@b3os/cli 0.0.1 → 0.1.3
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 +71 -34
- package/bin/b3os.js +13 -3
- package/dist/commands/_common.d.ts +49 -0
- package/dist/commands/_common.js +174 -0
- package/dist/commands/_common.js.map +1 -0
- package/dist/commands/actions.d.ts +43 -0
- package/dist/commands/actions.js +184 -0
- package/dist/commands/actions.js.map +1 -0
- package/dist/commands/api.d.ts +24 -0
- package/dist/commands/api.js +14 -8
- package/dist/commands/api.js.map +1 -1
- package/dist/commands/auth.d.ts +58 -0
- package/dist/commands/auth.js +215 -19
- package/dist/commands/auth.js.map +1 -1
- package/dist/commands/bench.d.ts +22 -0
- package/dist/commands/bench.js +19 -7
- package/dist/commands/bench.js.map +1 -1
- package/dist/commands/connect.d.ts +52 -0
- package/dist/commands/connect.js +221 -0
- package/dist/commands/connect.js.map +1 -0
- package/dist/commands/infer.d.ts +47 -0
- package/dist/commands/infer.js +152 -0
- package/dist/commands/infer.js.map +1 -0
- package/dist/commands/init.d.ts +45 -0
- package/dist/commands/init.js +267 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/keys.d.ts +42 -0
- package/dist/commands/keys.js +70 -38
- package/dist/commands/keys.js.map +1 -1
- package/dist/commands/manifest.d.ts +13 -0
- package/dist/commands/manifest.js +117 -0
- package/dist/commands/manifest.js.map +1 -0
- package/dist/commands/mcp.d.ts +65 -0
- package/dist/commands/mcp.js +167 -50
- package/dist/commands/mcp.js.map +1 -1
- package/dist/commands/render.d.ts +119 -0
- package/dist/commands/render.js +294 -0
- package/dist/commands/render.js.map +1 -0
- package/dist/commands/requests.d.ts +34 -0
- package/dist/commands/requests.js +63 -0
- package/dist/commands/requests.js.map +1 -0
- package/dist/commands/routine.d.ts +53 -1
- package/dist/commands/routine.js +246 -110
- package/dist/commands/routine.js.map +1 -1
- package/dist/commands/sandbox.d.ts +130 -0
- package/dist/commands/sandbox.js +327 -55
- package/dist/commands/sandbox.js.map +1 -1
- package/dist/commands/vision.d.ts +196 -0
- package/dist/commands/vision.js +478 -0
- package/dist/commands/vision.js.map +1 -0
- package/dist/commands/webhooks.d.ts +20 -0
- package/dist/commands/webhooks.js +76 -0
- package/dist/commands/webhooks.js.map +1 -0
- package/dist/ctx.d.ts +80 -6
- package/dist/ctx.js +233 -24
- package/dist/ctx.js.map +1 -1
- package/dist/main.d.ts +4 -1
- package/dist/main.js +72 -40
- package/dist/main.js.map +1 -1
- package/dist/manifest/load.d.ts +143 -0
- package/dist/manifest/load.js +279 -0
- package/dist/manifest/load.js.map +1 -0
- package/dist/manifest/plan.d.ts +52 -0
- package/dist/manifest/plan.js +628 -0
- package/dist/manifest/plan.js.map +1 -0
- package/dist/registry.d.ts +19 -0
- package/dist/registry.js +52 -0
- package/dist/registry.js.map +1 -0
- package/dist/suggest.d.ts +9 -0
- package/dist/suggest.js +51 -0
- package/dist/suggest.js.map +1 -0
- package/package.json +12 -9
- package/schemas/b3os.v0.schema.json +244 -0
- package/dist/commands/web.d.ts +0 -4
- package/dist/commands/web.js +0 -205
- package/dist/commands/web.js.map +0 -1
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
// b3os init: the one setup line (PD43). Composed from what exists: the device login when there is no working
|
|
2
|
+
// credential (asking for the agent preset of scopes, which the approver can narrow on the approval page), the MCP
|
|
3
|
+
// entry for each client on this machine (or the ones named), and one authenticated GET /v1/ping whose times it
|
|
4
|
+
// prints: the first call (connection included) and the warm round trip, with the edge and node phases. It exits
|
|
5
|
+
// non-zero when any step failed and says which; --json prints one summary object.
|
|
6
|
+
import { B3OSError } from "@b3os/sdk";
|
|
7
|
+
import { EXIT, exitCodeFor, intFlag, parse, UsageError } from "../ctx.js";
|
|
8
|
+
import { scopeList } from "./_common.js";
|
|
9
|
+
import { deviceLogin } from "./auth.js";
|
|
10
|
+
import { CLIENTS, detectClients, installMcp } from "./mcp.js";
|
|
11
|
+
/**
|
|
12
|
+
* The scopes `b3os init` asks for: the spec's default key scopes (packages/spec/dist/scopes.json
|
|
13
|
+
* `default_key_scopes`; test/init.test.ts keeps them equal). Every product's read, write and run, profiles used
|
|
14
|
+
* but never exported, vault read and run, platform read; no platform:write, vault:write or profile export.
|
|
15
|
+
*/
|
|
16
|
+
export const AGENT_SCOPES = [
|
|
17
|
+
"vision:read",
|
|
18
|
+
"vision:write",
|
|
19
|
+
"vision:run",
|
|
20
|
+
"vision:profiles:use",
|
|
21
|
+
"render:read",
|
|
22
|
+
"render:write",
|
|
23
|
+
"render:run",
|
|
24
|
+
"sandboxes:read",
|
|
25
|
+
"sandboxes:write",
|
|
26
|
+
"sandboxes:run",
|
|
27
|
+
"routines:read",
|
|
28
|
+
"routines:write",
|
|
29
|
+
"routines:run",
|
|
30
|
+
"actions:read",
|
|
31
|
+
"actions:write",
|
|
32
|
+
"actions:run",
|
|
33
|
+
"infer:read",
|
|
34
|
+
"infer:write",
|
|
35
|
+
"infer:run",
|
|
36
|
+
"vault:read",
|
|
37
|
+
"vault:run",
|
|
38
|
+
"platform:read",
|
|
39
|
+
];
|
|
40
|
+
const USAGE = `usage: b3os init [--all | --client claude,cursor,codex] [--no-mcp] [--no-login] [--browser | --no-browser]
|
|
41
|
+
[--scope vision:run,sandboxes:*] [--pings 5] [--json]
|
|
42
|
+
1. credential --api-key, B3OS_API_KEY or a stored login, checked with GET /v1/ping; without a working one, the
|
|
43
|
+
device login (b3os login) asking for the agent scopes, unless --no-login
|
|
44
|
+
2. mcp the b3os MCP server in each client: --all (or no flag) every client found on this machine,
|
|
45
|
+
--client the ones named; --no-mcp skips it
|
|
46
|
+
3. ping GET /v1/ping: the process's first call (connection included) and the warm round trip over
|
|
47
|
+
--pings more, with the edge and node phases
|
|
48
|
+
Exit 0 when every step passed; otherwise the first failed step's code (b3os --help lists them).`;
|
|
49
|
+
/** `b3os init`'s options. */
|
|
50
|
+
export const INIT_OPTIONS = {
|
|
51
|
+
all: { type: "boolean" },
|
|
52
|
+
client: { type: "string" },
|
|
53
|
+
"no-mcp": { type: "boolean" },
|
|
54
|
+
"no-login": { type: "boolean" },
|
|
55
|
+
"no-browser": { type: "boolean" },
|
|
56
|
+
browser: { type: "boolean" },
|
|
57
|
+
scope: { type: "string" },
|
|
58
|
+
pings: { type: "string" },
|
|
59
|
+
};
|
|
60
|
+
export async function init(ctx, argv) {
|
|
61
|
+
const a = parse(argv, INIT_OPTIONS);
|
|
62
|
+
ctx.applyGlobals(a.values);
|
|
63
|
+
if (a.values.help) {
|
|
64
|
+
ctx.out(USAGE);
|
|
65
|
+
return EXIT.OK;
|
|
66
|
+
}
|
|
67
|
+
if (a.values.all && typeof a.values.client === "string")
|
|
68
|
+
throw new UsageError("--all and --client: pick one");
|
|
69
|
+
const pings = intFlag(a.values.pings, "--pings") ?? 5;
|
|
70
|
+
if (pings < 1 || pings > 50)
|
|
71
|
+
throw new UsageError("--pings is 1 to 50");
|
|
72
|
+
let named = null;
|
|
73
|
+
if (typeof a.values.client === "string") {
|
|
74
|
+
const list = a.values.client
|
|
75
|
+
.split(",")
|
|
76
|
+
.map((c) => c.trim())
|
|
77
|
+
.filter(Boolean);
|
|
78
|
+
const bad = list.filter((c) => !CLIENTS.includes(c));
|
|
79
|
+
if (bad.length || list.length === 0)
|
|
80
|
+
throw new UsageError(`--client takes ${CLIENTS.join(", ")} (comma-separated); got ${a.values.client}`);
|
|
81
|
+
named = list;
|
|
82
|
+
}
|
|
83
|
+
const steps = [];
|
|
84
|
+
let firstFailure = EXIT.OK;
|
|
85
|
+
const fail = (code) => {
|
|
86
|
+
if (firstFailure === EXIT.OK)
|
|
87
|
+
firstFailure = code;
|
|
88
|
+
};
|
|
89
|
+
// 1. A credential that works.
|
|
90
|
+
let cred = ctx.credential();
|
|
91
|
+
let usable = false;
|
|
92
|
+
// The first authenticated call of this process, connection setup included: the time to a first call.
|
|
93
|
+
const firstCall = { ms: null };
|
|
94
|
+
const timedPing = async () => {
|
|
95
|
+
const t0 = performance.now();
|
|
96
|
+
const r = await ctx.client().ping().withResponse();
|
|
97
|
+
const ms = performance.now() - t0;
|
|
98
|
+
if (firstCall.ms === null)
|
|
99
|
+
firstCall.ms = ms;
|
|
100
|
+
return { ms, r };
|
|
101
|
+
};
|
|
102
|
+
if (cred.key) {
|
|
103
|
+
try {
|
|
104
|
+
await timedPing();
|
|
105
|
+
usable = true;
|
|
106
|
+
steps.push({ step: "credential", ok: true, detail: `using ${cred.source}`, source: cred.source });
|
|
107
|
+
}
|
|
108
|
+
catch (e) {
|
|
109
|
+
if (!(e instanceof B3OSError) || (e.status !== 401 && e.status !== 403)) {
|
|
110
|
+
steps.push({ step: "credential", ok: false, detail: errText(e), source: cred.source });
|
|
111
|
+
fail(exitCodeFor(e));
|
|
112
|
+
}
|
|
113
|
+
else if (cred.source !== "b3os login" || a.values["no-login"]) {
|
|
114
|
+
// A key the user passed is theirs to fix; a stale login token is replaced below.
|
|
115
|
+
steps.push({ step: "credential", ok: false, detail: `${cred.source} was refused: ${errText(e)}` });
|
|
116
|
+
fail(EXIT.AUTH);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
if (!usable && firstFailure === EXIT.OK) {
|
|
121
|
+
if (a.values["no-login"]) {
|
|
122
|
+
steps.push({ step: "credential", ok: false, detail: "no credential, and --no-login" });
|
|
123
|
+
fail(EXIT.AUTH);
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
try {
|
|
127
|
+
const scope = (scopeList(a.values.scope, "--scope") ?? AGENT_SCOPES).join(" ");
|
|
128
|
+
const r = await deviceLogin(ctx, { scope, browser: !a.values["no-browser"] });
|
|
129
|
+
ctx.resetClient();
|
|
130
|
+
cred = ctx.credential();
|
|
131
|
+
usable = true;
|
|
132
|
+
steps.push({
|
|
133
|
+
step: "credential",
|
|
134
|
+
ok: true,
|
|
135
|
+
detail: `logged in: org ${r.org_id}, project ${r.project_id}`,
|
|
136
|
+
source: "b3os login",
|
|
137
|
+
org_id: r.org_id,
|
|
138
|
+
project_id: r.project_id,
|
|
139
|
+
scope: r.scope,
|
|
140
|
+
expires_at: r.expires_at,
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
catch (e) {
|
|
144
|
+
steps.push({ step: "credential", ok: false, detail: errText(e) });
|
|
145
|
+
fail(exitCodeFor(e));
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
// 2. The MCP server in each client. The entry holds no secret, so it is written even without a credential.
|
|
150
|
+
if (!a.values["no-mcp"]) {
|
|
151
|
+
const clients = named ?? detectClients();
|
|
152
|
+
if (clients.length === 0) {
|
|
153
|
+
steps.push({
|
|
154
|
+
step: "mcp",
|
|
155
|
+
ok: true,
|
|
156
|
+
detail: "no MCP client found (claude, ~/.cursor, codex); run b3os mcp install --client ... later",
|
|
157
|
+
clients: [],
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
for (const client of clients) {
|
|
161
|
+
try {
|
|
162
|
+
const r = installMcp(ctx, { client, scope: "user" });
|
|
163
|
+
steps.push({ step: "mcp", ok: true, detail: `${client}: ${r.where}`, client, where: r.where });
|
|
164
|
+
}
|
|
165
|
+
catch (e) {
|
|
166
|
+
steps.push({ step: "mcp", ok: false, detail: `${client}: ${errText(e)}`, client });
|
|
167
|
+
fail(e instanceof UsageError ? EXIT.ERROR : exitCodeFor(e));
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
// 3. The round trip.
|
|
172
|
+
if (usable) {
|
|
173
|
+
try {
|
|
174
|
+
const times = [];
|
|
175
|
+
let last = {
|
|
176
|
+
edge_ms: null,
|
|
177
|
+
total_ms: null,
|
|
178
|
+
node: null,
|
|
179
|
+
};
|
|
180
|
+
// After a login the first of these is the process's first authenticated call; it is never a warm one.
|
|
181
|
+
const n = firstCall.ms === null ? pings + 1 : pings;
|
|
182
|
+
for (let i = 0; i < n; i++) {
|
|
183
|
+
const { ms, r } = await timedPing();
|
|
184
|
+
if (i > 0 || n === pings)
|
|
185
|
+
times.push(ms);
|
|
186
|
+
last = { edge_ms: r.response.timing.edge_ms, total_ms: r.response.timing.total_ms, node: r.data.node ?? null };
|
|
187
|
+
}
|
|
188
|
+
const first = firstCall.ms;
|
|
189
|
+
const warm = times.sort((x, y) => x - y);
|
|
190
|
+
const warmP50 = warm.length ? warm[Math.floor((warm.length - 1) / 2)] : null;
|
|
191
|
+
const r1 = (v) => (v === null ? null : Math.round(v * 10) / 10);
|
|
192
|
+
steps.push({
|
|
193
|
+
step: "ping",
|
|
194
|
+
ok: true,
|
|
195
|
+
detail: `first call ${r1(first)} ms (connection included)` +
|
|
196
|
+
(warmP50 !== null ? `, then ${r1(warmP50)} ms p50 over ${warm.length}` : "") +
|
|
197
|
+
(last.total_ms !== null ? ` (node ${last.total_ms} ms` : "") +
|
|
198
|
+
(last.total_ms !== null && last.edge_ms !== null
|
|
199
|
+
? `, edge ${last.edge_ms} ms)`
|
|
200
|
+
: last.total_ms !== null
|
|
201
|
+
? ")"
|
|
202
|
+
: ""),
|
|
203
|
+
node: last.node,
|
|
204
|
+
first_call_ms: r1(first),
|
|
205
|
+
warm_p50_ms: r1(warmP50),
|
|
206
|
+
warm_n: warm.length,
|
|
207
|
+
node_total_ms: last.total_ms,
|
|
208
|
+
edge_ms: last.edge_ms,
|
|
209
|
+
base_url: cred.baseUrl,
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
catch (e) {
|
|
213
|
+
steps.push({ step: "ping", ok: false, detail: errText(e) });
|
|
214
|
+
fail(exitCodeFor(e));
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
else {
|
|
218
|
+
steps.push({ step: "ping", ok: false, detail: "skipped: no working credential" });
|
|
219
|
+
}
|
|
220
|
+
const ok = steps.every((s) => s.ok);
|
|
221
|
+
const agents = steps.filter((s) => s.step === "mcp" && s.ok && s.client).map((s) => s.client);
|
|
222
|
+
ctx.result({ ok, steps }, () => {
|
|
223
|
+
for (const s of steps)
|
|
224
|
+
ctx.out(`${s.ok ? "ok " : "FAIL"} ${s.step.padEnd(10)} ${s.detail}`);
|
|
225
|
+
if (ok)
|
|
226
|
+
ctx.info(summary(agents, a.values["no-mcp"] === true, cred.source));
|
|
227
|
+
});
|
|
228
|
+
return ok ? EXIT.OK : firstFailure === EXIT.OK ? EXIT.ERROR : firstFailure;
|
|
229
|
+
}
|
|
230
|
+
const AGENT_NAMES = { claude: "Claude Code", cursor: "Cursor", codex: "Codex" };
|
|
231
|
+
/**
|
|
232
|
+
* The last line after every step passed: what is set up, and nothing more. An agent can call B3OS only when its
|
|
233
|
+
* MCP server finds a credential, and the server reads B3OS_API_KEY from the agent's environment or the stored
|
|
234
|
+
* login, never an --api-key given to this command.
|
|
235
|
+
*/
|
|
236
|
+
export function summary(agents, noMcp, source) {
|
|
237
|
+
if (agents.length === 0) {
|
|
238
|
+
const why = noMcp ? "--no-mcp" : "none of Claude Code, Cursor or Codex was found";
|
|
239
|
+
return `This machine can call B3OS. No agent was set up (${why}); b3os mcp install --client claude|cursor|codex adds one.`;
|
|
240
|
+
}
|
|
241
|
+
const names = agents.map((c) => AGENT_NAMES[c]);
|
|
242
|
+
const who = names.length === 1 ? names[0] : `${names.slice(0, -1).join(", ")} and ${names.at(-1)}`;
|
|
243
|
+
const restart = names.length === 1 ? "Restart it if it was open." : "Restart any that was open.";
|
|
244
|
+
if (source === "b3os login")
|
|
245
|
+
return `Ready: ${who} can call B3OS now. ${restart}`;
|
|
246
|
+
if (source === "B3OS_API_KEY")
|
|
247
|
+
return (`${who} ${names.length === 1 ? "has" : "have"} the B3OS MCP server. It reads B3OS_API_KEY from the agent's ` +
|
|
248
|
+
`environment, so start the agent with it set, or run b3os login to store a token it finds. ${restart}`);
|
|
249
|
+
return (`${who} ${names.length === 1 ? "has" : "have"} the B3OS MCP server, but it cannot read --api-key. Run b3os ` +
|
|
250
|
+
`login, or set B3OS_API_KEY where the agent runs.`);
|
|
251
|
+
}
|
|
252
|
+
function errText(e) {
|
|
253
|
+
if (e instanceof B3OSError)
|
|
254
|
+
return `${e.code}${e.status ? ` (${e.status})` : ""}: ${e.message}`;
|
|
255
|
+
return e instanceof Error ? e.message : String(e);
|
|
256
|
+
}
|
|
257
|
+
/** This module's commands, found by main.ts (src/registry.ts). */
|
|
258
|
+
export const commands = [
|
|
259
|
+
{
|
|
260
|
+
name: "init",
|
|
261
|
+
summary: "Set up this machine: sign in if needed, add the MCP server to your agents, ping",
|
|
262
|
+
order: 5,
|
|
263
|
+
run: init,
|
|
264
|
+
options: INIT_OPTIONS,
|
|
265
|
+
},
|
|
266
|
+
];
|
|
267
|
+
//# sourceMappingURL=init.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,6GAA6G;AAC7G,kHAAkH;AAClH,+GAA+G;AAC/G,gHAAgH;AAChH,kFAAkF;AAElF,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAY,IAAI,EAAE,WAAW,EAAE,OAAO,EAAgB,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAElG,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,OAAO,EAAe,aAAa,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3E;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,aAAa;IACb,cAAc;IACd,YAAY;IACZ,qBAAqB;IACrB,aAAa;IACb,cAAc;IACd,YAAY;IACZ,gBAAgB;IAChB,iBAAiB;IACjB,eAAe;IACf,eAAe;IACf,gBAAgB;IAChB,cAAc;IACd,cAAc;IACd,eAAe;IACf,aAAa;IACb,YAAY;IACZ,aAAa;IACb,WAAW;IACX,YAAY;IACZ,WAAW;IACX,eAAe;CACP,CAAC;AASX,MAAM,KAAK,GAAG;;;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AC,CAAC,CAAC,MAAM,+DAA+D;YAC5G,6FAA6F,OAAO,EAAE,CACvG,CAAC;IACJ,OAAO,CACL,GAAG,GAAG,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,+DAA+D;QAC5G,kDAAkD,CACnD,CAAC;AACJ,CAAC;AAED,SAAS,OAAO,CAAC,CAAU;IACzB,IAAI,CAAC,YAAY,SAAS;QAAE,OAAO,GAAG,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC;IAChG,OAAO,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACpD,CAAC;AAED,kEAAkE;AAClE,MAAM,CAAC,MAAM,QAAQ,GAAiB;IACpC;QACE,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,iFAAiF;QAC1F,KAAK,EAAE,CAAC;QACR,GAAG,EAAE,IAAI;QACT,OAAO,EAAE,YAAY;KACtB;CACF,CAAC"}
|
package/dist/commands/keys.d.ts
CHANGED
|
@@ -1,2 +1,44 @@
|
|
|
1
1
|
import { type Ctx } from "../ctx.ts";
|
|
2
|
+
import type { CliCommand } from "../registry.ts";
|
|
3
|
+
/** `b3os keys`'s options. One named after a request field sets that field (ctx.ts CliOption). */
|
|
4
|
+
export declare const KEYS_OPTIONS: {
|
|
5
|
+
readonly name: {
|
|
6
|
+
readonly type: "string";
|
|
7
|
+
readonly fields: readonly ["platformCreateKey:name", "platformUpdateKey:name"];
|
|
8
|
+
};
|
|
9
|
+
readonly scope: {
|
|
10
|
+
readonly type: "string";
|
|
11
|
+
readonly multiple: true;
|
|
12
|
+
readonly fields: readonly ["platformCreateKey:scopes"];
|
|
13
|
+
};
|
|
14
|
+
readonly "spend-cap-usd": {
|
|
15
|
+
readonly type: "string";
|
|
16
|
+
readonly alias: readonly ["spend-cap"];
|
|
17
|
+
readonly fields: readonly ["platformCreateKey:spend_cap_usd", "platformUpdateKey:spend_cap_usd"];
|
|
18
|
+
};
|
|
19
|
+
readonly "expires-at": {
|
|
20
|
+
readonly type: "string";
|
|
21
|
+
readonly alias: readonly ["expires"];
|
|
22
|
+
readonly fields: readonly ["platformCreateKey:expires_at", "platformUpdateKey:expires_at"];
|
|
23
|
+
};
|
|
24
|
+
readonly "project-id": {
|
|
25
|
+
readonly type: "string";
|
|
26
|
+
readonly alias: readonly ["project"];
|
|
27
|
+
readonly fields: readonly ["platformCreateKey:project_id"];
|
|
28
|
+
};
|
|
29
|
+
readonly status: {
|
|
30
|
+
readonly type: "string";
|
|
31
|
+
readonly fields: readonly ["platformListKeys:status"];
|
|
32
|
+
};
|
|
33
|
+
readonly kind: {
|
|
34
|
+
readonly type: "string";
|
|
35
|
+
readonly fields: readonly ["platformListKeys:kind"];
|
|
36
|
+
};
|
|
37
|
+
readonly limit: {
|
|
38
|
+
readonly type: "string";
|
|
39
|
+
readonly fields: readonly ["platformListKeys:limit"];
|
|
40
|
+
};
|
|
41
|
+
};
|
|
2
42
|
export declare function keys(ctx: Ctx, argv: string[]): Promise<number>;
|
|
43
|
+
/** This module's commands, found by main.ts (src/registry.ts). */
|
|
44
|
+
export declare const commands: CliCommand[];
|
package/dist/commands/keys.js
CHANGED
|
@@ -1,19 +1,14 @@
|
|
|
1
|
-
// b3os keys
|
|
2
|
-
import { EXIT, parse, UsageError } from "../ctx.js";
|
|
1
|
+
// b3os keys ls | create | get | update | revoke (platform.yaml; served by beta-api.b3os.org).
|
|
2
|
+
import { EXIT, parse, splitSub, UsageError } from "../ctx.js";
|
|
3
|
+
import { scopeList, showUsage, unknownSub } from "./_common.js";
|
|
3
4
|
const USAGE = `usage: b3os keys <command>
|
|
4
|
-
|
|
5
|
-
create --name NAME --scope SCOPE[,SCOPE...] [--spend-cap USD] [--expires RFC3339] [--project prj_…]
|
|
5
|
+
ls [--kind api_key|cli_token] [--status active|revoked|expired] [--limit N]
|
|
6
|
+
create --name NAME --scope SCOPE[,SCOPE...] [--spend-cap-usd USD] [--expires-at RFC3339] [--project-id prj_…]
|
|
7
|
+
(signed in with b3os login, the new key cannot outlive the CLI token: --expires-at defaults to the
|
|
8
|
+
token's expiry and may not be later)
|
|
6
9
|
get <key_id>
|
|
7
|
-
update <key_id> [--name NAME] [--spend-cap USD|none] [--expires RFC3339|none] (scopes are fixed at creation)
|
|
10
|
+
update <key_id> [--name NAME] [--spend-cap-usd USD|none] [--expires-at RFC3339|none] (scopes are fixed at creation)
|
|
8
11
|
revoke <key_id> [--yes]`;
|
|
9
|
-
function scopesOf(v) {
|
|
10
|
-
if (v === undefined)
|
|
11
|
-
return undefined;
|
|
12
|
-
const list = (Array.isArray(v) ? v : [v]).flatMap((s) => String(s).split(/[,\s]+/)).filter(Boolean);
|
|
13
|
-
if (!list.length)
|
|
14
|
-
throw new UsageError("--scope needs at least one scope");
|
|
15
|
-
return list;
|
|
16
|
-
}
|
|
17
12
|
function capOf(v) {
|
|
18
13
|
if (v === undefined)
|
|
19
14
|
return undefined;
|
|
@@ -21,49 +16,75 @@ function capOf(v) {
|
|
|
21
16
|
return null;
|
|
22
17
|
const n = Number(v);
|
|
23
18
|
if (!Number.isFinite(n) || n < 0)
|
|
24
|
-
throw new UsageError("--spend-cap takes dollars or none");
|
|
19
|
+
throw new UsageError("--spend-cap-usd takes dollars or none");
|
|
25
20
|
return n;
|
|
26
21
|
}
|
|
22
|
+
/** `b3os keys`'s options. One named after a request field sets that field (ctx.ts CliOption). */
|
|
23
|
+
export const KEYS_OPTIONS = {
|
|
24
|
+
name: { type: "string", fields: ["platformCreateKey:name", "platformUpdateKey:name"] },
|
|
25
|
+
scope: { type: "string", multiple: true, fields: ["platformCreateKey:scopes"] },
|
|
26
|
+
"spend-cap-usd": {
|
|
27
|
+
type: "string",
|
|
28
|
+
alias: ["spend-cap"],
|
|
29
|
+
fields: ["platformCreateKey:spend_cap_usd", "platformUpdateKey:spend_cap_usd"],
|
|
30
|
+
},
|
|
31
|
+
"expires-at": {
|
|
32
|
+
type: "string",
|
|
33
|
+
alias: ["expires"],
|
|
34
|
+
fields: ["platformCreateKey:expires_at", "platformUpdateKey:expires_at"],
|
|
35
|
+
},
|
|
36
|
+
"project-id": { type: "string", alias: ["project"], fields: ["platformCreateKey:project_id"] },
|
|
37
|
+
status: { type: "string", fields: ["platformListKeys:status"] },
|
|
38
|
+
kind: { type: "string", fields: ["platformListKeys:kind"] },
|
|
39
|
+
limit: { type: "string", fields: ["platformListKeys:limit"] },
|
|
40
|
+
};
|
|
27
41
|
export async function keys(ctx, argv) {
|
|
28
|
-
const [sub,
|
|
29
|
-
const a = parse(rest,
|
|
30
|
-
name: { type: "string" },
|
|
31
|
-
scope: { type: "string", multiple: true },
|
|
32
|
-
"spend-cap": { type: "string" },
|
|
33
|
-
expires: { type: "string" },
|
|
34
|
-
project: { type: "string" },
|
|
35
|
-
status: { type: "string" },
|
|
36
|
-
limit: { type: "string" },
|
|
37
|
-
});
|
|
42
|
+
const [sub, rest] = splitSub(argv);
|
|
43
|
+
const a = parse(rest, KEYS_OPTIONS);
|
|
38
44
|
ctx.applyGlobals(a.values);
|
|
39
|
-
if (!sub || a.values.help)
|
|
40
|
-
ctx.
|
|
41
|
-
return sub ? EXIT.OK : EXIT.USAGE;
|
|
42
|
-
}
|
|
45
|
+
if (!sub || a.values.help)
|
|
46
|
+
return showUsage(ctx, USAGE, sub, a.values.help);
|
|
43
47
|
const b3 = ctx.client();
|
|
44
48
|
const id = a.positionals[0];
|
|
45
49
|
switch (sub) {
|
|
46
|
-
case "
|
|
47
|
-
case "
|
|
50
|
+
case "ls":
|
|
51
|
+
case "list": {
|
|
52
|
+
const kind = a.values.kind;
|
|
53
|
+
if (kind !== undefined && kind !== "api_key" && kind !== "cli_token")
|
|
54
|
+
throw new UsageError("--kind is api_key or cli_token");
|
|
48
55
|
const page = await b3.keys.listKeys({
|
|
49
56
|
status: a.values.status,
|
|
57
|
+
...(kind ? { kind } : {}),
|
|
50
58
|
limit: a.values.limit ? Number(a.values.limit) : undefined,
|
|
51
59
|
});
|
|
52
|
-
ctx.result(page, () => ctx.table(page.data.map((k) => ({ ...k, scopes: k.scopes.join(",") })), ["id", "name", "status", "scopes", "created_at"]));
|
|
60
|
+
ctx.result(page, () => ctx.table(page.data.map((k) => ({ ...k, scopes: k.scopes.join(",") })), ["id", "kind", "name", "status", "scopes", "expires_at", "created_at"]));
|
|
53
61
|
return EXIT.OK;
|
|
54
62
|
}
|
|
55
63
|
case "create": {
|
|
56
64
|
if (typeof a.values.name !== "string")
|
|
57
65
|
throw new UsageError("keys create needs --name");
|
|
58
|
-
const scopes =
|
|
66
|
+
const scopes = scopeList(a.values.scope, "--scope");
|
|
59
67
|
if (!scopes)
|
|
60
68
|
throw new UsageError("keys create needs --scope (for example --scope vision:run,sandboxes:*)");
|
|
69
|
+
// A caller that expires (a CLI token) may only create keys that expire no later (platform.yaml createKey).
|
|
70
|
+
let expires = typeof a.values["expires-at"] === "string" ? a.values["expires-at"] : undefined;
|
|
71
|
+
const me = await b3.keys.getCurrentKey().catch(() => undefined);
|
|
72
|
+
const mine = me?.expires_at ?? null;
|
|
73
|
+
if (mine) {
|
|
74
|
+
if (!expires) {
|
|
75
|
+
expires = mine;
|
|
76
|
+
ctx.info(`The key expires with your ${me?.kind === "cli_token" ? "CLI token" : "key"} at ${mine} (--expires-at to set an earlier time).`);
|
|
77
|
+
}
|
|
78
|
+
else if (Date.parse(expires) > Date.parse(mine)) {
|
|
79
|
+
throw new UsageError(`--expires-at ${expires} is later than your ${me?.kind === "cli_token" ? "CLI token" : "key"}'s expiry ${mine}; a key cannot outlive the credential that creates it`);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
61
82
|
const key = await b3.keys.createKey({
|
|
62
83
|
name: a.values.name,
|
|
63
84
|
scopes: scopes,
|
|
64
|
-
spend_cap_usd: capOf(a.values["spend-cap"]),
|
|
65
|
-
expires_at:
|
|
66
|
-
project_id: typeof a.values
|
|
85
|
+
spend_cap_usd: capOf(a.values["spend-cap-usd"]),
|
|
86
|
+
expires_at: expires,
|
|
87
|
+
project_id: typeof a.values["project-id"] === "string" ? a.values["project-id"] : undefined,
|
|
67
88
|
});
|
|
68
89
|
ctx.result(key, () => {
|
|
69
90
|
ctx.out(key.secret);
|
|
@@ -82,10 +103,10 @@ export async function keys(ctx, argv) {
|
|
|
82
103
|
case "update": {
|
|
83
104
|
if (!id)
|
|
84
105
|
throw new UsageError("keys update needs a key id");
|
|
85
|
-
const exp = a.values
|
|
106
|
+
const exp = a.values["expires-at"] === "none" ? null : a.values["expires-at"];
|
|
86
107
|
const key = await b3.keys.updateKey(id, {
|
|
87
108
|
name: a.values.name,
|
|
88
|
-
spend_cap_usd: capOf(a.values["spend-cap"]),
|
|
109
|
+
spend_cap_usd: capOf(a.values["spend-cap-usd"]),
|
|
89
110
|
expires_at: exp,
|
|
90
111
|
});
|
|
91
112
|
ctx.result(key, () => ctx.out(`Updated ${key.id}`));
|
|
@@ -102,7 +123,18 @@ export async function keys(ctx, argv) {
|
|
|
102
123
|
return EXIT.OK;
|
|
103
124
|
}
|
|
104
125
|
default:
|
|
105
|
-
throw
|
|
126
|
+
throw unknownSub("keys", sub, USAGE);
|
|
106
127
|
}
|
|
107
128
|
}
|
|
129
|
+
/** This module's commands, found by main.ts (src/registry.ts). */
|
|
130
|
+
export const commands = [
|
|
131
|
+
{
|
|
132
|
+
name: "keys",
|
|
133
|
+
summary: "List, create, update and revoke API keys",
|
|
134
|
+
order: 40,
|
|
135
|
+
run: keys,
|
|
136
|
+
options: KEYS_OPTIONS,
|
|
137
|
+
oldSubcommands: { list: "ls", rm: "revoke" },
|
|
138
|
+
},
|
|
139
|
+
];
|
|
108
140
|
//# sourceMappingURL=keys.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keys.js","sourceRoot":"","sources":["../../src/commands/keys.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"keys.js","sourceRoot":"","sources":["../../src/commands/keys.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAE9F,OAAO,EAAY,IAAI,EAAgB,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEtF,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAEhE,MAAM,KAAK,GAAG;;;;;;;0BAOY,CAAC;AAE3B,SAAS,KAAK,CAAC,CAAU;IACvB,IAAI,CAAC,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IACtC,IAAI,CAAC,KAAK,MAAM;QAAE,OAAO,IAAI,CAAC;IAC9B,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IACpB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,MAAM,IAAI,UAAU,CAAC,uCAAuC,CAAC,CAAC;IAChG,OAAO,CAAC,CAAC;AACX,CAAC;AAED,iGAAiG;AACjG,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,wBAAwB,EAAE,wBAAwB,CAAC,EAAE;IACtF,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,0BAA0B,CAAC,EAAE;IAC/E,eAAe,EAAE;QACf,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,CAAC,WAAW,CAAC;QACpB,MAAM,EAAE,CAAC,iCAAiC,EAAE,iCAAiC,CAAC;KAC/E;IACD,YAAY,EAAE;QACZ,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,CAAC,SAAS,CAAC;QAClB,MAAM,EAAE,CAAC,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AG,CAAC,GAAG,CAAC,WAAW,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;YACpD,OAAO,IAAI,CAAC,EAAE,CAAC;QACjB,CAAC;QACD,KAAK,QAAQ,CAAC;QACd,KAAK,IAAI,CAAC,CAAC,CAAC;YACV,IAAI,CAAC,EAAE;gBAAE,MAAM,IAAI,UAAU,CAAC,4BAA4B,CAAC,CAAC;YAC5D,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,sCAAsC,CAAC,CAAC;gBAAE,OAAO,IAAI,CAAC,EAAE,CAAC;YAC7F,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;YACxC,GAAG,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,CAAC;YAChD,OAAO,IAAI,CAAC,EAAE,CAAC;QACjB,CAAC;QACD;YACE,MAAM,UAAU,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;IACzC,CAAC;AACH,CAAC;AAED,kEAAkE;AAClE,MAAM,CAAC,MAAM,QAAQ,GAAiB;IACpC;QACE,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,0CAA0C;QACnD,KAAK,EAAE,EAAE;QACT,GAAG,EAAE,IAAI;QACT,OAAO,EAAE,YAAY;QACrB,cAAc,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE;KAC7C;CACF,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { CliCommand } from "../registry.ts";
|
|
2
|
+
/** `b3os apply`'s options. */
|
|
3
|
+
export declare const APPLY_OPTIONS: {
|
|
4
|
+
readonly "dry-run": {
|
|
5
|
+
readonly type: "boolean";
|
|
6
|
+
};
|
|
7
|
+
readonly file: {
|
|
8
|
+
readonly type: "string";
|
|
9
|
+
readonly short: "f";
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
/** This module's commands, found by main.ts (src/registry.ts). */
|
|
13
|
+
export declare const commands: CliCommand[];
|