@phnx-labs/agents-cli 1.22.121 → 1.22.123
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 +316 -0
- package/README.md +53 -53
- package/dist/bootstrap.js +22 -17
- package/dist/cli/command-registry.d.ts +0 -1
- package/dist/cli/command-registry.js +2 -12
- package/dist/commands/auth.js +13 -4
- package/dist/commands/browser.js +3 -4
- package/dist/commands/cloud-transcripts.d.ts +7 -0
- package/dist/commands/cloud-transcripts.js +100 -0
- package/dist/commands/cloud.js +5 -0
- package/dist/commands/computer.d.ts +0 -12
- package/dist/commands/computer.js +14 -124
- package/dist/commands/config.js +5 -4
- package/dist/commands/daemon-index.d.ts +2 -0
- package/dist/commands/daemon-index.js +44 -0
- package/dist/commands/daemon.js +13 -8
- package/dist/commands/doctor.js +3 -4
- package/dist/commands/exec.d.ts +5 -0
- package/dist/commands/exec.js +35 -7
- package/dist/commands/feed-watch.js +12 -0
- package/dist/commands/feed.d.ts +1 -1
- package/dist/commands/feed.js +7 -4
- package/dist/commands/insights.js +3 -1
- package/dist/commands/inspect.js +1 -1
- package/dist/commands/logs.js +2 -1
- package/dist/commands/mailboxes.js +1 -1
- package/dist/commands/models.js +1 -1
- package/dist/commands/projects.js +3 -3
- package/dist/commands/prune.js +6 -28
- package/dist/commands/ps-roster.d.ts +0 -1
- package/dist/commands/ps-roster.js +2 -21
- package/dist/commands/ps.js +13 -1
- package/dist/commands/recordings.d.ts +2 -0
- package/dist/commands/recordings.js +117 -0
- package/dist/commands/routines.js +1 -1
- package/dist/commands/secrets-passthrough.js +3 -3
- package/dist/commands/send.js +33 -20
- package/dist/commands/sessions-backfill.d.ts +1 -0
- package/dist/commands/sessions-backfill.js +48 -13
- package/dist/commands/sessions-migrate.d.ts +1 -1
- package/dist/commands/sessions-migrate.js +11 -10
- package/dist/commands/sessions-optimize.d.ts +1 -0
- package/dist/commands/sessions-optimize.js +7 -4
- package/dist/commands/sessions-resume.js +8 -1
- package/dist/commands/sessions-stats.d.ts +2 -0
- package/dist/commands/sessions-stats.js +24 -7
- package/dist/commands/sessions.d.ts +5 -11
- package/dist/commands/sessions.js +8 -236
- package/dist/commands/setup-computer.js +1 -2
- package/dist/commands/setup-mine.js +0 -1
- package/dist/commands/setup.js +1 -1
- package/dist/commands/sync.js +101 -1
- package/dist/commands/teams.js +2 -2
- package/dist/commands/testdata/feed-hub.js +11 -0
- package/dist/commands/trash.d.ts +0 -1
- package/dist/commands/trash.js +74 -10
- package/dist/lib/accounting/usage-sync.js +7 -0
- package/dist/lib/agent-modes.d.ts +1 -1
- package/dist/lib/agent-modes.js +11 -5
- package/dist/lib/auth-mint.d.ts +4 -0
- package/dist/lib/auth-mint.js +6 -4
- package/dist/lib/browser/native-history.test-fixture.d.ts +12 -0
- package/dist/lib/browser/native-history.test-fixture.js +43 -0
- package/dist/lib/browser/paths.d.ts +5 -0
- package/dist/lib/browser/paths.js +7 -1
- package/dist/lib/browser/sessions-list.d.ts +28 -1
- package/dist/lib/browser/sessions-list.js +137 -25
- package/dist/lib/channels/providers/rush.d.ts +2 -1
- package/dist/lib/channels/providers/rush.js +2 -2
- package/dist/lib/channels/providers/session.d.ts +1 -0
- package/dist/lib/channels/providers/session.js +23 -12
- package/dist/lib/channels/registry.d.ts +9 -2
- package/dist/lib/channels/send.d.ts +5 -10
- package/dist/lib/channels/send.js +88 -50
- package/dist/lib/cloud/rush.d.ts +6 -0
- package/dist/lib/cloud/rush.js +18 -3
- package/dist/lib/computer-client.d.ts +19 -0
- package/dist/lib/computer-client.js +104 -0
- package/dist/lib/config-keys.d.ts +5 -1
- package/dist/lib/config-keys.js +14 -11
- package/dist/lib/daemon/auth-sync-service.js +13 -0
- package/dist/lib/daemon/daemon.js +20 -23
- package/dist/lib/daemon/owner-device-delivery-service.d.ts +10 -0
- package/dist/lib/daemon/owner-device-delivery-service.js +28 -0
- package/dist/lib/daemon-services.d.ts +2 -1
- package/dist/lib/daemon-services.js +17 -10
- package/dist/lib/daemon-webhooks.d.ts +1 -1
- package/dist/lib/daemon-webhooks.js +1 -1
- package/dist/lib/device-config.d.ts +4 -1
- package/dist/lib/device-config.js +58 -8
- package/dist/lib/devices/doctor-findings.d.ts +2 -3
- package/dist/lib/devices/doctor-findings.js +10 -19
- package/dist/lib/event-provenance.d.ts +1 -0
- package/dist/lib/event-provenance.js +2 -0
- package/dist/lib/exec.d.ts +1 -0
- package/dist/lib/exec.js +20 -15
- package/dist/lib/feed/pr-status.d.ts +5 -1
- package/dist/lib/feed/pr-status.js +44 -3
- package/dist/lib/feed/tool-activity.js +9 -6
- package/dist/lib/feed/tools.d.ts +4 -1
- package/dist/lib/feed/tools.js +8 -11
- package/dist/lib/feed-broadcast.d.ts +5 -3
- package/dist/lib/feed-broadcast.js +47 -36
- package/dist/lib/fleet-shared-state.d.ts +5 -0
- package/dist/lib/fleet-shared-state.js +8 -0
- package/dist/lib/github/project-prs.d.ts +4 -1
- package/dist/lib/github/project-prs.js +20 -7
- package/dist/lib/help.d.ts +1 -0
- package/dist/lib/help.js +8 -0
- package/dist/lib/helper-versions.js +1 -1
- package/dist/lib/hosts/passthrough.js +5 -9
- package/dist/lib/hosts/remote-cmd.d.ts +2 -7
- package/dist/lib/hosts/remote-cmd.js +14 -22
- package/dist/lib/hosts/routing-flag.d.ts +22 -0
- package/dist/lib/hosts/routing-flag.js +127 -14
- package/dist/lib/identity/index.d.ts +22 -0
- package/dist/lib/identity/index.js +3 -0
- package/dist/lib/installations/migrate.d.ts +7 -0
- package/dist/lib/installations/migrate.js +99 -88
- package/dist/lib/installations/versions.js +2 -2
- package/dist/lib/launch-identity.d.ts +6 -1
- package/dist/lib/launch-identity.js +12 -2
- package/dist/lib/menubar/install-menubar.d.ts +1 -0
- package/dist/lib/menubar/install-menubar.js +8 -5
- package/dist/lib/menubar/snapshot.js +2 -3
- package/dist/lib/notify.d.ts +7 -14
- package/dist/lib/notify.js +29 -75
- package/dist/lib/owner-message.d.ts +4 -6
- package/dist/lib/owner-message.js +12 -11
- package/dist/lib/owner-notify-tokens.d.ts +49 -0
- package/dist/lib/owner-notify-tokens.js +214 -0
- package/dist/lib/owner-notify.d.ts +75 -0
- package/dist/lib/owner-notify.js +144 -0
- package/dist/lib/plugins/plugins.d.ts +7 -1
- package/dist/lib/plugins/plugins.js +26 -5
- package/dist/lib/pr-land-detach.js +2 -2
- package/dist/lib/recordings/config.d.ts +11 -0
- package/dist/lib/recordings/config.js +54 -0
- package/dist/lib/recordings/identity.d.ts +12 -0
- package/dist/lib/recordings/identity.js +57 -0
- package/dist/lib/recordings/ledger.d.ts +16 -0
- package/dist/lib/recordings/ledger.js +141 -0
- package/dist/lib/recordings/model.d.ts +29 -0
- package/dist/lib/recordings/model.js +28 -0
- package/dist/lib/recordings/pipeline.d.ts +44 -0
- package/dist/lib/recordings/pipeline.js +272 -0
- package/dist/lib/recordings/process.d.ts +17 -0
- package/dist/lib/recordings/process.js +94 -0
- package/dist/lib/recordings/service.d.ts +15 -0
- package/dist/lib/recordings/service.js +45 -0
- package/dist/lib/recordings/settle.d.ts +21 -0
- package/dist/lib/recordings/settle.js +92 -0
- package/dist/lib/recordings/transcode.d.ts +13 -0
- package/dist/lib/recordings/transcode.js +44 -0
- package/dist/lib/refresh.js +4 -1
- package/dist/lib/reminders.d.ts +0 -1
- package/dist/lib/reminders.js +1 -1
- package/dist/lib/reserved-stores.d.ts +3 -0
- package/dist/lib/reserved-stores.js +13 -0
- package/dist/lib/routine-notify-owner.d.ts +3 -23
- package/dist/lib/routine-notify-owner.js +26 -107
- package/dist/lib/rush-api.d.ts +1 -0
- package/dist/lib/rush-api.js +1 -0
- package/dist/lib/scheduling/routines.d.ts +1 -1
- package/dist/lib/scheduling/routines.js +1 -1
- package/dist/lib/session/active.d.ts +18 -2
- package/dist/lib/session/active.js +47 -37
- package/dist/lib/session/cloud.js +18 -45
- package/dist/lib/session/db.d.ts +3 -1
- package/dist/lib/session/db.js +64 -32
- package/dist/lib/session/glance-files.d.ts +4 -3
- package/dist/lib/session/glance-files.js +31 -0
- package/dist/lib/session/inject-target.js +12 -2
- package/dist/lib/session/pid-registry.d.ts +2 -0
- package/dist/lib/session/pid-registry.js +6 -2
- package/dist/lib/session/presentation.d.ts +21 -0
- package/dist/lib/session/presentation.js +198 -0
- package/dist/lib/session/projection.js +9 -2
- package/dist/lib/sqlite.d.ts +3 -1
- package/dist/lib/sqlite.js +7 -3
- package/dist/lib/staleness/index.js +12 -0
- package/dist/lib/staleness/types.d.ts +5 -0
- package/dist/lib/standalone-tools.js +1 -1
- package/dist/lib/startup/command-registry.js +10 -5
- package/dist/lib/state.d.ts +2 -5
- package/dist/lib/state.js +3 -11
- package/dist/lib/sync-delete.d.ts +21 -0
- package/dist/lib/sync-delete.js +113 -0
- package/dist/lib/terminal/inject.js +1 -1
- package/dist/lib/testdata/owner-notify-api.d.ts +36 -0
- package/dist/lib/testdata/owner-notify-api.js +102 -0
- package/dist/lib/trash.d.ts +14 -0
- package/dist/lib/trash.js +75 -0
- package/dist/lib/types.d.ts +0 -34
- package/package.json +1 -3
- package/dist/commands/feedback.d.ts +0 -2
- package/dist/commands/feedback.js +0 -68
- package/dist/commands/humans.d.ts +0 -2
- package/dist/commands/humans.js +0 -83
- package/dist/commands/modes.d.ts +0 -2
- package/dist/commands/modes.js +0 -134
- package/dist/commands/monitors.d.ts +0 -2
- package/dist/commands/monitors.js +0 -1070
- package/dist/commands/reminders.d.ts +0 -2
- package/dist/commands/reminders.js +0 -49
- package/dist/lib/channels/owner-forward.d.ts +0 -25
- package/dist/lib/channels/owner-forward.js +0 -78
- package/dist/lib/channels/owner-sink.d.ts +0 -10
- package/dist/lib/channels/owner-sink.js +0 -26
- package/dist/lib/daemon/monitor-engine-service.d.ts +0 -13
- package/dist/lib/daemon/monitor-engine-service.js +0 -25
- package/dist/lib/humans.d.ts +0 -12
- package/dist/lib/humans.js +0 -64
- package/dist/lib/monitors/config.d.ts +0 -77
- package/dist/lib/monitors/config.js +0 -405
- package/dist/lib/monitors/dispatch.d.ts +0 -10
- package/dist/lib/monitors/dispatch.js +0 -72
- package/dist/lib/monitors/engine.d.ts +0 -45
- package/dist/lib/monitors/engine.js +0 -243
- package/dist/lib/monitors/fingerprint.d.ts +0 -3
- package/dist/lib/monitors/fingerprint.js +0 -43
- package/dist/lib/monitors/pid-watch.d.ts +0 -4
- package/dist/lib/monitors/pid-watch.js +0 -14
- package/dist/lib/monitors/remote.d.ts +0 -31
- package/dist/lib/monitors/remote.js +0 -63
- package/dist/lib/monitors/sources/command.d.ts +0 -4
- package/dist/lib/monitors/sources/command.js +0 -20
- package/dist/lib/monitors/sources/device.d.ts +0 -3
- package/dist/lib/monitors/sources/device.js +0 -31
- package/dist/lib/monitors/sources/failure.d.ts +0 -5
- package/dist/lib/monitors/sources/failure.js +0 -25
- package/dist/lib/monitors/sources/file.d.ts +0 -4
- package/dist/lib/monitors/sources/file.js +0 -46
- package/dist/lib/monitors/sources/http.d.ts +0 -3
- package/dist/lib/monitors/sources/http.js +0 -25
- package/dist/lib/monitors/sources/index.d.ts +0 -5
- package/dist/lib/monitors/sources/index.js +0 -22
- package/dist/lib/monitors/sources/poll.d.ts +0 -1
- package/dist/lib/monitors/sources/poll.js +0 -1
- package/dist/lib/monitors/sources/types.d.ts +0 -9
- package/dist/lib/monitors/sources/webhook.d.ts +0 -3
- package/dist/lib/monitors/sources/webhook.js +0 -3
- package/dist/lib/monitors/sources/ws.d.ts +0 -4
- package/dist/lib/monitors/sources/ws.js +0 -35
- package/dist/lib/monitors/state.d.ts +0 -51
- package/dist/lib/monitors/state.js +0 -221
- /package/dist/{lib/monitors/sources/types.js → commands/testdata/feed-hub.d.ts} +0 -0
package/dist/commands/humans.js
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { setHelpSections } from '../lib/help.js';
|
|
2
|
-
import { readHumans, getOwnerFromHumans } from '../lib/humans.js';
|
|
3
|
-
export function registerHumansCommands(program) {
|
|
4
|
-
const humansCmd = program
|
|
5
|
-
.command('humans')
|
|
6
|
-
.description('Inspect owner identity and notification channel config (humans.yaml)');
|
|
7
|
-
setHelpSections(humansCmd, {
|
|
8
|
-
examples: `
|
|
9
|
-
# Show owner identity and channel config as JSON
|
|
10
|
-
agents humans show owner --json
|
|
11
|
-
|
|
12
|
-
# Show owner identity in human-readable form
|
|
13
|
-
agents humans show owner
|
|
14
|
-
`,
|
|
15
|
-
notes: `
|
|
16
|
-
humans.yaml is the canonical owner identity file at ~/.agents/humans.yaml.
|
|
17
|
-
It is populated by migrating notify.owner from agents.yaml and frontmatter
|
|
18
|
-
from owner.md. Use \`agents humans show owner\` to inspect the current config.
|
|
19
|
-
`,
|
|
20
|
-
});
|
|
21
|
-
const showCmd = humansCmd
|
|
22
|
-
.command('show')
|
|
23
|
-
.description('Show config from humans.yaml');
|
|
24
|
-
setHelpSections(showCmd, {
|
|
25
|
-
examples: `
|
|
26
|
-
agents humans show owner
|
|
27
|
-
agents humans show owner --json
|
|
28
|
-
`,
|
|
29
|
-
});
|
|
30
|
-
showCmd
|
|
31
|
-
.command('owner')
|
|
32
|
-
.description('Show the configured owner identity and notification channels')
|
|
33
|
-
.option('--json', 'Output as JSON')
|
|
34
|
-
.action((opts) => {
|
|
35
|
-
const humans = readHumans();
|
|
36
|
-
if (!humans) {
|
|
37
|
-
if (opts.json) {
|
|
38
|
-
process.stdout.write(JSON.stringify(null) + '\n');
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
process.stderr.write('humans.yaml not found — run `agents` once to trigger migration\n');
|
|
42
|
-
process.exitCode = 1;
|
|
43
|
-
}
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
const owner = getOwnerFromHumans();
|
|
47
|
-
if (opts.json) {
|
|
48
|
-
process.stdout.write(JSON.stringify(owner ?? null, null, 2) + '\n');
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
if (!owner) {
|
|
52
|
-
process.stdout.write('No owner configured in humans.yaml\n');
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
if (owner.name)
|
|
56
|
-
process.stdout.write(`Name: ${owner.name}\n`);
|
|
57
|
-
if (owner.timezone)
|
|
58
|
-
process.stdout.write(`Timezone: ${owner.timezone}\n`);
|
|
59
|
-
if (owner.quiet_hours)
|
|
60
|
-
process.stdout.write(`Quiet: ${owner.quiet_hours}\n`);
|
|
61
|
-
if (owner.default_severity)
|
|
62
|
-
process.stdout.write(`Severity: ${owner.default_severity}\n`);
|
|
63
|
-
if (owner.notify) {
|
|
64
|
-
process.stdout.write(`Notify: channel=${owner.notify.channel} to=${owner.notify.to}\n`);
|
|
65
|
-
}
|
|
66
|
-
if (owner.channels?.length) {
|
|
67
|
-
process.stdout.write(`Channels:\n`);
|
|
68
|
-
for (const ch of owner.channels) {
|
|
69
|
-
const extra = [ch.transport, ch.intrusive ? 'intrusive' : null].filter(Boolean).join(', ');
|
|
70
|
-
process.stdout.write(` - ${ch.id}${extra ? ` (${extra})` : ''}\n`);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
if (owner.policy) {
|
|
74
|
-
process.stdout.write(`Policy:\n`);
|
|
75
|
-
for (const [sev, channels] of Object.entries(owner.policy)) {
|
|
76
|
-
if (Array.isArray(channels) && channels.length) {
|
|
77
|
-
process.stdout.write(` ${sev}: ${channels.join(', ')}\n`);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
}
|
package/dist/commands/modes.d.ts
DELETED
package/dist/commands/modes.js
DELETED
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
2
|
-
import { AGENTS, ALL_AGENT_IDS, agentLabel, formatAgentError, resolveAgentName, } from '../lib/agents.js';
|
|
3
|
-
import { formatModeFlags, getAgentModesCatalog, } from '../lib/agent-modes.js';
|
|
4
|
-
import { setHelpSections } from '../lib/help.js';
|
|
5
|
-
import { getGlobalDefault, listInstalledVersions, resolveVersion, resolveVersionAlias } from '../lib/installations/versions.js';
|
|
6
|
-
const MODE_AGENTS = ALL_AGENT_IDS.filter((id) => !AGENTS[id].deprecated?.hard);
|
|
7
|
-
export function registerModesCommand(program) {
|
|
8
|
-
const modes = program
|
|
9
|
-
.command('modes [agentSpec]')
|
|
10
|
-
.description('Show which permission modes (--mode plan|edit|auto|skip) a harness supports for agents run / teams add')
|
|
11
|
-
.option('--json', 'Output machine-readable JSON')
|
|
12
|
-
.action((agentSpec, options) => {
|
|
13
|
-
const targets = resolveTargets(agentSpec);
|
|
14
|
-
if (targets.length === 0)
|
|
15
|
-
process.exit(1);
|
|
16
|
-
if (options.json) {
|
|
17
|
-
const out = targets.map(({ agent, version }) => {
|
|
18
|
-
const catalog = getAgentModesCatalog(agent, version);
|
|
19
|
-
return {
|
|
20
|
-
agent,
|
|
21
|
-
version,
|
|
22
|
-
defaultMode: catalog.defaultMode,
|
|
23
|
-
configuredMode: catalog.configuredMode,
|
|
24
|
-
configuredModeSource: catalog.configuredModeSource,
|
|
25
|
-
headlessPlan: catalog.headlessPlan,
|
|
26
|
-
modes: catalog.modes.map((m) => ({
|
|
27
|
-
mode: m.mode,
|
|
28
|
-
flags: m.flags,
|
|
29
|
-
description: m.description,
|
|
30
|
-
isDefault: m.isDefault,
|
|
31
|
-
})),
|
|
32
|
-
unsupported: catalog.unsupported,
|
|
33
|
-
notes: catalog.notes,
|
|
34
|
-
};
|
|
35
|
-
});
|
|
36
|
-
console.log(JSON.stringify(out, null, 2));
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
let printed = 0;
|
|
40
|
-
for (const { agent, version, isDefault } of targets) {
|
|
41
|
-
if (printed > 0)
|
|
42
|
-
console.log();
|
|
43
|
-
printCatalog(getAgentModesCatalog(agent, version), version, isDefault);
|
|
44
|
-
printed++;
|
|
45
|
-
}
|
|
46
|
-
if (!agentSpec) {
|
|
47
|
-
console.log(chalk.gray('\n `agents modes <agent>` for one harness · `agents modes claude@2.1.219` for a version\'s run default'));
|
|
48
|
-
console.log(chalk.gray(' Pass --mode on `agents run` / `agents teams add`. Models: `agents models <agent>`.'));
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
setHelpSections(modes, {
|
|
52
|
-
examples: `
|
|
53
|
-
agents modes
|
|
54
|
-
agents modes claude
|
|
55
|
-
agents modes claude@2.1.219
|
|
56
|
-
agents modes cursor --json
|
|
57
|
-
`,
|
|
58
|
-
notes: `
|
|
59
|
-
Permission modes control how much the agent can do (not which LLM model
|
|
60
|
-
runs — that is --model / agents models). Supported modes come from each
|
|
61
|
-
harness's capabilities table; unsupported requests degrade (auto→edit,
|
|
62
|
-
plan→safest native) or error (skip when missing).
|
|
63
|
-
'full' is a silent alias for skip.
|
|
64
|
-
agent@version is accepted so any configured run.defaults mode for that
|
|
65
|
-
version is shown; the mode list itself is per-agent today.
|
|
66
|
-
`,
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
function resolveTargets(agentSpec) {
|
|
70
|
-
if (!agentSpec) {
|
|
71
|
-
const targets = [];
|
|
72
|
-
for (const agent of MODE_AGENTS) {
|
|
73
|
-
const version = getGlobalDefault(agent) || listInstalledVersions(agent)[0] || null;
|
|
74
|
-
targets.push({ agent, version, isDefault: true });
|
|
75
|
-
}
|
|
76
|
-
return targets;
|
|
77
|
-
}
|
|
78
|
-
const [agentName, versionSpec] = agentSpec.split('@');
|
|
79
|
-
const agent = resolveAgentName(agentName);
|
|
80
|
-
if (!agent) {
|
|
81
|
-
console.error(chalk.red(formatAgentError(agentName, MODE_AGENTS)));
|
|
82
|
-
return [];
|
|
83
|
-
}
|
|
84
|
-
if (AGENTS[agent].deprecated?.hard) {
|
|
85
|
-
console.error(chalk.yellow(`${agent} is deprecated and no longer supports run modes.`));
|
|
86
|
-
return [];
|
|
87
|
-
}
|
|
88
|
-
if (versionSpec === 'all') {
|
|
89
|
-
const installed = listInstalledVersions(agent);
|
|
90
|
-
if (installed.length === 0) {
|
|
91
|
-
return [{ agent, version: null, isDefault: true }];
|
|
92
|
-
}
|
|
93
|
-
return installed.map((v) => ({
|
|
94
|
-
agent,
|
|
95
|
-
version: v,
|
|
96
|
-
isDefault: v === getGlobalDefault(agent),
|
|
97
|
-
}));
|
|
98
|
-
}
|
|
99
|
-
if (versionSpec) {
|
|
100
|
-
const version = resolveVersionAlias(agent, versionSpec) ?? null;
|
|
101
|
-
return [{ agent, version, isDefault: version === getGlobalDefault(agent) }];
|
|
102
|
-
}
|
|
103
|
-
const version = resolveVersion(agent, process.cwd()) || getGlobalDefault(agent) || null;
|
|
104
|
-
return [{ agent, version, isDefault: true }];
|
|
105
|
-
}
|
|
106
|
-
function printCatalog(catalog, version, isDefault) {
|
|
107
|
-
const tag = version
|
|
108
|
-
? ` ${chalk.bold(version)}${isDefault ? chalk.gray(' (default)') : ''}`
|
|
109
|
-
: chalk.gray(' (not installed)');
|
|
110
|
-
console.log(`${agentLabel(catalog.agent)}${tag}`);
|
|
111
|
-
console.log(chalk.gray(' modes:'));
|
|
112
|
-
for (const entry of catalog.modes) {
|
|
113
|
-
const star = entry.isDefault ? chalk.cyan('*') : ' ';
|
|
114
|
-
const flags = chalk.gray(formatModeFlags(entry.flags));
|
|
115
|
-
console.log(` ${star} ${chalk.cyan(entry.mode.padEnd(6))} ${chalk.bold(entry.description)} ${flags}`);
|
|
116
|
-
}
|
|
117
|
-
if (catalog.unsupported.length > 0) {
|
|
118
|
-
console.log(chalk.gray(` unsupported: ${catalog.unsupported.join(', ')}`));
|
|
119
|
-
}
|
|
120
|
-
const defaultBits = [`native default ${chalk.white(catalog.defaultMode)}`];
|
|
121
|
-
if (catalog.configuredMode) {
|
|
122
|
-
const src = catalog.configuredModeSource ? chalk.gray(` (${catalog.configuredModeSource})`) : '';
|
|
123
|
-
defaultBits.push(`run default ${chalk.white(catalog.configuredMode)}${src}`);
|
|
124
|
-
}
|
|
125
|
-
console.log(chalk.gray(` ${defaultBits.join(' · ')}`));
|
|
126
|
-
if (!catalog.headlessPlan && catalog.modes.some((m) => m.mode === 'plan')) {
|
|
127
|
-
console.log(chalk.yellow(' headless plan: not supported (interactive plan still works)'));
|
|
128
|
-
}
|
|
129
|
-
for (const note of catalog.notes) {
|
|
130
|
-
if (note.startsWith("'full'"))
|
|
131
|
-
continue;
|
|
132
|
-
console.log(chalk.gray(` note: ${note}`));
|
|
133
|
-
}
|
|
134
|
-
}
|