@marinoscar/platform-cli 0.1.0-next.16 → 0.1.0-next.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/README.md +32 -3
- package/dist/engine/create-cli.d.ts +10 -1
- package/dist/engine/create-cli.d.ts.map +1 -1
- package/dist/engine/create-cli.js +5 -1
- package/dist/engine/create-cli.js.map +1 -1
- package/dist/engine/github-raw-manifest.d.ts +59 -0
- package/dist/engine/github-raw-manifest.d.ts.map +1 -0
- package/dist/engine/github-raw-manifest.js +197 -0
- package/dist/engine/github-raw-manifest.js.map +1 -0
- package/dist/engine/identity.d.ts +5 -5
- package/dist/engine/identity.d.ts.map +1 -1
- package/dist/engine/identity.js +4 -4
- package/dist/engine/identity.js.map +1 -1
- package/dist/engine/index.d.ts +4 -0
- package/dist/engine/index.d.ts.map +1 -1
- package/dist/engine/index.js +3 -0
- package/dist/engine/index.js.map +1 -1
- package/dist/engine/program.d.ts +3 -0
- package/dist/engine/program.d.ts.map +1 -1
- package/dist/engine/program.js +16 -0
- package/dist/engine/program.js.map +1 -1
- package/dist/engine/registries.d.ts.map +1 -1
- package/dist/engine/registries.js +2 -0
- package/dist/engine/registries.js.map +1 -1
- package/dist/engine/semver.d.ts +31 -0
- package/dist/engine/semver.d.ts.map +1 -0
- package/dist/engine/semver.js +100 -0
- package/dist/engine/semver.js.map +1 -0
- package/dist/engine/test-support.d.ts +1 -1
- package/dist/engine/test-support.js +1 -1
- package/dist/engine/update-notice-options.d.ts +70 -0
- package/dist/engine/update-notice-options.d.ts.map +1 -0
- package/dist/engine/update-notice-options.js +79 -0
- package/dist/engine/update-notice-options.js.map +1 -0
- package/dist/engine/update-notice.d.ts +69 -0
- package/dist/engine/update-notice.d.ts.map +1 -0
- package/dist/engine/update-notice.js +204 -0
- package/dist/engine/update-notice.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# @marinoscar/platform-cli
|
|
2
2
|
|
|
3
|
+
## 0.1.0-next.18
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- bca937b: Example names in doc comments, README examples and schema examples are replaced with invented placeholders (Org Kappa, Org Sigma, Org Theta and similar) instead of well-known fictional brands. No behaviour change.
|
|
8
|
+
- Updated dependencies [1687d34]
|
|
9
|
+
- Updated dependencies [bca937b]
|
|
10
|
+
- @marinoscar/platform-contract@0.1.0-next.18
|
|
11
|
+
- @marinoscar/platform-infra@0.1.0-next.18
|
|
12
|
+
|
|
13
|
+
## 0.1.0-next.17
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- 331eee4: The CLI can tell the operator a newer version exists. `createCli({ updateNotice: { latestVersion, upgradeHint, intervalMs?, timeoutMs? } })` (type `UpdateNoticeOptions`, experimental) checks when the CLI starts and, when the newest version is semver-greater than the running one, writes one line to stderr after the command's output: `<cli> <latest> is available (you have <current>). Update: <upgradeHint>`. Operators ran an old app CLI on servers without knowing a newer one had fixed the failure in front of them.
|
|
18
|
+
|
|
19
|
+
Unset means off: an app that does not pass the option makes no request and is unchanged. The check starts in parallel with the command and is never awaited before it; at the end the CLI waits only for what remains of `timeoutMs` (default 1500 ms from the start). At most one network check per `intervalMs` (default 24 hours), cached in `~/.<cli>/update-check.json` (`{ checkedAt, latest }`, written atomically with mode 0600; a missing or corrupt file is a new check; a failed check is recorded with the last known version, so an offline server does not retry on every command). Failure, timeout, a throwing or hanging `latestVersion` and any version that is not strict semver 2.0.0 (prereleases ordered by the spec) are silent, and the exit code and stdout never change. The interactive menu shows the line once, when it exits.
|
|
20
|
+
|
|
21
|
+
Never shown: when `CI` is set, when stderr is not a terminal, for `--json`, `--version`/`-v`, `--help`/`-h` and `help`, for the worker daemon `node start`, or when `<PREFIX>_NO_UPDATE_CHECK=1` is set (`APPCTL_NO_UPDATE_CHECK`, the prefix from the CLI identity). `createCli` validates the option (a `latestVersion` function, a non-empty single-line `upgradeHint`, a non-negative `intervalMs`, a positive `timeoutMs`) and throws a `UsageError` otherwise. `RunOptions` gains `updateCheck` (environment, home directory, stderr and clock) as a test seam.
|
|
22
|
+
|
|
23
|
+
New helper `githubRawManifest({ repo, ref = 'main', path, timeoutMs = 1500, fetch? })` builds a `latestVersion` that reads `version` from `https://raw.githubusercontent.com/<repo>/<ref>/<path>`: HTTPS only, no credentials, no redirects, the body capped at 256 KiB, only a valid semver `version` accepted, everything else `undefined`; `repo` must be `owner/name` and `ref` / `path` plain relative paths (a `UsageError` when it is built). `latestVersion` receives an `AbortSignal` that `createCli` aborts at the deadline. Docs: the CLI README (options table, a section and the extension-point catalog), `docs/EXTENDING.md` and the reference app's example `coach.update-notice.ts` (not wired).
|
|
24
|
+
|
|
25
|
+
- @marinoscar/platform-contract@0.1.0-next.17
|
|
26
|
+
- @marinoscar/platform-infra@0.1.0-next.17
|
|
27
|
+
|
|
3
28
|
## 0.1.0-next.16
|
|
4
29
|
|
|
5
30
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -77,7 +77,7 @@ void main();
|
|
|
77
77
|
|
|
78
78
|
| Option | Type | Default | Meaning |
|
|
79
79
|
|---|---|---|---|
|
|
80
|
-
| `identity` | `CliIdentity` | required | `name` (lowercase `[a-z0-9-]`, e.g. `appctl`), `displayName` (`
|
|
80
|
+
| `identity` | `CliIdentity` | required | `name` (lowercase `[a-z0-9-]`, e.g. `appctl`), `displayName` (`Kappa CLI`), `repoSlug` (`owner/repo`); optional `productName` (the systemd unit's Description; defaults to `displayName`), `configDirName` (defaults to `.<name>`), `envPrefix` (defaults to `toEnvPrefix(name)`, `APPCTL_`). Set once per process; a different second identity throws. |
|
|
81
81
|
| `version` | `string` | required | The app's own version (its `package.json`). |
|
|
82
82
|
| `extraCommands` | `CliCommandRegistration[]` | `[]` | Commands after the built-ins, in order. Same as `registerCliCommand`. |
|
|
83
83
|
| `tuiScreens` | `TuiScreenRegistration[]` | `[]` | Screens in the TUI menu. Same as `registerTuiScreen`. |
|
|
@@ -85,8 +85,36 @@ void main();
|
|
|
85
85
|
| `nodeExecutors` | `JobExecutor[]` | `[]` | Executors for the app's node-eligible job types. Same as `registerNodeExecutor`. |
|
|
86
86
|
| `envSpecFragments` | `EnvSpecFragment[]` | `[]` | Metadata for the app's `.env.example` keys. Same as `registerEnvSpecFragment`. |
|
|
87
87
|
| `deploy.versionedManifests` | `string[]` | the four of the reference layout | The manifests the deploy `version` step reads and writes: repository-relative POSIX paths ending in `package.json` (`apps/api/package.json`). **The first is the version source.** Only these manifests and their `package-lock.json` workspace entries change; an app whose CLI keeps its own version leaves `apps/cli/package.json` out. Validated at `createCli`: at least one, no `..`, no duplicates, no root manifest. |
|
|
88
|
+
| `updateNotice` | `{ latestVersion, upgradeHint, intervalMs?, timeoutMs? }` | unset (no check) | The [start-up update notice](#the-start-up-update-notice): `latestVersion(signal?)` returns the newest version or `undefined` (use `githubRawManifest({ repo, ref?, path })` to read a `package.json` on GitHub), `upgradeHint` is the text after `Update:` (one line, non-empty), `intervalMs` is the least time between network checks (default 24 hours), `timeoutMs` the longest the end of a command waits for the answer (default 1500). Validated at `createCli`. |
|
|
88
89
|
|
|
89
|
-
The options and the `register*` functions feed the same registries: string ids, a duplicate-id error, a deterministic order (built-ins first, then registration order), and frozen when `createCli` returns, so a late registration throws instead of going missing. A broken composition (a taken command name, TUI route, deploy step id, check id, env group or generator kind or executor type; a step anchored on an unknown step; an env key with two owners; an invalid stream path or edge-config path) throws at `createCli`. The newer options are `envGroups`, `envGenerators`, `envAnnotations`, `deployChecks`, `edgeConfigFiles`, `tuiSections`, `proxy: { streamPaths }
|
|
90
|
+
The options and the `register*` functions feed the same registries: string ids, a duplicate-id error, a deterministic order (built-ins first, then registration order), and frozen when `createCli` returns, so a late registration throws instead of going missing. A broken composition (a taken command name, TUI route, deploy step id, check id, env group or generator kind or executor type; a step anchored on an unknown step; an env key with two owners; an invalid stream path or edge-config path) throws at `createCli`. The newer options are `envGroups`, `envGenerators`, `envAnnotations`, `deployChecks`, `edgeConfigFiles`, `tuiSections`, `proxy: { streamPaths }`, `deploy: { versionedManifests }` and `updateNotice`. A bad `deploy.versionedManifests` (empty, a duplicate, `..`, an entry that does not end in `package.json`) or a bad `updateNotice` (no `latestVersion`, an empty or multi-line `upgradeHint`, a negative `intervalMs`, a non-positive `timeoutMs`) throws at `createCli` too.
|
|
91
|
+
|
|
92
|
+
### The start-up update notice
|
|
93
|
+
|
|
94
|
+
Operators run an old app CLI on a server without knowing a newer one exists. With `createCli({ updateNotice })` the CLI checks when it starts and, if the newest version is semver-greater than the running one, writes one line to stderr after the command's output:
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
appctl 1.11.0 is available (you have 1.10.7). Update: git pull && npm ci && npm run build
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
```ts
|
|
101
|
+
import { createCli, githubRawManifest } from '@marinoscar/platform-cli';
|
|
102
|
+
|
|
103
|
+
createCli({
|
|
104
|
+
...APP_CLI_OPTIONS,
|
|
105
|
+
updateNotice: {
|
|
106
|
+
latestVersion: githubRawManifest({ repo: 'owner/name', ref: 'main', path: 'apps/cli/package.json' }),
|
|
107
|
+
upgradeHint: 'git pull && npm ci && npm run build',
|
|
108
|
+
},
|
|
109
|
+
});
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
- **Unset means off.** An app that does not pass `updateNotice` makes no request, reads no file and prints nothing.
|
|
113
|
+
- **At most one network check per `intervalMs` (24 hours).** The answer is cached in `~/.<name>/update-check.json` (`{ "checkedAt": "<ISO time>", "latest": "<version>" }`, written atomically with mode 0600; a missing or corrupt file just means a new check). A failed check is recorded too, keeping the last known version, so an offline server does not retry on every command. Within the interval the notice comes from the cache, with no network.
|
|
114
|
+
- **Never in the command's way.** The check starts before the command and runs beside it. After the command, the CLI waits for what remains of `timeoutMs` (counted from the start, so a command longer than that waits for nothing), then stores the answer. Failure, timeout, a throwing or hanging `latestVersion` and a version that is not valid semver are silent. The exit code and stdout never change, and only the one stderr line is written. The interactive menu shows the line when it exits, after the terminal is restored.
|
|
115
|
+
- **Never shown** when `CI` (or `CONTINUOUS_INTEGRATION`) is set; when stderr is not a terminal; for `--json`, `--version`/`-v`, `--help`/`-h` and `help`; for the worker daemon `node start` (every form: `--headless`, `--daemon`, the systemd unit); or when the operator sets `<PREFIX>_NO_UPDATE_CHECK=1` (`APPCTL_NO_UPDATE_CHECK`; the prefix is the CLI identity's `envPrefix`). The other `node` commands and `deploy` check normally.
|
|
116
|
+
- **`githubRawManifest({ repo, ref = 'main', path, timeoutMs = 1500 })`** reads `https://raw.githubusercontent.com/<repo>/<ref>/<path>`: HTTPS only, no credentials (a private repository answers 404 and stays silent), no redirects, a body capped at 256 KiB, and only a valid semver `version` accepted. It never throws at run time; `repo` must be `owner/name` and `ref`/`path` plain relative paths, or it throws a `UsageError` when it is built. Any other source is a function returning the version.
|
|
117
|
+
- **The latest version is proven before it is printed**: the network value and the cache file are both parsed as strict semver 2.0.0 (prereleases order correctly: `1.2.3` is newer than `1.2.3-rc.1`, not the reverse).
|
|
90
118
|
|
|
91
119
|
## Extension-point catalog
|
|
92
120
|
|
|
@@ -96,6 +124,7 @@ The extension ladder and a recipe per extension: [docs/EXTENDING.md](../../docs/
|
|
|
96
124
|
|---|---|---|---|---|---|
|
|
97
125
|
| `CreateCliOptions` | option | `createCli(options: CreateCliOptions): CliInstance` | Build the app's CLI: its identity and version, plus its commands, TUI screens, deploy steps, node executors and env-spec fragments | experimental | [example](../../apps/cli/src/app.ts) |
|
|
98
126
|
| `CreateCliDeployOptions` | option | `createCli({ deploy: { versionedManifests?: readonly string[] } })` | Choose the workspace manifests the deploy `version` step writes (default `apps/api`, `apps/web`, `apps/cli`, `packages/shared`); an app whose CLI keeps its own version leaves `apps/cli` out. The first entry is the version source | experimental | [example](../../apps/cli/src/examples/coach.versioned-manifests.ts) |
|
|
127
|
+
| `UpdateNoticeOptions` | option | `createCli({ updateNotice?: { latestVersion: (signal?: AbortSignal) => Promise<string \| undefined>; upgradeHint: string; intervalMs?: number; timeoutMs?: number } })` | Tell the operator, with one stderr line after the command, that a newer version of the CLI exists (cached for 24 hours, silent on any failure, never in CI or for `--json` / `--version` / the worker daemon). Read the version from a GitHub manifest with `githubRawManifest` | experimental | [example](../../apps/cli/src/examples/coach.update-notice.ts) |
|
|
99
128
|
|
|
100
129
|
The registries are catalogued by the entry point that exports them, each with a compiled, tested example in the reference app:
|
|
101
130
|
|
|
@@ -128,7 +157,7 @@ None of its own. Every command acts with the permissions of the token `login` st
|
|
|
128
157
|
|
|
129
158
|
## UI
|
|
130
159
|
|
|
131
|
-
None in the web app. In a terminal: the ink TUI (`menu`, `login`, `invoke`, `status`, `node`, `deploy`, `logout`, plus the app's registered screens), opened only by a bare invocation in a real terminal (`<NAME>_NO_TUI` disables it).
|
|
160
|
+
None in the web app. In a terminal: the ink TUI (`menu`, `login`, `invoke`, `status`, `node`, `deploy`, `logout`, plus the app's registered screens), opened only by a bare invocation in a real terminal (`<NAME>_NO_TUI` disables it). `<NAME>_NO_UPDATE_CHECK=1` turns the [update notice](#the-start-up-update-notice) off.
|
|
132
161
|
|
|
133
162
|
## Infra
|
|
134
163
|
|
|
@@ -9,6 +9,7 @@ import type { JobExecutor } from './node/executors/index.js';
|
|
|
9
9
|
import { type RunOptions } from './program.js';
|
|
10
10
|
import { type TuiScreenRegistration } from './tui/screen-registry.js';
|
|
11
11
|
import { type TuiSectionRegistration } from './tui/section-registry.js';
|
|
12
|
+
import { type UpdateNoticeOptions } from './update-notice-options.js';
|
|
12
13
|
/**
|
|
13
14
|
* The app's view of the VPS host proxy, for {@link CreateCliOptions}.
|
|
14
15
|
*
|
|
@@ -101,6 +102,12 @@ export interface CreateCliOptions {
|
|
|
101
102
|
* the version step writes.
|
|
102
103
|
*/
|
|
103
104
|
deploy?: CreateCliDeployOptions | undefined;
|
|
105
|
+
/**
|
|
106
|
+
* The start-up update notice: when a newer version of this CLI exists, one
|
|
107
|
+
* line on stderr after the command's output. Unset means no check. See
|
|
108
|
+
* {@link UpdateNoticeOptions} and `githubRawManifest`.
|
|
109
|
+
*/
|
|
110
|
+
updateNotice?: UpdateNoticeOptions | undefined;
|
|
104
111
|
}
|
|
105
112
|
/**
|
|
106
113
|
* What {@link createCli} returns.
|
|
@@ -124,7 +131,9 @@ export interface CliInstance {
|
|
|
124
131
|
* @returns The program and its `run`.
|
|
125
132
|
* @throws Error when the identity is invalid or a different one is already
|
|
126
133
|
* set, when `deploy.versionedManifests` is empty, not a list of relative
|
|
127
|
-
* `package.json` paths, or has a duplicate, when
|
|
134
|
+
* `package.json` paths, or has a duplicate, when `updateNotice` has no
|
|
135
|
+
* `latestVersion` function, an empty or multi-line `upgradeHint`, or a bad
|
|
136
|
+
* `intervalMs` / `timeoutMs`, when an app command's name, TUI route, deploy step id or executor
|
|
128
137
|
* type is taken (or a step's `after` names no step), when an env key gets
|
|
129
138
|
* two owners, or when it registers anything after an earlier `createCli`
|
|
130
139
|
* froze the registries.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-cli.d.ts","sourceRoot":"","sources":["../../src/engine/create-cli.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,EAML,KAAK,sBAAsB,EAC3B,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACrB,MAAM,kBAAkB,CAAC;AAI1B,OAAO,EAA0B,KAAK,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACtF,OAAO,EAAuB,KAAK,WAAW,EAAE,MAAM,6BAA6B,CAAC;AACpF,OAAO,EAA2B,KAAK,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AACtG,OAAO,EAAsB,KAAK,sBAAsB,EA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B,CAAC,CAAC,GAAG,SAAS,CAAC;IACxE,+HAA+H;IAC/H,SAAS,CAAC,EAAE,SAAS,oBAAoB,EAAE,GAAG,SAAS,CAAC;IACxD;;;;OAIG;IACH,KAAK,CAAC,EAAE,qBAAqB,GAAG,SAAS,CAAC;IAC1C;;;;OAIG;IACH,MAAM,CAAC,EAAE,sBAAsB,GAAG,SAAS,CAAC;IAC5C;;;;OAIG;IACH,YAAY,CAAC,EAAE,mBAAmB,GAAG,SAAS,CAAC;CAChD;AAED;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,iGAAiG;IACjG,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B;;;;OAIG;IACH,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,UAAU,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAC/D;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,gBAAgB,GAAG,WAAW,CA4BhE"}
|
|
@@ -11,6 +11,7 @@ import { buildProgram, run } from './program.js';
|
|
|
11
11
|
import { freezeCliRegistries } from './registries.js';
|
|
12
12
|
import { registerTuiScreen } from './tui/screen-registry.js';
|
|
13
13
|
import { registerTuiScreenSection } from './tui/section-registry.js';
|
|
14
|
+
import { setUpdateNotice } from './update-notice-options.js';
|
|
14
15
|
/**
|
|
15
16
|
* Builds the CLI from the app's identity and additions plus the registries.
|
|
16
17
|
*
|
|
@@ -18,7 +19,9 @@ import { registerTuiScreenSection } from './tui/section-registry.js';
|
|
|
18
19
|
* @returns The program and its `run`.
|
|
19
20
|
* @throws Error when the identity is invalid or a different one is already
|
|
20
21
|
* set, when `deploy.versionedManifests` is empty, not a list of relative
|
|
21
|
-
* `package.json` paths, or has a duplicate, when
|
|
22
|
+
* `package.json` paths, or has a duplicate, when `updateNotice` has no
|
|
23
|
+
* `latestVersion` function, an empty or multi-line `upgradeHint`, or a bad
|
|
24
|
+
* `intervalMs` / `timeoutMs`, when an app command's name, TUI route, deploy step id or executor
|
|
22
25
|
* type is taken (or a step's `after` names no step), when an env key gets
|
|
23
26
|
* two owners, or when it registers anything after an earlier `createCli`
|
|
24
27
|
* froze the registries.
|
|
@@ -29,6 +32,7 @@ export function createCli(options) {
|
|
|
29
32
|
// Validated first of the additions: a bad list throws here, before anything
|
|
30
33
|
// is registered, and the default is restored when the app sets none.
|
|
31
34
|
setVersionedManifests(options.deploy?.versionedManifests);
|
|
35
|
+
setUpdateNotice(options.updateNotice);
|
|
32
36
|
ensurePlatformRegistrations();
|
|
33
37
|
for (const generator of options.envGenerators ?? [])
|
|
34
38
|
registerEnvGenerator(generator);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-cli.js","sourceRoot":"","sources":["../../src/engine/create-cli.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EAChB,uBAAuB,GAMxB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAuB,MAAM,yBAAyB,CAAC;AACtF,OAAO,EAAE,mBAAmB,EAAoB,MAAM,6BAA6B,CAAC;AACpF,OAAO,EAAE,uBAAuB,EAAoC,MAAM,2BAA2B,CAAC;AACtG,OAAO,EAAE,kBAAkB,EAA+B,MAAM,4BAA4B,CAAC;AAC7F,OAAO,EAAE,cAAc,EAAoB,MAAM,eAAe,CAAC;AAEjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,GAAG,EAAmB,MAAM,cAAc,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAA8B,MAAM,0BAA0B,CAAC;AACz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CAAC;IACvE,KAAK,MAAM,QAAQ,IAAI,OAAO,CAAC,aAAa,IAAI,EAAE;QAAE,oBAAoB,CAAC,QAAQ,CAAC,CAAC;IACnF,KAAK,MAAM,IAAI,IAAI,OAAO,CAAC,KAAK,EAAE,WAAW,IAAI,EAAE;QAAE,uBAAuB,CAAC,IAAI,CAAC,CAAC;IAEnF,MAAM,OAAO,GAAG,YAAY,EAAE,CAAC;IAC/B,mBAAmB,CAAC,yBAAyB,CAAC,CAAC;IAC/C,OAAO;QACL,OAAO;QACP,GAAG,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,UAAU,CAAC;KACjD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/** The largest response body read, in bytes. A package.json is a few KiB. */
|
|
2
|
+
export declare const MAX_MANIFEST_BYTES: number;
|
|
3
|
+
/** Default time allowed for the request and the body, in milliseconds. */
|
|
4
|
+
export declare const DEFAULT_MANIFEST_TIMEOUT_MS = 1500;
|
|
5
|
+
/**
|
|
6
|
+
* Options of {@link githubRawManifest}.
|
|
7
|
+
*
|
|
8
|
+
* @stability experimental
|
|
9
|
+
*/
|
|
10
|
+
export interface GithubRawManifestOptions {
|
|
11
|
+
/** The repository, `owner/name`. */
|
|
12
|
+
repo: string;
|
|
13
|
+
/** The branch, tag or commit to read. Default `main`. A branch with slashes (`release/1.x`) is allowed. */
|
|
14
|
+
ref?: string | undefined;
|
|
15
|
+
/** The manifest's path in the repository, e.g. `apps/cli/package.json`. */
|
|
16
|
+
path: string;
|
|
17
|
+
/** Time allowed for the request and the body. Default 1500 ms. */
|
|
18
|
+
timeoutMs?: number | undefined;
|
|
19
|
+
/** Replaces the global `fetch` (Node 18+). A seam for tests; the default is the real one. */
|
|
20
|
+
fetch?: typeof fetch | undefined;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The URL a manifest is read from, after validating every part.
|
|
24
|
+
*
|
|
25
|
+
* @throws UsageError when `repo` is not `owner/name`, or `ref` / `path` is not a plain relative path.
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
28
|
+
export declare function githubRawManifestUrl(options: Pick<GithubRawManifestOptions, 'repo' | 'ref' | 'path'>): string;
|
|
29
|
+
/**
|
|
30
|
+
* Builds the `latestVersion` function of `createCli({ updateNotice })` that
|
|
31
|
+
* reads `version` from a JSON manifest in a GitHub repository:
|
|
32
|
+
* `https://raw.githubusercontent.com/<repo>/<ref>/<path>`.
|
|
33
|
+
*
|
|
34
|
+
* The returned function resolves the manifest's `version` when it is a valid
|
|
35
|
+
* semver string, and `undefined` for everything else (offline, timeout, a
|
|
36
|
+
* non-200 status, an oversized or malformed body, a missing or invalid
|
|
37
|
+
* version). It never rejects. It sends no credentials, follows no redirect and
|
|
38
|
+
* reads at most 256 KiB. See the file header for the reasons.
|
|
39
|
+
*
|
|
40
|
+
* @param options - The repository, ref, path, timeout and the `fetch` seam.
|
|
41
|
+
* @returns A `latestVersion` function; it takes an optional `AbortSignal` that
|
|
42
|
+
* `createCli` aborts at the update-check deadline.
|
|
43
|
+
* @throws UsageError when `repo` is not `owner/name`, or `ref` or `path` is not
|
|
44
|
+
* a plain relative path (no `..`, no empty segment, no space or `%`), or
|
|
45
|
+
* `timeoutMs` is not a positive number.
|
|
46
|
+
* @example
|
|
47
|
+
* ```ts
|
|
48
|
+
* createCli({
|
|
49
|
+
* ...APP_CLI_OPTIONS,
|
|
50
|
+
* updateNotice: {
|
|
51
|
+
* latestVersion: githubRawManifest({ repo: 'kappa/coach', path: 'apps/cli/package.json' }),
|
|
52
|
+
* upgradeHint: 'git pull && npm ci && npm run build',
|
|
53
|
+
* },
|
|
54
|
+
* });
|
|
55
|
+
* ```
|
|
56
|
+
* @stability experimental
|
|
57
|
+
*/
|
|
58
|
+
export declare function githubRawManifest(options: GithubRawManifestOptions): (signal?: AbortSignal) => Promise<string | undefined>;
|
|
59
|
+
//# sourceMappingURL=github-raw-manifest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github-raw-manifest.d.ts","sourceRoot":"","sources":["../../src/engine/github-raw-manifest.ts"],"names":[],"mappings":"AA+BA,6EAA6E;AAC7E,eAAO,MAAM,kBAAkB,QAAa,CAAC;AAE7C,0EAA0E;AAC1E,eAAO,MAAM,2BAA2B,OAAO,CAAC;AAUhD;;;;GAIG;AACH,MAAM,WAAW,wBAAwB;IACvC,oCAAoC;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,2GAA2G;IAC3G,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,2EAA2E;IAC3E,IAAI,EAAE,MAAM,CAAC;IACb,kEAAkE;IAClE,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,6FAA6F;IAC7F,KAAK,CAAC,EAAE,OAAO,KAAK,GAAG,SAAS,CAAC;CAClC;AAaD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,IAAI,CAAC,wBAAwB,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM,CAAC,GAAG,MAAM,CAgB7G;AA8CD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,CAAC,MAAM,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAoD1H"}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { UsageError } from './errors.js';
|
|
2
|
+
import { parseSemver } from './semver.js';
|
|
3
|
+
// =============================================================================
|
|
4
|
+
// githubRawManifest: where the newest version is read from (issue #1033)
|
|
5
|
+
// =============================================================================
|
|
6
|
+
//
|
|
7
|
+
// The common source of "what is the newest CLI" is the `version` field of a
|
|
8
|
+
// `package.json` on the app's default branch. `githubRawManifest` builds the
|
|
9
|
+
// `latestVersion` function of `createCli({ updateNotice })` for that.
|
|
10
|
+
//
|
|
11
|
+
// WHAT IT WILL AND WILL NOT DO, each with the reason:
|
|
12
|
+
// - HTTPS to `raw.githubusercontent.com` only. The host and scheme are
|
|
13
|
+
// constants; no input chooses them.
|
|
14
|
+
// - NO CREDENTIALS. No `Authorization`, no cookie, no token from the CLI's
|
|
15
|
+
// config. A private repository answers 404 and the check stays silent:
|
|
16
|
+
// sending the operator's token to a third-party host from a convenience
|
|
17
|
+
// feature is not a trade this makes.
|
|
18
|
+
// - NO REDIRECTS. `redirect: 'error'`, so a response can never move the
|
|
19
|
+
// request to another host or to plain http.
|
|
20
|
+
// - THE BODY IS CAPPED (256 KiB) while it is read, not after: a hostile or
|
|
21
|
+
// broken endpoint cannot make a CLI start-up buffer megabytes.
|
|
22
|
+
// - ONLY A VALID SEMVER `version` IS ACCEPTED. Anything else (bad JSON, a
|
|
23
|
+
// missing or non-string version, `v1.2.3`, a version with control
|
|
24
|
+
// characters) is `undefined`, because the value is printed on a terminal.
|
|
25
|
+
// - IT NEVER THROWS. Offline, DNS failure, timeout, 404, 5xx, oversize and
|
|
26
|
+
// garbage are all `undefined`; the notice is a convenience, not a gate.
|
|
27
|
+
// - IT HONOURS THE CALLER'S SIGNAL AND ITS OWN TIMEOUT, and also stops
|
|
28
|
+
// waiting at the deadline when a `fetch` replacement ignores both.
|
|
29
|
+
// =============================================================================
|
|
30
|
+
/** The largest response body read, in bytes. A package.json is a few KiB. */
|
|
31
|
+
export const MAX_MANIFEST_BYTES = 256 * 1024;
|
|
32
|
+
/** Default time allowed for the request and the body, in milliseconds. */
|
|
33
|
+
export const DEFAULT_MANIFEST_TIMEOUT_MS = 1500;
|
|
34
|
+
const RAW_HOST = 'https://raw.githubusercontent.com';
|
|
35
|
+
/** GitHub's own limits: an owner is alphanumeric and hyphens; a repository adds `.` and `_`. */
|
|
36
|
+
const OWNER = /^[A-Za-z0-9](?:[A-Za-z0-9-]{0,38})$/;
|
|
37
|
+
const REPO_NAME = /^[A-Za-z0-9._-]{1,100}$/;
|
|
38
|
+
/** A ref or path segment: plain characters, no separators, no space, no `%`. */
|
|
39
|
+
const SEGMENT = /^[A-Za-z0-9._@+-]+$/;
|
|
40
|
+
function assertSegments(label, value, what) {
|
|
41
|
+
const segments = value.split('/');
|
|
42
|
+
if (value === '' ||
|
|
43
|
+
value.startsWith('/') ||
|
|
44
|
+
segments.some((segment) => segment === '' || segment === '.' || segment === '..' || !SEGMENT.test(segment))) {
|
|
45
|
+
throw new UsageError(`githubRawManifest ${label} ${JSON.stringify(value)} is not ${what}.`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* The URL a manifest is read from, after validating every part.
|
|
50
|
+
*
|
|
51
|
+
* @throws UsageError when `repo` is not `owner/name`, or `ref` / `path` is not a plain relative path.
|
|
52
|
+
* @internal
|
|
53
|
+
*/
|
|
54
|
+
export function githubRawManifestUrl(options) {
|
|
55
|
+
const repo = options.repo;
|
|
56
|
+
const parts = typeof repo === 'string' ? repo.split('/') : [];
|
|
57
|
+
if (parts.length !== 2 ||
|
|
58
|
+
!OWNER.test(parts[0]) ||
|
|
59
|
+
!REPO_NAME.test(parts[1]) ||
|
|
60
|
+
parts[1] === '.' ||
|
|
61
|
+
parts[1] === '..') {
|
|
62
|
+
throw new UsageError(`githubRawManifest repo ${JSON.stringify(repo)} is not "owner/name".`);
|
|
63
|
+
}
|
|
64
|
+
const ref = options.ref ?? 'main';
|
|
65
|
+
assertSegments('ref', ref, 'a branch, tag or commit name');
|
|
66
|
+
assertSegments('path', options.path, 'a plain relative path such as "apps/cli/package.json"');
|
|
67
|
+
return `${RAW_HOST}/${parts[0]}/${parts[1]}/${ref}/${options.path}`;
|
|
68
|
+
}
|
|
69
|
+
/** Reads at most `MAX_MANIFEST_BYTES` of the body; `undefined` when it is larger or unreadable. */
|
|
70
|
+
async function readCappedText(response) {
|
|
71
|
+
const declared = Number(response.headers.get('content-length'));
|
|
72
|
+
if (Number.isFinite(declared) && declared > MAX_MANIFEST_BYTES) {
|
|
73
|
+
await response.body?.cancel().catch(() => undefined);
|
|
74
|
+
return undefined;
|
|
75
|
+
}
|
|
76
|
+
const body = response.body;
|
|
77
|
+
if (body === null)
|
|
78
|
+
return undefined;
|
|
79
|
+
const reader = body.getReader();
|
|
80
|
+
const chunks = [];
|
|
81
|
+
let total = 0;
|
|
82
|
+
for (;;) {
|
|
83
|
+
const { done, value } = await reader.read();
|
|
84
|
+
if (done)
|
|
85
|
+
break;
|
|
86
|
+
total += value.byteLength;
|
|
87
|
+
if (total > MAX_MANIFEST_BYTES) {
|
|
88
|
+
await reader.cancel().catch(() => undefined);
|
|
89
|
+
return undefined;
|
|
90
|
+
}
|
|
91
|
+
chunks.push(value);
|
|
92
|
+
}
|
|
93
|
+
const bytes = new Uint8Array(total);
|
|
94
|
+
let offset = 0;
|
|
95
|
+
for (const chunk of chunks) {
|
|
96
|
+
bytes.set(chunk, offset);
|
|
97
|
+
offset += chunk.byteLength;
|
|
98
|
+
}
|
|
99
|
+
return new TextDecoder('utf-8', { fatal: false }).decode(bytes);
|
|
100
|
+
}
|
|
101
|
+
/** The `version` of a manifest's JSON text, only when it is a valid semver string. */
|
|
102
|
+
function versionOf(text) {
|
|
103
|
+
let parsed;
|
|
104
|
+
try {
|
|
105
|
+
parsed = JSON.parse(text);
|
|
106
|
+
}
|
|
107
|
+
catch {
|
|
108
|
+
return undefined;
|
|
109
|
+
}
|
|
110
|
+
if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed))
|
|
111
|
+
return undefined;
|
|
112
|
+
const version = parsed.version;
|
|
113
|
+
return parseSemver(version) === undefined ? undefined : version;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Builds the `latestVersion` function of `createCli({ updateNotice })` that
|
|
117
|
+
* reads `version` from a JSON manifest in a GitHub repository:
|
|
118
|
+
* `https://raw.githubusercontent.com/<repo>/<ref>/<path>`.
|
|
119
|
+
*
|
|
120
|
+
* The returned function resolves the manifest's `version` when it is a valid
|
|
121
|
+
* semver string, and `undefined` for everything else (offline, timeout, a
|
|
122
|
+
* non-200 status, an oversized or malformed body, a missing or invalid
|
|
123
|
+
* version). It never rejects. It sends no credentials, follows no redirect and
|
|
124
|
+
* reads at most 256 KiB. See the file header for the reasons.
|
|
125
|
+
*
|
|
126
|
+
* @param options - The repository, ref, path, timeout and the `fetch` seam.
|
|
127
|
+
* @returns A `latestVersion` function; it takes an optional `AbortSignal` that
|
|
128
|
+
* `createCli` aborts at the update-check deadline.
|
|
129
|
+
* @throws UsageError when `repo` is not `owner/name`, or `ref` or `path` is not
|
|
130
|
+
* a plain relative path (no `..`, no empty segment, no space or `%`), or
|
|
131
|
+
* `timeoutMs` is not a positive number.
|
|
132
|
+
* @example
|
|
133
|
+
* ```ts
|
|
134
|
+
* createCli({
|
|
135
|
+
* ...APP_CLI_OPTIONS,
|
|
136
|
+
* updateNotice: {
|
|
137
|
+
* latestVersion: githubRawManifest({ repo: 'kappa/coach', path: 'apps/cli/package.json' }),
|
|
138
|
+
* upgradeHint: 'git pull && npm ci && npm run build',
|
|
139
|
+
* },
|
|
140
|
+
* });
|
|
141
|
+
* ```
|
|
142
|
+
* @stability experimental
|
|
143
|
+
*/
|
|
144
|
+
export function githubRawManifest(options) {
|
|
145
|
+
const url = githubRawManifestUrl(options);
|
|
146
|
+
const timeoutMs = options.timeoutMs ?? DEFAULT_MANIFEST_TIMEOUT_MS;
|
|
147
|
+
if (typeof timeoutMs !== 'number' || !Number.isFinite(timeoutMs) || timeoutMs <= 0) {
|
|
148
|
+
throw new UsageError('githubRawManifest timeoutMs must be a positive number of milliseconds.');
|
|
149
|
+
}
|
|
150
|
+
return async (signal) => {
|
|
151
|
+
const controller = new AbortController();
|
|
152
|
+
let timer;
|
|
153
|
+
const onCallerAbort = () => controller.abort();
|
|
154
|
+
try {
|
|
155
|
+
if (signal?.aborted === true)
|
|
156
|
+
return undefined;
|
|
157
|
+
signal?.addEventListener('abort', onCallerAbort, { once: true });
|
|
158
|
+
// Resolves `undefined` at the deadline or on abort, so a `fetch`
|
|
159
|
+
// replacement that ignores the signal cannot hold this function open.
|
|
160
|
+
const stopped = new Promise((resolve) => {
|
|
161
|
+
timer = setTimeout(() => {
|
|
162
|
+
controller.abort();
|
|
163
|
+
resolve(undefined);
|
|
164
|
+
}, timeoutMs);
|
|
165
|
+
controller.signal.addEventListener('abort', () => resolve(undefined), { once: true });
|
|
166
|
+
});
|
|
167
|
+
const work = (async () => {
|
|
168
|
+
const doFetch = options.fetch ?? globalThis.fetch;
|
|
169
|
+
const response = await doFetch(url, {
|
|
170
|
+
method: 'GET',
|
|
171
|
+
redirect: 'error',
|
|
172
|
+
credentials: 'omit',
|
|
173
|
+
headers: { accept: 'application/json, text/plain;q=0.9' },
|
|
174
|
+
signal: controller.signal,
|
|
175
|
+
});
|
|
176
|
+
if (response.status !== 200) {
|
|
177
|
+
await response.body?.cancel().catch(() => undefined);
|
|
178
|
+
return undefined;
|
|
179
|
+
}
|
|
180
|
+
const text = await readCappedText(response);
|
|
181
|
+
return text === undefined ? undefined : versionOf(text);
|
|
182
|
+
})();
|
|
183
|
+
// The losing branch must not become an unhandled rejection.
|
|
184
|
+
work.catch(() => undefined);
|
|
185
|
+
return await Promise.race([work, stopped]);
|
|
186
|
+
}
|
|
187
|
+
catch {
|
|
188
|
+
return undefined;
|
|
189
|
+
}
|
|
190
|
+
finally {
|
|
191
|
+
if (timer !== undefined)
|
|
192
|
+
clearTimeout(timer);
|
|
193
|
+
signal?.removeEventListener('abort', onCallerAbort);
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
//# sourceMappingURL=github-raw-manifest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github-raw-manifest.js","sourceRoot":"","sources":["../../src/engine/github-raw-manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,gFA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O,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;QAC7C,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,SAAS,CAAC;QACnB,CAAC;gBAAS,CAAC;YACT,IAAI,KAAK,KAAK,SAAS;gBAAE,YAAY,CAAC,KAAK,CAAC,CAAC;YAC7C,MAAM,EAAE,mBAAmB,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;QACtD,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -10,10 +10,10 @@ export interface CliIdentity {
|
|
|
10
10
|
* a letter: it becomes a dotfile directory and an env-var prefix.
|
|
11
11
|
*/
|
|
12
12
|
name: string;
|
|
13
|
-
/** Human name for banners and `--help`, e.g. `
|
|
13
|
+
/** Human name for banners and `--help`, e.g. `Kappa CLI`. */
|
|
14
14
|
displayName: string;
|
|
15
15
|
/**
|
|
16
|
-
* The product's own name, e.g. `
|
|
16
|
+
* The product's own name, e.g. `Org Kappa` (the systemd unit's Description).
|
|
17
17
|
* Defaults to `displayName`.
|
|
18
18
|
*/
|
|
19
19
|
productName?: string | undefined;
|
|
@@ -57,8 +57,8 @@ export interface ResolvedCliIdentity {
|
|
|
57
57
|
export declare const API_PATH_PREFIX = "/api";
|
|
58
58
|
/**
|
|
59
59
|
* Turns a CLI name into a legal environment-variable prefix: `appctl` to
|
|
60
|
-
* `APPCTL_`, `
|
|
61
|
-
* identifier (`export
|
|
60
|
+
* `APPCTL_`, `kappa-cli` to `KAPPA_CLI_`. A hyphen is illegal in a shell
|
|
61
|
+
* identifier (`export KAPPA-CLI_TOKEN=x` is a syntax error), and so is a
|
|
62
62
|
* leading digit.
|
|
63
63
|
*
|
|
64
64
|
* @param name - A CLI name.
|
|
@@ -115,7 +115,7 @@ export declare function hasCliIdentity(): boolean;
|
|
|
115
115
|
*/
|
|
116
116
|
export declare function cliName(): string;
|
|
117
117
|
/**
|
|
118
|
-
* The human name for banners, e.g. `
|
|
118
|
+
* The human name for banners, e.g. `Kappa CLI`.
|
|
119
119
|
*
|
|
120
120
|
* @returns `cliIdentity().displayName`.
|
|
121
121
|
* @stability experimental
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../src/engine/identity.ts"],"names":[],"mappings":"AA+BA;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,
|
|
1
|
+
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../src/engine/identity.ts"],"names":[],"mappings":"AA+BA;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,6DAA6D;IAC7D,WAAW,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,2EAA2E;IAC3E,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,8EAA8E;IAC9E,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,2BAA2B;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,2CAA2C;IAC3C,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,8BAA8B;IAC9B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,0DAA0D;IAC1D,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,wEAAwE;IACxE,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,0CAA0C;IAC1C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,oBAAoB;IACpB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;GAKG;AACH,eAAO,MAAM,eAAe,SAAS,CAAC;AAWtC;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGhD;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,WAAW,GAAG,mBAAmB,CAyB7E;AASD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAW3E;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,IAAI,mBAAmB,CAKjD;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,IAAI,OAAO,CAExC;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,IAAI,MAAM,CAEhC;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,IAAI,MAAM,CAElC;AAED;;;;;;;;;GASG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAE7C;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAEtC;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,IAAI,MAAM,CAEnC;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,WAAW,GAAG,SAAS,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,IAAI,CAS1G"}
|
package/dist/engine/identity.js
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
// 3. the environment-variable prefix, `<NAME>_`.
|
|
20
20
|
//
|
|
21
21
|
// If those three were three settings, a rename would leave a binary called
|
|
22
|
-
// `
|
|
22
|
+
// `kappactl` reading `~/.appctl/config.json` and answering to `APPCTL_TOKEN`,
|
|
23
23
|
// and nothing would fail.
|
|
24
24
|
//
|
|
25
25
|
// TWO STRINGS NEVER FOLLOW THE NAME. The deploy state file
|
|
@@ -44,8 +44,8 @@ const CONFIG_FILE_NAME = 'config.json';
|
|
|
44
44
|
const NAME_PATTERN = /^[a-z][a-z0-9-]*$/;
|
|
45
45
|
/**
|
|
46
46
|
* Turns a CLI name into a legal environment-variable prefix: `appctl` to
|
|
47
|
-
* `APPCTL_`, `
|
|
48
|
-
* identifier (`export
|
|
47
|
+
* `APPCTL_`, `kappa-cli` to `KAPPA_CLI_`. A hyphen is illegal in a shell
|
|
48
|
+
* identifier (`export KAPPA-CLI_TOKEN=x` is a syntax error), and so is a
|
|
49
49
|
* leading digit.
|
|
50
50
|
*
|
|
51
51
|
* @param name - A CLI name.
|
|
@@ -152,7 +152,7 @@ export function cliName() {
|
|
|
152
152
|
return cliIdentity().name;
|
|
153
153
|
}
|
|
154
154
|
/**
|
|
155
|
-
* The human name for banners, e.g. `
|
|
155
|
+
* The human name for banners, e.g. `Kappa CLI`.
|
|
156
156
|
*
|
|
157
157
|
* @returns `cliIdentity().displayName`.
|
|
158
158
|
* @stability experimental
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity.js","sourceRoot":"","sources":["../../src/engine/identity.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,gDAAgD;AAChD,gFAAgF;AAChF,EAAE;AACF,6EAA6E;AAC7E,yEAAyE;AACzE,8EAA8E;AAC9E,0EAA0E;AAC1E,yEAAyE;AACzE,4EAA4E;AAC5E,6EAA6E;AAC7E,qDAAqD;AACrD,EAAE;AACF,2EAA2E;AAC3E,4EAA4E;AAC5E,EAAE;AACF,oEAAoE;AACpE,2CAA2C;AAC3C,mDAAmD;AACnD,EAAE;AACF,2EAA2E;AAC3E,
|
|
1
|
+
{"version":3,"file":"identity.js","sourceRoot":"","sources":["../../src/engine/identity.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,gDAAgD;AAChD,gFAAgF;AAChF,EAAE;AACF,6EAA6E;AAC7E,yEAAyE;AACzE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AM,UAAU,UAAU;IACxB,OAAO,cAAc,IAAI,eAAe,CAAC;AAC3C,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,0BAA0B,CAAC,QAAiC,EAAE,OAAgB;IAC5F,MAAM,QAAQ,GAAG,OAAO,CAAC;IACzB,MAAM,eAAe,GAAG,cAAc,CAAC;IACvC,OAAO,GAAG,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IAC5E,cAAc,GAAG,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,OAAO,IAAI,eAAe,IAAI,YAAY,CAAC,CAAC;IACnG,OAAO,GAAG,EAAE;QACV,OAAO,GAAG,QAAQ,CAAC;QACnB,cAAc,GAAG,eAAe,CAAC;IACnC,CAAC,CAAC;AACJ,CAAC"}
|
package/dist/engine/index.d.ts
CHANGED
|
@@ -3,6 +3,10 @@ export type { CliIdentity, ResolvedCliIdentity } from './identity.js';
|
|
|
3
3
|
export { PLATFORM_CLI_VERSION } from './package-info.js';
|
|
4
4
|
export { createCli } from './create-cli.js';
|
|
5
5
|
export type { CliInstance, CreateCliDeployOptions, CreateCliOptions, CreateCliProxyOptions } from './create-cli.js';
|
|
6
|
+
export { githubRawManifest } from './github-raw-manifest.js';
|
|
7
|
+
export type { GithubRawManifestOptions } from './github-raw-manifest.js';
|
|
8
|
+
export type { UpdateCheckContext } from './update-notice.js';
|
|
9
|
+
export type { UpdateNoticeOptions } from './update-notice-options.js';
|
|
6
10
|
export { PLATFORM_ENV_FRAGMENT_ID, ensurePlatformRegistrations, resetPlatformRegistrationsForTests, } from './builtin-registrations.js';
|
|
7
11
|
export { ApiClient, DEFAULT_TIMEOUT_MS, buildUrl, resolveApiBaseUrl, unwrapEnvelope, } from './api-client.js';
|
|
8
12
|
export type { ApiClientOptions, ApiResponse, FetchLike, QueryValue, RequestOptions, } from './api-client.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/engine/index.ts"],"names":[],"mappings":"AAWA,OAAO,EACL,eAAe,EACf,cAAc,EACd,WAAW,EACX,OAAO,EACP,UAAU,EACV,aAAa,EACb,cAAc,EACd,SAAS,EACT,MAAM,EACN,cAAc,EACd,0BAA0B,EAC1B,kBAAkB,EAClB,cAAc,EACd,WAAW,GACZ,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAEzD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,YAAY,EAAE,WAAW,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/engine/index.ts"],"names":[],"mappings":"AAWA,OAAO,EACL,eAAe,EACf,cAAc,EACd,WAAW,EACX,OAAO,EACP,UAAU,EACV,aAAa,EACb,cAAc,EACd,SAAS,EACT,MAAM,EACN,cAAc,EACd,0BAA0B,EAC1B,kBAAkB,EAClB,cAAc,EACd,WAAW,GACZ,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAEzD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,YAAY,EAAE,WAAW,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAIpH,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,YAAY,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AACzE,YAAY,EAAE,kBAAkB,EAAE,M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