@cargo-ai/cli 1.0.135 → 1.0.136
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/agentSkills.d.ts +21 -1
- package/build/agentSkills.d.ts.map +1 -1
- package/build/agentSkills.js +29 -1
- package/build/commands/auth/email.js +2 -2
- package/build/commands/auth/index.js +3 -3
- package/build/commands/doctor.d.ts.map +1 -1
- package/build/commands/doctor.js +3 -1
- package/build/index.js +3 -0
- package/build/setupIssues.d.ts +12 -2
- package/build/setupIssues.d.ts.map +1 -1
- package/build/setupIssues.js +15 -4
- package/package.json +3 -3
package/build/agentSkills.d.ts
CHANGED
|
@@ -19,7 +19,8 @@
|
|
|
19
19
|
/** One line, for a footer where vertical space is somebody else's error. */
|
|
20
20
|
export declare const AGENT_SKILLS_HINT = "Coding agents: install the Cargo skills with `npx skills add getcargohq/cargo-skills`";
|
|
21
21
|
/**
|
|
22
|
-
* Printed after a successful sign-in
|
|
22
|
+
* Printed after a successful sign-in that did not end with the skills
|
|
23
|
+
* installed (see `offerAgentSkills`).
|
|
23
24
|
*
|
|
24
25
|
* Deliberately two lines and no more. A sign-in banner that scrolls is a banner
|
|
25
26
|
* people configure away, and this fires at most a handful of times per machine
|
|
@@ -31,4 +32,23 @@ export declare const AGENT_SKILLS_HINT = "Coding agents: install the Cargo skill
|
|
|
31
32
|
* somebody adds one, and nothing in CI was ever going to catch it here.
|
|
32
33
|
*/
|
|
33
34
|
export declare const AGENT_SKILLS_NEXT_STEP: string;
|
|
35
|
+
export type AgentSkillsOfferDeps = {
|
|
36
|
+
ensureSkillsInstalled: (cwd: string) => Promise<boolean>;
|
|
37
|
+
print: (message: string) => void;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Offer the skills install right after sign-in, falling back to printing the
|
|
41
|
+
* commands.
|
|
42
|
+
*
|
|
43
|
+
* Printing alone is what produced the gap above: the lines scroll past and the
|
|
44
|
+
* install never happens. Asking turns the one moment we know someone is
|
|
45
|
+
* watching into a single keypress. The prompt is the agent handoff's own, so a
|
|
46
|
+
* machine that already has the bundle (globally or in this repo) is not asked,
|
|
47
|
+
* and an agent or a CI run never is.
|
|
48
|
+
*
|
|
49
|
+
* Whatever stops the install — no terminal, a declined prompt, an installer
|
|
50
|
+
* that failed — still leaves the commands on screen, so nobody ends sign-in
|
|
51
|
+
* with less than they used to get.
|
|
52
|
+
*/
|
|
53
|
+
export declare function offerAgentSkills(deps?: AgentSkillsOfferDeps): Promise<void>;
|
|
34
54
|
//# sourceMappingURL=agentSkills.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agentSkills.d.ts","sourceRoot":"","sources":["../src/agentSkills.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;
|
|
1
|
+
{"version":3,"file":"agentSkills.d.ts","sourceRoot":"","sources":["../src/agentSkills.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAMH,4EAA4E;AAC5E,eAAO,MAAM,iBAAiB,0FAC2D,CAAC;AAE1F;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,sBAAsB,QAIvB,CAAC;AAEb,MAAM,MAAM,oBAAoB,GAAG;IACjC,qBAAqB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACzD,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAClC,CAAC;AAOF;;;;;;;;;;;;;GAaG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,GAAE,oBAAkC,GACvC,OAAO,CAAC,IAAI,CAAC,CAQf"}
|
package/build/agentSkills.js
CHANGED
|
@@ -16,10 +16,13 @@
|
|
|
16
16
|
* Keep the strings here rather than at each call site, so a change to how the
|
|
17
17
|
* bundles are named or installed cannot land in `--help` and miss sign-in.
|
|
18
18
|
*/
|
|
19
|
+
import { ensureSkillsInstalled } from "@cargo-ai/cdk/cli";
|
|
20
|
+
import { info } from "./commands/runHandler.js";
|
|
19
21
|
/** One line, for a footer where vertical space is somebody else's error. */
|
|
20
22
|
export const AGENT_SKILLS_HINT = "Coding agents: install the Cargo skills with `npx skills add getcargohq/cargo-skills`";
|
|
21
23
|
/**
|
|
22
|
-
* Printed after a successful sign-in
|
|
24
|
+
* Printed after a successful sign-in that did not end with the skills
|
|
25
|
+
* installed (see `offerAgentSkills`).
|
|
23
26
|
*
|
|
24
27
|
* Deliberately two lines and no more. A sign-in banner that scrolls is a banner
|
|
25
28
|
* people configure away, and this fires at most a handful of times per machine
|
|
@@ -35,3 +38,28 @@ export const AGENT_SKILLS_NEXT_STEP = [
|
|
|
35
38
|
" npx skills add getcargohq/cargo-skills every command, as agent skills",
|
|
36
39
|
" npx skills add getcargohq/gtm-skills standalone one-job GTM skills",
|
|
37
40
|
].join("\n");
|
|
41
|
+
const machineDeps = {
|
|
42
|
+
ensureSkillsInstalled,
|
|
43
|
+
print: info,
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Offer the skills install right after sign-in, falling back to printing the
|
|
47
|
+
* commands.
|
|
48
|
+
*
|
|
49
|
+
* Printing alone is what produced the gap above: the lines scroll past and the
|
|
50
|
+
* install never happens. Asking turns the one moment we know someone is
|
|
51
|
+
* watching into a single keypress. The prompt is the agent handoff's own, so a
|
|
52
|
+
* machine that already has the bundle (globally or in this repo) is not asked,
|
|
53
|
+
* and an agent or a CI run never is.
|
|
54
|
+
*
|
|
55
|
+
* Whatever stops the install — no terminal, a declined prompt, an installer
|
|
56
|
+
* that failed — still leaves the commands on screen, so nobody ends sign-in
|
|
57
|
+
* with less than they used to get.
|
|
58
|
+
*/
|
|
59
|
+
export async function offerAgentSkills(deps = machineDeps) {
|
|
60
|
+
const installed = await deps.ensureSkillsInstalled(process.cwd());
|
|
61
|
+
if (installed === true) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
deps.print(AGENT_SKILLS_NEXT_STEP);
|
|
65
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { offerAgentSkills } from "../../agentSkills.js";
|
|
2
2
|
import { getCredentialsPath } from "../../credentials.js";
|
|
3
3
|
import { askQuestion, openPromptInput } from "../../utils/prompt.js";
|
|
4
4
|
import { ExitCodes, failWith, info, outputJson, startSpinner, success, } from "../runHandler.js";
|
|
@@ -52,7 +52,7 @@ export async function runEmailLogin(opts) {
|
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
54
|
success(`Signed in as ${result.email}. Workspace: ${result.workspace.name}.`);
|
|
55
|
-
|
|
55
|
+
await offerAgentSkills();
|
|
56
56
|
outputJson({
|
|
57
57
|
ok: true,
|
|
58
58
|
status: "signedIn",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { declarePrompt, revokeSession } from "@cargo-ai/cdk/cli";
|
|
2
2
|
import { Option } from "commander";
|
|
3
|
-
import {
|
|
3
|
+
import { offerAgentSkills } from "../../agentSkills.js";
|
|
4
4
|
import { getConfig } from "../../config.js";
|
|
5
5
|
import { clearCredentials, CredentialsNotClearedError, getCredentialsPath, loadCredentials, saveCredentials, } from "../../credentials.js";
|
|
6
6
|
import { parseBooleanOption } from "../../utils/booleanOption.js";
|
|
@@ -140,7 +140,7 @@ async function runLogin(opts) {
|
|
|
140
140
|
baseUrl: opts.baseUrl,
|
|
141
141
|
});
|
|
142
142
|
success("Signed in with API token.");
|
|
143
|
-
|
|
143
|
+
await offerAgentSkills();
|
|
144
144
|
outputJson({
|
|
145
145
|
ok: true,
|
|
146
146
|
status: "signedIn",
|
|
@@ -159,7 +159,7 @@ async function runLogin(opts) {
|
|
|
159
159
|
workspaceName: opts.workspaceName,
|
|
160
160
|
});
|
|
161
161
|
success(`Signed in. Default workspace: ${workspace.name}.`);
|
|
162
|
-
|
|
162
|
+
await offerAgentSkills();
|
|
163
163
|
outputJson({
|
|
164
164
|
ok: true,
|
|
165
165
|
status: "signedIn",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA+KzC,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,MAAM,GACrB,IAAI,
|
|
1
|
+
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA+KzC,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,MAAM,GACrB,IAAI,CAkFN"}
|
package/build/commands/doctor.js
CHANGED
|
@@ -125,7 +125,8 @@ export function registerDoctorCommand(program, currentVersion) {
|
|
|
125
125
|
Runs every check and reports all results as one JSON object, then exits with the
|
|
126
126
|
most severe failure:
|
|
127
127
|
|
|
128
|
-
0 healthy (an outdated CLI
|
|
128
|
+
0 healthy (an outdated CLI, a pin mismatch or missing agent skills is
|
|
129
|
+
reported but never fails the check)
|
|
129
130
|
1 API unreachable or returned an unexpected error
|
|
130
131
|
3 not authenticated (no credentials, or the API rejected them)
|
|
131
132
|
4 permission denied for the configured workspace
|
|
@@ -167,6 +168,7 @@ Examples:
|
|
|
167
168
|
currentVersion,
|
|
168
169
|
latestVersion,
|
|
169
170
|
latestSkillsPin,
|
|
171
|
+
cwd: process.cwd(),
|
|
170
172
|
});
|
|
171
173
|
const apiIssue = describeApiIssue(api);
|
|
172
174
|
const issues = apiIssue === undefined
|
package/build/index.js
CHANGED
|
@@ -300,10 +300,13 @@ async function openPalette(startPath) {
|
|
|
300
300
|
const agents = availableCodingAgents();
|
|
301
301
|
// Read after the refresh above, which fetches the skills pin alongside.
|
|
302
302
|
const latestSkillsPin = cachedLatestSkillsPin();
|
|
303
|
+
// The cwd is read per call: a command run from the palette can install the
|
|
304
|
+
// skills into the project it is standing in.
|
|
303
305
|
const collectIssues = () => collectSetupIssues({
|
|
304
306
|
currentVersion: version,
|
|
305
307
|
latestVersion,
|
|
306
308
|
latestSkillsPin,
|
|
309
|
+
cwd: process.cwd(),
|
|
307
310
|
});
|
|
308
311
|
// Re-read after each command: signing in or out from inside the palette
|
|
309
312
|
// changes both what the setup line says and which rows are worth pinning.
|
package/build/setupIssues.d.ts
CHANGED
|
@@ -19,15 +19,25 @@ export type SetupIssueInput = {
|
|
|
19
19
|
* stale pin and the warning has nothing to offer.
|
|
20
20
|
*/
|
|
21
21
|
latestSkillsPin?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Where a coding agent would be opened. Passing one opts this caller in to
|
|
24
|
+
* reporting skills that are not installed at all, which only the palette and
|
|
25
|
+
* `doctor` do. The pre-command header does not: it prints before every
|
|
26
|
+
* command, and someone working the CLI by hand, with no coding agent, would
|
|
27
|
+
* see a line they could only clear by installing something they do not use.
|
|
28
|
+
* Agents, who do need the skills, run without a TTY and never see the header.
|
|
29
|
+
*/
|
|
30
|
+
cwd?: string;
|
|
22
31
|
};
|
|
23
32
|
/**
|
|
24
|
-
* The
|
|
25
|
-
*
|
|
33
|
+
* The facts this reads off the machine. Injected so the rules — which side of
|
|
34
|
+
* a pin mismatch to update, when an outdated CLI is this line's business at
|
|
26
35
|
* all — can be tested without a home directory.
|
|
27
36
|
*/
|
|
28
37
|
export type SetupIssueDeps = {
|
|
29
38
|
isSignedIn: () => boolean;
|
|
30
39
|
readSkillsPin: () => SkillsPin | undefined;
|
|
40
|
+
skillsInstalledFor: (cwd: string) => boolean;
|
|
31
41
|
};
|
|
32
42
|
export declare function collectSetupIssues(input: SetupIssueInput, deps?: SetupIssueDeps): SetupIssue[];
|
|
33
43
|
//# sourceMappingURL=setupIssues.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setupIssues.d.ts","sourceRoot":"","sources":["../src/setupIssues.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EACL,UAAU,EACV,aAAa,
|
|
1
|
+
{"version":3,"file":"setupIssues.d.ts","sourceRoot":"","sources":["../src/setupIssues.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EACL,UAAU,EACV,aAAa,EAGd,MAAM,mBAAmB,CAAC;AAM3B,YAAY,EAAE,SAAS,EAAE,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,CAAC;AAErC,MAAM,MAAM,eAAe,GAAG;IAC5B,cAAc,EAAE,MAAM,CAAC;IACvB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;;;;;OAOG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,UAAU,EAAE,MAAM,OAAO,CAAC;IAC1B,aAAa,EAAE,MAAM,SAAS,GAAG,SAAS,CAAC;IAC3C,kBAAkB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;CAC9C,CAAC;AAQF,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,eAAe,EACtB,IAAI,GAAE,cAA4B,GACjC,UAAU,EAAE,CAwDd"}
|
package/build/setupIssues.js
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
// What is wrong with this machine's Cargo setup, and the command that fixes
|
|
2
2
|
// each one.
|
|
3
3
|
//
|
|
4
|
-
// This runs before every command, so every check here is
|
|
5
|
-
// cheaper — no network. `cargo-ai doctor` is the same list with the online
|
|
4
|
+
// This runs before every command (and in the palette), so every check here is
|
|
5
|
+
// a small file read or cheaper — no network. `cargo-ai doctor` is the same list with the online
|
|
6
6
|
// checks added.
|
|
7
|
-
import { isSignedIn, readSkillsPin, SKILLS_INSTALL_COMMAND, } from "@cargo-ai/cdk/cli";
|
|
7
|
+
import { isSignedIn, readSkillsPin, SKILLS_INSTALL_COMMAND, skillsInstalledFor, } from "@cargo-ai/cdk/cli";
|
|
8
8
|
import { isOutdated, UPDATE_COMMAND } from "./version.js";
|
|
9
9
|
const LOGIN_COMMAND = "cargo-ai login --oauth";
|
|
10
10
|
export { isSignedIn, readSkillsPin };
|
|
11
|
-
const machineDeps = {
|
|
11
|
+
const machineDeps = {
|
|
12
|
+
isSignedIn,
|
|
13
|
+
readSkillsPin,
|
|
14
|
+
skillsInstalledFor,
|
|
15
|
+
};
|
|
12
16
|
export function collectSetupIssues(input, deps = machineDeps) {
|
|
13
17
|
const issues = [];
|
|
14
18
|
if (deps.isSignedIn() === false) {
|
|
@@ -46,5 +50,12 @@ export function collectSetupIssues(input, deps = machineDeps) {
|
|
|
46
50
|
});
|
|
47
51
|
}
|
|
48
52
|
}
|
|
53
|
+
if (input.cwd !== undefined && deps.skillsInstalledFor(input.cwd) === false) {
|
|
54
|
+
issues.push({
|
|
55
|
+
key: "skills-missing",
|
|
56
|
+
label: "no Cargo skills for coding agents",
|
|
57
|
+
fix: SKILLS_INSTALL_COMMAND,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
49
60
|
return issues;
|
|
50
61
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cargo-ai/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.136",
|
|
4
4
|
"mcpName": "io.github.getcargohq/cargo",
|
|
5
5
|
"private": false,
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -76,11 +76,11 @@
|
|
|
76
76
|
"@ai-sdk/harness-claude-code": "1.0.148",
|
|
77
77
|
"@cargo-ai/api": "^1.0.102",
|
|
78
78
|
"@cargo-ai/app-sdk": "^1.0.11",
|
|
79
|
-
"@cargo-ai/cdk": "^1.0.
|
|
79
|
+
"@cargo-ai/cdk": "^1.0.127",
|
|
80
80
|
"@cargo-ai/types": "^1.0.104",
|
|
81
81
|
"@cargo-ai/utils": "^1.0.35",
|
|
82
82
|
"@cargo-ai/worker-sdk": "^1.0.21",
|
|
83
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
83
|
+
"@modelcontextprotocol/sdk": "^1.32.0",
|
|
84
84
|
"ai": "^7.0.133",
|
|
85
85
|
"ai-sdk-sandbox-local": "^0.1.2",
|
|
86
86
|
"commander": "^12.1.0",
|