@pushary/agent-hooks 0.89.9 → 0.89.10

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 (67) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/bin/pushary-bell-hook.js +4 -4
  3. package/dist/bin/pushary-bell.js +7 -7
  4. package/dist/bin/pushary-claude.js +64 -33
  5. package/dist/bin/pushary-clean.js +52 -45
  6. package/dist/bin/pushary-codex-bridge.js +8 -8
  7. package/dist/bin/pushary-codex-hook.js +12 -8
  8. package/dist/bin/pushary-codex.js +7 -7
  9. package/dist/bin/pushary-connect.js +6 -6
  10. package/dist/bin/pushary-daemon.js +16 -16
  11. package/dist/bin/pushary-disconnect.js +34 -9
  12. package/dist/bin/pushary-doctor.js +19 -19
  13. package/dist/bin/pushary-elicitation-hook.js +4 -4
  14. package/dist/bin/pushary-gemini-bridge.js +7 -7
  15. package/dist/bin/pushary-gemini-hook.js +8 -8
  16. package/dist/bin/pushary-hook.js +11 -10
  17. package/dist/bin/pushary-login.js +4 -4
  18. package/dist/bin/pushary-logout.js +4 -4
  19. package/dist/bin/pushary-mode.js +3 -3
  20. package/dist/bin/pushary-notification-hook.js +7 -7
  21. package/dist/bin/pushary-opencode-hook.js +8 -8
  22. package/dist/bin/pushary-permission-denied-hook.js +11 -10
  23. package/dist/bin/pushary-permission-hook.js +11 -10
  24. package/dist/bin/pushary-post-hook.js +7 -7
  25. package/dist/bin/pushary-prompt-hook.js +7 -7
  26. package/dist/bin/pushary-session-end-hook.js +7 -7
  27. package/dist/bin/pushary-session-start-hook.js +7 -7
  28. package/dist/bin/pushary-setup.js +52 -54
  29. package/dist/bin/pushary-stats.js +2 -2
  30. package/dist/bin/pushary-status.js +8 -8
  31. package/dist/bin/pushary-stop-hook.js +7 -7
  32. package/dist/bin/pushary-stopfailure-hook.js +7 -7
  33. package/dist/bin/pushary-upgrade.js +15 -15
  34. package/dist/bin/pushary-wait.js +3 -3
  35. package/dist/{chunk-SS72Z7FV.js → chunk-253WC6O5.js} +1 -1
  36. package/dist/{chunk-T3LRWZKI.js → chunk-2LPEZYMC.js} +1 -1
  37. package/dist/{chunk-O5B7EK5U.js → chunk-34GN3IPX.js} +1 -1
  38. package/dist/{chunk-V6N4Q223.js → chunk-3CUDMTL4.js} +1 -1
  39. package/dist/{chunk-VZKXBFUA.js → chunk-3HFK3UXM.js} +1 -1
  40. package/dist/{chunk-543KNJKC.js → chunk-3SQYKLBW.js} +3 -3
  41. package/dist/{chunk-ATBKJNWS.js → chunk-6EKQZA6R.js} +5 -1
  42. package/dist/{chunk-NKHEHEUM.js → chunk-6XUABEX2.js} +1 -1
  43. package/dist/{chunk-I5L6SK5V.js → chunk-BLODMQKJ.js} +1 -1
  44. package/dist/{chunk-DKDDLF5P.js → chunk-DKWM5T3P.js} +1 -1
  45. package/dist/{chunk-BAE45YLP.js → chunk-FZ73G2RO.js} +3 -3
  46. package/dist/{chunk-EJT2ER6G.js → chunk-GSSFSVAQ.js} +15 -21
  47. package/dist/{chunk-4XZCDSNG.js → chunk-GTZLL7F4.js} +5 -5
  48. package/dist/{chunk-PMHTCDEO.js → chunk-IUN6VOKV.js} +1 -1
  49. package/dist/{chunk-OFRNZWC4.js → chunk-IUWRVTQK.js} +1 -1
  50. package/dist/{chunk-J2JZJZKB.js → chunk-KVE5RCQL.js} +1 -1
  51. package/dist/{chunk-A4O5ROZK.js → chunk-MZGWKIUZ.js} +2 -2
  52. package/dist/chunk-NCVIWGVA.js +18 -0
  53. package/dist/{chunk-C623LWJR.js → chunk-OLAGKKSR.js} +1 -1
  54. package/dist/{chunk-EA3E74P2.js → chunk-PZRWFWSR.js} +6 -6
  55. package/dist/{chunk-VA7VUNRD.js → chunk-Q223OM5J.js} +58 -8
  56. package/dist/{chunk-GMI5QZLG.js → chunk-QA72MKIT.js} +5 -1
  57. package/dist/{chunk-AIGDBRIJ.js → chunk-SYUIXXQW.js} +1 -1
  58. package/dist/{chunk-TF247BET.js → chunk-TEZ2FZD6.js} +1 -1
  59. package/dist/{chunk-KOPUTJQC.js → chunk-TG3T3M4K.js} +1 -1
  60. package/dist/{chunk-FX5QSMPY.js → chunk-TRVIRETT.js} +1 -1
  61. package/dist/{chunk-U5TQCQ25.js → chunk-TY5HVMXT.js} +1 -1
  62. package/dist/chunk-UDBJHQMG.js +240 -0
  63. package/dist/{chunk-GKAKAOKC.js → chunk-UXHMWF4H.js} +64 -11
  64. package/dist/{chunk-PZA7G4CN.js → chunk-X4ZUUFKV.js} +1 -0
  65. package/dist/{chunk-L4C2JXJS.js → chunk-X6RXX2NF.js} +5 -0
  66. package/dist/src/index.js +11 -10
  67. package/package.json +1 -1
@@ -4,13 +4,13 @@ import {
4
4
  } from "./chunk-XHKBHWLX.js";
5
5
  import {
6
6
  resolveGlobalBinary
7
- } from "./chunk-PZA7G4CN.js";
7
+ } from "./chunk-X4ZUUFKV.js";
8
8
  import {
9
9
  getMachineId
10
- } from "./chunk-DKDDLF5P.js";
10
+ } from "./chunk-DKWM5T3P.js";
11
11
  import {
12
12
  pusharyDir
13
- } from "./chunk-GMI5QZLG.js";
13
+ } from "./chunk-QA72MKIT.js";
14
14
  import {
15
15
  getPackageVersion
16
16
  } from "./chunk-DINDL2CF.js";
@@ -1,3 +1,7 @@
1
+ import {
2
+ ASKED_IN_EVERY_MODE_TOOLS
3
+ } from "./chunk-X6RXX2NF.js";
4
+
1
5
  // src/claude-tools.ts
2
6
  var PRETOOLUSE_GATED_TOOLS = [
3
7
  "Bash",
@@ -8,7 +12,7 @@ var PRETOOLUSE_GATED_TOOLS = [
8
12
  "PowerShell",
9
13
  "Monitor"
10
14
  ];
11
- var PRETOOLUSE_PHONE_ANSWERED_TOOLS = ["AskUserQuestion", "ExitPlanMode"];
15
+ var PRETOOLUSE_PHONE_ANSWERED_TOOLS = ASKED_IN_EVERY_MODE_TOOLS;
12
16
  var POSTTOOLUSE_MIRRORED_TOOLS = [...PRETOOLUSE_GATED_TOOLS, "TodoWrite"];
13
17
  var PRETOOLUSE_HANDLED_TOOLS = /* @__PURE__ */ new Set([...PRETOOLUSE_GATED_TOOLS, ...PRETOOLUSE_PHONE_ANSWERED_TOOLS]);
14
18
 
@@ -2,7 +2,7 @@ import {
2
2
  resolveBinary,
3
3
  resolveGlobalPackageVersion,
4
4
  resolvePackageVersionFromBinary
5
- } from "./chunk-PZA7G4CN.js";
5
+ } from "./chunk-X4ZUUFKV.js";
6
6
 
7
7
  // src/live-capabilities.ts
8
8
  var CLAUDE_BRIDGE_CAPABILITY = "claude-bridge";
@@ -12,7 +12,7 @@ import {
12
12
  } from "./chunk-2UMNXADU.js";
13
13
  import {
14
14
  isValidApiKey
15
- } from "./chunk-L4C2JXJS.js";
15
+ } from "./chunk-X6RXX2NF.js";
16
16
 
17
17
  // src/session.ts
18
18
  var IDENTITY_PATH = "/api/v1/server/identity";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  pusharyDir
3
- } from "./chunk-GMI5QZLG.js";
3
+ } from "./chunk-QA72MKIT.js";
4
4
  import {
5
5
  writeFileAtomic
6
6
  } from "./chunk-XX2V4QS5.js";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  hasGeminiHooks
3
- } from "./chunk-VA7VUNRD.js";
3
+ } from "./chunk-Q223OM5J.js";
4
4
  import {
5
5
  hasCodexHooks
6
- } from "./chunk-GMI5QZLG.js";
6
+ } from "./chunk-QA72MKIT.js";
7
7
  import {
8
8
  HOOK_LOCATOR_BINARY
9
- } from "./chunk-L4C2JXJS.js";
9
+ } from "./chunk-X6RXX2NF.js";
10
10
 
11
11
  // src/diagnostics/wiring.ts
12
12
  var record = (value) => value && typeof value === "object" && !Array.isArray(value) ? value : null;
@@ -1,11 +1,14 @@
1
1
  import {
2
2
  PRETOOLUSE_HANDLED_TOOLS,
3
3
  PRETOOLUSE_PHONE_ANSWERED_TOOLS
4
- } from "./chunk-ATBKJNWS.js";
4
+ } from "./chunk-6EKQZA6R.js";
5
+ import {
6
+ defersToNativeMode
7
+ } from "./chunk-NCVIWGVA.js";
5
8
  import {
6
9
  isGatingMoment,
7
10
  recordKeylessMoment
8
- } from "./chunk-VZKXBFUA.js";
11
+ } from "./chunk-3HFK3UXM.js";
9
12
  import {
10
13
  denyReasonFrom,
11
14
  isDeferAnswer
@@ -17,7 +20,7 @@ import {
17
20
  readLastUserPrompt,
18
21
  repoKeyFor,
19
22
  throttlePass
20
- } from "./chunk-4XZCDSNG.js";
23
+ } from "./chunk-GTZLL7F4.js";
21
24
  import {
22
25
  DEFAULT_SESSION,
23
26
  askUser,
@@ -25,7 +28,7 @@ import {
25
28
  pollForAnswer,
26
29
  savePendingQuestion,
27
30
  sendNotification
28
- } from "./chunk-GKAKAOKC.js";
31
+ } from "./chunk-UXHMWF4H.js";
29
32
  import {
30
33
  deriveAction,
31
34
  deriveActionBody,
@@ -33,10 +36,10 @@ import {
33
36
  deriveToolTarget,
34
37
  describeToolCall,
35
38
  scopePathFor
36
- } from "./chunk-KOPUTJQC.js";
39
+ } from "./chunk-TG3T3M4K.js";
37
40
  import {
38
41
  getMachineId
39
- } from "./chunk-DKDDLF5P.js";
42
+ } from "./chunk-DKWM5T3P.js";
40
43
  import {
41
44
  getApiKey,
42
45
  getBaseUrl
@@ -50,9 +53,8 @@ import {
50
53
  hookWaitDeadline,
51
54
  parseAgentQuestionAnswers,
52
55
  parseAgentQuestions,
53
- resolveGate,
54
- shouldDeferToNativeMode
55
- } from "./chunk-L4C2JXJS.js";
56
+ resolveGate
57
+ } from "./chunk-X6RXX2NF.js";
56
58
 
57
59
  // src/decision-episode.ts
58
60
  var EPISODE_PATH = "/api/agent/decision-episode";
@@ -302,15 +304,7 @@ var keylessNoticeOnce = (sessionId) => {
302
304
  } catch {
303
305
  }
304
306
  };
305
- var nativeDeferOptions = () => {
306
- const respect = process.env.PUSHARY_RESPECT_PERMISSION_MODE;
307
- const bypass = process.env.PUSHARY_DEFER_BYPASS;
308
- return {
309
- respectPermissionMode: !(respect === "0" || respect === "false"),
310
- deferBypass: bypass === "1" || bypass === "true"
311
- };
312
- };
313
- var shouldDeferToNativeMode2 = (permissionMode, toolName) => shouldDeferToNativeMode(permissionMode, toolName, nativeDeferOptions());
307
+ var shouldDeferToNativeMode = defersToNativeMode;
314
308
  var handedToTerminal = (result) => result.suppressed === true || result.noDevices === true || result.status === "terminal";
315
309
  var withLabels = (question) => ({
316
310
  ...question,
@@ -487,14 +481,14 @@ var handlePreToolUse = async (input) => {
487
481
  const policy = await getPolicy(apiKey, modeState.policyVersion, "claude_code", true, input.session_id);
488
482
  const verdict = resolveGate(claudeGateInput(modeState, policy, input));
489
483
  if (verdict.kind === "kill") return deny(verdict.reason);
484
+ if (verdict.kind === "deny") return deny(verdict.reason);
490
485
  if (input.tool_name === "AskUserQuestion") {
491
486
  return handleAskUserQuestion(apiKey, input);
492
487
  }
493
- if (verdict.kind === "deny") return deny(verdict.reason);
494
488
  if (input.tool_name === "ExitPlanMode") {
495
489
  return handleExitPlanMode(apiKey, input);
496
490
  }
497
- if (shouldDeferToNativeMode2(input.permission_mode, input.tool_name)) {
491
+ if (shouldDeferToNativeMode(input.permission_mode, input.tool_name)) {
498
492
  return void 0;
499
493
  }
500
494
  switch (verdict.kind) {
@@ -525,7 +519,7 @@ var toPermissionRequestOutput = (hookOutput) => {
525
519
  };
526
520
  var handlePermissionRequest = async (input) => {
527
521
  if (PRETOOLUSE_HANDLED_TOOLS.has(input.tool_name)) {
528
- const reclaimDeferredExec = !PRETOOLUSE_PHONE_ANSWERED_TOOLS.includes(input.tool_name) && shouldDeferToNativeMode2(input.permission_mode, input.tool_name);
522
+ const reclaimDeferredExec = !PRETOOLUSE_PHONE_ANSWERED_TOOLS.includes(input.tool_name) && shouldDeferToNativeMode(input.permission_mode, input.tool_name);
529
523
  if (!reclaimDeferredExec) return void 0;
530
524
  }
531
525
  if (input.tool_name.startsWith("mcp__pushary__")) return void 0;
@@ -12,7 +12,7 @@ import {
12
12
  savePendingCommand,
13
13
  sendNotification,
14
14
  waitForAnswer
15
- } from "./chunk-GKAKAOKC.js";
15
+ } from "./chunk-UXHMWF4H.js";
16
16
  import {
17
17
  AGENT_IDENTITIES,
18
18
  deriveReceiptMeta,
@@ -26,16 +26,16 @@ import {
26
26
  summarizeStop,
27
27
  taskTitleFrom,
28
28
  toolResultErrorText
29
- } from "./chunk-KOPUTJQC.js";
29
+ } from "./chunk-TG3T3M4K.js";
30
30
  import {
31
31
  getMachineId
32
- } from "./chunk-DKDDLF5P.js";
32
+ } from "./chunk-DKWM5T3P.js";
33
33
  import {
34
34
  withRetry
35
35
  } from "./chunk-BSZYIAZL.js";
36
36
  import {
37
37
  reportedInstallSource
38
- } from "./chunk-OFRNZWC4.js";
38
+ } from "./chunk-IUWRVTQK.js";
39
39
  import {
40
40
  getApiKey,
41
41
  getBaseUrl
@@ -51,7 +51,7 @@ import {
51
51
  pendingCommandEvents,
52
52
  resolveAutoResolveOrigin,
53
53
  resolvePolicy
54
- } from "./chunk-L4C2JXJS.js";
54
+ } from "./chunk-X6RXX2NF.js";
55
55
 
56
56
  // src/policy.ts
57
57
  import { createHash } from "crypto";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-2UMNXADU.js";
4
4
  import {
5
5
  redactSecrets
6
- } from "./chunk-L4C2JXJS.js";
6
+ } from "./chunk-X6RXX2NF.js";
7
7
 
8
8
  // src/crypto.ts
9
9
  import nacl from "tweetnacl";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-2UMNXADU.js";
4
4
  import {
5
5
  normalizeInstallSource
6
- } from "./chunk-L4C2JXJS.js";
6
+ } from "./chunk-X6RXX2NF.js";
7
7
 
8
8
  // src/install-source.ts
9
9
  import { readFileSync } from "fs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  parseVersion
3
- } from "./chunk-VA7VUNRD.js";
3
+ } from "./chunk-Q223OM5J.js";
4
4
 
5
5
  // src/setup/agent-probe.ts
6
6
  import { execSync } from "child_process";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  openCodeConfigDirFrom
3
- } from "./chunk-O5B7EK5U.js";
3
+ } from "./chunk-34GN3IPX.js";
4
4
  import {
5
5
  codexHomeFrom
6
- } from "./chunk-GMI5QZLG.js";
6
+ } from "./chunk-QA72MKIT.js";
7
7
 
8
8
  // src/vscode-config.ts
9
9
  import { homedir } from "os";
@@ -0,0 +1,18 @@
1
+ import {
2
+ shouldDeferToNativeMode
3
+ } from "./chunk-X6RXX2NF.js";
4
+
5
+ // src/native-defer.ts
6
+ var nativeDeferOptions = () => {
7
+ const respect = process.env.PUSHARY_RESPECT_PERMISSION_MODE;
8
+ const bypass = process.env.PUSHARY_DEFER_BYPASS;
9
+ return {
10
+ respectPermissionMode: !(respect === "0" || respect === "false"),
11
+ deferBypass: bypass === "1" || bypass === "true"
12
+ };
13
+ };
14
+ var defersToNativeMode = (permissionMode, toolName) => shouldDeferToNativeMode(permissionMode, toolName, nativeDeferOptions());
15
+
16
+ export {
17
+ defersToNativeMode
18
+ };
@@ -5,7 +5,7 @@ import {
5
5
  generateSessionKey,
6
6
  uploadTranscriptRecords,
7
7
  wrapSessionKey
8
- } from "./chunk-PMHTCDEO.js";
8
+ } from "./chunk-IUN6VOKV.js";
9
9
 
10
10
  // src/live-session.ts
11
11
  var MAX_TRANSCRIPT_QUEUE = 100;
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  detectClaudeVersion
3
- } from "./chunk-J2JZJZKB.js";
3
+ } from "./chunk-KVE5RCQL.js";
4
4
  import {
5
5
  claudeWired,
6
6
  codexWired,
7
7
  geminiWired
8
- } from "./chunk-BAE45YLP.js";
8
+ } from "./chunk-FZ73G2RO.js";
9
9
  import {
10
10
  GEMINI_HOOK_BINARY,
11
11
  addClaudeMcpServer,
@@ -14,14 +14,14 @@ import {
14
14
  addPusharyHooks,
15
15
  addPusharyToolPermissions,
16
16
  hasGeminiHooks
17
- } from "./chunk-VA7VUNRD.js";
17
+ } from "./chunk-Q223OM5J.js";
18
18
  import {
19
19
  guardBinary
20
- } from "./chunk-AIGDBRIJ.js";
20
+ } from "./chunk-SYUIXXQW.js";
21
21
  import {
22
22
  resolveGlobalBinDir,
23
23
  resolveGlobalBinary
24
- } from "./chunk-PZA7G4CN.js";
24
+ } from "./chunk-X4ZUUFKV.js";
25
25
  import {
26
26
  CODEX_HOOK_BINARY,
27
27
  addCodexHookTrust,
@@ -32,7 +32,7 @@ import {
32
32
  codexHooksJson,
33
33
  hasCodexHooks,
34
34
  vscodePluginMcp
35
- } from "./chunk-GMI5QZLG.js";
35
+ } from "./chunk-QA72MKIT.js";
36
36
  import {
37
37
  readJsonSafe
38
38
  } from "./chunk-XX2V4QS5.js";
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  PRETOOLUSE_GATED_TOOLS,
3
3
  PRETOOLUSE_PHONE_ANSWERED_TOOLS
4
- } from "./chunk-ATBKJNWS.js";
4
+ } from "./chunk-6EKQZA6R.js";
5
5
  import {
6
6
  guardBinary
7
- } from "./chunk-AIGDBRIJ.js";
7
+ } from "./chunk-SYUIXXQW.js";
8
8
  import {
9
9
  isProtectedByScope
10
- } from "./chunk-GMI5QZLG.js";
10
+ } from "./chunk-QA72MKIT.js";
11
11
  import {
12
12
  HOOK_BUDGETS,
13
13
  HOOK_LOCATOR_BINARY
14
- } from "./chunk-L4C2JXJS.js";
14
+ } from "./chunk-X6RXX2NF.js";
15
15
 
16
16
  // src/claude-config.ts
17
17
  import { join } from "path";
@@ -60,6 +60,7 @@ var CLAUDE_HOOK_EVENTS = [
60
60
  var supportedClaudeEvents = (version) => CLAUDE_HOOK_EVENTS.filter((hook) => version ? atLeast(version, hook.since) : hook.since === ESTABLISHED);
61
61
 
62
62
  // src/claude-config.ts
63
+ import { isDeepStrictEqual } from "util";
63
64
  var PUSHARY_MCP_URL = "https://pushary.com/api/mcp/mcp";
64
65
  var PUSHARY_PERMISSION_RULE = "mcp__pushary__*";
65
66
  var asRecord = (value) => value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
@@ -85,14 +86,59 @@ var isPusharyHook = (entry2, scope) => {
85
86
  return namesPusharyBinary(command);
86
87
  });
87
88
  };
89
+ var pusharyMcpServer = (apiKey) => ({
90
+ type: "http",
91
+ url: PUSHARY_MCP_URL,
92
+ headers: { Authorization: `Bearer ${apiKey}` }
93
+ });
88
94
  var addClaudeMcpServer = (config, apiKey) => {
89
95
  const mcpServers = ensureRecord(config, "mcpServers");
90
- mcpServers.pushary = {
91
- type: "http",
92
- url: PUSHARY_MCP_URL,
93
- headers: { Authorization: `Bearer ${apiKey}` }
96
+ mcpServers.pushary = pusharyMcpServer(apiKey);
97
+ };
98
+ var isClaudeMcpSnapshot = (value) => {
99
+ if (!value || typeof value !== "object" || Array.isArray(value)) return false;
100
+ const snapshot = value;
101
+ return typeof snapshot.hadMcpServers === "boolean" && typeof snapshot.mcpServersWasRecord === "boolean" && (!snapshot.hadMcpServers || snapshot.mcpServersWasRecord || Object.hasOwn(snapshot, "mcpServers")) && typeof snapshot.hadPushary === "boolean" && (!snapshot.hadPushary || Object.hasOwn(snapshot, "pushary")) && (!Object.hasOwn(snapshot, "installedPushary") || asRecord(snapshot.installedPushary)?.type === "http" && asRecord(snapshot.installedPushary)?.url === PUSHARY_MCP_URL);
102
+ };
103
+ var captureClaudeMcpServer = (config, apiKey) => {
104
+ const mcpServers = asRecord(config.mcpServers);
105
+ const hadMcpServers = Object.hasOwn(config, "mcpServers");
106
+ return {
107
+ hadMcpServers,
108
+ mcpServersWasRecord: Boolean(mcpServers),
109
+ ...hadMcpServers && !mcpServers ? { mcpServers: structuredClone(config.mcpServers) } : {},
110
+ hadPushary: Boolean(mcpServers && Object.hasOwn(mcpServers, "pushary")),
111
+ ...mcpServers && Object.hasOwn(mcpServers, "pushary") ? { pushary: structuredClone(mcpServers.pushary) } : {},
112
+ ...apiKey ? { installedPushary: pusharyMcpServer(apiKey) } : {}
94
113
  };
95
114
  };
115
+ var updateClaudeMcpSnapshot = (snapshot, apiKey) => ({
116
+ ...snapshot,
117
+ installedPushary: pusharyMcpServer(apiKey)
118
+ });
119
+ var restoreClaudeMcpServer = (config, snapshot) => {
120
+ const mcpServers = asRecord(config.mcpServers);
121
+ const current = asRecord(mcpServers?.pushary);
122
+ if (Object.hasOwn(snapshot, "installedPushary")) {
123
+ if (!isDeepStrictEqual(mcpServers?.pushary, snapshot.installedPushary)) return false;
124
+ } else if (current?.type !== "http" || current.url !== PUSHARY_MCP_URL) {
125
+ return false;
126
+ }
127
+ if (!snapshot.mcpServersWasRecord) {
128
+ if (Object.keys(mcpServers).length === 1) {
129
+ if (snapshot.hadMcpServers) config.mcpServers = structuredClone(snapshot.mcpServers);
130
+ else delete config.mcpServers;
131
+ } else {
132
+ delete mcpServers.pushary;
133
+ }
134
+ } else if (snapshot.hadPushary) {
135
+ mcpServers.pushary = structuredClone(snapshot.pushary);
136
+ } else {
137
+ delete mcpServers.pushary;
138
+ if (!snapshot.hadMcpServers && Object.keys(mcpServers).length === 0) delete config.mcpServers;
139
+ }
140
+ return true;
141
+ };
96
142
  var removeClaudeMcpServers = (config) => {
97
143
  let changed = false;
98
144
  const removeFrom = (target) => {
@@ -285,6 +331,10 @@ export {
285
331
  parseVersion,
286
332
  compareVersion,
287
333
  addClaudeMcpServer,
334
+ isClaudeMcpSnapshot,
335
+ captureClaudeMcpServer,
336
+ updateClaudeMcpSnapshot,
337
+ restoreClaudeMcpServer,
288
338
  removeClaudeMcpServers,
289
339
  addPusharyToolPermissions,
290
340
  addPusharyHooks,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  HOOK_BUDGETS,
3
3
  HOOK_LOCATOR_BINARY
4
- } from "./chunk-L4C2JXJS.js";
4
+ } from "./chunk-X6RXX2NF.js";
5
5
 
6
6
  // src/codex-config.ts
7
7
  import { createHash } from "crypto";
@@ -268,6 +268,8 @@ var vscodePluginDir = () => join2(homedir2(), ".pushary", "plugins", "vscode");
268
268
  var vscodePluginMcp = () => join2(vscodePluginDir(), ".mcp.json");
269
269
  var claudeSettingsLocal = () => join2(homedir2(), ".claude", "settings.local.json");
270
270
  var pusharyDir = () => join2(homedir2(), ".pushary");
271
+ var claudeMcpReceipt = () => join2(pusharyDir(), "setup", "claude-mcp.json");
272
+ var hermesConfigReceipt = () => join2(pusharyDir(), "setup", "hermes-config.json");
271
273
  var codexSkillDir2 = () => join2(codexHome(), "skills", "pushary");
272
274
  var codexAgentsMd2 = () => join2(codexHome(), "AGENTS.md");
273
275
  var geminiSettings = () => join2(homedir2(), ".gemini", "settings.json");
@@ -306,6 +308,8 @@ export {
306
308
  vscodePluginMcp,
307
309
  claudeSettingsLocal,
308
310
  pusharyDir,
311
+ claudeMcpReceipt,
312
+ hermesConfigReceipt,
309
313
  codexSkillDir2,
310
314
  codexAgentsMd2,
311
315
  geminiSettings,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  quoteIfNeeded
3
- } from "./chunk-PZA7G4CN.js";
3
+ } from "./chunk-X4ZUUFKV.js";
4
4
 
5
5
  // src/hook-command.ts
6
6
  var HOOK_SHELL = "/bin/sh -c";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  pusharyDir
3
- } from "./chunk-GMI5QZLG.js";
3
+ } from "./chunk-QA72MKIT.js";
4
4
  import {
5
5
  readJsonSafe
6
6
  } from "./chunk-XX2V4QS5.js";
@@ -5,7 +5,7 @@ import {
5
5
  FILE_TARGET_TOOLS,
6
6
  redactSecrets,
7
7
  redactSecretsDeep
8
- } from "./chunk-L4C2JXJS.js";
8
+ } from "./chunk-X6RXX2NF.js";
9
9
 
10
10
  // ../hook-mapping/src/describe.ts
11
11
  import { isAbsolute, relative, resolve } from "path";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  readConfigFileKey
3
- } from "./chunk-V6N4Q223.js";
3
+ } from "./chunk-3CUDMTL4.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
  getMachineId
3
- } from "./chunk-DKDDLF5P.js";
3
+ } from "./chunk-DKWM5T3P.js";
4
4
  import {
5
5
  getPackageVersion
6
6
  } from "./chunk-DINDL2CF.js";