@phnx-labs/agents-cli 1.22.127 → 1.23.0

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 (77) hide show
  1. package/CHANGELOG.md +72 -0
  2. package/README.md +13 -16
  3. package/dist/bootstrap.js +4 -3
  4. package/dist/commands/browser.js +4 -19
  5. package/dist/commands/computer.d.ts +2 -6
  6. package/dist/commands/computer.js +12 -18
  7. package/dist/commands/logs.js +2 -6
  8. package/dist/commands/menubar.js +28 -1
  9. package/dist/commands/projects.js +103 -40
  10. package/dist/commands/sessions.d.ts +0 -11
  11. package/dist/commands/sessions.js +31 -364
  12. package/dist/index.js +10 -11
  13. package/dist/lib/browser-client.d.ts +0 -21
  14. package/dist/lib/browser-client.js +1 -44
  15. package/dist/lib/computer/record.d.ts +1 -0
  16. package/dist/lib/computer/record.js +2 -16
  17. package/dist/lib/config-keys.d.ts +2 -2
  18. package/dist/lib/config-keys.js +8 -2
  19. package/dist/lib/daemon/daemon.js +1 -8
  20. package/dist/lib/daemon/runner.js +3 -2
  21. package/dist/lib/daemon-services.d.ts +1 -1
  22. package/dist/lib/daemon-services.js +0 -5
  23. package/dist/lib/device-config.d.ts +1 -1
  24. package/dist/lib/device-config.js +48 -7
  25. package/dist/lib/feed/tool-activity.d.ts +22 -10
  26. package/dist/lib/feed/tool-activity.js +161 -32
  27. package/dist/lib/feed/tools.d.ts +55 -2
  28. package/dist/lib/feed/tools.js +22 -28
  29. package/dist/lib/feed/watch.js +4 -3
  30. package/dist/lib/github/open-prs.d.ts +41 -0
  31. package/dist/lib/github/open-prs.js +157 -0
  32. package/dist/lib/github/project-prs.d.ts +20 -1
  33. package/dist/lib/github/project-prs.js +8 -7
  34. package/dist/lib/helper-versions.js +1 -1
  35. package/dist/lib/menubar/install-menubar.d.ts +5 -7
  36. package/dist/lib/menubar/install-menubar.js +120 -29
  37. package/dist/lib/menubar/resolve-version.d.ts +1 -0
  38. package/dist/lib/menubar/resolve-version.js +4 -2
  39. package/dist/lib/menubar/snapshot.d.ts +2 -0
  40. package/dist/lib/menubar/snapshot.js +2 -0
  41. package/dist/lib/menubar/update-state.d.ts +15 -0
  42. package/dist/lib/menubar/update-state.js +36 -0
  43. package/dist/lib/owner-notify.d.ts +0 -12
  44. package/dist/lib/owner-notify.js +1 -10
  45. package/dist/lib/self-heal/checks/menubar-helper.js +1 -0
  46. package/dist/lib/session/cloud.d.ts +0 -1
  47. package/dist/lib/session/cloud.js +0 -5
  48. package/dist/lib/session/db.d.ts +0 -64
  49. package/dist/lib/session/db.js +0 -116
  50. package/dist/lib/session/remote/remote-list.d.ts +2 -36
  51. package/dist/lib/session/remote/remote-list.js +3 -320
  52. package/dist/lib/session/tool-index.d.ts +0 -62
  53. package/dist/lib/session/tool-index.js +1 -537
  54. package/dist/lib/sessions-client.d.ts +1 -0
  55. package/dist/lib/sessions-client.js +17 -1
  56. package/dist/lib/standalone-tools.js +2 -2
  57. package/dist/lib/testdata/owner-notify-api.d.ts +0 -13
  58. package/dist/lib/testdata/owner-notify-api.js +3 -23
  59. package/package.json +1 -1
  60. package/dist/commands/browser-sessions-picker.d.ts +0 -9
  61. package/dist/commands/browser-sessions-picker.js +0 -136
  62. package/dist/commands/computer-sessions-picker.d.ts +0 -11
  63. package/dist/commands/computer-sessions-picker.js +0 -90
  64. package/dist/commands/sessions-tail.d.ts +0 -13
  65. package/dist/commands/sessions-tail.js +0 -222
  66. package/dist/lib/browser/native-history.test-fixture.d.ts +0 -12
  67. package/dist/lib/browser/native-history.test-fixture.js +0 -43
  68. package/dist/lib/browser/paths.d.ts +0 -9
  69. package/dist/lib/browser/paths.js +0 -31
  70. package/dist/lib/browser/record.d.ts +0 -4
  71. package/dist/lib/browser/record.js +0 -19
  72. package/dist/lib/browser/sessions-list.d.ts +0 -79
  73. package/dist/lib/browser/sessions-list.js +0 -415
  74. package/dist/lib/computer/sessions-list.d.ts +0 -78
  75. package/dist/lib/computer/sessions-list.js +0 -372
  76. package/dist/lib/daemon/owner-device-delivery-service.d.ts +0 -10
  77. package/dist/lib/daemon/owner-device-delivery-service.js +0 -28
@@ -4,7 +4,6 @@ import * as path from 'node:path';
4
4
  import { findInPath } from './agent-spec/agents.js';
5
5
  const INSTALL_HINT = 'npm i -g @phnx-labs/browser-cli';
6
6
  export const BROWSER_CONTEXT_FD = 3;
7
- export const BROWSER_EVENTS_FD = 4;
8
7
  export class BrowserClientError extends Error {
9
8
  code;
10
9
  constructor(code, message) {
@@ -58,38 +57,17 @@ export function invocation(bin) {
58
57
  return { command: process.execPath, prefix: [bin] };
59
58
  return { command: bin, prefix: [] };
60
59
  }
61
- export function parseEventLines(buffer) {
62
- const events = [];
63
- const parts = buffer.split('\n');
64
- const rest = parts.pop() ?? '';
65
- for (const line of parts) {
66
- const trimmed = line.trim();
67
- if (!trimmed)
68
- continue;
69
- try {
70
- const parsed = JSON.parse(trimmed);
71
- if (parsed && typeof parsed === 'object' && typeof parsed.command === 'string') {
72
- events.push(parsed);
73
- }
74
- }
75
- catch {
76
- }
77
- }
78
- return { events, rest };
79
- }
80
60
  export async function runBrowser(opts) {
81
61
  const bin = resolveBrowserBin();
82
62
  const { command, prefix } = invocation(bin);
83
63
  const child = spawn(command, [...prefix, ...opts.argv], {
84
- stdio: ['inherit', opts.capture ? 'pipe' : 'inherit', 'inherit', 'pipe', 'pipe'],
64
+ stdio: ['inherit', opts.capture ? 'pipe' : 'inherit', 'inherit', 'pipe'],
85
65
  env: {
86
66
  ...process.env,
87
67
  BROWSER_CONTEXT_FD: String(BROWSER_CONTEXT_FD),
88
- BROWSER_EVENTS_FD: String(BROWSER_EVENTS_FD),
89
68
  },
90
69
  });
91
70
  const contextPipe = child.stdio[BROWSER_CONTEXT_FD];
92
- const eventsPipe = child.stdio[BROWSER_EVENTS_FD];
93
71
  if (contextPipe) {
94
72
  contextPipe.on('error', () => { });
95
73
  contextPipe.end(JSON.stringify(opts.context) + '\n');
@@ -101,26 +79,6 @@ export async function runBrowser(opts) {
101
79
  stdout += chunk;
102
80
  });
103
81
  }
104
- let pending = '';
105
- const drained = new Promise((resolve) => {
106
- if (!eventsPipe)
107
- return resolve();
108
- eventsPipe.setEncoding('utf-8');
109
- eventsPipe.on('data', (chunk) => {
110
- const { events, rest } = parseEventLines(pending + chunk);
111
- pending = rest;
112
- for (const event of events)
113
- opts.onEvent?.(event);
114
- });
115
- eventsPipe.on('error', () => resolve());
116
- eventsPipe.on('end', () => {
117
- const { events } = parseEventLines(pending.endsWith('\n') ? pending : pending + '\n');
118
- pending = '';
119
- for (const event of events)
120
- opts.onEvent?.(event);
121
- resolve();
122
- });
123
- });
124
82
  const exitCode = await new Promise((resolve, reject) => {
125
83
  child.on('error', (err) => {
126
84
  reject(new BrowserClientError('BROWSER_SPAWN_FAILED', `Could not run \`${bin}\`: ${err.message}`));
@@ -131,7 +89,6 @@ export async function runBrowser(opts) {
131
89
  resolve(code);
132
90
  });
133
91
  });
134
- await drained;
135
92
  return { exitCode, stdout };
136
93
  }
137
94
  function osSignalNumber(signal) {
@@ -1,4 +1,5 @@
1
1
  import type { ComputerActionEvent } from '../computer-client.js';
2
+ export declare const TASK_PREVIEW_MAX_CHARS = 200;
2
3
  export declare const COMPUTER_INVOCATION_ID: `${string}-${string}-${string}-${string}-${string}`;
3
4
  export declare function recordComputerAction(event: ComputerActionEvent, opts?: {
4
5
  device?: string;
@@ -1,12 +1,10 @@
1
1
  import { randomUUID } from 'node:crypto';
2
2
  import { emit as emitEvent } from '../feed/events.js';
3
- import { recordComputerSession } from '../session/db.js';
4
- import { resolveActor } from '../actor.js';
5
3
  import { truncate } from '../feed/events.js';
6
- import { TASK_PREVIEW_MAX_CHARS } from './sessions-list.js';
4
+ export const TASK_PREVIEW_MAX_CHARS = 200;
7
5
  export const COMPUTER_INVOCATION_ID = randomUUID();
8
6
  export function recordComputerAction(event, opts = {}) {
9
- const { event: _kind, command, invocationId, pid: _enginePid, host, sessionId, launchId, actor, ...rest } = event;
7
+ const { event: _kind, command, invocationId, pid: _enginePid, host, sessionId, launchId, actor: _actor, ...rest } = event;
10
8
  const runId = invocationId || COMPUTER_INVOCATION_ID;
11
9
  const drivenHost = host ?? opts.device;
12
10
  const extra = typeof rest.task === 'string'
@@ -24,16 +22,4 @@ export function recordComputerAction(event, opts = {}) {
24
22
  }
25
23
  catch {
26
24
  }
27
- try {
28
- recordComputerSession({
29
- invocationId: runId,
30
- sessionId: sessionId ?? process.env.AGENT_SESSION_ID ?? process.env.AGENTS_SESSION_ID,
31
- launchId: launchId ?? process.env.AGENT_LAUNCH_ID,
32
- actor: actor ?? resolveActor().id,
33
- actionCount: 1,
34
- taskPreview: typeof extra.task === 'string' ? extra.task : undefined,
35
- });
36
- }
37
- catch {
38
- }
39
25
  }
@@ -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", "deviceSort", "headlessAgent", "headlessFallbackAgent", "headlessPlacement", "pinnedProjects", "tabOrder", "hiddenTabs", "groupTicketsByMilestone", "prGroupOpen", "prGroupMerged", "homeGoals"];
4
+ export declare const MENUBAR_MENU_PROPERTIES: readonly ["defaultProject", "workingRowsShown", "showPreviews", "projectPriorityFilter", "hideCompletedMilestones", "bannerWhenNeedsYou", "includeOtherDeviceRequests", "groupBy", "thenBy", "projectScope", "projectSort", "ticketSort", "showPullRequests", "sessionUpdates", "deviceSort", "headlessAgent", "headlessFallbackAgent", "headlessPlacement", "pinnedProjects", "tabOrder", "hiddenTabs", "groupTicketsByMilestone", "prGroupOpen", "prGroupMerged", "homeGoals", "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[];
@@ -45,7 +45,7 @@ export interface ParsedUpdatesConfigKey {
45
45
  }
46
46
  export interface ParsedMenubarConfigKey {
47
47
  scope: 'menubar';
48
- section: MenubarSection;
48
+ section?: MenubarSection;
49
49
  property: string;
50
50
  }
51
51
  export type ParsedConfigKey = ParsedRunConfigKey | ParsedInteractiveConfigKey | ParsedAutoConfigKey | ParsedBrowserConfigKey | ParsedProjectConfigKey | ParsedDeviceConfigKey | ParsedSummarizerConfigKey | ParsedUpdatesConfigKey | ParsedMenubarConfigKey;
@@ -27,9 +27,13 @@ export const MENUBAR_MENU_PROPERTIES = [
27
27
  'prGroupOpen',
28
28
  'prGroupMerged',
29
29
  'homeGoals',
30
+ 'githubHidden',
31
+ 'githubDrafts',
32
+ 'githubBots',
30
33
  ];
31
34
  export const MENUBAR_STATUSBAR_PROPERTIES = ['goalCountdown'];
32
35
  export const MENUBAR_CONFIG_KEYS = [
36
+ 'menubar.autoUpdate',
33
37
  ...MENUBAR_MENU_PROPERTIES.map((p) => `menubar.menu.${p}`),
34
38
  ...MENUBAR_STATUSBAR_PROPERTIES.map((p) => `menubar.statusbar.${p}`),
35
39
  ];
@@ -99,6 +103,8 @@ export function parseConfigKey(key) {
99
103
  if (summarizerMatch) {
100
104
  return { scope: 'summarizer', property: summarizerMatch[1] };
101
105
  }
106
+ if (raw === 'menubar.autoUpdate')
107
+ return { scope: 'menubar', property: 'autoUpdate' };
102
108
  const menubarMatch = raw.match(/^menubar\.(menu|statusbar)\.(.+)$/);
103
109
  if (menubarMatch) {
104
110
  if (!MENUBAR_CONFIG_KEYS.includes(raw)) {
@@ -178,7 +184,7 @@ export function formatConfigKey(parsed) {
178
184
  case 'updates':
179
185
  return parsed.agent ? `updates.${parsed.agent}.auto` : 'updates.auto';
180
186
  case 'menubar':
181
- return `menubar.${parsed.section}.${parsed.property}`;
187
+ return parsed.section ? `menubar.${parsed.section}.${parsed.property}` : `menubar.${parsed.property}`;
182
188
  }
183
189
  }
184
190
  export function listKnownConfigKeys() {
@@ -259,6 +265,6 @@ export function configKeyStorageHint(parsed) {
259
265
  ? `config.updatesAgentAuto.${parsed.agent} (central agents.yaml; syncs fleet-wide)`
260
266
  : 'config.updatesAuto (central agents.yaml; syncs fleet-wide)';
261
267
  case 'menubar':
262
- return `config.menubar${parsed.section === 'menu' ? 'Menu' : 'Statusbar'}${parsed.property.charAt(0).toUpperCase()}${parsed.property.slice(1)} (central agents.yaml; syncs fleet-wide)`;
268
+ 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)`;
263
269
  }
264
270
  }
@@ -504,7 +504,7 @@ export function assertTestDaemonHome(daemonDir = getDaemonDir(), testHome = proc
504
504
  }
505
505
  export async function runDaemon() {
506
506
  assertTestDaemonHome();
507
- const [{ SessionIndexService }, { SessionSummarizerService }, { SessionTitleService }, { AccountUsageService, AccountAuthService }, { CatchupService }, { WatchdogService }, { DeviceProbeService }, { SelfHealService }, { SelfUpdateService }, { HarnessUpdateService }, { AuthSyncService }, { UsageSyncService }, { StateDirCheckService }, { SessionStateService }, { FeedStreamService }, { AttentionNotifyService }, { OwnerDeviceDeliveryService }, { RecordingsService }, { WebhookReceiverService }, { HeartbeatService }, { TmuxReapService },] = await Promise.all([
507
+ 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([
508
508
  import('./session-index-service.js'),
509
509
  import('./session-summarizer-service.js'),
510
510
  import('./session-title-service.js'),
@@ -521,7 +521,6 @@ export async function runDaemon() {
521
521
  import('./session-state-service.js'),
522
522
  import('./feed-stream-service.js'),
523
523
  import('./attention-notify-service.js'),
524
- import('./owner-device-delivery-service.js'),
525
524
  import('../recordings/service.js'),
526
525
  import('./webhook-receiver-service.js'),
527
526
  import('./heartbeat-service.js'),
@@ -632,12 +631,6 @@ export async function runDaemon() {
632
631
  supervisor.register(new AttentionNotifyService());
633
632
  else
634
633
  log('INFO', 'Attention-notify service disabled');
635
- if (process.platform === 'darwin') {
636
- if (isEnabled('owner-device-delivery'))
637
- supervisor.register(new OwnerDeviceDeliveryService());
638
- else
639
- log('INFO', 'Owner device-delivery service disabled');
640
- }
641
634
  if (isEnabled('session-title'))
642
635
  supervisor.register(new SessionTitleService());
643
636
  else
@@ -596,12 +596,13 @@ export function claudeVersionIsAuthenticated(version) {
596
596
  const binary = getBinaryPath('claude', version);
597
597
  if (!binary)
598
598
  return false;
599
- const home = getVersionHomePath('claude', version);
599
+ const env = buildRoutineSpawnEnv(process.env, 'claude', version);
600
+ env.HOME = process.env.AGENTS_REAL_HOME || os.homedir();
600
601
  try {
601
602
  const raw = execFileSync(binary, ['auth', 'status', '--json'], {
602
603
  encoding: 'utf8',
603
604
  timeout: 5_000,
604
- env: { ...process.env, HOME: process.env.AGENTS_REAL_HOME || os.homedir(), CLAUDE_CONFIG_DIR: path.join(home, '.claude') },
605
+ env,
605
606
  stdio: ['ignore', 'pipe', 'ignore'],
606
607
  });
607
608
  return JSON.parse(raw).loggedIn === true;
@@ -1,4 +1,4 @@
1
- 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' | 'owner-device-delivery' | 'recordings' | 'harness-update';
1
+ 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
2
  interface DaemonServiceDef {
3
3
  id: DaemonServiceId;
4
4
  title: string;
@@ -89,11 +89,6 @@ export const DAEMON_SERVICES = [
89
89
  title: 'Attention desktop banners',
90
90
  description: 'Posts one actionable desktop banner per new attention item (question / permission / plan review / stall) so the macOS helper can answer it through agents feed answer (PHNX-4004).',
91
91
  },
92
- {
93
- id: 'owner-device-delivery',
94
- title: 'Owner iMessage delivery',
95
- description: 'macOS only: every 15 s, claims the iMessage notifications your account queued for a device and sends them through Messages, then reports each result. Idle without a Phoenix session or device token (PHNX-4267).',
96
- },
97
92
  {
98
93
  id: 'recordings',
99
94
  title: 'CleanShot recording publisher',
@@ -29,7 +29,7 @@ interface ConfigTarget {
29
29
  }
30
30
  declare const DEVICE_ROLES: readonly ["worker", "personal", "desktop"];
31
31
  declare const AUTO_POOL_MODES: readonly ["workers", "all"];
32
- export declare const MENUBAR_TABS: readonly ["home", "goals", "projects", "sessions", "inbox"];
32
+ export declare const MENUBAR_TABS: readonly ["home", "goals", "secrets", "projects", "github", "sessions", "inbox"];
33
33
  export declare const MENUBAR_HOME_GOALS: readonly ["company", "week", "myWeek", "myDay"];
34
34
  export declare function resolveMenubarTabOrder(stored: readonly string[]): string[];
35
35
  export declare const CONFIG_KEYS: readonly ConfigKeySpec[];
@@ -14,8 +14,8 @@ const SSH_AUTH_METHODS = ['key', 'password'];
14
14
  const DEVICE_ROLES = ['worker', 'personal', 'desktop'];
15
15
  const AUTO_POOL_MODES = ['workers', 'all'];
16
16
  const DEVICE_FORM_FACTORS = ['laptop', 'desktop', 'server', 'unknown'];
17
- export const MENUBAR_TABS = ['home', 'goals', 'projects', 'sessions', 'inbox'];
18
- const MENUBAR_TABS_ADDED_LATER = ['goals'];
17
+ export const MENUBAR_TABS = ['home', 'goals', 'secrets', 'projects', 'github', 'sessions', 'inbox'];
18
+ const MENUBAR_TABS_ADDED_LATER = ['goals', 'secrets', 'github'];
19
19
  export const MENUBAR_HOME_GOALS = ['company', 'week', 'myWeek', 'myDay'];
20
20
  export function resolveMenubarTabOrder(stored) {
21
21
  const known = MENUBAR_TABS;
@@ -550,8 +550,8 @@ export const CONFIG_KEYS = [
550
550
  type: 'string-list',
551
551
  defaultValue: [...MENUBAR_TABS],
552
552
  description: `AGI Menu: the order of the tab bar — every one of ${MENUBAR_TABS.join(', ')} exactly once. ` +
553
- 'Settings is always last and is not listed. An order saved before Goals existed may omit goals; ' +
554
- 'it reads back with goals appended. Hiding a tab is menubar.menu.hiddenTabs, not this key.',
553
+ 'Settings is always last and is not listed. An order saved before Goals, Secrets or GitHub existed may omit them; ' +
554
+ 'they read back appended. Hiding a tab is menubar.menu.hiddenTabs, not this key.',
555
555
  validate: (v) => {
556
556
  const tabs = v;
557
557
  const required = MENUBAR_TABS.filter((t) => !MENUBAR_TABS_ADDED_LATER.includes(t));
@@ -561,18 +561,26 @@ export const CONFIG_KEYS = [
561
561
  return ok
562
562
  ? null
563
563
  : `menubar.menu.tabOrder must list each of ${MENUBAR_TABS.join(', ')} exactly once ` +
564
- `(${MENUBAR_TABS_ADDED_LATER.join(', ')} may be left out and is appended).`;
564
+ `(${MENUBAR_TABS_ADDED_LATER.join(', ')} may be left out and are appended).`;
565
565
  },
566
566
  normalize: (v) => (Array.isArray(v) ? resolveMenubarTabOrder(v.map(String)) : v),
567
567
  },
568
+ {
569
+ name: 'menubar.autoUpdate',
570
+ yamlKey: 'menubarAutoUpdate',
571
+ scope: 'user',
572
+ type: 'bool',
573
+ defaultValue: true,
574
+ description: 'Automatically check and install AGI Menu releases about every 12 hours while this Mac is awake.',
575
+ },
568
576
  {
569
577
  name: 'menubar.menu.hiddenTabs',
570
578
  yamlKey: 'menubarMenuHiddenTabs',
571
579
  scope: 'user',
572
580
  type: 'string-list',
573
- defaultValue: [],
581
+ defaultValue: ['secrets'],
574
582
  description: `AGI Menu: tabs hidden from the tab bar — any of ${MENUBAR_TABS.join(', ')}, but not all of them. ` +
575
- 'Settings cannot be hidden. Hiding Inbox loses nothing: its requests still show on Home.',
583
+ 'Settings cannot be hidden. Hiding Inbox loses nothing: its requests still show on Home. Secrets is hidden unless this list is set without it.',
576
584
  validate: (v) => {
577
585
  const tabs = v;
578
586
  const bad = tabs.find((t) => !MENUBAR_TABS.includes(t));
@@ -585,6 +593,39 @@ export const CONFIG_KEYS = [
585
593
  return null;
586
594
  },
587
595
  },
596
+ {
597
+ name: 'menubar.menu.githubHidden',
598
+ yamlKey: 'menubarMenuGithubHidden',
599
+ scope: 'user',
600
+ type: 'string-list',
601
+ defaultValue: [],
602
+ description: 'AGI Menu: what the GitHub tab leaves out — an org or account login hides all of its repos, an ' +
603
+ 'owner/repo slug hides one repo. Unset shows every org and repo `agents projects prs --json` reads.',
604
+ validate: (v) => {
605
+ const entries = v;
606
+ const bad = entries.find((e) => !/^[\w.-]+(\/[\w.-]+)?$/.test(e));
607
+ if (bad !== undefined)
608
+ return `menubar.menu.githubHidden: "${bad}" is not an org login or owner/repo.`;
609
+ const dup = entries.find((e, i) => entries.findIndex((x) => x.toLowerCase() === e.toLowerCase()) !== i);
610
+ return dup === undefined ? null : `menubar.menu.githubHidden lists "${dup}" twice.`;
611
+ },
612
+ },
613
+ {
614
+ name: 'menubar.menu.githubDrafts',
615
+ yamlKey: 'menubarMenuGithubDrafts',
616
+ scope: 'user',
617
+ type: 'bool',
618
+ defaultValue: false,
619
+ description: 'AGI Menu: show draft pull requests on the GitHub tab (default off).',
620
+ },
621
+ {
622
+ name: 'menubar.menu.githubBots',
623
+ yamlKey: 'menubarMenuGithubBots',
624
+ scope: 'user',
625
+ type: 'bool',
626
+ defaultValue: false,
627
+ description: 'AGI Menu: show pull requests opened by bots (dependabot, CI bots) on the GitHub tab (default off).',
628
+ },
588
629
  {
589
630
  name: 'menubar.menu.groupTicketsByMilestone',
590
631
  yamlKey: 'menubarMenuGroupTicketsByMilestone',
@@ -1,15 +1,27 @@
1
- import { type BrowserSessionRow } from '../browser/sessions-list.js';
2
- import { type ComputerRunRow } from '../computer/sessions-list.js';
3
- import type { LiveBrowserTask } from './tools.js';
4
- import { type ToolRow } from './tools.js';
1
+ import type { SessionMeta } from '@phnx-labs/sessions-cli/reader';
2
+ import type { BrowserSessionRow, ComputerRunRow, LiveBrowserTask } from './tools.js';
3
+ import { type ToolKind, type ToolRow } from './tools.js';
5
4
  export declare const TOOL_SWEEP_MS = 5000;
5
+ type StandaloneTool = 'browser' | 'computer';
6
+ export declare class ToolNotInstalledError extends Error {
7
+ }
8
+ /** Runs a standalone tool's `--json` listing; any failure rejects so the snapshot is reported incomplete. */
9
+ export declare function readToolJson(tool: StandaloneTool, argv: string[]): Promise<unknown[]>;
10
+ export declare function readStandaloneBrowserRows(): Promise<BrowserSessionRow[]>;
11
+ export declare function readStandaloneComputerRows(): Promise<ComputerRunRow[]>;
12
+ /** The tools record a session or launch id; only agents-cli's index can say which agent session that was. */
13
+ export declare function linkToolSessions<T extends {
14
+ sessionId?: string;
15
+ launchId?: string;
16
+ linkedSession?: SessionMeta;
17
+ }>(rows: T[]): T[];
6
18
  export interface ToolDiff {
7
19
  upserts: ToolRow[];
8
20
  removes: string[];
9
21
  }
10
22
  interface ToolSources {
11
- browserRows?: () => BrowserSessionRow[];
12
- computerRows?: () => ComputerRunRow[];
23
+ browserRows?: () => BrowserSessionRow[] | Promise<BrowserSessionRow[]>;
24
+ computerRows?: () => ComputerRunRow[] | Promise<ComputerRunRow[]>;
13
25
  bindings?: () => Array<{
14
26
  name: string;
15
27
  device?: string;
@@ -23,12 +35,13 @@ interface ToolSources {
23
35
  }
24
36
  export interface ToolSnapshot {
25
37
  rows: ToolRow[];
26
- complete: boolean;
38
+ incomplete: ToolKind[];
39
+ retry: boolean;
27
40
  }
28
- export declare function collectToolRows(scope: string, sources?: ToolSources): ToolSnapshot;
41
+ export declare function collectToolRows(scope: string, sources?: ToolSources): Promise<ToolSnapshot>;
29
42
  export declare class ToolRowSet {
30
43
  private readonly rows;
31
- diff(next: ToolRow[]): ToolDiff;
44
+ diff(next: ToolRow[], unreadKinds?: readonly ToolKind[]): ToolDiff;
32
45
  reset(rows: ToolRow[]): void;
33
46
  }
34
47
  interface ToolWatchOptions {
@@ -40,7 +53,6 @@ interface ToolWatchOptions {
40
53
  sources?: ToolSources;
41
54
  initial?: ToolRow[];
42
55
  }
43
- export declare function toolWatchRoots(): string[];
44
56
  export declare function readLiveBrowserTasks(root?: string): LiveBrowserTask[];
45
57
  export declare function watchToolActivity(options: ToolWatchOptions): {
46
58
  armed: () => boolean;