@cargo-ai/cli 1.0.75 → 1.0.76

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -168,7 +168,7 @@ Deploy a draft release of an **existing** workflow. Two input modes share the sa
168
168
  # Compile a Workflow SDK module and deploy it
169
169
  cargo-ai orchestration release deploy-draft --file ./my-workflow.ts
170
170
 
171
- # Preview the compiled nodes + form fields without deploying
171
+ # Preview nodes + form fields without deploying
172
172
  cargo-ai orchestration release deploy-draft --file ./my-workflow.ts --dry-run
173
173
 
174
174
  # Pin an explicit version + description
@@ -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;AAiBxC,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,GAAG,IAAI,CAoK7E"}
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,CAqK7E"}
@@ -12,8 +12,9 @@ Use these commands to inspect or debug the node graph of a workflow. To just
12
12
  run a tool or connector action, no workflow needed, use instead:
13
13
  $ cargo-ai orchestration action execute --action '<json>' --data '<json>'
14
14
 
15
- 'diagram', 'compute' and 'validate' are free and run nothing. 'execute' is not
16
- a dry run: it performs the node's real action and consumes credits.
15
+ 'diagram', 'compute' and 'validate' are free and run nothing.
16
+ 'execute' is not a dry run: it performs the node's real action and consumes
17
+ credits.
17
18
 
18
19
  Before deploying a graph:
19
20
  $ cargo-ai orchestration node validate --nodes '<json>'
@@ -15,6 +15,10 @@ export type DiagramNode = {
15
15
  childrenUuids?: (string | null)[] | null;
16
16
  fallbackChildUuid?: string | null;
17
17
  config?: Record<string, unknown> | null;
18
+ position?: {
19
+ x?: number;
20
+ y?: number;
21
+ } | null;
18
22
  };
19
23
  export type DiagramOptions = {
20
24
  title?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"nodeDiagram.d.ts","sourceRoot":"","sources":["../../../src/commands/orchestration/nodeDiagram.ts"],"names":[],"mappings":"AAgBA;;2CAE2C;AAC3C,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,wEAAwE;IACxE,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,aAAa,CAAC,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC;IACzC,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;CACzC,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kEAAkE;IAClE,IAAI,CAAC,EAAE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AE,MAAM,cAAc,CAAC;AAoCxC,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CAgLN"}
1
+ {"version":3,"file":"release.d.ts","sourceRoot":"","sources":["../../../src/commands/orchestration/release.ts"],"names":[],"mappings":"AAIA,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,CAkLN"}
@@ -1,3 +1,4 @@
1
+ import { layoutWorkflowNodes, parseWorkflowLayoutNodes, } from "@cargo-ai/utils/workflow-layout";
1
2
  import { parseBooleanOption } from "../../utils/booleanOption.js";
2
3
  import { loadCompiledWorkflow, } from "../../utils/loadCompiledWorkflow.js";
3
4
  import { ExitCodes, failWith, handleApiCall, info, outputJson, parseJson, success, } from "../runHandler.js";
@@ -61,12 +62,13 @@ export function registerReleaseCommands(parent, getApi) {
61
62
  .option("--options <json>", "Options (JSON object)")
62
63
  .action(async (opts) => {
63
64
  const api = getApi();
65
+ const nodes = opts.nodes !== undefined
66
+ ? await layoutOrFail(parseJson(opts.nodes, "--nodes"))
67
+ : undefined;
64
68
  const result = await handleApiCall(() => api.orchestration.draftRelease.update({
65
69
  workflowUuid: opts.workflowUuid,
66
70
  parentUuid: opts.parentUuid,
67
- nodes: opts.nodes !== undefined
68
- ? parseJson(opts.nodes, "--nodes")
69
- : undefined,
71
+ nodes,
70
72
  testRecords: opts.testRecords !== undefined
71
73
  ? parseJson(opts.testRecords, "--test-records")
72
74
  : undefined,
@@ -122,11 +124,13 @@ async function runJsonDeploy(getApi, opts) {
122
124
  const workflowUuid = opts.workflowUuid;
123
125
  const nodesJson = opts.nodes;
124
126
  const formFieldsJson = opts.formFields;
127
+ const parsedNodes = parseJson(nodesJson, "--nodes");
128
+ const nodes = await layoutOrFail(parsedNodes);
125
129
  const api = getApi();
126
130
  const result = await handleApiCall(() => api.orchestration.draftRelease.deploy({
127
131
  workflowUuid,
128
132
  version: opts.version,
129
- nodes: parseJson(nodesJson, "--nodes"),
133
+ nodes: nodes,
130
134
  formFields: formFieldsJson === "null"
131
135
  ? null
132
136
  : parseJson(formFieldsJson, "--form-fields"),
@@ -153,10 +157,11 @@ async function runFileDeploy(getApi, opts) {
153
157
  failWith("--form-fields is not allowed with --file (sourced from the module)", { code: ExitCodes.InvalidUsage });
154
158
  }
155
159
  const compiled = await loadCompiledWorkflow(opts.file);
160
+ const nodes = await layoutOrFail(compiled.nodes);
156
161
  if (opts.dryRun === true) {
157
162
  outputJson({
158
163
  slug: compiled.slug,
159
- nodes: compiled.nodes,
164
+ nodes,
160
165
  formFields: compiled.formFields,
161
166
  });
162
167
  return;
@@ -166,11 +171,11 @@ async function runFileDeploy(getApi, opts) {
166
171
  const version = opts.version !== undefined
167
172
  ? opts.version
168
173
  : await computeNextVersion(api, workflowUuid);
169
- info(`Deploying "${compiled.slug}" → workflow ${workflowUuid} as v${version} (${String(compiled.nodes.length)} node(s))…`);
174
+ info(`Deploying "${compiled.slug}" → workflow ${workflowUuid} as v${version} (${String(nodes.length)} node(s))…`);
170
175
  const payload = {
171
176
  workflowUuid,
172
177
  version,
173
- nodes: compiled.nodes,
178
+ nodes: nodes,
174
179
  formFields: compiled.formFields,
175
180
  description: opts.description,
176
181
  options: opts.options !== undefined
@@ -181,6 +186,16 @@ async function runFileDeploy(getApi, opts) {
181
186
  success(`Deployed v${version}.`);
182
187
  outputJson(result);
183
188
  }
189
+ async function layoutOrFail(value) {
190
+ try {
191
+ return (await layoutWorkflowNodes(parseWorkflowLayoutNodes(value), {
192
+ nested: "recursive",
193
+ }));
194
+ }
195
+ catch (error) {
196
+ failWith(`layout failed: ${error instanceof Error ? error.message : String(error)}`, { code: ExitCodes.InvalidUsage });
197
+ }
198
+ }
184
199
  // Resolve the target workflow UUID. The platform `Workflow` has no free-form
185
200
  // slug field — the closest stable identifier is `template.slug` — and there
186
201
  // is no `workflow.create` endpoint, so an explicit `--workflow-uuid` always
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cargo-ai/cli",
3
- "version": "1.0.75",
3
+ "version": "1.0.76",
4
4
  "private": false,
5
5
  "license": "UNLICENSED",
6
6
  "homepage": "https://getcargo.ai",
@@ -67,7 +67,8 @@
67
67
  "@cargo-ai/api": "^1.0.71",
68
68
  "@cargo-ai/app-sdk": "^1.0.9",
69
69
  "@cargo-ai/cdk": "^1.0.61",
70
- "@cargo-ai/types": "^1.0.66",
70
+ "@cargo-ai/types": "^1.0.68",
71
+ "@cargo-ai/utils": "^1.0.28",
71
72
  "@cargo-ai/worker-sdk": "^1.0.17",
72
73
  "@modelcontextprotocol/sdk": "1.29.0",
73
74
  "commander": "^12.1.0",