@phnx-labs/agents-cli 1.22.41 → 1.22.42
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 +14 -0
- package/README.md +9 -3
- package/dist/bin/agents +0 -0
- package/dist/cli/command-registry.d.ts +2 -0
- package/dist/cli/command-registry.js +4 -0
- package/dist/commands/accounts.d.ts +29 -0
- package/dist/commands/accounts.js +220 -29
- package/dist/commands/alias.js +1 -1
- package/dist/commands/auth.d.ts +9 -0
- package/dist/commands/auth.js +104 -0
- package/dist/commands/browser-sessions-picker.js +42 -62
- package/dist/commands/browser.js +30 -38
- package/dist/commands/computer-actions.d.ts +1 -1
- package/dist/commands/computer-actions.js +1 -1
- package/dist/commands/computer-sessions-picker.js +32 -55
- package/dist/commands/computer.d.ts +1 -1
- package/dist/commands/computer.js +2 -2
- package/dist/commands/doctor.d.ts +1 -1
- package/dist/commands/doctor.js +3 -3
- package/dist/commands/feed.js +1 -1
- package/dist/commands/hooks.js +1 -1
- package/dist/commands/import.js +1 -1
- package/dist/commands/insights.js +163 -85
- package/dist/commands/inspect.js +2 -2
- package/dist/commands/mine.js +1 -1
- package/dist/commands/org.d.ts +6 -0
- package/dist/commands/org.js +174 -0
- package/dist/commands/packages.js +1 -1
- package/dist/commands/prune.js +1 -1
- package/dist/commands/routines.js +1 -1
- package/dist/commands/run-account-picker.d.ts +19 -0
- package/dist/commands/run-account-picker.js +81 -0
- package/dist/commands/sessions-picker-factory.d.ts +40 -0
- package/dist/commands/sessions-picker-factory.js +67 -0
- package/dist/commands/setup-browser.js +4 -4
- package/dist/commands/setup-mine.js +1 -1
- package/dist/commands/setup-preferences.js +2 -2
- package/dist/commands/setup.js +5 -3
- package/dist/commands/sync.js +1 -1
- package/dist/commands/versions.js +1 -1
- package/dist/commands/view.js +1 -1
- package/dist/lib/account-capabilities.d.ts +10 -0
- package/dist/lib/account-capabilities.js +34 -0
- package/dist/lib/agent-spec/agents.d.ts +584 -0
- package/dist/lib/agent-spec/agents.js +3127 -0
- package/dist/lib/agent-spec/provider.js +1 -1
- package/dist/lib/agents.d.ts +2 -584
- package/dist/lib/agents.js +2 -3127
- package/dist/lib/browser/drivers/local.d.ts +8 -2
- package/dist/lib/browser/drivers/local.js +8 -2
- package/dist/lib/browser/drivers/ssh.d.ts +8 -2
- package/dist/lib/browser/drivers/ssh.js +10 -4
- package/dist/lib/browser/hygiene.d.ts +1 -1
- package/dist/lib/browser/hygiene.js +5 -1
- package/dist/lib/browser/profiles.d.ts +74 -1
- package/dist/lib/browser/profiles.js +114 -5
- package/dist/lib/browser/runtime-state.d.ts +11 -5
- package/dist/lib/browser/runtime-state.js +13 -9
- package/dist/lib/browser/service.d.ts +68 -30
- package/dist/lib/browser/service.js +305 -194
- package/dist/lib/browser/types.d.ts +95 -3
- package/dist/lib/browser/types.js +51 -0
- package/dist/lib/catchup.js +1 -1
- package/dist/lib/computer/actions.d.ts +1 -1
- package/dist/lib/computer/actions.js +1 -1
- package/dist/lib/{computer-rpc.js → computer/computer-rpc.js} +5 -5
- package/dist/lib/computer/dispatch.d.ts +1 -1
- package/dist/lib/computer/download.d.ts +1 -1
- package/dist/lib/computer/download.js +3 -3
- package/dist/lib/{ssh-tunnel.d.ts → computer/ssh-tunnel.d.ts} +1 -1
- package/dist/lib/{ssh-tunnel.js → computer/ssh-tunnel.js} +12 -12
- package/dist/lib/daemon/daemon.js +1 -1
- package/dist/lib/{runner.d.ts → daemon/runner.d.ts} +10 -10
- package/dist/lib/{runner.js → daemon/runner.js} +40 -114
- package/dist/lib/devices/doctor-findings.d.ts +1 -1
- package/dist/lib/devices/doctor-findings.js +3 -3
- package/dist/lib/devices/fleet-inventory.js +1 -1
- package/dist/lib/devices/harness-inventory.js +1 -1
- package/dist/lib/devices/registry.js +4 -22
- package/dist/lib/doctor-diff.d.ts +1 -1
- package/dist/lib/doctor-diff.js +1 -1
- package/dist/lib/drift.js +1 -1
- package/dist/lib/entitlement.d.ts +31 -0
- package/dist/lib/entitlement.js +137 -0
- package/dist/lib/exec.js +39 -202
- package/dist/lib/feed/feed.js +2 -8
- package/dist/lib/fs-atomic.d.ts +7 -0
- package/dist/lib/fs-atomic.js +9 -0
- package/dist/lib/harness/adapter.d.ts +160 -0
- package/dist/lib/harness/adapter.js +47 -0
- package/dist/lib/harness/adapters/claude.d.ts +2 -0
- package/dist/lib/harness/adapters/claude.js +110 -0
- package/dist/lib/harness/adapters/codex.d.ts +2 -0
- package/dist/lib/harness/adapters/codex.js +83 -0
- package/dist/lib/harness/adapters/copilot.d.ts +2 -0
- package/dist/lib/harness/adapters/copilot.js +23 -0
- package/dist/lib/harness/adapters/cursor.d.ts +2 -0
- package/dist/lib/harness/adapters/cursor.js +38 -0
- package/dist/lib/harness/adapters/droid.d.ts +2 -0
- package/dist/lib/harness/adapters/droid.js +17 -0
- package/dist/lib/harness/adapters/grok.d.ts +2 -0
- package/dist/lib/harness/adapters/grok.js +14 -0
- package/dist/lib/harness/adapters/kimi.d.ts +2 -0
- package/dist/lib/harness/adapters/kimi.js +49 -0
- package/dist/lib/harness/adapters/muse.d.ts +2 -0
- package/dist/lib/harness/adapters/muse.js +44 -0
- package/dist/lib/harness/adapters/opencode.d.ts +2 -0
- package/dist/lib/harness/adapters/opencode.js +14 -0
- package/dist/lib/harness/exec-config-version.d.ts +8 -0
- package/dist/lib/harness/exec-config-version.js +22 -0
- package/dist/lib/harness/index.d.ts +1 -0
- package/dist/lib/harness/index.js +34 -0
- package/dist/lib/{hooks.d.ts → hooks/install.d.ts} +1 -1
- package/dist/lib/{hooks.js → hooks/install.js} +11 -11
- package/dist/lib/import.js +1 -1
- package/dist/lib/installations/index.d.ts +4 -4
- package/dist/lib/installations/index.js +3 -4
- package/dist/lib/installations/migrate.js +6 -6
- package/dist/lib/{shims.d.ts → installations/shims.d.ts} +2 -2
- package/dist/lib/{shims.js → installations/shims.js} +12 -114
- package/dist/lib/installations/store.d.ts +141 -3
- package/dist/lib/installations/store.js +475 -5
- package/dist/lib/installations/versions.d.ts +1 -126
- package/dist/lib/installations/versions.js +5 -465
- package/dist/lib/isolation-boundary-report.d.ts +1 -1
- package/dist/lib/isolation-boundary-report.js +1 -1
- package/dist/lib/mailbox-gc.js +2 -3
- package/dist/lib/menubar/MenubarHelper.app/Contents/CodeResources +0 -0
- package/dist/lib/menubar/MenubarHelper.app/Contents/MacOS/MenubarHelper +0 -0
- package/dist/lib/monitors/dispatch.d.ts +1 -1
- package/dist/lib/monitors/dispatch.js +2 -2
- package/dist/lib/monitors/state.d.ts +1 -1
- package/dist/lib/plugins/plugins.js +1 -1
- package/dist/lib/plugins/skills.js +1 -1
- package/dist/lib/prix-account.d.ts +158 -0
- package/dist/lib/prix-account.js +214 -0
- package/dist/lib/project-key.js +2 -2
- package/dist/lib/project-launch.js +1 -1
- package/dist/lib/refresh.js +2 -2
- package/dist/lib/resource-inventory.d.ts +1 -1
- package/dist/lib/resource-inventory.js +1 -1
- package/dist/lib/rules/rules.js +1 -1
- package/dist/lib/scheduling/routines.js +1 -1
- package/dist/lib/secrets/Agents CLI.app/Contents/CodeResources +0 -0
- package/dist/lib/secrets/Agents CLI.app/Contents/MacOS/Agents CLI +0 -0
- package/dist/lib/self-heal/checks/hook-runtime.js +1 -1
- package/dist/lib/self-heal/checks/path.js +1 -1
- package/dist/lib/self-heal/checks/shadowing.js +1 -1
- package/dist/lib/self-heal/checks/shims.js +1 -1
- package/dist/lib/session/discover.d.ts +39 -0
- package/dist/lib/session/discover.js +3 -3
- package/dist/lib/session/parse.js +24 -42
- package/dist/lib/session/recovery.js +1 -1
- package/dist/lib/staleness/prune.d.ts +1 -1
- package/dist/lib/staleness/prune.js +1 -1
- package/dist/lib/staleness/writers/hooks.js +1 -1
- package/dist/lib/startup/command-registry.js +1 -1
- package/dist/lib/teams/agents.js +2 -19
- package/dist/lib/teams/parsers.js +20 -26
- package/dist/lib/teams/registry.js +2 -21
- package/dist/lib/triggers/handlers.js +1 -1
- package/dist/lib/triggers/webhook.js +1 -1
- package/dist/lib/uninstall.js +1 -1
- package/dist/lib/version.d.ts +9 -2
- package/dist/lib/version.js +11 -9
- package/package.json +1 -1
- /package/dist/lib/{computer-rpc.d.ts → computer/computer-rpc.d.ts} +0 -0
|
@@ -124,6 +124,87 @@ export function buildRunAccountChoices(candidates, globalDefault) {
|
|
|
124
124
|
signInRequired: row.signInRequired,
|
|
125
125
|
}));
|
|
126
126
|
}
|
|
127
|
+
function switchRowStatus(row) {
|
|
128
|
+
if (!row.candidate) {
|
|
129
|
+
return {
|
|
130
|
+
status: row.kind === 'provider' ? 'credential' : 'named',
|
|
131
|
+
limits: 'limits unavailable',
|
|
132
|
+
ready: true,
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
const readiness = readinessFromCandidate(row.candidate);
|
|
136
|
+
const authReason = readiness.ready ? null : readiness.reason;
|
|
137
|
+
const status = authReason === 'revoked'
|
|
138
|
+
? 'needs re-login'
|
|
139
|
+
: authReason === 'signed_out'
|
|
140
|
+
? 'logged out'
|
|
141
|
+
: authReason === 'rate_limited'
|
|
142
|
+
? 'rate limited'
|
|
143
|
+
: authReason === 'out_of_credits'
|
|
144
|
+
? 'out of credits'
|
|
145
|
+
: 'logged in';
|
|
146
|
+
const limits = authReason === 'revoked'
|
|
147
|
+
? 'needs re-authentication'
|
|
148
|
+
: authReason === 'signed_out'
|
|
149
|
+
? 'signed out'
|
|
150
|
+
: formatAccountLimits(row.candidate);
|
|
151
|
+
return { status, limits, ready: readiness.ready };
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Aligned picker rows for `accounts switch`. Same columns as the run picker
|
|
155
|
+
* (identity, status, limits) but the value is the named account to set-default.
|
|
156
|
+
* Rows stay selectable: setting a default is not a launch.
|
|
157
|
+
*/
|
|
158
|
+
export function buildSwitchAccountChoices(rows) {
|
|
159
|
+
const rendered = rows.map((row) => {
|
|
160
|
+
const { status, limits, ready } = switchRowStatus(row);
|
|
161
|
+
const account = row.current ? `${row.accountName} (default)` : row.accountName;
|
|
162
|
+
const kind = row.kind === 'provider' ? `provider · ${row.detail}` : `native · ${row.detail}`;
|
|
163
|
+
return { account, kind, status, limits, ready, value: row.accountName };
|
|
164
|
+
});
|
|
165
|
+
const accountWidth = Math.max(0, ...rendered.map((row) => row.account.length));
|
|
166
|
+
const kindWidth = Math.max(0, ...rendered.map((row) => row.kind.length));
|
|
167
|
+
const statusWidth = Math.max(0, ...rendered.map((row) => row.status.length));
|
|
168
|
+
return rendered.map((row) => ({
|
|
169
|
+
name: [
|
|
170
|
+
row.account.padEnd(accountWidth),
|
|
171
|
+
row.kind.padEnd(kindWidth),
|
|
172
|
+
row.status.padEnd(statusWidth),
|
|
173
|
+
row.limits,
|
|
174
|
+
].join(' '),
|
|
175
|
+
value: row.value,
|
|
176
|
+
ready: row.ready,
|
|
177
|
+
signInRequired: false,
|
|
178
|
+
}));
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Prompt for the named account that becomes this harness's default.
|
|
182
|
+
* A cancelled picker writes nothing.
|
|
183
|
+
*/
|
|
184
|
+
export async function pickSwitchAccount(agent, rows) {
|
|
185
|
+
if (!isInteractiveTerminal()) {
|
|
186
|
+
requireInteractiveSelection(`Selecting a ${agentLabel(agent)} account`, [
|
|
187
|
+
`agents accounts switch ${agent} <account>`,
|
|
188
|
+
`agents accounts set-default ${agent} <account>`,
|
|
189
|
+
]);
|
|
190
|
+
}
|
|
191
|
+
if (rows.length === 0) {
|
|
192
|
+
throw new Error(`No named accounts for ${agent}. Add one with 'agents accounts add <name> --provider <p>' or 'agents accounts name ${agent}@<version> <name>'.`);
|
|
193
|
+
}
|
|
194
|
+
const choices = buildSwitchAccountChoices(rows).map(({ ready: _ready, signInRequired: _signInRequired, ...choice }) => choice);
|
|
195
|
+
try {
|
|
196
|
+
return await select({
|
|
197
|
+
message: `Select the default ${agentLabel(agent)} account:`,
|
|
198
|
+
choices,
|
|
199
|
+
loop: false,
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
catch (err) {
|
|
203
|
+
if (isPromptCancelled(err))
|
|
204
|
+
return null;
|
|
205
|
+
throw err;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
127
208
|
/**
|
|
128
209
|
* Whether a zero-healthy run may recover by launching for a login, or must keep
|
|
129
210
|
* failing loud. Three inputs, all of which have to hold:
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/** Flag subset both twins share for the interactive-routing gate. */
|
|
2
|
+
export interface SessionsPickerGateOpts {
|
|
3
|
+
interactive?: boolean;
|
|
4
|
+
json?: boolean;
|
|
5
|
+
/** Present only on the browser twin; computer never sets it. */
|
|
6
|
+
open?: string | boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface SessionsPickerCommandSpec<TRow, TOpts extends SessionsPickerGateOpts> {
|
|
9
|
+
/**
|
|
10
|
+
* Browser requires `opts.open === undefined` so `--open` (bare or with a
|
|
11
|
+
* selector) falls through to the flat printer. Computer has no `--open`.
|
|
12
|
+
*/
|
|
13
|
+
requireOpenUndefined?: boolean;
|
|
14
|
+
runFlat: (opts: TOpts) => void;
|
|
15
|
+
buildRows: (opts: TOpts) => TRow[];
|
|
16
|
+
emptyMessage: (opts: TOpts) => string;
|
|
17
|
+
message: string;
|
|
18
|
+
matches: (row: TRow, query: string) => boolean;
|
|
19
|
+
labelFor: (row: TRow) => string;
|
|
20
|
+
buildPreview: (row: TRow) => string;
|
|
21
|
+
emptyFilterMessage: string;
|
|
22
|
+
enterHint: string;
|
|
23
|
+
onOpen: (row: TRow) => void | Promise<void>;
|
|
24
|
+
}
|
|
25
|
+
export interface SessionsPickerCommand<TOpts extends SessionsPickerGateOpts> {
|
|
26
|
+
shouldOpen: (opts: TOpts, isTTY: boolean) => boolean;
|
|
27
|
+
run: (opts: TOpts) => Promise<void>;
|
|
28
|
+
}
|
|
29
|
+
export declare function shouldOpenInteractiveSessions(opts: SessionsPickerGateOpts, isTTY: boolean, requireOpenUndefined?: boolean): boolean;
|
|
30
|
+
export declare function browseSessionsUntilQuit<TRow>(spec: {
|
|
31
|
+
message: string;
|
|
32
|
+
rows: TRow[];
|
|
33
|
+
matches: (row: TRow, query: string) => boolean;
|
|
34
|
+
labelFor: (row: TRow) => string;
|
|
35
|
+
buildPreview: (row: TRow) => string;
|
|
36
|
+
emptyFilterMessage: string;
|
|
37
|
+
enterHint: string;
|
|
38
|
+
onOpen: (row: TRow) => void | Promise<void>;
|
|
39
|
+
}): Promise<void>;
|
|
40
|
+
export declare function createSessionsPickerCommand<TRow, TOpts extends SessionsPickerGateOpts>(spec: SessionsPickerCommandSpec<TRow, TOpts>): SessionsPickerCommand<TOpts>;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared interactive-routing + browse loop for the task-first session
|
|
3
|
+
* pickers (`browser-sessions-picker.ts`, `computer-sessions-picker.ts`).
|
|
4
|
+
*
|
|
5
|
+
* Each twin keeps its own row formatter, matcher, and enter-handler; this
|
|
6
|
+
* factory owns the TTY/`--json`/`--no-interactive` (and optional `--open`)
|
|
7
|
+
* gate, the empty-list message, and the cancel-aware `itemPicker` loop.
|
|
8
|
+
*/
|
|
9
|
+
import { itemPicker } from '../lib/picker.js';
|
|
10
|
+
import { isInteractiveTerminal, isPromptCancelled } from './utils.js';
|
|
11
|
+
export function shouldOpenInteractiveSessions(opts, isTTY, requireOpenUndefined = false) {
|
|
12
|
+
return (opts.interactive !== false &&
|
|
13
|
+
!opts.json &&
|
|
14
|
+
(!requireOpenUndefined || opts.open === undefined) &&
|
|
15
|
+
isTTY);
|
|
16
|
+
}
|
|
17
|
+
export async function browseSessionsUntilQuit(spec) {
|
|
18
|
+
for (;;) {
|
|
19
|
+
let picked;
|
|
20
|
+
try {
|
|
21
|
+
picked = await itemPicker({
|
|
22
|
+
message: spec.message,
|
|
23
|
+
items: spec.rows,
|
|
24
|
+
filter: (query) => (query.trim() ? spec.rows.filter((r) => spec.matches(r, query)) : spec.rows),
|
|
25
|
+
labelFor: spec.labelFor,
|
|
26
|
+
buildPreview: spec.buildPreview,
|
|
27
|
+
emptyMessage: spec.emptyFilterMessage,
|
|
28
|
+
enterHint: spec.enterHint,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
catch (err) {
|
|
32
|
+
if (isPromptCancelled(err))
|
|
33
|
+
return;
|
|
34
|
+
throw err;
|
|
35
|
+
}
|
|
36
|
+
if (!picked)
|
|
37
|
+
return;
|
|
38
|
+
await spec.onOpen(picked.item);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
export function createSessionsPickerCommand(spec) {
|
|
42
|
+
const shouldOpen = (opts, isTTY) => shouldOpenInteractiveSessions(opts, isTTY, spec.requireOpenUndefined === true);
|
|
43
|
+
return {
|
|
44
|
+
shouldOpen,
|
|
45
|
+
run: async (opts) => {
|
|
46
|
+
if (!shouldOpen(opts, isInteractiveTerminal())) {
|
|
47
|
+
spec.runFlat(opts);
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
const rows = spec.buildRows(opts);
|
|
51
|
+
if (rows.length === 0) {
|
|
52
|
+
console.log(spec.emptyMessage(opts));
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
await browseSessionsUntilQuit({
|
|
56
|
+
message: spec.message,
|
|
57
|
+
rows,
|
|
58
|
+
matches: spec.matches,
|
|
59
|
+
labelFor: spec.labelFor,
|
|
60
|
+
buildPreview: spec.buildPreview,
|
|
61
|
+
emptyFilterMessage: spec.emptyFilterMessage,
|
|
62
|
+
enterHint: spec.enterHint,
|
|
63
|
+
onOpen: spec.onOpen,
|
|
64
|
+
});
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
import chalk from 'chalk';
|
|
11
11
|
import { setConfigValue } from '../lib/device-config.js';
|
|
12
12
|
import { findFirstInstalledBrowser, listInstalledBrowsers } from '../lib/browser/chrome.js';
|
|
13
|
-
import { DEFAULT_BROWSER_PROFILE_NAME, createProfile, findFreeProfilePort, getConfiguredDefaultProfileName,
|
|
13
|
+
import { DEFAULT_BROWSER_PROFILE_NAME, getAutoDetectedProfile, createProfile, findFreeProfilePort, getConfiguredDefaultProfileName, } from '../lib/browser/profiles.js';
|
|
14
14
|
import { DEFAULT_VIEWPORT } from '../lib/browser/devices.js';
|
|
15
15
|
import { isInteractiveTerminal, isPromptCancelled } from './utils.js';
|
|
16
16
|
import { defaultBrowserChoice } from './setup-preferences.js';
|
|
@@ -29,9 +29,9 @@ export async function runBrowserWizard() {
|
|
|
29
29
|
console.error(chalk.red('No supported browser found.\n') + chalk.dim(INSTALL_HINT));
|
|
30
30
|
return false;
|
|
31
31
|
}
|
|
32
|
-
const existing = await
|
|
32
|
+
const existing = await getAutoDetectedProfile();
|
|
33
33
|
if (existing) {
|
|
34
|
-
console.log(chalk.dim(`Browser profile "${
|
|
34
|
+
console.log(chalk.dim(`Browser profile "${existing.name}" already exists.`));
|
|
35
35
|
return true;
|
|
36
36
|
}
|
|
37
37
|
const created = await createAutoDefault();
|
|
@@ -46,7 +46,7 @@ export async function runBrowserWizard() {
|
|
|
46
46
|
}
|
|
47
47
|
const { confirm, select } = await import('@inquirer/prompts');
|
|
48
48
|
// If a default profile already exists, this is a reconfigure.
|
|
49
|
-
const existing = await
|
|
49
|
+
const existing = await getAutoDetectedProfile();
|
|
50
50
|
if (existing) {
|
|
51
51
|
console.log(chalk.dim(`Browser profile "${existing.name}" already exists (${existing.browser}${existing.binary ? ` · ${existing.binary}` : ''}).`));
|
|
52
52
|
const change = await confirm({ message: 'Re-create it (e.g. to pin a different browser)?', default: false });
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
import chalk from 'chalk';
|
|
12
12
|
import { initBrand, registerMineManageCommands } from './mine.js';
|
|
13
13
|
import { validateBrandName, getBrandConfig } from '../lib/brand.js';
|
|
14
|
-
import { isShimsInPath } from '../lib/shims.js';
|
|
14
|
+
import { isShimsInPath } from '../lib/installations/shims.js';
|
|
15
15
|
import { isInteractiveTerminal, isPromptCancelled } from './utils.js';
|
|
16
16
|
/**
|
|
17
17
|
* Optional/heavier top-level commands a brand commonly turns off. Kept short so
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*/
|
|
15
15
|
import chalk from 'chalk';
|
|
16
16
|
import { listInstalledBrowsers } from '../lib/browser/chrome.js';
|
|
17
|
-
import { DEFAULT_BROWSER_PROFILE_NAME, createProfile, findFreeProfilePort, getConfiguredDefaultProfileName,
|
|
17
|
+
import { DEFAULT_BROWSER_PROFILE_NAME, getAutoDetectedProfile, createProfile, findFreeProfilePort, getConfiguredDefaultProfileName, } from '../lib/browser/profiles.js';
|
|
18
18
|
import { DEFAULT_VIEWPORT } from '../lib/browser/devices.js';
|
|
19
19
|
import { getConfigValue, setConfigValue } from '../lib/device-config.js';
|
|
20
20
|
import { loadDevices } from '../lib/devices/registry.js';
|
|
@@ -88,7 +88,7 @@ export async function maybePickBrowserProfile() {
|
|
|
88
88
|
return false;
|
|
89
89
|
if (getConfiguredDefaultProfileName())
|
|
90
90
|
return false;
|
|
91
|
-
if (await
|
|
91
|
+
if (await getAutoDetectedProfile())
|
|
92
92
|
return false;
|
|
93
93
|
const installed = listInstalledBrowsers();
|
|
94
94
|
if (installed.length === 0)
|
package/dist/commands/setup.js
CHANGED
|
@@ -16,7 +16,7 @@ import { isGitRepo, cloneIntoExisting, pullRepo } from '../lib/git.js';
|
|
|
16
16
|
import { isPromptCancelled, isInteractiveTerminal } from './utils.js';
|
|
17
17
|
import { AGENTS, agentConfigDirName, getUnmanagedAgentInstalls, countSessionFiles, agentLabel } from '../lib/agents.js';
|
|
18
18
|
import { setGlobalDefault } from '../lib/installations/versions.js';
|
|
19
|
-
import { ensureShimCurrent, switchHomeFileSymlinks, isShimsInPath, addShimsToPath, getPathSetupInstructions, assertIsolationBoundary } from '../lib/shims.js';
|
|
19
|
+
import { ensureShimCurrent, switchHomeFileSymlinks, isShimsInPath, addShimsToPath, getPathSetupInstructions, assertIsolationBoundary } from '../lib/installations/shims.js';
|
|
20
20
|
import { setHelpSections } from '../lib/help.js';
|
|
21
21
|
import { registerSetupBrowserCommand, runBrowserWizard } from './setup-browser.js';
|
|
22
22
|
import { registerSetupComputerCommand, runComputerWizard } from './setup-computer.js';
|
|
@@ -26,7 +26,7 @@ import { registerSetupSecretsCommand } from './setup-secrets.js';
|
|
|
26
26
|
import { registerSetupFleetCommand } from './setup-fleet.js';
|
|
27
27
|
import { registerSetupWatchdogCommand, runWatchdogSetupWizard } from './setup-watchdog.js';
|
|
28
28
|
import { runPreferencesStep } from './setup-preferences.js';
|
|
29
|
-
import { getConfiguredDefaultProfileName, getProfile,
|
|
29
|
+
import { getConfiguredDefaultProfileName, getProfile, getAutoDetectedProfile, isProfileLaunchableHere } from '../lib/browser/profiles.js';
|
|
30
30
|
import { listInstalledBrowsers } from '../lib/browser/chrome.js';
|
|
31
31
|
import { probeComputerTrust } from './computer.js';
|
|
32
32
|
import { readShareConfig } from '../lib/share/config.js';
|
|
@@ -265,7 +265,9 @@ export async function ensureInitialized(program) {
|
|
|
265
265
|
}
|
|
266
266
|
export async function getSetupStatus() {
|
|
267
267
|
const configuredBrowserProfile = getConfiguredDefaultProfileName();
|
|
268
|
-
const browserProfile =
|
|
268
|
+
const browserProfile = configuredBrowserProfile
|
|
269
|
+
? await getProfile(configuredBrowserProfile)
|
|
270
|
+
: await getAutoDetectedProfile();
|
|
269
271
|
const browserReady = browserProfile !== null && isProfileLaunchableHere(browserProfile);
|
|
270
272
|
const installedBrowsers = listInstalledBrowsers();
|
|
271
273
|
const computerState = process.platform === 'darwin' ? (await probeComputerTrust() ? 'ready' : 'missing') : 'n/a';
|
package/dist/commands/sync.js
CHANGED
|
@@ -36,7 +36,7 @@ import { resolveSyncPassphraseFromEnv } from '../lib/secrets/sync-passphrase.js'
|
|
|
36
36
|
import { agentLabel, resolveAgentName, MANAGED_AGENT_IDS, isAgentHardDeprecated, hardDeprecationError } from '../lib/agents.js';
|
|
37
37
|
import { isVersionInstalled, syncResourcesToVersion, parseAgentSpec, resolveVersion, resolveVersionAlias, listInstalledVersions, getAvailableResources, getActuallySyncedResources, getProjectOnlyResources, getNewResources, hasNewResources, promptResourceSelection, promptNewResourceSelection, buildSelection, mergeRepoScopedSelections, listRepoNames, getVersionHomePath, } from '../lib/installations/versions.js';
|
|
38
38
|
import { capableAgents } from '../lib/capabilities.js';
|
|
39
|
-
import { parseHookManifest, registerHooksToSettings } from '../lib/hooks.js';
|
|
39
|
+
import { parseHookManifest, registerHooksToSettings } from '../lib/hooks/install.js';
|
|
40
40
|
import { compileRulesForProject } from '../lib/rules/compile.js';
|
|
41
41
|
import { runLaunchSync } from '../lib/project-launch.js';
|
|
42
42
|
import { formatKeptProjectResources } from '../lib/project-resources.js';
|
|
@@ -11,7 +11,7 @@ import { resolveConfiguredModel, formatAgentIdentity } from '../lib/models.js';
|
|
|
11
11
|
import { readManifest, writeManifest, createDefaultManifest } from '../lib/manifest.js';
|
|
12
12
|
import { installVersion, removeVersion, listInstalledVersions, isVersionInstalled, isLatestInstalled, isOldestInstalled, getGlobalDefault, setGlobalDefault, markVersionIsolated, setIsolatedDefault, isVersionIsolated, getVersionHomePath, getVersionDir, syncResourcesToVersion, parseAgentSpec, promptResourceSelection, promptNewResourceSelection, getAvailableResources, getActuallySyncedResources, getNewResources, getProjectOnlyResources, hasNewResources, printTrashFooter, } from '../lib/installations/versions.js';
|
|
13
13
|
import { carryForwardSettings } from '../lib/settings-manifest.js';
|
|
14
|
-
import { createShim, createVersionedAlias, supportsIsolatedInstall, isIsolationProtected, CONFIG_ENV_ISOLATED_AGENTS, removeShim, shimExists, getShimsDir, getShimPath, getPathShadowingExecutable, isShimsInPath, getPathSetupInstructions, addShimsToPath, switchConfigSymlink, switchHomeFileSymlinks, } from '../lib/shims.js';
|
|
14
|
+
import { createShim, createVersionedAlias, supportsIsolatedInstall, isIsolationProtected, CONFIG_ENV_ISOLATED_AGENTS, removeShim, shimExists, getShimsDir, getShimPath, getPathShadowingExecutable, isShimsInPath, getPathSetupInstructions, addShimsToPath, switchConfigSymlink, switchHomeFileSymlinks, } from '../lib/installations/shims.js';
|
|
15
15
|
import { isInteractiveTerminal, isPromptCancelled, requireInteractiveSelection } from './utils.js';
|
|
16
16
|
import { tryAutoPull } from '../lib/git.js';
|
|
17
17
|
import { getAgentsDir, getTrashVersionsDir } from '../lib/state.js';
|
package/dist/commands/view.js
CHANGED
|
@@ -11,7 +11,7 @@ import { authCacheKey, formatCheckedAge, readAuthHealthCache } from '../lib/auth
|
|
|
11
11
|
import { agentReportsUsage, deriveUsageStatusFromSnapshot, formatUsageSection, formatUsageSummary, formatUsageStatusBadge, getUsageInfoForIdentity, getUsageInfoByIdentity, getUsageLookupKey, isUsageHeadlessScopeError, } from '../lib/accounting/usage.js';
|
|
12
12
|
import { readManifest } from '../lib/manifest.js';
|
|
13
13
|
import { listInstalledVersions, listInstalledVersionDirs, getGlobalDefault, getVersionHomePath, getVersionDir, removeVersion, printTrashFooter, reconcileStaleLatestForAgent, isGlobalBinaryAgent, getLiveVersion, isVersionIsolated, getIsolatedDefault, } from '../lib/installations/versions.js';
|
|
14
|
-
import { ensureVersionedAliasCurrent, removeShim, } from '../lib/shims.js';
|
|
14
|
+
import { ensureVersionedAliasCurrent, removeShim, } from '../lib/installations/shims.js';
|
|
15
15
|
import { getAgentResources } from '../lib/resources.js';
|
|
16
16
|
import { renderMergedResources } from '../lib/merged-resources.js';
|
|
17
17
|
import { resolveVersionFilter, AgentSpecError } from '../lib/agent-spec/index.js';
|
|
@@ -24,6 +24,16 @@ export declare const NATIVE_ACCOUNT_CAPABILITIES: Record<AgentId, NativeAccountC
|
|
|
24
24
|
export declare function nativeAccountCapability(agent: AgentId): NativeAccountCapability;
|
|
25
25
|
/** Whether a harness's native login can be named/attached (supported or conditional). */
|
|
26
26
|
export declare function nativeAccountNameable(agent: AgentId): boolean;
|
|
27
|
+
/** Harnesses whose native login is fully nameable/attachable today. */
|
|
28
|
+
export declare function supportedNativeHarnesses(): AgentId[];
|
|
29
|
+
/**
|
|
30
|
+
* Named reason to refuse native name/attach, or null when the harness is
|
|
31
|
+
* nameable. Provider-credential `accounts add` is a different path and MUST
|
|
32
|
+
* not consult this — that surface is supported for every registered provider.
|
|
33
|
+
*/
|
|
34
|
+
export declare function nativeAccountNamingRefusal(agent: AgentId): string | null;
|
|
35
|
+
/** Fail loud on the native name/attach path for an unsupported harness. */
|
|
36
|
+
export declare function assertNativeAccountNameable(agent: AgentId): void;
|
|
27
37
|
/**
|
|
28
38
|
* The single identity key used at `accounts name`, attach, exec validation,
|
|
29
39
|
* view, and inventory. Prefer the harness's stable `accountKey`. For an
|
|
@@ -42,6 +42,40 @@ export function nativeAccountNameable(agent) {
|
|
|
42
42
|
const cap = NATIVE_ACCOUNT_CAPABILITIES[agent];
|
|
43
43
|
return (cap.status === 'supported' || cap.status === 'conditional') && cap.scope !== 'unsupported';
|
|
44
44
|
}
|
|
45
|
+
/** Harnesses whose native login is fully nameable/attachable today. */
|
|
46
|
+
export function supportedNativeHarnesses() {
|
|
47
|
+
return Object.entries(NATIVE_ACCOUNT_CAPABILITIES)
|
|
48
|
+
.filter(([, cap]) => cap.status === 'supported')
|
|
49
|
+
.map(([id]) => id)
|
|
50
|
+
.sort();
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Named reason to refuse native name/attach, or null when the harness is
|
|
54
|
+
* nameable. Provider-credential `accounts add` is a different path and MUST
|
|
55
|
+
* not consult this — that surface is supported for every registered provider.
|
|
56
|
+
*/
|
|
57
|
+
export function nativeAccountNamingRefusal(agent) {
|
|
58
|
+
if (nativeAccountNameable(agent))
|
|
59
|
+
return null;
|
|
60
|
+
const cap = NATIVE_ACCOUNT_CAPABILITIES[agent];
|
|
61
|
+
const suffix = `Supported today: ${supportedNativeHarnesses().join(', ')}.`;
|
|
62
|
+
if (cap.scope === 'device') {
|
|
63
|
+
return `${agent} accounts can't be isolated by agents-cli yet (device-scoped login). ${suffix}`;
|
|
64
|
+
}
|
|
65
|
+
if (agent === 'cursor') {
|
|
66
|
+
return `${agent} accounts can't be isolated by agents-cli yet (multi-account isolation unresolved). ${suffix}`;
|
|
67
|
+
}
|
|
68
|
+
if (cap.status === 'discovery-only') {
|
|
69
|
+
return `${agent} native accounts are discovery-only; agents-cli cannot name or attach this login. ${suffix}`;
|
|
70
|
+
}
|
|
71
|
+
return `${agent} accounts can't be named by agents-cli yet. ${suffix}`;
|
|
72
|
+
}
|
|
73
|
+
/** Fail loud on the native name/attach path for an unsupported harness. */
|
|
74
|
+
export function assertNativeAccountNameable(agent) {
|
|
75
|
+
const reason = nativeAccountNamingRefusal(agent);
|
|
76
|
+
if (reason)
|
|
77
|
+
throw new Error(reason);
|
|
78
|
+
}
|
|
45
79
|
/**
|
|
46
80
|
* The single identity key used at `accounts name`, attach, exec validation,
|
|
47
81
|
* view, and inventory. Prefer the harness's stable `accountKey`. For an
|