@phnx-labs/agents-cli 1.23.16 → 1.23.18
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/CHANGELOG.md +75 -0
- package/README.md +140 -165
- package/dist/bootstrap.js +10 -16
- package/dist/cli/command-registry.d.ts +1 -2
- package/dist/cli/command-registry.js +1 -10
- package/dist/commands/accounts.js +7 -7
- package/dist/commands/cloud-transcripts.d.ts +0 -1
- package/dist/commands/cloud-transcripts.js +2 -2
- package/dist/commands/cloud.js +1 -1
- package/dist/commands/config.js +0 -4
- package/dist/commands/cost.js +1 -1
- package/dist/commands/daemon-index.js +0 -1
- package/dist/commands/detach.d.ts +1 -1
- package/dist/commands/detach.js +5 -5
- package/dist/commands/exec.js +10 -22
- package/dist/commands/feed.d.ts +1 -1
- package/dist/commands/feed.js +3 -3
- package/dist/commands/focus.d.ts +1 -4
- package/dist/commands/focus.js +12 -13
- package/dist/commands/fork.d.ts +0 -1
- package/dist/commands/fork.js +7 -16
- package/dist/commands/harness-wizard.js +1 -1
- package/dist/commands/harness.js +1 -1
- package/dist/commands/insights.d.ts +0 -1
- package/dist/commands/insights.js +3 -7
- package/dist/commands/open.js +1 -1
- package/dist/commands/output.js +1 -1
- package/dist/commands/profiles.d.ts +1 -1
- package/dist/commands/profiles.js +2 -2
- package/dist/commands/projects.js +1 -1
- package/dist/commands/prune.js +1 -1
- package/dist/commands/ps.d.ts +0 -1
- package/dist/commands/ps.js +63 -18
- package/dist/commands/routines.js +1 -1
- package/dist/commands/send.js +1 -1
- package/dist/commands/sessions-backfill.d.ts +0 -1
- package/dist/commands/sessions-backfill.js +3 -6
- package/dist/commands/sessions-browser.d.ts +0 -10
- package/dist/commands/sessions-browser.js +19 -25
- package/dist/commands/sessions-migrate.d.ts +2 -2
- package/dist/commands/sessions-migrate.js +13 -13
- package/dist/commands/sessions-optimize.d.ts +0 -1
- package/dist/commands/sessions-optimize.js +0 -3
- package/dist/commands/sessions-picker.js +11 -11
- package/dist/commands/sessions-resume.d.ts +16 -15
- package/dist/commands/sessions-resume.js +101 -269
- package/dist/commands/sessions-stats.d.ts +0 -1
- package/dist/commands/sessions-stats.js +5 -8
- package/dist/commands/sessions-stop.d.ts +1 -1
- package/dist/commands/sessions-stop.js +6 -6
- package/dist/commands/sessions-trace.d.ts +1 -1
- package/dist/commands/sessions-trace.js +40 -17
- package/dist/commands/sessions-watch.js +2 -2
- package/dist/commands/sessions.test-fixture.d.ts +1 -0
- package/dist/commands/sessions.test-fixture.js +14 -0
- package/dist/commands/setup-browser.js +4 -4
- package/dist/commands/setup-computer.js +4 -4
- package/dist/commands/setup-fleet.js +1 -1
- package/dist/commands/setup-preferences.js +1 -1
- package/dist/commands/{sessions-backup-setup.d.ts → setup-session-backup.d.ts} +2 -2
- package/dist/commands/{sessions-backup-setup.js → setup-session-backup.js} +8 -8
- package/dist/commands/setup.js +3 -1
- package/dist/commands/ssh.js +4 -5
- package/dist/commands/sync.js +1 -1
- package/dist/commands/teams.js +2 -2
- package/dist/commands/utils.d.ts +0 -1
- package/dist/commands/utils.js +0 -10
- package/dist/index.js +0 -71
- package/dist/lib/accounting/rotate.js +1 -1
- package/dist/lib/analytics/mix-commands.js +1 -1
- package/dist/lib/auth-mint.js +2 -2
- package/dist/lib/browser-client.d.ts +0 -1
- package/dist/lib/browser-client.js +0 -3
- package/dist/lib/cloud/antigravity.js +1 -1
- package/dist/lib/cloud/cursor.js +3 -3
- package/dist/lib/cloudflare/creds.js +2 -2
- package/dist/lib/computer/context.d.ts +4 -21
- package/dist/lib/computer/context.js +3 -24
- package/dist/lib/computer/policy.d.ts +0 -10
- package/dist/lib/computer/policy.js +0 -28
- package/dist/lib/computer-client.d.ts +0 -44
- package/dist/lib/computer-client.js +17 -121
- package/dist/lib/config-keys.d.ts +1 -1
- package/dist/lib/config-keys.js +0 -3
- package/dist/lib/crabbox/cli.js +1 -1
- package/dist/lib/device-config.js +5 -28
- package/dist/lib/devices/connect.d.ts +1 -1
- package/dist/lib/devices/connect.js +3 -6
- package/dist/lib/devices/doctor-findings.d.ts +2 -1
- package/dist/lib/devices/doctor-findings.js +4 -4
- package/dist/lib/exec.js +1 -1
- package/dist/lib/feed/activity.js +1 -1
- package/dist/lib/fleet/apply.js +1 -1
- package/dist/lib/help.d.ts +0 -1
- package/dist/lib/help.js +2 -10
- package/dist/lib/hosts/option.js +1 -1
- package/dist/lib/hosts/passthrough.d.ts +0 -1
- package/dist/lib/hosts/passthrough.js +2 -26
- package/dist/lib/hosts/reconnect.js +5 -5
- package/dist/lib/hosts/remote-cmd.d.ts +3 -5
- package/dist/lib/hosts/remote-cmd.js +15 -20
- package/dist/lib/hosts/remote-session-id.js +1 -1
- package/dist/lib/installations/active-check.js +1 -1
- package/dist/lib/installations/migrate.js +4 -15
- package/dist/lib/installations/versions.js +1 -1
- package/dist/lib/launch-log.js +3 -6
- package/dist/lib/owner-notify.d.ts +1 -6
- package/dist/lib/owner-notify.js +0 -2
- package/dist/lib/paths.d.ts +0 -1
- package/dist/lib/paths.js +0 -8
- package/dist/lib/permissions.js +1 -1
- package/dist/lib/redact.d.ts +0 -1
- package/dist/lib/redact.js +0 -4
- package/dist/lib/remote-agents-json.d.ts +3 -1
- package/dist/lib/remote-agents-json.js +8 -6
- package/dist/lib/reserved-stores.js +1 -1
- package/dist/lib/scheduling/routines.d.ts +0 -1
- package/dist/lib/scheduling/routines.js +1 -1
- package/dist/lib/session/active.d.ts +1 -1
- package/dist/lib/session/db.js +3 -3
- package/dist/lib/session/detached.d.ts +0 -1
- package/dist/lib/session/detached.js +0 -23
- package/dist/lib/session/discover.d.ts +2 -2
- package/dist/lib/session/presentation.d.ts +0 -7
- package/dist/lib/session/presentation.js +4 -4
- package/dist/lib/session/projection.js +1 -1
- package/dist/lib/session/remote/remote-list.d.ts +2 -0
- package/dist/lib/session/remote/remote-list.js +3 -2
- package/dist/lib/session/remote/watch.js +4 -5
- package/dist/lib/session/remote-active.js +1 -1
- package/dist/lib/session/resume-command.d.ts +0 -1
- package/dist/lib/session/resume-command.js +1 -4
- package/dist/lib/session/resume-owner.d.ts +0 -2
- package/dist/lib/session/resume-owner.js +0 -6
- package/dist/lib/session/selection.d.ts +4 -5
- package/dist/lib/session/selection.js +2 -2
- package/dist/lib/session/sync/config.d.ts +0 -25
- package/dist/lib/session/sync/config.js +0 -62
- package/dist/lib/session/sync/managed-config.d.ts +0 -1
- package/dist/lib/session/sync/managed-config.js +0 -3
- package/dist/lib/session/sync/worker-template.js +1 -1
- package/dist/lib/sessions-client.d.ts +0 -16
- package/dist/lib/sessions-client.js +1 -187
- package/dist/lib/startup/command-registry.d.ts +2 -0
- package/dist/lib/startup/command-registry.js +36 -3
- package/dist/lib/startup/root-command.d.ts +0 -1
- package/dist/lib/startup/root-command.js +0 -21
- package/dist/lib/sync-umbrella.js +1 -1
- package/dist/lib/terminal/resolve.js +1 -1
- package/dist/lib/watchdog/rotate.js +1 -1
- package/dist/lib/watchdog/watchdog.d.ts +1 -1
- package/dist/lib/watchdog/watchdog.js +2 -2
- package/package.json +1 -1
- package/dist/commands/browser.d.ts +0 -7
- package/dist/commands/browser.js +0 -139
- package/dist/commands/computer.d.ts +0 -48
- package/dist/commands/computer.js +0 -244
- package/dist/commands/resume.d.ts +0 -23
- package/dist/commands/resume.js +0 -158
- package/dist/commands/secrets-passthrough.d.ts +0 -3
- package/dist/commands/secrets-passthrough.js +0 -52
- package/dist/commands/sessions-bookmark.d.ts +0 -2
- package/dist/commands/sessions-bookmark.js +0 -92
- package/dist/commands/sessions-export.d.ts +0 -31
- package/dist/commands/sessions-export.js +0 -409
- package/dist/commands/sessions-import.d.ts +0 -6
- package/dist/commands/sessions-import.js +0 -343
- package/dist/commands/sessions-inject.d.ts +0 -14
- package/dist/commands/sessions-inject.js +0 -143
- package/dist/commands/sessions-picker-factory.d.ts +0 -24
- package/dist/commands/sessions-picker-factory.js +0 -59
- package/dist/commands/sessions-render.d.ts +0 -11
- package/dist/commands/sessions-render.js +0 -119
- package/dist/commands/sessions-share.d.ts +0 -15
- package/dist/commands/sessions-share.js +0 -171
- package/dist/commands/sessions.d.ts +0 -122
- package/dist/commands/sessions.js +0 -1760
- package/dist/lib/address.d.ts +0 -39
- package/dist/lib/address.js +0 -128
- package/dist/lib/computer/record.d.ts +0 -6
- package/dist/lib/computer/record.js +0 -25
- package/dist/lib/openclaw-keychain.d.ts +0 -43
- package/dist/lib/openclaw-keychain.js +0 -227
- package/dist/lib/session/bundle.d.ts +0 -76
- package/dist/lib/session/bundle.js +0 -146
- package/dist/lib/session/remote/remote-bundle.d.ts +0 -7
- package/dist/lib/session/remote/remote-bundle.js +0 -40
- package/dist/lib/session/remote/remote.d.ts +0 -35
- package/dist/lib/session/remote/remote.js +0 -198
- package/dist/lib/session/remote-bundle.d.ts +0 -1
- package/dist/lib/session/remote-bundle.js +0 -1
- package/dist/lib/session/remote.d.ts +0 -1
- package/dist/lib/session/remote.js +0 -1
- package/dist/lib/session/sync/agents.d.ts +0 -24
- package/dist/lib/session/sync/agents.js +0 -0
- package/dist/lib/session/sync/backend.d.ts +0 -22
- package/dist/lib/session/sync/backend.js +0 -44
- package/dist/lib/session/sync/managed-key.d.ts +0 -5
- package/dist/lib/session/sync/managed-key.js +0 -87
- package/dist/lib/session/sync/net-client.d.ts +0 -29
- package/dist/lib/session/sync/net-client.js +0 -87
- package/dist/lib/session/sync/r2.d.ts +0 -20
- package/dist/lib/session/sync/r2.js +0 -103
- package/dist/lib/session/sync/transcript-crypto.d.ts +0 -41
- package/dist/lib/session/sync/transcript-crypto.js +0 -115
|
@@ -14,8 +14,34 @@ import { diffTrajectories } from '@phnx-labs/sessions-cli/reader';
|
|
|
14
14
|
import { buildLineage } from '@phnx-labs/sessions-cli/reader';
|
|
15
15
|
import { renderTrajectoryHtml, renderTrajectoryCompareHtml, renderLineageHtml } from '@phnx-labs/sessions-cli/reader';
|
|
16
16
|
import { renderTrajectoryText, renderTrajectoryCompareText, renderLineageText } from '@phnx-labs/sessions-cli/reader';
|
|
17
|
-
import { parseAgentFilter } from '../lib/session/selection.js';
|
|
18
|
-
import {
|
|
17
|
+
import { filterSessionsByQuery, parseAgentFilter } from '../lib/session/selection.js';
|
|
18
|
+
import { looksLikeSessionId, resolveSessionById } from '../lib/session/discover.js';
|
|
19
|
+
import { findSessionsById } from '../lib/session/db.js';
|
|
20
|
+
export function selectSessions(metas, selectors) {
|
|
21
|
+
if (selectors.length === 0)
|
|
22
|
+
return metas;
|
|
23
|
+
const byId = [];
|
|
24
|
+
const unmatched = [];
|
|
25
|
+
for (const sel of selectors) {
|
|
26
|
+
const trimmed = sel.trim();
|
|
27
|
+
const hits = resolveSessionById(metas, trimmed);
|
|
28
|
+
const resolved = hits.length > 0 || !looksLikeSessionId(trimmed) ? hits : findSessionsById(trimmed);
|
|
29
|
+
if (resolved.length > 0)
|
|
30
|
+
byId.push(...resolved);
|
|
31
|
+
else
|
|
32
|
+
unmatched.push(trimmed);
|
|
33
|
+
}
|
|
34
|
+
if (byId.length > 0 && unmatched.length === 0) {
|
|
35
|
+
const seen = new Set();
|
|
36
|
+
return byId.filter(s => (seen.has(s.id) ? false : (seen.add(s.id), true)));
|
|
37
|
+
}
|
|
38
|
+
const missingIds = unmatched.filter(looksLikeSessionId);
|
|
39
|
+
if (missingIds.length > 0) {
|
|
40
|
+
process.stderr.write(chalk.red(`No session with id ${missingIds.join(', ')} on this machine.\n`));
|
|
41
|
+
return [];
|
|
42
|
+
}
|
|
43
|
+
return filterSessionsByQuery(metas, selectors.join(' '));
|
|
44
|
+
}
|
|
19
45
|
export const SESSIONS_TRACE_SCHEMA_VERSION = 1;
|
|
20
46
|
export function buildTraceEnvelope(models) {
|
|
21
47
|
return {
|
|
@@ -159,37 +185,37 @@ function configureTraceCommand(cmd) {
|
|
|
159
185
|
.option('-a, --agent <agent>', 'Filter by agent type (e.g. claude, codex)');
|
|
160
186
|
setHelpSections(cmd, {
|
|
161
187
|
examples: `# Open one session's trajectory in a browser (a person at a terminal)
|
|
162
|
-
agents
|
|
188
|
+
agents trace a1b2c3d4
|
|
163
189
|
|
|
164
|
-
# The compact text trajectory an agent reads in-context
|
|
165
|
-
|
|
190
|
+
# The compact text trajectory an agent reads in-context (standalone sessions CLI)
|
|
191
|
+
sessions trace a1b2c3d4
|
|
166
192
|
|
|
167
193
|
# Just the failures and their neighbours — for a triaging agent
|
|
168
|
-
|
|
194
|
+
sessions trace a1b2c3d4 --errors-only
|
|
169
195
|
|
|
170
196
|
# What the agent said it was doing, step by step — the sidebar's timeline as text
|
|
171
|
-
agents
|
|
197
|
+
agents trace a1b2c3d4 --steps
|
|
172
198
|
|
|
173
199
|
# The stable JSON envelope for the AGI EXT Fleet panel or a tool
|
|
174
|
-
agents
|
|
200
|
+
agents trace a1b2c3d4 --json
|
|
175
201
|
|
|
176
202
|
# Write the self-contained HTML to a file without opening it
|
|
177
|
-
agents
|
|
203
|
+
agents trace a1b2c3d4 --html -o trace.html --no-open
|
|
178
204
|
|
|
179
205
|
# Two selectors — compare where a passing run and a failing one diverge
|
|
180
|
-
agents
|
|
206
|
+
agents trace a1b2c3d4 e5f6a7b8
|
|
181
207
|
|
|
182
208
|
# The compare, as text — for a triaging agent comparing harnesses
|
|
183
|
-
agents
|
|
209
|
+
agents trace a1b2c3d4 e5f6a7b8 --text
|
|
184
210
|
|
|
185
211
|
# The team an orchestrator spawned, as a graph (one selector + --tree)
|
|
186
|
-
agents
|
|
212
|
+
agents trace a1b2c3d4 --tree
|
|
187
213
|
|
|
188
214
|
# The same lineage as an indented tree an agent can read
|
|
189
|
-
agents
|
|
215
|
+
agents trace a1b2c3d4 --tree --text`,
|
|
190
216
|
notes: `Audience auto-select: with no --html/--text/--json, HTML opens on a TTY (a person) and
|
|
191
217
|
the compact text trajectory prints when piped or headless (an agent). The HTML is self-contained
|
|
192
|
-
(no CDN, no external asset) and redacted by default, as safe to share as
|
|
218
|
+
(no CDN, no external asset) and redacted by default, as safe to share as a 'sessions share' page.
|
|
193
219
|
|
|
194
220
|
One selector renders the single trajectory; exactly two selectors compare them (a shared time axis,
|
|
195
221
|
the first divergence point, and the step-level diff); one selector with --tree renders its lineage —
|
|
@@ -375,9 +401,6 @@ Three or more selectors, and --tree with more than one selector, fail loud.`,
|
|
|
375
401
|
});
|
|
376
402
|
return cmd;
|
|
377
403
|
}
|
|
378
|
-
export function registerSessionsTraceCommand(sessionsCmd) {
|
|
379
|
-
configureTraceCommand(sessionsCmd.command('trace <selectors...>'));
|
|
380
|
-
}
|
|
381
404
|
export function registerTraceCommand(program) {
|
|
382
405
|
configureTraceCommand(program.command('trace <selectors...>'));
|
|
383
406
|
}
|
|
@@ -9,10 +9,10 @@ export function registerSessionsWatchCommand(parent) {
|
|
|
9
9
|
setHelpSections(command, {
|
|
10
10
|
examples: `
|
|
11
11
|
# Subscribe to session changes for a long-lived UI consumer
|
|
12
|
-
agents
|
|
12
|
+
agents ps watch --json
|
|
13
13
|
|
|
14
14
|
# Subscribe only to this machine
|
|
15
|
-
agents
|
|
15
|
+
agents ps watch --json --local
|
|
16
16
|
`,
|
|
17
17
|
notes: `
|
|
18
18
|
- Each line is one versioned reset, upsert, remove, scope, or heartbeat envelope.
|
|
@@ -8,6 +8,7 @@ export declare function writeClaudeSession(tempHome: string, projectKey: string,
|
|
|
8
8
|
export declare function writeCodexSession(tempHome: string, sessionId: string, cwd: string, prompt: string, timestamp: string): void;
|
|
9
9
|
export declare function writeOpenClawSetup(tempHome: string, version?: string): string;
|
|
10
10
|
export declare function runAgents(args: string[], cwd: string, home: string, envOverrides?: Record<string, string>): import("node:child_process").SpawnSyncReturns<string>;
|
|
11
|
+
export declare function indexSessions(cwd: string, home: string): import("node:child_process").SpawnSyncReturns<string>;
|
|
11
12
|
export declare function outputOf(result: {
|
|
12
13
|
stdout: string;
|
|
13
14
|
stderr: string;
|
|
@@ -167,6 +167,20 @@ export function runAgents(args, cwd, home, envOverrides = {}) {
|
|
|
167
167
|
encoding: 'utf-8',
|
|
168
168
|
});
|
|
169
169
|
}
|
|
170
|
+
// The daemon tick's incremental scan, the only writer of the index on a peer.
|
|
171
|
+
export function indexSessions(cwd, home) {
|
|
172
|
+
const script = [
|
|
173
|
+
"const { scanSessionsIncremental } = await import('./src/lib/session/discover.ts');",
|
|
174
|
+
"const { closeDB } = await import('./src/lib/session/db.ts');",
|
|
175
|
+
'await scanSessionsIncremental();',
|
|
176
|
+
'closeDB();',
|
|
177
|
+
].join(' ');
|
|
178
|
+
return spawnSync(process.execPath, ['--import', tsxLoaderUrl, '--input-type=module', '--eval', script], {
|
|
179
|
+
cwd: repoRoot,
|
|
180
|
+
env: { ...process.env, HOME: home, USERPROFILE: home, PWD: cwd },
|
|
181
|
+
encoding: 'utf-8',
|
|
182
|
+
});
|
|
183
|
+
}
|
|
170
184
|
export function outputOf(result) {
|
|
171
185
|
return `${result.stdout}${result.stderr}`;
|
|
172
186
|
}
|
|
@@ -39,7 +39,7 @@ export async function runBrowserWizard() {
|
|
|
39
39
|
await runBrowserVerb(['use']);
|
|
40
40
|
const chosen = configuredDefaultProfile();
|
|
41
41
|
if (!chosen) {
|
|
42
|
-
console.log(chalk.dim('No default profile chosen. Run `
|
|
42
|
+
console.log(chalk.dim('No default profile chosen. Run `browser use <name>` later to set one.'));
|
|
43
43
|
return false;
|
|
44
44
|
}
|
|
45
45
|
printOnboardingNextStep(chosen);
|
|
@@ -48,14 +48,14 @@ export async function runBrowserWizard() {
|
|
|
48
48
|
function printOnboardingNextStep(name) {
|
|
49
49
|
console.log(chalk.bold('\nOne manual step left:'));
|
|
50
50
|
console.log(' ' +
|
|
51
|
-
chalk.cyan(`
|
|
51
|
+
chalk.cyan(`browser start --profile ${name}`) +
|
|
52
52
|
chalk.dim(' # finish the browser first-run + sign in to any sites you want automated'));
|
|
53
|
-
console.log(chalk.dim(` Then check it's ready:
|
|
53
|
+
console.log(chalk.dim(` Then check it's ready: browser profiles doctor ${name}`));
|
|
54
54
|
}
|
|
55
55
|
export function registerSetupBrowserCommand(setupCmd) {
|
|
56
56
|
setupCmd
|
|
57
57
|
.command('browser')
|
|
58
|
-
.description('Set up `
|
|
58
|
+
.description('Set up the standalone `browser` CLI — install it, seed profiles, and pick this machine\'s default.')
|
|
59
59
|
.option('--install-only', 'Install the standalone Browser CLI without changing profiles or starting a browser')
|
|
60
60
|
.option('--terminal [backend]', 'Open interactive setup in a detected or selected terminal')
|
|
61
61
|
.action(async (options) => {
|
|
@@ -19,7 +19,7 @@ function openPane(pane) {
|
|
|
19
19
|
export async function runComputerWizard() {
|
|
20
20
|
if (os.platform() !== 'darwin') {
|
|
21
21
|
console.log(chalk.yellow('`agents setup computer` configures the macOS helper (local control).'));
|
|
22
|
-
console.log(chalk.dim('On Windows, provision a remote host from a Mac/Linux box instead: `
|
|
22
|
+
console.log(chalk.dim('On Windows, provision a remote host from a Mac/Linux box instead: `computer setup --device <device>`.'));
|
|
23
23
|
return false;
|
|
24
24
|
}
|
|
25
25
|
try {
|
|
@@ -67,7 +67,7 @@ export async function runComputerWizard() {
|
|
|
67
67
|
openPane(SCREEN_PANE);
|
|
68
68
|
if (!trusted) {
|
|
69
69
|
console.log(chalk.yellow('\nAccessibility not granted yet.'));
|
|
70
|
-
console.log(chalk.dim('Finish both grants in System Settings, then run: ') + chalk.cyan('
|
|
70
|
+
console.log(chalk.dim('Finish both grants in System Settings, then run: ') + chalk.cyan('computer start'));
|
|
71
71
|
console.log(chalk.dim(' Accessibility: System Settings > Privacy & Security > Accessibility'));
|
|
72
72
|
console.log(chalk.dim(' Screen Recording: System Settings > Privacy & Security > Screen Recording'));
|
|
73
73
|
}
|
|
@@ -81,7 +81,7 @@ export async function runComputerWizard() {
|
|
|
81
81
|
console.log(chalk.dim(' allow:'));
|
|
82
82
|
console.log(chalk.dim(' - "Computer(com.apple.finder)"'));
|
|
83
83
|
console.log(chalk.dim(' - "Computer(com.apple.notes)"'));
|
|
84
|
-
console.log(chalk.dim(' Then reload: ') + chalk.cyan('
|
|
84
|
+
console.log(chalk.dim(' Then reload: ') + chalk.cyan('computer reload'));
|
|
85
85
|
return trusted;
|
|
86
86
|
}
|
|
87
87
|
async function pollForTrust() {
|
|
@@ -107,7 +107,7 @@ async function pollForTrust() {
|
|
|
107
107
|
export function registerSetupComputerCommand(setupCmd) {
|
|
108
108
|
setupCmd
|
|
109
109
|
.command('computer')
|
|
110
|
-
.description('Set up `
|
|
110
|
+
.description('Set up `computer` (macOS) — install the signed helper and grant control permissions.')
|
|
111
111
|
.option('--install-only', 'Install the standalone Computer CLI without starting the helper or changing permissions')
|
|
112
112
|
.option('--terminal [backend]', 'Open interactive setup in a detected or selected terminal')
|
|
113
113
|
.action(async (options) => {
|
|
@@ -73,7 +73,7 @@ async function resolveInteractiveChoices(opts) {
|
|
|
73
73
|
default: 'key',
|
|
74
74
|
choices: [
|
|
75
75
|
{ name: 'key — use your SSH agent / on-disk public keys', value: 'key' },
|
|
76
|
-
{ name: 'password — read the login password from an
|
|
76
|
+
{ name: 'password — read the login password from an secrets bundle', value: 'password' },
|
|
77
77
|
],
|
|
78
78
|
});
|
|
79
79
|
return {
|
|
@@ -58,7 +58,7 @@ export async function maybePickBrowserProfile(deps = {}) {
|
|
|
58
58
|
if (!chosen)
|
|
59
59
|
return false;
|
|
60
60
|
console.log(chalk.green(`Browser: '${chosen}'`) +
|
|
61
|
-
chalk.dim(' — this machine\'s default (
|
|
61
|
+
chalk.dim(' — this machine\'s default (browser use to change).'));
|
|
62
62
|
return true;
|
|
63
63
|
}
|
|
64
64
|
export async function runPreferencesStep() {
|
|
@@ -7,6 +7,6 @@ interface BackupSetupOptions {
|
|
|
7
7
|
token?: string;
|
|
8
8
|
domain: string;
|
|
9
9
|
}
|
|
10
|
-
export declare function
|
|
11
|
-
export declare function
|
|
10
|
+
export declare function handleSessionBackupSetup(opts: BackupSetupOptions): Promise<void>;
|
|
11
|
+
export declare function registerSetupSessionBackupCommand(setupCmd: Command): void;
|
|
12
12
|
export {};
|
|
@@ -4,7 +4,7 @@ import { PHOENIX_ID_BASE } from '../lib/identity/client.js';
|
|
|
4
4
|
import { provisionSessions } from '../lib/session/sync/provision.js';
|
|
5
5
|
import { DEFAULT_SESSIONS_BUCKET_NAME, DEFAULT_SESSIONS_DOMAIN, DEFAULT_SESSIONS_WORKER_NAME, } from '../lib/session/sync/managed-config.js';
|
|
6
6
|
import { setHelpSections } from '../lib/help.js';
|
|
7
|
-
export async function
|
|
7
|
+
export async function handleSessionBackupSetup(opts) {
|
|
8
8
|
const { input } = await import('@inquirer/prompts');
|
|
9
9
|
const { apiToken, accountId: bundledAccountId } = readCloudflareCreds(opts.bundle, {
|
|
10
10
|
apiToken: opts.token,
|
|
@@ -22,18 +22,18 @@ export async function handleSessionsBackupSetup(opts) {
|
|
|
22
22
|
phoenixIdBase: PHOENIX_ID_BASE,
|
|
23
23
|
});
|
|
24
24
|
console.log(chalk.green(`Managed session-backup endpoint ready → ${chalk.bold(result.baseUrl)}`));
|
|
25
|
-
console.log(chalk.dim('Signed-in users now back up with `
|
|
25
|
+
console.log(chalk.dim('Signed-in users now back up with `sessions export --to-r2` — no r2.backups bucket.'));
|
|
26
26
|
}
|
|
27
27
|
const BACKUP_SETUP_EXAMPLES = `
|
|
28
|
-
$
|
|
28
|
+
$ secrets exec cloudflare -- agents setup session-backup
|
|
29
29
|
Provision the managed session-backup Worker + R2 bucket (creds from the bundle).
|
|
30
30
|
|
|
31
|
-
$ agents
|
|
31
|
+
$ agents setup session-backup --account <id> --domain sessions.example.com
|
|
32
32
|
Provision against a private account service and custom domain.
|
|
33
33
|
`.trimStart();
|
|
34
|
-
export function
|
|
35
|
-
const cmd =
|
|
36
|
-
.command('backup
|
|
34
|
+
export function registerSetupSessionBackupCommand(setupCmd) {
|
|
35
|
+
const cmd = setupCmd
|
|
36
|
+
.command('session-backup')
|
|
37
37
|
.description('(operator) Provision the managed session-backup Worker + R2 bucket — NOT a per-user step; signing in with `agents auth login` backs sessions up with zero setup')
|
|
38
38
|
.option('--bundle <name>', 'secrets bundle holding the Cloudflare API token', DEFAULT_CF_BUNDLE)
|
|
39
39
|
.option('--worker <name>', 'Worker name', DEFAULT_SESSIONS_WORKER_NAME)
|
|
@@ -43,7 +43,7 @@ export function registerSessionsBackupSetupCommand(sessionsCmd) {
|
|
|
43
43
|
.option('--domain <host>', 'custom domain to map', DEFAULT_SESSIONS_DOMAIN)
|
|
44
44
|
.action(async (opts) => {
|
|
45
45
|
try {
|
|
46
|
-
await
|
|
46
|
+
await handleSessionBackupSetup(opts);
|
|
47
47
|
}
|
|
48
48
|
catch (err) {
|
|
49
49
|
console.error(chalk.red(err.message));
|
package/dist/commands/setup.js
CHANGED
|
@@ -21,6 +21,7 @@ import { registerSetupTermCommand, runTermWizard, isTermCliInstalled } from './s
|
|
|
21
21
|
import { registerSetupFleetCommand } from './setup-fleet.js';
|
|
22
22
|
import { registerSetupAccountsCommand, runAccountsSetupWizard } from './setup-accounts.js';
|
|
23
23
|
import { registerSetupWatchdogCommand, runWatchdogSetupWizard } from './setup-watchdog.js';
|
|
24
|
+
import { registerSetupSessionBackupCommand } from './setup-session-backup.js';
|
|
24
25
|
import { hasMintedSetupToken } from '../lib/auth-mint.js';
|
|
25
26
|
import { registerAliasCommand } from './alias.js';
|
|
26
27
|
import { registerBetaCommands } from './beta.js';
|
|
@@ -184,7 +185,7 @@ export async function runSetup(program, options = {}) {
|
|
|
184
185
|
.map(i => `${agentLabel(i.agentId)} (${sessionCounts[i.agentId] || 0})`)
|
|
185
186
|
.join(', ');
|
|
186
187
|
console.log(chalk.gray(`\n${totalSessions} sessions available across ${breakdown}`));
|
|
187
|
-
console.log(chalk.cyan('
|
|
188
|
+
console.log(chalk.cyan(' sessions') + chalk.gray(' # browse them'));
|
|
188
189
|
}
|
|
189
190
|
}
|
|
190
191
|
}
|
|
@@ -332,6 +333,7 @@ export function registerSetupCommand(program) {
|
|
|
332
333
|
registerSetupAccountsCommand(setupCmd);
|
|
333
334
|
registerSetupFleetCommand(setupCmd);
|
|
334
335
|
registerSetupWatchdogCommand(setupCmd);
|
|
336
|
+
registerSetupSessionBackupCommand(setupCmd);
|
|
335
337
|
registerAliasCommand(setupCmd);
|
|
336
338
|
registerBetaCommands(setupCmd);
|
|
337
339
|
const urlScheme = setupCmd
|
package/dist/commands/ssh.js
CHANGED
|
@@ -23,7 +23,7 @@ import { clearPendingSentinel } from '../lib/devices/pending.js';
|
|
|
23
23
|
import { getDeviceDiscoveryStatus, setDeviceDiscoveryStatus } from '../lib/devices/discovery-policy.js';
|
|
24
24
|
import { isInteractiveTerminal, isPromptCancelled } from './utils.js';
|
|
25
25
|
import { hostNameFor, renderSshConfig } from '../lib/devices/ssh-config.js';
|
|
26
|
-
import { ASKPASS_BUNDLE_ENV, ASKPASS_KEY_ENV, buildSshInvocation, deviceIdentityArgs, fleetDialTarget,
|
|
26
|
+
import { ASKPASS_BUNDLE_ENV, ASKPASS_KEY_ENV, buildSshInvocation, deviceIdentityArgs, fleetDialTarget, isBrowserDrive, markFleetRemote, writeAskpassShim, } from '../lib/devices/connect.js';
|
|
27
27
|
import { ensureManagedKnownHostsDir, isHostPinned } from '../lib/devices/known-hosts.js';
|
|
28
28
|
import { shouldSyncTerminfo, syncTerminfoToDevice, terminfoHostKey } from '../lib/devices/terminfo.js';
|
|
29
29
|
import { fanOutDevices, fleetHealthSkip, planFleetTargets, remoteFleetTargets, runFleet, runOnDevice, runLocalCommand, skipLabel, upgradeCommand, } from '../lib/devices/fleet.js';
|
|
@@ -261,7 +261,7 @@ function trySshLeasedBox(name, cmd) {
|
|
|
261
261
|
process.exit(res.status ?? 1);
|
|
262
262
|
}
|
|
263
263
|
export function leasedBoxRemoteCmd(cmd) {
|
|
264
|
-
return
|
|
264
|
+
return isBrowserDrive(cmd) ? markFleetRemote(cmd, { shell: 'posix' }) : cmd;
|
|
265
265
|
}
|
|
266
266
|
async function mustGetDevice(name) {
|
|
267
267
|
const d = await getDevice(name);
|
|
@@ -2067,9 +2067,8 @@ launched from — 'agents ssh yosemite-s0' from ~/src/app lands in ~/src/app on
|
|
|
2067
2067
|
the target when it exists, else the remote home. Same portable-cwd rule as
|
|
2068
2068
|
'agents run --device'. Passing a command keeps the remote home.
|
|
2069
2069
|
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
gate applies, same as 'agents browser <verb> --device <name>'.
|
|
2070
|
+
A 'browser …' command is stamped AGENTS_FLEET_REMOTE so the target's
|
|
2071
|
+
browser.remote-control consent gate applies, same as 'browser <verb> --device <name>'.
|
|
2073
2072
|
|
|
2074
2073
|
--argv takes a JSON array of strings and delivers each element as exactly ONE
|
|
2075
2074
|
token on the peer, so a token containing a space, '&', '|', '$' or a quote
|
package/dist/commands/sync.js
CHANGED
|
@@ -113,7 +113,7 @@ export function addSelectorOptions(cmd) {
|
|
|
113
113
|
export function registerSyncCommand(program) {
|
|
114
114
|
const cmd = addHostOption(program.command('sync [agentSpec] [repo]'))
|
|
115
115
|
.summary('Make this machine current, or sync resources into one agent')
|
|
116
|
-
.description('With an [agentSpec], syncs resources (commands, skills, hooks, rules, MCPs, plugins, etc.) into that installed agent version — previews changes and lets you pick. e.g. "claude", "claude@2.1.142", a selector: @latest / @oldest / @pinned (= @default), or @all for every installed version.\n\nAppend a [repo] (or pass --repo) to scope the sync to a single DotAgent repo — system / user / project / <alias>. e.g. "agents sync claude@all system" reconciles only the system repo\'s resources into every installed Claude.\n\nGive a DotAgent repo name ALONE — "agents sync system" / "agents sync user" / "agents sync <alias>" — to git-sync that one repo: git pull --rebase against origin when the tree is clean; when it is dirty, fast-forward anyway if no incoming path is uncommitted, else refuse and name what collided. The user repo and extra aliases also push local commits up; the system repo is a pull-only mirror.\n\nWith NO agent, runs the umbrella verb: fetch the config repos then reconcile them into every installed agent. Secrets are opt-in — add --secrets to pull secret bundles. Session transcripts are queryable live via "
|
|
116
|
+
.description('With an [agentSpec], syncs resources (commands, skills, hooks, rules, MCPs, plugins, etc.) into that installed agent version — previews changes and lets you pick. e.g. "claude", "claude@2.1.142", a selector: @latest / @oldest / @pinned (= @default), or @all for every installed version.\n\nAppend a [repo] (or pass --repo) to scope the sync to a single DotAgent repo — system / user / project / <alias>. e.g. "agents sync claude@all system" reconciles only the system repo\'s resources into every installed Claude.\n\nGive a DotAgent repo name ALONE — "agents sync system" / "agents sync user" / "agents sync <alias>" — to git-sync that one repo: git pull --rebase against origin when the tree is clean; when it is dirty, fast-forward anyway if no incoming path is uncommitted, else refuse and name what collided. The user repo and extra aliases also push local commits up; the system repo is a pull-only mirror.\n\nWith NO agent, runs the umbrella verb: fetch the config repos then reconcile them into every installed agent. Secrets are opt-in — add --secrets to pull secret bundles. Session transcripts are queryable live via "sessions --device <machine>", or moved with "sessions export/import". Also: --cloud (fetch only), --local (reconcile only).\n\n`agents sync status` reports fleet drift (what is drifted, missing, or behind) and can reconcile it — the former top-level `agents status`.')
|
|
117
117
|
.option('--agent <agent>', 'Agent identifier (legacy form; prefer the positional spec)')
|
|
118
118
|
.option('--agent-version <version>', 'Version to sync into (legacy form; prefer "agent@version" or --version)')
|
|
119
119
|
.option('--repo <name>', 'Scope the sync to a single DotAgent repo: system / user / project / <alias> (also accepted as a positional)')
|
package/dist/commands/teams.js
CHANGED
|
@@ -1047,7 +1047,7 @@ export function registerTeamsCommands(program) {
|
|
|
1047
1047
|
`,
|
|
1048
1048
|
notes: `
|
|
1049
1049
|
A team is a named group of agents working in the background on a shared task.
|
|
1050
|
-
Teammate sessions show in '
|
|
1050
|
+
Teammate sessions show in 'sessions --teams' tagged [team/name · mode].
|
|
1051
1051
|
|
|
1052
1052
|
Teammate syntax:
|
|
1053
1053
|
'claude' the default Claude version on this machine
|
|
@@ -1708,7 +1708,7 @@ export function registerTeamsCommands(program) {
|
|
|
1708
1708
|
}
|
|
1709
1709
|
console.log();
|
|
1710
1710
|
}
|
|
1711
|
-
console.log(chalk.gray(`${running.length} teammate${running.length === 1 ? '' : 's'} running. See 'agents
|
|
1711
|
+
console.log(chalk.gray(`${running.length} teammate${running.length === 1 ? '' : 's'} running. See 'agents ps' for the full cross-context view.`));
|
|
1712
1712
|
});
|
|
1713
1713
|
addHostOption(teams.command('start [team]'))
|
|
1714
1714
|
.description('Launch ready teammates independently. Failed launch/placement and blocked --after dependencies persist in status; --watch keeps draining viable DAG branches.')
|
package/dist/commands/utils.d.ts
CHANGED
|
@@ -11,7 +11,6 @@ export interface Surface {
|
|
|
11
11
|
interactive: boolean;
|
|
12
12
|
}
|
|
13
13
|
export declare function resolveSurface(cmd: Command): Surface;
|
|
14
|
-
export declare function normalizeSingleDeviceOption(value: string | string[] | undefined, commandLabel: string): string | undefined;
|
|
15
14
|
export declare function requireInteractiveSelection(action: string, alternatives: string[]): never;
|
|
16
15
|
export declare function requireDestructiveArg(opts: {
|
|
17
16
|
argName: string;
|
package/dist/commands/utils.js
CHANGED
|
@@ -31,16 +31,6 @@ export function resolveSurface(cmd) {
|
|
|
31
31
|
interactive: tty && !json,
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
export function normalizeSingleDeviceOption(value, commandLabel) {
|
|
35
|
-
const list = value == null ? [] : Array.isArray(value) ? value : [value];
|
|
36
|
-
const hosts = list.map((v) => String(v).trim()).filter((v) => v.length > 0);
|
|
37
|
-
if (hosts.length === 0)
|
|
38
|
-
return undefined;
|
|
39
|
-
if (hosts.length > 1) {
|
|
40
|
-
throw new Error(`${commandLabel} targets a single device, but --device named ${hosts.length}: ${hosts.join(', ')}.`);
|
|
41
|
-
}
|
|
42
|
-
return hosts[0];
|
|
43
|
-
}
|
|
44
34
|
export function requireInteractiveSelection(action, alternatives) {
|
|
45
35
|
console.error(chalk.red(`${action} requires an interactive terminal.`));
|
|
46
36
|
if (alternatives.length > 0) {
|
package/dist/index.js
CHANGED
|
@@ -67,76 +67,5 @@ if (process.argv[2] === '__daemon-run') {
|
|
|
67
67
|
}
|
|
68
68
|
process.exit(process.exitCode ?? 0);
|
|
69
69
|
}
|
|
70
|
-
if (process.argv[2] === 'sessions') {
|
|
71
|
-
const forwarded = process.argv.slice(3);
|
|
72
|
-
const { isReadQuery, usesFilterFlags, usesHostFlag, sessionsBinSupportsFilters, sessionsBinSupportsHost, planDeviceHostRead, resolveSessionsBin, invocation, SessionsClientError, SESSIONS_INSTALL_HINT, } = await import('./lib/sessions-client.js');
|
|
73
|
-
let bin = null;
|
|
74
|
-
try {
|
|
75
|
-
bin = resolveSessionsBin();
|
|
76
|
-
}
|
|
77
|
-
catch (err) {
|
|
78
|
-
if (!(err instanceof SessionsClientError && err.code === 'SESSIONS_BIN_MISSING'))
|
|
79
|
-
throw err;
|
|
80
|
-
}
|
|
81
|
-
const filters = bin !== null && usesFilterFlags(forwarded) ? sessionsBinSupportsFilters(bin) : false;
|
|
82
|
-
const host = bin !== null && usesHostFlag(forwarded) ? sessionsBinSupportsHost(bin) : false;
|
|
83
|
-
if (bin !== null) {
|
|
84
|
-
const deviceRead = planDeviceHostRead(forwarded, { filters });
|
|
85
|
-
if (deviceRead && sessionsBinSupportsHost(bin)) {
|
|
86
|
-
let target = null;
|
|
87
|
-
try {
|
|
88
|
-
const { resolveRemoteDevice } = await import('./lib/ssh-tunnel.js');
|
|
89
|
-
target = (await resolveRemoteDevice(deviceRead.device, {})).target;
|
|
90
|
-
}
|
|
91
|
-
catch {
|
|
92
|
-
target = null;
|
|
93
|
-
}
|
|
94
|
-
if (target !== null) {
|
|
95
|
-
const { spawnSync } = await import('node:child_process');
|
|
96
|
-
const { command, prefix } = invocation(bin);
|
|
97
|
-
const hostArgs = [...deviceRead.readArgs, '--host', `ssh://${target}`];
|
|
98
|
-
const childEnv = { ...process.env };
|
|
99
|
-
if (process.stdout.isTTY && !hostArgs.includes('--json')) {
|
|
100
|
-
if (childEnv.FORCE_COLOR === undefined)
|
|
101
|
-
childEnv.FORCE_COLOR = '1';
|
|
102
|
-
if (process.stdout.columns)
|
|
103
|
-
childEnv.COLUMNS = String(process.stdout.columns);
|
|
104
|
-
if (process.stdout.rows)
|
|
105
|
-
childEnv.LINES = String(process.stdout.rows);
|
|
106
|
-
}
|
|
107
|
-
const res = spawnSync(command, [...prefix, ...hostArgs], {
|
|
108
|
-
encoding: 'utf8',
|
|
109
|
-
env: childEnv,
|
|
110
|
-
maxBuffer: 256 * 1024 * 1024,
|
|
111
|
-
});
|
|
112
|
-
if (res.error) {
|
|
113
|
-
process.stderr.write(`Failed to run \`sessions\`: ${res.error.message}\n`);
|
|
114
|
-
process.exit(1);
|
|
115
|
-
}
|
|
116
|
-
if (res.status !== 127) {
|
|
117
|
-
if (res.stdout)
|
|
118
|
-
process.stdout.write(res.stdout);
|
|
119
|
-
if (res.stderr)
|
|
120
|
-
process.stderr.write(res.stderr);
|
|
121
|
-
process.exit(res.status ?? 1);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
if (isReadQuery(forwarded, { filters, host })) {
|
|
127
|
-
if (!bin) {
|
|
128
|
-
process.stderr.write(`agents: the standalone \`sessions\` CLI was not found. Install it with ${SESSIONS_INSTALL_HINT}, or point $SESSIONS_BIN at its executable.\n`);
|
|
129
|
-
process.exit(1);
|
|
130
|
-
}
|
|
131
|
-
const { spawnSync } = await import('node:child_process');
|
|
132
|
-
const { command, prefix } = invocation(bin);
|
|
133
|
-
const res = spawnSync(command, [...prefix, ...forwarded], { stdio: 'inherit' });
|
|
134
|
-
if (res.error) {
|
|
135
|
-
process.stderr.write(`Failed to run \`sessions\`: ${res.error.message}\n`);
|
|
136
|
-
process.exit(1);
|
|
137
|
-
}
|
|
138
|
-
process.exit(res.status ?? 1);
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
70
|
await import('./bootstrap.js');
|
|
142
71
|
export {};
|
|
@@ -209,7 +209,7 @@ function preferVerified(pool, nowMs, choose, narrowing = 'any-verified') {
|
|
|
209
209
|
const narrow = verified.length > 0 &&
|
|
210
210
|
(narrowing === 'any-verified' || verified.length >= Math.ceil(pool.length / 2));
|
|
211
211
|
const picked = choose(narrow ? verified : pool);
|
|
212
|
-
const noVerifiedUsage = verified.length === 0 && pool.
|
|
212
|
+
const noVerifiedUsage = verified.length === 0 && pool.every((c) => hasStaleUsage(c, nowMs));
|
|
213
213
|
return {
|
|
214
214
|
picked,
|
|
215
215
|
usageUnverified: !isUsageVerified(picked, nowMs),
|
|
@@ -108,7 +108,7 @@ export function registerMixCommands(parent) {
|
|
|
108
108
|
(\`agents insights mix harness-mix\`) for just that section; \`--list\` names them.
|
|
109
109
|
This is the cheap counter path. Behavioural report (transcript content, account split)
|
|
110
110
|
is bare \`agents insights\`. Latency is \`agents insights perf\`; quota is \`agents view\`.
|
|
111
|
-
Skill/slash-command popularity is \`agents
|
|
111
|
+
Skill/slash-command popularity is \`agents insights resources\`.
|
|
112
112
|
`,
|
|
113
113
|
});
|
|
114
114
|
parent.command('query')
|
package/dist/lib/auth-mint.js
CHANGED
|
@@ -142,7 +142,7 @@ export function seedReservedAuthToken(email, token) {
|
|
|
142
142
|
if (bundleExistsSync(AUTH_BUNDLE)) {
|
|
143
143
|
const backend = bundleBackendSync(AUTH_BUNDLE);
|
|
144
144
|
if (backend !== 'file') {
|
|
145
|
-
throw new Error(`Reserved bundle '${AUTH_BUNDLE}' exists with backend '${backend}', but usage/probe only reads a FILE-backed auth bundle. Recreate it with:
|
|
145
|
+
throw new Error(`Reserved bundle '${AUTH_BUNDLE}' exists with backend '${backend}', but usage/probe only reads a FILE-backed auth bundle. Recreate it with: secrets create ${AUTH_BUNDLE} --backend file --policy never --i-understand --force`);
|
|
146
146
|
}
|
|
147
147
|
const bundle = readBundleSync(AUTH_BUNDLE);
|
|
148
148
|
if (key in bundle.vars) {
|
|
@@ -215,7 +215,7 @@ export function writeReservedStoreItem(name, key, value, description) {
|
|
|
215
215
|
if (bundleExistsSync(name)) {
|
|
216
216
|
const backend = bundleBackendSync(name);
|
|
217
217
|
if (backend !== 'file') {
|
|
218
|
-
throw new Error(`Reserved store '${name}' exists with backend '${backend}', but worker provisioning only reads a FILE-backed store. Recreate it with:
|
|
218
|
+
throw new Error(`Reserved store '${name}' exists with backend '${backend}', but worker provisioning only reads a FILE-backed store. Recreate it with: secrets delete ${name} --yes`);
|
|
219
219
|
}
|
|
220
220
|
const bundle = readBundleSync(name);
|
|
221
221
|
if (key in bundle.vars) {
|
|
@@ -3,7 +3,6 @@ export declare class BrowserClientError extends Error {
|
|
|
3
3
|
code: string;
|
|
4
4
|
constructor(code: string, message: string);
|
|
5
5
|
}
|
|
6
|
-
export declare function isBrowserClientError(err: unknown): err is BrowserClientError;
|
|
7
6
|
export declare function isStandaloneBrowser(bin: string): boolean;
|
|
8
7
|
export declare function resolveBrowserBin(): string;
|
|
9
8
|
export declare function browserInstalled(): boolean;
|
|
@@ -12,9 +12,6 @@ export class BrowserClientError extends Error {
|
|
|
12
12
|
this.name = 'BrowserClientError';
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
-
export function isBrowserClientError(err) {
|
|
16
|
-
return err instanceof BrowserClientError;
|
|
17
|
-
}
|
|
18
15
|
let cachedBin;
|
|
19
16
|
function browserEntrypoint(bin) {
|
|
20
17
|
if (!/\.(cmd|ps1)$/i.test(bin))
|
|
@@ -42,7 +42,7 @@ export class AntigravityCloudProvider {
|
|
|
42
42
|
if (env[k])
|
|
43
43
|
return env[k];
|
|
44
44
|
}
|
|
45
|
-
throw new Error(`Secrets bundle '${this.secretsBundle}' has no ${KEY_NAMES.join(' or ')}. Add one:
|
|
45
|
+
throw new Error(`Secrets bundle '${this.secretsBundle}' has no ${KEY_NAMES.join(' or ')}. Add one: secrets add ${this.secretsBundle} GEMINI_API_KEY`);
|
|
46
46
|
}
|
|
47
47
|
catch (err) {
|
|
48
48
|
throw new Error(`Could not read Gemini API key from bundle '${this.secretsBundle}': ${err.message}`);
|
package/dist/lib/cloud/cursor.js
CHANGED
|
@@ -92,7 +92,7 @@ export function cursorApiError(action, status, text) {
|
|
|
92
92
|
return new Error(`Cursor Cloud Agents requires a paid Cursor plan; this API key belongs to a plan without Cloud Agents access. ${message}`);
|
|
93
93
|
}
|
|
94
94
|
if (status === 401 || code === 'unauthorized' || code === 'api_key_not_found') {
|
|
95
|
-
return new Error(`Cursor Cloud authentication failed (${status}${code ? ` ${code}` : ''}). Check CURSOR_API_KEY in the configured
|
|
95
|
+
return new Error(`Cursor Cloud authentication failed (${status}${code ? ` ${code}` : ''}). Check CURSOR_API_KEY in the configured secrets bundle. ${message}`);
|
|
96
96
|
}
|
|
97
97
|
return new Error(`Cursor Cloud ${action} failed (${status}${code ? ` ${code}` : ''}): ${message}`);
|
|
98
98
|
}
|
|
@@ -112,7 +112,7 @@ export class CursorCloudProvider {
|
|
|
112
112
|
const { env } = await readAndResolveBundleEnv(this.secretsBundle, { caller: 'cloud:cursor', agentOnly: true });
|
|
113
113
|
if (env[KEY_NAME])
|
|
114
114
|
return env[KEY_NAME];
|
|
115
|
-
throw new Error(`Secrets bundle '${this.secretsBundle}' has no ${KEY_NAME}. Add one:
|
|
115
|
+
throw new Error(`Secrets bundle '${this.secretsBundle}' has no ${KEY_NAME}. Add one: secrets add ${this.secretsBundle} ${KEY_NAME}`);
|
|
116
116
|
}
|
|
117
117
|
catch (err) {
|
|
118
118
|
throw new Error(`Could not read Cursor API key from bundle '${this.secretsBundle}': ${err.message}`);
|
|
@@ -120,7 +120,7 @@ export class CursorCloudProvider {
|
|
|
120
120
|
}
|
|
121
121
|
if (process.env[KEY_NAME])
|
|
122
122
|
return process.env[KEY_NAME];
|
|
123
|
-
throw new Error(`Cursor cloud needs an API key. Set cloud.providers.cursor.secretsBundle in ~/.agents/agents.yaml after running:
|
|
123
|
+
throw new Error(`Cursor cloud needs an API key. Set cloud.providers.cursor.secretsBundle in ~/.agents/agents.yaml after running: secrets add cursor ${KEY_NAME}`);
|
|
124
124
|
}
|
|
125
125
|
capabilities() {
|
|
126
126
|
const available = this.hasKeySource();
|
|
@@ -7,7 +7,7 @@ export function readCloudflareCreds(bundle = DEFAULT_CF_BUNDLE, override) {
|
|
|
7
7
|
if (!bundleExists(bundle)) {
|
|
8
8
|
throw new Error(`The '${bundle}' bundle does not exist. ` +
|
|
9
9
|
`Pass credentials directly with --token <t> [--account <id>], or create it: ` +
|
|
10
|
-
`
|
|
10
|
+
`secrets add ${bundle} CLOUDFLARE_API_TOKEN`);
|
|
11
11
|
}
|
|
12
12
|
const { env } = readAndResolveBundleEnv(bundle, {
|
|
13
13
|
caller: 'cloudflare',
|
|
@@ -26,7 +26,7 @@ export function readCloudflareCreds(bundle = DEFAULT_CF_BUNDLE, override) {
|
|
|
26
26
|
throw new Error(`No Cloudflare API token in the '${bundle}' bundle ` +
|
|
27
27
|
`(keys present: ${keys.length ? keys.join(', ') : 'none'}). ` +
|
|
28
28
|
`Pass it directly with --token <t> [--account <id>], or add it: ` +
|
|
29
|
-
`
|
|
29
|
+
`secrets add ${bundle} CLOUDFLARE_API_TOKEN`);
|
|
30
30
|
}
|
|
31
31
|
return { apiToken, accountId };
|
|
32
32
|
}
|