@cargo-ai/cli 1.0.76 → 1.0.78
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/commands/ai/chat.d.ts.map +1 -1
- package/build/commands/ai/chat.js +6 -0
- package/build/commands/ai/message.d.ts.map +1 -1
- package/build/commands/ai/message.js +12 -2
- package/build/commands/ai/release.d.ts.map +1 -1
- package/build/commands/ai/release.js +29 -2
- package/build/commands/orchestration/action.d.ts.map +1 -1
- package/build/commands/orchestration/action.js +3 -3
- package/build/commands/orchestration/batch.js +2 -2
- package/build/commands/orchestration/run.js +2 -2
- package/build/commands/runHandler.d.ts +1 -3
- package/build/commands/runHandler.d.ts.map +1 -1
- package/build/commands/runHandler.js +6 -32
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../../src/commands/ai/chat.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,
|
|
1
|
+
{"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../../src/commands/ai/chat.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,CAyI7E"}
|
|
@@ -41,6 +41,8 @@ export function registerChatCommands(parent, getApi) {
|
|
|
41
41
|
.option("--name <name>", "Chat name (string)")
|
|
42
42
|
.option("--agent-uuid <uuid>", "Agent UUID to associate with (string)")
|
|
43
43
|
.option("--release-uuid <uuid>", "Release UUID to pin to (string)")
|
|
44
|
+
.option("--harness-slug <slug>", "Coding-agent runtime. Currently only claudeCode. When omitted, later turns use the agent's pinned release, if any.")
|
|
45
|
+
.option("--repository <json>", "Git workspace for a coding harness (JSON object: connectorUuid, repository as owner/name, defaultBranch, rootDirectory, env)")
|
|
44
46
|
.addHelpText("after", `
|
|
45
47
|
Examples:
|
|
46
48
|
$ cargo-ai ai chat create --trigger '{"type":"draft"}'
|
|
@@ -56,6 +58,10 @@ Trigger object shapes:
|
|
|
56
58
|
name: opts.name,
|
|
57
59
|
agentUuid: opts.agentUuid,
|
|
58
60
|
releaseUuid: opts.releaseUuid,
|
|
61
|
+
harnessSlug: opts.harnessSlug,
|
|
62
|
+
repository: opts.repository !== undefined
|
|
63
|
+
? parseJson(opts.repository, "--repository")
|
|
64
|
+
: undefined,
|
|
59
65
|
}));
|
|
60
66
|
outputJson(result);
|
|
61
67
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../src/commands/ai/message.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":"message.d.ts","sourceRoot":"","sources":["../../../src/commands/ai/message.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAoCxC,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CAmTN"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { parseBooleanOption } from "../../utils/booleanOption.js";
|
|
2
2
|
import { loadCompiledAgent, resolveCompiledAgentFromState, } from "../../utils/loadCompiledAgent.js";
|
|
3
|
-
import { ExitCodes, failWith, handleApiCall, info, outputJson, parseJson,
|
|
3
|
+
import { ExitCodes, failWith, handleApiCall, info, outputJson, parseJson, pollUntilFinished, } from "../runHandler.js";
|
|
4
4
|
export function registerMessageCommands(parent, getApi) {
|
|
5
5
|
const message = parent
|
|
6
6
|
.command("message")
|
|
@@ -27,6 +27,8 @@ export function registerMessageCommands(parent, getApi) {
|
|
|
27
27
|
.option("--integration-slug <slug>", "Integration slug (string)")
|
|
28
28
|
.option("--connector-uuid <uuid>", "Connector UUID (string)")
|
|
29
29
|
.option("--language-model-slug <slug>", "Language model slug (string)")
|
|
30
|
+
.option("--harness-slug <slug>", "Coding-agent runtime. Currently only claudeCode. When omitted, later turns use the agent's pinned release, if any.")
|
|
31
|
+
.option("--repository <json>", "Git workspace for a coding harness (JSON object: connectorUuid, repository as owner/name, defaultBranch, rootDirectory, env)")
|
|
30
32
|
.option("--output <json>", 'Output format for the assistant message (JSON object, e.g. \'{"type":"text"}\' or \'{"type":"jsonSchema","jsonSchema":{...}}\'). Defaults to text when omitted.')
|
|
31
33
|
.option("--wait-until-finished [true|false]", "Poll the assistant message until finished before returning (defaults to true when passed bare)", parseBooleanOption)
|
|
32
34
|
.option("--polling-interval <ms>", "Polling interval in milliseconds, used with --wait-until-finished (integer, default: 5000)", "5000")
|
|
@@ -65,6 +67,8 @@ MCP client shape: { "name": string, "url": string }`)
|
|
|
65
67
|
["--integration-slug", opts.integrationSlug],
|
|
66
68
|
["--connector-uuid", opts.connectorUuid],
|
|
67
69
|
["--language-model-slug", opts.languageModelSlug],
|
|
70
|
+
["--harness-slug", opts.harnessSlug],
|
|
71
|
+
["--repository", opts.repository],
|
|
68
72
|
["--output", opts.output],
|
|
69
73
|
]
|
|
70
74
|
.filter(([, value]) => value !== undefined)
|
|
@@ -85,6 +89,8 @@ MCP client shape: { "name": string, "url": string }`)
|
|
|
85
89
|
maxSteps: resolved.maxSteps,
|
|
86
90
|
connectorUuid: resolved.connectorUuid,
|
|
87
91
|
languageModelSlug: resolved.languageModelSlug,
|
|
92
|
+
harnessSlug: resolved.harnessSlug,
|
|
93
|
+
repository: resolved.repository,
|
|
88
94
|
output: resolved.output,
|
|
89
95
|
};
|
|
90
96
|
if (resolved.connectorUuid !== undefined) {
|
|
@@ -119,6 +125,10 @@ MCP client shape: { "name": string, "url": string }`)
|
|
|
119
125
|
integrationSlug: opts.integrationSlug,
|
|
120
126
|
connectorUuid: opts.connectorUuid,
|
|
121
127
|
languageModelSlug: opts.languageModelSlug,
|
|
128
|
+
harnessSlug: opts.harnessSlug,
|
|
129
|
+
repository: opts.repository !== undefined
|
|
130
|
+
? parseJson(opts.repository, "--repository")
|
|
131
|
+
: undefined,
|
|
122
132
|
output: opts.output !== undefined
|
|
123
133
|
? parseJson(opts.output, "--output")
|
|
124
134
|
: undefined,
|
|
@@ -133,7 +143,7 @@ MCP client shape: { "name": string, "url": string }`)
|
|
|
133
143
|
}));
|
|
134
144
|
if (opts.waitUntilFinished === true) {
|
|
135
145
|
const intervalMs = parseInt(opts.pollingInterval, 10);
|
|
136
|
-
const finalResult = await
|
|
146
|
+
const finalResult = await pollUntilFinished(() => api.ai.message.get(result.assistantMessage.uuid), (r) => r.message.finishedAt, intervalMs);
|
|
137
147
|
outputJson(finalResult);
|
|
138
148
|
return;
|
|
139
149
|
}
|
|
@@ -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;AAIxC,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;AAIxC,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CA0VN"}
|
|
@@ -63,6 +63,8 @@ export function registerReleaseCommands(parent, getApi) {
|
|
|
63
63
|
.option("--integration-slug <slug>", "LLM integration slug (string)")
|
|
64
64
|
.option("--connector-uuid <uuid>", "Connector UUID (string)")
|
|
65
65
|
.option("--language-model-slug <slug>", "Language model slug (string)")
|
|
66
|
+
.option("--harness-slug <slug>", "Coding-agent runtime. Currently only claudeCode.")
|
|
67
|
+
.option("--repository <json>", "Git workspace for a coding harness (JSON object: connectorUuid, repository as owner/name, defaultBranch, rootDirectory, env)")
|
|
66
68
|
.option("--actions <json>", "Actions configuration (JSON array of action objects)")
|
|
67
69
|
.option("--mcp-clients <json>", "MCP clients configuration (JSON array of MCP client objects)")
|
|
68
70
|
.option("--resources <json>", "Resources configuration (JSON array of resource objects)")
|
|
@@ -95,6 +97,10 @@ Set "isReadOnly": false on a model resource to grant the agent write tools (inse
|
|
|
95
97
|
integrationSlug: opts.integrationSlug,
|
|
96
98
|
connectorUuid: opts.connectorUuid,
|
|
97
99
|
languageModelSlug: opts.languageModelSlug,
|
|
100
|
+
harnessSlug: opts.harnessSlug,
|
|
101
|
+
repository: opts.repository !== undefined
|
|
102
|
+
? parseJson(opts.repository, "--repository")
|
|
103
|
+
: undefined,
|
|
98
104
|
actions: opts.actions !== undefined
|
|
99
105
|
? parseJson(opts.actions, "--actions")
|
|
100
106
|
: undefined,
|
|
@@ -120,8 +126,10 @@ Set "isReadOnly": false on a model resource to grant the agent write tools (inse
|
|
|
120
126
|
.command("deploy-draft")
|
|
121
127
|
.description("Deploy the draft release to production")
|
|
122
128
|
.requiredOption("--agent-uuid <uuid>", "Agent UUID (string, required)")
|
|
123
|
-
.
|
|
124
|
-
.
|
|
129
|
+
.option("--integration-slug <slug>", "LLM integration slug (string). Unused when --harness-slug is set.")
|
|
130
|
+
.option("--language-model-slug <slug>", "Language model slug (string). Unused when --harness-slug is set.")
|
|
131
|
+
.option("--harness-slug <slug>", "Coding-agent runtime. Currently only claudeCode. When set, --integration-slug and --language-model-slug are unused.")
|
|
132
|
+
.option("--repository <json>", "Git workspace for a coding harness (JSON object: connectorUuid, repository as owner/name, defaultBranch, rootDirectory, env)")
|
|
125
133
|
.option("--version <version>", "Semver release version, e.g. 1.0.0 (string, auto-incremented if omitted)")
|
|
126
134
|
.requiredOption("--actions <json>", "Actions configuration (JSON array of action objects, required)")
|
|
127
135
|
.requiredOption("--mcp-clients <json>", "MCP clients configuration (JSON array, required)")
|
|
@@ -135,12 +143,31 @@ Set "isReadOnly": false on a model resource to grant the agent write tools (inse
|
|
|
135
143
|
.option("--connector-uuid <uuid>", "Connector UUID (string)")
|
|
136
144
|
.option("--description <text>", "Release description (string)")
|
|
137
145
|
.option("--options <json>", "Additional options (JSON object)")
|
|
146
|
+
.addHelpText("after", `
|
|
147
|
+
Examples:
|
|
148
|
+
$ cargo-ai ai release deploy-draft --agent-uuid <uuid> \\
|
|
149
|
+
--integration-slug openai --language-model-slug gpt-4o \\
|
|
150
|
+
--actions '[]' --mcp-clients '[]' --resources '[]' \\
|
|
151
|
+
--capabilities '[]' --suggested-actions '[]'
|
|
152
|
+
|
|
153
|
+
$ cargo-ai ai release deploy-draft --agent-uuid <uuid> \\
|
|
154
|
+
--harness-slug claudeCode \\
|
|
155
|
+
--repository '{"connectorUuid":"<github-uuid>","repository":"acme/app"}' \\
|
|
156
|
+
--actions '[]' --mcp-clients '[]' --resources '[]' \\
|
|
157
|
+
--capabilities '[]' --suggested-actions '[]'
|
|
158
|
+
|
|
159
|
+
A tool-loop agent needs --integration-slug and --language-model-slug. A
|
|
160
|
+
--harness-slug claudeCode agent does not — those flags are unused.`)
|
|
138
161
|
.action(async (opts) => {
|
|
139
162
|
const api = getApi();
|
|
140
163
|
const result = await handleApiCall(() => api.ai.release.deployDraft({
|
|
141
164
|
agentUuid: opts.agentUuid,
|
|
142
165
|
integrationSlug: opts.integrationSlug,
|
|
143
166
|
languageModelSlug: opts.languageModelSlug,
|
|
167
|
+
harnessSlug: opts.harnessSlug,
|
|
168
|
+
repository: opts.repository !== undefined
|
|
169
|
+
? parseJson(opts.repository, "--repository")
|
|
170
|
+
: undefined,
|
|
144
171
|
version: opts.version,
|
|
145
172
|
actions: parseJson(opts.actions, "--actions"),
|
|
146
173
|
mcpClients: parseJson(opts.mcpClients, "--mcp-clients"),
|
|
@@ -1 +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;
|
|
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;AAaxC,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CAgTN"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parseBooleanOption } from "../../utils/booleanOption.js";
|
|
2
|
-
import { applyRecordsLimit, ExitCodes, failWith, handleApiCall, outputJson, parseJson, parsePositiveInt,
|
|
2
|
+
import { applyRecordsLimit, ExitCodes, failWith, handleApiCall, outputJson, parseJson, parsePositiveInt, pollUntilFinished, } from "../runHandler.js";
|
|
3
3
|
export function registerActionCommands(parent, getApi) {
|
|
4
4
|
const action = parent
|
|
5
5
|
.command("action")
|
|
@@ -97,7 +97,7 @@ Examples:
|
|
|
97
97
|
}));
|
|
98
98
|
if (opts.waitUntilFinished === true) {
|
|
99
99
|
const intervalMs = parseInt(opts.pollingInterval, 10);
|
|
100
|
-
const finalResult = await
|
|
100
|
+
const finalResult = await pollUntilFinished(() => api.orchestration.run.get(result.run.uuid), (r) => r.run.finishedAt, intervalMs);
|
|
101
101
|
outputJson(finalResult);
|
|
102
102
|
return;
|
|
103
103
|
}
|
|
@@ -139,7 +139,7 @@ Examples:
|
|
|
139
139
|
}));
|
|
140
140
|
if (opts.waitUntilFinished === true) {
|
|
141
141
|
const intervalMs = parseInt(opts.pollingInterval, 10);
|
|
142
|
-
const finalResult = await
|
|
142
|
+
const finalResult = await pollUntilFinished(() => api.orchestration.batch.get(result.batch.uuid), (r) => r.batch.finishedAt, intervalMs);
|
|
143
143
|
outputJson(finalResult);
|
|
144
144
|
return;
|
|
145
145
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { parseBooleanOption } from "../../utils/booleanOption.js";
|
|
2
2
|
import { loadCompiledWorkflow, resolveCompiledWorkflowFromState, } from "../../utils/loadCompiledWorkflow.js";
|
|
3
|
-
import { ExitCodes, failWith, handleApiCall, info, outputJson, parseJson,
|
|
3
|
+
import { ExitCodes, failWith, handleApiCall, info, outputJson, parseJson, pollUntilFinished, } from "../runHandler.js";
|
|
4
4
|
export function registerBatchCommands(parent, getApi) {
|
|
5
5
|
const batch = parent
|
|
6
6
|
.command("batch")
|
|
@@ -103,7 +103,7 @@ Examples:
|
|
|
103
103
|
}));
|
|
104
104
|
if (opts.waitUntilFinished === true) {
|
|
105
105
|
const intervalMs = parseInt(opts.pollingInterval, 10);
|
|
106
|
-
const finalResult = await
|
|
106
|
+
const finalResult = await pollUntilFinished(() => api.orchestration.batch.get(result.batch.uuid), (r) => r.batch.finishedAt, intervalMs);
|
|
107
107
|
outputJson(finalResult);
|
|
108
108
|
return;
|
|
109
109
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { parseBooleanOption } from "../../utils/booleanOption.js";
|
|
2
2
|
import { loadCompiledWorkflow, resolveCompiledWorkflowFromState, } from "../../utils/loadCompiledWorkflow.js";
|
|
3
|
-
import { ExitCodes, failWith, handleApiCall, info, outputJson, parseJson,
|
|
3
|
+
import { ExitCodes, failWith, handleApiCall, info, outputJson, parseJson, pollUntilFinished, } from "../runHandler.js";
|
|
4
4
|
export function registerRunCommands(parent, getApi) {
|
|
5
5
|
const run = parent
|
|
6
6
|
.command("run")
|
|
@@ -116,7 +116,7 @@ Examples:
|
|
|
116
116
|
}));
|
|
117
117
|
if (opts.waitUntilFinished === true) {
|
|
118
118
|
const intervalMs = parseInt(opts.pollingInterval, 10);
|
|
119
|
-
const finalResult = await
|
|
119
|
+
const finalResult = await pollUntilFinished(() => api.orchestration.run.get(result.run.uuid), (r) => r.run.finishedAt, intervalMs);
|
|
120
120
|
outputJson(finalResult);
|
|
121
121
|
return;
|
|
122
122
|
}
|
|
@@ -47,8 +47,6 @@ type HandleApiCallOpts = {
|
|
|
47
47
|
};
|
|
48
48
|
export declare function handleApiCall<T>(fn: () => Promise<T>, opts?: HandleApiCallOpts): Promise<T>;
|
|
49
49
|
export declare function sleep(ms: number): Promise<void>;
|
|
50
|
-
export declare function
|
|
51
|
-
export declare function pollBatchUntilFinished<T>(getResult: () => Promise<T>, getStatus: (result: T) => string, intervalMs: number): Promise<T>;
|
|
52
|
-
export declare function pollMessageUntilFinished<T>(getResult: () => Promise<T>, getFinishedAt: (result: T) => string | null | undefined, intervalMs: number): Promise<T>;
|
|
50
|
+
export declare function pollUntilFinished<T>(getResult: () => Promise<T>, getFinishedAt: (result: T) => Date | string | null | undefined, intervalMs: number): Promise<T>;
|
|
53
51
|
export {};
|
|
54
52
|
//# sourceMappingURL=runHandler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runHandler.d.ts","sourceRoot":"","sources":["../../src/commands/runHandler.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;;;;;;;CAOZ,CAA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OAAO,CAAC,IAAI,CAAC,CAE/C;AAED,wBAAsB,iBAAiB,CAAC,CAAC,EACvC,SAAS,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EAC3B,aAAa,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,IAAI,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,EAC9D,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,CAAC,CAAC,CAaZ"}
|
|
@@ -290,40 +290,14 @@ function extractApiErrorDetail(body) {
|
|
|
290
290
|
export function sleep(ms) {
|
|
291
291
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
292
292
|
}
|
|
293
|
-
|
|
294
|
-
"success",
|
|
295
|
-
"error",
|
|
296
|
-
"cancelled",
|
|
297
|
-
"skipped",
|
|
298
|
-
]);
|
|
299
|
-
const TERMINAL_BATCH_STATUSES = new Set([
|
|
300
|
-
"success",
|
|
301
|
-
"error",
|
|
302
|
-
"cancelled",
|
|
303
|
-
"skipped",
|
|
304
|
-
]);
|
|
305
|
-
export async function pollRunUntilFinished(getResult, getStatus, intervalMs) {
|
|
293
|
+
export async function pollUntilFinished(getResult, getFinishedAt, intervalMs) {
|
|
306
294
|
let result = await handleApiCall(getResult, { spinner: false });
|
|
307
|
-
while (
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
}
|
|
313
|
-
export async function pollBatchUntilFinished(getResult, getStatus, intervalMs) {
|
|
314
|
-
let result = await handleApiCall(getResult, { spinner: false });
|
|
315
|
-
while (!TERMINAL_BATCH_STATUSES.has(getStatus(result))) {
|
|
316
|
-
await sleep(intervalMs);
|
|
317
|
-
result = await handleApiCall(getResult, { spinner: false });
|
|
318
|
-
}
|
|
319
|
-
return result;
|
|
320
|
-
}
|
|
321
|
-
export async function pollMessageUntilFinished(getResult, getFinishedAt, intervalMs) {
|
|
322
|
-
let result = await handleApiCall(getResult, { spinner: false });
|
|
323
|
-
const finishedAt = getFinishedAt(result);
|
|
324
|
-
while (finishedAt === null || finishedAt === undefined) {
|
|
295
|
+
while (true) {
|
|
296
|
+
const finishedAt = getFinishedAt(result);
|
|
297
|
+
if (finishedAt !== null && finishedAt !== undefined) {
|
|
298
|
+
return result;
|
|
299
|
+
}
|
|
325
300
|
await sleep(intervalMs);
|
|
326
301
|
result = await handleApiCall(getResult, { spinner: false });
|
|
327
302
|
}
|
|
328
|
-
return result;
|
|
329
303
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cargo-ai/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.78",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"homepage": "https://getcargo.ai",
|
|
@@ -64,10 +64,10 @@
|
|
|
64
64
|
"format:check": "prettier --check ."
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"@cargo-ai/api": "^1.0.
|
|
67
|
+
"@cargo-ai/api": "^1.0.72",
|
|
68
68
|
"@cargo-ai/app-sdk": "^1.0.9",
|
|
69
|
-
"@cargo-ai/cdk": "^1.0.
|
|
70
|
-
"@cargo-ai/types": "^1.0.
|
|
69
|
+
"@cargo-ai/cdk": "^1.0.62",
|
|
70
|
+
"@cargo-ai/types": "^1.0.69",
|
|
71
71
|
"@cargo-ai/utils": "^1.0.28",
|
|
72
72
|
"@cargo-ai/worker-sdk": "^1.0.17",
|
|
73
73
|
"@modelcontextprotocol/sdk": "1.29.0",
|