@usenaive-sdk/cli 0.15.1 → 1.0.1
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 +43 -402
- package/dist/index.js +51796 -502
- package/package.json +22 -18
- package/dist/client.d.ts +0 -108
- package/dist/client.js +0 -458
- package/dist/client.js.map +0 -1
- package/dist/commands/account-kits.d.ts +0 -2
- package/dist/commands/account-kits.js +0 -71
- package/dist/commands/account-kits.js.map +0 -1
- package/dist/commands/aeo.d.ts +0 -2
- package/dist/commands/aeo.js +0 -451
- package/dist/commands/aeo.js.map +0 -1
- package/dist/commands/agent-profiles.d.ts +0 -11
- package/dist/commands/agent-profiles.js +0 -120
- package/dist/commands/agent-profiles.js.map +0 -1
- package/dist/commands/agents.d.ts +0 -2
- package/dist/commands/agents.js +0 -916
- package/dist/commands/agents.js.map +0 -1
- package/dist/commands/app-data.d.ts +0 -2
- package/dist/commands/app-data.js +0 -445
- package/dist/commands/app-data.js.map +0 -1
- package/dist/commands/approvals.d.ts +0 -2
- package/dist/commands/approvals.js +0 -242
- package/dist/commands/approvals.js.map +0 -1
- package/dist/commands/apps.d.ts +0 -9
- package/dist/commands/apps.js +0 -844
- package/dist/commands/apps.js.map +0 -1
- package/dist/commands/audio.d.ts +0 -9
- package/dist/commands/audio.js +0 -391
- package/dist/commands/audio.js.map +0 -1
- package/dist/commands/auth.d.ts +0 -31
- package/dist/commands/auth.js +0 -428
- package/dist/commands/auth.js.map +0 -1
- package/dist/commands/billing.d.ts +0 -2
- package/dist/commands/billing.js +0 -250
- package/dist/commands/billing.js.map +0 -1
- package/dist/commands/brain.d.ts +0 -2
- package/dist/commands/brain.js +0 -1300
- package/dist/commands/brain.js.map +0 -1
- package/dist/commands/browser.d.ts +0 -2
- package/dist/commands/browser.js +0 -378
- package/dist/commands/browser.js.map +0 -1
- package/dist/commands/business.d.ts +0 -2
- package/dist/commands/business.js +0 -566
- package/dist/commands/business.js.map +0 -1
- package/dist/commands/cards.d.ts +0 -2
- package/dist/commands/cards.js +0 -419
- package/dist/commands/cards.js.map +0 -1
- package/dist/commands/ceo.d.ts +0 -2
- package/dist/commands/ceo.js +0 -369
- package/dist/commands/ceo.js.map +0 -1
- package/dist/commands/clone.d.ts +0 -2
- package/dist/commands/clone.js +0 -203
- package/dist/commands/clone.js.map +0 -1
- package/dist/commands/companies.d.ts +0 -10
- package/dist/commands/companies.js +0 -283
- package/dist/commands/companies.js.map +0 -1
- package/dist/commands/company-data.d.ts +0 -2
- package/dist/commands/company-data.js +0 -168
- package/dist/commands/company-data.js.map +0 -1
- package/dist/commands/compute.d.ts +0 -2
- package/dist/commands/compute.js +0 -498
- package/dist/commands/compute.js.map +0 -1
- package/dist/commands/config.d.ts +0 -2
- package/dist/commands/config.js +0 -36
- package/dist/commands/config.js.map +0 -1
- package/dist/commands/connections.d.ts +0 -8
- package/dist/commands/connections.js +0 -137
- package/dist/commands/connections.js.map +0 -1
- package/dist/commands/cron-jobs.d.ts +0 -2
- package/dist/commands/cron-jobs.js +0 -245
- package/dist/commands/cron-jobs.js.map +0 -1
- package/dist/commands/domains.d.ts +0 -2
- package/dist/commands/domains.js +0 -474
- package/dist/commands/domains.js.map +0 -1
- package/dist/commands/ecommerce.d.ts +0 -2
- package/dist/commands/ecommerce.js +0 -277
- package/dist/commands/ecommerce.js.map +0 -1
- package/dist/commands/email.d.ts +0 -2
- package/dist/commands/email.js +0 -336
- package/dist/commands/email.js.map +0 -1
- package/dist/commands/employees.d.ts +0 -2
- package/dist/commands/employees.js +0 -190
- package/dist/commands/employees.js.map +0 -1
- package/dist/commands/env.d.ts +0 -7
- package/dist/commands/env.js +0 -112
- package/dist/commands/env.js.map +0 -1
- package/dist/commands/formation.d.ts +0 -2
- package/dist/commands/formation.js +0 -273
- package/dist/commands/formation.js.map +0 -1
- package/dist/commands/identity.d.ts +0 -2
- package/dist/commands/identity.js +0 -110
- package/dist/commands/identity.js.map +0 -1
- package/dist/commands/images.d.ts +0 -2
- package/dist/commands/images.js +0 -371
- package/dist/commands/images.js.map +0 -1
- package/dist/commands/init.d.ts +0 -5
- package/dist/commands/init.js +0 -43
- package/dist/commands/init.js.map +0 -1
- package/dist/commands/jobs.d.ts +0 -2
- package/dist/commands/jobs.js +0 -144
- package/dist/commands/jobs.js.map +0 -1
- package/dist/commands/keys.d.ts +0 -2
- package/dist/commands/keys.js +0 -156
- package/dist/commands/keys.js.map +0 -1
- package/dist/commands/legacy-auth.d.ts +0 -27
- package/dist/commands/legacy-auth.js +0 -64
- package/dist/commands/legacy-auth.js.map +0 -1
- package/dist/commands/llm.d.ts +0 -2
- package/dist/commands/llm.js +0 -125
- package/dist/commands/llm.js.map +0 -1
- package/dist/commands/login.d.ts +0 -2
- package/dist/commands/login.js +0 -65
- package/dist/commands/login.js.map +0 -1
- package/dist/commands/logout.d.ts +0 -7
- package/dist/commands/logout.js +0 -55
- package/dist/commands/logout.js.map +0 -1
- package/dist/commands/logs.d.ts +0 -2
- package/dist/commands/logs.js +0 -42
- package/dist/commands/logs.js.map +0 -1
- package/dist/commands/loops.d.ts +0 -2
- package/dist/commands/loops.js +0 -260
- package/dist/commands/loops.js.map +0 -1
- package/dist/commands/media.d.ts +0 -2
- package/dist/commands/media.js +0 -183
- package/dist/commands/media.js.map +0 -1
- package/dist/commands/memory.d.ts +0 -2
- package/dist/commands/memory.js +0 -151
- package/dist/commands/memory.js.map +0 -1
- package/dist/commands/mobile.d.ts +0 -4
- package/dist/commands/mobile.js +0 -382
- package/dist/commands/mobile.js.map +0 -1
- package/dist/commands/module.d.ts +0 -8
- package/dist/commands/module.js +0 -48
- package/dist/commands/module.js.map +0 -1
- package/dist/commands/objectives.d.ts +0 -2
- package/dist/commands/objectives.js +0 -243
- package/dist/commands/objectives.js.map +0 -1
- package/dist/commands/payments.d.ts +0 -2
- package/dist/commands/payments.js +0 -131
- package/dist/commands/payments.js.map +0 -1
- package/dist/commands/people.d.ts +0 -2
- package/dist/commands/people.js +0 -197
- package/dist/commands/people.js.map +0 -1
- package/dist/commands/phone.d.ts +0 -2
- package/dist/commands/phone.js +0 -289
- package/dist/commands/phone.js.map +0 -1
- package/dist/commands/projects.d.ts +0 -13
- package/dist/commands/projects.js +0 -220
- package/dist/commands/projects.js.map +0 -1
- package/dist/commands/queue.d.ts +0 -2
- package/dist/commands/queue.js +0 -121
- package/dist/commands/queue.js.map +0 -1
- package/dist/commands/register.d.ts +0 -2
- package/dist/commands/register.js +0 -88
- package/dist/commands/register.js.map +0 -1
- package/dist/commands/report.d.ts +0 -17
- package/dist/commands/report.js +0 -109
- package/dist/commands/report.js.map +0 -1
- package/dist/commands/sandbox.d.ts +0 -2
- package/dist/commands/sandbox.js +0 -558
- package/dist/commands/sandbox.js.map +0 -1
- package/dist/commands/search.d.ts +0 -2
- package/dist/commands/search.js +0 -223
- package/dist/commands/search.js.map +0 -1
- package/dist/commands/seo.d.ts +0 -2
- package/dist/commands/seo.js +0 -528
- package/dist/commands/seo.js.map +0 -1
- package/dist/commands/sessions.d.ts +0 -6
- package/dist/commands/sessions.js +0 -109
- package/dist/commands/sessions.js.map +0 -1
- package/dist/commands/social-data.d.ts +0 -2
- package/dist/commands/social-data.js +0 -245
- package/dist/commands/social-data.js.map +0 -1
- package/dist/commands/social.d.ts +0 -2
- package/dist/commands/social.js +0 -407
- package/dist/commands/social.js.map +0 -1
- package/dist/commands/status.d.ts +0 -2
- package/dist/commands/status.js +0 -79
- package/dist/commands/status.js.map +0 -1
- package/dist/commands/support.d.ts +0 -2
- package/dist/commands/support.js +0 -134
- package/dist/commands/support.js.map +0 -1
- package/dist/commands/tasks.d.ts +0 -2
- package/dist/commands/tasks.js +0 -409
- package/dist/commands/tasks.js.map +0 -1
- package/dist/commands/teams.d.ts +0 -69
- package/dist/commands/teams.js +0 -503
- package/dist/commands/teams.js.map +0 -1
- package/dist/commands/trading.d.ts +0 -2
- package/dist/commands/trading.js +0 -333
- package/dist/commands/trading.js.map +0 -1
- package/dist/commands/up.d.ts +0 -551
- package/dist/commands/up.js +0 -1149
- package/dist/commands/up.js.map +0 -1
- package/dist/commands/usage.d.ts +0 -2
- package/dist/commands/usage.js +0 -73
- package/dist/commands/usage.js.map +0 -1
- package/dist/commands/use.d.ts +0 -12
- package/dist/commands/use.js +0 -96
- package/dist/commands/use.js.map +0 -1
- package/dist/commands/users.d.ts +0 -10
- package/dist/commands/users.js +0 -82
- package/dist/commands/users.js.map +0 -1
- package/dist/commands/vault.d.ts +0 -2
- package/dist/commands/vault.js +0 -101
- package/dist/commands/vault.js.map +0 -1
- package/dist/commands/verification.d.ts +0 -2
- package/dist/commands/verification.js +0 -152
- package/dist/commands/verification.js.map +0 -1
- package/dist/commands/verify-email.d.ts +0 -19
- package/dist/commands/verify-email.js +0 -130
- package/dist/commands/verify-email.js.map +0 -1
- package/dist/commands/video.d.ts +0 -2
- package/dist/commands/video.js +0 -417
- package/dist/commands/video.js.map +0 -1
- package/dist/commands/voice.d.ts +0 -2
- package/dist/commands/voice.js +0 -516
- package/dist/commands/voice.js.map +0 -1
- package/dist/commands/wallet.d.ts +0 -2
- package/dist/commands/wallet.js +0 -244
- package/dist/commands/wallet.js.map +0 -1
- package/dist/commands/webhooks.d.ts +0 -13
- package/dist/commands/webhooks.js +0 -119
- package/dist/commands/webhooks.js.map +0 -1
- package/dist/commands/whoami.d.ts +0 -2
- package/dist/commands/whoami.js +0 -53
- package/dist/commands/whoami.js.map +0 -1
- package/dist/config.d.ts +0 -42
- package/dist/config.js +0 -83
- package/dist/config.js.map +0 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.js.map +0 -1
- package/dist/lib/brain-select.d.ts +0 -193
- package/dist/lib/brain-select.js +0 -403
- package/dist/lib/brain-select.js.map +0 -1
- package/dist/lib/cli-validation.d.ts +0 -12
- package/dist/lib/cli-validation.js +0 -46
- package/dist/lib/cli-validation.js.map +0 -1
- package/dist/lib/config-errors.d.ts +0 -4
- package/dist/lib/config-errors.js +0 -13
- package/dist/lib/config-errors.js.map +0 -1
- package/dist/lib/deprecation.d.ts +0 -158
- package/dist/lib/deprecation.js +0 -140
- package/dist/lib/deprecation.js.map +0 -1
- package/dist/lib/duration.d.ts +0 -8
- package/dist/lib/duration.js +0 -11
- package/dist/lib/duration.js.map +0 -1
- package/dist/lib/http-response.d.ts +0 -11
- package/dist/lib/http-response.js +0 -96
- package/dist/lib/http-response.js.map +0 -1
- package/dist/lib/llm-paywall.d.ts +0 -82
- package/dist/lib/llm-paywall.js +0 -231
- package/dist/lib/llm-paywall.js.map +0 -1
- package/dist/lib/pricing.d.ts +0 -132
- package/dist/lib/pricing.js +0 -148
- package/dist/lib/pricing.js.map +0 -1
- package/dist/lib/starter-config.d.ts +0 -13
- package/dist/lib/starter-config.js +0 -71
- package/dist/lib/starter-config.js.map +0 -1
- package/dist/lib/stream-frames.d.ts +0 -114
- package/dist/lib/stream-frames.js +0 -169
- package/dist/lib/stream-frames.js.map +0 -1
- package/dist/lib/teams-catalog.d.ts +0 -141
- package/dist/lib/teams-catalog.js +0 -841
- package/dist/lib/teams-catalog.js.map +0 -1
- package/dist/lib/unknown-command.d.ts +0 -71
- package/dist/lib/unknown-command.js +0 -132
- package/dist/lib/unknown-command.js.map +0 -1
- package/dist/lib/version-check.d.ts +0 -26
- package/dist/lib/version-check.js +0 -21
- package/dist/lib/version-check.js.map +0 -1
- package/dist/output.d.ts +0 -246
- package/dist/output.js +0 -539
- package/dist/output.js.map +0 -1
- package/dist/prompt.d.ts +0 -17
- package/dist/prompt.js +0 -70
- package/dist/prompt.js.map +0 -1
- package/dist/version.d.ts +0 -2
- package/dist/version.js +0 -14
- package/dist/version.js.map +0 -1
|
@@ -1,242 +0,0 @@
|
|
|
1
|
-
import { Command } from "commander";
|
|
2
|
-
import { apiRequest, handleApiError, activeUserId } from "../client.js";
|
|
3
|
-
import { agentOutput } from "../output.js";
|
|
4
|
-
/**
|
|
5
|
-
* THE SUCCESS ENVELOPE.
|
|
6
|
-
*
|
|
7
|
-
* `naive --help` promises "every command returns structured JSON with result
|
|
8
|
-
* data, next steps, and contextual guidance for autonomous operation"
|
|
9
|
-
* (index.ts), /cli/overview documents the same shape. `approvals` shipped with
|
|
10
|
-
* `next_steps: []` on `get`/`deny`/`watch`, `<id>` placeholders on `list`, and
|
|
11
|
-
* no `hints` anywhere — so an agent that listed its own frozen actions was told
|
|
12
|
-
* neither which id to act on nor that a pending action has not run yet.
|
|
13
|
-
*
|
|
14
|
-
* Both are DERIVED from the response the API just returned — the id in a
|
|
15
|
-
* suggested command is an id the API echoed (`serializeApproval`,
|
|
16
|
-
* api/src/services/approvals.ts:410), a hint restates a field it actually sent —
|
|
17
|
-
* so neither can drift from the queue's real state. Same rule `workloadHints`
|
|
18
|
-
* follows in compute.ts and `creditCostHint` in output.ts.
|
|
19
|
-
*/
|
|
20
|
-
/** Resolve the user path segment — explicit --user wins, else active, else "default". */
|
|
21
|
-
function userPath(user) {
|
|
22
|
-
return `/v1/users/${user ?? activeUserId() ?? "default"}`;
|
|
23
|
-
}
|
|
24
|
-
/** A non-empty string field, or undefined — the API sends `null` for unset. */
|
|
25
|
-
function str(o, k) {
|
|
26
|
-
const v = o?.[k];
|
|
27
|
-
return typeof v === "string" && v ? v : undefined;
|
|
28
|
-
}
|
|
29
|
-
/** The id for a suggested command: the one the API echoed, else what the caller
|
|
30
|
-
* typed, so a next step is copy-pasteable rather than an `<id>` placeholder. */
|
|
31
|
-
function aid(data, typed) {
|
|
32
|
-
return str(data, "id") ?? typed ?? "<id>";
|
|
33
|
-
}
|
|
34
|
-
/** The rows of a queue read — the API answers `{ approvals: [...] }`. */
|
|
35
|
-
function rows(data) {
|
|
36
|
-
const a = data?.approvals;
|
|
37
|
-
if (!Array.isArray(a))
|
|
38
|
-
return [];
|
|
39
|
-
return a.filter((r) => !!r && typeof r === "object");
|
|
40
|
-
}
|
|
41
|
-
/** What `pending` MEANS, stated once — the action is frozen and has not run. */
|
|
42
|
-
const FROZEN = "Pending means frozen: the action has NOT run yet, and runs only if it is approved.";
|
|
43
|
-
/** Hints echoed off one approval the API returned — restated, never asserted. */
|
|
44
|
-
function approvalHints(data) {
|
|
45
|
-
const out = [];
|
|
46
|
-
const status = str(data, "status");
|
|
47
|
-
if (status)
|
|
48
|
-
out.push(`Status: ${status}`);
|
|
49
|
-
const title = str(data, "title");
|
|
50
|
-
if (title)
|
|
51
|
-
out.push(`Action: ${title}`);
|
|
52
|
-
const type = str(data, "action_type");
|
|
53
|
-
if (type)
|
|
54
|
-
out.push(`Action type: ${type}`);
|
|
55
|
-
const reason = str(data, "reason");
|
|
56
|
-
if (reason)
|
|
57
|
-
out.push(`Reason on record: ${reason}`);
|
|
58
|
-
const err = str(data, "error");
|
|
59
|
-
if (err)
|
|
60
|
-
out.push(`Failed with: ${err}`);
|
|
61
|
-
if (status === "pending")
|
|
62
|
-
out.push(FROZEN);
|
|
63
|
-
if (status === "executed")
|
|
64
|
-
out.push("Already replayed by the API — `result` holds what the action returned.");
|
|
65
|
-
if (status === "denied")
|
|
66
|
-
out.push("Denied — this action will never run.");
|
|
67
|
-
// The contract is a NON-EMPTY hints array; a row the API sent with none of the
|
|
68
|
-
// fields above still has to say something true rather than nothing.
|
|
69
|
-
return out.length > 0 ? out : ["The API returned this approval with no status or title."];
|
|
70
|
-
}
|
|
71
|
-
/** Hints for a queue read — the shape of the queue the API just returned. */
|
|
72
|
-
function queueHints(list, filter) {
|
|
73
|
-
const out = [list.length === 1 ? "1 approval." : `${list.length} approvals.`];
|
|
74
|
-
if (filter)
|
|
75
|
-
out.push(`Filtered by status: ${filter}.`);
|
|
76
|
-
const counts = new Map();
|
|
77
|
-
for (const r of list)
|
|
78
|
-
counts.set(str(r, "status") ?? "unknown", (counts.get(str(r, "status") ?? "unknown") ?? 0) + 1);
|
|
79
|
-
if (counts.size > 0)
|
|
80
|
-
out.push(`Statuses: ${[...counts].map(([s, n]) => `${s} ${n}`).join(", ")}.`);
|
|
81
|
-
if ((counts.get("pending") ?? 0) > 0)
|
|
82
|
-
out.push(FROZEN);
|
|
83
|
-
if (list.length === 0) {
|
|
84
|
-
out.push('Only actions that require human approval land here — a gated action returns HTTP 202 with status "pending_approval" and waits.');
|
|
85
|
-
}
|
|
86
|
-
return out;
|
|
87
|
-
}
|
|
88
|
-
export const approvalsCmd = new Command("approvals")
|
|
89
|
-
.alias("approval")
|
|
90
|
-
.description("Governance — review & resolve agent-requested approvals for sensitive actions")
|
|
91
|
-
.addHelpText("after", `
|
|
92
|
-
Sensitive agent actions (issue/fund a card, purchase a domain, KYC, form a
|
|
93
|
-
company, sign up for / connect a 3rd-party service) can require HUMAN APPROVAL.
|
|
94
|
-
When gated, the action returns HTTP 202 with status "pending_approval" and is
|
|
95
|
-
frozen here until a human approves it — only then does it actually run.
|
|
96
|
-
|
|
97
|
-
Subcommands:
|
|
98
|
-
naive approvals list List approvals (use --status pending)
|
|
99
|
-
naive approvals get <id> Show one approval (status, frozen payload)
|
|
100
|
-
naive approvals approve <id> Approve → the API replays the frozen action
|
|
101
|
-
naive approvals deny <id> Deny (action never runs)
|
|
102
|
-
naive approvals watch <id> Poll until the approval is resolved
|
|
103
|
-
|
|
104
|
-
Scope: pass --user <id> to target one tenant user, or omit to use the active
|
|
105
|
-
user (set with 'naive use <id>'). Omit --user with no active user to use the
|
|
106
|
-
agent profile's default user.
|
|
107
|
-
|
|
108
|
-
Examples:
|
|
109
|
-
$ naive approvals list --status pending
|
|
110
|
-
$ naive approvals approve <approval-uuid>
|
|
111
|
-
$ naive approvals deny <approval-uuid> --reason "not now"
|
|
112
|
-
`);
|
|
113
|
-
approvalsCmd
|
|
114
|
-
.command("list")
|
|
115
|
-
.description("List approvals (optionally filter by status)")
|
|
116
|
-
.option("--user <id>", "Target a specific tenant user")
|
|
117
|
-
.option("--status <status>", "pending | executed | failed | denied | expired")
|
|
118
|
-
.action(async (opts) => {
|
|
119
|
-
const q = opts.status ? `?status=${encodeURIComponent(opts.status)}` : "";
|
|
120
|
-
const resp = await apiRequest("GET", `${userPath(opts.user)}/approvals${q}`, undefined, { userId: opts.user });
|
|
121
|
-
handleApiError("approvals.list", resp);
|
|
122
|
-
const list = rows(resp.data);
|
|
123
|
-
// Point at a REAL row — a pending one first, since that is the only state
|
|
124
|
-
// approve/deny can act on. With an empty queue there is no id to name, so
|
|
125
|
-
// the next step is the re-read that would surface one.
|
|
126
|
-
const target = list.find((r) => str(r, "status") === "pending") ?? list[0];
|
|
127
|
-
const next = target
|
|
128
|
-
? [
|
|
129
|
-
{ command: `naive approvals get ${aid(target)}`, description: "Show this approval's frozen payload" },
|
|
130
|
-
{ command: `naive approvals approve ${aid(target)}`, description: "Approve it — the API replays the action" },
|
|
131
|
-
{ command: `naive approvals deny ${aid(target)}`, description: "Deny it — the action never runs" },
|
|
132
|
-
]
|
|
133
|
-
: opts.status
|
|
134
|
-
? [{ command: "naive approvals list", description: `Show every approval, not just "${opts.status}"` }]
|
|
135
|
-
: [{ command: "naive approvals list --status pending", description: "Re-check for newly frozen actions" }];
|
|
136
|
-
agentOutput({
|
|
137
|
-
action: "approvals.list",
|
|
138
|
-
result: resp.data,
|
|
139
|
-
next_steps: next,
|
|
140
|
-
hints: queueHints(list, opts.status),
|
|
141
|
-
});
|
|
142
|
-
});
|
|
143
|
-
approvalsCmd
|
|
144
|
-
.command("get")
|
|
145
|
-
.description("Show a single approval")
|
|
146
|
-
.argument("<id>")
|
|
147
|
-
.option("--user <id>", "Target a specific tenant user")
|
|
148
|
-
.action(async (id, opts) => {
|
|
149
|
-
const resp = await apiRequest("GET", `${userPath(opts.user)}/approvals/${id}`, undefined, { userId: opts.user });
|
|
150
|
-
handleApiError("approvals.get", resp);
|
|
151
|
-
agentOutput({
|
|
152
|
-
action: "approvals.get",
|
|
153
|
-
result: resp.data,
|
|
154
|
-
// Only a pending approval can be approved, denied or waited on; once it is
|
|
155
|
-
// resolved the honest next move is back to the queue.
|
|
156
|
-
next_steps: str(resp.data, "status") === "pending"
|
|
157
|
-
? [
|
|
158
|
-
{ command: `naive approvals approve ${aid(resp.data, id)}`, description: "Approve — the API replays the frozen action" },
|
|
159
|
-
{ command: `naive approvals deny ${aid(resp.data, id)}`, description: "Deny — the action never runs" },
|
|
160
|
-
{ command: `naive approvals watch ${aid(resp.data, id)}`, description: "Block until someone resolves it" },
|
|
161
|
-
]
|
|
162
|
-
: [{ command: "naive approvals list --status pending", description: "Back to the actions still awaiting a decision" }],
|
|
163
|
-
hints: approvalHints(resp.data),
|
|
164
|
-
});
|
|
165
|
-
});
|
|
166
|
-
approvalsCmd
|
|
167
|
-
.command("approve")
|
|
168
|
-
.description("Approve a pending action — the API replays the frozen request")
|
|
169
|
-
.argument("<id>")
|
|
170
|
-
.option("--user <id>", "Target a specific tenant user")
|
|
171
|
-
.action(async (id, opts) => {
|
|
172
|
-
const resp = await apiRequest("POST", `${userPath(opts.user)}/approvals/${id}/approve`, undefined, {
|
|
173
|
-
userId: opts.user,
|
|
174
|
-
});
|
|
175
|
-
handleApiError("approvals.approve", resp);
|
|
176
|
-
agentOutput({
|
|
177
|
-
action: "approvals.approve",
|
|
178
|
-
result: resp.data,
|
|
179
|
-
next_steps: [
|
|
180
|
-
{ command: `naive approvals get ${aid(resp.data, id)}`, description: "Inspect the execution result" },
|
|
181
|
-
{ command: "naive approvals list --status pending", description: "Continue with the rest of the queue" },
|
|
182
|
-
],
|
|
183
|
-
hints: approvalHints(resp.data),
|
|
184
|
-
});
|
|
185
|
-
});
|
|
186
|
-
approvalsCmd
|
|
187
|
-
.command("deny")
|
|
188
|
-
.description("Deny a pending action (it will never run)")
|
|
189
|
-
.argument("<id>")
|
|
190
|
-
.option("--user <id>", "Target a specific tenant user")
|
|
191
|
-
.option("--reason <reason>", "Why it was denied")
|
|
192
|
-
.action(async (id, opts) => {
|
|
193
|
-
const resp = await apiRequest("POST", `${userPath(opts.user)}/approvals/${id}/deny`, { reason: opts.reason }, { userId: opts.user });
|
|
194
|
-
handleApiError("approvals.deny", resp);
|
|
195
|
-
agentOutput({
|
|
196
|
-
action: "approvals.deny",
|
|
197
|
-
result: resp.data,
|
|
198
|
-
next_steps: [
|
|
199
|
-
{ command: `naive approvals get ${aid(resp.data, id)}`, description: "Confirm the recorded denial and its reason" },
|
|
200
|
-
{ command: "naive approvals list --status pending", description: "Continue with the rest of the queue" },
|
|
201
|
-
],
|
|
202
|
-
hints: approvalHints(resp.data),
|
|
203
|
-
});
|
|
204
|
-
});
|
|
205
|
-
approvalsCmd
|
|
206
|
-
.command("watch")
|
|
207
|
-
.description("Poll a pending approval until it is resolved")
|
|
208
|
-
.argument("<id>")
|
|
209
|
-
.option("--user <id>", "Target a specific tenant user")
|
|
210
|
-
.option("--interval <ms>", "Poll interval in ms", "2000")
|
|
211
|
-
.option("--timeout <ms>", "Give up after this many ms", "300000")
|
|
212
|
-
.action(async (id, opts) => {
|
|
213
|
-
const interval = Number(opts.interval ?? "2000");
|
|
214
|
-
const deadline = Date.now() + Number(opts.timeout ?? "300000");
|
|
215
|
-
for (;;) {
|
|
216
|
-
const resp = await apiRequest("GET", `${userPath(opts.user)}/approvals/${id}`, undefined, { userId: opts.user });
|
|
217
|
-
handleApiError("approvals.watch", resp);
|
|
218
|
-
const status = resp.data.status;
|
|
219
|
-
const timedOut = Date.now() >= deadline;
|
|
220
|
-
if (status !== "pending" || timedOut) {
|
|
221
|
-
// Two very different exits share this return: resolved, or gave up while
|
|
222
|
-
// still pending. The envelope has to say which one happened.
|
|
223
|
-
const gaveUp = status === "pending" && timedOut;
|
|
224
|
-
agentOutput({
|
|
225
|
-
action: "approvals.watch",
|
|
226
|
-
result: resp.data,
|
|
227
|
-
next_steps: gaveUp
|
|
228
|
-
? [
|
|
229
|
-
{ command: `naive approvals watch ${aid(resp.data, id)}`, description: "Keep waiting — it is still pending" },
|
|
230
|
-
{ command: `naive approvals approve ${aid(resp.data, id)}`, description: "Stop waiting and approve it now" },
|
|
231
|
-
]
|
|
232
|
-
: [{ command: "naive approvals list --status pending", description: "Back to the actions still awaiting a decision" }],
|
|
233
|
-
hints: gaveUp
|
|
234
|
-
? [...approvalHints(resp.data), `Timed out after ${opts.timeout ?? "300000"}ms while still pending — nothing was decided.`]
|
|
235
|
-
: approvalHints(resp.data),
|
|
236
|
-
});
|
|
237
|
-
return;
|
|
238
|
-
}
|
|
239
|
-
await new Promise((r) => setTimeout(r, interval));
|
|
240
|
-
}
|
|
241
|
-
});
|
|
242
|
-
//# sourceMappingURL=approvals.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"approvals.js","sourceRoot":"","sources":["../../src/commands/approvals.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C;;;;;;;;;;;;;;;GAeG;AAEH,yFAAyF;AACzF,SAAS,QAAQ,CAAC,IAAa;IAC7B,OAAO,aAAa,IAAI,IAAI,YAAY,EAAE,IAAI,SAAS,EAAE,CAAC;AAC5D,CAAC;AAED,+EAA+E;AAC/E,SAAS,GAAG,CAAC,CAAU,EAAE,CAAS;IAChC,MAAM,CAAC,GAAI,CAAgD,EAAE,CAAC,CAAC,CAAC,CAAC;IACjE,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACpD,CAAC;AAED;iFACiF;AACjF,SAAS,GAAG,CAAC,IAAa,EAAE,KAAc;IACxC,OAAO,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,KAAK,IAAI,MAAM,CAAC;AAC5C,CAAC;AAED,yEAAyE;AACzE,SAAS,IAAI,CAAC,IAAa;IACzB,MAAM,CAAC,GAAI,IAAmD,EAAE,SAAS,CAAC;IAC1E,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;QAAE,OAAO,EAAE,CAAC;IACjC,OAAO,CAAC,CAAC,MAA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,EAAE,OAAO,EAAE,2BAA2B,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,EAAE,WAAW,EAAE,iCAAiC,EAAE;qBAC7G;oBACH,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,uCAAuC,EAAE,WAAW,EAAE,+CAA+C,EAAE,CAAC;gBACxH,KAAK,EAAE,MAAM;oBACX,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,mBAAmB,IAAI,CAAC,OAAO,IAAI,QAAQ,+CAA+C,CAAC;oBAC3H,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC;aAC7B,CAAC,CAAC;YACH,OAAO;QACT,CAAC;QACD,MAAM,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC;IACpD,CAAC;AACH,CAAC,CAAC,CAAC"}
|
package/dist/commands/apps.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Command } from "commander";
|
|
2
|
-
export declare const appsCmd: Command;
|
|
3
|
-
/**
|
|
4
|
-
* Parse --body JSON. Agents / shlex often strip quotes from
|
|
5
|
-
* `{"a":"b"}` → `{a:b}`, and word-split leave `{` `a:b` `}` tokens.
|
|
6
|
-
* Join tokens, try JSON.parse, then repair unquoted keys/values (including
|
|
7
|
-
* nested edge-function `files[].content` source strings).
|
|
8
|
-
*/
|
|
9
|
-
export declare function parseJsonBody(raw: string | string[] | undefined, flag: string): Record<string, unknown> | undefined;
|