@pushary/agent-hooks 1.6.4 → 1.7.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 (98) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +3 -2
  3. package/dist/bin/pushary-bell-hook.js +23 -24
  4. package/dist/bin/pushary-bell.js +9 -10
  5. package/dist/bin/pushary-claude.js +27 -28
  6. package/dist/bin/pushary-clean.js +85 -28
  7. package/dist/bin/pushary-codex-bridge.js +17 -18
  8. package/dist/bin/pushary-codex-hook.js +30 -31
  9. package/dist/bin/pushary-codex.js +12 -13
  10. package/dist/bin/pushary-connect.js +13 -14
  11. package/dist/bin/pushary-cowork.js +5 -6
  12. package/dist/bin/pushary-daemon.js +27 -28
  13. package/dist/bin/pushary-disconnect.js +17 -18
  14. package/dist/bin/pushary-doctor.js +71 -36
  15. package/dist/bin/pushary-elicitation-hook.js +24 -25
  16. package/dist/bin/pushary-gemini-bridge.js +12 -13
  17. package/dist/bin/pushary-gemini-hook.js +27 -28
  18. package/dist/bin/pushary-hook.js +31 -32
  19. package/dist/bin/pushary-login.js +13 -15
  20. package/dist/bin/pushary-logout.js +7 -8
  21. package/dist/bin/pushary-mcp.d.ts +1 -0
  22. package/dist/bin/pushary-mcp.js +56 -0
  23. package/dist/bin/pushary-mode.js +9 -10
  24. package/dist/bin/pushary-notification-hook.js +27 -28
  25. package/dist/bin/pushary-opencode-hook.js +26 -27
  26. package/dist/bin/pushary-permission-denied-hook.js +31 -32
  27. package/dist/bin/pushary-permission-hook.js +30 -31
  28. package/dist/bin/pushary-post-hook.js +27 -28
  29. package/dist/bin/pushary-prompt-hook.js +27 -28
  30. package/dist/bin/pushary-session-end-hook.js +27 -28
  31. package/dist/bin/pushary-session-start-hook.js +31 -32
  32. package/dist/bin/pushary-setup.js +183 -73
  33. package/dist/bin/pushary-stats.js +5 -6
  34. package/dist/bin/pushary-status.js +15 -16
  35. package/dist/bin/pushary-stop-hook.js +27 -28
  36. package/dist/bin/pushary-stopfailure-hook.js +27 -28
  37. package/dist/bin/pushary-suggestions.js +4 -4
  38. package/dist/bin/pushary-transcript-register.js +19 -20
  39. package/dist/bin/pushary-transcripts.js +7 -8
  40. package/dist/bin/pushary-upgrade.js +20 -21
  41. package/dist/bin/pushary-wait.js +9 -10
  42. package/dist/bin/pushary.js +6 -7
  43. package/dist/{chunk-5UWV5GHM.js → chunk-2C7CCWVX.js} +1 -1
  44. package/dist/{chunk-P4BNYJ5Q.js → chunk-2PS6QWDW.js} +2 -2
  45. package/dist/{chunk-JOGA3TL2.js → chunk-4F46VIEE.js} +6 -6
  46. package/dist/{chunk-NYMPLNV3.js → chunk-52NVBNJT.js} +3 -3
  47. package/dist/{chunk-I3XJATMR.js → chunk-5HLTWFJ6.js} +1 -1
  48. package/dist/{chunk-HUB4Q35G.js → chunk-6ADZQFVW.js} +1 -1
  49. package/dist/{chunk-OZE2TQX5.js → chunk-73T6MSU5.js} +5 -5
  50. package/dist/{chunk-53DN77WB.js → chunk-7OS4IHGI.js} +2 -2
  51. package/dist/{chunk-BY2CRWBO.js → chunk-B234346F.js} +1 -1
  52. package/dist/{chunk-EA3IELHP.js → chunk-B3UXMSMW.js} +6 -2
  53. package/dist/{chunk-3VZX4NSP.js → chunk-B3YQANFN.js} +1 -1
  54. package/dist/{chunk-VA2R64I7.js → chunk-B76WVEDX.js} +1 -1
  55. package/dist/{chunk-YPONELWS.js → chunk-BBKNJJVX.js} +6 -6
  56. package/dist/{chunk-XOMH53NB.js → chunk-BH2SKSSK.js} +1 -1
  57. package/dist/{chunk-P4UYILQK.js → chunk-BWYJ6AAF.js} +2 -2
  58. package/dist/{chunk-I2YUMZLE.js → chunk-CVALVGA7.js} +1 -1
  59. package/dist/{chunk-6NLWK6ZV.js → chunk-D6BULEJW.js} +2 -2
  60. package/dist/{chunk-N62KAMMY.js → chunk-DANOZVZK.js} +1 -1
  61. package/dist/{chunk-K32C2RGK.js → chunk-DNJUSFBL.js} +11 -5
  62. package/dist/{chunk-5U3FJ6YF.js → chunk-DVQDPI3T.js} +8 -8
  63. package/dist/{chunk-YUGGNZSF.js → chunk-DZURML2D.js} +1 -1
  64. package/dist/{chunk-D3K2FPPJ.js → chunk-EAQMWJPG.js} +8 -8
  65. package/dist/{chunk-EREBZHN2.js → chunk-EGKXSQCY.js} +4 -4
  66. package/dist/{chunk-XJG2FUWS.js → chunk-HDRNWNVP.js} +6 -6
  67. package/dist/{chunk-H6XU22TN.js → chunk-IJ6ECPA6.js} +8 -8
  68. package/dist/{chunk-3LU74H52.js → chunk-J2355HR7.js} +1 -1
  69. package/dist/{chunk-BJENQBMH.js → chunk-JNXVOU6Y.js} +8 -4
  70. package/dist/{chunk-GBL4BTG3.js → chunk-JXUAXO74.js} +2 -2
  71. package/dist/{chunk-DESAUCH2.js → chunk-KW2RRR7D.js} +4 -6
  72. package/dist/{chunk-66H2QQAK.js → chunk-KXMZMZD3.js} +1 -1
  73. package/dist/{chunk-ZA5UXRNE.js → chunk-KYQXUGH7.js} +3 -3
  74. package/dist/{chunk-NFH73H5B.js → chunk-L4H2Q2S4.js} +276 -19
  75. package/dist/{chunk-LDRGVXLR.js → chunk-LEZFOTMI.js} +1 -1
  76. package/dist/{chunk-PBKEYMAO.js → chunk-O2LEPIU6.js} +1 -1
  77. package/dist/{chunk-YXPGFRRW.js → chunk-PQ4F64M2.js} +3 -3
  78. package/dist/{chunk-LFMOYHPY.js → chunk-PUDBG3GM.js} +1 -1
  79. package/dist/{chunk-YQMFGWBD.js → chunk-QXAK5RFU.js} +1 -1
  80. package/dist/{chunk-5SWQZ6HY.js → chunk-R2XCLT6I.js} +4 -4
  81. package/dist/{chunk-VHNDE3ZD.js → chunk-ROQK7IN3.js} +2 -2
  82. package/dist/{chunk-GU3EJCVV.js → chunk-S3UD4V6W.js} +39 -0
  83. package/dist/{chunk-PJF7L7AA.js → chunk-SQRWHALT.js} +2 -2
  84. package/dist/{chunk-UAP556WK.js → chunk-UC65FJJT.js} +2 -2
  85. package/dist/{chunk-R4HVHTNA.js → chunk-UOAQ6QMP.js} +2 -2
  86. package/dist/{chunk-OSJEMXSR.js → chunk-V4AQBAVG.js} +1 -1
  87. package/dist/{chunk-VOCZHOXV.js → chunk-V6QRSU2G.js} +4 -4
  88. package/dist/{chunk-LQI7W4RG.js → chunk-VKVIAZQO.js} +1 -1
  89. package/dist/{chunk-LJEL7IB5.js → chunk-WUNZAE7I.js} +5 -5
  90. package/dist/{chunk-UGKDBJJX.js → chunk-X6KDKOV5.js} +3 -3
  91. package/dist/{chunk-DZTKLE7Q.js → chunk-XNCMT7YY.js} +1 -1
  92. package/dist/{chunk-CAS7GFWI.js → chunk-YROGUPOZ.js} +75 -5
  93. package/dist/chunk-YYINL576.js +120 -0
  94. package/dist/{chunk-7CLTSZOL.js → chunk-ZQ7IDOKY.js} +3 -3
  95. package/dist/{reapply-4DAJKNVP.js → reapply-6PH3FMPX.js} +9 -10
  96. package/dist/src/index.js +19 -20
  97. package/package.json +2 -1
  98. package/dist/chunk-HWJW3CPO.js +0 -65
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  pusharyFetch
3
- } from "./chunk-DESAUCH2.js";
3
+ } from "./chunk-KW2RRR7D.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-OSJEMXSR.js";
12
+ } from "./chunk-V4AQBAVG.js";
13
13
  import {
14
14
  isValidApiKey,
15
15
  normalizeKeyScope
16
- } from "./chunk-CAS7GFWI.js";
16
+ } from "./chunk-YROGUPOZ.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
  pusharyDir
3
- } from "./chunk-K32C2RGK.js";
3
+ } from "./chunk-DNJUSFBL.js";
4
4
  import {
5
5
  writeFileAtomic
6
6
  } from "./chunk-T7E75EKA.js";
@@ -151,6 +151,13 @@ var AGENTS = {
151
151
  setupCommand: AGENT_HOOKS_SETUP_COMMAND,
152
152
  enforcementDetail: "Shell, writes, edits and web fetches when OpenCode itself asks for permission."
153
153
  },
154
+ fx: {
155
+ ...defaults,
156
+ label: "fx",
157
+ connectVia: "Local MCP bridge",
158
+ setupCommand: AGENT_HOOKS_SETUP_COMMAND,
159
+ capabilityNote: "fx has no hooks that other tools can register, so Pushary cannot answer fx's own approval prompts. fx's agent reaches Pushary through its MCP tools when it chooses to ask."
160
+ },
154
161
  qwen_code: {
155
162
  ...defaults,
156
163
  label: "Qwen Code",
@@ -467,8 +474,8 @@ var SECRET_REDACTION_RULES = [
467
474
  { pattern: /\bbearer\s+[A-Za-z0-9._~+/=-]+/gi, replacement: "bearer [redacted]" },
468
475
  { pattern: /\bauthorization:\s*\S+/gi, replacement: "authorization: [redacted]" },
469
476
  {
470
- pattern: /((?:secret|token|password|passwd|api[_-]?key|access[_-]?key|client[_-]?secret|private[_-]?key)\s*[=:]\s*)("[^"]*"|'[^']*'|\S+)/gi,
471
- replacement: "$1[redacted]"
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"
472
479
  }
473
480
  ];
474
481
  var HIGH_ENTROPY_RULE = { pattern: /[A-Za-z0-9+/]{40,}={0,2}/g, replacement: "[redacted]" };
@@ -497,6 +504,7 @@ var SETUP_AGENT_CHOICES = [
497
504
  "cursor",
498
505
  "vscode",
499
506
  "opencode",
507
+ "fx",
500
508
  ...COMPATIBLE_AGENT_TYPES,
501
509
  "custom"
502
510
  ];
@@ -1324,8 +1332,7 @@ var DESTRUCTIVE_SUBCOMMANDS = /* @__PURE__ */ new Set([
1324
1332
  var DATA_LOSS_COMMAND_PATTERNS = [
1325
1333
  "Bash(git branch -D:*)",
1326
1334
  "Bash(git branch --delete:*)",
1327
- "Bash(git checkout --:*)",
1328
- "Bash(git checkout .:*)",
1335
+ "Bash(git checkout:*)",
1329
1336
  "Bash(git restore:*)",
1330
1337
  "Bash(git stash drop:*)",
1331
1338
  "Bash(git stash clear:*)",
@@ -2498,6 +2505,63 @@ var hookActivationResult = (report) => {
2498
2505
  return report && !report.truncated && report.evidence.length === 1 ? report.evidence[0].result : "unverified";
2499
2506
  };
2500
2507
 
2508
+ // src/cli/version.ts
2509
+ import { readFileSync } from "fs";
2510
+ import { dirname, join, parse } from "path";
2511
+ import { fileURLToPath } from "url";
2512
+ var PACKAGE_NAME = "@pushary/agent-hooks";
2513
+ var UNKNOWN_VERSION = "0.0.0";
2514
+ var findOwnPackageJson = (start) => {
2515
+ const { root } = parse(start);
2516
+ let dir = start;
2517
+ while (true) {
2518
+ const candidate = join(dir, "package.json");
2519
+ try {
2520
+ const pkg = JSON.parse(readFileSync(candidate, "utf-8"));
2521
+ if (pkg.name === PACKAGE_NAME) return candidate;
2522
+ } catch {
2523
+ }
2524
+ if (dir === root) return void 0;
2525
+ const parent = dirname(dir);
2526
+ if (parent === dir) return void 0;
2527
+ dir = parent;
2528
+ }
2529
+ };
2530
+ var getPackageVersion = () => {
2531
+ const root = ownPackageRoot();
2532
+ return (root === void 0 ? void 0 : packageVersionAt(root)) ?? UNKNOWN_VERSION;
2533
+ };
2534
+ var ownPackageRoot = () => {
2535
+ try {
2536
+ const found = findOwnPackageJson(dirname(fileURLToPath(import.meta.url)));
2537
+ return found ? dirname(found) : void 0;
2538
+ } catch {
2539
+ return void 0;
2540
+ }
2541
+ };
2542
+ var packageVersionAt = (packageRoot) => {
2543
+ try {
2544
+ const manifest = JSON.parse(readFileSync(join(packageRoot, "package.json"), "utf-8"));
2545
+ const version = manifest && typeof manifest === "object" && "version" in manifest ? manifest.version : void 0;
2546
+ return typeof version === "string" ? version : void 0;
2547
+ } catch {
2548
+ return void 0;
2549
+ }
2550
+ };
2551
+ var isNewerVersion = (candidate, current) => {
2552
+ const a = candidate.split(".").map((part) => parseInt(part, 10) || 0);
2553
+ const b = current.split(".").map((part) => parseInt(part, 10) || 0);
2554
+ for (let i = 0; i < 3; i++) {
2555
+ if ((a[i] ?? 0) > (b[i] ?? 0)) return true;
2556
+ if ((a[i] ?? 0) < (b[i] ?? 0)) return false;
2557
+ }
2558
+ return false;
2559
+ };
2560
+ var RELEASE_VERSION = /^\d+\.\d+\.\d+$/;
2561
+ var isReleaseVersion = (value) => RELEASE_VERSION.test(value);
2562
+ var majorOf = (version) => parseInt(version.split(".")[0] ?? "", 10) || 0;
2563
+ var isSameMajorVersion = (candidate, current) => majorOf(candidate) === majorOf(current);
2564
+
2501
2565
  export {
2502
2566
  CLAUDE_CONNECTOR_URL,
2503
2567
  CLAUDE_CONNECTOR_GUIDE,
@@ -2600,5 +2664,11 @@ export {
2600
2664
  readElicitationFields,
2601
2665
  planElicitationAsk,
2602
2666
  elicitationContent,
2603
- elicitationContentFromAnswers
2667
+ elicitationContentFromAnswers,
2668
+ getPackageVersion,
2669
+ ownPackageRoot,
2670
+ packageVersionAt,
2671
+ isNewerVersion,
2672
+ isReleaseVersion,
2673
+ isSameMajorVersion
2604
2674
  };
@@ -0,0 +1,120 @@
1
+ import {
2
+ parseSseMessages
3
+ } from "./chunk-JNXVOU6Y.js";
4
+ import {
5
+ NPX_LATEST_COMMAND
6
+ } from "./chunk-B3UXMSMW.js";
7
+
8
+ // src/mcp-stdio-bridge.ts
9
+ var MCP_BRIDGE_BINARY = "pushary-mcp";
10
+ var MCP_BRIDGE_PATH = "/api/mcp/mcp";
11
+ var MCP_BRIDGE_REQUEST_TIMEOUT_MS = 9e4;
12
+ var JSON_RPC_PARSE_ERROR = -32700;
13
+ var MCP_BRIDGE_ERROR = -32e3;
14
+ var MCP_SESSION_HEADER = "mcp-session-id";
15
+ var MCP_PROTOCOL_HEADER = "mcp-protocol-version";
16
+ var INITIALIZE_METHOD = "initialize";
17
+ var MISSING_KEY_MESSAGE = `Pushary has no API key for this machine. Run \`${NPX_LATEST_COMMAND} setup\`.`;
18
+ var REJECTED_KEY_MESSAGE = `Pushary rejected this machine's API key. Run \`${NPX_LATEST_COMMAND} setup\` to sign in again.`;
19
+ var PARSE_ERROR_MESSAGE = "Parse error";
20
+ var NO_RESPONSE_MESSAGE = "Pushary sent no response.";
21
+ var unreachableMessage = (err) => `Pushary is unreachable: ${err instanceof Error ? err.message : String(err)}`;
22
+ var asRecord = (value) => value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
23
+ var isJsonRpcId = (value) => typeof value === "string" || typeof value === "number";
24
+ var messagesOf = (payload) => Array.isArray(payload) ? payload : [payload];
25
+ var requestOf = (message) => {
26
+ const record = asRecord(message);
27
+ return record && typeof record.method === "string" && isJsonRpcId(record.id) ? [{ id: record.id, method: record.method }] : [];
28
+ };
29
+ var requestsIn = (payload) => messagesOf(payload).flatMap(requestOf);
30
+ var isJsonRpcMessage = (message) => asRecord(message)?.jsonrpc === "2.0";
31
+ var responseIdOf = (message) => {
32
+ const record = asRecord(message);
33
+ return record && !("method" in record) && isJsonRpcId(record.id) ? record.id : void 0;
34
+ };
35
+ var bridgeError = (id, message, code = MCP_BRIDGE_ERROR) => ({
36
+ jsonrpc: "2.0",
37
+ id,
38
+ error: { code, message }
39
+ });
40
+ var parseBridgeLine = (line) => {
41
+ try {
42
+ return { ok: true, payload: JSON.parse(line) };
43
+ } catch {
44
+ return { ok: false };
45
+ }
46
+ };
47
+ var parseMcpMessages = (body, contentType) => {
48
+ if (!body.trim()) return [];
49
+ if (contentType?.includes("text/event-stream")) return parseSseMessages(body);
50
+ const parsed = parseBridgeLine(body);
51
+ return parsed.ok ? messagesOf(parsed.payload) : [];
52
+ };
53
+ var httpFailureMessage = (status, hasKey, body) => {
54
+ if (status === 401) return hasKey ? REJECTED_KEY_MESSAGE : MISSING_KEY_MESSAGE;
55
+ const detail = body.trim().slice(0, 300);
56
+ return detail ? `Pushary returned ${status}: ${detail}` : `Pushary returned ${status}.`;
57
+ };
58
+ var negotiatedProtocolOf = (messages, initializeIds) => {
59
+ for (const message of messages) {
60
+ const id = responseIdOf(message);
61
+ const version = asRecord(asRecord(message)?.result)?.protocolVersion;
62
+ if (id !== void 0 && initializeIds.has(id) && typeof version === "string") return version;
63
+ }
64
+ return void 0;
65
+ };
66
+ var createMcpStdioBridge = (deps) => {
67
+ let sessionId = null;
68
+ let protocolVersion = null;
69
+ const headersFor = (apiKey) => ({
70
+ "Content-Type": "application/json",
71
+ "Accept": "application/json, text/event-stream",
72
+ ...apiKey ? { Authorization: `Bearer ${apiKey}` } : {},
73
+ ...sessionId ? { [MCP_SESSION_HEADER]: sessionId } : {},
74
+ ...protocolVersion ? { [MCP_PROTOCOL_HEADER]: protocolVersion } : {}
75
+ });
76
+ const failRequests = (requests, message, answered = /* @__PURE__ */ new Set()) => {
77
+ for (const request of requests) {
78
+ if (!answered.has(request.id)) deps.emit(bridgeError(request.id, message));
79
+ }
80
+ };
81
+ const post = async (line, apiKey) => deps.fetchImpl(deps.endpoint, {
82
+ method: "POST",
83
+ headers: headersFor(apiKey),
84
+ body: line,
85
+ signal: AbortSignal.timeout(deps.timeoutMs ?? MCP_BRIDGE_REQUEST_TIMEOUT_MS)
86
+ });
87
+ const forward = async (line) => {
88
+ const parsed = parseBridgeLine(line);
89
+ if (!parsed.ok) {
90
+ deps.emit(bridgeError(null, PARSE_ERROR_MESSAGE, JSON_RPC_PARSE_ERROR));
91
+ return;
92
+ }
93
+ const requests = requestsIn(parsed.payload);
94
+ const apiKey = deps.apiKey();
95
+ let response;
96
+ let body;
97
+ try {
98
+ response = await post(line, apiKey);
99
+ body = await response.text();
100
+ } catch (err) {
101
+ failRequests(requests, unreachableMessage(err));
102
+ return;
103
+ }
104
+ sessionId = response.headers.get(MCP_SESSION_HEADER) ?? sessionId;
105
+ const messages = parseMcpMessages(body, response.headers.get("content-type")).filter(isJsonRpcMessage);
106
+ const initializeIds = new Set(requests.filter((request) => request.method === INITIALIZE_METHOD).map((request) => request.id));
107
+ protocolVersion = negotiatedProtocolOf(messages, initializeIds) ?? protocolVersion;
108
+ for (const message of messages) deps.emit(message);
109
+ const answered = new Set(messages.map(responseIdOf).filter(isJsonRpcId));
110
+ const failure = response.ok ? NO_RESPONSE_MESSAGE : httpFailureMessage(response.status, apiKey !== null, body);
111
+ failRequests(requests, failure, answered);
112
+ };
113
+ return { forward };
114
+ };
115
+
116
+ export {
117
+ MCP_BRIDGE_BINARY,
118
+ MCP_BRIDGE_PATH,
119
+ createMcpStdioBridge
120
+ };
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  NOTIFICATION_MATCHED_TYPES,
3
3
  POSTTOOLUSE_MIRRORED_TOOLS
4
- } from "./chunk-YUGGNZSF.js";
4
+ } from "./chunk-DZURML2D.js";
5
5
  import {
6
6
  isProtectedByScope,
7
7
  registerHookEntry
8
- } from "./chunk-K32C2RGK.js";
8
+ } from "./chunk-DNJUSFBL.js";
9
9
  import {
10
10
  CLAUDE_PRETOOLUSE_MATCHER,
11
11
  HOOK_BUDGETS,
12
12
  HOOK_LOCATOR_BINARY
13
- } from "./chunk-CAS7GFWI.js";
13
+ } from "./chunk-YROGUPOZ.js";
14
14
 
15
15
  // src/gemini-config.ts
16
16
  var GEMINI_HOOK_BINARY = "pushary-gemini-hook";
@@ -9,18 +9,17 @@ import {
9
9
  reapplyGeminiSettings,
10
10
  reapplyVsCodePlugin,
11
11
  repairCodexHolds
12
- } from "./chunk-YPONELWS.js";
13
- import "./chunk-PBKEYMAO.js";
14
- import "./chunk-53DN77WB.js";
15
- import "./chunk-ZA5UXRNE.js";
16
- import "./chunk-YXPGFRRW.js";
17
- import "./chunk-7CLTSZOL.js";
12
+ } from "./chunk-BBKNJJVX.js";
13
+ import "./chunk-O2LEPIU6.js";
14
+ import "./chunk-7OS4IHGI.js";
15
+ import "./chunk-KYQXUGH7.js";
16
+ import "./chunk-PQ4F64M2.js";
17
+ import "./chunk-ZQ7IDOKY.js";
18
18
  import "./chunk-XHKBHWLX.js";
19
- import "./chunk-YUGGNZSF.js";
20
- import "./chunk-K32C2RGK.js";
19
+ import "./chunk-DZURML2D.js";
20
+ import "./chunk-DNJUSFBL.js";
21
21
  import "./chunk-T7E75EKA.js";
22
- import "./chunk-CAS7GFWI.js";
23
- import "./chunk-HWJW3CPO.js";
22
+ import "./chunk-YROGUPOZ.js";
24
23
  export {
25
24
  ensureCodexTrustAfterReapply,
26
25
  inspectConfiguredManagedProviders,
package/dist/src/index.js CHANGED
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  handlePreToolUse
3
- } from "../chunk-5U3FJ6YF.js";
4
- import "../chunk-LJEL7IB5.js";
5
- import "../chunk-ZA5UXRNE.js";
6
- import "../chunk-NYMPLNV3.js";
7
- import "../chunk-5UWV5GHM.js";
3
+ } from "../chunk-DVQDPI3T.js";
4
+ import "../chunk-WUNZAE7I.js";
5
+ import "../chunk-KYQXUGH7.js";
6
+ import "../chunk-52NVBNJT.js";
7
+ import "../chunk-2C7CCWVX.js";
8
8
  import "../chunk-YHG74UFF.js";
9
- import "../chunk-7CLTSZOL.js";
9
+ import "../chunk-ZQ7IDOKY.js";
10
10
  import {
11
11
  fetchAccountPublicKey
12
- } from "../chunk-66H2QQAK.js";
12
+ } from "../chunk-KXMZMZD3.js";
13
13
  import {
14
14
  fetchModeOverride,
15
15
  fetchModeState,
@@ -18,32 +18,31 @@ import {
18
18
  handlePostToolUse,
19
19
  handleStop,
20
20
  reportEvent
21
- } from "../chunk-H6XU22TN.js";
22
- import "../chunk-YUGGNZSF.js";
21
+ } from "../chunk-IJ6ECPA6.js";
22
+ import "../chunk-DZURML2D.js";
23
23
  import {
24
24
  askUser,
25
25
  cancelQuestion,
26
26
  waitForAnswer
27
- } from "../chunk-EREBZHN2.js";
28
- import "../chunk-VOCZHOXV.js";
27
+ } from "../chunk-EGKXSQCY.js";
28
+ import "../chunk-V6QRSU2G.js";
29
29
  import "../chunk-POFBE6ZY.js";
30
- import "../chunk-BJENQBMH.js";
31
- import "../chunk-DESAUCH2.js";
32
- import "../chunk-DZTKLE7Q.js";
30
+ import "../chunk-JNXVOU6Y.js";
31
+ import "../chunk-KW2RRR7D.js";
32
+ import "../chunk-XNCMT7YY.js";
33
33
  import "../chunk-7QLSKOSU.js";
34
34
  import "../chunk-KZERVKTD.js";
35
- import "../chunk-VHNDE3ZD.js";
36
- import "../chunk-K32C2RGK.js";
35
+ import "../chunk-ROQK7IN3.js";
36
+ import "../chunk-DNJUSFBL.js";
37
37
  import "../chunk-T7E75EKA.js";
38
38
  import {
39
39
  getApiKey,
40
40
  getBaseUrl
41
- } from "../chunk-OSJEMXSR.js";
41
+ } from "../chunk-V4AQBAVG.js";
42
+ import "../chunk-B3UXMSMW.js";
42
43
  import {
43
44
  resolvePolicy
44
- } from "../chunk-CAS7GFWI.js";
45
- import "../chunk-EA3IELHP.js";
46
- import "../chunk-HWJW3CPO.js";
45
+ } from "../chunk-YROGUPOZ.js";
47
46
  export {
48
47
  askUser,
49
48
  cancelQuestion,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushary/agent-hooks",
3
- "version": "1.6.4",
3
+ "version": "1.7.0",
4
4
  "description": "Permission hooks for AI coding agents: route tool approvals through Pushary push notifications",
5
5
  "keywords": [
6
6
  "pushary",
@@ -67,6 +67,7 @@
67
67
  "pushary-connect": "./dist/bin/pushary-connect.js",
68
68
  "pushary-doctor": "./dist/bin/pushary-doctor.js",
69
69
  "pushary-mode": "./dist/bin/pushary-mode.js",
70
+ "pushary-mcp": "./dist/bin/pushary-mcp.js",
70
71
  "pushary-wait": "./dist/bin/pushary-wait.js",
71
72
  "pushary-stats": "./dist/bin/pushary-stats.js",
72
73
  "pushary-suggestions": "./dist/bin/pushary-suggestions.js",
@@ -1,65 +0,0 @@
1
- // src/cli/version.ts
2
- import { readFileSync } from "fs";
3
- import { dirname, join, parse } from "path";
4
- import { fileURLToPath } from "url";
5
- var PACKAGE_NAME = "@pushary/agent-hooks";
6
- var UNKNOWN_VERSION = "0.0.0";
7
- var findOwnPackageJson = (start) => {
8
- const { root } = parse(start);
9
- let dir = start;
10
- while (true) {
11
- const candidate = join(dir, "package.json");
12
- try {
13
- const pkg = JSON.parse(readFileSync(candidate, "utf-8"));
14
- if (pkg.name === PACKAGE_NAME) return candidate;
15
- } catch {
16
- }
17
- if (dir === root) return void 0;
18
- const parent = dirname(dir);
19
- if (parent === dir) return void 0;
20
- dir = parent;
21
- }
22
- };
23
- var getPackageVersion = () => {
24
- const root = ownPackageRoot();
25
- return (root === void 0 ? void 0 : packageVersionAt(root)) ?? UNKNOWN_VERSION;
26
- };
27
- var ownPackageRoot = () => {
28
- try {
29
- const found = findOwnPackageJson(dirname(fileURLToPath(import.meta.url)));
30
- return found ? dirname(found) : void 0;
31
- } catch {
32
- return void 0;
33
- }
34
- };
35
- var packageVersionAt = (packageRoot) => {
36
- try {
37
- const manifest = JSON.parse(readFileSync(join(packageRoot, "package.json"), "utf-8"));
38
- const version = manifest && typeof manifest === "object" && "version" in manifest ? manifest.version : void 0;
39
- return typeof version === "string" ? version : void 0;
40
- } catch {
41
- return void 0;
42
- }
43
- };
44
- var isNewerVersion = (candidate, current) => {
45
- const a = candidate.split(".").map((part) => parseInt(part, 10) || 0);
46
- const b = current.split(".").map((part) => parseInt(part, 10) || 0);
47
- for (let i = 0; i < 3; i++) {
48
- if ((a[i] ?? 0) > (b[i] ?? 0)) return true;
49
- if ((a[i] ?? 0) < (b[i] ?? 0)) return false;
50
- }
51
- return false;
52
- };
53
- var RELEASE_VERSION = /^\d+\.\d+\.\d+$/;
54
- var isReleaseVersion = (value) => RELEASE_VERSION.test(value);
55
- var majorOf = (version) => parseInt(version.split(".")[0] ?? "", 10) || 0;
56
- var isSameMajorVersion = (candidate, current) => majorOf(candidate) === majorOf(current);
57
-
58
- export {
59
- getPackageVersion,
60
- ownPackageRoot,
61
- packageVersionAt,
62
- isNewerVersion,
63
- isReleaseVersion,
64
- isSameMajorVersion
65
- };