@join-pantheon/cli 0.21.2 → 0.21.3

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/dist/cli.js CHANGED
@@ -685,6 +685,35 @@ async function main() {
685
685
  }
686
686
  if (r.alreadyCurrent) {
687
687
  console.error(`\n${B("already up to date")} ${D(`(${r.from})`)}`);
688
+ if (process.platform === "darwin") {
689
+ const { trayStale, ensureTrayBinary, writeTrayCommands } = await import("./tray.js");
690
+ const { notifierStale, ensureNativeNotifier } = await import("./notifier.js");
691
+ const { restartService } = await import("./service.js");
692
+ if (trayStale()) {
693
+ try {
694
+ ensureTrayBinary();
695
+ writeTrayCommands();
696
+ for (const l of restartService("menubar"))
697
+ console.error(l);
698
+ }
699
+ catch (e) {
700
+ console.error(` menu bar: could not rebuild (${e.message.split("\n")[0]})`);
701
+ }
702
+ }
703
+ if (notifierStale()) {
704
+ try {
705
+ ensureNativeNotifier();
706
+ for (const l of restartService("notifier"))
707
+ console.error(l);
708
+ }
709
+ catch (e) {
710
+ console.error(` alerts: could not rebuild (${e.message.split("\n")[0]})`);
711
+ }
712
+ }
713
+ }
714
+ const cur = load();
715
+ if (cur && loadProfile(cur).agent.wake_default === undefined)
716
+ await guidedSetup(cur, repoInfo(process.cwd())?.root ?? null);
688
717
  return;
689
718
  }
690
719
  console.error(`\n${B(`upgraded ${r.from} → ${r.to}`)}`);
package/dist/worker.js CHANGED
@@ -216,6 +216,43 @@ export class Worker {
216
216
  this.cfg = cfg;
217
217
  this.opts = opts;
218
218
  }
219
+ async bringMachineAlong() {
220
+ if (this.opts.selfUpgrade?.run)
221
+ return;
222
+ try {
223
+ const { restartService, serviceInstalled } = await import("./service.js");
224
+ if (process.platform === "darwin") {
225
+ const { trayStale, ensureTrayBinary, writeTrayCommands } = await import("./tray.js");
226
+ const { notifierStale, ensureNativeNotifier } = await import("./notifier.js");
227
+ if (trayStale()) {
228
+ try {
229
+ ensureTrayBinary();
230
+ writeTrayCommands();
231
+ this.opts.log(" menu bar rebuilt from the new source");
232
+ }
233
+ catch (e) {
234
+ this.opts.log(` menu bar not rebuilt: ${e.message.split("\n")[0]}`);
235
+ }
236
+ }
237
+ if (notifierStale()) {
238
+ try {
239
+ ensureNativeNotifier();
240
+ this.opts.log(" alerts helper rebuilt from the new source");
241
+ }
242
+ catch (e) {
243
+ this.opts.log(` alerts helper not rebuilt: ${e.message.split("\n")[0]}`);
244
+ }
245
+ }
246
+ }
247
+ for (const kind of ["notifier", "menubar"])
248
+ if (serviceInstalled(kind))
249
+ for (const l of restartService(kind))
250
+ this.opts.log(l);
251
+ }
252
+ catch (e) {
253
+ this.opts.log(` could not bring the other services along: ${e.message.split("\n")[0]}`);
254
+ }
255
+ }
219
256
  repoBase() {
220
257
  return this.client?.repos.find((r) => r.fingerprint === this.cfg.repo)?.base ?? null;
221
258
  }
@@ -661,6 +698,7 @@ export class Worker {
661
698
  summary: `self-upgraded pantheon ${result.from} -> ${result.to}; worker restarting on the new build`,
662
699
  body: `This machine's worker upgraded pantheon ${result.from} -> ${result.to} (fast-forward pull + rebuild, granted by its human) and is restarting on the new build.`,
663
700
  }).catch((e) => this.opts.log(`! could not report the upgrade on the ledger: ${e.message}`));
701
+ await this.bringMachineAlong();
664
702
  this.opts.log(`* self-upgrade done: ${result.from} -> ${result.to}; restarting worker to load it`);
665
703
  (this.opts.selfUpgrade?.restart ?? (() => process.exit(0)))();
666
704
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@join-pantheon/cli",
3
- "version": "0.21.2",
3
+ "version": "0.21.3",
4
4
  "description": "Let your coding agent collaborate directly with your teammates' agents — ask, agree an interface, and deliver, without a human relaying messages.",
5
5
  "type": "module",
6
6
  "bin": {