@pushary/agent-hooks 1.9.61 → 1.9.63

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 (125) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +1 -1
  3. package/dist/{api-LW3PJQYY.js → api-UHUUAONF.js} +14 -12
  4. package/dist/bin/pushary-bell-hook.js +27 -27
  5. package/dist/bin/pushary-bell.js +12 -12
  6. package/dist/bin/pushary-claude.js +35 -28
  7. package/dist/bin/pushary-clean.js +35 -34
  8. package/dist/bin/pushary-codex-bridge.js +21 -21
  9. package/dist/bin/pushary-codex-hook.js +51 -38
  10. package/dist/bin/pushary-codex-session.js +8 -8
  11. package/dist/bin/pushary-codex.js +14 -14
  12. package/dist/bin/pushary-connect.js +27 -27
  13. package/dist/bin/pushary-cowork.js +5 -5
  14. package/dist/bin/pushary-daemon.js +39 -38
  15. package/dist/bin/pushary-disconnect.js +30 -29
  16. package/dist/bin/pushary-doctor.js +46 -44
  17. package/dist/bin/pushary-elicitation-hook.js +30 -28
  18. package/dist/bin/pushary-gemini-bridge.js +15 -15
  19. package/dist/bin/pushary-gemini-hook.js +38 -30
  20. package/dist/bin/pushary-hook.js +32 -31
  21. package/dist/bin/pushary-login.js +27 -15
  22. package/dist/bin/pushary-logout.js +28 -28
  23. package/dist/bin/pushary-mcp.js +11 -11
  24. package/dist/bin/pushary-mode.js +14 -14
  25. package/dist/bin/pushary-notification-hook.js +26 -26
  26. package/dist/bin/pushary-opencode-hook.js +40 -31
  27. package/dist/bin/pushary-permission-denied-hook.js +31 -31
  28. package/dist/bin/pushary-permission-hook.js +30 -30
  29. package/dist/bin/pushary-post-hook.js +26 -26
  30. package/dist/bin/pushary-prompt-hook.js +26 -26
  31. package/dist/bin/pushary-session-end-hook.js +26 -26
  32. package/dist/bin/pushary-session-start-hook.js +34 -33
  33. package/dist/bin/pushary-setup.js +115 -4205
  34. package/dist/bin/pushary-stats.js +5 -5
  35. package/dist/bin/pushary-status.js +32 -32
  36. package/dist/bin/pushary-stop-hook.js +26 -26
  37. package/dist/bin/pushary-stopfailure-hook.js +26 -26
  38. package/dist/bin/pushary-suggestions.js +14 -14
  39. package/dist/bin/pushary-transcript-register.js +18 -18
  40. package/dist/bin/pushary-transcripts.js +62 -9
  41. package/dist/bin/pushary-upgrade.js +43 -41
  42. package/dist/bin/pushary-wait.js +14 -14
  43. package/dist/bin/pushary.js +7 -7
  44. package/dist/{chunk-ORX5BTV4.js → chunk-2MZ6ROWZ.js} +8 -6
  45. package/dist/{chunk-7BHI3PZN.js → chunk-3GVV7XVT.js} +1 -1
  46. package/dist/{chunk-GKFO5JLN.js → chunk-3QLFB2EY.js} +4 -4
  47. package/dist/{chunk-LBHJJEKT.js → chunk-4WFAP6QN.js} +10 -10
  48. package/dist/{chunk-PITQ5ZIQ.js → chunk-5JK3DQGZ.js} +2 -2
  49. package/dist/{chunk-CJ5TCFD4.js → chunk-5LOP4AVD.js} +3 -3
  50. package/dist/{chunk-ERK24P76.js → chunk-6Z2VR3BA.js} +4 -2
  51. package/dist/{chunk-K4MBKXAE.js → chunk-75ODMNOM.js} +1 -1
  52. package/dist/{chunk-YPD3MTFU.js → chunk-7GRQGXF4.js} +1 -1
  53. package/dist/{chunk-AXJLJJ3M.js → chunk-7NCLUA65.js} +99 -6
  54. package/dist/{chunk-YDR4BQ7R.js → chunk-AB3VAQ25.js} +3 -3
  55. package/dist/{chunk-2AELPDMT.js → chunk-BCVCUDFI.js} +16 -5
  56. package/dist/{chunk-RGSW36XH.js → chunk-BQFL2ECS.js} +3 -3
  57. package/dist/{chunk-BG4Y64FW.js → chunk-BUQU3OPX.js} +1 -1
  58. package/dist/{chunk-SHJVFW22.js → chunk-CLABCSZC.js} +4 -4
  59. package/dist/{chunk-4VRTSDGP.js → chunk-DMNLFWGY.js} +7 -108
  60. package/dist/{chunk-7MCCXE5Y.js → chunk-EHHTQURL.js} +5 -5
  61. package/dist/{chunk-XAO6EYGM.js → chunk-ELAK46NR.js} +26 -3
  62. package/dist/{chunk-JGQV4MDQ.js → chunk-EQ26IKZM.js} +6 -6
  63. package/dist/{chunk-VX2MJ4X7.js → chunk-FAF5AW3P.js} +9 -9
  64. package/dist/{chunk-XEJOPVCG.js → chunk-FEAGK25K.js} +1 -1
  65. package/dist/{chunk-GZCSWDAS.js → chunk-GNUARBRZ.js} +4 -4
  66. package/dist/{chunk-64S5PQBQ.js → chunk-GZS72NCF.js} +4 -4
  67. package/dist/{chunk-WFSGCFXQ.js → chunk-HAIXS4OX.js} +2 -6
  68. package/dist/{chunk-G36T5LAP.js → chunk-HOIO66DU.js} +3 -3
  69. package/dist/{chunk-ADR3KHOC.js → chunk-HZ72EMJE.js} +2 -2
  70. package/dist/{chunk-WN3RACVD.js → chunk-IOH2T3CB.js} +17 -3
  71. package/dist/chunk-KEPESIIR.js +4117 -0
  72. package/dist/{chunk-ZEWIMY63.js → chunk-KL76XWZ7.js} +1 -1
  73. package/dist/{chunk-IFPOHFDJ.js → chunk-KLZZI5TU.js} +1 -1
  74. package/dist/{chunk-ATKN4BJT.js → chunk-KUCL7ETL.js} +1 -1
  75. package/dist/{chunk-SFAP4AJY.js → chunk-L5CDGXPO.js} +3 -3
  76. package/dist/{chunk-GDKQUB52.js → chunk-LGZ545TA.js} +5 -5
  77. package/dist/{chunk-ZGU3NXL2.js → chunk-LTT54NOU.js} +8 -8
  78. package/dist/{chunk-MWLTTLPK.js → chunk-MK4USZYQ.js} +2 -2
  79. package/dist/{chunk-NKLNU577.js → chunk-MRCVYYPW.js} +3 -3
  80. package/dist/{chunk-7JXJJNQ5.js → chunk-OJEIS5L2.js} +1 -1
  81. package/dist/{chunk-ELLJPP6O.js → chunk-OP5IBEV7.js} +7 -3
  82. package/dist/{chunk-BQ2VV7LY.js → chunk-OU3BYBJ3.js} +2 -2
  83. package/dist/{chunk-6T5Z64KS.js → chunk-OW6VBXXI.js} +15 -15
  84. package/dist/{chunk-USE5IEEW.js → chunk-OY6Z4IKB.js} +1 -1
  85. package/dist/{chunk-O65F2IIN.js → chunk-P6RF4RQN.js} +6 -6
  86. package/dist/{chunk-4N5E4JNF.js → chunk-PIQ4HHA2.js} +5 -5
  87. package/dist/{chunk-7HDGH3Z2.js → chunk-PJ34FOIV.js} +4 -4
  88. package/dist/{chunk-DQLCFGHK.js → chunk-PXAOEFJZ.js} +17 -11
  89. package/dist/{chunk-P3VQH65N.js → chunk-QC2W42DE.js} +33 -20
  90. package/dist/{chunk-X3YKQJCZ.js → chunk-RAJ3QEIL.js} +1 -1
  91. package/dist/chunk-S2Z6VWHH.js +112 -0
  92. package/dist/{chunk-FUZ5VYWD.js → chunk-SARPHHTT.js} +1 -1
  93. package/dist/{chunk-BJTSKOH3.js → chunk-SKUSGWFK.js} +5 -5
  94. package/dist/{chunk-Y6Z7DA5Y.js → chunk-T3GHXR6N.js} +5 -5
  95. package/dist/{chunk-EUIPTDLX.js → chunk-T6XQNOZV.js} +22 -15
  96. package/dist/{chunk-RJHX66EY.js → chunk-TBKHQWIH.js} +16 -11
  97. package/dist/{chunk-CICLXLQN.js → chunk-TMGJAFSD.js} +4 -4
  98. package/dist/{chunk-Y5VKZNFN.js → chunk-V5W3CK7F.js} +2 -2
  99. package/dist/{chunk-GAMVAORR.js → chunk-V7N5NOZV.js} +4 -2
  100. package/dist/{chunk-33OOEVPG.js → chunk-VC3HFFMQ.js} +1 -1
  101. package/dist/{chunk-KPNZ7JUL.js → chunk-VDBXSUXP.js} +6 -6
  102. package/dist/{chunk-7BAO42UV.js → chunk-VFJSVPNL.js} +3 -3
  103. package/dist/{chunk-HUI4OE43.js → chunk-VHZAJ6IB.js} +3 -3
  104. package/dist/{chunk-QER5R7Z6.js → chunk-VN7XH6TU.js} +2 -2
  105. package/dist/{chunk-UADSXJZ4.js → chunk-WUOOZE5S.js} +2 -2
  106. package/dist/{chunk-LN7DE5LY.js → chunk-XBTWG2VL.js} +4 -4
  107. package/dist/{chunk-XV6S5PWW.js → chunk-XE5N352V.js} +1 -1
  108. package/dist/{chunk-SVQWHV65.js → chunk-XO3KAH7K.js} +1 -1
  109. package/dist/{chunk-BUZIEL7Y.js → chunk-YK6GR4GU.js} +2 -2
  110. package/dist/chunk-YMZOM6BD.js +216 -0
  111. package/dist/{codex-app-cards-switch-BD7LCI2I.js → codex-app-cards-switch-LXMAIOFB.js} +11 -11
  112. package/dist/{codex-desktop-launch-V5CASSBB.js → codex-desktop-launch-VE5RLFUU.js} +1 -1
  113. package/dist/{codex-session-launch-5PKFKUFD.js → codex-session-launch-XZZWXCPK.js} +18 -18
  114. package/dist/{config-AEKH7HGC.js → config-PPX25AV5.js} +3 -3
  115. package/dist/{global-upgrade-IUXJJDWF.js → global-upgrade-NRMHNLNU.js} +9 -9
  116. package/dist/{identity-YJIV2XTY.js → identity-ZFQR7JNW.js} +4 -4
  117. package/dist/{live-capabilities-QYFW5QAW.js → live-capabilities-SJRYRKNB.js} +4 -4
  118. package/dist/{paths-A5GAR5PL.js → paths-7VTVOQXJ.js} +3 -3
  119. package/dist/{reapply-BKJGICRJ.js → reapply-WOANOIRZ.js} +27 -26
  120. package/dist/src/index.d.ts +1 -0
  121. package/dist/src/index.js +21 -21
  122. package/dist/{upgrade-lock-DDB7WEWC.js → upgrade-lock-VAYJZVTB.js} +4 -4
  123. package/dist/{usage-HBDNFZ3O.js → usage-C4DIYUR6.js} +3 -3
  124. package/package.json +1 -1
  125. package/dist/chunk-6FJ6CK32.js +0 -126
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  DEFAULT_SESSION
3
- } from "./chunk-DQLCFGHK.js";
3
+ } from "./chunk-PXAOEFJZ.js";
4
4
 
5
5
  // src/answer.ts
6
6
  var isDeferAnswer = (value) => value === "defer";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  guardBinary
3
- } from "./chunk-MWLTTLPK.js";
3
+ } from "./chunk-MK4USZYQ.js";
4
4
 
5
5
  // src/bell/install.ts
6
6
  import { join } from "path";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  readConfigFileKey
3
- } from "./chunk-WN3RACVD.js";
3
+ } from "./chunk-IOH2T3CB.js";
4
4
 
5
5
  // src/bell/fleet.ts
6
6
  import { closeSync, constants, futimesSync, lstatSync, mkdirSync, openSync, readdirSync, unlinkSync } from "fs";
@@ -1,9 +1,9 @@
1
- import {
2
- pusharyDir
3
- } from "./chunk-MWLTTLPK.js";
4
1
  import {
5
2
  writeFileAtomic
6
3
  } from "./chunk-QENTGE75.js";
4
+ import {
5
+ pusharyDir
6
+ } from "./chunk-MK4USZYQ.js";
7
7
 
8
8
  // src/identity.ts
9
9
  import { randomUUID } from "crypto";
@@ -1,22 +1,22 @@
1
1
  import {
2
2
  openCodeConfigDirFrom
3
- } from "./chunk-ZGU3NXL2.js";
3
+ } from "./chunk-LTT54NOU.js";
4
4
  import {
5
5
  nativeClaudeInstallPath
6
6
  } from "./chunk-VUFHYMSP.js";
7
7
  import {
8
8
  grokHome
9
- } from "./chunk-GKFO5JLN.js";
9
+ } from "./chunk-3QLFB2EY.js";
10
10
  import {
11
11
  claudeConfigDir,
12
12
  codexHomeFrom
13
- } from "./chunk-MWLTTLPK.js";
13
+ } from "./chunk-MK4USZYQ.js";
14
14
  import {
15
15
  resolvePathBinary
16
- } from "./chunk-CJ5TCFD4.js";
16
+ } from "./chunk-5LOP4AVD.js";
17
17
  import {
18
18
  HOOK_COMPATIBLE_PROFILES
19
- } from "./chunk-AXJLJJ3M.js";
19
+ } from "./chunk-7NCLUA65.js";
20
20
 
21
21
  // src/hermes-config.ts
22
22
  import { execFileSync } from "child_process";
@@ -1,15 +1,18 @@
1
1
  import {
2
2
  compatibleConfigFile
3
- } from "./chunk-GKFO5JLN.js";
3
+ } from "./chunk-3QLFB2EY.js";
4
4
  import {
5
5
  hookOwnerOf,
6
6
  hookOwnerOfCommands,
7
7
  liveBridgeProbe,
8
8
  resolveBridgeStub
9
- } from "./chunk-BJTSKOH3.js";
9
+ } from "./chunk-SKUSGWFK.js";
10
10
  import {
11
11
  AGENT_CHOICES
12
- } from "./chunk-XV6S5PWW.js";
12
+ } from "./chunk-XE5N352V.js";
13
+ import {
14
+ readJsonSafe
15
+ } from "./chunk-QENTGE75.js";
13
16
  import {
14
17
  claudeSettings,
15
18
  codexHooksJson,
@@ -18,10 +21,7 @@ import {
18
21
  guardedArgv,
19
22
  pusharyDir,
20
23
  vscodePluginDir
21
- } from "./chunk-MWLTTLPK.js";
22
- import {
23
- readJsonSafe
24
- } from "./chunk-QENTGE75.js";
24
+ } from "./chunk-MK4USZYQ.js";
25
25
  import {
26
26
  HOOK_BUDGETS,
27
27
  HOOK_COMPATIBLE_PROFILES,
@@ -29,7 +29,7 @@ import {
29
29
  OPENCODE_APPROVAL_EVENT,
30
30
  hookCompatibleProfile,
31
31
  isRecord
32
- } from "./chunk-AXJLJJ3M.js";
32
+ } from "./chunk-7NCLUA65.js";
33
33
 
34
34
  // src/opencode-plugin.ts
35
35
  var OPENCODE_PLUGIN_MARKER = "pushary-opencode-plugin w1";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  quoteIfNeeded,
3
3
  shellDoubleQuoted
4
- } from "./chunk-CJ5TCFD4.js";
4
+ } from "./chunk-5LOP4AVD.js";
5
5
  import {
6
6
  CODEX_QUESTION_TOOLS,
7
7
  HOOK_BUDGETS,
8
8
  HOOK_LOCATOR_BINARY,
9
9
  withHookHoldBudget
10
- } from "./chunk-AXJLJJ3M.js";
10
+ } from "./chunk-7NCLUA65.js";
11
11
 
12
12
  // src/setup/paths.ts
13
13
  import { createHash as createHash2 } from "crypto";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  SETUP_FLAGS
3
- } from "./chunk-XV6S5PWW.js";
3
+ } from "./chunk-XE5N352V.js";
4
4
  import {
5
5
  parseFlags
6
6
  } from "./chunk-NMUI3ZWG.js";
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-PPY5N2E6.js";
10
10
  import {
11
11
  NPX_LATEST_COMMAND
12
- } from "./chunk-ERK24P76.js";
12
+ } from "./chunk-6Z2VR3BA.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-AXJLJJ3M.js";
20
+ } from "./chunk-7NCLUA65.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-WN3RACVD.js";
3
+ } from "./chunk-IOH2T3CB.js";
4
4
 
5
5
  // src/transcript-setting.ts
6
6
  var transcriptEnvironmentPreference = () => {
@@ -1,13 +1,15 @@
1
1
  import {
2
2
  buildTranscriptRecords,
3
3
  decodePublicKey,
4
+ encryptRecord,
4
5
  generateSessionKey,
6
+ recordSealerFor,
5
7
  wrapSessionKey
6
- } from "./chunk-2AELPDMT.js";
8
+ } from "./chunk-BCVCUDFI.js";
7
9
  import {
8
10
  fetchTranscriptRecipients,
9
11
  uploadTranscriptRecords
10
- } from "./chunk-GAMVAORR.js";
12
+ } from "./chunk-V7N5NOZV.js";
11
13
 
12
14
  // src/live-session.ts
13
15
  var MAX_TRANSCRIPT_QUEUE = 100;
@@ -68,6 +70,7 @@ var LiveTranscriptRelay = class {
68
70
  wrappedKey = null;
69
71
  providerWrappedKey = null;
70
72
  providerKeyId = null;
73
+ sealRecord = encryptRecord;
71
74
  keyUploaded = false;
72
75
  keyRejected = false;
73
76
  flushing = null;
@@ -98,13 +101,14 @@ var LiveTranscriptRelay = class {
98
101
  if (!recipients) return false;
99
102
  this.sessionKey = generateSessionKey();
100
103
  this.wrappedKey = wrapSessionKey(this.sessionKey, decodePublicKey(recipients.phonePublicKey));
104
+ this.sealRecord = recordSealerFor(recipients.phoneReadsCompressedRecords);
101
105
  if (recipients.provider) {
102
106
  this.providerWrappedKey = wrapSessionKey(this.sessionKey, decodePublicKey(recipients.provider.publicKey));
103
107
  this.providerKeyId = recipients.provider.keyId;
104
108
  }
105
109
  }
106
110
  const count = Math.min(this.queue.length, 50);
107
- const records = buildTranscriptRecords(this.queue.slice(0, count), this.sessionKey).records;
111
+ const records = buildTranscriptRecords(this.queue.slice(0, count), this.sessionKey, /* @__PURE__ */ new Set(), this.sealRecord).records;
108
112
  if (records.length === 0) {
109
113
  this.queue.splice(0, count);
110
114
  return true;
@@ -8,13 +8,13 @@ import {
8
8
  everyProgramFileIsThere,
9
9
  installedCodexApp,
10
10
  shellQuoted
11
- } from "./chunk-PITQ5ZIQ.js";
11
+ } from "./chunk-5JK3DQGZ.js";
12
12
  import {
13
13
  writeHuman
14
14
  } from "./chunk-QCGNGEGE.js";
15
15
  import {
16
16
  xml
17
- } from "./chunk-LBHJJEKT.js";
17
+ } from "./chunk-4WFAP6QN.js";
18
18
  import {
19
19
  CODEX_APP_LAUNCH_AT_LOGIN_VERB,
20
20
  CODEX_APP_LAUNCH_VARIABLE
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ensureCodexTrustsPusharyHooks
3
- } from "./chunk-BUZIEL7Y.js";
3
+ } from "./chunk-YK6GR4GU.js";
4
4
  import {
5
5
  CODEX_INSTRUCTIONS_LABEL,
6
6
  GEMINI_INSTRUCTIONS_LABEL,
@@ -11,7 +11,7 @@ import {
11
11
  macAppFxBridge,
12
12
  refreshInstructionBlock,
13
13
  renderAgentInstructions
14
- } from "./chunk-4VRTSDGP.js";
14
+ } from "./chunk-DMNLFWGY.js";
15
15
  import {
16
16
  OPENCODE_HOOK_BINARY,
17
17
  agentHookOwner,
@@ -21,10 +21,10 @@ import {
21
21
  openCodeInstructionsFile,
22
22
  openCodePluginDir,
23
23
  openCodeWired
24
- } from "./chunk-ZGU3NXL2.js";
24
+ } from "./chunk-LTT54NOU.js";
25
25
  import {
26
26
  detectClaudeVersion
27
- } from "./chunk-USE5IEEW.js";
27
+ } from "./chunk-OY6Z4IKB.js";
28
28
  import {
29
29
  addClaudeMcpServer,
30
30
  addCompatibleHooks,
@@ -33,7 +33,7 @@ import {
33
33
  compatibleConfigFile,
34
34
  compatibleInstructionsFile,
35
35
  hasCompatibleHooks
36
- } from "./chunk-GKFO5JLN.js";
36
+ } from "./chunk-3QLFB2EY.js";
37
37
  import {
38
38
  claudeUnprovenHolds,
39
39
  claudeWired,
@@ -41,7 +41,7 @@ import {
41
41
  codexWired,
42
42
  geminiWired,
43
43
  planHooks
44
- } from "./chunk-BJTSKOH3.js";
44
+ } from "./chunk-SKUSGWFK.js";
45
45
  import {
46
46
  CLAUDE_HOOK_BINARY,
47
47
  CLAUDE_HOOK_EVENTS,
@@ -52,10 +52,15 @@ import {
52
52
  needsReregistration,
53
53
  registrationSignatures,
54
54
  supportedClaudeEvents
55
- } from "./chunk-RGSW36XH.js";
55
+ } from "./chunk-BQFL2ECS.js";
56
56
  import {
57
57
  formatVersion
58
58
  } from "./chunk-6ICPEJY5.js";
59
+ import {
60
+ readJsonSafe,
61
+ writeFileAtomic,
62
+ writeJsonAtomic
63
+ } from "./chunk-QENTGE75.js";
59
64
  import {
60
65
  CODEX_HOOK_BINARY,
61
66
  addCodexHookTrust,
@@ -83,21 +88,16 @@ import {
83
88
  registeredCommands,
84
89
  registrationHolderOf,
85
90
  vscodePluginMcp
86
- } from "./chunk-MWLTTLPK.js";
91
+ } from "./chunk-MK4USZYQ.js";
87
92
  import {
88
93
  resolveGlobalBinDir,
89
94
  resolveGlobalBinary
90
- } from "./chunk-CJ5TCFD4.js";
91
- import {
92
- readJsonSafe,
93
- writeFileAtomic,
94
- writeJsonAtomic
95
- } from "./chunk-QENTGE75.js";
95
+ } from "./chunk-5LOP4AVD.js";
96
96
  import {
97
97
  HOOK_COMPATIBLE_PROFILES,
98
98
  isCompatibleAgentType,
99
99
  isRecord
100
- } from "./chunk-AXJLJJ3M.js";
100
+ } from "./chunk-7NCLUA65.js";
101
101
 
102
102
  // src/reapply.ts
103
103
  import { dirname, join } from "path";
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-6ICPEJY5.js";
7
7
  import {
8
8
  isRecord
9
- } from "./chunk-AXJLJJ3M.js";
9
+ } from "./chunk-7NCLUA65.js";
10
10
 
11
11
  // src/setup/agent-probe.ts
12
12
  import { execSync } from "child_process";
@@ -4,30 +4,30 @@ import {
4
4
  postLiveSession,
5
5
  postLiveSessionUntilAccepted,
6
6
  startLiveSessionHeartbeat
7
- } from "./chunk-ELLJPP6O.js";
7
+ } from "./chunk-OP5IBEV7.js";
8
8
  import {
9
9
  SESSION_IDLE_TIMEOUT_MS,
10
10
  describeIdleWindow,
11
11
  idleDeadlinePassed,
12
12
  startProcessOwnership
13
- } from "./chunk-SHJVFW22.js";
13
+ } from "./chunk-CLABCSZC.js";
14
14
  import {
15
15
  spawnClaude
16
16
  } from "./chunk-XHKBHWLX.js";
17
17
  import {
18
18
  repoKeyFor
19
- } from "./chunk-YPD3MTFU.js";
19
+ } from "./chunk-7GRQGXF4.js";
20
20
  import {
21
21
  isAskUserResponse,
22
22
  isDecisionStopped,
23
23
  isWaitForAnswerResponse,
24
24
  withdrawQuestion,
25
25
  writeDegraded
26
- } from "./chunk-RJHX66EY.js";
26
+ } from "./chunk-TBKHQWIH.js";
27
27
  import {
28
28
  callMcpTool,
29
29
  isRetryable
30
- } from "./chunk-XAO6EYGM.js";
30
+ } from "./chunk-ELAK46NR.js";
31
31
  import {
32
32
  AGENT_QUESTION_DESCRIPTION_MAX,
33
33
  AGENT_QUESTION_HEADER_MAX,
@@ -48,7 +48,7 @@ import {
48
48
  parseCodexQuestions,
49
49
  planElicitationAsk,
50
50
  readElicitationFields
51
- } from "./chunk-AXJLJJ3M.js";
51
+ } from "./chunk-7NCLUA65.js";
52
52
 
53
53
  // src/codex-question-owner.ts
54
54
  import { createHash } from "crypto";
@@ -1,13 +1,13 @@
1
+ import {
2
+ writeJsonAtomic
3
+ } from "./chunk-QENTGE75.js";
1
4
  import {
2
5
  autoUpdateLock
3
- } from "./chunk-MWLTTLPK.js";
6
+ } from "./chunk-MK4USZYQ.js";
4
7
  import {
5
8
  installPackageGlobally,
6
9
  npmErrorMessage
7
- } from "./chunk-CJ5TCFD4.js";
8
- import {
9
- writeJsonAtomic
10
- } from "./chunk-QENTGE75.js";
10
+ } from "./chunk-5LOP4AVD.js";
11
11
 
12
12
  // src/upgrade-lock.ts
13
13
  import { fork } from "child_process";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  isDisabledByEnv
3
3
  } from "./chunk-POFBE6ZY.js";
4
- import {
5
- autoUpdateState
6
- } from "./chunk-MWLTTLPK.js";
7
4
  import {
8
5
  readJsonSafe,
9
6
  writeJsonAtomic
10
7
  } from "./chunk-QENTGE75.js";
8
+ import {
9
+ autoUpdateState
10
+ } from "./chunk-MK4USZYQ.js";
11
11
  import {
12
12
  CLI_PACKAGE_NAMES,
13
13
  POSIX_GLOBAL_ROOT_SEGMENTS,
@@ -17,7 +17,7 @@ import {
17
17
  } from "./chunk-QTOLNRET.js";
18
18
  import {
19
19
  isAutoUpdateResult
20
- } from "./chunk-AXJLJJ3M.js";
20
+ } from "./chunk-7NCLUA65.js";
21
21
 
22
22
  // src/auto-update.ts
23
23
  import { spawn } from "child_process";
@@ -2,10 +2,10 @@ import {
2
2
  IDLE_PROMPT_NOTIFICATION,
3
3
  NOTIFICATION_PUSH_TYPES,
4
4
  POSTTOOLUSE_MIRROR_ONLY_TOOLS
5
- } from "./chunk-33OOEVPG.js";
5
+ } from "./chunk-VC3HFFMQ.js";
6
6
  import {
7
7
  repoKeyFor
8
- } from "./chunk-YPD3MTFU.js";
8
+ } from "./chunk-7GRQGXF4.js";
9
9
  import {
10
10
  cancelQuestion,
11
11
  clientErrorKindOf,
@@ -13,26 +13,26 @@ import {
13
13
  reportClientError,
14
14
  sendNotification,
15
15
  waitForAnswer
16
- } from "./chunk-RJHX66EY.js";
16
+ } from "./chunk-TBKHQWIH.js";
17
17
  import {
18
18
  withRetry
19
- } from "./chunk-XAO6EYGM.js";
19
+ } from "./chunk-ELAK46NR.js";
20
20
  import {
21
21
  getMachineId
22
- } from "./chunk-SFAP4AJY.js";
22
+ } from "./chunk-L5CDGXPO.js";
23
23
  import {
24
24
  reportedInstallSource
25
- } from "./chunk-Y5VKZNFN.js";
26
- import {
27
- canonicalJson
28
- } from "./chunk-MWLTTLPK.js";
25
+ } from "./chunk-V5W3CK7F.js";
29
26
  import {
30
27
  writeFileAtomic
31
28
  } from "./chunk-QENTGE75.js";
29
+ import {
30
+ canonicalJson
31
+ } from "./chunk-MK4USZYQ.js";
32
32
  import {
33
33
  getApiKey,
34
34
  getBaseUrl
35
- } from "./chunk-BG4Y64FW.js";
35
+ } from "./chunk-BUQU3OPX.js";
36
36
  import {
37
37
  ACTION_BODY_MAX,
38
38
  AGENTS,
@@ -58,6 +58,7 @@ import {
58
58
  modeStateFromResponse,
59
59
  parseMcpToolName,
60
60
  pendingCommandEvents,
61
+ questionLimitHandBack,
61
62
  redactSecrets,
62
63
  redactSecretsDeep,
63
64
  reportableSessionId,
@@ -66,7 +67,7 @@ import {
66
67
  toToolLookup,
67
68
  truncateLine,
68
69
  unansweredRefusalReason
69
- } from "./chunk-AXJLJJ3M.js";
70
+ } from "./chunk-7NCLUA65.js";
70
71
 
71
72
  // ../hook-mapping/src/describe.ts
72
73
  import { isAbsolute, relative, resolve } from "path";
@@ -1348,6 +1349,10 @@ var toPolicyLookups = (toolName, toolInput, cwd) => {
1348
1349
  inputs: files.map((file) => ({ file_path: cwd ? resolve2(cwd, file) : file }))
1349
1350
  };
1350
1351
  };
1352
+ var codexQuestionLimitDecision = (facts) => {
1353
+ const handBack = questionLimitHandBack(facts);
1354
+ return handBack.kind === "refuse" ? codexDeny(handBack.reason) : codexPass();
1355
+ };
1351
1356
  var permissionTimeoutDecision = (timeoutAction, paused) => {
1352
1357
  if (timeoutAction === "approve") return codexAllow();
1353
1358
  if (timeoutAction === "deny") return codexDeny(unansweredRefusalReason(paused));
@@ -2236,6 +2241,7 @@ export {
2236
2241
  describeApplyPatch,
2237
2242
  toPolicyLookup,
2238
2243
  toPolicyLookups,
2244
+ codexQuestionLimitDecision,
2239
2245
  permissionTimeoutDecision,
2240
2246
  userScope,
2241
2247
  codexCallKey,
@@ -4,19 +4,19 @@ import {
4
4
  outcomeOfFailedAsk,
5
5
  reportMachineDenial,
6
6
  storedWaitDeadline
7
- } from "./chunk-ORX5BTV4.js";
7
+ } from "./chunk-2MZ6ROWZ.js";
8
8
  import {
9
9
  isGatingMoment,
10
10
  recordKeylessMoment
11
- } from "./chunk-SVQWHV65.js";
11
+ } from "./chunk-XO3KAH7K.js";
12
12
  import {
13
13
  isDeferAnswer,
14
14
  oncePerSession
15
- } from "./chunk-ZEWIMY63.js";
15
+ } from "./chunk-KL76XWZ7.js";
16
16
  import {
17
17
  activeHookSource,
18
18
  activeIdentity
19
- } from "./chunk-GKFO5JLN.js";
19
+ } from "./chunk-3QLFB2EY.js";
20
20
  import {
21
21
  DEFAULT_SESSION,
22
22
  UNNAMED_ACTION,
@@ -40,10 +40,10 @@ import {
40
40
  reportEvent,
41
41
  scopePathFor,
42
42
  settleQuestionsForToolUse
43
- } from "./chunk-DQLCFGHK.js";
43
+ } from "./chunk-PXAOEFJZ.js";
44
44
  import {
45
45
  repoKeyFor
46
- } from "./chunk-YPD3MTFU.js";
46
+ } from "./chunk-7GRQGXF4.js";
47
47
  import {
48
48
  askUser,
49
49
  cancelQuestion,
@@ -52,26 +52,27 @@ import {
52
52
  isAwayPaused,
53
53
  isDecisionStopped,
54
54
  isLocalQuestionHandoff,
55
+ isQuestionLimitRefusal,
55
56
  pollForAnswer,
56
57
  reportClientError,
57
58
  requestGate,
58
59
  sendNotification,
59
60
  waitForQuestion,
60
61
  waitsForThePhone
61
- } from "./chunk-RJHX66EY.js";
62
+ } from "./chunk-TBKHQWIH.js";
62
63
  import {
63
64
  getMachineId
64
- } from "./chunk-SFAP4AJY.js";
65
+ } from "./chunk-L5CDGXPO.js";
65
66
  import {
66
67
  claudeConfigDir
67
- } from "./chunk-MWLTTLPK.js";
68
+ } from "./chunk-MK4USZYQ.js";
68
69
  import {
69
70
  getApiKey,
70
71
  getBaseUrl
71
- } from "./chunk-BG4Y64FW.js";
72
+ } from "./chunk-BUQU3OPX.js";
72
73
  import {
73
74
  NPX_LATEST_COMMAND
74
- } from "./chunk-ERK24P76.js";
75
+ } from "./chunk-6Z2VR3BA.js";
75
76
  import {
76
77
  AGENT_QUESTION_STRATEGY,
77
78
  AGENT_QUESTION_TOOL,
@@ -80,6 +81,7 @@ import {
80
81
  GATE_WIRE,
81
82
  HANDED_BACK_REASON,
82
83
  PLAN_DECLINED_REASON,
84
+ QUESTION_LIMIT_PROMPT_REASON,
83
85
  SCOPE_BATCH_REASON,
84
86
  SOLE_GATE_SIGNED_OUT_REASON,
85
87
  SOLE_GATE_SUBSCRIPTION_REASON,
@@ -109,14 +111,17 @@ import {
109
111
  hookWaitDeadline,
110
112
  hookWritePath,
111
113
  isBlockedActionRequest,
114
+ isCursorHookPayload,
112
115
  isPermissionRequestOwnedByPreToolUse,
113
116
  isPusharyOwnTool,
114
117
  parseAgentQuestions,
115
118
  questionHandedToTheTerminal,
119
+ questionLimitHandBack,
120
+ refusesWhenUnanswered,
116
121
  resolveGate,
117
122
  timeoutActionWithoutLocalPrompt,
118
123
  unansweredRefusalReason
119
- } from "./chunk-AXJLJJ3M.js";
124
+ } from "./chunk-7NCLUA65.js";
120
125
 
121
126
  // src/claude-permission-rules.ts
122
127
  import { readFileSync, statSync } from "fs";
@@ -197,8 +202,12 @@ var allowWithInput = (updatedInput) => claudePreToolUseOutput("allow", void 0, u
197
202
  var ask = (reason) => claudePreToolUseOutput("ask", reason);
198
203
  var halted = (reason) => claudeStoppedPreToolUseOutput(reason);
199
204
  var undecidedCall = (reason) => PUSHARY_IS_SOLE_GATE ? deny(reason) : void 0;
200
- var outcomeOfFailedPermissionAsk = (error, sessionId) => outcomeOfFailedAsk(error, sessionId, halted(UNVERIFIABLE_APPROVAL_REASON)) ?? undecidedCall(SOLE_GATE_SUBSCRIPTION_REASON);
201
- var handlePushOnly = async (apiKey, description, projectName, timeoutSeconds, timeoutAction, sessionId, machineId, toolName, toolTarget, decision, signals) => {
205
+ var questionLimitOutput = (handBack) => handBack.kind === "refuse" ? deny(handBack.reason) : ask(QUESTION_LIMIT_PROMPT_REASON);
206
+ var outcomeOfFailedPermissionAsk = (error, sessionId, questionLimitFacts) => {
207
+ if (isQuestionLimitRefusal(error)) return questionLimitOutput(questionLimitHandBack(questionLimitFacts));
208
+ return outcomeOfFailedAsk(error, sessionId, halted(UNVERIFIABLE_APPROVAL_REASON)) ?? undecidedCall(SOLE_GATE_SUBSCRIPTION_REASON);
209
+ };
210
+ var handlePushOnly = async (apiKey, description, projectName, timeoutSeconds, timeoutAction, sessionId, machineId, toolName, toolTarget, decision, signals, agentPromptFollows) => {
202
211
  const effectiveWait = effectiveWaitSeconds(timeoutAction, timeoutSeconds, "claude");
203
212
  const now = Date.now();
204
213
  const requestedDeadline = hookWaitDeadline(START_MS, effectiveWait, "claude", now);
@@ -218,7 +227,10 @@ var handlePushOnly = async (apiKey, description, projectName, timeoutSeconds, ti
218
227
  ...decision
219
228
  });
220
229
  } catch (error) {
221
- return outcomeOfFailedPermissionAsk(error, sessionId);
230
+ return outcomeOfFailedPermissionAsk(error, sessionId, {
231
+ refusesUnanswered: refusesWhenUnanswered({ mode: "push_only", timeoutAction }),
232
+ agentPromptFollows
233
+ });
222
234
  }
223
235
  if (isDecisionStopped(result)) return halted(DECISION_STOP_REASON);
224
236
  const deadline = storedWaitDeadline(result, requestedDeadline);
@@ -246,7 +258,7 @@ var handlePushOnly = async (apiKey, description, projectName, timeoutSeconds, ti
246
258
  var handleTerminalOnly = () => {
247
259
  return ask();
248
260
  };
249
- var handlePushFirst = async (apiKey, description, projectName, pushFirstSeconds, sessionId, machineId, toolName, toolTarget, decision, signals) => {
261
+ var handlePushFirst = async (apiKey, description, projectName, pushFirstSeconds, sessionId, machineId, toolName, toolTarget, decision, signals, agentPromptFollows) => {
250
262
  const requestedDeadline = hookWaitDeadline(START_MS, pushFirstSeconds, "claude", Date.now());
251
263
  let result;
252
264
  try {
@@ -263,7 +275,7 @@ var handlePushFirst = async (apiKey, description, projectName, pushFirstSeconds,
263
275
  ...decision
264
276
  });
265
277
  } catch (error) {
266
- return outcomeOfFailedPermissionAsk(error, sessionId);
278
+ return outcomeOfFailedPermissionAsk(error, sessionId, { refusesUnanswered: false, agentPromptFollows });
267
279
  }
268
280
  if (isDecisionStopped(result)) return halted(DECISION_STOP_REASON);
269
281
  if (waitsForThePhone(result)) announceWait(pushFirstSeconds, result.answerUrl, sessionId);
@@ -324,6 +336,7 @@ var dispatchModeHandler = async (apiKey, input, toolPolicy, machineId, trainingC
324
336
  const sessionId = input.session_id;
325
337
  const toolTarget = deriveToolTarget(input.tool_name, input.tool_input);
326
338
  const ownPrompt = hasItsOwnApprovalPrompt(ACTIVE_SOURCE);
339
+ const agentPromptFollows = ownPrompt && !isCursorHookPayload(input);
327
340
  const intent = readLastPrompt(sessionId ?? DEFAULT_SESSION) ?? (input.transcript_path ? readLastUserPrompt(input.transcript_path) : void 0);
328
341
  const decision = {
329
342
  toolPath: hookWritePath(input.tool_name, input.tool_input),
@@ -347,15 +360,15 @@ var dispatchModeHandler = async (apiKey, input, toolPolicy, machineId, trainingC
347
360
  const runHandler = () => {
348
361
  switch (ownPrompt ? toolPolicy.mode : approvalModeWithoutLocalPrompt(toolPolicy.mode)) {
349
362
  case "push_only":
350
- return handlePushOnly(apiKey, description, projectName, toolPolicy.timeoutSeconds, ownPrompt ? toolPolicy.timeoutAction : timeoutActionWithoutLocalPrompt(toolPolicy), sessionId, machineId, input.tool_name, toolTarget, decision, signals);
363
+ return handlePushOnly(apiKey, description, projectName, toolPolicy.timeoutSeconds, ownPrompt ? toolPolicy.timeoutAction : timeoutActionWithoutLocalPrompt(toolPolicy), sessionId, machineId, input.tool_name, toolTarget, decision, signals, agentPromptFollows);
351
364
  case "terminal_only":
352
365
  return Promise.resolve(handleTerminalOnly());
353
366
  case "push_first":
354
- return handlePushFirst(apiKey, description, projectName, toolPolicy.pushFirstSeconds, sessionId, machineId, input.tool_name, toolTarget, decision, signals);
367
+ return handlePushFirst(apiKey, description, projectName, toolPolicy.pushFirstSeconds, sessionId, machineId, input.tool_name, toolTarget, decision, signals, agentPromptFollows);
355
368
  case "notify_only":
356
369
  return handleNotifyOnly(apiKey, description, projectName, sessionId, machineId);
357
370
  default:
358
- return handlePushFirst(apiKey, description, projectName, toolPolicy.pushFirstSeconds, sessionId, machineId, input.tool_name, toolTarget, decision, signals);
371
+ return handlePushFirst(apiKey, description, projectName, toolPolicy.pushFirstSeconds, sessionId, machineId, input.tool_name, toolTarget, decision, signals, agentPromptFollows);
359
372
  }
360
373
  };
361
374
  const result = await runHandler();
@@ -2,7 +2,7 @@ import {
2
2
  isApprovalMode,
3
3
  isRecord,
4
4
  isTimeoutAction
5
- } from "./chunk-AXJLJJ3M.js";
5
+ } from "./chunk-7NCLUA65.js";
6
6
 
7
7
  // src/cli/settings-response.ts
8
8
  var isFiniteNumber = (value) => typeof value === "number" && Number.isFinite(value);