@pushary/agent-hooks 1.9.64 → 1.9.65

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 (103) hide show
  1. package/CHANGELOG.md +9 -1
  2. package/dist/{api-HDLTZTVR.js → api-32B3XLJR.js} +7 -7
  3. package/dist/bin/pushary-bell-hook.js +19 -19
  4. package/dist/bin/pushary-bell.js +5 -5
  5. package/dist/bin/pushary-claude.js +20 -20
  6. package/dist/bin/pushary-clean.js +32 -27
  7. package/dist/bin/pushary-codex-bridge.js +14 -14
  8. package/dist/bin/pushary-codex-hook.js +22 -22
  9. package/dist/bin/pushary-codex-session.js +6 -6
  10. package/dist/bin/pushary-codex.js +8 -8
  11. package/dist/bin/pushary-connect.js +19 -19
  12. package/dist/bin/pushary-daemon.js +30 -30
  13. package/dist/bin/pushary-disconnect.js +19 -19
  14. package/dist/bin/pushary-doctor.js +55 -31
  15. package/dist/bin/pushary-elicitation-hook.js +19 -19
  16. package/dist/bin/pushary-gemini-bridge.js +9 -9
  17. package/dist/bin/pushary-gemini-hook.js +20 -20
  18. package/dist/bin/pushary-hook.js +21 -21
  19. package/dist/bin/pushary-login.js +12 -12
  20. package/dist/bin/pushary-logout.js +18 -18
  21. package/dist/bin/pushary-mcp.js +8 -8
  22. package/dist/bin/pushary-mode.js +8 -8
  23. package/dist/bin/pushary-notification-hook.js +18 -18
  24. package/dist/bin/pushary-opencode-hook.js +19 -19
  25. package/dist/bin/pushary-permission-denied-hook.js +21 -21
  26. package/dist/bin/pushary-permission-hook.js +21 -21
  27. package/dist/bin/pushary-post-hook.js +18 -18
  28. package/dist/bin/pushary-prompt-hook.js +18 -18
  29. package/dist/bin/pushary-session-end-hook.js +20 -20
  30. package/dist/bin/pushary-session-start-hook.js +27 -27
  31. package/dist/bin/pushary-setup.js +56 -40
  32. package/dist/bin/pushary-status.js +23 -23
  33. package/dist/bin/pushary-stop-hook.js +18 -18
  34. package/dist/bin/pushary-stopfailure-hook.js +18 -18
  35. package/dist/bin/pushary-suggestions.js +8 -8
  36. package/dist/bin/pushary-transcript-register.js +11 -11
  37. package/dist/bin/pushary-transcripts.js +12 -12
  38. package/dist/bin/pushary-upgrade.js +31 -31
  39. package/dist/bin/pushary-wait.js +8 -8
  40. package/dist/bin/pushary.js +4 -4
  41. package/dist/{chunk-Q6ID23SU.js → chunk-3LF7T3NW.js} +3 -3
  42. package/dist/{chunk-MIPJ2VXP.js → chunk-3UNAPXED.js} +5 -5
  43. package/dist/{chunk-66FRMK7V.js → chunk-4LUWNBGD.js} +2 -2
  44. package/dist/{chunk-A5KQXZR7.js → chunk-6CZX6YOE.js} +2 -2
  45. package/dist/{chunk-EEM65CGJ.js → chunk-7ILQX47W.js} +1 -1
  46. package/dist/{chunk-5NP3OJ5P.js → chunk-ADXHPGBZ.js} +4 -4
  47. package/dist/{chunk-6QPDBD7Q.js → chunk-ANP3DIST.js} +1 -1
  48. package/dist/{chunk-H4BKC2GN.js → chunk-ATPJGHUP.js} +1 -1
  49. package/dist/{chunk-2PKHGHMA.js → chunk-BEQ3MEE3.js} +1 -1
  50. package/dist/{chunk-2KID4FK4.js → chunk-BKCI53W6.js} +2 -2
  51. package/dist/{chunk-2EY4HGLG.js → chunk-CSKABVSH.js} +1 -1
  52. package/dist/{chunk-6HPLEGUP.js → chunk-CU2PXLZ6.js} +3 -3
  53. package/dist/{chunk-RY4EPMZX.js → chunk-CZ65D6Q5.js} +2 -2
  54. package/dist/{chunk-PLMX3IHG.js → chunk-DM24VZOI.js} +2 -2
  55. package/dist/{chunk-E23RKH3T.js → chunk-DTVHZDYM.js} +3 -3
  56. package/dist/{chunk-OQKSF5ST.js → chunk-DXMUJTYF.js} +2 -2
  57. package/dist/{chunk-BLAIETMP.js → chunk-ED2SWTPC.js} +1 -1
  58. package/dist/{chunk-CJADXAJU.js → chunk-EEVE7H5Z.js} +1 -1
  59. package/dist/{chunk-QECRQWLV.js → chunk-F56GTJFG.js} +4 -4
  60. package/dist/{chunk-7UBDBJTG.js → chunk-FFSIYBBU.js} +3 -3
  61. package/dist/{chunk-ADRPW7KU.js → chunk-FWS2KLV2.js} +2 -2
  62. package/dist/{chunk-42PD2MQH.js → chunk-GA257T2E.js} +4 -4
  63. package/dist/{chunk-KA7JIMTG.js → chunk-GTBWWCCM.js} +3 -3
  64. package/dist/{chunk-LV6DX4P6.js → chunk-HDGB6SQ4.js} +2 -2
  65. package/dist/{chunk-IZTDX2MX.js → chunk-HIYLAC3C.js} +2 -2
  66. package/dist/{chunk-2YXBCZ3Z.js → chunk-I2UBF2SS.js} +1 -1
  67. package/dist/{chunk-JTOBQUIL.js → chunk-ICFHMJTW.js} +1 -1
  68. package/dist/{chunk-O7PCNYEY.js → chunk-ITYKN2K3.js} +1 -1
  69. package/dist/{chunk-AQAPPSDV.js → chunk-IZVEBBDH.js} +2 -2
  70. package/dist/{chunk-LA7CKRZN.js → chunk-JCWHOB36.js} +1 -1
  71. package/dist/{chunk-5TNGBDIE.js → chunk-JFKMPLNF.js} +2 -2
  72. package/dist/{chunk-2CEVEMJE.js → chunk-OA6EADFT.js} +3 -3
  73. package/dist/{chunk-KX3RMF6T.js → chunk-ONBL2GCU.js} +5 -5
  74. package/dist/{chunk-VNRWQCGU.js → chunk-P5HZEGT7.js} +61 -4
  75. package/dist/{chunk-YUDZCJYC.js → chunk-PP7FC3Y7.js} +6 -6
  76. package/dist/{chunk-57PU5OBL.js → chunk-Q2BD4IBX.js} +7 -7
  77. package/dist/{chunk-MPPTIZ2G.js → chunk-QNZ6G3LY.js} +5 -5
  78. package/dist/{chunk-DCMRNIDM.js → chunk-R4FL5JHK.js} +3 -3
  79. package/dist/{chunk-MXPOLQZH.js → chunk-RABLE5R6.js} +1 -1
  80. package/dist/{chunk-XF3AWNMO.js → chunk-RRHHWYPX.js} +5 -5
  81. package/dist/{chunk-BSZIPIFA.js → chunk-SCMEVDAR.js} +3 -3
  82. package/dist/{chunk-DVYVGBPB.js → chunk-SZBMTOUZ.js} +1 -1
  83. package/dist/{chunk-5TUDGSDC.js → chunk-TK4JU2F7.js} +1 -1
  84. package/dist/{chunk-QPPBH5NY.js → chunk-U2P2LQ5B.js} +4 -4
  85. package/dist/{chunk-QNATBOUH.js → chunk-UHS5MMAI.js} +1 -1
  86. package/dist/{chunk-JX3DHGZX.js → chunk-UM2X7HL6.js} +26 -11
  87. package/dist/{chunk-TR3GP5MH.js → chunk-UMTMFDL2.js} +1 -1
  88. package/dist/{chunk-NYV45Q25.js → chunk-W5L2ZLHE.js} +1 -1
  89. package/dist/{chunk-E2LB6JNV.js → chunk-WOHP7EL6.js} +6 -5
  90. package/dist/{chunk-ML2Q6WWE.js → chunk-WY6YAMZW.js} +3 -3
  91. package/dist/{chunk-CCNH4PJ2.js → chunk-XZCJC3QO.js} +7 -7
  92. package/dist/{chunk-PMLQRB3D.js → chunk-Z3M627TQ.js} +1 -1
  93. package/dist/{codex-app-cards-switch-JQ6356VX.js → codex-app-cards-switch-HK4RMOBI.js} +7 -7
  94. package/dist/{codex-desktop-launch-YUB2LOAG.js → codex-desktop-launch-OCO6N7SA.js} +1 -1
  95. package/dist/{codex-session-launch-UKMAORXS.js → codex-session-launch-ETZQTVFS.js} +12 -12
  96. package/dist/{global-upgrade-Y4USGPS2.js → global-upgrade-5DN5G3ZQ.js} +8 -8
  97. package/dist/{identity-W5CYL5RC.js → identity-EGL6HAWG.js} +3 -3
  98. package/dist/{live-capabilities-JRNNA5EP.js → live-capabilities-WU3FYJJG.js} +4 -4
  99. package/dist/{paths-4MEBINV3.js → paths-ZG6KDM6Y.js} +2 -2
  100. package/dist/{reapply-ZN7C3CB3.js → reapply-AQLNCCTE.js} +21 -21
  101. package/dist/src/index.js +13 -13
  102. package/dist/{upgrade-lock-QAWUV2DO.js → upgrade-lock-BIRXIKHJ.js} +3 -3
  103. package/package.json +1 -1
@@ -6,14 +6,14 @@ import {
6
6
  McpToolError,
7
7
  SubscriptionRequiredError,
8
8
  callMcpTool
9
- } from "./chunk-2KID4FK4.js";
9
+ } from "./chunk-BKCI53W6.js";
10
10
  import {
11
11
  installNetworkDefaults,
12
12
  isNetworkFailure
13
- } from "./chunk-EEM65CGJ.js";
13
+ } from "./chunk-7ILQX47W.js";
14
14
  import {
15
15
  clientReportClaims
16
- } from "./chunk-H4BKC2GN.js";
16
+ } from "./chunk-ATPJGHUP.js";
17
17
  import {
18
18
  getApiKey,
19
19
  getBaseUrl
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  autoUpdateLock
3
- } from "./chunk-H4BKC2GN.js";
3
+ } from "./chunk-ATPJGHUP.js";
4
4
  import {
5
5
  installPackageGlobally,
6
6
  npmErrorMessage,
7
7
  writeJsonAtomic
8
- } from "./chunk-BSZIPIFA.js";
8
+ } from "./chunk-SCMEVDAR.js";
9
9
 
10
10
  // src/upgrade-lock.ts
11
11
  import { fork } from "child_process";
@@ -6,7 +6,7 @@ import {
6
6
  readJsonSafe,
7
7
  writeFileAtomic,
8
8
  writeJsonAtomic
9
- } from "./chunk-BSZIPIFA.js";
9
+ } from "./chunk-SCMEVDAR.js";
10
10
  import {
11
11
  configFilePath
12
12
  } from "./chunk-Y64JGYTB.js";
@@ -12,7 +12,7 @@ import {
12
12
  reachVerdict,
13
13
  reachesYou,
14
14
  verifyDelivery
15
- } from "./chunk-JTOBQUIL.js";
15
+ } from "./chunk-ICFHMJTW.js";
16
16
  import {
17
17
  humanIsTty,
18
18
  writeHuman
@@ -3,21 +3,21 @@ import {
3
3
  expectedLaunchCapabilities,
4
4
  hasSpawnProvider,
5
5
  resolveControlPolicy
6
- } from "./chunk-DCMRNIDM.js";
6
+ } from "./chunk-R4FL5JHK.js";
7
7
  import {
8
8
  daemonHasRemoteProof,
9
9
  daemonServiceManagerAvailable,
10
10
  hasDaemonServiceDefinition,
11
11
  readDaemonNeedsLogin,
12
12
  readDaemonStatus
13
- } from "./chunk-5NP3OJ5P.js";
13
+ } from "./chunk-ADXHPGBZ.js";
14
14
  import {
15
15
  readControlMode,
16
16
  readKeySource
17
- } from "./chunk-BLAIETMP.js";
17
+ } from "./chunk-ED2SWTPC.js";
18
18
  import {
19
19
  getMachineId
20
- } from "./chunk-ADRPW7KU.js";
20
+ } from "./chunk-FWS2KLV2.js";
21
21
  import {
22
22
  getBaseUrl
23
23
  } from "./chunk-Y64JGYTB.js";
@@ -2,19 +2,19 @@ import {
2
2
  SIGNED_OUT_ON_MAC_MESSAGE,
3
3
  describeSignedOutKey,
4
4
  readSignedOutDiagnosis
5
- } from "./chunk-O7PCNYEY.js";
5
+ } from "./chunk-ITYKN2K3.js";
6
6
  import {
7
7
  createIo
8
8
  } from "./chunk-FO3MDD26.js";
9
9
  import {
10
10
  readKeySource
11
- } from "./chunk-BLAIETMP.js";
11
+ } from "./chunk-ED2SWTPC.js";
12
12
  import {
13
13
  absoluteUrl,
14
14
  checkApiKey,
15
15
  describeKeyCheck,
16
16
  keyCheckFromResponse
17
- } from "./chunk-QNATBOUH.js";
17
+ } from "./chunk-UHS5MMAI.js";
18
18
  import {
19
19
  EXIT
20
20
  } from "./chunk-KZERVKTD.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  pusharyDir
3
- } from "./chunk-H4BKC2GN.js";
3
+ } from "./chunk-ATPJGHUP.js";
4
4
  import {
5
5
  writeFileAtomic
6
- } from "./chunk-BSZIPIFA.js";
6
+ } from "./chunk-SCMEVDAR.js";
7
7
 
8
8
  // src/identity.ts
9
9
  import { randomUUID } from "crypto";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  APPROVAL_SETTINGS_PATH
3
- } from "./chunk-7UBDBJTG.js";
3
+ } from "./chunk-FFSIYBBU.js";
4
4
  import {
5
5
  readMacAppAgentKey
6
- } from "./chunk-QPPBH5NY.js";
6
+ } from "./chunk-U2P2LQ5B.js";
7
7
  import {
8
8
  findExportedKeyLines,
9
9
  isAdoptedMacAppKey,
@@ -13,10 +13,10 @@ import {
13
13
  readConfigFileKey,
14
14
  readKeySource,
15
15
  readMacAppKeyPrefix
16
- } from "./chunk-BLAIETMP.js";
16
+ } from "./chunk-ED2SWTPC.js";
17
17
  import {
18
18
  absoluteUrl
19
- } from "./chunk-QNATBOUH.js";
19
+ } from "./chunk-UHS5MMAI.js";
20
20
  import {
21
21
  isValidApiKey
22
22
  } from "./chunk-MNKIR2ZB.js";
@@ -1,20 +1,20 @@
1
1
  import {
2
2
  GEMINI_HOOK_EVENTS,
3
3
  hasGeminiHooks
4
- } from "./chunk-6QPDBD7Q.js";
4
+ } from "./chunk-ANP3DIST.js";
5
5
  import {
6
6
  AGENT_CHOICES
7
7
  } from "./chunk-SROWUG5W.js";
8
8
  import {
9
9
  BELL_HOOK_BINARY
10
- } from "./chunk-PMLQRB3D.js";
10
+ } from "./chunk-Z3M627TQ.js";
11
11
  import {
12
12
  CLAUDE_HOOK_EVENTS,
13
13
  CODEX_HOOK_EVENTS,
14
14
  HOOK_SHELL,
15
15
  hasCodexHooks,
16
16
  holdBudgetOf
17
- } from "./chunk-H4BKC2GN.js";
17
+ } from "./chunk-ATPJGHUP.js";
18
18
  import {
19
19
  CURSOR_GATE_EVENTS,
20
20
  HOOK_LOCATOR_BINARY,
@@ -7,10 +7,10 @@ import {
7
7
  codexHome,
8
8
  codexHooksJsonIn,
9
9
  isPusharyCodexCommand
10
- } from "./chunk-H4BKC2GN.js";
10
+ } from "./chunk-ATPJGHUP.js";
11
11
  import {
12
12
  resolvePathBinary
13
- } from "./chunk-BSZIPIFA.js";
13
+ } from "./chunk-SCMEVDAR.js";
14
14
  import {
15
15
  getPackageVersion
16
16
  } from "./chunk-QTOLNRET.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  findNativeClaudeInstall
3
- } from "./chunk-MXPOLQZH.js";
3
+ } from "./chunk-RABLE5R6.js";
4
4
  import {
5
5
  parseVersion
6
- } from "./chunk-BSZIPIFA.js";
6
+ } from "./chunk-SCMEVDAR.js";
7
7
  import {
8
8
  isRecord
9
9
  } from "./chunk-MNKIR2ZB.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  readConfigFileKey
3
- } from "./chunk-BLAIETMP.js";
3
+ } from "./chunk-ED2SWTPC.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
  callMcpTool
3
- } from "./chunk-2KID4FK4.js";
3
+ } from "./chunk-BKCI53W6.js";
4
4
  import {
5
5
  NPX_LATEST_COMMAND
6
6
  } from "./chunk-BAGBCSXA.js";
@@ -4,7 +4,7 @@ import {
4
4
  keyPrefix,
5
5
  readConfigFileKey,
6
6
  readMacAppKeyPrefix
7
- } from "./chunk-BLAIETMP.js";
7
+ } from "./chunk-ED2SWTPC.js";
8
8
  import {
9
9
  NPX_LATEST_COMMAND
10
10
  } from "./chunk-BAGBCSXA.js";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  pusharyDir
3
- } from "./chunk-H4BKC2GN.js";
3
+ } from "./chunk-ATPJGHUP.js";
4
4
  import {
5
5
  readJsonSafe,
6
6
  writeFileAtomic
7
- } from "./chunk-BSZIPIFA.js";
7
+ } from "./chunk-SCMEVDAR.js";
8
8
  import {
9
9
  DECLINED_AGENTS_FILE,
10
10
  DISCONNECT_AGENT_IDS,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  CODEX_HOOK_STATUS
3
- } from "./chunk-LV6DX4P6.js";
3
+ } from "./chunk-HDGB6SQ4.js";
4
4
  import {
5
5
  NPX_LATEST_COMMAND
6
6
  } from "./chunk-BAGBCSXA.js";
@@ -294,7 +294,7 @@ var loadedOnce = (load) => {
294
294
  };
295
295
 
296
296
  // src/codex-desktop-proxy.ts
297
- var loadThePhone = () => import("./api-HDLTZTVR.js");
297
+ var loadThePhone = () => import("./api-32B3XLJR.js");
298
298
  var theFirstCardLoadsAgain = () => {
299
299
  };
300
300
  var APP_SERVER_COMMAND = "app-server";
@@ -827,7 +827,7 @@ var codexDesktopCommand = async (args, entry, readAccount) => {
827
827
  return runCodexDesktopProxy(engine2, args.slice(3), readAccount, { watchesForCards: layoutIsKnown });
828
828
  }
829
829
  if (args[0] === APP_CARDS_FLAG) {
830
- const { codexAppCardsCommandOnThisMac } = await import("./codex-app-cards-switch-JQ6356VX.js");
830
+ const { codexAppCardsCommandOnThisMac } = await import("./codex-app-cards-switch-HK4RMOBI.js");
831
831
  return codexAppCardsCommandOnThisMac(args.slice(1), entry, readAccount);
832
832
  }
833
833
  if (args.length > 2) throw new Error("Usage: pushary codex --desktop [path/to/Codex.app]");
@@ -8,20 +8,20 @@ import {
8
8
  everyProgramFileIsThere,
9
9
  installedCodexApp,
10
10
  shellQuoted
11
- } from "./chunk-5TNGBDIE.js";
11
+ } from "./chunk-JFKMPLNF.js";
12
12
  import {
13
13
  writeHuman
14
14
  } from "./chunk-QCGNGEGE.js";
15
15
  import {
16
16
  xml
17
- } from "./chunk-5NP3OJ5P.js";
17
+ } from "./chunk-ADXHPGBZ.js";
18
18
  import {
19
19
  CODEX_APP_LAUNCH_AT_LOGIN_VERB,
20
20
  CODEX_APP_LAUNCH_VARIABLE
21
21
  } from "./chunk-E46NE7FB.js";
22
22
  import {
23
23
  writeFileAtomic
24
- } from "./chunk-BSZIPIFA.js";
24
+ } from "./chunk-SCMEVDAR.js";
25
25
 
26
26
  // src/codex-app-cards-switch.ts
27
27
  import { execFileSync as execFileSync2 } from "child_process";
@@ -1,20 +1,20 @@
1
1
  import {
2
2
  openCodeConfigDirFrom
3
- } from "./chunk-VNRWQCGU.js";
3
+ } from "./chunk-P5HZEGT7.js";
4
4
  import {
5
5
  nativeClaudeInstallPath
6
- } from "./chunk-MXPOLQZH.js";
6
+ } from "./chunk-RABLE5R6.js";
7
7
  import {
8
8
  grokHome
9
- } from "./chunk-ML2Q6WWE.js";
9
+ } from "./chunk-WY6YAMZW.js";
10
10
  import {
11
11
  claudeConfigDir,
12
12
  clineDataDirectory,
13
13
  codexHomeFrom
14
- } from "./chunk-H4BKC2GN.js";
14
+ } from "./chunk-ATPJGHUP.js";
15
15
  import {
16
16
  resolvePathBinary
17
- } from "./chunk-BSZIPIFA.js";
17
+ } from "./chunk-SCMEVDAR.js";
18
18
  import {
19
19
  HOOK_COMPATIBLE_PROFILES
20
20
  } from "./chunk-MNKIR2ZB.js";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  compatibleConfigFile
3
- } from "./chunk-ML2Q6WWE.js";
3
+ } from "./chunk-WY6YAMZW.js";
4
4
  import {
5
5
  hookOwnerOf,
6
6
  hookOwnerOfCommands,
7
7
  liveBridgeProbe,
8
8
  resolveBridgeStub
9
- } from "./chunk-KA7JIMTG.js";
9
+ } from "./chunk-GTBWWCCM.js";
10
10
  import {
11
11
  AGENT_CHOICES
12
12
  } from "./chunk-SROWUG5W.js";
@@ -18,10 +18,10 @@ import {
18
18
  guardedArgv,
19
19
  pusharyDir,
20
20
  vscodePluginDir
21
- } from "./chunk-H4BKC2GN.js";
21
+ } from "./chunk-ATPJGHUP.js";
22
22
  import {
23
23
  readJsonSafe
24
- } from "./chunk-BSZIPIFA.js";
24
+ } from "./chunk-SCMEVDAR.js";
25
25
  import {
26
26
  HOOK_BUDGETS,
27
27
  HOOK_COMPATIBLE_PROFILES,
@@ -456,6 +456,59 @@ var addOpenCodeMcpServer = (config, apiKey) => {
456
456
  };
457
457
  config.mcp = servers;
458
458
  };
459
+ var OPENCODE_ASKED_PERMISSIONS = ["bash", "edit", "webfetch"];
460
+ var PERMISSION_KEY = "permission";
461
+ var TOOLS_KEY = "tools";
462
+ var ASK_ACTION = "ask";
463
+ var ALLOW_ACTION = "allow";
464
+ var DENY_ACTION = "deny";
465
+ var ALL_PATTERNS = "*";
466
+ var OPENCODE_ACTION_NAMES = {
467
+ bash: ["bash", "shell"],
468
+ edit: ["edit", "write", "patch"],
469
+ webfetch: ["webfetch"]
470
+ };
471
+ var escapedForPattern = (text) => text.replace(/[.+^${}()|[\]\\]/g, "\\$&").replaceAll("?", ".");
472
+ var keyMatches = (key, name) => new RegExp(`^${key.split(ALL_PATTERNS).map(escapedForPattern).join(".*")}$`).test(name);
473
+ var ruleNamesPermission = (permission) => ([key]) => OPENCODE_ACTION_NAMES[permission].some((name) => keyMatches(key, name));
474
+ var toolRules = (config) => Object.entries(asRecord(config[TOOLS_KEY]) ?? {}).filter(([, enabled]) => typeof enabled === "boolean").map(([key, enabled]) => [key, enabled ? ALLOW_ACTION : DENY_ACTION]);
475
+ var permissionRules = (config) => {
476
+ const permission = config[PERMISSION_KEY];
477
+ if (permission === void 0) return [];
478
+ const rules = asRecord(permission);
479
+ return rules ? Object.entries(rules) : [[ALL_PATTERNS, permission]];
480
+ };
481
+ var rulesInOrder = (config) => [...toolRules(config), ...permissionRules(config)];
482
+ var actionOfRule = (value) => {
483
+ const patterns = asRecord(value);
484
+ return patterns ? patterns[ALL_PATTERNS] : value;
485
+ };
486
+ var holdsTheCall = (action) => action === ASK_ACTION || action === DENY_ACTION;
487
+ var withOpenCodeAskRules = (config) => {
488
+ const permission = config[PERMISSION_KEY];
489
+ const rules = asRecord(permission);
490
+ if (permission !== void 0 && !rules) return { config, change: { kind: "person-setting-kept" } };
491
+ const personRules = rulesInOrder(config);
492
+ const added = OPENCODE_ASKED_PERMISSIONS.filter((name) => !personRules.some(ruleNamesPermission(name)));
493
+ if (added.length === 0) return { config, change: { kind: "present" } };
494
+ const asks = Object.fromEntries(added.map((name) => [name, ASK_ACTION]));
495
+ return { config: { ...config, [PERMISSION_KEY]: { ...asks, ...rules } }, change: { kind: "added", added } };
496
+ };
497
+ var openCodePermissionsLeftOpen = (config) => {
498
+ const rules = rulesInOrder(asRecord(config) ?? {});
499
+ return OPENCODE_ASKED_PERMISSIONS.filter((name) => !holdsTheCall(
500
+ rules.filter(ruleNamesPermission(name)).map(([, value]) => actionOfRule(value)).filter((action) => action !== void 0).at(-1)
501
+ ));
502
+ };
503
+ var openCodeAskCheck = (config) => {
504
+ if (config.kind === "unreadable" || config.kind === "unparseable") return { kind: "unreadable" };
505
+ const value = config.kind === "ok" ? asRecord(config.value) ?? {} : {};
506
+ const open = openCodePermissionsLeftOpen(value);
507
+ if (open.length === 0) return { kind: "asks" };
508
+ const personRules = rulesInOrder(value);
509
+ const namedByPerson = (name) => personRules.some(ruleNamesPermission(name));
510
+ return { kind: "open", unset: open.filter((name) => !namedByPerson(name)), allowedByPerson: open.filter(namedByPerson) };
511
+ };
459
512
  var removeOpenCodeMcpServer = (config) => {
460
513
  const servers = asRecord(config.mcp);
461
514
  if (!servers || !("pushary" in servers)) return false;
@@ -518,6 +571,10 @@ export {
518
571
  openCodeConfigFile,
519
572
  openCodeInstructionsFile,
520
573
  addOpenCodeMcpServer,
574
+ OPENCODE_ASKED_PERMISSIONS,
575
+ withOpenCodeAskRules,
576
+ openCodePermissionsLeftOpen,
577
+ openCodeAskCheck,
521
578
  removeOpenCodeMcpServer,
522
579
  agentHookFile,
523
580
  agentHooksKeyPath,
@@ -1,25 +1,25 @@
1
1
  import {
2
2
  registerTranscript
3
- } from "./chunk-57PU5OBL.js";
3
+ } from "./chunk-Q2BD4IBX.js";
4
4
  import {
5
5
  namedEvent
6
- } from "./chunk-ML2Q6WWE.js";
6
+ } from "./chunk-WY6YAMZW.js";
7
7
  import {
8
8
  isBridgeLocator,
9
9
  liveBridgeProbe,
10
10
  pusharyHookExecutable,
11
11
  resolveBridgeStub
12
- } from "./chunk-KA7JIMTG.js";
12
+ } from "./chunk-GTBWWCCM.js";
13
13
  import {
14
14
  writeDegraded
15
- } from "./chunk-E23RKH3T.js";
15
+ } from "./chunk-DTVHZDYM.js";
16
16
  import {
17
17
  cursorUserHooks
18
- } from "./chunk-H4BKC2GN.js";
18
+ } from "./chunk-ATPJGHUP.js";
19
19
  import {
20
20
  atLeast,
21
21
  parseVersion
22
- } from "./chunk-BSZIPIFA.js";
22
+ } from "./chunk-SCMEVDAR.js";
23
23
  import {
24
24
  CURSOR_GATE_COVERAGE,
25
25
  CURSOR_GATE_SCRIPT,
@@ -3,13 +3,13 @@ import {
3
3
  loadPin,
4
4
  savePin,
5
5
  verifyRecipients
6
- } from "./chunk-DVYVGBPB.js";
6
+ } from "./chunk-SZBMTOUZ.js";
7
7
  import {
8
8
  ensureDaemonRunning
9
- } from "./chunk-5NP3OJ5P.js";
9
+ } from "./chunk-ADXHPGBZ.js";
10
10
  import {
11
11
  hookOwnerOf
12
- } from "./chunk-KA7JIMTG.js";
12
+ } from "./chunk-GTBWWCCM.js";
13
13
  import {
14
14
  buildTranscriptRecords,
15
15
  decodePublicKey,
@@ -24,18 +24,18 @@ import {
24
24
  import {
25
25
  transcriptEnvironmentPreference,
26
26
  transcriptsEnabled
27
- } from "./chunk-5TUDGSDC.js";
27
+ } from "./chunk-TK4JU2F7.js";
28
28
  import {
29
29
  readTranscriptPreference
30
- } from "./chunk-BLAIETMP.js";
30
+ } from "./chunk-ED2SWTPC.js";
31
31
  import {
32
32
  claudeConfigDir,
33
33
  codexHome,
34
34
  pusharyDir
35
- } from "./chunk-H4BKC2GN.js";
35
+ } from "./chunk-ATPJGHUP.js";
36
36
  import {
37
37
  writeJsonAtomic
38
- } from "./chunk-BSZIPIFA.js";
38
+ } from "./chunk-SCMEVDAR.js";
39
39
  import {
40
40
  getApiKey,
41
41
  getBaseUrl
@@ -4,13 +4,13 @@ import {
4
4
  configFailureKind,
5
5
  retryAgentCommand,
6
6
  writeSetupConfigFile
7
- } from "./chunk-NYV45Q25.js";
7
+ } from "./chunk-W5L2ZLHE.js";
8
8
  import {
9
9
  MCP_BRIDGE_BINARY
10
- } from "./chunk-2PKHGHMA.js";
10
+ } from "./chunk-BEQ3MEE3.js";
11
11
  import {
12
12
  KEY_FILE_MODE
13
- } from "./chunk-BLAIETMP.js";
13
+ } from "./chunk-ED2SWTPC.js";
14
14
  import {
15
15
  CLINE_SERVER_NAME_TAKEN,
16
16
  CLINE_SETTINGS_REFUSALS,
@@ -30,12 +30,12 @@ import {
30
30
  withClinePusharyServer,
31
31
  withRefreshedClineKey,
32
32
  withoutClinePusharyServer
33
- } from "./chunk-H4BKC2GN.js";
33
+ } from "./chunk-ATPJGHUP.js";
34
34
  import {
35
35
  readJsonSafe,
36
36
  writeFileAtomic,
37
37
  writeJsonAtomic
38
- } from "./chunk-BSZIPIFA.js";
38
+ } from "./chunk-SCMEVDAR.js";
39
39
 
40
40
  // src/fx-config.ts
41
41
  var FX_SERVER_NAME = "pushary";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  realpath
3
- } from "./chunk-IZTDX2MX.js";
3
+ } from "./chunk-HIYLAC3C.js";
4
4
  import {
5
5
  findNativeClaudeInstall
6
- } from "./chunk-MXPOLQZH.js";
6
+ } from "./chunk-RABLE5R6.js";
7
7
  import {
8
8
  readGlobalPrefixAsync,
9
9
  resolveGlobalBinary,
@@ -13,7 +13,7 @@ import {
13
13
  resolvePackageVersionFromBinary,
14
14
  resolvePathBinary,
15
15
  resolvePathBinaryAsync
16
- } from "./chunk-BSZIPIFA.js";
16
+ } from "./chunk-SCMEVDAR.js";
17
17
  import {
18
18
  MANAGED_PROVIDERS
19
19
  } from "./chunk-MNKIR2ZB.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isFile
3
- } from "./chunk-BSZIPIFA.js";
3
+ } from "./chunk-SCMEVDAR.js";
4
4
 
5
5
  // src/claude-native-install.ts
6
6
  import { accessSync, constants } from "fs";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  announceSubscriptionRequired,
3
3
  isDeferAnswer
4
- } from "./chunk-TR3GP5MH.js";
4
+ } from "./chunk-UMTMFDL2.js";
5
5
  import {
6
6
  AUTO_DECISION_WINDOW_MS,
7
7
  DEFAULT_SESSION,
@@ -10,19 +10,19 @@ import {
10
10
  permissionDeniedAction,
11
11
  releaseThrottle,
12
12
  reportEvent
13
- } from "./chunk-MIPJ2VXP.js";
13
+ } from "./chunk-3UNAPXED.js";
14
14
  import {
15
15
  askUser,
16
16
  isDecisionStopped,
17
17
  isQuestionLimitRefusal,
18
18
  waitForQuestion
19
- } from "./chunk-E23RKH3T.js";
19
+ } from "./chunk-DTVHZDYM.js";
20
20
  import {
21
21
  SubscriptionRequiredError
22
- } from "./chunk-2KID4FK4.js";
22
+ } from "./chunk-BKCI53W6.js";
23
23
  import {
24
24
  getMachineId
25
- } from "./chunk-ADRPW7KU.js";
25
+ } from "./chunk-FWS2KLV2.js";
26
26
  import {
27
27
  ASK_CONTEXT_MAX,
28
28
  agentQuestionContext,
@@ -443,9 +443,9 @@ var installGlobally = (options) => {
443
443
  }
444
444
  const started = (async () => {
445
445
  if (!npmIsOnPath()) throw new NpmMissingError();
446
- const { withUpgradeLock } = await import("./global-upgrade-Y4USGPS2.js");
447
- const { installWithUpgradeLock, ownsUpgradeLock } = await import("./upgrade-lock-QAWUV2DO.js");
448
- const { autoUpdateLock } = await import("./paths-4MEBINV3.js");
446
+ const { withUpgradeLock } = await import("./global-upgrade-5DN5G3ZQ.js");
447
+ const { installWithUpgradeLock, ownsUpgradeLock } = await import("./upgrade-lock-BIRXIKHJ.js");
448
+ const { autoUpdateLock } = await import("./paths-ZG6KDM6Y.js");
449
449
  let result = "skipped";
450
450
  const install = async () => {
451
451
  const platform = process.platform;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  writeJsonAtomicDurable
3
- } from "./chunk-BSZIPIFA.js";
3
+ } from "./chunk-SCMEVDAR.js";
4
4
 
5
5
  // src/transcript-recipient-pin.ts
6
6
  import { existsSync, mkdirSync, readFileSync, rmSync } from "fs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  readTranscriptPreference
3
- } from "./chunk-BLAIETMP.js";
3
+ } from "./chunk-ED2SWTPC.js";
4
4
 
5
5
  // src/transcript-setting.ts
6
6
  var transcriptEnvironmentPreference = () => {
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  macAppBridgeAvailable
3
- } from "./chunk-VNRWQCGU.js";
3
+ } from "./chunk-P5HZEGT7.js";
4
4
  import {
5
5
  keyPrefix
6
- } from "./chunk-BLAIETMP.js";
6
+ } from "./chunk-ED2SWTPC.js";
7
7
  import {
8
8
  bridgeAgentKey
9
- } from "./chunk-H4BKC2GN.js";
9
+ } from "./chunk-ATPJGHUP.js";
10
10
  import {
11
11
  readJsonSafe
12
- } from "./chunk-BSZIPIFA.js";
12
+ } from "./chunk-SCMEVDAR.js";
13
13
  import {
14
14
  isValidApiKey
15
15
  } from "./chunk-MNKIR2ZB.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  pusharyFetch
3
- } from "./chunk-EEM65CGJ.js";
3
+ } from "./chunk-7ILQX47W.js";
4
4
  import {
5
5
  NetworkError
6
6
  } from "./chunk-PPY5N2E6.js";