@cargo-ai/cli 1.0.127 → 1.0.129
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/commands/ai/prompt.d.ts.map +1 -1
- package/build/commands/ai/prompt.js +2 -2
- package/build/commands/auth/index.js +1 -1
- package/build/commands/connection/connector.d.ts.map +1 -1
- package/build/commands/connection/connector.js +1 -1
- package/build/commands/hosting/envVar.d.ts.map +1 -1
- package/build/commands/hosting/envVar.js +15 -6
- package/build/commands/orchestration/span.js +2 -2
- package/build/commands/orchestration/trace.js +2 -2
- package/build/commands/segmentation/change.js +1 -1
- package/build/commands/workspaceManagement/user.d.ts.map +1 -1
- package/build/commands/workspaceManagement/user.js +8 -5
- package/build/index.js +43 -9
- package/build/paletteLayout.d.ts +7 -0
- package/build/paletteLayout.d.ts.map +1 -1
- package/build/paletteLayout.js +19 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../../src/commands/ai/prompt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGxC,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,
|
|
1
|
+
{"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../../src/commands/ai/prompt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGxC,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CAqFN"}
|
|
@@ -2,7 +2,7 @@ import { handleApiCall, outputJson, parseJson } from "../runHandler.js";
|
|
|
2
2
|
export function registerPromptCommands(parent, getApi) {
|
|
3
3
|
const prompt = parent
|
|
4
4
|
.command("prompt")
|
|
5
|
-
.description("Optimize and
|
|
5
|
+
.description("Optimize and render AI prompts");
|
|
6
6
|
prompt
|
|
7
7
|
.command("optimize")
|
|
8
8
|
.description("Optimize a prompt for better AI performance")
|
|
@@ -17,7 +17,7 @@ Example:
|
|
|
17
17
|
});
|
|
18
18
|
prompt
|
|
19
19
|
.command("evaluate")
|
|
20
|
-
.description("
|
|
20
|
+
.description("Render a prompt's template expressions against the variables its actions, resources and capabilities provide — the prompt the agent will actually see. It does not score the prompt")
|
|
21
21
|
.requiredOption("--prompt <text>", "Prompt text to evaluate (string, required)")
|
|
22
22
|
.option("--actions <json>", "Available actions context (JSON array of action objects, default: [])")
|
|
23
23
|
.option("--resources <json>", "Available resources context (JSON array of resource objects, default: [])")
|
|
@@ -20,7 +20,7 @@ export function registerAuthCommands(program, getApi) {
|
|
|
20
20
|
.option("--oauth [true|false]", "Sign in via browser using the OAuth 2.0 Device Authorization Flow", parseBooleanOption)
|
|
21
21
|
.option("--agentid [true|false]", "Sign in as an agent through the AgentID connection; prints an Auth0 URL and waits for it to redirect back to this machine", parseBooleanOption)
|
|
22
22
|
.option("--token <token>", "Existing Cargo API token")
|
|
23
|
-
.option("--workspace-name <name>", "Workspace to use
|
|
23
|
+
.option("--workspace-name <name>", "Workspace to use (skips the workspace prompt): one of that name if it exists; otherwise the Personal workspace a first sign-in creates is renamed to it (when under 10 minutes old and you are its only member); otherwise it is created")
|
|
24
24
|
.option("--workspace-uuid <uuid>", "Workspace UUID to sign in for (skips the workspace prompt)")
|
|
25
25
|
.option("--base-url <url>", `Cargo API base URL (string, default: ${DEFAULT_BASE_URL})`)
|
|
26
26
|
.addHelpText("after", `
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connector.d.ts","sourceRoot":"","sources":["../../../src/commands/connection/connector.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAcxC,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,
|
|
1
|
+
{"version":3,"file":"connector.d.ts","sourceRoot":"","sources":["../../../src/commands/connection/connector.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAcxC,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CAgUN"}
|
|
@@ -69,7 +69,7 @@ export function registerConnectorCommands(parent, getApi) {
|
|
|
69
69
|
.command("get-dynamic-schema")
|
|
70
70
|
.description("Get dynamic schema for a connector action")
|
|
71
71
|
.requiredOption("--connector-uuid <uuid>", "Connector UUID (string, required)")
|
|
72
|
-
.requiredOption("--slug <slug>", "
|
|
72
|
+
.requiredOption("--slug <slug>", "Dynamic-schema slug as the integration declares it (e.g. hubspot's getConsentOptions) — not the action slug (string, required)")
|
|
73
73
|
.requiredOption("--params <json>", "Schema parameters (JSON object, required)")
|
|
74
74
|
.action(async (opts) => {
|
|
75
75
|
const api = getApi();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"envVar.d.ts","sourceRoot":"","sources":["../../../src/commands/hosting/envVar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AASxC,KAAK,OAAO,GAAG,KAAK,GAAG,QAAQ,CAAC;AAehC;;;;GAIG;AACH,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,EACjB,OAAO,EAAE;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC1C,IAAI,
|
|
1
|
+
{"version":3,"file":"envVar.d.ts","sourceRoot":"","sources":["../../../src/commands/hosting/envVar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AASxC,KAAK,OAAO,GAAG,KAAK,GAAG,QAAQ,CAAC;AAehC;;;;GAIG;AACH,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,EACjB,OAAO,EAAE;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC1C,IAAI,CAkJN"}
|
|
@@ -37,18 +37,27 @@ ${note}`);
|
|
|
37
37
|
: { workerUuid: subjectUuid }));
|
|
38
38
|
outputJson(result);
|
|
39
39
|
});
|
|
40
|
-
env
|
|
40
|
+
const set = env
|
|
41
41
|
.command("set")
|
|
42
42
|
.description(`Create an environment variable on a ${subject}, or update it if the key already exists. Takes effect on the next deployment`)
|
|
43
43
|
.requiredOption(`${flag} <uuid>`, `${capitalize(subject)} UUID`)
|
|
44
44
|
.requiredOption("--key <key>", "Environment variable name")
|
|
45
|
-
.option("--value <value>", "Value. Pass '-' to read it from stdin, or omit it to read the local environment variable of the same name — both keep a secret out of shell history")
|
|
46
|
-
|
|
45
|
+
.option("--value <value>", "Value. Pass '-' to read it from stdin, or omit it to read the local environment variable of the same name — both keep a secret out of shell history");
|
|
46
|
+
// An app's values are compiled into its public bundle, so the API refuses a
|
|
47
|
+
// secret one (secretNotSupportedForApp); only a worker gets the flag.
|
|
48
|
+
if (subject === "worker") {
|
|
49
|
+
set.option("--secret [true|false]", "Encrypt the value at rest and never return it. On an existing key, omit to keep its current setting", parseBooleanOption);
|
|
50
|
+
}
|
|
51
|
+
const examples = subject === "worker"
|
|
52
|
+
? ` $ cargo-ai hosting ${subject} ${name} set ${flag} <uuid> --key LOG_LEVEL --value debug
|
|
53
|
+
$ printf %s "$TOKEN" | cargo-ai hosting ${subject} ${name} set ${flag} <uuid> --key CARGO_API_TOKEN --value - --secret
|
|
54
|
+
$ CARGO_API_TOKEN=... cargo-ai hosting ${subject} ${name} set ${flag} <uuid> --key CARGO_API_TOKEN --secret`
|
|
55
|
+
: ` $ cargo-ai hosting ${subject} ${name} set ${flag} <uuid> --key VITE_API_URL --value https://api.example.com
|
|
56
|
+
$ cargo-ai hosting ${subject} ${name} set ${flag} <uuid> --key VITE_WORKER_URL --value https://my-worker.example.com`;
|
|
57
|
+
set
|
|
47
58
|
.addHelpText("after", `
|
|
48
59
|
Examples:
|
|
49
|
-
|
|
50
|
-
$ printf %s "$TOKEN" | cargo-ai hosting ${subject} ${name} set ${flag} <uuid> --key CARGO_API_TOKEN --value - --secret
|
|
51
|
-
$ CARGO_API_TOKEN=... cargo-ai hosting ${subject} ${name} set ${flag} <uuid> --key CARGO_API_TOKEN --secret
|
|
60
|
+
${examples}
|
|
52
61
|
|
|
53
62
|
${note}`)
|
|
54
63
|
.action(async (opts) => {
|
|
@@ -24,7 +24,7 @@ export function registerSpanCommands(parent, getApi) {
|
|
|
24
24
|
.option("--node-release-uuid <uuid>", "Release UUID on the node")
|
|
25
25
|
.option("--execution-statuses <pending,success,error>", "Filter by execution statuses")
|
|
26
26
|
.option("--parent-run-uuid <uuid>", "Parent run UUID")
|
|
27
|
-
.requiredOption("--execution-started-after <date>", "Execution started after (ISO date)")
|
|
27
|
+
.requiredOption("--execution-started-after <date>", "Execution started after (ISO date, required)")
|
|
28
28
|
.option("--execution-started-before <date>", "Execution started on or before (ISO date)")
|
|
29
29
|
.option("--search <text>", "Case-insensitive partial match on record title, record ID, execution title, or error message")
|
|
30
30
|
.option("--limit <n>", "Limit", "30")
|
|
@@ -89,7 +89,7 @@ export function registerSpanCommands(parent, getApi) {
|
|
|
89
89
|
.option("--node-release-uuid <uuid>", "Release UUID on the node")
|
|
90
90
|
.option("--execution-statuses <pending,success,error>", "Filter by execution statuses")
|
|
91
91
|
.option("--parent-run-uuid <uuid>", "Parent run UUID")
|
|
92
|
-
.requiredOption("--execution-started-after <date>", "Execution started after (ISO date)")
|
|
92
|
+
.requiredOption("--execution-started-after <date>", "Execution started after (ISO date, required)")
|
|
93
93
|
.option("--execution-started-before <date>", "Execution started on or before (ISO date)")
|
|
94
94
|
.action(async (opts) => {
|
|
95
95
|
const api = getApi();
|
|
@@ -8,7 +8,7 @@ export function registerTraceCommands(parent, getApi) {
|
|
|
8
8
|
.description("List traces (aggregated over their spans)")
|
|
9
9
|
.option("--workflow-uuid <uuid>", "Workflow UUID (omit to include all workflows in the workspace)")
|
|
10
10
|
.option("--statuses <pending,error,degraded,success>", "Trace statuses")
|
|
11
|
-
.requiredOption("--started-after <date>", "Trace's first span started after (ISO date)")
|
|
11
|
+
.requiredOption("--started-after <date>", "Trace's first span started after (ISO date, required)")
|
|
12
12
|
.option("--started-before <date>", "Trace's first span started on or before (ISO date)")
|
|
13
13
|
.option("--limit <n>", "Limit", "30")
|
|
14
14
|
.option("--offset <n>", "Offset", "0")
|
|
@@ -31,7 +31,7 @@ export function registerTraceCommands(parent, getApi) {
|
|
|
31
31
|
.description("Count traces matching the filter")
|
|
32
32
|
.option("--workflow-uuid <uuid>", "Workflow UUID (omit to include all workflows in the workspace)")
|
|
33
33
|
.option("--statuses <pending,error,degraded,success>", "Trace statuses")
|
|
34
|
-
.requiredOption("--started-after <date>", "Trace's first span started after (ISO date)")
|
|
34
|
+
.requiredOption("--started-after <date>", "Trace's first span started after (ISO date, required)")
|
|
35
35
|
.option("--started-before <date>", "Trace's first span started on or before (ISO date)")
|
|
36
36
|
.action(async (opts) => {
|
|
37
37
|
const api = getApi();
|
|
@@ -6,7 +6,7 @@ export function registerChangeCommands(parent, getApi) {
|
|
|
6
6
|
.command("list")
|
|
7
7
|
.description("List changes")
|
|
8
8
|
.option("--segment-uuid <uuid>", "Segment UUID")
|
|
9
|
-
.option("--not-empty [true|false]", "Only
|
|
9
|
+
.option("--not-empty [true|false]", "Only changes where a record was added, updated or removed", parseBooleanOption)
|
|
10
10
|
.option("--has-records <added|updated|removed|unchanged>", "Has records of kind")
|
|
11
11
|
.option("--limit <n>", "Limit")
|
|
12
12
|
.option("--offset <n>", "Offset")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../src/commands/workspaceManagement/user.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGxC,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../src/commands/workspaceManagement/user.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGxC,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,GAAG,IAAI,CAiN7E"}
|
|
@@ -76,18 +76,21 @@ Example:
|
|
|
76
76
|
.command("upsert-permission")
|
|
77
77
|
.description("Create or update a user permission")
|
|
78
78
|
.option("--user-uuids <uuids>", "Target user UUIDs (comma-separated strings). At least one of --user-uuids or --emails is required")
|
|
79
|
-
.option("--emails <emails>", "Target user emails (comma-separated strings). At least one of --user-uuids or --emails is required")
|
|
80
|
-
.requiredOption("--action <action>", "Permission action (string, required)")
|
|
79
|
+
.option("--emails <emails>", "Target user emails (comma-separated strings). Invites any address that is not a member yet. At least one of --user-uuids or --emails is required")
|
|
80
|
+
.requiredOption("--action <action>", "Permission action, e.g. orchestration:workflow:read (string, required)")
|
|
81
81
|
.requiredOption("--resource-uuid <uuid>", "Resource UUID to grant/deny access to (string, required)")
|
|
82
|
-
.requiredOption("--effect <allow|deny>", "Permission effect")
|
|
82
|
+
.requiredOption("--effect <allow|deny>", "Permission effect. deny applies to existing members only, so it takes --user-uuids")
|
|
83
83
|
.addHelpText("after", `
|
|
84
84
|
Examples:
|
|
85
|
-
$ cargo-ai workspaceManagement user upsert-permission --emails alice@example.com --action read --resource-uuid 550e8400-... --effect allow
|
|
86
|
-
$ cargo-ai workspaceManagement user upsert-permission --user-uuids uuid1,uuid2 --action write --resource-uuid 550e8400-... --effect deny`)
|
|
85
|
+
$ cargo-ai workspaceManagement user upsert-permission --emails alice@example.com --action orchestration:workflow:read --resource-uuid 550e8400-... --effect allow
|
|
86
|
+
$ cargo-ai workspaceManagement user upsert-permission --user-uuids uuid1,uuid2 --action orchestration:workflow:write --resource-uuid 550e8400-... --effect deny`)
|
|
87
87
|
.action(async (opts) => {
|
|
88
88
|
if (opts.userUuids === undefined && opts.emails === undefined) {
|
|
89
89
|
throw new Error("--user-uuids or --emails is required");
|
|
90
90
|
}
|
|
91
|
+
if (opts.effect === "deny" && opts.emails !== undefined) {
|
|
92
|
+
throw new Error("--effect deny applies to existing members only: pass --user-uuids, not --emails");
|
|
93
|
+
}
|
|
91
94
|
const api = getApi();
|
|
92
95
|
const result = await handleApiCall(() => api.workspaceManagement.user.upsertPermission({
|
|
93
96
|
userUuids: opts.userUuids !== undefined
|
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, creditsLeftOf, declareSources, fetchSubscription, fetchWorkspaceName, findProjectDir, formatWorkspaceSuffix, isInteractive, isUnpaidPlan, printSetupIssues, registerCommands as registerCdkCommands, runPalette, SessionExpiredError, } from "@cargo-ai/cdk/cli";
|
|
3
|
+
import { availableCodingAgents, BRAND, canRunPalette, creditsLeftOf, declareSources, fetchStateConnected, fetchSubscription, fetchWorkspaceName, findProjectDir, 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";
|
|
@@ -308,7 +308,7 @@ async function openPalette(startPath) {
|
|
|
308
308
|
// Re-read after each command: signing in or out from inside the palette
|
|
309
309
|
// changes both what the setup line says and which rows are worth pinning.
|
|
310
310
|
// The cwd is re-tested too — a command can create a project in it.
|
|
311
|
-
const layoutFor = (
|
|
311
|
+
const layoutFor = (lookups) => {
|
|
312
312
|
// Read once: a layout describing two different directories could offer to
|
|
313
313
|
// deploy one and name the other.
|
|
314
314
|
const cwd = process.cwd();
|
|
@@ -318,7 +318,14 @@ async function openPalette(startPath) {
|
|
|
318
318
|
agents,
|
|
319
319
|
projectDir: root,
|
|
320
320
|
cwd,
|
|
321
|
-
unpaidPlan,
|
|
321
|
+
unpaidPlan: lookups.unpaidPlan,
|
|
322
|
+
// Only trusted for the project it was asked about: a command can `cd`
|
|
323
|
+
// the process or create a project, and an answer about another state
|
|
324
|
+
// would offer to connect one that is already connected.
|
|
325
|
+
stateConnected: lookups.stateConnected !== undefined &&
|
|
326
|
+
lookups.stateConnected.projectDir === root
|
|
327
|
+
? lookups.stateConnected.connected
|
|
328
|
+
: undefined,
|
|
322
329
|
});
|
|
323
330
|
};
|
|
324
331
|
await runPalette({
|
|
@@ -328,10 +335,17 @@ async function openPalette(startPath) {
|
|
|
328
335
|
title: chrome.title,
|
|
329
336
|
issues: collectIssues(),
|
|
330
337
|
refreshIssues: collectIssues,
|
|
331
|
-
// First paint reuses the
|
|
332
|
-
layout: layoutFor(chrome
|
|
333
|
-
// After a command the plan can change (sign-in, upgrade)
|
|
334
|
-
|
|
338
|
+
// First paint reuses the lookups already made for the title.
|
|
339
|
+
layout: layoutFor(chrome),
|
|
340
|
+
// After a command the plan can change (sign-in, upgrade), and so can the
|
|
341
|
+
// state (the command may have been the connect); look both up again.
|
|
342
|
+
refreshLayout: async () => {
|
|
343
|
+
const [unpaidPlan, stateConnected] = await Promise.all([
|
|
344
|
+
resolveUnpaidPlan(),
|
|
345
|
+
resolveStateConnected(),
|
|
346
|
+
]);
|
|
347
|
+
return layoutFor({ unpaidPlan, stateConnected });
|
|
348
|
+
},
|
|
335
349
|
});
|
|
336
350
|
}
|
|
337
351
|
/**
|
|
@@ -342,19 +356,39 @@ async function openPalette(startPath) {
|
|
|
342
356
|
async function paletteChrome() {
|
|
343
357
|
const base = `${BRAND} cargo-ai ${version}`;
|
|
344
358
|
if (isSignedIn() === false) {
|
|
345
|
-
return { title: base, unpaidPlan: false };
|
|
359
|
+
return { title: base, unpaidPlan: false, stateConnected: undefined };
|
|
346
360
|
}
|
|
347
361
|
const api = getApi();
|
|
348
|
-
|
|
362
|
+
// The state lookup rides alongside the two the title already waits for, so
|
|
363
|
+
// it adds no round-trip of its own to the first paint.
|
|
364
|
+
const [name, subscription, stateConnected] = await Promise.all([
|
|
349
365
|
fetchWorkspaceName(api),
|
|
350
366
|
fetchSubscription(api),
|
|
367
|
+
resolveStateConnected(),
|
|
351
368
|
]);
|
|
352
369
|
const creditsLeft = subscription === undefined ? undefined : creditsLeftOf(subscription);
|
|
353
370
|
return {
|
|
354
371
|
title: `${base}${formatWorkspaceSuffix(name, creditsLeft)}`,
|
|
355
372
|
unpaidPlan: subscription === undefined ? false : isUnpaidPlan(subscription),
|
|
373
|
+
stateConnected,
|
|
356
374
|
};
|
|
357
375
|
}
|
|
376
|
+
/**
|
|
377
|
+
* Best-effort, like the plan: whether the project the palette is standing in
|
|
378
|
+
* deploys from GitHub. Undefined outside a project, signed out, or when the
|
|
379
|
+
* lookup could not tell, all of which leave "Connect to GitHub" unpinned.
|
|
380
|
+
*/
|
|
381
|
+
async function resolveStateConnected() {
|
|
382
|
+
if (isSignedIn() === false) {
|
|
383
|
+
return undefined;
|
|
384
|
+
}
|
|
385
|
+
const projectDir = findProjectDir(process.cwd());
|
|
386
|
+
if (projectDir === undefined) {
|
|
387
|
+
return undefined;
|
|
388
|
+
}
|
|
389
|
+
const connected = await fetchStateConnected(getApi(), projectDir);
|
|
390
|
+
return connected === undefined ? undefined : { projectDir, connected };
|
|
391
|
+
}
|
|
358
392
|
/**
|
|
359
393
|
* Best-effort: true only when we can see an Orb $0 plan. A failed lookup or a
|
|
360
394
|
* signed-out session leaves the pin off rather than guessing.
|
package/build/paletteLayout.d.ts
CHANGED
|
@@ -15,6 +15,13 @@ export type PaletteLayoutInput = {
|
|
|
15
15
|
* false leaves it in the last section only.
|
|
16
16
|
*/
|
|
17
17
|
unpaidPlan?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Whether the project's deploy state is connected to its GitHub repository.
|
|
20
|
+
* Only `false` pins "Connect to GitHub": undefined means the lookup could not
|
|
21
|
+
* say (no state yet, offline, timed out), and a row offered on a guess is a
|
|
22
|
+
* row that fails when picked.
|
|
23
|
+
*/
|
|
24
|
+
stateConnected?: boolean;
|
|
18
25
|
};
|
|
19
26
|
export declare function buildPaletteLayout(input: PaletteLayoutInput): PaletteLayout;
|
|
20
27
|
/**
|
|
@@ -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;AAgF3B,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,SAAS,WAAW,EAAE,CAAC;IAC/B,mFAAmF;IACnF,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B;;;;OAIG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,kBAAkB,GAAG,aAAa,CAS3E;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,kBAAkB,GAAG,SAAS,EAAE,CAmFjE"}
|
package/build/paletteLayout.js
CHANGED
|
@@ -16,6 +16,7 @@ const CODE = " code";
|
|
|
16
16
|
const ADD = " add";
|
|
17
17
|
const DEPLOY = " deploy";
|
|
18
18
|
const BOOK_DEMO = " book-demo";
|
|
19
|
+
const CONNECT = " connect";
|
|
19
20
|
/**
|
|
20
21
|
* `start` runs most of these; the pinned row is the shortcut to one of them.
|
|
21
22
|
* The exceptions are "Add" and "Deploy", which run `project add` and `project
|
|
@@ -139,7 +140,25 @@ export function pinnedRows(input) {
|
|
|
139
140
|
},
|
|
140
141
|
]
|
|
141
142
|
: [];
|
|
143
|
+
// Above everything, even Ask: a project deployed from a laptop has no review
|
|
144
|
+
// and no record of who changed what, and the step that fixes that is one
|
|
145
|
+
// command nobody guesses the name of. It disappears once taken (the layout
|
|
146
|
+
// is rebuilt after every command), so it is never a permanent tenant of the
|
|
147
|
+
// top row.
|
|
148
|
+
const connectRow = input.projectDir !== undefined && input.stateConnected === false
|
|
149
|
+
? [
|
|
150
|
+
{
|
|
151
|
+
value: CONNECT,
|
|
152
|
+
label: "Connect to GitHub",
|
|
153
|
+
hint: "review every change in a pull request; merging deploys",
|
|
154
|
+
// `--dir` for the same reason as Add and Deploy: connect the
|
|
155
|
+
// project the palette found, not whatever the cwd happens to be.
|
|
156
|
+
argv: ["project", "state", "connect", "--dir", input.projectDir],
|
|
157
|
+
},
|
|
158
|
+
]
|
|
159
|
+
: [];
|
|
142
160
|
return [
|
|
161
|
+
...connectRow,
|
|
143
162
|
{
|
|
144
163
|
value: ASK,
|
|
145
164
|
label: "Ask Cargo",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cargo-ai/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.129",
|
|
4
4
|
"mcpName": "io.github.getcargohq/cargo",
|
|
5
5
|
"private": false,
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"@ai-sdk/harness-claude-code": "1.0.148",
|
|
77
77
|
"@cargo-ai/api": "^1.0.101",
|
|
78
78
|
"@cargo-ai/app-sdk": "^1.0.11",
|
|
79
|
-
"@cargo-ai/cdk": "^1.0.
|
|
79
|
+
"@cargo-ai/cdk": "^1.0.122",
|
|
80
80
|
"@cargo-ai/types": "^1.0.103",
|
|
81
81
|
"@cargo-ai/utils": "^1.0.35",
|
|
82
82
|
"@cargo-ai/worker-sdk": "^1.0.21",
|