@pushary/agent-hooks 0.99.0 → 1.1.0

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 (84) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/data/SKILL.md +250 -49
  3. package/data/cursor-plugin/scripts/pushary-gate.mjs +24 -0
  4. package/data/cursor-plugin/skills/pushary/SKILL.md +250 -49
  5. package/data/vscode-plugin/scripts/pushary-gate.mjs +24 -0
  6. package/data/vscode-plugin/skills/pushary/SKILL.md +250 -49
  7. package/dist/bin/pushary-bell-hook.js +18 -18
  8. package/dist/bin/pushary-bell.js +6 -6
  9. package/dist/bin/pushary-claude.js +22 -24
  10. package/dist/bin/pushary-clean.js +60 -18
  11. package/dist/bin/pushary-codex-bridge.js +10 -10
  12. package/dist/bin/pushary-codex-hook.js +33 -35
  13. package/dist/bin/pushary-codex.js +6 -7
  14. package/dist/bin/pushary-connect.js +6 -6
  15. package/dist/bin/pushary-cowork.js +3 -3
  16. package/dist/bin/pushary-daemon.js +22 -22
  17. package/dist/bin/pushary-disconnect.js +48 -7
  18. package/dist/bin/pushary-doctor.js +88 -19
  19. package/dist/bin/pushary-elicitation-hook.js +17 -17
  20. package/dist/bin/pushary-gemini-bridge.js +9 -9
  21. package/dist/bin/pushary-gemini-hook.js +25 -27
  22. package/dist/bin/pushary-hook.js +61 -33
  23. package/dist/bin/pushary-login.js +7 -7
  24. package/dist/bin/pushary-logout.js +4 -4
  25. package/dist/bin/pushary-mode.js +3 -3
  26. package/dist/bin/pushary-notification-hook.js +26 -21
  27. package/dist/bin/pushary-opencode-hook.js +27 -29
  28. package/dist/bin/pushary-permission-denied-hook.js +24 -23
  29. package/dist/bin/pushary-permission-hook.js +32 -24
  30. package/dist/bin/pushary-post-hook.js +30 -22
  31. package/dist/bin/pushary-prompt-hook.js +26 -21
  32. package/dist/bin/pushary-session-end-hook.js +26 -21
  33. package/dist/bin/pushary-session-start-hook.js +30 -25
  34. package/dist/bin/pushary-setup.js +145 -37
  35. package/dist/bin/pushary-stats.js +2 -2
  36. package/dist/bin/pushary-status.js +10 -10
  37. package/dist/bin/pushary-stop-hook.js +27 -22
  38. package/dist/bin/pushary-stopfailure-hook.js +26 -21
  39. package/dist/bin/pushary-transcript-register.js +16 -16
  40. package/dist/bin/pushary-transcripts.js +4 -4
  41. package/dist/bin/pushary-upgrade.js +14 -14
  42. package/dist/bin/pushary-wait.js +3 -3
  43. package/dist/{chunk-ID5FDKDZ.js → chunk-2MOQUNFL.js} +1 -1
  44. package/dist/{chunk-CRFLU455.js → chunk-6JUCFMSF.js} +3 -3
  45. package/dist/{chunk-QS55LDX4.js → chunk-6T4OINZB.js} +16 -16
  46. package/dist/{chunk-6C6MS57P.js → chunk-76ZCJZBK.js} +1 -1
  47. package/dist/{chunk-JXELRCU5.js → chunk-AH5OO2YZ.js} +3 -3
  48. package/dist/{chunk-XPPXOKIG.js → chunk-BBUZD7MU.js} +1 -1
  49. package/dist/{chunk-T3JZZUAR.js → chunk-DKTFZCLQ.js} +30 -29
  50. package/dist/{chunk-RALVI7OF.js → chunk-DZYIAMKR.js} +9 -6
  51. package/dist/{chunk-GCD3SQSV.js → chunk-E3WQMDCE.js} +1 -1
  52. package/dist/{chunk-JBJBVERL.js → chunk-EWQZISYV.js} +1 -1
  53. package/dist/{chunk-LWKPMSBB.js → chunk-EZ3GX3NS.js} +5 -5
  54. package/dist/{chunk-5KLAETSU.js → chunk-FO4HHPMO.js} +1 -1
  55. package/dist/{chunk-6KLCP7VF.js → chunk-IH7YUPFN.js} +3 -3
  56. package/dist/{chunk-OPR2BPD4.js → chunk-INBTKFT6.js} +1 -1
  57. package/dist/{chunk-K4XFCEVI.js → chunk-IPDBFJ2M.js} +1 -1
  58. package/dist/{chunk-6IFUXNFX.js → chunk-ISELLVBP.js} +1 -1
  59. package/dist/{chunk-562UJ2DA.js → chunk-J7PJALS2.js} +1 -1
  60. package/dist/{chunk-O3LZQEQP.js → chunk-LQ3BHPPZ.js} +1 -1
  61. package/dist/{chunk-3RVCQDC4.js → chunk-LUYYB6V2.js} +1 -1
  62. package/dist/{chunk-V262ATS5.js → chunk-MR2PWE62.js} +17 -3
  63. package/dist/{chunk-WGV3VY7O.js → chunk-MZUXTN7X.js} +2 -2
  64. package/dist/{chunk-LBNAGGLV.js → chunk-OYYQHJAO.js} +3 -2
  65. package/dist/{chunk-4C4XFAGJ.js → chunk-PHJOSAXW.js} +2 -2
  66. package/dist/{chunk-SI7GYBQP.js → chunk-PQG6NTPT.js} +1 -1
  67. package/dist/{chunk-3ZAEUPM4.js → chunk-PUDQJ772.js} +1 -1
  68. package/dist/{chunk-NSFNEDCT.js → chunk-PWIMJP4U.js} +6 -6
  69. package/dist/{chunk-JL33EDN7.js → chunk-QACXZYDA.js} +4 -4
  70. package/dist/{chunk-CP34FI4B.js → chunk-RZTH4MIY.js} +2 -2
  71. package/dist/{chunk-HB2KB7QL.js → chunk-S2BNTXP6.js} +1 -1
  72. package/dist/{chunk-EXHXR2X5.js → chunk-SA6UB3GD.js} +1 -1
  73. package/dist/{chunk-IRLTW6KF.js → chunk-SLEWDZOA.js} +1 -1
  74. package/dist/chunk-SM54HHVY.js +224 -0
  75. package/dist/{chunk-4PBCNVI3.js → chunk-UP7NZXJU.js} +1 -1
  76. package/dist/{chunk-XOOWC62T.js → chunk-VACFOGF3.js} +1 -1
  77. package/dist/{chunk-OUAE3GKO.js → chunk-VQYARC2K.js} +279 -1
  78. package/dist/{chunk-64WARXGV.js → chunk-WTT24AUA.js} +698 -43
  79. package/dist/{chunk-K6BASBQJ.js → chunk-XIHKSZHL.js} +1 -1
  80. package/dist/{chunk-PD6JY33P.js → chunk-YM4G6CFN.js} +4 -3
  81. package/dist/{reapply-HQ264ZTR.js → reapply-STSGYPF2.js} +8 -8
  82. package/dist/src/index.js +12 -10
  83. package/package.json +1 -1
  84. package/dist/chunk-A76GNRIK.js +0 -608
@@ -5,11 +5,11 @@ import {
5
5
  import {
6
6
  coworkOutput,
7
7
  coworkSelection
8
- } from "../chunk-CP34FI4B.js";
8
+ } from "../chunk-RZTH4MIY.js";
9
9
  import "../chunk-PUZZELE6.js";
10
10
  import {
11
11
  detectClaudeVersion
12
- } from "../chunk-K4XFCEVI.js";
12
+ } from "../chunk-IPDBFJ2M.js";
13
13
  import {
14
14
  describeVersionManagerPin,
15
15
  versionManagerOf
@@ -17,7 +17,7 @@ import {
17
17
  import {
18
18
  readManagedControlEvidence,
19
19
  waitForMachineReadiness
20
- } from "../chunk-JL33EDN7.js";
20
+ } from "../chunk-QACXZYDA.js";
21
21
  import {
22
22
  HERMES_CONFIG_SCRIPT,
23
23
  HERMES_PIP_PACKAGE,
@@ -25,7 +25,7 @@ import {
25
25
  isHermesConfigReceipt,
26
26
  resolveHermesPython,
27
27
  runHermesPythonScript
28
- } from "../chunk-3ZAEUPM4.js";
28
+ } from "../chunk-PUDQJ772.js";
29
29
  import {
30
30
  describeDetection,
31
31
  detectAllAgents,
@@ -37,7 +37,7 @@ import {
37
37
  shortenHome,
38
38
  vscodeSettingsTargets,
39
39
  writeInstructionBlock
40
- } from "../chunk-V262ATS5.js";
40
+ } from "../chunk-MR2PWE62.js";
41
41
  import {
42
42
  OPENCODE_HOOK_BINARY,
43
43
  addOpenCodeMcpServer,
@@ -48,7 +48,18 @@ import {
48
48
  openCodePluginDir,
49
49
  openCodePluginFile,
50
50
  openCodeWired
51
- } from "../chunk-HB2KB7QL.js";
51
+ } from "../chunk-S2BNTXP6.js";
52
+ import {
53
+ addCompatibleHooks,
54
+ addCompatibleMcpServer,
55
+ addCompatibleToolPermissions,
56
+ compatibleConfigFile,
57
+ compatibleHookEvents,
58
+ compatibleInstructionsFile,
59
+ compatibleMcpFile,
60
+ compatiblePermissionRuleFile,
61
+ hasCompatibleHooks
62
+ } from "../chunk-SM54HHVY.js";
52
63
  import {
53
64
  addClaudeMcpServer,
54
65
  addPusharyHooks,
@@ -56,12 +67,12 @@ import {
56
67
  captureClaudeMcpServer,
57
68
  isClaudeMcpSnapshot,
58
69
  updateClaudeMcpSnapshot
59
- } from "../chunk-QS55LDX4.js";
70
+ } from "../chunk-6T4OINZB.js";
60
71
  import {
61
72
  detectProviderLiveCapabilities,
62
73
  hasSpawnProvider,
63
74
  resolveControlPolicy
64
- } from "../chunk-WGV3VY7O.js";
75
+ } from "../chunk-MZUXTN7X.js";
65
76
  import {
66
77
  KEEP_HINT,
67
78
  captureHookTakeover,
@@ -71,23 +82,23 @@ import {
71
82
  hookOwnerOf,
72
83
  mcpBearerKey,
73
84
  planHooks
74
- } from "../chunk-RALVI7OF.js";
85
+ } from "../chunk-DZYIAMKR.js";
75
86
  import {
76
87
  AGENT_CHOICES,
77
88
  effectiveControlMode,
78
89
  effectiveVerify,
79
90
  parseSetupOptions
80
- } from "../chunk-LBNAGGLV.js";
91
+ } from "../chunk-OYYQHJAO.js";
81
92
  import {
82
93
  liveBridgeProbe,
83
94
  resolveBridgeStub
84
- } from "../chunk-IRLTW6KF.js";
95
+ } from "../chunk-SLEWDZOA.js";
85
96
  import {
86
97
  claudeWired,
87
98
  codexWired,
88
99
  geminiWired,
89
100
  pusharyHookExecutable
90
- } from "../chunk-JXELRCU5.js";
101
+ } from "../chunk-AH5OO2YZ.js";
91
102
  import {
92
103
  clearDaemonNeedsLogin,
93
104
  daemonHasRemoteProof,
@@ -100,26 +111,25 @@ import {
100
111
  replaceDaemonService,
101
112
  stopDaemonService,
102
113
  waitForDaemonRemoteProof
103
- } from "../chunk-CRFLU455.js";
114
+ } from "../chunk-6JUCFMSF.js";
104
115
  import {
105
116
  GEMINI_HOOK_BINARY,
106
117
  addGeminiHooks,
107
118
  addGeminiMcpServer,
108
119
  compareVersion,
109
120
  parseVersion
110
- } from "../chunk-PD6JY33P.js";
111
- import "../chunk-EXHXR2X5.js";
121
+ } from "../chunk-YM4G6CFN.js";
122
+ import "../chunk-SA6UB3GD.js";
112
123
  import {
113
124
  transcriptPreferenceForSetup
114
- } from "../chunk-ID5FDKDZ.js";
125
+ } from "../chunk-2MOQUNFL.js";
115
126
  import "../chunk-XHKBHWLX.js";
116
127
  import {
117
128
  reportEvent
118
- } from "../chunk-64WARXGV.js";
119
- import "../chunk-A76GNRIK.js";
120
- import "../chunk-OPR2BPD4.js";
129
+ } from "../chunk-WTT24AUA.js";
130
+ import "../chunk-INBTKFT6.js";
121
131
  import "../chunk-LGXUGYUH.js";
122
- import "../chunk-562UJ2DA.js";
132
+ import "../chunk-J7PJALS2.js";
123
133
  import {
124
134
  addCodexHookTrust,
125
135
  addCodexHooks,
@@ -157,7 +167,7 @@ import {
157
167
  resolveGlobalBinary,
158
168
  vscodePluginDir,
159
169
  vscodePluginMcp
160
- } from "../chunk-JBJBVERL.js";
170
+ } from "../chunk-EWQZISYV.js";
161
171
  import {
162
172
  confirmAppConnection,
163
173
  connectDevice,
@@ -167,13 +177,13 @@ import {
167
177
  printConnectInstructions,
168
178
  roundTripEvidence,
169
179
  verifyRoundTrip
170
- } from "../chunk-4C4XFAGJ.js";
180
+ } from "../chunk-PHJOSAXW.js";
171
181
  import "../chunk-3EGEA4KH.js";
172
182
  import {
173
183
  checkApiKey,
174
184
  describeKeyCheck,
175
185
  samePusharyAccount
176
- } from "../chunk-3RVCQDC4.js";
186
+ } from "../chunk-LUYYB6V2.js";
177
187
  import {
178
188
  setHumanStream
179
189
  } from "../chunk-QCGNGEGE.js";
@@ -198,7 +208,7 @@ import {
198
208
  readKeySource,
199
209
  resolveShellRc,
200
210
  writeKey
201
- } from "../chunk-4PBCNVI3.js";
211
+ } from "../chunk-UP7NZXJU.js";
202
212
  import "../chunk-EYRGBYZG.js";
203
213
  import "../chunk-SAF6HGAA.js";
204
214
  import {
@@ -207,7 +217,7 @@ import {
207
217
  import {
208
218
  EXIT
209
219
  } from "../chunk-KZERVKTD.js";
210
- import "../chunk-GCD3SQSV.js";
220
+ import "../chunk-E3WQMDCE.js";
211
221
  import {
212
222
  backupFile,
213
223
  readJsonSafe,
@@ -216,9 +226,13 @@ import {
216
226
  } from "../chunk-4LL6LG5X.js";
217
227
  import "../chunk-2UMNXADU.js";
218
228
  import {
229
+ HOOK_COMPATIBLE_PROFILES,
219
230
  HOOK_LOCATOR_BINARY,
231
+ PRETOOLUSE_GATED_TOOLS,
232
+ compatibleTargetFiles,
233
+ hookCompatibleProfile,
220
234
  isValidApiKey
221
- } from "../chunk-OUAE3GKO.js";
235
+ } from "../chunk-VQYARC2K.js";
222
236
 
223
237
  // bin/pushary-setup.ts
224
238
  import { existsSync, readFileSync, writeFileSync, mkdirSync, cpSync, rmSync, renameSync, realpathSync, readdirSync, statSync, openSync, readSync, closeSync } from "fs";
@@ -1490,18 +1504,28 @@ var setupOpenCode = async (apiKey) => {
1490
1504
  noteManual("Restart OpenCode to load the plugin.");
1491
1505
  return "configured";
1492
1506
  };
1507
+ var compatibleRecord = (of) => HOOK_COMPATIBLE_PROFILES.reduce(
1508
+ (record, profile) => ({ ...record, [profile.agentType]: of(profile) }),
1509
+ {}
1510
+ );
1493
1511
  var HOOK_FILES = {
1494
1512
  claude_code: () => CLAUDE_SETTINGS,
1495
1513
  codex: () => CODEX_HOOKS_JSON,
1496
1514
  gemini_cli: () => GEMINI_SETTINGS,
1497
1515
  cursor: () => CURSOR_USER_HOOKS,
1498
- vscode: () => join3(VSCODE_PLUGIN_DIR, "hooks", "hooks.json")
1516
+ vscode: () => join3(VSCODE_PLUGIN_DIR, "hooks", "hooks.json"),
1517
+ ...compatibleRecord((profile) => () => compatibleConfigFile(profile))
1499
1518
  };
1500
1519
  var hookOwnerFor = (agent, appAvailable = true) => {
1501
1520
  const file = HOOK_FILES[agent]?.();
1502
1521
  if (!file) return "none";
1503
1522
  const document = readJsonSafe(file);
1504
- return hookOwnerOf(document.kind === "ok" ? document.value : null, appAvailable);
1523
+ const profile = hookCompatibleProfile(agent);
1524
+ return hookOwnerOf(
1525
+ document.kind === "ok" ? document.value : null,
1526
+ appAvailable,
1527
+ profile ? profile.hooksKeyPath : void 0
1528
+ );
1505
1529
  };
1506
1530
  var appMcpKeyFor = (agent) => {
1507
1531
  if (agent === "codex") {
@@ -1571,10 +1595,90 @@ var agentIsWired = (agent) => {
1571
1595
  return existsSync(VSCODE_PLUGIN_MCP);
1572
1596
  case "opencode":
1573
1597
  return openCodeWired();
1574
- default:
1575
- return true;
1598
+ default: {
1599
+ const profile = hookCompatibleProfile(agent);
1600
+ if (!profile) return true;
1601
+ const config = readJson2(compatibleConfigFile(profile));
1602
+ return config !== null && hasCompatibleHooks(config, profile);
1603
+ }
1604
+ }
1605
+ };
1606
+ var compatibleGateSummary = (profile) => {
1607
+ const gated = PRETOOLUSE_GATED_TOOLS.map((canonical) => Object.entries(profile.toolAliases).find(([, target]) => target === canonical)?.[0] ?? canonical);
1608
+ return gated.slice(0, 3).map((name) => bold(name)).join(", ");
1609
+ };
1610
+ var setupCompatibleAgent = (profile) => async (apiKey) => {
1611
+ const configFile = compatibleConfigFile(profile);
1612
+ const mcpFile = compatibleMcpFile(profile);
1613
+ const permissionFile = compatiblePermissionRuleFile(profile);
1614
+ const instructionsFile = compatibleInstructionsFile(profile);
1615
+ console.log(`
1616
+ ${bold(`Setting up ${profile.label}`)}
1617
+ `);
1618
+ if (!isInstalled(profile.binary) && !existsSync(dirname2(configFile))) {
1619
+ console.log(` ${yellow("!")} ${profile.label} not found. Skipping.`);
1620
+ console.log(` ${dim(`Install ${profile.label} and re-run setup to configure.`)}`);
1621
+ return "skipped";
1576
1622
  }
1623
+ await installGlobally2();
1624
+ const documents = /* @__PURE__ */ new Map();
1625
+ const open = (path) => {
1626
+ const existing = documents.get(path);
1627
+ if (existing) return existing;
1628
+ const document = readAgentJson(path);
1629
+ documents.set(path, document);
1630
+ return document;
1631
+ };
1632
+ const declined = [];
1633
+ const record = (path, write) => {
1634
+ if (!write.ok) declined.push(`${shortenHome(path)} \u2192 ${write.conflictAt}`);
1635
+ };
1636
+ const events = compatibleHookEvents(profile).map((hook) => hook.event);
1637
+ await spinner(`Adding hooks (${events.slice(0, 4).join(", ")}${events.length > 4 ? `, +${events.length - 4} more` : ""})`, async () => {
1638
+ record(configFile, addCompatibleHooks(open(configFile), profile, resolveGlobalBinDir("pushary-hook")));
1639
+ });
1640
+ if (mcpFile) {
1641
+ await spinner(`Adding MCP server (${shortenHome(mcpFile)})`, async () => {
1642
+ addCompatibleMcpServer(open(mcpFile), profile, apiKey);
1643
+ });
1644
+ }
1645
+ if (permissionFile) {
1646
+ await spinner("Auto-allowing Pushary MCP tools", async () => {
1647
+ record(permissionFile, addCompatibleToolPermissions(open(permissionFile)));
1648
+ });
1649
+ }
1650
+ if (declined.length > 0) {
1651
+ console.log(`
1652
+ ${yellow("!")} ${profile.label} keeps something unexpected where Pushary writes. Nothing was changed.`);
1653
+ for (const conflict of declined) console.log(` ${dim(`\u2022 ${conflict}`)}`);
1654
+ console.log(` ${dim("Pushary expects a list of hook entries there. Move that key and re-run setup.")}`);
1655
+ return "skipped";
1656
+ }
1657
+ for (const [path, document] of documents) {
1658
+ await spinner(`Writing ${shortenHome(path)}`, async () => {
1659
+ writeJsonAtomic(path, document, KEY_FILE_MODE);
1660
+ });
1661
+ }
1662
+ if (instructionsFile && profile.instructions) {
1663
+ await spinner(`Teaching ${profile.label} to ask via push (${shortenHome(instructionsFile)})`, async () => {
1664
+ writeInstructionBlock(instructionsFile, renderAgentInstructions(profile.instructions.label));
1665
+ });
1666
+ }
1667
+ console.log();
1668
+ console.log(` ${dim("What this configured:")}`);
1669
+ console.log(` ${dim("\u2022")} Hooks: phone approvals, policy enforcement, kill switch, session tracking`);
1670
+ console.log(` ${dim("\u2022")} Gate covers ${compatibleGateSummary(profile)}`);
1671
+ if (mcpFile) console.log(` ${dim("\u2022")} MCP server: ${profile.label} can send notifications and ask questions`);
1672
+ else console.log(` ${dim("\u2022")} ${dim(`No MCP server: ${profile.label} documents no remote-server config shape, so approvals work and agent-initiated questions do not`)}`);
1673
+ if (instructionsFile) console.log(` ${dim("\u2022")} Proactive instructions: ${shortenHome(instructionsFile)}`);
1674
+ console.log(` ${dim(`Restart ${profile.label} to load the new config.`)}`);
1675
+ noteManual(`Restart ${profile.label} to load the new config.`);
1676
+ return "configured";
1577
1677
  };
1678
+ var COMPATIBLE_SETUP = HOOK_COMPATIBLE_PROFILES.reduce((installers, profile) => ({
1679
+ ...installers,
1680
+ [profile.agentType]: setupCompatibleAgent(profile)
1681
+ }), {});
1578
1682
  var AGENT_SETUP = {
1579
1683
  claude_code: setupClaudeCode,
1580
1684
  codex: setupCodex,
@@ -1583,6 +1687,7 @@ var AGENT_SETUP = {
1583
1687
  cursor: setupCursor,
1584
1688
  vscode: setupVsCode,
1585
1689
  opencode: setupOpenCode,
1690
+ ...COMPATIBLE_SETUP,
1586
1691
  custom: setupCustom
1587
1692
  };
1588
1693
  var PROJECT_INSTRUCTION_TARGETS = {
@@ -1686,6 +1791,7 @@ var AGENT_NAMES = {
1686
1791
  cursor: "Cursor",
1687
1792
  vscode: "VS Code",
1688
1793
  opencode: "OpenCode",
1794
+ ...compatibleRecord((profile) => profile.label),
1689
1795
  custom: "Other"
1690
1796
  };
1691
1797
  var AGENT_CAPABILITIES = {
@@ -1696,6 +1802,7 @@ var AGENT_CAPABILITIES = {
1696
1802
  cursor: "plugin + permission gate",
1697
1803
  vscode: "agent plugin + permission gate",
1698
1804
  opencode: "generated plugin + permission gate",
1805
+ ...compatibleRecord((profile) => profile.mcp ? "MCP + native hooks" : "native hooks"),
1699
1806
  custom: "any MCP or HTTP agent (Windsurf, n8n, custom)"
1700
1807
  };
1701
1808
  var NAME_COLUMN = Math.max(...Object.values(AGENT_NAMES).map((name) => name.length)) + 2;
@@ -1766,6 +1873,7 @@ var AGENT_TARGETS = {
1766
1873
  openCodeConfigFile(),
1767
1874
  OPENCODE_INSTRUCTIONS()
1768
1875
  ],
1876
+ ...compatibleRecord((profile) => compatibleTargetFiles(profile).map((file) => join3(homedir(), ...file))),
1769
1877
  custom: ["nothing (prints connection details only)"]
1770
1878
  };
1771
1879
  var reportDryRun = (apiKey, agents, keyCheck, controlMode) => {
@@ -1792,10 +1900,10 @@ var reportDryRun = (apiKey, agents, keyCheck, controlMode) => {
1792
1900
  if (agents.length === 0) {
1793
1901
  console.log(` ${dim("Agents:")} ${dim("none")}`);
1794
1902
  } else {
1795
- console.log(` ${dim("Agents:")} ${agents.map((a) => a.replace("_", " ")).join(", ")}`);
1903
+ console.log(` ${dim("Agents:")} ${agents.map((agent) => AGENT_NAMES[agent]).join(", ")}`);
1796
1904
  for (const agent of agents) {
1797
1905
  console.log();
1798
- console.log(` ${bold(agent.replace("_", " "))}`);
1906
+ console.log(` ${bold(AGENT_NAMES[agent])}`);
1799
1907
  for (const target of AGENT_TARGETS[agent]) console.log(` ${dim("would write")} ${target}`);
1800
1908
  }
1801
1909
  }
@@ -2045,7 +2153,7 @@ var main = async () => {
2045
2153
  if (keepAppWiring) {
2046
2154
  if (!await appAccountMatches(agent)) {
2047
2155
  hookOwners.push({ agent, owner: "app", kept: true });
2048
- failed.push(agent.replace("_", " "));
2156
+ failed.push(AGENT_NAMES[agent]);
2049
2157
  console.log(`
2050
2158
  ${yellow("!")} ${AGENT_NAMES[agent]}: Mac app hooks kept, but their Pushary account could not be matched to this setup.`);
2051
2159
  console.log(` ${dim("Sign the Mac app into the same account and repair this agent, then re-run setup.")}`);
@@ -2066,13 +2174,13 @@ var main = async () => {
2066
2174
  completed.push(agent);
2067
2175
  hookOwners.push({ agent, owner: hookOwnerFor(agent, appBridgeAvailable), kept: false });
2068
2176
  } else {
2069
- failed.push(agent.replace("_", " "));
2070
- console.log(` ${yellow("!")} ${agent.replace("_", " ")} reported success but its config is not there.`);
2177
+ failed.push(AGENT_NAMES[agent]);
2178
+ console.log(` ${yellow("!")} ${AGENT_NAMES[agent]} reported success but its config is not there.`);
2071
2179
  console.log(` ${dim("Re-run setup, then")} ${cyan("npx @pushary/agent-hooks@latest doctor")} ${dim("to see what is missing.")}`);
2072
2180
  }
2073
2181
  } catch (err) {
2074
- failed.push(agent.replace("_", " "));
2075
- console.log(` ${yellow("!")} ${agent.replace("_", " ")} setup failed: ${formatError(err)}`);
2182
+ failed.push(AGENT_NAMES[agent]);
2183
+ console.log(` ${yellow("!")} ${AGENT_NAMES[agent]} setup failed: ${formatError(err)}`);
2076
2184
  console.log(` ${dim("Other agents will continue. Re-run setup to retry.")}`);
2077
2185
  }
2078
2186
  }
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  readLedgerSummary
4
- } from "../chunk-XOOWC62T.js";
4
+ } from "../chunk-VACFOGF3.js";
5
5
  import {
6
6
  exitOnHelpFlag
7
7
  } from "../chunk-GOQHN2UH.js";
@@ -11,7 +11,7 @@ import "../chunk-KZERVKTD.js";
11
11
  import {
12
12
  getApiKey
13
13
  } from "../chunk-2UMNXADU.js";
14
- import "../chunk-OUAE3GKO.js";
14
+ import "../chunk-VQYARC2K.js";
15
15
 
16
16
  // bin/pushary-stats.ts
17
17
  exitOnHelpFlag("stats");
@@ -2,22 +2,22 @@
2
2
  import {
3
3
  describeLastSeen,
4
4
  listMachines
5
- } from "../chunk-JL33EDN7.js";
6
- import "../chunk-WGV3VY7O.js";
7
- import "../chunk-CRFLU455.js";
5
+ } from "../chunk-QACXZYDA.js";
6
+ import "../chunk-MZUXTN7X.js";
7
+ import "../chunk-6JUCFMSF.js";
8
8
  import "../chunk-XHKBHWLX.js";
9
- import "../chunk-562UJ2DA.js";
10
- import "../chunk-JBJBVERL.js";
9
+ import "../chunk-J7PJALS2.js";
10
+ import "../chunk-EWQZISYV.js";
11
11
  import {
12
12
  describeReach,
13
13
  fetchChannels,
14
14
  reachVerdict
15
- } from "../chunk-4C4XFAGJ.js";
15
+ } from "../chunk-PHJOSAXW.js";
16
16
  import "../chunk-3EGEA4KH.js";
17
17
  import {
18
18
  checkApiKey,
19
19
  describeKeyCheck
20
- } from "../chunk-3RVCQDC4.js";
20
+ } from "../chunk-LUYYB6V2.js";
21
21
  import "../chunk-QCGNGEGE.js";
22
22
  import {
23
23
  createIo
@@ -32,7 +32,7 @@ import {
32
32
  import "../chunk-DINDL2CF.js";
33
33
  import {
34
34
  readKeySource
35
- } from "../chunk-4PBCNVI3.js";
35
+ } from "../chunk-UP7NZXJU.js";
36
36
  import "../chunk-EYRGBYZG.js";
37
37
  import "../chunk-SAF6HGAA.js";
38
38
  import {
@@ -41,10 +41,10 @@ import {
41
41
  import {
42
42
  EXIT
43
43
  } from "../chunk-KZERVKTD.js";
44
- import "../chunk-GCD3SQSV.js";
44
+ import "../chunk-E3WQMDCE.js";
45
45
  import "../chunk-4LL6LG5X.js";
46
46
  import "../chunk-2UMNXADU.js";
47
- import "../chunk-OUAE3GKO.js";
47
+ import "../chunk-VQYARC2K.js";
48
48
 
49
49
  // src/status.ts
50
50
  var keySourceLine = (source) => {
@@ -1,52 +1,57 @@
1
1
  #!/usr/bin/env node
2
+ import {
3
+ activeHookSource,
4
+ activeIdentity
5
+ } from "../chunk-SM54HHVY.js";
6
+ import "../chunk-6T4OINZB.js";
2
7
  import {
3
8
  readHookInput
4
- } from "../chunk-O3LZQEQP.js";
5
- import "../chunk-NSFNEDCT.js";
9
+ } from "../chunk-LQ3BHPPZ.js";
10
+ import "../chunk-PWIMJP4U.js";
6
11
  import "../chunk-YKLCWWEI.js";
7
- import "../chunk-RALVI7OF.js";
8
- import "../chunk-LBNAGGLV.js";
9
- import "../chunk-IRLTW6KF.js";
10
- import "../chunk-JXELRCU5.js";
11
- import "../chunk-CRFLU455.js";
12
- import "../chunk-PD6JY33P.js";
13
- import "../chunk-EXHXR2X5.js";
14
- import "../chunk-XPPXOKIG.js";
12
+ import "../chunk-DZYIAMKR.js";
13
+ import "../chunk-OYYQHJAO.js";
14
+ import "../chunk-SLEWDZOA.js";
15
+ import "../chunk-AH5OO2YZ.js";
16
+ import "../chunk-6JUCFMSF.js";
17
+ import "../chunk-YM4G6CFN.js";
18
+ import "../chunk-SA6UB3GD.js";
19
+ import "../chunk-BBUZD7MU.js";
15
20
  import "../chunk-EQRS3SGM.js";
16
- import "../chunk-ID5FDKDZ.js";
21
+ import "../chunk-2MOQUNFL.js";
17
22
  import "../chunk-XHKBHWLX.js";
18
23
  import {
19
24
  handleStop,
20
25
  handleSubagentStop,
21
26
  isSubagentStop
22
- } from "../chunk-64WARXGV.js";
23
- import "../chunk-A76GNRIK.js";
24
- import "../chunk-OPR2BPD4.js";
27
+ } from "../chunk-WTT24AUA.js";
28
+ import "../chunk-INBTKFT6.js";
25
29
  import "../chunk-LGXUGYUH.js";
26
- import "../chunk-562UJ2DA.js";
27
- import "../chunk-JBJBVERL.js";
30
+ import "../chunk-J7PJALS2.js";
31
+ import "../chunk-EWQZISYV.js";
28
32
  import "../chunk-GMXKITVA.js";
29
33
  import "../chunk-DINDL2CF.js";
30
- import "../chunk-4PBCNVI3.js";
34
+ import "../chunk-UP7NZXJU.js";
31
35
  import "../chunk-EYRGBYZG.js";
32
36
  import "../chunk-SAF6HGAA.js";
33
37
  import "../chunk-7QLSKOSU.js";
34
38
  import "../chunk-KZERVKTD.js";
35
- import "../chunk-GCD3SQSV.js";
39
+ import "../chunk-E3WQMDCE.js";
36
40
  import "../chunk-4LL6LG5X.js";
37
41
  import "../chunk-2UMNXADU.js";
38
- import "../chunk-OUAE3GKO.js";
42
+ import "../chunk-VQYARC2K.js";
39
43
 
40
44
  // bin/pushary-stop-hook.ts
45
+ var AGENT = activeIdentity(process.argv);
41
46
  var main = async () => {
42
- const input = await readHookInput("claude", "Stop");
47
+ const input = await readHookInput(activeHookSource(process.argv), "Stop");
43
48
  if (!input) return;
44
49
  try {
45
50
  if (isSubagentStop(input)) {
46
- await handleSubagentStop(input);
51
+ await handleSubagentStop(input, AGENT);
47
52
  return;
48
53
  }
49
- const output = await handleStop(input);
54
+ const output = await handleStop(input, AGENT);
50
55
  if (output) process.stdout.write(JSON.stringify(output));
51
56
  } catch {
52
57
  }
@@ -1,46 +1,51 @@
1
1
  #!/usr/bin/env node
2
+ import {
3
+ activeHookSource,
4
+ activeIdentity
5
+ } from "../chunk-SM54HHVY.js";
6
+ import "../chunk-6T4OINZB.js";
2
7
  import {
3
8
  readHookInput
4
- } from "../chunk-O3LZQEQP.js";
5
- import "../chunk-NSFNEDCT.js";
9
+ } from "../chunk-LQ3BHPPZ.js";
10
+ import "../chunk-PWIMJP4U.js";
6
11
  import "../chunk-YKLCWWEI.js";
7
- import "../chunk-RALVI7OF.js";
8
- import "../chunk-LBNAGGLV.js";
9
- import "../chunk-IRLTW6KF.js";
10
- import "../chunk-JXELRCU5.js";
11
- import "../chunk-CRFLU455.js";
12
- import "../chunk-PD6JY33P.js";
13
- import "../chunk-EXHXR2X5.js";
14
- import "../chunk-XPPXOKIG.js";
12
+ import "../chunk-DZYIAMKR.js";
13
+ import "../chunk-OYYQHJAO.js";
14
+ import "../chunk-SLEWDZOA.js";
15
+ import "../chunk-AH5OO2YZ.js";
16
+ import "../chunk-6JUCFMSF.js";
17
+ import "../chunk-YM4G6CFN.js";
18
+ import "../chunk-SA6UB3GD.js";
19
+ import "../chunk-BBUZD7MU.js";
15
20
  import "../chunk-EQRS3SGM.js";
16
- import "../chunk-ID5FDKDZ.js";
21
+ import "../chunk-2MOQUNFL.js";
17
22
  import "../chunk-XHKBHWLX.js";
18
23
  import {
19
24
  handleStopFailure
20
- } from "../chunk-64WARXGV.js";
21
- import "../chunk-A76GNRIK.js";
22
- import "../chunk-OPR2BPD4.js";
25
+ } from "../chunk-WTT24AUA.js";
26
+ import "../chunk-INBTKFT6.js";
23
27
  import "../chunk-LGXUGYUH.js";
24
- import "../chunk-562UJ2DA.js";
25
- import "../chunk-JBJBVERL.js";
28
+ import "../chunk-J7PJALS2.js";
29
+ import "../chunk-EWQZISYV.js";
26
30
  import "../chunk-GMXKITVA.js";
27
31
  import "../chunk-DINDL2CF.js";
28
- import "../chunk-4PBCNVI3.js";
32
+ import "../chunk-UP7NZXJU.js";
29
33
  import "../chunk-EYRGBYZG.js";
30
34
  import "../chunk-SAF6HGAA.js";
31
35
  import "../chunk-7QLSKOSU.js";
32
36
  import "../chunk-KZERVKTD.js";
33
- import "../chunk-GCD3SQSV.js";
37
+ import "../chunk-E3WQMDCE.js";
34
38
  import "../chunk-4LL6LG5X.js";
35
39
  import "../chunk-2UMNXADU.js";
36
- import "../chunk-OUAE3GKO.js";
40
+ import "../chunk-VQYARC2K.js";
37
41
 
38
42
  // bin/pushary-stopfailure-hook.ts
43
+ var AGENT = activeIdentity(process.argv);
39
44
  var main = async () => {
40
- const input = await readHookInput("claude", "StopFailure");
45
+ const input = await readHookInput(activeHookSource(process.argv), "StopFailure");
41
46
  if (!input) return;
42
47
  try {
43
- await handleStopFailure(input);
48
+ await handleStopFailure(input, AGENT);
44
49
  } catch {
45
50
  }
46
51
  };
@@ -1,31 +1,31 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  registerTranscript
4
- } from "../chunk-NSFNEDCT.js";
4
+ } from "../chunk-PWIMJP4U.js";
5
5
  import "../chunk-YKLCWWEI.js";
6
- import "../chunk-RALVI7OF.js";
7
- import "../chunk-LBNAGGLV.js";
8
- import "../chunk-IRLTW6KF.js";
9
- import "../chunk-JXELRCU5.js";
10
- import "../chunk-CRFLU455.js";
11
- import "../chunk-PD6JY33P.js";
12
- import "../chunk-EXHXR2X5.js";
13
- import "../chunk-XPPXOKIG.js";
6
+ import "../chunk-DZYIAMKR.js";
7
+ import "../chunk-OYYQHJAO.js";
8
+ import "../chunk-SLEWDZOA.js";
9
+ import "../chunk-AH5OO2YZ.js";
10
+ import "../chunk-6JUCFMSF.js";
11
+ import "../chunk-YM4G6CFN.js";
12
+ import "../chunk-SA6UB3GD.js";
13
+ import "../chunk-BBUZD7MU.js";
14
14
  import "../chunk-EQRS3SGM.js";
15
- import "../chunk-ID5FDKDZ.js";
15
+ import "../chunk-2MOQUNFL.js";
16
16
  import "../chunk-XHKBHWLX.js";
17
- import "../chunk-OPR2BPD4.js";
18
- import "../chunk-562UJ2DA.js";
19
- import "../chunk-JBJBVERL.js";
17
+ import "../chunk-INBTKFT6.js";
18
+ import "../chunk-J7PJALS2.js";
19
+ import "../chunk-EWQZISYV.js";
20
20
  import "../chunk-GMXKITVA.js";
21
21
  import "../chunk-DINDL2CF.js";
22
- import "../chunk-4PBCNVI3.js";
22
+ import "../chunk-UP7NZXJU.js";
23
23
  import "../chunk-7QLSKOSU.js";
24
24
  import "../chunk-KZERVKTD.js";
25
- import "../chunk-GCD3SQSV.js";
25
+ import "../chunk-E3WQMDCE.js";
26
26
  import "../chunk-4LL6LG5X.js";
27
27
  import "../chunk-2UMNXADU.js";
28
- import "../chunk-OUAE3GKO.js";
28
+ import "../chunk-VQYARC2K.js";
29
29
 
30
30
  // bin/pushary-transcript-register.ts
31
31
  var raw = "";