pushary 1.9.61 → 1.9.62

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 (122) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/dist/{api-LW3PJQYY.js → api-7HLZRIUV.js} +14 -12
  3. package/dist/bin/pushary-bell-hook.js +27 -27
  4. package/dist/bin/pushary-bell.js +10 -10
  5. package/dist/bin/pushary-claude.js +33 -26
  6. package/dist/bin/pushary-clean.js +33 -33
  7. package/dist/bin/pushary-codex-bridge.js +21 -21
  8. package/dist/bin/pushary-codex-hook.js +48 -35
  9. package/dist/bin/pushary-codex-session.js +8 -8
  10. package/dist/bin/pushary-codex.js +14 -14
  11. package/dist/bin/pushary-connect.js +27 -27
  12. package/dist/bin/pushary-cowork.js +5 -5
  13. package/dist/bin/pushary-daemon.js +37 -37
  14. package/dist/bin/pushary-disconnect.js +26 -26
  15. package/dist/bin/pushary-doctor.js +40 -40
  16. package/dist/bin/pushary-elicitation-hook.js +29 -27
  17. package/dist/bin/pushary-gemini-bridge.js +15 -15
  18. package/dist/bin/pushary-gemini-hook.js +37 -29
  19. package/dist/bin/pushary-hook.js +32 -31
  20. package/dist/bin/pushary-login.js +14 -14
  21. package/dist/bin/pushary-logout.js +27 -27
  22. package/dist/bin/pushary-mcp.js +11 -11
  23. package/dist/bin/pushary-mode.js +14 -14
  24. package/dist/bin/pushary-notification-hook.js +26 -26
  25. package/dist/bin/pushary-opencode-hook.js +39 -30
  26. package/dist/bin/pushary-permission-denied-hook.js +31 -31
  27. package/dist/bin/pushary-permission-hook.js +30 -30
  28. package/dist/bin/pushary-post-hook.js +26 -26
  29. package/dist/bin/pushary-prompt-hook.js +26 -26
  30. package/dist/bin/pushary-session-end-hook.js +26 -26
  31. package/dist/bin/pushary-session-start-hook.js +33 -33
  32. package/dist/bin/pushary-setup.js +44 -44
  33. package/dist/bin/pushary-stats.js +5 -5
  34. package/dist/bin/pushary-status.js +31 -31
  35. package/dist/bin/pushary-stop-hook.js +26 -26
  36. package/dist/bin/pushary-stopfailure-hook.js +26 -26
  37. package/dist/bin/pushary-suggestions.js +14 -14
  38. package/dist/bin/pushary-transcript-register.js +18 -18
  39. package/dist/bin/pushary-transcripts.js +7 -7
  40. package/dist/bin/pushary-upgrade.js +37 -37
  41. package/dist/bin/pushary-wait.js +14 -14
  42. package/dist/bin/pushary.js +7 -7
  43. package/dist/{chunk-ZEWIMY63.js → chunk-3IFCXMC6.js} +1 -1
  44. package/dist/{chunk-GZCSWDAS.js → chunk-3LBB7GVF.js} +4 -4
  45. package/dist/{chunk-WFSGCFXQ.js → chunk-3YGUWPNZ.js} +2 -6
  46. package/dist/{chunk-SVQWHV65.js → chunk-44FNEAXK.js} +1 -1
  47. package/dist/{chunk-YPD3MTFU.js → chunk-4K6YZPZ3.js} +1 -1
  48. package/dist/{chunk-GKFO5JLN.js → chunk-557ZE5EX.js} +4 -4
  49. package/dist/{chunk-LBHJJEKT.js → chunk-5R23J52J.js} +6 -6
  50. package/dist/{chunk-ORX5BTV4.js → chunk-67Q3Q5IO.js} +8 -6
  51. package/dist/{chunk-ZGU3NXL2.js → chunk-6HIYOY6I.js} +5 -5
  52. package/dist/{chunk-LN7DE5LY.js → chunk-6JAWNRDR.js} +2 -2
  53. package/dist/{chunk-MWLTTLPK.js → chunk-6YSEOXP5.js} +2 -2
  54. package/dist/{chunk-4N5E4JNF.js → chunk-7E2ZN7XA.js} +2 -2
  55. package/dist/{chunk-P3VQH65N.js → chunk-7EHZXZB2.js} +33 -20
  56. package/dist/{chunk-2AELPDMT.js → chunk-7ETELRQX.js} +1 -1
  57. package/dist/{chunk-7BHI3PZN.js → chunk-7GU4PXE5.js} +1 -1
  58. package/dist/{chunk-BJTSKOH3.js → chunk-7NJ4TDUH.js} +5 -5
  59. package/dist/{chunk-X3YKQJCZ.js → chunk-7NXB7OVX.js} +1 -1
  60. package/dist/{chunk-XEJOPVCG.js → chunk-A4CZPUQ6.js} +1 -1
  61. package/dist/{chunk-64S5PQBQ.js → chunk-AFV3FQNG.js} +4 -4
  62. package/dist/{chunk-QER5R7Z6.js → chunk-BIUSODLS.js} +2 -2
  63. package/dist/{chunk-CJ5TCFD4.js → chunk-CFIQ3252.js} +3 -3
  64. package/dist/{chunk-BG4Y64FW.js → chunk-DFKEJARZ.js} +1 -1
  65. package/dist/{chunk-GDKQUB52.js → chunk-EA6574W2.js} +5 -5
  66. package/dist/{chunk-UADSXJZ4.js → chunk-EO6CL4PD.js} +2 -2
  67. package/dist/{chunk-XAO6EYGM.js → chunk-ESXGCZDA.js} +26 -3
  68. package/dist/{chunk-EUIPTDLX.js → chunk-EUNSJKJJ.js} +8 -8
  69. package/dist/{chunk-BUZIEL7Y.js → chunk-EVZDYG7L.js} +2 -2
  70. package/dist/{chunk-IFPOHFDJ.js → chunk-F35YILEN.js} +1 -1
  71. package/dist/{chunk-ERK24P76.js → chunk-FG5HMJ7C.js} +1 -1
  72. package/dist/{chunk-NKLNU577.js → chunk-FX7KDF47.js} +3 -3
  73. package/dist/{chunk-AXJLJJ3M.js → chunk-FXECTHAG.js} +73 -2
  74. package/dist/chunk-FYS27SUS.js +216 -0
  75. package/dist/{chunk-SFAP4AJY.js → chunk-G3ZDCYMU.js} +1 -1
  76. package/dist/{chunk-ELLJPP6O.js → chunk-GFAG72LR.js} +2 -2
  77. package/dist/{chunk-ATKN4BJT.js → chunk-GV43RXR2.js} +1 -1
  78. package/dist/{chunk-7BAO42UV.js → chunk-HSRNWCXJ.js} +3 -3
  79. package/dist/{chunk-RGSW36XH.js → chunk-LCNN7UOE.js} +3 -3
  80. package/dist/{chunk-4VRTSDGP.js → chunk-LILS32LF.js} +5 -5
  81. package/dist/{chunk-33OOEVPG.js → chunk-LL2KHEJH.js} +1 -1
  82. package/dist/{chunk-DQLCFGHK.js → chunk-LWR5VKNC.js} +15 -9
  83. package/dist/{chunk-CICLXLQN.js → chunk-M7MEVILL.js} +3 -3
  84. package/dist/{chunk-XV6S5PWW.js → chunk-MURJ4WAL.js} +1 -1
  85. package/dist/{chunk-FUZ5VYWD.js → chunk-MYEALNW6.js} +1 -1
  86. package/dist/{chunk-ADR3KHOC.js → chunk-NAZRRXZM.js} +2 -2
  87. package/dist/{chunk-VX2MJ4X7.js → chunk-NZLQ6GMX.js} +4 -4
  88. package/dist/{chunk-K4MBKXAE.js → chunk-OZRT64BB.js} +1 -1
  89. package/dist/{chunk-Y5VKZNFN.js → chunk-PSCXEH42.js} +2 -2
  90. package/dist/{chunk-YDR4BQ7R.js → chunk-Q4WTIKM6.js} +3 -3
  91. package/dist/{chunk-KPNZ7JUL.js → chunk-QIPW7OVB.js} +4 -4
  92. package/dist/{chunk-USE5IEEW.js → chunk-R3CLBNST.js} +1 -1
  93. package/dist/{chunk-SHJVFW22.js → chunk-RFCEVROB.js} +2 -2
  94. package/dist/{chunk-RJHX66EY.js → chunk-RSNN2TPE.js} +13 -8
  95. package/dist/{chunk-HUI4OE43.js → chunk-RU37NSZH.js} +3 -3
  96. package/dist/{chunk-7MCCXE5Y.js → chunk-SDOWT67G.js} +5 -5
  97. package/dist/{chunk-BQ2VV7LY.js → chunk-SJCPIYWJ.js} +2 -2
  98. package/dist/{chunk-O65F2IIN.js → chunk-SJJYXMJP.js} +6 -6
  99. package/dist/{chunk-G36T5LAP.js → chunk-TMHE5CVX.js} +3 -3
  100. package/dist/{chunk-GAMVAORR.js → chunk-UUAVYIWJ.js} +1 -1
  101. package/dist/{chunk-PITQ5ZIQ.js → chunk-UWCPY4RY.js} +2 -2
  102. package/dist/{chunk-7HDGH3Z2.js → chunk-VF3IL56Q.js} +2 -2
  103. package/dist/{chunk-WN3RACVD.js → chunk-W3CBFLIX.js} +3 -3
  104. package/dist/{chunk-6T5Z64KS.js → chunk-W6MYFAOK.js} +10 -10
  105. package/dist/{chunk-Y6Z7DA5Y.js → chunk-YQK72JGV.js} +5 -5
  106. package/dist/{chunk-7JXJJNQ5.js → chunk-ZEDGKCCM.js} +1 -1
  107. package/dist/{chunk-JGQV4MDQ.js → chunk-ZJFJUAHS.js} +6 -6
  108. package/dist/{codex-app-cards-switch-BD7LCI2I.js → codex-app-cards-switch-IIL7IPP6.js} +11 -11
  109. package/dist/{codex-desktop-launch-V5CASSBB.js → codex-desktop-launch-XCLMYVBD.js} +1 -1
  110. package/dist/{codex-session-launch-5PKFKUFD.js → codex-session-launch-UMVALJ3A.js} +18 -18
  111. package/dist/{config-AEKH7HGC.js → config-5N3GUJD5.js} +3 -3
  112. package/dist/{global-upgrade-IUXJJDWF.js → global-upgrade-5F4CSXED.js} +9 -9
  113. package/dist/{identity-YJIV2XTY.js → identity-7ULYW4RL.js} +4 -4
  114. package/dist/{live-capabilities-QYFW5QAW.js → live-capabilities-QTSFXA6T.js} +4 -4
  115. package/dist/{paths-A5GAR5PL.js → paths-HEMK2ALW.js} +3 -3
  116. package/dist/{reapply-BKJGICRJ.js → reapply-AMFKVYZV.js} +26 -26
  117. package/dist/src/index.d.ts +1 -0
  118. package/dist/src/index.js +21 -21
  119. package/dist/{upgrade-lock-DDB7WEWC.js → upgrade-lock-IAZC5644.js} +4 -4
  120. package/dist/{usage-HBDNFZ3O.js → usage-NEFDYSRT.js} +3 -3
  121. package/package.json +1 -1
  122. package/dist/chunk-6FJ6CK32.js +0 -126
@@ -0,0 +1,216 @@
1
+ import {
2
+ registerTranscript
3
+ } from "./chunk-EUNSJKJJ.js";
4
+ import {
5
+ namedEvent
6
+ } from "./chunk-557ZE5EX.js";
7
+ import {
8
+ isBridgeLocator,
9
+ liveBridgeProbe,
10
+ pusharyHookExecutable,
11
+ resolveBridgeStub
12
+ } from "./chunk-7NJ4TDUH.js";
13
+ import {
14
+ atLeast,
15
+ parseVersion
16
+ } from "./chunk-6ICPEJY5.js";
17
+ import {
18
+ writeDegraded
19
+ } from "./chunk-RSNN2TPE.js";
20
+ import {
21
+ cursorUserHooks
22
+ } from "./chunk-6YSEOXP5.js";
23
+ import {
24
+ CURSOR_GATE_COVERAGE,
25
+ CURSOR_GATE_SCRIPT,
26
+ HOOK_VERSION_PATTERN,
27
+ NO_CURSOR_GATE,
28
+ claudeShapedHookInput,
29
+ cursorGateOwnsToolCall,
30
+ hookCompatibleProfileBySource,
31
+ isCursorHookPayload,
32
+ isGrokHookPayload,
33
+ isGrokSessionEndStop,
34
+ isRecord,
35
+ toolsCoveredByGateEntry
36
+ } from "./chunk-FXECTHAG.js";
37
+
38
+ // src/tool-hook-input.ts
39
+ var OPTIONAL_TEXT_FIELDS = ["hook_event_name", "session_id", "cwd", "transcript_path", "tool_use_id", "permission_mode", "cursor_version"];
40
+ function isInputRecord(value) {
41
+ return value !== null && typeof value === "object" && !Array.isArray(value);
42
+ }
43
+ function isToolHookInput(value) {
44
+ if (!isInputRecord(value)) return false;
45
+ if (typeof value.tool_name !== "string" || value.tool_name.length === 0) return false;
46
+ if (!isInputRecord(value.tool_input)) return false;
47
+ for (const field of OPTIONAL_TEXT_FIELDS) {
48
+ if (value[field] !== void 0 && typeof value[field] !== "string") return false;
49
+ }
50
+ return true;
51
+ }
52
+ function parseToolHookInput(value) {
53
+ if (!isInputRecord(value)) return null;
54
+ const input = { ...value, tool_input: value.tool_input === void 0 ? {} : value.tool_input };
55
+ return isToolHookInput(input) ? input : null;
56
+ }
57
+
58
+ // src/admission.ts
59
+ import { readFileSync } from "fs";
60
+ import { homedir } from "os";
61
+ import { join as join2 } from "path";
62
+
63
+ // src/cursor-gate-registration.ts
64
+ import { dirname, isAbsolute, join, resolve } from "path";
65
+ var FIRST_PLUGIN_VERSION_HANDLING = {
66
+ beforeShellExecution: [0, 1, 0],
67
+ beforeMCPExecution: [0, 2, 1],
68
+ preToolUse: [0, 2, 2]
69
+ };
70
+ var COMMAND_HOOK_TYPE = "command";
71
+ var PLUGIN_MANIFEST = join(".cursor-plugin", "plugin.json");
72
+ var NO_SPOTLIGHT = () => [];
73
+ var executableName = (executable) => executable.split(/[/\\]/).pop() ?? "";
74
+ var isCursorGateScript = (executable) => executableName(executable) === CURSOR_GATE_SCRIPT;
75
+ var fromHooksDirectory = (path, environment) => isAbsolute(path) ? path : resolve(dirname(environment.hooksFile), path);
76
+ var pluginManifestBeside = (script) => join(dirname(dirname(script)), PLUGIN_MANIFEST);
77
+ var versionIn = (manifest) => {
78
+ try {
79
+ const parsed = JSON.parse(manifest);
80
+ return isRecord(parsed) && typeof parsed.version === "string" && HOOK_VERSION_PATTERN.test(parsed.version) ? parseVersion(parsed.version) : null;
81
+ } catch {
82
+ return null;
83
+ }
84
+ };
85
+ var pluginVersionOf = (script, probe) => {
86
+ const manifest = probe.readFile(pluginManifestBeside(script));
87
+ return manifest === null ? null : versionIn(manifest);
88
+ };
89
+ var gateScriptHandles = (script, event, probe) => {
90
+ if (!probe.exists(script)) return false;
91
+ const version = pluginVersionOf(script, probe);
92
+ return version !== null && atLeast(version, FIRST_PLUGIN_VERSION_HANDLING[event]);
93
+ };
94
+ var appBundleResolves = (locator, probe) => resolveBridgeStub(locator, { ...probe, mdfind: NO_SPOTLIGHT }).kind === "bundle";
95
+ var isLiveCursorGateCommand = (command, event, environment) => {
96
+ const executable = pusharyHookExecutable(command);
97
+ if (executable === null) return false;
98
+ const target = fromHooksDirectory(executable, environment);
99
+ if (isCursorGateScript(executable)) return gateScriptHandles(target, event, environment.probe);
100
+ return isBridgeLocator(executable) && appBundleResolves(target, environment.probe);
101
+ };
102
+ var isCommandHook = (entry) => entry.type === void 0 || entry.type === COMMAND_HOOK_TYPE;
103
+ var entriesOn = (hooks, event) => {
104
+ const entries = Object.hasOwn(hooks, event) ? hooks[event] : void 0;
105
+ return Array.isArray(entries) ? entries.filter(isRecord) : [];
106
+ };
107
+ var runsALiveGate = (entry, event, isLiveGate) => isCommandHook(entry) && typeof entry.command === "string" && isLiveGate(entry.command, event);
108
+ var toolsCoveredOn = (hooks, coverage, isLiveGate) => entriesOn(hooks, coverage.event).filter((entry) => runsALiveGate(entry, coverage.event, isLiveGate)).flatMap((entry) => toolsCoveredByGateEntry(coverage, entry.matcher) ?? []);
109
+ var cursorGateRegistrationOf = (document, isLiveGate) => {
110
+ if (!isRecord(document) || !isRecord(document.hooks)) return NO_CURSOR_GATE;
111
+ const hooks = document.hooks;
112
+ return CURSOR_GATE_COVERAGE.flatMap((coverage) => toolsCoveredOn(hooks, coverage, isLiveGate));
113
+ };
114
+ var userCursorGateEnvironment = () => ({ hooksFile: cursorUserHooks(), probe: liveBridgeProbe() });
115
+ var readCursorGateRegistration = (environment = userCursorGateEnvironment()) => {
116
+ try {
117
+ const raw = environment.probe.readFile(environment.hooksFile);
118
+ if (raw === null) return NO_CURSOR_GATE;
119
+ return cursorGateRegistrationOf(JSON.parse(raw), (command, event) => isLiveCursorGateCommand(command, event, environment));
120
+ } catch {
121
+ return NO_CURSOR_GATE;
122
+ }
123
+ };
124
+ var cursorGateOwnsClaudeCall = (payload, readRegistration) => isCursorHookPayload(payload) && cursorGateOwnsToolCall(readRegistration(), payload.tool_name);
125
+
126
+ // src/admission.ts
127
+ var NO_RULES = { version: 1, disabled: [] };
128
+ var SUPPORTED_VERSION = 1;
129
+ var parseAdmissionRules = (raw) => {
130
+ if (!raw) return NO_RULES;
131
+ try {
132
+ const parsed = JSON.parse(raw);
133
+ if (parsed.version !== SUPPORTED_VERSION) return NO_RULES;
134
+ if (!Array.isArray(parsed.disabled)) return NO_RULES;
135
+ return {
136
+ version: SUPPORTED_VERSION,
137
+ disabled: parsed.disabled.filter((rule) => typeof rule === "string")
138
+ };
139
+ } catch {
140
+ return NO_RULES;
141
+ }
142
+ };
143
+ var admissionRulesFile = () => process.env.PUSHARY_ADMISSION_FILE?.trim() || join2(homedir(), ".pushary", "admission-rules.json");
144
+ var readAdmissionRules = () => {
145
+ try {
146
+ return parseAdmissionRules(readFileSync(admissionRulesFile(), "utf-8"));
147
+ } catch {
148
+ return NO_RULES;
149
+ }
150
+ };
151
+ var matches = (rule, source, event) => {
152
+ const colon = rule.indexOf(":");
153
+ if (colon <= 0 || colon === rule.length - 1) return false;
154
+ const ruleSource = rule.slice(0, colon);
155
+ const ruleEvent = rule.slice(colon + 1);
156
+ return (ruleSource === "*" || ruleSource === source) && (ruleEvent === "*" || ruleEvent === event);
157
+ };
158
+ var isAdmitted = (rules, source, event) => !rules.disabled.some((rule) => matches(rule, source, event));
159
+ var UNREADABLE = { kind: "unreadable" };
160
+ var UNKNOWN_AGENT = { kind: "unknown_agent" };
161
+ var GATED_BY_CURSOR = { kind: "gated_by_cursor" };
162
+ var readHookInputOutcome = async (source, fallbackEvent = "", stdin = process.stdin, parseInput, { cursorGateOwnsCall } = {}) => {
163
+ if (source === null) {
164
+ writeDegraded("hook", {
165
+ reason: "unknown_agent",
166
+ fallback: "stood aside, so nothing is gated or reported for this call",
167
+ event: fallbackEvent
168
+ });
169
+ return UNKNOWN_AGENT;
170
+ }
171
+ let raw = "";
172
+ for await (const chunk of stdin) raw += chunk;
173
+ if (!raw.trim()) return UNREADABLE;
174
+ let parsed;
175
+ try {
176
+ parsed = JSON.parse(raw);
177
+ } catch {
178
+ return UNREADABLE;
179
+ }
180
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return UNREADABLE;
181
+ if (source !== "grok" && process.env.GROK_SESSION_ID && isGrokHookPayload(parsed)) return UNREADABLE;
182
+ if (cursorGateOwnsCall?.(parsed)) return GATED_BY_CURSOR;
183
+ const shaped = inClaudeShape(source, namedEvent(process.argv) ?? fallbackEvent, parsed);
184
+ if (source === "grok" && isGrokSessionEndStop(shaped.hook_event_name, shaped.reason)) return UNREADABLE;
185
+ const input = parseInput ? parseInput(shaped) : shaped;
186
+ if (input === null) return UNREADABLE;
187
+ const event = eventNameOf(input) ?? fallbackEvent;
188
+ if (!isAdmitted(readAdmissionRules(), source, event)) return { kind: "not_admitted", input };
189
+ if (stdin === process.stdin) registerTranscript(source, input);
190
+ return { kind: "admitted", input };
191
+ };
192
+ var admittedInput = (read) => read.kind === "admitted" ? read.input : null;
193
+ var readHookInput = async (source, fallbackEvent = "", stdin = process.stdin, parseInput) => admittedInput(await readHookInputOutcome(source, fallbackEvent, stdin, parseInput));
194
+ var inClaudeShape = (source, event, parsed) => {
195
+ const profile = hookCompatibleProfileBySource(source);
196
+ return profile ? claudeShapedHookInput(profile.payload, event, parsed) : parsed;
197
+ };
198
+ var eventNameOf = (input) => {
199
+ if (!("hook_event_name" in input)) return void 0;
200
+ const name = input.hook_event_name;
201
+ return typeof name === "string" && name.length > 0 ? name : void 0;
202
+ };
203
+ function readToolHookInput(source, event, stdin = process.stdin) {
204
+ return readHookInput(source, event, stdin, parseToolHookInput);
205
+ }
206
+ var isClaudePreToolUse = (source, event) => source === "claude" && event === "PreToolUse";
207
+ var screenFor = (source, event, readCursorGate) => isClaudePreToolUse(source, event) ? { cursorGateOwnsCall: (payload) => cursorGateOwnsClaudeCall(payload, readCursorGate) } : {};
208
+ function readToolHookCall(source, event, stdin = process.stdin, { readCursorGate = readCursorGateRegistration } = {}) {
209
+ return readHookInputOutcome(source, event, stdin, parseToolHookInput, screenFor(source, event, readCursorGate));
210
+ }
211
+
212
+ export {
213
+ readHookInput,
214
+ readToolHookInput,
215
+ readToolHookCall
216
+ };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  pusharyDir
3
- } from "./chunk-MWLTTLPK.js";
3
+ } from "./chunk-6YSEOXP5.js";
4
4
  import {
5
5
  writeFileAtomic
6
6
  } from "./chunk-QENTGE75.js";
@@ -3,11 +3,11 @@ import {
3
3
  decodePublicKey,
4
4
  generateSessionKey,
5
5
  wrapSessionKey
6
- } from "./chunk-2AELPDMT.js";
6
+ } from "./chunk-7ETELRQX.js";
7
7
  import {
8
8
  fetchTranscriptRecipients,
9
9
  uploadTranscriptRecords
10
- } from "./chunk-GAMVAORR.js";
10
+ } from "./chunk-UUAVYIWJ.js";
11
11
 
12
12
  // src/live-session.ts
13
13
  var MAX_TRANSCRIPT_QUEUE = 100;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  readConfigFileKey
3
- } from "./chunk-WN3RACVD.js";
3
+ } from "./chunk-W3CBFLIX.js";
4
4
 
5
5
  // src/bell/fleet.ts
6
6
  import { closeSync, constants, futimesSync, lstatSync, mkdirSync, openSync, readdirSync, unlinkSync } from "fs";
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  readExistingMachineId
3
- } from "./chunk-SFAP4AJY.js";
3
+ } from "./chunk-G3ZDCYMU.js";
4
4
  import {
5
5
  NetworkError
6
6
  } from "./chunk-PPY5N2E6.js";
7
7
  import {
8
8
  getBaseUrl
9
- } from "./chunk-BG4Y64FW.js";
9
+ } from "./chunk-DFKEJARZ.js";
10
10
  import {
11
11
  getPackageVersion
12
12
  } from "./chunk-QTOLNRET.js";
13
13
  import {
14
14
  clientContextHeaders,
15
15
  redactSecretsFromContent
16
- } from "./chunk-AXJLJJ3M.js";
16
+ } from "./chunk-FXECTHAG.js";
17
17
 
18
18
  // src/cli/net.ts
19
19
  import { createRequire } from "module";
@@ -5,16 +5,16 @@ import {
5
5
  import {
6
6
  NOTIFICATION_MATCHED_TYPES,
7
7
  POSTTOOLUSE_MIRRORED_TOOLS
8
- } from "./chunk-33OOEVPG.js";
8
+ } from "./chunk-LL2KHEJH.js";
9
9
  import {
10
10
  isProtectedByScope,
11
11
  registerHookEntry
12
- } from "./chunk-MWLTTLPK.js";
12
+ } from "./chunk-6YSEOXP5.js";
13
13
  import {
14
14
  CLAUDE_PRETOOLUSE_MATCHER,
15
15
  HOOK_BUDGETS,
16
16
  HOOK_LOCATOR_BINARY
17
- } from "./chunk-AXJLJJ3M.js";
17
+ } from "./chunk-FXECTHAG.js";
18
18
 
19
19
  // src/gemini-config.ts
20
20
  var GEMINI_HOOK_BINARY = "pushary-gemini-hook";
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  MCP_BRIDGE_BINARY
3
- } from "./chunk-UADSXJZ4.js";
3
+ } from "./chunk-EO6CL4PD.js";
4
4
  import {
5
5
  KEY_FILE_MODE
6
- } from "./chunk-WN3RACVD.js";
6
+ } from "./chunk-W3CBFLIX.js";
7
7
  import {
8
8
  NpmInstallError,
9
9
  NpmMissingError,
10
10
  NpmPermissionError
11
- } from "./chunk-CJ5TCFD4.js";
11
+ } from "./chunk-CFIQ3252.js";
12
12
  import {
13
13
  readJsonSafe,
14
14
  writeFileAtomic,
@@ -16,10 +16,10 @@ import {
16
16
  } from "./chunk-QENTGE75.js";
17
17
  import {
18
18
  NPX_LATEST_COMMAND
19
- } from "./chunk-ERK24P76.js";
19
+ } from "./chunk-FG5HMJ7C.js";
20
20
  import {
21
21
  readSetupAgentFailures
22
- } from "./chunk-AXJLJJ3M.js";
22
+ } from "./chunk-FXECTHAG.js";
23
23
 
24
24
  // src/instruction-file.ts
25
25
  import { accessSync, constants, existsSync, readFileSync, statSync, writeFileSync, mkdirSync, rmSync } from "fs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  PRETOOLUSE_GATED_TOOLS
3
- } from "./chunk-AXJLJJ3M.js";
3
+ } from "./chunk-FXECTHAG.js";
4
4
 
5
5
  // src/claude-tools.ts
6
6
  var POSTTOOLUSE_MIRROR_ONLY_TOOLS = ["TodoWrite", "Task", "WebFetch", "WebSearch"];
@@ -2,10 +2,10 @@ import {
2
2
  IDLE_PROMPT_NOTIFICATION,
3
3
  NOTIFICATION_PUSH_TYPES,
4
4
  POSTTOOLUSE_MIRROR_ONLY_TOOLS
5
- } from "./chunk-33OOEVPG.js";
5
+ } from "./chunk-LL2KHEJH.js";
6
6
  import {
7
7
  repoKeyFor
8
- } from "./chunk-YPD3MTFU.js";
8
+ } from "./chunk-4K6YZPZ3.js";
9
9
  import {
10
10
  cancelQuestion,
11
11
  clientErrorKindOf,
@@ -13,26 +13,26 @@ import {
13
13
  reportClientError,
14
14
  sendNotification,
15
15
  waitForAnswer
16
- } from "./chunk-RJHX66EY.js";
16
+ } from "./chunk-RSNN2TPE.js";
17
17
  import {
18
18
  withRetry
19
- } from "./chunk-XAO6EYGM.js";
19
+ } from "./chunk-ESXGCZDA.js";
20
20
  import {
21
21
  getMachineId
22
- } from "./chunk-SFAP4AJY.js";
22
+ } from "./chunk-G3ZDCYMU.js";
23
23
  import {
24
24
  reportedInstallSource
25
- } from "./chunk-Y5VKZNFN.js";
25
+ } from "./chunk-PSCXEH42.js";
26
26
  import {
27
27
  canonicalJson
28
- } from "./chunk-MWLTTLPK.js";
28
+ } from "./chunk-6YSEOXP5.js";
29
29
  import {
30
30
  writeFileAtomic
31
31
  } from "./chunk-QENTGE75.js";
32
32
  import {
33
33
  getApiKey,
34
34
  getBaseUrl
35
- } from "./chunk-BG4Y64FW.js";
35
+ } from "./chunk-DFKEJARZ.js";
36
36
  import {
37
37
  ACTION_BODY_MAX,
38
38
  AGENTS,
@@ -58,6 +58,7 @@ import {
58
58
  modeStateFromResponse,
59
59
  parseMcpToolName,
60
60
  pendingCommandEvents,
61
+ questionLimitHandBack,
61
62
  redactSecrets,
62
63
  redactSecretsDeep,
63
64
  reportableSessionId,
@@ -66,7 +67,7 @@ import {
66
67
  toToolLookup,
67
68
  truncateLine,
68
69
  unansweredRefusalReason
69
- } from "./chunk-AXJLJJ3M.js";
70
+ } from "./chunk-FXECTHAG.js";
70
71
 
71
72
  // ../hook-mapping/src/describe.ts
72
73
  import { isAbsolute, relative, resolve } from "path";
@@ -1348,6 +1349,10 @@ var toPolicyLookups = (toolName, toolInput, cwd) => {
1348
1349
  inputs: files.map((file) => ({ file_path: cwd ? resolve2(cwd, file) : file }))
1349
1350
  };
1350
1351
  };
1352
+ var codexQuestionLimitDecision = (facts) => {
1353
+ const handBack = questionLimitHandBack(facts);
1354
+ return handBack.kind === "refuse" ? codexDeny(handBack.reason) : codexPass();
1355
+ };
1351
1356
  var permissionTimeoutDecision = (timeoutAction, paused) => {
1352
1357
  if (timeoutAction === "approve") return codexAllow();
1353
1358
  if (timeoutAction === "deny") return codexDeny(unansweredRefusalReason(paused));
@@ -2236,6 +2241,7 @@ export {
2236
2241
  describeApplyPatch,
2237
2242
  toPolicyLookup,
2238
2243
  toPolicyLookups,
2244
+ codexQuestionLimitDecision,
2239
2245
  permissionTimeoutDecision,
2240
2246
  userScope,
2241
2247
  codexCallKey,
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  notificationAnswerStep
3
- } from "./chunk-HUI4OE43.js";
3
+ } from "./chunk-RU37NSZH.js";
4
4
  import {
5
5
  matchMacAccountStep,
6
6
  retryAgentCommand
7
- } from "./chunk-4VRTSDGP.js";
7
+ } from "./chunk-LILS32LF.js";
8
8
  import {
9
9
  EXIT
10
10
  } from "./chunk-KZERVKTD.js";
11
11
  import {
12
12
  NPX_LATEST_COMMAND
13
- } from "./chunk-ERK24P76.js";
13
+ } from "./chunk-FG5HMJ7C.js";
14
14
 
15
15
  // src/setup/closing.ts
16
16
  var ACTIVITY_URL = "pushary.com/dashboard/agent/activity";
@@ -10,7 +10,7 @@ import {
10
10
  isSetupConnectMode,
11
11
  isValidApiKey,
12
12
  normalizeAgentId
13
- } from "./chunk-AXJLJJ3M.js";
13
+ } from "./chunk-FXECTHAG.js";
14
14
 
15
15
  // src/setup/options.ts
16
16
  var AGENT_CHOICES = SETUP_AGENT_CHOICES;
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-3EGEA4KH.js";
10
10
  import {
11
11
  getBaseUrl
12
- } from "./chunk-BG4Y64FW.js";
12
+ } from "./chunk-DFKEJARZ.js";
13
13
 
14
14
  // src/cli/login-ui.ts
15
15
  import { hostname } from "os";
@@ -4,10 +4,10 @@ import {
4
4
  keyPrefix,
5
5
  readConfigFileKey,
6
6
  readMacAppKeyPrefix
7
- } from "./chunk-WN3RACVD.js";
7
+ } from "./chunk-W3CBFLIX.js";
8
8
  import {
9
9
  NPX_LATEST_COMMAND
10
- } from "./chunk-ERK24P76.js";
10
+ } from "./chunk-FG5HMJ7C.js";
11
11
 
12
12
  // src/key-signed-out.ts
13
13
  var VERDICT_BY_CHECK = {
@@ -7,7 +7,7 @@ import {
7
7
  reachVerdict,
8
8
  reachesYou,
9
9
  verifyDelivery
10
- } from "./chunk-HUI4OE43.js";
10
+ } from "./chunk-RU37NSZH.js";
11
11
  import {
12
12
  generateKeypair,
13
13
  openSealedKey,
@@ -24,14 +24,14 @@ import {
24
24
  } from "./chunk-FO3MDD26.js";
25
25
  import {
26
26
  reportedInstallSource
27
- } from "./chunk-Y5VKZNFN.js";
27
+ } from "./chunk-PSCXEH42.js";
28
28
  import {
29
29
  NPX_LATEST_COMMAND
30
- } from "./chunk-ERK24P76.js";
30
+ } from "./chunk-FG5HMJ7C.js";
31
31
  import {
32
32
  NO_PAIRING_COMPUTER,
33
33
  PAIR_TTL_SECONDS
34
- } from "./chunk-AXJLJJ3M.js";
34
+ } from "./chunk-FXECTHAG.js";
35
35
 
36
36
  // src/onboarding.ts
37
37
  import qrcodeTerminal from "qrcode-terminal";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-KZERVKTD.js";
4
4
  import {
5
5
  renderCommandHelp
6
- } from "./chunk-ERK24P76.js";
6
+ } from "./chunk-FG5HMJ7C.js";
7
7
  import {
8
8
  getPackageVersion
9
9
  } from "./chunk-QTOLNRET.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  configFilePath
3
- } from "./chunk-BG4Y64FW.js";
3
+ } from "./chunk-DFKEJARZ.js";
4
4
  import {
5
5
  normalizeInstallSource
6
- } from "./chunk-AXJLJJ3M.js";
6
+ } from "./chunk-FXECTHAG.js";
7
7
 
8
8
  // src/install-source.ts
9
9
  import { readFileSync } from "fs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  pusharyFetch
3
- } from "./chunk-7BAO42UV.js";
3
+ } from "./chunk-HSRNWCXJ.js";
4
4
  import {
5
5
  NetworkError
6
6
  } from "./chunk-PPY5N2E6.js";
@@ -9,11 +9,11 @@ import {
9
9
  } from "./chunk-KZERVKTD.js";
10
10
  import {
11
11
  getBaseUrl
12
- } from "./chunk-BG4Y64FW.js";
12
+ } from "./chunk-DFKEJARZ.js";
13
13
  import {
14
14
  isValidApiKey,
15
15
  normalizeKeyScope
16
- } from "./chunk-AXJLJJ3M.js";
16
+ } from "./chunk-FXECTHAG.js";
17
17
 
18
18
  // src/session.ts
19
19
  var samePusharyAccount = (left, right) => left.kind === "ok" && right.kind === "ok" && left.identity.workspaceId !== "" && left.identity.workspaceId === right.identity.workspaceId && left.identity.siteId === right.identity.siteId;
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  macAppBridgeAvailable
3
- } from "./chunk-ZGU3NXL2.js";
3
+ } from "./chunk-6HIYOY6I.js";
4
4
  import {
5
5
  keyPrefix
6
- } from "./chunk-WN3RACVD.js";
6
+ } from "./chunk-W3CBFLIX.js";
7
7
  import {
8
8
  bridgeAgentKey
9
- } from "./chunk-MWLTTLPK.js";
9
+ } from "./chunk-6YSEOXP5.js";
10
10
  import {
11
11
  readJsonSafe
12
12
  } from "./chunk-QENTGE75.js";
13
13
  import {
14
14
  isValidApiKey
15
- } from "./chunk-AXJLJJ3M.js";
15
+ } from "./chunk-FXECTHAG.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;
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-6ICPEJY5.js";
7
7
  import {
8
8
  isRecord
9
- } from "./chunk-AXJLJJ3M.js";
9
+ } from "./chunk-FXECTHAG.js";
10
10
 
11
11
  // src/setup/agent-probe.ts
12
12
  import { execSync } from "child_process";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  pusharyDir
3
- } from "./chunk-MWLTTLPK.js";
3
+ } from "./chunk-6YSEOXP5.js";
4
4
  import {
5
5
  readJsonSafe
6
6
  } from "./chunk-QENTGE75.js";
7
7
  import {
8
8
  isRecord
9
- } from "./chunk-AXJLJJ3M.js";
9
+ } from "./chunk-FXECTHAG.js";
10
10
 
11
11
  // src/process-ownership.ts
12
12
  import { createHash, randomUUID } from "crypto";
@@ -1,7 +1,8 @@
1
1
  import {
2
+ McpToolError,
2
3
  SubscriptionRequiredError,
3
4
  callMcpTool
4
- } from "./chunk-XAO6EYGM.js";
5
+ } from "./chunk-ESXGCZDA.js";
5
6
  import {
6
7
  CLIENT_REPORT_DISABLE_ENV,
7
8
  isDisabledByEnv
@@ -9,22 +10,23 @@ import {
9
10
  import {
10
11
  installNetworkDefaults,
11
12
  isNetworkFailure
12
- } from "./chunk-7BAO42UV.js";
13
+ } from "./chunk-HSRNWCXJ.js";
13
14
  import {
14
15
  clientReportClaims
15
- } from "./chunk-MWLTTLPK.js";
16
+ } from "./chunk-6YSEOXP5.js";
16
17
  import {
17
18
  getApiKey,
18
19
  getBaseUrl
19
- } from "./chunk-BG4Y64FW.js";
20
+ } from "./chunk-DFKEJARZ.js";
20
21
  import {
21
22
  ASK_AGENT_NAME_MAX,
22
23
  CLIENT_REPORT_PATH,
23
24
  DECISION_LINE_MAX,
24
25
  GATE_PERMISSION_MODE_MAX_LENGTH,
26
+ TOOL_FAILURE_CODES,
25
27
  degradedLine,
26
28
  truncateLine
27
- } from "./chunk-AXJLJJ3M.js";
29
+ } from "./chunk-FXECTHAG.js";
28
30
 
29
31
  // src/api.ts
30
32
  import { randomUUID } from "crypto";
@@ -195,8 +197,10 @@ var isAwayPaused = (result) => result.paused === true;
195
197
  var isLocalQuestionHandoff = (result) => !isAwayPaused(result) && (result.suppressed === true || result.noDevices === true || result.status === "terminal" || result.status === "notified");
196
198
  var waitsForThePhone = (result) => result.answered !== true && !isAwayPaused(result) && !isLocalQuestionHandoff(result);
197
199
  var STOPPED = { answered: false, handoffAction: "stop" };
198
- var unavailableQuestionUnlessSubscriptionRequired = (error) => {
199
- if (error instanceof SubscriptionRequiredError) throw error;
200
+ var isQuestionLimitRefusal = (error) => error instanceof McpToolError && error.failure === TOOL_FAILURE_CODES.questionLimit;
201
+ var isRefusedAsk = (error) => error instanceof SubscriptionRequiredError || isQuestionLimitRefusal(error);
202
+ var unavailableQuestionUnlessRefused = (error) => {
203
+ if (isRefusedAsk(error)) throw error;
200
204
  return { correlationId: "", status: "unavailable" };
201
205
  };
202
206
  var truncateOptional = (text, max) => text === void 0 ? void 0 : truncateLine(text, max);
@@ -318,7 +322,8 @@ export {
318
322
  isAwayPaused,
319
323
  isLocalQuestionHandoff,
320
324
  waitsForThePhone,
321
- unavailableQuestionUnlessSubscriptionRequired,
325
+ isQuestionLimitRefusal,
326
+ unavailableQuestionUnlessRefused,
322
327
  askUser,
323
328
  waitForAnswer,
324
329
  WAIT_RESPONSE_GRACE_MS,
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  callMcpTool
3
- } from "./chunk-XAO6EYGM.js";
3
+ } from "./chunk-ESXGCZDA.js";
4
4
  import {
5
5
  NPX_LATEST_COMMAND
6
- } from "./chunk-ERK24P76.js";
6
+ } from "./chunk-FG5HMJ7C.js";
7
7
  import {
8
8
  classifyConfirmResponse,
9
9
  isAnswerSource
10
- } from "./chunk-AXJLJJ3M.js";
10
+ } from "./chunk-FXECTHAG.js";
11
11
 
12
12
  // src/reach.ts
13
13
  var reachVerdict = (channels) => {