pushary 1.9.36 → 1.9.37

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 (101) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/dist/bin/pushary-bell-hook.js +25 -25
  3. package/dist/bin/pushary-bell.js +9 -9
  4. package/dist/bin/pushary-claude.js +24 -24
  5. package/dist/bin/pushary-clean.js +29 -29
  6. package/dist/bin/pushary-codex-bridge.js +17 -17
  7. package/dist/bin/pushary-codex-hook.js +65 -41
  8. package/dist/bin/pushary-codex.js +12 -12
  9. package/dist/bin/pushary-connect.js +24 -24
  10. package/dist/bin/pushary-cowork.js +5 -5
  11. package/dist/bin/pushary-daemon.js +32 -32
  12. package/dist/bin/pushary-disconnect.js +24 -24
  13. package/dist/bin/pushary-doctor.js +33 -33
  14. package/dist/bin/pushary-elicitation-hook.js +25 -25
  15. package/dist/bin/pushary-gemini-bridge.js +13 -13
  16. package/dist/bin/pushary-gemini-hook.js +27 -27
  17. package/dist/bin/pushary-hook.js +29 -29
  18. package/dist/bin/pushary-login.js +12 -12
  19. package/dist/bin/pushary-logout.js +24 -24
  20. package/dist/bin/pushary-mcp.js +9 -9
  21. package/dist/bin/pushary-mode.js +12 -12
  22. package/dist/bin/pushary-notification-hook.js +24 -24
  23. package/dist/bin/pushary-opencode-hook.js +26 -26
  24. package/dist/bin/pushary-permission-denied-hook.js +29 -29
  25. package/dist/bin/pushary-permission-hook.js +28 -28
  26. package/dist/bin/pushary-post-hook.js +24 -24
  27. package/dist/bin/pushary-prompt-hook.js +24 -24
  28. package/dist/bin/pushary-session-end-hook.js +24 -24
  29. package/dist/bin/pushary-session-start-hook.js +28 -28
  30. package/dist/bin/pushary-setup.js +35 -35
  31. package/dist/bin/pushary-stats.js +5 -5
  32. package/dist/bin/pushary-status.js +26 -26
  33. package/dist/bin/pushary-stop-hook.js +24 -24
  34. package/dist/bin/pushary-stopfailure-hook.js +24 -24
  35. package/dist/bin/pushary-suggestions.js +12 -12
  36. package/dist/bin/pushary-transcript-register.js +17 -17
  37. package/dist/bin/pushary-transcripts.js +7 -7
  38. package/dist/bin/pushary-upgrade.js +30 -30
  39. package/dist/bin/pushary-wait.js +12 -12
  40. package/dist/bin/pushary.js +6 -6
  41. package/dist/{chunk-2DZBIELP.js → chunk-235LKHLW.js} +166 -67
  42. package/dist/{chunk-RYXSY3RH.js → chunk-2WZJHJAB.js} +5 -5
  43. package/dist/{chunk-GTEF64CJ.js → chunk-3Y73MQPF.js} +1 -1
  44. package/dist/{chunk-JAA7YJJZ.js → chunk-4OQHT5IJ.js} +4 -4
  45. package/dist/{chunk-ULDOQF4Q.js → chunk-6SYU5LVK.js} +3 -3
  46. package/dist/{chunk-DC6KHRVH.js → chunk-6VUVVVVN.js} +1 -1
  47. package/dist/{chunk-PRKH662J.js → chunk-AZXPJLKC.js} +1 -1
  48. package/dist/{chunk-CHNSFTD5.js → chunk-B7SE22M7.js} +2 -2
  49. package/dist/{chunk-ML42WKI7.js → chunk-DG5QHKJA.js} +3 -3
  50. package/dist/{chunk-GNESC5EF.js → chunk-DYALNCS6.js} +3 -3
  51. package/dist/{chunk-4E4PZQFE.js → chunk-EK6PRPCY.js} +4 -4
  52. package/dist/{chunk-Y5FCB66K.js → chunk-F3J6JFR2.js} +5 -5
  53. package/dist/{chunk-MBBPLF5T.js → chunk-FFRH7KZP.js} +2 -2
  54. package/dist/{chunk-TRNSODJ6.js → chunk-GKTVIN4F.js} +1 -1
  55. package/dist/{chunk-YRAPCLOB.js → chunk-GQSJVYKN.js} +6 -6
  56. package/dist/{chunk-VRALPR4B.js → chunk-GSP7CC52.js} +4 -4
  57. package/dist/{chunk-5S2P2CK6.js → chunk-GUHM2UQO.js} +2 -2
  58. package/dist/{chunk-FBKGGIFB.js → chunk-HA22GGDG.js} +5 -5
  59. package/dist/{chunk-CHWJ7ZXI.js → chunk-HJF57K2U.js} +5 -5
  60. package/dist/{chunk-J36W6ARB.js → chunk-HK2RPWAD.js} +1 -1
  61. package/dist/{chunk-QPUTCMAK.js → chunk-HQR6DYVG.js} +1 -1
  62. package/dist/{chunk-55XIK7YS.js → chunk-ISNGKZG4.js} +1 -1
  63. package/dist/{chunk-ETGGQWBR.js → chunk-JLQV3XLV.js} +4 -4
  64. package/dist/{chunk-EH635XAR.js → chunk-JMLJHKJN.js} +2 -2
  65. package/dist/{chunk-SHLLDMPM.js → chunk-KHLYOIPY.js} +4 -4
  66. package/dist/{chunk-RNRCOOQZ.js → chunk-KZ3XE3JG.js} +34 -109
  67. package/dist/{chunk-H3MOTS2C.js → chunk-MAGB6VW6.js} +1 -1
  68. package/dist/{chunk-42FTY5II.js → chunk-N5WEEYV6.js} +3 -3
  69. package/dist/{chunk-7GQILLZD.js → chunk-NDQXKLGE.js} +5 -5
  70. package/dist/{chunk-NE5OPCD5.js → chunk-NPE44CX4.js} +4 -4
  71. package/dist/{chunk-CRZ4CP7C.js → chunk-NWSWP3KY.js} +3 -3
  72. package/dist/{chunk-UDHT3W7I.js → chunk-OSLC7G3D.js} +2 -2
  73. package/dist/{chunk-HCKBZYBW.js → chunk-PDDJKGIW.js} +2 -2
  74. package/dist/chunk-PDRKQSC6.js +184 -0
  75. package/dist/{chunk-X4BPD5RD.js → chunk-PYWLW7PC.js} +1 -1
  76. package/dist/{chunk-4NMDFPK7.js → chunk-Q3TCLMYC.js} +5 -5
  77. package/dist/{chunk-EQXMVKKD.js → chunk-Q52PBCN7.js} +1 -1
  78. package/dist/{chunk-U2PUHT4W.js → chunk-QUKATQ66.js} +1 -1
  79. package/dist/{chunk-K5X25GUV.js → chunk-RFIHLLRH.js} +9 -6
  80. package/dist/{chunk-5ML6E3L7.js → chunk-SNI4FGOV.js} +1 -1
  81. package/dist/{chunk-556JCOMK.js → chunk-SNUNAIKK.js} +4 -4
  82. package/dist/{chunk-CRZKFEEO.js → chunk-T2NKNQPM.js} +2 -2
  83. package/dist/{chunk-F5W7B7YT.js → chunk-UEIL72RN.js} +1 -1
  84. package/dist/{chunk-KCUTE3EB.js → chunk-UK3WY3LE.js} +2 -2
  85. package/dist/{chunk-QHL3Y6D2.js → chunk-UKCGR5T2.js} +2 -2
  86. package/dist/{chunk-L25KSDIB.js → chunk-V7Q7DQXL.js} +8 -8
  87. package/dist/{chunk-EGTVN6YV.js → chunk-VA36Q6BD.js} +1 -1
  88. package/dist/{chunk-JWURAYXK.js → chunk-VMIDUNOT.js} +2 -2
  89. package/dist/{chunk-6LKIK7V2.js → chunk-W73URGML.js} +8 -8
  90. package/dist/{chunk-LL256PHP.js → chunk-WXA3CFZR.js} +1 -1
  91. package/dist/{chunk-26AEFJSK.js → chunk-YNJ372JU.js} +2 -2
  92. package/dist/{chunk-BS64ZHTB.js → chunk-Z5ORWTY3.js} +3 -3
  93. package/dist/{chunk-7MOFAAZ3.js → chunk-ZMR3DSMH.js} +4 -4
  94. package/dist/{chunk-IPYCRJGM.js → chunk-ZQD6GVS7.js} +7 -7
  95. package/dist/{global-upgrade-EF6RZBPU.js → global-upgrade-R57HCUTC.js} +6 -6
  96. package/dist/{paths-F645XTFZ.js → paths-G2AYNZCD.js} +2 -2
  97. package/dist/{reapply-HJOTWJAN.js → reapply-FHCOPXEN.js} +20 -20
  98. package/dist/src/index.js +19 -19
  99. package/dist/{upgrade-lock-APUN7YKQ.js → upgrade-lock-3I7AF7E3.js} +3 -3
  100. package/package.json +1 -1
  101. package/dist/chunk-MNXHKEXB.js +0 -71
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  macAppBridgeAvailable
3
- } from "./chunk-CHWJ7ZXI.js";
3
+ } from "./chunk-HJF57K2U.js";
4
4
  import {
5
5
  keyPrefix
6
- } from "./chunk-42FTY5II.js";
6
+ } from "./chunk-N5WEEYV6.js";
7
7
  import {
8
8
  bridgeAgentKey
9
- } from "./chunk-K5X25GUV.js";
9
+ } from "./chunk-RFIHLLRH.js";
10
10
  import {
11
11
  readJsonSafe
12
12
  } from "./chunk-AQFEP65J.js";
13
13
  import {
14
14
  isValidApiKey
15
- } from "./chunk-2DZBIELP.js";
15
+ } from "./chunk-235LKHLW.js";
16
16
 
17
17
  // src/shared-mcp-key.ts
18
18
  var asRecord = (value) => value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0;
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  configFilePath
3
- } from "./chunk-PRKH662J.js";
3
+ } from "./chunk-AZXPJLKC.js";
4
4
  import {
5
5
  normalizeInstallSource
6
- } from "./chunk-2DZBIELP.js";
6
+ } from "./chunk-235LKHLW.js";
7
7
 
8
8
  // src/install-source.ts
9
9
  import { readFileSync } from "fs";
@@ -5,18 +5,18 @@ import {
5
5
  import {
6
6
  SubscriptionRequiredError,
7
7
  callMcpTool
8
- } from "./chunk-BS64ZHTB.js";
8
+ } from "./chunk-Z5ORWTY3.js";
9
9
  import {
10
10
  installNetworkDefaults,
11
11
  isNetworkFailure
12
- } from "./chunk-CRZ4CP7C.js";
12
+ } from "./chunk-NWSWP3KY.js";
13
13
  import {
14
14
  clientReportClaims
15
- } from "./chunk-K5X25GUV.js";
15
+ } from "./chunk-RFIHLLRH.js";
16
16
  import {
17
17
  getApiKey,
18
18
  getBaseUrl
19
- } from "./chunk-PRKH662J.js";
19
+ } from "./chunk-AZXPJLKC.js";
20
20
  import {
21
21
  ASK_AGENT_NAME_MAX,
22
22
  CLIENT_REPORT_PATH,
@@ -24,7 +24,7 @@ import {
24
24
  GATE_PERMISSION_MODE_MAX_LENGTH,
25
25
  degradedLine,
26
26
  truncateLine
27
- } from "./chunk-2DZBIELP.js";
27
+ } from "./chunk-235LKHLW.js";
28
28
 
29
29
  // src/client-report-claim.ts
30
30
  import { createHash } from "crypto";
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  compatibleConfigFile
3
- } from "./chunk-SHLLDMPM.js";
3
+ } from "./chunk-KHLYOIPY.js";
4
4
  import {
5
5
  hookOwnerOf,
6
6
  hookOwnerOfCommands,
7
7
  liveBridgeProbe,
8
8
  resolveBridgeStub
9
- } from "./chunk-4NMDFPK7.js";
9
+ } from "./chunk-Q3TCLMYC.js";
10
10
  import {
11
11
  AGENT_CHOICES
12
- } from "./chunk-EQXMVKKD.js";
12
+ } from "./chunk-Q52PBCN7.js";
13
13
  import {
14
14
  claudeSettings,
15
15
  codexHooksJson,
@@ -18,7 +18,7 @@ import {
18
18
  guardedArgv,
19
19
  pusharyDir,
20
20
  vscodePluginDir
21
- } from "./chunk-K5X25GUV.js";
21
+ } from "./chunk-RFIHLLRH.js";
22
22
  import {
23
23
  readJsonSafe
24
24
  } from "./chunk-AQFEP65J.js";
@@ -29,7 +29,7 @@ import {
29
29
  OPENCODE_APPROVAL_EVENT,
30
30
  hookCompatibleProfile,
31
31
  isRecord
32
- } from "./chunk-2DZBIELP.js";
32
+ } from "./chunk-235LKHLW.js";
33
33
 
34
34
  // src/opencode-plugin.ts
35
35
  var OPENCODE_PLUGIN_MARKER = "pushary-opencode-plugin w1";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isSafeReadOnlyCommand
3
- } from "./chunk-2DZBIELP.js";
3
+ } from "./chunk-235LKHLW.js";
4
4
 
5
5
  // src/ledger.ts
6
6
  import { appendFileSync, existsSync, mkdirSync, readFileSync, renameSync, rmSync, statSync } from "fs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  readTranscriptPreference
3
- } from "./chunk-42FTY5II.js";
3
+ } from "./chunk-N5WEEYV6.js";
4
4
 
5
5
  // src/transcript-setting.ts
6
6
  var transcriptEnvironmentPreference = () => {
@@ -2,7 +2,7 @@ import {
2
2
  autoUpdateLock,
3
3
  installPackageGlobally,
4
4
  npmErrorMessage
5
- } from "./chunk-K5X25GUV.js";
5
+ } from "./chunk-RFIHLLRH.js";
6
6
  import {
7
7
  writeJsonAtomic
8
8
  } from "./chunk-AQFEP65J.js";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  MCP_BRIDGE_BINARY
3
- } from "./chunk-KCUTE3EB.js";
3
+ } from "./chunk-UK3WY3LE.js";
4
4
  import {
5
5
  KEY_FILE_MODE
6
- } from "./chunk-42FTY5II.js";
6
+ } from "./chunk-N5WEEYV6.js";
7
7
  import {
8
8
  NpmMissingError,
9
9
  NpmPermissionError
10
- } from "./chunk-K5X25GUV.js";
10
+ } from "./chunk-RFIHLLRH.js";
11
11
  import {
12
12
  readJsonSafe,
13
13
  writeFileAtomic,
@@ -15,7 +15,7 @@ import {
15
15
  } from "./chunk-AQFEP65J.js";
16
16
  import {
17
17
  NPX_LATEST_COMMAND
18
- } from "./chunk-LL256PHP.js";
18
+ } from "./chunk-WXA3CFZR.js";
19
19
 
20
20
  // src/instruction-file.ts
21
21
  import { existsSync, readFileSync, writeFileSync, mkdirSync, rmSync } from "fs";
@@ -3,10 +3,10 @@ import {
3
3
  } from "./chunk-KZERVKTD.js";
4
4
  import {
5
5
  renderCommandHelp
6
- } from "./chunk-LL256PHP.js";
6
+ } from "./chunk-WXA3CFZR.js";
7
7
  import {
8
8
  getPackageVersion
9
- } from "./chunk-2DZBIELP.js";
9
+ } from "./chunk-235LKHLW.js";
10
10
 
11
11
  // src/cli/usage.ts
12
12
  var exitOnHelpFlag = (command) => {
@@ -3,18 +3,18 @@ import {
3
3
  addGeminiMcpServer,
4
4
  removeGeminiMcpServer,
5
5
  supportedClaudeEvents
6
- } from "./chunk-ULDOQF4Q.js";
6
+ } from "./chunk-6SYU5LVK.js";
7
7
  import {
8
8
  CLAUDE_CODE_AGENT,
9
9
  compatibleToolLookup
10
- } from "./chunk-6LKIK7V2.js";
10
+ } from "./chunk-W73URGML.js";
11
11
  import {
12
12
  guardBinary,
13
13
  guardBinaryRefusing,
14
14
  holdBudgetOf,
15
15
  isProtectedByScope,
16
16
  registerHookEntry
17
- } from "./chunk-K5X25GUV.js";
17
+ } from "./chunk-RFIHLLRH.js";
18
18
  import {
19
19
  HOOK_LOCATOR_BINARY,
20
20
  PHONE_ANSWERED_TOOLS,
@@ -25,7 +25,7 @@ import {
25
25
  pusharyMissingReason,
26
26
  refusalOutput,
27
27
  withHookHoldBudget
28
- } from "./chunk-2DZBIELP.js";
28
+ } from "./chunk-235LKHLW.js";
29
29
 
30
30
  // src/claude-config.ts
31
31
  import { join } from "path";
@@ -1,20 +1,22 @@
1
1
  import {
2
+ askAgentQuestions,
2
3
  defersToNativeMode,
3
- reportMachineDenial
4
- } from "./chunk-MNXHKEXB.js";
4
+ outcomeOfFailedAsk,
5
+ reportMachineDenial,
6
+ storedWaitDeadline
7
+ } from "./chunk-PDRKQSC6.js";
5
8
  import {
6
9
  isGatingMoment,
7
10
  recordKeylessMoment
8
- } from "./chunk-J36W6ARB.js";
11
+ } from "./chunk-HK2RPWAD.js";
9
12
  import {
10
- announceSubscriptionRequired,
11
13
  isDeferAnswer,
12
14
  oncePerSession
13
- } from "./chunk-DC6KHRVH.js";
15
+ } from "./chunk-6VUVVVVN.js";
14
16
  import {
15
17
  activeHookSource,
16
18
  activeIdentity
17
- } from "./chunk-SHLLDMPM.js";
19
+ } from "./chunk-KHLYOIPY.js";
18
20
  import {
19
21
  DEFAULT_SESSION,
20
22
  UNNAMED_ACTION,
@@ -39,7 +41,7 @@ import {
39
41
  reportEvent,
40
42
  scopePathFor,
41
43
  settleQuestionsForToolUse
42
- } from "./chunk-6LKIK7V2.js";
44
+ } from "./chunk-W73URGML.js";
43
45
  import {
44
46
  askUser,
45
47
  cancelQuestion,
@@ -52,22 +54,20 @@ import {
52
54
  sendNotification,
53
55
  waitForQuestion,
54
56
  waitsForThePhone
55
- } from "./chunk-FBKGGIFB.js";
56
- import {
57
- SubscriptionRequiredError
58
- } from "./chunk-BS64ZHTB.js";
57
+ } from "./chunk-HA22GGDG.js";
59
58
  import {
60
59
  getMachineId
61
- } from "./chunk-EGTVN6YV.js";
60
+ } from "./chunk-VA36Q6BD.js";
62
61
  import {
63
62
  getApiKey,
64
63
  getBaseUrl
65
- } from "./chunk-PRKH662J.js";
64
+ } from "./chunk-AZXPJLKC.js";
66
65
  import {
67
66
  NPX_LATEST_COMMAND
68
- } from "./chunk-LL256PHP.js";
67
+ } from "./chunk-WXA3CFZR.js";
69
68
  import {
70
69
  AGENT_QUESTION_STRATEGY,
70
+ AGENT_QUESTION_TOOL,
71
71
  DECISION_STOP_REASON,
72
72
  GATE_BLOCK_REASON_MAX_LENGTH,
73
73
  GATE_WIRE,
@@ -104,13 +104,12 @@ import {
104
104
  isBlockedActionRequest,
105
105
  isPermissionRequestOwnedByPreToolUse,
106
106
  isPusharyOwnTool,
107
- parseAgentQuestionAnswers,
108
107
  parseAgentQuestions,
109
108
  questionHandedToTheTerminal,
110
109
  resolveGate,
111
110
  timeoutActionWithoutLocalPrompt,
112
111
  unansweredRefusalReason
113
- } from "./chunk-2DZBIELP.js";
112
+ } from "./chunk-235LKHLW.js";
114
113
 
115
114
  // src/claude-permission-rules.ts
116
115
  import { readFileSync, statSync } from "fs";
@@ -191,16 +190,7 @@ var allowWithInput = (updatedInput) => claudePreToolUseOutput("allow", void 0, u
191
190
  var ask = (reason) => claudePreToolUseOutput("ask", reason);
192
191
  var halted = (reason) => claudeStoppedPreToolUseOutput(reason);
193
192
  var undecidedCall = (reason) => PUSHARY_IS_SOLE_GATE ? deny(reason) : void 0;
194
- var outcomeOfFailedAsk = (error, sessionId, failure) => {
195
- if (!(error instanceof SubscriptionRequiredError)) return failure;
196
- announceSubscriptionRequired(error.upgradeUrl, sessionId);
197
- return void 0;
198
- };
199
193
  var outcomeOfFailedPermissionAsk = (error, sessionId) => outcomeOfFailedAsk(error, sessionId, halted(UNVERIFIABLE_APPROVAL_REASON)) ?? undecidedCall(SOLE_GATE_SUBSCRIPTION_REASON);
200
- var storedWaitDeadline = (result, requestedDeadline) => {
201
- const stored = result.waitEndsAt ? Date.parse(result.waitEndsAt) : Number.NaN;
202
- return Number.isFinite(stored) ? Math.min(stored, requestedDeadline) : requestedDeadline;
203
- };
204
194
  var handlePushOnly = async (apiKey, description, projectName, timeoutSeconds, timeoutAction, sessionId, machineId, toolName, toolTarget, decision, signals) => {
205
195
  const effectiveWait = effectiveWaitSeconds(timeoutAction, timeoutSeconds, "claude");
206
196
  const now = Date.now();
@@ -393,94 +383,29 @@ var keylessNoticeOnce = (sessionId) => {
393
383
  }
394
384
  };
395
385
  var shouldDeferToNativeMode = defersToNativeMode;
396
- var withLabels = (question) => ({
397
- ...question,
398
- labels: question.options.map((option) => option.label)
399
- });
400
- var withoutLabels = ({ labels: _, ...question }) => question;
401
- var parseQuestions = (toolInput) => parseAgentQuestions(toolInput)?.map(withLabels);
402
- var questionContext = (question, index, total, project) => {
403
- const subject = question.header ? `${question.header}: your agent is asking in ${project}` : `Your agent is asking in ${project}`;
404
- return total > 1 ? `${subject} (${index + 1} of ${total})` : subject;
405
- };
406
- var askAsOneCard = async (apiKey, input, parsed, projectName, deadline) => {
407
- const only = parsed[0];
408
- let result;
409
- try {
410
- result = await askUser(apiKey, {
411
- question: only.question,
412
- type: "select",
413
- options: [...only.labels],
414
- questions: parsed.map(withoutLabels),
415
- context: questionContext(only, 0, 1, projectName),
416
- agentName: agentNameIn(projectName),
417
- sessionId: input.session_id,
418
- machineId: getMachineId(),
419
- toolName: "AskUserQuestion",
420
- toolUseId: input.tool_use_id,
421
- waitEndsAt: new Date(deadline).toISOString()
422
- });
423
- } catch (error) {
424
- return outcomeOfFailedAsk(error, input.session_id, null);
425
- }
426
- if (isDecisionStopped(result)) return null;
427
- const answer = await waitForQuestion(apiKey, result, storedWaitDeadline(result, deadline));
428
- if (isDecisionStopped(answer)) return null;
429
- const values = answer.answered && answer.value ? parseAgentQuestionAnswers(parsed, answer.value) : null;
430
- if (!values || isDeferAnswer(answer.value)) {
431
- return void 0;
432
- }
433
- return values;
434
- };
435
- var askQuestionByQuestion = async (apiKey, input, parsed, projectName, deadline) => {
436
- const answers = {};
437
- for (const [index, question] of parsed.entries()) {
438
- let result;
439
- try {
440
- result = await askUser(apiKey, {
441
- question: question.question,
442
- type: "select",
443
- options: [...question.labels],
444
- questions: [withoutLabels(question)],
445
- context: questionContext(question, index, parsed.length, projectName),
446
- agentName: agentNameIn(projectName),
447
- sessionId: input.session_id,
448
- machineId: getMachineId(),
449
- toolName: "AskUserQuestion",
450
- // One AskUserQuestion call raises several questions, and their payload
451
- // fingerprints are identical (same tool, no target, no body). Without the
452
- // index they would all collapse onto the first decision.
453
- toolUseId: input.tool_use_id ? `${input.tool_use_id}#q${index}` : void 0,
454
- waitEndsAt: new Date(deadline).toISOString()
455
- });
456
- } catch (error) {
457
- return outcomeOfFailedAsk(error, input.session_id, null);
458
- }
459
- if (isDecisionStopped(result)) return null;
460
- const answer = await waitForQuestion(apiKey, result, storedWaitDeadline(result, deadline));
461
- if (isDecisionStopped(answer)) return null;
462
- const legacyValue = answer.answered ? answer.value?.trim() : void 0;
463
- const values = legacyValue ? parseAgentQuestionAnswers([question], legacyValue) ?? parseAgentQuestionAnswers([question], JSON.stringify({
464
- [question.question]: question.multiSelect ? JSON.stringify([legacyValue]) : legacyValue
465
- })) : null;
466
- const value = values?.[question.question];
467
- if (!value || isDeferAnswer(answer.value)) {
468
- return void 0;
469
- }
470
- answers[question.question] = value;
471
- }
472
- return answers;
473
- };
474
386
  var handleAskUserQuestion = async (apiKey, input, modeState) => {
475
387
  if (questionHandedToTheTerminal(input.tool_name, modeState)) return void 0;
476
- const parsed = parseQuestions(input.tool_input ?? {});
477
- if (!parsed) return void 0;
388
+ const questions = parseAgentQuestions(input.tool_input ?? {});
389
+ if (!questions) return void 0;
478
390
  const projectName = basename(input.cwd ?? process.cwd());
479
391
  const deadline = hookWaitDeadline(START_MS, effectiveWaitSeconds("wait", 0, "claude"), "claude", Date.now());
480
- const answers = parsed.length === 1 ? await askAsOneCard(apiKey, input, parsed, projectName, deadline) : await askQuestionByQuestion(apiKey, input, parsed, projectName, deadline);
481
- if (answers === null) return halted(DECISION_STOP_REASON);
482
- if (!answers) return void 0;
483
- return allowWithInput({ ...input.tool_input ?? {}, answers });
392
+ const outcome = await askAgentQuestions(apiKey, {
393
+ toolName: AGENT_QUESTION_TOOL,
394
+ agentName: agentNameIn(projectName),
395
+ projectName,
396
+ sessionId: input.session_id,
397
+ toolUseId: input.tool_use_id,
398
+ deadline
399
+ }, questions);
400
+ switch (outcome.kind) {
401
+ case "answered":
402
+ return allowWithInput({ ...input.tool_input ?? {}, answers: outcome.answers });
403
+ case "stopped":
404
+ case "unavailable":
405
+ return halted(DECISION_STOP_REASON);
406
+ case "unanswered":
407
+ return void 0;
408
+ }
484
409
  };
485
410
  var PLAN_APPROVE = "Approve, start coding";
486
411
  var PLAN_KEEP_PLANNING = "Keep planning";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  redactSecretsFromContent
3
- } from "./chunk-2DZBIELP.js";
3
+ } from "./chunk-235LKHLW.js";
4
4
 
5
5
  // src/crypto.ts
6
6
  import nacl from "tweetnacl";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resolveInstallSourceFor
3
- } from "./chunk-5S2P2CK6.js";
3
+ } from "./chunk-GUHM2UQO.js";
4
4
  import {
5
5
  backupFile,
6
6
  readJsonSafe,
@@ -9,11 +9,11 @@ import {
9
9
  } from "./chunk-AQFEP65J.js";
10
10
  import {
11
11
  configFilePath
12
- } from "./chunk-PRKH662J.js";
12
+ } from "./chunk-AZXPJLKC.js";
13
13
  import {
14
14
  API_KEY_PREFIX_PATTERN,
15
15
  isRecord
16
- } from "./chunk-2DZBIELP.js";
16
+ } from "./chunk-235LKHLW.js";
17
17
 
18
18
  // src/shell-alias.ts
19
19
  import { homedir } from "os";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  APPROVAL_SETTINGS_PATH
3
- } from "./chunk-4E4PZQFE.js";
3
+ } from "./chunk-EK6PRPCY.js";
4
4
  import {
5
5
  readMacAppAgentKey
6
- } from "./chunk-VRALPR4B.js";
6
+ } from "./chunk-GSP7CC52.js";
7
7
  import {
8
8
  findExportedKeyLines,
9
9
  isAdoptedMacAppKey,
@@ -13,13 +13,13 @@ import {
13
13
  readConfigFileKey,
14
14
  readKeySource,
15
15
  readMacAppKeyPrefix
16
- } from "./chunk-42FTY5II.js";
16
+ } from "./chunk-N5WEEYV6.js";
17
17
  import {
18
18
  absoluteUrl
19
- } from "./chunk-GNESC5EF.js";
19
+ } from "./chunk-DYALNCS6.js";
20
20
  import {
21
21
  isValidApiKey
22
- } from "./chunk-2DZBIELP.js";
22
+ } from "./chunk-235LKHLW.js";
23
23
 
24
24
  // src/key-revocation.ts
25
25
  var SELF_REVOKE_PATH = "/api/v1/server/keys/self/revoke";
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  openCodeConfigDirFrom
3
- } from "./chunk-CHWJ7ZXI.js";
3
+ } from "./chunk-HJF57K2U.js";
4
4
  import {
5
5
  grokHome
6
- } from "./chunk-SHLLDMPM.js";
6
+ } from "./chunk-KHLYOIPY.js";
7
7
  import {
8
8
  codexHomeFrom,
9
9
  resolvePathBinary
10
- } from "./chunk-K5X25GUV.js";
10
+ } from "./chunk-RFIHLLRH.js";
11
11
  import {
12
12
  HOOK_COMPATIBLE_PROFILES
13
- } from "./chunk-2DZBIELP.js";
13
+ } from "./chunk-235LKHLW.js";
14
14
 
15
15
  // src/hermes-config.ts
16
16
  import { execFileSync } from "child_process";
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  readExistingMachineId
3
- } from "./chunk-EGTVN6YV.js";
3
+ } from "./chunk-VA36Q6BD.js";
4
4
  import {
5
5
  NetworkError
6
6
  } from "./chunk-7QLSKOSU.js";
7
7
  import {
8
8
  getBaseUrl
9
- } from "./chunk-PRKH662J.js";
9
+ } from "./chunk-AZXPJLKC.js";
10
10
  import {
11
11
  clientContextHeaders,
12
12
  getPackageVersion
13
- } from "./chunk-2DZBIELP.js";
13
+ } from "./chunk-235LKHLW.js";
14
14
 
15
15
  // src/cli/net.ts
16
16
  import { createRequire } from "module";
@@ -3,11 +3,11 @@ import {
3
3
  decodePublicKey,
4
4
  generateSessionKey,
5
5
  wrapSessionKey
6
- } from "./chunk-H3MOTS2C.js";
6
+ } from "./chunk-MAGB6VW6.js";
7
7
  import {
8
8
  fetchTranscriptRecipients,
9
9
  uploadTranscriptRecords
10
- } from "./chunk-X4BPD5RD.js";
10
+ } from "./chunk-PYWLW7PC.js";
11
11
 
12
12
  // src/live-session.ts
13
13
  var MAX_TRANSCRIPT_QUEUE = 100;
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-POFBE6ZY.js";
4
4
  import {
5
5
  autoUpdateState
6
- } from "./chunk-K5X25GUV.js";
6
+ } from "./chunk-RFIHLLRH.js";
7
7
  import {
8
8
  readJsonSafe,
9
9
  writeJsonAtomic
@@ -15,7 +15,7 @@ import {
15
15
  globalUpgradeEntry,
16
16
  isAutoUpdateResult,
17
17
  ownPackageRoot
18
- } from "./chunk-2DZBIELP.js";
18
+ } from "./chunk-235LKHLW.js";
19
19
 
20
20
  // src/auto-update.ts
21
21
  import { spawn } from "child_process";