pushary 1.9.104 → 1.9.105

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 (130) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/{api-QOG7JVXE.js → api-RL5CPDTH.js} +11 -11
  3. package/dist/bin/pushary-audit.js +4 -4
  4. package/dist/bin/pushary-bell-hook.js +28 -27
  5. package/dist/bin/pushary-bell.js +11 -11
  6. package/dist/bin/pushary-claude.js +28 -28
  7. package/dist/bin/pushary-clean.js +37 -37
  8. package/dist/bin/pushary-codex-bridge.js +22 -22
  9. package/dist/bin/pushary-codex-hook.js +33 -32
  10. package/dist/bin/pushary-codex-session.js +8 -8
  11. package/dist/bin/pushary-codex.js +15 -15
  12. package/dist/bin/pushary-connect.js +28 -28
  13. package/dist/bin/pushary-cowork.js +5 -5
  14. package/dist/bin/pushary-daemon.js +489 -62
  15. package/dist/bin/pushary-disconnect.js +27 -27
  16. package/dist/bin/pushary-display-hook.js +18 -18
  17. package/dist/bin/pushary-doctor.js +50 -50
  18. package/dist/bin/pushary-elicitation-hook.js +28 -27
  19. package/dist/bin/pushary-gemini-bridge.js +16 -16
  20. package/dist/bin/pushary-gemini-hook.js +30 -29
  21. package/dist/bin/pushary-hook.js +33 -31
  22. package/dist/bin/pushary-login.js +21 -21
  23. package/dist/bin/pushary-logout.js +26 -26
  24. package/dist/bin/pushary-mcp.js +12 -12
  25. package/dist/bin/pushary-mode.js +16 -16
  26. package/dist/bin/pushary-notification-hook.js +27 -26
  27. package/dist/bin/pushary-opencode-hook.js +29 -28
  28. package/dist/bin/pushary-permission-denied-hook.js +33 -31
  29. package/dist/bin/pushary-permission-hook.js +33 -31
  30. package/dist/bin/pushary-post-hook.js +27 -26
  31. package/dist/bin/pushary-prompt-hook.js +27 -26
  32. package/dist/bin/pushary-session-end-hook.js +29 -28
  33. package/dist/bin/pushary-session-start-hook.js +37 -36
  34. package/dist/bin/pushary-setup.js +49 -49
  35. package/dist/bin/pushary-stats.js +5 -5
  36. package/dist/bin/pushary-status.js +33 -33
  37. package/dist/bin/pushary-stop-hook.js +27 -26
  38. package/dist/bin/pushary-stopfailure-hook.js +27 -26
  39. package/dist/bin/pushary-suggestions.js +16 -16
  40. package/dist/bin/pushary-transcript-register.js +19 -19
  41. package/dist/bin/pushary-transcripts.js +27 -27
  42. package/dist/bin/pushary-upgrade.js +41 -41
  43. package/dist/bin/pushary-wait.js +16 -16
  44. package/dist/bin/pushary.js +8 -8
  45. package/dist/{chunk-4JBCPRWZ.js → chunk-2HC5ISDW.js} +2 -2
  46. package/dist/{chunk-HB7FHRTT.js → chunk-43PNDDB3.js} +6 -6
  47. package/dist/{chunk-SJCHJQKT.js → chunk-4EMPELDR.js} +4 -4
  48. package/dist/{chunk-HJ4EBHK4.js → chunk-4XE3DVF7.js} +2 -2
  49. package/dist/{chunk-SJJCCFD5.js → chunk-5IAW6G3K.js} +3 -3
  50. package/dist/{chunk-JVZVO3K5.js → chunk-6DKMZBRK.js} +1 -1
  51. package/dist/{chunk-OFRQNTJD.js → chunk-76JOLPST.js} +1 -1
  52. package/dist/{chunk-FYQHXN4X.js → chunk-772NHSQB.js} +2 -2
  53. package/dist/{chunk-BDSI2NEN.js → chunk-A37RKFI3.js} +4 -4
  54. package/dist/{chunk-UL52HYKN.js → chunk-ASCQXNCL.js} +1 -1
  55. package/dist/{chunk-XXPA3X6L.js → chunk-ATVZAEM5.js} +5 -5
  56. package/dist/{chunk-JMTOQXHV.js → chunk-B5Q44HKN.js} +1 -1
  57. package/dist/{chunk-NKA2PEQQ.js → chunk-B7O4CXFX.js} +4 -4
  58. package/dist/{chunk-SVZPRTCK.js → chunk-CJTJ55DR.js} +1 -1
  59. package/dist/{chunk-AG7PFGGE.js → chunk-CKWV3T7O.js} +6 -6
  60. package/dist/{chunk-GV2MF4NY.js → chunk-DA57ZI62.js} +2 -2
  61. package/dist/{chunk-ZBT3U2VB.js → chunk-DH22FQAS.js} +1 -1
  62. package/dist/{chunk-VZY4GD4T.js → chunk-DIVVLBZZ.js} +6 -6
  63. package/dist/{chunk-FXTUSTQG.js → chunk-DS672F57.js} +11 -11
  64. package/dist/{chunk-NGY2WS3X.js → chunk-EMSRB2KH.js} +3 -3
  65. package/dist/{chunk-HHEFOGT2.js → chunk-FE5JENEJ.js} +3 -3
  66. package/dist/{chunk-4QI6SBNR.js → chunk-FJYUB3ZK.js} +4 -4
  67. package/dist/{chunk-6B4R7HUV.js → chunk-FUTFQSRA.js} +1 -1
  68. package/dist/{chunk-TMJK3CLD.js → chunk-G5HGV6D4.js} +3 -3
  69. package/dist/{chunk-HXZYBYBD.js → chunk-GBHP3LML.js} +7 -5
  70. package/dist/{chunk-4OLWSYX5.js → chunk-GESW4OSZ.js} +4 -4
  71. package/dist/{chunk-3A7REECH.js → chunk-GKCDMAUM.js} +1 -1
  72. package/dist/{chunk-U5DBYW63.js → chunk-GUIS6ASL.js} +1 -1
  73. package/dist/{chunk-KDIZS7FN.js → chunk-HH5NNPB5.js} +1 -1
  74. package/dist/{chunk-XTMAVKO3.js → chunk-HLYZEZOI.js} +3 -3
  75. package/dist/{chunk-OPV6724W.js → chunk-HONSMBF2.js} +7 -7
  76. package/dist/{chunk-M7BDKARZ.js → chunk-HXBQTPKC.js} +1 -1
  77. package/dist/{chunk-PYUN7HNY.js → chunk-I3IUS4SR.js} +2 -2
  78. package/dist/{chunk-CC4LGKEZ.js → chunk-IAASPG5B.js} +5 -5
  79. package/dist/{chunk-2MRLDEQY.js → chunk-IGO5NDQY.js} +3 -3
  80. package/dist/{chunk-RDUY7MKN.js → chunk-IHQRLJEP.js} +12 -12
  81. package/dist/{chunk-RUN772MN.js → chunk-J2HIFUAT.js} +7 -7
  82. package/dist/{chunk-UYJLXAP4.js → chunk-J5PUKKCT.js} +8 -7
  83. package/dist/{chunk-AYWX6M7J.js → chunk-JCSJEMTA.js} +208 -60
  84. package/dist/{chunk-FVERRWDP.js → chunk-JDGLNYDZ.js} +2 -2
  85. package/dist/{chunk-5BX57BGT.js → chunk-JLJJRBTD.js} +6 -5
  86. package/dist/{chunk-UUYLBSAU.js → chunk-KHZCJP7P.js} +11 -11
  87. package/dist/{chunk-WBLK4WLO.js → chunk-LK3WA6MK.js} +3 -3
  88. package/dist/{chunk-ID4BZRBW.js → chunk-LL7SW4RL.js} +3 -3
  89. package/dist/{chunk-GV5TEADP.js → chunk-LMDXQIYT.js} +1 -1
  90. package/dist/{chunk-RYUIXLZ5.js → chunk-MFJHLVIZ.js} +11 -95
  91. package/dist/{chunk-XXNXMX2G.js → chunk-MLLL2ET6.js} +17 -61
  92. package/dist/{chunk-TYM6IH5F.js → chunk-NM44KCO6.js} +4 -4
  93. package/dist/{chunk-5YVBVJOH.js → chunk-O5TB2LMQ.js} +8 -0
  94. package/dist/{chunk-ZUXDGVW4.js → chunk-OBZQPBUI.js} +5 -5
  95. package/dist/chunk-OINGJICB.js +108 -0
  96. package/dist/{chunk-JGRBWTDW.js → chunk-P3H6I656.js} +11 -11
  97. package/dist/{chunk-IVAXF3JG.js → chunk-P3VVRBBI.js} +1 -1
  98. package/dist/{chunk-PK6LBL3Z.js → chunk-PFZCLG55.js} +4 -4
  99. package/dist/{chunk-XDTE55H7.js → chunk-QCFWJZGT.js} +4 -4
  100. package/dist/{chunk-I3T5YV5I.js → chunk-RKQVMFHN.js} +11 -93
  101. package/dist/{chunk-VUFHYMSP.js → chunk-ROVLRXBI.js} +1 -1
  102. package/dist/{chunk-7RHEZVAE.js → chunk-S2TTGX6F.js} +5 -5
  103. package/dist/{chunk-N4RIGNDX.js → chunk-S75UO75C.js} +2 -2
  104. package/dist/{chunk-QENTGE75.js → chunk-T5I4PKOQ.js} +37 -1
  105. package/dist/{chunk-SPM4VNED.js → chunk-TXMYET7E.js} +3 -3
  106. package/dist/{chunk-CFTPHNBY.js → chunk-UUJQK7DJ.js} +1 -1
  107. package/dist/{chunk-ORIVT4BL.js → chunk-UXIUCMFO.js} +6 -6
  108. package/dist/{chunk-4HBWXZPI.js → chunk-VCWLGM77.js} +3 -3
  109. package/dist/{chunk-AE2BQ3XM.js → chunk-VKTW5WVB.js} +2 -2
  110. package/dist/{chunk-LIDIA5JW.js → chunk-WTREXZGS.js} +4 -4
  111. package/dist/chunk-WUIWHGKF.js +56 -0
  112. package/dist/{chunk-FQNMUJTK.js → chunk-X3QG5RT5.js} +1 -1
  113. package/dist/{chunk-3KEY3453.js → chunk-X4TZN52V.js} +6 -6
  114. package/dist/{chunk-TYH7SNKD.js → chunk-XN527J4W.js} +1 -1
  115. package/dist/{chunk-YDT6TVGN.js → chunk-YDQ6OJMF.js} +1 -1
  116. package/dist/{chunk-FH6PHTUD.js → chunk-Z5FV7LTD.js} +2 -2
  117. package/dist/{chunk-VAZCGOLS.js → chunk-ZCBTCW3T.js} +3 -3
  118. package/dist/{codex-app-cards-switch-6IDDWXYS.js → codex-app-cards-switch-FD2ZWLYL.js} +12 -12
  119. package/dist/{codex-desktop-launch-VP4TXVCM.js → codex-desktop-launch-BN5OABPN.js} +1 -1
  120. package/dist/{codex-session-launch-OACJB5NN.js → codex-session-launch-O3PHQWTS.js} +19 -19
  121. package/dist/{config-S7HAIK6E.js → config-KWP7UXYG.js} +3 -3
  122. package/dist/{global-upgrade-OOFEGR4H.js → global-upgrade-NBSY5436.js} +11 -11
  123. package/dist/{identity-QSM6MVAH.js → identity-RP5I7KTV.js} +5 -5
  124. package/dist/{live-capabilities-NSVW362T.js → live-capabilities-XC6C47ZH.js} +6 -6
  125. package/dist/{paths-KFRRYJWL.js → paths-OE5APZ4Q.js} +8 -4
  126. package/dist/{reapply-7H3VCPW4.js → reapply-DRZ32BIB.js} +29 -29
  127. package/dist/src/index.js +32 -30
  128. package/dist/{upgrade-lock-BJKRXNMC.js → upgrade-lock-LWTVHYAJ.js} +5 -5
  129. package/dist/{usage-KGWL6WKQ.js → usage-5YESCANM.js} +3 -3
  130. package/package.json +1 -1
@@ -1,101 +1,27 @@
1
1
  import {
2
2
  AGENT_CHOICES
3
- } from "./chunk-ZBT3U2VB.js";
3
+ } from "./chunk-DH22FQAS.js";
4
4
  import {
5
5
  BELL_HOOK_BINARY
6
- } from "./chunk-U5DBYW63.js";
6
+ } from "./chunk-GUIS6ASL.js";
7
7
  import {
8
8
  CLAUDE_HOOK_EVENTS,
9
9
  CODEX_HOOK_EVENTS,
10
- HOOK_SHELL,
11
10
  hasCodexHooks,
12
11
  holdBudgetOf,
13
12
  hookBinaryNameOf,
13
+ hookCommandTokens,
14
+ hookExecutableName,
15
+ isBridgeLocator,
14
16
  isProtectedByScope,
15
17
  registerHookEntry
16
- } from "./chunk-AYWX6M7J.js";
18
+ } from "./chunk-JCSJEMTA.js";
17
19
  import {
18
20
  CURSOR_GATE_EVENTS,
19
21
  HOOK_BUDGETS,
20
22
  HOOK_LOCATOR_BINARY,
21
23
  hookCommandHoldBudget
22
- } from "./chunk-5YVBVJOH.js";
23
-
24
- // src/diagnostics/bridge.ts
25
- import { execFileSync } from "child_process";
26
- import { existsSync, readFileSync } from "fs";
27
- import { homedir } from "os";
28
- import { dirname, join } from "path";
29
- var BRIDGE_BUNDLE_IDENTIFIER = "com.pushary.app";
30
- var BRIDGE_HELPER_SUFFIX = "/Contents/Helpers/pushary-bridge";
31
- var BRIDGE_BUNDLE_ROOTS = ["/Applications/Pushary.app", "$HOME/Applications/Pushary.app"];
32
- var expandHome = (path, home) => path.replaceAll("$HOME", home);
33
- var parseBridgeStub = (contents, stubPath) => {
34
- const helperSuffix = contents.match(/^H=(\S+)$/m)?.[1] ?? BRIDGE_HELPER_SUFFIX;
35
- const cachePath = contents.match(/^C="([^"\n]+)"$/m)?.[1] ?? join(dirname(stubPath), ".bridge-cache");
36
- const rootsLine = contents.match(/^for P in ((?:"[^"\n]*"\s*)+); do$/m)?.[1];
37
- const bundleRoots = rootsLine ? [...rootsLine.matchAll(/"([^"]*)"/g)].map((match) => match[1]) : BRIDGE_BUNDLE_ROOTS;
38
- const bundleIdentifier = contents.match(/kMDItemCFBundleIdentifier == "([^"]+)"/)?.[1] ?? BRIDGE_BUNDLE_IDENTIFIER;
39
- return { helperSuffix, cachePath, bundleRoots, bundleIdentifier };
40
- };
41
- var resolveBridgeStub = (stubPath, probe) => {
42
- const contents = probe.readFile(stubPath);
43
- if (contents === null) return { kind: "no-stub", stub: stubPath };
44
- const shape = parseBridgeStub(contents, stubPath);
45
- const helperIn = (bundle) => `${bundle}${shape.helperSuffix}`;
46
- const looked = [];
47
- for (const root of shape.bundleRoots.map((root2) => expandHome(root2, probe.home))) {
48
- looked.push(root);
49
- if (probe.exists(helperIn(root))) return { kind: "bundle", helper: helperIn(root), via: "root" };
50
- }
51
- const cached = shape.cachePath ? probe.readFile(shape.cachePath)?.split("\n")[0]?.trim() : void 0;
52
- if (cached) {
53
- looked.push(cached);
54
- if (probe.exists(helperIn(cached))) return { kind: "bundle", helper: helperIn(cached), via: "cache" };
55
- }
56
- for (const found of probe.mdfind(shape.bundleIdentifier)) {
57
- looked.push(found);
58
- if (probe.exists(helperIn(found))) return { kind: "bundle", helper: helperIn(found), via: "spotlight" };
59
- }
60
- return { kind: "missing", stub: stubPath, looked };
61
- };
62
- var BRIDGE_GONE_MESSAGE = "the Mac app is gone but its hooks remain; run pushary setup or reinstall the app";
63
- var describeBridgeResolution = (resolution) => {
64
- switch (resolution.kind) {
65
- case "bundle":
66
- return `${resolution.helper} (${resolution.via === "root" ? "installed" : resolution.via === "cache" ? "cached path" : "found by Spotlight"})`;
67
- case "missing":
68
- return BRIDGE_GONE_MESSAGE;
69
- case "no-stub":
70
- return `${resolution.stub} is not there; ${BRIDGE_GONE_MESSAGE}`;
71
- }
72
- };
73
- var isBridgeLocator = (executable) => executable !== null && executable.split(/[/\\]/).pop() === HOOK_LOCATOR_BINARY;
74
- var spotlight = (bundleIdentifier) => {
75
- if (process.platform !== "darwin") return [];
76
- try {
77
- return execFileSync("/usr/bin/mdfind", [`kMDItemCFBundleIdentifier == "${bundleIdentifier}"`], {
78
- encoding: "utf-8",
79
- timeout: 5e3,
80
- stdio: ["ignore", "pipe", "ignore"]
81
- }).split("\n").map((line) => line.trim()).filter((line) => line !== "");
82
- } catch {
83
- return [];
84
- }
85
- };
86
- var readOrNull = (path) => {
87
- try {
88
- return readFileSync(path, "utf-8");
89
- } catch {
90
- return null;
91
- }
92
- };
93
- var liveBridgeProbe = () => ({
94
- exists: existsSync,
95
- readFile: readOrNull,
96
- mdfind: spotlight,
97
- home: homedir()
98
- });
24
+ } from "./chunk-O5TB2LMQ.js";
99
25
 
100
26
  // src/gemini-config.ts
101
27
  var GEMINI_HOOK_BINARY = "pushary-gemini-hook";
@@ -200,16 +126,8 @@ var missingGeminiHookEvents = (settings) => {
200
126
  var record = (value) => value && typeof value === "object" && !Array.isArray(value) ? value : null;
201
127
  var CLAUDE_HOOK_BINARY = /pushary-[a-z-]*hook/;
202
128
  var EXACT_HOOK_BINARY = /^pushary-[a-z-]*(hook|gate)$/;
203
- var pusharyHookExecutable = (command) => {
204
- const tokens = command.match(/"(?:\\.|[^"\\])*"|'[^']*'|\S+/g) ?? [];
205
- for (const raw of tokens.reverse()) {
206
- const unquoted = raw[0] === '"' && raw.at(-1) === '"' || raw[0] === "'" && raw.at(-1) === "'" ? raw.slice(1, -1) : raw;
207
- const token = command.startsWith(`${HOOK_SHELL} `) && raw[0] === '"' ? unquoted.replace(/\\(["\\$`])/g, "$1") : unquoted;
208
- const name = hookBinaryNameOf(token.split(/[/\\]/).pop() ?? "");
209
- if (name === HOOK_LOCATOR_BINARY || EXACT_HOOK_BINARY.test(name)) return token;
210
- }
211
- return null;
212
- };
129
+ var isPusharyHookName = (name) => name === HOOK_LOCATOR_BINARY || EXACT_HOOK_BINARY.test(name);
130
+ var pusharyHookExecutable = (command) => [...hookCommandTokens(command)].reverse().find((token) => isPusharyHookName(hookExecutableName(token))) ?? null;
213
131
  var claudeWired = ({ claudeJson, settings, skillExists }) => {
214
132
  if (record(record(claudeJson)?.mcpServers)?.pushary) return true;
215
133
  const s = record(settings);
@@ -421,10 +339,6 @@ var describeHookOwnership = (entries, names) => {
421
339
  };
422
340
 
423
341
  export {
424
- resolveBridgeStub,
425
- describeBridgeResolution,
426
- isBridgeLocator,
427
- liveBridgeProbe,
428
342
  GEMINI_HOOK_BINARY,
429
343
  GEMINI_HOOK_EVENTS,
430
344
  addGeminiMcpServer,
@@ -450,6 +364,8 @@ export {
450
364
  describeHoldSentence,
451
365
  captureMcpServer,
452
366
  restoreMcpServer,
367
+ DEFAULT_HOOKS_KEY_PATH,
368
+ hooksAt,
453
369
  captureHookTakeover,
454
370
  isHookTakeoverReceipt,
455
371
  restoreHookTakeover,
@@ -1,27 +1,31 @@
1
+ import {
2
+ claudeSettingsLocationFor,
3
+ readClaudePermissionRules
4
+ } from "./chunk-WUIWHGKF.js";
1
5
  import {
2
6
  askAgentQuestions,
3
7
  defersToNativeMode,
4
8
  outcomeOfFailedAsk,
5
9
  reportMachineDenial,
6
10
  storedWaitDeadline
7
- } from "./chunk-RUN772MN.js";
11
+ } from "./chunk-J2HIFUAT.js";
8
12
  import {
9
13
  isGatingMoment,
10
14
  recordKeylessMoment
11
- } from "./chunk-6B4R7HUV.js";
15
+ } from "./chunk-FUTFQSRA.js";
12
16
  import {
13
17
  isAdmitted,
14
18
  readAdmissionRules
15
- } from "./chunk-I3T5YV5I.js";
19
+ } from "./chunk-RKQVMFHN.js";
16
20
  import {
17
21
  isDeferAnswer,
18
22
  oncePerSession
19
- } from "./chunk-CFTPHNBY.js";
23
+ } from "./chunk-UUJQK7DJ.js";
20
24
  import {
21
25
  activeHookSource,
22
26
  activeIdentity,
23
27
  namedSource
24
- } from "./chunk-5BX57BGT.js";
28
+ } from "./chunk-JLJJRBTD.js";
25
29
  import {
26
30
  DEFAULT_SESSION,
27
31
  approvalAwaitingRetry,
@@ -37,7 +41,7 @@ import {
37
41
  recordBlockedActionHint,
38
42
  reportEvent,
39
43
  settleQuestionsForToolUse
40
- } from "./chunk-UUYLBSAU.js";
44
+ } from "./chunk-KHZCJP7P.js";
41
45
  import {
42
46
  UNNAMED_ACTION,
43
47
  deriveAction,
@@ -48,11 +52,11 @@ import {
48
52
  patchDeletesFiles,
49
53
  permissionDeniedAction,
50
54
  scopePathFor
51
- } from "./chunk-OFRQNTJD.js";
55
+ } from "./chunk-76JOLPST.js";
52
56
  import {
53
57
  repoKeyFor,
54
58
  repositoryScopeFor
55
- } from "./chunk-GV5TEADP.js";
59
+ } from "./chunk-LMDXQIYT.js";
56
60
  import {
57
61
  askUser,
58
62
  cancelQuestion,
@@ -69,20 +73,17 @@ import {
69
73
  waitForQuestion,
70
74
  waitsForThePhone,
71
75
  withdrawQuestion
72
- } from "./chunk-CC4LGKEZ.js";
76
+ } from "./chunk-IAASPG5B.js";
73
77
  import {
74
78
  getMachineId
75
- } from "./chunk-PYUN7HNY.js";
76
- import {
77
- claudeConfigDir
78
- } from "./chunk-AYWX6M7J.js";
79
+ } from "./chunk-I3IUS4SR.js";
79
80
  import {
80
81
  getApiKey,
81
82
  getBaseUrl
82
- } from "./chunk-3A7REECH.js";
83
+ } from "./chunk-GKCDMAUM.js";
83
84
  import {
84
85
  NPX_LATEST_COMMAND
85
- } from "./chunk-YDT6TVGN.js";
86
+ } from "./chunk-YDQ6OJMF.js";
86
87
  import {
87
88
  AGENT_QUESTION_STRATEGY,
88
89
  AGENT_QUESTION_TOOL,
@@ -109,7 +110,6 @@ import {
109
110
  claudeConsultsItsAllowlist,
110
111
  claudePermissionDeniedOutput,
111
112
  claudePermissionRequestOutput,
112
- claudePermissionRulesFromSettings,
113
113
  claudePreToolUseOutput,
114
114
  claudePromptTakesTheCall,
115
115
  claudeStoppedPermissionRequestOutput,
@@ -139,7 +139,7 @@ import {
139
139
  terminalStaysLiveForTheCall,
140
140
  timeoutActionWithoutLocalPrompt,
141
141
  unansweredRefusalReason
142
- } from "./chunk-5YVBVJOH.js";
142
+ } from "./chunk-O5TB2LMQ.js";
143
143
 
144
144
  // src/terminal-answer-watch.ts
145
145
  import { closeSync, openSync, readSync, statSync } from "fs";
@@ -234,50 +234,6 @@ var watchForTerminalAnswer = (transcriptPath, call, startedAtMs, signal, pollMs
234
234
  tick();
235
235
  });
236
236
 
237
- // src/claude-permission-rules.ts
238
- import { readFileSync, statSync as statSync2 } from "fs";
239
- import { homedir } from "os";
240
- import { join } from "path";
241
- var MANAGED_CLAUDE_SETTINGS_BY_PLATFORM = {
242
- darwin: "/Library/Application Support/ClaudeCode/managed-settings.json",
243
- linux: "/etc/claude-code/managed-settings.json",
244
- win32: "C:\\ProgramData\\ClaudeCode\\managed-settings.json"
245
- };
246
- var MAX_CLAUDE_SETTINGS_BYTES = 1048576;
247
- var claudeSettingsLocationFor = (cwd, environment = process.env, home = homedir(), platform = process.platform) => ({
248
- configDir: claudeConfigDir(home, environment),
249
- projectDir: environment.CLAUDE_PROJECT_DIR || cwd || void 0,
250
- managedSettingsPath: MANAGED_CLAUDE_SETTINGS_BY_PLATFORM[platform]
251
- });
252
- var claudeSettingsSources = (location) => [
253
- ...location.managedSettingsPath ? [{ path: location.managedSettingsPath, trust: "grants" }] : [],
254
- { path: join(location.configDir, "settings.json"), trust: "grants" },
255
- ...location.projectDir ? [
256
- { path: join(location.projectDir, ".claude", "settings.json"), trust: "restricts_only" },
257
- { path: join(location.projectDir, ".claude", "settings.local.json"), trust: "grants" }
258
- ] : []
259
- ];
260
- var isRecord2 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
261
- var restrictionsOnly = (document) => {
262
- if (!isRecord2(document) || !isRecord2(document.permissions)) return null;
263
- const { ask: ask2, deny: deny2 } = document.permissions;
264
- return { permissions: { ask: ask2, deny: deny2 } };
265
- };
266
- var readSettingsDocument = (path) => {
267
- try {
268
- const stats = statSync2(path);
269
- if (!stats.isFile() || stats.size > MAX_CLAUDE_SETTINGS_BYTES) return null;
270
- return JSON.parse(readFileSync(path, "utf8"));
271
- } catch {
272
- return null;
273
- }
274
- };
275
- var trustedDocument = ({ path, trust }) => {
276
- const document = readSettingsDocument(path);
277
- return trust === "grants" ? document : restrictionsOnly(document);
278
- };
279
- var readClaudePermissionRules = (location) => claudePermissionRulesFromSettings(claudeSettingsSources(location).map(trustedDocument));
280
-
281
237
  // src/decision-episode.ts
282
238
  var EPISODE_PATH = "/api/agent/decision-episode";
283
239
  var EMIT_TIMEOUT_MS = 3e3;
@@ -5,21 +5,21 @@ import {
5
5
  hermesAppWiringRecord,
6
6
  hermesConfigReceipt,
7
7
  hermesSetupReceipt
8
- } from "./chunk-AYWX6M7J.js";
8
+ } from "./chunk-JCSJEMTA.js";
9
9
  import {
10
10
  resolvePathBinary
11
- } from "./chunk-VAZCGOLS.js";
11
+ } from "./chunk-ZCBTCW3T.js";
12
12
  import {
13
13
  readJsonSafe,
14
14
  writeJsonAtomic
15
- } from "./chunk-QENTGE75.js";
15
+ } from "./chunk-T5I4PKOQ.js";
16
16
  import {
17
17
  isNewerVersion,
18
18
  isReleaseVersion
19
19
  } from "./chunk-ZVU6WMMU.js";
20
20
  import {
21
21
  isRecord
22
- } from "./chunk-5YVBVJOH.js";
22
+ } from "./chunk-O5TB2LMQ.js";
23
23
 
24
24
  // src/hermes/plugin-payload.ts
25
25
  import { createHash } from "crypto";
@@ -3508,6 +3508,11 @@ var MIN_SAFE_CLI_VERSION = formatReleaseVersion(MIN_SAFE_RELEASE);
3508
3508
  var AUTO_UPDATE_RESULTS = ["updated", "current", "needs_manual", "failed", "finish_pending", "finish_blocked"];
3509
3509
  var isAutoUpdateResult = (value) => typeof value === "string" && AUTO_UPDATE_RESULTS.includes(value);
3510
3510
 
3511
+ // ../contracts/src/hook-wiring-report.ts
3512
+ var HOOK_WIRING_REPORT_VERSION = 1;
3513
+ var HOOK_WIRING_PROFILE_LENGTH = 16;
3514
+ var HOOK_WIRING_PROFILE_PATTERN = new RegExp(`^[0-9a-f]{${HOOK_WIRING_PROFILE_LENGTH}}$`);
3515
+
3511
3516
  // ../contracts/src/answer-drafts.ts
3512
3517
  var ANSWER_DRAFT_TTL_MS = 24 * 60 * 60 * 1e3;
3513
3518
 
@@ -8612,6 +8617,7 @@ export {
8612
8617
  CURSOR_GATE_COVERAGE,
8613
8618
  isCursorHookPayload,
8614
8619
  NO_CURSOR_GATE,
8620
+ matcherMatchesEveryCall,
8615
8621
  toolsCoveredByGateEntry,
8616
8622
  cursorGateOwnsToolCall,
8617
8623
  claudeTurnEndOutput,
@@ -8643,6 +8649,8 @@ export {
8643
8649
  withDeclinedAgent,
8644
8650
  withoutDeclinedAgent,
8645
8651
  isAutoUpdateResult,
8652
+ HOOK_WIRING_REPORT_VERSION,
8653
+ HOOK_WIRING_PROFILE_LENGTH,
8646
8654
  SESSION_HISTORY_BACKFILL_LIMIT_BYTES,
8647
8655
  PERSONAL_QUESTION_CAPABILITY,
8648
8656
  isQuestionOwner,
@@ -1,20 +1,20 @@
1
1
  import {
2
2
  openCodeConfigDirFrom
3
- } from "./chunk-RDUY7MKN.js";
3
+ } from "./chunk-IHQRLJEP.js";
4
4
  import {
5
5
  nativeClaudeInstallPath
6
- } from "./chunk-VUFHYMSP.js";
6
+ } from "./chunk-ROVLRXBI.js";
7
7
  import {
8
8
  grokHome
9
- } from "./chunk-5BX57BGT.js";
9
+ } from "./chunk-JLJJRBTD.js";
10
10
  import {
11
11
  claudeConfigDir,
12
12
  clineDataDirectory,
13
13
  codexHomeFrom
14
- } from "./chunk-AYWX6M7J.js";
14
+ } from "./chunk-JCSJEMTA.js";
15
15
  import {
16
16
  HOOK_COMPATIBLE_PROFILES
17
- } from "./chunk-5YVBVJOH.js";
17
+ } from "./chunk-O5TB2LMQ.js";
18
18
 
19
19
  // src/vscode-config.ts
20
20
  import { homedir } from "os";
@@ -0,0 +1,108 @@
1
+ import {
2
+ pusharyHookExecutable
3
+ } from "./chunk-MFJHLVIZ.js";
4
+ import {
5
+ bridgeResolvesToApp,
6
+ cursorUserHooks,
7
+ executableFileName,
8
+ isBridgeLocator,
9
+ liveBridgeProbe
10
+ } from "./chunk-JCSJEMTA.js";
11
+ import {
12
+ atLeast,
13
+ parseVersion
14
+ } from "./chunk-ZCBTCW3T.js";
15
+ import {
16
+ CURSOR_GATE_COVERAGE,
17
+ CURSOR_GATE_SCRIPT,
18
+ HOOK_VERSION_PATTERN,
19
+ NO_CURSOR_GATE,
20
+ cursorGateOwnsToolCall,
21
+ isCursorHookPayload,
22
+ isRecord,
23
+ toolsCoveredByGateEntry
24
+ } from "./chunk-O5TB2LMQ.js";
25
+
26
+ // src/cursor-gate-registration.ts
27
+ import { dirname, isAbsolute, join, resolve } from "path";
28
+ var FIRST_PLUGIN_VERSION_HANDLING = {
29
+ beforeShellExecution: [0, 1, 0],
30
+ beforeMCPExecution: [0, 2, 1],
31
+ preToolUse: [0, 2, 2]
32
+ };
33
+ var COMMAND_HOOK_TYPE = "command";
34
+ var PLUGIN_MANIFEST = join(".cursor-plugin", "plugin.json");
35
+ var isCursorGateScript = (executable) => executableFileName(executable) === CURSOR_GATE_SCRIPT;
36
+ var fromHooksDirectory = (path, environment) => isAbsolute(path) ? path : resolve(dirname(environment.hooksFile), path);
37
+ var pluginManifestBeside = (script) => join(dirname(dirname(script)), PLUGIN_MANIFEST);
38
+ var versionIn = (manifest) => {
39
+ try {
40
+ const parsed = JSON.parse(manifest);
41
+ return isRecord(parsed) && typeof parsed.version === "string" && HOOK_VERSION_PATTERN.test(parsed.version) ? parseVersion(parsed.version) : null;
42
+ } catch {
43
+ return null;
44
+ }
45
+ };
46
+ var pluginVersionOf = (script, probe) => {
47
+ const manifest = probe.readFile(pluginManifestBeside(script));
48
+ return manifest === null ? null : versionIn(manifest);
49
+ };
50
+ var gateScriptHandles = (script, event, probe) => {
51
+ if (!probe.exists(script)) return false;
52
+ const version = pluginVersionOf(script, probe);
53
+ return version !== null && atLeast(version, FIRST_PLUGIN_VERSION_HANDLING[event]);
54
+ };
55
+ var isLiveCursorGateCommand = (command, event, environment) => {
56
+ const executable = pusharyHookExecutable(command);
57
+ if (executable === null) return false;
58
+ const target = fromHooksDirectory(executable, environment);
59
+ if (isCursorGateScript(executable)) return gateScriptHandles(target, event, environment.probe);
60
+ return isBridgeLocator(executable) && bridgeResolvesToApp(target, environment.probe);
61
+ };
62
+ var isCommandHook = (entry) => entry.type === void 0 || entry.type === COMMAND_HOOK_TYPE;
63
+ var entriesOn = (hooks, event) => {
64
+ const entries = Object.hasOwn(hooks, event) ? hooks[event] : void 0;
65
+ return Array.isArray(entries) ? entries.filter(isRecord) : [];
66
+ };
67
+ var runsALiveGate = (entry, event, isLiveGate) => isCommandHook(entry) && typeof entry.command === "string" && isLiveGate(entry.command, event);
68
+ var toolsCoveredOn = (hooks, coverage, isLiveGate) => entriesOn(hooks, coverage.event).filter((entry) => runsALiveGate(entry, coverage.event, isLiveGate)).flatMap((entry) => toolsCoveredByGateEntry(coverage, entry.matcher) ?? []);
69
+ var cursorGateRegistrationOf = (document, isLiveGate) => {
70
+ if (!isRecord(document) || !isRecord(document.hooks)) return NO_CURSOR_GATE;
71
+ const hooks = document.hooks;
72
+ return CURSOR_GATE_COVERAGE.flatMap((coverage) => toolsCoveredOn(hooks, coverage, isLiveGate));
73
+ };
74
+ var coversEveryTool = (covers, covered) => {
75
+ if (covers.kind === "prefix") return covered.some((match) => match.kind === "prefix" && match.prefix === covers.prefix);
76
+ return covers.tools.every((tool) => covered.some((match) => match.kind === "named" && match.tools.includes(tool)));
77
+ };
78
+ var NO_LIVE_CURSOR_GATE = { full: [], partial: [] };
79
+ var liveCursorGateCoverage = (document, environment) => {
80
+ if (!isRecord(document) || !isRecord(document.hooks)) return NO_LIVE_CURSOR_GATE;
81
+ const hooks = document.hooks;
82
+ const isLiveGate = (command, event) => isLiveCursorGateCommand(command, event, environment);
83
+ const coverage = CURSOR_GATE_COVERAGE.map((gate) => {
84
+ const covered = toolsCoveredOn(hooks, gate, isLiveGate);
85
+ return { event: gate.event, coversEveryTool: coversEveryTool(gate.covers, covered), coversSomeTool: covered.length > 0 };
86
+ });
87
+ return {
88
+ full: coverage.filter((gate) => gate.coversEveryTool).map((gate) => gate.event),
89
+ partial: coverage.filter((gate) => gate.coversSomeTool && !gate.coversEveryTool).map((gate) => gate.event)
90
+ };
91
+ };
92
+ var userCursorGateEnvironment = () => ({ hooksFile: cursorUserHooks(), probe: liveBridgeProbe() });
93
+ var readCursorGateRegistration = (environment = userCursorGateEnvironment()) => {
94
+ try {
95
+ const raw = environment.probe.readFile(environment.hooksFile);
96
+ if (raw === null) return NO_CURSOR_GATE;
97
+ return cursorGateRegistrationOf(JSON.parse(raw), (command, event) => isLiveCursorGateCommand(command, event, environment));
98
+ } catch {
99
+ return NO_CURSOR_GATE;
100
+ }
101
+ };
102
+ var cursorGateOwnsClaudeCall = (payload, readRegistration) => isCursorHookPayload(payload) && cursorGateOwnsToolCall(readRegistration(), payload.tool_name);
103
+
104
+ export {
105
+ liveCursorGateCoverage,
106
+ readCursorGateRegistration,
107
+ cursorGateOwnsClaudeCall
108
+ };
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  ensureCodexTrustsPusharyHooks
3
- } from "./chunk-AE2BQ3XM.js";
3
+ } from "./chunk-VKTW5WVB.js";
4
4
  import {
5
5
  hermesReceiptPaths,
6
6
  hermesSetupPredatesThePluginFolder,
7
7
  installHermesPlugin,
8
8
  refreshHermesPluginFiles,
9
9
  shippedHermesPlugin
10
- } from "./chunk-TYM6IH5F.js";
10
+ } from "./chunk-NM44KCO6.js";
11
11
  import {
12
12
  fxIgnoresInstructionsFile,
13
13
  fxInstructionsBody,
@@ -16,7 +16,7 @@ import {
16
16
  macAppFxBridge,
17
17
  refreshClineKey,
18
18
  switchFxHttpEntryToBridge
19
- } from "./chunk-ORIVT4BL.js";
19
+ } from "./chunk-UXIUCMFO.js";
20
20
  import {
21
21
  OPENCODE_HOOK_BINARY,
22
22
  agentHookOwner,
@@ -28,16 +28,16 @@ import {
28
28
  openCodePluginDir,
29
29
  openCodeWired,
30
30
  withOpenCodeAskRules
31
- } from "./chunk-RDUY7MKN.js";
31
+ } from "./chunk-IHQRLJEP.js";
32
32
  import {
33
33
  detectClaudeVersion
34
- } from "./chunk-2MRLDEQY.js";
34
+ } from "./chunk-IGO5NDQY.js";
35
35
  import {
36
36
  addCompatibleHooks,
37
37
  compatibleConfigFile,
38
38
  compatibleInstructionsFile,
39
39
  hasCompatibleHooks
40
- } from "./chunk-5BX57BGT.js";
40
+ } from "./chunk-JLJJRBTD.js";
41
41
  import {
42
42
  GEMINI_HOOK_BINARY,
43
43
  addGeminiHooks,
@@ -49,7 +49,7 @@ import {
49
49
  geminiWired,
50
50
  hasGeminiHooks,
51
51
  planHooks
52
- } from "./chunk-RYUIXLZ5.js";
52
+ } from "./chunk-MFJHLVIZ.js";
53
53
  import {
54
54
  CLAUDE_HOOK_BINARY,
55
55
  CLAUDE_HOOK_EVENTS,
@@ -95,23 +95,23 @@ import {
95
95
  renderAgentInstructions,
96
96
  supportedClaudeEvents,
97
97
  vscodePluginMcp
98
- } from "./chunk-AYWX6M7J.js";
98
+ } from "./chunk-JCSJEMTA.js";
99
99
  import {
100
100
  formatVersion,
101
101
  hookCommandsUseBareNames,
102
102
  resolveGlobalBinDir,
103
103
  resolveGlobalBinary
104
- } from "./chunk-VAZCGOLS.js";
104
+ } from "./chunk-ZCBTCW3T.js";
105
105
  import {
106
106
  readJsonSafe,
107
107
  writeFileAtomic,
108
108
  writeJsonAtomic
109
- } from "./chunk-QENTGE75.js";
109
+ } from "./chunk-T5I4PKOQ.js";
110
110
  import {
111
111
  HOOK_COMPATIBLE_PROFILES,
112
112
  isCompatibleAgentType,
113
113
  isRecord
114
- } from "./chunk-5YVBVJOH.js";
114
+ } from "./chunk-O5TB2LMQ.js";
115
115
 
116
116
  // src/reapply.ts
117
117
  import { dirname, join } from "path";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  readOwnerOnlyJson,
3
3
  transcriptReadPositionSchema
4
- } from "./chunk-M7BDKARZ.js";
4
+ } from "./chunk-HXBQTPKC.js";
5
5
  import {
6
6
  external_exports
7
7
  } from "./chunk-XMSDA5WA.js";
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  keyCheckFromResponse
3
- } from "./chunk-NGY2WS3X.js";
3
+ } from "./chunk-EMSRB2KH.js";
4
4
  import {
5
5
  installNetworkDefaults
6
- } from "./chunk-ID4BZRBW.js";
6
+ } from "./chunk-LL7SW4RL.js";
7
7
  import {
8
8
  getBaseUrl
9
- } from "./chunk-3A7REECH.js";
9
+ } from "./chunk-GKCDMAUM.js";
10
10
  import {
11
11
  isRecord,
12
12
  isToolErrorResult,
13
13
  toolFailureCodeOfResult
14
- } from "./chunk-5YVBVJOH.js";
14
+ } from "./chunk-O5TB2LMQ.js";
15
15
 
16
16
  // src/retry.ts
17
17
  var isRetryable = (err) => {
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  notificationAnswerStep
3
- } from "./chunk-3KEY3453.js";
3
+ } from "./chunk-X4TZN52V.js";
4
4
  import {
5
5
  canChangeApprovalSettings
6
- } from "./chunk-4JBCPRWZ.js";
6
+ } from "./chunk-2HC5ISDW.js";
7
7
  import {
8
8
  matchMacAccountStep,
9
9
  retryAgentCommand
10
- } from "./chunk-4QI6SBNR.js";
10
+ } from "./chunk-FJYUB3ZK.js";
11
11
  import {
12
12
  EXIT
13
13
  } from "./chunk-BG4HHB7E.js";
14
14
  import {
15
15
  NPX_LATEST_COMMAND
16
- } from "./chunk-YDT6TVGN.js";
16
+ } from "./chunk-YDQ6OJMF.js";
17
17
 
18
18
  // src/setup/closing.ts
19
19
  var ACTIVITY_URL = "pushary.com/dashboard/agent/activity";