pushary 1.9.73 → 1.9.76

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 (127) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/{api-JVWXPKEW.js → api-YDCHRRA4.js} +10 -10
  3. package/dist/bin/pushary-bell-hook.js +27 -25
  4. package/dist/bin/pushary-bell.js +14 -14
  5. package/dist/bin/pushary-claude.js +55 -82
  6. package/dist/bin/pushary-clean.js +37 -37
  7. package/dist/bin/pushary-codex-bridge.js +24 -24
  8. package/dist/bin/pushary-codex-hook.js +36 -34
  9. package/dist/bin/pushary-codex-session.js +8 -8
  10. package/dist/bin/pushary-codex.js +15 -15
  11. package/dist/bin/pushary-connect.js +26 -26
  12. package/dist/bin/pushary-cowork.js +5 -5
  13. package/dist/bin/pushary-daemon.js +1293 -63
  14. package/dist/bin/pushary-disconnect.js +31 -31
  15. package/dist/bin/pushary-display-hook.d.ts +1 -0
  16. package/dist/bin/pushary-display-hook.js +58 -0
  17. package/dist/bin/pushary-doctor.js +50 -50
  18. package/dist/bin/pushary-elicitation-hook.js +29 -27
  19. package/dist/bin/pushary-gemini-bridge.js +16 -16
  20. package/dist/bin/pushary-gemini-hook.js +31 -29
  21. package/dist/bin/pushary-hook.js +31 -29
  22. package/dist/bin/pushary-login.js +20 -20
  23. package/dist/bin/pushary-logout.js +30 -30
  24. package/dist/bin/pushary-mcp.js +14 -14
  25. package/dist/bin/pushary-mode.js +18 -18
  26. package/dist/bin/pushary-notification-hook.js +26 -24
  27. package/dist/bin/pushary-opencode-hook.js +30 -28
  28. package/dist/bin/pushary-permission-denied-hook.js +31 -29
  29. package/dist/bin/pushary-permission-hook.js +31 -29
  30. package/dist/bin/pushary-post-hook.js +32 -29
  31. package/dist/bin/pushary-prompt-hook.js +32 -29
  32. package/dist/bin/pushary-session-end-hook.js +28 -26
  33. package/dist/bin/pushary-session-start-hook.js +36 -34
  34. package/dist/bin/pushary-setup.js +66 -282
  35. package/dist/bin/pushary-stats.js +6 -6
  36. package/dist/bin/pushary-status.js +31 -31
  37. package/dist/bin/pushary-stop-hook.js +32 -26
  38. package/dist/bin/pushary-stopfailure-hook.js +26 -24
  39. package/dist/bin/pushary-suggestions.js +18 -18
  40. package/dist/bin/pushary-transcript-register.js +18 -16
  41. package/dist/bin/pushary-transcripts.js +20 -20
  42. package/dist/bin/pushary-upgrade.js +45 -45
  43. package/dist/bin/pushary-wait.js +18 -18
  44. package/dist/bin/pushary.js +7 -7
  45. package/dist/{chunk-F3WI32HG.js → chunk-2BK2EQOB.js} +7 -7
  46. package/dist/{chunk-ZBZBYUNZ.js → chunk-2QFYEB3P.js} +5 -5
  47. package/dist/{chunk-UIF7HWHX.js → chunk-3YU6NIIL.js} +4 -4
  48. package/dist/{chunk-L2FQBHIR.js → chunk-47TIRGS5.js} +2 -2
  49. package/dist/{chunk-AXZ67XVN.js → chunk-4LX5QUFV.js} +1 -1
  50. package/dist/{chunk-YZ6DMGZZ.js → chunk-57MQNSM5.js} +1 -1
  51. package/dist/{chunk-BLX6KRK5.js → chunk-5FV472Q2.js} +1 -1
  52. package/dist/{chunk-VBSPP4QY.js → chunk-5KPMDLXB.js} +3 -3
  53. package/dist/{chunk-S63VIM7E.js → chunk-5M5F4IWR.js} +2 -2
  54. package/dist/{chunk-7FROPPIH.js → chunk-5NW7VM35.js} +2 -2
  55. package/dist/{chunk-EITOMPFB.js → chunk-74ONBRPF.js} +4 -4
  56. package/dist/{chunk-7S46LCKD.js → chunk-7KYQ24FI.js} +3 -2
  57. package/dist/{chunk-NGNBX3YH.js → chunk-7LLC4R66.js} +4 -4
  58. package/dist/{chunk-AC5TVOAH.js → chunk-7SFP6Y5U.js} +373 -93
  59. package/dist/{chunk-CMYFV3VC.js → chunk-7ZOWQBHQ.js} +5 -5
  60. package/dist/{chunk-2QB7HJVJ.js → chunk-B2PFCS72.js} +2 -2
  61. package/dist/{chunk-UUCRWEEU.js → chunk-BUR2LYQI.js} +2 -2
  62. package/dist/{chunk-W47XZJSH.js → chunk-C2AR7QXU.js} +2 -2
  63. package/dist/{chunk-FK3JSDH5.js → chunk-CHIOUBPB.js} +13 -13
  64. package/dist/{chunk-TTGBS5JB.js → chunk-CMNB4IZO.js} +3 -3
  65. package/dist/{chunk-4UIR25GA.js → chunk-CUD6SYDG.js} +1 -1
  66. package/dist/{chunk-WJJVCDEU.js → chunk-DB3NOEDW.js} +6 -6
  67. package/dist/{chunk-PGJMSREY.js → chunk-DZF2M3LM.js} +8 -8
  68. package/dist/{chunk-2NG3ANMT.js → chunk-E2VJ7B7D.js} +9 -9
  69. package/dist/{chunk-S7VMHSJW.js → chunk-E7U4YM4A.js} +5 -5
  70. package/dist/{chunk-XKQ7CQGG.js → chunk-F7R7M5MG.js} +1 -1
  71. package/dist/{chunk-FAKEKFCI.js → chunk-FAGQAR6I.js} +5 -3
  72. package/dist/{chunk-3JJI5O5N.js → chunk-GII565PB.js} +1 -1
  73. package/dist/{chunk-WXV7J3DG.js → chunk-GJVV2EUC.js} +3 -3
  74. package/dist/{chunk-Z7AIYWZ2.js → chunk-IRLHN5UP.js} +236 -20
  75. package/dist/{chunk-NJSW2REO.js → chunk-IRN6JLSM.js} +4 -4
  76. package/dist/{chunk-JC7XUZST.js → chunk-ITLWEGLE.js} +31 -5
  77. package/dist/{chunk-7M4AA7QF.js → chunk-JNV5LOZH.js} +4 -4
  78. package/dist/{chunk-IN3MPEFA.js → chunk-JZ5KV2FK.js} +5 -5
  79. package/dist/{chunk-QAWWTRDD.js → chunk-KGWLDNNT.js} +4 -4
  80. package/dist/{chunk-O4EAMVSC.js → chunk-KWGOKO4E.js} +5 -5
  81. package/dist/{chunk-KDQLKND5.js → chunk-M5VJ3HXB.js} +6 -6
  82. package/dist/{chunk-R5PZPROX.js → chunk-M7JFGDGP.js} +1 -1
  83. package/dist/{chunk-N4VRSFRZ.js → chunk-MAWC4PJV.js} +5 -5
  84. package/dist/chunk-MHUKYYYR.js +239 -0
  85. package/dist/{chunk-56GK65Z6.js → chunk-MMVIKXCP.js} +3 -3
  86. package/dist/{chunk-CGWUVEOB.js → chunk-MTRZQR2R.js} +3 -3
  87. package/dist/{chunk-JYOR57ZW.js → chunk-NFUV25JZ.js} +3 -3
  88. package/dist/{chunk-EUHTC7K5.js → chunk-NJTAUEW6.js} +1 -1
  89. package/dist/{chunk-2JFEMKDG.js → chunk-NQA56AMZ.js} +6 -6
  90. package/dist/{chunk-AJWGZJFS.js → chunk-NVLKH5FS.js} +131 -28
  91. package/dist/{chunk-2HFC4W6J.js → chunk-PPD64MZW.js} +4 -3
  92. package/dist/{chunk-3RAWW5DH.js → chunk-QUGP76DQ.js} +6 -6
  93. package/dist/{chunk-PPKIL4EL.js → chunk-R3HXGHRQ.js} +1 -1
  94. package/dist/{chunk-3QBKMSOZ.js → chunk-S7C5NY4R.js} +1 -1
  95. package/dist/{chunk-EUEGCEA7.js → chunk-SWRNJ3BP.js} +3 -3
  96. package/dist/{chunk-RZVWEDIS.js → chunk-T2EJ3H6Y.js} +3 -3
  97. package/dist/{chunk-DT6VCMXS.js → chunk-TFYFQM5C.js} +2 -2
  98. package/dist/{chunk-GBR6E7AY.js → chunk-UEY4SHY2.js} +1 -1
  99. package/dist/{chunk-TFDMJHAB.js → chunk-UMBVIFP5.js} +1 -1
  100. package/dist/{chunk-TQ2L3ECX.js → chunk-USMUW3LI.js} +2 -2
  101. package/dist/{chunk-VJUDBZGC.js → chunk-USZJJWZL.js} +2 -2
  102. package/dist/{chunk-4LAD5A2Q.js → chunk-VELPOV2F.js} +4 -4
  103. package/dist/{chunk-JNTYPMVU.js → chunk-VZSSL6US.js} +10 -10
  104. package/dist/{chunk-KSLBS3II.js → chunk-W5AUTVVL.js} +6 -5
  105. package/dist/{chunk-OJ3ZD5VX.js → chunk-WK2L3XVQ.js} +1 -1
  106. package/dist/{chunk-PM2MHBMF.js → chunk-WLHHDDVA.js} +9 -4
  107. package/dist/{chunk-U3EBM73X.js → chunk-WRCM4XGY.js} +2 -2
  108. package/dist/{chunk-SQ5XCMPB.js → chunk-XJ5DYPTM.js} +4 -4
  109. package/dist/{chunk-PNXNWZ5P.js → chunk-XLGD5LDG.js} +3 -3
  110. package/dist/{chunk-7RX5TOU3.js → chunk-Y2CYSVWU.js} +6 -6
  111. package/dist/{chunk-AVHL2ZTS.js → chunk-Y4OBAK4I.js} +459 -172
  112. package/dist/{chunk-JWBZUTYF.js → chunk-YDPGBBV7.js} +5 -5
  113. package/dist/{chunk-FB262EOM.js → chunk-YLB4AGZJ.js} +1 -1
  114. package/dist/{chunk-QMPM3CAN.js → chunk-ZY25SNFQ.js} +1 -1
  115. package/dist/{codex-app-cards-switch-M7VH7AZH.js → codex-app-cards-switch-3OUTABVU.js} +11 -11
  116. package/dist/{codex-desktop-launch-6DASTBBA.js → codex-desktop-launch-JH3E2CIA.js} +1 -1
  117. package/dist/{codex-session-launch-2XSMFA4K.js → codex-session-launch-GR363OQN.js} +18 -18
  118. package/dist/{config-7QQOIFTW.js → config-R43UFHX7.js} +3 -3
  119. package/dist/{global-upgrade-XAKX26AN.js → global-upgrade-73GP4MZM.js} +10 -10
  120. package/dist/{identity-7AS5MBNM.js → identity-CA7CZGDL.js} +4 -4
  121. package/dist/{live-capabilities-DV4F7MIB.js → live-capabilities-RCGMQIIZ.js} +5 -5
  122. package/dist/{paths-GSMXYKT5.js → paths-H7VNNB46.js} +3 -3
  123. package/dist/{reapply-MR7UWBXR.js → reapply-3UIA3CUO.js} +27 -27
  124. package/dist/src/index.js +32 -30
  125. package/dist/{upgrade-lock-6OTHLCBZ.js → upgrade-lock-ZTLX5PDF.js} +4 -4
  126. package/dist/{usage-H53PO3VQ.js → usage-C53NVWC2.js} +3 -3
  127. package/package.json +4 -2
@@ -54,9 +54,9 @@ var isAgentQuestionSet = (value) => {
54
54
  const labels = /* @__PURE__ */ new Set();
55
55
  for (const option of question.options) {
56
56
  if (!option || typeof option !== "object" || Array.isArray(option)) return false;
57
- const record3 = option;
58
- const label = record3.label;
59
- if (typeof label !== "string" || label.length === 0 || labels.has(label) || record3.description !== void 0 && typeof record3.description !== "string") return false;
57
+ const record4 = option;
58
+ const label = record4.label;
59
+ if (typeof label !== "string" || label.length === 0 || labels.has(label) || record4.description !== void 0 && typeof record4.description !== "string") return false;
60
60
  labels.add(label);
61
61
  }
62
62
  questions.add(question.question);
@@ -536,9 +536,9 @@ var CANONICAL_COMMAND_KEYS = ["command"];
536
536
  var SHELL_TOOLS = /* @__PURE__ */ new Set([SHELL_TOOL, POWERSHELL_TOOL]);
537
537
  var PATH_TOOLS = /* @__PURE__ */ new Set(["Write", "Edit", "MultiEdit", "NotebookEdit", "Read"]);
538
538
  var PHONE_ANSWERED_TOOLS = /* @__PURE__ */ new Set(["AskUserQuestion", "ExitPlanMode"]);
539
- var firstString = (record3, keys2) => {
539
+ var firstString = (record4, keys2) => {
540
540
  for (const key of keys2) {
541
- const value = record3[key];
541
+ const value = record4[key];
542
542
  if (typeof value === "string" && value.length > 0) return value;
543
543
  }
544
544
  return void 0;
@@ -554,12 +554,12 @@ var BLANK_TASK_INPUT_TOOL = "TaskInput";
554
554
  var typesText = (value) => typeof value === "string" && value.trim().length > 0;
555
555
  var taskIdOf = (control, toolInput) => typeof toolInput[control.taskKey] === "string" ? { task_id: toolInput[control.taskKey] } : {};
556
556
  var typedIntoTask = (control, toolInput) => {
557
- const text2 = toolInput[control.inputKey];
558
- if (typesText(text2)) return { tool: SHELL_TOOL, input: { command: text2 }, unreadable: false };
559
- if (text2 !== void 0 && typeof text2 !== "string") return { tool: control.name, input: toolInput, unreadable: true };
557
+ const text3 = toolInput[control.inputKey];
558
+ if (typesText(text3)) return { tool: SHELL_TOOL, input: { command: text3 }, unreadable: false };
559
+ if (text3 !== void 0 && typeof text3 !== "string") return { tool: control.name, input: toolInput, unreadable: true };
560
560
  return {
561
561
  tool: BLANK_TASK_INPUT_TOOL,
562
- input: { ...taskIdOf(control, toolInput), input: text2 ?? "" },
562
+ input: { ...taskIdOf(control, toolInput), input: text3 ?? "" },
563
563
  unreadable: false
564
564
  };
565
565
  };
@@ -986,10 +986,10 @@ var secretRedactionRules = (shapes) => [
986
986
  var SECRET_REDACTION_RULES = secretRedactionRules(DISPLAYED_SECRET_SHAPES);
987
987
  var CUT_OFF_TEXT_REDACTION_RULES = secretRedactionRules(CUT_OFF_SECRET_SHAPES);
988
988
  var HIGH_ENTROPY_RULE = { pattern: /[A-Za-z0-9+/]{40,}={0,2}/g, replacement: "[redacted]" };
989
- var applyRedactionRules = (rules, text2) => rules.reduce((acc, rule) => acc.replace(rule.pattern, rule.replacement), text2);
990
- var redactSecrets = (text2) => applyRedactionRules(SECRET_REDACTION_RULES, text2);
991
- var redactSecretsFromContent = (text2) => applyRedactionRules(CUT_OFF_TEXT_REDACTION_RULES, text2);
992
- var redactSecretsDeep = (text2) => redactSecrets(text2).replace(HIGH_ENTROPY_RULE.pattern, HIGH_ENTROPY_RULE.replacement);
989
+ var applyRedactionRules = (rules, text3) => rules.reduce((acc, rule) => acc.replace(rule.pattern, rule.replacement), text3);
990
+ var redactSecrets = (text3) => applyRedactionRules(SECRET_REDACTION_RULES, text3);
991
+ var redactSecretsFromContent = (text3) => applyRedactionRules(CUT_OFF_TEXT_REDACTION_RULES, text3);
992
+ var redactSecretsDeep = (text3) => redactSecrets(text3).replace(HIGH_ENTROPY_RULE.pattern, HIGH_ENTROPY_RULE.replacement);
993
993
 
994
994
  // ../contracts/src/cursor.ts
995
995
  var CURSOR_GATE_EVENTS = ["beforeShellExecution", "beforeMCPExecution", "preToolUse"];
@@ -1029,13 +1029,13 @@ var cursorGateOwnsToolCall = (registration, toolName) => typeof toolName === "st
1029
1029
  var INTERNAL_ENVELOPE = /(^|\n) {0,3}(?:<(total_tokens|task-notification)>[\s\S]*?(?:<\/\2>|$)[\t ]*)+/g;
1030
1030
  var INCOMPLETE_ENVELOPE = /(^|\n) {0,3}<(?:total_tokens|task-notification)$/g;
1031
1031
  var SUGGESTION_REQUEST = /^This is an app-generated request for a suggested next user(?: message| prompt)/;
1032
- var visibleProse = (text2) => text2.replace(INTERNAL_ENVELOPE, "$1").replace(INCOMPLETE_ENVELOPE, "$1");
1033
- function conversationText(text2) {
1034
- if (SUGGESTION_REQUEST.test(text2.trimStart())) return "";
1032
+ var visibleProse = (text3) => text3.replace(INTERNAL_ENVELOPE, "$1").replace(INCOMPLETE_ENVELOPE, "$1");
1033
+ function conversationText(text3) {
1034
+ if (SUGGESTION_REQUEST.test(text3.trimStart())) return "";
1035
1035
  const output = [];
1036
1036
  let prose = [];
1037
1037
  let fence = null;
1038
- for (const line of text2.split("\n")) {
1038
+ for (const line of text3.split("\n")) {
1039
1039
  const marker = /^ {0,3}(`{3,}|~{3,})/.exec(line)?.[1];
1040
1040
  if (fence) {
1041
1041
  output.push(line);
@@ -1059,6 +1059,186 @@ function extractMessageText(content) {
1059
1059
  ).join("\n");
1060
1060
  }
1061
1061
 
1062
+ // ../contracts/src/native-input.ts
1063
+ var NativeInputAgent = /* @__PURE__ */ ((NativeInputAgent2) => {
1064
+ NativeInputAgent2["codex"] = "codex";
1065
+ NativeInputAgent2["hermes"] = "hermes";
1066
+ return NativeInputAgent2;
1067
+ })(NativeInputAgent || {});
1068
+ var NATIVE_INPUT = {
1069
+ protocol: 1,
1070
+ codexVersion: "0.163.0",
1071
+ hermesCommit: "2e83e2a935ee04f606aab58e498d34ca58d84c07",
1072
+ hermesRecoveryCommit: "1ba5596b494c699386304d425792f214b67afe2c",
1073
+ rpcTimeoutMs: 5e3,
1074
+ receiptWindowMs: 15e3,
1075
+ maxFrameBytes: 4194304,
1076
+ maxSessions: 128,
1077
+ receiptPageSize: 100,
1078
+ receiptMaxPages: 4,
1079
+ heartbeatMs: 6e4,
1080
+ maxConcurrent: 4,
1081
+ journalVersion: 1,
1082
+ journalDirectory: "run/native-input",
1083
+ codexSocket: "app-server-control/app-server-control.sock",
1084
+ hermesSocket: "gateway.sock",
1085
+ hermesWebSocketProtocol: "hermes-gateway-v1",
1086
+ hermesTicketPrefix: "hermes-gateway-ticket."
1087
+ };
1088
+ var HermesInputCapability = /* @__PURE__ */ ((HermesInputCapability2) => {
1089
+ HermesInputCapability2["durableAdmission"] = "durable-admission-v1";
1090
+ HermesInputCapability2["submissionReceipt"] = "submission-receipt-v1";
1091
+ HermesInputCapability2["admissionHistory"] = "admission-history-v1";
1092
+ HermesInputCapability2["ordinaryInputEvents"] = "ordinary-input-events-v1";
1093
+ return HermesInputCapability2;
1094
+ })(HermesInputCapability || {});
1095
+ var qualifyHermesReceiptMode = (codeSha, capabilities) => {
1096
+ if (!Array.isArray(capabilities) || !capabilities.every((value) => typeof value === "string"))
1097
+ return null;
1098
+ if (!capabilities.includes("durable-admission-v1" /* durableAdmission */))
1099
+ return null;
1100
+ if (codeSha === NATIVE_INPUT.hermesCommit)
1101
+ return "event_replay" /* eventReplay */;
1102
+ if (codeSha === NATIVE_INPUT.hermesRecoveryCommit && Object.values(HermesInputCapability).every(
1103
+ (capability) => capabilities.includes(capability)
1104
+ ))
1105
+ return "submission" /* submission */;
1106
+ return null;
1107
+ };
1108
+ var nativeRecord = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
1109
+ var nativeIdentifier = (v) => typeof v === "string" && /^[A-Za-z0-9_-]{1,128}$/.test(v);
1110
+ var nativeInputAction = (p) => {
1111
+ if (p.accepted) return "acknowledge" /* acknowledge */;
1112
+ if (p.nowMs >= p.expiresAtMs)
1113
+ return p.attempted ? "outcome_unknown" /* outcomeUnknown */ : "expire" /* expire */;
1114
+ if (p.attempted) return "observe" /* observe */;
1115
+ return "submit" /* submit */;
1116
+ };
1117
+ var isCodexQueuedReceipt = (v, commandId) => nativeRecord(v) && nativeIdentifier(v.id) && v.clientUserMessageId === commandId;
1118
+ var isCodexInputReceipt = (v, sessionId, commandId) => nativeRecord(v) && v.id === sessionId && Array.isArray(v.turns) && v.turns.some(
1119
+ (turn) => nativeRecord(turn) && Array.isArray(turn.items) && turn.items.some(
1120
+ (item) => nativeRecord(item) && item.type === "userMessage" && item.clientId === commandId
1121
+ )
1122
+ );
1123
+ var parseHermesAdmission = (v, profile, sessionId) => {
1124
+ if (!nativeRecord(v) || !nativeIdentifier(v.admission_id) || !nativeRecord(v.ref) || v.ref.profile_id !== profile || v.ref.session_id !== sessionId || v.status !== "queued" /* queued */ && v.status !== "started" /* started */ && v.status !== "terminal" /* terminal */ && v.status !== "unknown" /* unknown */)
1125
+ return null;
1126
+ return {
1127
+ admissionId: v.admission_id,
1128
+ status: v.status,
1129
+ outcome: typeof v.outcome === "string" ? v.outcome : null
1130
+ };
1131
+ };
1132
+ var parseHermesReplayCursor = (v) => {
1133
+ if (!nativeRecord(v) || !nativeIdentifier(v.replay_epoch) || typeof v.last_sequence !== "number" || !Number.isSafeInteger(v.last_sequence) || v.last_sequence < 0)
1134
+ return null;
1135
+ return { replay_epoch: v.replay_epoch, last_sequence: v.last_sequence };
1136
+ };
1137
+ var hermesPendingAdmissionId = (snapshot, profile, sessionId, commandId) => {
1138
+ if (!nativeRecord(snapshot) || snapshot.session_id !== sessionId || !Array.isArray(snapshot.pending))
1139
+ return null;
1140
+ for (const row of snapshot.pending) {
1141
+ if (!nativeRecord(row) || row.input_id !== commandId) continue;
1142
+ const receipt = parseHermesAdmission(row, profile, sessionId);
1143
+ if (receipt) return receipt.admissionId;
1144
+ }
1145
+ return null;
1146
+ };
1147
+ var hermesReplayAdmissionId = (replay, cursor, sessionId, commandId) => {
1148
+ if (!nativeRecord(replay) || replay.replay_epoch !== cursor.replay_epoch || replay.truncated !== false || replay.snapshot_required !== false || !Array.isArray(replay.events))
1149
+ return null;
1150
+ for (const event of replay.events) {
1151
+ if (!nativeRecord(event) || event.type !== "message.complete" || event.session_id !== sessionId || event.replay_epoch !== cursor.replay_epoch || typeof event.seq !== "number" || !Number.isSafeInteger(event.seq) || event.seq <= cursor.last_sequence || !nativeIdentifier(event.admission_id) || !nativeRecord(event.payload) || event.payload.admission_id !== event.admission_id || !nativeRecord(event.payload.persisted_turn) || event.payload.persisted_turn.submission_id !== commandId)
1152
+ continue;
1153
+ return event.admission_id;
1154
+ }
1155
+ return null;
1156
+ };
1157
+
1158
+ // ../contracts/src/command-delivery.ts
1159
+ var COMMAND_SETTLEMENT_STATES = [
1160
+ "delivered",
1161
+ "failed",
1162
+ "uncertain"
1163
+ ];
1164
+ var COMMAND_RECOVERY = {
1165
+ receiptRetentionMs: 7 * 24 * 60 * 60 * 1e3,
1166
+ waitingObservationMs: 9e4,
1167
+ acknowledgementTimeoutMs: 5e3,
1168
+ emissionRecoveryGraceMs: 6e4,
1169
+ retrySendWindowMs: 72e5
1170
+ };
1171
+ var COMMAND_ACKNOWLEDGEMENT_STATES = [
1172
+ "dispatching",
1173
+ ...COMMAND_SETTLEMENT_STATES
1174
+ ];
1175
+ var isCommandAcknowledgementReceipt = (value) => typeof value === "object" && value !== null && "ok" in value && value.ok === true;
1176
+
1177
+ // ../contracts/src/claude-wake.ts
1178
+ var CLAUDE_WAKE = {
1179
+ apiPath: "/api/agent/command/wake",
1180
+ message: "Pushary has a message from your user. It arrives through Pushary's hook; no reply is needed.",
1181
+ unixMinimumVersion: "2.1.224",
1182
+ windowsMinimumVersion: "2.1.234",
1183
+ stopFeedbackMinimumVersion: "2.1.163",
1184
+ receiptWindowMs: 15e3,
1185
+ debounceMs: 6e4,
1186
+ missingReceiptLimit: 3,
1187
+ retainedAttempts: 128,
1188
+ directory: "run/claude-wake"
1189
+ };
1190
+ var versionAtLeast = (version, floor) => {
1191
+ if (!version || !/^\d+\.\d+\.\d+$/.test(version)) return false;
1192
+ const parts = version.split(".").map(Number);
1193
+ const minimum = floor.split(".").map(Number);
1194
+ if (!parts.every(Number.isSafeInteger)) return false;
1195
+ for (let index = 0; index < 3; index++) {
1196
+ if (parts[index] !== minimum[index]) return parts[index] > minimum[index];
1197
+ }
1198
+ return true;
1199
+ };
1200
+ var supportsClaudeInbox = (version, platform) => {
1201
+ if (platform === "win32")
1202
+ return versionAtLeast(version, CLAUDE_WAKE.windowsMinimumVersion);
1203
+ return (platform === "darwin" || platform === "linux") && versionAtLeast(version, CLAUDE_WAKE.unixMinimumVersion);
1204
+ };
1205
+ var claudeWakeDecision = (progress) => {
1206
+ if (!progress.idle) return "agent_busy" /* busy */;
1207
+ const attempts = [...progress.attempts].sort(
1208
+ (a, b) => b.submittedAtMs - a.submittedAtMs
1209
+ );
1210
+ const recent = attempts.find(
1211
+ (attempt) => attempt.sessionId === progress.sessionId
1212
+ );
1213
+ if (recent && progress.nowMs - recent.submittedAtMs < CLAUDE_WAKE.debounceMs) {
1214
+ return recent.accepted ? "wake_accepted" /* accepted */ : "wake_unconfirmed" /* unconfirmed */;
1215
+ }
1216
+ let missing = 0;
1217
+ for (const attempt of attempts) {
1218
+ if (attempt.accepted) break;
1219
+ if (progress.nowMs - attempt.submittedAtMs >= CLAUDE_WAKE.receiptWindowMs)
1220
+ missing++;
1221
+ if (missing >= CLAUDE_WAKE.missingReceiptLimit)
1222
+ return "wake_disabled" /* circuitOpen */;
1223
+ }
1224
+ return null;
1225
+ };
1226
+ var CLAUDE_WAKE_API = CLAUDE_WAKE.apiPath;
1227
+ var claudeWakeWaitingOn = (outcome) => {
1228
+ switch (outcome) {
1229
+ case "wake_accepted" /* accepted */:
1230
+ return "hook" /* hook */;
1231
+ case "agent_busy" /* busy */:
1232
+ return "agent_turn" /* agentTurn */;
1233
+ case "wake_unconfirmed" /* unconfirmed */:
1234
+ return "wake_unconfirmed" /* wakeUnconfirmed */;
1235
+ case "wake_disabled" /* circuitOpen */:
1236
+ return "wake_disabled" /* wakeDisabled */;
1237
+ case "wake_not_sent" /* notSent */:
1238
+ return "local_use" /* localUse */;
1239
+ }
1240
+ };
1241
+
1062
1242
  // ../contracts/src/shell-analysis.ts
1063
1243
  var SHELL_WORD_SEPARATOR = /[ \t\n]/;
1064
1244
  var ARITHMETIC_EVALUATING_EXPANSION = /\$[#+=~^]*(?:[A-Za-z_][A-Za-z0-9_]*|[0-9]+|[-?$!@*#])?\[/;
@@ -1096,16 +1276,16 @@ var splitShellSegments = (command) => {
1096
1276
  let consumed = -1;
1097
1277
  let readsPipe = false;
1098
1278
  for (const lexeme of lexemes) {
1099
- const { index, text: text2, quote, kind } = lexeme;
1279
+ const { index, text: text3, quote, kind } = lexeme;
1100
1280
  if (index <= consumed || kind !== "text" || quote === "'") continue;
1101
- if (text2 === "`" || text2 === "$" && command[index + 1] === "(") return null;
1281
+ if (text3 === "`" || text3 === "$" && command[index + 1] === "(") return null;
1102
1282
  if (quote !== null) continue;
1103
- if (UNDECOMPOSABLE.has(text2)) return null;
1104
- if (!SEGMENT_SEPARATORS.has(text2)) continue;
1105
- const doubled = DOUBLED_SEPARATORS.has(text2) && command[index + 1] === text2;
1283
+ if (UNDECOMPOSABLE.has(text3)) return null;
1284
+ if (!SEGMENT_SEPARATORS.has(text3)) continue;
1285
+ const doubled = DOUBLED_SEPARATORS.has(text3) && command[index + 1] === text3;
1106
1286
  consumed = index + (doubled ? 1 : 0);
1107
1287
  segments.push({ text: trimShellWhitespace(command.slice(start, index)), readsPipe });
1108
- readsPipe = text2 === PIPE && !doubled;
1288
+ readsPipe = text3 === PIPE && !doubled;
1109
1289
  start = consumed + 1;
1110
1290
  }
1111
1291
  segments.push({ text: trimShellWhitespace(command.slice(start)), readsPipe });
@@ -1203,10 +1383,10 @@ var shellVisibleText = (command) => {
1203
1383
  const lexemes = scanShell(command);
1204
1384
  if (lexemes === null) return null;
1205
1385
  let visible = "";
1206
- for (const { text: text2, quote, kind } of lexemes) {
1386
+ for (const { text: text3, quote, kind } of lexemes) {
1207
1387
  if (kind === "escape" && quote === '"') return null;
1208
- const literal = kind === "text" && (quote === "'" || quote === '"' && LITERAL_IN_DOUBLE_QUOTES.has(text2));
1209
- visible += literal ? "_".repeat(text2.length) : text2;
1388
+ const literal = kind === "text" && (quote === "'" || quote === '"' && LITERAL_IN_DOUBLE_QUOTES.has(text3));
1389
+ visible += literal ? "_".repeat(text3.length) : text3;
1210
1390
  }
1211
1391
  return visible;
1212
1392
  };
@@ -1222,14 +1402,14 @@ var shellWordsOf = (command) => {
1222
1402
  const lexemes = scanShell(command);
1223
1403
  if (lexemes === null) return null;
1224
1404
  const words = [];
1225
- let text2 = "";
1405
+ let text3 = "";
1226
1406
  let plain = true;
1227
1407
  let expands = false;
1228
1408
  let comment = false;
1229
1409
  let started = false;
1230
1410
  const finishWord = () => {
1231
- if (started) words.push({ text: text2, plain, expands, comment });
1232
- text2 = "";
1411
+ if (started) words.push({ text: text3, plain, expands, comment });
1412
+ text3 = "";
1233
1413
  plain = true;
1234
1414
  expands = false;
1235
1415
  comment = false;
@@ -1242,7 +1422,7 @@ var shellWordsOf = (command) => {
1242
1422
  continue;
1243
1423
  }
1244
1424
  if (lexeme.kind === "escape") {
1245
- text2 += lexeme.text.slice(1);
1425
+ text3 += lexeme.text.slice(1);
1246
1426
  plain = false;
1247
1427
  started = true;
1248
1428
  continue;
@@ -1253,7 +1433,7 @@ var shellWordsOf = (command) => {
1253
1433
  }
1254
1434
  comment ||= lexeme.quote === null && !started && lexeme.text === "#";
1255
1435
  expands ||= lexeme.quote !== "'" && lexeme.text === "$";
1256
- text2 += lexeme.text;
1436
+ text3 += lexeme.text;
1257
1437
  started = true;
1258
1438
  }
1259
1439
  finishWord();
@@ -1328,40 +1508,40 @@ var opensAHereString = (source, index) => {
1328
1508
  return source.charAt(index) === HERE_STRING_SIGIL && (SINGLE_QUOTES.has(quote) || DOUBLE_QUOTES.has(quote)) && HERE_STRING_HEADER_REST.test(source.slice(index + 2));
1329
1509
  };
1330
1510
  var singleQuotedTextAt = (source, open) => {
1331
- let text2 = "";
1511
+ let text3 = "";
1332
1512
  for (let index = open + 1; index < source.length; index += 1) {
1333
1513
  const char = source.charAt(index);
1334
1514
  if (!SINGLE_QUOTES.has(char)) {
1335
- text2 += char;
1515
+ text3 += char;
1336
1516
  } else if (SINGLE_QUOTES.has(source.charAt(index + 1))) {
1337
- text2 += char;
1517
+ text3 += char;
1338
1518
  index += 1;
1339
1519
  } else {
1340
- return { end: index + 1, text: text2, expands: false, nested: [] };
1520
+ return { end: index + 1, text: text3, expands: false, nested: [] };
1341
1521
  }
1342
1522
  }
1343
1523
  return null;
1344
1524
  };
1345
1525
  var expandableTextUntil = (source, start, closesAt, nesting) => {
1346
- let text2 = "";
1526
+ let text3 = "";
1347
1527
  let expands = false;
1348
1528
  const nested = [];
1349
1529
  for (let index = start; index < source.length; index += 1) {
1350
1530
  const char = source.charAt(index);
1351
- if (closesAt(index)) return { end: index + 1, text: text2, expands, nested };
1531
+ if (closesAt(index)) return { end: index + 1, text: text3, expands, nested };
1352
1532
  if (char === ESCAPE || DOUBLE_QUOTES.has(char) && DOUBLE_QUOTES.has(source.charAt(index + 1))) {
1353
- text2 += source.charAt(index + 1);
1533
+ text3 += source.charAt(index + 1);
1354
1534
  index += 1;
1355
1535
  } else if (source.startsWith(SUBEXPRESSION_OPEN, index)) {
1356
1536
  const group = groupAt(source, index + SUBEXPRESSION_OPEN.length, ")", nesting + 1);
1357
1537
  if (group === null) return null;
1358
1538
  nested.push(group.inner);
1359
- text2 += SUBEXPRESSION_PLACEHOLDER;
1539
+ text3 += SUBEXPRESSION_PLACEHOLDER;
1360
1540
  expands = true;
1361
1541
  index = group.end - 1;
1362
1542
  } else {
1363
1543
  expands ||= opensAVariable(source, index);
1364
- text2 += char;
1544
+ text3 += char;
1365
1545
  }
1366
1546
  }
1367
1547
  return null;
@@ -1860,12 +2040,12 @@ var parameterValueOf = (command, fullName, shortestPrefix) => {
1860
2040
  };
1861
2041
  var operandTextsOf = (command) => command.args.flatMap((arg) => {
1862
2042
  const parameter = parameterOf(arg);
1863
- const text2 = parameter === null ? arg.text : parameter.value;
1864
- return text2 === void 0 ? [] : text2.split(POWERSHELL_ARRAY_SEPARATOR);
2043
+ const text3 = parameter === null ? arg.text : parameter.value;
2044
+ return text3 === void 0 ? [] : text3.split(POWERSHELL_ARRAY_SEPARATOR);
1865
2045
  });
1866
2046
  var positionalTextsOf = (command) => command.args.filter((arg) => parameterOf(arg) === null).map((arg) => arg.text);
1867
2047
  var firstOperandOf = (command, isSwitch) => command.args.find((arg) => !isSwitch.test(arg.text))?.text;
1868
- var namesASecretPath = (text2, judge) => judge.namesASecretFile(fileNameOf(text2.trim()));
2048
+ var namesASecretPath = (text3, judge) => judge.namesASecretFile(fileNameOf(text3.trim()));
1869
2049
  var isAssignmentTarget = (word) => POWERSHELL_ASSIGNMENT_TARGET.test(word.text) || word.text === POWERSHELL_ARRAY_SEPARATOR;
1870
2050
  var wordsAfterAnAssignment = (words) => {
1871
2051
  const operator = words.findIndex((word) => isPowerShellAssignmentOperator(word));
@@ -1924,7 +2104,7 @@ var copyDestinationOf = (command) => {
1924
2104
  };
1925
2105
  var writesASecretFileFromPowerShell = (command, judge) => {
1926
2106
  if (command.cmdlet !== COPY_ITEM) {
1927
- return POWERSHELL_FILE_WRITERS.has(command.cmdlet) && operandTextsOf(command).some((text2) => namesASecretPath(text2, judge));
2107
+ return POWERSHELL_FILE_WRITERS.has(command.cmdlet) && operandTextsOf(command).some((text3) => namesASecretPath(text3, judge));
1928
2108
  }
1929
2109
  const destination = copyDestinationOf(command);
1930
2110
  return destination !== void 0 && namesASecretPath(destination, judge);
@@ -1932,7 +2112,7 @@ var writesASecretFileFromPowerShell = (command, judge) => {
1932
2112
  var formatsADisk = (command) => DISK_ERASERS.has(command.cmdlet);
1933
2113
  var changesAWindowsService = (command) => {
1934
2114
  if (WINDOWS_SERVICE_CHANGERS.has(command.cmdlet)) return true;
1935
- const [verb, ...operands] = command.args.map((arg) => arg.text.toLowerCase()).filter((text2) => !text2.startsWith(REMOTE_MACHINE_PREFIX));
2115
+ const [verb, ...operands] = command.args.map((arg) => arg.text.toLowerCase()).filter((text3) => !text3.startsWith(REMOTE_MACHINE_PREFIX));
1936
2116
  if (command.name === SERVICE_CONTROL_PROGRAM) return SERVICE_CONTROL_VERBS_THAT_CHANGE.has(verb ?? "");
1937
2117
  return NET_PROGRAMS.has(command.name) && (NET_VERBS_THAT_CHANGE_A_SERVICE.has(verb ?? "") || verb === NET_START && operands.length > 0);
1938
2118
  };
@@ -1956,7 +2136,7 @@ var runsTextAsCode = (stage, judge) => {
1956
2136
  return SCRIPTBLOCK_FROM_TEXT.test(stage.source) || command !== null && (command.cmdlet === INVOKE_EXPRESSION || stage.readsAPipe && judge.runsWhatItReads(posixInvocationOf(command)));
1957
2137
  };
1958
2138
  var runsFetchedPowerShellCode = (stages, judge) => stages.some((stage) => fetchesWithPowerShell(stage, judge)) && stages.some((stage) => runsTextAsCode(stage, judge));
1959
- var downloadedFileNameOf = (text2) => fileNameOf(text2.replace(URL_QUERY_OR_FRAGMENT, "")).toLowerCase();
2139
+ var downloadedFileNameOf = (text3) => fileNameOf(text3.replace(URL_QUERY_OR_FRAGMENT, "")).toLowerCase();
1960
2140
  var downloadedFileNamesOf = (stages, judge) => new Set(stages.filter((stage) => fetchesWithPowerShell(stage, judge)).flatMap((stage) => {
1961
2141
  const command = powerShellCommandOf(stage);
1962
2142
  return command === null ? [] : operandTextsOf(command).map(downloadedFileNameOf);
@@ -1988,12 +2168,12 @@ var hostedPowerShellScriptOf = (command) => {
1988
2168
  if (!POWERSHELL_HOSTS.has(command.name)) return { kind: "none" };
1989
2169
  const texts = command.args.map((arg) => arg.text);
1990
2170
  for (let index = 0; index < texts.length; index += 1) {
1991
- const text2 = (texts[index] ?? "").trim();
1992
- if (!text2) continue;
1993
- if (!POWERSHELL_HOST_SWITCH.test(text2)) {
2171
+ const text3 = (texts[index] ?? "").trim();
2172
+ if (!text3) continue;
2173
+ if (!POWERSHELL_HOST_SWITCH.test(text3)) {
1994
2174
  return command.name === WINDOWS_POWERSHELL_HOST ? { kind: "script", script: texts.slice(index).join(" ") } : { kind: "none" };
1995
2175
  }
1996
- const option = text2.toLowerCase().replace(POWERSHELL_HOST_SWITCH_PREFIX, "");
2176
+ const option = text3.toLowerCase().replace(POWERSHELL_HOST_SWITCH_PREFIX, "");
1997
2177
  if (option && (POWERSHELL_HOST_ENCODED_PARAMETER.startsWith(option) || option === POWERSHELL_HOST_ENCODED_ALIAS)) {
1998
2178
  return { kind: "incomplete", reason: "encoded_command" };
1999
2179
  }
@@ -2043,9 +2223,9 @@ var wslCommandWordsOf = (command) => {
2043
2223
  const texts = command.args.map((arg) => arg.text);
2044
2224
  let index = 0;
2045
2225
  while (index < texts.length && POSIX_FLAG.test(texts[index] ?? "")) {
2046
- const text2 = texts[index] ?? "";
2047
- index += WSL_OPTIONS_WITH_A_VALUE.has(text2) ? 2 : 1;
2048
- if (WSL_COMMAND_MARKERS.has(text2)) break;
2226
+ const text3 = texts[index] ?? "";
2227
+ index += WSL_OPTIONS_WITH_A_VALUE.has(text3) ? 2 : 1;
2228
+ if (WSL_COMMAND_MARKERS.has(text3)) break;
2049
2229
  }
2050
2230
  return index < texts.length ? texts.slice(index) : void 0;
2051
2231
  };
@@ -2289,8 +2469,8 @@ var quotedToken = (source, start, reading, inside) => {
2289
2469
  }
2290
2470
  if (swallowsABacktick(source, start, end, reading.lexicon)) return "uncertain";
2291
2471
  const quote = source.charAt(start);
2292
- const text2 = syntax.content === "hidden" ? STRING_PLACEHOLDER : visibleQuotedText(source.slice(start + opener.length, end - opener.length).replaceAll(quote + quote, quote));
2293
- return { text: text2, end, insideExecutableComment: inside };
2472
+ const text3 = syntax.content === "hidden" ? STRING_PLACEHOLDER : visibleQuotedText(source.slice(start + opener.length, end - opener.length).replaceAll(quote + quote, quote));
2473
+ return { text: text3, end, insideExecutableComment: inside };
2294
2474
  };
2295
2475
  var lineCommentEnd = (source, start, lexicon) => {
2296
2476
  const terminator = endOfRun(source, start, (character) => !isLineCommentTerminator(character));
@@ -2340,9 +2520,9 @@ var dollarToken = (source, start, lexicon, inside) => {
2340
2520
  };
2341
2521
  var numberToken = (source, start, inside) => {
2342
2522
  const end = endOfRun(source, start, isWordCharacter);
2343
- const text2 = source.slice(start, end);
2344
- if (!DECIMAL_DIGITS.test(text2) && dollarQuoteDelimiterAt(source, end) !== void 0) return "uncertain";
2345
- return { text: text2, end, insideExecutableComment: inside };
2523
+ const text3 = source.slice(start, end);
2524
+ if (!DECIMAL_DIGITS.test(text3) && dollarQuoteDelimiterAt(source, end) !== void 0) return "uncertain";
2525
+ return { text: text3, end, insideExecutableComment: inside };
2346
2526
  };
2347
2527
  var identifierToken = (source, start, inside) => {
2348
2528
  const end = endOfRun(source, start, isIdentifierPart);
@@ -2550,13 +2730,13 @@ var splitReading = (args, index, clusterBefore, attached) => {
2550
2730
  return { kind: "split", prefix, value: args[index + 1], rest: index + 2 };
2551
2731
  };
2552
2732
  var requiredValueStep = (args, index) => index + 1 < args.length ? nextOption(index + 2) : finished(EXITS);
2553
- var shortOptionStep = (args, index, text2, options) => {
2554
- for (let position = 1; position < text2.length; position += 1) {
2555
- const letter = text2.charAt(position);
2733
+ var shortOptionStep = (args, index, text3, options) => {
2734
+ for (let position = 1; position < text3.length; position += 1) {
2735
+ const letter = text3.charAt(position);
2556
2736
  if (options.switches.has(letter)) continue;
2557
2737
  if (!options.withAValue.has(letter)) return finished(EXITS);
2558
- const attached = text2.slice(position + 1);
2559
- if (letter === SPLIT_STRING_LETTER) return finished(splitReading(args, index, text2.slice(0, position), attached === "" ? void 0 : attached));
2738
+ const attached = text3.slice(position + 1);
2739
+ if (letter === SPLIT_STRING_LETTER) return finished(splitReading(args, index, text3.slice(0, position), attached === "" ? void 0 : attached));
2560
2740
  return attached === "" ? requiredValueStep(args, index) : nextOption(index + 1);
2561
2741
  }
2562
2742
  return nextOption(index + 1);
@@ -2567,8 +2747,8 @@ var gnuLongOptionAbbreviatedBy = (name, options) => {
2567
2747
  const candidates = options.filter((option) => option.name.startsWith(name));
2568
2748
  return candidates.length === 1 ? candidates[0] : void 0;
2569
2749
  };
2570
- var longOptionStep = (args, index, text2, options) => {
2571
- const body = text2.slice(LONG_OPTION_PREFIX.length);
2750
+ var longOptionStep = (args, index, text3, options) => {
2751
+ const body = text3.slice(LONG_OPTION_PREFIX.length);
2572
2752
  const separator = body.indexOf(ASSIGNMENT_SEPARATOR);
2573
2753
  const attached = separator === -1 ? void 0 : body.slice(separator + 1);
2574
2754
  const option = gnuLongOptionAbbreviatedBy(separator === -1 ? body : body.slice(0, separator), options);
@@ -2598,7 +2778,7 @@ var runsSomething = (reading) => reading.kind === "command" || reading.kind ===
2598
2778
  var sameEnvReading = (left, right) => {
2599
2779
  if (left.kind === "command" && right.kind === "command") return left.start === right.start;
2600
2780
  if (left.kind !== "split" || right.kind !== "split") return false;
2601
- return left.rest === right.rest && left.prefix.length === right.prefix.length && left.prefix.every((text2, position) => text2 === right.prefix[position]) && left.value?.text === right.value?.text && left.value?.expands === right.value?.expands;
2781
+ return left.rest === right.rest && left.prefix.length === right.prefix.length && left.prefix.every((text3, position) => text3 === right.prefix[position]) && left.value?.text === right.value?.text && left.value?.expands === right.value?.expands;
2602
2782
  };
2603
2783
  var envReadingOf = (args) => {
2604
2784
  const readings = ENV_FLAVORS.map((flavor) => flavorReadingOf(args, flavor));
@@ -2642,8 +2822,8 @@ var clusterReadingOf = (cluster, syntax) => {
2642
2822
  endsOptions: [...letters].some((letter) => syntax.lettersThatEndOptions.has(letter))
2643
2823
  };
2644
2824
  };
2645
- var endsOptionParsing = (text2) => text2 === END_OF_OPTIONS2 || text2 === LONE_DASH2;
2646
- var isAnOperand = (text2) => !text2.startsWith("-") && !text2.startsWith("+");
2825
+ var endsOptionParsing = (text3) => text3 === END_OF_OPTIONS2 || text3 === LONE_DASH2;
2826
+ var isAnOperand = (text3) => !text3.startsWith("-") && !text3.startsWith("+");
2647
2827
  var optionValueIsUnreadable = (value) => value === void 0 || value.expands;
2648
2828
  var shellCommandStringOf = (shell, args) => {
2649
2829
  const syntax = SHELL_OPTION_SYNTAX.get(shell);
@@ -2955,6 +3135,9 @@ var isAutoUpdateResult = (value) => typeof value === "string" && AUTO_UPDATE_RES
2955
3135
  // ../contracts/src/answer-drafts.ts
2956
3136
  var ANSWER_DRAFT_TTL_MS = 24 * 60 * 60 * 1e3;
2957
3137
 
3138
+ // ../contracts/src/session-history.ts
3139
+ var SESSION_HISTORY_BACKFILL_LIMIT_BYTES = 2e7;
3140
+
2958
3141
  // ../contracts/src/decision-lifetime.ts
2959
3142
  var DECISION_REMINDER_DELAY_MS = 10 * 60 * 1e3;
2960
3143
  var DECISION_CACHE_TTL_SECONDS = 10 * 60;
@@ -2984,13 +3167,13 @@ var leadingWordPart = (rest) => {
2984
3167
  return double ? { text: (double[1] ?? "").replace(ESCAPED_INSIDE_DOUBLE_QUOTES, "$1"), length: double[0].length } : null;
2985
3168
  };
2986
3169
  var leadingWord = (rest) => {
2987
- let text2 = "";
3170
+ let text3 = "";
2988
3171
  let length = 0;
2989
3172
  for (let part = leadingWordPart(rest); part !== null; part = leadingWordPart(rest.slice(length))) {
2990
- text2 += part.text;
3173
+ text3 += part.text;
2991
3174
  length += part.length;
2992
3175
  }
2993
- return length === 0 ? null : { text: text2, length };
3176
+ return length === 0 ? null : { text: text3, length };
2994
3177
  };
2995
3178
  var wordsOfAJoinedCommand = (joined) => {
2996
3179
  const words = [];
@@ -3158,15 +3341,89 @@ var codexNativeApprovalResponse = (approval, answer) => {
3158
3341
  // ../contracts/src/transcript-record.ts
3159
3342
  var COMPRESSED_TRANSCRIPT_RECORD_MARKER = 1;
3160
3343
  var TRANSCRIPT_RECORD_MAX_INFLATED_BYTES = 1024 * 1024;
3344
+ var isCompressedTranscriptRecord = (opened) => opened[0] === COMPRESSED_TRANSCRIPT_RECORD_MARKER;
3161
3345
  var compressionShrinks = (raw, deflated) => deflated.length + 1 < raw.length;
3346
+ var inflatedRecord = (deflated, inflateRawWithin) => {
3347
+ const inflated = inflateRawWithin(deflated, TRANSCRIPT_RECORD_MAX_INFLATED_BYTES);
3348
+ return inflated && inflated.length > 0 ? inflated : null;
3349
+ };
3350
+ var transcriptRecordPlaintext = (opened, inflateRawWithin) => isCompressedTranscriptRecord(opened) ? inflatedRecord(opened.subarray(1), inflateRawWithin) : opened;
3162
3351
  var compressTranscriptRecord = (raw, deflateRaw) => {
3163
3352
  if (raw.length > TRANSCRIPT_RECORD_MAX_INFLATED_BYTES) return raw;
3164
3353
  const deflated = deflateRaw(raw);
3165
3354
  if (!compressionShrinks(raw, deflated)) return raw;
3166
- const record3 = new Uint8Array(deflated.length + 1);
3167
- record3[0] = COMPRESSED_TRANSCRIPT_RECORD_MARKER;
3168
- record3.set(deflated, 1);
3169
- return record3;
3355
+ const record4 = new Uint8Array(deflated.length + 1);
3356
+ record4[0] = COMPRESSED_TRANSCRIPT_RECORD_MARKER;
3357
+ record4.set(deflated, 1);
3358
+ return record4;
3359
+ };
3360
+
3361
+ // ../contracts/src/claude-inbox.ts
3362
+ var CLAUDE_INBOX = {
3363
+ protocol: 1,
3364
+ connectTimeoutMs: 1e3,
3365
+ receiptWindowMs: 15e3,
3366
+ receiptPollMs: 200,
3367
+ maxRecordBytes: 16384,
3368
+ maxTranscriptReadBytes: 4194304,
3369
+ maxMessageBytes: 65536,
3370
+ journalVersion: 1,
3371
+ journalDirectory: "run/native-input",
3372
+ sender: "pushary",
3373
+ carrier: "native"
3374
+ };
3375
+ var record3 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
3376
+ var text2 = (value) => typeof value === "string" && value.length > 0;
3377
+ var sessionIdPattern = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
3378
+ var parseClaudeInboxSession = (value, platform = "darwin") => {
3379
+ if (!record3(value) || !Number.isSafeInteger(value.pid) || typeof value.pid !== "number" || value.pid <= 0 || !text2(value.sessionId) || !sessionIdPattern.test(value.sessionId) || !text2(value.cwd) || !text2(value.procStart) || !text2(value.messagingSocketPath) || value.peerProtocol !== CLAUDE_INBOX.protocol || !text2(value.version) || !supportsClaudeInbox(value.version, platform))
3380
+ return null;
3381
+ return {
3382
+ pid: value.pid,
3383
+ sessionId: value.sessionId,
3384
+ cwd: value.cwd,
3385
+ procStart: value.procStart,
3386
+ messagingSocketPath: value.messagingSocketPath,
3387
+ peerProtocol: value.peerProtocol,
3388
+ version: value.version,
3389
+ ...typeof value.status === "string" ? { status: value.status } : {}
3390
+ };
3391
+ };
3392
+ var claudeInboxAction = (progress) => {
3393
+ if (progress.accepted) return "acknowledge" /* acknowledge */;
3394
+ if (progress.expiresAtMs <= progress.nowMs) {
3395
+ return progress.attempted ? "outcome_unknown" /* outcomeUnknown */ : "expire" /* expire */;
3396
+ }
3397
+ return progress.attempted ? "observe" /* observe */ : "submit" /* submit */;
3398
+ };
3399
+ var isClaudeInboxReceipt = (value, sessionId, commandId) => record3(value) && value.type === "user" && value.sessionId === sessionId && value.uuid === commandId && record3(value.origin) && value.origin.kind === "peer" && value.origin.msg_id === commandId;
3400
+ var CLAUDE_INBOX_MAX_SESSIONS = 128;
3401
+ var parseClaudeInboxCommand = (value) => {
3402
+ if (!record3(value) || !text2(value.id) || !sessionIdPattern.test(value.id) || !text2(value.text) || typeof value.expiresAtMs !== "number" || !Number.isSafeInteger(value.expiresAtMs))
3403
+ return null;
3404
+ return { id: value.id, text: value.text, expiresAtMs: value.expiresAtMs };
3405
+ };
3406
+ var parseClaudeInboxPoll = (value) => {
3407
+ if (!record3(value) || value.protocol !== CLAUDE_INBOX.protocol || !Array.isArray(value.sessionIds) || value.sessionIds.length > CLAUDE_INBOX_MAX_SESSIONS || !value.sessionIds.every((id) => nativeIdentifier(id)))
3408
+ return null;
3409
+ return value.sessionIds;
3410
+ };
3411
+ var parseClaudeInboxClaim = (value) => record3(value) && value.protocol === CLAUDE_INBOX.protocol ? parseClaudeInboxCommand(value.command) : null;
3412
+ var CLAUDE_INBOX_RECEIVER = {
3413
+ pollMs: 3e3,
3414
+ heartbeatMs: 6e4,
3415
+ requestTimeoutMs: 1e4,
3416
+ maxConcurrent: 4
3417
+ };
3418
+ var CLAUDE_INBOX_SETTLEMENTS = {
3419
+ ["accepted" /* accepted */]: { state: "delivered" },
3420
+ ["expired" /* expired */]: { state: "failed", failureCode: "expired" },
3421
+ ["outcome_unknown" /* outcomeUnknown */]: {
3422
+ state: "uncertain",
3423
+ failureCode: "delivery_unconfirmed"
3424
+ },
3425
+ ["not_sent" /* notSent */]: null,
3426
+ ["unconfirmed" /* unconfirmed */]: null
3170
3427
  };
3171
3428
 
3172
3429
  // ../contracts/src/index.ts
@@ -3214,11 +3471,11 @@ var TIMEOUT_ACTION_THAT_REFUSES = "deny";
3214
3471
  var timeoutActionWithoutLocalPrompt = ({ mode, timeoutAction }) => mode !== "push_only" && timeoutAction === "approve" ? TIMEOUT_ACTION_THAT_REFUSES : timeoutAction;
3215
3472
  var TIMEOUT_ACTIONS = ["approve", "deny", "escalate", "wait"];
3216
3473
  var isTimeoutAction = (value) => typeof value === "string" && TIMEOUT_ACTIONS.includes(value);
3217
- var typedTextAsAnswers = (questions, text2) => {
3474
+ var typedTextAsAnswers = (questions, text3) => {
3218
3475
  const [only, ...others] = questions;
3219
3476
  if (!only || others.length > 0 || !isTypedAnswerQuestion(only)) return null;
3220
- if (text2.trim().length === 0 || isHandBackAnswer(text2)) return null;
3221
- return { [only.question]: text2 };
3477
+ if (text3.trim().length === 0 || isHandBackAnswer(text3)) return null;
3478
+ return { [only.question]: text3 };
3222
3479
  };
3223
3480
  var plainAskOf = (question) => isTypedAnswerQuestion(question) ? { type: "input" } : { type: "select", options: question.options.map((option) => option.label) };
3224
3481
  var isLoneTypedAnswerQuestion = (questions) => questions.length === 1 && questions.every(isTypedAnswerQuestion);
@@ -3283,7 +3540,7 @@ var HOOK_HOLD_BUDGET_FLAG = "--hold-budget";
3283
3540
  var HOOK_HOLD_BUDGET_ENV = "PUSHARY_HOLD_BUDGET_SECONDS";
3284
3541
  var HOOK_BRIDGE_SOURCE_FLAG = "--source";
3285
3542
  var HOOK_HOLD_BUDGET_SECONDS = /^[1-9]\d{0,5}$/;
3286
- var hookHoldBudgetSeconds = (text2) => text2 !== void 0 && HOOK_HOLD_BUDGET_SECONDS.test(text2) ? Number(text2) : void 0;
3543
+ var hookHoldBudgetSeconds = (text3) => text3 !== void 0 && HOOK_HOLD_BUDGET_SECONDS.test(text3) ? Number(text3) : void 0;
3287
3544
  var hookHoldBudgetArgument = (seconds) => `${HOOK_HOLD_BUDGET_FLAG}=${seconds}`;
3288
3545
  var withHookHoldBudget = (command, holdBudgetSeconds) => holdBudgetSeconds === void 0 ? command : `${command} ${hookHoldBudgetArgument(holdBudgetSeconds)}`;
3289
3546
  var registeredHookHoldBudget = (args) => {
@@ -3392,8 +3649,8 @@ var tokenizeGlob = (glob) => {
3392
3649
  return tokens;
3393
3650
  };
3394
3651
  var SLASH = "/".charCodeAt(0);
3395
- var matchGlobTokens = (tokens, text2) => {
3396
- const n = text2.length;
3652
+ var matchGlobTokens = (tokens, text3) => {
3653
+ const n = text3.length;
3397
3654
  let reachable = new Uint8Array(n + 1);
3398
3655
  reachable[0] = 1;
3399
3656
  for (const token of tokens) {
@@ -3401,13 +3658,13 @@ var matchGlobTokens = (tokens, text2) => {
3401
3658
  if (token.kind === "literal") {
3402
3659
  const { value } = token;
3403
3660
  for (let p = 0; p <= n - value.length; p += 1) {
3404
- if (reachable[p] && text2.startsWith(value, p)) next[p + value.length] = 1;
3661
+ if (reachable[p] && text3.startsWith(value, p)) next[p + value.length] = 1;
3405
3662
  }
3406
3663
  } else {
3407
3664
  const spansSeparators = token.kind === "globstar";
3408
3665
  let open = 0;
3409
3666
  for (let p = 0; p <= n; p += 1) {
3410
- if (!spansSeparators && p > 0 && text2.charCodeAt(p - 1) === SLASH) open = 0;
3667
+ if (!spansSeparators && p > 0 && text3.charCodeAt(p - 1) === SLASH) open = 0;
3411
3668
  if (reachable[p]) open = 1;
3412
3669
  if (open) next[p] = 1;
3413
3670
  }
@@ -3771,7 +4028,7 @@ var argumentsMayExpand = (segment) => {
3771
4028
  const visible = shellVisibleText(segment);
3772
4029
  return visible === null || EXPANSION_THAT_CAN_BECOME_A_FLAG.test(visible.replace(SHELL_QUOTE_CHARACTERS, ""));
3773
4030
  };
3774
- var blankedSafeRedirections = (text2) => text2.replace(SAFE_REDIRECTION, (redirection) => " ".repeat(redirection.length));
4031
+ var blankedSafeRedirections = (text3) => text3.replace(SAFE_REDIRECTION, (redirection) => " ".repeat(redirection.length));
3775
4032
  var segmentsSplitWhereVisible = (command, visible, separators) => {
3776
4033
  const segments = [];
3777
4034
  let start = 0;
@@ -3920,10 +4177,10 @@ var DESTRUCTIVE_WORDS_IN_ANY_CASE_BY_COMMAND = /* @__PURE__ */ new Map([
3920
4177
  ]);
3921
4178
  var namesDestructiveWordInAnyCase = (name, texts) => {
3922
4179
  const words = DESTRUCTIVE_WORDS_IN_ANY_CASE_BY_COMMAND.get(name);
3923
- return words !== void 0 && texts.some((text2) => words.has(text2.toLowerCase()));
4180
+ return words !== void 0 && texts.some((text3) => words.has(text3.toLowerCase()));
3924
4181
  };
3925
4182
  var LONG_OPTION = /^--[A-Za-z]/;
3926
- var namesDestructiveArgument = (text2, destructiveArguments) => destructiveArguments.has(text2) || LONG_OPTION.test(text2) && [...destructiveArguments].some((argument) => argument.startsWith(text2)) || [...SHORT_FLAG_CLUSTER.exec(text2)?.[1] ?? ""].some((letter) => destructiveArguments.has(`-${letter}`));
4183
+ var namesDestructiveArgument = (text3, destructiveArguments) => destructiveArguments.has(text3) || LONG_OPTION.test(text3) && [...destructiveArguments].some((argument) => argument.startsWith(text3)) || [...SHORT_FLAG_CLUSTER.exec(text3)?.[1] ?? ""].some((letter) => destructiveArguments.has(`-${letter}`));
3927
4184
  var RUNNER_SUBCOMMANDS = /* @__PURE__ */ new Set(["exec", "dlx"]);
3928
4185
  var SUBCOMMAND_CLIS = /* @__PURE__ */ new Set([
3929
4186
  "git",
@@ -4050,7 +4307,7 @@ var argumentsHideTheEffect = (name, args) => {
4050
4307
  const texts = args.map((arg) => arg.text);
4051
4308
  if (INLINE_CODE_INTERPRETERS.has(name.replace(/\d+(?:\.\d+)*$/, "")) && interpreterRunsUnreadableCode(texts)) return true;
4052
4309
  const destructiveArguments = destructiveArgumentsOf(name, args);
4053
- if (destructiveArguments && texts.some((text2) => namesDestructiveArgument(text2, destructiveArguments))) return true;
4310
+ if (destructiveArguments && texts.some((text3) => namesDestructiveArgument(text3, destructiveArguments))) return true;
4054
4311
  if (namesDestructiveWordInAnyCase(name, texts)) return true;
4055
4312
  if (!SUBCOMMAND_CLIS.has(name)) return false;
4056
4313
  const meaningful = argsAfterHarmlessGlobalFlags(args);
@@ -4069,7 +4326,7 @@ var normalizedInvocation = (invocation) => invocationTextWith(invocation, (word)
4069
4326
  var SHELL_METACHARACTER = /[\s;&|<>()$`\\"'*?[\]#~{}!]/;
4070
4327
  var SINGLE_QUOTE2 = "'";
4071
4328
  var ESCAPED_SINGLE_QUOTE = `'\\''`;
4072
- var asOneShellWord = (text2) => SHELL_METACHARACTER.test(text2) ? `${SINGLE_QUOTE2}${text2.replaceAll(SINGLE_QUOTE2, ESCAPED_SINGLE_QUOTE)}${SINGLE_QUOTE2}` : text2;
4329
+ var asOneShellWord = (text3) => SHELL_METACHARACTER.test(text3) ? `${SINGLE_QUOTE2}${text3.replaceAll(SINGLE_QUOTE2, ESCAPED_SINGLE_QUOTE)}${SINGLE_QUOTE2}` : text3;
4073
4330
  var quotedInvocation = (invocation) => invocationTextWith(invocation, (word) => asOneShellWord(word.text));
4074
4331
  var normalizedCommand = (command) => {
4075
4332
  const segments = readableCommandSegments(command);
@@ -4187,8 +4444,8 @@ var statementSelectsIntoATable = (statement) => {
4187
4444
  return select !== -1 && SQL_INTO_A_TABLE.test(statement.slice(select));
4188
4445
  };
4189
4446
  var selectsIntoATable = (sql) => sql.split(SQL_STATEMENT_SEPARATOR).some(statementSelectsIntoATable);
4190
- var sqlTextWrites = (text2) => {
4191
- const statement = text2.replace(SQL_READ_PHRASE, "");
4447
+ var sqlTextWrites = (text3) => {
4448
+ const statement = text3.replace(SQL_READ_PHRASE, "");
4192
4449
  return SQL_WRITE_STATEMENT.test(statement) || selectsIntoATable(statement) || SQL_CLIENT_FILE_COMMAND.test(statement);
4193
4450
  };
4194
4451
  var writesThroughSql = (sql, lexicon) => {
@@ -4204,7 +4461,7 @@ var SQL_CLIENT_FILE_COMMAND = new RegExp([
4204
4461
  var SHORT_FLAG_CLUSTER_ONLY = /^-([A-Za-z0-9]+)$/;
4205
4462
  var LEADING_OPTION_DASHES = /^-+/;
4206
4463
  var NO_SQL = { script: false, sql: null, hidden: false };
4207
- var shortFlagOf = (flags, text2) => [...flags].find((flag) => /^-[A-Za-z]$/.test(flag) && text2.startsWith(flag) && text2.length > flag.length && !text2.startsWith("--"));
4464
+ var shortFlagOf = (flags, text3) => [...flags].find((flag) => /^-[A-Za-z]$/.test(flag) && text3.startsWith(flag) && text3.length > flag.length && !text3.startsWith("--"));
4208
4465
  var sqlArgumentAt = (args, index, syntax) => {
4209
4466
  const arg = args[index];
4210
4467
  if (arg === void 0) return NO_SQL;
@@ -4224,7 +4481,7 @@ var sqlArgumentAt = (args, index, syntax) => {
4224
4481
  if (cluster && cluster.length > 1 && syntax.inlineFlags.has(last)) return valueOf(next);
4225
4482
  return { script: false, sql: arg.text.replace(LEADING_OPTION_DASHES, ""), hidden: false };
4226
4483
  };
4227
- var namesALongFlagValue = (text2, flags) => [...flags].some((flag) => flag.startsWith("--") && text2.startsWith(`${flag}${FLAG_VALUE_SEPARATOR}`));
4484
+ var namesALongFlagValue = (text3, flags) => [...flags].some((flag) => flag.startsWith("--") && text3.startsWith(`${flag}${FLAG_VALUE_SEPARATOR}`));
4228
4485
  var positionalSqlIsHidden = (args, syntax) => syntax.positionalSql && args.filter((arg) => !arg.text.startsWith("-")).slice(1).some((arg) => arg.expands);
4229
4486
  var sqlClientSyntaxOf = ({ program }) => program === void 0 ? void 0 : SQL_CLIENT_SYNTAX.get(basenameOf(program.text));
4230
4487
  var sqlClientChangesData = (invocation) => {
@@ -4598,7 +4855,7 @@ var gitDiscardsWork = ({ program, args }) => {
4598
4855
  const [subcommand, ...rest] = argsAfterHarmlessGlobalFlags(args);
4599
4856
  const discards = GIT_WORK_DISCARDERS.get(subcommand?.text ?? "");
4600
4857
  const texts = rest.map((arg) => arg.text);
4601
- return discards !== void 0 && discards(texts.filter((text2) => FLAG.test(text2)), texts.filter((text2) => !FLAG.test(text2)));
4858
+ return discards !== void 0 && discards(texts.filter((text3) => FLAG.test(text3)), texts.filter((text3) => !FLAG.test(text3)));
4602
4859
  };
4603
4860
  var PACKAGE_MANAGERS = /* @__PURE__ */ new Set([
4604
4861
  "npm",
@@ -4746,25 +5003,25 @@ var WRAPPER_SYNTAX = /* @__PURE__ */ new Map([
4746
5003
  ]);
4747
5004
  var EVAL = "eval";
4748
5005
  var MAX_CONSEQUENCE_DEPTH = 4;
4749
- var shortValueOptionPosition = (text2, options) => {
4750
- if (!text2.startsWith("-") || text2.startsWith("--")) return -1;
4751
- for (let index = 1; index < text2.length; index += 1) {
4752
- if (options.has(`-${text2[index]}`)) return index;
5006
+ var shortValueOptionPosition = (text3, options) => {
5007
+ if (!text3.startsWith("-") || text3.startsWith("--")) return -1;
5008
+ for (let index = 1; index < text3.length; index += 1) {
5009
+ if (options.has(`-${text3[index]}`)) return index;
4753
5010
  }
4754
5011
  return -1;
4755
5012
  };
4756
- var wrapperOptionConsumesNextWord = (text2, options) => {
4757
- if (options.has(text2)) return true;
4758
- const position = shortValueOptionPosition(text2, options);
4759
- return position !== -1 && position === text2.length - 1;
5013
+ var wrapperOptionConsumesNextWord = (text3, options) => {
5014
+ if (options.has(text3)) return true;
5015
+ const position = shortValueOptionPosition(text3, options);
5016
+ return position !== -1 && position === text3.length - 1;
4760
5017
  };
4761
5018
  var commandStartAfterWrapper = (words, syntax) => {
4762
5019
  let index = 0;
4763
5020
  while (index < words.length) {
4764
- const text2 = words[index]?.text ?? "";
4765
- if (text2 === END_OF_OPTIONS3) return index + 1 + syntax.operandsBeforeTheCommand;
4766
- if (!SHELL_ENV_ASSIGNMENT.test(text2) && (!FLAG.test(text2) || text2 === STANDARD_INPUT_ARGUMENT)) break;
4767
- index += wrapperOptionConsumesNextWord(text2, syntax.optionsWithAValue) ? 2 : 1;
5021
+ const text3 = words[index]?.text ?? "";
5022
+ if (text3 === END_OF_OPTIONS3) return index + 1 + syntax.operandsBeforeTheCommand;
5023
+ if (!SHELL_ENV_ASSIGNMENT.test(text3) && (!FLAG.test(text3) || text3 === STANDARD_INPUT_ARGUMENT)) break;
5024
+ index += wrapperOptionConsumesNextWord(text3, syntax.optionsWithAValue) ? 2 : 1;
4768
5025
  }
4769
5026
  return index + syntax.operandsBeforeTheCommand;
4770
5027
  };
@@ -4866,16 +5123,16 @@ var pipesFetchedCodeIntoAnInterpreter = (command, invocations) => invocations.so
4866
5123
  var WORDS_THAT_OPEN_A_COMMAND = String.raw`if|then|elif|else|do|while|until|!`;
4867
5124
  var SHELL_GROUPING_PREFIX = new RegExp(String.raw`^\s*(?:(?:${WORDS_THAT_OPEN_A_COMMAND})\s+|[({]\s*)+`);
4868
5125
  var GROUP_OPENER_BY_CLOSER = /* @__PURE__ */ new Map([[")", "("], ["}", "{"]]);
4869
- var occurrencesOf = (text2, character) => text2.split(character).length - 1;
4870
- var closesAGroupItDidNotOpen = (text2) => {
4871
- const last = text2.at(-1) ?? "";
5126
+ var occurrencesOf = (text3, character) => text3.split(character).length - 1;
5127
+ var closesAGroupItDidNotOpen = (text3) => {
5128
+ const last = text3.at(-1) ?? "";
4872
5129
  const opener = GROUP_OPENER_BY_CLOSER.get(last);
4873
- return opener !== void 0 && occurrencesOf(text2, last) > occurrencesOf(text2, opener);
5130
+ return opener !== void 0 && occurrencesOf(text3, last) > occurrencesOf(text3, opener);
4874
5131
  };
4875
5132
  var withoutShellGrouping = (segment) => {
4876
- let text2 = segment.replace(SHELL_GROUPING_PREFIX, "").trimEnd();
4877
- while (closesAGroupItDidNotOpen(text2)) text2 = text2.slice(0, -1).trimEnd();
4878
- return text2;
5133
+ let text3 = segment.replace(SHELL_GROUPING_PREFIX, "").trimEnd();
5134
+ while (closesAGroupItDidNotOpen(text3)) text3 = text3.slice(0, -1).trimEnd();
5135
+ return text3;
4879
5136
  };
4880
5137
  var HEREDOC_OPERATOR = /(?<!<)\d*<<(?!<)-?[ \t]*(?:'([A-Za-z_]\w*)'|"([A-Za-z_]\w*)"|\\?([A-Za-z_]\w*))/g;
4881
5138
  var HEREDOC_MARK = "\uE001";
@@ -4908,24 +5165,24 @@ var SEPARATORS_INSIDE_DOUBLE_QUOTES = /* @__PURE__ */ new Set(["$(", "`", ")"]);
4908
5165
  var PIPE3 = "|";
4909
5166
  var SUBSTITUTION_OPENERS = /* @__PURE__ */ new Set(["$(", "`"]);
4910
5167
  var QUOTE_CHARACTERS = /['"]/g;
4911
- var roughPiecesOf = (text2) => {
5168
+ var roughPiecesOf = (text3) => {
4912
5169
  const pieces = [];
4913
5170
  let current = "";
4914
5171
  let before = "";
4915
5172
  let quote = null;
4916
- for (let index = 0; index < text2.length; index += 1) {
4917
- const char = text2.charAt(index);
5173
+ for (let index = 0; index < text3.length; index += 1) {
5174
+ const char = text3.charAt(index);
4918
5175
  if (quote === "'") {
4919
5176
  current += char;
4920
5177
  if (char === "'") quote = null;
4921
5178
  continue;
4922
5179
  }
4923
5180
  if (char === "\\") {
4924
- current += text2.slice(index, index + 2);
5181
+ current += text3.slice(index, index + 2);
4925
5182
  index += 1;
4926
5183
  continue;
4927
5184
  }
4928
- const separator = ROUGH_SEPARATORS.find((candidate) => text2.startsWith(candidate, index) && (quote === null || SEPARATORS_INSIDE_DOUBLE_QUOTES.has(candidate)));
5185
+ const separator = ROUGH_SEPARATORS.find((candidate) => text3.startsWith(candidate, index) && (quote === null || SEPARATORS_INSIDE_DOUBLE_QUOTES.has(candidate)));
4929
5186
  if (separator !== void 0) {
4930
5187
  pieces.push({ text: current, before });
4931
5188
  current = "";
@@ -4938,14 +5195,14 @@ var roughPiecesOf = (text2) => {
4938
5195
  }
4939
5196
  return [...pieces, { text: current, before }];
4940
5197
  };
4941
- var invocationOfRoughPiece = (text2) => {
4942
- const piece = withoutShellGrouping(text2.replaceAll(REDIRECTED_INPUT_MARK, "").replaceAll(HEREDOC_MARK, ""));
5198
+ var invocationOfRoughPiece = (text3) => {
5199
+ const piece = withoutShellGrouping(text3.replaceAll(REDIRECTED_INPUT_MARK, "").replaceAll(HEREDOC_MARK, ""));
4943
5200
  const parsed = invocationOf(piece);
4944
5201
  return parsed.program !== void 0 ? parsed : invocationOf(piece.replace(QUOTE_CHARACTERS, ""));
4945
5202
  };
4946
5203
  var roughSegmentsOf = (command) => {
4947
- const { text: text2, bodies } = withHeredocBodiesSetAside(commandForReading(command));
4948
- const pieces = roughPiecesOf(text2.replace(INPUT_REDIRECTION, ` ${REDIRECTED_INPUT_MARK} `).replace(OUTPUT_REDIRECTION, " "));
5204
+ const { text: text3, bodies } = withHeredocBodiesSetAside(commandForReading(command));
5205
+ const pieces = roughPiecesOf(text3.replace(INPUT_REDIRECTION, ` ${REDIRECTED_INPUT_MARK} `).replace(OUTPUT_REDIRECTION, " "));
4949
5206
  let heredocsSeen = 0;
4950
5207
  return pieces.map((piece, index) => {
4951
5208
  const heredocCount = occurrencesOf(piece.text, HEREDOC_MARK);
@@ -4982,7 +5239,7 @@ var commandHasAVisibleConsequenceAt = (toolName, command, depth) => {
4982
5239
  };
4983
5240
  var posixCommandOf = (words) => words.map(asOneShellWord).join(" ");
4984
5241
  var posixShellJudgeFor = (toolName) => ({
4985
- namesADestructiveAction: (text2) => classifyDecisionRisk(toolName, text2) === "destructive",
5242
+ namesADestructiveAction: (text3) => classifyDecisionRisk(toolName, text3) === "destructive",
4986
5243
  invocationShowsAConsequence: (invocation) => invocationHasAVisibleConsequence(SHELL_TOOL, invocation, 0),
4987
5244
  commandShowsAConsequence: (words) => commandHasAVisibleConsequenceAt(SHELL_TOOL, posixCommandOf(words), 1),
4988
5245
  onlyReads: (words) => isSafeReadOnlyCommand(posixCommandOf(words)),
@@ -5025,9 +5282,9 @@ var GIT_GLOBAL_FLAGS = /* @__PURE__ */ new Set([
5025
5282
  var GIT_OPTION_AND_ITS_VALUE = 2;
5026
5283
  var GIT_OPTION_ALONE = 1;
5027
5284
  var NOT_A_GIT_GLOBAL_OPTION = 0;
5028
- var gitGlobalOptionWidth = (text2) => {
5029
- if (GIT_GLOBAL_OPTIONS_WITH_A_VALUE.has(text2)) return GIT_OPTION_AND_ITS_VALUE;
5030
- const name = longOptionName(text2);
5285
+ var gitGlobalOptionWidth = (text3) => {
5286
+ if (GIT_GLOBAL_OPTIONS_WITH_A_VALUE.has(text3)) return GIT_OPTION_AND_ITS_VALUE;
5287
+ const name = longOptionName(text3);
5031
5288
  return GIT_GLOBAL_OPTIONS_WITH_A_VALUE.has(name) || GIT_GLOBAL_FLAGS.has(name) ? GIT_OPTION_ALONE : NOT_A_GIT_GLOBAL_OPTION;
5032
5289
  };
5033
5290
  var argsAfterGitGlobalOptions = (args) => {
@@ -5046,7 +5303,7 @@ var gitReadingsPastGlobalOptions = ({ program, args }) => {
5046
5303
  };
5047
5304
  var CURRENT_DIRECTORY_STEP = /\/\.(?=\/)/g;
5048
5305
  var LEADING_CURRENT_DIRECTORY = /^(?:\.\/+)+(?=[^/])/;
5049
- var canonicalPathWord = (text2) => text2.replace(CURRENT_DIRECTORY_STEP, "").replace(LEADING_CURRENT_DIRECTORY, "");
5306
+ var canonicalPathWord = (text3) => text3.replace(CURRENT_DIRECTORY_STEP, "").replace(LEADING_CURRENT_DIRECTORY, "");
5050
5307
  var verbatimInvocationText = (invocation) => wordsOfInvocation(invocation).map((word) => asOneShellWord(word.text)).join(" ");
5051
5308
  var canonicalInvocationText = (invocation) => invocationTextWith(invocation, (word) => asOneShellWord(canonicalPathWord(word.text)));
5052
5309
  var spellingsOfAnInvocation = (invocation, innermost) => [invocation, innermost, ...gitReadingsPastGlobalOptions(innermost), ...readingsPastGlobalFlags(innermost)].flatMap((reading) => [verbatimInvocationText(reading), canonicalInvocationText(reading)]);
@@ -5085,8 +5342,8 @@ var runsASubstitutionAsAProgram = (command) => {
5085
5342
  return visible !== null && SUBSTITUTION_AS_A_PROGRAM.test(visible);
5086
5343
  };
5087
5344
  var parsedSpelledSegment = (segment) => {
5088
- const text2 = withoutShellGrouping(segment);
5089
- return { text: text2, invocation: invocationOf(text2), heredocs: [], feedsASubstitution: false };
5345
+ const text3 = withoutShellGrouping(segment);
5346
+ return { text: text3, invocation: invocationOf(text3), heredocs: [], feedsASubstitution: false };
5090
5347
  };
5091
5348
  var roughSpelledSegment = ({ invocation, heredocs, feedsASubstitution }) => ({ text: verbatimInvocationText(invocation), invocation, heredocs, feedsASubstitution });
5092
5349
  var segmentHidesWhatItRuns = (segment, innermost, scripts) => programIsHidden(innermost) || scripts.kind === "hidden" || segment.feedsASubstitution && passesAnInlineScript(innermost);
@@ -5138,7 +5395,7 @@ var parseMcpToolName = (toolName) => {
5138
5395
  return { server: rest.slice(0, split), tool: rest.slice(split + 2) };
5139
5396
  };
5140
5397
  var INVISIBLE_CHARACTERS = /[\u200B-\u200D\u2060\uFEFF]/g;
5141
- var readableText = (text2) => text2.normalize("NFKC").replace(INVISIBLE_CHARACTERS, "");
5398
+ var readableText = (text3) => text3.normalize("NFKC").replace(INVISIBLE_CHARACTERS, "");
5142
5399
  var ACRONYM_BOUNDARY = /([A-Z]{1,63})([A-Z][a-z])/g;
5143
5400
  var CAMEL_CASE_BOUNDARY = /([a-z0-9])([A-Z])/g;
5144
5401
  var IDENTIFIER_WORD_SEPARATOR = /[^a-z0-9]+/;
@@ -5508,15 +5765,15 @@ var toolInputFieldNamed = (fieldName, parent) => {
5508
5765
  holdsGraphql: inherited.holdsGraphql || fieldWordsNameOnly(words, FIELD_WORDS_THAT_NAME_GRAPHQL, FIELD_WORDS_THAT_QUALIFY_A_QUERY)
5509
5766
  };
5510
5767
  };
5511
- var readableToolInputText = (text2) => {
5512
- if (text2.length > LONGEST_TOOL_INPUT_TEXT_READ || COMBINING_MARK_RUN_LONGER_THAN_ANY_LANGUAGE_WRITES.test(text2)) {
5768
+ var readableToolInputText = (text3) => {
5769
+ if (text3.length > LONGEST_TOOL_INPUT_TEXT_READ || COMBINING_MARK_RUN_LONGER_THAN_ANY_LANGUAGE_WRITES.test(text3)) {
5513
5770
  return UNREADABLE_TOOL_INPUT_TEXT;
5514
5771
  }
5515
- const readable = readableText(text2);
5772
+ const readable = readableText(text3);
5516
5773
  return readable.length > LONGEST_TOOL_INPUT_TEXT_READ ? UNREADABLE_TOOL_INPUT_TEXT : { kind: "readable", text: readable };
5517
5774
  };
5518
- var toolInputTextMatches = (field, text2, test) => {
5519
- const readable = readableToolInputText(text2);
5775
+ var toolInputTextMatches = (field, text3, test) => {
5776
+ const readable = readableToolInputText(text3);
5520
5777
  return readable.kind === "unreadable" || test(field, readable.text);
5521
5778
  };
5522
5779
  var fieldNameTooLongToRead = (fieldName) => fieldName.length > LONGEST_TOOL_INPUT_FIELD_NAME_READ;
@@ -5550,9 +5807,9 @@ var WRITTEN_WEB_ADDRESSES = [
5550
5807
  /\blocalhost(?::\d|\/)/i
5551
5808
  ];
5552
5809
  var WHOLE_VALUE_HOST_THAT_CARRIES_DATA_IN_ITS_QUERY = /^[<"'(\[]?(?:[^@\s/]{1,64}@)?(?:[a-z0-9-]{1,63}\.)+[a-z]{2,63}(?::\d{1,5})?(?:\/[^\s?#]*)?\?[^\s#]\S*$/i;
5553
- var textNamesAWebAddress = (field, text2) => {
5554
- const unbroken = text2.replace(LINE_BREAKS_A_URL_PARSER_DROPS, "");
5555
- return field.holdsAnAddress && text2.trim().length > 0 || WRITTEN_WEB_ADDRESSES.some((pattern) => pattern.test(unbroken)) || WHOLE_VALUE_HOST_THAT_CARRIES_DATA_IN_ITS_QUERY.test(unbroken.trim());
5810
+ var textNamesAWebAddress = (field, text3) => {
5811
+ const unbroken = text3.replace(LINE_BREAKS_A_URL_PARSER_DROPS, "");
5812
+ return field.holdsAnAddress && text3.trim().length > 0 || WRITTEN_WEB_ADDRESSES.some((pattern) => pattern.test(unbroken)) || WHOLE_VALUE_HOST_THAT_CARRIES_DATA_IN_ITS_QUERY.test(unbroken.trim());
5556
5813
  };
5557
5814
  var HTTP_METHODS_THAT_WRITE = /* @__PURE__ */ new Set([
5558
5815
  "POST",
@@ -5622,20 +5879,20 @@ var STATEMENTS_THAT_CHANGE = [
5622
5879
  String.raw`\bpg_(?:terminate|cancel)_backend\b`,
5623
5880
  String.raw`\bmutation\b(?:\s+[a-z_]\w{0,127})?\s*(?:\{|@[a-z_]|\(\s*\$)`
5624
5881
  ].map((source) => new RegExp(source, "i"));
5625
- var fieldSetsAnHttpMethodThatWrites = (field, text2) => field.namesAnHttpMethod && HTTP_METHODS_THAT_WRITE.has(text2.trim().toUpperCase());
5626
- var sqlTextWritesAsAClientReadsIt = (text2) => writesThroughSql(text2, UNVERIFIED_SQL_LEXICON);
5627
- var fieldHoldsSqlThatWrites = (field, text2) => field.holdsSql && sqlTextWritesAsAClientReadsIt(text2);
5628
- var fieldHoldsAGraphqlMutation = (field, text2) => field.holdsGraphql && GRAPHQL_MUTATION.test(text2);
5882
+ var fieldSetsAnHttpMethodThatWrites = (field, text3) => field.namesAnHttpMethod && HTTP_METHODS_THAT_WRITE.has(text3.trim().toUpperCase());
5883
+ var sqlTextWritesAsAClientReadsIt = (text3) => writesThroughSql(text3, UNVERIFIED_SQL_LEXICON);
5884
+ var fieldHoldsSqlThatWrites = (field, text3) => field.holdsSql && sqlTextWritesAsAClientReadsIt(text3);
5885
+ var fieldHoldsAGraphqlMutation = (field, text3) => field.holdsGraphql && GRAPHQL_MUTATION.test(text3);
5629
5886
  var COPY_OF_A_SUBQUERY = /\bcopy\s*\((?:\s*\()*\s*(?:select|with|values|table|insert|update|delete|merge)\b/i;
5630
5887
  var COPY_TO_A_PROGRAM_OR_A_FILE = /\)\s*to\s+(?:program\b|')/i;
5631
- var copiesASubqueryOut = (text2) => {
5632
- const copy = text2.search(COPY_OF_A_SUBQUERY);
5633
- return copy !== -1 && COPY_TO_A_PROGRAM_OR_A_FILE.test(text2.slice(copy));
5634
- };
5635
- var carriesAStatementThatChanges = (text2) => STATEMENTS_THAT_CHANGE.some((pattern) => pattern.test(text2)) || copiesASubqueryOut(text2);
5636
- var textCarriesAStatementThatChanges = (text2) => carriesAStatementThatChanges(text2) || carriesAStatementThatChanges(text2.replace(SQL_COMMENT, " "));
5637
- var textAsksToChange = (field, text2) => fieldSetsAnHttpMethodThatWrites(field, text2) || fieldHoldsSqlThatWrites(field, text2) || fieldHoldsAGraphqlMutation(field, text2) || textCarriesAStatementThatChanges(text2);
5638
- var textNeedsAPersonFor = (toolNamesADatabase) => (field, text2) => textNamesAWebAddress(field, text2) || textAsksToChange(field, text2) || toolNamesADatabase && sqlTextWritesAsAClientReadsIt(text2);
5888
+ var copiesASubqueryOut = (text3) => {
5889
+ const copy = text3.search(COPY_OF_A_SUBQUERY);
5890
+ return copy !== -1 && COPY_TO_A_PROGRAM_OR_A_FILE.test(text3.slice(copy));
5891
+ };
5892
+ var carriesAStatementThatChanges = (text3) => STATEMENTS_THAT_CHANGE.some((pattern) => pattern.test(text3)) || copiesASubqueryOut(text3);
5893
+ var textCarriesAStatementThatChanges = (text3) => carriesAStatementThatChanges(text3) || carriesAStatementThatChanges(text3.replace(SQL_COMMENT, " "));
5894
+ var textAsksToChange = (field, text3) => fieldSetsAnHttpMethodThatWrites(field, text3) || fieldHoldsSqlThatWrites(field, text3) || fieldHoldsAGraphqlMutation(field, text3) || textCarriesAStatementThatChanges(text3);
5895
+ var textNeedsAPersonFor = (toolNamesADatabase) => (field, text3) => textNamesAWebAddress(field, text3) || textAsksToChange(field, text3) || toolNamesADatabase && sqlTextWritesAsAClientReadsIt(text3);
5639
5896
  var mcpToolInputOnlyReads = (toolName, toolInput) => !toolInputTooLargeToRead(toolInput) && !anyToolInputText(toolInput, UNNAMED_TOOL_INPUT_FIELD, 0, textNeedsAPersonFor(mcpToolNamesADatabase(toolName)));
5640
5897
  var allowsSessionToolGrant = (toolName) => SESSION_TOOL_GRANT_TOOLS.has(toolName) || mcpToolOnlyReads(toolName);
5641
5898
  var isSessionToolGrant = (policy) => Boolean(policy.sessionId) && allowsSessionToolGrant(policy.tool) && isAutoApprove(policy);
@@ -5650,11 +5907,11 @@ var ASK_CONTEXT_MAX = 500;
5650
5907
  var ASK_AGENT_NAME_MAX = 100;
5651
5908
  var TRUNCATION_MARK = "\u2026";
5652
5909
  var isHighSurrogate = (code) => code >= 55296 && code <= 56319;
5653
- var truncateLine = (text2, max, mark = TRUNCATION_MARK) => {
5654
- if (text2.length <= max) return text2;
5910
+ var truncateLine = (text3, max, mark = TRUNCATION_MARK) => {
5911
+ if (text3.length <= max) return text3;
5655
5912
  const end = max - mark.length;
5656
- const keep = isHighSurrogate(text2.charCodeAt(end - 1)) ? end - 1 : end;
5657
- return `${text2.slice(0, keep)}${mark}`;
5913
+ const keep = isHighSurrogate(text3.charCodeAt(end - 1)) ? end - 1 : end;
5914
+ return `${text3.slice(0, keep)}${mark}`;
5658
5915
  };
5659
5916
  var APPROVAL_FATIGUE_FLAG_PATTERNS = [
5660
5917
  /\brm\s+-[a-z]*r/i,
@@ -5716,9 +5973,9 @@ var addAlnumTokens = (source, set) => {
5716
5973
  if (raw) set.add(raw);
5717
5974
  }
5718
5975
  };
5719
- var tokenize = (text2) => {
5976
+ var tokenize = (text3) => {
5720
5977
  const set = /* @__PURE__ */ new Set();
5721
- for (const raw of text2.toLowerCase().split(/[^a-z0-9]+/)) {
5978
+ for (const raw of text3.toLowerCase().split(/[^a-z0-9]+/)) {
5722
5979
  if (raw && !DELTA_STOPWORDS.has(raw)) set.add(raw);
5723
5980
  }
5724
5981
  return set;
@@ -5989,19 +6246,19 @@ var deriveTargetClass = (path) => {
5989
6246
  var bucketArgCount = (n) => n <= 0 ? "none" : n <= 3 ? "few" : "many";
5990
6247
  var bucketLength = (n) => n < 40 ? "short" : n < 200 ? "medium" : "long";
5991
6248
  var deriveArgShape = (isCommand, commandText, path) => {
5992
- const text2 = isCommand ? commandText : path;
5993
- const tokenCount = isCommand ? text2.trim().split(/\s+/).filter(Boolean).length : 0;
6249
+ const text3 = isCommand ? commandText : path;
6250
+ const tokenCount = isCommand ? text3.trim().split(/\s+/).filter(Boolean).length : 0;
5994
6251
  return {
5995
- hasPipe: isCommand && /(?<!\|)\|(?!\|)/.test(text2),
5996
- hasRedirect: isCommand && /(?<![0-9])[<>]/.test(text2),
5997
- hasChain: isCommand && /&&|\|\||;/.test(text2),
5998
- hasSudo: /\bsudo\b/i.test(text2),
5999
- hasGlob: isCommand && /[*?]/.test(text2),
6000
- hasSubshell: isCommand && /\$\(|`/.test(text2),
6001
- touchesSecretPath: SECRET_TARGET_PATTERNS.some((re) => re.test(text2)),
6252
+ hasPipe: isCommand && /(?<!\|)\|(?!\|)/.test(text3),
6253
+ hasRedirect: isCommand && /(?<![0-9])[<>]/.test(text3),
6254
+ hasChain: isCommand && /&&|\|\||;/.test(text3),
6255
+ hasSudo: /\bsudo\b/i.test(text3),
6256
+ hasGlob: isCommand && /[*?]/.test(text3),
6257
+ hasSubshell: isCommand && /\$\(|`/.test(text3),
6258
+ touchesSecretPath: SECRET_TARGET_PATTERNS.some((re) => re.test(text3)),
6002
6259
  // The command word itself is not an argument, so subtract one.
6003
6260
  argCountBucket: bucketArgCount(isCommand ? Math.max(0, tokenCount - 1) : 0),
6004
- lengthBucket: bucketLength(text2.length)
6261
+ lengthBucket: bucketLength(text3.length)
6005
6262
  };
6006
6263
  };
6007
6264
  var deriveReversibility = (capability, riskClass) => {
@@ -6331,8 +6588,8 @@ var isBlockedActionRequest = (request) => isBlockedActionEvent(request) && block
6331
6588
  var canonicalJsonText = (value) => {
6332
6589
  if (Array.isArray(value)) return `[${value.map(canonicalJsonText).join(",")}]`;
6333
6590
  if (value !== null && typeof value === "object") {
6334
- const record3 = value;
6335
- return `{${Object.keys(record3).filter((key) => record3[key] !== void 0).sort().map((key) => `${JSON.stringify(key)}:${canonicalJsonText(record3[key])}`).join(",")}}`;
6591
+ const record4 = value;
6592
+ return `{${Object.keys(record4).filter((key) => record4[key] !== void 0).sort().map((key) => `${JSON.stringify(key)}:${canonicalJsonText(record4[key])}`).join(",")}}`;
6336
6593
  }
6337
6594
  return JSON.stringify(value) ?? "null";
6338
6595
  };
@@ -6723,11 +6980,11 @@ var elicitationEnum = (property) => {
6723
6980
  return members.length === property.enum.length && members.length >= ELICITATION_MIN_OPTIONS ? members : null;
6724
6981
  };
6725
6982
  var readElicitationFields = (schema) => {
6726
- const record3 = elicitationRecord(schema);
6727
- const properties = elicitationRecord(record3?.properties);
6728
- if (!properties || record3?.type !== "object") return null;
6729
- if (Object.keys(record3).some((key) => !["type", "properties", "required", "$schema"].includes(key))) return null;
6730
- if (record3.required !== void 0 && (!Array.isArray(record3.required) || !record3.required.every((name) => typeof name === "string" && Object.hasOwn(properties, name)))) return null;
6983
+ const record4 = elicitationRecord(schema);
6984
+ const properties = elicitationRecord(record4?.properties);
6985
+ if (!properties || record4?.type !== "object") return null;
6986
+ if (Object.keys(record4).some((key) => !["type", "properties", "required", "$schema"].includes(key))) return null;
6987
+ if (record4.required !== void 0 && (!Array.isArray(record4.required) || !record4.required.every((name) => typeof name === "string" && Object.hasOwn(properties, name)))) return null;
6731
6988
  const entries = Object.entries(properties);
6732
6989
  if (entries.length === 0) return null;
6733
6990
  const fields = [];
@@ -6851,6 +7108,24 @@ var hookActivationResult = (report) => {
6851
7108
  export {
6852
7109
  conversationText,
6853
7110
  extractMessageText,
7111
+ NativeInputAgent,
7112
+ NATIVE_INPUT,
7113
+ qualifyHermesReceiptMode,
7114
+ nativeRecord,
7115
+ nativeIdentifier,
7116
+ nativeInputAction,
7117
+ isCodexQueuedReceipt,
7118
+ isCodexInputReceipt,
7119
+ parseHermesAdmission,
7120
+ parseHermesReplayCursor,
7121
+ hermesPendingAdmissionId,
7122
+ hermesReplayAdmissionId,
7123
+ COMMAND_RECOVERY,
7124
+ isCommandAcknowledgementReceipt,
7125
+ CLAUDE_WAKE,
7126
+ claudeWakeDecision,
7127
+ CLAUDE_WAKE_API,
7128
+ claudeWakeWaitingOn,
6854
7129
  isRecord,
6855
7130
  AGENT_QUESTION_HEADER_MAX,
6856
7131
  AGENT_QUESTION_OPTION_MAX,
@@ -6908,6 +7183,7 @@ export {
6908
7183
  toolsCoveredByGateEntry,
6909
7184
  cursorGateOwnsToolCall,
6910
7185
  claudeTurnEndOutput,
7186
+ PENDING_COMMAND_PREFIX,
6911
7187
  pendingCommandInstruction,
6912
7188
  degradedLine,
6913
7189
  KEY_SCOPE,
@@ -6936,6 +7212,7 @@ export {
6936
7212
  withDeclinedAgent,
6937
7213
  withoutDeclinedAgent,
6938
7214
  isAutoUpdateResult,
7215
+ SESSION_HISTORY_BACKFILL_LIMIT_BYTES,
6939
7216
  PERSONAL_QUESTION_CAPABILITY,
6940
7217
  isQuestionOwner,
6941
7218
  CODEX_SHELL_COMMAND_FLAGS,
@@ -6945,7 +7222,17 @@ export {
6945
7222
  CODEX_NATIVE_APPROVAL_REPLIES,
6946
7223
  parseCodexNativeApproval,
6947
7224
  codexNativeApprovalResponse,
7225
+ transcriptRecordPlaintext,
6948
7226
  compressTranscriptRecord,
7227
+ CLAUDE_INBOX,
7228
+ parseClaudeInboxSession,
7229
+ claudeInboxAction,
7230
+ isClaudeInboxReceipt,
7231
+ CLAUDE_INBOX_MAX_SESSIONS,
7232
+ parseClaudeInboxPoll,
7233
+ parseClaudeInboxClaim,
7234
+ CLAUDE_INBOX_RECEIVER,
7235
+ CLAUDE_INBOX_SETTLEMENTS,
6949
7236
  isApprovalMode,
6950
7237
  APPROVAL_MODE_META,
6951
7238
  approvalModeWithoutLocalPrompt,