@phnx-labs/agents-cli 1.20.21 → 1.20.23

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 (40) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/commands/cloud.js +142 -13
  3. package/dist/commands/exec.js +13 -1
  4. package/dist/commands/menubar.d.ts +10 -0
  5. package/dist/commands/menubar.js +83 -0
  6. package/dist/commands/routines.js +34 -1
  7. package/dist/commands/secrets.d.ts +1 -1
  8. package/dist/commands/secrets.js +95 -38
  9. package/dist/index.js +292 -225
  10. package/dist/lib/agents.js +8 -0
  11. package/dist/lib/cloud/antigravity.d.ts +70 -0
  12. package/dist/lib/cloud/antigravity.js +196 -0
  13. package/dist/lib/cloud/codex.d.ts +1 -0
  14. package/dist/lib/cloud/codex.js +8 -2
  15. package/dist/lib/cloud/factory.d.ts +79 -18
  16. package/dist/lib/cloud/factory.js +324 -26
  17. package/dist/lib/cloud/registry.d.ts +18 -2
  18. package/dist/lib/cloud/registry.js +28 -4
  19. package/dist/lib/cloud/types.d.ts +73 -2
  20. package/dist/lib/cloud/types.js +17 -0
  21. package/dist/lib/exec.d.ts +2 -0
  22. package/dist/lib/exec.js +5 -0
  23. package/dist/lib/menubar/MenubarHelper.app/Contents/Info.plist +20 -0
  24. package/dist/lib/menubar/MenubarHelper.app/Contents/MacOS/MenubarHelper +0 -0
  25. package/dist/lib/menubar/MenubarHelper.app/Contents/_CodeSignature/CodeResources +115 -0
  26. package/dist/lib/menubar/install-menubar.d.ts +57 -0
  27. package/dist/lib/menubar/install-menubar.js +291 -0
  28. package/dist/lib/secrets/agent.d.ts +9 -1
  29. package/dist/lib/secrets/agent.js +91 -10
  30. package/dist/lib/secrets/bundles.d.ts +19 -12
  31. package/dist/lib/secrets/bundles.js +22 -14
  32. package/dist/lib/self-update.d.ts +34 -0
  33. package/dist/lib/self-update.js +63 -2
  34. package/dist/lib/startup/command-registry.d.ts +99 -0
  35. package/dist/lib/startup/command-registry.js +136 -0
  36. package/dist/lib/types.d.ts +8 -0
  37. package/dist/lib/version.d.ts +11 -0
  38. package/dist/lib/version.js +20 -0
  39. package/package.json +5 -3
  40. package/scripts/postinstall.js +35 -0
@@ -239,6 +239,8 @@ To enable version-aware shims, add this to your shell config:
239
239
  console.log(` Installed shorthands: ${written.join(', ')}`);
240
240
  }
241
241
 
242
+ await healLongRunningProcesses();
243
+
242
244
  const version = getVersion();
243
245
  if (version) {
244
246
  const section = getChangelogSection(version);
@@ -250,6 +252,39 @@ To enable version-aware shims, add this to your shell config:
250
252
  }
251
253
  }
252
254
 
255
+ /**
256
+ * Self-heal long-running processes onto the just-installed code (macOS).
257
+ *
258
+ * The root cause behind stale-behavior bugs is a daemon/broker that keeps
259
+ * running pre-upgrade code for days. An in-place `npm i -g` swaps the files but
260
+ * not the running processes — so we bounce them here, the one moment we know the
261
+ * code just changed. Best-effort and non-fatal: a failure must never break the
262
+ * install. Skipped in CI and when AGENTS_NO_HEAL=1.
263
+ */
264
+ async function healLongRunningProcesses() {
265
+ if (process.platform !== 'darwin') return;
266
+ if (process.env.CI || process.env.AGENTS_NO_HEAL === '1') return;
267
+ // Routines daemon: restart so it reloads new code (e.g. picks up keychain
268
+ // read-memoization / broker fast-path that a stale daemon wouldn't have).
269
+ try {
270
+ const d = await import('../dist/lib/daemon.js');
271
+ if (d.isDaemonRunning?.()) {
272
+ d.stopDaemon?.();
273
+ d.startDaemon?.();
274
+ console.log(' Restarted the routines daemon onto this version.');
275
+ }
276
+ } catch { /* best effort */ }
277
+ // Persistent secrets-agent broker: kickstart so launchd relaunches it on the
278
+ // new code. No-op if the service isn't installed; never blocks.
279
+ try {
280
+ const a = await import('../dist/lib/secrets/agent.js');
281
+ if (a.secretsAgentServiceInstalled?.()) {
282
+ a.kickstartSecretsAgentService?.();
283
+ console.log(' Reloaded the secrets-agent service onto this version.');
284
+ }
285
+ } catch { /* best effort */ }
286
+ }
287
+
253
288
  main().catch((err) => {
254
289
  console.error(err);
255
290
  process.exit(0);