@phnx-labs/agents-cli 1.23.13 → 1.23.14

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.
Files changed (162) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/README.md +30 -59
  3. package/dist/cli/command-registry.js +0 -24
  4. package/dist/commands/accounts.js +3 -3
  5. package/dist/commands/daemon.js +5 -147
  6. package/dist/commands/doctor.js +7 -0
  7. package/dist/commands/events-logs.d.ts +2 -0
  8. package/dist/commands/{logs.js → events-logs.js} +28 -127
  9. package/dist/commands/events.js +3 -1
  10. package/dist/commands/exec.d.ts +0 -1
  11. package/dist/commands/exec.js +3 -11
  12. package/dist/commands/feed.d.ts +1 -1
  13. package/dist/commands/feed.js +4 -7
  14. package/dist/commands/mcp.js +1 -1
  15. package/dist/commands/menubar.js +12 -226
  16. package/dist/commands/projects.js +1 -2
  17. package/dist/commands/{trash.d.ts → prune-trash.d.ts} +1 -1
  18. package/dist/commands/{trash.js → prune-trash.js} +8 -8
  19. package/dist/commands/prune.js +3 -1
  20. package/dist/commands/send.js +2 -5
  21. package/dist/commands/sessions.js +1 -1
  22. package/dist/commands/ssh.js +2 -2
  23. package/dist/commands/utils.d.ts +1 -5
  24. package/dist/commands/utils.js +1 -7
  25. package/dist/lib/agent-spec/agents.d.ts +0 -2
  26. package/dist/lib/agent-spec/agents.js +0 -12
  27. package/dist/lib/agent-spec/index.d.ts +0 -4
  28. package/dist/lib/agent-spec/index.js +0 -4
  29. package/dist/lib/commands.d.ts +1 -5
  30. package/dist/lib/commands.js +2 -69
  31. package/dist/lib/comms-render.d.ts +0 -7
  32. package/dist/lib/comms-render.js +0 -41
  33. package/dist/lib/config-keys.d.ts +1 -1
  34. package/dist/lib/config-keys.js +8 -0
  35. package/dist/lib/daemon/daemon.js +1 -6
  36. package/dist/lib/daemon-services.d.ts +1 -1
  37. package/dist/lib/daemon-services.js +0 -5
  38. package/dist/lib/device-config.d.ts +2 -0
  39. package/dist/lib/device-config.js +81 -8
  40. package/dist/lib/devices/doctor-findings.d.ts +6 -1
  41. package/dist/lib/devices/doctor-findings.js +34 -1
  42. package/dist/lib/git.d.ts +1 -0
  43. package/dist/lib/git.js +5 -0
  44. package/dist/lib/hooks/install.d.ts +0 -7
  45. package/dist/lib/hooks/install.js +0 -55
  46. package/dist/lib/hosts/passthrough.js +2 -4
  47. package/dist/lib/hosts/progress.js +2 -2
  48. package/dist/lib/hosts/remote-cmd.js +0 -1
  49. package/dist/lib/installations/migrate.d.ts +1 -0
  50. package/dist/lib/installations/migrate.js +18 -1
  51. package/dist/lib/installations/versions.js +2 -2
  52. package/dist/lib/loop.js +1 -1
  53. package/dist/lib/mailbox-target.d.ts +0 -31
  54. package/dist/lib/mailbox-target.js +0 -37
  55. package/dist/lib/mcp-lookup.d.ts +7 -0
  56. package/dist/lib/mcp-lookup.js +71 -0
  57. package/dist/lib/mcp.d.ts +0 -8
  58. package/dist/lib/mcp.js +0 -47
  59. package/dist/lib/menubar/install-menubar.d.ts +0 -15
  60. package/dist/lib/menubar/install-menubar.js +24 -118
  61. package/dist/lib/menubar/resolve-version.d.ts +9 -10
  62. package/dist/lib/menubar/resolve-version.js +70 -30
  63. package/dist/lib/paths.d.ts +0 -1
  64. package/dist/lib/paths.js +0 -18
  65. package/dist/lib/plugins/skills.d.ts +0 -10
  66. package/dist/lib/plugins/skills.js +2 -165
  67. package/dist/lib/project-pull.js +1 -2
  68. package/dist/lib/resources.d.ts +1 -1
  69. package/dist/lib/routines-project.js +1 -1
  70. package/dist/lib/session/local-tmux-attach.js +2 -2
  71. package/dist/lib/startup/command-registry.js +20 -7
  72. package/dist/lib/teams/agents.js +1 -1
  73. package/dist/lib/triggers/webhook.d.ts +2 -59
  74. package/dist/lib/triggers/webhook.js +2 -422
  75. package/package.json +2 -1
  76. package/dist/commands/funnel.d.ts +0 -2
  77. package/dist/commands/funnel.js +0 -77
  78. package/dist/commands/logs.d.ts +0 -2
  79. package/dist/commands/mailboxes.d.ts +0 -2
  80. package/dist/commands/mailboxes.js +0 -400
  81. package/dist/commands/message.d.ts +0 -2
  82. package/dist/commands/message.js +0 -259
  83. package/dist/commands/packages-materialize.d.ts +0 -6
  84. package/dist/commands/packages-materialize.js +0 -90
  85. package/dist/commands/packages.d.ts +0 -5
  86. package/dist/commands/packages.js +0 -763
  87. package/dist/commands/route.d.ts +0 -2
  88. package/dist/commands/route.js +0 -259
  89. package/dist/commands/testdata/feed-hub.d.ts +0 -1
  90. package/dist/commands/testdata/feed-hub.js +0 -11
  91. package/dist/commands/tmux.d.ts +0 -7
  92. package/dist/commands/tmux.js +0 -529
  93. package/dist/commands/traces.d.ts +0 -2
  94. package/dist/commands/traces.js +0 -204
  95. package/dist/commands/webhook.d.ts +0 -5
  96. package/dist/commands/webhook.js +0 -105
  97. package/dist/lib/agent-spec/materialize.d.ts +0 -3
  98. package/dist/lib/agent-spec/materialize.js +0 -277
  99. package/dist/lib/agent-spec/package-resolve.d.ts +0 -4
  100. package/dist/lib/agent-spec/package-resolve.js +0 -231
  101. package/dist/lib/agent-spec/package-schema.d.ts +0 -3
  102. package/dist/lib/agent-spec/package-schema.js +0 -136
  103. package/dist/lib/agent-spec/package-types.d.ts +0 -94
  104. package/dist/lib/agent-spec/package-types.js +0 -10
  105. package/dist/lib/daemon/testdata/process-view-daemon.d.ts +0 -1
  106. package/dist/lib/daemon/testdata/process-view-daemon.js +0 -12
  107. package/dist/lib/daemon/testdata/process-view-start.d.ts +0 -1
  108. package/dist/lib/daemon/testdata/process-view-start.js +0 -41
  109. package/dist/lib/daemon/webhook-receiver-service.d.ts +0 -8
  110. package/dist/lib/daemon/webhook-receiver-service.js +0 -16
  111. package/dist/lib/daemon-webhooks.d.ts +0 -48
  112. package/dist/lib/daemon-webhooks.js +0 -177
  113. package/dist/lib/funnel.d.ts +0 -6
  114. package/dist/lib/funnel.js +0 -31
  115. package/dist/lib/net-close.d.ts +0 -2
  116. package/dist/lib/net-close.js +0 -20
  117. package/dist/lib/packages/output-home.d.ts +0 -9
  118. package/dist/lib/packages/output-home.js +0 -89
  119. package/dist/lib/registry.d.ts +0 -65
  120. package/dist/lib/registry.js +0 -432
  121. package/dist/lib/routers.d.ts +0 -25
  122. package/dist/lib/routers.js +0 -122
  123. package/dist/lib/run-trace-sync.d.ts +0 -7
  124. package/dist/lib/run-trace-sync.js +0 -35
  125. package/dist/lib/session/testdata/pid-registry-namespace.d.ts +0 -1
  126. package/dist/lib/session/testdata/pid-registry-namespace.js +0 -25
  127. package/dist/lib/session/testdata/process-view-namespace.d.ts +0 -1
  128. package/dist/lib/session/testdata/process-view-namespace.js +0 -56
  129. package/dist/lib/session/testdata/process-view-private.d.ts +0 -1
  130. package/dist/lib/session/testdata/process-view-private.js +0 -11
  131. package/dist/lib/testdata/daemon-health-writer.d.ts +0 -1
  132. package/dist/lib/testdata/daemon-health-writer.js +0 -8
  133. package/dist/lib/testdata/owner-notify-api.d.ts +0 -23
  134. package/dist/lib/testdata/owner-notify-api.js +0 -82
  135. package/dist/lib/testdata/refresh-coordinator-worker.d.ts +0 -1
  136. package/dist/lib/testdata/refresh-coordinator-worker.js +0 -23
  137. package/dist/lib/traces/backend.d.ts +0 -8
  138. package/dist/lib/traces/backend.js +0 -33
  139. package/dist/lib/traces/classify.d.ts +0 -40
  140. package/dist/lib/traces/classify.js +0 -70
  141. package/dist/lib/traces/config.d.ts +0 -2
  142. package/dist/lib/traces/config.js +0 -2
  143. package/dist/lib/traces/insights.d.ts +0 -30
  144. package/dist/lib/traces/insights.js +0 -198
  145. package/dist/lib/traces/phenotype.d.ts +0 -18
  146. package/dist/lib/traces/phenotype.js +0 -335
  147. package/dist/lib/traces/provision.d.ts +0 -16
  148. package/dist/lib/traces/provision.js +0 -25
  149. package/dist/lib/traces/schema2-build.d.ts +0 -28
  150. package/dist/lib/traces/schema2-build.js +0 -496
  151. package/dist/lib/traces/schema2-danger.d.ts +0 -7
  152. package/dist/lib/traces/schema2-danger.js +0 -123
  153. package/dist/lib/traces/schema2.d.ts +0 -139
  154. package/dist/lib/traces/schema2.js +0 -20
  155. package/dist/lib/traces/segments.d.ts +0 -73
  156. package/dist/lib/traces/segments.js +0 -236
  157. package/dist/lib/traces/sync.d.ts +0 -197
  158. package/dist/lib/traces/sync.js +0 -654
  159. package/dist/lib/traces/worker-template.d.ts +0 -1
  160. package/dist/lib/traces/worker-template.js +0 -292
  161. package/dist/lib/triggers/handlers.d.ts +0 -66
  162. package/dist/lib/triggers/handlers.js +0 -383
@@ -126,13 +126,13 @@ export function restoreVersion(target) {
126
126
  const entry = pickLatest(entries, agent, version);
127
127
  if (!entry) {
128
128
  console.error(chalk.red(`No trashed copy found for ${agent}@${version}`));
129
- console.error(chalk.gray('Run `agents trash list` to see what exists.'));
129
+ console.error(chalk.gray('Run `agents prune trash list` to see what exists.'));
130
130
  process.exit(1);
131
131
  }
132
132
  const dest = getVersionDir(agent, version);
133
133
  if (fs.existsSync(dest)) {
134
134
  console.error(chalk.red(`Cannot restore: ${dest} already exists.`));
135
- console.error(chalk.gray('Move or remove the existing dir first, then re-run agents trash restore.'));
135
+ console.error(chalk.gray('Move or remove the existing dir first, then re-run agents prune trash restore.'));
136
136
  process.exit(1);
137
137
  }
138
138
  try {
@@ -154,8 +154,8 @@ export function restoreVersion(target) {
154
154
  catch { }
155
155
  console.log(chalk.green(`Restored ${agentLabel(agent)}@${version} to ${dest}`));
156
156
  }
157
- export function registerTrashCommands(program) {
158
- const trash = program
157
+ export function registerPruneTrashCommands(prune) {
158
+ const trash = prune
159
159
  .command('trash')
160
160
  .description('Inspect, restore, and empty soft-deleted agent versions and resources');
161
161
  trash
@@ -183,7 +183,7 @@ export function registerTrashCommands(program) {
183
183
  chalk.gray(`${e.stamp} ${size} ${e.trashPath}`));
184
184
  }
185
185
  console.log();
186
- console.log(chalk.gray('Restore with: agents trash restore <agent>@<version>'));
186
+ console.log(chalk.gray('Restore with: agents prune trash restore <agent>@<version>'));
187
187
  });
188
188
  trash
189
189
  .command('restore <target>')
@@ -197,9 +197,9 @@ export function registerTrashCommands(program) {
197
197
  .action(async (opts) => runTrashEmpty(opts));
198
198
  setHelpSections(empty, {
199
199
  examples: `
200
- agents trash list
201
- agents trash empty --older-than 30d
202
- agents trash empty --yes
200
+ agents prune trash list
201
+ agents prune trash empty --older-than 30d
202
+ agents prune trash empty --yes
203
203
  `,
204
204
  notes: `
205
205
  Removes items from ~/.agents/.history/trash for good; they cannot be
@@ -11,6 +11,7 @@ import { resolveAgentName, formatAgentError } from '../lib/agents.js';
11
11
  import { pruneDuplicates } from './view.js';
12
12
  import { isInteractiveTerminal, isPromptCancelled } from './utils.js';
13
13
  import { previewRunsPrune, pruneRuns, countAllRuns } from '../lib/scheduling/routines.js';
14
+ import { registerPruneTrashCommands } from './prune-trash.js';
14
15
  const RESOURCE_TYPES = ['commands', 'skills', 'hooks', 'plugins', 'subagents'];
15
16
  const STATE_TYPES = ['sessions', 'runs'];
16
17
  const ALL_TYPES = [...RESOURCE_TYPES, 'versions', ...STATE_TYPES];
@@ -274,7 +275,7 @@ What's an orphan?
274
275
  Durability:
275
276
  Version prune and cleanup move version directories to
276
277
  ~/.agents/.history/trash/versions/<agent>/<version>/<timestamp>/. Nothing is
277
- hard-deleted until you run \`agents trash empty\`. Session records are durable;
278
+ hard-deleted until you run \`agents prune trash empty\`. Session records are durable;
278
279
  the sessions target remains only as a no-op compatibility shim.
279
280
  `)
280
281
  .action(async (target, options) => {
@@ -301,4 +302,5 @@ Durability:
301
302
  await pruneDuplicates(parsed.versionAgent, options.yes === true, options.dryRun === true);
302
303
  }
303
304
  });
305
+ registerPruneTrashCommands(pruneCmd);
304
306
  }
@@ -2,8 +2,7 @@ import chalk from 'chalk';
2
2
  import { die } from '../lib/format.js';
3
3
  import { setHelpSections } from '../lib/help.js';
4
4
  import { readMeta } from '../lib/state.js';
5
- import { sendMessage, isOwnerAlias } from '../lib/channels/send.js';
6
- import { fireTraceSyncInBackground } from '../lib/run-trace-sync.js';
5
+ import { sendMessage } from '../lib/channels/send.js';
7
6
  function mergeAttachments(opts) {
8
7
  const list = [...(opts.attach ?? []), ...(opts.attachment ?? [])];
9
8
  return list.length ? list : undefined;
@@ -31,8 +30,6 @@ function toInput(positionalText, opts) {
31
30
  async function runSend(positionalText, opts) {
32
31
  const meta = readMeta();
33
32
  const input = toInput(positionalText, opts);
34
- if (isOwnerAlias(opts.to))
35
- fireTraceSyncInBackground({ disabled: Boolean(opts.dryRun) });
36
33
  const out = await sendMessage(input, meta);
37
34
  if ('error' in out) {
38
35
  die(out.error);
@@ -62,7 +59,7 @@ const SHARED_NOTES = `
62
59
  send - DELIVER a message to a recipient (this command)
63
60
  feed post - RECORD progress / milestones (optional broadcast may call send)
64
61
  activity - READ the activity stream (not a send path)
65
- message - CONTROL a running agent through its mailbox
62
+ send --channel mailbox - queue a message in a running agent's mailbox
66
63
  send --channel session - type text + Enter into a running agent's terminal
67
64
 
68
65
  --to owner posts one notification to your account (agents auth login). The
@@ -1491,7 +1491,7 @@ export function registerSessionsCommands(program) {
1491
1491
  # --- Session lifecycle ---
1492
1492
  # Get back into a session — attaches a live pane, or recovers an ended one
1493
1493
  agents sessions resume a1b2c3d4
1494
- # Same, by the tmux name shown in: agents tmux ls
1494
+ # Same, by its tmux session name
1495
1495
  agents sessions resume ag-claude-a1b2c3d4
1496
1496
  # Attach only — never fork a copy
1497
1497
  agents sessions resume a1b2c3d4 --attach-only
@@ -1772,7 +1772,7 @@ is reported \`failed\` (exit non-zero), never a stranded \`ok\`.
1772
1772
  });
1773
1773
  devicesCmd
1774
1774
  .command('ps')
1775
- .description('List agent tasks dispatched to devices with `agents run --device <name> --no-follow`. Reconciles each still-`running` record against the remote before listing. View a log with `agents logs <id>`.')
1775
+ .description('List agent tasks dispatched to devices with `agents run --device <name> --no-follow`. Reconciles each still-`running` record against the remote before listing. View a log with `agents events logs <id>`.')
1776
1776
  .option('--json', 'Output JSON')
1777
1777
  .action((opts) => doDeviceTaskPs(!!opts.json));
1778
1778
  devicesCmd
@@ -2012,7 +2012,7 @@ async function doDeviceTaskStop(ref) {
2012
2012
  chalk.gray(` on ${stopped.host}`) +
2013
2013
  ' ' + statusColor(stopped.status) +
2014
2014
  chalk.gray(` (${exitNote})`));
2015
- console.log(chalk.gray(`Logs: agents logs ${stopped.id}`));
2015
+ console.log(chalk.gray(`Logs: agents events logs ${stopped.id}`));
2016
2016
  }
2017
2017
  catch (err) {
2018
2018
  console.error(chalk.red(err?.message ?? err));
@@ -1,6 +1,6 @@
1
1
  import type { Command } from 'commander';
2
2
  import type { AgentId } from '../lib/types.js';
3
- import { type InstalledAgentTargetResult, type VersionSelectionResult } from '../lib/installations/versions.js';
3
+ import { type VersionSelectionResult } from '../lib/installations/versions.js';
4
4
  export declare function resolveListFilterOrExit(agent: AgentId, qualifier: string | undefined | null): string | undefined;
5
5
  import { isPromptCancelled, isInteractiveTerminal, parseCommaSeparatedList } from '../lib/format.js';
6
6
  export { isPromptCancelled, isInteractiveTerminal, parseCommaSeparatedList };
@@ -37,8 +37,4 @@ export declare function resolveAgentTargetsAutoInstalling(value: string, availab
37
37
  yes?: boolean;
38
38
  allVersions?: boolean;
39
39
  }): Promise<VersionSelectionResult | null>;
40
- export declare function resolveInstalledAgentTargetsAutoInstalling(value: string, availableAgents: readonly AgentId[], options?: {
41
- yes?: boolean;
42
- allVersions?: boolean;
43
- }): Promise<InstalledAgentTargetResult | null>;
44
40
  export { VersionNotInstalledError } from '../lib/installations/versions.js';
@@ -4,7 +4,7 @@ import chalk from 'chalk';
4
4
  import ora from 'ora';
5
5
  import { confirm } from '@inquirer/prompts';
6
6
  import { agentLabel, resolveAgentName } from '../lib/agents.js';
7
- import { installVersion, listInstalledVersions, resolveAgentVersionTargets, resolveInstalledAgentTargets, } from '../lib/installations/versions.js';
7
+ import { installVersion, listInstalledVersions, resolveAgentVersionTargets, } from '../lib/installations/versions.js';
8
8
  import { resolveListFilter, AgentSpecError } from '../lib/agent-spec/index.js';
9
9
  export function resolveListFilterOrExit(agent, qualifier) {
10
10
  try {
@@ -214,10 +214,4 @@ export async function resolveAgentTargetsAutoInstalling(value, availableAgents,
214
214
  return null;
215
215
  return resolveAgentVersionTargets(value, availableAgents, { allVersions: options.allVersions });
216
216
  }
217
- export async function resolveInstalledAgentTargetsAutoInstalling(value, availableAgents, options = {}) {
218
- const ok = await ensureAgentVersionsInstalled(value, availableAgents, options);
219
- if (!ok)
220
- return null;
221
- return resolveInstalledAgentTargets(value, availableAgents, { allVersions: options.allVersions });
222
- }
223
217
  export { VersionNotInstalledError } from '../lib/installations/versions.js';
@@ -49,8 +49,6 @@ interface UnmanagedInstall {
49
49
  }
50
50
  export declare const UNMANAGED_DETECTION_CANDIDATES: AgentId[];
51
51
  export declare function getUnmanagedAgentInstalls(): Promise<UnmanagedInstall[]>;
52
- export declare function ensureCommandsDir(agentId: AgentId): void;
53
- export declare function ensureSkillsDir(agentId: AgentId): void;
54
52
  export declare function agentConfigDirName(agentId: AgentId): string;
55
53
  export interface AccountInfo {
56
54
  accountKey: string | null;
@@ -872,18 +872,6 @@ export async function getUnmanagedAgentInstalls() {
872
872
  }
873
873
  return unmanaged;
874
874
  }
875
- export function ensureCommandsDir(agentId) {
876
- const agent = AGENTS[agentId];
877
- if (!fs.existsSync(agent.commandsDir)) {
878
- fs.mkdirSync(agent.commandsDir, { recursive: true });
879
- }
880
- }
881
- export function ensureSkillsDir(agentId) {
882
- const agent = AGENTS[agentId];
883
- if (!fs.existsSync(agent.skillsDir)) {
884
- fs.mkdirSync(agent.skillsDir, { recursive: true });
885
- }
886
- }
887
875
  export function agentConfigDirName(agentId) {
888
876
  // Use import-time HOME: nested config dirs and later HOME overrides must stay relative.
889
877
  return path.relative(HOME, AGENTS[agentId].configDir);
@@ -2,10 +2,6 @@ import type { AgentId } from '../types.js';
2
2
  import type { AgentTarget, ResolveOptions, VersionFilter } from './types.js';
3
3
  export * from './types.js';
4
4
  export * from './primitives.js';
5
- export * from './package-types.js';
6
- export { parseAgentPackageManifest, loadAgentPackageManifest } from './package-schema.js';
7
- export { resolveAgentPackage, effectiveResources } from './package-resolve.js';
8
- export { materializeAgentPackage, sha256OfReceiptFile } from './materialize.js';
9
5
  export declare const AGENT_SPEC_HELP: string;
10
6
  export declare function resolveAgentTargets(spec: string, opts?: ResolveOptions): AgentTarget[];
11
7
  export declare function resolveSingleAgentTarget(spec: string, opts?: ResolveOptions): {
@@ -2,10 +2,6 @@ import { defaultVersionProvider } from './provider.js';
2
2
  import * as core from './resolve.js';
3
3
  export * from './types.js';
4
4
  export * from './primitives.js';
5
- export * from './package-types.js';
6
- export { parseAgentPackageManifest, loadAgentPackageManifest } from './package-schema.js';
7
- export { resolveAgentPackage, effectiveResources } from './package-resolve.js';
8
- export { materializeAgentPackage, sha256OfReceiptFile } from './materialize.js';
9
5
  export const AGENT_SPEC_HELP = 'Agent spec: <agent>[@<qualifier>]. Qualifiers: ' +
10
6
  '@latest (highest installed), @oldest (lowest installed), ' +
11
7
  '@pinned / @default (your configured default — synonyms), ' +
@@ -1,4 +1,4 @@
1
- import type { AgentId, CommandInstallation } from './types.js';
1
+ import type { AgentId } from './types.js';
2
2
  type CommandScope = 'user' | 'project';
3
3
  interface CommandMetadata {
4
4
  name: string;
@@ -38,10 +38,6 @@ interface InstalledCommand {
38
38
  export declare function parseCommandMetadata(filePath: string): CommandMetadata | null;
39
39
  export declare function discoverCommands(repoPath: string): DiscoveredCommand[];
40
40
  export declare function resolveCommandSource(repoPath: string, commandName: string): string | null;
41
- export declare function installCommand(sourcePath: string, agentId: AgentId, commandName: string, method?: 'symlink' | 'copy'): CommandInstallation & {
42
- error?: string;
43
- warnings?: string[];
44
- };
45
41
  export declare function getVersionCommandsDir(agent: AgentId, version: string): string;
46
42
  export declare function listCommandsInVersionHome(agent: AgentId, version: string): string[];
47
43
  export interface VersionCommandDiff {
@@ -3,13 +3,13 @@ import { compareVersions } from './agent-spec/primitives.js';
3
3
  import { installedReleaseFor } from './installations/store.js';
4
4
  import * as path from 'path';
5
5
  import * as yaml from 'yaml';
6
- import { AGENTS, ensureCommandsDir, agentConfigDirName, resolveAgentName } from './agents.js';
6
+ import { AGENTS, agentConfigDirName, resolveAgentName } from './agents.js';
7
7
  import { capableAgents, isCapable, supports } from './capabilities.js';
8
8
  import { isDirectoryDoc } from './resources.js';
9
9
  import { normalizeAliases } from './resource-aliases.js';
10
10
  import { markdownToToml } from './convert.js';
11
11
  import { getCommandsDir, getUserCommandsDir, getEnabledExtraRepos, getProjectAgentsDir, getSkillsDir, getTrashCommandsDir } from './state.js';
12
- import { getEffectiveHome, getVersionHomePath, listInstalledVersions, resolveVersion } from './installations/versions.js';
12
+ import { getEffectiveHome, getVersionHomePath, listInstalledVersions } from './installations/versions.js';
13
13
  import { discoverPlugins } from './plugins/plugins.js';
14
14
  import { commandSkillMatches, installCommandSkillToVersion, listCommandSkillsInVersion, removeCommandSkillFromVersion, shouldAlsoInstallCommandAsSkill, shouldInstallCommandAsSkill, } from './command-skills.js';
15
15
  import { installGooseCommandToVersion, listGooseCommandsInVersion, gooseCommandMatches, removeGooseCommandFromVersion, } from './goose-commands.js';
@@ -157,73 +157,6 @@ export function resolveCommandSource(repoPath, commandName) {
157
157
  }
158
158
  return null;
159
159
  }
160
- export function installCommand(sourcePath, agentId, commandName, method = 'symlink') {
161
- const metadata = parseCommandMetadata(sourcePath);
162
- const validation = validateCommandMetadata(metadata, commandName);
163
- if (!validation.valid) {
164
- return {
165
- path: '',
166
- method: 'copy',
167
- error: `Invalid command: ${validation.errors.join(', ')}`,
168
- warnings: validation.warnings,
169
- };
170
- }
171
- const pinnedVersion = resolveVersion(agentId, process.cwd());
172
- if (pinnedVersion) {
173
- const gate = commandAppliesTo(agentId, pinnedVersion, metadata);
174
- if (!gate.ok) {
175
- return {
176
- path: '',
177
- method: 'copy',
178
- error: explainCommandSkip(agentId, pinnedVersion, commandName, gate),
179
- warnings: validation.warnings,
180
- };
181
- }
182
- }
183
- const agent = AGENTS[agentId];
184
- ensureCommandsDir(agentId);
185
- const home = getEffectiveHome(agentId);
186
- const installVersion = pinnedVersion ?? listInstalledVersions(agentId)[0] ?? '';
187
- const alsoInstallAsSkill = shouldAlsoInstallCommandAsSkill(agentId, installVersion);
188
- if (alsoInstallAsSkill) {
189
- const installed = installCommandSkillToVersion(path.join(home, agentConfigDirName(agentId)), commandName, sourcePath, [getSkillsDir(), ...getEnabledExtraRepos().map((repo) => path.join(repo.dir, 'skills'))]);
190
- if (!installed.success) {
191
- return { path: '', method: 'copy', error: installed.error, warnings: validation.warnings };
192
- }
193
- }
194
- if (agentId === 'goose') {
195
- const result = installGooseCommandToVersion(home, commandName, sourcePath);
196
- if (!result.success) {
197
- return { path: '', method: 'copy', error: result.error, warnings: validation.warnings };
198
- }
199
- return {
200
- path: path.join(home, '.config', 'goose', 'commands', `${commandName}.yaml`),
201
- method: 'copy',
202
- warnings: validation.warnings,
203
- };
204
- }
205
- const commandsDir = path.join(home, agentConfigDirName(agentId), agent.commandsSubdir);
206
- fs.mkdirSync(commandsDir, { recursive: true });
207
- const ext = agent.format === 'toml' ? '.toml' : '.md';
208
- const targetPath = path.join(commandsDir, `${commandName}${ext}`);
209
- if (fs.existsSync(targetPath)) {
210
- fs.unlinkSync(targetPath);
211
- }
212
- const sourceContent = fs.readFileSync(sourcePath, 'utf-8');
213
- const sourceIsMarkdown = sourcePath.endsWith('.md');
214
- const needsConversion = agent.format === 'toml' && sourceIsMarkdown;
215
- if (needsConversion) {
216
- const tomlContent = markdownToToml(commandName, sourceContent);
217
- fs.writeFileSync(targetPath, tomlContent, 'utf-8');
218
- return { path: targetPath, method: 'copy', warnings: validation.warnings };
219
- }
220
- if (method === 'symlink') {
221
- fs.symlinkSync(sourcePath, targetPath);
222
- return { path: targetPath, method: 'symlink', warnings: validation.warnings };
223
- }
224
- fs.copyFileSync(sourcePath, targetPath);
225
- return { path: targetPath, method: 'copy', warnings: validation.warnings };
226
- }
227
160
  export function getVersionCommandsDir(agent, version) {
228
161
  const home = getVersionHomePath(agent, version);
229
162
  return path.join(home, agentConfigDirName(agent), AGENTS[agent].commandsSubdir);
@@ -18,15 +18,8 @@ export declare function masthead(o: {
18
18
  right?: string;
19
19
  stats?: string[];
20
20
  }): string;
21
- export declare function sparkline(counts: number[]): string;
22
21
  export declare function aggregate(boxes: {
23
22
  id: string;
24
23
  label: string;
25
24
  messages: import('./mailbox.js').StoredMessage[];
26
25
  }[]): CommsMsg[];
27
- export declare function hourlyCounts(msgs: CommsMsg[], hours: number, now?: Date): number[];
28
- export declare function graphEdges(msgs: CommsMsg[]): {
29
- from: string;
30
- to: string;
31
- count: number;
32
- }[];
@@ -22,18 +22,6 @@ export function masthead(o) {
22
22
  const gap = Math.max(1, terminalWidth() - stringWidth(left) - stringWidth(right));
23
23
  return `${left}${' '.repeat(gap)}${right}`;
24
24
  }
25
- const SPARK_LEVELS = '▁▂▃▄▅▆▇█';
26
- export function sparkline(counts) {
27
- if (counts.length === 0)
28
- return ' ';
29
- const normalized = counts.map((count) => Number.isFinite(count) ? Math.max(0, count) : 0);
30
- const max = Math.max(...normalized);
31
- if (max === 0)
32
- return ' '.repeat(counts.length);
33
- return normalized
34
- .map((count) => SPARK_LEVELS[Math.round((count / max) * (SPARK_LEVELS.length - 1))])
35
- .join('');
36
- }
37
25
  export function aggregate(boxes) {
38
26
  return boxes
39
27
  .flatMap((box) => {
@@ -50,35 +38,6 @@ export function aggregate(boxes) {
50
38
  })
51
39
  .sort((a, b) => compareText(b.ts, a.ts));
52
40
  }
53
- const HOUR_MS = 60 * 60 * 1_000;
54
- export function hourlyCounts(msgs, hours, now = new Date()) {
55
- const bucketCount = Number.isFinite(hours) ? Math.max(0, Math.floor(hours)) : 0;
56
- const counts = Array.from({ length: bucketCount }, () => 0);
57
- const nowMs = now.getTime();
58
- if (bucketCount === 0 || !Number.isFinite(nowMs))
59
- return counts;
60
- for (const message of msgs) {
61
- const timestamp = Date.parse(message.ts);
62
- const age = nowMs - timestamp;
63
- if (!Number.isFinite(timestamp) || age < 0 || age >= bucketCount * HOUR_MS)
64
- continue;
65
- const bucket = bucketCount - 1 - Math.floor(age / HOUR_MS);
66
- counts[bucket]++;
67
- }
68
- return counts;
69
- }
70
- export function graphEdges(msgs) {
71
- const edges = new Map();
72
- for (const message of msgs) {
73
- const key = JSON.stringify([message.from, message.toLabel]);
74
- const existing = edges.get(key);
75
- if (existing)
76
- existing.count++;
77
- else
78
- edges.set(key, { from: message.from, to: message.toLabel, count: 1 });
79
- }
80
- return [...edges.values()].sort((a, b) => b.count - a.count || compareText(a.from, b.from) || compareText(a.to, b.to));
81
- }
82
41
  function compareText(a, b) {
83
42
  return a < b ? -1 : a > b ? 1 : 0;
84
43
  }
@@ -1,7 +1,7 @@
1
1
  import type { AgentId } from './types.js';
2
2
  import { type ModelTier } from './model-tiers.js';
3
3
  export type ConfigScope = 'run' | 'interactive' | 'auto' | 'browser' | 'project' | 'device' | 'summarizer' | 'updates' | 'menubar';
4
- export declare const MENUBAR_MENU_PROPERTIES: readonly ["defaultProject", "workingRowsShown", "showPreviews", "projectPriorityFilter", "hideCompletedMilestones", "bannerWhenNeedsYou", "includeOtherDeviceRequests", "groupBy", "thenBy", "projectScope", "projectSort", "ticketSort", "showPullRequests", "sessionUpdates", "showBrowserSessions", "showComputerSessions", "deviceSort", "headlessAgent", "headlessFallbackAgent", "headlessPlacement", "pinnedProjects", "tabOrder", "hiddenTabs", "groupTicketsByMilestone", "ticketGroup", "prGroupOpen", "prGroupMerged", "homeGoals", "githubHidden", "githubDrafts", "githubBots"];
4
+ export declare const MENUBAR_MENU_PROPERTIES: readonly ["defaultProject", "workingRowsShown", "showPreviews", "projectPriorityFilter", "hideCompletedMilestones", "bannerWhenNeedsYou", "includeOtherDeviceRequests", "groupBy", "thenBy", "projectScope", "projectSort", "ticketSort", "showPullRequests", "sessionUpdates", "showBrowserSessions", "showComputerSessions", "deviceSort", "headlessAgent", "headlessFallbackAgent", "headlessPlacement", "pinnedProjects", "tabOrder", "hiddenTabs", "groupTicketsByMilestone", "ticketGroup", "prGroupOpen", "prGroupMerged", "homeGoals", "homeSections", "sessionFilter", "artifactApps", "githubHidden", "githubDrafts", "githubBots"];
5
5
  export declare const MENUBAR_STATUSBAR_PROPERTIES: readonly ["goalCountdown"];
6
6
  export type MenubarSection = 'menu' | 'statusbar';
7
7
  export declare const MENUBAR_CONFIG_KEYS: readonly string[];
@@ -30,12 +30,16 @@ export const MENUBAR_MENU_PROPERTIES = [
30
30
  'prGroupOpen',
31
31
  'prGroupMerged',
32
32
  'homeGoals',
33
+ 'homeSections',
34
+ 'sessionFilter',
35
+ 'artifactApps',
33
36
  'githubHidden',
34
37
  'githubDrafts',
35
38
  'githubBots',
36
39
  ];
37
40
  export const MENUBAR_STATUSBAR_PROPERTIES = ['goalCountdown'];
38
41
  export const MENUBAR_CONFIG_KEYS = [
42
+ 'menubar.enabled',
39
43
  'menubar.autoUpdate',
40
44
  ...MENUBAR_MENU_PROPERTIES.map((p) => `menubar.menu.${p}`),
41
45
  ...MENUBAR_STATUSBAR_PROPERTIES.map((p) => `menubar.statusbar.${p}`),
@@ -106,6 +110,8 @@ export function parseConfigKey(key) {
106
110
  if (summarizerMatch) {
107
111
  return { scope: 'summarizer', property: summarizerMatch[1] };
108
112
  }
113
+ if (raw === 'menubar.enabled')
114
+ return { scope: 'menubar', property: 'enabled' };
109
115
  if (raw === 'menubar.autoUpdate')
110
116
  return { scope: 'menubar', property: 'autoUpdate' };
111
117
  const menubarMatch = raw.match(/^menubar\.(menu|statusbar)\.(.+)$/);
@@ -268,6 +274,8 @@ export function configKeyStorageHint(parsed) {
268
274
  ? `config.updatesAgentAuto.${parsed.agent} (central agents.yaml; syncs fleet-wide)`
269
275
  : 'config.updatesAuto (central agents.yaml; syncs fleet-wide)';
270
276
  case 'menubar':
277
+ if (parsed.property === 'enabled')
278
+ return 'devices/<self>/agents.yaml config.menubarEnabled';
271
279
  return `config.menubar${parsed.section === 'menu' ? 'Menu' : parsed.section === 'statusbar' ? 'Statusbar' : ''}${parsed.property.charAt(0).toUpperCase()}${parsed.property.slice(1)} (central agents.yaml; syncs fleet-wide)`;
272
280
  }
273
281
  }
@@ -540,7 +540,7 @@ export function assertTestDaemonHome(daemonDir = getDaemonDir(), testHome = proc
540
540
  }
541
541
  export async function runDaemon() {
542
542
  assertTestDaemonHome();
543
- const [{ SessionIndexService }, { SessionSummarizerService }, { SessionTitleService }, { AccountUsageService, AccountAuthService }, { CatchupService }, { WatchdogService }, { DeviceProbeService }, { SelfHealService }, { SelfUpdateService }, { HarnessUpdateService }, { AuthSyncService }, { UsageSyncService }, { StateDirCheckService }, { SessionStateService }, { FeedStreamService }, { AttentionNotifyService }, { RecordingsService }, { WebhookReceiverService }, { HeartbeatService }, { TmuxReapService },] = await Promise.all([
543
+ const [{ SessionIndexService }, { SessionSummarizerService }, { SessionTitleService }, { AccountUsageService, AccountAuthService }, { CatchupService }, { WatchdogService }, { DeviceProbeService }, { SelfHealService }, { SelfUpdateService }, { HarnessUpdateService }, { AuthSyncService }, { UsageSyncService }, { StateDirCheckService }, { SessionStateService }, { FeedStreamService }, { AttentionNotifyService }, { RecordingsService }, { HeartbeatService }, { TmuxReapService },] = await Promise.all([
544
544
  import('./session-index-service.js'),
545
545
  import('./session-summarizer-service.js'),
546
546
  import('./session-title-service.js'),
@@ -558,7 +558,6 @@ export async function runDaemon() {
558
558
  import('./feed-stream-service.js'),
559
559
  import('./attention-notify-service.js'),
560
560
  import('../recordings/service.js'),
561
- import('./webhook-receiver-service.js'),
562
561
  import('./heartbeat-service.js'),
563
562
  import('./tmux-reap-service.js'),
564
563
  ]);
@@ -707,10 +706,6 @@ export async function runDaemon() {
707
706
  supervisor.register(new UsageSyncService());
708
707
  else
709
708
  log('INFO', 'Usage-sync service disabled');
710
- if (isEnabled('webhook-receiver'))
711
- supervisor.register(new WebhookReceiverService());
712
- else
713
- log('INFO', 'Webhook receiver service disabled');
714
709
  if (isEnabled('daemon-heartbeat'))
715
710
  supervisor.register(new HeartbeatService(() => writeHeartbeat()));
716
711
  else
@@ -1,5 +1,5 @@
1
1
  import { type LogLevel } from './daemon/diagnostics.js';
2
- export type DaemonServiceId = 'scheduler' | 'catchup' | 'webhook-receiver' | 'self-heal' | 'self-update' | 'account-state' | 'account-auth' | 'watchdog' | 'device-probe' | 'state-dir-check' | 'session-index' | 'session-title' | 'auth-sync' | 'usage-sync' | 'daemon-heartbeat' | 'tmux-reap' | 'session-state' | 'feed-stream' | 'session-summarizer' | 'attention-notify' | 'recordings' | 'harness-update';
2
+ export type DaemonServiceId = 'scheduler' | 'catchup' | 'self-heal' | 'self-update' | 'account-state' | 'account-auth' | 'watchdog' | 'device-probe' | 'state-dir-check' | 'session-index' | 'session-title' | 'auth-sync' | 'usage-sync' | 'daemon-heartbeat' | 'tmux-reap' | 'session-state' | 'feed-stream' | 'session-summarizer' | 'attention-notify' | 'recordings' | 'harness-update';
3
3
  interface DaemonServiceDef {
4
4
  id: DaemonServiceId;
5
5
  title: string;
@@ -15,11 +15,6 @@ export const DAEMON_SERVICES = [
15
15
  title: 'Catch-up recovery',
16
16
  description: 'Supervised pass that re-runs routines whose scheduled fire this device missed (sleep, wedge, or suspend). No-ops while the scheduler gate is off.',
17
17
  },
18
- {
19
- id: 'webhook-receiver',
20
- title: 'Webhook receiver',
21
- description: 'Hosts signed GitHub/Linear webhook ingress declared in daemon/webhooks.yaml, drawing signing secrets from the standalone secrets CLI; binds nothing when no receivers are declared.',
22
- },
23
18
  {
24
19
  id: 'self-heal',
25
20
  title: 'Self-heal registry',
@@ -31,6 +31,8 @@ declare const DEVICE_ROLES: readonly ["worker", "personal", "desktop"];
31
31
  declare const AUTO_POOL_MODES: readonly ["workers", "all"];
32
32
  export declare const MENUBAR_TABS: readonly ["home", "goals", "secrets", "projects", "linear", "github", "sessions", "inbox"];
33
33
  export declare const MENUBAR_HOME_GOALS: readonly ["company", "week", "myWeek", "myDay"];
34
+ export declare const MENUBAR_HOME_SECTIONS: readonly ["company", "cycle", "today", "needs", "prs", "issues", "sessions", "artifacts", "todos"];
35
+ export declare const MENUBAR_ARTIFACT_KINDS: readonly ["image", "html", "markdown"];
34
36
  export declare function resolveMenubarTabOrder(stored: readonly string[]): string[];
35
37
  export declare const CONFIG_KEYS: readonly ConfigKeySpec[];
36
38
  export declare function configKeySpec(name: string): ConfigKeySpec;