@phnx-labs/agents-cli 1.23.1 → 1.23.2

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.23.2
4
+
5
+ - **AGI Menu 1.15.21: Restart AGI Menu, and Quit no longer turns it off (PHNX-4325).** Settings → AGI Menu has a Restart button and the right-click menu has Restart AGI Menu (⌘R); both run `agents menubar restart`. Quit AGI Menu only quits, and the app returns at the next login. The new Turn off AGI Menu… asks first, then runs `agents menubar disable` as Quit used to. Settings → Tabs names the agents-cli version an unavailable tab needs. Several failing CLI calls finishing at once no longer crash the app. Source: `cli/src/lib/helper-versions.ts`.
6
+
7
+ - **Re-registering AGI Menu's login item no longer leaves the menu stopped.** `launchctl bootout` returns before launchd finishes removing the job, so the immediate `bootstrap` failed with `5: Input/output error` and the menu stayed down until the next login. Every setup, enable and startup repair that rewrites the plist took this path, including the one-time `KeepAlive` rewrite in 1.23.1. The CLI now waits for the old job to leave (up to 5 seconds), retries a refused bootstrap twice, and prints an error naming `agents menubar setup` if registration still fails. Source: `cli/src/lib/menubar/install-menubar.ts`.
8
+
3
9
  ## 1.23.1
4
10
 
5
11
  - **`agents ps preview <id>` shows the rich session card (PHNX-4227).** It is the
@@ -1,5 +1,5 @@
1
1
  export const HELPER_RELEASES = {
2
- menubar: { tagPrefix: 'menubar', floor: '1.15.20' },
2
+ menubar: { tagPrefix: 'menubar', floor: '1.15.21' },
3
3
  };
4
4
  export function helperTag(helper, version) {
5
5
  const release = HELPER_RELEASES[helper];
@@ -25,7 +25,7 @@ export declare function ensureMenubarAppInstalled(opts?: {
25
25
  export declare function generateServicePlist(execPath: string): string;
26
26
  export declare function restartMenubarLaunchAgent(uid: number, plist: string, exec?: (cmd: string, args: readonly string[], opts: {
27
27
  stdio: ['ignore', 'ignore', 'ignore'];
28
- }) => Buffer): void;
28
+ }) => Buffer, sleep?: (ms: number) => void): void;
29
29
  export declare function restartMenubarHelperAfterSwap(uid: number, ownProcesses: readonly MenubarProcess[], exec?: (cmd: string, args: readonly string[], opts: {
30
30
  stdio: ['ignore', 'ignore', 'ignore'];
31
31
  }) => Buffer, kill?: (pid: number) => void): void;
@@ -22,6 +22,7 @@ export function serviceLabel() {
22
22
  return namespacedServiceLabel(SERVICE_LABEL_BASE);
23
23
  }
24
24
  const MENUBAR_THROTTLE_SECONDS = 30;
25
+ const MENUBAR_BOOTOUT_WAIT_TRIES = 50;
25
26
  function onDarwin() {
26
27
  return process.platform === 'darwin';
27
28
  }
@@ -232,7 +233,7 @@ ${envXml}
232
233
  </dict>
233
234
  </plist>`;
234
235
  }
235
- export function restartMenubarLaunchAgent(uid, plist, exec = execFileSync) {
236
+ export function restartMenubarLaunchAgent(uid, plist, exec = execFileSync, sleep = sleepSync) {
236
237
  const reg = serviceManagerRegistrationAllowed();
237
238
  if (!reg.allowed) {
238
239
  process.stderr.write(`[agents] ${reg.reason}\n`);
@@ -240,18 +241,28 @@ export function restartMenubarLaunchAgent(uid, plist, exec = execFileSync) {
240
241
  }
241
242
  const serviceTarget = `gui/${uid}/${serviceLabel()}`;
242
243
  const opts = { stdio: ['ignore', 'ignore', 'ignore'] };
243
- try {
244
- exec('launchctl', ['bootout', serviceTarget], opts);
245
- }
246
- catch { }
247
- try {
248
- exec('launchctl', ['bootstrap', `gui/${uid}`, plist], opts);
249
- }
250
- catch { }
251
- try {
252
- exec('launchctl', ['kickstart', serviceTarget], opts);
253
- }
254
- catch { }
244
+ const succeeds = (args) => {
245
+ try {
246
+ exec('launchctl', args, opts);
247
+ return true;
248
+ }
249
+ catch {
250
+ return false;
251
+ }
252
+ };
253
+ succeeds(['bootout', serviceTarget]);
254
+ for (let i = 0; i < MENUBAR_BOOTOUT_WAIT_TRIES && succeeds(['print', serviceTarget]); i++)
255
+ sleep(100);
256
+ let bootstrapped = false;
257
+ for (let attempt = 0; attempt < 3 && !bootstrapped; attempt++) {
258
+ if (attempt > 0)
259
+ sleep(500);
260
+ bootstrapped = succeeds(['bootstrap', `gui/${uid}`, plist]);
261
+ }
262
+ if (!bootstrapped) {
263
+ process.stderr.write(`[agents] AGI Menu login item could not be registered (launchctl bootstrap gui/${uid} ${plist} failed 3 times); run \`agents menubar setup\`\n`);
264
+ }
265
+ succeeds(['kickstart', serviceTarget]);
255
266
  }
256
267
  export function restartMenubarHelperAfterSwap(uid, ownProcesses, exec = execFileSync, kill = endProcess) {
257
268
  const reg = serviceManagerRegistrationAllowed();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phnx-labs/agents-cli",
3
- "version": "1.23.1",
3
+ "version": "1.23.2",
4
4
  "description": "One CLI for all your AI coding agents - versions, config, cloud dispatch, sessions, and teams (now with first-class Grok Build CLI support)",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",