@cargo-ai/cli 1.0.92 → 1.0.95
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 +17 -17
- package/build/commands/ai/chat.d.ts.map +1 -1
- package/build/commands/ai/chat.js +2 -1
- package/build/commands/ai/message.d.ts.map +1 -1
- package/build/commands/ai/message.js +2 -1
- package/build/commands/ai/release.d.ts.map +1 -1
- package/build/commands/ai/release.js +7 -6
- package/build/commands/ask/harness/approvals.d.ts +7 -0
- package/build/commands/ask/harness/approvals.d.ts.map +1 -0
- package/build/commands/ask/harness/approvals.js +82 -0
- package/build/commands/ask/harness/artifacts.d.ts.map +1 -0
- package/build/commands/ask/harness/claudeConfig.d.ts.map +1 -0
- package/build/commands/ask/harness/create.d.ts +59 -0
- package/build/commands/ask/harness/create.d.ts.map +1 -0
- package/build/commands/ask/harness/create.js +292 -0
- package/build/commands/ask/harness/index.d.ts +8 -0
- package/build/commands/ask/harness/index.d.ts.map +1 -0
- package/build/commands/ask/harness/index.js +7 -0
- package/build/commands/ask/harness/ingest.d.ts +25 -0
- package/build/commands/ask/harness/ingest.d.ts.map +1 -0
- package/build/commands/ask/harness/ingest.js +35 -0
- package/build/commands/ask/harness/instructions.d.ts +13 -0
- package/build/commands/ask/harness/instructions.d.ts.map +1 -0
- package/build/commands/ask/harness/instructions.js +41 -0
- package/build/commands/ask/harness/layout.d.ts +23 -0
- package/build/commands/ask/harness/layout.d.ts.map +1 -0
- package/build/commands/ask/harness/layout.js +32 -0
- package/build/commands/ask/harness/mcp.d.ts +25 -0
- package/build/commands/ask/harness/mcp.d.ts.map +1 -0
- package/build/commands/ask/harness/mcp.js +72 -0
- package/build/commands/ask/harness/pnpmShim.d.ts.map +1 -0
- package/build/commands/ask/harness/release.d.ts +18 -0
- package/build/commands/ask/harness/release.d.ts.map +1 -0
- package/build/commands/ask/harness/release.js +117 -0
- package/build/commands/ask/harness/sandbox.d.ts +9 -0
- package/build/commands/ask/harness/sandbox.d.ts.map +1 -0
- package/build/commands/ask/harness/sandbox.js +27 -0
- package/build/commands/ask/harness/timing.d.ts +16 -0
- package/build/commands/ask/harness/timing.d.ts.map +1 -0
- package/build/commands/ask/harness/timing.js +72 -0
- package/build/commands/ask/harness/turn.d.ts +145 -0
- package/build/commands/ask/harness/turn.d.ts.map +1 -0
- package/build/commands/ask/harness/turn.js +626 -0
- package/build/commands/ask/harness/usage.d.ts +50 -0
- package/build/commands/ask/harness/usage.d.ts.map +1 -0
- package/build/commands/ask/harness/usage.js +87 -0
- package/build/commands/ask/index.d.ts +9 -0
- package/build/commands/ask/index.d.ts.map +1 -1
- package/build/commands/ask/index.js +7 -7
- package/build/commands/ask/input/completer.d.ts.map +1 -0
- package/build/commands/ask/input/index.d.ts +5 -0
- package/build/commands/ask/input/index.d.ts.map +1 -0
- package/build/commands/ask/input/index.js +4 -0
- package/build/commands/ask/input/prompt.d.ts.map +1 -0
- package/build/commands/ask/{prompt.js → input/prompt.js} +1 -1
- package/build/commands/ask/input/slash.d.ts.map +1 -0
- package/build/commands/ask/{slash.js → input/slash.js} +2 -2
- package/build/commands/ask/input/typeAhead.d.ts.map +1 -0
- package/build/commands/ask/{history.d.ts → persist/history.d.ts} +1 -1
- package/build/commands/ask/persist/history.d.ts.map +1 -0
- package/build/commands/ask/persist/index.d.ts +4 -0
- package/build/commands/ask/persist/index.d.ts.map +1 -0
- package/build/commands/ask/persist/index.js +3 -0
- package/build/commands/ask/persist/persist.d.ts.map +1 -0
- package/build/commands/ask/persist/state.d.ts.map +1 -0
- package/build/commands/ask/session/claim.d.ts +56 -0
- package/build/commands/ask/session/claim.d.ts.map +1 -0
- package/build/commands/ask/session/claim.js +76 -0
- package/build/commands/ask/session/index.d.ts +5 -0
- package/build/commands/ask/session/index.d.ts.map +1 -0
- package/build/commands/ask/session/index.js +4 -0
- package/build/commands/ask/session/run.d.ts +36 -0
- package/build/commands/ask/session/run.d.ts.map +1 -0
- package/build/commands/ask/session/run.js +832 -0
- package/build/commands/ask/session/thinking.d.ts.map +1 -0
- package/build/commands/ask/session/tree.d.ts +90 -0
- package/build/commands/ask/session/tree.d.ts.map +1 -0
- package/build/commands/ask/session/tree.js +318 -0
- package/build/commands/start/brief.js +1 -1
- package/build/commands/start/index.d.ts +1 -1
- package/build/commands/start/index.d.ts.map +1 -1
- package/build/commands/start/index.js +7 -7
- package/build/index.js +6 -1
- package/build/paletteLayout.d.ts.map +1 -1
- package/build/paletteLayout.js +9 -8
- package/build/utils/cdkState.js +2 -2
- package/build/utils/loadCompiledAgent.js +1 -1
- package/package.json +6 -5
- package/build/commands/ask/artifacts.d.ts.map +0 -1
- package/build/commands/ask/binding.d.ts +0 -13
- package/build/commands/ask/binding.d.ts.map +0 -1
- package/build/commands/ask/binding.js +0 -19
- package/build/commands/ask/claudeConfig.d.ts.map +0 -1
- package/build/commands/ask/completer.d.ts.map +0 -1
- package/build/commands/ask/history.d.ts.map +0 -1
- package/build/commands/ask/localHarness.d.ts +0 -278
- package/build/commands/ask/localHarness.d.ts.map +0 -1
- package/build/commands/ask/localHarness.js +0 -1300
- package/build/commands/ask/messageStream.d.ts +0 -33
- package/build/commands/ask/messageStream.d.ts.map +0 -1
- package/build/commands/ask/messageStream.js +0 -114
- package/build/commands/ask/persist.d.ts.map +0 -1
- package/build/commands/ask/pnpmShim.d.ts.map +0 -1
- package/build/commands/ask/prompt.d.ts.map +0 -1
- package/build/commands/ask/session.d.ts +0 -101
- package/build/commands/ask/session.d.ts.map +0 -1
- package/build/commands/ask/session.js +0 -1328
- package/build/commands/ask/slash.d.ts.map +0 -1
- package/build/commands/ask/state.d.ts.map +0 -1
- package/build/commands/ask/thinking.d.ts.map +0 -1
- package/build/commands/ask/typeAhead.d.ts.map +0 -1
- /package/build/commands/ask/{artifacts.d.ts → harness/artifacts.d.ts} +0 -0
- /package/build/commands/ask/{artifacts.js → harness/artifacts.js} +0 -0
- /package/build/commands/ask/{claudeConfig.d.ts → harness/claudeConfig.d.ts} +0 -0
- /package/build/commands/ask/{claudeConfig.js → harness/claudeConfig.js} +0 -0
- /package/build/commands/ask/{pnpmShim.d.ts → harness/pnpmShim.d.ts} +0 -0
- /package/build/commands/ask/{pnpmShim.js → harness/pnpmShim.js} +0 -0
- /package/build/commands/ask/{completer.d.ts → input/completer.d.ts} +0 -0
- /package/build/commands/ask/{completer.js → input/completer.js} +0 -0
- /package/build/commands/ask/{prompt.d.ts → input/prompt.d.ts} +0 -0
- /package/build/commands/ask/{slash.d.ts → input/slash.d.ts} +0 -0
- /package/build/commands/ask/{typeAhead.d.ts → input/typeAhead.d.ts} +0 -0
- /package/build/commands/ask/{typeAhead.js → input/typeAhead.js} +0 -0
- /package/build/commands/ask/{history.js → persist/history.js} +0 -0
- /package/build/commands/ask/{persist.d.ts → persist/persist.d.ts} +0 -0
- /package/build/commands/ask/{persist.js → persist/persist.js} +0 -0
- /package/build/commands/ask/{state.d.ts → persist/state.d.ts} +0 -0
- /package/build/commands/ask/{state.js → persist/state.js} +0 -0
- /package/build/commands/ask/{thinking.d.ts → session/thinking.d.ts} +0 -0
- /package/build/commands/ask/{thinking.js → session/thinking.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thinking.d.ts","sourceRoot":"","sources":["../../../../src/commands/ask/session/thinking.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAAS,MAAM,EAyB/C,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAc1D"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { type Spinner } from "../../runHandler.js";
|
|
2
|
+
import type { LocalToolApproval } from "../harness/index.js";
|
|
3
|
+
/**
|
|
4
|
+
* Greedy wrap on spaces. A word longer than the width keeps its own line
|
|
5
|
+
* rather than being cut mid-token.
|
|
6
|
+
*
|
|
7
|
+
* Exported for tests.
|
|
8
|
+
*/
|
|
9
|
+
export declare function wrapLine(text: string, width: number): string[];
|
|
10
|
+
export declare function showStep(label: string, body: string): void;
|
|
11
|
+
/**
|
|
12
|
+
* Slash help / notes — finished step like the palette:
|
|
13
|
+
* ◇ /help
|
|
14
|
+
* │ …
|
|
15
|
+
*/
|
|
16
|
+
export declare function showCard(body: string): void;
|
|
17
|
+
/**
|
|
18
|
+
* Finished user turn — message on the diamond, like the palette's
|
|
19
|
+
* `◇ ask hey --continue`. No "You" label.
|
|
20
|
+
*/
|
|
21
|
+
export declare function showUserTurn(body: string): void;
|
|
22
|
+
export type LiveAssistantTurn = {
|
|
23
|
+
buffer: string;
|
|
24
|
+
paintedLines: number;
|
|
25
|
+
/**
|
|
26
|
+
* The question being typed while this reply streams, drawn under it.
|
|
27
|
+
*
|
|
28
|
+
* It cannot live on the spinner: the first text delta stops the spinner and
|
|
29
|
+
* opens this block, and raw mode means the terminal is not echoing. Without
|
|
30
|
+
* it here, the one moment type-ahead is most obviously in use — typing over
|
|
31
|
+
* a reply as it arrives — is the one moment nothing appears on screen.
|
|
32
|
+
*/
|
|
33
|
+
footer: string;
|
|
34
|
+
};
|
|
35
|
+
/** Rail gap, then an empty marker line ready for deltas. */
|
|
36
|
+
export declare function beginAssistantTurn(): LiveAssistantTurn;
|
|
37
|
+
export declare function appendAssistantDelta(live: LiveAssistantTurn, delta: string): void;
|
|
38
|
+
/** Show, change or remove the question being typed over this reply. */
|
|
39
|
+
export declare function setAssistantFooter(live: LiveAssistantTurn, footer: string): void;
|
|
40
|
+
/** Trailing rail gap before the next user turn / ◆ prompt. */
|
|
41
|
+
export declare function endAssistantTurn(live: LiveAssistantTurn): void;
|
|
42
|
+
/**
|
|
43
|
+
* Finished assistant turn — same tree as a user step, with `■` instead of `◇`.
|
|
44
|
+
*/
|
|
45
|
+
export declare function showAssistantTurn(body: string): void;
|
|
46
|
+
export declare function describeToolActivity(toolName: string, summary: string): string;
|
|
47
|
+
/**
|
|
48
|
+
* A tool that has finished, left in the transcript.
|
|
49
|
+
*
|
|
50
|
+
* The spinner shows what is running, but it is one line that is overwritten
|
|
51
|
+
* and then cleared, so once a turn is over there is no record of what it did —
|
|
52
|
+
* only the prose describing it. A turn that read four files and ran two
|
|
53
|
+
* commands should say so afterwards, the way the approval prompt does for the
|
|
54
|
+
* tools it happened to ask about.
|
|
55
|
+
*
|
|
56
|
+
* Written through the spinner's `log` when one is up, which wipes the spinner
|
|
57
|
+
* line, leaves this behind, and lets the next frame redraw underneath.
|
|
58
|
+
*/
|
|
59
|
+
export declare function showToolRun(input: {
|
|
60
|
+
spinner: Spinner | undefined;
|
|
61
|
+
toolName: string;
|
|
62
|
+
summary: string;
|
|
63
|
+
isError: boolean;
|
|
64
|
+
}): void;
|
|
65
|
+
/**
|
|
66
|
+
* A path inside the session directory reads better relative to it; anything
|
|
67
|
+
* outside stays absolute so it is obvious the turn left the project.
|
|
68
|
+
*
|
|
69
|
+
* Exported for tests.
|
|
70
|
+
*/
|
|
71
|
+
export declare function displayPath(path: string, dir: string): string;
|
|
72
|
+
/**
|
|
73
|
+
* Closing step for a turn that edited the working copy, so a reply that says
|
|
74
|
+
* "done" is backed by the list of files it touched.
|
|
75
|
+
*/
|
|
76
|
+
export declare function showTouchedFiles(paths: ReadonlySet<string>, dir: string): void;
|
|
77
|
+
/**
|
|
78
|
+
* Side notes from a turn — a chat-history save that failed, say. They are not
|
|
79
|
+
* part of the reply, so they land after it rather than inside it.
|
|
80
|
+
*/
|
|
81
|
+
export declare function showNotices(notices: string[]): void;
|
|
82
|
+
/**
|
|
83
|
+
* Local Claude Code runs against the user's own working copy, so anything
|
|
84
|
+
* beyond a read is confirmed before it happens:
|
|
85
|
+
*
|
|
86
|
+
* ◆ Run Bash: npm test?
|
|
87
|
+
* │ ● Yes …
|
|
88
|
+
*/
|
|
89
|
+
export declare function askToolApproval(approval: LocalToolApproval): Promise<"yes" | "always" | "no">;
|
|
90
|
+
//# sourceMappingURL=tree.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree.d.ts","sourceRoot":"","sources":["../../../../src/commands/ask/session/tree.ts"],"names":[],"mappings":"AAIA,OAAO,EAAuB,KAAK,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AA6B7D;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAe9D;AA0DD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAM1D;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAK3C;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAE/C;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB;;;;;;;OAOG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AA+DF,4DAA4D;AAC5D,wBAAgB,kBAAkB,IAAI,iBAAiB,CAItD;AAED,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,iBAAiB,EACvB,KAAK,EAAE,MAAM,GACZ,IAAI,CAeN;AAkBD,uEAAuE;AACvE,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,iBAAiB,EACvB,MAAM,EAAE,MAAM,GACb,IAAI,CAON;AAED,8DAA8D;AAC9D,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,iBAAiB,GAAG,IAAI,CAK9D;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAIpD;AAaD,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,GACd,MAAM,CAYR;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE;IACjC,OAAO,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;CAClB,GAAG,IAAI,CAYP;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAQ7D;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,EAC1B,GAAG,EAAE,MAAM,GACV,IAAI,CAWN;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,CAQnD;AAED;;;;;;GAMG;AACH,wBAAsB,eAAe,CACnC,QAAQ,EAAE,iBAAiB,GAC1B,OAAO,CAAC,KAAK,GAAG,QAAQ,GAAG,IAAI,CAAC,CAkBlC"}
|
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
import { isAbsolute, relative } from "node:path";
|
|
2
|
+
import { selectOne } from "@cargo-ai/cdk/cli";
|
|
3
|
+
import { clipToWidth, colors } from "../../runHandler.js";
|
|
4
|
+
/**
|
|
5
|
+
* What an assistant turn is marked with, alongside `◇` for a step and `│` for
|
|
6
|
+
* the rail.
|
|
7
|
+
*
|
|
8
|
+
* A text glyph rather than an emoji, so it takes the same `marker + two
|
|
9
|
+
* spaces` as every other row and the whole tree stays on one left edge. An
|
|
10
|
+
* emoji is two columns wide and needs its own spacing rule to line up, which
|
|
11
|
+
* is one more thing to get wrong every time a line is drawn.
|
|
12
|
+
*/
|
|
13
|
+
const ASSISTANT_MARKER = "■";
|
|
14
|
+
/** Completed tool call, so the transcript keeps what was actually run. */
|
|
15
|
+
const TOOL_MARKER = "⏺";
|
|
16
|
+
/**
|
|
17
|
+
* Body width under `◇ ` / `│ ` / `◆ `. Soft wrap without this drops the
|
|
18
|
+
* rail mid-line and the tree looks broken.
|
|
19
|
+
*/
|
|
20
|
+
function treeBodyWidth() {
|
|
21
|
+
const columns = process.stderr.columns === undefined ? 80 : process.stderr.columns;
|
|
22
|
+
// Marker + two spaces (`◇ `, `│ `, `◆ `), and one column of margin: a
|
|
23
|
+
// line filling the last cell makes some terminals wrap on their own, and the
|
|
24
|
+
// `\n` after it then lands a row further down than the tree expects.
|
|
25
|
+
return Math.max(24, columns - 4);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Greedy wrap on spaces. A word longer than the width keeps its own line
|
|
29
|
+
* rather than being cut mid-token.
|
|
30
|
+
*
|
|
31
|
+
* Exported for tests.
|
|
32
|
+
*/
|
|
33
|
+
export function wrapLine(text, width) {
|
|
34
|
+
const lines = [];
|
|
35
|
+
for (const word of text.split(/\s+/).filter((part) => part.length > 0)) {
|
|
36
|
+
const current = lines[lines.length - 1];
|
|
37
|
+
if (current === undefined || `${current} ${word}`.length > width) {
|
|
38
|
+
lines.push(word);
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
lines[lines.length - 1] = `${current} ${word}`;
|
|
42
|
+
}
|
|
43
|
+
return lines;
|
|
44
|
+
}
|
|
45
|
+
/** One line under the current ◆/◇, with the │ rail (same indent as clack). */
|
|
46
|
+
function writeRail(body) {
|
|
47
|
+
process.stderr.write(`${colors.dim("│")} ${body}\n`);
|
|
48
|
+
}
|
|
49
|
+
/** Word-wrap onto the │ rail so the terminal never soft-wraps mid-line. */
|
|
50
|
+
function writeRailWrapped(body) {
|
|
51
|
+
// Keep the rail on blank paragraphs so the tree does not break mid-reply.
|
|
52
|
+
if (body === "") {
|
|
53
|
+
writeRail("");
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
const lines = wrapLine(body, treeBodyWidth());
|
|
57
|
+
if (lines.length === 0) {
|
|
58
|
+
writeRail("");
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
for (const line of lines) {
|
|
62
|
+
writeRail(line);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Light cleanup so model markdown does not fight the tree. Keeps the words;
|
|
67
|
+
* drops heading marks, bold markers, and horizontal rules.
|
|
68
|
+
*/
|
|
69
|
+
function forTerminal(text) {
|
|
70
|
+
return text
|
|
71
|
+
.replace(/^#{1,6}\s+/gm, "")
|
|
72
|
+
.replace(/\*\*([^*]+)\*\*/g, "$1")
|
|
73
|
+
.replace(/^---+$/gm, "");
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* A `◇` step: the first line beside the marker, the rest continuing on the
|
|
77
|
+
* rail under it.
|
|
78
|
+
*
|
|
79
|
+
* Wrapped here rather than left to the terminal. A label long enough to reach
|
|
80
|
+
* the edge — a stall notice, an API error — soft-wraps mid-word and starts its
|
|
81
|
+
* next line at column zero, outside the tree, which is how a one-sentence
|
|
82
|
+
* notice ends up looking like the output is corrupted.
|
|
83
|
+
*/
|
|
84
|
+
function writeDiamondBlock(body) {
|
|
85
|
+
const lines = body === "" ? [""] : wrapLine(body, treeBodyWidth());
|
|
86
|
+
const first = lines[0] === undefined ? "" : lines[0];
|
|
87
|
+
process.stderr.write(`${colors.dim("◇")} ${first}\n`);
|
|
88
|
+
for (const line of lines.slice(1)) {
|
|
89
|
+
writeRail(line);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
export function showStep(label, body) {
|
|
93
|
+
writeDiamondBlock(label);
|
|
94
|
+
for (const paragraph of body.split("\n")) {
|
|
95
|
+
writeRailWrapped(paragraph);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Slash help / notes — finished step like the palette:
|
|
100
|
+
* ◇ /help
|
|
101
|
+
* │ …
|
|
102
|
+
*/
|
|
103
|
+
export function showCard(body) {
|
|
104
|
+
const paragraphs = body.split("\n");
|
|
105
|
+
const title = paragraphs[0] === undefined ? "" : paragraphs[0];
|
|
106
|
+
const rest = paragraphs.slice(1).join("\n");
|
|
107
|
+
showStep(title, rest);
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Finished user turn — message on the diamond, like the palette's
|
|
111
|
+
* `◇ ask hey --continue`. No "You" label.
|
|
112
|
+
*/
|
|
113
|
+
export function showUserTurn(body) {
|
|
114
|
+
writeDiamondBlock(body);
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Display lines for an assistant body. First line is the brick header body;
|
|
118
|
+
* later lines sit on the │ rail. Blank paragraphs keep an empty rail.
|
|
119
|
+
*/
|
|
120
|
+
function assistantDisplayLines(body) {
|
|
121
|
+
const paragraphs = forTerminal(body).split("\n");
|
|
122
|
+
const lines = [];
|
|
123
|
+
for (let index = 0; index < paragraphs.length; index += 1) {
|
|
124
|
+
const paragraph = paragraphs[index];
|
|
125
|
+
if (paragraph === undefined) {
|
|
126
|
+
continue;
|
|
127
|
+
}
|
|
128
|
+
if (paragraph === "") {
|
|
129
|
+
lines.push("");
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
const wrapped = wrapLine(paragraph, treeBodyWidth());
|
|
133
|
+
if (wrapped.length === 0) {
|
|
134
|
+
lines.push("");
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
for (const line of wrapped) {
|
|
138
|
+
lines.push(line);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
if (lines.length === 0) {
|
|
142
|
+
return [""];
|
|
143
|
+
}
|
|
144
|
+
return lines;
|
|
145
|
+
}
|
|
146
|
+
function writeAssistantLines(lines) {
|
|
147
|
+
const first = lines[0] === undefined ? "" : lines[0];
|
|
148
|
+
process.stderr.write(`${ASSISTANT_MARKER} ${first}\n`);
|
|
149
|
+
for (let index = 1; index < lines.length; index += 1) {
|
|
150
|
+
const line = lines[index];
|
|
151
|
+
if (line !== undefined) {
|
|
152
|
+
writeRail(line);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
function clearPaintedLines(count) {
|
|
157
|
+
if (count <= 0 || process.stderr.isTTY !== true) {
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
process.stderr.write(`\x1B[${String(count)}A\r\x1B[J`);
|
|
161
|
+
}
|
|
162
|
+
/** Rail gap, then an empty marker line ready for deltas. */
|
|
163
|
+
export function beginAssistantTurn() {
|
|
164
|
+
writeRail("");
|
|
165
|
+
process.stderr.write(`${ASSISTANT_MARKER} \n`);
|
|
166
|
+
return { buffer: "", paintedLines: 1, footer: "" };
|
|
167
|
+
}
|
|
168
|
+
export function appendAssistantDelta(live, delta) {
|
|
169
|
+
// A tool between two pieces of narration inserts a paragraph break, so that
|
|
170
|
+
// "Let me look." and what it found do not run together. When the tool also
|
|
171
|
+
// closed the block on screen, that break arrives as the first thing in the
|
|
172
|
+
// *next* block — and renders as an empty rail line under the marker before a
|
|
173
|
+
// word has been said. Kept in the stored answer, where the paragraphs still
|
|
174
|
+
// belong; dropped here, where the block itself is already the separation.
|
|
175
|
+
const text = live.buffer === "" ? delta.replace(/^\n+/, "") : delta;
|
|
176
|
+
if (text === "") {
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
live.buffer += text;
|
|
180
|
+
repaintAssistantTurn(live);
|
|
181
|
+
}
|
|
182
|
+
/** Draw the block again from its buffer, with the typed line under it. */
|
|
183
|
+
function repaintAssistantTurn(live) {
|
|
184
|
+
const lines = assistantDisplayLines(live.buffer);
|
|
185
|
+
clearPaintedLines(live.paintedLines);
|
|
186
|
+
writeAssistantLines(lines);
|
|
187
|
+
live.paintedLines = lines.length;
|
|
188
|
+
if (live.footer !== "") {
|
|
189
|
+
// Clipped for the same reason the spinner's is: it has to occupy exactly
|
|
190
|
+
// one row, or the next repaint clears from the wrong line.
|
|
191
|
+
process.stderr.write(`${colors.dim(clipToWidth(live.footer))}\n`);
|
|
192
|
+
live.paintedLines += 1;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
/** Show, change or remove the question being typed over this reply. */
|
|
196
|
+
export function setAssistantFooter(live, footer) {
|
|
197
|
+
if (live.footer === footer) {
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
live.footer = footer;
|
|
201
|
+
repaintAssistantTurn(live);
|
|
202
|
+
}
|
|
203
|
+
/** Trailing rail gap before the next user turn / ◆ prompt. */
|
|
204
|
+
export function endAssistantTurn(live) {
|
|
205
|
+
// The typed line belongs to whatever draws next — the spinner, or the block
|
|
206
|
+
// after this one. Left here it would be printed twice.
|
|
207
|
+
setAssistantFooter(live, "");
|
|
208
|
+
writeRail("");
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Finished assistant turn — same tree as a user step, with `■` instead of `◇`.
|
|
212
|
+
*/
|
|
213
|
+
export function showAssistantTurn(body) {
|
|
214
|
+
const live = beginAssistantTurn();
|
|
215
|
+
appendAssistantDelta(live, body);
|
|
216
|
+
endAssistantTurn(live);
|
|
217
|
+
}
|
|
218
|
+
/** Common tool names arrive lowercase (`bash`); natives keep their case. */
|
|
219
|
+
function toolLabel(toolName) {
|
|
220
|
+
if (toolName.length === 0) {
|
|
221
|
+
return "tool";
|
|
222
|
+
}
|
|
223
|
+
return `${toolName.slice(0, 1).toUpperCase()}${toolName.slice(1)}`;
|
|
224
|
+
}
|
|
225
|
+
const ACTIVITY_MAX_LENGTH = 72;
|
|
226
|
+
export function describeToolActivity(toolName, summary) {
|
|
227
|
+
const label = toolLabel(toolName);
|
|
228
|
+
if (summary === "") {
|
|
229
|
+
return label;
|
|
230
|
+
}
|
|
231
|
+
const line = `${label}: ${summary}`;
|
|
232
|
+
return line.length > ACTIVITY_MAX_LENGTH
|
|
233
|
+
? `${line.slice(0, ACTIVITY_MAX_LENGTH - 1)}…`
|
|
234
|
+
: line;
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* A tool that has finished, left in the transcript.
|
|
238
|
+
*
|
|
239
|
+
* The spinner shows what is running, but it is one line that is overwritten
|
|
240
|
+
* and then cleared, so once a turn is over there is no record of what it did —
|
|
241
|
+
* only the prose describing it. A turn that read four files and ran two
|
|
242
|
+
* commands should say so afterwards, the way the approval prompt does for the
|
|
243
|
+
* tools it happened to ask about.
|
|
244
|
+
*
|
|
245
|
+
* Written through the spinner's `log` when one is up, which wipes the spinner
|
|
246
|
+
* line, leaves this behind, and lets the next frame redraw underneath.
|
|
247
|
+
*/
|
|
248
|
+
export function showToolRun(input) {
|
|
249
|
+
const marker = input.isError === true ? colors.red("✗") : colors.dim(TOOL_MARKER);
|
|
250
|
+
const label = describeToolActivity(input.toolName, input.summary);
|
|
251
|
+
const line = `${marker} ${colors.dim(label)}`;
|
|
252
|
+
if (input.spinner !== undefined) {
|
|
253
|
+
input.spinner.log(line);
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
process.stderr.write(`${line}\n`);
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* A path inside the session directory reads better relative to it; anything
|
|
260
|
+
* outside stays absolute so it is obvious the turn left the project.
|
|
261
|
+
*
|
|
262
|
+
* Exported for tests.
|
|
263
|
+
*/
|
|
264
|
+
export function displayPath(path, dir) {
|
|
265
|
+
const relativePath = relative(dir, path);
|
|
266
|
+
return relativePath === "" ||
|
|
267
|
+
relativePath.startsWith("..") === true ||
|
|
268
|
+
isAbsolute(relativePath) === true
|
|
269
|
+
? path
|
|
270
|
+
: relativePath;
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Closing step for a turn that edited the working copy, so a reply that says
|
|
274
|
+
* "done" is backed by the list of files it touched.
|
|
275
|
+
*/
|
|
276
|
+
export function showTouchedFiles(paths, dir) {
|
|
277
|
+
if (paths.size === 0) {
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
const listed = [...paths].map((path) => displayPath(path, dir)).sort();
|
|
281
|
+
showStep(`${String(listed.length)} file${listed.length === 1 ? "" : "s"} changed`, listed.join("\n"));
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Side notes from a turn — a chat-history save that failed, say. They are not
|
|
285
|
+
* part of the reply, so they land after it rather than inside it.
|
|
286
|
+
*/
|
|
287
|
+
export function showNotices(notices) {
|
|
288
|
+
while (notices.length > 0) {
|
|
289
|
+
const notice = notices.shift();
|
|
290
|
+
if (notice !== undefined) {
|
|
291
|
+
showCard(notice);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Local Claude Code runs against the user's own working copy, so anything
|
|
297
|
+
* beyond a read is confirmed before it happens:
|
|
298
|
+
*
|
|
299
|
+
* ◆ Run Bash: npm test?
|
|
300
|
+
* │ ● Yes …
|
|
301
|
+
*/
|
|
302
|
+
export async function askToolApproval(approval) {
|
|
303
|
+
const decision = await selectOne({
|
|
304
|
+
message: approval.summary === ""
|
|
305
|
+
? `Run ${approval.toolName}?`
|
|
306
|
+
: `Run ${approval.toolName}: ${approval.summary}?`,
|
|
307
|
+
recommended: "yes",
|
|
308
|
+
// Escape here means "not that tool", not "leave the chat" — the turn
|
|
309
|
+
// continues and the model reports what it could not do.
|
|
310
|
+
cancelValue: "no",
|
|
311
|
+
choices: [
|
|
312
|
+
{ value: "yes", label: "Yes", hint: "just this once" },
|
|
313
|
+
{ value: "always", label: "Yes to everything", hint: "for this chat" },
|
|
314
|
+
{ value: "no", label: "No", hint: "tell the model to skip it" },
|
|
315
|
+
],
|
|
316
|
+
});
|
|
317
|
+
return decision === "always" ? "always" : decision === "no" ? "no" : "yes";
|
|
318
|
+
}
|
|
@@ -171,7 +171,7 @@ export function formatStartNextSteps(facts) {
|
|
|
171
171
|
"Next steps:",
|
|
172
172
|
" cargo-ai whoami # confirm the workspace",
|
|
173
173
|
" cargo-ai orchestration action list enrich # find something to run",
|
|
174
|
-
" cargo-ai
|
|
174
|
+
" cargo-ai project init # define this workspace in a repo",
|
|
175
175
|
" cargo-ai # the command palette",
|
|
176
176
|
];
|
|
177
177
|
if (facts.skillsInstalled === false) {
|
|
@@ -14,7 +14,7 @@ export type StartOptions = {
|
|
|
14
14
|
};
|
|
15
15
|
/** What the flow needs from the program it was registered on. */
|
|
16
16
|
export type StartDeps = {
|
|
17
|
-
/** The script `
|
|
17
|
+
/** The script `project init` is re-run through — normally `process.argv[1]`. */
|
|
18
18
|
binPath: string;
|
|
19
19
|
/** Opens the command palette, part-way down the tree. */
|
|
20
20
|
openPalette: (startPath: readonly string[]) => Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/start/index.ts"],"names":[],"mappings":"AAgCA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAcxC,OAAO,EAUL,KAAK,cAAc,EAGpB,MAAM,YAAY,CAAC;AAGpB,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,iEAAiE;AACjE,MAAM,MAAM,SAAS,GAAG;IACtB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/start/index.ts"],"names":[],"mappings":"AAgCA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAcxC,OAAO,EAUL,KAAK,cAAc,EAGpB,MAAM,YAAY,CAAC;AAGpB,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,iEAAiE;AACjE,MAAM,MAAM,SAAS,GAAG;IACtB,gFAAgF;IAChF,OAAO,EAAE,MAAM,CAAC;IAChB,yDAAyD;IACzD,WAAW,EAAE,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9D,CAAC;AAKF;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAiBjE;AAED,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,GAAG,EACjB,IAAI,EAAE,SAAS,GACd,IAAI,CAmDN;AAED,wBAAsB,QAAQ,CAC5B,MAAM,EAAE,MAAM,GAAG,EACjB,IAAI,EAAE,SAAS,EACf,IAAI,EAAE,YAAY,GACjB,OAAO,CAAC,IAAI,CAAC,CAmDf;AAqPD;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,GAAG,MAAM,CAkBvE"}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
// down.
|
|
8
8
|
//
|
|
9
9
|
// Three steps and no more: sign in, land in a workspace, choose where to carry
|
|
10
|
-
// on. Everything past that belongs to whatever you chose — `
|
|
10
|
+
// on. Everything past that belongs to whatever you chose — `project init` asks its
|
|
11
11
|
// own questions about a project, a coding agent asks its own about the work.
|
|
12
12
|
// The flow writes nothing to disk except its own state.
|
|
13
13
|
//
|
|
@@ -57,7 +57,7 @@ export function registerStartCommand(program, getApi, deps) {
|
|
|
57
57
|
.option("--workspace-name <name>", "Workspace to use, created if it does not exist")
|
|
58
58
|
.option("--workspace-uuid <uuid>", "Workspace to use")
|
|
59
59
|
.option("--continue <where>", 'Where to continue: a coding agent ("claude", "cursor", "codex", "gemini"), "code" to set up a project, "cli" for the palette, "demo" for the guided tour, or "none"')
|
|
60
|
-
.option("--directory <path>", "Directory to scaffold into, for `--continue code`. Required when there is nobody to ask; supplying it also skips the project wizard, the way `
|
|
60
|
+
.option("--directory <path>", "Directory to scaffold into, for `--continue code`. Required when there is nobody to ask; supplying it also skips the project wizard, the way `project init <directory>` does")
|
|
61
61
|
.option("--icp <description>", "Who you sell to, used to brief the guided demo")
|
|
62
62
|
.option("--base-url <url>", "Cargo API base URL")
|
|
63
63
|
.addHelpText("after", `
|
|
@@ -83,7 +83,7 @@ export async function runStart(getApi, deps, opts) {
|
|
|
83
83
|
// error, and finding it out after a browser sign-in is a poor way to learn.
|
|
84
84
|
const supplied = opts.continue === undefined ? undefined : requireDestination(opts.continue);
|
|
85
85
|
// Same reasoning, one step further. Scaffolding headless needs a directory,
|
|
86
|
-
// and `
|
|
86
|
+
// and `project init` cannot ask for one — so without this the run signs in,
|
|
87
87
|
// saves its state, and *then* dies on a usage error from a child
|
|
88
88
|
// process, having done everything except the thing it was asked to do.
|
|
89
89
|
if (supplied !== undefined &&
|
|
@@ -166,7 +166,7 @@ async function go(destination, facts, deps, opts) {
|
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
168
|
/**
|
|
169
|
-
* The skill to load for a general agent handoff: `cargo-
|
|
169
|
+
* The skill to load for a general agent handoff: `cargo-project` when inside a
|
|
170
170
|
* CDK project (the user is building infra as code), `cargo` (the router)
|
|
171
171
|
* everywhere else.
|
|
172
172
|
*/
|
|
@@ -174,7 +174,7 @@ function agentSkill(project) {
|
|
|
174
174
|
return project.kind === "none" ? ROUTER_SKILL : CDK_SKILL;
|
|
175
175
|
}
|
|
176
176
|
/**
|
|
177
|
-
* Hand the whole project question to `
|
|
177
|
+
* Hand the whole project question to `project init`, which owns it: where the
|
|
178
178
|
* project goes, what it starts from, and the company questions worth asking
|
|
179
179
|
* once there is a repo to write the answers into.
|
|
180
180
|
*
|
|
@@ -188,12 +188,12 @@ function scaffoldProject(deps, opts) {
|
|
|
188
188
|
// command line, which `--directory` is here to forward.
|
|
189
189
|
const scaffold = spawnSync(process.execPath, [
|
|
190
190
|
deps.binPath,
|
|
191
|
-
"
|
|
191
|
+
"project",
|
|
192
192
|
"init",
|
|
193
193
|
...(opts.directory === undefined ? [] : [opts.directory]),
|
|
194
194
|
], { stdio: "inherit" });
|
|
195
195
|
if (scaffold.error !== undefined) {
|
|
196
|
-
failWith(`Could not run \`
|
|
196
|
+
failWith(`Could not run \`project init\`: ${scaffold.error.message}`);
|
|
197
197
|
}
|
|
198
198
|
// The child has already said what went wrong on this terminal, so this
|
|
199
199
|
// carries its code rather than adding a second message. A null status means
|
package/build/index.js
CHANGED
|
@@ -248,8 +248,13 @@ registerAiCommands(program, getApi);
|
|
|
248
248
|
registerHostingCommands(program, getApi);
|
|
249
249
|
registerMailboxManagementCommands(program, getApi);
|
|
250
250
|
registerMcpCommand(program, getApi);
|
|
251
|
+
// `cdk` is what this group was called for its first year, and it is still what
|
|
252
|
+
// the npm package and the standalone bin are called. The alias keeps every
|
|
253
|
+
// pasted command, script and older skill working; `project` is the name a
|
|
254
|
+
// person who has never used the AWS CDK can guess.
|
|
251
255
|
registerCdkCommands(program
|
|
252
|
-
.command("
|
|
256
|
+
.command("project")
|
|
257
|
+
.alias("cdk")
|
|
253
258
|
.description("Define this workspace in a repo and deploy it (init/plan/deploy)"), getApi);
|
|
254
259
|
// Bare `cargo-ai` in a terminal opens the palette instead of printing the help
|
|
255
260
|
// wall: twenty command groups is a list to navigate, not one to read. Anything
|
|
@@ -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;
|
|
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;AA+E3B,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
|
@@ -18,10 +18,11 @@ const DEPLOY = " deploy";
|
|
|
18
18
|
const BOOK_DEMO = " book-demo";
|
|
19
19
|
/**
|
|
20
20
|
* `start` runs most of these; the pinned row is the shortcut to one of them.
|
|
21
|
-
* The exceptions are "Add" and "Deploy", which run `
|
|
22
|
-
* directly: neither is a `start` destination, because neither needs the
|
|
23
|
-
* step nor a choice of where to carry on — you are already in the
|
|
24
|
-
* `
|
|
21
|
+
* The exceptions are "Add" and "Deploy", which run `project add` and `project
|
|
22
|
+
* deploy` directly: neither is a `start` destination, because neither needs the
|
|
23
|
+
* sign-in step nor a choice of where to carry on — you are already in the
|
|
24
|
+
* project. Bare `project add` asks connector vs cookbook, then shows that
|
|
25
|
+
* kind's list. "Book a
|
|
25
26
|
* demo" is the other exception: it is only pinned on an unpaid plan, and runs
|
|
26
27
|
* `book-demo` itself.
|
|
27
28
|
*/
|
|
@@ -78,7 +79,7 @@ const SECTIONS = [
|
|
|
78
79
|
],
|
|
79
80
|
// The workspace as code sits on its own: it is the same resources again,
|
|
80
81
|
// declared in a repo rather than run from here.
|
|
81
|
-
["
|
|
82
|
+
["project"],
|
|
82
83
|
["doctor", "whoami", "login", "logout", "book-demo"],
|
|
83
84
|
];
|
|
84
85
|
export function buildPaletteLayout(input) {
|
|
@@ -162,10 +163,10 @@ function cdkRows(root, cwd) {
|
|
|
162
163
|
value: ADD,
|
|
163
164
|
label: "Add",
|
|
164
165
|
hint: "a connector or a cookbook into this project",
|
|
165
|
-
// `--dir` because `
|
|
166
|
+
// `--dir` because `project add` refuses a directory with no package.json,
|
|
166
167
|
// and the palette is as often open in `infra/` — where the scaffold's
|
|
167
168
|
// README sends people — as at the root.
|
|
168
|
-
argv: ["
|
|
169
|
+
argv: ["project", "add", "--dir", root],
|
|
169
170
|
},
|
|
170
171
|
{
|
|
171
172
|
value: DEPLOY,
|
|
@@ -180,7 +181,7 @@ function cdkRows(root, cwd) {
|
|
|
180
181
|
: `${basename(root)}/ to your workspace`,
|
|
181
182
|
// No `--yes`: `deploy` shows the plan and asks, which is the point of
|
|
182
183
|
// reaching it from a menu.
|
|
183
|
-
argv: ["
|
|
184
|
+
argv: ["project", "deploy", "--dir", root],
|
|
184
185
|
},
|
|
185
186
|
];
|
|
186
187
|
}
|
package/build/utils/cdkState.js
CHANGED
|
@@ -101,7 +101,7 @@ export function resolveTokensFromState(value, file, subject) {
|
|
|
101
101
|
failWith(`${subject} references ${String(deps.size)} deployed resource(s) ` +
|
|
102
102
|
`(${[...deps].join(", ")}), but no cargo.state.json was found near ` +
|
|
103
103
|
`${absPath} or the current directory. Deploy the resources first with ` +
|
|
104
|
-
"`cargo-ai
|
|
104
|
+
"`cargo-ai project 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
|
|
@@ -120,7 +120,7 @@ export function resolveTokensFromState(value, file, subject) {
|
|
|
120
120
|
failWith(`${String(missing.length)} resource(s) referenced by ${subject} ` +
|
|
121
121
|
`aren't in this project's deploy state yet: ${missing.join(", ")}. A test run ` +
|
|
122
122
|
"resolves existing (already-deployed) resources from state — it won't " +
|
|
123
|
-
"create new ones. Deploy them first with `cargo-ai
|
|
123
|
+
"create new ones. Deploy them first with `cargo-ai project deploy`, or " +
|
|
124
124
|
"reference them by literal uuid (toolRef / agentRef / connectorRef).", { code: ExitCodes.NotFound });
|
|
125
125
|
}
|
|
126
126
|
return resolveTokens(value, outputs);
|
|
@@ -97,7 +97,7 @@ export async function loadCompiledAgent(file) {
|
|
|
97
97
|
if (setUnsupported.length > 0) {
|
|
98
98
|
failWith(`Agent "${handle.slug}" sets ${setUnsupported.join(", ")}, which a test ` +
|
|
99
99
|
"message can't apply (they only take effect on a deployed release). " +
|
|
100
|
-
"Remove them for a test run, or deploy the agent with `cargo-ai
|
|
100
|
+
"Remove them for a test run, or deploy the agent with `cargo-ai project " +
|
|
101
101
|
"deploy` and chat against it by uuid.", { code: ExitCodes.InvalidUsage });
|
|
102
102
|
}
|
|
103
103
|
return compileAgent(node.spec);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cargo-ai/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.95",
|
|
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.83",
|
|
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.81",
|
|
73
|
+
"@cargo-ai/types": "^1.0.79",
|
|
74
74
|
"@cargo-ai/utils": "^1.0.30",
|
|
75
75
|
"@cargo-ai/worker-sdk": "^1.0.17",
|
|
76
76
|
"@modelcontextprotocol/sdk": "1.29.0",
|
|
@@ -78,7 +78,8 @@
|
|
|
78
78
|
"ai-sdk-sandbox-local": "^0.1.2",
|
|
79
79
|
"commander": "^12.1.0",
|
|
80
80
|
"tsx": "^4.19.2",
|
|
81
|
-
"undici": "^7.29.0"
|
|
81
|
+
"undici": "^7.29.0",
|
|
82
|
+
"uuid": "^14.0.0"
|
|
82
83
|
},
|
|
83
84
|
"devDependencies": {
|
|
84
85
|
"@cargo-ai/eslint-config": "*",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"artifacts.d.ts","sourceRoot":"","sources":["../../../src/commands/ask/artifacts.ts"],"names":[],"mappings":"AAwBA,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,SAAa,GAAG,IAAI,CAGzE"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
type RepositoryLike = {
|
|
2
|
-
connectorUuid?: string;
|
|
3
|
-
repository?: string;
|
|
4
|
-
} | null | undefined;
|
|
5
|
-
/**
|
|
6
|
-
* A usable GitHub workspace: connector + owner/name. Matches
|
|
7
|
-
* parseHarnessBinding's required fields, without decrypting env.
|
|
8
|
-
*
|
|
9
|
-
* Exported for tests.
|
|
10
|
-
*/
|
|
11
|
-
export declare function isBoundRepository(repository: RepositoryLike): boolean;
|
|
12
|
-
export {};
|
|
13
|
-
//# sourceMappingURL=binding.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"binding.d.ts","sourceRoot":"","sources":["../../../src/commands/ask/binding.ts"],"names":[],"mappings":"AAAA,KAAK,cAAc,GACf;IACE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,GACD,IAAI,GACJ,SAAS,CAAC;AAEd;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,cAAc,GAAG,OAAO,CAgBrE"}
|