@cargo-ai/cli 1.0.82 → 1.0.83
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/index.js +1 -6
- package/build/paletteLayout.d.ts +0 -10
- package/build/paletteLayout.d.ts.map +1 -1
- package/build/paletteLayout.js +11 -25
- package/package.json +2 -2
package/build/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
|
-
import { availableCodingAgents, BRAND, canRunPalette,
|
|
3
|
+
import { availableCodingAgents, BRAND, canRunPalette, cdkProjectRoot, creditsLeftOf, declareSources, fetchSubscription, fetchWorkspaceName, formatWorkspaceSuffix, isInteractive, isUnpaidPlan, printSetupIssues, registerCommands as registerCdkCommands, runPalette, SessionExpiredError, } from "@cargo-ai/cdk/cli";
|
|
4
4
|
import { Command } from "commander";
|
|
5
5
|
import { AGENT_SKILLS_HINT } from "./agentSkills.js";
|
|
6
6
|
import { createApi } from "./api.js";
|
|
@@ -289,11 +289,6 @@ async function openPalette(startPath) {
|
|
|
289
289
|
signedIn: isSignedIn(),
|
|
290
290
|
agents,
|
|
291
291
|
cdkProjectRoot: root,
|
|
292
|
-
// Resolved from the root, never the cwd. `cdkProjectDir` looks *down* for
|
|
293
|
-
// `infra/` rather than walking up, and a scaffolded `infra/` carries no
|
|
294
|
-
// package.json to be recognised by — so asked from inside one it answers
|
|
295
|
-
// undefined, and `deploy` would fall back to the root it must not use.
|
|
296
|
-
cdkProjectDir: root === undefined ? undefined : cdkProjectDir(root),
|
|
297
292
|
cwd,
|
|
298
293
|
unpaidPlan,
|
|
299
294
|
});
|
package/build/paletteLayout.d.ts
CHANGED
|
@@ -4,16 +4,6 @@ export type PaletteLayoutInput = {
|
|
|
4
4
|
agents: readonly CodingAgent[];
|
|
5
5
|
/** The CDK repo root the palette is standing in, or undefined when none. */
|
|
6
6
|
cdkProjectRoot: string | undefined;
|
|
7
|
-
/**
|
|
8
|
-
* The directory holding the CDK project — `infra/` for a scaffolded repo, or
|
|
9
|
-
* the same as `cdkProjectRoot` for a hand-rolled layout. Commands that load
|
|
10
|
-
* the resource tree and state (`cdk deploy`) need this, not the repo root.
|
|
11
|
-
*
|
|
12
|
-
* Resolve it from `cdkProjectRoot` rather than from `cwd`: `cdkProjectDir`
|
|
13
|
-
* looks down for `infra/` instead of walking up, so from inside one it
|
|
14
|
-
* answers undefined.
|
|
15
|
-
*/
|
|
16
|
-
cdkProjectDir: string | undefined;
|
|
17
7
|
/**
|
|
18
8
|
* Where the palette is standing. The project rows are resolved by walking
|
|
19
9
|
* *up* from here, so this is what says whether they point at the directory
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paletteLayout.d.ts","sourceRoot":"","sources":["../src/paletteLayout.ts"],"names":[],"mappings":"AAYA,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,SAAS,EACf,MAAM,mBAAmB,CAAC;AA8E3B,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,SAAS,WAAW,EAAE,CAAC;IAC/B,4EAA4E;IAC5E,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC
|
|
1
|
+
{"version":3,"file":"paletteLayout.d.ts","sourceRoot":"","sources":["../src/paletteLayout.ts"],"names":[],"mappings":"AAYA,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,SAAS,EACf,MAAM,mBAAmB,CAAC;AA8E3B,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,SAAS,WAAW,EAAE,CAAC;IAC/B,4EAA4E;IAC5E,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC;;;;OAIG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,kBAAkB,GAAG,aAAa,CAS3E;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,kBAAkB,GAAG,SAAS,EAAE,CA+DjE"}
|
package/build/paletteLayout.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
// most often wants, a coding agent briefed on their workspace, two screens
|
|
8
8
|
// down behind `start`. This is the missing opinion, kept in one place and as
|
|
9
9
|
// data, so it can be read and tested rather than inferred from a menu.
|
|
10
|
-
import { basename,
|
|
10
|
+
import { basename, resolve } from "node:path";
|
|
11
11
|
import { ASK, } from "@cargo-ai/cdk/cli";
|
|
12
12
|
/** Pinned row values. The leading space keeps them out of the command namespace. */
|
|
13
13
|
const SIGN_IN = " sign-in";
|
|
@@ -113,7 +113,7 @@ export function pinnedRows(input) {
|
|
|
113
113
|
// Outside, there is no project to add to or deploy, so offer the tour and the
|
|
114
114
|
// scaffold instead.
|
|
115
115
|
const projectRows = input.cdkProjectRoot !== undefined
|
|
116
|
-
? cdkRows(input.cdkProjectRoot, input.
|
|
116
|
+
? cdkRows(input.cdkProjectRoot, input.cwd)
|
|
117
117
|
: [
|
|
118
118
|
{
|
|
119
119
|
value: DEMO,
|
|
@@ -156,11 +156,7 @@ export function pinnedRows(input) {
|
|
|
156
156
|
];
|
|
157
157
|
}
|
|
158
158
|
/** The two rows for a palette standing in the CDK project rooted at `root`. */
|
|
159
|
-
function cdkRows(root,
|
|
160
|
-
// `cdk deploy` loads the resource tree and `cargo.state.json` from the
|
|
161
|
-
// directory it runs in, so it needs the CDK project — `infra/` in a
|
|
162
|
-
// scaffolded repo — where `add` takes the root and resolves that itself.
|
|
163
|
-
const target = projectDir !== undefined ? projectDir : root;
|
|
159
|
+
function cdkRows(root, cwd) {
|
|
164
160
|
return [
|
|
165
161
|
{
|
|
166
162
|
value: ADD,
|
|
@@ -174,27 +170,17 @@ function cdkRows(root, projectDir, cwd) {
|
|
|
174
170
|
{
|
|
175
171
|
value: DEPLOY,
|
|
176
172
|
label: "Deploy",
|
|
177
|
-
// Name the
|
|
178
|
-
// found by walking *up*, so this row can target a
|
|
179
|
-
// sign of — and it mutates a live workspace, which in a
|
|
180
|
-
// than one project is worth saying out loud before it
|
|
181
|
-
|
|
173
|
+
// Name the project whenever it is not the directory on screen. The
|
|
174
|
+
// project is found by walking *up*, so this row can target a repo the
|
|
175
|
+
// cwd gives no sign of — and it mutates a live workspace, which in a
|
|
176
|
+
// tree holding more than one project is worth saying out loud before it
|
|
177
|
+
// is picked. `deploy` walks into `infra/` itself.
|
|
178
|
+
hint: resolve(root) === resolve(cwd)
|
|
182
179
|
? "this project to your workspace"
|
|
183
|
-
: `${
|
|
180
|
+
: `${basename(root)}/ to your workspace`,
|
|
184
181
|
// No `--yes`: `deploy` shows the plan and asks, which is the point of
|
|
185
182
|
// reaching it from a menu.
|
|
186
|
-
argv: ["cdk", "deploy", "--dir",
|
|
183
|
+
argv: ["cdk", "deploy", "--dir", root],
|
|
187
184
|
},
|
|
188
185
|
];
|
|
189
186
|
}
|
|
190
|
-
/**
|
|
191
|
-
* A short name for the CDK project directory: where it sits inside the repo
|
|
192
|
-
* (`infra`), or the repo's own directory name when it *is* the repo root.
|
|
193
|
-
*
|
|
194
|
-
* `relative` answers "" for two equal paths — the hand-rolled layout that keeps
|
|
195
|
-
* its resources at the root — and "" is not a name anybody can read.
|
|
196
|
-
*/
|
|
197
|
-
function projectName(dir, root) {
|
|
198
|
-
const within = relative(root, dir);
|
|
199
|
-
return within === "" ? basename(root) : within;
|
|
200
|
-
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cargo-ai/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.83",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"homepage": "https://getcargo.ai",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"@ai-sdk/harness-claude-code": "^1.0.99",
|
|
69
69
|
"@cargo-ai/api": "^1.0.75",
|
|
70
70
|
"@cargo-ai/app-sdk": "^1.0.10",
|
|
71
|
-
"@cargo-ai/cdk": "^1.0.
|
|
71
|
+
"@cargo-ai/cdk": "^1.0.67",
|
|
72
72
|
"@cargo-ai/types": "^1.0.72",
|
|
73
73
|
"@cargo-ai/utils": "^1.0.28",
|
|
74
74
|
"@cargo-ai/worker-sdk": "^1.0.17",
|