@antasphere/cli-core 0.4.0 → 0.5.0
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/README.md +206 -111
- package/dist/config.d.ts +52 -24
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +31 -9
- package/dist/config.js.map +1 -1
- package/dist/connect-on-demand.d.ts +60 -20
- package/dist/connect-on-demand.d.ts.map +1 -1
- package/dist/connect-on-demand.js +80 -43
- package/dist/connect-on-demand.js.map +1 -1
- package/dist/connect.d.ts +21 -6
- package/dist/connect.d.ts.map +1 -1
- package/dist/connect.js +17 -1
- package/dist/connect.js.map +1 -1
- package/dist/index.d.ts +15 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -10
- package/dist/index.js.map +1 -1
- package/dist/resolve.d.ts +125 -10
- package/dist/resolve.d.ts.map +1 -1
- package/dist/resolve.js +167 -8
- package/dist/resolve.js.map +1 -1
- package/package.json +2 -2
- package/src/config.ts +70 -25
- package/src/connect-on-demand.ts +140 -59
- package/src/connect.ts +27 -6
- package/src/index.ts +48 -13
- package/src/resolve.ts +234 -13
- package/dist/org.d.ts +0 -42
- package/dist/org.d.ts.map +0 -1
- package/dist/org.js +0 -39
- package/dist/org.js.map +0 -1
- package/src/org.ts +0 -73
package/README.md
CHANGED
|
@@ -1,14 +1,28 @@
|
|
|
1
1
|
# @antasphere/cli-core
|
|
2
2
|
|
|
3
3
|
The shared foundation every Antasphere tool CLI builds on. One config home for
|
|
4
|
-
the whole ecosystem, per-tool profile namespaces
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
the whole ecosystem, per-tool profile namespaces where a profile is an
|
|
5
|
+
instance, the flag → env → profile → cloud URL resolution order, the
|
|
6
|
+
per-command organization override, the instance email-OTP auth client, the
|
|
7
|
+
hub → tool connect exchange with its connect-on-demand seam and the
|
|
8
|
+
stranded-key recovery, and the `CliIo` prompt seam. Tool commands, wire types,
|
|
9
|
+
and API surfaces live in the tools — this package carries only config/login
|
|
10
|
+
plumbing, never secrets.
|
|
8
11
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
(`hub-
|
|
12
|
+
The model: one identity at the hub (`antasphere login`, a user-scoped `ant_`
|
|
13
|
+
key); per-tool credentials minted from it by the exchange
|
|
14
|
+
(`POST {hub}/api/v1/sso/tool-token`, then `POST {tool}/api/v1/sso/cli-connect`
|
|
15
|
+
— the exchange names no organization, hub ADR 014); the organization a
|
|
16
|
+
per-request parameter (the hub's server-side default organization, or
|
|
17
|
+
`--org <hub org id or name>` on one command, which the tool maps to its own
|
|
18
|
+
workspace through `central_account_id`). Every tool CLI ships its cloud URL and
|
|
19
|
+
resolves it last, so `antasphere login` then `slideless list` works on a clean
|
|
20
|
+
machine.
|
|
21
|
+
|
|
22
|
+
Consumers today: the `antasphere` account CLI (the hub's `packages/cli`), the
|
|
23
|
+
`slideless` CLI and the `hackathon` CLI. The design decisions live in the hub
|
|
24
|
+
architecture brief (`hub-architecture.md` §8, CLI family; §4c, the CLI token
|
|
25
|
+
flow).
|
|
12
26
|
|
|
13
27
|
## The config home
|
|
14
28
|
|
|
@@ -25,7 +39,40 @@ antasphere/ 0700
|
|
|
25
39
|
└── <tool>.json 0600 every other tool, e.g. tools/slideless.json
|
|
26
40
|
```
|
|
27
41
|
|
|
28
|
-
Each file holds one tool's profiles
|
|
42
|
+
Each file holds one tool's profiles. A tool file, e.g. `tools/slideless.json`:
|
|
43
|
+
|
|
44
|
+
```json
|
|
45
|
+
{
|
|
46
|
+
"activeProfile": "cloud",
|
|
47
|
+
"profiles": {
|
|
48
|
+
"cloud": {
|
|
49
|
+
"baseUrl": "https://slideless.antasphere.com",
|
|
50
|
+
"connectKeys": {
|
|
51
|
+
"default": {
|
|
52
|
+
"apiKey": "slk_…",
|
|
53
|
+
"email": "you@example.com",
|
|
54
|
+
"mintedAt": "2026-09-30T09:12:44.000Z"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"share.antasphere.com": {
|
|
59
|
+
"baseUrl": "https://share.antasphere.com",
|
|
60
|
+
"apiKey": "slk_…"
|
|
61
|
+
},
|
|
62
|
+
"localhost:3400": {
|
|
63
|
+
"baseUrl": "http://localhost:3400",
|
|
64
|
+
"apiKey": "slk_…"
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
`baseUrl` is the instance the profile is; a profile with no `baseUrl` is at the
|
|
71
|
+
tool's cloud URL. `apiKey` is the tool's own login; `connectKeys` holds the keys
|
|
72
|
+
the hub exchange minted, one per hub profile (the slot name, here `default`, is
|
|
73
|
+
the hub profile's name).
|
|
74
|
+
|
|
75
|
+
The hub's `config.json`:
|
|
29
76
|
|
|
30
77
|
```json
|
|
31
78
|
{
|
|
@@ -41,118 +88,178 @@ Each file holds one tool's profiles:
|
|
|
41
88
|
}
|
|
42
89
|
```
|
|
43
90
|
|
|
44
|
-
`
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
91
|
+
`workspaceId` is the default organization at login — informational; the hub's
|
|
92
|
+
server-side default is what applies. All config I/O is env-injected (no
|
|
93
|
+
`process.env` reads) — tests point the whole config world at a temp dir via
|
|
94
|
+
`XDG_CONFIG_HOME`.
|
|
95
|
+
|
|
96
|
+
## Profiles
|
|
97
|
+
|
|
98
|
+
A profile is an instance, named for its host by default (`cloud` for the tool's
|
|
99
|
+
cloud URL, `share.antasphere.com`, `localhost:3400`). `selectProfile` applies
|
|
100
|
+
one rule, in this order:
|
|
101
|
+
|
|
102
|
+
1. `--profile <name>` wins, and the profile must exist.
|
|
103
|
+
2. `--api-url`, else the tool's URL env var, selects the profile of that
|
|
104
|
+
instance; when several name it, the active one first, then `cloud`, then the
|
|
105
|
+
first declared. When none does, a profile is made in memory, named for the
|
|
106
|
+
host — `cloud` when it is the cloud URL — under a name no profile on disk
|
|
107
|
+
has (a taken name falls back to the host, then `<host>-2`, `<host>-3`). The
|
|
108
|
+
chassis passes `apiUrl: firstSet(flags.apiUrl, env[URL_VAR])`, the same
|
|
109
|
+
merge `resolveBaseUrl` makes, so a blank flag never hides the env var.
|
|
110
|
+
3. The active profile — the choice the person makes with `<tool> use <profile>`.
|
|
111
|
+
4. The profile at the tool's cloud URL, `cloud` by default: the one on disk at
|
|
112
|
+
that instance whatever its name (a profile named `cloud` that lives at
|
|
113
|
+
another instance is not it), else made in memory under a free name —
|
|
114
|
+
`cloud`, or the host (then `<host>-2`, …) when `cloud` is taken elsewhere.
|
|
115
|
+
|
|
116
|
+
`created: true` means the selected profile is not on disk yet (made in memory
|
|
117
|
+
for an instance URL, or the implicit `cloud` profile) and its name is free. A
|
|
118
|
+
profile with no `baseUrl` is at the cloud URL, for the selection and for the
|
|
119
|
+
connect seam alike (the chassis hands `connectOnDemand` the same `cloudUrl`).
|
|
120
|
+
Selection never writes;
|
|
121
|
+
`storeConnectKey` is the only thing that writes such a profile, on first
|
|
122
|
+
contact, and makes it active only when the tool had no profile at all. It never
|
|
123
|
+
renames or repoints an existing profile, and never changes which profile is
|
|
124
|
+
active once the tool has one.
|
|
125
|
+
|
|
126
|
+
An active profile pointing at an unreachable instance is still the selection —
|
|
127
|
+
there is no silent fallback to `cloud`. The tool's error names the profile and
|
|
128
|
+
says the hub login exists; that wording is the tool's. `default` is an ordinary
|
|
129
|
+
profile name now, nothing pins it.
|
|
130
|
+
|
|
131
|
+
An illustration of what a tool can print for the three profiles above (a
|
|
132
|
+
`slideless profiles`-style listing, not a command this package provides):
|
|
133
|
+
|
|
134
|
+
```
|
|
135
|
+
PROFILE INSTANCE SIGNS IN WITH
|
|
136
|
+
* cloud https://slideless.antasphere.com hub
|
|
137
|
+
share.antasphere.com https://share.antasphere.com key
|
|
138
|
+
localhost:3400 http://localhost:3400 key
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
The last column is `profileCredential`: `key` (the profile's own `apiKey`, the
|
|
142
|
+
tool's login), else `hub` (a key the exchange minted), else `none`.
|
|
48
143
|
|
|
49
144
|
## Surface
|
|
50
145
|
|
|
51
146
|
- `configPath / loadConfig / saveConfig / clearConfig (env, tool)` — the
|
|
52
147
|
tool-namespaced store. `HUB_TOOL` names the hub namespace. `redactKey`
|
|
53
|
-
renders keys safely for terminals.
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
- `
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
148
|
+
renders keys safely for terminals. `parseConfig(raw)` is the tolerant parse
|
|
149
|
+
(corrupt or foreign shapes → empty config); `assertToolNamespace(tool)`
|
|
150
|
+
refuses anything but a lowercase slug.
|
|
151
|
+
- `resolveProfile(config, requested, { unknownHint })` — the named (or active)
|
|
152
|
+
profile; an explicitly named missing profile throws `CliUsageError`.
|
|
153
|
+
- `selectProfile({ config, requested, apiUrl, cloudUrl, unknownHint })` — the
|
|
154
|
+
selection rule of [Profiles](#profiles); returns
|
|
155
|
+
`{ name, profile, source, created }`, `source` being `flag`, `url`, `active`
|
|
156
|
+
or `cloud`. Nothing is written, no profile is repointed.
|
|
157
|
+
- `CLOUD_PROFILE` — `'cloud'`, the implicit profile at the tool's cloud URL.
|
|
158
|
+
- `normalizeUrl(url) / sameInstance(a, b) / profileNameFor(url, cloudUrl)` —
|
|
159
|
+
the comparable form of an instance URL (scheme, host with port, path; no
|
|
160
|
+
trailing slash, query or fragment), equality on it, and the name an
|
|
161
|
+
instance's profile gets (`cloud`, else the host with its port).
|
|
162
|
+
`profileUrl(profile, cloudUrl)` is the instance a profile is at (its
|
|
163
|
+
`baseUrl`, a blank one counting as none, else the cloud URL);
|
|
164
|
+
`firstSet(...values)` the first non-blank value, trimmed — the one rule
|
|
165
|
+
every resolver applies to flags, env vars and profile fields, the hub
|
|
166
|
+
profile's `apiKey` and `baseUrl` included.
|
|
167
|
+
- `resolveBaseUrl({ flag, env, envVar, profile, cloudUrl, missingMessage })` —
|
|
168
|
+
flag → tool env var → profile → cloud URL, trailing slashes stripped; a
|
|
169
|
+
blank value counts as unset (`SLIDELESS_URL=""` never hides the cloud URL);
|
|
170
|
+
throws `missingMessage` as a `CliUsageError` only when nothing resolves and
|
|
171
|
+
the tool has no cloud URL.
|
|
172
|
+
- `resolveApiKey({ flag, env, envVar, profile })` — flag → env → profile, blank
|
|
173
|
+
values skipped.
|
|
174
|
+
- `resolveOrg({ flag, env, envVar })` — the organization override for one
|
|
175
|
+
command: `--org`, else the tool's org env var, else `undefined` (the hub's
|
|
176
|
+
server-side default applies); blank values skipped. Nothing is stored; it
|
|
177
|
+
never reaches the exchange.
|
|
178
|
+
- `CliUsageError(message, { exitCode })` — a usage-level error; runners print
|
|
179
|
+
it and exit with `exitCode` (default 1).
|
|
180
|
+
- `CliAuthClient({ baseUrl, fetch? })` — the browserless email-OTP flow every instance
|
|
62
181
|
speaks: `request({ email })`, `complete({ email, otp, keyName?,
|
|
63
182
|
expiresInDays?, workspaceId? })` (the full key appears exactly once),
|
|
64
|
-
`revoke(apiKey)` (self-revocation = logout). Errors are `CliAuthError`
|
|
65
|
-
|
|
66
|
-
- `CliIo` + `ask` + `printJson` — the injectable I/O seam (env, streams,
|
|
67
|
-
|
|
68
|
-
- `CliConnectClient({ hubBaseUrl, toolBaseUrl })` — the cross-tool connect
|
|
183
|
+
`revoke(apiKey)` (self-revocation = logout). Errors are `CliAuthError` with
|
|
184
|
+
`status`/`code`/`message`.
|
|
185
|
+
- `CliIo` + `ask` + `printJson` — the injectable I/O seam (env, streams, fetch,
|
|
186
|
+
interactive prompt) so tool CLIs run in-process under test.
|
|
187
|
+
- `CliConnectClient({ hubBaseUrl, toolBaseUrl, fetch? })` — the cross-tool connect
|
|
69
188
|
exchange (binding patterns §7, gcloud model — one hub login serves every
|
|
70
189
|
federated tool): `toolToken(hubApiKey, { resource })` asks the hub for a
|
|
71
190
|
120 s USER-scoped JWT plus the tool's one-time offline grant
|
|
72
191
|
(`hubRefreshToken`; the exchange names NO org — hub ADR 014),
|
|
73
192
|
`cliConnect(token, hubRefreshToken?)` trades the pair at the tool for a
|
|
74
|
-
user-scoped tool-local key (no auth header — the JWT is the credential;
|
|
75
|
-
|
|
76
|
-
`hub_grant_missing`), `exchange(hubApiKey, body)` composes both; the hub
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
pre-`sso:exchange` key)
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
tool
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
(
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
193
|
+
user-scoped tool-local key (no auth header — the JWT is the credential; the
|
|
194
|
+
grant is relayed so a fresh user's connect is never refused
|
|
195
|
+
`hub_grant_missing`), `exchange(hubApiKey, body)` composes both; the hub key
|
|
196
|
+
never reaches the tool, the grant never reaches anything but the tool, and
|
|
197
|
+
neither is ever persisted here. Errors are `CliConnectError` (a
|
|
198
|
+
`CliAuthError`) tagged with the failing `stage` plus four remedies:
|
|
199
|
+
`needsHubLogin` (hub 401, or 403 `insufficient_scope` from a
|
|
200
|
+
pre-`sso:exchange` key), `needsReExchange` (tool 401 on an expired/replayed
|
|
201
|
+
JWT), `refusal` (a 403 that is not the scope case, from either side — the
|
|
202
|
+
account was refused, not the key) and `exitCode` (3 for a refusal, else 1).
|
|
203
|
+
- `lookupConnectKey / storeConnectKey / removeConnectKey / profileCredential` —
|
|
204
|
+
the cache of exchange-minted user-scoped keys, held on the profile of the
|
|
205
|
+
instance they were minted for, in its `connectKeys` map (slot = the hub
|
|
206
|
+
profile name; `activeHubProfile(env)` resolves it). ONE key per hub account
|
|
207
|
+
serves every org — the org is never part of the credential or the slot.
|
|
208
|
+
`storeConnectKey(env, tool, profileName, hubProfileName, entry, { baseUrl })`
|
|
209
|
+
writes `baseUrl` only on a profile that has none, a blank one counting as
|
|
210
|
+
none (a profile is never repointed), creates a profile not on disk yet, and makes it active only when
|
|
211
|
+
the tool had no profile at all. `removeConnectKey` never touches the tool's
|
|
212
|
+
own `apiKey`. `profileCredential(profile, hubProfileName?)` answers `key` /
|
|
213
|
+
`hub` / `none`.
|
|
214
|
+
- `connectOnDemand({ tool, toolBaseUrl, cloudUrl?, profileName, env, resource?,
|
|
215
|
+
fetch?, notify?, messages?, cached? })` — the seam a tool CLI runs when NO
|
|
216
|
+
direct credential resolved. `profileName` is REQUIRED: the profile
|
|
217
|
+
`selectProfile` chose; `cloudUrl` is what a profile with no `baseUrl` is at,
|
|
218
|
+
the same value the selection got. The cache is read first, on that profile
|
|
219
|
+
only when it is at this instance (a hit costs zero network); `cached: false`
|
|
220
|
+
skips it. On a miss the
|
|
221
|
+
anonymous `GET /api/v1/instance` probe gates the flow (a self-hosted or
|
|
222
|
+
unreachable instance answers `{ outcome: 'not_cloud' }` and the tool raises
|
|
223
|
+
its classic no-key error), the hub credential is read from the `HUB_TOOL`
|
|
224
|
+
profile, `exchange` runs with one re-exchange retry on a dead JWT (a missing
|
|
225
|
+
or rejected hub login → a guided `antasphere login` `CliUsageError`, on
|
|
226
|
+
either attempt; a refusal propagates as its `CliConnectError`), and the key
|
|
227
|
+
is stored on the selected profile — never on one that is at another
|
|
228
|
+
instance. Success:
|
|
229
|
+
`{ outcome: 'connected', key, cached, result?, stored? }` — `cached: true` =
|
|
230
|
+
served from the cache. `notify` receives the "Connected to …" notice on fresh
|
|
231
|
+
exchanges (cache hits are silent); `messages` overrides the copy.
|
|
232
|
+
`probeToolInstance(toolBaseUrl, fetch?)` is the discovery probe on its own;
|
|
233
|
+
`activeHubProfile(env)` is the active hub profile, whose name is the cache
|
|
234
|
+
slot.
|
|
235
|
+
- `refreshConnectKey(opts)` — the stranded-key recovery, same options as
|
|
236
|
+
`connectOnDemand`. When a request answers 401 with a key served
|
|
237
|
+
`cached: true`, the chassis calls it once: it evicts that key (only from a
|
|
238
|
+
profile at this instance; a key of another instance is never touched) and
|
|
239
|
+
exchanges again with the cache skipped. The chassis retries its request once
|
|
240
|
+
with the new key, and a second 401 fails; `not_cloud` means nothing to
|
|
241
|
+
recover with.
|
|
114
242
|
- `migrateLegacyConfig(env, { tool, legacyDir })` — one-shot, non-destructive
|
|
115
243
|
import of a tool's pre-cli-core `$XDG_CONFIG_HOME/<legacyDir>/config.json`
|
|
116
244
|
into the shared home. Imports only when the tool has no profiles in the
|
|
117
245
|
shared home yet and the legacy file holds at least one; the legacy file is
|
|
118
246
|
left in place.
|
|
119
247
|
|
|
120
|
-
##
|
|
121
|
-
|
|
122
|
-
Until the package is on npm, pin the git tag (pnpm resolves the `github:`
|
|
123
|
-
shorthand over SSH — the repo is private):
|
|
248
|
+
## Exit codes
|
|
124
249
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
}
|
|
129
|
-
```
|
|
250
|
+
- `1` — a usage or wire error.
|
|
251
|
+
- `3` — a refusal: a 403 at the exchange that is not the scope case; the
|
|
252
|
+
message is the server's own sentence, printed as is.
|
|
130
253
|
|
|
131
|
-
|
|
132
|
-
scratch clone — but pnpm ≥10 blocks dependency build scripts by default, and
|
|
133
|
-
for a git dependency it honors the allowlist **only as the exact resolved
|
|
134
|
-
spec** (no glob patterns, no bare package name — proven against an empty
|
|
135
|
-
store: a bare-name or missing entry fails with
|
|
136
|
-
`ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED`). We standardize the entry in
|
|
137
|
-
`pnpm-workspace.yaml`. Each consumer therefore carries:
|
|
138
|
-
|
|
139
|
-
```yaml
|
|
140
|
-
# pnpm-workspace.yaml
|
|
141
|
-
onlyBuiltDependencies:
|
|
142
|
-
- esbuild
|
|
143
|
-
- '@antasphere/cli-core@git+ssh://git@github.com/antasphere/cli-core.git#<commit-sha-of-the-tag>'
|
|
144
|
-
```
|
|
254
|
+
Runners read `exitCode` off `CliUsageError` and `CliConnectError`.
|
|
145
255
|
|
|
146
|
-
|
|
147
|
-
the new allowlist line pnpm prints in its error. At npm-publish time the
|
|
148
|
-
switch is one line in each consumer:
|
|
256
|
+
## Consuming it
|
|
149
257
|
|
|
150
258
|
```json
|
|
151
|
-
"@antasphere/cli-core": "^0.
|
|
259
|
+
"dependencies": { "@antasphere/cli-core": "^0.5.0" }
|
|
152
260
|
```
|
|
153
261
|
|
|
154
|
-
|
|
155
|
-
prebuilt `dist/`, no build script runs).
|
|
262
|
+
Registry tarballs ship a prebuilt `dist/`, no build script runs on install.
|
|
156
263
|
|
|
157
264
|
## Release
|
|
158
265
|
|
|
@@ -163,21 +270,11 @@ with no npm token — npm authenticates the workflow's OIDC identity directly.
|
|
|
163
270
|
|
|
164
271
|
```bash
|
|
165
272
|
# bump package.json#version, commit, then:
|
|
166
|
-
git tag v0.
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
**First publish is manual.** Trusted publishing can only be configured on a
|
|
170
|
-
package that already exists on npm, so the very first publish of the name is
|
|
171
|
-
done by hand from a clean checkout while logged in to an account that owns
|
|
172
|
-
the npm `antasphere` org:
|
|
173
|
-
|
|
174
|
-
```bash
|
|
175
|
-
pnpm install # runs prepare → builds dist/
|
|
176
|
-
npm publish # publishConfig.access = public
|
|
273
|
+
git tag v0.5.0 && git push origin v0.5.0
|
|
177
274
|
```
|
|
178
275
|
|
|
179
|
-
|
|
180
|
-
|
|
276
|
+
The first publish was done by hand, and the trusted publisher is configured on
|
|
277
|
+
npmjs.com; every release is the tag.
|
|
181
278
|
|
|
182
279
|
| Field | Value |
|
|
183
280
|
| -------------------- | --------------- |
|
|
@@ -186,8 +283,6 @@ After that, configure the trusted publisher on npmjs.com
|
|
|
186
283
|
| Workflow filename | `publish.yml` |
|
|
187
284
|
| Environment | _(leave empty)_ |
|
|
188
285
|
|
|
189
|
-
and every further release is just the tag.
|
|
190
|
-
|
|
191
286
|
## Development
|
|
192
287
|
|
|
193
288
|
```bash
|
|
@@ -197,4 +292,4 @@ pnpm lint && pnpm typecheck && pnpm test && pnpm build
|
|
|
197
292
|
|
|
198
293
|
Branches per the workspace rule: `prod` (default, releases/tags) + `dev`
|
|
199
294
|
(day-to-day work). License: MIT (permissive on purpose — this is plumbing
|
|
200
|
-
consumed by public CLIs
|
|
295
|
+
consumed by public CLIs).
|
package/dist/config.d.ts
CHANGED
|
@@ -13,9 +13,16 @@
|
|
|
13
13
|
* └── <tool>.json 0600 every other tool's profiles
|
|
14
14
|
* (e.g. tools/slideless.json)
|
|
15
15
|
*
|
|
16
|
-
* Each file holds one tool's `{ activeProfile?, profiles }
|
|
17
|
-
*
|
|
18
|
-
*
|
|
16
|
+
* Each file holds one tool's `{ activeProfile?, profiles }`. A PROFILE IS AN
|
|
17
|
+
* INSTANCE: it names the tool instance it talks to (`baseUrl`; absent = the
|
|
18
|
+
* tool's cloud URL) and carries the credentials for that instance, either
|
|
19
|
+
* the tool's own key (`apiKey`, the tool's login) or the keys the hub
|
|
20
|
+
* exchange minted (`connectKeys`, one per hub profile). Profiles are named
|
|
21
|
+
* for their host by default (`cloud` for the cloud instance,
|
|
22
|
+
* `share.antasphere.com`, `localhost:3400`); the person may rename them and
|
|
23
|
+
* chooses the active one with `<tool> use`. The hub profile additionally
|
|
24
|
+
* carries `workspaceId`, the default organization at login (informational;
|
|
25
|
+
* the hub's server-side default is what applies).
|
|
19
26
|
*
|
|
20
27
|
* Files store API keys, so directories are created 0700 and files kept 0600
|
|
21
28
|
* on every write. All I/O is synchronous and env-injected (no process.env
|
|
@@ -25,11 +32,11 @@
|
|
|
25
32
|
export type CliEnv = Record<string, string | undefined>;
|
|
26
33
|
/**
|
|
27
34
|
* A tool-local key minted by the cross-tool connect exchange (binding
|
|
28
|
-
* patterns §7), cached
|
|
29
|
-
* `antasphere login` credential minted it. The
|
|
30
|
-
* ADR 014): one key serves every org — the org is a
|
|
31
|
-
* never part of the credential or of this cache's
|
|
32
|
-
* the key itself is informational.
|
|
35
|
+
* patterns §7), cached on the profile of the instance it was minted for,
|
|
36
|
+
* under the HUB PROFILE whose `antasphere login` credential minted it. The
|
|
37
|
+
* key is USER-scoped (hub ADR 014): one key serves every org — the org is a
|
|
38
|
+
* per-request parameter, never part of the credential or of this cache's
|
|
39
|
+
* slot. Every field beyond the key itself is informational.
|
|
33
40
|
*/
|
|
34
41
|
export interface CliConnectKey {
|
|
35
42
|
/** Full tool-local API key (`slk_`-style) — shown once at mint, cached here. */
|
|
@@ -40,20 +47,20 @@ export interface CliConnectKey {
|
|
|
40
47
|
mintedAt?: string;
|
|
41
48
|
}
|
|
42
49
|
export interface CliProfile {
|
|
43
|
-
/** `<prefix>_...` API key for this profile. */
|
|
50
|
+
/** `<prefix>_...` API key for this profile (the tool's own login). */
|
|
44
51
|
apiKey?: string;
|
|
45
|
-
/**
|
|
52
|
+
/** The instance this profile IS: its origin. Absent = the tool's cloud URL. */
|
|
46
53
|
baseUrl?: string;
|
|
47
54
|
/** The signed-in account's email (informational, set by login). */
|
|
48
55
|
email?: string;
|
|
49
|
-
/**
|
|
56
|
+
/** Hub profile: the default organization at login (informational; the
|
|
57
|
+
* hub's server-side default is what applies, `--org` overrides per
|
|
58
|
+
* command). Tool profiles from a tool's own login may carry the
|
|
59
|
+
* workspace that login bound. */
|
|
50
60
|
workspaceId?: string;
|
|
51
|
-
/** Hub profiles only: the org selected via `antasphere org use` (the
|
|
52
|
-
* default per-request org context; never part of any credential). */
|
|
53
|
-
activeWorkspaceId?: string;
|
|
54
61
|
/** Tool profiles only: exchange-minted USER-scoped keys, ONE per hub
|
|
55
|
-
* profile — the (tool, hub profile) cache of the cross-tool
|
|
56
|
-
* flow. Org-independent: a cached key serves every org
|
|
62
|
+
* profile — the (tool profile, hub profile) cache of the cross-tool
|
|
63
|
+
* connect flow. Org-independent: a cached key serves every org. */
|
|
57
64
|
connectKeys?: Record<string, CliConnectKey>;
|
|
58
65
|
}
|
|
59
66
|
export interface CliConfig {
|
|
@@ -83,17 +90,38 @@ export declare function redactKey(key: string): string;
|
|
|
83
90
|
* runs never misses the cache).
|
|
84
91
|
*/
|
|
85
92
|
export declare function lookupConnectKey(profile: CliProfile | undefined, hubProfileName: string): string | undefined;
|
|
93
|
+
/** How a profile signs in, for a `profiles`-style listing. */
|
|
94
|
+
export type ProfileCredential = 'key' | 'hub' | 'none';
|
|
86
95
|
/**
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
96
|
+
* What a profile signs in with, in the order the tool resolves it: its own
|
|
97
|
+
* `apiKey` (`key`, the tool's login), else a key the hub exchange minted
|
|
98
|
+
* (`hub`: under the named hub profile, or under any when none is named),
|
|
99
|
+
* else `none`. A listing can then say which profiles ride the hub login.
|
|
91
100
|
*/
|
|
92
|
-
export declare function
|
|
101
|
+
export declare function profileCredential(profile: CliProfile | undefined, hubProfileName?: string): ProfileCredential;
|
|
102
|
+
export interface StoreConnectKeyOptions {
|
|
103
|
+
/**
|
|
104
|
+
* The instance the key was minted for. Written on the profile when it is
|
|
105
|
+
* created here or has no `baseUrl` of its own (a blank one counts as
|
|
106
|
+
* none); a `baseUrl` that is there is never overwritten (a profile is
|
|
107
|
+
* never repointed).
|
|
108
|
+
*/
|
|
109
|
+
baseUrl?: string;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Cache an exchange-minted tool key on the SELECTED profile under the hub
|
|
113
|
+
* profile's name. A profile not on disk yet is created (with `baseUrl` when
|
|
114
|
+
* given) and made active only when the tool had NO profile at all: the
|
|
115
|
+
* first cloud connect on a fresh machine. An existing profile is never
|
|
116
|
+
* renamed, repointed or made active; every other field is preserved.
|
|
117
|
+
* Returns the file written.
|
|
118
|
+
*/
|
|
119
|
+
export declare function storeConnectKey(env: CliEnv, tool: string, profileName: string, hubProfileName: string, entry: CliConnectKey, opts?: StoreConnectKeyOptions): string;
|
|
93
120
|
/**
|
|
94
|
-
* Drop one hub profile's cached connect key (disconnect this
|
|
95
|
-
* hub account
|
|
96
|
-
*
|
|
121
|
+
* Drop one hub profile's cached connect key from a profile (disconnect this
|
|
122
|
+
* tool from the hub account, or evict a key the hub revoked). Returns
|
|
123
|
+
* whether anything was removed; the tool's own `apiKey` is never touched —
|
|
124
|
+
* it belongs to the tool's own login flow.
|
|
97
125
|
*/
|
|
98
126
|
export declare function removeConnectKey(env: CliEnv, tool: string, profileName: string, hubProfileName: string): boolean;
|
|
99
127
|
//# sourceMappingURL=config.d.ts.map
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAGA
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;AAExD;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa;IAC5B,gFAAgF;IAChF,MAAM,EAAE,MAAM,CAAC;IACf,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yDAAyD;IACzD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,UAAU;IACzB,sEAAsE;IACtE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,+EAA+E;IAC/E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mEAAmE;IACnE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;sCAGkC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;wEAEoE;IACpE,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC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,sBAAsB;IACrC;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,EACtB,KAAK,EAAE,aAAa,EACpB,IAAI,GAAE,sBAA2B,GAChC,MAAM,CAWR;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,GACrB,OAAO,CAaT"}
|
package/dist/config.js
CHANGED
|
@@ -85,26 +85,48 @@ export function lookupConnectKey(profile, hubProfileName) {
|
|
|
85
85
|
return profile?.connectKeys?.[hubProfileName]?.apiKey;
|
|
86
86
|
}
|
|
87
87
|
/**
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
88
|
+
* What a profile signs in with, in the order the tool resolves it: its own
|
|
89
|
+
* `apiKey` (`key`, the tool's login), else a key the hub exchange minted
|
|
90
|
+
* (`hub`: under the named hub profile, or under any when none is named),
|
|
91
|
+
* else `none`. A listing can then say which profiles ride the hub login.
|
|
92
92
|
*/
|
|
93
|
-
export function
|
|
93
|
+
export function profileCredential(profile, hubProfileName) {
|
|
94
|
+
if (!profile)
|
|
95
|
+
return 'none';
|
|
96
|
+
if (profile.apiKey)
|
|
97
|
+
return 'key';
|
|
98
|
+
const slots = profile.connectKeys ?? {};
|
|
99
|
+
const connected = hubProfileName
|
|
100
|
+
? Boolean(slots[hubProfileName]?.apiKey)
|
|
101
|
+
: Object.values(slots).some((k) => k.apiKey);
|
|
102
|
+
return connected ? 'hub' : 'none';
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Cache an exchange-minted tool key on the SELECTED profile under the hub
|
|
106
|
+
* profile's name. A profile not on disk yet is created (with `baseUrl` when
|
|
107
|
+
* given) and made active only when the tool had NO profile at all: the
|
|
108
|
+
* first cloud connect on a fresh machine. An existing profile is never
|
|
109
|
+
* renamed, repointed or made active; every other field is preserved.
|
|
110
|
+
* Returns the file written.
|
|
111
|
+
*/
|
|
112
|
+
export function storeConnectKey(env, tool, profileName, hubProfileName, entry, opts = {}) {
|
|
94
113
|
const config = loadConfig(env, tool);
|
|
114
|
+
const first = Object.keys(config.profiles).length === 0;
|
|
95
115
|
const profile = config.profiles[profileName] ?? {};
|
|
96
116
|
config.profiles[profileName] = {
|
|
97
117
|
...profile,
|
|
118
|
+
...(!profile.baseUrl?.trim() && opts.baseUrl ? { baseUrl: opts.baseUrl } : {}),
|
|
98
119
|
connectKeys: { ...profile.connectKeys, [hubProfileName]: entry }
|
|
99
120
|
};
|
|
100
|
-
if (
|
|
121
|
+
if (first)
|
|
101
122
|
config.activeProfile = profileName;
|
|
102
123
|
return saveConfig(env, tool, config);
|
|
103
124
|
}
|
|
104
125
|
/**
|
|
105
|
-
* Drop one hub profile's cached connect key (disconnect this
|
|
106
|
-
* hub account
|
|
107
|
-
*
|
|
126
|
+
* Drop one hub profile's cached connect key from a profile (disconnect this
|
|
127
|
+
* tool from the hub account, or evict a key the hub revoked). Returns
|
|
128
|
+
* whether anything was removed; the tool's own `apiKey` is never touched —
|
|
129
|
+
* it belongs to the tool's own login flow.
|
|
108
130
|
*/
|
|
109
131
|
export function removeConnectKey(env, tool, profileName, hubProfileName) {
|
|
110
132
|
const config = loadConfig(env, tool);
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAChG,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;
|
|
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