@cargo-ai/cli 1.0.64 → 1.0.65
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/message.d.ts.map +1 -1
- package/build/commands/ai/message.js +3 -2
- package/build/commands/ai/release.d.ts.map +1 -1
- package/build/commands/ai/release.js +3 -2
- package/build/commands/ai/vote.d.ts.map +1 -1
- package/build/commands/ai/vote.js +2 -1
- package/build/commands/auth/index.d.ts.map +1 -1
- package/build/commands/auth/index.js +3 -2
- package/build/commands/billing/subscription.d.ts.map +1 -1
- package/build/commands/billing/subscription.js +3 -2
- package/build/commands/connection/action.js +1 -1
- package/build/commands/connection/connector.d.ts.map +1 -1
- package/build/commands/connection/connector.js +2 -1
- package/build/commands/context/runtime.d.ts.map +1 -1
- package/build/commands/context/runtime.js +2 -1
- package/build/commands/expression/recipe.d.ts.map +1 -1
- package/build/commands/expression/recipe.js +3 -2
- package/build/commands/observability/alert.d.ts.map +1 -1
- package/build/commands/observability/alert.js +6 -21
- package/build/commands/orchestration/action.d.ts.map +1 -1
- package/build/commands/orchestration/action.js +3 -2
- package/build/commands/orchestration/batch.d.ts.map +1 -1
- package/build/commands/orchestration/batch.js +5 -4
- package/build/commands/orchestration/node.d.ts.map +1 -1
- package/build/commands/orchestration/node.js +3 -2
- package/build/commands/orchestration/play.d.ts.map +1 -1
- package/build/commands/orchestration/play.js +10 -24
- package/build/commands/orchestration/record.d.ts.map +1 -1
- package/build/commands/orchestration/record.js +6 -5
- package/build/commands/orchestration/release.d.ts.map +1 -1
- package/build/commands/orchestration/release.js +2 -1
- package/build/commands/orchestration/run.d.ts.map +1 -1
- package/build/commands/orchestration/run.js +10 -9
- package/build/commands/segmentation/change.d.ts.map +1 -1
- package/build/commands/segmentation/change.js +2 -1
- package/build/commands/segmentation/record.d.ts.map +1 -1
- package/build/commands/segmentation/record.js +2 -1
- package/build/commands/segmentation/segment.d.ts.map +1 -1
- package/build/commands/segmentation/segment.js +3 -2
- package/build/commands/storage/run.d.ts.map +1 -1
- package/build/commands/storage/run.js +3 -2
- package/build/commands/version.d.ts.map +1 -1
- package/build/commands/version.js +2 -1
- package/build/commands/workspaceManagement/session.d.ts.map +1 -1
- package/build/commands/workspaceManagement/session.js +2 -1
- package/build/commands/workspaceManagement/workspaces.d.ts.map +1 -1
- package/build/commands/workspaceManagement/workspaces.js +2 -1
- package/build/index.js +5 -0
- package/build/utils/booleanOption.d.ts +6 -0
- package/build/utils/booleanOption.d.ts.map +1 -0
- package/build/utils/booleanOption.js +33 -0
- package/package.json +1 -1
|
@@ -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;AAkCxC,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CAgSN"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { parseBooleanOption } from "../../utils/booleanOption.js";
|
|
1
2
|
import { loadCompiledAgent, resolveCompiledAgentFromState, } from "../../utils/loadCompiledAgent.js";
|
|
2
3
|
import { ExitCodes, failWith, handleApiCall, info, outputJson, parseJson, pollMessageUntilFinished, } from "../runHandler.js";
|
|
3
4
|
export function registerMessageCommands(parent, getApi) {
|
|
@@ -20,14 +21,14 @@ export function registerMessageCommands(parent, getApi) {
|
|
|
20
21
|
.option("--capabilities <json>", "Capabilities to enable (JSON array of capability objects)")
|
|
21
22
|
.option("--mcp-clients <json>", "MCP clients to connect (JSON array of MCP client objects)")
|
|
22
23
|
.option("--system-prompt <text>", "System prompt override (string)")
|
|
23
|
-
.option("--with-reasoning", "Enable reasoning mode (
|
|
24
|
+
.option("--with-reasoning [value]", "Enable reasoning mode (true/false, defaults to true when passed bare)", parseBooleanOption)
|
|
24
25
|
.option("--temperature <n>", "Sampling temperature (float, 0.0-1.0)")
|
|
25
26
|
.option("--max-steps <n>", "Maximum number of agentic steps (integer)")
|
|
26
27
|
.option("--integration-slug <slug>", "Integration slug (string)")
|
|
27
28
|
.option("--connector-uuid <uuid>", "Connector UUID (string)")
|
|
28
29
|
.option("--language-model-slug <slug>", "Language model slug (string)")
|
|
29
30
|
.option("--output <json>", 'Output format for the assistant message (JSON object, e.g. \'{"type":"text"}\' or \'{"type":"jsonSchema","jsonSchema":{...}}\'). Defaults to text when omitted.')
|
|
30
|
-
.option("--wait-until-finished", "Poll the assistant message until finished before returning (
|
|
31
|
+
.option("--wait-until-finished [value]", "Poll the assistant message until finished before returning (true/false, defaults to true when passed bare)", parseBooleanOption)
|
|
31
32
|
.option("--polling-interval <ms>", "Polling interval in milliseconds, used with --wait-until-finished (integer, default: 5000)", "5000")
|
|
32
33
|
.addHelpText("after", `
|
|
33
34
|
Examples:
|
|
@@ -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;
|
|
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,CA6SN"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { parseBooleanOption } from "../../utils/booleanOption.js";
|
|
1
2
|
import { handleApiCall, outputJson, parseJson } from "../runHandler.js";
|
|
2
3
|
export function registerReleaseCommands(parent, getApi) {
|
|
3
4
|
const release = parent
|
|
@@ -56,7 +57,7 @@ export function registerReleaseCommands(parent, getApi) {
|
|
|
56
57
|
.requiredOption("--agent-uuid <uuid>", "Agent UUID (string, required)")
|
|
57
58
|
.option("--parent-uuid <uuid>", "Parent release UUID to inherit from (string)")
|
|
58
59
|
.option("--system-prompt <text>", "System prompt (string)")
|
|
59
|
-
.option("--with-reasoning", "Enable reasoning mode (
|
|
60
|
+
.option("--with-reasoning [value]", "Enable reasoning mode (true/false, defaults to true when passed bare)", parseBooleanOption)
|
|
60
61
|
.option("--temperature <n>", "Sampling temperature (float, 0.0-1.0)")
|
|
61
62
|
.option("--max-steps <n>", "Maximum agentic steps (integer)")
|
|
62
63
|
.option("--integration-slug <slug>", "LLM integration slug (string)")
|
|
@@ -128,7 +129,7 @@ Set "isReadOnly": false on a model resource to grant the agent write tools (inse
|
|
|
128
129
|
.requiredOption("--capabilities <json>", "Capabilities to enable (JSON array, required)")
|
|
129
130
|
.requiredOption("--suggested-actions <json>", "Suggested actions for chat UI (JSON array, required)")
|
|
130
131
|
.option("--system-prompt <text>", "System prompt (string)")
|
|
131
|
-
.option("--with-reasoning", "Enable reasoning mode (
|
|
132
|
+
.option("--with-reasoning [value]", "Enable reasoning mode (true/false, defaults to true when passed bare)", parseBooleanOption)
|
|
132
133
|
.option("--temperature <n>", "Sampling temperature (float, 0.0-1.0)")
|
|
133
134
|
.option("--max-steps <n>", "Maximum agentic steps (integer)")
|
|
134
135
|
.option("--connector-uuid <uuid>", "Connector UUID (string)")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vote.d.ts","sourceRoot":"","sources":["../../../src/commands/ai/vote.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":"vote.d.ts","sourceRoot":"","sources":["../../../src/commands/ai/vote.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAIxC,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,GAAG,IAAI,CAsC7E"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { parseBooleanOption } from "../../utils/booleanOption.js";
|
|
1
2
|
import { handleApiCall, outputJson } from "../runHandler.js";
|
|
2
3
|
export function registerVoteCommands(parent, getApi) {
|
|
3
4
|
const vote = parent.command("vote").description("Vote operations");
|
|
@@ -6,7 +7,7 @@ export function registerVoteCommands(parent, getApi) {
|
|
|
6
7
|
.description("Upsert a vote")
|
|
7
8
|
.requiredOption("--chat-uuid <uuid>", "Chat UUID")
|
|
8
9
|
.requiredOption("--message-uuid <uuid>", "Message UUID")
|
|
9
|
-
.option("--is-upvoted", "Upvote the message")
|
|
10
|
+
.option("--is-upvoted [value]", "Upvote the message", parseBooleanOption)
|
|
10
11
|
.action(async (opts) => {
|
|
11
12
|
const api = getApi();
|
|
12
13
|
const result = await handleApiCall(() => api.ai.vote.upsert({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/auth/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,WAAW,CAAC;AAGjD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/auth/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,WAAW,CAAC;AAGjD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AA0BxD,MAAM,MAAM,aAAa,GAAG;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CA2GN;AAiGD,MAAM,MAAM,cAAc,GAAG;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAEpE;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,WAAW,EAAE,WAAW,GAAG,SAAS,EACpC,IAAI,EAAE,aAAa,GAClB,cAAc,CAchB"}
|
|
@@ -3,6 +3,7 @@ import { Option } from "commander";
|
|
|
3
3
|
import { AGENT_SKILLS_NEXT_STEP } from "../../agentSkills.js";
|
|
4
4
|
import { getConfig } from "../../config.js";
|
|
5
5
|
import { clearCredentials, CredentialsNotClearedError, getCredentialsPath, loadCredentials, saveCredentials, } from "../../credentials.js";
|
|
6
|
+
import { parseBooleanOption } from "../../utils/booleanOption.js";
|
|
6
7
|
import { ExitCodes, failWith, handleApiCall, info, outputJson, success, } from "../runHandler.js";
|
|
7
8
|
import { runEmailLogin } from "./email.js";
|
|
8
9
|
import { selectLoginChannel } from "./loginChannel.js";
|
|
@@ -14,7 +15,7 @@ export function registerAuthCommands(program, getApi) {
|
|
|
14
15
|
.description("Sign in to Cargo with an emailed code (--email), via browser (--oauth), or with an existing API token (--token)")
|
|
15
16
|
.option("--email <email>", "Sign in with a code emailed to this address; creates the account on first use")
|
|
16
17
|
.option("--code <code>", 'Verification code from the email, or "-" to read it from stdin; omit to have one sent (--email only)')
|
|
17
|
-
.option("--oauth", "Sign in via browser using the OAuth 2.0 Device Authorization Flow")
|
|
18
|
+
.option("--oauth [value]", "Sign in via browser using the OAuth 2.0 Device Authorization Flow", parseBooleanOption)
|
|
18
19
|
.option("--token <token>", "Existing Cargo API token")
|
|
19
20
|
.option("--workspace-name <name>", "Workspace to use, created if no workspace of that name exists (skips the workspace prompt)")
|
|
20
21
|
.option("--workspace-uuid <uuid>", "Workspace UUID to sign in for (skips the workspace prompt)")
|
|
@@ -55,7 +56,7 @@ Environment variables (CARGO_API_TOKEN, CARGO_WORKSPACE_UUID, CARGO_BASE_URL) ta
|
|
|
55
56
|
program
|
|
56
57
|
.command("logout")
|
|
57
58
|
.description("Sign out: revoke the saved credential and remove it locally")
|
|
58
|
-
.option("--keep-token", "Only forget the credentials locally, leaving the session or token valid")
|
|
59
|
+
.option("--keep-token [value]", "Only forget the credentials locally, leaving the session or token valid", parseBooleanOption)
|
|
59
60
|
// The credential is usually a session now, so accept the name people reach
|
|
60
61
|
// for; --keep-token stays the documented spelling for existing scripts.
|
|
61
62
|
.addOption(new Option("--keep-session").hideHelp())
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscription.d.ts","sourceRoot":"","sources":["../../../src/commands/billing/subscription.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":"subscription.d.ts","sourceRoot":"","sources":["../../../src/commands/billing/subscription.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAwFxC,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CAuSN"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { parseBooleanOption } from "../../utils/booleanOption.js";
|
|
1
2
|
import { ExitCodes, failWith, handleApiCall, outputJson, parsePositiveInt, success, } from "../runHandler.js";
|
|
2
3
|
import { DEFAULT_POLL_INTERVAL_SECONDS, DEFAULT_TIMEOUT_SECONDS, runHostedCardForm, } from "./hostedCardForm.js";
|
|
3
4
|
import { parseCardExpiry, readCardFromStdin, tokenizeCard, } from "./tokenizeCard.js";
|
|
@@ -85,7 +86,7 @@ Example:
|
|
|
85
86
|
.option("--card-number <number>", "Card number")
|
|
86
87
|
.option("--card-exp <MM/YYYY>", "Card expiry, e.g. 12/2030")
|
|
87
88
|
.option("--card-cvc <cvc>", "Card security code")
|
|
88
|
-
.option("--card-stdin", 'Read {"number","expMonth","expYear","cvc"} as JSON from stdin')
|
|
89
|
+
.option("--card-stdin [value]", 'Read {"number","expMonth","expYear","cvc"} as JSON from stdin', parseBooleanOption)
|
|
89
90
|
.option("--timeout <seconds>", `Hosted-form mode: how long to wait for the card to change (default: ${String(DEFAULT_TIMEOUT_SECONDS)})`)
|
|
90
91
|
.option("--poll-interval <seconds>", `Hosted-form mode: how often to check for the new card (default: ${String(DEFAULT_POLL_INTERVAL_SECONDS)})`)
|
|
91
92
|
.option("--no-open", "Hosted-form mode: print the URL without launching a browser")
|
|
@@ -175,7 +176,7 @@ Examples:
|
|
|
175
176
|
subscription
|
|
176
177
|
.command("update-topup")
|
|
177
178
|
.description("Configure automatic credit top-ups")
|
|
178
|
-
.option("--enabled", "Enable automatic top-ups (omit to disable)")
|
|
179
|
+
.option("--enabled [value]", "Enable automatic top-ups (omit to disable)", parseBooleanOption)
|
|
179
180
|
.requiredOption("--credits-count <n>", "Number of credits to add per top-up")
|
|
180
181
|
.requiredOption("--threshold <n>", "Trigger top-up when remaining credits drop below this number")
|
|
181
182
|
.addHelpText("after", `
|
|
@@ -11,7 +11,7 @@ export function registerActionSearchCommands(parent, getApi) {
|
|
|
11
11
|
"instead of scanning the full `integration list` payload")
|
|
12
12
|
.option("--category <category>", "Filter by integration category (string)")
|
|
13
13
|
.option("--integration <slug>", "Filter by integration slug (string)")
|
|
14
|
-
.option("--credits-only", "Only return credits-based (paid) actions (
|
|
14
|
+
.option("--credits-only", "Only return credits-based (paid) actions (presence flag)")
|
|
15
15
|
.option("--limit <n>", `Maximum results to return (integer, default: ${String(DEFAULT_LIMIT)})`, String(DEFAULT_LIMIT))
|
|
16
16
|
.addHelpText("after", `
|
|
17
17
|
All query terms must match somewhere (action slug/name, integration, or description).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connector.d.ts","sourceRoot":"","sources":["../../../src/commands/connection/connector.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":"connector.d.ts","sourceRoot":"","sources":["../../../src/commands/connection/connector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAIxC,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CAwPN"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { parseBooleanOption } from "../../utils/booleanOption.js";
|
|
1
2
|
import { handleApiCall, outputJson, parseJson } from "../runHandler.js";
|
|
2
3
|
export function registerConnectorCommands(parent, getApi) {
|
|
3
4
|
const connector = parent
|
|
@@ -45,7 +46,7 @@ export function registerConnectorCommands(parent, getApi) {
|
|
|
45
46
|
.requiredOption("--slug <slug>", "Field slug to autocomplete (string, required)")
|
|
46
47
|
.requiredOption("--params <json>", "Autocomplete parameters (JSON object, required)")
|
|
47
48
|
.option("--value <value>", "Search value to filter results (string)")
|
|
48
|
-
.option("--refresh", "Refresh cached results (
|
|
49
|
+
.option("--refresh [value]", "Refresh cached results (true/false, defaults to true when passed bare)", parseBooleanOption)
|
|
49
50
|
.option("--variables <json>", "Additional variables (JSON object)")
|
|
50
51
|
.action(async (opts) => {
|
|
51
52
|
const api = getApi();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../src/commands/context/runtime.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":"runtime.d.ts","sourceRoot":"","sources":["../../../src/commands/context/runtime.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,CAqJN"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { parseBooleanOption } from "../../utils/booleanOption.js";
|
|
1
2
|
import { handleApiCall, outputJson } from "../runHandler.js";
|
|
2
3
|
export function registerRuntimeCommands(parent, getApi) {
|
|
3
4
|
const runtime = parent
|
|
@@ -50,7 +51,7 @@ export function registerRuntimeCommands(parent, getApi) {
|
|
|
50
51
|
.requiredOption("--path <path>", "Path to the file")
|
|
51
52
|
.requiredOption("--old-string <old>", "Exact substring to replace (must occur once unless --replace-all is set)")
|
|
52
53
|
.requiredOption("--new-string <new>", "Replacement string (may be empty to delete the match). Must differ from --old-string.")
|
|
53
|
-
.option("--replace-all", "Replace every occurrence of --old-string instead of requiring a single match")
|
|
54
|
+
.option("--replace-all [value]", "Replace every occurrence of --old-string instead of requiring a single match", parseBooleanOption)
|
|
54
55
|
.option("--commit-message <message>", "Commit message override")
|
|
55
56
|
.action(async (opts) => {
|
|
56
57
|
const api = getApi();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recipe.d.ts","sourceRoot":"","sources":["../../../src/commands/expression/recipe.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":"recipe.d.ts","sourceRoot":"","sources":["../../../src/commands/expression/recipe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAIxC,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CAwKN"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { parseBooleanOption } from "../../utils/booleanOption.js";
|
|
1
2
|
import { handleApiCall, outputJson, parseJson } from "../runHandler.js";
|
|
2
3
|
export function registerRecipeCommands(parent, getApi) {
|
|
3
4
|
const recipe = parent.command("recipe").description("Recipe operations");
|
|
@@ -49,7 +50,7 @@ export function registerRecipeCommands(parent, getApi) {
|
|
|
49
50
|
.requiredOption("--expression <expr>", "Expression")
|
|
50
51
|
.requiredOption("--instruct-to <value>", "Instruct to (ai or none)")
|
|
51
52
|
.requiredOption("--placeholders <json>", 'Placeholders (JSON array, e.g. [{"slug":"my_var","label":"My Variable","kind":"text"}])')
|
|
52
|
-
.option("--is-public", "Make recipe public")
|
|
53
|
+
.option("--is-public [value]", "Make recipe public", parseBooleanOption)
|
|
53
54
|
.action(async (opts) => {
|
|
54
55
|
const api = getApi();
|
|
55
56
|
const result = await handleApiCall(() => api.expression.recipe.create({
|
|
@@ -73,7 +74,7 @@ export function registerRecipeCommands(parent, getApi) {
|
|
|
73
74
|
.requiredOption("--category <cat>", "Category (other, classification, cleaning, marketing, sales, event, copywriting)")
|
|
74
75
|
.requiredOption("--expression <expr>", "Expression")
|
|
75
76
|
.requiredOption("--placeholders <json>", 'Placeholders (JSON array, e.g. [{"slug":"my_var","label":"My Variable","kind":"text"}])')
|
|
76
|
-
.option("--is-public", "Make recipe public")
|
|
77
|
+
.option("--is-public [value]", "Make recipe public", parseBooleanOption)
|
|
77
78
|
.action(async (opts) => {
|
|
78
79
|
const api = getApi();
|
|
79
80
|
const result = await handleApiCall(() => api.expression.recipe.createNewVersion({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../../src/commands/observability/alert.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":"alert.d.ts","sourceRoot":"","sources":["../../../src/commands/observability/alert.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAIxC,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CA4MN"}
|
|
@@ -1,18 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
// but the literal "true" used to read as false) is the kind of surprise a
|
|
4
|
-
// usage error prevents.
|
|
5
|
-
function parseBooleanOption(value, optionName) {
|
|
6
|
-
if (value === "true") {
|
|
7
|
-
return true;
|
|
8
|
-
}
|
|
9
|
-
if (value === "false") {
|
|
10
|
-
return false;
|
|
11
|
-
}
|
|
12
|
-
failWith(`${optionName} must be "true" or "false", got "${value}".`, {
|
|
13
|
-
code: ExitCodes.InvalidUsage,
|
|
14
|
-
});
|
|
15
|
-
}
|
|
1
|
+
import { parseBooleanOption } from "../../utils/booleanOption.js";
|
|
2
|
+
import { handleApiCall, outputJson, parseJson } from "../runHandler.js";
|
|
16
3
|
export function registerAlertCommands(parent, getApi) {
|
|
17
4
|
const alert = parent
|
|
18
5
|
.command("alert")
|
|
@@ -41,7 +28,7 @@ export function registerAlertCommands(parent, getApi) {
|
|
|
41
28
|
.requiredOption("--scope <json>", 'Scope (JSON), one of: {"kind":"spans","workflowUuid":"..."}, {"kind":"runs","workflowUuid":"...","statuses":["error"]}, {"kind":"records","workflowUuid":"...","statuses":["error"]}, {"kind":"orchestrationQuery","query":"select ..."}, {"kind":"storageQuery","query":"select ..."} or {"kind":"model","modelUuid":"...","filter":{...}}')
|
|
42
29
|
.requiredOption("--threshold <json>", 'Threshold (JSON). Spans, runs and records scopes: {"metric":"errorRate","operator":"gte","value":10}, {"metric":"duration","aggregation":"p95","operator":"gte","value":30}, {"metric":"credits","aggregation":"sum","operator":"gte","value":500} or {"metric":"count","operator":"lte","value":0}; model scopes: {"metric":"recordsCount","operator":"lte","value":0}, {"metric":"recordsShare","operator":"gte","value":30} (needs a scope filter), {"metric":"freshness","operator":"gte","value":60} or {"metric":"syncDuration","operator":"gte","value":300}; query scopes: {"metric":"query","operator":"gte","value":10}')
|
|
43
30
|
.option("--actions <json>", "Actions fired as runs on breach (JSON Action[]: connector, tool, or agent nodes)")
|
|
44
|
-
.option("--disabled", "Create the alert disabled")
|
|
31
|
+
.option("--disabled [value]", "Create the alert disabled", parseBooleanOption)
|
|
45
32
|
.option("--description <text>", "What this alert watches")
|
|
46
33
|
.option("--folder <uuid>", "Folder UUID to file the alert under")
|
|
47
34
|
.action(async (opts) => {
|
|
@@ -50,7 +37,7 @@ export function registerAlertCommands(parent, getApi) {
|
|
|
50
37
|
name: opts.name,
|
|
51
38
|
description: opts.description,
|
|
52
39
|
cron: opts.cron,
|
|
53
|
-
isEnabled: opts.disabled ===
|
|
40
|
+
isEnabled: opts.disabled === undefined ? undefined : opts.disabled === false,
|
|
54
41
|
scope: parseJson(opts.scope, "--scope"),
|
|
55
42
|
threshold: parseJson(opts.threshold, "--threshold"),
|
|
56
43
|
actions: opts.actions !== undefined
|
|
@@ -66,7 +53,7 @@ export function registerAlertCommands(parent, getApi) {
|
|
|
66
53
|
.requiredOption("--uuid <uuid>", "Alert UUID")
|
|
67
54
|
.option("--name <name>", "Alert name")
|
|
68
55
|
.option("--cron <cron>", 'Evaluation schedule: 5-field cron or "@every <interval>" (UTC), at most once a minute')
|
|
69
|
-
.option("--enabled
|
|
56
|
+
.option("--enabled [value]", "Enable or disable the alert (true/false)", parseBooleanOption)
|
|
70
57
|
.option("--scope <json>", "Scope (JSON). See `alert create`")
|
|
71
58
|
.option("--threshold <json>", "Threshold (JSON). See `alert create`")
|
|
72
59
|
.option("--actions <json>", "Actions fired as runs on breach (JSON Action[])")
|
|
@@ -78,9 +65,7 @@ export function registerAlertCommands(parent, getApi) {
|
|
|
78
65
|
uuid: opts.uuid,
|
|
79
66
|
name: opts.name,
|
|
80
67
|
cron: opts.cron,
|
|
81
|
-
isEnabled: opts.enabled
|
|
82
|
-
? parseBooleanOption(opts.enabled, "--enabled")
|
|
83
|
-
: undefined,
|
|
68
|
+
isEnabled: opts.enabled,
|
|
84
69
|
scope: opts.scope !== undefined
|
|
85
70
|
? parseJson(opts.scope, "--scope")
|
|
86
71
|
: undefined,
|
|
@@ -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;AAcxC,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CAuMN"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { parseBooleanOption } from "../../utils/booleanOption.js";
|
|
1
2
|
import { applyRecordsLimit, ExitCodes, failWith, handleApiCall, outputJson, parseJson, parsePositiveInt, pollBatchUntilFinished, pollRunUntilFinished, } from "../runHandler.js";
|
|
2
3
|
export function registerActionCommands(parent, getApi) {
|
|
3
4
|
const action = parent
|
|
@@ -18,7 +19,7 @@ To debug a node inside an existing workflow instead, use
|
|
|
18
19
|
.description("Execute a single action")
|
|
19
20
|
.requiredOption("--action <json>", 'Action definition (JSON object, required). Example: \'{"kind":"tool","toolUuid":"550e8400-...","config":{}}\'')
|
|
20
21
|
.requiredOption("--data <json>", "Input data for the run (JSON object, required)")
|
|
21
|
-
.option("--wait-until-finished", "Poll the run until it reaches a terminal status before returning (
|
|
22
|
+
.option("--wait-until-finished [value]", "Poll the run until it reaches a terminal status before returning (true/false, defaults to true when passed bare)", parseBooleanOption)
|
|
22
23
|
.option("--polling-interval <ms>", "Polling interval in milliseconds, used with --wait-until-finished (integer, default: 5000)", "5000")
|
|
23
24
|
.option("--webhook-url <url>", "URL to call when the run completes")
|
|
24
25
|
.option("--webhook-secret <secret>", "Secret used to sign webhook deliveries")
|
|
@@ -52,7 +53,7 @@ Examples:
|
|
|
52
53
|
.option("--webhook-url <url>", "URL to call when the batch completes")
|
|
53
54
|
.option("--webhook-secret <secret>", "Secret used to sign webhook deliveries")
|
|
54
55
|
.option("--limit <n>", "Pilot: only submit the first N records (integer). Inspect the pilot's output before re-running on the full set — credits-based actions bill per record.")
|
|
55
|
-
.option("--wait-until-finished", "Poll the batch until it reaches a terminal status before returning (
|
|
56
|
+
.option("--wait-until-finished [value]", "Poll the batch until it reaches a terminal status before returning (true/false, defaults to true when passed bare)", parseBooleanOption)
|
|
56
57
|
.option("--polling-interval <ms>", "Polling interval in milliseconds, used with --wait-until-finished (integer, default: 5000)", "5000")
|
|
57
58
|
.addHelpText("after", `
|
|
58
59
|
Examples:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"batch.d.ts","sourceRoot":"","sources":["../../../src/commands/orchestration/batch.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":"batch.d.ts","sourceRoot":"","sources":["../../../src/commands/orchestration/batch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAgBxC,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CA6RN"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { parseBooleanOption } from "../../utils/booleanOption.js";
|
|
1
2
|
import { loadCompiledWorkflow, resolveCompiledWorkflowFromState, } from "../../utils/loadCompiledWorkflow.js";
|
|
2
3
|
import { ExitCodes, failWith, handleApiCall, info, outputJson, parseJson, pollBatchUntilFinished, } from "../runHandler.js";
|
|
3
4
|
export function registerBatchCommands(parent, getApi) {
|
|
@@ -13,9 +14,9 @@ export function registerBatchCommands(parent, getApi) {
|
|
|
13
14
|
.option("--parent-run-uuid <uuid>", "Filter by parent run UUID (string)")
|
|
14
15
|
.option("--parent-node-uuid <uuid>", "Filter by parent node UUID (string)")
|
|
15
16
|
.option("--statuses <list>", "Filter by statuses (comma-separated: pending,syncing,skipped,querying,running,success,cancelling,error,cancelled)")
|
|
16
|
-
.option("--has-runs", "Only return batches that have runs (
|
|
17
|
-
.option("--is-skipped", "Only return skipped batches (
|
|
18
|
-
.option("--is-finished", "Only return finished batches (
|
|
17
|
+
.option("--has-runs [value]", "Only return batches that have runs (true/false, defaults to true when passed bare)", parseBooleanOption)
|
|
18
|
+
.option("--is-skipped [value]", "Only return skipped batches (true/false, defaults to true when passed bare)", parseBooleanOption)
|
|
19
|
+
.option("--is-finished [value]", "Only return finished batches (true/false, defaults to true when passed bare)", parseBooleanOption)
|
|
19
20
|
.option("--included-data-kinds <list>", "Include only these data kinds (comma-separated strings)")
|
|
20
21
|
.option("--excluded-data-kinds <list>", "Exclude these data kinds (comma-separated strings)")
|
|
21
22
|
.option("--limit <n>", "Max results to return (integer, default: 20)", "20")
|
|
@@ -68,7 +69,7 @@ export function registerBatchCommands(parent, getApi) {
|
|
|
68
69
|
.option("--release-uuid <uuid>", "Release UUID to pin the batch to (string)")
|
|
69
70
|
.option("--file <path>", "Path to a Workflow SDK module (its default export must be the compiled workflow returned by defineWorkflow()). Compiles it, resolves any @cargo-ai/cdk resource handles to real uuids from cargo.state.json, and runs the resulting nodes. Rejected with --nodes.")
|
|
70
71
|
.option("--nodes <json>", "Custom nodes to override the workflow definition (JSON array). Rejected with --file.")
|
|
71
|
-
.option("--wait-until-finished", "Poll the batch until it reaches a terminal status before returning (
|
|
72
|
+
.option("--wait-until-finished [value]", "Poll the batch until it reaches a terminal status before returning (true/false, defaults to true when passed bare)", parseBooleanOption)
|
|
72
73
|
.option("--polling-interval <ms>", "Polling interval in milliseconds, used with --wait-until-finished (integer, default: 5000)", "5000")
|
|
73
74
|
.addHelpText("after", `
|
|
74
75
|
Examples:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../src/commands/orchestration/node.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../src/commands/orchestration/node.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAiBxC,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,GAAG,IAAI,CAoK7E"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { readFileSync } from "node:fs";
|
|
2
|
+
import { parseBooleanOption } from "../../utils/booleanOption.js";
|
|
2
3
|
import { ExitCodes, failWith, handleApiCall, outputJson, parseJson, } from "../runHandler.js";
|
|
3
4
|
import { extractNodes, renderNodeDiagram, toMermaidBlock, } from "./nodeDiagram.js";
|
|
4
5
|
import { renderNodeAscii } from "./nodeDiagramAscii.js";
|
|
@@ -110,7 +111,7 @@ function registerDiagramCommand(node, getApi) {
|
|
|
110
111
|
.option("--nodes <json>", "Node definitions (JSON array, or '-' to read from stdin)")
|
|
111
112
|
.option("--file <path>", "Read a JSON payload or node array from a file")
|
|
112
113
|
.option("--workflow-uuid <uuid>", "Diagram a workflow's deployed release (add --draft for its draft)")
|
|
113
|
-
.option("--draft", "With --workflow-uuid, use the draft release")
|
|
114
|
+
.option("--draft [value]", "With --workflow-uuid, use the draft release", parseBooleanOption)
|
|
114
115
|
.option("--release-uuid <uuid>", "Diagram a specific release")
|
|
115
116
|
.option("--run-uuid <uuid>", "Diagram the graph a run executed (follows the run's release when it has one)")
|
|
116
117
|
.option("--title <text>", "Title rendered above the diagram")
|
|
@@ -118,7 +119,7 @@ function registerDiagramCommand(node, getApi) {
|
|
|
118
119
|
.option("--direction <TD|LR>", "Mermaid flow direction, ignored by --format ascii (default: TD)", "TD")
|
|
119
120
|
.option("--paid <slugs>", "Comma-separated node slugs/uuids that bill credits — marked 💳")
|
|
120
121
|
.option("--highlight <slugs>", "Comma-separated node slugs/uuids to mark (red in Mermaid, ← in ASCII)")
|
|
121
|
-
.option("--raw", "Print the diagram itself instead of JSON")
|
|
122
|
+
.option("--raw [value]", "Print the diagram itself instead of JSON", parseBooleanOption)
|
|
122
123
|
.addHelpText("after", `
|
|
123
124
|
Free, runs nothing: turns a node graph into a picture so a reviewer can see the
|
|
124
125
|
routing, the fallback paths and which steps bill before approving or deploying
|
|
@@ -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;
|
|
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;AAOxC,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,GAAG,IAAI,CAuR7E"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { parseBooleanOption, resolveBooleanPair, } from "../../utils/booleanOption.js";
|
|
1
2
|
import { handleApiCall, outputJson, parseJson } from "../runHandler.js";
|
|
2
3
|
export function registerPlayCommands(parent, getApi) {
|
|
3
4
|
const play = parent
|
|
@@ -9,13 +10,11 @@ export function registerPlayCommands(parent, getApi) {
|
|
|
9
10
|
.option("--model-uuid <uuid>", "Only plays for this model UUID")
|
|
10
11
|
.option("--segment-uuid <uuid>", "Only plays for this segment UUID")
|
|
11
12
|
.option("--schedule-type <type>", "Only plays with this schedule type: dbt | cron | realtime | dependency | watch")
|
|
12
|
-
.option("--is-enabled", "Only enabled plays (
|
|
13
|
-
.option("--is-disabled", "Only disabled plays (
|
|
13
|
+
.option("--is-enabled [value]", "Only enabled plays (true/false, defaults to true when passed bare)", parseBooleanOption)
|
|
14
|
+
.option("--is-disabled [value]", "Only disabled plays (true/false, defaults to true when passed bare)", parseBooleanOption)
|
|
14
15
|
.action(async (opts) => {
|
|
15
16
|
const api = getApi();
|
|
16
|
-
|
|
17
|
-
throw new Error("Use only one of --is-enabled or --is-disabled");
|
|
18
|
-
}
|
|
17
|
+
const isEnabledFilter = resolveBooleanPair(opts.isEnabled, opts.isDisabled, { positive: "--is-enabled", negative: "--is-disabled" });
|
|
19
18
|
const scheduleTypes = [
|
|
20
19
|
"dbt",
|
|
21
20
|
"cron",
|
|
@@ -31,13 +30,6 @@ export function registerPlayCommands(parent, getApi) {
|
|
|
31
30
|
}
|
|
32
31
|
scheduleType = opts.scheduleType;
|
|
33
32
|
}
|
|
34
|
-
let isEnabledFilter;
|
|
35
|
-
if (opts.isEnabled === true) {
|
|
36
|
-
isEnabledFilter = true;
|
|
37
|
-
}
|
|
38
|
-
if (opts.isDisabled === true) {
|
|
39
|
-
isEnabledFilter = false;
|
|
40
|
-
}
|
|
41
33
|
const result = await handleApiCall(() => api.orchestration.play.list({
|
|
42
34
|
modelUuid: opts.modelUuid,
|
|
43
35
|
segmentUuid: opts.segmentUuid,
|
|
@@ -90,8 +82,8 @@ Examples:
|
|
|
90
82
|
.description("Update a play")
|
|
91
83
|
.option("--name <name>", "Play name")
|
|
92
84
|
.option("--description <description>", "Description")
|
|
93
|
-
.option("--is-enabled", "Enable the play")
|
|
94
|
-
.option("--is-disabled", "Disable the play")
|
|
85
|
+
.option("--is-enabled [value]", "Enable the play", parseBooleanOption)
|
|
86
|
+
.option("--is-disabled [value]", "Disable the play", parseBooleanOption)
|
|
95
87
|
.option("--change-kinds <kinds>", "Change kinds to trigger on (comma-separated strings)")
|
|
96
88
|
.option("--run-creation-rule <rule>", "Run creation rule. Allowed values: always, once, noConcurrency")
|
|
97
89
|
.option("--folder-uuid <uuid>", "Folder UUID")
|
|
@@ -105,16 +97,10 @@ Examples:
|
|
|
105
97
|
.option("--template <json>", 'Template settings (JSON object, e.g. {"isAvailable":true,"scope":"private"})')
|
|
106
98
|
.action(async (uuid, opts) => {
|
|
107
99
|
const api = getApi();
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
if (opts.isEnabled === true) {
|
|
113
|
-
isEnabled = true;
|
|
114
|
-
}
|
|
115
|
-
if (opts.isDisabled === true) {
|
|
116
|
-
isEnabled = false;
|
|
117
|
-
}
|
|
100
|
+
const isEnabled = resolveBooleanPair(opts.isEnabled, opts.isDisabled, {
|
|
101
|
+
positive: "--is-enabled",
|
|
102
|
+
negative: "--is-disabled",
|
|
103
|
+
});
|
|
118
104
|
let runCreationRule;
|
|
119
105
|
if (opts.runCreationRule !== undefined) {
|
|
120
106
|
const validRules = [
|
|
@@ -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;
|
|
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;AAIxC,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CAgbN"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { parseBooleanOption } from "../../utils/booleanOption.js";
|
|
1
2
|
import { handleApiCall, outputJson, parseJson } from "../runHandler.js";
|
|
2
3
|
export function registerRecordCommands(parent, getApi) {
|
|
3
4
|
const record = parent.command("record").description("Record operations");
|
|
@@ -14,7 +15,7 @@ export function registerRecordCommands(parent, getApi) {
|
|
|
14
15
|
.option("--parent-batch-uuid <uuid>", "Parent batch UUID")
|
|
15
16
|
.option("--parent-run-uuid <uuid>", "Parent run UUID")
|
|
16
17
|
.option("--parent-node-uuid <uuid>", "Parent node UUID")
|
|
17
|
-
.option("--is-group-parent", "Only group parents")
|
|
18
|
+
.option("--is-group-parent [value]", "Only group parents", parseBooleanOption)
|
|
18
19
|
.option("--executions-filter <json>", 'Executions filter (JSON, e.g. {"conjonction":"and","groups":[{"conjonction":"and","conditions":[{"kind":"node","nodeSlug":"...","status":"pending"}]}]})')
|
|
19
20
|
.option("--created-after <date>", "Created after date")
|
|
20
21
|
.option("--created-before <date>", "Created before date")
|
|
@@ -67,7 +68,7 @@ export function registerRecordCommands(parent, getApi) {
|
|
|
67
68
|
.option("--parent-batch-uuid <uuid>", "Parent batch UUID")
|
|
68
69
|
.option("--parent-run-uuid <uuid>", "Parent run UUID")
|
|
69
70
|
.option("--parent-node-uuid <uuid>", "Parent node UUID")
|
|
70
|
-
.option("--is-group-parent", "Only group parents")
|
|
71
|
+
.option("--is-group-parent [value]", "Only group parents", parseBooleanOption)
|
|
71
72
|
.option("--executions-filter <json>", 'Executions filter (JSON, e.g. {"conjonction":"and","groups":[{"conjonction":"and","conditions":[{"kind":"node","nodeSlug":"...","status":"pending"}]}]})')
|
|
72
73
|
.option("--created-after <date>", "Created after date")
|
|
73
74
|
.option("--created-before <date>", "Created before date")
|
|
@@ -114,7 +115,7 @@ export function registerRecordCommands(parent, getApi) {
|
|
|
114
115
|
.option("--parent-batch-uuid <uuid>", "Parent batch UUID")
|
|
115
116
|
.option("--parent-run-uuid <uuid>", "Parent run UUID")
|
|
116
117
|
.option("--parent-node-uuid <uuid>", "Parent node UUID")
|
|
117
|
-
.option("--is-group-parent", "Only group parents")
|
|
118
|
+
.option("--is-group-parent [value]", "Only group parents", parseBooleanOption)
|
|
118
119
|
.option("--executions-filter <json>", 'Executions filter (JSON, e.g. {"conjonction":"and","groups":[{"conjonction":"and","conditions":[{"kind":"node","nodeSlug":"...","status":"pending"}]}]})')
|
|
119
120
|
.option("--created-after <date>", "Created after date")
|
|
120
121
|
.option("--created-before <date>", "Created before date")
|
|
@@ -163,7 +164,7 @@ export function registerRecordCommands(parent, getApi) {
|
|
|
163
164
|
.option("--parent-batch-uuid <uuid>", "Parent batch UUID")
|
|
164
165
|
.option("--parent-run-uuid <uuid>", "Parent run UUID")
|
|
165
166
|
.option("--parent-node-uuid <uuid>", "Parent node UUID")
|
|
166
|
-
.option("--is-group-parent", "Only group parents")
|
|
167
|
+
.option("--is-group-parent [value]", "Only group parents", parseBooleanOption)
|
|
167
168
|
.option("--executions-filter <json>", 'Executions filter (JSON, e.g. {"conjonction":"and","groups":[{"conjonction":"and","conditions":[{"kind":"node","nodeSlug":"...","status":"pending"}]}]})')
|
|
168
169
|
.option("--created-after <date>", "Created after date")
|
|
169
170
|
.option("--created-before <date>", "Created before date")
|
|
@@ -226,7 +227,7 @@ export function registerRecordCommands(parent, getApi) {
|
|
|
226
227
|
.option("--parent-batch-uuid <uuid>", "Parent batch UUID")
|
|
227
228
|
.option("--parent-run-uuid <uuid>", "Parent run UUID")
|
|
228
229
|
.option("--parent-node-uuid <uuid>", "Parent node UUID")
|
|
229
|
-
.option("--is-group-parent", "Only group parents")
|
|
230
|
+
.option("--is-group-parent [value]", "Only group parents", parseBooleanOption)
|
|
230
231
|
.option("--executions-filter <json>", 'Executions filter (JSON, e.g. {"conjonction":"and","groups":[{"conjonction":"and","conditions":[{"kind":"node","nodeSlug":"...","status":"pending"}]}]})')
|
|
231
232
|
.action(async (opts) => {
|
|
232
233
|
const payload = opts.ids !== undefined
|
|
@@ -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;
|
|
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;AAoCxC,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CAgLN"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { parseBooleanOption } from "../../utils/booleanOption.js";
|
|
1
2
|
import { loadCompiledWorkflow, } from "../../utils/loadCompiledWorkflow.js";
|
|
2
3
|
import { ExitCodes, failWith, handleApiCall, info, outputJson, parseJson, success, } from "../runHandler.js";
|
|
3
4
|
export function registerReleaseCommands(parent, getApi) {
|
|
@@ -90,7 +91,7 @@ export function registerReleaseCommands(parent, getApi) {
|
|
|
90
91
|
.option("--form-fields <json>", "Form fields (JSON array, or 'null'). Required without --file; rejected with --file.")
|
|
91
92
|
.option("--description <text>", "Release description.")
|
|
92
93
|
.option("--options <json>", "Options (JSON object)")
|
|
93
|
-
.option("--dry-run", "With --file: compile and print the nodes + form fields without deploying. Ignored without --file.")
|
|
94
|
+
.option("--dry-run [value]", "With --file: compile and print the nodes + form fields without deploying. Ignored without --file.", parseBooleanOption)
|
|
94
95
|
.action(async (opts) => {
|
|
95
96
|
if (opts.file !== undefined) {
|
|
96
97
|
await runFileDeploy(getApi, opts);
|
|
@@ -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;
|
|
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;AAgBxC,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,GAAG,IAAI,CAsqB5E"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { parseBooleanOption } from "../../utils/booleanOption.js";
|
|
1
2
|
import { loadCompiledWorkflow, resolveCompiledWorkflowFromState, } from "../../utils/loadCompiledWorkflow.js";
|
|
2
3
|
import { ExitCodes, failWith, handleApiCall, info, outputJson, parseJson, pollRunUntilFinished, } from "../runHandler.js";
|
|
3
4
|
export function registerRunCommands(parent, getApi) {
|
|
@@ -14,11 +15,11 @@ export function registerRunCommands(parent, getApi) {
|
|
|
14
15
|
.option("--parent-batch-uuid <uuid>", "Filter by parent batch UUID (string)")
|
|
15
16
|
.option("--parent-uuid <uuid>", "Filter by parent run UUID (string)")
|
|
16
17
|
.option("--parent-node-uuid <uuid>", "Filter by parent node UUID (string)")
|
|
17
|
-
.option("--is-group-parent", "Only return group parents (
|
|
18
|
+
.option("--is-group-parent [value]", "Only return group parents (true/false, defaults to true when passed bare)", parseBooleanOption)
|
|
18
19
|
.option("--record-id <id>", "Filter by record ID (string)")
|
|
19
20
|
.option("--record-title <title>", "Filter by record title (string)")
|
|
20
21
|
.option("--record-title-or-id <value>", "Filter by record title or ID (string)")
|
|
21
|
-
.option("--is-finished", "Only return finished runs (
|
|
22
|
+
.option("--is-finished [value]", "Only return finished runs (true/false, defaults to true when passed bare)", parseBooleanOption)
|
|
22
23
|
.option("--executions-filter <json>", 'Filter by node executions (JSON). Example: \'{"conjonction":"and","groups":[{"conjonction":"and","conditions":[{"kind":"node","nodeSlug":"my-node","status":"pending"}]}]}\'')
|
|
23
24
|
.option("--created-after <date>", "Filter runs created after this date (ISO 8601 string)")
|
|
24
25
|
.option("--created-before <date>", "Filter runs created before this date (ISO 8601 string)")
|
|
@@ -79,7 +80,7 @@ Examples:
|
|
|
79
80
|
.option("--release-uuid <uuid>", "Release UUID to pin the run to (string)")
|
|
80
81
|
.option("--file <path>", "Path to a Workflow SDK module (its default export must be the compiled workflow returned by defineWorkflow()). Compiles it, resolves any @cargo-ai/cdk resource handles to real uuids from cargo.state.json, and runs the resulting nodes. Rejected with --nodes.")
|
|
81
82
|
.option("--nodes <json>", "Custom nodes to override the workflow definition (JSON array). Rejected with --file.")
|
|
82
|
-
.option("--wait-until-finished", "Poll the run until it reaches a terminal status before returning (
|
|
83
|
+
.option("--wait-until-finished [value]", "Poll the run until it reaches a terminal status before returning (true/false, defaults to true when passed bare)", parseBooleanOption)
|
|
83
84
|
.option("--polling-interval <ms>", "Polling interval in milliseconds, used with --wait-until-finished (integer, default: 5000)", "5000")
|
|
84
85
|
.addHelpText("after", `
|
|
85
86
|
Examples:
|
|
@@ -150,11 +151,11 @@ Examples:
|
|
|
150
151
|
.option("--parent-batch-uuid <uuid>", "Filter by parent batch UUID (string)")
|
|
151
152
|
.option("--parent-uuid <uuid>", "Filter by parent run UUID (string)")
|
|
152
153
|
.option("--parent-node-uuid <uuid>", "Filter by parent node UUID (string)")
|
|
153
|
-
.option("--is-group-parent", "Only count group parents (
|
|
154
|
+
.option("--is-group-parent [value]", "Only count group parents (true/false, defaults to true when passed bare)", parseBooleanOption)
|
|
154
155
|
.option("--record-id <id>", "Filter by record ID (string)")
|
|
155
156
|
.option("--record-title <title>", "Filter by record title (string)")
|
|
156
157
|
.option("--record-title-or-id <value>", "Filter by record title or ID (string)")
|
|
157
|
-
.option("--is-finished", "Only count finished runs (
|
|
158
|
+
.option("--is-finished [value]", "Only count finished runs (true/false, defaults to true when passed bare)", parseBooleanOption)
|
|
158
159
|
.option("--executions-filter <json>", "Filter by node executions (JSON object, same format as 'run list')")
|
|
159
160
|
.option("--created-after <date>", "Filter runs created after this date (ISO 8601 string)")
|
|
160
161
|
.option("--created-before <date>", "Filter runs created before this date (ISO 8601 string)")
|
|
@@ -198,11 +199,11 @@ Examples:
|
|
|
198
199
|
.option("--parent-batch-uuid <uuid>", "Filter by parent batch UUID (string)")
|
|
199
200
|
.option("--parent-uuid <uuid>", "Filter by parent run UUID (string)")
|
|
200
201
|
.option("--parent-node-uuid <uuid>", "Filter by parent node UUID (string)")
|
|
201
|
-
.option("--is-group-parent", "Only return group parents (
|
|
202
|
+
.option("--is-group-parent [value]", "Only return group parents (true/false, defaults to true when passed bare)", parseBooleanOption)
|
|
202
203
|
.option("--record-id <id>", "Filter by record ID (string)")
|
|
203
204
|
.option("--record-title <title>", "Filter by record title (string)")
|
|
204
205
|
.option("--record-title-or-id <value>", "Filter by record title or ID (string)")
|
|
205
|
-
.option("--is-finished", "Only return finished runs (
|
|
206
|
+
.option("--is-finished [value]", "Only return finished runs (true/false, defaults to true when passed bare)", parseBooleanOption)
|
|
206
207
|
.option("--executions-filter <json>", "Filter by node executions (JSON object, same format as 'run list')")
|
|
207
208
|
.option("--created-after <date>", "Filter runs created after this date (ISO 8601 string)")
|
|
208
209
|
.option("--created-before <date>", "Filter runs created before this date (ISO 8601 string)")
|
|
@@ -250,11 +251,11 @@ Examples:
|
|
|
250
251
|
.option("--parent-batch-uuid <uuid>", "Filter by parent batch UUID (string)")
|
|
251
252
|
.option("--parent-uuid <uuid>", "Filter by parent run UUID (string)")
|
|
252
253
|
.option("--parent-node-uuid <uuid>", "Filter by parent node UUID (string)")
|
|
253
|
-
.option("--is-group-parent", "Only return group parents (
|
|
254
|
+
.option("--is-group-parent [value]", "Only return group parents (true/false, defaults to true when passed bare)", parseBooleanOption)
|
|
254
255
|
.option("--record-id <id>", "Filter by record ID (string)")
|
|
255
256
|
.option("--record-title <title>", "Filter by record title (string)")
|
|
256
257
|
.option("--record-title-or-id <value>", "Filter by record title or ID (string)")
|
|
257
|
-
.option("--is-finished", "Only return finished runs (
|
|
258
|
+
.option("--is-finished [value]", "Only return finished runs (true/false, defaults to true when passed bare)", parseBooleanOption)
|
|
258
259
|
.option("--executions-filter <json>", "Filter by node executions (JSON object, same format as 'run list')")
|
|
259
260
|
.option("--created-after <date>", "Filter runs created after this date (ISO 8601 string)")
|
|
260
261
|
.option("--created-before <date>", "Filter runs created before this date (ISO 8601 string)")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"change.d.ts","sourceRoot":"","sources":["../../../src/commands/segmentation/change.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":"change.d.ts","sourceRoot":"","sources":["../../../src/commands/segmentation/change.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAIxC,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CAgGN"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { parseBooleanOption } from "../../utils/booleanOption.js";
|
|
1
2
|
import { handleApiCall, outputJson } from "../runHandler.js";
|
|
2
3
|
export function registerChangeCommands(parent, getApi) {
|
|
3
4
|
const change = parent.command("change").description("Change operations");
|
|
@@ -5,7 +6,7 @@ export function registerChangeCommands(parent, getApi) {
|
|
|
5
6
|
.command("list")
|
|
6
7
|
.description("List changes")
|
|
7
8
|
.option("--segment-uuid <uuid>", "Segment UUID")
|
|
8
|
-
.option("--not-empty", "Only non-empty changes")
|
|
9
|
+
.option("--not-empty [value]", "Only non-empty changes", parseBooleanOption)
|
|
9
10
|
.option("--has-records <kind>", "Has records of kind")
|
|
10
11
|
.option("--limit <n>", "Limit")
|
|
11
12
|
.option("--offset <n>", "Offset")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record.d.ts","sourceRoot":"","sources":["../../../src/commands/segmentation/record.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":"record.d.ts","sourceRoot":"","sources":["../../../src/commands/segmentation/record.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAIxC,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CA4BN"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { parseBooleanOption } from "../../utils/booleanOption.js";
|
|
1
2
|
import { handleApiCall, outputJson } from "../runHandler.js";
|
|
2
3
|
export function registerRecordCommands(parent, getApi) {
|
|
3
4
|
const record = parent
|
|
@@ -8,7 +9,7 @@ export function registerRecordCommands(parent, getApi) {
|
|
|
8
9
|
.description("Fetch segmentation records")
|
|
9
10
|
.requiredOption("--model-uuid <uuid>", "Model UUID")
|
|
10
11
|
.requiredOption("--ids <ids>", "Record IDs (comma-separated)")
|
|
11
|
-
.option("--reset-cache", "Reset cache")
|
|
12
|
+
.option("--reset-cache [value]", "Reset cache", parseBooleanOption)
|
|
12
13
|
.action(async (opts) => {
|
|
13
14
|
const api = getApi();
|
|
14
15
|
const result = await handleApiCall(() => api.segmentation.record.fetch({
|
|
@@ -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;
|
|
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;AAIxC,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CA0QN"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { parseBooleanOption } from "../../utils/booleanOption.js";
|
|
1
2
|
import { handleApiCall, outputJson, parseJson } from "../runHandler.js";
|
|
2
3
|
export function registerSegmentCommands(parent, getApi) {
|
|
3
4
|
const segment = parent
|
|
@@ -85,8 +86,8 @@ Filter object shape:
|
|
|
85
86
|
.option("--limit <n>", "Max records in segment (integer)")
|
|
86
87
|
.option("--fetching-limit <n>", "Max records to fetch per page (integer)")
|
|
87
88
|
.option("--fetching-offset <n>", "Number of records to skip (integer)")
|
|
88
|
-
.option("--enrich", "Enrich records with additional data (
|
|
89
|
-
.option("--sync", "Sync data sources before fetching (
|
|
89
|
+
.option("--enrich [value]", "Enrich records with additional data (true/false, defaults to true when passed bare)", parseBooleanOption)
|
|
90
|
+
.option("--sync [value]", "Sync data sources before fetching (true/false, defaults to true when passed bare)", parseBooleanOption)
|
|
90
91
|
.action(async (opts) => {
|
|
91
92
|
const api = getApi();
|
|
92
93
|
const result = await handleApiCall(() => api.segmentation.segment.fetch({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/commands/storage/run.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":"run.d.ts","sourceRoot":"","sources":["../../../src/commands/storage/run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAIxC,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,GAAG,IAAI,CA6D5E"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { parseBooleanOption } from "../../utils/booleanOption.js";
|
|
1
2
|
import { handleApiCall, outputJson } from "../runHandler.js";
|
|
2
3
|
export function registerRunCommands(parent, getApi) {
|
|
3
4
|
const run = parent.command("run").description("Storage run operations");
|
|
@@ -20,8 +21,8 @@ export function registerRunCommands(parent, getApi) {
|
|
|
20
21
|
.command("create")
|
|
21
22
|
.description("Create a storage run")
|
|
22
23
|
.requiredOption("--model-uuid <uuid>", "Model UUID")
|
|
23
|
-
.option("--is-reset", "Reset the model before running")
|
|
24
|
-
.option("--is-force", "Force the run")
|
|
24
|
+
.option("--is-reset [value]", "Reset the model before running", parseBooleanOption)
|
|
25
|
+
.option("--is-force [value]", "Force the run", parseBooleanOption)
|
|
25
26
|
.action(async (opts) => {
|
|
26
27
|
const api = getApi();
|
|
27
28
|
const result = await handleApiCall(() => api.storage.run.create({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/commands/version.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/commands/version.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQzC,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,OAAO,EACf,cAAc,EAAE,MAAM,GACrB,IAAI,CAqCN"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { parseBooleanOption } from "../utils/booleanOption.js";
|
|
1
2
|
import { fetchLatestVersion, isOutdated, UPDATE_COMMAND } from "../version.js";
|
|
2
3
|
import { failWith, outputJson } from "./runHandler.js";
|
|
3
4
|
const CHECK_FETCH_TIMEOUT_MS = 5000;
|
|
@@ -5,7 +6,7 @@ export function registerVersionCommand(parent, currentVersion) {
|
|
|
5
6
|
parent
|
|
6
7
|
.command("version")
|
|
7
8
|
.description("Print the installed CLI version, or check npm for a newer release with --check")
|
|
8
|
-
.option("--check", "Query the npm registry and report whether a newer version is available")
|
|
9
|
+
.option("--check [value]", "Query the npm registry and report whether a newer version is available", parseBooleanOption)
|
|
9
10
|
.action(async (opts) => {
|
|
10
11
|
if (opts.check !== true) {
|
|
11
12
|
outputJson({ version: currentVersion });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../src/commands/workspaceManagement/session.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":"session.d.ts","sourceRoot":"","sources":["../../../src/commands/workspaceManagement/session.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,CAkDN"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { parseBooleanOption } from "../../utils/booleanOption.js";
|
|
1
2
|
import { handleApiCall, outputJson } from "../runHandler.js";
|
|
2
3
|
export function registerSessionCommands(parent, getApi) {
|
|
3
4
|
const session = parent
|
|
@@ -9,7 +10,7 @@ export function registerSessionCommands(parent, getApi) {
|
|
|
9
10
|
.requiredOption("--session-id <sessionId>", "Claude Code session id")
|
|
10
11
|
.requiredOption("--title <title>", "Short title for the session")
|
|
11
12
|
.requiredOption("--summary <summary>", "Summary of what happened in the session")
|
|
12
|
-
.option("--finished", "Mark the session as finished now (sets finishedAt = now)")
|
|
13
|
+
.option("--finished [value]", "Mark the session as finished now (sets finishedAt = now)", parseBooleanOption)
|
|
13
14
|
.option("--finished-at <timestamp>", "Explicit ISO timestamp for when the session finished")
|
|
14
15
|
.action(async (opts) => {
|
|
15
16
|
let finishedAt;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspaces.d.ts","sourceRoot":"","sources":["../../../src/commands/workspaceManagement/workspaces.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":"workspaces.d.ts","sourceRoot":"","sources":["../../../src/commands/workspaceManagement/workspaces.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAIxC,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CAkLN"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { parseBooleanOption } from "../../utils/booleanOption.js";
|
|
1
2
|
import { handleApiCall, outputJson, parseJson } from "../runHandler.js";
|
|
2
3
|
export function registerWorkspacesCommands(parent, getApi) {
|
|
3
4
|
const workspaces = parent
|
|
@@ -6,7 +7,7 @@ export function registerWorkspacesCommands(parent, getApi) {
|
|
|
6
7
|
workspaces
|
|
7
8
|
.command("list")
|
|
8
9
|
.description("List all workspaces accessible to the current user")
|
|
9
|
-
.option("--refresh", "Bypass any token cache and re-fetch from the server (useful after permission changes)")
|
|
10
|
+
.option("--refresh [value]", "Bypass any token cache and re-fetch from the server (useful after permission changes)", parseBooleanOption)
|
|
10
11
|
.addHelpText("after", `
|
|
11
12
|
Examples:
|
|
12
13
|
$ cargo-ai workspaceManagement workspaces list
|
package/build/index.js
CHANGED
|
@@ -35,6 +35,11 @@ program
|
|
|
35
35
|
.name("cargo-ai")
|
|
36
36
|
.description("Cargo API CLI")
|
|
37
37
|
.version(version)
|
|
38
|
+
// Boolean flags take no value, so `--is-enabled false` parses as
|
|
39
|
+
// `--is-enabled` plus a stray `false` — silently inverting what the caller
|
|
40
|
+
// meant. Commander 12 discards excess arguments by default; refuse them so
|
|
41
|
+
// the mistake is a parse error. Subcommands inherit this via `.command()`.
|
|
42
|
+
.allowExcessArguments(false)
|
|
38
43
|
.showHelpAfterError(`${AGENT_SKILLS_HINT}\nRun "cargo-ai --help" for the full command list.`)
|
|
39
44
|
.addHelpText("after", `
|
|
40
45
|
Agent skills:
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const parseBooleanOption: (value: string | boolean) => boolean;
|
|
2
|
+
export declare const resolveBooleanPair: (positive: boolean | undefined, negative: boolean | undefined, flagNames: {
|
|
3
|
+
positive: string;
|
|
4
|
+
negative: string;
|
|
5
|
+
}) => boolean | undefined;
|
|
6
|
+
//# sourceMappingURL=booleanOption.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"booleanOption.d.ts","sourceRoot":"","sources":["../../src/utils/booleanOption.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,kBAAkB,UAAW,MAAM,GAAG,OAAO,KAAG,OAY5D,CAAC;AAMF,eAAO,MAAM,kBAAkB,aACnB,OAAO,GAAG,SAAS,YACnB,OAAO,GAAG,SAAS;cACN,MAAM;cAAY,MAAM;MAC9C,OAAO,GAAG,SAkBZ,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { InvalidArgumentError } from "commander";
|
|
2
|
+
// Boolean flags are declared as `--flag [value]` so that both `--flag` and the
|
|
3
|
+
// form people actually reach for, `--flag false`, are accepted. Commander hands
|
|
4
|
+
// this parser the literal `true` when the flag is passed bare, and the raw
|
|
5
|
+
// string when a value follows it.
|
|
6
|
+
//
|
|
7
|
+
// Declaring them as bare flags instead is a trap: `--flag false` parses as the
|
|
8
|
+
// flag plus a stray `false`, so the caller gets the opposite of what they typed.
|
|
9
|
+
export const parseBooleanOption = (value) => {
|
|
10
|
+
if (value === true || value === "true") {
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
if (value === "false") {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
throw new InvalidArgumentError('Expected "true" or "false", or pass the flag on its own.');
|
|
17
|
+
};
|
|
18
|
+
// Resolves a `--is-x` / `--is-not-x` pair into the single boolean the API takes.
|
|
19
|
+
// Both flags now carry values, so "which one was passed" is no longer enough to
|
|
20
|
+
// tell them apart — `--is-enabled false` and `--is-disabled` mean the same
|
|
21
|
+
// thing, and only a genuine disagreement between the two is an error.
|
|
22
|
+
export const resolveBooleanPair = (positive, negative, flagNames) => {
|
|
23
|
+
const fromNegative = negative === undefined ? undefined : negative === false;
|
|
24
|
+
if (positive !== undefined &&
|
|
25
|
+
fromNegative !== undefined &&
|
|
26
|
+
positive !== fromNegative) {
|
|
27
|
+
throw new Error(`${flagNames.positive} and ${flagNames.negative} contradict each other`);
|
|
28
|
+
}
|
|
29
|
+
if (positive !== undefined) {
|
|
30
|
+
return positive;
|
|
31
|
+
}
|
|
32
|
+
return fromNegative;
|
|
33
|
+
};
|