pushary 1.9.174 → 1.9.175

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 (139) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/{api-MNYX7TLY.js → api-MMBCOOHP.js} +11 -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 +27 -27
  8. package/dist/bin/pushary-clean.js +38 -38
  9. package/dist/bin/pushary-codex-bridge.js +23 -23
  10. package/dist/bin/pushary-codex-hook.js +36 -36
  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 +34 -34
  14. package/dist/bin/pushary-cowork.js +5 -5
  15. package/dist/bin/pushary-daemon.js +45 -45
  16. package/dist/bin/pushary-disconnect.js +29 -29
  17. package/dist/bin/pushary-doctor.js +46 -46
  18. package/dist/bin/pushary-elicitation-hook.js +28 -28
  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 +29 -29
  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-hook.js +33 -33
  28. package/dist/bin/pushary-permission-denied-hook.js +36 -36
  29. package/dist/bin/pushary-permission-hook.js +36 -36
  30. package/dist/bin/pushary-post-hook.js +28 -28
  31. package/dist/bin/pushary-prompt-hook.js +27 -27
  32. package/dist/bin/pushary-session-end-hook.js +27 -27
  33. package/dist/bin/pushary-session-start-hook.js +38 -38
  34. package/dist/bin/pushary-sessions.js +14 -14
  35. package/dist/bin/pushary-setup.js +54 -54
  36. package/dist/bin/pushary-stats.js +5 -5
  37. package/dist/bin/pushary-status.js +35 -35
  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 +16 -16
  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 +43 -43
  44. package/dist/bin/pushary-wait.js +16 -16
  45. package/dist/bin/pushary.js +7 -7
  46. package/dist/{chunk-VCWHZDP3.js → chunk-24W735XB.js} +2 -2
  47. package/dist/{chunk-ZLXN26UD.js → chunk-2RILXRZ5.js} +6 -6
  48. package/dist/{chunk-R3EIRYON.js → chunk-37EEYMUJ.js} +5 -5
  49. package/dist/{chunk-BHBHY35A.js → chunk-3F4UI7DP.js} +4 -4
  50. package/dist/{chunk-LH5JTAAH.js → chunk-3FMW4G3B.js} +2 -2
  51. package/dist/{chunk-YE7WPP7M.js → chunk-3HVCLYEA.js} +1 -1
  52. package/dist/{chunk-C7SKKHMD.js → chunk-3O42YMMA.js} +4 -4
  53. package/dist/{chunk-5LIGHRBH.js → chunk-3TGLZAON.js} +1 -1
  54. package/dist/{chunk-HZGSGLK4.js → chunk-537VC73A.js} +6 -6
  55. package/dist/{chunk-YFOR2JQQ.js → chunk-5DEG6XEK.js} +1 -1
  56. package/dist/{chunk-OLKAGHOO.js → chunk-5RAMEVL5.js} +1 -1
  57. package/dist/{chunk-CPV25VW5.js → chunk-6L5Q4I4V.js} +1 -1
  58. package/dist/{chunk-R4RL4UDT.js → chunk-6RAM3F5N.js} +5 -5
  59. package/dist/{chunk-DJS7W4SC.js → chunk-6TJ463K6.js} +6 -6
  60. package/dist/{chunk-2EHDZOJA.js → chunk-6YR7VLHE.js} +8 -8
  61. package/dist/{chunk-FS7WOHFO.js → chunk-77FE2JQB.js} +5 -5
  62. package/dist/{chunk-PDIN6FE5.js → chunk-A3DLOQJ7.js} +1 -1
  63. package/dist/{chunk-HUJWZIQ2.js → chunk-ACWLYAEM.js} +1 -1
  64. package/dist/{chunk-IQNM745W.js → chunk-AN7252SG.js} +2 -2
  65. package/dist/{chunk-PZNVSYIY.js → chunk-B7S5NLZB.js} +5 -5
  66. package/dist/{chunk-2IEU6RX5.js → chunk-CZG2AXJD.js} +1 -1
  67. package/dist/{chunk-FPF7ZSH5.js → chunk-CZQGXJQY.js} +2 -2
  68. package/dist/{chunk-OFKKNHYJ.js → chunk-D3U46VX5.js} +1 -1
  69. package/dist/{chunk-US4LUIFU.js → chunk-DJHPBM5S.js} +3 -1
  70. package/dist/{chunk-57C45LJT.js → chunk-DOVLWIA4.js} +2 -2
  71. package/dist/{chunk-6355EUTT.js → chunk-EG23IMEU.js} +3 -3
  72. package/dist/{chunk-YXLWKFKC.js → chunk-EH7M4CXB.js} +6 -6
  73. package/dist/{chunk-CDUTYRXO.js → chunk-EMRFCGWI.js} +4 -4
  74. package/dist/{chunk-LIVVVKIZ.js → chunk-F66QGIJR.js} +3 -3
  75. package/dist/{chunk-WAZIEUIG.js → chunk-F7JATJWH.js} +4 -4
  76. package/dist/{chunk-GPHESUOZ.js → chunk-G74JB53L.js} +4 -4
  77. package/dist/{chunk-M4KQPSMS.js → chunk-GC75JZFG.js} +1 -1
  78. package/dist/{chunk-5JCKVJC6.js → chunk-GHTQ7IAZ.js} +5 -5
  79. package/dist/{chunk-4IOCYW6O.js → chunk-GMNBIURN.js} +3 -3
  80. package/dist/{chunk-TRXYUOWW.js → chunk-GT4GUCCK.js} +6 -6
  81. package/dist/{chunk-Z6YRFNN3.js → chunk-GVMPWNPA.js} +4 -4
  82. package/dist/{chunk-3L5DXDPK.js → chunk-H75BEIQN.js} +1 -1
  83. package/dist/{chunk-HLK3ZELO.js → chunk-HB2EJOEM.js} +2 -2
  84. package/dist/{chunk-CTLI2HJE.js → chunk-HLDDLBXI.js} +5 -5
  85. package/dist/{chunk-3FOW4K2L.js → chunk-HQS7MUTB.js} +4 -4
  86. package/dist/{chunk-VH2DDTBE.js → chunk-I2TMZ2VO.js} +10 -10
  87. package/dist/{chunk-JG2ZVO5L.js → chunk-KZ7FPLTR.js} +1 -1
  88. package/dist/{chunk-TU5DTA2V.js → chunk-LYC7OGLM.js} +1 -1
  89. package/dist/{chunk-7VG4JO77.js → chunk-MFNSTUPF.js} +4 -4
  90. package/dist/{chunk-IP4NJN6G.js → chunk-N4AVMDS3.js} +1 -1
  91. package/dist/{chunk-YDYKKSFU.js → chunk-NGXZD5B2.js} +3 -3
  92. package/dist/{chunk-HGVGOGVD.js → chunk-NIYGTZZ4.js} +3 -3
  93. package/dist/{chunk-A3YA4EIY.js → chunk-NW4M5WK6.js} +2 -2
  94. package/dist/{chunk-N73CKAC6.js → chunk-OQVTK7HS.js} +1 -1
  95. package/dist/{chunk-PAYK5BD7.js → chunk-OZBNNBZG.js} +2 -2
  96. package/dist/{chunk-UJ6ZJNHK.js → chunk-P35JKWDS.js} +2 -2
  97. package/dist/{chunk-JXOVA3JW.js → chunk-P5AJZMHG.js} +5 -5
  98. package/dist/{chunk-GGNKMBCN.js → chunk-PBPF46MM.js} +4 -4
  99. package/dist/{chunk-XZOYXQ6J.js → chunk-PWIHCKC2.js} +5 -5
  100. package/dist/{chunk-7YVSQ342.js → chunk-PYNRQFXB.js} +1 -1
  101. package/dist/{chunk-QCZMBOMF.js → chunk-QDF4VGHL.js} +1 -1
  102. package/dist/{chunk-SNY4ABHS.js → chunk-RDCP7PVJ.js} +4 -4
  103. package/dist/{chunk-4NXEOPXZ.js → chunk-RHOZMBEL.js} +1 -1
  104. package/dist/{chunk-ET2BWLQX.js → chunk-RIH62UGR.js} +3 -3
  105. package/dist/{chunk-DPHYIJNF.js → chunk-RX64LJJQ.js} +3 -3
  106. package/dist/{chunk-H3MY3EQP.js → chunk-S7AT7T7H.js} +4 -4
  107. package/dist/{chunk-OBNVYNPQ.js → chunk-SFXASSHE.js} +3 -3
  108. package/dist/{chunk-O4AAXXXP.js → chunk-TDZRZNXX.js} +3 -3
  109. package/dist/{chunk-76T3UMRC.js → chunk-TKGSV72S.js} +76 -31
  110. package/dist/{chunk-SHLAHE46.js → chunk-TVJ4A32Y.js} +9 -9
  111. package/dist/{chunk-7XALAS43.js → chunk-UEKEMOE7.js} +2 -2
  112. package/dist/{chunk-X5LTD4VA.js → chunk-UJKHGU7E.js} +1 -1
  113. package/dist/{chunk-6BZCNKCY.js → chunk-UNKYMIVH.js} +3 -3
  114. package/dist/{chunk-E2WABTIY.js → chunk-VRY3F35M.js} +7 -7
  115. package/dist/{chunk-RT6FAMIF.js → chunk-VWKCVBDJ.js} +12 -12
  116. package/dist/{chunk-6HYQSAMW.js → chunk-WC3JA2Q3.js} +2 -2
  117. package/dist/{chunk-MF6FSDM4.js → chunk-WWBOST2M.js} +2 -2
  118. package/dist/{chunk-PWJ76P2L.js → chunk-WXVCXQKB.js} +6 -6
  119. package/dist/{chunk-GTCNACQ2.js → chunk-X4RHTBTI.js} +5 -5
  120. package/dist/{chunk-S3X6WLW5.js → chunk-Y5IBOWHQ.js} +1 -1
  121. package/dist/{chunk-VLEKL3PF.js → chunk-YAP7HQNG.js} +1 -1
  122. package/dist/{chunk-DNJKQHK2.js → chunk-YH6DJA7F.js} +1 -1
  123. package/dist/{chunk-RIHIXQAL.js → chunk-YHXH4SDN.js} +11 -11
  124. package/dist/{chunk-WWVVLMPJ.js → chunk-YJWMKS4K.js} +2 -2
  125. package/dist/{chunk-K5NBHOE6.js → chunk-YPGLRH6E.js} +2 -2
  126. package/dist/{codex-app-cards-switch-MJA47AZY.js → codex-app-cards-switch-2KIZJC4H.js} +11 -11
  127. package/dist/{codex-card-routing-2MDDCMAO.js → codex-card-routing-WWPQAJ4X.js} +2 -2
  128. package/dist/{codex-desktop-launch-7IVPOMSK.js → codex-desktop-launch-H325FPFI.js} +1 -1
  129. package/dist/{codex-session-launch-U6JUH6X6.js → codex-session-launch-IRN5OGXZ.js} +20 -20
  130. package/dist/{config-S2OVEI6F.js → config-IDRTM5J7.js} +3 -3
  131. package/dist/{global-upgrade-XGDWDFQN.js → global-upgrade-DX4ZXLZ5.js} +9 -9
  132. package/dist/{identity-7LLNHIP3.js → identity-FZSHIS7P.js} +4 -4
  133. package/dist/{live-capabilities-CI46M4XO.js → live-capabilities-2DIRQWGQ.js} +4 -4
  134. package/dist/{paths-FVQYVHLH.js → paths-BQORCROG.js} +3 -3
  135. package/dist/{reapply-M4DKHUZX.js → reapply-7SA3FKAJ.js} +31 -31
  136. package/dist/src/index.js +35 -35
  137. package/dist/{upgrade-lock-DTWLFPH2.js → upgrade-lock-TKFFUNHB.js} +4 -4
  138. package/dist/{usage-IHNVIPGZ.js → usage-XHC7EO7E.js} +3 -3
  139. package/package.json +1 -1
@@ -2,39 +2,39 @@ import {
2
2
  forgetPhoneApproval,
3
3
  rememberPhoneApproval,
4
4
  takePhoneApproval
5
- } from "./chunk-57C45LJT.js";
5
+ } from "./chunk-DOVLWIA4.js";
6
6
  import {
7
7
  claudeSettingsLocationFor,
8
8
  readClaudePermissionRules
9
- } from "./chunk-K5NBHOE6.js";
9
+ } from "./chunk-YPGLRH6E.js";
10
10
  import {
11
11
  defersToNativeMode
12
- } from "./chunk-7YVSQ342.js";
12
+ } from "./chunk-PYNRQFXB.js";
13
13
  import {
14
14
  askAgentQuestions,
15
15
  outcomeOfFailedAsk,
16
16
  storedWaitDeadline
17
- } from "./chunk-R4RL4UDT.js";
17
+ } from "./chunk-6RAM3F5N.js";
18
18
  import {
19
19
  reportMachineDenial
20
- } from "./chunk-C7SKKHMD.js";
20
+ } from "./chunk-3O42YMMA.js";
21
21
  import {
22
22
  isGatingMoment,
23
23
  recordKeylessMoment
24
- } from "./chunk-VLEKL3PF.js";
24
+ } from "./chunk-YAP7HQNG.js";
25
25
  import {
26
26
  isAdmitted,
27
27
  readAdmissionRules
28
- } from "./chunk-CTLI2HJE.js";
28
+ } from "./chunk-HLDDLBXI.js";
29
29
  import {
30
30
  isDeferAnswer,
31
31
  oncePerSession
32
- } from "./chunk-4NXEOPXZ.js";
32
+ } from "./chunk-RHOZMBEL.js";
33
33
  import {
34
34
  activeHookSource,
35
35
  activeIdentity,
36
36
  namedSource
37
- } from "./chunk-R3EIRYON.js";
37
+ } from "./chunk-37EEYMUJ.js";
38
38
  import {
39
39
  DEFAULT_SESSION,
40
40
  approvalAwaitingRetry,
@@ -57,7 +57,7 @@ import {
57
57
  settleQuestionsForToolUse,
58
58
  sweepFilesOlderThan,
59
59
  userScope
60
- } from "./chunk-RT6FAMIF.js";
60
+ } from "./chunk-VWKCVBDJ.js";
61
61
  import {
62
62
  UNNAMED_ACTION,
63
63
  deriveAction,
@@ -68,7 +68,7 @@ import {
68
68
  patchDeletesFiles,
69
69
  permissionDeniedAction,
70
70
  scopePathFor
71
- } from "./chunk-OFKKNHYJ.js";
71
+ } from "./chunk-D3U46VX5.js";
72
72
  import {
73
73
  askUser,
74
74
  cancelQuestion,
@@ -85,29 +85,29 @@ import {
85
85
  waitForQuestion,
86
86
  waitsForThePhone,
87
87
  withdrawQuestion
88
- } from "./chunk-YXLWKFKC.js";
88
+ } from "./chunk-EH7M4CXB.js";
89
89
  import {
90
90
  branchFor,
91
91
  projectNameFor,
92
92
  repoKeyFor,
93
93
  repositoryScopeFor
94
- } from "./chunk-DNJKQHK2.js";
94
+ } from "./chunk-YH6DJA7F.js";
95
95
  import {
96
96
  getMachineId
97
- } from "./chunk-YFOR2JQQ.js";
97
+ } from "./chunk-5DEG6XEK.js";
98
98
  import {
99
99
  POSTTOOLUSE_MIRRORED_TOOLS
100
- } from "./chunk-MF6FSDM4.js";
100
+ } from "./chunk-WWBOST2M.js";
101
101
  import {
102
102
  getApiKey,
103
103
  getBaseUrl
104
- } from "./chunk-TU5DTA2V.js";
104
+ } from "./chunk-LYC7OGLM.js";
105
105
  import {
106
106
  writeFileAtomic
107
107
  } from "./chunk-PM2NRK6Y.js";
108
108
  import {
109
109
  NPX_LATEST_COMMAND
110
- } from "./chunk-S3X6WLW5.js";
110
+ } from "./chunk-Y5IBOWHQ.js";
111
111
  import {
112
112
  AGENT_QUESTION_STRATEGY,
113
113
  AGENT_QUESTION_TOOL,
@@ -154,6 +154,7 @@ import {
154
154
  hookWaitClamped,
155
155
  hookWaitDeadline,
156
156
  hookWritePath,
157
+ isApprovedOnlyAtPermissionRequest,
157
158
  isBlockedActionRequest,
158
159
  isClaudeRefusalsOnlyTool,
159
160
  isCursorHookPayload,
@@ -179,7 +180,7 @@ import {
179
180
  timeoutActionWithoutLocalPrompt,
180
181
  unansweredRefusalReason,
181
182
  unapprovedScopeReason
182
- } from "./chunk-US4LUIFU.js";
183
+ } from "./chunk-DJHPBM5S.js";
183
184
 
184
185
  // src/terminal-answer-watch.ts
185
186
  import { closeSync, openSync, readSync, statSync } from "fs";
@@ -718,13 +719,13 @@ var handleAskUserQuestion = async (apiKey, input, modeState) => {
718
719
  };
719
720
  var PLAN_APPROVE = "Approve, start coding";
720
721
  var PLAN_KEEP_PLANNING = "Keep planning";
721
- var handleExitPlanMode = async (apiKey, input) => {
722
+ var askThePlanQuestion = async (apiKey, input) => {
722
723
  const toolInput = input.tool_input ?? {};
723
724
  const projectName = projectNameFor(input.cwd);
724
725
  const deadline = hookWaitDeadline(START_MS, effectiveWaitSeconds("wait", 0, "claude"), "claude", Date.now());
725
- let result;
726
+ let question;
726
727
  try {
727
- result = await askUser(apiKey, {
728
+ question = await askUser(apiKey, {
728
729
  question: `Approve the plan and start coding in ${projectName}?`,
729
730
  type: "select",
730
731
  options: [PLAN_APPROVE, PLAN_KEEP_PLANNING],
@@ -742,17 +743,34 @@ var handleExitPlanMode = async (apiKey, input) => {
742
743
  waitEndsAt: new Date(deadline).toISOString()
743
744
  });
744
745
  } catch (error) {
745
- return outcomeOfFailedAsk(error, input.session_id, halted(DECISION_STOP_REASON));
746
+ return { kind: "settled", answer: outcomeOfFailedAsk(error, input.session_id, "failed") ?? "unanswered" };
746
747
  }
747
- if (isDecisionStopped(result)) return halted(DECISION_STOP_REASON);
748
- const answer = await waitForQuestion(apiKey, result, storedWaitDeadline(result, deadline));
749
- if (isDecisionStopped(answer)) return halted(DECISION_STOP_REASON);
748
+ if (isDecisionStopped(question)) return { kind: "settled", answer: "stopped" };
749
+ return { kind: "asked", question, deadline: storedWaitDeadline(question, deadline) };
750
+ };
751
+ var planAnswerOf = async (apiKey, question, deadline, signal) => {
752
+ const answer = await waitForQuestion(apiKey, question, deadline, void 0, signal);
753
+ if (isDecisionStopped(answer)) return "stopped";
750
754
  const value = answer.answered ? (answer.value ?? "").trim() : "";
751
- if (!value || isDeferAnswer(answer.value)) {
752
- return void 0;
755
+ if (!value || isDeferAnswer(answer.value)) return "unanswered";
756
+ return value === PLAN_APPROVE ? "approved" : "declined";
757
+ };
758
+ var preToolUsePlanOutput = (answer) => {
759
+ switch (answer) {
760
+ case "approved":
761
+ return allow();
762
+ case "declined":
763
+ return deny(PLAN_DECLINED_REASON);
764
+ case "stopped":
765
+ case "failed":
766
+ return halted(DECISION_STOP_REASON);
767
+ case "unanswered":
768
+ return void 0;
753
769
  }
754
- if (value === PLAN_APPROVE) return allow();
755
- return deny(PLAN_DECLINED_REASON);
770
+ };
771
+ var handleExitPlanMode = async (apiKey, input) => {
772
+ const plan = await askThePlanQuestion(apiKey, input);
773
+ return preToolUsePlanOutput(plan.kind === "settled" ? plan.answer : await planAnswerOf(apiKey, plan.question, plan.deadline));
756
774
  };
757
775
  var handleKeyless = (input) => {
758
776
  try {
@@ -930,6 +948,7 @@ var decidePreToolUse = async (input, canonical) => {
930
948
  if (input.tool_name === "AskUserQuestion") {
931
949
  return settledAs("asked", await handleAskUserQuestion(apiKey, input, modeState));
932
950
  }
951
+ if (isApprovedOnlyAtPermissionRequest(ACTIVE_SOURCE, input.tool_name)) return settledAs("native_mode", void 0);
933
952
  if (input.tool_name === "ExitPlanMode") {
934
953
  return settledAs("asked", await handleExitPlanMode(apiKey, input));
935
954
  }
@@ -980,10 +999,35 @@ var toPermissionRequestOutput = (hookOutput) => {
980
999
  return void 0;
981
1000
  };
982
1001
  var answerOfTheReplay = (replayed) => replayed.humanDecision ? toPermissionRequestOutput(replayed.result) : void 0;
1002
+ var permissionRequestPlanOutput = (answer, plan) => {
1003
+ switch (answer) {
1004
+ case "approved":
1005
+ return permReqAllow(plan);
1006
+ case "declined":
1007
+ return permReqDeny(PLAN_DECLINED_REASON);
1008
+ case "stopped":
1009
+ return permReqDeny(DECISION_STOP_REASON);
1010
+ case "failed":
1011
+ case "unanswered":
1012
+ return void 0;
1013
+ }
1014
+ };
1015
+ var answerThePlanBesideTheDialog = async (apiKey, input) => {
1016
+ const toolInput = input.tool_input ?? {};
1017
+ const plan = await askThePlanQuestion(apiKey, input);
1018
+ if (plan.kind === "settled") return permissionRequestPlanOutput(plan.answer, toolInput);
1019
+ const stop = new AbortController();
1020
+ const first = await Promise.race([planAnswerOf(apiKey, plan.question, plan.deadline, stop.signal), terminalAnswered(input, stop.signal)]).finally(() => stop.abort());
1021
+ if (first === TERMINAL_ANSWERED) {
1022
+ await withdrawQuestion(apiKey, plan.question.correlationId);
1023
+ return void 0;
1024
+ }
1025
+ return permissionRequestPlanOutput(first, toolInput);
1026
+ };
983
1027
  var handlePermissionRequest = async (input, canonical, holdBudgetSeconds) => {
984
1028
  if (isPusharyOwnOrConnectorTool(input.tool_name)) return permReqAllow();
985
1029
  const claudeRules = claudePermissionRulesFor(input);
986
- if (canonical === void 0 && !claudeRulesMayCover(input, claudeRules) && isPermissionRequestOwnedByPreToolUse(input.tool_name, input.permission_mode, shouldDeferToNativeMode) && !terminalStaysLiveForTheCall(terminalLiveFactsOf(input))) return void 0;
1030
+ if (canonical === void 0 && !claudeRulesMayCover(input, claudeRules) && isPermissionRequestOwnedByPreToolUse(ACTIVE_SOURCE, input.tool_name, input.permission_mode, shouldDeferToNativeMode) && !terminalStaysLiveForTheCall(terminalLiveFactsOf(input))) return void 0;
987
1031
  let apiKey;
988
1032
  try {
989
1033
  apiKey = getApiKey();
@@ -1006,6 +1050,7 @@ var handlePermissionRequest = async (input, canonical, holdBudgetSeconds) => {
1006
1050
  if (canonical === null) return permReqDeny(UNREADABLE_CALL_REASON);
1007
1051
  if (isMcpCallInClaudeCode(input) && claimMcpHoldHandback(blockedActionFingerprintFor(input))) return void 0;
1008
1052
  if (agentQuestionStrategy(ACTIVE_SOURCE, "PermissionRequest", input.tool_name) === AGENT_QUESTION_STRATEGY.native) return void 0;
1053
+ if (isApprovedOnlyAtPermissionRequest(ACTIVE_SOURCE, input.tool_name)) return await answerThePlanBesideTheDialog(apiKey, input);
1009
1054
  if (verdict.kind === "gate" && verdict.scopeReason && (canonical?.toolInputs.length ?? 0) > 1) return permReqDeny(SCOPE_BATCH_REASON);
1010
1055
  const approvedCall = PHONE_APPROVAL_SOURCE ? takePhoneApproval(PHONE_APPROVAL_SOURCE, input) : void 0;
1011
1056
  const preToolUseAllowLeftThePrompt = PHONE_APPROVAL_SOURCE !== null && (verdict.kind === "allow" || approvedCall !== void 0);
@@ -1014,7 +1059,7 @@ var handlePermissionRequest = async (input, canonical, holdBudgetSeconds) => {
1014
1059
  const scopeQuestion = verdict.kind === "gate" && Boolean(verdict.scopeReason);
1015
1060
  const preToolUseRanForTheCall = PRETOOLUSE_HANDLED_TOOLS.has(input.tool_name) && isAdmitted(readAdmissionRules(), "claude", "PreToolUse");
1016
1061
  const preToolUseAskedTheScopeQuestion = scopeQuestion && terminalLive && preToolUseRanForTheCall;
1017
- const preToolUseOwnsTheCall = !scopeQuestion && !preToolUseAllowLeftThePrompt && !claudeAllowlistOwnsCall(gateInput, verdict, input.permission_mode, claudeRules) && (isPermissionRequestOwnedByPreToolUse(input.tool_name, input.permission_mode, shouldDeferToNativeMode) || preToolUseRanForTheCall && approvalRouteOutranksAutoMode(gateInput, verdict, input.permission_mode));
1062
+ const preToolUseOwnsTheCall = !scopeQuestion && !preToolUseAllowLeftThePrompt && !claudeAllowlistOwnsCall(gateInput, verdict, input.permission_mode, claudeRules) && (isPermissionRequestOwnedByPreToolUse(ACTIVE_SOURCE, input.tool_name, input.permission_mode, shouldDeferToNativeMode) || preToolUseRanForTheCall && approvalRouteOutranksAutoMode(gateInput, verdict, input.permission_mode));
1018
1063
  if (!handedOff && (preToolUseAskedTheScopeQuestion || preToolUseOwnsTheCall)) return void 0;
1019
1064
  const terminalLiveDispatch = handedOff ? { holdBudgetSeconds } : void 0;
1020
1065
  switch (verdict.kind) {
@@ -1,33 +1,33 @@
1
1
  import {
2
2
  MANAGED_CLAUDE_SETTINGS_BY_PLATFORM
3
- } from "./chunk-K5NBHOE6.js";
3
+ } from "./chunk-YPGLRH6E.js";
4
4
  import {
5
5
  declinedAgentsFile,
6
6
  readDeclinedAgents
7
- } from "./chunk-IQNM745W.js";
7
+ } from "./chunk-AN7252SG.js";
8
8
  import {
9
9
  OPENCODE_HOOK_BINARY,
10
10
  openCodeConfigDir,
11
11
  openCodePluginFile
12
- } from "./chunk-PWJ76P2L.js";
12
+ } from "./chunk-WXVCXQKB.js";
13
13
  import {
14
14
  openCodePluginArgv
15
- } from "./chunk-3L5DXDPK.js";
15
+ } from "./chunk-H75BEIQN.js";
16
16
  import {
17
17
  liveCursorGateCoverage
18
- } from "./chunk-H3MY3EQP.js";
18
+ } from "./chunk-S7AT7T7H.js";
19
19
  import {
20
20
  compatibleConfigFile,
21
21
  compatibleHookEvents,
22
22
  grokHome,
23
23
  parseConfigDocument
24
- } from "./chunk-R3EIRYON.js";
24
+ } from "./chunk-37EEYMUJ.js";
25
25
  import {
26
26
  DEFAULT_HOOKS_KEY_PATH,
27
27
  GEMINI_HOOK_BINARY,
28
28
  GEMINI_HOOK_EVENTS,
29
29
  hooksAt
30
- } from "./chunk-7VG4JO77.js";
30
+ } from "./chunk-MFNSTUPF.js";
31
31
  import {
32
32
  CODEX_EARLIER_APPROVAL_MATCHERS,
33
33
  CODEX_HOOK_BINARY,
@@ -55,7 +55,7 @@ import {
55
55
  parseHookArgv,
56
56
  parseHookCommand,
57
57
  supportedClaudeEvents
58
- } from "./chunk-MF6FSDM4.js";
58
+ } from "./chunk-WWBOST2M.js";
59
59
  import {
60
60
  readRegularJsonFile,
61
61
  readRegularTextFile
@@ -69,7 +69,7 @@ import {
69
69
  OPENCODE_APPROVAL_EVENT,
70
70
  isRecord,
71
71
  matcherMatchesEveryCall
72
- } from "./chunk-US4LUIFU.js";
72
+ } from "./chunk-DJHPBM5S.js";
73
73
 
74
74
  // src/hook-wiring.ts
75
75
  import { createHash } from "crypto";
@@ -9,7 +9,7 @@ import {
9
9
  installedCodexApp,
10
10
  readCodexAppRuntime,
11
11
  shellQuoted
12
- } from "./chunk-HGVGOGVD.js";
12
+ } from "./chunk-NIYGTZZ4.js";
13
13
  import {
14
14
  CODEX_APP_LAUNCH_AT_LOGIN_VERB,
15
15
  CODEX_APP_LAUNCH_VARIABLE
@@ -19,7 +19,7 @@ import {
19
19
  } from "./chunk-QCGNGEGE.js";
20
20
  import {
21
21
  xml
22
- } from "./chunk-TRXYUOWW.js";
22
+ } from "./chunk-GT4GUCCK.js";
23
23
  import {
24
24
  writeFileAtomic
25
25
  } from "./chunk-PM2NRK6Y.js";
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  RETRY_ACK,
6
6
  refusedReceiptMessage
7
- } from "./chunk-5LIGHRBH.js";
7
+ } from "./chunk-3TGLZAON.js";
8
8
 
9
9
  // src/command-receipts.ts
10
10
  import { randomUUID } from "crypto";
@@ -4,10 +4,10 @@ import {
4
4
  } from "./chunk-55L4JSPA.js";
5
5
  import {
6
6
  fetchAsCredential
7
- } from "./chunk-N73CKAC6.js";
7
+ } from "./chunk-OQVTK7HS.js";
8
8
  import {
9
9
  getBaseUrl
10
- } from "./chunk-TU5DTA2V.js";
10
+ } from "./chunk-LYC7OGLM.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-US4LUIFU.js";
18
+ } from "./chunk-DJHPBM5S.js";
19
19
 
20
20
  // src/transcript-recipient-pin.ts
21
21
  import { createHash } from "crypto";
@@ -2,31 +2,31 @@ import {
2
2
  SIGNED_OUT_ON_MAC_MESSAGE,
3
3
  describeSignedOutKey,
4
4
  readSignedOutDiagnosis
5
- } from "./chunk-HLK3ZELO.js";
5
+ } from "./chunk-HB2EJOEM.js";
6
6
  import {
7
7
  APPROVAL_RULES_PATH
8
- } from "./chunk-PAYK5BD7.js";
8
+ } from "./chunk-OZBNNBZG.js";
9
9
  import {
10
10
  createIo
11
- } from "./chunk-CPV25VW5.js";
11
+ } from "./chunk-6L5Q4I4V.js";
12
12
  import {
13
13
  absoluteUrl,
14
14
  checkApiKey,
15
15
  describeKeyCheck,
16
16
  keyCheckFromResponse
17
- } from "./chunk-OBNVYNPQ.js";
17
+ } from "./chunk-SFXASSHE.js";
18
18
  import {
19
19
  readKeySource
20
- } from "./chunk-YDYKKSFU.js";
20
+ } from "./chunk-NGXZD5B2.js";
21
21
  import {
22
22
  getBaseUrl
23
- } from "./chunk-TU5DTA2V.js";
23
+ } from "./chunk-LYC7OGLM.js";
24
24
  import {
25
25
  EXIT
26
26
  } from "./chunk-BG4HHB7E.js";
27
27
  import {
28
28
  KEY_SCOPE
29
- } from "./chunk-US4LUIFU.js";
29
+ } from "./chunk-DJHPBM5S.js";
30
30
 
31
31
  // src/cli/report-key.ts
32
32
  var { dim, yellow } = createIo();
@@ -27,7 +27,7 @@ import {
27
27
  toolResultErrorText,
28
28
  transcriptTokensIn,
29
29
  transcriptUsageRequest
30
- } from "./chunk-OFKKNHYJ.js";
30
+ } from "./chunk-D3U46VX5.js";
31
31
  import {
32
32
  cancelQuestion,
33
33
  clientErrorKindOf,
@@ -35,44 +35,44 @@ import {
35
35
  reportClientError,
36
36
  sendNotification,
37
37
  waitForAnswer
38
- } from "./chunk-YXLWKFKC.js";
38
+ } from "./chunk-EH7M4CXB.js";
39
39
  import {
40
40
  RETRY_ACK,
41
41
  readCommandAck,
42
42
  refusedReceiptMessage
43
- } from "./chunk-5LIGHRBH.js";
43
+ } from "./chunk-3TGLZAON.js";
44
44
  import {
45
45
  isRetryable,
46
46
  withRetry
47
- } from "./chunk-5JCKVJC6.js";
47
+ } from "./chunk-GHTQ7IAZ.js";
48
48
  import {
49
49
  fetchAsCredential
50
- } from "./chunk-N73CKAC6.js";
50
+ } from "./chunk-OQVTK7HS.js";
51
51
  import {
52
52
  branchFor,
53
53
  projectNameFor,
54
54
  repoKeyFor
55
- } from "./chunk-DNJKQHK2.js";
55
+ } from "./chunk-YH6DJA7F.js";
56
56
  import {
57
57
  getMachineId
58
- } from "./chunk-YFOR2JQQ.js";
58
+ } from "./chunk-5DEG6XEK.js";
59
59
  import {
60
60
  reportedInstallSource
61
- } from "./chunk-LH5JTAAH.js";
61
+ } from "./chunk-3FMW4G3B.js";
62
62
  import {
63
63
  IDLE_PROMPT_NOTIFICATION,
64
64
  NOTIFICATION_PUSH_TYPES,
65
65
  POSTTOOLUSE_MIRROR_ONLY_TOOLS,
66
66
  claudeConfigDir
67
- } from "./chunk-MF6FSDM4.js";
67
+ } from "./chunk-WWBOST2M.js";
68
68
  import {
69
69
  compareVersion,
70
70
  parseVersion
71
- } from "./chunk-GGNKMBCN.js";
71
+ } from "./chunk-PBPF46MM.js";
72
72
  import {
73
73
  getApiKey,
74
74
  getBaseUrl
75
- } from "./chunk-TU5DTA2V.js";
75
+ } from "./chunk-LYC7OGLM.js";
76
76
  import {
77
77
  writeFileAtomic,
78
78
  writeJsonAtomicDurable
@@ -103,7 +103,7 @@ import {
103
103
  resolveAutoResolveOrigin,
104
104
  resolvePolicy,
105
105
  unansweredRefusalReason
106
- } from "./chunk-US4LUIFU.js";
106
+ } from "./chunk-DJHPBM5S.js";
107
107
 
108
108
  // src/pending.ts
109
109
  import { join } from "path";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  pusharyDir
3
- } from "./chunk-MF6FSDM4.js";
3
+ } from "./chunk-WWBOST2M.js";
4
4
  import {
5
5
  readJsonSafe
6
6
  } from "./chunk-PM2NRK6Y.js";
7
7
  import {
8
8
  isRecord
9
- } from "./chunk-US4LUIFU.js";
9
+ } from "./chunk-DJHPBM5S.js";
10
10
 
11
11
  // src/process-ownership.ts
12
12
  import { createHash, randomUUID } from "crypto";
@@ -3,7 +3,7 @@ import {
3
3
  formatVersion,
4
4
  quoteIfNeeded,
5
5
  shellDoubleQuoted
6
- } from "./chunk-GGNKMBCN.js";
6
+ } from "./chunk-PBPF46MM.js";
7
7
  import {
8
8
  writeFileAtomic
9
9
  } from "./chunk-PM2NRK6Y.js";
@@ -22,7 +22,7 @@ import {
22
22
  PUSHARY_HOSTS,
23
23
  PUSHARY_TOOL_PREFIX,
24
24
  withHookHoldBudget
25
- } from "./chunk-US4LUIFU.js";
25
+ } from "./chunk-DJHPBM5S.js";
26
26
 
27
27
  // src/setup/paths.ts
28
28
  import { createHash as createHash2 } from "crypto";
@@ -10,17 +10,17 @@ import {
10
10
  openCodePluginArgv,
11
11
  openCodePluginModule,
12
12
  renderOpenCodePlugin
13
- } from "./chunk-3L5DXDPK.js";
13
+ } from "./chunk-H75BEIQN.js";
14
14
  import {
15
15
  compatibleConfigFile
16
- } from "./chunk-R3EIRYON.js";
16
+ } from "./chunk-37EEYMUJ.js";
17
17
  import {
18
18
  hookOwnerOf,
19
19
  hookOwnerOfCommands
20
- } from "./chunk-7VG4JO77.js";
20
+ } from "./chunk-MFNSTUPF.js";
21
21
  import {
22
22
  AGENT_CHOICES
23
- } from "./chunk-HUJWZIQ2.js";
23
+ } from "./chunk-ACWLYAEM.js";
24
24
  import {
25
25
  OPENCODE_INSTRUCTIONS_LABEL,
26
26
  bridgeStub,
@@ -34,7 +34,7 @@ import {
34
34
  resolveBridgeStub,
35
35
  vscodePluginDir,
36
36
  windowsNodeLauncherFor
37
- } from "./chunk-MF6FSDM4.js";
37
+ } from "./chunk-WWBOST2M.js";
38
38
  import {
39
39
  readJsonSafe
40
40
  } from "./chunk-PM2NRK6Y.js";
@@ -44,7 +44,7 @@ import {
44
44
  OPENCODE_APPROVAL_EVENT,
45
45
  hookCompatibleProfile,
46
46
  isRecord
47
- } from "./chunk-US4LUIFU.js";
47
+ } from "./chunk-DJHPBM5S.js";
48
48
 
49
49
  // src/opencode-config.ts
50
50
  import { existsSync, mkdirSync, readdirSync, readFileSync, rmSync, writeFileSync } from "fs";
@@ -5,13 +5,13 @@ import {
5
5
  } from "./chunk-OYIN77HO.js";
6
6
  import {
7
7
  readMacAppAgentKey
8
- } from "./chunk-Z6YRFNN3.js";
8
+ } from "./chunk-GVMPWNPA.js";
9
9
  import {
10
10
  API_KEYS_PATH
11
- } from "./chunk-PAYK5BD7.js";
11
+ } from "./chunk-OZBNNBZG.js";
12
12
  import {
13
13
  absoluteUrl
14
- } from "./chunk-OBNVYNPQ.js";
14
+ } from "./chunk-SFXASSHE.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-YDYKKSFU.js";
24
+ } from "./chunk-NGXZD5B2.js";
25
25
  import {
26
26
  isValidApiKey
27
- } from "./chunk-US4LUIFU.js";
27
+ } from "./chunk-DJHPBM5S.js";
28
28
 
29
29
  // src/cli/held-key-revocation.ts
30
30
  var readCliHeldKeys = (profiles) => {
@@ -6,7 +6,7 @@ import {
6
6
  DISCONNECT_AGENT_IDS,
7
7
  SETUP_AGENT_CHOICES,
8
8
  isApprovalMode
9
- } from "./chunk-US4LUIFU.js";
9
+ } from "./chunk-DJHPBM5S.js";
10
10
 
11
11
  // src/cli/mode-request.ts
12
12
  var parseDuration = (value) => {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isSafeReadOnlyCommand
3
- } from "./chunk-US4LUIFU.js";
3
+ } from "./chunk-DJHPBM5S.js";
4
4
 
5
5
  // src/ledger.ts
6
6
  import { appendFileSync, existsSync, mkdirSync, readFileSync, renameSync, rmSync, statSync } from "fs";
@@ -2,7 +2,7 @@ import {
2
2
  localRepoKey,
3
3
  normalizeRepoRemote,
4
4
  parseGitBranch
5
- } from "./chunk-US4LUIFU.js";
5
+ } from "./chunk-DJHPBM5S.js";
6
6
 
7
7
  // src/repo.ts
8
8
  import { existsSync, readFileSync, statSync } from "fs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ensureCodexTrustsPusharyHooks
3
- } from "./chunk-A3YA4EIY.js";
3
+ } from "./chunk-NW4M5WK6.js";
4
4
  import {
5
5
  hermesReceiptPaths,
6
6
  hermesSetupPredatesThePluginFolder,
@@ -9,7 +9,7 @@ import {
9
9
  refreshHermesPluginFiles,
10
10
  refreshOpenClawPlugin,
11
11
  shippedHermesPlugin
12
- } from "./chunk-GPHESUOZ.js";
12
+ } from "./chunk-G74JB53L.js";
13
13
  import {
14
14
  fxIgnoresInstructionsFile,
15
15
  fxInstructionsBody,
@@ -18,7 +18,7 @@ import {
18
18
  macAppFxBridge,
19
19
  refreshClineKey,
20
20
  switchFxHttpEntryToBridge
21
- } from "./chunk-PZNVSYIY.js";
21
+ } from "./chunk-B7S5NLZB.js";
22
22
  import {
23
23
  OPENCODE_HOOK_BINARY,
24
24
  agentHookOwner,
@@ -31,16 +31,16 @@ import {
31
31
  openCodePluginDir,
32
32
  openCodeWired,
33
33
  withOpenCodeAskRules
34
- } from "./chunk-PWJ76P2L.js";
34
+ } from "./chunk-WXVCXQKB.js";
35
35
  import {
36
36
  detectClaudeVersion
37
- } from "./chunk-FPF7ZSH5.js";
37
+ } from "./chunk-CZQGXJQY.js";
38
38
  import {
39
39
  addCompatibleHooks,
40
40
  compatibleConfigFile,
41
41
  compatibleInstructionsFile,
42
42
  hasCompatibleHooks
43
- } from "./chunk-R3EIRYON.js";
43
+ } from "./chunk-37EEYMUJ.js";
44
44
  import {
45
45
  GEMINI_HOOK_BINARY,
46
46
  addGeminiHooks,
@@ -52,10 +52,10 @@ import {
52
52
  geminiWired,
53
53
  hasGeminiHooks,
54
54
  planHooks
55
- } from "./chunk-7VG4JO77.js";
55
+ } from "./chunk-MFNSTUPF.js";
56
56
  import {
57
57
  KEY_FILE_MODE
58
- } from "./chunk-YDYKKSFU.js";
58
+ } from "./chunk-NGXZD5B2.js";
59
59
  import {
60
60
  CLAUDE_CODE_PUSHARY_PERMISSION_RULES,
61
61
  CLAUDE_HOOK_BINARY,
@@ -102,13 +102,13 @@ import {
102
102
  renderAgentInstructions,
103
103
  supportedClaudeEvents,
104
104
  vscodePluginMcp
105
- } from "./chunk-MF6FSDM4.js";
105
+ } from "./chunk-WWBOST2M.js";
106
106
  import {
107
107
  formatVersion,
108
108
  hookCommandsUseBareNames,
109
109
  resolveGlobalBinDir,
110
110
  resolveGlobalBinary
111
- } from "./chunk-GGNKMBCN.js";
111
+ } from "./chunk-PBPF46MM.js";
112
112
  import {
113
113
  readJsonSafe,
114
114
  writeFileAtomic,
@@ -118,7 +118,7 @@ import {
118
118
  HOOK_COMPATIBLE_PROFILES,
119
119
  isCompatibleAgentType,
120
120
  isRecord
121
- } from "./chunk-US4LUIFU.js";
121
+ } from "./chunk-DJHPBM5S.js";
122
122
 
123
123
  // src/reapply.ts
124
124
  import { dirname, join } from "path";