pushary 1.9.199 → 1.9.204

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 (145) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/{api-OUFAFWVY.js → api-PO372R5F.js} +13 -11
  3. package/dist/bin/pushary-audit.js +3 -3
  4. package/dist/bin/pushary-bell-hook.js +28 -28
  5. package/dist/bin/pushary-bell.js +12 -12
  6. package/dist/bin/pushary-calls.js +15 -15
  7. package/dist/bin/pushary-claude.js +30 -32
  8. package/dist/bin/pushary-clean.js +39 -39
  9. package/dist/bin/pushary-codex-bridge.js +23 -23
  10. package/dist/bin/pushary-codex-hook.js +51 -52
  11. package/dist/bin/pushary-codex-session.js +8 -8
  12. package/dist/bin/pushary-codex.js +16 -16
  13. package/dist/bin/pushary-connect.js +35 -35
  14. package/dist/bin/pushary-cowork.js +5 -5
  15. package/dist/bin/pushary-daemon.js +47 -47
  16. package/dist/bin/pushary-disconnect.js +30 -30
  17. package/dist/bin/pushary-doctor.js +47 -47
  18. package/dist/bin/pushary-elicitation-hook.js +29 -29
  19. package/dist/bin/pushary-gemini-bridge.js +18 -18
  20. package/dist/bin/pushary-gemini-hook.js +32 -32
  21. package/dist/bin/pushary-hook.js +36 -36
  22. package/dist/bin/pushary-login.js +22 -22
  23. package/dist/bin/pushary-logout.js +30 -30
  24. package/dist/bin/pushary-mcp.js +12 -12
  25. package/dist/bin/pushary-mode.js +16 -16
  26. package/dist/bin/pushary-notification-hook.js +27 -27
  27. package/dist/bin/pushary-opencode-bridge.js +22 -22
  28. package/dist/bin/pushary-opencode-hook.js +34 -34
  29. package/dist/bin/pushary-permission-denied-hook.js +36 -36
  30. package/dist/bin/pushary-permission-hook.js +36 -36
  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 +40 -40
  35. package/dist/bin/pushary-sessions.js +14 -14
  36. package/dist/bin/pushary-setup.js +197 -92
  37. package/dist/bin/pushary-stats.js +5 -5
  38. package/dist/bin/pushary-status.js +36 -36
  39. package/dist/bin/pushary-stop-hook.js +27 -27
  40. package/dist/bin/pushary-stopfailure-hook.js +27 -27
  41. package/dist/bin/pushary-suggestions.js +16 -16
  42. package/dist/bin/pushary-transcript-register.js +17 -17
  43. package/dist/bin/pushary-transcripts.js +25 -25
  44. package/dist/bin/pushary-upgrade.js +47 -47
  45. package/dist/bin/pushary-wait.js +16 -16
  46. package/dist/bin/pushary.js +7 -7
  47. package/dist/{chunk-LECDW27E.js → chunk-2KNKPMWO.js} +1 -1
  48. package/dist/{chunk-TZD42VJP.js → chunk-2RJQKHS2.js} +5 -5
  49. package/dist/{chunk-LEUQ37WR.js → chunk-2Y7MJQCN.js} +2 -2
  50. package/dist/{chunk-LGV3U2KK.js → chunk-322DR4ZT.js} +1 -1
  51. package/dist/{chunk-WHDNAGFI.js → chunk-33GWNNFN.js} +5 -5
  52. package/dist/{chunk-WRZFEG6A.js → chunk-34YI42UX.js} +3 -3
  53. package/dist/{chunk-UQOEZQ6G.js → chunk-3DGWT6EY.js} +2 -2
  54. package/dist/{chunk-3XSDSKAX.js → chunk-3NGBANTY.js} +1 -1
  55. package/dist/{chunk-HQUYQOWZ.js → chunk-3W5OVQ66.js} +2 -2
  56. package/dist/{chunk-7SCBP4U7.js → chunk-3WPXWHEM.js} +9 -9
  57. package/dist/{chunk-RXNQ3GJM.js → chunk-52OHO3HH.js} +1 -1
  58. package/dist/{chunk-MRG7AEJA.js → chunk-5JRBOJYW.js} +1 -1
  59. package/dist/{chunk-DGZYM676.js → chunk-6LQEDP2W.js} +1 -1
  60. package/dist/{chunk-I4EHOHYH.js → chunk-75MSER3U.js} +1 -1
  61. package/dist/{chunk-RMWPSYJG.js → chunk-7SNBOQDD.js} +2 -2
  62. package/dist/{chunk-WFE2YHWQ.js → chunk-7YB4UGGI.js} +2 -2
  63. package/dist/{chunk-HIPEE6RH.js → chunk-AISKZTFX.js} +4 -4
  64. package/dist/{chunk-FUY7TPTQ.js → chunk-AORWV5JK.js} +1 -1
  65. package/dist/chunk-AVFPHV4N.js +10 -0
  66. package/dist/{chunk-UUMBN6AU.js → chunk-B4J3OPKE.js} +2 -2
  67. package/dist/{chunk-QOV5MVKT.js → chunk-BDVSELVT.js} +4 -4
  68. package/dist/{chunk-OPBYHXZP.js → chunk-CBBRVY77.js} +1 -1
  69. package/dist/{chunk-MOCDN7B3.js → chunk-CFPJRYNK.js} +1 -1
  70. package/dist/{chunk-247LVLEC.js → chunk-CQJ7567M.js} +3 -3
  71. package/dist/{chunk-2BVH7JC7.js → chunk-CQP7P52T.js} +13 -13
  72. package/dist/{chunk-AQB2LUX5.js → chunk-CRCC65FU.js} +11 -11
  73. package/dist/{chunk-JFUTFHB6.js → chunk-D7LVY2XF.js} +6 -6
  74. package/dist/{chunk-UJERPPET.js → chunk-DGNQLVYO.js} +2 -2
  75. package/dist/{chunk-FR7XIHSN.js → chunk-DNCH65TL.js} +10 -10
  76. package/dist/{chunk-XQNSJWFD.js → chunk-E3VDRPOZ.js} +5 -5
  77. package/dist/{chunk-Q7W4TEWC.js → chunk-ETPJJ6Y6.js} +3 -3
  78. package/dist/{chunk-PWJ2YNLB.js → chunk-HNSTXU6Y.js} +1 -1
  79. package/dist/{chunk-4DTKZQKO.js → chunk-HS4RZZRG.js} +1 -1
  80. package/dist/{chunk-F75727GN.js → chunk-HTMMJASM.js} +33 -6
  81. package/dist/{chunk-A6TVXDTE.js → chunk-HXLCATVW.js} +2 -2
  82. package/dist/{chunk-LS2VJJFJ.js → chunk-IKUJZYFH.js} +19 -12
  83. package/dist/{chunk-4SHFFJTL.js → chunk-JWXEPWQ6.js} +7 -7
  84. package/dist/{chunk-JKD642VE.js → chunk-JZOXTGTD.js} +3 -3
  85. package/dist/{chunk-SUUATETY.js → chunk-KNCMUCKG.js} +1 -1
  86. package/dist/{chunk-I3ZOD5I4.js → chunk-LWWFQHJR.js} +3 -3
  87. package/dist/{chunk-5STI67CK.js → chunk-MGAEFOGL.js} +5 -5
  88. package/dist/{chunk-B3STTU5D.js → chunk-MP3IANXU.js} +22 -6
  89. package/dist/{chunk-X3TBNXPX.js → chunk-MX6HK3UN.js} +3 -3
  90. package/dist/{chunk-XTFN2YTA.js → chunk-N4QFPPSM.js} +3 -3
  91. package/dist/{chunk-6ZYUYRR2.js → chunk-N62TAZJE.js} +3 -3
  92. package/dist/{chunk-RHQ5FDU4.js → chunk-NE6LKCGR.js} +4 -4
  93. package/dist/{chunk-PHFQV5MO.js → chunk-OXGT7OTC.js} +63 -24
  94. package/dist/{chunk-JTZMPMXH.js → chunk-PGGYS32J.js} +1 -1
  95. package/dist/{chunk-YGRPTTER.js → chunk-POVKTTKE.js} +2 -2
  96. package/dist/{chunk-KCSTT6KQ.js → chunk-PTHC2H7E.js} +1 -1
  97. package/dist/{chunk-72EKTJ2U.js → chunk-PW7WIT6J.js} +5 -5
  98. package/dist/{chunk-23W7FAZL.js → chunk-QKCWDUQQ.js} +5 -5
  99. package/dist/{chunk-HN6ABA2B.js → chunk-QKKNYXIU.js} +4 -4
  100. package/dist/{chunk-BYYU5QS3.js → chunk-QSVIT62Y.js} +1 -1
  101. package/dist/{chunk-TQDTYV27.js → chunk-QZZU4VHH.js} +1 -1
  102. package/dist/{chunk-M2S6BBSR.js → chunk-R6XDTP7G.js} +6 -6
  103. package/dist/{chunk-2SHEWMGU.js → chunk-R7ZVCOXR.js} +2 -2
  104. package/dist/{chunk-ZEVNSFFV.js → chunk-RBKBFQ3D.js} +4 -4
  105. package/dist/{chunk-AXJCUWLD.js → chunk-RDFQOEPF.js} +6 -6
  106. package/dist/{chunk-YB64X4IQ.js → chunk-RG3REA2Y.js} +1 -1
  107. package/dist/{chunk-WGGEF3XC.js → chunk-RGPYEMW5.js} +5 -5
  108. package/dist/{chunk-O4E4ISTO.js → chunk-RILOBL2B.js} +2 -2
  109. package/dist/{chunk-SJUE6CFP.js → chunk-RJTCIOHI.js} +6 -4
  110. package/dist/{chunk-VEOVR6Z2.js → chunk-RMNOELSS.js} +1 -1
  111. package/dist/{chunk-LXWHMYOS.js → chunk-RYT23NAI.js} +3 -3
  112. package/dist/{chunk-RDECWGBJ.js → chunk-SCZELAXA.js} +1 -1
  113. package/dist/{chunk-P4VF3DZW.js → chunk-SH2WBJ5M.js} +1 -1
  114. package/dist/{chunk-3RUQKPHU.js → chunk-SHYBUXSP.js} +7 -7
  115. package/dist/{chunk-XKFL7XBP.js → chunk-SXMJ7NAN.js} +1 -1
  116. package/dist/{chunk-CDWR23BU.js → chunk-T5RPPEUL.js} +10 -10
  117. package/dist/{chunk-VCTMCQCU.js → chunk-TTE7QIW5.js} +2 -2
  118. package/dist/{chunk-CFWOZBUQ.js → chunk-UQQE37KU.js} +6 -6
  119. package/dist/{chunk-OMJ6ISJW.js → chunk-VLSSUMFC.js} +2 -2
  120. package/dist/{chunk-6KMMY7DI.js → chunk-W6KQY5RJ.js} +5 -5
  121. package/dist/{chunk-VU7LK6KI.js → chunk-WFUWF4QY.js} +24 -19
  122. package/dist/{chunk-DQGTFUXX.js → chunk-X2ITLLIV.js} +5 -5
  123. package/dist/{chunk-SYO4XLTG.js → chunk-XCULMPQO.js} +2 -2
  124. package/dist/{chunk-DFA42X45.js → chunk-XEFPE5MQ.js} +4 -4
  125. package/dist/{chunk-QM3YURHW.js → chunk-YC3MEGKX.js} +3 -3
  126. package/dist/{chunk-ECG372D5.js → chunk-YUQAIO4Z.js} +1 -1
  127. package/dist/{chunk-57E7NOZO.js → chunk-ZERUCHT6.js} +4 -4
  128. package/dist/{chunk-FWPN4AHK.js → chunk-ZEXFK5YS.js} +4 -4
  129. package/dist/{chunk-OK3GVZNU.js → chunk-ZQ4YBCVO.js} +2 -2
  130. package/dist/{codex-app-cards-switch-WV7RKIVN.js → codex-app-cards-switch-MO5LT4NK.js} +11 -11
  131. package/dist/{codex-card-routing-HQRJF2NY.js → codex-card-routing-7NYNHVLU.js} +2 -2
  132. package/dist/{codex-desktop-launch-LDA7CWEX.js → codex-desktop-launch-JBQBWPED.js} +1 -1
  133. package/dist/{codex-session-launch-LS75CYUV.js → codex-session-launch-N7PFVCBO.js} +20 -20
  134. package/dist/{config-WFIMGEI5.js → config-NJ6EGXZF.js} +3 -3
  135. package/dist/{global-upgrade-XMQVRK7X.js → global-upgrade-XTTSGSGC.js} +9 -9
  136. package/dist/{identity-J5O4WLQQ.js → identity-6BMMEYWU.js} +4 -4
  137. package/dist/{live-capabilities-JMVAIHR3.js → live-capabilities-4TXTJ7R2.js} +4 -4
  138. package/dist/{paths-OFQDG25M.js → paths-IIV4U3NA.js} +3 -3
  139. package/dist/reapply-RGEME3JA.js +75 -0
  140. package/dist/src/index.d.ts +4 -0
  141. package/dist/src/index.js +35 -35
  142. package/dist/{upgrade-lock-77W22ICV.js → upgrade-lock-HZ66QJKL.js} +4 -4
  143. package/dist/{usage-MQWUFNYJ.js → usage-NEZ2357Z.js} +3 -3
  144. package/package.json +4 -1
  145. package/dist/reapply-JTMPSOEG.js +0 -75
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  SETUP_FLAGS
3
- } from "./chunk-FUY7TPTQ.js";
3
+ } from "./chunk-AORWV5JK.js";
4
4
  import {
5
5
  parseFlags
6
6
  } from "./chunk-BZIBNSQE.js";
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-CINBAX5G.js";
10
10
  import {
11
11
  NPX_LATEST_COMMAND
12
- } from "./chunk-RDECWGBJ.js";
12
+ } from "./chunk-SCZELAXA.js";
13
13
  import {
14
14
  CLAUDE_CONNECTOR_GUIDE,
15
15
  CLAUDE_CONNECTOR_STEPS,
@@ -17,7 +17,7 @@ import {
17
17
  CLAUDE_CONNECTOR_URL,
18
18
  COWORK_CONNECTOR_LIMIT,
19
19
  COWORK_STANDING_INSTRUCTIONS
20
- } from "./chunk-F75727GN.js";
20
+ } from "./chunk-HTMMJASM.js";
21
21
 
22
22
  // src/cli/cowork.ts
23
23
  import { readFileSync } from "fs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  readTranscriptPreference
3
- } from "./chunk-LXWHMYOS.js";
3
+ } from "./chunk-RYT23NAI.js";
4
4
 
5
5
  // src/transcript-setting.ts
6
6
  var transcriptEnvironmentPreference = () => {
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  parseSseMessages
3
- } from "./chunk-DQGTFUXX.js";
3
+ } from "./chunk-X2ITLLIV.js";
4
4
  import {
5
5
  fetchAsCredential
6
- } from "./chunk-LGV3U2KK.js";
6
+ } from "./chunk-322DR4ZT.js";
7
7
  import {
8
8
  NPX_LATEST_COMMAND
9
- } from "./chunk-RDECWGBJ.js";
9
+ } from "./chunk-SCZELAXA.js";
10
10
 
11
11
  // src/mcp-stdio-bridge.ts
12
12
  var MCP_BRIDGE_BINARY = "pushary-mcp";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  addGeminiMcpServer,
3
3
  removeGeminiMcpServer
4
- } from "./chunk-ZEVNSFFV.js";
4
+ } from "./chunk-RBKBFQ3D.js";
5
5
  import {
6
6
  CLAUDE_CODE_AGENT
7
- } from "./chunk-PHFQV5MO.js";
7
+ } from "./chunk-OXGT7OTC.js";
8
8
  import {
9
9
  compatibleToolLookup
10
- } from "./chunk-4DTKZQKO.js";
10
+ } from "./chunk-HS4RZZRG.js";
11
11
  import {
12
12
  CLAUDE_HOOK_EVENTS,
13
13
  PUSHARY_MCP_URL,
@@ -19,7 +19,7 @@ import {
19
19
  isPusharyHook,
20
20
  registerHookEntry,
21
21
  removeClaudeMcpServers
22
- } from "./chunk-A6TVXDTE.js";
22
+ } from "./chunk-HXLCATVW.js";
23
23
  import {
24
24
  HOOK_COMPATIBLE_PROFILES,
25
25
  PHONE_ANSWERED_TOOLS,
@@ -30,7 +30,7 @@ import {
30
30
  pusharyMissingReason,
31
31
  refusalOutput,
32
32
  withHookHoldBudget
33
- } from "./chunk-F75727GN.js";
33
+ } from "./chunk-HTMMJASM.js";
34
34
 
35
35
  // src/config-document.ts
36
36
  import { parse, stringify } from "smol-toml";
@@ -19,7 +19,7 @@ import {
19
19
  } from "./chunk-CXQWDQCJ.js";
20
20
  import {
21
21
  redactSecretsFromContent
22
- } from "./chunk-F75727GN.js";
22
+ } from "./chunk-HTMMJASM.js";
23
23
 
24
24
  // src/shell-quote.ts
25
25
  var shellDoubleQuoted = (text) => `"${text.replace(/(["\\$`])/g, "\\$1")}"`;
@@ -530,7 +530,22 @@ var npmHoldsReleasesBack = (rule) => rule.kind === "min_release_age" || rule.kin
530
530
  var NPM_NOT_STARTED = { kind: "not_started" };
531
531
  var SIGNALLED_EXIT_BASE = 128;
532
532
  var exitCodeOfNpm = (code, signal) => code ?? (signal === null ? EXIT.FAILED : SIGNALLED_EXIT_BASE + osConstants.signals[signal]);
533
- var npmLaunchFor = (args, platform) => platform === "win32" ? { command: ["npm", ...args.map((arg) => quoteIfNeeded(arg, platform))].join(" "), args: [], shell: true } : { command: "npm", args, shell: false };
533
+ var npmLaunchFor = (args, platform, locate = (name) => resolvePathBinary(name, platform), exists = existsSync, globalPrefix = readGlobalPrefix) => {
534
+ if (platform !== "win32") return { command: "npm", args };
535
+ const npm = locate("npm");
536
+ if (!npm) return void 0;
537
+ if (win32.extname(npm).toLowerCase() === ".exe") return { command: npm, args };
538
+ const cliUnder = (prefix2) => win32.join(prefix2, "node_modules", "npm", "bin", "npm-cli.js");
539
+ const bundled = cliUnder(win32.dirname(npm));
540
+ const prefix = globalPrefix();
541
+ const upgraded = prefix && win32.isAbsolute(prefix) ? cliUnder(prefix) : void 0;
542
+ const cli = [upgraded, bundled].find((file) => file !== void 0 && exists(file));
543
+ if (!cli) return void 0;
544
+ const siblingNode = win32.join(win32.dirname(npm), "node.exe");
545
+ const node = exists(siblingNode) ? siblingNode : locate("node");
546
+ if (!node || win32.extname(node).toLowerCase() !== ".exe") return void 0;
547
+ return { command: node, args: [cli, ...args] };
548
+ };
534
549
  var spellingOf = (name) => name.toLowerCase();
535
550
  var npmTerminalEnvironment = (inherited, overrides) => {
536
551
  const overridden = new Set(Object.keys(overrides).map(spellingOf));
@@ -539,10 +554,11 @@ var npmTerminalEnvironment = (inherited, overrides) => {
539
554
  };
540
555
  var runNpmInTerminal = (command) => new Promise((resolve2) => {
541
556
  const launch = npmLaunchFor(command.args, process.platform);
557
+ if (!launch) return resolve2(NPM_NOT_STARTED);
542
558
  const child = spawn(launch.command, [...launch.args], {
543
559
  stdio: "inherit",
544
560
  env: npmTerminalEnvironment(cleanNpmEnv(), command.env),
545
- shell: launch.shell,
561
+ shell: false,
546
562
  windowsHide: true
547
563
  });
548
564
  child.once("error", () => resolve2(NPM_NOT_STARTED));
@@ -582,9 +598,9 @@ var installGlobally = (options) => {
582
598
  }
583
599
  const started = (async () => {
584
600
  if (!npmIsOnPath()) throw new NpmMissingError();
585
- const { withUpgradeLock } = await import("./global-upgrade-XMQVRK7X.js");
586
- const { installWithUpgradeLock, ownsUpgradeLock } = await import("./upgrade-lock-77W22ICV.js");
587
- const { autoUpdateLock } = await import("./paths-OFQDG25M.js");
601
+ const { withUpgradeLock } = await import("./global-upgrade-XTTSGSGC.js");
602
+ const { installWithUpgradeLock, ownsUpgradeLock } = await import("./upgrade-lock-HZ66QJKL.js");
603
+ const { autoUpdateLock } = await import("./paths-IIV4U3NA.js");
588
604
  let result = "skipped";
589
605
  const install = async () => {
590
606
  const planned = readPlannedSetupInstall(process.platform);
@@ -4,10 +4,10 @@ import {
4
4
  } from "./chunk-P6DUWKAO.js";
5
5
  import {
6
6
  fetchAsCredential
7
- } from "./chunk-LGV3U2KK.js";
7
+ } from "./chunk-322DR4ZT.js";
8
8
  import {
9
9
  getBaseUrl
10
- } from "./chunk-YB64X4IQ.js";
10
+ } from "./chunk-RG3REA2Y.js";
11
11
  import {
12
12
  writeJsonAtomicDurable
13
13
  } from "./chunk-PM2NRK6Y.js";
@@ -15,7 +15,7 @@ import {
15
15
  compressTranscriptRecord,
16
16
  redactSecretsFromContent,
17
17
  transcriptRecordPlaintext
18
- } from "./chunk-F75727GN.js";
18
+ } from "./chunk-HTMMJASM.js";
19
19
 
20
20
  // src/transcript-recipient-pin.ts
21
21
  import { createHash } from "crypto";
@@ -3,16 +3,16 @@ import {
3
3
  NpmMissingError,
4
4
  NpmPermissionError,
5
5
  NpmReleaseAgeError
6
- } from "./chunk-B3STTU5D.js";
6
+ } from "./chunk-MP3IANXU.js";
7
7
  import {
8
8
  writeFileAtomic
9
9
  } from "./chunk-PM2NRK6Y.js";
10
10
  import {
11
11
  NPX_LATEST_COMMAND
12
- } from "./chunk-RDECWGBJ.js";
12
+ } from "./chunk-SCZELAXA.js";
13
13
  import {
14
14
  readSetupAgentFailures
15
- } from "./chunk-F75727GN.js";
15
+ } from "./chunk-HTMMJASM.js";
16
16
 
17
17
  // src/setup/config-write.ts
18
18
  var AgentConfigWriteError = class extends Error {
@@ -5,13 +5,13 @@ import {
5
5
  OPENCLAW_ENVIRONMENT_KEYS,
6
6
  openClawEnvironmentOf,
7
7
  openClawPathsFrom
8
- } from "./chunk-A6TVXDTE.js";
8
+ } from "./chunk-HXLCATVW.js";
9
9
  import {
10
10
  resolvePathBinary
11
- } from "./chunk-B3STTU5D.js";
11
+ } from "./chunk-MP3IANXU.js";
12
12
  import {
13
13
  isRecord
14
- } from "./chunk-F75727GN.js";
14
+ } from "./chunk-HTMMJASM.js";
15
15
 
16
16
  // src/openclaw/wiring-state.ts
17
17
  var OPENCLAW_PLUGIN_ID = "pushary";
@@ -13,7 +13,7 @@ import {
13
13
  uninstallOpenClawPlugin,
14
14
  unsetOpenClawEntry,
15
15
  writeOpenClawEntry
16
- } from "./chunk-6ZYUYRR2.js";
16
+ } from "./chunk-N62TAZJE.js";
17
17
  import {
18
18
  needsShell
19
19
  } from "./chunk-3PSNUHC5.js";
@@ -25,10 +25,10 @@ import {
25
25
  openClawDirectoriesToLookIn,
26
26
  openClawPluginFolder,
27
27
  openClawSetupReceiptDirectory
28
- } from "./chunk-A6TVXDTE.js";
28
+ } from "./chunk-HXLCATVW.js";
29
29
  import {
30
30
  resolvePathBinary
31
- } from "./chunk-B3STTU5D.js";
31
+ } from "./chunk-MP3IANXU.js";
32
32
  import {
33
33
  readJsonSafe,
34
34
  writeJsonAtomic
@@ -39,7 +39,7 @@ import {
39
39
  } from "./chunk-CXQWDQCJ.js";
40
40
  import {
41
41
  isRecord
42
- } from "./chunk-F75727GN.js";
42
+ } from "./chunk-HTMMJASM.js";
43
43
 
44
44
  // src/hermes/plugin-payload.ts
45
45
  import { createHash } from "crypto";
@@ -27,52 +27,53 @@ import {
27
27
  toolResultErrorText,
28
28
  transcriptTokensIn,
29
29
  transcriptUsageRequest
30
- } from "./chunk-4DTKZQKO.js";
30
+ } from "./chunk-HS4RZZRG.js";
31
31
  import {
32
32
  cancelQuestion,
33
33
  clientErrorKindOf,
34
34
  isPolicyConfig,
35
35
  reportClientError,
36
36
  sendNotification,
37
- waitForAnswer
38
- } from "./chunk-LS2VJJFJ.js";
37
+ waitForAnswer,
38
+ writeDegraded
39
+ } from "./chunk-IKUJZYFH.js";
39
40
  import {
40
41
  RETRY_ACK,
41
42
  readCommandAck,
42
43
  refusedReceiptMessage
43
- } from "./chunk-BYYU5QS3.js";
44
+ } from "./chunk-QSVIT62Y.js";
44
45
  import {
45
46
  isRetryable,
46
47
  withRetry
47
- } from "./chunk-DQGTFUXX.js";
48
+ } from "./chunk-X2ITLLIV.js";
48
49
  import {
49
50
  fetchAsCredential
50
- } from "./chunk-LGV3U2KK.js";
51
+ } from "./chunk-322DR4ZT.js";
51
52
  import {
52
53
  branchFor,
53
54
  projectNameFor,
54
55
  repoKeyFor
55
- } from "./chunk-MRG7AEJA.js";
56
+ } from "./chunk-5JRBOJYW.js";
56
57
  import {
57
58
  getMachineId
58
- } from "./chunk-DGZYM676.js";
59
+ } from "./chunk-6LQEDP2W.js";
59
60
  import {
60
61
  reportedInstallSource
61
- } from "./chunk-UUMBN6AU.js";
62
+ } from "./chunk-B4J3OPKE.js";
62
63
  import {
63
64
  IDLE_PROMPT_NOTIFICATION,
64
65
  NOTIFICATION_PUSH_TYPES,
65
66
  POSTTOOLUSE_MIRROR_ONLY_TOOLS,
66
67
  claudeConfigDir
67
- } from "./chunk-A6TVXDTE.js";
68
+ } from "./chunk-HXLCATVW.js";
68
69
  import {
69
70
  compareVersion,
70
71
  parseVersion
71
- } from "./chunk-B3STTU5D.js";
72
+ } from "./chunk-MP3IANXU.js";
72
73
  import {
73
74
  getApiKey,
74
75
  getBaseUrl
75
- } from "./chunk-YB64X4IQ.js";
76
+ } from "./chunk-RG3REA2Y.js";
76
77
  import {
77
78
  writeFileAtomic,
78
79
  writeJsonAtomicDurable
@@ -81,13 +82,17 @@ import {
81
82
  BLOCKED_ACTION_GRANT_TTL_SECONDS,
82
83
  CLI_POLICY_REQUEST_CAPABILITIES,
83
84
  COMMAND_RECOVERY,
85
+ HOOK_CWD_MAX_LENGTH,
84
86
  HOOK_SOURCES,
85
87
  POLICY_REQUEST_CAPABILITIES_HEADER,
86
88
  REPO_AWARE_AGENTS,
89
+ askableToolPathOf,
87
90
  blockedActionIdentity,
88
91
  canCarryPendingCommand,
89
92
  claudeTurnEndOutput,
93
+ codexUnansweredPreToolUse,
90
94
  gateOutputFor,
95
+ governingToolInputOf,
91
96
  isAutoApprove,
92
97
  isClaudeWakePrompt,
93
98
  isGateOutcome,
@@ -103,7 +108,7 @@ import {
103
108
  resolveAutoResolveOrigin,
104
109
  resolvePolicy,
105
110
  unansweredRefusalReason
106
- } from "./chunk-F75727GN.js";
111
+ } from "./chunk-HTMMJASM.js";
107
112
 
108
113
  // src/pending.ts
109
114
  import { join } from "path";
@@ -472,6 +477,9 @@ var writePolicyCache = (path, entry) => {
472
477
  } catch {
473
478
  }
474
479
  };
480
+ var currentPolicy = (policy) => ({ kind: "current", policy });
481
+ var recordedCacheAgeOf = (cachedAt) => cachedAt ? Date.now() - cachedAt : null;
482
+ var staleFallback = (policy, cachedAt) => ({ kind: "stale_fallback", policy, cacheAgeMs: recordedCacheAgeOf(cachedAt) });
475
483
  var POLICY_REQUEST_CAPABILITIES_VALUE = policyRequestCapabilitiesHeaderValue(CLI_POLICY_REQUEST_CAPABILITIES);
476
484
  var fetchPolicy = async (apiKey, agent, repoAware = false, sessionId, signal) => {
477
485
  return withRetry(async () => {
@@ -496,7 +504,7 @@ var fetchPolicy = async (apiKey, agent, repoAware = false, sessionId, signal) =>
496
504
  return raw;
497
505
  }, { maxAttempts: 2, shouldRetry: (error) => signal?.aborted !== true && isRetryable(error) });
498
506
  };
499
- var getPolicy = async (apiKey, expectedVersion, agent, repoAware = false, sessionId, signal) => {
507
+ var readPolicy = async (apiKey, expectedVersion, agent, repoAware = false, sessionId, signal) => {
500
508
  const path = policyCacheFile(apiKey, agent, repoAware, sessionId);
501
509
  const sharedPath = policyCacheFile(apiKey, agent, repoAware);
502
510
  const firstForThisSession = path !== sharedPath && !existsSync2(path);
@@ -511,9 +519,9 @@ var getPolicy = async (apiKey, expectedVersion, agent, repoAware = false, sessio
511
519
  const age = cached._cachedAt ? Date.now() - cached._cachedAt : 0;
512
520
  const ttlFresh = !cached._cachedAt || age < CACHE_TTL_MS;
513
521
  if (ttlFresh && !versionStale && !sessionStale) {
514
- return cached;
522
+ return currentPolicy(cached);
515
523
  }
516
- if (!sessionStale && age < STALE_CACHE_MAX_MS) staleCache = versionStale ? { ...cached, knownSuperseded: true } : cached;
524
+ if (!sessionStale && age < STALE_CACHE_MAX_MS) staleCache = staleFallback(versionStale ? { ...cached, knownSuperseded: true } : cached, cached._cachedAt);
517
525
  } catch {
518
526
  }
519
527
  }
@@ -524,12 +532,13 @@ var getPolicy = async (apiKey, expectedVersion, agent, repoAware = false, sessio
524
532
  if (firstForThisSession) removePolicyCachesTooOldToServe(cachedAt);
525
533
  writePolicyCache(path, entry);
526
534
  if (path !== sharedPath) writePolicyCache(sharedPath, entry);
527
- return policy;
535
+ return currentPolicy(policy);
528
536
  } catch (error) {
529
537
  if (staleCache) return staleCache;
530
538
  throw new PolicyUnavailable(error);
531
539
  }
532
540
  };
541
+ var getPolicy = async (apiKey, expectedVersion, agent, repoAware = false, sessionId, signal) => (await readPolicy(apiKey, expectedVersion, agent, repoAware, sessionId, signal)).policy;
533
542
  var PolicyUnavailable = class extends Error {
534
543
  constructor(cause) {
535
544
  super("Failed to fetch policy and no cached policy available", { cause });
@@ -537,8 +546,8 @@ var PolicyUnavailable = class extends Error {
537
546
  }
538
547
  };
539
548
  var lastPolicyOfAnySessionOr = (apiKey, agent, repoAware, error) => {
540
- const cached = readCachedPolicy(apiKey, agent, repoAware);
541
- if (cached) return cached;
549
+ const cached = readCachedPolicyCopy(apiKey, agent, repoAware);
550
+ if (cached) return staleFallback(cached, cached._cachedAt);
542
551
  throw error;
543
552
  };
544
553
  var readFreshPolicyOfAnySession = (path, expectedVersion) => {
@@ -552,8 +561,22 @@ var readFreshPolicyOfAnySession = (path, expectedVersion) => {
552
561
  return null;
553
562
  }
554
563
  };
555
- var getPolicyForStandingDenies = async (apiKey, expectedVersion, agent, repoAware, sessionId, signal) => readFreshPolicyOfAnySession(policyCacheFile(apiKey, agent, repoAware), expectedVersion) ?? getPolicy(apiKey, expectedVersion, agent, repoAware, sessionId, signal).catch((error) => lastPolicyOfAnySessionOr(apiKey, agent, repoAware, error));
556
- var readCachedPolicy = (apiKey, agent, repoAware = false) => {
564
+ var getPolicyForStandingDenies = async (apiKey, expectedVersion, agent, repoAware, sessionId, signal) => {
565
+ const fresh = readFreshPolicyOfAnySession(policyCacheFile(apiKey, agent, repoAware), expectedVersion);
566
+ if (fresh) return currentPolicy(fresh);
567
+ return readPolicy(apiKey, expectedVersion, agent, repoAware, sessionId, signal).catch((error) => lastPolicyOfAnySessionOr(apiKey, agent, repoAware, error));
568
+ };
569
+ var STANDING_DENIES_FROM_STALE_POLICY = "standing_denies_from_stale_policy";
570
+ var STANDING_DENIES_FROM_STALE_POLICY_FALLBACK = "checked standing denies against this session's cached policy, or else the last one any session cached, of any version: a deny added since is missed and a deny removed since still refuses";
571
+ var stalePolicyAgeMessage = (cacheAgeMs) => cacheAgeMs === null ? void 0 : `policy cache age ${Math.round(Math.max(0, cacheAgeMs) / 1e3)} s`;
572
+ var reportStandingDeniesFromStalePolicy = (cacheAgeMs) => {
573
+ try {
574
+ writeDegraded("policy", { reason: STANDING_DENIES_FROM_STALE_POLICY, fallback: STANDING_DENIES_FROM_STALE_POLICY_FALLBACK }, stalePolicyAgeMessage(cacheAgeMs));
575
+ } catch {
576
+ return;
577
+ }
578
+ };
579
+ var readCachedPolicyCopy = (apiKey, agent, repoAware = false) => {
557
580
  const path = policyCacheFile(apiKey, agent, repoAware);
558
581
  try {
559
582
  const cached = JSON.parse(readFileSync2(path, "utf-8"));
@@ -564,6 +587,7 @@ var readCachedPolicy = (apiKey, agent, repoAware = false) => {
564
587
  return null;
565
588
  }
566
589
  };
590
+ var readCachedPolicy = (apiKey, agent, repoAware = false) => readCachedPolicyCopy(apiKey, agent, repoAware);
567
591
  var MODE_GRACE_MS = 60 * 1e3;
568
592
  var modeStateCacheFile = (apiKey) => {
569
593
  const hash = createHash2("sha256").update(`mode:${apiKey}`).digest("hex").slice(0, 12);
@@ -846,11 +870,21 @@ var codexQuestionLimitDecision = (facts) => {
846
870
  const handBack = questionLimitHandBack(facts);
847
871
  return handBack.kind === "refuse" ? codexDeny(handBack.reason) : codexPass();
848
872
  };
849
- var permissionTimeoutDecision = (timeoutAction, paused) => {
850
- if (timeoutAction === "approve") return codexAllow();
851
- if (timeoutAction === "deny") return codexDeny(unansweredRefusalReason(paused));
873
+ var questionServedItsWholeWindow = (window) => !window.clampCut && !window.paused && !window.overflow;
874
+ var permissionTimeoutDecision = (timeoutAction, window) => {
875
+ if (timeoutAction === "approve") return questionServedItsWholeWindow(window) ? codexAllow() : codexPass();
876
+ if (timeoutAction === "deny") return codexDeny(unansweredRefusalReason(window.paused));
852
877
  return codexPass();
853
878
  };
879
+ var codexDecisionOf = (ending) => ending.kind === "deny" ? codexDeny(ending.reason) : codexPass();
880
+ var codexUnansweredDecision = (rule, fullWindowServed, paused) => codexDecisionOf(codexUnansweredPreToolUse({ mode: rule.mode, timeoutAction: rule.timeoutAction, fullWindowServed, paused }));
881
+ var NO_ASKED_FILE_PATH = {};
882
+ var sendableCwd = (cwd) => cwd !== void 0 && cwd.length > 0 && cwd.length <= HOOK_CWD_MAX_LENGTH ? { cwd } : {};
883
+ var codexAskedFilePathOf = (gateInput) => {
884
+ const governing = governingToolInputOf(gateInput);
885
+ const toolPath = governing === void 0 ? void 0 : askableToolPathOf(gateInput.toolName, governing);
886
+ return toolPath === void 0 ? NO_ASKED_FILE_PATH : { toolPath, ...sendableCwd(gateInput.cwd) };
887
+ };
854
888
 
855
889
  // src/driver.ts
856
890
  var DRIVER_ENV = "PUSHARY_DRIVER";
@@ -1983,6 +2017,7 @@ export {
1983
2017
  policyRequestFor,
1984
2018
  getPolicy,
1985
2019
  getPolicyForStandingDenies,
2020
+ reportStandingDeniesFromStalePolicy,
1986
2021
  readCachedPolicy,
1987
2022
  fetchModeState,
1988
2023
  fetchLiveModeState,
@@ -1998,7 +2033,11 @@ export {
1998
2033
  toPolicyLookup,
1999
2034
  toPolicyLookups,
2000
2035
  codexQuestionLimitDecision,
2036
+ questionServedItsWholeWindow,
2001
2037
  permissionTimeoutDecision,
2038
+ codexDecisionOf,
2039
+ codexUnansweredDecision,
2040
+ codexAskedFilePathOf,
2002
2041
  userScope,
2003
2042
  identifyingToolInput,
2004
2043
  callDecisionStore,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  HOOK_BUDGETS
3
- } from "./chunk-F75727GN.js";
3
+ } from "./chunk-HTMMJASM.js";
4
4
 
5
5
  // src/opencode-protocol.ts
6
6
  var OPENCODE_PLUGIN_MARKER = "pushary-opencode-plugin w1";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-POFBE6ZY.js";
4
4
  import {
5
5
  autoUpdateState
6
- } from "./chunk-A6TVXDTE.js";
6
+ } from "./chunk-HXLCATVW.js";
7
7
  import {
8
8
  readJsonSafe,
9
9
  writeJsonAtomic
@@ -17,7 +17,7 @@ import {
17
17
  } from "./chunk-CXQWDQCJ.js";
18
18
  import {
19
19
  isAutoUpdateResult
20
- } from "./chunk-F75727GN.js";
20
+ } from "./chunk-HTMMJASM.js";
21
21
 
22
22
  // src/auto-update.ts
23
23
  import { spawn } from "child_process";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  redactSecretsFromContent
3
- } from "./chunk-F75727GN.js";
3
+ } from "./chunk-HTMMJASM.js";
4
4
 
5
5
  // src/cli/terminal-row.ts
6
6
  var visibleLength = (text) => text.replace(/\x1b\[[0-9;]*m/g, "").length;
@@ -3,24 +3,24 @@ import {
3
3
  expectedLaunchCapabilities,
4
4
  hasSpawnProvider,
5
5
  resolveControlPolicy
6
- } from "./chunk-247LVLEC.js";
6
+ } from "./chunk-CQJ7567M.js";
7
7
  import {
8
8
  daemonHasRemoteProof,
9
9
  daemonServiceManagerAvailable,
10
10
  hasDaemonServiceDefinition,
11
11
  readDaemonNeedsLogin,
12
12
  readDaemonStatus
13
- } from "./chunk-JFUTFHB6.js";
13
+ } from "./chunk-D7LVY2XF.js";
14
14
  import {
15
15
  getMachineId
16
- } from "./chunk-DGZYM676.js";
16
+ } from "./chunk-6LQEDP2W.js";
17
17
  import {
18
18
  readControlMode,
19
19
  readKeySource
20
- } from "./chunk-LXWHMYOS.js";
20
+ } from "./chunk-RYT23NAI.js";
21
21
  import {
22
22
  getBaseUrl
23
- } from "./chunk-YB64X4IQ.js";
23
+ } from "./chunk-RG3REA2Y.js";
24
24
  import {
25
25
  getPackageVersion
26
26
  } from "./chunk-CXQWDQCJ.js";
@@ -5,13 +5,13 @@ import {
5
5
  } from "./chunk-OYIN77HO.js";
6
6
  import {
7
7
  readMacAppAgentKey
8
- } from "./chunk-DFA42X45.js";
8
+ } from "./chunk-XEFPE5MQ.js";
9
9
  import {
10
10
  API_KEYS_PATH
11
- } from "./chunk-WFE2YHWQ.js";
11
+ } from "./chunk-7YB4UGGI.js";
12
12
  import {
13
13
  absoluteUrl
14
- } from "./chunk-QM3YURHW.js";
14
+ } from "./chunk-YC3MEGKX.js";
15
15
  import {
16
16
  findExportedKeyLines,
17
17
  isAdoptedMacAppKey,
@@ -21,10 +21,10 @@ import {
21
21
  readConfigFileKey,
22
22
  readKeySource,
23
23
  readMacAppKeyPrefix
24
- } from "./chunk-LXWHMYOS.js";
24
+ } from "./chunk-RYT23NAI.js";
25
25
  import {
26
26
  isValidApiKey
27
- } from "./chunk-F75727GN.js";
27
+ } from "./chunk-HTMMJASM.js";
28
28
 
29
29
  // src/cli/held-key-revocation.ts
30
30
  var readCliHeldKeys = (profiles) => {
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  CODEX_HOOK_STATUS
3
- } from "./chunk-HQUYQOWZ.js";
3
+ } from "./chunk-3W5OVQ66.js";
4
4
  import {
5
5
  HERMES_ALWAYS_ALLOWED_SHELL_RULE,
6
6
  HERMES_COMMAND_ALLOWLIST_KEY,
7
7
  HERMES_GATE_TOOLS_KEY,
8
8
  HERMES_SHELL_TOOL
9
- } from "./chunk-RHQ5FDU4.js";
9
+ } from "./chunk-NE6LKCGR.js";
10
10
  import {
11
11
  retryAgentCommand
12
- } from "./chunk-XTFN2YTA.js";
12
+ } from "./chunk-N4QFPPSM.js";
13
13
  import {
14
14
  NPX_LATEST_COMMAND
15
- } from "./chunk-RDECWGBJ.js";
15
+ } from "./chunk-SCZELAXA.js";
16
16
 
17
17
  // src/setup/codex-trust.ts
18
18
  var CODEX_TRUST_TELEMETRY = {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isFinalCommandAckRefusal
3
- } from "./chunk-F75727GN.js";
3
+ } from "./chunk-HTMMJASM.js";
4
4
 
5
5
  // src/command-ack-outcome.ts
6
6
  var SETTLED_ACK = { outcome: "settled" };
@@ -10,7 +10,7 @@ import {
10
10
  uploadTranscriptRecords,
11
11
  verifyAnchoredRecipients,
12
12
  wrapSessionKey
13
- } from "./chunk-X3TBNXPX.js";
13
+ } from "./chunk-MX6HK3UN.js";
14
14
 
15
15
  // src/live-session.ts
16
16
  var LIVE_TRANSCRIPT_LIMITS = { queuedRecords: 100, recordCharacters: 32 * 1024 };
@@ -3,10 +3,10 @@ import {
3
3
  forkFinishWithUpgradeLock,
4
4
  installWithUpgradeLock,
5
5
  releaseAutoUpdateLock
6
- } from "./chunk-UQOEZQ6G.js";
6
+ } from "./chunk-3DGWT6EY.js";
7
7
  import {
8
8
  phoneStartIsRequired
9
- } from "./chunk-247LVLEC.js";
9
+ } from "./chunk-CQJ7567M.js";
10
10
  import {
11
11
  describeAutoUpdateCheck,
12
12
  globalInstallLocation,
@@ -18,12 +18,12 @@ import {
18
18
  readAutoUpdateState,
19
19
  updateAutoUpdateState,
20
20
  upgradeEntryFor
21
- } from "./chunk-YGRPTTER.js";
21
+ } from "./chunk-POVKTTKE.js";
22
22
  import {
23
23
  autoUpdateLock,
24
24
  autoUpdateLog,
25
25
  autoUpdateState
26
- } from "./chunk-A6TVXDTE.js";
26
+ } from "./chunk-HXLCATVW.js";
27
27
  import {
28
28
  describeReleaseNpmHolds,
29
29
  execNpm,
@@ -33,10 +33,10 @@ import {
33
33
  npmExitedOnReleaseAge,
34
34
  readGlobalCliInstallAt,
35
35
  readGlobalPrefix
36
- } from "./chunk-B3STTU5D.js";
36
+ } from "./chunk-MP3IANXU.js";
37
37
  import {
38
38
  NPX_LATEST_COMMAND
39
- } from "./chunk-RDECWGBJ.js";
39
+ } from "./chunk-SCZELAXA.js";
40
40
  import {
41
41
  EXIT
42
42
  } from "./chunk-BG4HHB7E.js";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  pusharyDir
3
- } from "./chunk-A6TVXDTE.js";
3
+ } from "./chunk-HXLCATVW.js";
4
4
  import {
5
5
  readJsonSafe
6
6
  } from "./chunk-PM2NRK6Y.js";
7
7
  import {
8
8
  isRecord
9
- } from "./chunk-F75727GN.js";
9
+ } from "./chunk-HTMMJASM.js";
10
10
 
11
11
  // src/process-ownership.ts
12
12
  import { createHash, randomUUID } from "crypto";