@usenaive-sdk/cli 0.12.2 → 0.12.5
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 +22 -0
- package/dist/client.d.ts +26 -1
- package/dist/client.js +167 -5
- package/dist/client.js.map +1 -1
- package/dist/commands/aeo.js +13 -6
- package/dist/commands/aeo.js.map +1 -1
- package/dist/commands/auth.d.ts +30 -0
- package/dist/commands/auth.js +400 -0
- package/dist/commands/auth.js.map +1 -0
- package/dist/commands/billing.js +9 -9
- package/dist/commands/billing.js.map +1 -1
- package/dist/commands/brain.d.ts +2 -0
- package/dist/commands/brain.js +509 -0
- package/dist/commands/brain.js.map +1 -0
- package/dist/commands/browser.js +28 -1
- package/dist/commands/browser.js.map +1 -1
- package/dist/commands/clone.d.ts +2 -0
- package/dist/commands/clone.js +199 -0
- package/dist/commands/clone.js.map +1 -0
- package/dist/commands/config.d.ts +2 -0
- package/dist/commands/config.js +36 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/env.d.ts +3 -3
- package/dist/commands/env.js +68 -4
- package/dist/commands/env.js.map +1 -1
- package/dist/commands/images.js +2 -2
- package/dist/commands/keys.js +26 -3
- package/dist/commands/keys.js.map +1 -1
- package/dist/commands/loops.d.ts +2 -0
- package/dist/commands/loops.js +260 -0
- package/dist/commands/loops.js.map +1 -0
- package/dist/commands/mobile.d.ts +2 -0
- package/dist/commands/mobile.js +341 -0
- package/dist/commands/mobile.js.map +1 -0
- package/dist/commands/payments.d.ts +2 -0
- package/dist/commands/payments.js +131 -0
- package/dist/commands/payments.js.map +1 -0
- package/dist/commands/phone.js +77 -2
- package/dist/commands/phone.js.map +1 -1
- package/dist/commands/register.js +4 -4
- package/dist/commands/register.js.map +1 -1
- package/dist/commands/usage.js +4 -4
- package/dist/commands/video.js +94 -273
- package/dist/commands/video.js.map +1 -1
- package/dist/commands/voice.d.ts +2 -0
- package/dist/commands/voice.js +516 -0
- package/dist/commands/voice.js.map +1 -0
- package/dist/commands/wallet.d.ts +2 -0
- package/dist/commands/wallet.js +244 -0
- package/dist/commands/wallet.js.map +1 -0
- package/dist/config.d.ts +15 -0
- package/dist/config.js +35 -6
- package/dist/config.js.map +1 -1
- package/dist/index.js +70 -4
- package/dist/index.js.map +1 -1
- package/dist/lib/unknown-command.d.ts +17 -0
- package/dist/lib/unknown-command.js +19 -0
- package/dist/lib/unknown-command.js.map +1 -0
- package/dist/lib/version-check.d.ts +26 -0
- package/dist/lib/version-check.js +21 -0
- package/dist/lib/version-check.js.map +1 -0
- package/dist/output.d.ts +20 -5
- package/dist/output.js +150 -5
- package/dist/output.js.map +1 -1
- package/dist/prompt.d.ts +17 -0
- package/dist/prompt.js +70 -0
- package/dist/prompt.js.map +1 -0
- package/package.json +9 -4
- package/dist/commands/billing-client.d.ts +0 -2
- package/dist/commands/billing-client.js +0 -271
- package/dist/commands/billing-client.js.map +0 -1
- package/dist/commands/crm-app.d.ts +0 -2
- package/dist/commands/crm-app.js +0 -306
- package/dist/commands/crm-app.js.map +0 -1
- package/dist/commands/crm.d.ts +0 -2
- package/dist/commands/crm.js +0 -319
- package/dist/commands/crm.js.map +0 -1
- package/dist/commands/integrations.d.ts +0 -2
- package/dist/commands/integrations.js +0 -199
- package/dist/commands/integrations.js.map +0 -1
- package/dist/commands/operators.d.ts +0 -11
- package/dist/commands/operators.js +0 -120
- package/dist/commands/operators.js.map +0 -1
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import { Command } from "commander";
|
|
2
|
-
import { apiRequest, handleApiError, activeUserId } from "../client.js";
|
|
3
|
-
import { agentOutput } from "../output.js";
|
|
4
|
-
/**
|
|
5
|
-
* Operators — the per-tenant governed real-world bundle (identity, money, comms,
|
|
6
|
-
* runtime), governed on every action and instantly revocable.
|
|
7
|
-
*/
|
|
8
|
-
export const operatorsCmd = new Command("operators")
|
|
9
|
-
.alias("operator")
|
|
10
|
-
.description("Provision & govern a real-world operator per tenant (identity, card, comms, runtime)");
|
|
11
|
-
operatorsCmd
|
|
12
|
-
.command("provision")
|
|
13
|
-
.description("Provision a governed operator for a tenant from a template")
|
|
14
|
-
.argument("<template>", "Template name (registered via naive.config.ts / naive up)")
|
|
15
|
-
.option("--user <id>", "Tenant id to provision the operator for (defaults to the active/default user)")
|
|
16
|
-
.option("--idempotency-key <key>", "Idempotency key — a retried provision resumes the same operator")
|
|
17
|
-
.option("--overrides <json>", "JSON overrides applied on top of the template (legalName, domain, …)")
|
|
18
|
-
.action(async (template, opts) => {
|
|
19
|
-
const user = opts.user ?? activeUserId() ?? "default";
|
|
20
|
-
let overrides;
|
|
21
|
-
if (opts.overrides) {
|
|
22
|
-
try {
|
|
23
|
-
overrides = JSON.parse(opts.overrides);
|
|
24
|
-
}
|
|
25
|
-
catch {
|
|
26
|
-
agentOutput({
|
|
27
|
-
action: "operators.provision",
|
|
28
|
-
result: { error: "invalid --overrides JSON" },
|
|
29
|
-
next_steps: [{ command: "naive operators provision <template> --overrides '{\"identity\":{\"legalName\":\"Acme\"}}'", description: "Valid JSON" }],
|
|
30
|
-
});
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
const resp = await apiRequest("POST", `/v1/users/${user}/operators`, {
|
|
35
|
-
template,
|
|
36
|
-
idempotency_key: opts.idempotencyKey,
|
|
37
|
-
overrides,
|
|
38
|
-
});
|
|
39
|
-
handleApiError("operators.provision", resp);
|
|
40
|
-
const op = resp.data;
|
|
41
|
-
agentOutput({
|
|
42
|
-
action: "operators.provision",
|
|
43
|
-
result: resp.data,
|
|
44
|
-
next_steps: [
|
|
45
|
-
{ command: `naive operators get ${op.id ?? "<id>"}`, description: "Check provisioning status" },
|
|
46
|
-
{ command: `naive operators revoke ${op.id ?? "<id>"}`, description: "Absolute revoke (freeze card, halt sends)" },
|
|
47
|
-
],
|
|
48
|
-
hints: [
|
|
49
|
-
"Pull the operator's governed tools with @usenaive/server: const tools = await op.tools().",
|
|
50
|
-
"Run the agent on your own runtime (Eve / AgentCore / LangGraph) — governance is constant.",
|
|
51
|
-
],
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
operatorsCmd
|
|
55
|
-
.command("list")
|
|
56
|
-
.description("List provisioned operators")
|
|
57
|
-
.action(async () => {
|
|
58
|
-
const resp = await apiRequest("GET", `/v1/operators`);
|
|
59
|
-
handleApiError("operators.list", resp);
|
|
60
|
-
agentOutput({
|
|
61
|
-
action: "operators.list",
|
|
62
|
-
result: resp.data,
|
|
63
|
-
next_steps: [{ command: "naive operators get <id>", description: "Inspect one operator" }],
|
|
64
|
-
});
|
|
65
|
-
});
|
|
66
|
-
operatorsCmd
|
|
67
|
-
.command("get")
|
|
68
|
-
.description("Get an operator's status")
|
|
69
|
-
.argument("<id>", "Operator id")
|
|
70
|
-
.action(async (id) => {
|
|
71
|
-
const resp = await apiRequest("GET", `/v1/operators/${id}`);
|
|
72
|
-
handleApiError("operators.get", resp);
|
|
73
|
-
agentOutput({
|
|
74
|
-
action: "operators.get",
|
|
75
|
-
result: resp.data,
|
|
76
|
-
next_steps: [{ command: `naive operators revoke ${id}`, description: "Absolute revoke" }],
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
operatorsCmd
|
|
80
|
-
.command("revoke")
|
|
81
|
-
.description("Absolute revoke — freeze the card, halt sends, tear down runtime")
|
|
82
|
-
.argument("<id>", "Operator id")
|
|
83
|
-
.action(async (id) => {
|
|
84
|
-
const resp = await apiRequest("POST", `/v1/operators/${id}/revoke`);
|
|
85
|
-
handleApiError("operators.revoke", resp);
|
|
86
|
-
agentOutput({
|
|
87
|
-
action: "operators.revoke",
|
|
88
|
-
result: resp.data,
|
|
89
|
-
next_steps: [{ command: "naive operators list", description: "Confirm the operator is revoked" }],
|
|
90
|
-
hints: ["Revoke is absolute: the governance gateway denies all further tool calls for this operator."],
|
|
91
|
-
});
|
|
92
|
-
});
|
|
93
|
-
/**
|
|
94
|
-
* Top-level `naive revoke` sugar — revoke an operator (or, with --tenant, the
|
|
95
|
-
* operator for that tenant).
|
|
96
|
-
*/
|
|
97
|
-
export const revokeCmd = new Command("revoke")
|
|
98
|
-
.description("Absolute revoke of an operator (sugar for `naive operators revoke`)")
|
|
99
|
-
.argument("[id]", "Operator id")
|
|
100
|
-
.option("--operator <id>", "Operator id")
|
|
101
|
-
.option("--tenant <id>", "Tenant id (its operator id equals the tenant id)")
|
|
102
|
-
.action(async (idArg, opts) => {
|
|
103
|
-
const id = idArg ?? opts.operator ?? opts.tenant;
|
|
104
|
-
if (!id) {
|
|
105
|
-
agentOutput({
|
|
106
|
-
action: "revoke",
|
|
107
|
-
result: { error: "missing operator id" },
|
|
108
|
-
next_steps: [{ command: "naive revoke <operator_id>", description: "Provide an operator id" }],
|
|
109
|
-
});
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
const resp = await apiRequest("POST", `/v1/operators/${id}/revoke`);
|
|
113
|
-
handleApiError("revoke", resp);
|
|
114
|
-
agentOutput({
|
|
115
|
-
action: "revoke",
|
|
116
|
-
result: resp.data,
|
|
117
|
-
next_steps: [{ command: "naive operators list", description: "Confirm revoked" }],
|
|
118
|
-
});
|
|
119
|
-
});
|
|
120
|
-
//# sourceMappingURL=operators.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"operators.js","sourceRoot":"","sources":["../../src/commands/operators.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;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,OAAO,CAAC,WAAW,CAAC;KACjD,KAAK,CAAC,UAAU,CAAC;KACjB,WAAW,CAAC,sFAAsF,CAAC,CAAC;AAEvG,YAAY;KACT,OAAO,CAAC,WAAW,CAAC;KACpB,WAAW,CAAC,4DAA4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