@pushary/agent-hooks 1.9.12 → 1.9.13

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 (102) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/data/cursor-plugin/scripts/pushary-gate.mjs +7 -2
  3. package/dist/bin/pushary-bell-hook.js +25 -25
  4. package/dist/bin/pushary-bell.js +9 -9
  5. package/dist/bin/pushary-claude.js +26 -25
  6. package/dist/bin/pushary-clean.js +52 -30
  7. package/dist/bin/pushary-codex-bridge.js +17 -17
  8. package/dist/bin/pushary-codex-hook.js +30 -30
  9. package/dist/bin/pushary-codex.js +12 -12
  10. package/dist/bin/pushary-connect.js +24 -24
  11. package/dist/bin/pushary-cowork.js +5 -5
  12. package/dist/bin/pushary-daemon.js +31 -31
  13. package/dist/bin/pushary-disconnect.js +39 -25
  14. package/dist/bin/pushary-doctor.js +33 -33
  15. package/dist/bin/pushary-elicitation-hook.js +25 -25
  16. package/dist/bin/pushary-gemini-bridge.js +13 -13
  17. package/dist/bin/pushary-gemini-hook.js +27 -27
  18. package/dist/bin/pushary-hook.js +29 -29
  19. package/dist/bin/pushary-login.js +12 -12
  20. package/dist/bin/pushary-logout.js +10 -10
  21. package/dist/bin/pushary-mcp.js +9 -9
  22. package/dist/bin/pushary-mode.js +12 -12
  23. package/dist/bin/pushary-notification-hook.js +24 -24
  24. package/dist/bin/pushary-opencode-hook.js +26 -26
  25. package/dist/bin/pushary-permission-denied-hook.js +29 -29
  26. package/dist/bin/pushary-permission-hook.js +28 -28
  27. package/dist/bin/pushary-post-hook.js +24 -24
  28. package/dist/bin/pushary-prompt-hook.js +24 -24
  29. package/dist/bin/pushary-session-end-hook.js +24 -24
  30. package/dist/bin/pushary-session-start-hook.js +28 -28
  31. package/dist/bin/pushary-setup.js +69 -41
  32. package/dist/bin/pushary-stats.js +5 -5
  33. package/dist/bin/pushary-status.js +26 -26
  34. package/dist/bin/pushary-stop-hook.js +24 -24
  35. package/dist/bin/pushary-stopfailure-hook.js +24 -24
  36. package/dist/bin/pushary-suggestions.js +12 -12
  37. package/dist/bin/pushary-transcript-register.js +17 -17
  38. package/dist/bin/pushary-transcripts.js +7 -7
  39. package/dist/bin/pushary-upgrade.js +30 -30
  40. package/dist/bin/pushary-wait.js +12 -12
  41. package/dist/bin/pushary.js +6 -6
  42. package/dist/{chunk-SJ7M37RL.js → chunk-226PID65.js} +5 -5
  43. package/dist/{chunk-ZHF4JDVE.js → chunk-3EOXZYUE.js} +1 -1
  44. package/dist/{chunk-FSCWOYK6.js → chunk-3LSJ7YVM.js} +3 -3
  45. package/dist/{chunk-BOHDM4T7.js → chunk-3VSMTCXV.js} +10 -5
  46. package/dist/{chunk-2QJ6K2SR.js → chunk-43IDNI4X.js} +5 -5
  47. package/dist/{chunk-2NKTEA42.js → chunk-43ORAXAL.js} +1 -1
  48. package/dist/{chunk-RYBAJXV4.js → chunk-4ATFPZ6X.js} +1 -1
  49. package/dist/{chunk-KXCWWHYO.js → chunk-4EAILOOQ.js} +3 -3
  50. package/dist/{chunk-2GBUL4NP.js → chunk-4ZSWBLVM.js} +6 -6
  51. package/dist/{chunk-5HPC3RNE.js → chunk-5QTQI3HL.js} +1 -1
  52. package/dist/{chunk-BX2R7SIY.js → chunk-6CM3B4PJ.js} +6 -6
  53. package/dist/{chunk-NDZKDJQU.js → chunk-6MGD24SH.js} +1 -1
  54. package/dist/{chunk-7U26QSMF.js → chunk-6NL3LYUM.js} +8 -8
  55. package/dist/{chunk-Z6VYZSVA.js → chunk-6QPQG3Q5.js} +5 -5
  56. package/dist/{chunk-ZC6EVOX6.js → chunk-7JM6TCMA.js} +1 -1
  57. package/dist/{chunk-5VUB6VVO.js → chunk-7VWIBIDK.js} +4 -4
  58. package/dist/{chunk-JNDELCH5.js → chunk-FWAXBC3P.js} +1 -1
  59. package/dist/{chunk-M2P3HQA3.js → chunk-G54VGPRX.js} +1 -1
  60. package/dist/{chunk-A2DW2RNT.js → chunk-G5K656XW.js} +2 -2
  61. package/dist/{chunk-CKUACXAX.js → chunk-GFAVGG3X.js} +5 -5
  62. package/dist/{chunk-CPUEZAE2.js → chunk-GYR4G4WO.js} +1 -1
  63. package/dist/{chunk-EYLQVCME.js → chunk-HHMMY6TB.js} +2 -2
  64. package/dist/{chunk-FLPXTN3Q.js → chunk-J2VNQSS6.js} +1 -1
  65. package/dist/{chunk-JKGTASA2.js → chunk-JRKUJOZL.js} +1 -1
  66. package/dist/{chunk-DWHCF4RH.js → chunk-JVUK5YFM.js} +5 -5
  67. package/dist/{chunk-RBBMGCSZ.js → chunk-LBNIISXH.js} +1 -1
  68. package/dist/{chunk-CXKY5FGY.js → chunk-LHLUKFJV.js} +8 -8
  69. package/dist/{chunk-WBSL4FBX.js → chunk-LUYAXSUS.js} +3 -3
  70. package/dist/{chunk-CATIBZQH.js → chunk-LYDO2SS6.js} +3 -3
  71. package/dist/{chunk-J5XCHLP4.js → chunk-MPDJJNGA.js} +2 -2
  72. package/dist/{chunk-GTM7C36Y.js → chunk-MWP65CZ3.js} +2 -2
  73. package/dist/{chunk-OBGZUD73.js → chunk-N6XFGVNW.js} +3 -3
  74. package/dist/{chunk-WKP2KRTU.js → chunk-NPRFA7YM.js} +2 -2
  75. package/dist/chunk-OOKRWBCG.js +111 -0
  76. package/dist/{chunk-MEHDBT5H.js → chunk-OOZ5RSEF.js} +2 -2
  77. package/dist/{chunk-BNQKHPEC.js → chunk-QIPDIZC5.js} +4 -4
  78. package/dist/{chunk-PKQ435Z2.js → chunk-RI5E5JQS.js} +1 -1
  79. package/dist/{chunk-YZWUTWDG.js → chunk-RJAPOB34.js} +2 -2
  80. package/dist/{chunk-UEQWLVJB.js → chunk-RYKU62ZI.js} +1 -1
  81. package/dist/{chunk-3VPS7JPH.js → chunk-S2LDTUHS.js} +2 -2
  82. package/dist/{chunk-VDPU4YQN.js → chunk-TCVFNLMM.js} +20 -14
  83. package/dist/{chunk-GP44LTXN.js → chunk-TDSLVFG6.js} +1 -1
  84. package/dist/{chunk-QOBOIFGG.js → chunk-TVDI7SX2.js} +26 -7
  85. package/dist/{chunk-DYQ5QIDN.js → chunk-U5SXTKZV.js} +2 -2
  86. package/dist/{chunk-CMZ4CW5J.js → chunk-U6QEHPEF.js} +3 -3
  87. package/dist/{chunk-SQJUXVLW.js → chunk-UUBEEKT6.js} +2 -2
  88. package/dist/{chunk-TSGQYARU.js → chunk-VUHT6NYV.js} +4 -4
  89. package/dist/{chunk-E2FGVADR.js → chunk-WIRM7ZLI.js} +2 -2
  90. package/dist/{chunk-LBDMCNQY.js → chunk-WL4PVINO.js} +2 -2
  91. package/dist/{chunk-AWD2SLNA.js → chunk-WP57USIT.js} +13 -4
  92. package/dist/{chunk-PNBJAYSL.js → chunk-Y25RH4VF.js} +1 -1
  93. package/dist/{chunk-TZCHW6KR.js → chunk-YI37QERZ.js} +4 -4
  94. package/dist/{chunk-4DWQNP52.js → chunk-ZAH3CCEV.js} +4 -4
  95. package/dist/{global-upgrade-OCZWEF3A.js → global-upgrade-NIFOQFV4.js} +6 -6
  96. package/dist/{paths-SOGZJICO.js → paths-QPBLO5Q2.js} +2 -2
  97. package/dist/{reapply-DFG5IE6N.js → reapply-TVMBJWJB.js} +20 -20
  98. package/dist/src/index.d.ts +1 -0
  99. package/dist/src/index.js +19 -19
  100. package/dist/{upgrade-lock-XLE5GVWS.js → upgrade-lock-Z3LYROGK.js} +3 -3
  101. package/package.json +1 -1
  102. package/dist/chunk-PMUOEEUE.js +0 -50
@@ -1,21 +1,21 @@
1
1
  import {
2
2
  defersToNativeMode,
3
3
  reportMachineDenial
4
- } from "./chunk-E2FGVADR.js";
4
+ } from "./chunk-WIRM7ZLI.js";
5
5
  import {
6
6
  isGatingMoment,
7
7
  recordKeylessMoment
8
- } from "./chunk-RBBMGCSZ.js";
8
+ } from "./chunk-LBNIISXH.js";
9
9
  import {
10
10
  announceSubscriptionRequired,
11
11
  denyReasonFrom,
12
12
  isDeferAnswer,
13
13
  oncePerSession
14
- } from "./chunk-CPUEZAE2.js";
14
+ } from "./chunk-GYR4G4WO.js";
15
15
  import {
16
16
  activeHookSource,
17
17
  activeIdentity
18
- } from "./chunk-BOHDM4T7.js";
18
+ } from "./chunk-3VSMTCXV.js";
19
19
  import {
20
20
  DEFAULT_SESSION,
21
21
  UNNAMED_ACTION,
@@ -40,7 +40,7 @@ import {
40
40
  reportEvent,
41
41
  scopePathFor,
42
42
  settleQuestionsForToolUse
43
- } from "./chunk-7U26QSMF.js";
43
+ } from "./chunk-6NL3LYUM.js";
44
44
  import {
45
45
  askUser,
46
46
  cancelQuestion,
@@ -51,26 +51,28 @@ import {
51
51
  requestGate,
52
52
  sendNotification,
53
53
  waitForQuestion
54
- } from "./chunk-DWHCF4RH.js";
54
+ } from "./chunk-JVUK5YFM.js";
55
55
  import {
56
56
  SubscriptionRequiredError
57
- } from "./chunk-CATIBZQH.js";
57
+ } from "./chunk-LYDO2SS6.js";
58
58
  import {
59
59
  getMachineId
60
- } from "./chunk-2NKTEA42.js";
60
+ } from "./chunk-43ORAXAL.js";
61
61
  import {
62
62
  getApiKey,
63
63
  getBaseUrl
64
- } from "./chunk-ZC6EVOX6.js";
64
+ } from "./chunk-7JM6TCMA.js";
65
65
  import {
66
66
  NPX_LATEST_COMMAND
67
- } from "./chunk-RYBAJXV4.js";
67
+ } from "./chunk-4ATFPZ6X.js";
68
68
  import {
69
69
  AGENT_QUESTION_STRATEGY,
70
70
  DECISION_STOP_REASON,
71
71
  GATE_BLOCK_REASON_MAX_LENGTH,
72
72
  GATE_WIRE,
73
73
  PLAN_DECLINED_REASON,
74
+ SOLE_GATE_SIGNED_OUT_REASON,
75
+ SOLE_GATE_UNDECIDED_REASON,
74
76
  UNVERIFIABLE_APPROVAL_REASON,
75
77
  WITHDRAWN_APPROVAL_REASON,
76
78
  agentQuestionStrategy,
@@ -87,6 +89,7 @@ import {
87
89
  editGoesToTheAgentsPrompt,
88
90
  effectiveWaitSeconds,
89
91
  hasNativeApprovalPrompt,
92
+ hookCompatibleProfileBySource,
90
93
  hookHoldWindowMs,
91
94
  hookWaitClamped,
92
95
  hookWaitDeadline,
@@ -98,7 +101,7 @@ import {
98
101
  parseAgentQuestions,
99
102
  questionHandedToTheTerminal,
100
103
  resolveGate
101
- } from "./chunk-QOBOIFGG.js";
104
+ } from "./chunk-TVDI7SX2.js";
102
105
 
103
106
  // src/claude-permission-rules.ts
104
107
  import { readFileSync, statSync } from "fs";
@@ -171,12 +174,14 @@ import { basename } from "path";
171
174
  var START_MS = Date.now();
172
175
  var ACTIVE_AGENT = activeIdentity(process.argv);
173
176
  var ACTIVE_SOURCE = activeHookSource(process.argv);
177
+ var PUSHARY_IS_SOLE_GATE = ACTIVE_SOURCE !== null && hookCompatibleProfileBySource(ACTIVE_SOURCE)?.soleGate != null;
174
178
  var agentNameIn = (projectName) => `${ACTIVE_AGENT.label} - ${projectName}`;
175
179
  var allow = (reason) => claudePreToolUseOutput("allow", reason);
176
180
  var deny = (reason) => claudePreToolUseOutput("deny", reason);
177
181
  var allowWithInput = (updatedInput) => claudePreToolUseOutput("allow", void 0, updatedInput);
178
182
  var ask = (reason) => claudePreToolUseOutput("ask", reason);
179
183
  var halted = (reason) => claudeStoppedPreToolUseOutput(reason);
184
+ var undecidedCall = (reason) => PUSHARY_IS_SOLE_GATE ? deny(reason) : void 0;
180
185
  var outcomeOfFailedAsk = (error, sessionId, failure) => {
181
186
  if (!(error instanceof SubscriptionRequiredError)) return failure;
182
187
  announceSubscriptionRequired(error.upgradeUrl, sessionId);
@@ -591,7 +596,8 @@ var handlePreToolUse = async (input, canonical) => {
591
596
  try {
592
597
  apiKey = getApiKey();
593
598
  } catch {
594
- return handleKeyless(input);
599
+ handleKeyless(input);
600
+ return undecidedCall(SOLE_GATE_SIGNED_OUT_REASON);
595
601
  }
596
602
  try {
597
603
  const modeState = await fetchModeState(apiKey, input.session_id);
@@ -631,12 +637,12 @@ var handlePreToolUse = async (input, canonical) => {
631
637
  // State we could not establish, with an auto-approve on the table. No
632
638
  // opinion, so Claude Code's own flow runs as if the hook were absent.
633
639
  case "defer":
634
- return void 0;
640
+ return undecidedCall(SOLE_GATE_UNDECIDED_REASON);
635
641
  default:
636
642
  return dispatchModeHandler(apiKey, input, verdict.policy, getMachineId(), modeState.trainingConsent, verdict.scopeReason, verdict.scopePath);
637
643
  }
638
644
  } catch {
639
- return void 0;
645
+ return undecidedCall(SOLE_GATE_UNDECIDED_REASON);
640
646
  }
641
647
  };
642
648
  var permReqAllow = (updatedInput) => claudePermissionRequestOutput("allow", void 0, updatedInput);
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  pusharyDir
3
- } from "./chunk-AWD2SLNA.js";
3
+ } from "./chunk-WP57USIT.js";
4
4
  import {
5
5
  readJsonSafe
6
6
  } from "./chunk-T7E75EKA.js";
@@ -239,7 +239,7 @@ var AGENTS = {
239
239
  connectVia: "Native hooks + MCP",
240
240
  setupCommand: PUSHARY_SETUP_COMMAND,
241
241
  enforcementDetail: "Shell commands, file writes, edits and MCP calls through native PreToolUse hooks in ~/.gemini/config/hooks.json, answered allow or deny.",
242
- capabilityNote: 'Antigravity CLI ignores a hook\'s allow unless it runs in always-proceed mode (`toolPermission: "always-proceed"` or `--dangerously-skip-permissions`), so approving from the phone needs that mode, with Pushary as the only gate. Pushary answers allow or deny and never ask, because ask and force_ask run the call unprompted in that mode. An unanswered approval is blocked with a reason.'
242
+ capabilityNote: 'Antigravity CLI ignores a hook\'s allow unless it runs in always-proceed mode, so connecting it sets `toolPermission: "always-proceed"` when you never chose a mode, and disconnecting puts it back. Pushary is then the only gate: it answers allow or deny and never ask, and a call it cannot decide, one nobody answers, or one made after Pushary was removed is blocked with a reason.'
243
243
  },
244
244
  windsurf: {
245
245
  ...defaults,
@@ -332,6 +332,8 @@ var toToolLookup = (profile, toolName, toolInput, resolvePath = (path) => path)
332
332
  };
333
333
  var NO_AGENT_PROMPT_REASON = "Pushary needs an answer from the phone before this can run, and this agent has no approval prompt of its own here, so nothing ran. Ask the user, then try again.";
334
334
  var DENIED_BY_PUSHARY_REASON = "Denied from Pushary.";
335
+ var SOLE_GATE_UNDECIDED_REASON = "Pushary could not decide on this call, so it did not run. Pushary is the only approval for this agent. Check that Pushary is signed in and online, then try again.";
336
+ var SOLE_GATE_SIGNED_OUT_REASON = "Pushary is not signed in on this computer, so nothing can approve this call and it did not run. Sign in to Pushary, or disconnect this agent from Pushary.";
335
337
  var UNCARRIED_ANSWER_REASON = "The answer from the phone cannot be passed to this agent, so the call did not run. Ask the question in chat instead.";
336
338
  var renderAllowDenyDecision = (verdict) => {
337
339
  const { permissionDecision, permissionDecisionReason } = verdict.hookSpecificOutput;
@@ -357,6 +359,14 @@ var renderPreToolUseVerdict = (profile, verdict) => {
357
359
  ...stop
358
360
  };
359
361
  };
362
+ var homePath = (segments) => `~/${segments.join("/")}`;
363
+ var pusharyMissingReason = (profile) => {
364
+ const settingBack = profile.soleGate ? ` and remove ${profile.soleGate.key} from ${homePath(profile.soleGate.file)}` : "";
365
+ return `Pushary is not installed on this computer any more, so nothing can approve this call and it did not run. Reinstall Pushary, or remove the pushary hook from ${homePath(profile.configFile)}${settingBack}.`;
366
+ };
367
+ var refusalOutput = (profile, reason) => JSON.stringify(renderPreToolUseVerdict(profile, {
368
+ hookSpecificOutput: { permissionDecision: "deny", permissionDecisionReason: reason }
369
+ }));
360
370
  var ANTIGRAVITY_MCP_TOOL = "call_mcp_tool";
361
371
  var isPayloadRecord = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
362
372
  var nonEmptyString = (value) => typeof value === "string" && value.length > 0 ? value : void 0;
@@ -442,7 +452,7 @@ var QWEN_CODE = {
442
452
  instructions: { file: [".qwen", "QWEN.md"], label: "Qwen Code" },
443
453
  permissionRuleFile: null,
444
454
  configDirIsShared: false,
445
- setupNote: null
455
+ soleGate: null
446
456
  };
447
457
  var CODEBUDDY = {
448
458
  agentType: "codebuddy",
@@ -465,7 +475,7 @@ var CODEBUDDY = {
465
475
  instructions: { file: [".codebuddy", "CODEBUDDY.md"], label: "CodeBuddy" },
466
476
  permissionRuleFile: [".codebuddy", "settings.json"],
467
477
  configDirIsShared: false,
468
- setupNote: null
478
+ soleGate: null
469
479
  };
470
480
  var QODER = {
471
481
  agentType: "qoder",
@@ -488,7 +498,7 @@ var QODER = {
488
498
  instructions: null,
489
499
  permissionRuleFile: null,
490
500
  configDirIsShared: false,
491
- setupNote: null
501
+ soleGate: null
492
502
  };
493
503
  var DROID = {
494
504
  agentType: "droid",
@@ -516,7 +526,7 @@ var DROID = {
516
526
  instructions: null,
517
527
  permissionRuleFile: null,
518
528
  configDirIsShared: false,
519
- setupNote: null
529
+ soleGate: null
520
530
  };
521
531
  var DEVIN = {
522
532
  agentType: "devin",
@@ -549,7 +559,7 @@ var DEVIN = {
549
559
  instructions: null,
550
560
  permissionRuleFile: null,
551
561
  configDirIsShared: false,
552
- setupNote: null
562
+ soleGate: null
553
563
  };
554
564
  var ANTIGRAVITY_CLI = {
555
565
  agentType: "antigravity_cli",
@@ -584,7 +594,12 @@ var ANTIGRAVITY_CLI = {
584
594
  instructions: null,
585
595
  permissionRuleFile: null,
586
596
  configDirIsShared: true,
587
- setupNote: 'Approvals from your phone take effect only when Antigravity CLI runs in always-proceed mode: start it with --dangerously-skip-permissions, or set "toolPermission": "always-proceed" in ~/.gemini/antigravity-cli/settings.json. Pushary is then the only gate, and an unanswered approval is blocked.'
597
+ soleGate: {
598
+ file: [".gemini", "antigravity-cli", "settings.json"],
599
+ key: "toolPermission",
600
+ value: "always-proceed",
601
+ receipt: [".pushary", "setup", "antigravity-tool-permission.json"]
602
+ }
588
603
  };
589
604
  var HOOK_COMPATIBLE_PROFILES = Object.freeze([QWEN_CODE, CODEBUDDY, QODER, DROID, DEVIN, ANTIGRAVITY_CLI]);
590
605
  var hookCompatibleProfile = (agentType) => HOOK_COMPATIBLE_PROFILES.find((profile) => profile.agentType === agentType);
@@ -3019,7 +3034,11 @@ export {
3019
3034
  PHONE_ANSWERED_TOOLS,
3020
3035
  canonicalToolName,
3021
3036
  toToolLookup,
3037
+ SOLE_GATE_UNDECIDED_REASON,
3038
+ SOLE_GATE_SIGNED_OUT_REASON,
3022
3039
  renderPreToolUseVerdict,
3040
+ pusharyMissingReason,
3041
+ refusalOutput,
3023
3042
  claudeShapedHookInput,
3024
3043
  HOOK_COMPATIBLE_PROFILES,
3025
3044
  hookCompatibleProfile,
@@ -3,11 +3,11 @@ import {
3
3
  decodePublicKey,
4
4
  generateSessionKey,
5
5
  wrapSessionKey
6
- } from "./chunk-PKQ435Z2.js";
6
+ } from "./chunk-RI5E5JQS.js";
7
7
  import {
8
8
  fetchTranscriptRecipients,
9
9
  uploadTranscriptRecords
10
- } from "./chunk-ZHF4JDVE.js";
10
+ } from "./chunk-3EOXZYUE.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
  pusharyFetch
3
- } from "./chunk-WBSL4FBX.js";
3
+ } from "./chunk-LUYAXSUS.js";
4
4
  import {
5
5
  NetworkError
6
6
  } from "./chunk-7QLSKOSU.js";
@@ -9,11 +9,11 @@ import {
9
9
  } from "./chunk-KZERVKTD.js";
10
10
  import {
11
11
  getBaseUrl
12
- } from "./chunk-ZC6EVOX6.js";
12
+ } from "./chunk-7JM6TCMA.js";
13
13
  import {
14
14
  isValidApiKey,
15
15
  normalizeKeyScope
16
- } from "./chunk-QOBOIFGG.js";
16
+ } from "./chunk-TVDI7SX2.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;
@@ -3,10 +3,10 @@ import {
3
3
  keyPrefix,
4
4
  readConfigFileKey,
5
5
  readMacAppKeyPrefix
6
- } from "./chunk-3VPS7JPH.js";
6
+ } from "./chunk-S2LDTUHS.js";
7
7
  import {
8
8
  NPX_LATEST_COMMAND
9
- } from "./chunk-RYBAJXV4.js";
9
+ } from "./chunk-4ATFPZ6X.js";
10
10
 
11
11
  // src/key-signed-out.ts
12
12
  var VERDICT_BY_CHECK = {
@@ -14,19 +14,19 @@ import {
14
14
  } from "./chunk-U4TMAANR.js";
15
15
  import {
16
16
  callMcpTool
17
- } from "./chunk-CATIBZQH.js";
17
+ } from "./chunk-LYDO2SS6.js";
18
18
  import {
19
19
  reportedInstallSource
20
- } from "./chunk-WKP2KRTU.js";
20
+ } from "./chunk-NPRFA7YM.js";
21
21
  import {
22
22
  NPX_LATEST_COMMAND
23
- } from "./chunk-RYBAJXV4.js";
23
+ } from "./chunk-4ATFPZ6X.js";
24
24
  import {
25
25
  NO_PAIRING_COMPUTER,
26
26
  PAIR_TTL_SECONDS,
27
27
  classifyConfirmResponse,
28
28
  isAnswerSource
29
- } from "./chunk-QOBOIFGG.js";
29
+ } from "./chunk-TVDI7SX2.js";
30
30
 
31
31
  // src/reach.ts
32
32
  var reachVerdict = (channels) => {
@@ -6,12 +6,12 @@ import {
6
6
  permissionDeniedAction,
7
7
  releaseThrottle,
8
8
  reportEvent
9
- } from "./chunk-7U26QSMF.js";
9
+ } from "./chunk-6NL3LYUM.js";
10
10
  import {
11
11
  machineDecisionFor,
12
12
  shouldDeferToNativeMode,
13
13
  wireVerdictFor
14
- } from "./chunk-QOBOIFGG.js";
14
+ } from "./chunk-TVDI7SX2.js";
15
15
 
16
16
  // src/machine-decision-audit.ts
17
17
  import { basename } from "path";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  parseSseMessages
3
- } from "./chunk-CATIBZQH.js";
3
+ } from "./chunk-LYDO2SS6.js";
4
4
  import {
5
5
  NPX_LATEST_COMMAND
6
- } from "./chunk-RYBAJXV4.js";
6
+ } from "./chunk-4ATFPZ6X.js";
7
7
 
8
8
  // src/mcp-stdio-bridge.ts
9
9
  var MCP_BRIDGE_BINARY = "pushary-mcp";
@@ -13,7 +13,7 @@ import {
13
13
  isReleaseVersion,
14
14
  ownPackageName,
15
15
  withHookHoldBudget
16
- } from "./chunk-QOBOIFGG.js";
16
+ } from "./chunk-TVDI7SX2.js";
17
17
 
18
18
  // src/setup/paths.ts
19
19
  import { homedir as homedir2 } from "os";
@@ -365,9 +365,9 @@ var installGlobally = (options) => {
365
365
  }
366
366
  const started = (async () => {
367
367
  if (!npmIsOnPath()) throw new NpmMissingError();
368
- const { withUpgradeLock } = await import("./global-upgrade-OCZWEF3A.js");
369
- const { installWithUpgradeLock, ownsUpgradeLock } = await import("./upgrade-lock-XLE5GVWS.js");
370
- const { autoUpdateLock: autoUpdateLock2 } = await import("./paths-SOGZJICO.js");
368
+ const { withUpgradeLock } = await import("./global-upgrade-NIFOQFV4.js");
369
+ const { installWithUpgradeLock, ownsUpgradeLock } = await import("./upgrade-lock-Z3LYROGK.js");
370
+ const { autoUpdateLock: autoUpdateLock2 } = await import("./paths-QPBLO5Q2.js");
371
371
  let result = "skipped";
372
372
  const install = async () => {
373
373
  const platform = process.platform;
@@ -438,6 +438,14 @@ var guardHookCommand = (target, platform = process.platform) => {
438
438
  return `${HOOK_SHELL} '${HOOK_GUARD_SCRIPTS[guardKindOf(target)]}' ${path}`;
439
439
  };
440
440
  var guardBinary = (path, platform) => guardHookCommand({ kind: "binary", path, runtime: "node" }, platform);
441
+ var SILENT_MISS = "exit 0";
442
+ var REFUSE = "R";
443
+ var definesRefusal = (refusal) => `${REFUSE}() { printf %s ${shellDoubleQuoted(refusal)}; exit 0; }`;
444
+ var guardBinaryRefusing = (path, refusal, platform = process.platform) => {
445
+ if (platform === "win32") return guardBinary(path, platform);
446
+ const script = `${definesRefusal(refusal)}; ${HOOK_GUARD_SCRIPTS.node_binary.replaceAll(SILENT_MISS, REFUSE)}`;
447
+ return `${HOOK_SHELL} '${script}' ${quoteIfNeeded(path)}`;
448
+ };
441
449
  var guardNodeScript = (script, platform) => guardHookCommand({ kind: "node", script }, platform);
442
450
  var guardCursorGate = (script, platform) => guardHookCommand({ kind: "cursor_gate", script }, platform);
443
451
  var guardedArgv = (target, args = [], platform = process.platform) => {
@@ -854,6 +862,7 @@ export {
854
862
  installGlobally,
855
863
  holdBudgetOf,
856
864
  guardBinary,
865
+ guardBinaryRefusing,
857
866
  guardNodeScript,
858
867
  guardCursorGate,
859
868
  guardedArgv,
@@ -2,7 +2,7 @@ import {
2
2
  autoUpdateLock,
3
3
  installPackageGlobally,
4
4
  npmErrorMessage
5
- } from "./chunk-AWD2SLNA.js";
5
+ } from "./chunk-WP57USIT.js";
6
6
  import {
7
7
  writeJsonAtomic
8
8
  } from "./chunk-T7E75EKA.js";
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  macAppBridgeAvailable
3
- } from "./chunk-Z6VYZSVA.js";
3
+ } from "./chunk-6QPQG3Q5.js";
4
4
  import {
5
5
  keyPrefix
6
- } from "./chunk-3VPS7JPH.js";
6
+ } from "./chunk-S2LDTUHS.js";
7
7
  import {
8
8
  bridgeAgentKey
9
- } from "./chunk-AWD2SLNA.js";
9
+ } from "./chunk-WP57USIT.js";
10
10
  import {
11
11
  readJsonSafe
12
12
  } from "./chunk-T7E75EKA.js";
13
13
  import {
14
14
  isValidApiKey
15
- } from "./chunk-QOBOIFGG.js";
15
+ } from "./chunk-TVDI7SX2.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;
@@ -2,25 +2,25 @@ import {
2
2
  SIGNED_OUT_ON_MAC_MESSAGE,
3
3
  describeSignedOutKey,
4
4
  readSignedOutDiagnosis
5
- } from "./chunk-SQJUXVLW.js";
5
+ } from "./chunk-UUBEEKT6.js";
6
6
  import {
7
7
  createIo
8
8
  } from "./chunk-U4TMAANR.js";
9
9
  import {
10
10
  readKeySource
11
- } from "./chunk-3VPS7JPH.js";
11
+ } from "./chunk-S2LDTUHS.js";
12
12
  import {
13
13
  absoluteUrl,
14
14
  checkApiKey,
15
15
  describeKeyCheck,
16
16
  keyCheckFromResponse
17
- } from "./chunk-CMZ4CW5J.js";
17
+ } from "./chunk-U6QEHPEF.js";
18
18
  import {
19
19
  EXIT
20
20
  } from "./chunk-KZERVKTD.js";
21
21
  import {
22
22
  getBaseUrl
23
- } from "./chunk-ZC6EVOX6.js";
23
+ } from "./chunk-7JM6TCMA.js";
24
24
 
25
25
  // src/cli/report-key.ts
26
26
  var { dim, yellow } = createIo();
@@ -5,15 +5,15 @@ import {
5
5
  readGlobalUpgradeSubject,
6
6
  upgradeInstalledPackage,
7
7
  withUpgradeLock
8
- } from "./chunk-CKUACXAX.js";
9
- import "./chunk-PNBJAYSL.js";
10
- import "./chunk-J5XCHLP4.js";
8
+ } from "./chunk-GFAVGG3X.js";
9
+ import "./chunk-Y25RH4VF.js";
10
+ import "./chunk-MPDJJNGA.js";
11
11
  import "./chunk-POFBE6ZY.js";
12
12
  import "./chunk-KZERVKTD.js";
13
- import "./chunk-AWD2SLNA.js";
13
+ import "./chunk-WP57USIT.js";
14
14
  import "./chunk-T7E75EKA.js";
15
- import "./chunk-RYBAJXV4.js";
16
- import "./chunk-QOBOIFGG.js";
15
+ import "./chunk-4ATFPZ6X.js";
16
+ import "./chunk-TVDI7SX2.js";
17
17
  export {
18
18
  finishGlobalUpgrade,
19
19
  finishUpgradeWithLock,
@@ -32,8 +32,8 @@ import {
32
32
  pusharyDir,
33
33
  vscodePluginDir,
34
34
  vscodePluginMcp
35
- } from "./chunk-AWD2SLNA.js";
36
- import "./chunk-QOBOIFGG.js";
35
+ } from "./chunk-WP57USIT.js";
36
+ import "./chunk-TVDI7SX2.js";
37
37
  export {
38
38
  autoUpdateLock,
39
39
  autoUpdateLog,
@@ -10,34 +10,34 @@ import {
10
10
  reapplyOpenCodePlugin,
11
11
  reapplyVsCodePlugin,
12
12
  repairCodexHolds
13
- } from "./chunk-BX2R7SIY.js";
14
- import "./chunk-YZWUTWDG.js";
13
+ } from "./chunk-6CM3B4PJ.js";
14
+ import "./chunk-RJAPOB34.js";
15
15
  import "./chunk-RIVNNBEK.js";
16
16
  import "./chunk-XHKBHWLX.js";
17
- import "./chunk-Z6VYZSVA.js";
18
- import "./chunk-BOHDM4T7.js";
19
- import "./chunk-SJ7M37RL.js";
20
- import "./chunk-KXCWWHYO.js";
21
- import "./chunk-NDZKDJQU.js";
22
- import "./chunk-JNDELCH5.js";
17
+ import "./chunk-6QPQG3Q5.js";
18
+ import "./chunk-3VSMTCXV.js";
19
+ import "./chunk-226PID65.js";
20
+ import "./chunk-4EAILOOQ.js";
21
+ import "./chunk-6MGD24SH.js";
22
+ import "./chunk-FWAXBC3P.js";
23
23
  import "./chunk-GMXKITVA.js";
24
24
  import "./chunk-6ICPEJY5.js";
25
- import "./chunk-7U26QSMF.js";
26
- import "./chunk-JKGTASA2.js";
27
- import "./chunk-DWHCF4RH.js";
25
+ import "./chunk-6NL3LYUM.js";
26
+ import "./chunk-JRKUJOZL.js";
27
+ import "./chunk-JVUK5YFM.js";
28
28
  import "./chunk-POFBE6ZY.js";
29
- import "./chunk-CATIBZQH.js";
30
- import "./chunk-CMZ4CW5J.js";
31
- import "./chunk-WBSL4FBX.js";
32
- import "./chunk-2NKTEA42.js";
29
+ import "./chunk-LYDO2SS6.js";
30
+ import "./chunk-U6QEHPEF.js";
31
+ import "./chunk-LUYAXSUS.js";
32
+ import "./chunk-43ORAXAL.js";
33
33
  import "./chunk-7QLSKOSU.js";
34
34
  import "./chunk-KZERVKTD.js";
35
- import "./chunk-WKP2KRTU.js";
36
- import "./chunk-AWD2SLNA.js";
35
+ import "./chunk-NPRFA7YM.js";
36
+ import "./chunk-WP57USIT.js";
37
37
  import "./chunk-T7E75EKA.js";
38
- import "./chunk-ZC6EVOX6.js";
39
- import "./chunk-RYBAJXV4.js";
40
- import "./chunk-QOBOIFGG.js";
38
+ import "./chunk-7JM6TCMA.js";
39
+ import "./chunk-4ATFPZ6X.js";
40
+ import "./chunk-TVDI7SX2.js";
41
41
  export {
42
42
  ensureCodexTrustAfterReapply,
43
43
  inspectConfiguredManagedProviders,
@@ -159,6 +159,7 @@ interface AskUserParams {
159
159
  waitEndsAt?: string;
160
160
  requestId?: string;
161
161
  sessionToolAware?: true;
162
+ localSurfaceAvailable?: false;
162
163
  }
163
164
  interface AskUserResponse {
164
165
  correlationId: string;
package/dist/src/index.js CHANGED
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  handlePreToolUse
3
- } from "../chunk-VDPU4YQN.js";
4
- import "../chunk-E2FGVADR.js";
5
- import "../chunk-RBBMGCSZ.js";
6
- import "../chunk-CPUEZAE2.js";
3
+ } from "../chunk-TCVFNLMM.js";
4
+ import "../chunk-WIRM7ZLI.js";
5
+ import "../chunk-LBNIISXH.js";
6
+ import "../chunk-GYR4G4WO.js";
7
7
  import {
8
8
  fetchAccountPublicKey
9
- } from "../chunk-ZHF4JDVE.js";
10
- import "../chunk-BOHDM4T7.js";
11
- import "../chunk-KXCWWHYO.js";
9
+ } from "../chunk-3EOXZYUE.js";
10
+ import "../chunk-3VSMTCXV.js";
11
+ import "../chunk-4EAILOOQ.js";
12
12
  import "../chunk-6ICPEJY5.js";
13
13
  import {
14
14
  fetchModeOverride,
@@ -18,31 +18,31 @@ import {
18
18
  handlePostToolUse,
19
19
  handleStop,
20
20
  reportEvent
21
- } from "../chunk-7U26QSMF.js";
22
- import "../chunk-JKGTASA2.js";
21
+ } from "../chunk-6NL3LYUM.js";
22
+ import "../chunk-JRKUJOZL.js";
23
23
  import {
24
24
  askUser,
25
25
  cancelQuestion,
26
26
  waitForAnswer
27
- } from "../chunk-DWHCF4RH.js";
27
+ } from "../chunk-JVUK5YFM.js";
28
28
  import "../chunk-POFBE6ZY.js";
29
- import "../chunk-CATIBZQH.js";
30
- import "../chunk-CMZ4CW5J.js";
31
- import "../chunk-WBSL4FBX.js";
32
- import "../chunk-2NKTEA42.js";
29
+ import "../chunk-LYDO2SS6.js";
30
+ import "../chunk-U6QEHPEF.js";
31
+ import "../chunk-LUYAXSUS.js";
32
+ import "../chunk-43ORAXAL.js";
33
33
  import "../chunk-7QLSKOSU.js";
34
34
  import "../chunk-KZERVKTD.js";
35
- import "../chunk-WKP2KRTU.js";
36
- import "../chunk-AWD2SLNA.js";
35
+ import "../chunk-NPRFA7YM.js";
36
+ import "../chunk-WP57USIT.js";
37
37
  import "../chunk-T7E75EKA.js";
38
38
  import {
39
39
  getApiKey,
40
40
  getBaseUrl
41
- } from "../chunk-ZC6EVOX6.js";
42
- import "../chunk-RYBAJXV4.js";
41
+ } from "../chunk-7JM6TCMA.js";
42
+ import "../chunk-4ATFPZ6X.js";
43
43
  import {
44
44
  resolvePolicy
45
- } from "../chunk-QOBOIFGG.js";
45
+ } from "../chunk-TVDI7SX2.js";
46
46
  export {
47
47
  askUser,
48
48
  cancelQuestion,
@@ -5,10 +5,10 @@ import {
5
5
  installWithUpgradeLock,
6
6
  ownsUpgradeLock,
7
7
  releaseAutoUpdateLock
8
- } from "./chunk-PNBJAYSL.js";
9
- import "./chunk-AWD2SLNA.js";
8
+ } from "./chunk-Y25RH4VF.js";
9
+ import "./chunk-WP57USIT.js";
10
10
  import "./chunk-T7E75EKA.js";
11
- import "./chunk-QOBOIFGG.js";
11
+ import "./chunk-TVDI7SX2.js";
12
12
  export {
13
13
  claimUpgradeLock,
14
14
  finishWithUpgradeLock,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushary/agent-hooks",
3
- "version": "1.9.12",
3
+ "version": "1.9.13",
4
4
  "description": "Permission hooks for AI coding agents: route tool approvals through Pushary push notifications",
5
5
  "keywords": [
6
6
  "pushary",