@getstackrun/cli 2.7.0 → 3.0.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 +19 -8
- package/dist/account-args.d.ts +4 -1
- package/dist/account-args.d.ts.map +1 -1
- package/dist/account-args.js +5 -1
- package/dist/account-args.js.map +1 -1
- package/dist/account-email.d.ts +0 -10
- package/dist/account-email.d.ts.map +1 -1
- package/dist/account-email.js +1 -1
- package/dist/account-email.js.map +1 -1
- package/dist/agent.d.ts +0 -5
- package/dist/agent.d.ts.map +1 -1
- package/dist/agent.js +40 -37
- package/dist/agent.js.map +1 -1
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +13 -1
- package/dist/api.js.map +1 -1
- package/dist/approvals.d.ts.map +1 -1
- package/dist/approvals.js +2 -1
- package/dist/approvals.js.map +1 -1
- package/dist/audit.d.ts.map +1 -1
- package/dist/audit.js +2 -1
- package/dist/audit.js.map +1 -1
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +18 -10
- package/dist/auth.js.map +1 -1
- package/dist/authority.d.ts.map +1 -1
- package/dist/authority.js +2 -1
- package/dist/authority.js.map +1 -1
- package/dist/brain.d.ts.map +1 -1
- package/dist/brain.js +1 -42
- package/dist/brain.js.map +1 -1
- package/dist/catalogue.d.ts +0 -1
- package/dist/catalogue.d.ts.map +1 -1
- package/dist/catalogue.js +1 -1
- package/dist/catalogue.js.map +1 -1
- package/dist/cli-input.d.ts +12 -0
- package/dist/cli-input.d.ts.map +1 -0
- package/dist/cli-input.js +100 -0
- package/dist/cli-input.js.map +1 -0
- package/dist/commands.d.ts +3 -2
- package/dist/commands.d.ts.map +1 -1
- package/dist/commands.js +47 -14
- package/dist/commands.js.map +1 -1
- package/dist/detectors.d.ts.map +1 -1
- package/dist/detectors.js +2 -1
- package/dist/detectors.js.map +1 -1
- package/dist/drive.d.ts.map +1 -1
- package/dist/drive.js +1 -43
- package/dist/drive.js.map +1 -1
- package/dist/dropoffs.d.ts.map +1 -1
- package/dist/dropoffs.js +2 -1
- package/dist/dropoffs.js.map +1 -1
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js +2 -1
- package/dist/events.js.map +1 -1
- package/dist/evidence-packs.d.ts.map +1 -1
- package/dist/evidence-packs.js +2 -1
- package/dist/evidence-packs.js.map +1 -1
- package/dist/exit.d.ts +10 -0
- package/dist/exit.d.ts.map +1 -0
- package/dist/exit.js +30 -0
- package/dist/exit.js.map +1 -0
- package/dist/help.d.ts +0 -2
- package/dist/help.d.ts.map +1 -1
- package/dist/help.js +1 -1
- package/dist/help.js.map +1 -1
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +2 -1
- package/dist/identity.js.map +1 -1
- package/dist/inbound-webhooks.d.ts.map +1 -1
- package/dist/inbound-webhooks.js +2 -1
- package/dist/inbound-webhooks.js.map +1 -1
- package/dist/index.js +19 -3
- package/dist/index.js.map +1 -1
- package/dist/intents.d.ts.map +1 -1
- package/dist/intents.js +2 -1
- package/dist/intents.js.map +1 -1
- package/dist/llm.d.ts.map +1 -1
- package/dist/llm.js +2 -1
- package/dist/llm.js.map +1 -1
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +4 -44
- package/dist/memory.js.map +1 -1
- package/dist/meta.d.ts +1 -1
- package/dist/meta.d.ts.map +1 -1
- package/dist/meta.js +11 -4
- package/dist/meta.js.map +1 -1
- package/dist/missions.d.ts +0 -8
- package/dist/missions.d.ts.map +1 -1
- package/dist/missions.js +3 -2
- package/dist/missions.js.map +1 -1
- package/dist/notifications.d.ts.map +1 -1
- package/dist/notifications.js +2 -1
- package/dist/notifications.js.map +1 -1
- package/dist/partner.d.ts.map +1 -1
- package/dist/partner.js +2 -1
- package/dist/partner.js.map +1 -1
- package/dist/passports.d.ts.map +1 -1
- package/dist/passports.js +2 -1
- package/dist/passports.js.map +1 -1
- package/dist/pay.d.ts +0 -1
- package/dist/pay.d.ts.map +1 -1
- package/dist/pay.js +0 -1
- package/dist/pay.js.map +1 -1
- package/dist/pii.d.ts.map +1 -1
- package/dist/pii.js +2 -1
- package/dist/pii.js.map +1 -1
- package/dist/proxy-serve.d.ts +0 -4
- package/dist/proxy-serve.d.ts.map +1 -1
- package/dist/proxy-serve.js +4 -4
- package/dist/proxy-serve.js.map +1 -1
- package/dist/quickstart.d.ts.map +1 -1
- package/dist/quickstart.js +17 -8
- package/dist/quickstart.js.map +1 -1
- package/dist/rentahuman.d.ts.map +1 -1
- package/dist/rentahuman.js +174 -48
- package/dist/rentahuman.js.map +1 -1
- package/dist/scan.d.ts.map +1 -1
- package/dist/scan.js +2 -1
- package/dist/scan.js.map +1 -1
- package/dist/services.d.ts.map +1 -1
- package/dist/services.js +40 -2
- package/dist/services.js.map +1 -1
- package/dist/setup.d.ts +14 -2
- package/dist/setup.d.ts.map +1 -1
- package/dist/setup.js +56 -17
- package/dist/setup.js.map +1 -1
- package/dist/skills.d.ts.map +1 -1
- package/dist/skills.js +2 -1
- package/dist/skills.js.map +1 -1
- package/dist/team.d.ts.map +1 -1
- package/dist/team.js +2 -1
- package/dist/team.js.map +1 -1
- package/dist/usage.d.ts.map +1 -1
- package/dist/usage.js +2 -1
- package/dist/usage.js.map +1 -1
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -70,7 +70,7 @@ cannot drift. Prefix each command with `npx @getstackrun/cli`.
|
|
|
70
70
|
| --- | --- |
|
|
71
71
|
| `quickstart [--provider anthropic\|openai\|openrouter] [--agent <name>]` | Guided setup: register a safe bot, issue a passport, make one governed LLM call, print the audit row |
|
|
72
72
|
| `proxy serve --agent <name\|id>` | Run a localhost LLM gateway. Point any tool's baseURL at it (dummy key ok); STACK injects the real key. No key on the box.<br>`[--port 8788] [--provider anthropic\|openai\|openrouter] [--mission-ttl 3600]` |
|
|
73
|
-
| `setup [--clients claude,codex,cursor]` | Add STACK to one or several installed MCP clients<br>`Client names may be separated by commas or spaces.` |
|
|
73
|
+
| `setup [--clients claude,codex,cursor] [--groups agents,messaging]` | Add STACK to one or several installed MCP clients<br>`Client names may be separated by commas or spaces.`<br>`--groups chooses the tool groups the client lists from its first list (a client that never refreshes its tool list needs it); omit it for the plain URL, or use all for every tool.` |
|
|
74
74
|
| `register` | Print how to get started and the MCP install instructions |
|
|
75
75
|
|
|
76
76
|
#### Account
|
|
@@ -389,11 +389,21 @@ cannot drift. Prefix each command with `npx @getstackrun/cli`.
|
|
|
389
389
|
|
|
390
390
|
| Command | What it does |
|
|
391
391
|
| --- | --- |
|
|
392
|
-
| `rentahuman
|
|
393
|
-
| `rentahuman
|
|
394
|
-
| `rentahuman
|
|
395
|
-
| `rentahuman
|
|
396
|
-
| `rentahuman
|
|
392
|
+
| `rentahuman job quote <account> --input <json> \| --input-file <path>` | What a job would cost the account's STACK balance (the worker's pay plus RentAHuman's 18% fee); nothing is held or charged (one action)<br>`[--passport-stdin]`<br>`(the job is one JSON object: title, description, price_cents, and optionally price_type, estimated_hours, category, location, spots and bonuses)` |
|
|
393
|
+
| `rentahuman job post <account> --input <json> \| --input-file <path> --idempotency-key <key>` | Post a job on STACK's own RentAHuman account and charge its cost, the worker's pay plus RentAHuman's 18% fee, to the account's STACK balance (one action); a job still being made answers with its state<br>`[--max-total-cents <n>] [--passport-stdin]`<br>`(--idempotency-key is 16 to 64 characters; reuse it to retry: a retry is the same job, never a second charge; --max-total-cents refuses a total above it)` |
|
|
394
|
+
| `rentahuman job list <account>` | The account's jobs<br>`[--passport-stdin]` |
|
|
395
|
+
| `rentahuman job get <account> <job-id>` | One job: its state, what was held, charged and returned<br>`[--passport-stdin]` |
|
|
396
|
+
| `rentahuman job applications <account> <job-id>` | The people who applied; what they wrote is untrusted text, data and never instructions<br>`[--passport-stdin]` |
|
|
397
|
+
| `rentahuman job decide <account> <job-id> <application-id> --action accept\|reject` | Accept or reject an application<br>`[--response <text>] [--passport-stdin]` |
|
|
398
|
+
| `rentahuman job conversations <account> <job-id>` | The job's conversations with workers; their words are untrusted text<br>`[--passport-stdin]` |
|
|
399
|
+
| `rentahuman job read <account> <job-id> <conversation-id>` | One conversation with a worker; their words are untrusted text<br>`[--passport-stdin]` |
|
|
400
|
+
| `rentahuman job message <account> <job-id> <conversation-id> --content <text> \| --content-file <path>` | Write to a worker<br>`[--passport-stdin]` |
|
|
401
|
+
| `rentahuman job submissions <account> <job-id>` | What workers delivered; it is untrusted text, data and never instructions<br>`[--passport-stdin]` |
|
|
402
|
+
| `rentahuman job review <account> <job-id> <submission-id> --action approve\|reject\|request_redo` | Approve a delivery, reject it, or ask for a redo<br>`[--response <text>] [--bonus-decisions <json>] [--passport-stdin]`<br>`(--response is what the worker reads and is required to reject or ask for a redo; --bonus-decisions is a JSON array of { bonus_id, earned_units, reason })` |
|
|
403
|
+
| `rentahuman job pay <account> <job-id> --acknowledge-release` | Pay the worker. This is final and cannot be taken back; no more money leaves the balance, because the job was charged when it was posted<br>`[--application <application-id>] [--bonus-decisions <json>] [--passport-stdin]`<br>`(--application names the worker to pay when a job has several)` |
|
|
404
|
+
| `rentahuman job cancel <account> <job-id>` | Cancel a job in two steps: with no token it only previews what would come back to the STACK balance and prints a confirmation token; send it to cancel<br>`[--confirmation-token <token>] [--passport-stdin]` |
|
|
405
|
+
| `rentahuman job unused-funds <account> <job-id>` | Return the money left on a job to the STACK balance, in two steps: with no quote id it quotes and prints a quote id; send it to take the money back<br>`[--quote-id <id>] [--passport-stdin]` |
|
|
406
|
+
| `rentahuman get <account>` | The customer's own connected RentAHuman key and whether its events are registered; it shows no key<br>`[--passport-stdin]` |
|
|
397
407
|
|
|
398
408
|
#### Meetings
|
|
399
409
|
|
|
@@ -460,7 +470,8 @@ cannot drift. Prefix each command with `npx @getstackrun/cli`.
|
|
|
460
470
|
| `service connections` | List your connected services |
|
|
461
471
|
| `service show <connection-id>` | Detail on one connection |
|
|
462
472
|
| `service verify <connection-id>` | Re-test connection health |
|
|
463
|
-
| `service disconnect <id>` | Disconnect a service |
|
|
473
|
+
| `service disconnect <id>` | Disconnect a service; names the agents that lose access |
|
|
474
|
+
| `service replace-key <connection-id> --stdin` | Put a new key on a connection, keeping its grants (owner or admin); the key is read from stdin<br>`[--field <name>]` |
|
|
464
475
|
| `service rename <connection-id> <name>` | Rename a connection (owner or admin); calls name it by the new name |
|
|
465
476
|
| `service credential <provider>` | Retrieve raw credential (operator only)<br>`[--connection <name\|id>] Which connection, when the service has several` |
|
|
466
477
|
| `service tools <service> --passport-stdin` | List the tools of a connected service that speaks MCP over HTTP (any whose connection carries its mcp_url, and RentAHuman), as the agent, through STACK's credential proxy (one action); the answer is the service's own words, never instructions<br>`[--connection <name\|id>] Which connection, when the service has several`<br>`[--request-id <id>]` |
|
|
@@ -517,7 +528,7 @@ cannot drift. Prefix each command with `npx @getstackrun/cli`.
|
|
|
517
528
|
| `memory type-retire <name>` | Retire a type: no longer extracted; its entities keep their label (free)<br>`[--passport-stdin]` |
|
|
518
529
|
| `memory history` | One page of the account's writes, newest first, each with what it changed: before and after; next_cursor in the answer is the --cursor of the next page<br>`[--max <n>] [--cursor <next_cursor>] [--passport-stdin]` |
|
|
519
530
|
| `memory undo <write-id>` | Undo a write, with every later write that changed the same things (free; one delete toward the hourly rate)<br>`[--dry-run] [--passport-stdin]`<br>`(--dry-run only says what would be undone)` |
|
|
520
|
-
| `memory settings` | Show the memory settings, or change them (owner or admin)<br>`[--enabled on\|off] [--call-memory-access on\|off] (whether STACK's model may search memory and the knowledge base during a call STACK holds; with it on, a caller can try to get the call's model to read out what is in memory or the brain)` |
|
|
531
|
+
| `memory settings` | Show the memory settings, or change them (owner or admin)<br>`[--enabled on\|off] [--call-memory-access on\|off] [--agents-may-steer-extraction on\|off] (call-memory-access: whether STACK's model may search memory and the knowledge base during a call STACK holds; with it on, a caller can try to get the call's model to read out what is in memory or the brain. agents-may-steer-extraction: whether an agent may steer what memory extracts from its writes; off by default)` |
|
|
521
532
|
| `memory <command> --passport-stdin` | Act as the account's agent: pipe its Passport on stdin or type it at the hidden prompt<br>`(an agent's Passport is never taken from a flag)` |
|
|
522
533
|
|
|
523
534
|
#### Brain
|
package/dist/account-args.d.ts
CHANGED
|
@@ -5,12 +5,15 @@ export declare function wholeNumber(args: string[], name: string): number | unde
|
|
|
5
5
|
export declare function takeSwitch(args: string[], name: string): boolean;
|
|
6
6
|
export declare function accountPath(args: string[]): string;
|
|
7
7
|
export declare function positional(args: string[], what: string): string;
|
|
8
|
-
export declare const PASSPORT_ARGV_FLAGS: Set<string>;
|
|
9
8
|
export declare function refusePassportInArgv(args: string[]): void;
|
|
10
9
|
export declare function readPassport(): Promise<string>;
|
|
11
10
|
export declare function passportHeaders(token: string | undefined): {
|
|
12
11
|
headers?: Record<string, string>;
|
|
13
12
|
};
|
|
13
|
+
/** The headers of a call that runs as the account agent: its Passport is read from stdin when `--passport-stdin` is given. */
|
|
14
|
+
export declare function stdinPassportHeaders(args: string[]): Promise<{
|
|
15
|
+
headers?: Record<string, string>;
|
|
16
|
+
}>;
|
|
14
17
|
/** A JSON object read from `--file`; anything else is refused. */
|
|
15
18
|
export declare function readJsonObjectFile(file: string): Record<string, unknown>;
|
|
16
19
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account-args.d.ts","sourceRoot":"","sources":["../src/account-args.ts"],"names":[],"mappings":"AAQA,wBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAIrE;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAI7D;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAK5E;AAED,qFAAqF;AACrF,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAKhE;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,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AAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAIxE;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAOxD"}
|
package/dist/account-args.js
CHANGED
|
@@ -44,7 +44,7 @@ export function positional(args, what) {
|
|
|
44
44
|
throw new Error(`Invalid input: ${what} is required`);
|
|
45
45
|
return value;
|
|
46
46
|
}
|
|
47
|
-
|
|
47
|
+
const PASSPORT_ARGV_FLAGS = new Set(['--passport', '--passport-token', '--token']);
|
|
48
48
|
export function refusePassportInArgv(args) {
|
|
49
49
|
if (args.some((arg) => PASSPORT_ARGV_FLAGS.has(arg.split('=')[0] ?? arg))) {
|
|
50
50
|
throw new Error('Passport tokens must not be placed in argv. Pipe the token on stdin or type it at the hidden prompt.');
|
|
@@ -59,6 +59,10 @@ export async function readPassport() {
|
|
|
59
59
|
export function passportHeaders(token) {
|
|
60
60
|
return token === undefined ? {} : { headers: { 'X-Passport-Token': token } };
|
|
61
61
|
}
|
|
62
|
+
/** The headers of a call that runs as the account agent: its Passport is read from stdin when `--passport-stdin` is given. */
|
|
63
|
+
export async function stdinPassportHeaders(args) {
|
|
64
|
+
return takeSwitch(args, '--passport-stdin') ? passportHeaders(await readPassport()) : {};
|
|
65
|
+
}
|
|
62
66
|
/** A JSON object read from `--file`; anything else is refused. */
|
|
63
67
|
export function readJsonObjectFile(file) {
|
|
64
68
|
const value = JSON.parse(readFileSync(file, 'utf8'));
|
package/dist/account-args.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account-args.js","sourceRoot":"","sources":["../src/account-args.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,yEAAyE;A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C;AAC3F,CAAC;AAED,kEAAkE;AAClE,MAAM,UAAU,kBAAkB,CAAC,IAAY;IAC7C,MAAM,KAAK,GAAY,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;IAC9D,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;IAClI,OAAO,KAAgC,CAAC;AAC1C,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,KAAa;IACvC,IAAI,KAAK,KAAK,MAAM;QAAE,OAAO,IAAI,CAAC;IAClC,MAAM,KAAK,GAAG,yBAAyB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACpD,IAAI,CAAC,KAAK;QAAE,MAAM,IAAI,KAAK,CAAC,oGAAoG,CAAC,CAAC;IAClI,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;IAC/E,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,wEAAwE,CAAC,CAAC;IAC1I,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/dist/account-email.d.ts
CHANGED
|
@@ -1,16 +1,6 @@
|
|
|
1
1
|
/** What the files sent from this machine come to at most, in all (10 MB): the size of one JSON request. A larger file goes up to the drive and is attached by its id. */
|
|
2
2
|
export declare const INLINE_ATTACHMENTS_MAX_BYTES: number;
|
|
3
|
-
type EmailAttachment = {
|
|
4
|
-
file_id: string;
|
|
5
|
-
} | {
|
|
6
|
-
filename: string;
|
|
7
|
-
content_type: string;
|
|
8
|
-
content_base64: string;
|
|
9
|
-
};
|
|
10
|
-
/** A drive file id attaches that drive file; anything else is a local file, read and sent inline. */
|
|
11
|
-
export declare function readAttachments(args: string[]): EmailAttachment[];
|
|
12
3
|
export declare function cmdSendEmail(path: string, args: string[]): Promise<void>;
|
|
13
4
|
export declare function cmdReplyEmail(path: string, args: string[]): Promise<void>;
|
|
14
5
|
export declare function cmdForwardEmail(path: string, args: string[]): Promise<void>;
|
|
15
|
-
export {};
|
|
16
6
|
//# sourceMappingURL=account-email.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account-email.d.ts","sourceRoot":"","sources":["../src/account-email.ts"],"names":[],"mappings":"AAYA,yKAAyK;AACzK,eAAO,MAAM,4BAA4B,QAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"account-email.d.ts","sourceRoot":"","sources":["../src/account-email.ts"],"names":[],"mappings":"AAYA,yKAAyK;AACzK,eAAO,MAAM,4BAA4B,QAAmB,CAAC;AAsH7D,wBAAsB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAiB9E;AAED,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAiB/E;AAED,wBAAsB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAgBjF"}
|
package/dist/account-email.js
CHANGED
|
@@ -52,7 +52,7 @@ function megabytes(bytes) {
|
|
|
52
52
|
return `${(Math.ceil((bytes / (1024 * 1024)) * 10) / 10).toFixed(1)} MB`;
|
|
53
53
|
}
|
|
54
54
|
/** A drive file id attaches that drive file; anything else is a local file, read and sent inline. */
|
|
55
|
-
|
|
55
|
+
function readAttachments(args) {
|
|
56
56
|
const attachments = [];
|
|
57
57
|
let inlineBytes = 0;
|
|
58
58
|
for (const value of repeated(args, '--attach')) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account-email.js","sourceRoot":"","sources":["../src/account-email.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEjE,iGAAiG;AACjG,mGAAmG;AACnG,sGAAsG;AACtG,+BAA+B;AAE/B,yKAAyK;AACzK,MAAM,CAAC,MAAM,4BAA4B,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAE7D,MAAM,aAAa,GAAG,mBAAmB,CAAC;AAE1C,6GAA6G;AAC7G,MAAM,uBAAuB,GAA2B;IACtD,MAAM,EAAE,YAAY;IACpB,KAAK,EAAE,eAAe;IACtB,MAAM,EAAE,UAAU;IAClB,OAAO,EAAE,WAAW;IACpB,MAAM,EAAE,eAAe;IACvB,OAAO,EAAE,kBAAkB;IAC3B,MAAM,EAAE,iBAAiB;IACzB,MAAM,EAAE,WAAW;IACnB,MAAM,EAAE,YAAY;IACpB,OAAO,EAAE,YAAY;IACrB,MAAM,EAAE,WAAW;IACnB,OAAO,EAAE,YAAY;IACrB,MAAM,EAAE,iBAAiB;IACzB,OAAO,EAAE,yEAAyE;IAClF,OAAO,EAAE,mEAAmE;IAC5E,OAAO,EAAE,2EAA2E;IACpF,MAAM,EAAE,YAAY;IACpB,MAAM,EAAE,WAAW;IACnB,MAAM,EAAE,WAAW;CACpB,CAAC;AAIF,+GAA+G;AA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boolean;
|
|
3
|
-
}): Promise<void>;
|
|
4
|
-
export declare function cmdAgentRotate(nameOrId: string): Promise<void>;
|
|
5
|
-
export declare function cmdAgentSignClaim(nameOrId: string, envelopePath: string, outPath: string | undefined): Promise<void>;
|
|
6
1
|
export declare function cmdAgent(args: string[]): Promise<void>;
|
|
7
2
|
//# sourceMappingURL=agent.d.ts.map
|
package/dist/agent.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"AAqoBA,wBAAsB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAmJ5D"}
|
package/dist/agent.js
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
// body { public_key (JWK), challenge_id, signed_challenge }
|
|
19
19
|
// persist { agent_id, publicKey, privateKey, enrolled_at } to
|
|
20
20
|
// ~/.stack/agents/<id>.json (mode 0600)
|
|
21
|
+
import { exit, isCliExit } from './exit.js';
|
|
21
22
|
import { env, stdout, stderr } from 'node:process';
|
|
22
23
|
// Reused below; the imports for `api`, `printTable`, `printJson`, etc.
|
|
23
24
|
// come further down via the agent listing/show/etc. section import block.
|
|
@@ -38,7 +39,7 @@ async function bearer() {
|
|
|
38
39
|
if (token)
|
|
39
40
|
return token;
|
|
40
41
|
stderr.write(`error: not signed in.\nRun \`${invokeHint('auth login')}\` first.\n`);
|
|
41
|
-
|
|
42
|
+
exit(2);
|
|
42
43
|
}
|
|
43
44
|
// Resolve a name OR id to an agent row. Names without the agt_ prefix
|
|
44
45
|
// are looked up via /v1/agents (operator-scoped). IDs starting with
|
|
@@ -51,12 +52,12 @@ async function resolveAgent(nameOrId, token) {
|
|
|
51
52
|
});
|
|
52
53
|
if (res.status === 404) {
|
|
53
54
|
stderr.write(`error: no agent with id "${nameOrId}" in your operator.\n`);
|
|
54
|
-
|
|
55
|
+
exit(1);
|
|
55
56
|
}
|
|
56
57
|
if (!res.ok) {
|
|
57
58
|
const body = await res.text();
|
|
58
59
|
stderr.write(`error: failed to fetch agent (${res.status}): ${body.slice(0, 200)}\n`);
|
|
59
|
-
|
|
60
|
+
exit(1);
|
|
60
61
|
}
|
|
61
62
|
return (await res.json());
|
|
62
63
|
}
|
|
@@ -66,14 +67,14 @@ async function resolveAgent(nameOrId, token) {
|
|
|
66
67
|
if (!listRes.ok) {
|
|
67
68
|
const body = await listRes.text();
|
|
68
69
|
stderr.write(`error: failed to list agents (${listRes.status}): ${body.slice(0, 200)}\n`);
|
|
69
|
-
|
|
70
|
+
exit(1);
|
|
70
71
|
}
|
|
71
72
|
const agents = (await listRes.json());
|
|
72
73
|
const match = findAgentByName(agents, nameOrId);
|
|
73
74
|
if (!match) {
|
|
74
75
|
stderr.write(`error: no agent named "${nameOrId}" in your operator.\n` +
|
|
75
76
|
`Register it first at https://getstack.run/agents.\n`);
|
|
76
|
-
|
|
77
|
+
exit(1);
|
|
77
78
|
}
|
|
78
79
|
return match;
|
|
79
80
|
}
|
|
@@ -157,11 +158,11 @@ async function runEnroll(agentId, token, force) {
|
|
|
157
158
|
// that's not member-readonly.
|
|
158
159
|
// Rotation (when already enrolled OR --force passed): operator-admin
|
|
159
160
|
// authority required by the API; the CLI surfaces the 409/403 cleanly.
|
|
160
|
-
|
|
161
|
+
async function cmdAgentEnroll(nameOrId, opts) {
|
|
161
162
|
if (!nameOrId) {
|
|
162
163
|
stderr.write('error: agent name or id required.\n');
|
|
163
164
|
stderr.write(`usage: ${invokeHint('agent enroll <name|id> [--force]')}\n`);
|
|
164
|
-
|
|
165
|
+
exit(2);
|
|
165
166
|
}
|
|
166
167
|
const token = await bearer();
|
|
167
168
|
const agent = await resolveAgent(nameOrId, token);
|
|
@@ -184,7 +185,7 @@ export async function cmdAgentEnroll(nameOrId, opts) {
|
|
|
184
185
|
stderr.write(`error: ${agent.id} already has a local keypair at ${path}${enrolledAt}.\n` +
|
|
185
186
|
`Use \`${invokeHint(`agent rotate ${nameOrId}`)}\` (or pass --force) to replace it. ` +
|
|
186
187
|
`Rotation requires operator-admin authority on the API.\n`);
|
|
187
|
-
|
|
188
|
+
exit(1);
|
|
188
189
|
}
|
|
189
190
|
try {
|
|
190
191
|
const stored = await runEnroll(agent.id, token, force);
|
|
@@ -195,14 +196,16 @@ export async function cmdAgentEnroll(nameOrId, opts) {
|
|
|
195
196
|
`Run any SDK call against agent_id=${agent.id} to mint the first passport.\n`);
|
|
196
197
|
}
|
|
197
198
|
catch (err) {
|
|
199
|
+
if (isCliExit(err))
|
|
200
|
+
throw err;
|
|
198
201
|
stderr.write(`error: ${err.message}\n`);
|
|
199
|
-
|
|
202
|
+
exit(1);
|
|
200
203
|
}
|
|
201
204
|
}
|
|
202
205
|
// `agent rotate <name|id>` — alias for `enroll --force`.
|
|
203
206
|
// Same auth requirements; the API enforces operator-admin on the
|
|
204
207
|
// rotation branch.
|
|
205
|
-
|
|
208
|
+
async function cmdAgentRotate(nameOrId) {
|
|
206
209
|
await cmdAgentEnroll(nameOrId, { force: true });
|
|
207
210
|
}
|
|
208
211
|
// ── Customer-managed claim signing ─────────────────
|
|
@@ -255,16 +258,16 @@ function signEnvelopeWithStoredKey(envelopeJson, storedKey) {
|
|
|
255
258
|
const coseSign1 = [protectedBytes, new Map(), payloadBytes, signature];
|
|
256
259
|
return Buffer.from(cborEncode(coseSign1)).toString('base64url');
|
|
257
260
|
}
|
|
258
|
-
|
|
261
|
+
async function cmdAgentSignClaim(nameOrId, envelopePath, outPath) {
|
|
259
262
|
if (!nameOrId) {
|
|
260
263
|
stderr.write('error: agent name or id required.\n');
|
|
261
264
|
stderr.write(`usage: ${invokeHint('agent sign-claim <name|id> --envelope <file> [--out <file>]')}\n`);
|
|
262
|
-
|
|
265
|
+
exit(2);
|
|
263
266
|
}
|
|
264
267
|
if (!envelopePath) {
|
|
265
268
|
stderr.write('error: --envelope <file> required.\n');
|
|
266
269
|
stderr.write(`usage: ${invokeHint('agent sign-claim <name|id> --envelope <file> [--out <file>]')}\n`);
|
|
267
|
-
|
|
270
|
+
exit(2);
|
|
268
271
|
}
|
|
269
272
|
const token = await bearer();
|
|
270
273
|
const agent = await resolveAgent(nameOrId, token);
|
|
@@ -272,7 +275,7 @@ export async function cmdAgentSignClaim(nameOrId, envelopePath, outPath) {
|
|
|
272
275
|
if (!existsSync(localPath)) {
|
|
273
276
|
stderr.write(`error: no local keypair for ${agent.id} at ${localPath}.\n` +
|
|
274
277
|
`Run \`${invokeHint(`agent enroll ${nameOrId}`)}\` first to generate + register a keypair.\n`);
|
|
275
|
-
|
|
278
|
+
exit(1);
|
|
276
279
|
}
|
|
277
280
|
const stored = JSON.parse(await readFile(localPath, 'utf8'));
|
|
278
281
|
let envelope;
|
|
@@ -281,7 +284,7 @@ export async function cmdAgentSignClaim(nameOrId, envelopePath, outPath) {
|
|
|
281
284
|
}
|
|
282
285
|
catch (err) {
|
|
283
286
|
stderr.write(`error: failed to read envelope from ${envelopePath}: ${err.message}\n`);
|
|
284
|
-
|
|
287
|
+
exit(1);
|
|
285
288
|
}
|
|
286
289
|
let cose;
|
|
287
290
|
try {
|
|
@@ -289,7 +292,7 @@ export async function cmdAgentSignClaim(nameOrId, envelopePath, outPath) {
|
|
|
289
292
|
}
|
|
290
293
|
catch (err) {
|
|
291
294
|
stderr.write(`error: signing failed: ${err.message}\n`);
|
|
292
|
-
|
|
295
|
+
exit(1);
|
|
293
296
|
}
|
|
294
297
|
if (outPath) {
|
|
295
298
|
await writeFile(outPath, cose, 'utf8');
|
|
@@ -339,7 +342,7 @@ function parseBoolFlag(flagName, value) {
|
|
|
339
342
|
if (value === 'false')
|
|
340
343
|
return false;
|
|
341
344
|
stderr.write(`error: ${flagName} must be true or false (got "${String(value)}").\n`);
|
|
342
|
-
|
|
345
|
+
exit(2);
|
|
343
346
|
}
|
|
344
347
|
async function agentPolicyBody(args, allowRegistrationOnly) {
|
|
345
348
|
const fromFile = takeFlag(args, '--from-file');
|
|
@@ -348,7 +351,7 @@ async function agentPolicyBody(args, allowRegistrationOnly) {
|
|
|
348
351
|
const parsed = JSON.parse(await readFile(fromFile, 'utf8'));
|
|
349
352
|
if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {
|
|
350
353
|
stderr.write('error: --from-file must contain one JSON object.\n');
|
|
351
|
-
|
|
354
|
+
exit(2);
|
|
352
355
|
}
|
|
353
356
|
body = { ...parsed };
|
|
354
357
|
}
|
|
@@ -403,7 +406,7 @@ async function cmdAgentRegister(name, description, keyMode, credentialAccess, pr
|
|
|
403
406
|
if (profile) {
|
|
404
407
|
if (profile !== 'proxied-llm-bot') {
|
|
405
408
|
stderr.write(`error: --profile must be: proxied-llm-bot (got "${profile}").\n`);
|
|
406
|
-
|
|
409
|
+
exit(2);
|
|
407
410
|
}
|
|
408
411
|
// The preset expands server-side to proxy_only + logged + stack_managed.
|
|
409
412
|
body.profile = profile;
|
|
@@ -411,14 +414,14 @@ async function cmdAgentRegister(name, description, keyMode, credentialAccess, pr
|
|
|
411
414
|
if (keyMode) {
|
|
412
415
|
if (!['stack_managed', 'customer_managed', 'co_signed'].includes(keyMode)) {
|
|
413
416
|
stderr.write(`error: --key-mode must be one of: stack_managed, customer_managed, co_signed (got "${keyMode}").\n`);
|
|
414
|
-
|
|
417
|
+
exit(2);
|
|
415
418
|
}
|
|
416
419
|
body.key_mode = keyMode;
|
|
417
420
|
}
|
|
418
421
|
if (credentialAccess) {
|
|
419
422
|
if (!['direct', 'proxy_preferred', 'proxy_only'].includes(credentialAccess)) {
|
|
420
423
|
stderr.write(`error: --credential-access must be one of: direct, proxy_preferred, proxy_only (got "${credentialAccess}").\n`);
|
|
421
|
-
|
|
424
|
+
exit(2);
|
|
422
425
|
}
|
|
423
426
|
body.credential_access = credentialAccess;
|
|
424
427
|
}
|
|
@@ -456,13 +459,13 @@ async function cmdAgentSetup(file, json) {
|
|
|
456
459
|
const parsed = JSON.parse(await readFile(file, 'utf8'));
|
|
457
460
|
if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {
|
|
458
461
|
stderr.write('error: the setup file must contain one JSON object.\n');
|
|
459
|
-
|
|
462
|
+
exit(2);
|
|
460
463
|
}
|
|
461
464
|
const body = parsed;
|
|
462
465
|
const agentPart = body['agent'];
|
|
463
466
|
if (!agentPart || typeof agentPart !== 'object' || typeof agentPart['name'] !== 'string') {
|
|
464
467
|
stderr.write('error: the setup file needs an "agent" object with a "name".\n');
|
|
465
|
-
|
|
468
|
+
exit(2);
|
|
466
469
|
}
|
|
467
470
|
const result = await governedApi('POST', '/v1/agents/setup', {
|
|
468
471
|
body: { agent: agentPart, grants: body['grants'] ?? [], allowed_hosts: body['allowed_hosts'] ?? [] },
|
|
@@ -503,7 +506,7 @@ async function cmdAgentUpdate(nameOrId, llmInjectSystemPrompt, llmRedactPii, pol
|
|
|
503
506
|
body.llm_redact_pii = llmRedactPii;
|
|
504
507
|
if (Object.keys(body).length === 0) {
|
|
505
508
|
stderr.write(`usage: ${invokeHint('agent update <name|id> [--name <new-name>] [--description <text>] [--llm-inject-system-prompt true|false] [--llm-redact-pii true|false]')}\n`);
|
|
506
|
-
|
|
509
|
+
exit(2);
|
|
507
510
|
}
|
|
508
511
|
const token = await bearer();
|
|
509
512
|
const agent = await resolveAgent(nameOrId, token);
|
|
@@ -555,7 +558,7 @@ export async function cmdAgent(args) {
|
|
|
555
558
|
if (sub === 'show' || sub === 'get') {
|
|
556
559
|
if (!target) {
|
|
557
560
|
stderr.write(`usage: ${invokeHint('agent show <name|id>')}\n`);
|
|
558
|
-
|
|
561
|
+
exit(2);
|
|
559
562
|
}
|
|
560
563
|
await cmdAgentShow(target, json);
|
|
561
564
|
return;
|
|
@@ -563,7 +566,7 @@ export async function cmdAgent(args) {
|
|
|
563
566
|
if (sub === 'register') {
|
|
564
567
|
if (!target) {
|
|
565
568
|
stderr.write(`usage: ${invokeHint('agent register <name> [--from-file policy.json] [--profile proxied-llm-bot] [--description "..."]')}\n`);
|
|
566
|
-
|
|
569
|
+
exit(2);
|
|
567
570
|
}
|
|
568
571
|
const description = takeFlag(args, '--description');
|
|
569
572
|
const policyBody = await agentPolicyBody(args, true);
|
|
@@ -579,7 +582,7 @@ export async function cmdAgent(args) {
|
|
|
579
582
|
const file = takeFlag(args, '--from-file');
|
|
580
583
|
if (typeof file !== 'string') {
|
|
581
584
|
stderr.write(`usage: ${invokeHint('agent setup --from-file setup.json')}\n`);
|
|
582
|
-
|
|
585
|
+
exit(2);
|
|
583
586
|
}
|
|
584
587
|
await cmdAgentSetup(file, json);
|
|
585
588
|
return;
|
|
@@ -587,7 +590,7 @@ export async function cmdAgent(args) {
|
|
|
587
590
|
if (sub === 'dismiss-warnings') {
|
|
588
591
|
if (!target) {
|
|
589
592
|
stderr.write(`usage: ${invokeHint('agent dismiss-warnings <name|id>')}\n`);
|
|
590
|
-
|
|
593
|
+
exit(2);
|
|
591
594
|
}
|
|
592
595
|
await cmdAgentDismissWarnings(target, json);
|
|
593
596
|
return;
|
|
@@ -595,7 +598,7 @@ export async function cmdAgent(args) {
|
|
|
595
598
|
if (sub === 'update') {
|
|
596
599
|
if (!target) {
|
|
597
600
|
stderr.write(`usage: ${invokeHint('agent update <name|id> [--name <new-name>] [--description <text>] [--from-file policy.json] [policy flags...]')}\n`);
|
|
598
|
-
|
|
601
|
+
exit(2);
|
|
599
602
|
}
|
|
600
603
|
// A new name and a new description change no authority: the same agent, called something else.
|
|
601
604
|
const newName = takeFlag(args, '--name');
|
|
@@ -613,7 +616,7 @@ export async function cmdAgent(args) {
|
|
|
613
616
|
if (sub === 'enroll') {
|
|
614
617
|
if (!target) {
|
|
615
618
|
stderr.write(`usage: ${invokeHint('agent enroll <name|id> [--force]')}\n`);
|
|
616
|
-
|
|
619
|
+
exit(2);
|
|
617
620
|
}
|
|
618
621
|
await cmdAgentEnroll(target, { force });
|
|
619
622
|
return;
|
|
@@ -621,7 +624,7 @@ export async function cmdAgent(args) {
|
|
|
621
624
|
if (sub === 'rotate') {
|
|
622
625
|
if (!target) {
|
|
623
626
|
stderr.write(`usage: ${invokeHint('agent rotate <name|id>')}\n`);
|
|
624
|
-
|
|
627
|
+
exit(2);
|
|
625
628
|
}
|
|
626
629
|
await cmdAgentRotate(target);
|
|
627
630
|
return;
|
|
@@ -629,7 +632,7 @@ export async function cmdAgent(args) {
|
|
|
629
632
|
if (sub === 'sign-claim') {
|
|
630
633
|
if (!target) {
|
|
631
634
|
stderr.write(`usage: ${invokeHint('agent sign-claim <name|id> --envelope <file> [--out <file>]')}\n`);
|
|
632
|
-
|
|
635
|
+
exit(2);
|
|
633
636
|
}
|
|
634
637
|
const envelope = takeFlag(args, '--envelope');
|
|
635
638
|
const out = takeFlag(args, '--out');
|
|
@@ -639,7 +642,7 @@ export async function cmdAgent(args) {
|
|
|
639
642
|
if (sub === 'suspend') {
|
|
640
643
|
if (!target) {
|
|
641
644
|
stderr.write(`usage: ${invokeHint('agent suspend <name|id>')}\n`);
|
|
642
|
-
|
|
645
|
+
exit(2);
|
|
643
646
|
}
|
|
644
647
|
await cmdAgentSuspend(target, 'suspended', json);
|
|
645
648
|
return;
|
|
@@ -647,7 +650,7 @@ export async function cmdAgent(args) {
|
|
|
647
650
|
if (sub === 'unsuspend' || sub === 'activate') {
|
|
648
651
|
if (!target) {
|
|
649
652
|
stderr.write(`usage: ${invokeHint('agent unsuspend <name|id>')}\n`);
|
|
650
|
-
|
|
653
|
+
exit(2);
|
|
651
654
|
}
|
|
652
655
|
await cmdAgentSuspend(target, 'active', json);
|
|
653
656
|
return;
|
|
@@ -655,7 +658,7 @@ export async function cmdAgent(args) {
|
|
|
655
658
|
if (sub === 'delete' || sub === 'rm') {
|
|
656
659
|
if (!target) {
|
|
657
660
|
stderr.write(`usage: ${invokeHint('agent delete <name|id>')}\n`);
|
|
658
|
-
|
|
661
|
+
exit(2);
|
|
659
662
|
}
|
|
660
663
|
await cmdAgentDelete(target, json);
|
|
661
664
|
return;
|
|
@@ -663,13 +666,13 @@ export async function cmdAgent(args) {
|
|
|
663
666
|
if (sub === 'unblock') {
|
|
664
667
|
if (!target) {
|
|
665
668
|
stderr.write(`usage: ${invokeHint('agent unblock <name|id>')}\n`);
|
|
666
|
-
|
|
669
|
+
exit(2);
|
|
667
670
|
}
|
|
668
671
|
await cmdAgentUnblock(target, json);
|
|
669
672
|
return;
|
|
670
673
|
}
|
|
671
674
|
stderr.write(`error: unknown agent subcommand "${sub ?? ''}".\n` +
|
|
672
675
|
`Use list | show | register | setup | dismiss-warnings | update | enroll | rotate | sign-claim | suspend | unsuspend | unblock | delete\n`);
|
|
673
|
-
|
|
676
|
+
exit(2);
|
|
674
677
|
}
|
|
675
678
|
//# sourceMappingURL=agent.js.map
|