@cargo-ai/cli 1.0.24 → 1.0.26
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 +17 -17
- package/build/commands/cdk/index.d.ts +4 -0
- package/build/commands/cdk/index.d.ts.map +1 -0
- package/build/commands/cdk/index.js +539 -0
- package/build/commands/cdk/init.d.ts +3 -0
- package/build/commands/cdk/init.d.ts.map +1 -0
- package/build/commands/cdk/init.js +86 -0
- package/build/commands/{workflow → cdk}/inputTypes.d.ts +6 -0
- package/build/commands/cdk/inputTypes.d.ts.map +1 -0
- package/build/commands/{workflow → cdk}/inputTypes.js +115 -17
- package/build/commands/cdk/types.d.ts +4 -0
- package/build/commands/cdk/types.d.ts.map +1 -0
- package/build/commands/{workflow/sync.js → cdk/types.js} +139 -208
- package/build/commands/hosting/app.js +1 -1
- package/build/commands/hosting/worker.js +1 -1
- package/build/commands/orchestration/record.d.ts.map +1 -1
- package/build/commands/orchestration/record.js +12 -0
- package/build/commands/orchestration/run.d.ts.map +1 -1
- package/build/commands/orchestration/run.js +12 -0
- package/build/commands/runHandler.d.ts +5 -1
- package/build/commands/runHandler.d.ts.map +1 -1
- package/build/commands/runHandler.js +36 -4
- package/build/commands/segmentation/segment.d.ts.map +1 -1
- package/build/commands/segmentation/segment.js +8 -0
- package/build/commands/storage/model.d.ts.map +1 -1
- package/build/commands/storage/model.js +0 -2
- package/build/commands/templateUtils.d.ts.map +1 -0
- package/build/index.js +2 -0
- package/package.json +4 -3
- package/build/commands/hosting/templateUtils.d.ts.map +0 -1
- package/build/commands/workflow/index.d.ts +0 -4
- package/build/commands/workflow/index.d.ts.map +0 -1
- package/build/commands/workflow/index.js +0 -10
- package/build/commands/workflow/inputTypes.d.ts.map +0 -1
- package/build/commands/workflow/sync.d.ts +0 -4
- package/build/commands/workflow/sync.d.ts.map +0 -1
- /package/build/commands/{hosting/templateUtils.d.ts → templateUtils.d.ts} +0 -0
- /package/build/commands/{hosting/templateUtils.js → templateUtils.js} +0 -0
|
@@ -37,6 +37,21 @@ export function info(message) {
|
|
|
37
37
|
export function success(message) {
|
|
38
38
|
console.error(`${colors.green("✓")} ${message}`);
|
|
39
39
|
}
|
|
40
|
+
// Ask a yes/no question on stderr (stdout stays reserved for JSON). Resolves
|
|
41
|
+
// false on a non-TTY stdin (callers should require an explicit --yes there).
|
|
42
|
+
export async function confirm(question) {
|
|
43
|
+
if (process.stdin.isTTY !== true)
|
|
44
|
+
return false;
|
|
45
|
+
const { createInterface } = await import("node:readline/promises");
|
|
46
|
+
const rl = createInterface({ input: process.stdin, output: process.stderr });
|
|
47
|
+
try {
|
|
48
|
+
const answer = await rl.question(`${question} [y/N] `);
|
|
49
|
+
return /^y(es)?$/i.test(answer.trim());
|
|
50
|
+
}
|
|
51
|
+
finally {
|
|
52
|
+
rl.close();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
40
55
|
export function failWith(message, opts) {
|
|
41
56
|
const code = opts !== undefined && opts.code !== undefined
|
|
42
57
|
? opts.code
|
|
@@ -64,20 +79,37 @@ const SPINNER_FRAMES = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧",
|
|
|
64
79
|
const SPINNER_INTERVAL_MS = 80;
|
|
65
80
|
export function startSpinner(message) {
|
|
66
81
|
if (process.stderr.isTTY !== true) {
|
|
82
|
+
// Non-TTY (CI, piped): no animation — just emit each line so progress is
|
|
83
|
+
// still visible in logs.
|
|
67
84
|
process.stderr.write(`${message}\n`);
|
|
68
|
-
return {
|
|
85
|
+
return {
|
|
86
|
+
update: (m) => process.stderr.write(`${m}\n`),
|
|
87
|
+
log: (line) => process.stderr.write(`${line}\n`),
|
|
88
|
+
stop: () => undefined,
|
|
89
|
+
};
|
|
69
90
|
}
|
|
70
91
|
process.stderr.write("\x1B[?25l");
|
|
92
|
+
let current = message;
|
|
71
93
|
let frame = 0;
|
|
72
|
-
const
|
|
94
|
+
const render = () => {
|
|
73
95
|
const ch = SPINNER_FRAMES[frame % SPINNER_FRAMES.length];
|
|
74
96
|
if (ch !== undefined) {
|
|
75
|
-
|
|
97
|
+
// \x1B[K clears any stale characters when the message shrinks.
|
|
98
|
+
process.stderr.write(`\r\x1B[K${colors.cyan(ch)} ${colors.dim(current)}`);
|
|
76
99
|
}
|
|
77
100
|
frame += 1;
|
|
78
|
-
}
|
|
101
|
+
};
|
|
102
|
+
const id = setInterval(render, SPINNER_INTERVAL_MS);
|
|
79
103
|
let stopped = false;
|
|
80
104
|
return {
|
|
105
|
+
update: (m) => {
|
|
106
|
+
current = m;
|
|
107
|
+
},
|
|
108
|
+
log: (line) => {
|
|
109
|
+
// Wipe the spinner line, drop a permanent line, let the next frame redraw
|
|
110
|
+
// the spinner beneath it.
|
|
111
|
+
process.stderr.write(`\r\x1B[K${line}\n`);
|
|
112
|
+
},
|
|
81
113
|
stop: () => {
|
|
82
114
|
if (stopped) {
|
|
83
115
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"segment.d.ts","sourceRoot":"","sources":["../../../src/commands/segmentation/segment.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":"segment.d.ts","sourceRoot":"","sources":["../../../src/commands/segmentation/segment.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,CAkQN"}
|
|
@@ -28,6 +28,7 @@ export function registerSegmentCommands(parent, getApi) {
|
|
|
28
28
|
.option("--sort <json>", 'Sort definition (JSON object). Shape: {"slug": string, "order": "asc" | "desc"}')
|
|
29
29
|
.option("--limit <n>", "Max records in segment (integer)")
|
|
30
30
|
.option("--tracking-column-slugs <slugs>", "Column slugs to track changes on (comma-separated strings)")
|
|
31
|
+
.option("--column-slugs <slugs>", "Column slugs displayed for the segment (comma-separated strings)")
|
|
31
32
|
.addHelpText("after", `
|
|
32
33
|
Examples:
|
|
33
34
|
$ cargo-ai segmentation segment create --name "Active Users" --model-uuid 550e8400-... \\
|
|
@@ -50,6 +51,9 @@ Filter object shape:
|
|
|
50
51
|
trackingColumnSlugs: opts.trackingColumnSlugs !== undefined
|
|
51
52
|
? opts.trackingColumnSlugs.split(",").map((s) => s.trim())
|
|
52
53
|
: undefined,
|
|
54
|
+
columnSlugs: opts.columnSlugs !== undefined
|
|
55
|
+
? opts.columnSlugs.split(",").map((s) => s.trim())
|
|
56
|
+
: undefined,
|
|
53
57
|
}));
|
|
54
58
|
outputJson(result);
|
|
55
59
|
});
|
|
@@ -120,6 +124,7 @@ Filter object shape:
|
|
|
120
124
|
.option("--sort <json>", 'Sort definition (JSON object). Shape: {"slug": string, "order": "asc" | "desc"}')
|
|
121
125
|
.option("--limit <n>", "Max records in segment (integer)")
|
|
122
126
|
.option("--tracking-column-slugs <slugs>", "Column slugs to track changes on (comma-separated strings)")
|
|
127
|
+
.option("--column-slugs <slugs>", "Column slugs displayed for the segment (comma-separated strings)")
|
|
123
128
|
.action(async (opts) => {
|
|
124
129
|
const api = getApi();
|
|
125
130
|
const result = await handleApiCall(() => api.segmentation.segment.update({
|
|
@@ -135,6 +140,9 @@ Filter object shape:
|
|
|
135
140
|
trackingColumnSlugs: opts.trackingColumnSlugs !== undefined
|
|
136
141
|
? opts.trackingColumnSlugs.split(",").map((s) => s.trim())
|
|
137
142
|
: undefined,
|
|
143
|
+
columnSlugs: opts.columnSlugs !== undefined
|
|
144
|
+
? opts.columnSlugs.split(",").map((s) => s.trim())
|
|
145
|
+
: undefined,
|
|
138
146
|
}));
|
|
139
147
|
outputJson(result);
|
|
140
148
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../src/commands/storage/model.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":"model.d.ts","sourceRoot":"","sources":["../../../src/commands/storage/model.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,CA0MN"}
|
|
@@ -64,7 +64,6 @@ export function registerModelCommands(parent, getApi) {
|
|
|
64
64
|
.requiredOption("--uuid <uuid>", "Model UUID")
|
|
65
65
|
.option("--name <name>", "Model name")
|
|
66
66
|
.option("--description <description>", "Model description (or 'null' to clear)")
|
|
67
|
-
.option("--extractor-slug <slug>", "Extractor slug")
|
|
68
67
|
.option("--config <json>", "Extractor configuration (JSON object)")
|
|
69
68
|
.option("--position <json>", 'Position (JSON, e.g. {"x":0,"y":0})')
|
|
70
69
|
.option("--unification <json>", 'Unification (JSON, e.g. {"source":"integration"} or null)')
|
|
@@ -75,7 +74,6 @@ export function registerModelCommands(parent, getApi) {
|
|
|
75
74
|
uuid: opts.uuid,
|
|
76
75
|
name: opts.name,
|
|
77
76
|
description: opts.description === "null" ? null : opts.description,
|
|
78
|
-
extractorSlug: opts.extractorSlug,
|
|
79
77
|
config: opts.config !== undefined
|
|
80
78
|
? parseJson(opts.config, "--config")
|
|
81
79
|
: undefined,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templateUtils.d.ts","sourceRoot":"","sources":["../../src/commands/templateUtils.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa,SAAgB,MAAM,KAAG,QAAQ,MAAM,EAAE,CAUlE,CAAC;AAEF,eAAO,MAAM,aAAa,QACnB,MAAM,QACL,MAAM,UACJ;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,EAAE,KACrC,QAAQ,IAAI,CAmBd,CAAC"}
|
package/build/index.js
CHANGED
|
@@ -5,6 +5,7 @@ import { createApi } from "./api.js";
|
|
|
5
5
|
import { registerAiCommands } from "./commands/ai/index.js";
|
|
6
6
|
import { registerAuthCommands } from "./commands/auth/index.js";
|
|
7
7
|
import { registerBillingCommands } from "./commands/billing/index.js";
|
|
8
|
+
import { registerCdkCommands } from "./commands/cdk/index.js";
|
|
8
9
|
import { registerConnectionCommands } from "./commands/connection/index.js";
|
|
9
10
|
import { registerContentCommands } from "./commands/content/index.js";
|
|
10
11
|
import { registerContextCommands } from "./commands/context/index.js";
|
|
@@ -72,6 +73,7 @@ registerSystemOfRecordIntegrationCommands(program, getApi);
|
|
|
72
73
|
registerUserManagementCommands(program, getApi);
|
|
73
74
|
registerAiCommands(program, getApi);
|
|
74
75
|
registerHostingCommands(program, getApi);
|
|
76
|
+
registerCdkCommands(program, getApi);
|
|
75
77
|
program
|
|
76
78
|
.parseAsync()
|
|
77
79
|
.then(() => maybeNotifyUpdate(version))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cargo-ai/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.26",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"description": "Command-line interface for the Cargo API",
|
|
@@ -29,9 +29,10 @@
|
|
|
29
29
|
"format:check": "prettier --check ."
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@cargo-ai/api": "^1.0.
|
|
32
|
+
"@cargo-ai/api": "^1.0.31",
|
|
33
33
|
"@cargo-ai/app-sdk": "^1.0.2",
|
|
34
|
-
"@cargo-ai/
|
|
34
|
+
"@cargo-ai/cdk": "*",
|
|
35
|
+
"@cargo-ai/worker-sdk": "^1.0.3",
|
|
35
36
|
"commander": "^12.1.0",
|
|
36
37
|
"http-proxy-agent": "^9.1.0",
|
|
37
38
|
"https-proxy-agent": "^9.1.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"templateUtils.d.ts","sourceRoot":"","sources":["../../../src/commands/hosting/templateUtils.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa,SAAgB,MAAM,KAAG,QAAQ,MAAM,EAAE,CAUlE,CAAC;AAEF,eAAO,MAAM,aAAa,QACnB,MAAM,QACL,MAAM,UACJ;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,EAAE,KACrC,QAAQ,IAAI,CAmBd,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/workflow/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAMxC,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CAMN"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { registerSyncCommand } from "./sync.js";
|
|
2
|
-
// SDK deploy lives under `cargo-ai orchestration release deploy-draft --file
|
|
3
|
-
// <path>` (alongside the raw-JSON deploy path), so this group only ships the
|
|
4
|
-
// `sync` developer tool today.
|
|
5
|
-
export function registerWorkflowCommands(parent, getApi) {
|
|
6
|
-
const workflow = parent
|
|
7
|
-
.command("workflow")
|
|
8
|
-
.description("Workflow SDK developer tools (type sync, codegen)");
|
|
9
|
-
registerSyncCommand(workflow, getApi);
|
|
10
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"inputTypes.d.ts","sourceRoot":"","sources":["../../../src/commands/workflow/inputTypes.ts"],"names":[],"mappings":"AAgCA;;;GAGG;AACH,eAAO,MAAM,oBAAoB,QAE+D,CAAC;AAEjG;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAM5D;AAgGD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAU5E"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../../src/commands/workflow/sync.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAgGxC,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,GAAG,IAAI,CAsD5E"}
|
|
File without changes
|
|
File without changes
|