@cargo-ai/cli 1.0.9 → 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.
- package/build/api.d.ts.map +1 -1
- package/build/api.js +4 -0
- package/build/commands/ai/release.d.ts.map +1 -1
- package/build/commands/ai/release.js +10 -1
- package/build/commands/orchestration/action.d.ts +4 -0
- package/build/commands/orchestration/action.d.ts.map +1 -0
- package/build/commands/orchestration/action.js +64 -0
- package/build/commands/orchestration/batch.js +2 -2
- package/build/commands/orchestration/index.d.ts.map +1 -1
- package/build/commands/orchestration/index.js +2 -0
- package/build/commands/orchestration/play.d.ts.map +1 -1
- package/build/commands/orchestration/play.js +38 -3
- package/build/commands/orchestration/record.js +6 -6
- package/build/commands/orchestration/release.d.ts.map +1 -1
- package/build/commands/orchestration/release.js +12 -1
- package/build/commands/orchestration/run.js +3 -3
- package/build/commands/storage/record.d.ts.map +1 -1
- package/build/commands/storage/record.js +51 -1
- package/package.json +2 -2
package/build/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"
|
|
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,
|
|
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")
|
|
@@ -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
|
+
}
|
|
@@ -64,7 +64,7 @@ export function registerBatchCommands(parent, getApi) {
|
|
|
64
64
|
.option("--workflow-uuid <uuid>", "Workflow UUID (string)")
|
|
65
65
|
.requiredOption("--data <json>", 'Batch data source (JSON object, required). Supported kinds: {"kind":"segment","segmentUuid":"..."} or {"kind":"file","s3Filename":"..."}')
|
|
66
66
|
.option("--release-uuid <uuid>", "Release UUID to pin the batch to (string)")
|
|
67
|
-
.option("--nodes <json>",
|
|
67
|
+
.option("--nodes <json>", "Custom nodes to override the workflow definition (JSON array).")
|
|
68
68
|
.option("--wait-until-finished", "Poll the batch until it reaches a terminal status before returning (boolean flag)")
|
|
69
69
|
.option("--polling-interval <ms>", "Polling interval in milliseconds, used with --wait-until-finished (integer, default: 5000)", "5000")
|
|
70
70
|
.addHelpText("after", `
|
|
@@ -114,7 +114,7 @@ Examples:
|
|
|
114
114
|
.command("download")
|
|
115
115
|
.description("Download batch results")
|
|
116
116
|
.requiredOption("--uuid <uuid>", "Batch UUID (string, required)")
|
|
117
|
-
.
|
|
117
|
+
.option("--output-node-slug <slug>", "Output node slug to download from (string)")
|
|
118
118
|
.action(async (opts) => {
|
|
119
119
|
const api = getApi();
|
|
120
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;
|
|
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,3 +1,4 @@
|
|
|
1
|
+
import { registerActionCommands } from "./action.js";
|
|
1
2
|
import { registerBatchCommands } from "./batch.js";
|
|
2
3
|
import { registerDraftReleaseCommands } from "./draftRelease.js";
|
|
3
4
|
import { registerLogCommands } from "./log.js";
|
|
@@ -13,6 +14,7 @@ export function registerOrchestrationCommands(parent, getApi) {
|
|
|
13
14
|
const orchestration = parent
|
|
14
15
|
.command("orchestration")
|
|
15
16
|
.description("Workflows, plays, runs, batches, tools, templates");
|
|
17
|
+
registerActionCommands(orchestration, getApi);
|
|
16
18
|
registerWorkflowCommands(orchestration, getApi);
|
|
17
19
|
registerPlayCommands(orchestration, getApi);
|
|
18
20
|
registerRunCommands(orchestration, getApi);
|
|
@@ -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,
|
|
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
|
|
9
|
-
.
|
|
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
|
-
|
|
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":"...","
|
|
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":"...","
|
|
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":"...","
|
|
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) => {
|
|
@@ -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
|
-
.
|
|
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")
|
|
@@ -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":"...","
|
|
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":"...","
|
|
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,
|
|
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
|
|
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")
|
|
@@ -69,7 +69,7 @@ Examples:
|
|
|
69
69
|
.option("--workflow-uuid <uuid>", "Workflow UUID (string)")
|
|
70
70
|
.requiredOption("--data <json>", "Run input data (JSON object, required). The shape depends on your workflow's start node configuration")
|
|
71
71
|
.option("--release-uuid <uuid>", "Release UUID to pin the run to (string)")
|
|
72
|
-
.option("--nodes <json>",
|
|
72
|
+
.option("--nodes <json>", "Custom nodes to override the workflow definition (JSON array).")
|
|
73
73
|
.option("--wait-until-finished", "Poll the run until it reaches a terminal status before returning (boolean flag)")
|
|
74
74
|
.option("--polling-interval <ms>", "Polling interval in milliseconds, used with --wait-until-finished (integer, default: 5000)", "5000")
|
|
75
75
|
.addHelpText("after", `
|
|
@@ -206,7 +206,7 @@ Examples:
|
|
|
206
206
|
.command("download-outputs")
|
|
207
207
|
.description("Download outputs from a specific node in matching runs")
|
|
208
208
|
.requiredOption("--workflow-uuid <uuid>", "Workflow UUID (string, required)")
|
|
209
|
-
.
|
|
209
|
+
.option("--output-node-slug <slug>", "Output node slug to download from (string)")
|
|
210
210
|
.option("--format <format>", "Export format: csv | json (default: csv)", "csv")
|
|
211
211
|
.option("--batch-uuid <uuid>", "Filter by batch UUID (string)")
|
|
212
212
|
.option("--release-uuid <uuid>", "Filter by release UUID (string)")
|
|
@@ -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,
|
|
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.
|
|
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.
|
|
32
|
+
"@cargo-ai/api": "^1.0.20"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@cargo-ai/eslint-config": "*",
|