@cargo-ai/cli 1.0.8 → 1.0.10

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.
Files changed (52) hide show
  1. package/build/commands/ai/agent.d.ts.map +1 -1
  2. package/build/commands/ai/agent.js +24 -14
  3. package/build/commands/ai/chat.d.ts.map +1 -1
  4. package/build/commands/ai/chat.js +21 -11
  5. package/build/commands/ai/mcpClient.d.ts.map +1 -1
  6. package/build/commands/ai/mcpClient.js +12 -6
  7. package/build/commands/ai/mcpServer.d.ts.map +1 -1
  8. package/build/commands/ai/mcpServer.js +32 -11
  9. package/build/commands/ai/message.d.ts.map +1 -1
  10. package/build/commands/ai/message.js +34 -22
  11. package/build/commands/ai/prompt.d.ts.map +1 -1
  12. package/build/commands/ai/prompt.js +23 -9
  13. package/build/commands/ai/release.d.ts.map +1 -1
  14. package/build/commands/ai/release.js +42 -42
  15. package/build/commands/ai/suggestedAction.js +3 -3
  16. package/build/commands/auth.d.ts.map +1 -1
  17. package/build/commands/auth.js +14 -3
  18. package/build/commands/connection/connector.d.ts.map +1 -1
  19. package/build/commands/connection/connector.js +23 -18
  20. package/build/commands/connection/integration.d.ts.map +1 -1
  21. package/build/commands/connection/integration.js +9 -9
  22. package/build/commands/expression/expressionEval.d.ts.map +1 -1
  23. package/build/commands/expression/expressionEval.js +10 -7
  24. package/build/commands/orchestration/action.d.ts +4 -0
  25. package/build/commands/orchestration/action.d.ts.map +1 -0
  26. package/build/commands/orchestration/action.js +64 -0
  27. package/build/commands/orchestration/batch.d.ts.map +1 -1
  28. package/build/commands/orchestration/batch.js +31 -25
  29. package/build/commands/orchestration/index.d.ts.map +1 -1
  30. package/build/commands/orchestration/index.js +4 -0
  31. package/build/commands/orchestration/log.d.ts +4 -0
  32. package/build/commands/orchestration/log.d.ts.map +1 -0
  33. package/build/commands/orchestration/log.js +122 -0
  34. package/build/commands/orchestration/node.d.ts.map +1 -1
  35. package/build/commands/orchestration/node.js +16 -14
  36. package/build/commands/orchestration/play.d.ts.map +1 -1
  37. package/build/commands/orchestration/play.js +15 -7
  38. package/build/commands/orchestration/record.js +1 -1
  39. package/build/commands/orchestration/release.d.ts.map +1 -1
  40. package/build/commands/orchestration/release.js +6 -4
  41. package/build/commands/orchestration/run.d.ts.map +1 -1
  42. package/build/commands/orchestration/run.js +103 -82
  43. package/build/commands/segmentation/segment.d.ts.map +1 -1
  44. package/build/commands/segmentation/segment.js +33 -22
  45. package/build/commands/storage/model.d.ts.map +1 -1
  46. package/build/commands/storage/model.js +4 -0
  47. package/build/commands/storage/record.d.ts.map +1 -1
  48. package/build/commands/storage/record.js +15 -8
  49. package/build/commands/workspace/user.d.ts.map +1 -1
  50. package/build/commands/workspace/user.js +22 -13
  51. package/build/index.js +14 -1
  52. package/package.json +2 -2
@@ -2,7 +2,7 @@ import { handleApiCall, outputJson, parseJson } from "../runHandler.js";
2
2
  export function registerConnectorCommands(parent, getApi) {
3
3
  const connector = parent
4
4
  .command("connector")
5
- .description("Connector operations");
5
+ .description("Manage connectors (list, get, create, update, remove, autocomplete)");
6
6
  connector
7
7
  .command("list")
8
8
  .description("List all connectors")
@@ -40,13 +40,13 @@ export function registerConnectorCommands(parent, getApi) {
40
40
  });
41
41
  connector
42
42
  .command("autocomplete")
43
- .description("Autocomplete connector values")
44
- .requiredOption("--connector-uuid <uuid>", "Connector UUID")
45
- .requiredOption("--slug <slug>", "Slug")
46
- .requiredOption("--params <json>", "Params (JSON object)")
47
- .option("--value <value>", "Search value")
48
- .option("--refresh", "Refresh cached results")
49
- .option("--variables <json>", 'Variables (JSON object, e.g. {"key":"value"})')
43
+ .description("Autocomplete connector values for a given field")
44
+ .requiredOption("--connector-uuid <uuid>", "Connector UUID (string, required)")
45
+ .requiredOption("--slug <slug>", "Field slug to autocomplete (string, required)")
46
+ .requiredOption("--params <json>", "Autocomplete parameters (JSON object, required)")
47
+ .option("--value <value>", "Search value to filter results (string)")
48
+ .option("--refresh", "Refresh cached results (boolean flag)")
49
+ .option("--variables <json>", "Additional variables (JSON object)")
50
50
  .action(async (opts) => {
51
51
  const api = getApi();
52
52
  const result = await handleApiCall(() => api.connection.connector.autocomplete({
@@ -63,10 +63,10 @@ export function registerConnectorCommands(parent, getApi) {
63
63
  });
64
64
  connector
65
65
  .command("get-dynamic-schema")
66
- .description("Get dynamic schema for a connector")
67
- .requiredOption("--connector-uuid <uuid>", "Connector UUID")
68
- .requiredOption("--slug <slug>", "Slug")
69
- .requiredOption("--params <json>", "Params (JSON object)")
66
+ .description("Get dynamic schema for a connector action")
67
+ .requiredOption("--connector-uuid <uuid>", "Connector UUID (string, required)")
68
+ .requiredOption("--slug <slug>", "Action slug (string, required)")
69
+ .requiredOption("--params <json>", "Schema parameters (JSON object, required)")
70
70
  .action(async (opts) => {
71
71
  const api = getApi();
72
72
  const result = await handleApiCall(() => api.connection.connector.getDynamicSchema({
@@ -79,12 +79,17 @@ export function registerConnectorCommands(parent, getApi) {
79
79
  connector
80
80
  .command("create")
81
81
  .description("Create a connector")
82
- .requiredOption("--name <name>", "Connector name")
83
- .requiredOption("--slug <slug>", "Connector slug")
84
- .requiredOption("--integration-slug <slug>", "Integration slug")
85
- .option("--config <json>", "Configuration (JSON object)")
86
- .option("--rate-limit <json>", 'Rate limit (JSON, e.g. {"maxRequests":100,"windowMs":60000})')
87
- .option("--cache-ttl-milliseconds <n>", "Cache TTL in milliseconds")
82
+ .requiredOption("--name <name>", "Connector name (string, required)")
83
+ .requiredOption("--slug <slug>", "Connector slug identifier (string, required)")
84
+ .requiredOption("--integration-slug <slug>", "Integration slug to connect to (string, required)")
85
+ .option("--config <json>", "Connector configuration (JSON object, shape depends on integration)")
86
+ .option("--rate-limit <json>", 'Rate limit configuration (JSON object). Shape: {"maxRequests": integer, "windowMs": integer}')
87
+ .option("--cache-ttl-milliseconds <n>", "Cache TTL in milliseconds (integer)")
88
+ .addHelpText("after", `
89
+ Examples:
90
+ $ cargo-ai connection connector create --name "HubSpot" --slug hubspot-main --integration-slug hubspot
91
+ $ cargo-ai connection connector create --name "HubSpot" --slug hubspot-main --integration-slug hubspot \\
92
+ --rate-limit '{"maxRequests":100,"windowMs":60000}' --cache-ttl-milliseconds 300000`)
88
93
  .action(async (opts) => {
89
94
  const api = getApi();
90
95
  const result = await handleApiCall(() => api.connection.connector.create({
@@ -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,CAwFN"}
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,CA2FN"}
@@ -2,15 +2,15 @@ import { handleApiCall, outputJson, parseJson } from "../runHandler.js";
2
2
  export function registerIntegrationCommands(parent, getApi) {
3
3
  const integration = parent
4
4
  .command("integration")
5
- .description("Integration operations");
5
+ .description("Browse and manage integrations");
6
6
  integration
7
7
  .command("list")
8
8
  .description("List all integrations")
9
- .option("--category <category>", "Filter by category")
10
- .option("--slug <slug>", "Filter by slug")
11
- .option("--search <search>", "Search by name (case-insensitive)")
12
- .option("--has-actions <bool>", "Filter by presence of actions (true/false)")
13
- .option("--has-extractors <bool>", "Filter by presence of extractors (true/false)")
9
+ .option("--category <category>", "Filter by category (string)")
10
+ .option("--slug <slug>", "Filter by integration slug (string)")
11
+ .option("--search <search>", "Search by name, case-insensitive (string)")
12
+ .option("--has-actions <bool>", 'Filter by presence of actions (string: "true" or "false")')
13
+ .option("--has-extractors <bool>", 'Filter by presence of extractors (string: "true" or "false")')
14
14
  .action(async (opts) => {
15
15
  const api = getApi();
16
16
  const result = await handleApiCall(() => api.connection.integration.list({
@@ -48,9 +48,9 @@ export function registerIntegrationCommands(parent, getApi) {
48
48
  });
49
49
  integration
50
50
  .command("complete-oauth")
51
- .description("Complete OAuth for an integration")
52
- .requiredOption("--slug <slug>", "Integration slug")
53
- .requiredOption("--params <json>", "OAuth params (JSON object)")
51
+ .description("Complete OAuth flow for an integration")
52
+ .requiredOption("--slug <slug>", "Integration slug (string, required)")
53
+ .requiredOption("--params <json>", "OAuth callback parameters (JSON object, required)")
54
54
  .action(async (opts) => {
55
55
  const api = getApi();
56
56
  const result = await handleApiCall(() => api.connection.integration.completeOauth({
@@ -1 +1 @@
1
- {"version":3,"file":"expressionEval.d.ts","sourceRoot":"","sources":["../../../src/commands/expression/expressionEval.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGxC,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CA6CN"}
1
+ {"version":3,"file":"expressionEval.d.ts","sourceRoot":"","sources":["../../../src/commands/expression/expressionEval.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGxC,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CAsDN"}
@@ -2,12 +2,15 @@ import { handleApiCall, outputJson, parseJson } from "../runHandler.js";
2
2
  export function registerExpressionEvalCommands(parent, getApi) {
3
3
  const expr = parent
4
4
  .command("eval")
5
- .description("Expression evaluate and generate");
5
+ .description("Evaluate and generate expressions");
6
6
  expr
7
7
  .command("evaluate")
8
- .description("Evaluate an expression")
9
- .requiredOption("--expression <json>", "Expression definition (JSON object)")
10
- .requiredOption("--variables <json>", 'Variables (JSON object, e.g. {"key":"value"})')
8
+ .description("Evaluate an expression with given variables")
9
+ .requiredOption("--expression <json>", "Expression definition (JSON object, required)")
10
+ .requiredOption("--variables <json>", "Variable bindings for the expression (JSON object, required)")
11
+ .addHelpText("after", `
12
+ Example:
13
+ $ cargo-ai expression eval evaluate --expression '{"kind":"template","template":"Hello {{name}}"}' --variables '{"name":"World"}'`)
11
14
  .action(async (opts) => {
12
15
  const api = getApi();
13
16
  const result = await handleApiCall(() => api.expression.expression.evaluate({
@@ -18,9 +21,9 @@ export function registerExpressionEvalCommands(parent, getApi) {
18
21
  });
19
22
  expr
20
23
  .command("generate")
21
- .description("Generate an expression")
22
- .requiredOption("--prompt <text>", "Prompt")
23
- .requiredOption("--variables <json>", 'Variables (JSON object, e.g. {"key":"value"})')
24
+ .description("Generate an expression from a natural language prompt")
25
+ .requiredOption("--prompt <text>", "Natural language description of the expression (string, required)")
26
+ .requiredOption("--variables <json>", "Available variable bindings (JSON object, required)")
24
27
  .action(async (opts) => {
25
28
  const api = getApi();
26
29
  const result = await handleApiCall(() => api.expression.expression.generate({
@@ -0,0 +1,4 @@
1
+ import type { Command } from "commander";
2
+ import type { Api } from "../../api.js";
3
+ export declare function registerActionCommands(parent: Command, getApi: () => Api): void;
4
+ //# sourceMappingURL=action.d.ts.map
@@ -0,0 +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;AASxC,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CAmIN"}
@@ -0,0 +1,64 @@
1
+ import { handleApiCall, outputJson, parseJson, pollBatchUntilFinished, pollRunUntilFinished, } from "../runHandler.js";
2
+ export function registerActionCommands(parent, getApi) {
3
+ const action = parent
4
+ .command("action")
5
+ .description("Execute actions (single run or batch)");
6
+ action
7
+ .command("execute")
8
+ .description("Execute a single action")
9
+ .requiredOption("--action <json>", 'Action definition (JSON object, required). Example: \'{"kind":"tool","toolUuid":"550e8400-...","config":{}}\'')
10
+ .requiredOption("--data <json>", "Input data for the run (JSON object, required)")
11
+ .option("--wait-until-finished", "Poll the run until it reaches a terminal status before returning (boolean flag)")
12
+ .option("--polling-interval <ms>", "Polling interval in milliseconds, used with --wait-until-finished (integer, default: 5000)", "5000")
13
+ .addHelpText("after", `
14
+ Examples:
15
+ $ cargo-ai orchestration action execute --action '{"kind":"tool","toolUuid":"550e8400-...","config":{}}' --data '{"email":"user@example.com"}'
16
+ $ cargo-ai orchestration action execute --action '{"kind":"connector","integrationSlug":"slack","actionSlug":"send-message","config":{}}' --data '{"channel":"#general","text":"hello"}' --wait-until-finished`)
17
+ .action(async (opts) => {
18
+ const actionPayload = parseJson(opts.action, "--action");
19
+ const data = parseJson(opts.data, "--data");
20
+ const api = getApi();
21
+ const result = await handleApiCall(() => api.orchestration.action.execute({
22
+ action: actionPayload,
23
+ data,
24
+ }));
25
+ if (opts.waitUntilFinished === true) {
26
+ const intervalMs = parseInt(opts.pollingInterval, 10);
27
+ const finalResult = await pollRunUntilFinished(() => api.orchestration.run.get(result.run.uuid), (r) => r.run.status, intervalMs);
28
+ outputJson(finalResult);
29
+ return;
30
+ }
31
+ outputJson(result);
32
+ });
33
+ action
34
+ .command("execute-batch")
35
+ .description("Execute an action as a batch over multiple records")
36
+ .requiredOption("--action <json>", 'Action definition (JSON object, required). Example: \'{"kind":"tool","toolUuid":"550e8400-...","config":{}}\'')
37
+ .requiredOption("--records <json>", 'Records to process (JSON array, required). Example: \'[{"email":"a@b.com"},{"email":"c@d.com"}]\'')
38
+ .option("--webhook-url <url>", "URL to call when the batch completes")
39
+ .option("--webhook-secret <secret>", "Secret used to sign webhook deliveries")
40
+ .option("--wait-until-finished", "Poll the batch until it reaches a terminal status before returning (boolean flag)")
41
+ .option("--polling-interval <ms>", "Polling interval in milliseconds, used with --wait-until-finished (integer, default: 5000)", "5000")
42
+ .addHelpText("after", `
43
+ Examples:
44
+ $ cargo-ai orchestration action execute-batch --action '{"kind":"tool","toolUuid":"550e8400-...","config":{}}' --records '[{"email":"a@b.com"},{"email":"c@d.com"}]'
45
+ $ cargo-ai orchestration action execute-batch --action '{"kind":"connector","integrationSlug":"slack","actionSlug":"send-message","config":{}}' --records '[{"channel":"#general"}]' --wait-until-finished`)
46
+ .action(async (opts) => {
47
+ const actionPayload = parseJson(opts.action, "--action");
48
+ const records = parseJson(opts.records, "--records");
49
+ const api = getApi();
50
+ const result = await handleApiCall(() => api.orchestration.action.executeBatch({
51
+ action: actionPayload,
52
+ records,
53
+ webhookUrl: opts.webhookUrl,
54
+ webhookSecret: opts.webhookSecret,
55
+ }));
56
+ if (opts.waitUntilFinished === true) {
57
+ const intervalMs = parseInt(opts.pollingInterval, 10);
58
+ const finalResult = await pollBatchUntilFinished(() => api.orchestration.batch.get(result.batch.uuid), (r) => r.batch.status, intervalMs);
59
+ outputJson(finalResult);
60
+ return;
61
+ }
62
+ outputJson(result);
63
+ });
64
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"batch.d.ts","sourceRoot":"","sources":["../../../src/commands/orchestration/batch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAQxC,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CAwMN"}
1
+ {"version":3,"file":"batch.d.ts","sourceRoot":"","sources":["../../../src/commands/orchestration/batch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAQxC,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CAyON"}
@@ -1,22 +1,24 @@
1
1
  import { handleApiCall, outputJson, parseJson, pollBatchUntilFinished, } from "../runHandler.js";
2
2
  export function registerBatchCommands(parent, getApi) {
3
- const batch = parent.command("batch").description("Batch operations");
3
+ const batch = parent
4
+ .command("batch")
5
+ .description("Manage batch operations (list, get, create, cancel, preview, download)");
4
6
  batch
5
7
  .command("list")
6
8
  .description("List batches")
7
- .option("--workflow-uuids <uuids>", "Workflow UUIDs (comma-separated)")
8
- .option("--release-uuid <uuid>", "Release UUID")
9
- .option("--parent-batch-uuid <uuid>", "Parent batch UUID")
10
- .option("--parent-run-uuid <uuid>", "Parent run UUID")
11
- .option("--parent-node-uuid <uuid>", "Parent node UUID")
12
- .option("--statuses <list>", "Statuses (comma-separated)")
13
- .option("--has-runs", "Only batches with runs")
14
- .option("--is-skipped", "Only skipped batches")
15
- .option("--is-finished", "Only finished batches")
16
- .option("--included-data-kinds <list>", "Included data kinds (comma-separated)")
17
- .option("--excluded-data-kinds <list>", "Excluded data kinds (comma-separated)")
18
- .option("--limit <n>", "Limit", "20")
19
- .option("--offset <n>", "Offset", "0")
9
+ .option("--workflow-uuids <uuids>", "Filter by workflow UUIDs (comma-separated strings)")
10
+ .option("--release-uuid <uuid>", "Filter by release UUID (string)")
11
+ .option("--parent-batch-uuid <uuid>", "Filter by parent batch UUID (string)")
12
+ .option("--parent-run-uuid <uuid>", "Filter by parent run UUID (string)")
13
+ .option("--parent-node-uuid <uuid>", "Filter by parent node UUID (string)")
14
+ .option("--statuses <list>", "Filter by statuses (comma-separated: pending,running,finished,failed,cancelled)")
15
+ .option("--has-runs", "Only return batches that have runs (boolean flag)")
16
+ .option("--is-skipped", "Only return skipped batches (boolean flag)")
17
+ .option("--is-finished", "Only return finished batches (boolean flag)")
18
+ .option("--included-data-kinds <list>", "Include only these data kinds (comma-separated strings)")
19
+ .option("--excluded-data-kinds <list>", "Exclude these data kinds (comma-separated strings)")
20
+ .option("--limit <n>", "Max results to return (integer, default: 20)", "20")
21
+ .option("--offset <n>", "Number of results to skip (integer, default: 0)", "0")
20
22
  .action(async (opts) => {
21
23
  const api = getApi();
22
24
  const result = await handleApiCall(() => api.orchestration.batch.list({
@@ -59,12 +61,16 @@ export function registerBatchCommands(parent, getApi) {
59
61
  batch
60
62
  .command("create")
61
63
  .description("Create a batch")
62
- .option("--workflow-uuid <uuid>", "Workflow UUID")
63
- .requiredOption("--data <json>", 'Batch data (JSON, e.g. {"kind":"segment","segmentUuid":"..."} or {"kind":"file","s3Filename":"..."})')
64
- .option("--release-uuid <uuid>", "Release UUID")
65
- .option("--nodes <json>", 'Custom nodes to override the workflow definition (JSON array). Must include a start node (slug:"start") and an end node (slug:"end"). E.g. [{"uuid":"a","slug":"start","kind":"native","actionSlug":"start","config":{},"childrenUuids":["b"],"fallbackOnFailure":false,"position":{"x":0,"y":0}},{"uuid":"b","slug":"end","kind":"native","actionSlug":"end","config":{},"childrenUuids":[],"fallbackOnFailure":false,"position":{"x":1,"y":0}}]')
66
- .option("--wait-until-finished", "Poll the batch until it reaches a terminal status before returning")
67
- .option("--polling-interval <ms>", "Polling interval in milliseconds (used with --wait-until-finished)", "5000")
64
+ .option("--workflow-uuid <uuid>", "Workflow UUID (string)")
65
+ .requiredOption("--data <json>", 'Batch data source (JSON object, required). Supported kinds: {"kind":"segment","segmentUuid":"..."} or {"kind":"file","s3Filename":"..."}')
66
+ .option("--release-uuid <uuid>", "Release UUID to pin the batch to (string)")
67
+ .option("--nodes <json>", "Custom nodes to override the workflow definition (JSON array).")
68
+ .option("--wait-until-finished", "Poll the batch until it reaches a terminal status before returning (boolean flag)")
69
+ .option("--polling-interval <ms>", "Polling interval in milliseconds, used with --wait-until-finished (integer, default: 5000)", "5000")
70
+ .addHelpText("after", `
71
+ Examples:
72
+ $ cargo-ai orchestration batch create --data '{"kind":"segment","segmentUuid":"550e8400-..."}'
73
+ $ cargo-ai orchestration batch create --workflow-uuid 550e8400-... --data '{"kind":"file","s3Filename":"input.csv"}' --wait-until-finished`)
68
74
  .action(async (opts) => {
69
75
  const api = getApi();
70
76
  const result = await handleApiCall(() => api.orchestration.batch.create({
@@ -93,9 +99,9 @@ export function registerBatchCommands(parent, getApi) {
93
99
  });
94
100
  batch
95
101
  .command("preview")
96
- .description("Preview a batch")
97
- .requiredOption("--workflow-uuid <uuid>", "Workflow UUID")
98
- .requiredOption("--data <json>", 'Batch data (JSON, e.g. {"kind":"segment","segmentUuid":"..."} or {"kind":"file","s3Filename":"..."})')
102
+ .description("Preview a batch without creating it")
103
+ .requiredOption("--workflow-uuid <uuid>", "Workflow UUID (string, required)")
104
+ .requiredOption("--data <json>", 'Batch data source (JSON object, required). Same format as "batch create --data"')
99
105
  .action(async (opts) => {
100
106
  const api = getApi();
101
107
  const result = await handleApiCall(() => api.orchestration.batch.preview({
@@ -107,8 +113,8 @@ export function registerBatchCommands(parent, getApi) {
107
113
  batch
108
114
  .command("download")
109
115
  .description("Download batch results")
110
- .requiredOption("--uuid <uuid>", "Batch UUID")
111
- .requiredOption("--output-node-slug <slug>", "Output node slug")
116
+ .requiredOption("--uuid <uuid>", "Batch UUID (string, required)")
117
+ .option("--output-node-slug <slug>", "Output node slug to download from (string)")
112
118
  .action(async (opts) => {
113
119
  const api = getApi();
114
120
  const result = await handleApiCall(() => api.orchestration.batch.download({
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/orchestration/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAYxC,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CAeN"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/orchestration/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAcxC,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CAiBN"}
@@ -1,5 +1,7 @@
1
+ import { registerActionCommands } from "./action.js";
1
2
  import { registerBatchCommands } from "./batch.js";
2
3
  import { registerDraftReleaseCommands } from "./draftRelease.js";
4
+ import { registerLogCommands } from "./log.js";
3
5
  import { registerNodeCommands } from "./node.js";
4
6
  import { registerPlayCommands } from "./play.js";
5
7
  import { registerRecordCommands } from "./record.js";
@@ -12,10 +14,12 @@ export function registerOrchestrationCommands(parent, getApi) {
12
14
  const orchestration = parent
13
15
  .command("orchestration")
14
16
  .description("Workflows, plays, runs, batches, tools, templates");
17
+ registerActionCommands(orchestration, getApi);
15
18
  registerWorkflowCommands(orchestration, getApi);
16
19
  registerPlayCommands(orchestration, getApi);
17
20
  registerRunCommands(orchestration, getApi);
18
21
  registerBatchCommands(orchestration, getApi);
22
+ registerLogCommands(orchestration, getApi);
19
23
  registerReleaseCommands(orchestration, getApi);
20
24
  registerDraftReleaseCommands(orchestration, getApi);
21
25
  registerToolCommands(orchestration, getApi);
@@ -0,0 +1,4 @@
1
+ import type { Command } from "commander";
2
+ import type { Api } from "../../api.js";
3
+ export declare function registerLogCommands(parent: Command, getApi: () => Api): void;
4
+ //# sourceMappingURL=log.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../../src/commands/orchestration/log.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGxC,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,GAAG,IAAI,CAwO5E"}
@@ -0,0 +1,122 @@
1
+ import { handleApiCall, outputJson } from "../runHandler.js";
2
+ export function registerLogCommands(parent, getApi) {
3
+ const log = parent.command("log").description("Execution log operations");
4
+ log
5
+ .command("list")
6
+ .description("List execution logs")
7
+ .option("--workflow-uuid <uuid>", "Workflow UUID (omit to include all workflows in the workspace)")
8
+ .option("--batch-uuid <uuid>", "Batch UUID")
9
+ .option("--run-uuid <uuid>", "Run UUID")
10
+ .option("--record-id <id>", "Record ID")
11
+ .option("--record-title <title>", "Record title (ilike)")
12
+ .option("--record-title-or-id <text>", "Record id or title (ilike on id or title, same as run list)")
13
+ .option("--execution-title <text>", "Execution title (ilike)")
14
+ .option("--node-uuid <uuid>", "Node UUID")
15
+ .option("--node-kind <kind>", "Node kind: native | connector | tool | agent")
16
+ .option("--node-slug <slug>", "Workflow node slug (exact match)")
17
+ .option("--node-integration-slug <slug>", "Connector integration slug (exact match)")
18
+ .option("--node-connector-uuid <uuid>", "Connector UUID")
19
+ .option("--node-action-slug <slug>", "Node action slug (exact match)")
20
+ .option("--parent-node-uuid <uuid>", "Parent node UUID on the run")
21
+ .option("--node-tool-uuid <uuid>", "Tool node UUID")
22
+ .option("--node-agent-uuid <uuid>", "Agent node UUID")
23
+ .option("--node-release-uuid <uuid>", "Release UUID on the node")
24
+ .option("--execution-statuses <list>", "Comma-separated: pending,success,error")
25
+ .option("--parent-run-uuid <uuid>", "Parent run UUID")
26
+ .requiredOption("--execution-started-after <date>", "Execution started after (ISO date)")
27
+ .option("--execution-started-before <date>", "Execution started on or before (ISO date)")
28
+ .option("--limit <n>", "Limit", "30")
29
+ .option("--offset <n>", "Offset", "0")
30
+ .action(async (opts) => {
31
+ const api = getApi();
32
+ const result = await handleApiCall(() => api.orchestration.log.list({
33
+ workflowUuid: opts.workflowUuid,
34
+ batchUuid: opts.batchUuid,
35
+ runUuid: opts.runUuid,
36
+ recordId: opts.recordId,
37
+ recordTitle: opts.recordTitle,
38
+ recordTitleOrId: opts.recordTitleOrId,
39
+ executionTitle: opts.executionTitle,
40
+ nodeUuid: opts.nodeUuid,
41
+ nodeKind: opts.nodeKind !== undefined
42
+ ? opts.nodeKind
43
+ : undefined,
44
+ nodeSlug: opts.nodeSlug,
45
+ nodeIntegrationSlug: opts.nodeIntegrationSlug,
46
+ nodeConnectorUuid: opts.nodeConnectorUuid,
47
+ nodeActionSlug: opts.nodeActionSlug,
48
+ parentNodeUuid: opts.parentNodeUuid,
49
+ nodeToolUuid: opts.nodeToolUuid,
50
+ nodeAgentUuid: opts.nodeAgentUuid,
51
+ nodeReleaseUuid: opts.nodeReleaseUuid,
52
+ executionStatuses: opts.executionStatuses !== undefined
53
+ ? opts.executionStatuses
54
+ .split(",")
55
+ .map((s) => s.trim())
56
+ : undefined,
57
+ parentRunUuid: opts.parentRunUuid,
58
+ executionStartedAfter: opts.executionStartedAfter,
59
+ executionStartedBefore: opts.executionStartedBefore,
60
+ limit: opts.limit !== undefined ? parseInt(opts.limit, 10) : undefined,
61
+ offset: opts.offset !== undefined ? parseInt(opts.offset, 10) : undefined,
62
+ }));
63
+ outputJson(result);
64
+ });
65
+ log
66
+ .command("count")
67
+ .description("Count execution logs")
68
+ .option("--workflow-uuid <uuid>", "Workflow UUID (omit to include all workflows in the workspace)")
69
+ .option("--batch-uuid <uuid>", "Batch UUID")
70
+ .option("--run-uuid <uuid>", "Run UUID")
71
+ .option("--record-id <id>", "Record ID")
72
+ .option("--record-title <title>", "Record title (ilike)")
73
+ .option("--record-title-or-id <text>", "Record id or title (ilike on id or title, same as run list)")
74
+ .option("--execution-title <text>", "Execution title (ilike)")
75
+ .option("--node-uuid <uuid>", "Node UUID")
76
+ .option("--node-kind <kind>", "Node kind: native | connector | tool | agent")
77
+ .option("--node-slug <slug>", "Workflow node slug (exact match)")
78
+ .option("--node-integration-slug <slug>", "Connector integration slug (exact match)")
79
+ .option("--node-connector-uuid <uuid>", "Connector UUID")
80
+ .option("--node-action-slug <slug>", "Node action slug (exact match)")
81
+ .option("--parent-node-uuid <uuid>", "Parent node UUID on the run")
82
+ .option("--node-tool-uuid <uuid>", "Tool node UUID")
83
+ .option("--node-agent-uuid <uuid>", "Agent node UUID")
84
+ .option("--node-release-uuid <uuid>", "Release UUID on the node")
85
+ .option("--execution-statuses <list>", "Comma-separated: pending,success,error")
86
+ .option("--parent-run-uuid <uuid>", "Parent run UUID")
87
+ .requiredOption("--execution-started-after <date>", "Execution started after (ISO date)")
88
+ .option("--execution-started-before <date>", "Execution started on or before (ISO date)")
89
+ .action(async (opts) => {
90
+ const api = getApi();
91
+ const result = await handleApiCall(() => api.orchestration.log.count({
92
+ workflowUuid: opts.workflowUuid,
93
+ batchUuid: opts.batchUuid,
94
+ runUuid: opts.runUuid,
95
+ recordId: opts.recordId,
96
+ recordTitle: opts.recordTitle,
97
+ recordTitleOrId: opts.recordTitleOrId,
98
+ executionTitle: opts.executionTitle,
99
+ nodeUuid: opts.nodeUuid,
100
+ nodeKind: opts.nodeKind !== undefined
101
+ ? opts.nodeKind
102
+ : undefined,
103
+ nodeSlug: opts.nodeSlug,
104
+ nodeIntegrationSlug: opts.nodeIntegrationSlug,
105
+ nodeConnectorUuid: opts.nodeConnectorUuid,
106
+ nodeActionSlug: opts.nodeActionSlug,
107
+ parentNodeUuid: opts.parentNodeUuid,
108
+ nodeToolUuid: opts.nodeToolUuid,
109
+ nodeAgentUuid: opts.nodeAgentUuid,
110
+ nodeReleaseUuid: opts.nodeReleaseUuid,
111
+ executionStatuses: opts.executionStatuses !== undefined
112
+ ? opts.executionStatuses
113
+ .split(",")
114
+ .map((s) => s.trim())
115
+ : undefined,
116
+ parentRunUuid: opts.parentRunUuid,
117
+ executionStartedAfter: opts.executionStartedAfter,
118
+ executionStartedBefore: opts.executionStartedBefore,
119
+ }));
120
+ outputJson(result);
121
+ });
122
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../src/commands/orchestration/node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGxC,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,GAAG,IAAI,CA+E7E"}
1
+ {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../src/commands/orchestration/node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGxC,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,GAAG,IAAI,CAwG7E"}
@@ -1,12 +1,14 @@
1
1
  import { handleApiCall, outputJson, parseJson } from "../runHandler.js";
2
2
  export function registerNodeCommands(parent, getApi) {
3
- const node = parent.command("node").description("Node operations");
3
+ const node = parent
4
+ .command("node")
5
+ .description("Compute, validate, and execute workflow nodes");
4
6
  node
5
7
  .command("compute")
6
- .description("Compute a node")
7
- .requiredOption("--node <json>", "Node definition (JSON object)")
8
- .requiredOption("--context <json>", "Execution context (JSON object)")
9
- .option("--group-context <json>", "Group context (JSON object)")
8
+ .description("Compute a node's configuration from its definition and context")
9
+ .requiredOption("--node <json>", "Node definition (JSON object, required)")
10
+ .requiredOption("--context <json>", "Execution context (JSON object, required)")
11
+ .option("--group-context <json>", "Group context for grouped nodes (JSON object)")
10
12
  .action(async (opts) => {
11
13
  const api = getApi();
12
14
  const result = await handleApiCall(() => api.orchestration.node.compute({
@@ -20,8 +22,8 @@ export function registerNodeCommands(parent, getApi) {
20
22
  });
21
23
  node
22
24
  .command("validate")
23
- .description("Validate nodes")
24
- .requiredOption("--nodes <json>", "Array of node definitions (JSON array)")
25
+ .description("Validate node definitions for correctness")
26
+ .requiredOption("--nodes <json>", "Node definitions to validate (JSON array, required)")
25
27
  .action(async (opts) => {
26
28
  const api = getApi();
27
29
  const result = await handleApiCall(() => api.orchestration.node.validate({
@@ -31,13 +33,13 @@ export function registerNodeCommands(parent, getApi) {
31
33
  });
32
34
  node
33
35
  .command("execute")
34
- .description("Execute a node")
35
- .requiredOption("--workflow-uuid <uuid>", "Workflow UUID")
36
- .requiredOption("--release-uuid <uuid>", "Release UUID")
37
- .requiredOption("--node <json>", "Node definition (JSON object)")
38
- .requiredOption("--computed-config <json>", "Computed config (JSON object)")
39
- .requiredOption("--context <json>", "Execution context (JSON object)")
40
- .option("--group-context <json>", "Group context (JSON object)")
36
+ .description("Execute a node within a workflow run")
37
+ .requiredOption("--workflow-uuid <uuid>", "Workflow UUID (string, required)")
38
+ .requiredOption("--release-uuid <uuid>", "Release UUID (string, required)")
39
+ .requiredOption("--node <json>", "Node definition (JSON object, required)")
40
+ .requiredOption("--computed-config <json>", "Computed configuration from 'node compute' (JSON object, required)")
41
+ .requiredOption("--context <json>", "Execution context (JSON object, required)")
42
+ .option("--group-context <json>", "Group context for grouped nodes (JSON object)")
41
43
  .action(async (opts) => {
42
44
  const api = getApi();
43
45
  const result = await handleApiCall(() => api.orchestration.node.execute({
@@ -1 +1 @@
1
- {"version":3,"file":"play.d.ts","sourceRoot":"","sources":["../../../src/commands/orchestration/play.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGxC,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,GAAG,IAAI,CAsF7E"}
1
+ {"version":3,"file":"play.d.ts","sourceRoot":"","sources":["../../../src/commands/orchestration/play.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGxC,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,GAAG,IAAI,CAuG7E"}
@@ -1,6 +1,8 @@
1
1
  import { handleApiCall, outputJson } from "../runHandler.js";
2
2
  export function registerPlayCommands(parent, getApi) {
3
- const play = parent.command("play").description("Play operations");
3
+ const play = parent
4
+ .command("play")
5
+ .description("Manage plays (list, create, update, remove)");
4
6
  play
5
7
  .command("list")
6
8
  .description("List all plays")
@@ -12,12 +14,18 @@ export function registerPlayCommands(parent, getApi) {
12
14
  play
13
15
  .command("create")
14
16
  .description("Create a play")
15
- .requiredOption("--name <name>", "Play name")
16
- .requiredOption("--model-uuid <uuid>", "Model UUID")
17
- .requiredOption("--change-kinds <kinds>", "Change kinds (comma-separated)")
18
- .requiredOption("--run-creation-rule <rule>", 'Run creation rule (JSON, e.g. {"kind":"segment","segmentUuid":"..."} or {"kind":"record","record":{}})')
19
- .option("--description <description>", "Description")
20
- .option("--folder-uuid <uuid>", "Folder UUID")
17
+ .requiredOption("--name <name>", "Play name (string, required)")
18
+ .requiredOption("--model-uuid <uuid>", "Model UUID to trigger on (string, required)")
19
+ .requiredOption("--change-kinds <kinds>", "Change kinds to trigger on (comma-separated strings, required)")
20
+ .requiredOption("--run-creation-rule <rule>", "Run creation rule. Allowed values: always, once, noConcurrency")
21
+ .option("--description <description>", "Play description (string)")
22
+ .option("--folder-uuid <uuid>", "Folder UUID (string)")
23
+ .addHelpText("after", `
24
+ Examples:
25
+ $ cargo-ai orchestration play create --name "My Play" --model-uuid 550e8400-... \\
26
+ --change-kinds created,updated --run-creation-rule always
27
+ $ cargo-ai orchestration play create --name "Dedup" --model-uuid 550e8400-... \\
28
+ --change-kinds created --run-creation-rule noConcurrency --description "Dedup new records"`)
21
29
  .action(async (opts) => {
22
30
  const api = getApi();
23
31
  const changeKinds = opts.changeKinds
@@ -138,7 +138,7 @@ export function registerRecordCommands(parent, getApi) {
138
138
  .command("download-outputs")
139
139
  .description("Download record outputs")
140
140
  .requiredOption("--workflow-uuid <uuid>", "Workflow UUID")
141
- .requiredOption("--output-node-slug <slug>", "Output node slug")
141
+ .option("--output-node-slug <slug>", "Output node slug")
142
142
  .option("--format <format>", "Export format (csv or json)", "csv")
143
143
  .option("--ids <list>", "Record IDs (comma-separated)")
144
144
  .option("--title <title>", "Record title")
@@ -1 +1 @@
1
- {"version":3,"file":"release.d.ts","sourceRoot":"","sources":["../../../src/commands/orchestration/release.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGxC,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CAuCN"}
1
+ {"version":3,"file":"release.d.ts","sourceRoot":"","sources":["../../../src/commands/orchestration/release.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGxC,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CA6CN"}