@cargo-ai/cli 1.0.73 → 1.0.74
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 +21 -0
- package/build/commands/ai/agent.js +2 -2
- package/build/commands/ai/chat.js +1 -1
- package/build/commands/ai/document.js +1 -1
- package/build/commands/ai/memory.js +3 -3
- package/build/commands/ai/message.js +2 -2
- package/build/commands/ai/release.d.ts.map +1 -1
- package/build/commands/ai/release.js +3 -3
- package/build/commands/ai/vote.d.ts.map +1 -1
- package/build/commands/ai/vote.js +1 -1
- package/build/commands/auth/index.js +2 -2
- package/build/commands/billing/subscription.d.ts.map +1 -1
- package/build/commands/billing/subscription.js +3 -3
- package/build/commands/billing/usage.d.ts.map +1 -1
- package/build/commands/billing/usage.js +1 -1
- package/build/commands/connection/action.d.ts.map +1 -1
- package/build/commands/connection/action.js +1 -1
- package/build/commands/connection/connector.js +1 -1
- package/build/commands/connection/integration.d.ts.map +1 -1
- package/build/commands/connection/integration.js +1 -1
- package/build/commands/content/library.js +1 -1
- package/build/commands/context/runtime.js +1 -1
- package/build/commands/expression/recipe.d.ts.map +1 -1
- package/build/commands/expression/recipe.js +9 -9
- package/build/commands/mailboxManagement/event.js +1 -1
- package/build/commands/mailboxManagement/mailbox.d.ts.map +1 -1
- package/build/commands/mailboxManagement/mailbox.js +3 -3
- package/build/commands/mailboxManagement/message.js +1 -1
- package/build/commands/mailboxManagement/suppression.js +1 -1
- package/build/commands/mailboxManagement/thread.js +1 -1
- package/build/commands/observability/alert.js +2 -2
- package/build/commands/orchestration/action.d.ts.map +1 -1
- package/build/commands/orchestration/action.js +18 -63
- package/build/commands/orchestration/batch.js +7 -7
- package/build/commands/orchestration/node.js +2 -2
- package/build/commands/orchestration/play.d.ts.map +1 -1
- package/build/commands/orchestration/play.js +9 -9
- package/build/commands/orchestration/record.d.ts.map +1 -1
- package/build/commands/orchestration/record.js +10 -10
- package/build/commands/orchestration/release.js +1 -1
- package/build/commands/orchestration/run.d.ts.map +1 -1
- package/build/commands/orchestration/run.js +14 -14
- package/build/commands/orchestration/span.d.ts.map +1 -1
- package/build/commands/orchestration/span.js +4 -4
- package/build/commands/orchestration/tool.js +2 -2
- package/build/commands/orchestration/trace.d.ts.map +1 -1
- package/build/commands/orchestration/trace.js +2 -2
- package/build/commands/revenueOrganization/capacity.d.ts.map +1 -1
- package/build/commands/revenueOrganization/capacity.js +2 -2
- package/build/commands/revenueOrganization/territory.js +2 -2
- package/build/commands/segmentation/change.d.ts.map +1 -1
- package/build/commands/segmentation/change.js +4 -4
- package/build/commands/segmentation/record.js +1 -1
- package/build/commands/segmentation/segment.js +2 -2
- package/build/commands/start/index.js +1 -1
- package/build/commands/storage/query.js +1 -1
- package/build/commands/storage/record.js +2 -2
- package/build/commands/storage/run.js +2 -2
- package/build/commands/systemOfRecordIntegration/log.js +1 -1
- package/build/commands/systemOfRecordIntegration/systemOfRecord.js +1 -1
- package/build/commands/version.js +1 -1
- package/build/commands/workspaceManagement/folder.d.ts.map +1 -1
- package/build/commands/workspaceManagement/folder.js +1 -1
- package/build/commands/workspaceManagement/role.d.ts.map +1 -1
- package/build/commands/workspaceManagement/role.js +2 -2
- package/build/commands/workspaceManagement/session.js +1 -1
- package/build/commands/workspaceManagement/user.d.ts.map +1 -1
- package/build/commands/workspaceManagement/user.js +2 -2
- package/build/commands/workspaceManagement/workspaces.js +1 -1
- package/build/utils/booleanOption.d.ts.map +1 -1
- package/build/utils/booleanOption.js +5 -4
- package/package.json +3 -3
- package/build/commands/orchestration/costTable.d.ts +0 -121
- package/build/commands/orchestration/costTable.d.ts.map +0 -1
- package/build/commands/orchestration/costTable.js +0 -363
package/README.md
CHANGED
|
@@ -234,6 +234,27 @@ npm run type:check
|
|
|
234
234
|
npm run lint:check
|
|
235
235
|
```
|
|
236
236
|
|
|
237
|
+
### Declaring an option's values
|
|
238
|
+
|
|
239
|
+
An option with a closed set of values lists them in its placeholder, never in
|
|
240
|
+
its description:
|
|
241
|
+
|
|
242
|
+
```ts
|
|
243
|
+
.option("--format <csv|json>", "Export format")
|
|
244
|
+
.option("--statuses <idle,pending,success>", "Filter by statuses")
|
|
245
|
+
.option("--is-finished [true|false]", "Only return finished runs")
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
A pipe means "one of these", a comma means "any of these, comma-separated", and
|
|
249
|
+
that is the whole grammar. Commander treats the placeholder as a display name,
|
|
250
|
+
so this changes nothing at parse time — but `--help` shows the set, and the
|
|
251
|
+
interactive palette turns it into a menu rather than an empty text field. Values
|
|
252
|
+
written into the description instead are invisible to both.
|
|
253
|
+
|
|
254
|
+
Use commander's own `.choices()` only when the CLI should _reject_ anything
|
|
255
|
+
else. It usually should not: the API owns these lists, and a value it starts
|
|
256
|
+
accepting would be refused here until someone noticed.
|
|
257
|
+
|
|
237
258
|
## License
|
|
238
259
|
|
|
239
260
|
See the project for license information.
|
|
@@ -23,7 +23,7 @@ export function registerAgentCommands(parent, getApi) {
|
|
|
23
23
|
.command("create")
|
|
24
24
|
.description("Create an agent")
|
|
25
25
|
.requiredOption("--name <name>", "Agent name (string, required)")
|
|
26
|
-
.requiredOption("--icon-color <
|
|
26
|
+
.requiredOption("--icon-color <grey|green|purple|yellow|blue|red>", "Icon color (string, required)")
|
|
27
27
|
.requiredOption("--icon-face <face>", "Icon face identifier (string, required)")
|
|
28
28
|
.option("--description <text>", "Agent description (string)")
|
|
29
29
|
.option("--folder-uuid <uuid>", "Folder UUID to place the agent in (string)")
|
|
@@ -65,7 +65,7 @@ Trigger object shape:
|
|
|
65
65
|
.description("Update an agent")
|
|
66
66
|
.requiredOption("--uuid <uuid>", "Agent UUID (string, required)")
|
|
67
67
|
.option("--name <name>", "Agent name (string)")
|
|
68
|
-
.option("--icon-color <
|
|
68
|
+
.option("--icon-color <grey|green|purple|yellow|blue|red>", "Icon color (string)")
|
|
69
69
|
.option("--icon-face <face>", "Icon face identifier (string)")
|
|
70
70
|
.option("--description <text>", "Agent description (string)")
|
|
71
71
|
.option("--folder-uuid <uuid>", "Folder UUID (string)")
|
|
@@ -9,7 +9,7 @@ export function registerChatCommands(parent, getApi) {
|
|
|
9
9
|
.option("--agent-uuid <uuid>", "Filter by agent UUID (string)")
|
|
10
10
|
.option("--release-uuid <uuid>", "Filter by release UUID (string)")
|
|
11
11
|
.option("--user-uuid <uuid>", "Filter by user UUID (string)")
|
|
12
|
-
.option("--trigger-type <
|
|
12
|
+
.option("--trigger-type <chat|connector|draft|web_extension|app|schedule|workflow>", "Filter by trigger type")
|
|
13
13
|
.option("--search <text>", "Case-insensitive partial match on chat name or slug")
|
|
14
14
|
.option("--limit <n>", "Max results to return (integer)")
|
|
15
15
|
.option("--offset <n>", "Number of results to skip (integer)")
|
|
@@ -30,7 +30,7 @@ export function registerDocumentCommands(parent, getApi) {
|
|
|
30
30
|
.command("create")
|
|
31
31
|
.description("Create a document")
|
|
32
32
|
.requiredOption("--uuid <uuid>", "Document UUID")
|
|
33
|
-
.requiredOption("--kind <
|
|
33
|
+
.requiredOption("--kind <text|code|image|sheet>", "Document kind")
|
|
34
34
|
.requiredOption("--title <title>", "Document title")
|
|
35
35
|
.requiredOption("--content <content>", "Document content")
|
|
36
36
|
.action(async (opts) => {
|
|
@@ -4,7 +4,7 @@ export function registerMemoryCommands(parent, getApi) {
|
|
|
4
4
|
memory
|
|
5
5
|
.command("list")
|
|
6
6
|
.description("List memories")
|
|
7
|
-
.requiredOption("--scope <
|
|
7
|
+
.requiredOption("--scope <user|agent>", "Scope")
|
|
8
8
|
.option("--agent-uuid <uuid>", "Agent UUID (required when scope is agent)")
|
|
9
9
|
.action(async (opts) => {
|
|
10
10
|
const api = getApi();
|
|
@@ -18,7 +18,7 @@ export function registerMemoryCommands(parent, getApi) {
|
|
|
18
18
|
.command("remove")
|
|
19
19
|
.description("Remove a memory")
|
|
20
20
|
.requiredOption("--mem0-id <id>", "Memory ID")
|
|
21
|
-
.requiredOption("--scope <
|
|
21
|
+
.requiredOption("--scope <user|agent>", "Scope")
|
|
22
22
|
.option("--agent-uuid <uuid>", "Agent UUID (required when scope is agent)")
|
|
23
23
|
.action(async (opts) => {
|
|
24
24
|
const api = getApi();
|
|
@@ -33,7 +33,7 @@ export function registerMemoryCommands(parent, getApi) {
|
|
|
33
33
|
.description("Update a memory")
|
|
34
34
|
.requiredOption("--mem0-id <id>", "Memory ID")
|
|
35
35
|
.requiredOption("--content <text>", "Memory content")
|
|
36
|
-
.requiredOption("--scope <
|
|
36
|
+
.requiredOption("--scope <user|agent>", "Scope")
|
|
37
37
|
.option("--agent-uuid <uuid>", "Agent UUID (required when scope is agent)")
|
|
38
38
|
.action(async (opts) => {
|
|
39
39
|
const api = getApi();
|
|
@@ -21,14 +21,14 @@ export function registerMessageCommands(parent, getApi) {
|
|
|
21
21
|
.option("--capabilities <json>", "Capabilities to enable (JSON array of capability objects)")
|
|
22
22
|
.option("--mcp-clients <json>", "MCP clients to connect (JSON array of MCP client objects)")
|
|
23
23
|
.option("--system-prompt <text>", "System prompt override (string)")
|
|
24
|
-
.option("--with-reasoning [
|
|
24
|
+
.option("--with-reasoning [true|false]", "Enable reasoning mode (defaults to true when passed bare)", parseBooleanOption)
|
|
25
25
|
.option("--temperature <n>", "Sampling temperature (float, 0.0-1.0)")
|
|
26
26
|
.option("--max-steps <n>", "Maximum number of agentic steps (integer)")
|
|
27
27
|
.option("--integration-slug <slug>", "Integration slug (string)")
|
|
28
28
|
.option("--connector-uuid <uuid>", "Connector UUID (string)")
|
|
29
29
|
.option("--language-model-slug <slug>", "Language model slug (string)")
|
|
30
30
|
.option("--output <json>", 'Output format for the assistant message (JSON object, e.g. \'{"type":"text"}\' or \'{"type":"jsonSchema","jsonSchema":{...}}\'). Defaults to text when omitted.')
|
|
31
|
-
.option("--wait-until-finished [
|
|
31
|
+
.option("--wait-until-finished [true|false]", "Poll the assistant message until finished before returning (defaults to true when passed bare)", parseBooleanOption)
|
|
32
32
|
.option("--polling-interval <ms>", "Polling interval in milliseconds, used with --wait-until-finished (integer, default: 5000)", "5000")
|
|
33
33
|
.addHelpText("after", `
|
|
34
34
|
Examples:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"release.d.ts","sourceRoot":"","sources":["../../../src/commands/ai/release.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAIxC,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,
|
|
1
|
+
{"version":3,"file":"release.d.ts","sourceRoot":"","sources":["../../../src/commands/ai/release.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAIxC,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CA0SN"}
|
|
@@ -9,7 +9,7 @@ export function registerReleaseCommands(parent, getApi) {
|
|
|
9
9
|
.description("List AI releases")
|
|
10
10
|
.option("--agent-uuid <uuid>", "Filter by agent UUID (string)")
|
|
11
11
|
.option("--user-uuid <uuid>", "Filter by user UUID (string)")
|
|
12
|
-
.option("--statuses <
|
|
12
|
+
.option("--statuses <draft,deployed,archived>", "Filter by statuses")
|
|
13
13
|
.option("--limit <n>", "Max results to return (integer)")
|
|
14
14
|
.option("--offset <n>", "Number of results to skip (integer)")
|
|
15
15
|
.action(async (opts) => {
|
|
@@ -57,7 +57,7 @@ export function registerReleaseCommands(parent, getApi) {
|
|
|
57
57
|
.requiredOption("--agent-uuid <uuid>", "Agent UUID (string, required)")
|
|
58
58
|
.option("--parent-uuid <uuid>", "Parent release UUID to inherit from (string)")
|
|
59
59
|
.option("--system-prompt <text>", "System prompt (string)")
|
|
60
|
-
.option("--with-reasoning [
|
|
60
|
+
.option("--with-reasoning [true|false]", "Enable reasoning mode (defaults to true when passed bare)", parseBooleanOption)
|
|
61
61
|
.option("--temperature <n>", "Sampling temperature (float, 0.0-1.0)")
|
|
62
62
|
.option("--max-steps <n>", "Maximum agentic steps (integer)")
|
|
63
63
|
.option("--integration-slug <slug>", "LLM integration slug (string)")
|
|
@@ -129,7 +129,7 @@ Set "isReadOnly": false on a model resource to grant the agent write tools (inse
|
|
|
129
129
|
.requiredOption("--capabilities <json>", "Capabilities to enable (JSON array, required)")
|
|
130
130
|
.requiredOption("--suggested-actions <json>", "Suggested actions for chat UI (JSON array, required)")
|
|
131
131
|
.option("--system-prompt <text>", "System prompt (string)")
|
|
132
|
-
.option("--with-reasoning [
|
|
132
|
+
.option("--with-reasoning [true|false]", "Enable reasoning mode (defaults to true when passed bare)", parseBooleanOption)
|
|
133
133
|
.option("--temperature <n>", "Sampling temperature (float, 0.0-1.0)")
|
|
134
134
|
.option("--max-steps <n>", "Maximum agentic steps (integer)")
|
|
135
135
|
.option("--connector-uuid <uuid>", "Connector UUID (string)")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vote.d.ts","sourceRoot":"","sources":["../../../src/commands/ai/vote.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAIxC,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"vote.d.ts","sourceRoot":"","sources":["../../../src/commands/ai/vote.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAIxC,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,GAAG,IAAI,CA0C7E"}
|
|
@@ -7,7 +7,7 @@ export function registerVoteCommands(parent, getApi) {
|
|
|
7
7
|
.description("Upsert a vote")
|
|
8
8
|
.requiredOption("--chat-uuid <uuid>", "Chat UUID")
|
|
9
9
|
.requiredOption("--message-uuid <uuid>", "Message UUID")
|
|
10
|
-
.option("--is-upvoted [
|
|
10
|
+
.option("--is-upvoted [true|false]", "Upvote the message", parseBooleanOption)
|
|
11
11
|
.action(async (opts) => {
|
|
12
12
|
const api = getApi();
|
|
13
13
|
const result = await handleApiCall(() => api.ai.vote.upsert({
|
|
@@ -16,7 +16,7 @@ export function registerAuthCommands(program, getApi) {
|
|
|
16
16
|
.description("Sign in to Cargo with an emailed code (--email), via browser (--oauth), or with an existing API token (--token)")
|
|
17
17
|
.option("--email <email>", "Sign in with a code emailed to this address; creates the account on first use")
|
|
18
18
|
.option("--code <code>", 'Verification code from the email, or "-" to read it from stdin; omit to have one sent (--email only)')
|
|
19
|
-
.option("--oauth [
|
|
19
|
+
.option("--oauth [true|false]", "Sign in via browser using the OAuth 2.0 Device Authorization Flow", parseBooleanOption)
|
|
20
20
|
.option("--token <token>", "Existing Cargo API token")
|
|
21
21
|
.option("--workspace-name <name>", "Workspace to use, created if no workspace of that name exists (skips the workspace prompt)")
|
|
22
22
|
.option("--workspace-uuid <uuid>", "Workspace UUID to sign in for (skips the workspace prompt)")
|
|
@@ -83,7 +83,7 @@ Environment variables (CARGO_API_TOKEN, CARGO_WORKSPACE_UUID, CARGO_BASE_URL) ta
|
|
|
83
83
|
program
|
|
84
84
|
.command("logout")
|
|
85
85
|
.description("Sign out: revoke the saved credential and remove it locally")
|
|
86
|
-
.option("--keep-token [
|
|
86
|
+
.option("--keep-token [true|false]", "Only forget the credentials locally, leaving the session or token valid", parseBooleanOption)
|
|
87
87
|
// The credential is usually a session now, so accept the name people reach
|
|
88
88
|
// for; --keep-token stays the documented spelling for existing scripts.
|
|
89
89
|
.addOption(new Option("--keep-session").hideHelp())
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscription.d.ts","sourceRoot":"","sources":["../../../src/commands/billing/subscription.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAwFxC,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,
|
|
1
|
+
{"version":3,"file":"subscription.d.ts","sourceRoot":"","sources":["../../../src/commands/billing/subscription.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAwFxC,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CAoSN"}
|
|
@@ -86,7 +86,7 @@ Example:
|
|
|
86
86
|
.option("--card-number <number>", "Card number")
|
|
87
87
|
.option("--card-exp <MM/YYYY>", "Card expiry, e.g. 12/2030")
|
|
88
88
|
.option("--card-cvc <cvc>", "Card security code")
|
|
89
|
-
.option("--card-stdin [
|
|
89
|
+
.option("--card-stdin [true|false]", 'Read {"number","expMonth","expYear","cvc"} as JSON from stdin', parseBooleanOption)
|
|
90
90
|
.option("--timeout <seconds>", `Hosted-form mode: how long to wait for the card to change (default: ${String(DEFAULT_TIMEOUT_SECONDS)})`)
|
|
91
91
|
.option("--poll-interval <seconds>", `Hosted-form mode: how often to check for the new card (default: ${String(DEFAULT_POLL_INTERVAL_SECONDS)})`)
|
|
92
92
|
.option("--no-open", "Hosted-form mode: print the URL without launching a browser")
|
|
@@ -160,7 +160,7 @@ Example:
|
|
|
160
160
|
.command("update-plan")
|
|
161
161
|
.description("Change the credit allotment and billing cadence")
|
|
162
162
|
.requiredOption("--credits-count <n>", "Number of credits per period")
|
|
163
|
-
.requiredOption("--cadence <
|
|
163
|
+
.requiredOption("--cadence <monthly|yearly>", "Billing cadence")
|
|
164
164
|
.addHelpText("after", `
|
|
165
165
|
Examples:
|
|
166
166
|
$ cargo-ai billing subscription update-plan --credits-count 10000 --cadence monthly
|
|
@@ -176,7 +176,7 @@ Examples:
|
|
|
176
176
|
subscription
|
|
177
177
|
.command("update-topup")
|
|
178
178
|
.description("Configure automatic credit top-ups")
|
|
179
|
-
.option("--enabled [
|
|
179
|
+
.option("--enabled [true|false]", "Enable automatic top-ups (omit to disable)", parseBooleanOption)
|
|
180
180
|
.requiredOption("--credits-count <n>", "Number of credits to add per top-up")
|
|
181
181
|
.requiredOption("--threshold <n>", "Trigger top-up when remaining credits drop below this number")
|
|
182
182
|
.addHelpText("after", `
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../../src/commands/billing/usage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGxC,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,
|
|
1
|
+
{"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../../src/commands/billing/usage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGxC,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CAsDN"}
|
|
@@ -13,7 +13,7 @@ export function registerUsageCommands(parent, getApi) {
|
|
|
13
13
|
.option("--slug <slug>", "Slug")
|
|
14
14
|
.option("--agent-uuid <uuid>", "Agent UUID")
|
|
15
15
|
.option("--group-by <value>", "Group by field")
|
|
16
|
-
.option("--unit <
|
|
16
|
+
.option("--unit <billing.credits|storage.records|orchestration.executions>", "Usage unit")
|
|
17
17
|
.action(async (opts) => {
|
|
18
18
|
const api = getApi();
|
|
19
19
|
const result = await handleApiCall(() => api.billing.usage.getMetrics({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../../src/commands/connection/action.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AA+CxC,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,
|
|
1
|
+
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../../src/commands/connection/action.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AA+CxC,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CA2HN"}
|
|
@@ -9,7 +9,7 @@ export function registerActionSearchCommands(parent, getApi) {
|
|
|
9
9
|
.command("search [query...]")
|
|
10
10
|
.description("Search integration actions by keyword across action slug, name, description, and integration — " +
|
|
11
11
|
"instead of scanning the full `integration list` payload")
|
|
12
|
-
.option("--category <
|
|
12
|
+
.option("--category <engagement|marketing|sales|finance|analytics|freeform|success|support|enrichment|storage|custom>", "Filter by integration category")
|
|
13
13
|
.option("--integration <slug>", "Filter by integration slug (string)")
|
|
14
14
|
.option("--credits-only", "Only return credits-based (paid) actions (presence flag)")
|
|
15
15
|
.option("--limit <n>", `Maximum results to return (integer, default: ${String(DEFAULT_LIMIT)})`, String(DEFAULT_LIMIT))
|
|
@@ -49,7 +49,7 @@ export function registerConnectorCommands(parent, getApi) {
|
|
|
49
49
|
.requiredOption("--slug <slug>", "Field slug to autocomplete (string, required)")
|
|
50
50
|
.requiredOption("--params <json>", "Autocomplete parameters (JSON object, required)")
|
|
51
51
|
.option("--value <value>", "Search value to filter results (string)")
|
|
52
|
-
.option("--refresh [
|
|
52
|
+
.option("--refresh [true|false]", "Refresh cached results (defaults to true when passed bare)", parseBooleanOption)
|
|
53
53
|
.option("--variables <json>", "Additional variables (JSON object)")
|
|
54
54
|
.action(async (opts) => {
|
|
55
55
|
const api = getApi();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../../../src/commands/connection/integration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGxC,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,
|
|
1
|
+
{"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../../../src/commands/connection/integration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGxC,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CAuGN"}
|
|
@@ -6,7 +6,7 @@ export function registerIntegrationCommands(parent, getApi) {
|
|
|
6
6
|
integration
|
|
7
7
|
.command("list")
|
|
8
8
|
.description("List all integrations")
|
|
9
|
-
.option("--category <
|
|
9
|
+
.option("--category <engagement|marketing|sales|finance|analytics|freeform|success|support|enrichment|storage|custom>", "Filter by category")
|
|
10
10
|
.option("--slugs <list>", "Filter by integration slugs (comma-separated strings)")
|
|
11
11
|
.option("--search <search>", "Search by name, case-insensitive (string)")
|
|
12
12
|
.option("--has-actions <bool>", 'Filter by presence of actions (string: "true" or "false")')
|
|
@@ -7,7 +7,7 @@ export function registerLibraryCommands(parent, getApi) {
|
|
|
7
7
|
.command("list")
|
|
8
8
|
.description("List workspace libraries")
|
|
9
9
|
.option("--connector-uuid <uuid>", "Filter by connector UUID")
|
|
10
|
-
.option("--kind <
|
|
10
|
+
.option("--kind <native|connector>", "Filter by kind")
|
|
11
11
|
.action(async (opts) => {
|
|
12
12
|
const api = getApi();
|
|
13
13
|
const kind = opts.kind === "connector" || opts.kind === "native"
|
|
@@ -51,7 +51,7 @@ export function registerRuntimeCommands(parent, getApi) {
|
|
|
51
51
|
.requiredOption("--path <path>", "Path to the file")
|
|
52
52
|
.requiredOption("--old-string <old>", "Exact substring to replace (must occur once unless --replace-all is set)")
|
|
53
53
|
.requiredOption("--new-string <new>", "Replacement string (may be empty to delete the match). Must differ from --old-string.")
|
|
54
|
-
.option("--replace-all [
|
|
54
|
+
.option("--replace-all [true|false]", "Replace every occurrence of --old-string instead of requiring a single match", parseBooleanOption)
|
|
55
55
|
.option("--commit-message <message>", "Commit message override")
|
|
56
56
|
.action(async (opts) => {
|
|
57
57
|
const api = getApi();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recipe.d.ts","sourceRoot":"","sources":["../../../src/commands/expression/recipe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAIxC,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,
|
|
1
|
+
{"version":3,"file":"recipe.d.ts","sourceRoot":"","sources":["../../../src/commands/expression/recipe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAIxC,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CAgLN"}
|
|
@@ -5,9 +5,9 @@ export function registerRecipeCommands(parent, getApi) {
|
|
|
5
5
|
recipe
|
|
6
6
|
.command("list")
|
|
7
7
|
.description("List recipes")
|
|
8
|
-
.option("--tab <
|
|
9
|
-
.option("--ui-types <
|
|
10
|
-
.option("--categories <
|
|
8
|
+
.option("--tab <all|user|workspace|favorites>", "Tab filter")
|
|
9
|
+
.option("--ui-types <js,ai>", "UI types")
|
|
10
|
+
.option("--categories <other,classification,cleaning,marketing,sales,event,copywriting>", "Categories")
|
|
11
11
|
.option("--name <name>", "Filter by name")
|
|
12
12
|
.option("--limit <n>", "Limit")
|
|
13
13
|
.option("--offset <n>", "Offset")
|
|
@@ -45,12 +45,12 @@ export function registerRecipeCommands(parent, getApi) {
|
|
|
45
45
|
.description("Create a recipe")
|
|
46
46
|
.requiredOption("--name <name>", "Recipe name")
|
|
47
47
|
.requiredOption("--description <text>", "Recipe description")
|
|
48
|
-
.requiredOption("--category <
|
|
49
|
-
.requiredOption("--kind <
|
|
48
|
+
.requiredOption("--category <other|classification|cleaning|marketing|sales|event|copywriting>", "Category")
|
|
49
|
+
.requiredOption("--kind <jsExpression|templateExpression>", "Kind")
|
|
50
50
|
.requiredOption("--expression <expr>", "Expression")
|
|
51
|
-
.requiredOption("--instruct-to <
|
|
51
|
+
.requiredOption("--instruct-to <ai|none>", "Instruct to")
|
|
52
52
|
.requiredOption("--placeholders <json>", 'Placeholders (JSON array, e.g. [{"slug":"my_var","label":"My Variable","kind":"text"}])')
|
|
53
|
-
.option("--is-public [
|
|
53
|
+
.option("--is-public [true|false]", "Make recipe public", parseBooleanOption)
|
|
54
54
|
.action(async (opts) => {
|
|
55
55
|
const api = getApi();
|
|
56
56
|
const result = await handleApiCall(() => api.expression.recipe.create({
|
|
@@ -71,10 +71,10 @@ export function registerRecipeCommands(parent, getApi) {
|
|
|
71
71
|
.requiredOption("--uuid <uuid>", "Recipe UUID")
|
|
72
72
|
.requiredOption("--name <name>", "Recipe name")
|
|
73
73
|
.requiredOption("--description <text>", "Recipe description")
|
|
74
|
-
.requiredOption("--category <
|
|
74
|
+
.requiredOption("--category <other|classification|cleaning|marketing|sales|event|copywriting>", "Category")
|
|
75
75
|
.requiredOption("--expression <expr>", "Expression")
|
|
76
76
|
.requiredOption("--placeholders <json>", 'Placeholders (JSON array, e.g. [{"slug":"my_var","label":"My Variable","kind":"text"}])')
|
|
77
|
-
.option("--is-public [
|
|
77
|
+
.option("--is-public [true|false]", "Make recipe public", parseBooleanOption)
|
|
78
78
|
.action(async (opts) => {
|
|
79
79
|
const api = getApi();
|
|
80
80
|
const result = await handleApiCall(() => api.expression.recipe.createNewVersion({
|
|
@@ -10,7 +10,7 @@ export function registerEventCommands(parent, getApi) {
|
|
|
10
10
|
.option("--mailbox-uuid <uuid>", "Filter by mailbox")
|
|
11
11
|
.option("--message-uuid <uuid>", "Filter by outbound message")
|
|
12
12
|
.option("--thread-uuid <uuid>", "Filter by thread")
|
|
13
|
-
.option("--kinds <
|
|
13
|
+
.option("--kinds <sent,opened,clicked,replied,bounced,unsubscribed>", "Filter by kind")
|
|
14
14
|
.option("--occurred-after <date>", "Occurred after (ISO 8601)")
|
|
15
15
|
.option("--occurred-before <date>", "Occurred before (ISO 8601)")
|
|
16
16
|
.option("--search <text>", "Search actor email or snippet")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mailbox.d.ts","sourceRoot":"","sources":["../../../src/commands/mailboxManagement/mailbox.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAUxC,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,
|
|
1
|
+
{"version":3,"file":"mailbox.d.ts","sourceRoot":"","sources":["../../../src/commands/mailboxManagement/mailbox.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAUxC,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CAySN"}
|
|
@@ -9,7 +9,7 @@ export function registerMailboxCommands(parent, getApi) {
|
|
|
9
9
|
.description("List mailboxes in this workspace")
|
|
10
10
|
.option("--domain-uuid <uuid>", "Only mailboxes on this sending domain")
|
|
11
11
|
.option("--folder-uuid <uuid>", 'Folder UUID, or "none" for mailboxes not in a folder')
|
|
12
|
-
.option("--statuses <
|
|
12
|
+
.option("--statuses <pending,active,inactive>", "Filter by statuses")
|
|
13
13
|
.option("--limit <n>", "Max results to return (integer)")
|
|
14
14
|
.option("--offset <n>", "Number of results to skip (integer)")
|
|
15
15
|
.addHelpText("after", `
|
|
@@ -43,7 +43,7 @@ Example:
|
|
|
43
43
|
.command("create")
|
|
44
44
|
.description("Provision a mailbox on a sending domain the workspace owns")
|
|
45
45
|
.requiredOption("--domain-uuid <uuid>", "Sending domain UUID")
|
|
46
|
-
.requiredOption("--type <
|
|
46
|
+
.requiredOption("--type <google|shared|private>", "Mailbox flavour (outlook cannot deliver yet)")
|
|
47
47
|
.requiredOption("--username <local-part>", "Local part of the address, e.g. jane for jane@acme.com")
|
|
48
48
|
.requiredOption("--first-name <name>", "Sender first name in the From header")
|
|
49
49
|
.requiredOption("--last-name <name>", "Sender last name in the From header")
|
|
@@ -136,7 +136,7 @@ Example:
|
|
|
136
136
|
.description("Change warm-up daily target or pause/resume the pool")
|
|
137
137
|
.requiredOption("--uuid <uuid>", "Mailbox UUID")
|
|
138
138
|
.option("--daily-target <n>", "Warm-up messages per day at full ramp")
|
|
139
|
-
.option("--status <
|
|
139
|
+
.option("--status <disabled|pending|active|paused|failed>", "Warm-up state")
|
|
140
140
|
.addHelpText("after", `
|
|
141
141
|
Example:
|
|
142
142
|
$ cargo-ai mailboxManagement mailbox update-warmup --uuid 550e8400-... --status paused`)
|
|
@@ -9,7 +9,7 @@ export function registerMessageCommands(parent, getApi) {
|
|
|
9
9
|
.description("List outbound messages")
|
|
10
10
|
.option("--mailbox-uuid <uuid>", "Filter by mailbox")
|
|
11
11
|
.option("--thread-uuid <uuid>", "Filter by thread")
|
|
12
|
-
.option("--statuses <
|
|
12
|
+
.option("--statuses <pending,error,sent,opened,clicked,replied,bounced,unsubscribed>", "Filter by list status")
|
|
13
13
|
.option("--created-after <date>", "Created after (ISO 8601)")
|
|
14
14
|
.option("--created-before <date>", "Created before (ISO 8601)")
|
|
15
15
|
.option("--search <text>", "Search subject or recipient")
|
|
@@ -7,7 +7,7 @@ export function registerSuppressionCommands(parent, getApi) {
|
|
|
7
7
|
suppression
|
|
8
8
|
.command("list")
|
|
9
9
|
.description("List suppressions")
|
|
10
|
-
.option("--reasons <
|
|
10
|
+
.option("--reasons <unsubscribed,bounced,complained,manual>", "Filter by reason")
|
|
11
11
|
.option("--limit <n>", "Max results to return (integer)")
|
|
12
12
|
.option("--offset <n>", "Number of results to skip (integer)")
|
|
13
13
|
.addHelpText("after", `
|
|
@@ -8,7 +8,7 @@ export function registerThreadCommands(parent, getApi) {
|
|
|
8
8
|
.command("list")
|
|
9
9
|
.description("List threads")
|
|
10
10
|
.option("--mailbox-uuid <uuid>", "Filter by mailbox")
|
|
11
|
-
.option("--statuses <
|
|
11
|
+
.option("--statuses <pending,error,sent,opened,clicked,replied,bounced,unsubscribed>", "Filter by latest list status")
|
|
12
12
|
.option("--created-after <date>", "Created after (ISO 8601)")
|
|
13
13
|
.option("--created-before <date>", "Created before (ISO 8601)")
|
|
14
14
|
.option("--search <text>", "Search subject or recipient")
|
|
@@ -28,7 +28,7 @@ export function registerAlertCommands(parent, getApi) {
|
|
|
28
28
|
.requiredOption("--scope <json>", 'Scope (JSON), one of: {"kind":"spans","workflowUuid":"..."}, {"kind":"runs","workflowUuid":"...","statuses":["error"]}, {"kind":"records","workflowUuid":"...","statuses":["error"]}, {"kind":"orchestrationQuery","query":"select ..."}, {"kind":"storageQuery","query":"select ..."} or {"kind":"model","modelUuid":"...","filter":{...}}')
|
|
29
29
|
.requiredOption("--threshold <json>", 'Threshold (JSON). Spans, runs and records scopes: {"metric":"errorRate","operator":"gte","value":10}, {"metric":"duration","aggregation":"p95","operator":"gte","value":30}, {"metric":"credits","aggregation":"sum","operator":"gte","value":500} or {"metric":"count","operator":"lte","value":0}; model scopes: {"metric":"recordsCount","operator":"lte","value":0}, {"metric":"recordsShare","operator":"gte","value":30} (needs a scope filter), {"metric":"freshness","operator":"gte","value":60} or {"metric":"syncDuration","operator":"gte","value":300}; query scopes: {"metric":"query","operator":"gte","value":10}')
|
|
30
30
|
.option("--actions <json>", "Actions fired as runs on breach (JSON Action[]: connector, tool, or agent nodes)")
|
|
31
|
-
.option("--disabled [
|
|
31
|
+
.option("--disabled [true|false]", "Create the alert disabled", parseBooleanOption)
|
|
32
32
|
.option("--description <text>", "What this alert watches")
|
|
33
33
|
.option("--folder <uuid>", "Folder UUID to file the alert under")
|
|
34
34
|
.action(async (opts) => {
|
|
@@ -53,7 +53,7 @@ export function registerAlertCommands(parent, getApi) {
|
|
|
53
53
|
.requiredOption("--uuid <uuid>", "Alert UUID")
|
|
54
54
|
.option("--name <name>", "Alert name")
|
|
55
55
|
.option("--cron <cron>", 'Evaluation schedule: 5-field cron or "@every <interval>" (UTC), at most once a minute')
|
|
56
|
-
.option("--enabled [
|
|
56
|
+
.option("--enabled [true|false]", "Enable or disable the alert", parseBooleanOption)
|
|
57
57
|
.option("--scope <json>", "Scope (JSON). See `alert create`")
|
|
58
58
|
.option("--threshold <json>", "Threshold (JSON). See `alert create`")
|
|
59
59
|
.option("--actions <json>", "Actions fired as runs on breach (JSON Action[])")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../../src/commands/orchestration/action.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../../src/commands/orchestration/action.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAcxC,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CAgTN"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { parseBooleanOption } from "../../utils/booleanOption.js";
|
|
2
2
|
import { applyRecordsLimit, ExitCodes, failWith, handleApiCall, outputJson, parseJson, parsePositiveInt, pollBatchUntilFinished, pollRunUntilFinished, } from "../runHandler.js";
|
|
3
|
-
import { buildCostRows, groupActionsByIntegration, renderCostTable, summarize, } from "./costTable.js";
|
|
4
3
|
export function registerActionCommands(parent, getApi) {
|
|
5
4
|
const action = parent
|
|
6
5
|
.command("action")
|
|
@@ -18,21 +17,34 @@ graph needed. Creates a run and consumes credits.
|
|
|
18
17
|
|
|
19
18
|
To debug a node inside an existing workflow instead, use
|
|
20
19
|
'cargo-ai orchestration node'.`);
|
|
21
|
-
registerCostTableCommand(action, getApi);
|
|
22
20
|
const listableKinds = ["connector", "native", "tool", "agent"];
|
|
23
21
|
action
|
|
24
22
|
.command("list")
|
|
25
23
|
.description("List actions")
|
|
26
24
|
.argument("[query...]", "Keywords to match (space-separated, optional)")
|
|
27
|
-
.option("--kind <
|
|
25
|
+
.option("--kind <connector|native|tool|agent>", "Restrict to one kind")
|
|
28
26
|
.option("--integration-slug <slug>", "Restrict connector actions to this integration (string)")
|
|
29
|
-
.option("--category <
|
|
27
|
+
.option("--category <engagement|marketing|sales|finance|analytics|freeform|success|support|enrichment|storage|custom>", "Restrict connector actions to integrations in this category")
|
|
30
28
|
.option("--limit <n>", "Maximum results to return (integer). Omit to return all results.")
|
|
31
29
|
.addHelpText("after", `
|
|
32
30
|
Each result includes an 'action' object you can pass to execute, execute-batch,
|
|
33
31
|
or get-output-schema. All query terms must match (AND). Matches on the action
|
|
34
32
|
slug or name rank above integration matches, which rank above description.
|
|
35
33
|
|
|
34
|
+
Billed actions carry a 'credits' array — this is where pricing lives, so it is
|
|
35
|
+
the answer to "what does <action> cost". Actions without it cost no credits.
|
|
36
|
+
Each entry is one of three shapes, selected by the 'config' it matches:
|
|
37
|
+
|
|
38
|
+
- fixed: 'cost' credits per call.
|
|
39
|
+
- unit: 'cost' credits per 'unit' consumed, plus 'fixedCost' per call.
|
|
40
|
+
- package: 'cost' credits per block of 'unitsCount' 'unit', plus 'fixedCost'.
|
|
41
|
+
|
|
42
|
+
'fixedCost' is a base charge on top of the metered rate, not an alternative to
|
|
43
|
+
it — a search billed 0.175 fixedCost + 0.025 per item costs 0.2 for one item.
|
|
44
|
+
When several entries are present the price depends on config, and each entry's
|
|
45
|
+
'config.jsonSchema' const/enum is what selects it (an LLM model, a phone-or-
|
|
46
|
+
email toggle).
|
|
47
|
+
|
|
36
48
|
Examples:
|
|
37
49
|
$ cargo-ai orchestration action list enrich
|
|
38
50
|
$ cargo-ai orchestration action list --kind tool
|
|
@@ -65,7 +77,7 @@ Examples:
|
|
|
65
77
|
.description("Execute a single action")
|
|
66
78
|
.requiredOption("--action <json>", 'Action definition (JSON object, required). Example: \'{"kind":"tool","toolUuid":"550e8400-..."}\'')
|
|
67
79
|
.requiredOption("--data <json>", "Input data for the run (JSON object, required)")
|
|
68
|
-
.option("--wait-until-finished [
|
|
80
|
+
.option("--wait-until-finished [true|false]", "Poll the run until it reaches a terminal status before returning (defaults to true when passed bare)", parseBooleanOption)
|
|
69
81
|
.option("--polling-interval <ms>", "Polling interval in milliseconds, used with --wait-until-finished (integer, default: 5000)", "5000")
|
|
70
82
|
.option("--webhook-url <url>", "URL to call when the run completes")
|
|
71
83
|
.option("--webhook-secret <secret>", "Secret used to sign webhook deliveries")
|
|
@@ -99,7 +111,7 @@ Examples:
|
|
|
99
111
|
.option("--webhook-url <url>", "URL to call when the batch completes")
|
|
100
112
|
.option("--webhook-secret <secret>", "Secret used to sign webhook deliveries")
|
|
101
113
|
.option("--limit <n>", "Pilot: only submit the first N records (integer). Inspect the pilot's output before re-running on the full set — credits-based actions bill per record.")
|
|
102
|
-
.option("--wait-until-finished [
|
|
114
|
+
.option("--wait-until-finished [true|false]", "Poll the batch until it reaches a terminal status before returning (defaults to true when passed bare)", parseBooleanOption)
|
|
103
115
|
.option("--polling-interval <ms>", "Polling interval in milliseconds, used with --wait-until-finished (integer, default: 5000)", "5000")
|
|
104
116
|
.addHelpText("after", `
|
|
105
117
|
Examples:
|
|
@@ -160,60 +172,3 @@ Examples:
|
|
|
160
172
|
outputJson(result);
|
|
161
173
|
});
|
|
162
174
|
}
|
|
163
|
-
function registerCostTableCommand(action, getApi) {
|
|
164
|
-
action
|
|
165
|
-
.command("cost-table")
|
|
166
|
-
.description("Price list of every credits-based action in the catalog, sorted by cost (free, reads the catalog)")
|
|
167
|
-
.option("--category <category>", "Filter by integration category (string)")
|
|
168
|
-
.option("--integration <slug>", "Filter by integration slug (string)")
|
|
169
|
-
.option("--raw", "Print the markdown document instead of JSON")
|
|
170
|
-
.addHelpText("after", `
|
|
171
|
-
Free, spends nothing: the catalog is where pricing actually lives, so this is
|
|
172
|
-
the answer to "what does <action> cost" and "what is the cheapest way to do
|
|
173
|
-
<stage>" without pricing anyone copied by hand.
|
|
174
|
-
|
|
175
|
-
Covers connector actions and Cargo's own native actions: sendEmail, modelAsk
|
|
176
|
-
and fileSearch are billed, so a connector-only price list is not a complete one.
|
|
177
|
-
Filtering by --category or --integration drops the natives.
|
|
178
|
-
|
|
179
|
-
Actions absent from the output cost no credits. Actions whose price depends on
|
|
180
|
-
config (an LLM model, a phone-or-email toggle) show a range, with the
|
|
181
|
-
per-config prices in the document's second half.
|
|
182
|
-
|
|
183
|
-
Examples:
|
|
184
|
-
$ cargo-ai orchestration action cost-table
|
|
185
|
-
$ cargo-ai orchestration action cost-table --category enrichment --raw
|
|
186
|
-
$ cargo-ai orchestration action cost-table --raw > credits-cost-table.md`)
|
|
187
|
-
.action(async (opts) => {
|
|
188
|
-
const api = getApi();
|
|
189
|
-
const isFiltered = opts.category !== undefined || opts.integration !== undefined;
|
|
190
|
-
// Fetch all connector and native actions. Omitting limit returns all.
|
|
191
|
-
// When filtering by category or integration, only connectors match —
|
|
192
|
-
// natives have no category and no integrationSlug.
|
|
193
|
-
const kinds = isFiltered
|
|
194
|
-
? ["connector"]
|
|
195
|
-
: ["connector", "native"];
|
|
196
|
-
const allActions = [];
|
|
197
|
-
for (const kind of kinds) {
|
|
198
|
-
const result = await handleApiCall(() => api.orchestration.action.list({
|
|
199
|
-
kind,
|
|
200
|
-
category: opts.category,
|
|
201
|
-
integrationSlug: opts.integration,
|
|
202
|
-
}));
|
|
203
|
-
allActions.push(...result.results);
|
|
204
|
-
}
|
|
205
|
-
const catalog = groupActionsByIntegration(allActions);
|
|
206
|
-
const rows = buildCostRows(catalog);
|
|
207
|
-
const summary = summarize(catalog);
|
|
208
|
-
if (opts.raw === true) {
|
|
209
|
-
console.log(renderCostTable(rows, summary, {
|
|
210
|
-
generatedAt: new Date().toISOString().slice(0, 10),
|
|
211
|
-
filter: isFiltered
|
|
212
|
-
? { category: opts.category, integration: opts.integration }
|
|
213
|
-
: undefined,
|
|
214
|
-
}));
|
|
215
|
-
return;
|
|
216
|
-
}
|
|
217
|
-
outputJson({ summary, rows });
|
|
218
|
-
});
|
|
219
|
-
}
|