@cargo-ai/cli 1.0.10 → 1.0.11

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.
@@ -1 +1 @@
1
- {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAY,MAAM,eAAe,CAAC;AAInD,YAAY,EAAE,GAAG,EAAE,CAAC;AAEpB,wBAAgB,SAAS,IAAI,GAAG,CAO/B"}
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,GAAG,EAAY,MAAM,eAAe,CAAC;AAInD,YAAY,EAAE,GAAG,EAAE,CAAC;AAMpB,wBAAgB,SAAS,IAAI,GAAG,CAQ/B"}
package/build/api.js CHANGED
@@ -1,10 +1,14 @@
1
+ import { createRequire } from "node:module";
1
2
  import { buildApi } from "@cargo-ai/api";
2
3
  import { getConfig } from "./config.js";
4
+ const require = createRequire(import.meta.url);
5
+ const { version } = require("../package.json");
3
6
  export function createApi() {
4
7
  const { baseUrl, accessToken, workspaceUuid } = getConfig();
5
8
  return buildApi({
6
9
  baseUrl,
7
10
  workspaceUuid,
8
11
  getAccessToken: async () => accessToken,
12
+ origin: { name: "cli", version },
9
13
  });
10
14
  }
@@ -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;AAGxC,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CA0QN"}
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;AAGxC,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CAwRN"}
@@ -2,7 +2,7 @@ import { handleApiCall, outputJson, parseJson } from "../runHandler.js";
2
2
  export function registerReleaseCommands(parent, getApi) {
3
3
  const release = parent
4
4
  .command("release")
5
- .description("Manage AI agent releases (list, get, draft, deploy)");
5
+ .description("Manage AI agent releases (list, get, get-deployed, draft, deploy)");
6
6
  release
7
7
  .command("list")
8
8
  .description("List AI releases")
@@ -41,6 +41,15 @@ export function registerReleaseCommands(parent, getApi) {
41
41
  const result = await handleApiCall(() => api.ai.release.getDraft({ agentUuid: opts.agentUuid }));
42
42
  outputJson(result);
43
43
  });
44
+ release
45
+ .command("get-deployed")
46
+ .description("Get the deployed AI release for an agent")
47
+ .requiredOption("--agent-uuid <uuid>", "Agent UUID (string, required)")
48
+ .action(async (opts) => {
49
+ const api = getApi();
50
+ const result = await handleApiCall(() => api.ai.release.getDeployed({ agentUuid: opts.agentUuid }));
51
+ outputJson(result);
52
+ });
44
53
  release
45
54
  .command("update-draft")
46
55
  .description("Update draft AI release configuration")
@@ -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,CAuG7E"}
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,CA6J7E"}
@@ -5,10 +5,45 @@ export function registerPlayCommands(parent, getApi) {
5
5
  .description("Manage plays (list, create, update, remove)");
6
6
  play
7
7
  .command("list")
8
- .description("List all plays")
9
- .action(async () => {
8
+ .description("List plays (optional filters match GET /orchestration/plays/list)")
9
+ .option("--model-uuid <uuid>", "Only plays for this model UUID")
10
+ .option("--segment-uuid <uuid>", "Only plays for this segment UUID")
11
+ .option("--schedule-type <type>", "Only plays with this schedule type: dbt | cron | realtime | dependency | watch")
12
+ .option("--is-enabled", "Only enabled plays (boolean flag)")
13
+ .option("--is-disabled", "Only disabled plays (boolean flag)")
14
+ .action(async (opts) => {
10
15
  const api = getApi();
11
- const result = await handleApiCall(() => api.orchestration.play.all());
16
+ if (opts.isEnabled === true && opts.isDisabled === true) {
17
+ throw new Error("Use only one of --is-enabled or --is-disabled");
18
+ }
19
+ const scheduleTypes = [
20
+ "dbt",
21
+ "cron",
22
+ "realtime",
23
+ "dependency",
24
+ "watch",
25
+ ];
26
+ let scheduleType;
27
+ if (opts.scheduleType !== undefined) {
28
+ if (scheduleTypes.includes(opts.scheduleType) ===
29
+ false) {
30
+ throw new Error(`--schedule-type must be one of: ${scheduleTypes.join(", ")}`);
31
+ }
32
+ scheduleType = opts.scheduleType;
33
+ }
34
+ let isEnabledFilter;
35
+ if (opts.isEnabled === true) {
36
+ isEnabledFilter = true;
37
+ }
38
+ if (opts.isDisabled === true) {
39
+ isEnabledFilter = false;
40
+ }
41
+ const result = await handleApiCall(() => api.orchestration.play.list({
42
+ modelUuid: opts.modelUuid,
43
+ segmentUuid: opts.segmentUuid,
44
+ scheduleType,
45
+ isEnabled: isEnabledFilter,
46
+ }));
12
47
  outputJson(result);
13
48
  });
14
49
  play
@@ -15,7 +15,7 @@ export function registerRecordCommands(parent, getApi) {
15
15
  .option("--parent-run-uuid <uuid>", "Parent run UUID")
16
16
  .option("--parent-node-uuid <uuid>", "Parent node UUID")
17
17
  .option("--is-group-parent", "Only group parents")
18
- .option("--executions-filter <json>", 'Executions filter (JSON, e.g. {"conjonction":"and","groups":[{"conjonction":"and","conditions":[{"kind":"node","nodeSlug":"...","operator":"isRunning"}]}]})')
18
+ .option("--executions-filter <json>", 'Executions filter (JSON, e.g. {"conjonction":"and","groups":[{"conjonction":"and","conditions":[{"kind":"node","nodeSlug":"...","status":"pending"}]}]})')
19
19
  .option("--created-after <date>", "Created after date")
20
20
  .option("--created-before <date>", "Created before date")
21
21
  .option("--limit <n>", "Limit", "20")
@@ -62,7 +62,7 @@ export function registerRecordCommands(parent, getApi) {
62
62
  .option("--parent-run-uuid <uuid>", "Parent run UUID")
63
63
  .option("--parent-node-uuid <uuid>", "Parent node UUID")
64
64
  .option("--is-group-parent", "Only group parents")
65
- .option("--executions-filter <json>", 'Executions filter (JSON, e.g. {"conjonction":"and","groups":[{"conjonction":"and","conditions":[{"kind":"node","nodeSlug":"...","operator":"isRunning"}]}]})')
65
+ .option("--executions-filter <json>", 'Executions filter (JSON, e.g. {"conjonction":"and","groups":[{"conjonction":"and","conditions":[{"kind":"node","nodeSlug":"...","status":"pending"}]}]})')
66
66
  .option("--created-after <date>", "Created after date")
67
67
  .option("--created-before <date>", "Created before date")
68
68
  .action(async (opts) => {
@@ -105,7 +105,7 @@ export function registerRecordCommands(parent, getApi) {
105
105
  .option("--parent-run-uuid <uuid>", "Parent run UUID")
106
106
  .option("--parent-node-uuid <uuid>", "Parent node UUID")
107
107
  .option("--is-group-parent", "Only group parents")
108
- .option("--executions-filter <json>", 'Executions filter (JSON, e.g. {"conjonction":"and","groups":[{"conjonction":"and","conditions":[{"kind":"node","nodeSlug":"...","operator":"isRunning"}]}]})')
108
+ .option("--executions-filter <json>", 'Executions filter (JSON, e.g. {"conjonction":"and","groups":[{"conjonction":"and","conditions":[{"kind":"node","nodeSlug":"...","status":"pending"}]}]})')
109
109
  .option("--created-after <date>", "Created after date")
110
110
  .option("--created-before <date>", "Created before date")
111
111
  .action(async (opts) => {
@@ -150,7 +150,7 @@ export function registerRecordCommands(parent, getApi) {
150
150
  .option("--parent-run-uuid <uuid>", "Parent run UUID")
151
151
  .option("--parent-node-uuid <uuid>", "Parent node UUID")
152
152
  .option("--is-group-parent", "Only group parents")
153
- .option("--executions-filter <json>", 'Executions filter (JSON, e.g. {"conjonction":"and","groups":[{"conjonction":"and","conditions":[{"kind":"node","nodeSlug":"...","operator":"isRunning"}]}]})')
153
+ .option("--executions-filter <json>", 'Executions filter (JSON, e.g. {"conjonction":"and","groups":[{"conjonction":"and","conditions":[{"kind":"node","nodeSlug":"...","status":"pending"}]}]})')
154
154
  .option("--created-after <date>", "Created after date")
155
155
  .option("--created-before <date>", "Created before date")
156
156
  .action(async (opts) => {
@@ -213,7 +213,7 @@ export function registerRecordCommands(parent, getApi) {
213
213
  .option("--parent-run-uuid <uuid>", "Parent run UUID")
214
214
  .option("--parent-node-uuid <uuid>", "Parent node UUID")
215
215
  .option("--is-group-parent", "Only group parents")
216
- .option("--executions-filter <json>", 'Executions filter (JSON, e.g. {"conjonction":"and","groups":[{"conjonction":"and","conditions":[{"kind":"node","nodeSlug":"...","operator":"isRunning"}]}]})')
216
+ .option("--executions-filter <json>", 'Executions filter (JSON, e.g. {"conjonction":"and","groups":[{"conjonction":"and","conditions":[{"kind":"node","nodeSlug":"...","status":"pending"}]}]})')
217
217
  .action(async (opts) => {
218
218
  const payload = opts.ids !== undefined
219
219
  ? {
@@ -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,CA6CN"}
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,CA8DN"}
@@ -2,7 +2,7 @@ import { handleApiCall, outputJson } from "../runHandler.js";
2
2
  export function registerReleaseCommands(parent, getApi) {
3
3
  const release = parent
4
4
  .command("release")
5
- .description("Manage workflow releases (list, get)");
5
+ .description("Manage workflow releases (list, get, get-deployed)");
6
6
  release
7
7
  .command("list")
8
8
  .description("List releases")
@@ -26,4 +26,15 @@ export function registerReleaseCommands(parent, getApi) {
26
26
  const result = await handleApiCall(() => api.orchestration.release.get(uuid));
27
27
  outputJson(result);
28
28
  });
29
+ release
30
+ .command("get-deployed")
31
+ .description("Get the deployed release for a workflow")
32
+ .requiredOption("--workflow-uuid <uuid>", "Workflow UUID (string, required)")
33
+ .action(async (opts) => {
34
+ const api = getApi();
35
+ const result = await handleApiCall(() => api.orchestration.release.getDeployed({
36
+ workflowUuid: opts.workflowUuid,
37
+ }));
38
+ outputJson(result);
39
+ });
29
40
  }
@@ -18,7 +18,7 @@ export function registerRunCommands(parent, getApi) {
18
18
  .option("--record-title <title>", "Filter by record title (string)")
19
19
  .option("--record-title-or-id <value>", "Filter by record title or ID (string)")
20
20
  .option("--is-finished", "Only return finished runs (boolean flag)")
21
- .option("--executions-filter <json>", 'Filter by node executions (JSON object). Example: \'{"conjonction":"and","groups":[{"conjonction":"and","conditions":[{"kind":"node","nodeSlug":"my-node","operator":"isRunning"}]}]}\'')
21
+ .option("--executions-filter <json>", 'Filter by node executions (JSON). Example: \'{"conjonction":"and","groups":[{"conjonction":"and","conditions":[{"kind":"node","nodeSlug":"my-node","status":"pending"}]}]}\'')
22
22
  .option("--created-after <date>", "Filter runs created after this date (ISO 8601 string)")
23
23
  .option("--created-before <date>", "Filter runs created before this date (ISO 8601 string)")
24
24
  .option("--limit <n>", "Max results to return (integer, default: 20)", "20")
@@ -1 +1 @@
1
- {"version":3,"file":"record.d.ts","sourceRoot":"","sources":["../../../src/commands/storage/record.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGxC,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CAiFN"}
1
+ {"version":3,"file":"record.d.ts","sourceRoot":"","sources":["../../../src/commands/storage/record.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGxC,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CAwJN"}
@@ -1,4 +1,4 @@
1
- import { handleApiCall, outputJson } from "../runHandler.js";
1
+ import { handleApiCall, outputJson, parseJson } from "../runHandler.js";
2
2
  export function registerRecordCommands(parent, getApi) {
3
3
  const record = parent
4
4
  .command("record")
@@ -50,4 +50,54 @@ Examples:
50
50
  }));
51
51
  outputJson(result);
52
52
  });
53
+ record
54
+ .command("create")
55
+ .description("Create a single storage record")
56
+ .requiredOption("--model-uuid <uuid>", "Model UUID (string, required)")
57
+ .requiredOption("--data <json>", "Record fields as a JSON object (merged into the row)")
58
+ .addHelpText("after", `
59
+ Example:
60
+ $ cargo-ai storage record create --model-uuid 550e8400-... --data '{"name":"Ada"}'`)
61
+ .action(async (opts) => {
62
+ const api = getApi();
63
+ const result = await handleApiCall(() => api.storage.record.create({
64
+ modelUuid: opts.modelUuid,
65
+ data: parseJson(opts.data, "--data"),
66
+ }));
67
+ outputJson(result);
68
+ });
69
+ record
70
+ .command("update")
71
+ .description("Update a single storage record")
72
+ .requiredOption("--model-uuid <uuid>", "Model UUID (string, required)")
73
+ .requiredOption("--id <id>", "Record ID (string, required)")
74
+ .requiredOption("--data <json>", "Fields to update as a JSON object")
75
+ .addHelpText("after", `
76
+ Example:
77
+ $ cargo-ai storage record update --model-uuid 550e8400-... --id rec_1 --data '{"status":"done"}'`)
78
+ .action(async (opts) => {
79
+ const api = getApi();
80
+ const result = await handleApiCall(() => api.storage.record.update({
81
+ modelUuid: opts.modelUuid,
82
+ id: opts.id,
83
+ data: parseJson(opts.data, "--data"),
84
+ }));
85
+ outputJson(result);
86
+ });
87
+ record
88
+ .command("remove")
89
+ .description("Remove a single storage record")
90
+ .requiredOption("--model-uuid <uuid>", "Model UUID (string, required)")
91
+ .requiredOption("--id <id>", "Record ID (string, required)")
92
+ .addHelpText("after", `
93
+ Example:
94
+ $ cargo-ai storage record remove --model-uuid 550e8400-... --id rec_1`)
95
+ .action(async (opts) => {
96
+ const api = getApi();
97
+ await handleApiCall(() => api.storage.record.remove({
98
+ modelUuid: opts.modelUuid,
99
+ id: opts.id,
100
+ }));
101
+ outputJson({ ok: true });
102
+ });
53
103
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cargo-ai/cli",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
4
4
  "private": false,
5
5
  "description": "Command-line interface for the Cargo API",
6
6
  "engines": {
@@ -29,7 +29,7 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "commander": "^12.1.0",
32
- "@cargo-ai/api": "^1.0.18"
32
+ "@cargo-ai/api": "^1.0.20"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@cargo-ai/eslint-config": "*",