@cargo-ai/cli 1.0.23 → 1.0.25

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":"AAEA,OAAO,EAAE,KAAK,GAAG,EAAY,MAAM,eAAe,CAAC;AAEnD,YAAY,EAAE,GAAG,EAAE,CAAC;AAQpB,wBAAgB,SAAS,CAAC,IAAI,EAAE;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;CACnC,GAAG,GAAG,CAON"}
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;AAQpB,wBAAgB,SAAS,CAAC,IAAI,EAAE;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;CACnC,GAAG,GAAG,CAQN"}
package/build/api.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { createRequire } from "node:module";
2
2
  import { buildApi } from "@cargo-ai/api";
3
+ import { getProxyTransport } from "./proxy.js";
3
4
  const require = createRequire(import.meta.url);
4
5
  const { version } = require("../package.json");
5
6
  const ORIGIN = { name: "cli", version };
@@ -9,5 +10,6 @@ export function createApi(opts) {
9
10
  workspaceUuid: opts.workspaceUuid,
10
11
  accessToken: opts.accessToken,
11
12
  origin: ORIGIN,
13
+ transport: getProxyTransport(opts.baseUrl),
12
14
  });
13
15
  }
@@ -1 +1 @@
1
- {"version":3,"file":"record.d.ts","sourceRoot":"","sources":["../../../src/commands/orchestration/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,CAoYN"}
1
+ {"version":3,"file":"record.d.ts","sourceRoot":"","sources":["../../../src/commands/orchestration/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,CAsZN"}
@@ -18,6 +18,8 @@ export function registerRecordCommands(parent, getApi) {
18
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
+ .option("--updated-after <date>", "Updated after date")
22
+ .option("--updated-before <date>", "Updated before date")
21
23
  .option("--limit <n>", "Limit", "20")
22
24
  .option("--offset <n>", "Offset", "0")
23
25
  .action(async (opts) => {
@@ -43,6 +45,8 @@ export function registerRecordCommands(parent, getApi) {
43
45
  : undefined,
44
46
  createdAfter: opts.createdAfter,
45
47
  createdBefore: opts.createdBefore,
48
+ updatedAfter: opts.updatedAfter,
49
+ updatedBefore: opts.updatedBefore,
46
50
  limit: opts.limit !== undefined ? parseInt(opts.limit, 10) : undefined,
47
51
  offset: opts.offset !== undefined ? parseInt(opts.offset, 10) : undefined,
48
52
  }));
@@ -65,6 +69,8 @@ export function registerRecordCommands(parent, getApi) {
65
69
  .option("--executions-filter <json>", 'Executions filter (JSON, e.g. {"conjonction":"and","groups":[{"conjonction":"and","conditions":[{"kind":"node","nodeSlug":"...","status":"pending"}]}]})')
66
70
  .option("--created-after <date>", "Created after date")
67
71
  .option("--created-before <date>", "Created before date")
72
+ .option("--updated-after <date>", "Updated after date")
73
+ .option("--updated-before <date>", "Updated before date")
68
74
  .action(async (opts) => {
69
75
  const api = getApi();
70
76
  const result = await handleApiCall(() => api.orchestration.record.count({
@@ -88,6 +94,8 @@ export function registerRecordCommands(parent, getApi) {
88
94
  : undefined,
89
95
  createdAfter: opts.createdAfter,
90
96
  createdBefore: opts.createdBefore,
97
+ updatedAfter: opts.updatedAfter,
98
+ updatedBefore: opts.updatedBefore,
91
99
  }));
92
100
  outputJson(result);
93
101
  });
@@ -108,6 +116,8 @@ export function registerRecordCommands(parent, getApi) {
108
116
  .option("--executions-filter <json>", 'Executions filter (JSON, e.g. {"conjonction":"and","groups":[{"conjonction":"and","conditions":[{"kind":"node","nodeSlug":"...","status":"pending"}]}]})')
109
117
  .option("--created-after <date>", "Created after date")
110
118
  .option("--created-before <date>", "Created before date")
119
+ .option("--updated-after <date>", "Updated after date")
120
+ .option("--updated-before <date>", "Updated before date")
111
121
  .action(async (opts) => {
112
122
  const api = getApi();
113
123
  const result = await handleApiCall(() => api.orchestration.record.download({
@@ -131,6 +141,8 @@ export function registerRecordCommands(parent, getApi) {
131
141
  : undefined,
132
142
  createdAfter: opts.createdAfter,
133
143
  createdBefore: opts.createdBefore,
144
+ updatedAfter: opts.updatedAfter,
145
+ updatedBefore: opts.updatedBefore,
134
146
  }));
135
147
  outputJson(result);
136
148
  });
@@ -1 +1 @@
1
- {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/commands/orchestration/run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAQxC,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,GAAG,IAAI,CA+iB5E"}
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/commands/orchestration/run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAQxC,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,GAAG,IAAI,CAmlB5E"}
@@ -21,6 +21,8 @@ export function registerRunCommands(parent, getApi) {
21
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
+ .option("--updated-after <date>", "Filter runs updated after this date (ISO 8601 string)")
25
+ .option("--updated-before <date>", "Filter runs updated before this date (ISO 8601 string)")
24
26
  .option("--limit <n>", "Max results to return (integer, default: 20)", "20")
25
27
  .option("--offset <n>", "Number of results to skip (integer, default: 0)", "0")
26
28
  .addHelpText("after", `
@@ -50,6 +52,8 @@ Examples:
50
52
  : undefined,
51
53
  createdAfter: opts.createdAfter,
52
54
  createdBefore: opts.createdBefore,
55
+ updatedAfter: opts.updatedAfter,
56
+ updatedBefore: opts.updatedBefore,
53
57
  limit: opts.limit !== undefined ? parseInt(opts.limit, 10) : undefined,
54
58
  offset: opts.offset !== undefined ? parseInt(opts.offset, 10) : undefined,
55
59
  }));
@@ -134,6 +138,8 @@ Examples:
134
138
  .option("--executions-filter <json>", "Filter by node executions (JSON object, same format as 'run list')")
135
139
  .option("--created-after <date>", "Filter runs created after this date (ISO 8601 string)")
136
140
  .option("--created-before <date>", "Filter runs created before this date (ISO 8601 string)")
141
+ .option("--updated-after <date>", "Filter runs updated after this date (ISO 8601 string)")
142
+ .option("--updated-before <date>", "Filter runs updated before this date (ISO 8601 string)")
137
143
  .action(async (opts) => {
138
144
  const api = getApi();
139
145
  const result = await handleApiCall(() => api.orchestration.run.count({
@@ -156,6 +162,8 @@ Examples:
156
162
  : undefined,
157
163
  createdAfter: opts.createdAfter,
158
164
  createdBefore: opts.createdBefore,
165
+ updatedAfter: opts.updatedAfter,
166
+ updatedBefore: opts.updatedBefore,
159
167
  }));
160
168
  outputJson(result);
161
169
  });
@@ -177,6 +185,8 @@ Examples:
177
185
  .option("--executions-filter <json>", "Filter by node executions (JSON object, same format as 'run list')")
178
186
  .option("--created-after <date>", "Filter runs created after this date (ISO 8601 string)")
179
187
  .option("--created-before <date>", "Filter runs created before this date (ISO 8601 string)")
188
+ .option("--updated-after <date>", "Filter runs updated after this date (ISO 8601 string)")
189
+ .option("--updated-before <date>", "Filter runs updated before this date (ISO 8601 string)")
180
190
  .action(async (opts) => {
181
191
  const api = getApi();
182
192
  const result = await handleApiCall(() => api.orchestration.run.download({
@@ -199,6 +209,8 @@ Examples:
199
209
  : undefined,
200
210
  createdAfter: opts.createdAfter,
201
211
  createdBefore: opts.createdBefore,
212
+ updatedAfter: opts.updatedAfter,
213
+ updatedBefore: opts.updatedBefore,
202
214
  }));
203
215
  outputJson(result);
204
216
  });
@@ -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,CAgPN"}
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,CA6MN"}
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,17 @@
1
+ import type { ClientTransport } from "@cargo-ai/api";
2
+ /**
3
+ * Build Axios transport overrides that tunnel requests through an
4
+ * HTTP/HTTPS proxy when one is configured via the standard proxy env
5
+ * vars (`HTTPS_PROXY`, `HTTP_PROXY`, `ALL_PROXY`, honoring `NO_PROXY`).
6
+ *
7
+ * This works around Axios' unreliable built-in proxy handling, which can
8
+ * fall into a 308 redirect loop (`ERR_FR_TOO_MANY_REDIRECTS`) for HTTPS
9
+ * targets inside proxied environments such as cloud agent sandboxes. We
10
+ * disable Axios' env-based proxy (`proxy: false`) and tunnel via the
11
+ * dedicated proxy agents instead.
12
+ *
13
+ * Returns `undefined` when no proxy applies, so the client keeps its
14
+ * default direct-egress behavior.
15
+ */
16
+ export declare const getProxyTransport: (targetUrl: string) => ClientTransport | undefined;
17
+ //# sourceMappingURL=proxy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proxy.d.ts","sourceRoot":"","sources":["../src/proxy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AA4CrD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,iBAAiB,cACjB,MAAM,KAChB,eAAe,GAAG,SAoBpB,CAAC"}
package/build/proxy.js ADDED
@@ -0,0 +1,65 @@
1
+ import { HttpProxyAgent } from "http-proxy-agent";
2
+ import { HttpsProxyAgent } from "https-proxy-agent";
3
+ const getEnv = (...names) => {
4
+ for (const name of names) {
5
+ const value = process.env[name];
6
+ if (value !== undefined && value.trim() !== "") {
7
+ return value.trim();
8
+ }
9
+ }
10
+ return undefined;
11
+ };
12
+ const shouldBypassProxy = (targetUrl, noProxy) => {
13
+ if (noProxy === undefined) {
14
+ return false;
15
+ }
16
+ if (noProxy === "*") {
17
+ return true;
18
+ }
19
+ let hostname;
20
+ try {
21
+ hostname = new URL(targetUrl).hostname;
22
+ }
23
+ catch {
24
+ return false;
25
+ }
26
+ return noProxy
27
+ .split(",")
28
+ .map((entry) => entry.trim())
29
+ .filter((entry) => entry.length > 0)
30
+ .some((entry) => {
31
+ const normalized = entry.replace(/^\./, "");
32
+ return hostname === normalized || hostname.endsWith(`.${normalized}`);
33
+ });
34
+ };
35
+ /**
36
+ * Build Axios transport overrides that tunnel requests through an
37
+ * HTTP/HTTPS proxy when one is configured via the standard proxy env
38
+ * vars (`HTTPS_PROXY`, `HTTP_PROXY`, `ALL_PROXY`, honoring `NO_PROXY`).
39
+ *
40
+ * This works around Axios' unreliable built-in proxy handling, which can
41
+ * fall into a 308 redirect loop (`ERR_FR_TOO_MANY_REDIRECTS`) for HTTPS
42
+ * targets inside proxied environments such as cloud agent sandboxes. We
43
+ * disable Axios' env-based proxy (`proxy: false`) and tunnel via the
44
+ * dedicated proxy agents instead.
45
+ *
46
+ * Returns `undefined` when no proxy applies, so the client keeps its
47
+ * default direct-egress behavior.
48
+ */
49
+ export const getProxyTransport = (targetUrl) => {
50
+ if (shouldBypassProxy(targetUrl, getEnv("NO_PROXY", "no_proxy"))) {
51
+ return undefined;
52
+ }
53
+ const isHttps = targetUrl.startsWith("https:");
54
+ const proxyUrl = isHttps
55
+ ? getEnv("HTTPS_PROXY", "https_proxy", "ALL_PROXY", "all_proxy")
56
+ : getEnv("HTTP_PROXY", "http_proxy", "ALL_PROXY", "all_proxy");
57
+ if (proxyUrl === undefined) {
58
+ return undefined;
59
+ }
60
+ return {
61
+ httpAgent: new HttpProxyAgent(proxyUrl),
62
+ httpsAgent: new HttpsProxyAgent(proxyUrl),
63
+ proxy: false,
64
+ };
65
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cargo-ai/cli",
3
- "version": "1.0.23",
3
+ "version": "1.0.25",
4
4
  "private": false,
5
5
  "license": "UNLICENSED",
6
6
  "description": "Command-line interface for the Cargo API",
@@ -29,10 +29,12 @@
29
29
  "format:check": "prettier --check ."
30
30
  },
31
31
  "dependencies": {
32
- "@cargo-ai/api": "^1.0.28",
32
+ "@cargo-ai/api": "^1.0.30",
33
33
  "@cargo-ai/app-sdk": "^1.0.2",
34
34
  "@cargo-ai/worker-sdk": "^1.0.2",
35
35
  "commander": "^12.1.0",
36
+ "http-proxy-agent": "^9.1.0",
37
+ "https-proxy-agent": "^9.1.0",
36
38
  "tsx": "^4.19.2"
37
39
  },
38
40
  "devDependencies": {