@pushary/agent-hooks 1.1.0 → 1.2.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 (78) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/bin/pushary-bell-hook.js +18 -18
  3. package/dist/bin/pushary-bell.js +6 -6
  4. package/dist/bin/pushary-claude.js +18 -18
  5. package/dist/bin/pushary-clean.js +19 -19
  6. package/dist/bin/pushary-codex-bridge.js +10 -10
  7. package/dist/bin/pushary-codex-hook.js +22 -22
  8. package/dist/bin/pushary-codex.js +6 -6
  9. package/dist/bin/pushary-connect.js +6 -6
  10. package/dist/bin/pushary-cowork.js +3 -3
  11. package/dist/bin/pushary-daemon.js +22 -22
  12. package/dist/bin/pushary-disconnect.js +10 -10
  13. package/dist/bin/pushary-doctor.js +23 -23
  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 +19 -19
  17. package/dist/bin/pushary-hook.js +26 -26
  18. package/dist/bin/pushary-login.js +7 -7
  19. package/dist/bin/pushary-logout.js +4 -4
  20. package/dist/bin/pushary-mode.js +3 -3
  21. package/dist/bin/pushary-notification-hook.js +20 -20
  22. package/dist/bin/pushary-opencode-hook.js +19 -19
  23. package/dist/bin/pushary-permission-denied-hook.js +24 -24
  24. package/dist/bin/pushary-permission-hook.js +25 -25
  25. package/dist/bin/pushary-post-hook.js +20 -20
  26. package/dist/bin/pushary-prompt-hook.js +20 -20
  27. package/dist/bin/pushary-session-end-hook.js +20 -20
  28. package/dist/bin/pushary-session-start-hook.js +22 -22
  29. package/dist/bin/pushary-setup.js +26 -26
  30. package/dist/bin/pushary-stats.js +2 -2
  31. package/dist/bin/pushary-status.js +10 -10
  32. package/dist/bin/pushary-stop-hook.js +20 -20
  33. package/dist/bin/pushary-stopfailure-hook.js +20 -20
  34. package/dist/bin/pushary-transcript-register.js +16 -16
  35. package/dist/bin/pushary-transcripts.js +4 -4
  36. package/dist/bin/pushary-upgrade.js +14 -14
  37. package/dist/bin/pushary-wait.js +3 -3
  38. package/dist/{chunk-VACFOGF3.js → chunk-2DT7STR5.js} +1 -1
  39. package/dist/{chunk-LQ3BHPPZ.js → chunk-4UT44NRP.js} +5 -1
  40. package/dist/{chunk-WTT24AUA.js → chunk-5AATCXJN.js} +29 -5
  41. package/dist/{chunk-BBUZD7MU.js → chunk-6QCN5XQE.js} +1 -1
  42. package/dist/{chunk-VQYARC2K.js → chunk-7DQVIIHX.js} +96 -16
  43. package/dist/{chunk-XIHKSZHL.js → chunk-7ERWAYVV.js} +1 -1
  44. package/dist/{chunk-MR2PWE62.js → chunk-7GH3D6YG.js} +7 -8
  45. package/dist/{chunk-UP7NZXJU.js → chunk-7TDQ7KDY.js} +1 -1
  46. package/dist/{chunk-IH7YUPFN.js → chunk-BXLFUTSD.js} +3 -3
  47. package/dist/{chunk-AH5OO2YZ.js → chunk-C3WH44MH.js} +3 -3
  48. package/dist/{chunk-MZUXTN7X.js → chunk-CG4ZUQ5O.js} +2 -2
  49. package/dist/{chunk-6JUCFMSF.js → chunk-CVCSUAXI.js} +3 -3
  50. package/dist/{chunk-EZ3GX3NS.js → chunk-DRAATYTY.js} +5 -5
  51. package/dist/{chunk-YM4G6CFN.js → chunk-ERP7FOFQ.js} +3 -3
  52. package/dist/{chunk-PUDQJ772.js → chunk-JOTV75GX.js} +1 -1
  53. package/dist/{chunk-IPDBFJ2M.js → chunk-JQJB7BZE.js} +1 -1
  54. package/dist/{chunk-ISELLVBP.js → chunk-KEVJ2WW6.js} +1 -1
  55. package/dist/{chunk-2MOQUNFL.js → chunk-KHTBSSY5.js} +1 -1
  56. package/dist/{chunk-DKTFZCLQ.js → chunk-KODKICKJ.js} +6 -6
  57. package/dist/{chunk-J7PJALS2.js → chunk-KZPUARCU.js} +1 -1
  58. package/dist/{chunk-RZTH4MIY.js → chunk-LAXU5U75.js} +2 -2
  59. package/dist/{chunk-PQG6NTPT.js → chunk-LGO7U23Z.js} +1 -1
  60. package/dist/{chunk-S2BNTXP6.js → chunk-LWKVEMVK.js} +1 -1
  61. package/dist/{chunk-FO4HHPMO.js → chunk-OGSRCIOD.js} +1 -1
  62. package/dist/{chunk-PWIMJP4U.js → chunk-PCT2MYG5.js} +6 -6
  63. package/dist/{chunk-EWQZISYV.js → chunk-PX53RT6Q.js} +1 -1
  64. package/dist/{chunk-6T4OINZB.js → chunk-PX54KULQ.js} +3 -3
  65. package/dist/{chunk-LUYYB6V2.js → chunk-RN6ZWIAC.js} +1 -1
  66. package/dist/{chunk-SLEWDZOA.js → chunk-U42ES5U3.js} +1 -1
  67. package/dist/{chunk-INBTKFT6.js → chunk-UWP66NDF.js} +1 -1
  68. package/dist/{chunk-SA6UB3GD.js → chunk-VDOKRCWM.js} +1 -1
  69. package/dist/{chunk-76ZCJZBK.js → chunk-VE2ZWUML.js} +1 -1
  70. package/dist/{chunk-PHJOSAXW.js → chunk-VIQ7CCWW.js} +2 -2
  71. package/dist/{chunk-DZYIAMKR.js → chunk-W6XVHP4U.js} +4 -4
  72. package/dist/{chunk-OYYQHJAO.js → chunk-WC5PYFDK.js} +1 -1
  73. package/dist/{chunk-QACXZYDA.js → chunk-YK3OU4E2.js} +4 -4
  74. package/dist/{chunk-SM54HHVY.js → chunk-YT6H7BB5.js} +21 -14
  75. package/dist/{chunk-E3WQMDCE.js → chunk-ZFQPSGPO.js} +1 -1
  76. package/dist/{reapply-STSGYPF2.js → reapply-47AMVIXN.js} +8 -8
  77. package/dist/src/index.js +12 -12
  78. package/package.json +1 -1
@@ -13,7 +13,7 @@ import {
13
13
  import {
14
14
  isValidApiKey,
15
15
  normalizeKeyScope
16
- } from "./chunk-VQYARC2K.js";
16
+ } from "./chunk-7DQVIIHX.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
  HOOK_LOCATOR_BINARY
3
- } from "./chunk-VQYARC2K.js";
3
+ } from "./chunk-7DQVIIHX.js";
4
4
 
5
5
  // src/diagnostics/bridge.ts
6
6
  import { execFileSync } from "child_process";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  PRETOOLUSE_GATED_TOOLS
3
- } from "./chunk-VQYARC2K.js";
3
+ } from "./chunk-7DQVIIHX.js";
4
4
 
5
5
  // src/claude-tools.ts
6
6
  var POSTTOOLUSE_MIRROR_ONLY_TOOLS = ["TodoWrite", "Task", "WebFetch", "WebSearch"];
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  guardBinary
3
- } from "./chunk-EWQZISYV.js";
3
+ } from "./chunk-PX53RT6Q.js";
4
4
 
5
5
  // src/bell/install.ts
6
6
  import { join } from "path";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  describeKeyCheck,
3
3
  keyCheckFromResponse
4
- } from "./chunk-LUYYB6V2.js";
4
+ } from "./chunk-RN6ZWIAC.js";
5
5
  import {
6
6
  createIo
7
7
  } from "./chunk-5RUIFDTP.js";
@@ -15,10 +15,10 @@ import {
15
15
  } from "./chunk-EYRGBYZG.js";
16
16
  import {
17
17
  reportedInstallSource
18
- } from "./chunk-E3WQMDCE.js";
18
+ } from "./chunk-ZFQPSGPO.js";
19
19
  import {
20
20
  isAnswerSource
21
- } from "./chunk-VQYARC2K.js";
21
+ } from "./chunk-7DQVIIHX.js";
22
22
 
23
23
  // src/reach.ts
24
24
  var reachVerdict = (channels) => {
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  AGENT_CHOICES
3
- } from "./chunk-OYYQHJAO.js";
3
+ } from "./chunk-WC5PYFDK.js";
4
4
  import {
5
5
  isBridgeLocator
6
- } from "./chunk-SLEWDZOA.js";
6
+ } from "./chunk-U42ES5U3.js";
7
7
  import {
8
8
  pusharyHookExecutable
9
- } from "./chunk-AH5OO2YZ.js";
9
+ } from "./chunk-C3WH44MH.js";
10
10
  import {
11
11
  BELL_HOOK_BINARY
12
- } from "./chunk-SA6UB3GD.js";
12
+ } from "./chunk-VDOKRCWM.js";
13
13
 
14
14
  // src/setup/hook-ownership.ts
15
15
  var commandsIn = (value) => {
@@ -7,7 +7,7 @@ import {
7
7
  import {
8
8
  COMPATIBLE_AGENT_TYPES,
9
9
  isValidApiKey
10
- } from "./chunk-VQYARC2K.js";
10
+ } from "./chunk-7DQVIIHX.js";
11
11
 
12
12
  // src/setup/options.ts
13
13
  var AGENT_CHOICES = ["claude_code", "codex", "gemini_cli", "hermes", "cursor", "vscode", "opencode", ...COMPATIBLE_AGENT_TYPES, "custom"];
@@ -2,24 +2,24 @@ import {
2
2
  detectProviderLiveCapabilities,
3
3
  hasSpawnProvider,
4
4
  resolveControlPolicy
5
- } from "./chunk-MZUXTN7X.js";
5
+ } from "./chunk-CG4ZUQ5O.js";
6
6
  import {
7
7
  daemonHasRemoteProof,
8
8
  daemonServiceManagerAvailable,
9
9
  hasDaemonServiceDefinition,
10
10
  readDaemonNeedsLogin,
11
11
  readDaemonStatus
12
- } from "./chunk-6JUCFMSF.js";
12
+ } from "./chunk-CVCSUAXI.js";
13
13
  import {
14
14
  getMachineId
15
- } from "./chunk-J7PJALS2.js";
15
+ } from "./chunk-KZPUARCU.js";
16
16
  import {
17
17
  getPackageVersion
18
18
  } from "./chunk-DINDL2CF.js";
19
19
  import {
20
20
  readControlMode,
21
21
  readKeySource
22
- } from "./chunk-UP7NZXJU.js";
22
+ } from "./chunk-7TDQ7KDY.js";
23
23
  import {
24
24
  getBaseUrl
25
25
  } from "./chunk-2UMNXADU.js";
@@ -3,27 +3,27 @@ import {
3
3
  addPusharyToolPermissions,
4
4
  isPusharyHook,
5
5
  removeClaudeMcpServers
6
- } from "./chunk-6T4OINZB.js";
6
+ } from "./chunk-PX54KULQ.js";
7
7
  import {
8
8
  CLAUDE_HOOK_EVENTS,
9
9
  addGeminiMcpServer,
10
10
  removeGeminiMcpServer
11
- } from "./chunk-YM4G6CFN.js";
11
+ } from "./chunk-ERP7FOFQ.js";
12
12
  import {
13
13
  CLAUDE_CODE_AGENT,
14
14
  parseApplyPatchFiles
15
- } from "./chunk-WTT24AUA.js";
15
+ } from "./chunk-5AATCXJN.js";
16
16
  import {
17
17
  guardBinary,
18
18
  holdBudgetOf,
19
19
  registerHookEntry
20
- } from "./chunk-EWQZISYV.js";
20
+ } from "./chunk-PX53RT6Q.js";
21
21
  import {
22
22
  PHONE_ANSWERED_TOOLS,
23
23
  hookCompatibleProfile,
24
24
  toToolLookup,
25
25
  withHookHoldBudget
26
- } from "./chunk-VQYARC2K.js";
26
+ } from "./chunk-7DQVIIHX.js";
27
27
 
28
28
  // src/compatible-config.ts
29
29
  import { homedir } from "os";
@@ -31,33 +31,40 @@ import { isAbsolute, join, resolve } from "path";
31
31
  var AGENT_FLAG = "--agent";
32
32
  var agentArgument = (profile) => `${AGENT_FLAG}=${profile.agentType}`;
33
33
  var profileFromArgv = (argv) => {
34
- const prefix = `${AGENT_FLAG}=`;
35
- const named = argv.find((argument) => argument.startsWith(prefix));
36
- return named ? hookCompatibleProfile(named.slice(prefix.length)) : void 0;
34
+ const named = namedAgent(argv);
35
+ return named ? hookCompatibleProfile(named) : void 0;
37
36
  };
38
37
  var activeIdentity = (argv) => {
39
38
  const profile = profileFromArgv(argv);
40
39
  return profile ? { type: profile.agentType, label: profile.label } : CLAUDE_CODE_AGENT;
41
40
  };
42
- var activeHookSource = (argv) => profileFromArgv(argv)?.source ?? "claude";
41
+ var namedAgent = (argv) => {
42
+ const prefix = `${AGENT_FLAG}=`;
43
+ return argv.find((argument) => argument.startsWith(prefix))?.slice(prefix.length);
44
+ };
45
+ var activeHookSource = (argv) => {
46
+ const named = namedAgent(argv);
47
+ if (named === void 0) return "claude";
48
+ return hookCompatibleProfile(named)?.source ?? null;
49
+ };
43
50
  var PATCH_INPUT_KEYS = ["command", "patch", "input"];
44
51
  var patchedFiles = (toolInput) => [...new Set(PATCH_INPUT_KEYS.flatMap((key) => parseApplyPatchFiles(toolInput[key])))];
45
52
  var lookupFor = (profile, input) => {
46
53
  const absolute = (path) => input.cwd && !isAbsolute(path) ? resolve(input.cwd, path) : path;
47
54
  const toolInput = input.tool_input ?? {};
48
55
  const lookup = toToolLookup(profile, input.tool_name ?? "", toolInput, absolute);
49
- if (!lookup.pathless) return lookup;
56
+ if (!lookup.unreadable) return lookup;
50
57
  const files = patchedFiles(toolInput);
51
- return files.length === 1 ? { ...lookup, input: { ...lookup.input, file_path: absolute(files[0]) }, pathless: false } : lookup;
58
+ return files.length === 1 ? { ...lookup, input: { ...lookup.input, file_path: absolute(files[0]) }, unreadable: false } : lookup;
52
59
  };
53
60
  var normalizeToolCall = (profile, input) => {
54
61
  if (!profile || !input.tool_name) return input;
55
62
  const lookup = lookupFor(profile, input);
56
63
  return { ...input, tool_name: lookup.tool, tool_input: lookup.input };
57
64
  };
58
- var unreadablePathTool = (profile, input) => {
65
+ var unreadableTool = (profile, input) => {
59
66
  if (!profile || !input.tool_name) return void 0;
60
- return lookupFor(profile, input).pathless ? input.tool_name : void 0;
67
+ return lookupFor(profile, input).unreadable ? input.tool_name : void 0;
61
68
  };
62
69
  var underHome = (segments, home = homedir()) => join(home, ...segments);
63
70
  var compatibleConfigFile = (profile, home) => underHome(profile.configFile, home);
@@ -208,7 +215,7 @@ export {
208
215
  activeIdentity,
209
216
  activeHookSource,
210
217
  normalizeToolCall,
211
- unreadablePathTool,
218
+ unreadableTool,
212
219
  compatibleConfigFile,
213
220
  compatibleMcpFile,
214
221
  compatibleInstructionsFile,
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-2UMNXADU.js";
4
4
  import {
5
5
  normalizeInstallSource
6
- } from "./chunk-VQYARC2K.js";
6
+ } from "./chunk-7DQVIIHX.js";
7
7
 
8
8
  // src/install-source.ts
9
9
  import { readFileSync } from "fs";
@@ -8,15 +8,15 @@ import {
8
8
  reapplyGeminiSettings,
9
9
  reapplyVsCodePlugin,
10
10
  repairCodexHolds
11
- } from "./chunk-EZ3GX3NS.js";
12
- import "./chunk-IPDBFJ2M.js";
13
- import "./chunk-6T4OINZB.js";
14
- import "./chunk-AH5OO2YZ.js";
15
- import "./chunk-YM4G6CFN.js";
16
- import "./chunk-INBTKFT6.js";
17
- import "./chunk-EWQZISYV.js";
11
+ } from "./chunk-DRAATYTY.js";
12
+ import "./chunk-JQJB7BZE.js";
13
+ import "./chunk-PX54KULQ.js";
14
+ import "./chunk-C3WH44MH.js";
15
+ import "./chunk-ERP7FOFQ.js";
16
+ import "./chunk-UWP66NDF.js";
17
+ import "./chunk-PX53RT6Q.js";
18
18
  import "./chunk-4LL6LG5X.js";
19
- import "./chunk-VQYARC2K.js";
19
+ import "./chunk-7DQVIIHX.js";
20
20
  export {
21
21
  inspectConfiguredManagedProviders,
22
22
  reapplyAllAgents,
package/dist/src/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  handlePreToolUse
3
- } from "../chunk-DKTFZCLQ.js";
4
- import "../chunk-SM54HHVY.js";
5
- import "../chunk-6T4OINZB.js";
6
- import "../chunk-IH7YUPFN.js";
7
- import "../chunk-VACFOGF3.js";
3
+ } from "../chunk-KODKICKJ.js";
4
+ import "../chunk-YT6H7BB5.js";
5
+ import "../chunk-PX54KULQ.js";
6
+ import "../chunk-BXLFUTSD.js";
7
+ import "../chunk-2DT7STR5.js";
8
8
  import "../chunk-YHG74UFF.js";
9
- import "../chunk-YM4G6CFN.js";
9
+ import "../chunk-ERP7FOFQ.js";
10
10
  import {
11
11
  fetchAccountPublicKey
12
12
  } from "../chunk-EQRS3SGM.js";
@@ -18,20 +18,20 @@ import {
18
18
  handlePostToolUse,
19
19
  handleStop,
20
20
  reportEvent
21
- } from "../chunk-WTT24AUA.js";
22
- import "../chunk-INBTKFT6.js";
21
+ } from "../chunk-5AATCXJN.js";
22
+ import "../chunk-UWP66NDF.js";
23
23
  import {
24
24
  askUser,
25
25
  cancelQuestion,
26
26
  waitForAnswer
27
27
  } from "../chunk-LGXUGYUH.js";
28
- import "../chunk-J7PJALS2.js";
29
- import "../chunk-EWQZISYV.js";
28
+ import "../chunk-KZPUARCU.js";
29
+ import "../chunk-PX53RT6Q.js";
30
30
  import "../chunk-EYRGBYZG.js";
31
31
  import "../chunk-SAF6HGAA.js";
32
32
  import "../chunk-7QLSKOSU.js";
33
33
  import "../chunk-KZERVKTD.js";
34
- import "../chunk-E3WQMDCE.js";
34
+ import "../chunk-ZFQPSGPO.js";
35
35
  import "../chunk-4LL6LG5X.js";
36
36
  import {
37
37
  getApiKey,
@@ -39,7 +39,7 @@ import {
39
39
  } from "../chunk-2UMNXADU.js";
40
40
  import {
41
41
  resolvePolicy
42
- } from "../chunk-VQYARC2K.js";
42
+ } from "../chunk-7DQVIIHX.js";
43
43
  export {
44
44
  askUser,
45
45
  cancelQuestion,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushary/agent-hooks",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "Permission hooks for AI coding agents: route tool approvals through Pushary push notifications",
5
5
  "keywords": [
6
6
  "pushary",