@cargo-ai/cli 1.0.89 → 1.0.90
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.
|
@@ -86,8 +86,8 @@ The user confirms each Bash, Write, Edit and NotebookEdit call, and can only ans
|
|
|
86
86
|
|
|
87
87
|
Prefer minimal, focused diffs; match the existing code style; run the project's own checks when they exist. End each task with a short summary of what changed and how it was validated.`;
|
|
88
88
|
const CDK_RAILS_INSTRUCTIONS = `This directory is a Cargo CDK project.
|
|
89
|
-
- Never edit cargo.state.json, cargo.state.lock, or .cargo-ai/ by hand — they are generated.
|
|
90
|
-
- Validate your changes before declaring them done: run \`npx tsc --noEmit\` and \`npx cargo-cdk plan\` (plan
|
|
89
|
+
- Never edit cargo.state.json, cargo.state.lock, or .cargo-ai/ by hand — they are generated. Repoint this project's deploy state with \`cargo-cdk state bind\`.
|
|
90
|
+
- Validate your changes before declaring them done: run \`npx tsc --noEmit\` and \`npx cargo-cdk plan\` (plan only reads — it changes nothing).
|
|
91
91
|
- Never run \`cargo-cdk deploy\`, \`destroy\`, \`import\`, or \`rollback\` unless the user explicitly asked.`;
|
|
92
92
|
const LOCAL_CDK_RAILS_SKILL = {
|
|
93
93
|
name: "cdk-rails",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cdkState.d.ts","sourceRoot":"","sources":["../../src/utils/cdkState.ts"],"names":[],"mappings":"AAoBA,wBAAgB,oBAAoB,CAAC,GAAG,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CASxE;AAED;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,GACd,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,OAAO,CAAA;CAAE,CAAC,CAyBtD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAOrD;AAaD;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,OAAO,EACd,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,GACd,OAAO,
|
|
1
|
+
{"version":3,"file":"cdkState.d.ts","sourceRoot":"","sources":["../../src/utils/cdkState.ts"],"names":[],"mappings":"AAoBA,wBAAgB,oBAAoB,CAAC,GAAG,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CASxE;AAED;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,GACd,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,OAAO,CAAA;CAAE,CAAC,CAyBtD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAOrD;AAaD;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,OAAO,EACd,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,GACd,OAAO,CA2CT"}
|
package/build/utils/cdkState.js
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
// test-run it against ALREADY-DEPLOYED resources. Both need the same two things:
|
|
4
4
|
// peel the tsx interop layer off a module's default export, and resolve any
|
|
5
5
|
// `@cargo-ai/cdk` handle tokens the module references to their real uuids from
|
|
6
|
-
//
|
|
6
|
+
// this project's deploy state — without deploying the module itself.
|
|
7
7
|
import { existsSync } from "node:fs";
|
|
8
8
|
import { dirname, isAbsolute, join, resolve } from "node:path";
|
|
9
9
|
import { pathToFileURL } from "node:url";
|
|
10
|
-
import { dependenciesOf,
|
|
10
|
+
import { dependenciesOf, readStateOffline, resolveTokens } from "@cargo-ai/cdk";
|
|
11
11
|
import { cdkProjectDir, cdkProjectRoot } from "@cargo-ai/cdk/cli";
|
|
12
12
|
import { ExitCodes, failWith } from "../commands/runHandler.js";
|
|
13
13
|
// Peel the extra interop layer tsx adds when a TS source is transpiled to CJS:
|
|
@@ -104,7 +104,11 @@ export function resolveTokensFromState(value, file, subject) {
|
|
|
104
104
|
"`cargo-ai cdk deploy`, or reference them by literal uuid " +
|
|
105
105
|
"(toolRef / agentRef / connectorRef).", { code: ExitCodes.NotFound });
|
|
106
106
|
}
|
|
107
|
-
|
|
107
|
+
// A project whose state lives in the workspace has a pointer here, not a
|
|
108
|
+
// resource map, so the cache the last plan or deploy left behind is what
|
|
109
|
+
// answers this offline. Resolving a handle is a read of what is already
|
|
110
|
+
// deployed — worth a stale answer, not worth a round trip on every run.
|
|
111
|
+
const state = readStateOffline(stateRoot);
|
|
108
112
|
const outputs = new Map();
|
|
109
113
|
if (state !== undefined) {
|
|
110
114
|
for (const [id, entry] of Object.entries(state.resources)) {
|
|
@@ -114,7 +118,7 @@ export function resolveTokensFromState(value, file, subject) {
|
|
|
114
118
|
const missing = [...deps].filter((id) => !outputs.has(id));
|
|
115
119
|
if (missing.length > 0) {
|
|
116
120
|
failWith(`${String(missing.length)} resource(s) referenced by ${subject} ` +
|
|
117
|
-
`aren't in
|
|
121
|
+
`aren't in this project's deploy state yet: ${missing.join(", ")}. A test run ` +
|
|
118
122
|
"resolves existing (already-deployed) resources from state — it won't " +
|
|
119
123
|
"create new ones. Deploy them first with `cargo-ai cdk deploy`, or " +
|
|
120
124
|
"reference them by literal uuid (toolRef / agentRef / connectorRef).", { code: ExitCodes.NotFound });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cargo-ai/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.90",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"homepage": "https://getcargo.ai",
|
|
@@ -67,10 +67,10 @@
|
|
|
67
67
|
"dependencies": {
|
|
68
68
|
"@ai-sdk/harness": "^1.0.95",
|
|
69
69
|
"@ai-sdk/harness-claude-code": "^1.0.99",
|
|
70
|
-
"@cargo-ai/api": "^1.0.
|
|
70
|
+
"@cargo-ai/api": "^1.0.78",
|
|
71
71
|
"@cargo-ai/app-sdk": "^1.0.10",
|
|
72
|
-
"@cargo-ai/cdk": "^1.0.
|
|
73
|
-
"@cargo-ai/types": "^1.0.
|
|
72
|
+
"@cargo-ai/cdk": "^1.0.73",
|
|
73
|
+
"@cargo-ai/types": "^1.0.75",
|
|
74
74
|
"@cargo-ai/utils": "^1.0.28",
|
|
75
75
|
"@cargo-ai/worker-sdk": "^1.0.17",
|
|
76
76
|
"@modelcontextprotocol/sdk": "1.29.0",
|