@pushary/agent-hooks 0.4.4 → 0.4.5

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.
@@ -38,14 +38,16 @@ var main = async () => {
38
38
  console.log(` ${dim("Configuration")}`);
39
39
  const apiKey = process.env.PUSHARY_API_KEY;
40
40
  check(!!apiKey, "API key in environment", apiKey ? `pk_${apiKey.split(".")[0]?.slice(3, 7)}...` : "PUSHARY_API_KEY not set");
41
+ const CLAUDE_JSON = join(homedir(), ".claude.json");
42
+ const claudeJson = readJson(CLAUDE_JSON);
43
+ const mcpServers = claudeJson?.mcpServers ?? {};
44
+ const pusharyServer = mcpServers?.pushary;
45
+ check(!!pusharyServer, "Claude Code: MCP server configured");
46
+ if (pusharyServer) {
47
+ check(pusharyServer.type === "http", "Claude Code: MCP server type", pusharyServer.type ? String(pusharyServer.type) : 'missing \u2014 add type: "http"');
48
+ }
41
49
  const settings = readJson(CLAUDE_SETTINGS);
42
50
  if (settings) {
43
- const mcpServers = settings.mcpServers;
44
- const pusharyServer = mcpServers?.pushary;
45
- check(!!pusharyServer, "Claude Code: MCP server configured");
46
- if (pusharyServer) {
47
- check(pusharyServer.type === "http", "Claude Code: MCP server type", pusharyServer.type ? String(pusharyServer.type) : 'missing \u2014 add type: "http"');
48
- }
49
51
  const hooks = settings.hooks;
50
52
  const hasPreHook = JSON.stringify(hooks?.PreToolUse ?? []).includes("pushary-hook");
51
53
  const hasPostHook = JSON.stringify(hooks?.PostToolUse ?? []).includes("pushary-post-hook");
@@ -54,8 +56,8 @@ var main = async () => {
54
56
  check(hasPostHook, "Claude Code: PostToolUse hook");
55
57
  check(hasStopHook, "Claude Code: Stop hook");
56
58
  const permissions = settings.permissions;
57
- const hasWildcard = permissions?.allow?.some((r) => r === "MCP(pushary:*)") ?? false;
58
- check(hasWildcard, "Claude Code: Pushary tools auto-allowed", hasWildcard ? "MCP(pushary:*)" : "missing");
59
+ const hasWildcard = permissions?.allow?.some((r) => r === "mcp__pushary__*" || r === "MCP(pushary:*)") ?? false;
60
+ check(hasWildcard, "Claude Code: Pushary tools auto-allowed", hasWildcard ? "mcp__pushary__*" : "missing");
59
61
  const hasLegacyPerms = permissions?.allow?.some((r) => r.startsWith("mcp__pushary__")) ?? false;
60
62
  if (hasLegacyPerms) {
61
63
  console.log(` ${warn} Legacy individual permissions detected ${dim("(run pushary clean, then setup again)")}`);
@@ -130,7 +130,7 @@ var addToolPermissions = (settings) => {
130
130
  const permissions = settings.permissions ?? {};
131
131
  const allow = permissions.allow ?? [];
132
132
  const filtered = allow.filter((r) => !r.includes("pushary"));
133
- const rule = "MCP(pushary:*)";
133
+ const rule = "mcp__pushary__*";
134
134
  if (!filtered.includes(rule)) filtered.push(rule);
135
135
  permissions.allow = filtered;
136
136
  settings.permissions = permissions;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushary/agent-hooks",
3
- "version": "0.4.4",
3
+ "version": "0.4.5",
4
4
  "description": "Permission hooks for AI coding agents: route tool approvals through Pushary push notifications",
5
5
  "author": "Pushary <business@pushary.com>",
6
6
  "homepage": "https://pushary.com",