pushary 1.9.139 → 1.9.141

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 (135) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/data/vscode-plugin/README.md +2 -0
  3. package/dist/{api-JY6EQT7A.js → api-JWLCKSWR.js} +11 -11
  4. package/dist/bin/pushary-audit.js +3 -3
  5. package/dist/bin/pushary-bell-hook.js +28 -28
  6. package/dist/bin/pushary-bell.js +10 -10
  7. package/dist/bin/pushary-claude.js +27 -27
  8. package/dist/bin/pushary-clean.js +36 -36
  9. package/dist/bin/pushary-codex-bridge.js +23 -23
  10. package/dist/bin/pushary-codex-hook.js +35 -35
  11. package/dist/bin/pushary-codex-session.js +9 -9
  12. package/dist/bin/pushary-codex.js +16 -16
  13. package/dist/bin/pushary-connect.js +29 -29
  14. package/dist/bin/pushary-cowork.js +5 -5
  15. package/dist/bin/pushary-daemon.js +93 -95
  16. package/dist/bin/pushary-disconnect.js +28 -28
  17. package/dist/bin/pushary-display-hook.js +93 -5
  18. package/dist/bin/pushary-doctor.js +43 -43
  19. package/dist/bin/pushary-elicitation-hook.js +28 -28
  20. package/dist/bin/pushary-gemini-bridge.js +19 -18
  21. package/dist/bin/pushary-gemini-hook.js +32 -32
  22. package/dist/bin/pushary-hook.js +35 -35
  23. package/dist/bin/pushary-login.js +21 -21
  24. package/dist/bin/pushary-logout.js +27 -27
  25. package/dist/bin/pushary-mcp.js +12 -12
  26. package/dist/bin/pushary-mode.js +15 -15
  27. package/dist/bin/pushary-notification-hook.js +27 -27
  28. package/dist/bin/pushary-opencode-hook.js +31 -31
  29. package/dist/bin/pushary-permission-denied-hook.js +35 -35
  30. package/dist/bin/pushary-permission-hook.js +35 -35
  31. package/dist/bin/pushary-post-hook.js +28 -28
  32. package/dist/bin/pushary-prompt-hook.js +27 -27
  33. package/dist/bin/pushary-session-end-hook.js +27 -27
  34. package/dist/bin/pushary-session-start-hook.js +36 -36
  35. package/dist/bin/pushary-setup.js +51 -51
  36. package/dist/bin/pushary-stats.js +5 -5
  37. package/dist/bin/pushary-status.js +33 -33
  38. package/dist/bin/pushary-stop-hook.js +27 -27
  39. package/dist/bin/pushary-stopfailure-hook.js +27 -27
  40. package/dist/bin/pushary-suggestions.js +15 -15
  41. package/dist/bin/pushary-transcript-register.js +17 -17
  42. package/dist/bin/pushary-transcripts.js +25 -25
  43. package/dist/bin/pushary-upgrade.js +41 -41
  44. package/dist/bin/pushary-wait.js +15 -15
  45. package/dist/bin/pushary.js +7 -7
  46. package/dist/{chunk-SVKZKLEP.js → chunk-24BLJAQN.js} +1 -1
  47. package/dist/{chunk-SKVPWXNK.js → chunk-3MFJDZ2L.js} +10 -10
  48. package/dist/{chunk-UTUR6WEA.js → chunk-3MMOB5TM.js} +3 -3
  49. package/dist/{chunk-BURSH6SW.js → chunk-3PALTBFX.js} +4 -4
  50. package/dist/{chunk-P3UCAWUP.js → chunk-3RBUCAO7.js} +6 -6
  51. package/dist/{chunk-KYWH4XUR.js → chunk-3YV26XPH.js} +3 -3
  52. package/dist/{chunk-GGTLV67J.js → chunk-4JR6PPIY.js} +4 -4
  53. package/dist/{chunk-RBPAUX6C.js → chunk-4KHBN7LI.js} +5 -5
  54. package/dist/{chunk-4NLZUCPG.js → chunk-4Y2LO2WB.js} +2 -2
  55. package/dist/{chunk-U7Z53YWH.js → chunk-4ZTPPMLM.js} +4 -4
  56. package/dist/{chunk-J5SMCRIT.js → chunk-5DMGHDOT.js} +5 -5
  57. package/dist/{chunk-LHUA6ADC.js → chunk-62V26PAL.js} +3 -3
  58. package/dist/{chunk-IAWFSD4Q.js → chunk-6DAXKHVX.js} +1 -1
  59. package/dist/{chunk-KDQSPNPH.js → chunk-7EYUDJQ6.js} +16 -16
  60. package/dist/{chunk-KXHGEJVW.js → chunk-7TKF7IFS.js} +2 -2
  61. package/dist/{chunk-KQVURVAP.js → chunk-A6KNDKO5.js} +597 -116
  62. package/dist/{chunk-IDXCVT6W.js → chunk-ACG7RC7N.js} +3 -3
  63. package/dist/{chunk-4RKB6X4S.js → chunk-AIZ5KC2N.js} +2 -2
  64. package/dist/{chunk-BRXKVYTV.js → chunk-ALJL6GDD.js} +1 -1
  65. package/dist/{chunk-M6TJWXST.js → chunk-ARIJUXCG.js} +8 -8
  66. package/dist/{chunk-QTR6KQEU.js → chunk-BFXIQGWS.js} +1 -1
  67. package/dist/{chunk-ZYLZCNOJ.js → chunk-BKWDG5QV.js} +1 -1
  68. package/dist/{chunk-2MJMKM6D.js → chunk-C4VTURGH.js} +1 -1
  69. package/dist/{chunk-IOWB43KY.js → chunk-CAUSBRTJ.js} +1 -1
  70. package/dist/{chunk-DTJZK3MN.js → chunk-CL3OIICA.js} +6 -6
  71. package/dist/{chunk-LHYBHWCK.js → chunk-CUJ2MGG5.js} +2 -2
  72. package/dist/{chunk-H4O4IPWY.js → chunk-CVGVWUNE.js} +5 -5
  73. package/dist/{chunk-3FNBN4JQ.js → chunk-CWCJFCAY.js} +1 -1
  74. package/dist/{chunk-LYLADUYE.js → chunk-D35XQMWO.js} +2 -2
  75. package/dist/{chunk-UZZRSCFR.js → chunk-EADQYNLU.js} +5 -5
  76. package/dist/{chunk-M4G4VWW6.js → chunk-F335PCA4.js} +1 -1
  77. package/dist/{chunk-CQLQFN6B.js → chunk-FKKS4ZC5.js} +3 -12
  78. package/dist/{chunk-2X2JHX77.js → chunk-FOPV3VQD.js} +4 -4
  79. package/dist/{chunk-FSTSLVZJ.js → chunk-GA72NGS7.js} +1 -1
  80. package/dist/{chunk-CZH3JDVB.js → chunk-GGXAZTSW.js} +2 -2
  81. package/dist/{chunk-7MPKMLE3.js → chunk-GX46NBAE.js} +11 -11
  82. package/dist/{chunk-IHUXZGHB.js → chunk-HEXX52SX.js} +1 -1
  83. package/dist/{chunk-S63DCSH4.js → chunk-I547BHSE.js} +4 -4
  84. package/dist/{chunk-OBPBT6RG.js → chunk-I72H3AWD.js} +3 -3
  85. package/dist/{chunk-T5FPA2JO.js → chunk-IR7J5WY4.js} +3 -3
  86. package/dist/{chunk-3PQEUSPK.js → chunk-J2ELAXGI.js} +1 -1
  87. package/dist/{chunk-6RAHONLG.js → chunk-J3NMHMG7.js} +2 -2
  88. package/dist/{chunk-6A6OSNC2.js → chunk-JBQFVXDK.js} +1 -1
  89. package/dist/{chunk-INGRSQVC.js → chunk-KAYK66B3.js} +3 -3
  90. package/dist/{chunk-FIQ7ND7P.js → chunk-LCYHJQGQ.js} +5 -5
  91. package/dist/{chunk-2YMVIBFT.js → chunk-ME2ZKG6Y.js} +12 -12
  92. package/dist/{chunk-LKSFQTGQ.js → chunk-MQJEDVTH.js} +1 -1
  93. package/dist/{chunk-C4F5RUJL.js → chunk-MW6MPOQZ.js} +6 -6
  94. package/dist/{chunk-XQYBTRVW.js → chunk-NDAJSNIZ.js} +1 -1
  95. package/dist/{chunk-DF2CUKN4.js → chunk-NFXWQDZ6.js} +2 -2
  96. package/dist/{chunk-ZAZQHOBS.js → chunk-O2CW5IFD.js} +11 -11
  97. package/dist/{chunk-GVJWHTN2.js → chunk-OR47JOLE.js} +2 -2
  98. package/dist/{chunk-422KDIO5.js → chunk-PD5LSNEK.js} +2 -2
  99. package/dist/{chunk-IEHI64ZN.js → chunk-PDES33BK.js} +1 -1
  100. package/dist/{chunk-AOAIYHAP.js → chunk-PHSPXFAY.js} +5 -5
  101. package/dist/{chunk-AEC72YC3.js → chunk-PNKFGNJF.js} +6 -6
  102. package/dist/{chunk-OBKHLKKB.js → chunk-PY2JHBNC.js} +4 -4
  103. package/dist/{chunk-LSABM2ES.js → chunk-Q4XW5FWF.js} +2 -2
  104. package/dist/{chunk-WES6E62H.js → chunk-Q6EK2GDR.js} +4 -4
  105. package/dist/{chunk-ZNMLL2WN.js → chunk-QNEF5JII.js} +2 -2
  106. package/dist/{chunk-XKXOT2ZU.js → chunk-QVXNSVBS.js} +3 -3
  107. package/dist/{chunk-LVL7XAXK.js → chunk-RO36S2KY.js} +5 -5
  108. package/dist/{chunk-QMKI5RGT.js → chunk-RQCKUCWK.js} +4 -5
  109. package/dist/{chunk-Q5H5AFS7.js → chunk-TIX4DZ2J.js} +3 -3
  110. package/dist/{chunk-E46NE7FB.js → chunk-U4P4NDVB.js} +2 -0
  111. package/dist/{chunk-GCOOOIBX.js → chunk-UJ2WT54H.js} +43 -31
  112. package/dist/{chunk-LGIB72D7.js → chunk-UOKA4ENY.js} +3 -3
  113. package/dist/{chunk-OLJTUTD2.js → chunk-UQ352C7S.js} +37 -33
  114. package/dist/{chunk-7Q6YKZY2.js → chunk-VBYWBGIJ.js} +3 -3
  115. package/dist/{chunk-QG5MJ6NW.js → chunk-VR6VWNLQ.js} +6 -6
  116. package/dist/{chunk-ISDMTGZ3.js → chunk-VTT3WV4C.js} +1 -1
  117. package/dist/{chunk-MAPC5KKZ.js → chunk-XBPBYSNM.js} +2 -2
  118. package/dist/{chunk-FMQBG2TD.js → chunk-XYFKYZCQ.js} +6 -6
  119. package/dist/{chunk-J6CNQ5UK.js → chunk-XYRPLFMD.js} +1 -1
  120. package/dist/{chunk-P6S4CALA.js → chunk-YKL7VBKJ.js} +5 -5
  121. package/dist/{chunk-MNVBO6UO.js → chunk-ZE56WMFL.js} +4 -4
  122. package/dist/{codex-app-cards-switch-TOHSGS5T.js → codex-app-cards-switch-NRAMENRL.js} +12 -12
  123. package/dist/{codex-card-routing-BPCOKSBO.js → codex-card-routing-D7ARIQKL.js} +2 -2
  124. package/dist/{codex-desktop-launch-6LD5GETH.js → codex-desktop-launch-2X4UEMRL.js} +2 -2
  125. package/dist/{codex-session-launch-ZVFPD4ON.js → codex-session-launch-FY5QIZSI.js} +20 -20
  126. package/dist/{config-3AFJSGM2.js → config-NDOIVL6S.js} +3 -3
  127. package/dist/{global-upgrade-6SWFRW5G.js → global-upgrade-MS3WGHEP.js} +9 -9
  128. package/dist/{identity-K2VBL5PB.js → identity-VXA3TZ7U.js} +4 -4
  129. package/dist/{live-capabilities-VQEG7TCE.js → live-capabilities-2LCBHUWN.js} +14 -11
  130. package/dist/{paths-ZAVMBGAQ.js → paths-HOCSWOBY.js} +3 -3
  131. package/dist/{reapply-BXMMOQXK.js → reapply-VYMO3QM6.js} +29 -29
  132. package/dist/src/index.js +34 -34
  133. package/dist/{upgrade-lock-UZN332AO.js → upgrade-lock-XH5AQIOD.js} +4 -4
  134. package/dist/{usage-EDDIN5YZ.js → usage-EVX6CH5H.js} +3 -3
  135. package/package.json +1 -1
@@ -3,6 +3,7 @@ import {
3
3
  } from "./chunk-XCEN33UP.js";
4
4
  import {
5
5
  CODEX_APP_LAUNCH_VARIABLE,
6
+ CODEX_ENGINE_COMMAND_THE_PROXY_WATCHES,
6
7
  CODEX_ENGINE_DIRECTORY,
7
8
  CODEX_ENGINE_ENTRYPOINT,
8
9
  CODEX_ENGINE_MANIFEST,
@@ -12,7 +13,7 @@ import {
12
13
  launcherIsGone,
13
14
  launcherWaitingOnThisProcess,
14
15
  tellTheLauncherTheEngineStarted
15
- } from "./chunk-E46NE7FB.js";
16
+ } from "./chunk-U4P4NDVB.js";
16
17
 
17
18
  // src/codex-desktop-launch.ts
18
19
  import { spawn as spawn2, execFileSync as execFileSync2 } from "child_process";
@@ -70,6 +71,7 @@ var PROBE_TIMEOUT_MS = 400;
70
71
  var MAX_PROBE_BYTES = 1024;
71
72
  var MAX_PROXIES = 64;
72
73
  var SOCKET_SUFFIX = ".sock";
74
+ var COMMAND_LINE_WORD_GAP = /\s+/;
73
75
  var codexRuntimeDirectory = (home = homedir()) => join("/tmp", `pushary-codex-${process.getuid?.() ?? "unknown"}-${createHash("sha256").update(home).digest("hex").slice(0, 16)}`);
74
76
  var privateDirectory = (directory) => {
75
77
  try {
@@ -185,11 +187,14 @@ var codexRuntimeProcesses = (output, commands = "") => {
185
187
  return processes;
186
188
  };
187
189
  var isCodexRuntimeEngine = (app, process2) => process2.executable.startsWith(`${app}/Contents/Resources/codex-cli/`) && process2.executable.endsWith("/codex");
188
- var isCodexCloudExecServer = (process2) => {
190
+ var wordsAfterTheExecutable = (process2) => {
191
+ if (process2.commandLine === process2.executable) return [];
189
192
  const prefix = `${process2.executable} `;
190
- if (!process2.commandLine?.startsWith(prefix)) return false;
191
- const args = process2.commandLine.slice(prefix.length).trimStart();
192
- return /^(?:(?:-c|--config)(?:\s+|=)forced_login_method=(?:"chatgpt"|'chatgpt'|chatgpt)\s+)*exec-server(?:\s+--remote(?:\s+|=)https?:\/\/[^\s'"]+)?(?:\s+--environment-id(?:\s+|=)[\w-]+)?\s*$/.test(args);
193
+ return process2.commandLine?.startsWith(prefix) ? process2.commandLine.slice(prefix.length).split(COMMAND_LINE_WORD_GAP) : null;
194
+ };
195
+ var theLauncherNeverSendsItThroughTheProxy = (process2) => {
196
+ const words = wordsAfterTheExecutable(process2);
197
+ return words !== null && !words.includes(CODEX_ENGINE_COMMAND_THE_PROXY_WATCHES);
193
198
  };
194
199
  var codexRuntimeStatus = (app, processes, replies) => {
195
200
  const byPid = new Map(processes.map((process2) => [process2.pid, process2]));
@@ -207,7 +212,7 @@ var codexRuntimeStatus = (app, processes, replies) => {
207
212
  }
208
213
  return null;
209
214
  };
210
- const engines = processes.filter((process2) => isEngine(process2) && !isCodexCloudExecServer(process2) && owningDesktop(process2) !== null);
215
+ const engines = processes.filter((process2) => isEngine(process2) && !theLauncherNeverSendsItThroughTheProxy(process2) && owningDesktop(process2) !== null);
211
216
  const owners = new Set(engines.map(owningDesktop));
212
217
  if ([...desktops].some((pid) => !owners.has(pid))) return "unknown";
213
218
  const observed = engines.map((engine) => replies.find((reply) => reply.enginePid === engine.pid && reply.pid === engine.parent));
@@ -531,12 +536,12 @@ var loadedOnce = (load) => {
531
536
  };
532
537
 
533
538
  // src/codex-desktop-proxy.ts
534
- var loadThePhone = () => import("./api-JY6EQT7A.js");
535
- var loadTheCardRouting = () => import("./codex-card-routing-BPCOKSBO.js");
539
+ var loadThePhone = () => import("./api-JWLCKSWR.js");
540
+ var loadTheCardRouting = () => import("./codex-card-routing-D7ARIQKL.js");
536
541
  var theFirstCardLoadsAgain = () => {
537
542
  };
538
543
  var ASKS_WITHOUT_ROUTING = {};
539
- var APP_SERVER_COMMAND = "app-server";
544
+ var APP_SERVER_COMMAND = CODEX_ENGINE_COMMAND_THE_PROXY_WATCHES;
540
545
  var CONFIG_FLAGS = ["-c", "--config"];
541
546
  var CONFIG_FLAG_PREFIXES = ["-c=", "--config="];
542
547
  var LISTEN_FLAG = "--listen";
@@ -712,16 +717,14 @@ var CodexAppCards = class {
712
717
  questions = /* @__PURE__ */ new Map();
713
718
  thePhone;
714
719
  theCardRouting;
715
- stoodDown = false;
720
+ closed = false;
716
721
  saidAQuestionWasUnknown = false;
717
722
  timing;
718
723
  standDown() {
719
- this.stoodDown = true;
720
- this.ledger.forgetEverything();
721
724
  void this.close();
722
725
  }
723
726
  fromTheEngine(line) {
724
- if (this.stoodDown) return;
727
+ if (this.closed || this.options.signal.aborted) return;
725
728
  try {
726
729
  if (line.includes(CARD_MARKER)) this.questionShown(parsedLine(line));
727
730
  else if (line.includes(RESOLVED_MARKER)) this.requestResolved(codexRequestResolvedBy(parsedLine(line)));
@@ -731,7 +734,7 @@ var CodexAppCards = class {
731
734
  }
732
735
  keepsFromTheApp(line) {
733
736
  try {
734
- if (this.stoodDown || this.ledger.tracksNothing) return true;
737
+ if (this.closed || this.options.signal.aborted || this.ledger.tracksNothing) return true;
735
738
  const answered = codexRequestAnsweredBy(parsedLine(line));
736
739
  if (answered === null) {
737
740
  this.ledger.appSentALine();
@@ -747,11 +750,16 @@ var CodexAppCards = class {
747
750
  }
748
751
  }
749
752
  async close() {
753
+ this.closed = true;
754
+ this.ledger.forgetEverything();
750
755
  const outstanding = [...this.questions.values()];
751
756
  this.questions.clear();
752
757
  for (const question of outstanding) question.waiting.abort();
753
758
  await Promise.allSettled(outstanding.map((question) => this.cancel(question)));
754
759
  }
760
+ canAnswer(requestId) {
761
+ return !this.closed && !this.options.signal.aborted && this.ledger.isWaiting(requestId);
762
+ }
755
763
  questionShown(message) {
756
764
  const card = codexCardOf(message);
757
765
  if (card) {
@@ -775,14 +783,14 @@ var CodexAppCards = class {
775
783
  async askThePhone(card, toolCall) {
776
784
  try {
777
785
  if (codexAppMayAnswerItself(card)) await pauseUnlessStopped(this.timing.letCodexAnswerFirstMs, this.options.signal);
778
- if (this.options.signal.aborted || !this.ledger.isWaiting(card.requestId)) return;
786
+ if (!this.canAnswer(card.requestId)) return;
779
787
  const account = await this.options.readAccount();
780
788
  if (!account) {
781
789
  this.ledger.leaveWithTheApp(card.requestId);
782
790
  return;
783
791
  }
784
792
  const [phone, routing] = await Promise.all([this.thePhone(), this.cardRoutingFor(toolCall)]);
785
- if (!this.ledger.isWaiting(card.requestId)) return;
793
+ if (!this.canAnswer(card.requestId)) return;
786
794
  const answerableUntil = Date.now() + this.timing.answerWindowMs;
787
795
  const asked = await phone.askUser(account.apiKey, {
788
796
  question: codexCardQuestion(card),
@@ -795,20 +803,20 @@ var CodexAppCards = class {
795
803
  ...routing
796
804
  }, ASK_TIMEOUT_MS, account.baseUrl);
797
805
  const question = { account, correlationId: asked.correlationId, waiting: new AbortController(), answerableUntil };
798
- if (!this.ledger.isWaiting(card.requestId)) {
806
+ if (!this.canAnswer(card.requestId)) {
799
807
  await this.cancel(question);
800
808
  return;
801
809
  }
810
+ this.questions.set(codexRequestKey(card.requestId), question);
802
811
  if (asked.answered) {
803
812
  await this.settle(card, question, asked.value);
804
813
  return;
805
814
  }
806
815
  if (!reachesAPersonAwayFromCodex(phone, asked)) {
807
816
  this.ledger.leaveWithTheApp(card.requestId);
808
- await this.cancel(question);
817
+ this.withdraw(card.requestId);
809
818
  return;
810
819
  }
811
- this.questions.set(codexRequestKey(card.requestId), question);
812
820
  await this.waitForThePhone(phone, card, question);
813
821
  } catch (error) {
814
822
  if (this.ledger.leaveWithTheApp(card.requestId)) {
@@ -820,7 +828,7 @@ var CodexAppCards = class {
820
828
  const { account, correlationId } = question;
821
829
  const stopped = AbortSignal.any([this.options.signal, question.waiting.signal]);
822
830
  let failures = 0;
823
- while (this.ledger.isWaiting(card.requestId) && !stopped.aborted && failures < MAX_CONSECUTIVE_WAIT_FAILURES) {
831
+ while (this.canAnswer(card.requestId) && !stopped.aborted && failures < MAX_CONSECUTIVE_WAIT_FAILURES) {
824
832
  const timeLeft = question.answerableUntil - Date.now();
825
833
  if (timeLeft <= 0) break;
826
834
  let answer;
@@ -832,7 +840,7 @@ var CodexAppCards = class {
832
840
  await pauseUnlessStopped(this.timing.pauseBetweenPollsMs, stopped);
833
841
  continue;
834
842
  }
835
- if (!this.ledger.isWaiting(card.requestId)) return;
843
+ if (!this.canAnswer(card.requestId)) return;
836
844
  if (answer.answered) {
837
845
  await this.settle(card, question, answer.value);
838
846
  return;
@@ -847,14 +855,19 @@ var CodexAppCards = class {
847
855
  if (this.ledger.leaveWithTheApp(card.requestId)) this.withdraw(card.requestId);
848
856
  }
849
857
  async settle(card, question, phoneAnswer) {
850
- this.questions.delete(codexRequestKey(card.requestId));
851
- const decision = codexAppCardDecisionOf(phoneAnswer);
852
- if (this.stoodDown) return;
853
- if (decision === null || !isTheSameAccount(await this.options.readAccount(), question.account)) {
854
- this.ledger.leaveWithTheApp(card.requestId);
855
- return;
858
+ const key = codexRequestKey(card.requestId);
859
+ try {
860
+ const decision = codexAppCardDecisionOf(phoneAnswer);
861
+ if (decision === null || !isTheSameAccount(await this.options.readAccount(), question.account)) {
862
+ this.ledger.leaveWithTheApp(card.requestId);
863
+ return;
864
+ }
865
+ if (!this.canAnswer(card.requestId) || question.waiting.signal.aborted) return;
866
+ if (this.questions.get(key) !== question) return;
867
+ if (this.ledger.settleOnThePhone(card.requestId)) this.options.reply(codexCardReply(card, decision));
868
+ } finally {
869
+ if (this.questions.get(key) === question) this.questions.delete(key);
856
870
  }
857
- if (this.ledger.settleOnThePhone(card.requestId)) this.options.reply(codexCardReply(card, decision));
858
871
  }
859
872
  withdraw(requestId) {
860
873
  const key = codexRequestKey(requestId);
@@ -985,7 +998,6 @@ var QUOTE_INSIDE_QUOTES = "'\\''";
985
998
  var shellQuoted = (value) => QUOTE + value.replaceAll(QUOTE, QUOTE_INSIDE_QUOTES) + QUOTE;
986
999
  var shellUnquoted = (quoted) => quoted.length >= 2 && quoted.startsWith(QUOTE) && quoted.endsWith(QUOTE) ? quoted.slice(1, -1).replaceAll(QUOTE_INSIDE_QUOTES, QUOTE) : null;
987
1000
  var KNOWN_ENGINE_LAYOUT = 1;
988
- var ENGINE_COMMAND_THE_PROXY_WATCHES = "app-server";
989
1001
  var INSTALLED_CODEX_APPS = ["/Applications/ChatGPT.app", "/Applications/Codex.app"];
990
1002
  var LAUNCHCTL = "/bin/launchctl";
991
1003
  var APP_CARDS_FLAG = "--app-cards";
@@ -1015,7 +1027,7 @@ var desktopProxyScript = (entry, app, engine, options = { turnsItselfOffWithoutT
1015
1027
  "fi",
1016
1028
  `if ${everyProgramFileIsThere(entry)}; then`,
1017
1029
  ' for argument in "$@"; do',
1018
- ` if [ "$argument" = ${shellQuoted(ENGINE_COMMAND_THE_PROXY_WATCHES)} ]; then`,
1030
+ ` if [ "$argument" = ${shellQuoted(CODEX_ENGINE_COMMAND_THE_PROXY_WATCHES)} ]; then`,
1019
1031
  ' for left in "$0".pending.*; do',
1020
1032
  ' [ -e "$left" ] && ! kill -0 "${left##*.}" 2>/dev/null && rm -f "$left"',
1021
1033
  " done",
@@ -1085,7 +1097,7 @@ var codexDesktopCommand = async (args, entry, readAccount) => {
1085
1097
  return runCodexDesktopProxy(engine2, args.slice(3), readAccount, { watchesForCards: layoutIsKnown });
1086
1098
  }
1087
1099
  if (args[0] === APP_CARDS_FLAG) {
1088
- const { codexAppCardsCommandOnThisMac } = await import("./codex-app-cards-switch-TOHSGS5T.js");
1100
+ const { codexAppCardsCommandOnThisMac } = await import("./codex-app-cards-switch-NRAMENRL.js");
1089
1101
  return codexAppCardsCommandOnThisMac(args.slice(1), entry, readAccount);
1090
1102
  }
1091
1103
  if (args.length > 2) throw new Error("Usage: pushary codex --desktop [path/to/Codex.app]");
@@ -9,20 +9,20 @@ import {
9
9
  installedCodexApp,
10
10
  readCodexAppRuntime,
11
11
  shellQuoted
12
- } from "./chunk-GCOOOIBX.js";
12
+ } from "./chunk-UJ2WT54H.js";
13
13
  import {
14
14
  writeHuman
15
15
  } from "./chunk-QCGNGEGE.js";
16
16
  import {
17
17
  xml
18
- } from "./chunk-AEC72YC3.js";
18
+ } from "./chunk-PNKFGNJF.js";
19
19
  import {
20
20
  writeFileAtomic
21
21
  } from "./chunk-TODDEIYG.js";
22
22
  import {
23
23
  CODEX_APP_LAUNCH_AT_LOGIN_VERB,
24
24
  CODEX_APP_LAUNCH_VARIABLE
25
- } from "./chunk-E46NE7FB.js";
25
+ } from "./chunk-U4P4NDVB.js";
26
26
 
27
27
  // src/codex-app-cards-switch.ts
28
28
  import { execFileSync as execFileSync2 } from "child_process";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  realpath
3
- } from "./chunk-MAPC5KKZ.js";
3
+ } from "./chunk-XBPBYSNM.js";
4
4
  import {
5
5
  findNativeClaudeInstall
6
6
  } from "./chunk-CYTPQDQY.js";
@@ -9,16 +9,24 @@ import {
9
9
  resolveGlobalBinary,
10
10
  resolveGlobalBinaryAt,
11
11
  resolveGlobalPackageVersion,
12
- resolveGlobalPackageVersionAsync,
13
12
  resolvePackageVersionFromBinary,
14
13
  resolvePathBinary,
15
14
  resolvePathBinaryAsync
16
- } from "./chunk-CQLQFN6B.js";
15
+ } from "./chunk-FKKS4ZC5.js";
17
16
  import {
18
- MANAGED_PROVIDERS
19
- } from "./chunk-KQVURVAP.js";
17
+ CLAUDE_BRIDGE_CAPABILITY,
18
+ CLAUDE_RESUME_CAPABILITY,
19
+ CODEX_BRIDGE_CAPABILITY,
20
+ CODEX_RESUME_CAPABILITY,
21
+ GEMINI_BRIDGE_CAPABILITY,
22
+ GEMINI_RESUME_CAPABILITY,
23
+ MANAGED_PROVIDERS,
24
+ SPAWN_CAPABILITY,
25
+ sessionProvidersAdvertisedBy
26
+ } from "./chunk-A6KNDKO5.js";
20
27
 
21
28
  // src/live-capabilities.ts
29
+ import { accessSync, constants, statSync as statSync2 } from "fs";
22
30
  import { homedir } from "os";
23
31
 
24
32
  // src/setup/codex-install-probe.ts
@@ -88,12 +96,6 @@ var nodeCodexInstallProbe = (resolveOnPath) => ({
88
96
  var codexInstallHealthAt = (binary) => checkCodexInstall(nodeCodexInstallProbe(() => binary));
89
97
 
90
98
  // src/live-capabilities.ts
91
- var CLAUDE_BRIDGE_CAPABILITY = "claude-bridge";
92
- var CLAUDE_RESUME_CAPABILITY = "claude-resume";
93
- var CODEX_BRIDGE_CAPABILITY = "codex-bridge";
94
- var CODEX_RESUME_CAPABILITY = "codex-resume";
95
- var GEMINI_BRIDGE_CAPABILITY = "gemini-bridge";
96
- var GEMINI_RESUME_CAPABILITY = "gemini-resume";
97
99
  var GEMINI_BRIDGE_MIN_VERSION = [0, 40, 0];
98
100
  var version = (raw) => {
99
101
  const match = raw?.match(/^(\d+)\.(\d+)\.(\d+)/);
@@ -113,12 +115,7 @@ var providerLiveCapabilities = (probe) => [
113
115
  ...probe.codex ? [CODEX_BRIDGE_CAPABILITY, CODEX_RESUME_CAPABILITY] : [],
114
116
  ...geminiLiveCapabilities(probe.geminiVersion)
115
117
  ];
116
- var PROVIDER_BY_BRIDGE_CAPABILITY = [
117
- [CLAUDE_BRIDGE_CAPABILITY, "claude"],
118
- [CODEX_BRIDGE_CAPABILITY, "codex"],
119
- [GEMINI_BRIDGE_CAPABILITY, "gemini"]
120
- ];
121
- var launchableProviders = (capabilities) => PROVIDER_BY_BRIDGE_CAPABILITY.filter(([capability]) => capabilities.includes(capability)).map(([, provider]) => provider);
118
+ var launchableProviders = sessionProvidersAdvertisedBy;
122
119
  var hasSpawnProvider = (capabilities) => launchableProviders(capabilities).length > 0;
123
120
  var resolveControlPolicy = (input) => {
124
121
  if (input.mode === "off") return "disabled";
@@ -156,9 +153,29 @@ var anyInstalledCodex = () => true;
156
153
  var codexWithItsProgram = (binary) => !codexBinaryIsBroken(binary);
157
154
  var detectProviderLiveCapabilities = (providers = MANAGED_PROVIDERS, home = homedir()) => detectCapabilities(providers, anyInstalledCodex, home);
158
155
  var detectLaunchableProviderCapabilities = (providers = MANAGED_PROVIDERS, home = homedir()) => detectCapabilities(providers, codexWithItsProgram, home);
159
- var SPAWN_CAPABILITY = "spawn";
160
156
  var launchAdvertisement = (launchable) => hasSpawnProvider(launchable) ? [SPAWN_CAPABILITY, ...launchable] : launchable;
161
157
  var expectedLaunchCapabilities = (providers = MANAGED_PROVIDERS, home = homedir()) => launchAdvertisement(detectLaunchableProviderCapabilities(providers, home));
158
+ var inspectProviderBinaries = (candidates) => {
159
+ const binaries = {};
160
+ for (const provider of MANAGED_PROVIDERS) {
161
+ const binary = candidates[provider];
162
+ if (!binary) continue;
163
+ try {
164
+ accessSync(binary, constants.X_OK);
165
+ if (statSync2(binary).isFile()) binaries[provider] = binary;
166
+ } catch {
167
+ continue;
168
+ }
169
+ }
170
+ return {
171
+ binaries,
172
+ capabilities: providerLiveCapabilities({
173
+ claude: binaries.claude !== void 0,
174
+ codex: binaries.codex !== void 0 && !codexBinaryIsBroken(binaries.codex),
175
+ geminiVersion: binaries.gemini ? resolvePackageVersionFromBinary(binaries.gemini, "@google/gemini-cli") : void 0
176
+ })
177
+ };
178
+ };
162
179
  var discoverProviderInventory = async (providers, signal, platform = process.platform, home = homedir()) => {
163
180
  let prefix;
164
181
  const globalBinary = async (provider) => {
@@ -174,14 +191,7 @@ var discoverProviderInventory = async (providers, signal, platform = process.pla
174
191
  for (const [provider, binary] of found) {
175
192
  if (binary !== void 0) binaries[provider] = binary;
176
193
  }
177
- return {
178
- binaries,
179
- capabilities: providerLiveCapabilities({
180
- claude: binaries.claude !== void 0,
181
- codex: binaries.codex !== void 0 && !codexBinaryIsBroken(binaries.codex),
182
- geminiVersion: binaries.gemini ? resolvePackageVersionFromBinary(binaries.gemini, "@google/gemini-cli") ?? await resolveGlobalPackageVersionAsync("@google/gemini-cli", signal) : void 0
183
- })
184
- };
194
+ return inspectProviderBinaries(binaries);
185
195
  };
186
196
  var trackProviderInventory = async (providers, onChange, home = homedir()) => {
187
197
  const controller = new AbortController();
@@ -207,12 +217,6 @@ var trackProviderInventory = async (providers, onChange, home = homedir()) => {
207
217
  export {
208
218
  checkCodexInstall,
209
219
  nodeCodexInstallProbe,
210
- CLAUDE_BRIDGE_CAPABILITY,
211
- CLAUDE_RESUME_CAPABILITY,
212
- CODEX_BRIDGE_CAPABILITY,
213
- CODEX_RESUME_CAPABILITY,
214
- GEMINI_BRIDGE_CAPABILITY,
215
- GEMINI_RESUME_CAPABILITY,
216
220
  geminiLiveCapabilities,
217
221
  providerLiveCapabilities,
218
222
  launchableProviders,
@@ -225,9 +229,9 @@ export {
225
229
  codexBinaryIsBroken,
226
230
  detectProviderLiveCapabilities,
227
231
  detectLaunchableProviderCapabilities,
228
- SPAWN_CAPABILITY,
229
232
  launchAdvertisement,
230
233
  expectedLaunchCapabilities,
234
+ inspectProviderBinaries,
231
235
  discoverProviderInventory,
232
236
  trackProviderInventory
233
237
  };
@@ -2,16 +2,16 @@ import {
2
2
  NpmInstallError,
3
3
  NpmMissingError,
4
4
  NpmPermissionError
5
- } from "./chunk-CQLQFN6B.js";
5
+ } from "./chunk-FKKS4ZC5.js";
6
6
  import {
7
7
  writeFileAtomic
8
8
  } from "./chunk-TODDEIYG.js";
9
9
  import {
10
10
  NPX_LATEST_COMMAND
11
- } from "./chunk-ZYLZCNOJ.js";
11
+ } from "./chunk-BKWDG5QV.js";
12
12
  import {
13
13
  readSetupAgentFailures
14
- } from "./chunk-KQVURVAP.js";
14
+ } from "./chunk-A6KNDKO5.js";
15
15
 
16
16
  // src/setup/config-write.ts
17
17
  var AgentConfigWriteError = class extends Error {
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  notificationAnswerStep
3
- } from "./chunk-DTJZK3MN.js";
3
+ } from "./chunk-CL3OIICA.js";
4
4
  import {
5
5
  canChangeApprovalSettings
6
- } from "./chunk-4RKB6X4S.js";
6
+ } from "./chunk-AIZ5KC2N.js";
7
7
  import {
8
8
  matchMacAccountStep,
9
9
  retryAgentCommand
10
- } from "./chunk-7Q6YKZY2.js";
10
+ } from "./chunk-VBYWBGIJ.js";
11
11
  import {
12
12
  EXIT
13
13
  } from "./chunk-BG4HHB7E.js";
14
14
  import {
15
15
  NPX_LATEST_COMMAND
16
- } from "./chunk-ZYLZCNOJ.js";
16
+ } from "./chunk-BKWDG5QV.js";
17
17
 
18
18
  // src/setup/closing.ts
19
19
  var ACTIVITY_URL = "pushary.com/dashboard/agent/activity";
@@ -26,10 +26,10 @@ var sendAnotherTestLines = (appPlatforms) => {
26
26
  var TRANSCRIPT_SYNC_NOTICE = `Transcripts sync redacted and encrypted. Your phone can decrypt them; authorized Pushary compliance admins can recover them for documented legal obligations. Turn off: ${NPX_LATEST_COMMAND} transcripts off`;
27
27
  var PAIR_PHONE_APP_HINT = `${NPX_LATEST_COMMAND} setup --connect app pair the Pushary app on your phone`;
28
28
  var RESTART_AGENTS_LINE = "Restart any open agent sessions so they pick up Pushary.";
29
- var TEAM_OFFER_LINE = "On a team? Send risky steps to a lead and see who approved: pushary.com/teams";
29
+ var TEAM_OFFER_URL = "https://pushary.com/teams?utm_source=cli&utm_medium=setup&utm_campaign=teams";
30
30
  var PLANS_THAT_CAN_MOVE_UP_TO_TEAM = ["agent", "agent_pro"];
31
31
  var canMoveUpToTeam = (plan) => PLANS_THAT_CAN_MOVE_UP_TO_TEAM.some((candidate) => candidate === plan);
32
- var teamOfferLines = (setupSucceeded, plan) => setupSucceeded && canMoveUpToTeam(plan) ? [TEAM_OFFER_LINE] : [];
32
+ var teamOfferLines = (setupSucceeded, plan) => setupSucceeded && canMoveUpToTeam(plan) ? ["On a team? Send risky steps to a lead and see who approved.", TEAM_OFFER_URL] : [];
33
33
  var ANSWERING_DEVICES = {
34
34
  mobile_app: "Your phone",
35
35
  mobile_background: "Your phone",
@@ -2,7 +2,7 @@ import {
2
2
  isApprovalMode,
3
3
  isRecord,
4
4
  isTimeoutAction
5
- } from "./chunk-KQVURVAP.js";
5
+ } from "./chunk-A6KNDKO5.js";
6
6
 
7
7
  // src/cli/settings-response.ts
8
8
  var isFiniteNumber = (value) => typeof value === "number" && Number.isFinite(value);
@@ -3,10 +3,10 @@ import {
3
3
  } from "./chunk-CYTPQDQY.js";
4
4
  import {
5
5
  parseVersion
6
- } from "./chunk-CQLQFN6B.js";
6
+ } from "./chunk-FKKS4ZC5.js";
7
7
  import {
8
8
  isRecord
9
- } from "./chunk-KQVURVAP.js";
9
+ } from "./chunk-A6KNDKO5.js";
10
10
 
11
11
  // src/setup/agent-probe.ts
12
12
  import { execSync } from "child_process";
@@ -3,10 +3,10 @@ import {
3
3
  forkFinishWithUpgradeLock,
4
4
  installWithUpgradeLock,
5
5
  releaseAutoUpdateLock
6
- } from "./chunk-6RAHONLG.js";
6
+ } from "./chunk-J3NMHMG7.js";
7
7
  import {
8
8
  phoneStartIsRequired
9
- } from "./chunk-OLJTUTD2.js";
9
+ } from "./chunk-UQ352C7S.js";
10
10
  import {
11
11
  describeAutoUpdateCheck,
12
12
  globalInstallLocation,
@@ -18,25 +18,25 @@ import {
18
18
  readAutoUpdateState,
19
19
  updateAutoUpdateState,
20
20
  upgradeEntryFor
21
- } from "./chunk-LHYBHWCK.js";
21
+ } from "./chunk-CUJ2MGG5.js";
22
22
  import {
23
23
  autoUpdateLock,
24
24
  autoUpdateLog,
25
25
  autoUpdateState
26
- } from "./chunk-CZH3JDVB.js";
26
+ } from "./chunk-GGXAZTSW.js";
27
27
  import {
28
28
  execNpm,
29
29
  fetchLatestPublishedVersion,
30
30
  npmErrorMessage,
31
31
  readGlobalCliInstallAt,
32
32
  readGlobalPrefix
33
- } from "./chunk-CQLQFN6B.js";
33
+ } from "./chunk-FKKS4ZC5.js";
34
34
  import {
35
35
  EXIT
36
36
  } from "./chunk-BG4HHB7E.js";
37
37
  import {
38
38
  NPX_LATEST_COMMAND
39
- } from "./chunk-ZYLZCNOJ.js";
39
+ } from "./chunk-BKWDG5QV.js";
40
40
  import {
41
41
  commandsPackage,
42
42
  globalUpgradeEntry,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  pusharyDir
3
- } from "./chunk-CZH3JDVB.js";
3
+ } from "./chunk-GGXAZTSW.js";
4
4
  import {
5
5
  writeFileAtomic
6
6
  } from "./chunk-TODDEIYG.js";
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  announceSubscriptionRequired,
3
3
  isDeferAnswer
4
- } from "./chunk-M4G4VWW6.js";
4
+ } from "./chunk-F335PCA4.js";
5
5
  import {
6
6
  askUser,
7
7
  isDecisionStopped,
8
8
  isQuestionLimitRefusal,
9
9
  waitForQuestion
10
- } from "./chunk-P3UCAWUP.js";
10
+ } from "./chunk-3RBUCAO7.js";
11
11
  import {
12
12
  SubscriptionRequiredError
13
- } from "./chunk-UZZRSCFR.js";
13
+ } from "./chunk-EADQYNLU.js";
14
14
  import {
15
15
  getMachineId
16
- } from "./chunk-J6CNQ5UK.js";
16
+ } from "./chunk-XYRPLFMD.js";
17
17
  import {
18
18
  ASK_CONTEXT_MAX,
19
19
  agentQuestionContext,
@@ -23,7 +23,7 @@ import {
23
23
  plainAskOf,
24
24
  questionsShownAsASet,
25
25
  shouldDeferToNativeMode
26
- } from "./chunk-KQVURVAP.js";
26
+ } from "./chunk-A6KNDKO5.js";
27
27
 
28
28
  // src/native-defer.ts
29
29
  var nativeDeferOptions = () => {
@@ -1,21 +1,21 @@
1
1
  import {
2
2
  UNNAMED_ACTION
3
- } from "./chunk-QTR6KQEU.js";
3
+ } from "./chunk-BFXIQGWS.js";
4
4
  import {
5
5
  askUser,
6
6
  isAwayPaused,
7
7
  isLocalQuestionHandoff,
8
8
  unavailableQuestionUnlessRefused,
9
9
  waitForQuestion
10
- } from "./chunk-P3UCAWUP.js";
10
+ } from "./chunk-3RBUCAO7.js";
11
11
  import {
12
12
  getMachineId
13
- } from "./chunk-J6CNQ5UK.js";
13
+ } from "./chunk-XYRPLFMD.js";
14
14
  import {
15
15
  hookWaitClamped,
16
16
  hookWaitDeadline,
17
17
  scopeBreachReasonOf
18
- } from "./chunk-KQVURVAP.js";
18
+ } from "./chunk-A6KNDKO5.js";
19
19
 
20
20
  // src/pushed-question.ts
21
21
  var scopeQuestionOf = (verdict) => {
@@ -22,23 +22,23 @@ import {
22
22
  turnCodexAppCardsOff,
23
23
  turnCodexAppCardsOn,
24
24
  whyLaunchctlFailed
25
- } from "./chunk-LGIB72D7.js";
26
- import "./chunk-GCOOOIBX.js";
25
+ } from "./chunk-UOKA4ENY.js";
26
+ import "./chunk-UJ2WT54H.js";
27
27
  import "./chunk-XCEN33UP.js";
28
28
  import "./chunk-QCGNGEGE.js";
29
- import "./chunk-AEC72YC3.js";
29
+ import "./chunk-PNKFGNJF.js";
30
30
  import "./chunk-H6CL3T2S.js";
31
- import "./chunk-J6CNQ5UK.js";
32
- import "./chunk-XKXOT2ZU.js";
33
- import "./chunk-GVJWHTN2.js";
34
- import "./chunk-CZH3JDVB.js";
35
- import "./chunk-CQLQFN6B.js";
36
- import "./chunk-IEHI64ZN.js";
31
+ import "./chunk-XYRPLFMD.js";
32
+ import "./chunk-QVXNSVBS.js";
33
+ import "./chunk-OR47JOLE.js";
34
+ import "./chunk-GGXAZTSW.js";
35
+ import "./chunk-FKKS4ZC5.js";
36
+ import "./chunk-PDES33BK.js";
37
37
  import "./chunk-TODDEIYG.js";
38
- import "./chunk-ZYLZCNOJ.js";
38
+ import "./chunk-BKWDG5QV.js";
39
39
  import "./chunk-WIIMW5YO.js";
40
- import "./chunk-KQVURVAP.js";
41
- import "./chunk-E46NE7FB.js";
40
+ import "./chunk-A6KNDKO5.js";
41
+ import "./chunk-U4P4NDVB.js";
42
42
  import "./chunk-MLKGABMK.js";
43
43
  export {
44
44
  CODEX_APP_CARDS_DIRECTORY,
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  deriveToolTarget
3
- } from "./chunk-QTR6KQEU.js";
3
+ } from "./chunk-BFXIQGWS.js";
4
4
  import {
5
5
  TOOL_NAME_MAX_LENGTH,
6
6
  codexElicitationToolName
7
- } from "./chunk-KQVURVAP.js";
7
+ } from "./chunk-A6KNDKO5.js";
8
8
  import "./chunk-MLKGABMK.js";
9
9
 
10
10
  // src/codex-card-routing.ts
@@ -11,11 +11,11 @@ import {
11
11
  installedCodexApp,
12
12
  shellQuoted,
13
13
  writeDesktopProxy
14
- } from "./chunk-GCOOOIBX.js";
14
+ } from "./chunk-UJ2WT54H.js";
15
15
  import "./chunk-XCEN33UP.js";
16
16
  import {
17
17
  CODEX_APP_LAUNCH_VARIABLE
18
- } from "./chunk-E46NE7FB.js";
18
+ } from "./chunk-U4P4NDVB.js";
19
19
  import "./chunk-MLKGABMK.js";
20
20
  export {
21
21
  CODEX_APP_LAUNCH_VARIABLE,