| 1 | import type { ProviderDriverKind } from "@t3tools/contracts"; |
| 2 | |
| 3 | export interface ProviderMaintenanceCapabilities { |
| 4 | readonly provider: ProviderDriverKind; |
| 5 | readonly packageName: string | null; |
| 6 | readonly update: ProviderMaintenanceCommandAction | null; |
| 7 | /** |
| 8 | * Latest version reported by the installer that owns the executable. |
| 9 | * `undefined` means the installer has no channel of its own and the npm |
| 10 | * registry entry for `packageName` is authoritative; `null` means the |
| 11 | * installer was asked and did not know. |
| 12 | */ |
| 13 | readonly latestVersion?: string | null; |
| 14 | /** Compare native release revisions when the provider does not use plain semver. */ |
| 15 | readonly compareVersions?: (current: string, latest: string) => number; |
| 16 | } |
| 17 | |
| 18 | export interface ProviderMaintenanceCommandAction { |
| 19 | readonly command: string; |
| 20 | readonly executable: string; |
| 21 | readonly args: ReadonlyArray<string>; |
| 22 | readonly lockKey: string; |
| 23 | /** |
| 24 | * Extra environment for the spawned updater, on top of the server's own. |
| 25 | * A native updater finds its install through the same variables the |
| 26 | * provider runs with (e.g. `CODEX_HOME`), so an instance with a custom home |
| 27 | * must update that home and not the default one. |
| 28 | */ |
| 29 | readonly env?: NodeJS.ProcessEnv; |
| 30 | } |