@pushary/agent-hooks 1.9.10 → 1.9.12

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 (102) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +1 -1
  3. package/dist/bin/pushary-bell-hook.js +25 -21
  4. package/dist/bin/pushary-bell.js +9 -9
  5. package/dist/bin/pushary-claude.js +31 -34
  6. package/dist/bin/pushary-clean.js +35 -37
  7. package/dist/bin/pushary-codex-bridge.js +20 -22
  8. package/dist/bin/pushary-codex-hook.js +33 -36
  9. package/dist/bin/pushary-codex.js +12 -14
  10. package/dist/bin/pushary-connect.js +25 -27
  11. package/dist/bin/pushary-cowork.js +5 -5
  12. package/dist/bin/pushary-daemon.js +42 -39
  13. package/dist/bin/pushary-disconnect.js +33 -33
  14. package/dist/bin/pushary-doctor.js +39 -41
  15. package/dist/bin/pushary-elicitation-hook.js +26 -26
  16. package/dist/bin/pushary-gemini-bridge.js +13 -13
  17. package/dist/bin/pushary-gemini-hook.js +30 -33
  18. package/dist/bin/pushary-hook.js +31 -33
  19. package/dist/bin/pushary-login.js +12 -12
  20. package/dist/bin/pushary-logout.js +10 -10
  21. package/dist/bin/pushary-mcp.js +9 -9
  22. package/dist/bin/pushary-mode.js +12 -12
  23. package/dist/bin/pushary-notification-hook.js +24 -26
  24. package/dist/bin/pushary-opencode-hook.js +29 -32
  25. package/dist/bin/pushary-permission-denied-hook.js +29 -31
  26. package/dist/bin/pushary-permission-hook.js +28 -30
  27. package/dist/bin/pushary-post-hook.js +24 -26
  28. package/dist/bin/pushary-prompt-hook.js +24 -26
  29. package/dist/bin/pushary-session-end-hook.js +24 -26
  30. package/dist/bin/pushary-session-start-hook.js +28 -30
  31. package/dist/bin/pushary-setup.js +47 -44
  32. package/dist/bin/pushary-stats.js +5 -5
  33. package/dist/bin/pushary-status.js +27 -29
  34. package/dist/bin/pushary-stop-hook.js +24 -26
  35. package/dist/bin/pushary-stopfailure-hook.js +24 -26
  36. package/dist/bin/pushary-suggestions.js +12 -12
  37. package/dist/bin/pushary-transcript-register.js +17 -17
  38. package/dist/bin/pushary-transcripts.js +7 -7
  39. package/dist/bin/pushary-upgrade.js +30 -32
  40. package/dist/bin/pushary-wait.js +12 -12
  41. package/dist/bin/pushary.js +6 -6
  42. package/dist/{chunk-XKMGHVXW.js → chunk-2GBUL4NP.js} +6 -6
  43. package/dist/{chunk-H4F5O3RE.js → chunk-2NKTEA42.js} +1 -1
  44. package/dist/{chunk-RPQLZLKC.js → chunk-2QJ6K2SR.js} +7 -6
  45. package/dist/{chunk-GTZ4HIHU.js → chunk-3VPS7JPH.js} +2 -2
  46. package/dist/{chunk-AKPHYSEL.js → chunk-4DWQNP52.js} +4 -4
  47. package/dist/{chunk-SMVMLWCD.js → chunk-5HPC3RNE.js} +1 -1
  48. package/dist/{chunk-Z2Q2VH43.js → chunk-5VUB6VVO.js} +15 -3
  49. package/dist/{chunk-LDQGURCF.js → chunk-7U26QSMF.js} +514 -313
  50. package/dist/{chunk-C6QTMWJZ.js → chunk-A2DW2RNT.js} +4 -4
  51. package/dist/{chunk-UJZ7AGSC.js → chunk-AWD2SLNA.js} +4 -4
  52. package/dist/{chunk-2HXG2QDI.js → chunk-BNQKHPEC.js} +4 -4
  53. package/dist/{chunk-7HGR5GNY.js → chunk-BOHDM4T7.js} +46 -21
  54. package/dist/{chunk-PNC5ZQFS.js → chunk-BX2R7SIY.js} +6 -6
  55. package/dist/{chunk-I3W7GJ5R.js → chunk-CATIBZQH.js} +3 -3
  56. package/dist/{chunk-SJDMULE7.js → chunk-CKUACXAX.js} +5 -5
  57. package/dist/{chunk-XXLCYKVS.js → chunk-CMZ4CW5J.js} +3 -3
  58. package/dist/{chunk-5OP5MQI7.js → chunk-CPUEZAE2.js} +1 -1
  59. package/dist/{chunk-DWO4RLYK.js → chunk-CXKY5FGY.js} +8 -8
  60. package/dist/{chunk-ZSGJYSF2.js → chunk-DWHCF4RH.js} +136 -8
  61. package/dist/{chunk-BTFUSQFB.js → chunk-DYQ5QIDN.js} +2 -2
  62. package/dist/{chunk-CJYM4ZHV.js → chunk-E2FGVADR.js} +3 -5
  63. package/dist/{chunk-EVC765EO.js → chunk-EYLQVCME.js} +2 -2
  64. package/dist/{chunk-YUQHUGTH.js → chunk-FLPXTN3Q.js} +1 -1
  65. package/dist/{chunk-BVPPYR7B.js → chunk-FSCWOYK6.js} +3 -3
  66. package/dist/{chunk-2S34OPHS.js → chunk-GP44LTXN.js} +1 -1
  67. package/dist/{chunk-2HFSKYLN.js → chunk-GTM7C36Y.js} +2 -2
  68. package/dist/{chunk-U5FP5JIS.js → chunk-J5XCHLP4.js} +2 -2
  69. package/dist/{chunk-MD4SVNT6.js → chunk-JKGTASA2.js} +1 -1
  70. package/dist/{chunk-GQYX24UC.js → chunk-JNDELCH5.js} +1 -1
  71. package/dist/{chunk-PR2VDVCP.js → chunk-KXCWWHYO.js} +3 -3
  72. package/dist/{chunk-OL2Z7WI4.js → chunk-LBDMCNQY.js} +2 -2
  73. package/dist/{chunk-QGRENWJL.js → chunk-M2P3HQA3.js} +1 -1
  74. package/dist/{chunk-DAOQT4WK.js → chunk-MEHDBT5H.js} +2 -2
  75. package/dist/{chunk-ZGADIZDS.js → chunk-NDZKDJQU.js} +1 -1
  76. package/dist/{chunk-S2DAKKQQ.js → chunk-OBGZUD73.js} +3 -3
  77. package/dist/{chunk-APP43AW7.js → chunk-PKQ435Z2.js} +1 -1
  78. package/dist/{chunk-BVSIM4EF.js → chunk-PMUOEEUE.js} +2 -2
  79. package/dist/{chunk-DL6QHS7V.js → chunk-PNBJAYSL.js} +1 -1
  80. package/dist/{chunk-5RGA636G.js → chunk-QOBOIFGG.js} +231 -17
  81. package/dist/{chunk-IIVZZMSO.js → chunk-RBBMGCSZ.js} +1 -1
  82. package/dist/{chunk-TCXL5FQQ.js → chunk-RYBAJXV4.js} +1 -1
  83. package/dist/{chunk-SIHYBIEN.js → chunk-SJ7M37RL.js} +5 -5
  84. package/dist/{chunk-LXA236ZQ.js → chunk-SQJUXVLW.js} +2 -2
  85. package/dist/{chunk-6KNC6KLL.js → chunk-TSGQYARU.js} +4 -4
  86. package/dist/{chunk-BOSXFI7L.js → chunk-TZCHW6KR.js} +4 -4
  87. package/dist/{chunk-T6ZN4TEF.js → chunk-UEQWLVJB.js} +1 -1
  88. package/dist/{chunk-5MQYA3YL.js → chunk-VDPU4YQN.js} +19 -16
  89. package/dist/{chunk-UM5WXBKN.js → chunk-WBSL4FBX.js} +3 -3
  90. package/dist/{chunk-Q3UMWSE4.js → chunk-WKP2KRTU.js} +2 -2
  91. package/dist/{chunk-Y7JM47CI.js → chunk-YZWUTWDG.js} +2 -2
  92. package/dist/{chunk-QAGWWDXQ.js → chunk-Z6VYZSVA.js} +5 -5
  93. package/dist/{chunk-2M52CFVO.js → chunk-ZC6EVOX6.js} +1 -1
  94. package/dist/{chunk-MISUKJGW.js → chunk-ZHF4JDVE.js} +1 -1
  95. package/dist/{global-upgrade-PUM44JUH.js → global-upgrade-OCZWEF3A.js} +6 -6
  96. package/dist/{paths-U2MJGNBT.js → paths-SOGZJICO.js} +2 -2
  97. package/dist/{reapply-PRKV4EO7.js → reapply-DFG5IE6N.js} +20 -22
  98. package/dist/src/index.js +19 -21
  99. package/dist/{upgrade-lock-QZSVLEM7.js → upgrade-lock-XLE5GVWS.js} +3 -3
  100. package/package.json +1 -1
  101. package/dist/chunk-N6IOSZOE.js +0 -185
  102. package/dist/chunk-NQ67AF3V.js +0 -142
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  SETUP_FLAGS
3
- } from "./chunk-ZGADIZDS.js";
3
+ } from "./chunk-NDZKDJQU.js";
4
4
  import {
5
5
  parseFlags
6
6
  } from "./chunk-GMXKITVA.js";
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-7QLSKOSU.js";
10
10
  import {
11
11
  NPX_LATEST_COMMAND
12
- } from "./chunk-TCXL5FQQ.js";
12
+ } from "./chunk-RYBAJXV4.js";
13
13
  import {
14
14
  CLAUDE_CONNECTOR_GUIDE,
15
15
  CLAUDE_CONNECTOR_STEPS,
@@ -17,7 +17,7 @@ import {
17
17
  CLAUDE_CONNECTOR_URL,
18
18
  COWORK_CONNECTOR_LIMIT,
19
19
  COWORK_STANDING_INSTRUCTIONS
20
- } from "./chunk-5RGA636G.js";
20
+ } from "./chunk-QOBOIFGG.js";
21
21
 
22
22
  // src/cli/cowork.ts
23
23
  import { readFileSync } from "fs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  pusharyDir
3
- } from "./chunk-UJZ7AGSC.js";
3
+ } from "./chunk-AWD2SLNA.js";
4
4
  import {
5
5
  readJsonSafe
6
6
  } from "./chunk-T7E75EKA.js";
@@ -3,10 +3,10 @@ import {
3
3
  } from "./chunk-KZERVKTD.js";
4
4
  import {
5
5
  renderCommandHelp
6
- } from "./chunk-TCXL5FQQ.js";
6
+ } from "./chunk-RYBAJXV4.js";
7
7
  import {
8
8
  getPackageVersion
9
- } from "./chunk-5RGA636G.js";
9
+ } from "./chunk-QOBOIFGG.js";
10
10
 
11
11
  // src/cli/usage.ts
12
12
  var exitOnHelpFlag = (command) => {
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-POFBE6ZY.js";
4
4
  import {
5
5
  autoUpdateState
6
- } from "./chunk-UJZ7AGSC.js";
6
+ } from "./chunk-AWD2SLNA.js";
7
7
  import {
8
8
  readJsonSafe,
9
9
  writeJsonAtomic
@@ -14,7 +14,7 @@ import {
14
14
  cliPackagePathSegments,
15
15
  globalUpgradeEntry,
16
16
  ownPackageRoot
17
- } from "./chunk-5RGA636G.js";
17
+ } from "./chunk-QOBOIFGG.js";
18
18
 
19
19
  // src/auto-update.ts
20
20
  import { spawn } from "child_process";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  PRETOOLUSE_GATED_TOOLS
3
- } from "./chunk-5RGA636G.js";
3
+ } from "./chunk-QOBOIFGG.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-UJZ7AGSC.js";
3
+ } from "./chunk-AWD2SLNA.js";
4
4
 
5
5
  // src/bell/install.ts
6
6
  import { join } from "path";
@@ -5,16 +5,16 @@ import {
5
5
  import {
6
6
  NOTIFICATION_MATCHED_TYPES,
7
7
  POSTTOOLUSE_MIRRORED_TOOLS
8
- } from "./chunk-MD4SVNT6.js";
8
+ } from "./chunk-JKGTASA2.js";
9
9
  import {
10
10
  isProtectedByScope,
11
11
  registerHookEntry
12
- } from "./chunk-UJZ7AGSC.js";
12
+ } from "./chunk-AWD2SLNA.js";
13
13
  import {
14
14
  CLAUDE_PRETOOLUSE_MATCHER,
15
15
  HOOK_BUDGETS,
16
16
  HOOK_LOCATOR_BINARY
17
- } from "./chunk-5RGA636G.js";
17
+ } from "./chunk-QOBOIFGG.js";
18
18
 
19
19
  // src/gemini-config.ts
20
20
  var GEMINI_HOOK_BINARY = "pushary-gemini-hook";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  parseSseMessages
3
- } from "./chunk-I3W7GJ5R.js";
3
+ } from "./chunk-CATIBZQH.js";
4
4
  import {
5
5
  NPX_LATEST_COMMAND
6
- } from "./chunk-TCXL5FQQ.js";
6
+ } from "./chunk-RYBAJXV4.js";
7
7
 
8
8
  // src/mcp-stdio-bridge.ts
9
9
  var MCP_BRIDGE_BINARY = "pushary-mcp";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  readTranscriptPreference
3
- } from "./chunk-GTZ4HIHU.js";
3
+ } from "./chunk-3VPS7JPH.js";
4
4
 
5
5
  // src/transcript-setting.ts
6
6
  var transcriptEnvironmentPreference = () => {
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  CODEX_HOOK_STATUS
3
- } from "./chunk-Y7JM47CI.js";
3
+ } from "./chunk-YZWUTWDG.js";
4
4
  import {
5
5
  NPX_LATEST_COMMAND
6
- } from "./chunk-TCXL5FQQ.js";
6
+ } from "./chunk-RYBAJXV4.js";
7
7
 
8
8
  // src/setup/codex-trust.ts
9
9
  var CODEX_TRUST_TELEMETRY = {
@@ -10,7 +10,7 @@ import {
10
10
  isSetupConnectMode,
11
11
  isValidApiKey,
12
12
  normalizeAgentId
13
- } from "./chunk-5RGA636G.js";
13
+ } from "./chunk-QOBOIFGG.js";
14
14
 
15
15
  // src/setup/options.ts
16
16
  var AGENT_CHOICES = SETUP_AGENT_CHOICES;
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  openCodeConfigDirFrom
3
- } from "./chunk-QAGWWDXQ.js";
3
+ } from "./chunk-Z6VYZSVA.js";
4
4
  import {
5
5
  codexHomeFrom,
6
6
  resolvePathBinary
7
- } from "./chunk-UJZ7AGSC.js";
7
+ } from "./chunk-AWD2SLNA.js";
8
8
  import {
9
9
  HOOK_COMPATIBLE_PROFILES
10
- } from "./chunk-5RGA636G.js";
10
+ } from "./chunk-QOBOIFGG.js";
11
11
 
12
12
  // src/hermes-config.ts
13
13
  import { execFileSync } from "child_process";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  redactSecretsFromContent
3
- } from "./chunk-5RGA636G.js";
3
+ } from "./chunk-QOBOIFGG.js";
4
4
 
5
5
  // src/crypto.ts
6
6
  import nacl from "tweetnacl";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  pusharyHookExecutable
3
- } from "./chunk-SIHYBIEN.js";
3
+ } from "./chunk-SJ7M37RL.js";
4
4
  import {
5
5
  isProtectedByScope,
6
6
  registerHookEntry
7
- } from "./chunk-UJZ7AGSC.js";
7
+ } from "./chunk-AWD2SLNA.js";
8
8
 
9
9
  // src/cursor-config.ts
10
10
  var hookCommandOf = (entry) => {
@@ -2,7 +2,7 @@ import {
2
2
  autoUpdateLock,
3
3
  installPackageGlobally,
4
4
  npmErrorMessage
5
- } from "./chunk-UJZ7AGSC.js";
5
+ } from "./chunk-AWD2SLNA.js";
6
6
  import {
7
7
  writeJsonAtomic
8
8
  } from "./chunk-T7E75EKA.js";
@@ -227,6 +227,20 @@ var AGENTS = {
227
227
  enforcementDetail: "exec, write and edit through native PreToolUse hooks, answered in Devin's own approve/block schema.",
228
228
  capabilityNote: "Devin CLI answers PreToolUse with `{decision}` rather than a permission decision. Pushary blocks an unanswered approval because this adapter cannot request a native prompt reliably. Question and plan dialogs remain with Devin; this adapter does not render their answers. It also fires no Notification event."
229
229
  },
230
+ antigravity_cli: {
231
+ ...defaults,
232
+ label: "Antigravity CLI",
233
+ hookSource: "antigravity",
234
+ bridged: true,
235
+ policyAgent: "antigravity_cli",
236
+ repoAware: true,
237
+ disconnectable: true,
238
+ enforcement: "enforced",
239
+ connectVia: "Native hooks + MCP",
240
+ setupCommand: PUSHARY_SETUP_COMMAND,
241
+ enforcementDetail: "Shell commands, file writes, edits and MCP calls through native PreToolUse hooks in ~/.gemini/config/hooks.json, answered allow or deny.",
242
+ capabilityNote: 'Antigravity CLI ignores a hook\'s allow unless it runs in always-proceed mode (`toolPermission: "always-proceed"` or `--dangerously-skip-permissions`), so approving from the phone needs that mode, with Pushary as the only gate. Pushary answers allow or deny and never ask, because ask and force_ask run the call unprompted in that mode. An unanswered approval is blocked with a reason.'
243
+ },
230
244
  windsurf: {
231
245
  ...defaults,
232
246
  label: "Windsurf",
@@ -283,7 +297,7 @@ var normalizeAgentId = (value, accepted) => {
283
297
  };
284
298
 
285
299
  // ../contracts/src/agent-wiring.ts
286
- var COMPATIBLE_AGENT_TYPES = ["qwen_code", "codebuddy", "qoder", "droid", "devin"];
300
+ var COMPATIBLE_AGENT_TYPES = ["qwen_code", "codebuddy", "qoder", "droid", "devin", "antigravity_cli"];
287
301
  var CANONICAL_PATH_KEYS = ["file_path", "path", "notebook_path"];
288
302
  var CANONICAL_COMMAND_KEYS = ["command"];
289
303
  var SHELL_TOOLS = /* @__PURE__ */ new Set(["Bash", "PowerShell"]);
@@ -296,6 +310,10 @@ var firstString = (record, keys) => {
296
310
  }
297
311
  return void 0;
298
312
  };
313
+ var withCanonicalInputKeys = (profile, toolInput) => {
314
+ const renamed = Object.entries(profile.inputKeyAliases).flatMap(([agentKey, canonicalKey]) => toolInput[agentKey] === void 0 || toolInput[canonicalKey] !== void 0 ? [] : [[canonicalKey, toolInput[agentKey]]]);
315
+ return renamed.length === 0 ? toolInput : { ...toolInput, ...Object.fromEntries(renamed) };
316
+ };
299
317
  var canonicalToolName = (profile, toolName) => profile.toolAliases[toolName] ?? toolName;
300
318
  var toToolLookup = (profile, toolName, toolInput, resolvePath = (path) => path) => {
301
319
  const tool = canonicalToolName(profile, toolName);
@@ -310,10 +328,25 @@ var toToolLookup = (profile, toolName, toolInput, resolvePath = (path) => path)
310
328
  if (!PATH_TOOLS.has(tool)) return { tool, input: toolInput, unreadable: false };
311
329
  const filePath = firstString(toolInput, [...profile.pathInputKeys, ...CANONICAL_PATH_KEYS]);
312
330
  if (!filePath) return { tool, input: toolInput, unreadable: true };
313
- return { tool, input: { ...toolInput, file_path: resolvePath(filePath) }, unreadable: false };
331
+ return { tool, input: { ...withCanonicalInputKeys(profile, toolInput), file_path: resolvePath(filePath) }, unreadable: false };
332
+ };
333
+ var NO_AGENT_PROMPT_REASON = "Pushary needs an answer from the phone before this can run, and this agent has no approval prompt of its own here, so nothing ran. Ask the user, then try again.";
334
+ var DENIED_BY_PUSHARY_REASON = "Denied from Pushary.";
335
+ var UNCARRIED_ANSWER_REASON = "The answer from the phone cannot be passed to this agent, so the call did not run. Ask the question in chat instead.";
336
+ var renderAllowDenyDecision = (verdict) => {
337
+ const { permissionDecision, permissionDecisionReason } = verdict.hookSpecificOutput;
338
+ if (verdict.continue === false) {
339
+ return { decision: "deny", reason: verdict.stopReason ?? permissionDecisionReason ?? DENIED_BY_PUSHARY_REASON };
340
+ }
341
+ if (permissionDecision === "allow") {
342
+ return verdict.hookSpecificOutput.updatedInput ? { decision: "deny", reason: UNCARRIED_ANSWER_REASON } : { decision: "allow" };
343
+ }
344
+ if (permissionDecision === "ask") return { decision: "deny", reason: NO_AGENT_PROMPT_REASON };
345
+ return { decision: "deny", reason: permissionDecisionReason ?? DENIED_BY_PUSHARY_REASON };
314
346
  };
315
347
  var renderPreToolUseVerdict = (profile, verdict) => {
316
348
  if (profile.wire === "permission_decision") return verdict;
349
+ if (profile.wire === "allow_deny_decision") return renderAllowDenyDecision(verdict);
317
350
  const { permissionDecision, permissionDecisionReason, updatedInput } = verdict.hookSpecificOutput;
318
351
  if (permissionDecision === "ask") return { decision: "block", reason: permissionDecisionReason ?? "Pushary requires an explicit approval before this tool can run." };
319
352
  if (updatedInput) return void 0;
@@ -324,6 +357,41 @@ var renderPreToolUseVerdict = (profile, verdict) => {
324
357
  ...stop
325
358
  };
326
359
  };
360
+ var ANTIGRAVITY_MCP_TOOL = "call_mcp_tool";
361
+ var isPayloadRecord = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
362
+ var nonEmptyString = (value) => typeof value === "string" && value.length > 0 ? value : void 0;
363
+ var mcpToolCall = (args) => {
364
+ const server = nonEmptyString(args.ServerName);
365
+ const tool = nonEmptyString(args.ToolName);
366
+ if (!server || !tool) return void 0;
367
+ return { tool_name: `mcp__${server}__${tool}`, tool_input: isPayloadRecord(args.Arguments) ? args.Arguments : {} };
368
+ };
369
+ var antigravityToolCall = (toolCall) => {
370
+ if (!isPayloadRecord(toolCall)) return void 0;
371
+ const name = nonEmptyString(toolCall.name);
372
+ if (!name) return void 0;
373
+ const args = isPayloadRecord(toolCall.args) ? toolCall.args : {};
374
+ return (name === ANTIGRAVITY_MCP_TOOL ? mcpToolCall(args) : void 0) ?? { tool_name: name, tool_input: args };
375
+ };
376
+ var firstWorkspace = (payload) => Array.isArray(payload.workspacePaths) ? payload.workspacePaths.map(nonEmptyString).find(Boolean) : void 0;
377
+ var fromAntigravity = (event, payload) => {
378
+ const { toolCall, ...rest } = payload;
379
+ const call = antigravityToolCall(toolCall);
380
+ const cwd = firstWorkspace(payload) ?? nonEmptyString(call?.tool_input.Cwd);
381
+ const sessionId = nonEmptyString(payload.conversationId);
382
+ const transcriptPath = nonEmptyString(payload.transcriptPath);
383
+ const error = event === "PostToolUse" ? nonEmptyString(payload.error) : void 0;
384
+ return {
385
+ ...rest,
386
+ ...event ? { hook_event_name: event } : {},
387
+ ...sessionId ? { session_id: sessionId } : {},
388
+ ...transcriptPath ? { transcript_path: transcriptPath } : {},
389
+ ...cwd ? { cwd } : {},
390
+ ...call ?? {},
391
+ ...error ? { tool_response: { error } } : {}
392
+ };
393
+ };
394
+ var claudeShapedHookInput = (dialect, event, payload) => dialect === "antigravity" ? fromAntigravity(event, payload) : payload;
327
395
  var CLAUDE_SHAPED_EVENTS = [
328
396
  "PreToolUse",
329
397
  "PostToolUse",
@@ -361,15 +429,20 @@ var QWEN_CODE = {
361
429
  ask_user_question: "AskUserQuestion",
362
430
  exit_plan_mode: "ExitPlanMode"
363
431
  },
432
+ inputKeyAliases: {},
364
433
  extraMatchers: ["mcp__.*"],
365
434
  pathInputKeys: ["absolute_path"],
366
435
  shellCommandKeys: [],
367
436
  shellContextKeys: ["directory"],
368
437
  events: without("TeammateIdle", "Elicitation", "PermissionDenied"),
369
438
  wire: "permission_decision",
439
+ payload: "claude",
440
+ nonToolEntries: "nested",
370
441
  mcp: { shape: "gemini_http", file: [".qwen", "settings.json"], trusted: true },
371
442
  instructions: { file: [".qwen", "QWEN.md"], label: "Qwen Code" },
372
- permissionRuleFile: null
443
+ permissionRuleFile: null,
444
+ configDirIsShared: false,
445
+ setupNote: null
373
446
  };
374
447
  var CODEBUDDY = {
375
448
  agentType: "codebuddy",
@@ -379,15 +452,20 @@ var CODEBUDDY = {
379
452
  configFile: [".codebuddy", "settings.json"],
380
453
  hooksKeyPath: ["hooks"],
381
454
  toolAliases: {},
455
+ inputKeyAliases: {},
382
456
  extraMatchers: ["mcp__.*"],
383
457
  pathInputKeys: [],
384
458
  shellCommandKeys: [],
385
459
  shellContextKeys: [],
386
460
  events: without("Elicitation", "PermissionDenied"),
387
461
  wire: "permission_decision",
462
+ payload: "claude",
463
+ nonToolEntries: "nested",
388
464
  mcp: { shape: "claude_http", file: [".codebuddy", ".mcp.json"], trusted: false },
389
465
  instructions: { file: [".codebuddy", "CODEBUDDY.md"], label: "CodeBuddy" },
390
- permissionRuleFile: [".codebuddy", "settings.json"]
466
+ permissionRuleFile: [".codebuddy", "settings.json"],
467
+ configDirIsShared: false,
468
+ setupNote: null
391
469
  };
392
470
  var QODER = {
393
471
  agentType: "qoder",
@@ -397,15 +475,20 @@ var QODER = {
397
475
  configFile: [".qoder", "settings.json"],
398
476
  hooksKeyPath: ["hooks"],
399
477
  toolAliases: {},
478
+ inputKeyAliases: {},
400
479
  extraMatchers: ["mcp__.*"],
401
480
  pathInputKeys: [],
402
481
  shellCommandKeys: [],
403
482
  shellContextKeys: [],
404
483
  events: without("Elicitation", "PermissionDenied"),
405
484
  wire: "permission_decision",
485
+ payload: "claude",
486
+ nonToolEntries: "nested",
406
487
  mcp: { shape: "claude_http", file: [".qoder", "settings.json"], trusted: true },
407
488
  instructions: null,
408
- permissionRuleFile: null
489
+ permissionRuleFile: null,
490
+ configDirIsShared: false,
491
+ setupNote: null
409
492
  };
410
493
  var DROID = {
411
494
  agentType: "droid",
@@ -420,15 +503,20 @@ var DROID = {
420
503
  ApplyPatch: "Edit",
421
504
  FetchUrl: "WebFetch"
422
505
  },
506
+ inputKeyAliases: {},
423
507
  extraMatchers: ["mcp__.*"],
424
508
  pathInputKeys: [],
425
509
  shellCommandKeys: [],
426
510
  shellContextKeys: [],
427
511
  events: ["PreToolUse", "PostToolUse", "UserPromptSubmit", "Notification", "Stop", "SubagentStop", "PreCompact", "SessionStart", "SessionEnd"],
428
512
  wire: "permission_decision",
513
+ payload: "claude",
514
+ nonToolEntries: "nested",
429
515
  mcp: null,
430
516
  instructions: null,
431
- permissionRuleFile: null
517
+ permissionRuleFile: null,
518
+ configDirIsShared: false,
519
+ setupNote: null
432
520
  };
433
521
  var DEVIN = {
434
522
  agentType: "devin",
@@ -448,17 +536,57 @@ var DEVIN = {
448
536
  web_search: "WebSearch",
449
537
  run_subagent: "Task"
450
538
  },
539
+ inputKeyAliases: {},
451
540
  extraMatchers: ["mcp__.*", "mcp_call_tool", "write_to_process"],
452
541
  pathInputKeys: [],
453
542
  shellCommandKeys: [],
454
543
  shellContextKeys: [],
455
544
  events: ["PreToolUse", "PostToolUse", "UserPromptSubmit", "Stop", "SessionStart", "SessionEnd"],
456
545
  wire: "legacy_decision",
546
+ payload: "claude",
547
+ nonToolEntries: "nested",
457
548
  mcp: null,
458
549
  instructions: null,
459
- permissionRuleFile: null
550
+ permissionRuleFile: null,
551
+ configDirIsShared: false,
552
+ setupNote: null
553
+ };
554
+ var ANTIGRAVITY_CLI = {
555
+ agentType: "antigravity_cli",
556
+ source: "antigravity",
557
+ label: "Antigravity CLI",
558
+ binary: "agy",
559
+ configFile: [".gemini", "config", "hooks.json"],
560
+ hooksKeyPath: ["pushary"],
561
+ toolAliases: {
562
+ run_command: "Bash",
563
+ write_to_file: "Write",
564
+ replace_file_content: "Edit",
565
+ multi_replace_file_content: "Edit",
566
+ view_file: "Read",
567
+ read_url_content: "WebFetch",
568
+ search_web: "WebSearch"
569
+ },
570
+ inputKeyAliases: {
571
+ CodeContent: "content",
572
+ TargetContent: "old_string",
573
+ ReplacementContent: "new_string"
574
+ },
575
+ extraMatchers: [ANTIGRAVITY_MCP_TOOL],
576
+ pathInputKeys: ["TargetFile", "AbsolutePath"],
577
+ shellCommandKeys: ["CommandLine"],
578
+ shellContextKeys: ["Cwd"],
579
+ events: ["PreToolUse", "PostToolUse", "Stop"],
580
+ wire: "allow_deny_decision",
581
+ payload: "antigravity",
582
+ nonToolEntries: "handler",
583
+ mcp: { shape: "antigravity_http", file: [".gemini", "config", "mcp_config.json"], trusted: false },
584
+ instructions: null,
585
+ permissionRuleFile: null,
586
+ configDirIsShared: true,
587
+ setupNote: 'Approvals from your phone take effect only when Antigravity CLI runs in always-proceed mode: start it with --dangerously-skip-permissions, or set "toolPermission": "always-proceed" in ~/.gemini/antigravity-cli/settings.json. Pushary is then the only gate, and an unanswered approval is blocked.'
460
588
  };
461
- var HOOK_COMPATIBLE_PROFILES = Object.freeze([QWEN_CODE, CODEBUDDY, QODER, DROID, DEVIN]);
589
+ var HOOK_COMPATIBLE_PROFILES = Object.freeze([QWEN_CODE, CODEBUDDY, QODER, DROID, DEVIN, ANTIGRAVITY_CLI]);
462
590
  var hookCompatibleProfile = (agentType) => HOOK_COMPATIBLE_PROFILES.find((profile) => profile.agentType === agentType);
463
591
  var hookCompatibleProfileBySource = (source) => HOOK_COMPATIBLE_PROFILES.find((profile) => profile.source === source);
464
592
  var compatibleTargetFiles = (profile) => {
@@ -736,7 +864,7 @@ var AUTH_REJECTION_REASONS = [
736
864
  // ../contracts/src/declined-agents.ts
737
865
  var DECLINED_AGENTS_FILE = "declined-agents.json";
738
866
  var DECLINED_AGENTS_VERSION = 1;
739
- var isDeclinableAgent = (value) => typeof value === "string" && HOOK_SOURCES.includes(value);
867
+ var isDeclinableAgent = (value) => typeof value === "string" && DISCONNECT_AGENT_IDS.includes(value);
740
868
  var isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
741
869
  var canonicalAgents = (agents) => [...new Set(agents)].sort();
742
870
  var parseDeclinedAgents = (value) => {
@@ -871,7 +999,8 @@ var HOOK_BUDGETS = {
871
999
  codebuddy: { budgetSeconds: 600, guardSeconds: 10 },
872
1000
  qoder: { budgetSeconds: 600, guardSeconds: 10 },
873
1001
  droid: { budgetSeconds: 600, guardSeconds: 10 },
874
- devin: { budgetSeconds: 600, guardSeconds: 10 }
1002
+ devin: { budgetSeconds: 600, guardSeconds: 10 },
1003
+ antigravity: { budgetSeconds: 600, guardSeconds: 10 }
875
1004
  };
876
1005
  var hookMaxWaitSeconds = (agent) => Math.max(HOOK_BUDGETS[agent].budgetSeconds - HOOK_BUDGETS[agent].guardSeconds, 1);
877
1006
  var HOOK_HOLD_BUDGET_FLAG = "--hold-budget";
@@ -905,12 +1034,16 @@ var hookWaitClamped = (startMs, policyWaitSeconds, agent, nowMs) => startMs + ho
905
1034
  var effectiveWaitSeconds = (timeoutAction, policySeconds, agent) => timeoutAction === "wait" ? hookMaxWaitSeconds(agent) : policySeconds;
906
1035
  var OPENCODE_APPROVAL_EVENT = "permission.ask";
907
1036
  var CURSOR_GATE_EVENTS = ["beforeShellExecution", "beforeMCPExecution", "preToolUse"];
1037
+ var hasNativeApprovalPrompt = (source, event) => !(source === "cursor" && event === "preToolUse") && !(source === "antigravity" && event === "PreToolUse");
908
1038
  var SUPPORT_EMAIL = "business@pushary.com";
909
1039
  var SUPPORT_DISCORD = "https://discord.gg/9v3VvUByrr";
910
1040
  var HOOK_LOCATOR_BINARY = "pushary-bridge";
911
1041
  var isRecord2 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
1042
+ var isTokenCount = (value) => typeof value === "number" && Number.isInteger(value) && value >= 0;
1043
+ var reportableSessionId = (value) => typeof value === "string" && value.length > 0 && value.length <= SESSION_ID_MAX_LENGTH ? value : null;
912
1044
  var HOOK_BATCH_MAX_BYTES = 4 * 1024 * 1024;
913
1045
  var REPO_KEY_MAX_LENGTH = 200;
1046
+ var SESSION_ID_MAX_LENGTH = 200;
914
1047
  var WILDCARD_TOOL_PATTERN = "*";
915
1048
  var isRepoKeyMatch = (ruleRepoKey, currentRepoKey) => {
916
1049
  if (!ruleRepoKey) return true;
@@ -1142,7 +1275,9 @@ var SAFE_SHELL_COMMANDS = /* @__PURE__ */ new Set([
1142
1275
  "du",
1143
1276
  "df",
1144
1277
  "ps",
1145
- "true"
1278
+ "true",
1279
+ "sleep",
1280
+ "pgrep"
1146
1281
  ]);
1147
1282
  var SAFE_GIT_SUBCOMMANDS = /* @__PURE__ */ new Set([
1148
1283
  "status",
@@ -1164,6 +1299,8 @@ var SAFE_GIT_SUBCOMMANDS = /* @__PURE__ */ new Set([
1164
1299
  "count-objects"
1165
1300
  ]);
1166
1301
  var GIT_WRITE_FLAGS = (token) => token === "--output" || token.startsWith("--output=");
1302
+ var GIT_READ_ONLY_BRANCH_ARGUMENTS = ["branch", "--show-current"];
1303
+ var isReadOnlyGitBranch = (args) => args.length === GIT_READ_ONLY_BRANCH_ARGUMENTS.length && args.every((arg, index) => arg === GIT_READ_ONLY_BRANCH_ARGUMENTS[index]);
1167
1304
  var DANGEROUS_FIND_ACTIONS = /* @__PURE__ */ new Set([
1168
1305
  "-exec",
1169
1306
  "-execdir",
@@ -1270,6 +1407,7 @@ var isSafeSimpleCommand = (segment) => {
1270
1407
  if (exe === "git") {
1271
1408
  const sub = tokens[1];
1272
1409
  if (!sub || sub.startsWith("-")) return false;
1410
+ if (isReadOnlyGitBranch(tokens.slice(1))) return true;
1273
1411
  if (!SAFE_GIT_SUBCOMMANDS.has(sub)) return false;
1274
1412
  return !tokens.some(GIT_WRITE_FLAGS);
1275
1413
  }
@@ -1284,8 +1422,61 @@ var isSafeSimpleCommand = (segment) => {
1284
1422
  if (exe === "sed") return isPrintOnlySed(tokens.slice(1));
1285
1423
  if (exe === "date") return isReadOnlyDate(tokens.slice(1));
1286
1424
  if (exe === "printf") return isOutputOnlyPrintf(tokens.slice(1));
1425
+ if (exe === RIPGREP_PROGRAM) return carriesNoRefusedOption(tokens.slice(1), RIPGREP_OPTIONS_THAT_RUN_A_PROGRAM);
1426
+ if (exe === SORT_PROGRAM) return carriesNoRefusedOption(tokens.slice(1), SORT_OPTIONS_THAT_WRITE_OR_RUN);
1427
+ if (exe === UNIQ_PROGRAM) return uniqFileOperandCount(tokens.slice(1)) <= UNIQ_MAX_FILE_OPERANDS;
1287
1428
  return SAFE_SHELL_COMMANDS.has(exe);
1288
1429
  };
1430
+ var RIPGREP_PROGRAM = "rg";
1431
+ var RIPGREP_OPTIONS_THAT_RUN_A_PROGRAM = {
1432
+ long: ["--pre", "--pre-glob", "--hostname-bin", "--search-zip"],
1433
+ short: ["-z"]
1434
+ };
1435
+ var SORT_PROGRAM = "sort";
1436
+ var SORT_OPTIONS_THAT_WRITE_OR_RUN = {
1437
+ long: ["--output", "--compress-program", "--temporary-directory"],
1438
+ short: ["-o", "-T"]
1439
+ };
1440
+ var UNIQ_PROGRAM = "uniq";
1441
+ var UNIQ_MAX_FILE_OPERANDS = 1;
1442
+ var UNIQ_OPTIONS_WITH_A_SEPARATE_VALUE = [
1443
+ "-f",
1444
+ "-s",
1445
+ "-w",
1446
+ "--skip-fields",
1447
+ "--skip-chars",
1448
+ "--check-chars"
1449
+ ];
1450
+ var uniqFileOperandCount = (args) => {
1451
+ let operands = 0;
1452
+ let optionsEnded = false;
1453
+ for (let index = 0; index < args.length; index += 1) {
1454
+ const arg = args[index] ?? "";
1455
+ if (optionsEnded || !isFlagToken(arg) || arg === STDIN_OPERAND) {
1456
+ operands += 1;
1457
+ optionsEnded = true;
1458
+ } else if (arg === END_OF_OPTIONS) {
1459
+ optionsEnded = true;
1460
+ } else if (UNIQ_OPTIONS_WITH_A_SEPARATE_VALUE.includes(arg)) {
1461
+ index += 1;
1462
+ }
1463
+ }
1464
+ return operands;
1465
+ };
1466
+ var STDIN_OPERAND = "-";
1467
+ var LONG_OPTION_PREFIX = "--";
1468
+ var OPTION_VALUE_SEPARATOR = "=";
1469
+ var longOptionName = (token) => token.split(OPTION_VALUE_SEPARATOR, 1)[0] ?? token;
1470
+ var abbreviatesALongOption = (token, longOptions) => {
1471
+ const name = longOptionName(token);
1472
+ return longOptions.some((option) => option.startsWith(name));
1473
+ };
1474
+ var clustersAShortOption = (token, shortOptions) => shortOptions.some((option) => token.slice(1).includes(option.slice(1)));
1475
+ var isRefusedOption = (token, options) => {
1476
+ if (token === END_OF_OPTIONS || !isFlagToken(token)) return false;
1477
+ return token.startsWith(LONG_OPTION_PREFIX) ? abbreviatesALongOption(token, options.long) : clustersAShortOption(token, options.short);
1478
+ };
1479
+ var carriesNoRefusedOption = (args, options) => !args.some((arg) => isRefusedOption(arg, options));
1289
1480
  var SED_PRINT_ONLY_SCRIPT = /^(?:\d+|\$)(?:,(?:\d+|\$))?p$/;
1290
1481
  var SED_QUIET_FLAG = "-n";
1291
1482
  var DATE_FORMAT_PREFIX = "+";
@@ -1298,7 +1489,16 @@ var READ_ONLY_SEGMENT_SEPARATOR = /&&|\|\||[;|]/g;
1298
1489
  var PIPELINE_CHAIN_SEPARATOR = /&&|\|\||;/g;
1299
1490
  var EXPANSION_THAT_CAN_BECOME_A_FLAG = /\$|(?:^|\s)[*?[]/;
1300
1491
  var SHELL_QUOTE_CHARACTERS = /['"]/g;
1301
- var INSPECTED_ARGUMENT_COMMANDS = /* @__PURE__ */ new Set(["git", "find", "sed", "date", "printf"]);
1492
+ var INSPECTED_ARGUMENT_COMMANDS = /* @__PURE__ */ new Set([
1493
+ "git",
1494
+ "find",
1495
+ "sed",
1496
+ "date",
1497
+ "printf",
1498
+ RIPGREP_PROGRAM,
1499
+ SORT_PROGRAM,
1500
+ UNIQ_PROGRAM
1501
+ ]);
1302
1502
  var argumentsMayExpand = (segment) => {
1303
1503
  const visible = shellVisibleText(segment);
1304
1504
  return visible === null || EXPANSION_THAT_CAN_BECOME_A_FLAG.test(visible.replace(SHELL_QUOTE_CHARACTERS, ""));
@@ -2075,12 +2275,21 @@ var autoApprove = (tool) => ({
2075
2275
  mode: "terminal_only",
2076
2276
  pushFirstSeconds: 0
2077
2277
  });
2278
+ var CODEX_COORDINATION_TOOLS = [
2279
+ "mcp__codex_app__wait_threads",
2280
+ "mcp__codex_app__send_message_to_thread"
2281
+ ];
2282
+ var CODEX_COORDINATION_TOOL_NAMES = new Set(CODEX_COORDINATION_TOOLS);
2283
+ var isCodexCoordinationTool = (toolName) => CODEX_COORDINATION_TOOL_NAMES.has(toolName);
2284
+ var isNamedByARule = (rank) => rank !== void 0 && rank !== "wildcard";
2285
+ var isSpecificArgumentRank = (rank) => rank === "exact" || rank === "prefix";
2286
+ var shellReadOnlyFloorApplies = (toolName, arg, rank) => !isSpecificArgumentRank(rank) && toolName === "Bash" && typeof arg === "string" && isSafeReadOnlyCommand(arg);
2287
+ var coordinationFloorApplies = (toolName, rank) => isCodexCoordinationTool(toolName) && !isNamedByARule(rank);
2078
2288
  var resolveAutoResolveOrigin = (config, toolName, toolInput, cwd, repoKey, sessionId) => {
2079
2289
  const args = toolInput ? policyArgForms(toolName, toolInput, cwd) : [];
2080
2290
  const arg = args[0];
2081
- const match = selectGoverningRule(config.policies, toolName, args, repoKey, sessionId);
2082
- const governedBySpecificRule = match?.rank === "exact" || match?.rank === "prefix";
2083
- if (!governedBySpecificRule && toolName === "Bash" && typeof arg === "string" && isSafeReadOnlyCommand(arg)) {
2291
+ const rank = selectGoverningRule(config.policies, toolName, args, repoKey, sessionId)?.rank;
2292
+ if (shellReadOnlyFloorApplies(toolName, arg, rank) || coordinationFloorApplies(toolName, rank)) {
2084
2293
  return DECISION_ORIGIN.safeReadonly;
2085
2294
  }
2086
2295
  return DECISION_ORIGIN.autopilot;
@@ -2107,10 +2316,10 @@ var resolvePolicy = (config, toolName, modeOverride, toolInput, cwd, repoKey, se
2107
2316
  mode: config.defaultMode ?? "push_first",
2108
2317
  pushFirstSeconds: config.defaultPushFirstSeconds ?? 20
2109
2318
  };
2110
- const governedBySpecificRule = match?.rank === "exact" || match?.rank === "prefix";
2319
+ const governedBySpecificRule = isSpecificArgumentRank(match?.rank);
2111
2320
  const governedBySessionToolGrant = match?.rank === "tool" && isSessionToolGrant(match.policy);
2112
2321
  const governingMode = base.mode;
2113
- const approvedByReadOnlyFloor = !governedBySpecificRule && toolName === "Bash" && typeof arg === "string" && isSafeReadOnlyCommand(arg);
2322
+ const approvedByReadOnlyFloor = !isAutoDeny(base) && (shellReadOnlyFloorApplies(toolName, arg, match?.rank) || coordinationFloorApplies(toolName, match?.rank));
2114
2323
  if (governedBySessionToolGrant && !approvedByReadOnlyFloor && typeof arg === "string" && commandNeedsAPerson(toolName, arg)) {
2115
2324
  return resolvePolicy(withoutSessionToolGrants(config), toolName, modeOverride, toolInput, cwd, repoKey, sessionId);
2116
2325
  }
@@ -2430,6 +2639,7 @@ var pendingCommandEvents = (source) => {
2430
2639
  case "qoder":
2431
2640
  case "droid":
2432
2641
  case "devin":
2642
+ case "antigravity":
2433
2643
  return compatiblePendingCommandEvents(source);
2434
2644
  }
2435
2645
  };
@@ -2810,6 +3020,7 @@ export {
2810
3020
  canonicalToolName,
2811
3021
  toToolLookup,
2812
3022
  renderPreToolUseVerdict,
3023
+ claudeShapedHookInput,
2813
3024
  HOOK_COMPATIBLE_PROFILES,
2814
3025
  hookCompatibleProfile,
2815
3026
  hookCompatibleProfileBySource,
@@ -2853,9 +3064,12 @@ export {
2853
3064
  effectiveWaitSeconds,
2854
3065
  OPENCODE_APPROVAL_EVENT,
2855
3066
  CURSOR_GATE_EVENTS,
3067
+ hasNativeApprovalPrompt,
2856
3068
  SUPPORT_EMAIL,
2857
3069
  SUPPORT_DISCORD,
2858
3070
  HOOK_LOCATOR_BINARY,
3071
+ isTokenCount,
3072
+ reportableSessionId,
2859
3073
  normalizeRepoRemote,
2860
3074
  localRepoKey,
2861
3075
  isSafeReadOnlyCommand,