@pushary/agent-hooks 0.95.5 → 0.95.6

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 (80) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/bin/pushary-bell-hook.js +18 -18
  3. package/dist/bin/pushary-bell.js +7 -7
  4. package/dist/bin/pushary-claude.js +19 -19
  5. package/dist/bin/pushary-clean.js +18 -18
  6. package/dist/bin/pushary-codex-bridge.js +10 -10
  7. package/dist/bin/pushary-codex-hook.js +21 -21
  8. package/dist/bin/pushary-codex.js +7 -7
  9. package/dist/bin/pushary-connect.js +8 -8
  10. package/dist/bin/pushary-cowork.js +5 -5
  11. package/dist/bin/pushary-daemon.js +24 -24
  12. package/dist/bin/pushary-disconnect.js +8 -8
  13. package/dist/bin/pushary-doctor.js +88 -34
  14. package/dist/bin/pushary-elicitation-hook.js +17 -17
  15. package/dist/bin/pushary-gemini-bridge.js +9 -9
  16. package/dist/bin/pushary-gemini-hook.js +20 -20
  17. package/dist/bin/pushary-hook.js +24 -24
  18. package/dist/bin/pushary-login.js +9 -9
  19. package/dist/bin/pushary-logout.js +6 -6
  20. package/dist/bin/pushary-mode.js +5 -5
  21. package/dist/bin/pushary-notification-hook.js +19 -19
  22. package/dist/bin/pushary-opencode-hook.js +20 -20
  23. package/dist/bin/pushary-permission-denied-hook.js +22 -22
  24. package/dist/bin/pushary-permission-hook.js +22 -22
  25. package/dist/bin/pushary-post-hook.js +19 -19
  26. package/dist/bin/pushary-prompt-hook.js +19 -19
  27. package/dist/bin/pushary-session-end-hook.js +19 -19
  28. package/dist/bin/pushary-session-start-hook.js +22 -22
  29. package/dist/bin/pushary-setup.js +45 -38
  30. package/dist/bin/pushary-stats.js +4 -4
  31. package/dist/bin/pushary-status.js +14 -10
  32. package/dist/bin/pushary-stop-hook.js +19 -19
  33. package/dist/bin/pushary-stopfailure-hook.js +19 -19
  34. package/dist/bin/pushary-suggestions.js +2 -2
  35. package/dist/bin/pushary-transcript-register.js +16 -16
  36. package/dist/bin/pushary-transcripts.js +7 -7
  37. package/dist/bin/pushary-upgrade.js +16 -16
  38. package/dist/bin/pushary-wait.js +5 -5
  39. package/dist/bin/pushary.js +1 -1
  40. package/dist/{chunk-UCS65VVR.js → chunk-32WFHA77.js} +1 -1
  41. package/dist/{chunk-IVQMNLSA.js → chunk-32WWVRXN.js} +1 -1
  42. package/dist/{chunk-HQIVR7MM.js → chunk-43TFQOAT.js} +1 -1
  43. package/dist/{chunk-2ZTL3PGN.js → chunk-4XFBO3GW.js} +1 -1
  44. package/dist/{chunk-I6GZX3FT.js → chunk-6II5RBAS.js} +1 -1
  45. package/dist/{chunk-S5CMLR35.js → chunk-6MRPTYYH.js} +1 -1
  46. package/dist/{chunk-XLOELLAS.js → chunk-7N3D4GN7.js} +4 -4
  47. package/dist/{chunk-HBHEX3JQ.js → chunk-A2M6FGUF.js} +3 -3
  48. package/dist/{chunk-WRDLHR2F.js → chunk-AXECWTTZ.js} +2 -2
  49. package/dist/{chunk-VOSGZ6PH.js → chunk-BS5XR4J7.js} +3 -3
  50. package/dist/{chunk-N4VNLISN.js → chunk-C7BFOC35.js} +2 -2
  51. package/dist/{chunk-2D7BAOMY.js → chunk-CDBTCEKE.js} +3 -3
  52. package/dist/{chunk-4PX4QK2Z.js → chunk-DH4INZW3.js} +1 -1
  53. package/dist/{chunk-QQGNFHIK.js → chunk-DSCGKZO5.js} +2 -2
  54. package/dist/{chunk-OW6AZDY2.js → chunk-FBO5WS3D.js} +1 -1
  55. package/dist/{chunk-67YNQ3QA.js → chunk-FHIVWF4B.js} +10 -6
  56. package/dist/{chunk-CUEZMPLJ.js → chunk-FVTFSYKB.js} +1 -1
  57. package/dist/{chunk-DLLAWCQB.js → chunk-GOQHN2UH.js} +1 -1
  58. package/dist/{chunk-BDI2MXTT.js → chunk-HBBQO77U.js} +1 -1
  59. package/dist/{chunk-HGUZOUB2.js → chunk-HHODMHTH.js} +3 -3
  60. package/dist/{chunk-IM2A5H33.js → chunk-HKQ6CD32.js} +1 -1
  61. package/dist/{chunk-OI3DJA7N.js → chunk-JZSWA3VT.js} +1 -1
  62. package/dist/{chunk-KAVDAZ7A.js → chunk-KAWLZTRJ.js} +1 -1
  63. package/dist/{chunk-QHWXUNMN.js → chunk-KNIVXEW4.js} +1 -1
  64. package/dist/{chunk-D6PRC3YQ.js → chunk-LZQVAEWP.js} +2 -1
  65. package/dist/{chunk-KI4PA7MQ.js → chunk-O5RQ7RYJ.js} +90 -18
  66. package/dist/{chunk-6AEM5RCS.js → chunk-OIZVYUED.js} +1 -1
  67. package/dist/{chunk-OEKFD5BC.js → chunk-R4MBUCPQ.js} +1 -1
  68. package/dist/{chunk-6VANQN5Q.js → chunk-RPHXG4HI.js} +2 -2
  69. package/dist/{chunk-VTO3TNIB.js → chunk-SLVXQOYU.js} +1 -1
  70. package/dist/{chunk-D62EONG3.js → chunk-SRFA5BOO.js} +1 -1
  71. package/dist/{chunk-WDKHZRAS.js → chunk-VZADMT7R.js} +41 -0
  72. package/dist/{chunk-32RMQO5Z.js → chunk-WRK6RAA5.js} +47 -4
  73. package/dist/{chunk-BMANRGJQ.js → chunk-WZ63WTAZ.js} +1 -1
  74. package/dist/{chunk-Z2UWFEJW.js → chunk-XJ6CXTSB.js} +7 -7
  75. package/dist/{chunk-4RF52LSU.js → chunk-XKIB2FQY.js} +8 -8
  76. package/dist/{chunk-HCMM3BOW.js → chunk-ZJ6QXXBC.js} +8 -5
  77. package/dist/{chunk-RLXVW4AM.js → chunk-ZQREURP6.js} +1 -1
  78. package/dist/src/index.d.ts +3 -0
  79. package/dist/src/index.js +10 -10
  80. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  parseVersion
3
- } from "./chunk-2D7BAOMY.js";
3
+ } from "./chunk-CDBTCEKE.js";
4
4
 
5
5
  // src/setup/agent-probe.ts
6
6
  import { execSync } from "child_process";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  registerTranscript
3
- } from "./chunk-4RF52LSU.js";
3
+ } from "./chunk-XKIB2FQY.js";
4
4
 
5
5
  // src/admission.ts
6
6
  import { readFileSync } from "fs";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  openCodeConfigDirFrom
3
- } from "./chunk-HQIVR7MM.js";
3
+ } from "./chunk-43TFQOAT.js";
4
4
  import {
5
5
  codexHomeFrom
6
- } from "./chunk-OW6AZDY2.js";
6
+ } from "./chunk-FBO5WS3D.js";
7
7
 
8
8
  // src/vscode-config.ts
9
9
  import { homedir } from "os";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  readConfigFileKey
3
- } from "./chunk-S5CMLR35.js";
3
+ } from "./chunk-6MRPTYYH.js";
4
4
 
5
5
  // src/bell/fleet.ts
6
6
  import { closeSync, constants, futimesSync, lstatSync, mkdirSync, openSync, readdirSync, unlinkSync } from "fs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  shouldDeferToNativeMode
3
- } from "./chunk-WDKHZRAS.js";
3
+ } from "./chunk-VZADMT7R.js";
4
4
 
5
5
  // src/native-defer.ts
6
6
  var nativeDeferOptions = () => {
@@ -34,6 +34,7 @@ var defaults = {
34
34
  setupCommand: null,
35
35
  setupChoice: null,
36
36
  setupGuide: "",
37
+ activationGuide: null,
37
38
  enforcementDetail: "Cooperative. The agent chooses when to ask; no native permission interception.",
38
39
  capabilityNote: "",
39
40
  documented: true
@@ -42,6 +43,7 @@ var AGENTS = {
42
43
  claude_code: {
43
44
  ...defaults,
44
45
  label: "Claude Code",
46
+ activationGuide: "/docs/agents/guides/claude-code#verify-a-real-approval",
45
47
  hookSource: "claude",
46
48
  policyAgent: "claude_code",
47
49
  repoAware: true,
@@ -958,6 +960,23 @@ p:12:small=n:1e-7`
958
960
  }
959
961
  ];
960
962
  var AUTHORIZATION_PERMIT_TTL_SECONDS = 60 * 60;
963
+ var ANSWER_SOURCES = [
964
+ "dashboard",
965
+ "mobile_app",
966
+ "mobile_background",
967
+ "decide_page",
968
+ "live_page",
969
+ "answer_link",
970
+ "inbox",
971
+ "slack",
972
+ "mac_app",
973
+ // Nobody. A decision opened on a workspace's sandbox site is settled by the
974
+ // simulator instead of being delivered, and the ledger has to say so: a
975
+ // sandbox row that looked like a human answer would be indistinguishable
976
+ // evidence of a person who was never asked.
977
+ "sandbox"
978
+ ];
979
+ var isAnswerSource = (value) => typeof value === "string" && ANSWER_SOURCES.includes(value);
961
980
  var classifyDecisionRisk = (toolName, toolTarget) => {
962
981
  const parts = [toolName, toolTarget ?? ""];
963
982
  const matchesAny = (patterns) => parts.some((part) => patterns.some((re) => re.test(part)));
@@ -1524,6 +1543,23 @@ var elicitationContentFromAnswers = (ask, answers) => {
1524
1543
  return content;
1525
1544
  };
1526
1545
 
1546
+ // ../contracts/src/hook-activation.ts
1547
+ var hookWritePath = (toolName, input) => toolName === "Write" && typeof input.file_path === "string" && input.file_path.startsWith("/") && input.file_path.length <= 4096 ? input.file_path : void 0;
1548
+ var HOOK_ACTIVATION_RESULTS = ["unverified", "approved_executed", "denied_observed", "unexpected_execution", "tool_failed"];
1549
+ var isHookActivationReport = (value) => {
1550
+ if (!value || typeof value !== "object") return false;
1551
+ const report = value;
1552
+ return typeof report.agentType === "string" && typeof report.machineId === "string" && typeof report.target === "string" && report.target.length > 0 && report.target.length <= 4096 && typeof report.truncated === "boolean" && Array.isArray(report.evidence) && report.evidence.length <= 20 && (!report.truncated || report.evidence.length === 0) && report.evidence.every((item) => {
1553
+ if (!item || typeof item !== "object") return false;
1554
+ const row = item;
1555
+ return ["correlationId", "sessionId", "toolUseId", "toolName", "createdAt"].every((key) => typeof row[key] === "string" && row[key].length > 0 && row[key].length <= 256) && (row.answerSource === null || isAnswerSource(row.answerSource)) && HOOK_ACTIVATION_RESULTS.includes(row.result) && Number.isFinite(Date.parse(row.createdAt)) && (row.occurredAt === null || typeof row.occurredAt === "string" && Number.isFinite(Date.parse(row.occurredAt))) && (row.observedAt === null || typeof row.observedAt === "string" && Number.isFinite(Date.parse(row.observedAt))) && (row.result === "unverified" || row.occurredAt !== null && row.observedAt !== null && row.producer !== null && isAnswerSource(row.answerSource) && row.answerSource !== "sandbox") && (row.producer === null || row.producer === "hook" || row.producer === "uplink");
1556
+ });
1557
+ };
1558
+ var hookActivationResult = (report) => {
1559
+ if (report?.evidence.some((row) => row.result === "unexpected_execution")) return "unexpected_execution";
1560
+ return report && !report.truncated && report.evidence.length === 1 ? report.evidence[0].result : "unverified";
1561
+ };
1562
+
1527
1563
  export {
1528
1564
  CLAUDE_CONNECTOR_URL,
1529
1565
  CLAUDE_CONNECTOR_GUIDE,
@@ -1531,11 +1567,15 @@ export {
1531
1567
  CLAUDE_CONNECTOR_STEPS,
1532
1568
  CLAUDE_CONNECTOR_TEST,
1533
1569
  COWORK_STANDING_INSTRUCTIONS,
1570
+ AGENTS,
1534
1571
  HOOK_SOURCES,
1535
1572
  AGENT_LABELS_BY_TYPE,
1536
1573
  DISCONNECTABLE_AGENTS,
1537
1574
  REPO_AWARE_AGENTS,
1538
1575
  MANAGED_PROVIDERS,
1576
+ hookWritePath,
1577
+ isHookActivationReport,
1578
+ hookActivationResult,
1539
1579
  normalizeKeyScope,
1540
1580
  parseAgentQuestion,
1541
1581
  parseAgentQuestions,
@@ -1558,6 +1598,7 @@ export {
1558
1598
  DECISION_LINE_MAX,
1559
1599
  redactSecrets,
1560
1600
  redactSecretsDeep,
1601
+ isAnswerSource,
1561
1602
  buildDecisionEpisodeFeatures,
1562
1603
  resolveAutoResolveOrigin,
1563
1604
  resolvePolicy,
@@ -1,9 +1,25 @@
1
+ import {
2
+ detectProviderLiveCapabilities,
3
+ hasSpawnProvider,
4
+ resolveControlPolicy
5
+ } from "./chunk-HKQ6CD32.js";
6
+ import {
7
+ daemonHasRemoteProof,
8
+ daemonServiceManagerAvailable,
9
+ hasDaemonServiceDefinition,
10
+ readDaemonNeedsLogin,
11
+ readDaemonStatus
12
+ } from "./chunk-7N3D4GN7.js";
1
13
  import {
2
14
  getMachineId
3
- } from "./chunk-N4VNLISN.js";
15
+ } from "./chunk-C7BFOC35.js";
4
16
  import {
5
17
  getPackageVersion
6
18
  } from "./chunk-DINDL2CF.js";
19
+ import {
20
+ readControlMode,
21
+ readKeySource
22
+ } from "./chunk-6MRPTYYH.js";
7
23
  import {
8
24
  getBaseUrl
9
25
  } from "./chunk-2UMNXADU.js";
@@ -50,7 +66,7 @@ var parseMachine = (value) => {
50
66
  online: raw.online === true
51
67
  };
52
68
  };
53
- var machineReadiness = (machines, machineId, expectedCapabilities) => {
69
+ var machineReadiness = (machines, machineId, expectedCapabilities, now = Date.now()) => {
54
70
  const machine = machines.find((item) => item.machineId === machineId);
55
71
  if (!machine) return { kind: "not-ready", detail: "this machine has not heartbeated to the server" };
56
72
  if (!machine.online) return { kind: "not-ready", detail: "the server reports this machine offline" };
@@ -60,12 +76,15 @@ var machineReadiness = (machines, machineId, expectedCapabilities) => {
60
76
  if (machine.lastControlAt === null || !Number.isFinite(Date.parse(machine.lastControlAt))) {
61
77
  return { kind: "not-ready", detail: "the server has not observed this machine polling the control queue" };
62
78
  }
79
+ if (!daemonHasRemoteProof({ kind: "running", lastSuccessfulHeartbeatAt: machine.lastSeenAt, lastSuccessfulControlAt: machine.lastControlAt }, now)) {
80
+ return { kind: "not-ready", detail: "the heartbeat or control-queue proof is stale; wake this machine and retry pushary doctor" };
81
+ }
63
82
  const missing = expectedCapabilities.filter((capability) => !machine.capabilities.includes(capability));
64
83
  return missing.length === 0 ? { kind: "ready", machine } : { kind: "not-ready", detail: `the server is missing capabilities: ${missing.join(", ")}` };
65
84
  };
66
85
  var readMachineReadiness = async (apiKey, expectedCapabilities, deps = {}) => {
67
86
  const listed = await listMachines(apiKey, deps);
68
- return listed.kind === "ok" ? machineReadiness(listed.machines, deps.machineId ?? getMachineId(), expectedCapabilities) : listed.kind === "unsupported" ? { kind: "unsupported", detail: "the server does not report machine readiness yet" } : listed;
87
+ return listed.kind === "ok" ? machineReadiness(listed.machines, deps.machineId ?? getMachineId(), expectedCapabilities, deps.now?.()) : listed.kind === "unsupported" ? { kind: "unsupported", detail: "the server does not report machine readiness yet" } : listed;
69
88
  };
70
89
  var waitForMachineReadiness = async (apiKey, expectedCapabilities, deps = {}) => {
71
90
  const attempts = deps.attempts ?? 21;
@@ -106,6 +125,29 @@ var describeLastSeen = (iso, now = Date.now()) => {
106
125
  if (hours < 48) return `${hours}h ago`;
107
126
  return `${Math.round(hours / 24)}d ago`;
108
127
  };
128
+ var readManagedControlEvidence = (apiKey, providers, serverProof) => {
129
+ const now = Date.now();
130
+ const daemon = readDaemonStatus();
131
+ const capabilities = detectProviderLiveCapabilities(providers);
132
+ const providerAvailable = hasSpawnProvider(capabilities);
133
+ const managerAvailable = daemonServiceManagerAvailable();
134
+ const serviceInstalled = hasDaemonServiceDefinition();
135
+ const keyCurrent = Boolean(apiKey) && readKeySource().key === apiKey && readDaemonNeedsLogin().kind !== "blocked";
136
+ const policy = resolveControlPolicy({ mode: readControlMode(), providerAvailable, managerAvailable, servicePresent: serviceInstalled || daemon.kind !== "absent" });
137
+ const localProof = daemonHasRemoteProof(daemon, now);
138
+ const remote = serverProof?.kind === "ready" ? machineReadiness([serverProof.machine], daemon.machineId ?? "", ["spawn", ...capabilities], now) : serverProof;
139
+ return {
140
+ ready: keyCurrent && policy === "enabled" && providerAvailable && managerAvailable && serviceInstalled && localProof && remote?.kind === "ready",
141
+ keyCurrent,
142
+ providerAvailable,
143
+ managerAvailable,
144
+ serviceInstalled,
145
+ policy,
146
+ localProof,
147
+ serverProof: remote?.kind ?? "unchecked",
148
+ checkedAt: new Date(now).toISOString()
149
+ };
150
+ };
109
151
 
110
152
  export {
111
153
  HEARTBEAT_INTERVAL_MS,
@@ -113,5 +155,6 @@ export {
113
155
  readMachineReadiness,
114
156
  waitForMachineReadiness,
115
157
  listMachines,
116
- describeLastSeen
158
+ describeLastSeen,
159
+ readManagedControlEvidence
117
160
  };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  writeJsonAtomicDurable
3
- } from "./chunk-KAVDAZ7A.js";
3
+ } from "./chunk-KAWLZTRJ.js";
4
4
 
5
5
  // src/transcript-recipient-pin.ts
6
6
  import { existsSync, mkdirSync, readFileSync, rmSync } from "fs";
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  detectClaudeVersion
3
- } from "./chunk-6AEM5RCS.js";
3
+ } from "./chunk-OIZVYUED.js";
4
4
  import {
5
5
  addClaudeMcpServer,
6
6
  addPusharyHooks,
7
7
  addPusharyToolPermissions
8
- } from "./chunk-HGUZOUB2.js";
8
+ } from "./chunk-HHODMHTH.js";
9
9
  import {
10
10
  claudeWired,
11
11
  codexWired,
12
12
  geminiWired
13
- } from "./chunk-HBHEX3JQ.js";
13
+ } from "./chunk-A2M6FGUF.js";
14
14
  import {
15
15
  CLAUDE_HOOK_EVENTS,
16
16
  GEMINI_HOOK_BINARY,
@@ -21,7 +21,7 @@ import {
21
21
  needsReregistration,
22
22
  registrationSignatures,
23
23
  supportedClaudeEvents
24
- } from "./chunk-2D7BAOMY.js";
24
+ } from "./chunk-CDBTCEKE.js";
25
25
  import {
26
26
  guardBinary
27
27
  } from "./chunk-3AJIK5AO.js";
@@ -40,14 +40,14 @@ import {
40
40
  codexHooksJson,
41
41
  hasCodexHooks,
42
42
  vscodePluginMcp
43
- } from "./chunk-OW6AZDY2.js";
43
+ } from "./chunk-FBO5WS3D.js";
44
44
  import {
45
45
  readJsonSafe,
46
46
  writeJsonAtomic
47
- } from "./chunk-KAVDAZ7A.js";
47
+ } from "./chunk-KAWLZTRJ.js";
48
48
  import {
49
49
  HOOK_LOCATOR_BINARY
50
- } from "./chunk-WDKHZRAS.js";
50
+ } from "./chunk-VZADMT7R.js";
51
51
 
52
52
  // src/reapply.ts
53
53
  import { join } from "path";
@@ -3,19 +3,19 @@ import {
3
3
  loadPin,
4
4
  savePin,
5
5
  verifyRecipients
6
- } from "./chunk-BMANRGJQ.js";
6
+ } from "./chunk-WZ63WTAZ.js";
7
7
  import {
8
8
  hookOwnerOf
9
- } from "./chunk-VOSGZ6PH.js";
9
+ } from "./chunk-BS5XR4J7.js";
10
10
  import {
11
11
  ensureDaemonRunning
12
- } from "./chunk-XLOELLAS.js";
12
+ } from "./chunk-7N3D4GN7.js";
13
13
  import {
14
14
  buildTranscriptRecords,
15
15
  decodePublicKey,
16
16
  generateSessionKey,
17
17
  wrapSessionKey
18
- } from "./chunk-4PX4QK2Z.js";
18
+ } from "./chunk-DH4INZW3.js";
19
19
  import {
20
20
  fetchTranscriptRecipients,
21
21
  uploadTranscriptRecords
@@ -23,17 +23,17 @@ import {
23
23
  import {
24
24
  transcriptEnvironmentPreference,
25
25
  transcriptsEnabled
26
- } from "./chunk-OI3DJA7N.js";
26
+ } from "./chunk-JZSWA3VT.js";
27
27
  import {
28
28
  codexHome,
29
29
  pusharyDir
30
- } from "./chunk-OW6AZDY2.js";
30
+ } from "./chunk-FBO5WS3D.js";
31
31
  import {
32
32
  readTranscriptPreference
33
- } from "./chunk-S5CMLR35.js";
33
+ } from "./chunk-6MRPTYYH.js";
34
34
  import {
35
35
  writeJsonAtomic
36
- } from "./chunk-KAVDAZ7A.js";
36
+ } from "./chunk-KAWLZTRJ.js";
37
37
  import {
38
38
  getApiKey,
39
39
  getBaseUrl
@@ -24,20 +24,20 @@ import {
24
24
  summarizeStop,
25
25
  taskTitleFrom,
26
26
  toolResultErrorText
27
- } from "./chunk-BDI2MXTT.js";
27
+ } from "./chunk-HBBQO77U.js";
28
28
  import {
29
29
  NOTIFICATION_PUSH_TYPES,
30
30
  POSTTOOLUSE_MIRROR_ONLY_TOOLS
31
- } from "./chunk-IVQMNLSA.js";
31
+ } from "./chunk-32WWVRXN.js";
32
32
  import {
33
33
  getMachineId
34
- } from "./chunk-N4VNLISN.js";
34
+ } from "./chunk-C7BFOC35.js";
35
35
  import {
36
36
  withRetry
37
37
  } from "./chunk-EYRGBYZG.js";
38
38
  import {
39
39
  reportedInstallSource
40
- } from "./chunk-KAVDAZ7A.js";
40
+ } from "./chunk-KAWLZTRJ.js";
41
41
  import {
42
42
  getApiKey,
43
43
  getBaseUrl
@@ -54,7 +54,7 @@ import {
54
54
  pendingCommandEvents,
55
55
  resolveAutoResolveOrigin,
56
56
  resolvePolicy
57
- } from "./chunk-WDKHZRAS.js";
57
+ } from "./chunk-VZADMT7R.js";
58
58
 
59
59
  // src/policy.ts
60
60
  import { createHash } from "crypto";
@@ -1004,6 +1004,7 @@ var settleQuestionsForToolUse = async (sessionId, toolUseId) => {
1004
1004
  for (const answer of late) removePendingQuestion(sessionId, answer.correlationId);
1005
1005
  };
1006
1006
  var handlePostToolUse = async (input, agent = CLAUDE_CODE_AGENT) => {
1007
+ const occurredAt = (/* @__PURE__ */ new Date()).toISOString();
1007
1008
  const deadline = Date.now() + HOOK_BUDGET_MS;
1008
1009
  const signal = AbortSignal.timeout(HOOK_BUDGET_MS);
1009
1010
  try {
@@ -1028,6 +1029,8 @@ var handlePostToolUse = async (input, agent = CLAUDE_CODE_AGENT) => {
1028
1029
  const beacon = !isMirrorOnly && decisionSource === "policy_auto" && throttlePass(`autodecision:${sessionKey}:${lookup.tool}`, AUTO_DECISION_WINDOW_MS) ? deriveAutoDecisionBeacon(lookup.tool, lookup.input, liveMode, agent.type, input.cwd, input.session_id) : void 0;
1029
1030
  const toolReport = reportEvent({
1030
1031
  event: isError ? "tool_error" : "tool_complete",
1032
+ occurredAt,
1033
+ toolUseId: input.tool_use_id,
1031
1034
  agentType: agent.type,
1032
1035
  agentName: `${agent.label} - ${projectName}`,
1033
1036
  action,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  describeKeyCheck,
3
3
  keyCheckFromResponse
4
- } from "./chunk-I6GZX3FT.js";
4
+ } from "./chunk-6II5RBAS.js";
5
5
  import {
6
6
  createIo
7
7
  } from "./chunk-5RUIFDTP.js";
@@ -34,6 +34,8 @@ interface AgentIdentity {
34
34
  readonly label: string;
35
35
  }
36
36
  interface AgentEvent {
37
+ occurredAt?: string;
38
+ toolUseId?: string;
37
39
  event: string;
38
40
  agentType: string;
39
41
  agentName?: string;
@@ -147,6 +149,7 @@ interface AskUserParams {
147
149
  machineId?: string;
148
150
  toolName?: string;
149
151
  toolTarget?: string;
152
+ toolPath?: string;
150
153
  repoKey?: string;
151
154
  intent?: string;
152
155
  action?: string;
package/dist/src/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  handlePreToolUse
3
- } from "../chunk-67YNQ3QA.js";
4
- import "../chunk-D62EONG3.js";
5
- import "../chunk-UCS65VVR.js";
3
+ } from "../chunk-FHIVWF4B.js";
4
+ import "../chunk-SRFA5BOO.js";
5
+ import "../chunk-32WFHA77.js";
6
6
  import "../chunk-YHG74UFF.js";
7
7
  import {
8
8
  fetchAccountPublicKey
@@ -15,28 +15,28 @@ import {
15
15
  handlePostToolUse,
16
16
  handleStop,
17
17
  reportEvent
18
- } from "../chunk-HCMM3BOW.js";
18
+ } from "../chunk-ZJ6QXXBC.js";
19
19
  import {
20
20
  askUser,
21
21
  cancelQuestion,
22
22
  waitForAnswer
23
23
  } from "../chunk-XS33QBJA.js";
24
- import "../chunk-BDI2MXTT.js";
25
- import "../chunk-IVQMNLSA.js";
26
- import "../chunk-N4VNLISN.js";
27
- import "../chunk-OW6AZDY2.js";
24
+ import "../chunk-HBBQO77U.js";
25
+ import "../chunk-32WWVRXN.js";
26
+ import "../chunk-C7BFOC35.js";
27
+ import "../chunk-FBO5WS3D.js";
28
28
  import "../chunk-EYRGBYZG.js";
29
29
  import "../chunk-SAF6HGAA.js";
30
30
  import "../chunk-7QLSKOSU.js";
31
31
  import "../chunk-KZERVKTD.js";
32
- import "../chunk-KAVDAZ7A.js";
32
+ import "../chunk-KAWLZTRJ.js";
33
33
  import {
34
34
  getApiKey,
35
35
  getBaseUrl
36
36
  } from "../chunk-2UMNXADU.js";
37
37
  import {
38
38
  resolvePolicy
39
- } from "../chunk-WDKHZRAS.js";
39
+ } from "../chunk-VZADMT7R.js";
40
40
  export {
41
41
  askUser,
42
42
  cancelQuestion,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushary/agent-hooks",
3
- "version": "0.95.5",
3
+ "version": "0.95.6",
4
4
  "description": "Permission hooks for AI coding agents: route tool approvals through Pushary push notifications",
5
5
  "keywords": [
6
6
  "pushary",