@pushary/agent-hooks 1.9.157 → 1.9.158

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 (136) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/{api-3C62HQDC.js → api-MRFKFDVV.js} +11 -11
  3. package/dist/bin/pushary-audit.js +3 -3
  4. package/dist/bin/pushary-bell-hook.js +28 -28
  5. package/dist/bin/pushary-bell.js +11 -11
  6. package/dist/bin/pushary-claude.js +27 -27
  7. package/dist/bin/pushary-clean.js +37 -37
  8. package/dist/bin/pushary-codex-bridge.js +23 -23
  9. package/dist/bin/pushary-codex-hook.js +50 -42
  10. package/dist/bin/pushary-codex-session.js +8 -8
  11. package/dist/bin/pushary-codex.js +16 -16
  12. package/dist/bin/pushary-connect.js +33 -33
  13. package/dist/bin/pushary-cowork.js +5 -5
  14. package/dist/bin/pushary-daemon.js +44 -44
  15. package/dist/bin/pushary-disconnect.js +28 -28
  16. package/dist/bin/pushary-doctor.js +45 -45
  17. package/dist/bin/pushary-elicitation-hook.js +28 -28
  18. package/dist/bin/pushary-gemini-bridge.js +17 -17
  19. package/dist/bin/pushary-gemini-hook.js +32 -32
  20. package/dist/bin/pushary-hook.js +35 -35
  21. package/dist/bin/pushary-login.js +22 -22
  22. package/dist/bin/pushary-logout.js +28 -28
  23. package/dist/bin/pushary-mcp.js +12 -12
  24. package/dist/bin/pushary-mode.js +16 -16
  25. package/dist/bin/pushary-notification-hook.js +27 -27
  26. package/dist/bin/pushary-opencode-hook.js +31 -31
  27. package/dist/bin/pushary-permission-denied-hook.js +35 -35
  28. package/dist/bin/pushary-permission-hook.js +35 -35
  29. package/dist/bin/pushary-post-hook.js +28 -28
  30. package/dist/bin/pushary-prompt-hook.js +27 -27
  31. package/dist/bin/pushary-session-end-hook.js +27 -27
  32. package/dist/bin/pushary-session-start-hook.js +37 -37
  33. package/dist/bin/pushary-setup.js +53 -53
  34. package/dist/bin/pushary-stats.js +5 -5
  35. package/dist/bin/pushary-status.js +34 -34
  36. package/dist/bin/pushary-stop-hook.js +27 -27
  37. package/dist/bin/pushary-stopfailure-hook.js +27 -27
  38. package/dist/bin/pushary-suggestions.js +16 -16
  39. package/dist/bin/pushary-transcript-register.js +17 -17
  40. package/dist/bin/pushary-transcripts.js +25 -25
  41. package/dist/bin/pushary-upgrade.js +42 -42
  42. package/dist/bin/pushary-wait.js +16 -16
  43. package/dist/bin/pushary.js +7 -7
  44. package/dist/{chunk-2N23JFER.js → chunk-2L52USKM.js} +3 -3
  45. package/dist/{chunk-XHPTW6WL.js → chunk-2MPT7YQK.js} +2 -2
  46. package/dist/{chunk-7JAEIKBV.js → chunk-3QU4WXAH.js} +5 -5
  47. package/dist/{chunk-VRLYEBDN.js → chunk-3UNZ7HRN.js} +75 -49
  48. package/dist/{chunk-O3NAHPCR.js → chunk-4B5K6YIP.js} +1 -1
  49. package/dist/{chunk-CHI57HS3.js → chunk-4I2SHNEU.js} +3 -3
  50. package/dist/{chunk-T3LSBTWU.js → chunk-4NHQAMSK.js} +2 -2
  51. package/dist/{chunk-5HMVXNFU.js → chunk-4SN4FHFZ.js} +2 -2
  52. package/dist/{chunk-UJJ2OXFA.js → chunk-4WL2MINE.js} +1 -1
  53. package/dist/{chunk-GA5T3WEB.js → chunk-6GGK3T24.js} +5 -5
  54. package/dist/{chunk-3FQJYA76.js → chunk-AGYD6XNI.js} +3 -3
  55. package/dist/{chunk-V4OIPLSC.js → chunk-ALQWZCUT.js} +4 -4
  56. package/dist/{chunk-C3HYWUZE.js → chunk-AMIUB22C.js} +1 -1
  57. package/dist/{chunk-QONYKXWP.js → chunk-ANQBLZAE.js} +1 -1
  58. package/dist/{chunk-P5JV6YZW.js → chunk-AOP55JR2.js} +1 -1
  59. package/dist/{chunk-AKUYCHJU.js → chunk-APCJZFTJ.js} +1 -1
  60. package/dist/{chunk-5MWNWCCI.js → chunk-AZZNHW3R.js} +4 -4
  61. package/dist/{chunk-MH4O453X.js → chunk-B3BOAYRO.js} +3 -2
  62. package/dist/{chunk-UH5NAPWL.js → chunk-C6PAIHLP.js} +10 -10
  63. package/dist/{chunk-TIOQ55VZ.js → chunk-CAMFNSJS.js} +6 -6
  64. package/dist/{chunk-HXX4EFK3.js → chunk-CCKY3JDB.js} +3 -3
  65. package/dist/{chunk-2NSPZZBJ.js → chunk-CIAJ55EQ.js} +5 -5
  66. package/dist/{chunk-ICHKAH5Q.js → chunk-CS4Z44F5.js} +6 -6
  67. package/dist/{chunk-WIOLCW7W.js → chunk-CSZWWPNS.js} +1 -1
  68. package/dist/{chunk-RF35YTIF.js → chunk-DHI3X5WK.js} +2 -2
  69. package/dist/{chunk-MEUAK5BK.js → chunk-EGBI4GRS.js} +2 -2
  70. package/dist/{chunk-CV6G4IDZ.js → chunk-EHRWEXRN.js} +2 -2
  71. package/dist/{chunk-6UGVZTRA.js → chunk-FGVBFDNV.js} +1 -1
  72. package/dist/{chunk-ANL74IBU.js → chunk-FTTSQAF4.js} +1 -1
  73. package/dist/{chunk-UOVTXOSS.js → chunk-GHHVXARK.js} +1 -1
  74. package/dist/{chunk-BO4HRAY7.js → chunk-GLDSXDRV.js} +5 -5
  75. package/dist/{chunk-3EF7G5EV.js → chunk-GTYVNVBZ.js} +4 -4
  76. package/dist/{chunk-KB7YWU7A.js → chunk-HA2SRYYP.js} +18 -0
  77. package/dist/{chunk-7HDQUTRK.js → chunk-IIK3CZXJ.js} +7 -7
  78. package/dist/{chunk-2SHPCEH6.js → chunk-IKC33YKC.js} +1 -1
  79. package/dist/{chunk-W2GOSAFI.js → chunk-IOKJJ2SY.js} +4 -4
  80. package/dist/{chunk-PMEDJ4WM.js → chunk-IVOELLUK.js} +4 -4
  81. package/dist/{chunk-RF7HGOBC.js → chunk-J7HSUQK2.js} +2 -2
  82. package/dist/{chunk-WWDWEVGT.js → chunk-JKRQL2BL.js} +5 -5
  83. package/dist/{chunk-5TCLBCUO.js → chunk-K3I2NMEF.js} +6 -6
  84. package/dist/{chunk-DDSMTD4W.js → chunk-K3OCYJPK.js} +3 -3
  85. package/dist/{chunk-25PVMWSM.js → chunk-LVZBLKAU.js} +1 -1
  86. package/dist/{chunk-4RSJZOKB.js → chunk-MHYX5Q3F.js} +1 -1
  87. package/dist/{chunk-44FDCO7M.js → chunk-MLPPQ556.js} +8 -8
  88. package/dist/{chunk-4I4HAPT5.js → chunk-MTITL2IG.js} +5 -5
  89. package/dist/{chunk-KRI7BOND.js → chunk-N2LWKWNY.js} +3 -3
  90. package/dist/{chunk-WDU4LEEW.js → chunk-N3CFEMLS.js} +2 -2
  91. package/dist/{chunk-KURQ4KMV.js → chunk-N5SSADNW.js} +4 -4
  92. package/dist/{chunk-G6SQOGSD.js → chunk-NW63PGKF.js} +4 -4
  93. package/dist/{chunk-O2DJWDVK.js → chunk-OCWXE4PR.js} +8 -8
  94. package/dist/{chunk-WCVANKUD.js → chunk-ORQ7THNZ.js} +1 -1
  95. package/dist/{chunk-C4K4KYOY.js → chunk-PBPQRJ2T.js} +3 -3
  96. package/dist/{chunk-PKU3WFT5.js → chunk-PI3BOI3A.js} +1 -1
  97. package/dist/{chunk-E2KAAKWU.js → chunk-PND5IGC7.js} +3 -3
  98. package/dist/{chunk-UAYNQ2IG.js → chunk-Q7WCDUFV.js} +4 -4
  99. package/dist/{chunk-QBDCKECQ.js → chunk-QP3TCKRZ.js} +117 -29
  100. package/dist/{chunk-3UYTCDDY.js → chunk-QVVBU2JU.js} +6 -6
  101. package/dist/{chunk-WSPDIT2B.js → chunk-RL5JLDRE.js} +2 -2
  102. package/dist/{chunk-F6ZBXV4G.js → chunk-RRVFN432.js} +1 -1
  103. package/dist/{chunk-JBF6A2X5.js → chunk-SNQOEDZ2.js} +1 -1
  104. package/dist/{chunk-EQF6SSQL.js → chunk-SZMDRBNK.js} +2 -2
  105. package/dist/{chunk-MGT2V2AB.js → chunk-T3PZQNIK.js} +1 -1
  106. package/dist/{chunk-S6DJAYQW.js → chunk-TKBCLK4B.js} +5 -5
  107. package/dist/{chunk-CAZ5FMWP.js → chunk-TMWXWBFP.js} +6 -6
  108. package/dist/{chunk-BMR66K6T.js → chunk-TPLTB256.js} +4 -4
  109. package/dist/{chunk-TWOSBIAW.js → chunk-TSR3FPGL.js} +1 -1
  110. package/dist/{chunk-R4DMHIOK.js → chunk-TYBVQ33X.js} +5 -5
  111. package/dist/{chunk-MOX7IOGL.js → chunk-TZJR5ESF.js} +5 -5
  112. package/dist/{chunk-ELF4NIIM.js → chunk-UDLWNOXX.js} +2 -2
  113. package/dist/{chunk-3XTH6EKH.js → chunk-UPI3JDHZ.js} +3 -3
  114. package/dist/{chunk-WDCS3RGI.js → chunk-UVWKMFLQ.js} +2 -2
  115. package/dist/{chunk-6NRFAP45.js → chunk-V36P4KS4.js} +1 -1
  116. package/dist/{chunk-6W6MZ53D.js → chunk-X254TRBU.js} +4 -4
  117. package/dist/{chunk-REUFDG7O.js → chunk-XHCX6DOY.js} +5 -5
  118. package/dist/{chunk-KOBIBSE6.js → chunk-XNJ2HOEL.js} +3 -3
  119. package/dist/{chunk-C74JHUD3.js → chunk-XSIZKQ2C.js} +11 -11
  120. package/dist/{chunk-IQWMRFKD.js → chunk-YPFOTFEG.js} +1 -1
  121. package/dist/{chunk-2LTRA6NA.js → chunk-ZYDE6QRW.js} +3 -3
  122. package/dist/{codex-app-cards-switch-MQIEZLSU.js → codex-app-cards-switch-CXXDGH7R.js} +11 -11
  123. package/dist/{codex-card-routing-UTWTJ6YQ.js → codex-card-routing-WP4IHJFN.js} +2 -2
  124. package/dist/{codex-desktop-launch-A6GX6F54.js → codex-desktop-launch-EN7ACHC6.js} +1 -1
  125. package/dist/{codex-session-launch-AVEFGOT7.js → codex-session-launch-7BV4VTJW.js} +20 -20
  126. package/dist/{config-YGUXX5GB.js → config-SZMMBOJV.js} +3 -3
  127. package/dist/{global-upgrade-HLXPTFDU.js → global-upgrade-I5J6BDHA.js} +9 -9
  128. package/dist/{identity-CAC763RQ.js → identity-GLJNTNHW.js} +4 -4
  129. package/dist/{live-capabilities-WRI22INV.js → live-capabilities-AYO7FOHS.js} +4 -4
  130. package/dist/{paths-DNXBDJJH.js → paths-NRBEF3T2.js} +3 -3
  131. package/dist/{reapply-5ZNMLEKV.js → reapply-J2QUV7J2.js} +30 -30
  132. package/dist/src/index.d.ts +6 -1
  133. package/dist/src/index.js +34 -34
  134. package/dist/{upgrade-lock-CRW26OIW.js → upgrade-lock-H6SU7MJR.js} +4 -4
  135. package/dist/{usage-AWWCZ7H7.js → usage-MY3DIFBG.js} +3 -3
  136. package/package.json +1 -1
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  compatibleConfigFile,
3
3
  hasCompatibleHooks
4
- } from "./chunk-4I4HAPT5.js";
4
+ } from "./chunk-MTITL2IG.js";
5
5
  import {
6
6
  pusharyHookExecutable
7
- } from "./chunk-BMR66K6T.js";
7
+ } from "./chunk-TPLTB256.js";
8
8
  import {
9
9
  isProtectedByScope,
10
10
  registerHookEntry
11
- } from "./chunk-MH4O453X.js";
11
+ } from "./chunk-B3BOAYRO.js";
12
12
  import {
13
13
  isRecord
14
- } from "./chunk-KB7YWU7A.js";
14
+ } from "./chunk-HA2SRYYP.js";
15
15
 
16
16
  // src/cursor-config.ts
17
17
  var hookCommandOf = (entry) => {
@@ -1,20 +1,20 @@
1
1
  import {
2
2
  notificationAnswerStep
3
- } from "./chunk-CAZ5FMWP.js";
3
+ } from "./chunk-TMWXWBFP.js";
4
4
  import {
5
5
  canChangeApprovalSettings
6
- } from "./chunk-EQF6SSQL.js";
6
+ } from "./chunk-SZMDRBNK.js";
7
7
  import {
8
8
  matchMacAccountStep,
9
9
  retryAgentCommand
10
- } from "./chunk-2N23JFER.js";
10
+ } from "./chunk-2L52USKM.js";
11
11
  import {
12
12
  EXIT
13
13
  } from "./chunk-BG4HHB7E.js";
14
14
  import {
15
15
  NPX_LATEST_COMMAND,
16
16
  npmExecSetupCommandFor
17
- } from "./chunk-P5JV6YZW.js";
17
+ } from "./chunk-AOP55JR2.js";
18
18
 
19
19
  // src/setup/closing.ts
20
20
  var ACTIVITY_URL = "pushary.com/dashboard/agent/activity";
@@ -1,31 +1,31 @@
1
1
  import {
2
2
  MANAGED_CLAUDE_SETTINGS_BY_PLATFORM
3
- } from "./chunk-WSPDIT2B.js";
3
+ } from "./chunk-RL5JLDRE.js";
4
4
  import {
5
5
  declinedAgentsFile,
6
6
  readDeclinedAgents
7
- } from "./chunk-WDCS3RGI.js";
7
+ } from "./chunk-UVWKMFLQ.js";
8
8
  import {
9
9
  OPENCODE_HOOK_BINARY,
10
10
  openCodeConfigDir,
11
11
  openCodePluginArgv,
12
12
  openCodePluginFile
13
- } from "./chunk-BO4HRAY7.js";
13
+ } from "./chunk-GLDSXDRV.js";
14
14
  import {
15
15
  liveCursorGateCoverage
16
- } from "./chunk-3EF7G5EV.js";
16
+ } from "./chunk-GTYVNVBZ.js";
17
17
  import {
18
18
  compatibleConfigFile,
19
19
  compatibleHookEvents,
20
20
  grokHome,
21
21
  parseConfigDocument
22
- } from "./chunk-4I4HAPT5.js";
22
+ } from "./chunk-MTITL2IG.js";
23
23
  import {
24
24
  DEFAULT_HOOKS_KEY_PATH,
25
25
  GEMINI_HOOK_BINARY,
26
26
  GEMINI_HOOK_EVENTS,
27
27
  hooksAt
28
- } from "./chunk-BMR66K6T.js";
28
+ } from "./chunk-TPLTB256.js";
29
29
  import {
30
30
  CODEX_EARLIER_APPROVAL_MATCHERS,
31
31
  CODEX_HOOK_BINARY,
@@ -53,7 +53,7 @@ import {
53
53
  parseHookArgv,
54
54
  parseHookCommand,
55
55
  supportedClaudeEvents
56
- } from "./chunk-MH4O453X.js";
56
+ } from "./chunk-B3BOAYRO.js";
57
57
  import {
58
58
  readRegularJsonFile,
59
59
  readRegularTextFile
@@ -67,7 +67,7 @@ import {
67
67
  OPENCODE_APPROVAL_EVENT,
68
68
  isRecord,
69
69
  matcherMatchesEveryCall
70
- } from "./chunk-KB7YWU7A.js";
70
+ } from "./chunk-HA2SRYYP.js";
71
71
 
72
72
  // src/hook-wiring.ts
73
73
  import { createHash } from "crypto";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  readConfigFileKey
3
- } from "./chunk-2LTRA6NA.js";
3
+ } from "./chunk-ZYDE6QRW.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
  pusharyFetch
3
- } from "./chunk-E2KAAKWU.js";
3
+ } from "./chunk-PND5IGC7.js";
4
4
  import {
5
5
  NetworkError
6
6
  } from "./chunk-YU2EUD7O.js";
7
7
  import {
8
8
  getBaseUrl
9
- } from "./chunk-ANL74IBU.js";
9
+ } from "./chunk-FTTSQAF4.js";
10
10
  import {
11
11
  EXIT
12
12
  } from "./chunk-BG4HHB7E.js";
13
13
  import {
14
14
  isValidApiKey,
15
15
  normalizeKeyScope
16
- } from "./chunk-KB7YWU7A.js";
16
+ } from "./chunk-HA2SRYYP.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;
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  RETRY_ACK,
6
6
  refusedReceiptMessage
7
- } from "./chunk-QONYKXWP.js";
7
+ } from "./chunk-ANQBLZAE.js";
8
8
 
9
9
  // src/command-receipts.ts
10
10
  import { randomUUID } from "crypto";
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  readExistingMachineId
3
- } from "./chunk-4RSJZOKB.js";
3
+ } from "./chunk-MHYX5Q3F.js";
4
4
  import {
5
5
  NetworkError
6
6
  } from "./chunk-YU2EUD7O.js";
7
7
  import {
8
8
  getBaseUrl
9
- } from "./chunk-ANL74IBU.js";
9
+ } from "./chunk-FTTSQAF4.js";
10
10
  import {
11
11
  getPackageVersion
12
12
  } from "./chunk-WIIMW5YO.js";
13
13
  import {
14
14
  clientContextHeaders,
15
15
  redactSecretsFromContent
16
- } from "./chunk-KB7YWU7A.js";
16
+ } from "./chunk-HA2SRYYP.js";
17
17
 
18
18
  // src/cli/net.ts
19
19
  import { createRequire } from "module";
@@ -13,7 +13,7 @@ import {
13
13
  uninstallOpenClawPlugin,
14
14
  unsetOpenClawEntry,
15
15
  writeOpenClawEntry
16
- } from "./chunk-HXX4EFK3.js";
16
+ } from "./chunk-CCKY3JDB.js";
17
17
  import {
18
18
  needsShell
19
19
  } from "./chunk-H6CL3T2S.js";
@@ -25,10 +25,10 @@ import {
25
25
  openClawDirectoriesToLookIn,
26
26
  openClawPluginFolder,
27
27
  openClawSetupReceiptDirectory
28
- } from "./chunk-MH4O453X.js";
28
+ } from "./chunk-B3BOAYRO.js";
29
29
  import {
30
30
  resolvePathBinary
31
- } from "./chunk-PMEDJ4WM.js";
31
+ } from "./chunk-IVOELLUK.js";
32
32
  import {
33
33
  readJsonSafe,
34
34
  writeJsonAtomic
@@ -39,7 +39,7 @@ import {
39
39
  } from "./chunk-WIIMW5YO.js";
40
40
  import {
41
41
  isRecord
42
- } from "./chunk-KB7YWU7A.js";
42
+ } from "./chunk-HA2SRYYP.js";
43
43
 
44
44
  // src/hermes/plugin-payload.ts
45
45
  import { createHash } from "crypto";
@@ -27,11 +27,11 @@ import {
27
27
  toolResultErrorText,
28
28
  transcriptTokensIn,
29
29
  transcriptUsageRequest
30
- } from "./chunk-2SHPCEH6.js";
30
+ } from "./chunk-IKC33YKC.js";
31
31
  import {
32
32
  branchFor,
33
33
  repoKeyFor
34
- } from "./chunk-UJJ2OXFA.js";
34
+ } from "./chunk-4WL2MINE.js";
35
35
  import {
36
36
  cancelQuestion,
37
37
  clientErrorKindOf,
@@ -39,39 +39,39 @@ import {
39
39
  reportClientError,
40
40
  sendNotification,
41
41
  waitForAnswer
42
- } from "./chunk-ICHKAH5Q.js";
42
+ } from "./chunk-CS4Z44F5.js";
43
43
  import {
44
44
  isRetryable,
45
45
  withRetry
46
- } from "./chunk-MOX7IOGL.js";
46
+ } from "./chunk-TZJR5ESF.js";
47
47
  import {
48
48
  RETRY_ACK,
49
49
  readCommandAck,
50
50
  refusedReceiptMessage
51
- } from "./chunk-QONYKXWP.js";
51
+ } from "./chunk-ANQBLZAE.js";
52
52
  import {
53
53
  fetchAsCredential
54
- } from "./chunk-TWOSBIAW.js";
54
+ } from "./chunk-TSR3FPGL.js";
55
55
  import {
56
56
  getMachineId
57
- } from "./chunk-4RSJZOKB.js";
57
+ } from "./chunk-MHYX5Q3F.js";
58
58
  import {
59
59
  reportedInstallSource
60
- } from "./chunk-ELF4NIIM.js";
60
+ } from "./chunk-UDLWNOXX.js";
61
61
  import {
62
62
  IDLE_PROMPT_NOTIFICATION,
63
63
  NOTIFICATION_PUSH_TYPES,
64
64
  POSTTOOLUSE_MIRROR_ONLY_TOOLS,
65
65
  claudeConfigDir
66
- } from "./chunk-MH4O453X.js";
66
+ } from "./chunk-B3BOAYRO.js";
67
67
  import {
68
68
  compareVersion,
69
69
  parseVersion
70
- } from "./chunk-PMEDJ4WM.js";
70
+ } from "./chunk-IVOELLUK.js";
71
71
  import {
72
72
  getApiKey,
73
73
  getBaseUrl
74
- } from "./chunk-ANL74IBU.js";
74
+ } from "./chunk-FTTSQAF4.js";
75
75
  import {
76
76
  writeFileAtomic,
77
77
  writeJsonAtomicDurable
@@ -89,10 +89,12 @@ import {
89
89
  gateOutputFor,
90
90
  isAutoApprove,
91
91
  isClaudeWakePrompt,
92
+ isGateOutcome,
92
93
  isProvenModeResponse,
93
94
  isRecord,
94
95
  modeStateFromResponse,
95
96
  nativeRecord,
97
+ parsePermissionMode,
96
98
  pendingCommandEvents,
97
99
  pendingCommandInstruction,
98
100
  policyRequestCapabilitiesHeaderValue,
@@ -100,7 +102,7 @@ import {
100
102
  resolveAutoResolveOrigin,
101
103
  resolvePolicy,
102
104
  unansweredRefusalReason
103
- } from "./chunk-KB7YWU7A.js";
105
+ } from "./chunk-HA2SRYYP.js";
104
106
 
105
107
  // src/pending.ts
106
108
  import { join } from "path";
@@ -1169,21 +1171,87 @@ var isWaitingOnBackgroundWork = (sessionKey, nowMs = Date.now()) => {
1169
1171
  }
1170
1172
  };
1171
1173
 
1172
- // src/events.ts
1173
- import { basename, join as join9 } from "path";
1174
- import { existsSync as existsSync5, mkdirSync as mkdirSync7, readFileSync as readFileSync7, statSync as statSync7, writeFileSync as writeFileSync7 } from "fs";
1174
+ // src/gate-outcome-record.ts
1175
+ import { createHash as createHash7 } from "crypto";
1176
+ import { lstatSync as lstatSync4, readFileSync as readFileSync7, readdirSync as readdirSync6, utimesSync as utimesSync3, writeFileSync as writeFileSync7 } from "fs";
1175
1177
  import { tmpdir as tmpdir8 } from "os";
1176
- var INTENT_DIR = join9(tmpdir8(), "pushary-intent");
1178
+ import { join as join9 } from "path";
1179
+ var GATE_OUTCOME_RECORD_TTL_MS = 60 * 60 * 1e3;
1180
+ var GATE_OUTCOME_RECORD_LIMIT = 512;
1181
+ var GATE_OUTCOME_SWEEP_INTERVAL_MS = 10 * 60 * 1e3;
1182
+ var GATE_OUTCOME_SWEEP_STAMP = ".swept";
1183
+ var gateOutcomeDirectory = () => join9(tmpdir8(), `pushary-gate-outcomes-${userScope()}`);
1184
+ var gateOutcomeRecordName = (toolUseId) => createHash7("sha256").update(toolUseId, "utf-8").digest("hex").slice(0, 32);
1185
+ var startedSweepStamp = (stamp) => {
1186
+ try {
1187
+ writeFileSync7(stamp, "", { flag: "wx", mode: PRIVATE_FILE_MODE });
1188
+ return true;
1189
+ } catch {
1190
+ return false;
1191
+ }
1192
+ };
1193
+ var claimedSweep = (stamp, nowMs) => {
1194
+ try {
1195
+ const stamped = lstatSync4(stamp);
1196
+ if (!stamped.isFile() || nowMs - stamped.mtimeMs < GATE_OUTCOME_SWEEP_INTERVAL_MS) return false;
1197
+ utimesSync3(stamp, nowMs / 1e3, nowMs / 1e3);
1198
+ return true;
1199
+ } catch {
1200
+ return startedSweepStamp(stamp);
1201
+ }
1202
+ };
1203
+ var sweepWhenDue = (dir, nowMs) => {
1204
+ if (claimedSweep(join9(dir, GATE_OUTCOME_SWEEP_STAMP), nowMs)) sweepExpired(dir, nowMs, GATE_OUTCOME_RECORD_TTL_MS);
1205
+ };
1206
+ var hasRoomForARecord = (dir) => readdirSync6(dir).length < GATE_OUTCOME_RECORD_LIMIT;
1207
+ var isFreshRecord = (path, nowMs) => {
1208
+ const record = lstatSync4(path);
1209
+ return record.isFile() && nowMs - record.mtimeMs < GATE_OUTCOME_RECORD_TTL_MS;
1210
+ };
1211
+ var readFreshRecord = (path, nowMs) => {
1212
+ try {
1213
+ return isFreshRecord(path, nowMs) ? readFileSync7(path, "utf-8") : void 0;
1214
+ } catch {
1215
+ return void 0;
1216
+ }
1217
+ };
1218
+ var recordGateOutcome = (toolUseId, outcome) => {
1219
+ if (!toolUseId) return;
1220
+ try {
1221
+ const dir = privateFolderAt(gateOutcomeDirectory());
1222
+ if (!dir) return;
1223
+ sweepWhenDue(dir, Date.now());
1224
+ if (!hasRoomForARecord(dir)) return;
1225
+ writeFileSync7(join9(dir, gateOutcomeRecordName(toolUseId)), outcome, { encoding: "utf-8", mode: PRIVATE_FILE_MODE });
1226
+ } catch {
1227
+ return;
1228
+ }
1229
+ };
1230
+ var takeGateOutcome = (toolUseId) => {
1231
+ if (!toolUseId) return void 0;
1232
+ const dir = gateOutcomeDirectory();
1233
+ if (!isPrivateFolder(dir)) return void 0;
1234
+ const path = join9(dir, gateOutcomeRecordName(toolUseId));
1235
+ const recorded = readFreshRecord(path, Date.now());
1236
+ removeQuietly(path);
1237
+ return isGateOutcome(recorded) ? recorded : void 0;
1238
+ };
1239
+
1240
+ // src/events.ts
1241
+ import { basename, join as join10 } from "path";
1242
+ import { existsSync as existsSync5, mkdirSync as mkdirSync7, readFileSync as readFileSync8, statSync as statSync7, writeFileSync as writeFileSync8 } from "fs";
1243
+ import { tmpdir as tmpdir9 } from "os";
1244
+ var INTENT_DIR = join10(tmpdir9(), "pushary-intent");
1177
1245
  var INTENT_MAX_BYTES = 2048;
1178
1246
  var INTENT_GRACE_MS = 10 * 60 * 1e3;
1179
1247
  var sanitizeSession = (sessionId) => sessionId.replace(/[^A-Za-z0-9_-]/g, "_").slice(0, 128) || DEFAULT_SESSION;
1180
- var intentFile = (sessionId) => join9(INTENT_DIR, sanitizeSession(sessionId));
1248
+ var intentFile = (sessionId) => join10(INTENT_DIR, sanitizeSession(sessionId));
1181
1249
  var saveLastPrompt = (sessionId, prompt) => {
1182
1250
  try {
1183
1251
  const trimmed = prompt.replace(/\s+/g, " ").trim().slice(0, INTENT_MAX_BYTES);
1184
1252
  if (!trimmed) return;
1185
1253
  mkdirSync7(INTENT_DIR, { recursive: true });
1186
- writeFileSync7(intentFile(sessionId), trimmed, "utf-8");
1254
+ writeFileSync8(intentFile(sessionId), trimmed, "utf-8");
1187
1255
  } catch {
1188
1256
  }
1189
1257
  };
@@ -1191,7 +1259,7 @@ var readLastPrompt = (sessionId) => {
1191
1259
  try {
1192
1260
  const path = intentFile(sessionId);
1193
1261
  if (isDefaultSession(sessionId) && statSync7(path).mtimeMs < Date.now() - INTENT_GRACE_MS) return void 0;
1194
- const value = readFileSync7(path, "utf-8").trim();
1262
+ const value = readFileSync8(path, "utf-8").trim();
1195
1263
  return value.length > 0 ? value : void 0;
1196
1264
  } catch {
1197
1265
  return void 0;
@@ -1256,7 +1324,7 @@ var readFreshCachedPolicy = (apiKey, agentType, sessionId) => {
1256
1324
  const request = policyRequestFor(agentType);
1257
1325
  const path = policyCacheFile(apiKey, request.agent, request.repoAware, sessionId);
1258
1326
  if (!existsSync5(path)) return null;
1259
- const cached = JSON.parse(readFileSync7(path, "utf-8"));
1327
+ const cached = JSON.parse(readFileSync8(path, "utf-8"));
1260
1328
  if (!isCachedPolicyRead(cached)) return null;
1261
1329
  if ((cached._sessionId ?? null) !== (sessionId ?? null)) return null;
1262
1330
  if (!cached._cachedAt || Date.now() - cached._cachedAt >= POLICY_CACHE_TTL_MS) return null;
@@ -1299,6 +1367,14 @@ var deriveAutoDecisionBeacon = (toolName, toolInput, liveMode, agentType, cwd, s
1299
1367
  };
1300
1368
  var AUTO_DECISION_WINDOW_MS = 15 * 60 * 1e3;
1301
1369
  var HOOK_ACTIVE_WINDOW_MS = 30 * 60 * 1e3;
1370
+ var permissionModeOf = (input) => {
1371
+ const permissionMode = parsePermissionMode(input.permission_mode);
1372
+ return permissionMode === void 0 ? {} : { permissionMode };
1373
+ };
1374
+ var gateOutcomeOf = (toolUseId) => {
1375
+ const gateOutcome = takeGateOutcome(toolUseId);
1376
+ return gateOutcome === void 0 ? {} : { gateOutcome };
1377
+ };
1302
1378
  var hookSourceOfAgentType = (agentType) => HOOK_SOURCES.find((candidate) => AGENT_IDENTITIES[candidate].type === agentType);
1303
1379
  var deriveUsage = (payload, agent, event) => {
1304
1380
  const source = hookSourceOfAgentType(agent.type);
@@ -1521,7 +1597,9 @@ var handlePostToolUse = async (input, agent = CLAUDE_CODE_AGENT) => {
1521
1597
  decisionSource,
1522
1598
  ...beacon ? { decisionOrigin: beacon.decisionOrigin, toolName: beacon.toolName, toolTarget: beacon.toolTarget } : {},
1523
1599
  meta: receiptsEnabled ? deriveReceiptMeta(lookup.tool, lookup.input, toolResult, input.cwd ?? process.cwd()) : void 0,
1524
- usage: deriveUsage(input, agent, "PostToolUse")
1600
+ usage: deriveUsage(input, agent, "PostToolUse"),
1601
+ ...permissionModeOf(input),
1602
+ ...gateOutcomeOf(input.tool_use_id)
1525
1603
  }, {
1526
1604
  maxAttempts: 1,
1527
1605
  budgetMs: Math.min(DRAINING_REPORT_BUDGET_MS, Math.max(0, deadline - Date.now())),
@@ -1574,7 +1652,8 @@ var handleUserPrompt = async (input, agent = CLAUDE_CODE_AGENT) => {
1574
1652
  agentName: `${agent.label} - ${projectName}`,
1575
1653
  sessionId: input.session_id,
1576
1654
  taskTitle,
1577
- ...wakeTurn ? { driver: PHONE_DRIVER } : {}
1655
+ ...wakeTurn ? { driver: PHONE_DRIVER } : {},
1656
+ ...permissionModeOf(input)
1578
1657
  }, { maxAttempts: 1, budgetMs: Math.min(DRAINING_REPORT_BUDGET_MS, Math.max(0, deadline - Date.now())), signal })
1579
1658
  ]);
1580
1659
  if (consumesActivityContext(agent.type)) {
@@ -1606,7 +1685,8 @@ var handleStop = async (input, agent = CLAUDE_CODE_AGENT) => {
1606
1685
  agentName: `${agent.label} - ${projectName}`,
1607
1686
  action: summarizeStop(input),
1608
1687
  ...sessionIdentityOf(input),
1609
- usage: deriveUsage(input, agent, "Stop")
1688
+ usage: deriveUsage(input, agent, "Stop"),
1689
+ ...permissionModeOf(input)
1610
1690
  }, {
1611
1691
  maxAttempts: 1,
1612
1692
  budgetMs: Math.min(DRAINING_REPORT_BUDGET_MS, Math.max(0, deadline - Date.now())),
@@ -1641,7 +1721,8 @@ var handleSubagentStop = async (input, agent = CLAUDE_CODE_AGENT) => {
1641
1721
  agentType: agent.type,
1642
1722
  agentName: `${agent.label} - ${projectName}`,
1643
1723
  action: subagentStopSummary(input),
1644
- ...sessionIdentityOf(input)
1724
+ ...sessionIdentityOf(input),
1725
+ ...permissionModeOf(input)
1645
1726
  // A subagent's end is a `session_end` like any other as far as the route is
1646
1727
  // concerned, and this caller discards the response, so without this the
1647
1728
  // parent's queued instruction is popped and thrown away.
@@ -1659,7 +1740,8 @@ var handleCompaction = async (input, agent = CLAUDE_CODE_AGENT) => {
1659
1740
  agentType: agent.type,
1660
1741
  agentName: `${agent.label} - ${projectName}`,
1661
1742
  action: compactionAction(input.hook_event_name, input.trigger),
1662
- ...sessionIdentityOf(input)
1743
+ ...sessionIdentityOf(input),
1744
+ ...permissionModeOf(input)
1663
1745
  }, { maxAttempts: 1, timeoutMs: COMPACTION_REPORT_TIMEOUT_MS });
1664
1746
  } catch {
1665
1747
  }
@@ -1673,7 +1755,8 @@ var handleSessionStart = async (input, agent = CLAUDE_CODE_AGENT) => {
1673
1755
  agentType: agent.type,
1674
1756
  agentName: `${agent.label} - ${projectName}`,
1675
1757
  action,
1676
- ...sessionIdentityOf(input)
1758
+ ...sessionIdentityOf(input),
1759
+ ...permissionModeOf(input)
1677
1760
  }, { maxAttempts: 2, timeoutMs: 4e3 });
1678
1761
  } catch {
1679
1762
  }
@@ -1698,7 +1781,8 @@ var handleSessionEnd = async (input, agent = CLAUDE_CODE_AGENT, options = {}) =>
1698
1781
  agentType: agent.type,
1699
1782
  agentName: `${agent.label} - ${projectName}`,
1700
1783
  action,
1701
- sessionId: input.session_id
1784
+ sessionId: input.session_id,
1785
+ ...permissionModeOf(input)
1702
1786
  }, { maxAttempts: options.reportAttempts ?? 2, timeoutMs: options.reportTimeoutMs ?? 3e3 });
1703
1787
  } catch {
1704
1788
  }
@@ -1720,7 +1804,8 @@ var handleNotification = async (input, agent = CLAUDE_CODE_AGENT) => {
1720
1804
  agentName: `${agent.label} - ${projectName}`,
1721
1805
  action,
1722
1806
  sessionId: input.session_id,
1723
- error: failed ? action : void 0
1807
+ error: failed ? action : void 0,
1808
+ ...permissionModeOf(input)
1724
1809
  // `timeoutMs` is not decoration. It is this file's way of saying "side
1725
1810
  // report", and it sets `clientCanDrain` false. Without it this call
1726
1811
  // advertises itself as able to consume a phone-queued instruction, and the
@@ -1777,7 +1862,8 @@ var handleStopFailure = async (input, agent = CLAUDE_CODE_AGENT) => {
1777
1862
  agentName: `${agent.label} - ${projectName}`,
1778
1863
  action: reason,
1779
1864
  error: reason,
1780
- sessionId: input.session_id
1865
+ sessionId: input.session_id,
1866
+ ...permissionModeOf(input)
1781
1867
  // Same reason as the Notification report above, and the same budget shape:
1782
1868
  // this is followed by a ~3s fetchModeState and a 4s sendNotification inside
1783
1869
  // Claude Code's 10s StopFailure budget. The stopfailure hook prints nothing,
@@ -1841,9 +1927,11 @@ export {
1841
1927
  approvalAwaitingRetry,
1842
1928
  markApprovalReminded,
1843
1929
  forgetBlockedActionHint,
1930
+ recordGateOutcome,
1844
1931
  readLastPrompt,
1845
1932
  CLAUDE_CODE_AGENT,
1846
1933
  AUTO_DECISION_WINDOW_MS,
1934
+ permissionModeOf,
1847
1935
  reportEvent,
1848
1936
  settleQuestionsForToolUse,
1849
1937
  handlePostToolUse,
@@ -3,10 +3,10 @@ import {
3
3
  forkFinishWithUpgradeLock,
4
4
  installWithUpgradeLock,
5
5
  releaseAutoUpdateLock
6
- } from "./chunk-XHPTW6WL.js";
6
+ } from "./chunk-2MPT7YQK.js";
7
7
  import {
8
8
  phoneStartIsRequired
9
- } from "./chunk-3FQJYA76.js";
9
+ } from "./chunk-AGYD6XNI.js";
10
10
  import {
11
11
  describeAutoUpdateCheck,
12
12
  globalInstallLocation,
@@ -18,25 +18,25 @@ import {
18
18
  readAutoUpdateState,
19
19
  updateAutoUpdateState,
20
20
  upgradeEntryFor
21
- } from "./chunk-RF7HGOBC.js";
21
+ } from "./chunk-J7HSUQK2.js";
22
22
  import {
23
23
  autoUpdateLock,
24
24
  autoUpdateLog,
25
25
  autoUpdateState
26
- } from "./chunk-MH4O453X.js";
26
+ } from "./chunk-B3BOAYRO.js";
27
27
  import {
28
28
  execNpm,
29
29
  fetchLatestPublishedVersion,
30
30
  npmErrorMessage,
31
31
  readGlobalCliInstallAt,
32
32
  readGlobalPrefix
33
- } from "./chunk-PMEDJ4WM.js";
33
+ } from "./chunk-IVOELLUK.js";
34
34
  import {
35
35
  EXIT
36
36
  } from "./chunk-BG4HHB7E.js";
37
37
  import {
38
38
  NPX_LATEST_COMMAND
39
- } from "./chunk-P5JV6YZW.js";
39
+ } from "./chunk-AOP55JR2.js";
40
40
  import {
41
41
  commandsPackage,
42
42
  globalUpgradeEntry,
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  claudeConfigDir
3
- } from "./chunk-MH4O453X.js";
3
+ } from "./chunk-B3BOAYRO.js";
4
4
  import {
5
5
  claudePermissionRulesFromSettings
6
- } from "./chunk-KB7YWU7A.js";
6
+ } from "./chunk-HA2SRYYP.js";
7
7
 
8
8
  // src/claude-permission-rules.ts
9
9
  import { readFileSync, statSync } from "fs";
@@ -2,7 +2,7 @@ import {
2
2
  isApprovalMode,
3
3
  isRecord,
4
4
  isTimeoutAction
5
- } from "./chunk-KB7YWU7A.js";
5
+ } from "./chunk-HA2SRYYP.js";
6
6
 
7
7
  // src/cli/settings-response.ts
8
8
  var isFiniteNumber = (value) => typeof value === "number" && Number.isFinite(value);
@@ -10,7 +10,7 @@ import {
10
10
  uploadTranscriptRecords,
11
11
  verifyAnchoredRecipients,
12
12
  wrapSessionKey
13
- } from "./chunk-CHI57HS3.js";
13
+ } from "./chunk-4I2SHNEU.js";
14
14
 
15
15
  // src/live-session.ts
16
16
  var LIVE_TRANSCRIPT_LIMITS = { queuedRecords: 100, recordCharacters: 32 * 1024 };
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  absoluteUrl
3
- } from "./chunk-C4K4KYOY.js";
3
+ } from "./chunk-PBPQRJ2T.js";
4
4
  import {
5
5
  KEY_SCOPE
6
- } from "./chunk-KB7YWU7A.js";
6
+ } from "./chunk-HA2SRYYP.js";
7
7
 
8
8
  // src/cli/approval-settings-pages.ts
9
9
  var API_KEYS_PATH = "/dashboard/agent/settings";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-BG4HHB7E.js";
4
4
  import {
5
5
  renderCommandHelp
6
- } from "./chunk-P5JV6YZW.js";
6
+ } from "./chunk-AOP55JR2.js";
7
7
  import {
8
8
  getPackageVersion
9
9
  } from "./chunk-WIIMW5YO.js";
@@ -4,13 +4,13 @@ import {
4
4
  configFailureKind,
5
5
  retryAgentCommand,
6
6
  writeSetupConfigFile
7
- } from "./chunk-2N23JFER.js";
7
+ } from "./chunk-2L52USKM.js";
8
8
  import {
9
9
  MCP_BRIDGE_BINARY
10
- } from "./chunk-DDSMTD4W.js";
10
+ } from "./chunk-K3OCYJPK.js";
11
11
  import {
12
12
  KEY_FILE_MODE
13
- } from "./chunk-2LTRA6NA.js";
13
+ } from "./chunk-ZYDE6QRW.js";
14
14
  import {
15
15
  CLINE_SERVER_NAME_TAKEN,
16
16
  CLINE_SETTINGS_REFUSALS,
@@ -32,10 +32,10 @@ import {
32
32
  withClinePusharyServer,
33
33
  withRefreshedClineKey,
34
34
  withoutClinePusharyServer
35
- } from "./chunk-MH4O453X.js";
35
+ } from "./chunk-B3BOAYRO.js";
36
36
  import {
37
37
  resolveGlobalBinary
38
- } from "./chunk-PMEDJ4WM.js";
38
+ } from "./chunk-IVOELLUK.js";
39
39
  import {
40
40
  readJsonSafe,
41
41
  writeFileAtomic,
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  APPROVAL_RULES_PATH,
3
3
  canChangeApprovalSettings
4
- } from "./chunk-EQF6SSQL.js";
4
+ } from "./chunk-SZMDRBNK.js";
5
5
  import {
6
6
  callMcpTool
7
- } from "./chunk-MOX7IOGL.js";
7
+ } from "./chunk-TZJR5ESF.js";
8
8
  import {
9
9
  absoluteUrl
10
- } from "./chunk-C4K4KYOY.js";
10
+ } from "./chunk-PBPQRJ2T.js";
11
11
  import {
12
12
  getBaseUrl
13
- } from "./chunk-ANL74IBU.js";
13
+ } from "./chunk-FTTSQAF4.js";
14
14
  import {
15
15
  NPX_LATEST_COMMAND
16
- } from "./chunk-P5JV6YZW.js";
16
+ } from "./chunk-AOP55JR2.js";
17
17
  import {
18
18
  AGENT_STOP_DEFAULT_SECONDS,
19
19
  APPROVAL_MODE_META,
@@ -21,7 +21,7 @@ import {
21
21
  classifyConfirmResponse,
22
22
  isAnswerSource,
23
23
  roundTripAsk
24
- } from "./chunk-KB7YWU7A.js";
24
+ } from "./chunk-HA2SRYYP.js";
25
25
 
26
26
  // src/reach.ts
27
27
  var PUSHARY_APP_DOWNLOAD_URL = "https://pushary.com/download";