@pushary/agent-hooks 1.7.1 → 1.7.2

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 (101) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/bin/pushary-bell-hook.js +23 -23
  3. package/dist/bin/pushary-bell.js +10 -10
  4. package/dist/bin/pushary-claude.js +46 -35
  5. package/dist/bin/pushary-clean.js +107 -60
  6. package/dist/bin/pushary-codex-bridge.js +18 -17
  7. package/dist/bin/pushary-codex-hook.js +53 -39
  8. package/dist/bin/pushary-codex.js +14 -12
  9. package/dist/bin/pushary-connect.js +16 -16
  10. package/dist/bin/pushary-cowork.js +5 -5
  11. package/dist/bin/pushary-daemon.js +27 -27
  12. package/dist/bin/pushary-disconnect.js +19 -17
  13. package/dist/bin/pushary-doctor.js +63 -35
  14. package/dist/bin/pushary-elicitation-hook.js +35 -26
  15. package/dist/bin/pushary-gemini-bridge.js +12 -12
  16. package/dist/bin/pushary-gemini-hook.js +47 -32
  17. package/dist/bin/pushary-hook.js +34 -32
  18. package/dist/bin/pushary-login.js +16 -16
  19. package/dist/bin/pushary-logout.js +8 -8
  20. package/dist/bin/pushary-mcp.js +9 -8
  21. package/dist/bin/pushary-mode.js +10 -10
  22. package/dist/bin/pushary-notification-hook.js +29 -27
  23. package/dist/bin/pushary-opencode-hook.js +46 -32
  24. package/dist/bin/pushary-permission-denied-hook.js +34 -32
  25. package/dist/bin/pushary-permission-hook.js +33 -31
  26. package/dist/bin/pushary-post-hook.js +29 -27
  27. package/dist/bin/pushary-prompt-hook.js +29 -27
  28. package/dist/bin/pushary-session-end-hook.js +29 -27
  29. package/dist/bin/pushary-session-start-hook.js +33 -31
  30. package/dist/bin/pushary-setup.js +69 -56
  31. package/dist/bin/pushary-stats.js +5 -5
  32. package/dist/bin/pushary-status.js +19 -19
  33. package/dist/bin/pushary-stop-hook.js +29 -27
  34. package/dist/bin/pushary-stopfailure-hook.js +29 -27
  35. package/dist/bin/pushary-suggestions.js +5 -5
  36. package/dist/bin/pushary-transcript-register.js +19 -19
  37. package/dist/bin/pushary-transcripts.js +7 -7
  38. package/dist/bin/pushary-upgrade.js +20 -20
  39. package/dist/bin/pushary-wait.js +10 -10
  40. package/dist/bin/pushary.js +6 -6
  41. package/dist/{chunk-WM3U2RUK.js → chunk-2B4XCMH6.js} +75 -232
  42. package/dist/{chunk-ZIIYTQHC.js → chunk-2XOHXZRC.js} +12 -4
  43. package/dist/{chunk-3QE3BHBW.js → chunk-3NSRL5E7.js} +2 -2
  44. package/dist/{chunk-7GI6QC3M.js → chunk-3RO2UWJQ.js} +2 -2
  45. package/dist/{chunk-AAGLDXH4.js → chunk-4S7CCOXB.js} +5 -5
  46. package/dist/{chunk-6SJQ442W.js → chunk-5GIBNUBD.js} +2 -2
  47. package/dist/chunk-5OP5MQI7.js +45 -0
  48. package/dist/{chunk-EIZW73P5.js → chunk-65RN6ZCO.js} +1 -1
  49. package/dist/{chunk-6PV2JQ64.js → chunk-6NHXKTQU.js} +2 -2
  50. package/dist/{chunk-KSNAAMU5.js → chunk-6QZK4O36.js} +4 -4
  51. package/dist/{chunk-WZWXBTRF.js → chunk-A6WQF7FQ.js} +3 -3
  52. package/dist/{chunk-62TEPRWQ.js → chunk-AWZNDM3B.js} +1 -1
  53. package/dist/{chunk-NQFGVAT6.js → chunk-D4OGEWLH.js} +19 -2
  54. package/dist/{chunk-SVEMF2VO.js → chunk-E3PLF7YB.js} +4 -4
  55. package/dist/{chunk-MCNS4725.js → chunk-F6BMJOSW.js} +1 -1
  56. package/dist/{chunk-P5CBNSYL.js → chunk-HOIGXMI7.js} +1 -1
  57. package/dist/{chunk-XMN37YJH.js → chunk-I7B2DNVU.js} +1 -1
  58. package/dist/{chunk-ZEMSCGDD.js → chunk-INR3RVQ3.js} +8 -3
  59. package/dist/{chunk-3QORH5EJ.js → chunk-IZVAVXHQ.js} +6 -4
  60. package/dist/{chunk-MWVCDP64.js → chunk-JMSB6CJT.js} +1 -1
  61. package/dist/{chunk-WSC53O7I.js → chunk-KAJT6HPI.js} +3 -3
  62. package/dist/{chunk-XPMOCJHN.js → chunk-KLXYMPTM.js} +1 -1
  63. package/dist/{chunk-XDASEYRS.js → chunk-L6IF4JOF.js} +3 -3
  64. package/dist/{chunk-UPKP67TA.js → chunk-LI3C2IQY.js} +2 -2
  65. package/dist/{chunk-H6JV44TE.js → chunk-M2JGLFFS.js} +1 -1
  66. package/dist/chunk-MY3UZO5U.js +99 -0
  67. package/dist/chunk-N6IOSZOE.js +185 -0
  68. package/dist/{chunk-454KMJHF.js → chunk-NYBZJ44G.js} +34 -1
  69. package/dist/{chunk-QPR33SHS.js → chunk-OJRB5QKN.js} +6 -6
  70. package/dist/{chunk-3T35OE7C.js → chunk-OXEF6JHD.js} +4 -4
  71. package/dist/{chunk-SNWNA3MQ.js → chunk-PWNQGITG.js} +1 -1
  72. package/dist/{chunk-XPTCPU6V.js → chunk-Q7CDBJXU.js} +1 -1
  73. package/dist/{chunk-OTZHT34O.js → chunk-QSZ37ROP.js} +1 -1
  74. package/dist/{chunk-O5JD7UI5.js → chunk-R7ZETVNR.js} +1 -1
  75. package/dist/{chunk-4C4NRDIC.js → chunk-RLRDPZG4.js} +1 -1
  76. package/dist/{chunk-IGBDOZUO.js → chunk-SEIZQZEE.js} +1 -1
  77. package/dist/{chunk-OAL44FM2.js → chunk-SJN64NJX.js} +1 -1
  78. package/dist/{chunk-NID4UZDN.js → chunk-SKEW3TQX.js} +1 -1
  79. package/dist/{chunk-NAAZCNKI.js → chunk-SKMWPXGV.js} +351 -37
  80. package/dist/{chunk-KBLIVEFJ.js → chunk-T3PRPFDY.js} +5 -5
  81. package/dist/{chunk-2FU43B5Q.js → chunk-TVJYGZXB.js} +2 -2
  82. package/dist/{chunk-Y6GKOZBT.js → chunk-U3MS6D5X.js} +1 -1
  83. package/dist/{chunk-O5PRIYFZ.js → chunk-U4TMAANR.js} +3 -0
  84. package/dist/{chunk-JTQDP4ZL.js → chunk-UFNBKYWT.js} +3 -3
  85. package/dist/{chunk-42XR73I2.js → chunk-UUTWHVSV.js} +35 -35
  86. package/dist/{chunk-43SSQCWO.js → chunk-VQDJ6KB3.js} +3 -3
  87. package/dist/{chunk-YZKS3ME3.js → chunk-VSGKQ3HI.js} +2 -2
  88. package/dist/{chunk-XFNVG3OV.js → chunk-WWTLAZQA.js} +24 -7
  89. package/dist/{chunk-VCMFKZON.js → chunk-WXIVUIXA.js} +2 -2
  90. package/dist/{chunk-AHWJHLG5.js → chunk-YLCSKVQQ.js} +7 -5
  91. package/dist/{chunk-Q7QRR6YL.js → chunk-YNJ2H2FD.js} +2 -2
  92. package/dist/{chunk-BYVB3RX3.js → chunk-YU4222G2.js} +2 -2
  93. package/dist/{chunk-YQN7S57T.js → chunk-YU54LNC6.js} +6 -6
  94. package/dist/{chunk-7GYGVQBU.js → chunk-ZMWX5SDA.js} +8 -8
  95. package/dist/{chunk-55RO62FV.js → chunk-ZUKZJQGR.js} +1 -1
  96. package/dist/{reapply-66GQIBXN.js → reapply-D6RSDYCK.js} +9 -9
  97. package/dist/src/index.d.ts +1 -0
  98. package/dist/src/index.js +22 -20
  99. package/package.json +2 -1
  100. package/dist/chunk-JMBG47WV.js +0 -336
  101. package/dist/chunk-YHG74UFF.js +0 -12
@@ -3,28 +3,28 @@ import {
3
3
  addPusharyToolPermissions,
4
4
  isPusharyHook,
5
5
  removeClaudeMcpServers
6
- } from "./chunk-WSC53O7I.js";
6
+ } from "./chunk-KAJT6HPI.js";
7
7
  import {
8
8
  CLAUDE_HOOK_EVENTS,
9
9
  addGeminiMcpServer,
10
10
  removeGeminiMcpServer
11
- } from "./chunk-WZWXBTRF.js";
11
+ } from "./chunk-A6WQF7FQ.js";
12
12
  import {
13
13
  CLAUDE_CODE_AGENT,
14
14
  parseApplyPatchFiles
15
- } from "./chunk-WM3U2RUK.js";
15
+ } from "./chunk-2B4XCMH6.js";
16
16
  import {
17
17
  guardBinary,
18
18
  holdBudgetOf,
19
19
  registerHookEntry
20
- } from "./chunk-454KMJHF.js";
20
+ } from "./chunk-NYBZJ44G.js";
21
21
  import {
22
22
  PHONE_ANSWERED_TOOLS,
23
23
  hookCompatibleProfile,
24
24
  hookCompatibleProfileBySource,
25
25
  toToolLookup,
26
26
  withHookHoldBudget
27
- } from "./chunk-XFNVG3OV.js";
27
+ } from "./chunk-WWTLAZQA.js";
28
28
 
29
29
  // src/compatible-config.ts
30
30
  import { homedir } from "os";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  parseSseMessages
3
- } from "./chunk-NQFGVAT6.js";
3
+ } from "./chunk-D4OGEWLH.js";
4
4
  import {
5
5
  NPX_LATEST_COMMAND
6
- } from "./chunk-EIZW73P5.js";
6
+ } from "./chunk-65RN6ZCO.js";
7
7
 
8
8
  // src/mcp-stdio-bridge.ts
9
9
  var MCP_BRIDGE_BINARY = "pushary-mcp";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  parseVersion
3
- } from "./chunk-WZWXBTRF.js";
3
+ } from "./chunk-A6WQF7FQ.js";
4
4
 
5
5
  // src/setup/agent-probe.ts
6
6
  import { execSync } from "child_process";
@@ -30,6 +30,8 @@ var truthyLevel = (value) => {
30
30
  const parsed = Number(value);
31
31
  return Number.isFinite(parsed) ? parsed : 1;
32
32
  };
33
+ var ANSI_RESET = "\x1B[0m";
34
+ var ansiPainter = (enabled) => (open) => (text) => enabled() ? `${open}${text}${ANSI_RESET}` : text;
33
35
  var useColor = (context = {}, stream = process.stdout) => {
34
36
  const forced = truthyLevel(process.env.FORCE_COLOR);
35
37
  if (forced !== void 0) return forced > 0;
@@ -103,6 +105,7 @@ var createIo = (stream = process.stdout, context = {}) => {
103
105
  export {
104
106
  clipToRow,
105
107
  terminalColumns,
108
+ ansiPainter,
106
109
  useColor,
107
110
  createIo
108
111
  };
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  readExistingMachineId
3
- } from "./chunk-P5CBNSYL.js";
3
+ } from "./chunk-HOIGXMI7.js";
4
4
  import {
5
5
  NetworkError
6
6
  } from "./chunk-7QLSKOSU.js";
7
7
  import {
8
8
  getBaseUrl
9
- } from "./chunk-OAL44FM2.js";
9
+ } from "./chunk-SJN64NJX.js";
10
10
  import {
11
11
  clientContextHeaders,
12
12
  getPackageVersion
13
- } from "./chunk-XFNVG3OV.js";
13
+ } from "./chunk-WWTLAZQA.js";
14
14
 
15
15
  // src/cli/net.ts
16
16
  import { createRequire } from "module";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  activeHookSource,
3
3
  activeIdentity
4
- } from "./chunk-KBLIVEFJ.js";
4
+ } from "./chunk-T3PRPFDY.js";
5
5
  import {
6
6
  blockedActionFingerprint,
7
7
  defersToNativeMode,
@@ -9,17 +9,18 @@ import {
9
9
  hasBlockedActionHint,
10
10
  recordBlockedActionHint,
11
11
  reportMachineDenial
12
- } from "./chunk-3QORH5EJ.js";
12
+ } from "./chunk-IZVAVXHQ.js";
13
13
  import {
14
14
  isGatingMoment,
15
15
  recordKeylessMoment
16
- } from "./chunk-MCNS4725.js";
16
+ } from "./chunk-F6BMJOSW.js";
17
17
  import {
18
+ announceSubscriptionRequired,
18
19
  denyReasonFrom,
19
- isDeferAnswer
20
- } from "./chunk-YHG74UFF.js";
20
+ isDeferAnswer,
21
+ oncePerSession
22
+ } from "./chunk-5OP5MQI7.js";
21
23
  import {
22
- DEFAULT_SESSION,
23
24
  UNNAMED_ACTION,
24
25
  claimThrottle,
25
26
  deriveAction,
@@ -36,9 +37,13 @@ import {
36
37
  reportEvent,
37
38
  scopePathFor,
38
39
  settleQuestionsForToolUse
39
- } from "./chunk-WM3U2RUK.js";
40
+ } from "./chunk-2B4XCMH6.js";
41
+ import {
42
+ DEFAULT_SESSION
43
+ } from "./chunk-N6IOSZOE.js";
40
44
  import {
41
45
  DECISION_STOP_REASON,
46
+ UNVERIFIABLE_APPROVAL_REASON,
42
47
  askUser,
43
48
  cancelQuestion,
44
49
  claimBlockedAction,
@@ -48,14 +53,17 @@ import {
48
53
  requestGate,
49
54
  sendNotification,
50
55
  waitForQuestion
51
- } from "./chunk-ZIIYTQHC.js";
56
+ } from "./chunk-2XOHXZRC.js";
57
+ import {
58
+ SubscriptionRequiredError
59
+ } from "./chunk-D4OGEWLH.js";
52
60
  import {
53
61
  getMachineId
54
- } from "./chunk-P5CBNSYL.js";
62
+ } from "./chunk-HOIGXMI7.js";
55
63
  import {
56
64
  getApiKey,
57
65
  getBaseUrl
58
- } from "./chunk-OAL44FM2.js";
66
+ } from "./chunk-SJN64NJX.js";
59
67
  import {
60
68
  AGENT_QUESTION_STRATEGY,
61
69
  GATE_BLOCK_REASON_MAX_LENGTH,
@@ -83,7 +91,7 @@ import {
83
91
  parseAgentQuestions,
84
92
  resolveGate,
85
93
  stoppedOutput
86
- } from "./chunk-XFNVG3OV.js";
94
+ } from "./chunk-WWTLAZQA.js";
87
95
 
88
96
  // src/claude-permission-rules.ts
89
97
  import { readFileSync, statSync } from "fs";
@@ -152,9 +160,7 @@ var reportDecisionEpisode = async (apiKey, input) => {
152
160
  };
153
161
 
154
162
  // src/hook.ts
155
- import { basename, join as join2 } from "path";
156
- import { tmpdir } from "os";
157
- import { existsSync, writeFileSync } from "fs";
163
+ import { basename } from "path";
158
164
  var START_MS = Date.now();
159
165
  var ACTIVE_AGENT = activeIdentity(process.argv);
160
166
  var ACTIVE_SOURCE = activeHookSource(process.argv);
@@ -164,6 +170,11 @@ var deny = (reason) => claudePreToolUseOutput("deny", reason);
164
170
  var allowWithInput = (updatedInput) => claudePreToolUseOutput("allow", void 0, updatedInput);
165
171
  var ask = (reason) => claudePreToolUseOutput("ask", reason);
166
172
  var halted = (reason) => stoppedOutput(deny(reason), reason);
173
+ var outcomeOfFailedAsk = (error, sessionId, failure) => {
174
+ if (!(error instanceof SubscriptionRequiredError)) return failure;
175
+ announceSubscriptionRequired(error.upgradeUrl, sessionId);
176
+ return void 0;
177
+ };
167
178
  var storedWaitDeadline = (result, requestedDeadline) => {
168
179
  const stored = result.waitEndsAt ? Date.parse(result.waitEndsAt) : Number.NaN;
169
180
  return Number.isFinite(stored) ? Math.min(stored, requestedDeadline) : requestedDeadline;
@@ -187,8 +198,8 @@ var handlePushOnly = async (apiKey, description, projectName, timeoutSeconds, ti
187
198
  waitEndsAt: timeoutAction !== "approve" && timeoutAction !== "deny" || clampCut ? new Date(requestedDeadline).toISOString() : void 0,
188
199
  ...decision
189
200
  });
190
- } catch {
191
- return halted("Pushary could not create a verifiable approval. Retry the action.");
201
+ } catch (error) {
202
+ return outcomeOfFailedAsk(error, sessionId, halted(UNVERIFIABLE_APPROVAL_REASON));
192
203
  }
193
204
  if (isDecisionStopped(result)) return halted(DECISION_STOP_REASON);
194
205
  const deadline = storedWaitDeadline(result, requestedDeadline);
@@ -232,8 +243,8 @@ var handlePushFirst = async (apiKey, description, projectName, pushFirstSeconds,
232
243
  waitEndsAt: new Date(requestedDeadline).toISOString(),
233
244
  ...decision
234
245
  });
235
- } catch {
236
- return halted("Pushary could not create a verifiable approval. Retry the action.");
246
+ } catch (error) {
247
+ return outcomeOfFailedAsk(error, sessionId, halted(UNVERIFIABLE_APPROVAL_REASON));
237
248
  }
238
249
  if (isDecisionStopped(result)) return halted(DECISION_STOP_REASON);
239
250
  if (!isLocalQuestionHandoff(result) && !result.answered) announceWait(pushFirstSeconds, result.answerUrl, sessionId);
@@ -344,17 +355,6 @@ var announceWait = (waitSeconds, answerUrl, sessionId) => {
344
355
  }
345
356
  };
346
357
  var KEYLESS_NOTICE = "[pushary] Not connected (no API key), so your agent runs untouched. Approval moments are counted locally; see them with: npx @pushary/agent-hooks@latest stats. Connect: https://pushary.com/sign-up?utm_source=cli&utm_medium=keyless-hook";
347
- var oncePerSession = (kind, sessionId) => {
348
- try {
349
- const key = (sessionId || DEFAULT_SESSION).replace(/[^a-zA-Z0-9_-]/g, "");
350
- const marker = join2(tmpdir(), `pushary-${kind}-${key}`);
351
- if (existsSync(marker)) return false;
352
- writeFileSync(marker, "1", "utf-8");
353
- return true;
354
- } catch {
355
- return false;
356
- }
357
- };
358
358
  var keylessNoticeOnce = (sessionId) => {
359
359
  try {
360
360
  if (!oncePerSession("keyless", sessionId)) return;
@@ -391,8 +391,8 @@ var askAsOneCard = async (apiKey, input, parsed, projectName, deadline) => {
391
391
  toolUseId: input.tool_use_id,
392
392
  waitEndsAt: new Date(deadline).toISOString()
393
393
  });
394
- } catch {
395
- return null;
394
+ } catch (error) {
395
+ return outcomeOfFailedAsk(error, input.session_id, null);
396
396
  }
397
397
  if (isDecisionStopped(result)) return null;
398
398
  const answer = await waitForQuestion(apiKey, result, storedWaitDeadline(result, deadline));
@@ -424,8 +424,8 @@ var askQuestionByQuestion = async (apiKey, input, parsed, projectName, deadline)
424
424
  toolUseId: input.tool_use_id ? `${input.tool_use_id}#q${index}` : void 0,
425
425
  waitEndsAt: new Date(deadline).toISOString()
426
426
  });
427
- } catch {
428
- return null;
427
+ } catch (error) {
428
+ return outcomeOfFailedAsk(error, input.session_id, null);
429
429
  }
430
430
  if (isDecisionStopped(result)) return null;
431
431
  const answer = await waitForQuestion(apiKey, result, storedWaitDeadline(result, deadline));
@@ -478,8 +478,8 @@ var handleExitPlanMode = async (apiKey, input) => {
478
478
  blocker: "Waiting for you to approve the plan",
479
479
  waitEndsAt: new Date(deadline).toISOString()
480
480
  });
481
- } catch {
482
- return halted(DECISION_STOP_REASON);
481
+ } catch (error) {
482
+ return outcomeOfFailedAsk(error, input.session_id, halted(DECISION_STOP_REASON));
483
483
  }
484
484
  if (isDecisionStopped(result)) return halted(DECISION_STOP_REASON);
485
485
  const answer = await waitForQuestion(apiKey, result, storedWaitDeadline(result, deadline));
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  pusharyFetch
3
- } from "./chunk-JTQDP4ZL.js";
3
+ } from "./chunk-UFNBKYWT.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-OAL44FM2.js";
12
+ } from "./chunk-SJN64NJX.js";
13
13
  import {
14
14
  isValidApiKey,
15
15
  normalizeKeyScope
16
- } from "./chunk-XFNVG3OV.js";
16
+ } from "./chunk-WWTLAZQA.js";
17
17
 
18
18
  // src/session.ts
19
19
  var samePusharyAccount = (left, right) => left.kind === "ok" && right.kind === "ok" && left.identity.workspaceId !== "" && left.identity.workspaceId === right.identity.workspaceId && left.identity.siteId === right.identity.siteId;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resolveInstallSourceFor
3
- } from "./chunk-UPKP67TA.js";
3
+ } from "./chunk-LI3C2IQY.js";
4
4
  import {
5
5
  backupFile,
6
6
  readJsonSafe,
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-T7E75EKA.js";
10
10
  import {
11
11
  configFilePath
12
- } from "./chunk-OAL44FM2.js";
12
+ } from "./chunk-SJN64NJX.js";
13
13
 
14
14
  // src/shell-alias.ts
15
15
  import { homedir } from "os";
@@ -455,7 +455,19 @@ var compatibleTargetFiles = (profile) => {
455
455
  };
456
456
 
457
457
  // ../contracts/src/redaction.ts
458
- var SECRET_REDACTION_RULES = [
458
+ var CREDENTIAL_KEY = String.raw`(?:secret|token|password|passwd|api[_-]?key|access[_-]?key|client[_-]?secret|private[_-]?key)["']?\s*[=:]\s*`;
459
+ var CLOSED_DOUBLE_QUOTE = '"';
460
+ var CLOSED_SINGLE_QUOTE = "'";
461
+ var DOUBLE_QUOTE_OR_CUT_OFF = String.raw`(?:"|\\?$)`;
462
+ var SINGLE_QUOTE_OR_CUT_OFF = "(?:'|$)";
463
+ var credentialAssignmentRule = (doubleQuoteEnd, singleQuoteEnd) => ({
464
+ pattern: new RegExp(
465
+ String.raw`(${CREDENTIAL_KEY})(?:(")(?:\\[\s\S]|[^"\\])*${doubleQuoteEnd}|(')[^']*${singleQuoteEnd}|\S+)`,
466
+ "gi"
467
+ ),
468
+ replacement: "$1$2$3[redacted]$2$3"
469
+ });
470
+ var PRECISE_SECRET_RULES = [
459
471
  { pattern: /\bpk_[A-Za-z0-9_]+\.[A-Za-z0-9_]+/g, replacement: "[redacted]" },
460
472
  { pattern: /-----BEGIN[A-Z0-9 ]*PRIVATE KEY-----[\s\S]*?-----END[A-Z0-9 ]*PRIVATE KEY-----/g, replacement: "[redacted key]" },
461
473
  { pattern: /\bsk-[A-Za-z0-9_-]{16,}\b/g, replacement: "[redacted]" },
@@ -472,14 +484,19 @@ var SECRET_REDACTION_RULES = [
472
484
  { pattern: /\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\b/g, replacement: "[redacted]" },
473
485
  { pattern: /\b([a-z][a-z0-9+.-]*:\/\/[^\s:/@]+:)[^\s@/]+@/gi, replacement: "$1[redacted]@" },
474
486
  { pattern: /\bbearer\s+[A-Za-z0-9._~+/=-]+/gi, replacement: "bearer [redacted]" },
475
- { pattern: /\bauthorization:\s*\S+/gi, replacement: "authorization: [redacted]" },
476
- {
477
- pattern: /((?:secret|token|password|passwd|api[_-]?key|access[_-]?key|client[_-]?secret|private[_-]?key)["']?\s*[=:]\s*)(?:(")(?:\\[\s\S]|[^"\\])*(?:"|\\?$)|(')[^']*(?:'|$)|\S+)/gi,
478
- replacement: "$1$2$3[redacted]$2$3"
479
- }
487
+ { pattern: /\bauthorization:\s*\S+/gi, replacement: "authorization: [redacted]" }
488
+ ];
489
+ var SECRET_REDACTION_RULES = [
490
+ ...PRECISE_SECRET_RULES,
491
+ credentialAssignmentRule(CLOSED_DOUBLE_QUOTE, CLOSED_SINGLE_QUOTE)
492
+ ];
493
+ var CUT_OFF_TEXT_REDACTION_RULES = [
494
+ ...PRECISE_SECRET_RULES,
495
+ credentialAssignmentRule(DOUBLE_QUOTE_OR_CUT_OFF, SINGLE_QUOTE_OR_CUT_OFF)
480
496
  ];
481
497
  var HIGH_ENTROPY_RULE = { pattern: /[A-Za-z0-9+/]{40,}={0,2}/g, replacement: "[redacted]" };
482
- var redactSecrets = (text) => SECRET_REDACTION_RULES.reduce((acc, rule) => acc.replace(rule.pattern, rule.replacement), text);
498
+ var applyRedactionRules = (rules, text) => rules.reduce((acc, rule) => acc.replace(rule.pattern, rule.replacement), text);
499
+ var redactSecrets = (text) => applyRedactionRules(SECRET_REDACTION_RULES, text);
483
500
  var redactSecretsDeep = (text) => redactSecrets(text).replace(HIGH_ENTROPY_RULE.pattern, HIGH_ENTROPY_RULE.replacement);
484
501
 
485
502
  // ../contracts/src/degraded.ts
@@ -3,11 +3,11 @@ import {
3
3
  decodePublicKey,
4
4
  generateSessionKey,
5
5
  wrapSessionKey
6
- } from "./chunk-O5JD7UI5.js";
6
+ } from "./chunk-R7ZETVNR.js";
7
7
  import {
8
8
  fetchTranscriptRecipients,
9
9
  uploadTranscriptRecords
10
- } from "./chunk-OTZHT34O.js";
10
+ } from "./chunk-QSZ37ROP.js";
11
11
 
12
12
  // src/live-session.ts
13
13
  var MAX_TRANSCRIPT_QUEUE = 100;
@@ -11,20 +11,20 @@ import {
11
11
  clipToRow,
12
12
  terminalColumns,
13
13
  useColor
14
- } from "./chunk-O5PRIYFZ.js";
14
+ } from "./chunk-U4TMAANR.js";
15
15
  import {
16
16
  callMcpTool
17
- } from "./chunk-NQFGVAT6.js";
17
+ } from "./chunk-D4OGEWLH.js";
18
18
  import {
19
19
  reportedInstallSource
20
- } from "./chunk-UPKP67TA.js";
20
+ } from "./chunk-LI3C2IQY.js";
21
21
  import {
22
22
  NPX_LATEST_COMMAND
23
- } from "./chunk-EIZW73P5.js";
23
+ } from "./chunk-65RN6ZCO.js";
24
24
  import {
25
25
  PAIR_TTL_SECONDS,
26
26
  isAnswerSource
27
- } from "./chunk-XFNVG3OV.js";
27
+ } from "./chunk-WWTLAZQA.js";
28
28
 
29
29
  // src/reach.ts
30
30
  var reachVerdict = (channels) => {
@@ -766,6 +766,8 @@ var describePairFailure = (reason) => {
766
766
  return "Finish setting up in the Pushary app, then run setup again";
767
767
  case "authorize_failed":
768
768
  return "The app could not authorize this terminal. Re-run setup to try again";
769
+ case "payment_required":
770
+ return "Your Pushary workspace has no active subscription. Subscribe in the Pushary app or at pushary.com, then run setup again";
769
771
  default:
770
772
  return "Pairing failed. Re-run setup to try again";
771
773
  }
@@ -2,10 +2,10 @@ import {
2
2
  resolveBinary,
3
3
  resolveGlobalPackageVersion,
4
4
  resolvePackageVersionFromBinary
5
- } from "./chunk-454KMJHF.js";
5
+ } from "./chunk-NYBZJ44G.js";
6
6
  import {
7
7
  MANAGED_PROVIDERS
8
- } from "./chunk-XFNVG3OV.js";
8
+ } from "./chunk-WWTLAZQA.js";
9
9
 
10
10
  // src/live-capabilities.ts
11
11
  var CLAUDE_BRIDGE_CAPABILITY = "claude-bridge";
@@ -3,14 +3,14 @@ import {
3
3
  } from "./chunk-POFBE6ZY.js";
4
4
  import {
5
5
  autoUpdateState
6
- } from "./chunk-454KMJHF.js";
6
+ } from "./chunk-NYBZJ44G.js";
7
7
  import {
8
8
  readJsonSafe,
9
9
  writeJsonAtomic
10
10
  } from "./chunk-T7E75EKA.js";
11
11
  import {
12
12
  ownPackageRoot
13
- } from "./chunk-XFNVG3OV.js";
13
+ } from "./chunk-WWTLAZQA.js";
14
14
 
15
15
  // src/auto-update.ts
16
16
  import { spawn } from "child_process";
@@ -2,27 +2,27 @@ import {
2
2
  detectProviderLiveCapabilities,
3
3
  hasSpawnProvider,
4
4
  resolveControlPolicy
5
- } from "./chunk-Q7QRR6YL.js";
5
+ } from "./chunk-YNJ2H2FD.js";
6
6
  import {
7
7
  daemonHasRemoteProof,
8
8
  daemonServiceManagerAvailable,
9
9
  hasDaemonServiceDefinition,
10
10
  readDaemonNeedsLogin,
11
11
  readDaemonStatus
12
- } from "./chunk-AAGLDXH4.js";
12
+ } from "./chunk-4S7CCOXB.js";
13
13
  import {
14
14
  readControlMode,
15
15
  readKeySource
16
- } from "./chunk-YZKS3ME3.js";
16
+ } from "./chunk-VSGKQ3HI.js";
17
17
  import {
18
18
  getMachineId
19
- } from "./chunk-P5CBNSYL.js";
19
+ } from "./chunk-HOIGXMI7.js";
20
20
  import {
21
21
  getBaseUrl
22
- } from "./chunk-OAL44FM2.js";
22
+ } from "./chunk-SJN64NJX.js";
23
23
  import {
24
24
  getPackageVersion
25
- } from "./chunk-XFNVG3OV.js";
25
+ } from "./chunk-WWTLAZQA.js";
26
26
 
27
27
  // src/machines.ts
28
28
  import { hostname } from "os";
@@ -6,38 +6,38 @@ import {
6
6
  } from "./chunk-SGZJ5LYH.js";
7
7
  import {
8
8
  hookOwnerOf
9
- } from "./chunk-SVEMF2VO.js";
9
+ } from "./chunk-E3PLF7YB.js";
10
10
  import {
11
11
  ensureDaemonRunning
12
- } from "./chunk-AAGLDXH4.js";
12
+ } from "./chunk-4S7CCOXB.js";
13
13
  import {
14
14
  buildTranscriptRecords,
15
15
  decodePublicKey,
16
16
  generateSessionKey,
17
17
  wrapSessionKey
18
- } from "./chunk-O5JD7UI5.js";
18
+ } from "./chunk-R7ZETVNR.js";
19
19
  import {
20
20
  fetchTranscriptRecipients,
21
21
  uploadTranscriptRecords
22
- } from "./chunk-OTZHT34O.js";
22
+ } from "./chunk-QSZ37ROP.js";
23
23
  import {
24
24
  transcriptEnvironmentPreference,
25
25
  transcriptsEnabled
26
- } from "./chunk-XPTCPU6V.js";
26
+ } from "./chunk-Q7CDBJXU.js";
27
27
  import {
28
28
  readTranscriptPreference
29
- } from "./chunk-YZKS3ME3.js";
29
+ } from "./chunk-VSGKQ3HI.js";
30
30
  import {
31
31
  codexHome,
32
32
  pusharyDir
33
- } from "./chunk-454KMJHF.js";
33
+ } from "./chunk-NYBZJ44G.js";
34
34
  import {
35
35
  writeJsonAtomic
36
36
  } from "./chunk-T7E75EKA.js";
37
37
  import {
38
38
  getApiKey,
39
39
  getBaseUrl
40
- } from "./chunk-OAL44FM2.js";
40
+ } from "./chunk-SJN64NJX.js";
41
41
 
42
42
  // src/transcript-registration.ts
43
43
  import { createHash } from "crypto";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  readConfigFileKey
3
- } from "./chunk-YZKS3ME3.js";
3
+ } from "./chunk-VSGKQ3HI.js";
4
4
 
5
5
  // src/bell/fleet.ts
6
6
  import { closeSync, constants, futimesSync, lstatSync, mkdirSync, openSync, readdirSync, unlinkSync } from "fs";
@@ -9,17 +9,17 @@ import {
9
9
  reapplyGeminiSettings,
10
10
  reapplyVsCodePlugin,
11
11
  repairCodexHolds
12
- } from "./chunk-QPR33SHS.js";
13
- import "./chunk-Y6GKOZBT.js";
14
- import "./chunk-6SJQ442W.js";
15
- import "./chunk-WSC53O7I.js";
16
- import "./chunk-XDASEYRS.js";
17
- import "./chunk-WZWXBTRF.js";
12
+ } from "./chunk-OJRB5QKN.js";
13
+ import "./chunk-U3MS6D5X.js";
14
+ import "./chunk-5GIBNUBD.js";
15
+ import "./chunk-KAJT6HPI.js";
16
+ import "./chunk-L6IF4JOF.js";
17
+ import "./chunk-A6WQF7FQ.js";
18
18
  import "./chunk-XHKBHWLX.js";
19
- import "./chunk-4C4NRDIC.js";
20
- import "./chunk-454KMJHF.js";
19
+ import "./chunk-RLRDPZG4.js";
20
+ import "./chunk-NYBZJ44G.js";
21
21
  import "./chunk-T7E75EKA.js";
22
- import "./chunk-XFNVG3OV.js";
22
+ import "./chunk-WWTLAZQA.js";
23
23
  export {
24
24
  ensureCodexTrustAfterReapply,
25
25
  inspectConfiguredManagedProviders,
@@ -109,6 +109,7 @@ declare const handlePostToolUse: (input: {
109
109
  tool_result?: unknown;
110
110
  cwd?: string;
111
111
  session_id?: string;
112
+ agent_id?: string;
112
113
  transcript_path?: string;
113
114
  tool_use_id?: string;
114
115
  }, agent?: AgentIdentity) => Promise<string | undefined>;
package/dist/src/index.js CHANGED
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  handlePreToolUse
3
- } from "../chunk-42XR73I2.js";
4
- import "../chunk-KBLIVEFJ.js";
5
- import "../chunk-WSC53O7I.js";
6
- import "../chunk-3QORH5EJ.js";
7
- import "../chunk-MCNS4725.js";
8
- import "../chunk-YHG74UFF.js";
9
- import "../chunk-WZWXBTRF.js";
3
+ } from "../chunk-UUTWHVSV.js";
4
+ import "../chunk-T3PRPFDY.js";
5
+ import "../chunk-KAJT6HPI.js";
6
+ import "../chunk-IZVAVXHQ.js";
7
+ import "../chunk-F6BMJOSW.js";
8
+ import "../chunk-5OP5MQI7.js";
9
+ import "../chunk-A6WQF7FQ.js";
10
10
  import {
11
11
  fetchAccountPublicKey
12
- } from "../chunk-OTZHT34O.js";
12
+ } from "../chunk-QSZ37ROP.js";
13
13
  import {
14
14
  fetchModeOverride,
15
15
  fetchModeState,
@@ -18,31 +18,33 @@ import {
18
18
  handlePostToolUse,
19
19
  handleStop,
20
20
  reportEvent
21
- } from "../chunk-WM3U2RUK.js";
22
- import "../chunk-4C4NRDIC.js";
21
+ } from "../chunk-2B4XCMH6.js";
22
+ import "../chunk-N6IOSZOE.js";
23
+ import "../chunk-RLRDPZG4.js";
23
24
  import {
24
25
  askUser,
25
26
  cancelQuestion,
26
27
  waitForAnswer
27
- } from "../chunk-ZIIYTQHC.js";
28
- import "../chunk-KSNAAMU5.js";
28
+ } from "../chunk-2XOHXZRC.js";
29
+ import "../chunk-6QZK4O36.js";
29
30
  import "../chunk-POFBE6ZY.js";
30
- import "../chunk-NQFGVAT6.js";
31
- import "../chunk-JTQDP4ZL.js";
32
- import "../chunk-P5CBNSYL.js";
31
+ import "../chunk-D4OGEWLH.js";
32
+ import "../chunk-VQDJ6KB3.js";
33
+ import "../chunk-UFNBKYWT.js";
34
+ import "../chunk-HOIGXMI7.js";
33
35
  import "../chunk-7QLSKOSU.js";
34
36
  import "../chunk-KZERVKTD.js";
35
- import "../chunk-UPKP67TA.js";
36
- import "../chunk-454KMJHF.js";
37
+ import "../chunk-LI3C2IQY.js";
38
+ import "../chunk-NYBZJ44G.js";
37
39
  import "../chunk-T7E75EKA.js";
38
40
  import {
39
41
  getApiKey,
40
42
  getBaseUrl
41
- } from "../chunk-OAL44FM2.js";
42
- import "../chunk-EIZW73P5.js";
43
+ } from "../chunk-SJN64NJX.js";
44
+ import "../chunk-65RN6ZCO.js";
43
45
  import {
44
46
  resolvePolicy
45
- } from "../chunk-XFNVG3OV.js";
47
+ } from "../chunk-WWTLAZQA.js";
46
48
  export {
47
49
  askUser,
48
50
  cancelQuestion,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushary/agent-hooks",
3
- "version": "1.7.1",
3
+ "version": "1.7.2",
4
4
  "description": "Permission hooks for AI coding agents: route tool approvals through Pushary push notifications",
5
5
  "keywords": [
6
6
  "pushary",
@@ -89,6 +89,7 @@
89
89
  "test": "node ../../scripts/ci/run-tests.mjs src bin",
90
90
  "typecheck": "tsc --noEmit",
91
91
  "conformance": "bun scripts/hook-conformance.ts",
92
+ "live:phone-session-hooks": "bun scripts/phone-session-hooks.ts",
92
93
  "gen:hooks-spec": "bun scripts/generate-hooks-spec.ts"
93
94
  },
94
95
  "dependencies": {