pushary 1.9.104 → 1.9.105

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 (130) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/{api-QOG7JVXE.js → api-RL5CPDTH.js} +11 -11
  3. package/dist/bin/pushary-audit.js +4 -4
  4. package/dist/bin/pushary-bell-hook.js +28 -27
  5. package/dist/bin/pushary-bell.js +11 -11
  6. package/dist/bin/pushary-claude.js +28 -28
  7. package/dist/bin/pushary-clean.js +37 -37
  8. package/dist/bin/pushary-codex-bridge.js +22 -22
  9. package/dist/bin/pushary-codex-hook.js +33 -32
  10. package/dist/bin/pushary-codex-session.js +8 -8
  11. package/dist/bin/pushary-codex.js +15 -15
  12. package/dist/bin/pushary-connect.js +28 -28
  13. package/dist/bin/pushary-cowork.js +5 -5
  14. package/dist/bin/pushary-daemon.js +489 -62
  15. package/dist/bin/pushary-disconnect.js +27 -27
  16. package/dist/bin/pushary-display-hook.js +18 -18
  17. package/dist/bin/pushary-doctor.js +50 -50
  18. package/dist/bin/pushary-elicitation-hook.js +28 -27
  19. package/dist/bin/pushary-gemini-bridge.js +16 -16
  20. package/dist/bin/pushary-gemini-hook.js +30 -29
  21. package/dist/bin/pushary-hook.js +33 -31
  22. package/dist/bin/pushary-login.js +21 -21
  23. package/dist/bin/pushary-logout.js +26 -26
  24. package/dist/bin/pushary-mcp.js +12 -12
  25. package/dist/bin/pushary-mode.js +16 -16
  26. package/dist/bin/pushary-notification-hook.js +27 -26
  27. package/dist/bin/pushary-opencode-hook.js +29 -28
  28. package/dist/bin/pushary-permission-denied-hook.js +33 -31
  29. package/dist/bin/pushary-permission-hook.js +33 -31
  30. package/dist/bin/pushary-post-hook.js +27 -26
  31. package/dist/bin/pushary-prompt-hook.js +27 -26
  32. package/dist/bin/pushary-session-end-hook.js +29 -28
  33. package/dist/bin/pushary-session-start-hook.js +37 -36
  34. package/dist/bin/pushary-setup.js +49 -49
  35. package/dist/bin/pushary-stats.js +5 -5
  36. package/dist/bin/pushary-status.js +33 -33
  37. package/dist/bin/pushary-stop-hook.js +27 -26
  38. package/dist/bin/pushary-stopfailure-hook.js +27 -26
  39. package/dist/bin/pushary-suggestions.js +16 -16
  40. package/dist/bin/pushary-transcript-register.js +19 -19
  41. package/dist/bin/pushary-transcripts.js +27 -27
  42. package/dist/bin/pushary-upgrade.js +41 -41
  43. package/dist/bin/pushary-wait.js +16 -16
  44. package/dist/bin/pushary.js +8 -8
  45. package/dist/{chunk-4JBCPRWZ.js → chunk-2HC5ISDW.js} +2 -2
  46. package/dist/{chunk-HB7FHRTT.js → chunk-43PNDDB3.js} +6 -6
  47. package/dist/{chunk-SJCHJQKT.js → chunk-4EMPELDR.js} +4 -4
  48. package/dist/{chunk-HJ4EBHK4.js → chunk-4XE3DVF7.js} +2 -2
  49. package/dist/{chunk-SJJCCFD5.js → chunk-5IAW6G3K.js} +3 -3
  50. package/dist/{chunk-JVZVO3K5.js → chunk-6DKMZBRK.js} +1 -1
  51. package/dist/{chunk-OFRQNTJD.js → chunk-76JOLPST.js} +1 -1
  52. package/dist/{chunk-FYQHXN4X.js → chunk-772NHSQB.js} +2 -2
  53. package/dist/{chunk-BDSI2NEN.js → chunk-A37RKFI3.js} +4 -4
  54. package/dist/{chunk-UL52HYKN.js → chunk-ASCQXNCL.js} +1 -1
  55. package/dist/{chunk-XXPA3X6L.js → chunk-ATVZAEM5.js} +5 -5
  56. package/dist/{chunk-JMTOQXHV.js → chunk-B5Q44HKN.js} +1 -1
  57. package/dist/{chunk-NKA2PEQQ.js → chunk-B7O4CXFX.js} +4 -4
  58. package/dist/{chunk-SVZPRTCK.js → chunk-CJTJ55DR.js} +1 -1
  59. package/dist/{chunk-AG7PFGGE.js → chunk-CKWV3T7O.js} +6 -6
  60. package/dist/{chunk-GV2MF4NY.js → chunk-DA57ZI62.js} +2 -2
  61. package/dist/{chunk-ZBT3U2VB.js → chunk-DH22FQAS.js} +1 -1
  62. package/dist/{chunk-VZY4GD4T.js → chunk-DIVVLBZZ.js} +6 -6
  63. package/dist/{chunk-FXTUSTQG.js → chunk-DS672F57.js} +11 -11
  64. package/dist/{chunk-NGY2WS3X.js → chunk-EMSRB2KH.js} +3 -3
  65. package/dist/{chunk-HHEFOGT2.js → chunk-FE5JENEJ.js} +3 -3
  66. package/dist/{chunk-4QI6SBNR.js → chunk-FJYUB3ZK.js} +4 -4
  67. package/dist/{chunk-6B4R7HUV.js → chunk-FUTFQSRA.js} +1 -1
  68. package/dist/{chunk-TMJK3CLD.js → chunk-G5HGV6D4.js} +3 -3
  69. package/dist/{chunk-HXZYBYBD.js → chunk-GBHP3LML.js} +7 -5
  70. package/dist/{chunk-4OLWSYX5.js → chunk-GESW4OSZ.js} +4 -4
  71. package/dist/{chunk-3A7REECH.js → chunk-GKCDMAUM.js} +1 -1
  72. package/dist/{chunk-U5DBYW63.js → chunk-GUIS6ASL.js} +1 -1
  73. package/dist/{chunk-KDIZS7FN.js → chunk-HH5NNPB5.js} +1 -1
  74. package/dist/{chunk-XTMAVKO3.js → chunk-HLYZEZOI.js} +3 -3
  75. package/dist/{chunk-OPV6724W.js → chunk-HONSMBF2.js} +7 -7
  76. package/dist/{chunk-M7BDKARZ.js → chunk-HXBQTPKC.js} +1 -1
  77. package/dist/{chunk-PYUN7HNY.js → chunk-I3IUS4SR.js} +2 -2
  78. package/dist/{chunk-CC4LGKEZ.js → chunk-IAASPG5B.js} +5 -5
  79. package/dist/{chunk-2MRLDEQY.js → chunk-IGO5NDQY.js} +3 -3
  80. package/dist/{chunk-RDUY7MKN.js → chunk-IHQRLJEP.js} +12 -12
  81. package/dist/{chunk-RUN772MN.js → chunk-J2HIFUAT.js} +7 -7
  82. package/dist/{chunk-UYJLXAP4.js → chunk-J5PUKKCT.js} +8 -7
  83. package/dist/{chunk-AYWX6M7J.js → chunk-JCSJEMTA.js} +208 -60
  84. package/dist/{chunk-FVERRWDP.js → chunk-JDGLNYDZ.js} +2 -2
  85. package/dist/{chunk-5BX57BGT.js → chunk-JLJJRBTD.js} +6 -5
  86. package/dist/{chunk-UUYLBSAU.js → chunk-KHZCJP7P.js} +11 -11
  87. package/dist/{chunk-WBLK4WLO.js → chunk-LK3WA6MK.js} +3 -3
  88. package/dist/{chunk-ID4BZRBW.js → chunk-LL7SW4RL.js} +3 -3
  89. package/dist/{chunk-GV5TEADP.js → chunk-LMDXQIYT.js} +1 -1
  90. package/dist/{chunk-RYUIXLZ5.js → chunk-MFJHLVIZ.js} +11 -95
  91. package/dist/{chunk-XXNXMX2G.js → chunk-MLLL2ET6.js} +17 -61
  92. package/dist/{chunk-TYM6IH5F.js → chunk-NM44KCO6.js} +4 -4
  93. package/dist/{chunk-5YVBVJOH.js → chunk-O5TB2LMQ.js} +8 -0
  94. package/dist/{chunk-ZUXDGVW4.js → chunk-OBZQPBUI.js} +5 -5
  95. package/dist/chunk-OINGJICB.js +108 -0
  96. package/dist/{chunk-JGRBWTDW.js → chunk-P3H6I656.js} +11 -11
  97. package/dist/{chunk-IVAXF3JG.js → chunk-P3VVRBBI.js} +1 -1
  98. package/dist/{chunk-PK6LBL3Z.js → chunk-PFZCLG55.js} +4 -4
  99. package/dist/{chunk-XDTE55H7.js → chunk-QCFWJZGT.js} +4 -4
  100. package/dist/{chunk-I3T5YV5I.js → chunk-RKQVMFHN.js} +11 -93
  101. package/dist/{chunk-VUFHYMSP.js → chunk-ROVLRXBI.js} +1 -1
  102. package/dist/{chunk-7RHEZVAE.js → chunk-S2TTGX6F.js} +5 -5
  103. package/dist/{chunk-N4RIGNDX.js → chunk-S75UO75C.js} +2 -2
  104. package/dist/{chunk-QENTGE75.js → chunk-T5I4PKOQ.js} +37 -1
  105. package/dist/{chunk-SPM4VNED.js → chunk-TXMYET7E.js} +3 -3
  106. package/dist/{chunk-CFTPHNBY.js → chunk-UUJQK7DJ.js} +1 -1
  107. package/dist/{chunk-ORIVT4BL.js → chunk-UXIUCMFO.js} +6 -6
  108. package/dist/{chunk-4HBWXZPI.js → chunk-VCWLGM77.js} +3 -3
  109. package/dist/{chunk-AE2BQ3XM.js → chunk-VKTW5WVB.js} +2 -2
  110. package/dist/{chunk-LIDIA5JW.js → chunk-WTREXZGS.js} +4 -4
  111. package/dist/chunk-WUIWHGKF.js +56 -0
  112. package/dist/{chunk-FQNMUJTK.js → chunk-X3QG5RT5.js} +1 -1
  113. package/dist/{chunk-3KEY3453.js → chunk-X4TZN52V.js} +6 -6
  114. package/dist/{chunk-TYH7SNKD.js → chunk-XN527J4W.js} +1 -1
  115. package/dist/{chunk-YDT6TVGN.js → chunk-YDQ6OJMF.js} +1 -1
  116. package/dist/{chunk-FH6PHTUD.js → chunk-Z5FV7LTD.js} +2 -2
  117. package/dist/{chunk-VAZCGOLS.js → chunk-ZCBTCW3T.js} +3 -3
  118. package/dist/{codex-app-cards-switch-6IDDWXYS.js → codex-app-cards-switch-FD2ZWLYL.js} +12 -12
  119. package/dist/{codex-desktop-launch-VP4TXVCM.js → codex-desktop-launch-BN5OABPN.js} +1 -1
  120. package/dist/{codex-session-launch-OACJB5NN.js → codex-session-launch-O3PHQWTS.js} +19 -19
  121. package/dist/{config-S7HAIK6E.js → config-KWP7UXYG.js} +3 -3
  122. package/dist/{global-upgrade-OOFEGR4H.js → global-upgrade-NBSY5436.js} +11 -11
  123. package/dist/{identity-QSM6MVAH.js → identity-RP5I7KTV.js} +5 -5
  124. package/dist/{live-capabilities-NSVW362T.js → live-capabilities-XC6C47ZH.js} +6 -6
  125. package/dist/{paths-KFRRYJWL.js → paths-OE5APZ4Q.js} +8 -4
  126. package/dist/{reapply-7H3VCPW4.js → reapply-DRZ32BIB.js} +29 -29
  127. package/dist/src/index.js +32 -30
  128. package/dist/{upgrade-lock-BJKRXNMC.js → upgrade-lock-LWTVHYAJ.js} +5 -5
  129. package/dist/{usage-KGWL6WKQ.js → usage-5YESCANM.js} +3 -3
  130. package/package.json +1 -1
@@ -1,39 +1,22 @@
1
+ import {
2
+ cursorGateOwnsClaudeCall,
3
+ readCursorGateRegistration
4
+ } from "./chunk-OINGJICB.js";
1
5
  import {
2
6
  registerTranscript
3
- } from "./chunk-FXTUSTQG.js";
7
+ } from "./chunk-DS672F57.js";
4
8
  import {
5
9
  namedEvent
6
- } from "./chunk-5BX57BGT.js";
7
- import {
8
- isBridgeLocator,
9
- liveBridgeProbe,
10
- pusharyHookExecutable,
11
- resolveBridgeStub
12
- } from "./chunk-RYUIXLZ5.js";
10
+ } from "./chunk-JLJJRBTD.js";
13
11
  import {
14
12
  writeDegraded
15
- } from "./chunk-CC4LGKEZ.js";
16
- import {
17
- cursorUserHooks
18
- } from "./chunk-AYWX6M7J.js";
13
+ } from "./chunk-IAASPG5B.js";
19
14
  import {
20
- atLeast,
21
- parseVersion
22
- } from "./chunk-VAZCGOLS.js";
23
- import {
24
- CURSOR_GATE_COVERAGE,
25
- CURSOR_GATE_SCRIPT,
26
- HOOK_VERSION_PATTERN,
27
- NO_CURSOR_GATE,
28
15
  claudeShapedHookInput,
29
- cursorGateOwnsToolCall,
30
16
  hookCompatibleProfileBySource,
31
- isCursorHookPayload,
32
17
  isGrokHookPayload,
33
- isGrokSessionEndStop,
34
- isRecord,
35
- toolsCoveredByGateEntry
36
- } from "./chunk-5YVBVJOH.js";
18
+ isGrokSessionEndStop
19
+ } from "./chunk-O5TB2LMQ.js";
37
20
 
38
21
  // src/tool-hook-input.ts
39
22
  var OPTIONAL_TEXT_FIELDS = ["hook_event_name", "session_id", "cwd", "transcript_path", "tool_use_id", "permission_mode", "cursor_version"];
@@ -58,72 +41,7 @@ function parseToolHookInput(value) {
58
41
  // src/admission.ts
59
42
  import { readFileSync } from "fs";
60
43
  import { homedir } from "os";
61
- import { join as join2 } from "path";
62
-
63
- // src/cursor-gate-registration.ts
64
- import { dirname, isAbsolute, join, resolve } from "path";
65
- var FIRST_PLUGIN_VERSION_HANDLING = {
66
- beforeShellExecution: [0, 1, 0],
67
- beforeMCPExecution: [0, 2, 1],
68
- preToolUse: [0, 2, 2]
69
- };
70
- var COMMAND_HOOK_TYPE = "command";
71
- var PLUGIN_MANIFEST = join(".cursor-plugin", "plugin.json");
72
- var NO_SPOTLIGHT = () => [];
73
- var executableName = (executable) => executable.split(/[/\\]/).pop() ?? "";
74
- var isCursorGateScript = (executable) => executableName(executable) === CURSOR_GATE_SCRIPT;
75
- var fromHooksDirectory = (path, environment) => isAbsolute(path) ? path : resolve(dirname(environment.hooksFile), path);
76
- var pluginManifestBeside = (script) => join(dirname(dirname(script)), PLUGIN_MANIFEST);
77
- var versionIn = (manifest) => {
78
- try {
79
- const parsed = JSON.parse(manifest);
80
- return isRecord(parsed) && typeof parsed.version === "string" && HOOK_VERSION_PATTERN.test(parsed.version) ? parseVersion(parsed.version) : null;
81
- } catch {
82
- return null;
83
- }
84
- };
85
- var pluginVersionOf = (script, probe) => {
86
- const manifest = probe.readFile(pluginManifestBeside(script));
87
- return manifest === null ? null : versionIn(manifest);
88
- };
89
- var gateScriptHandles = (script, event, probe) => {
90
- if (!probe.exists(script)) return false;
91
- const version = pluginVersionOf(script, probe);
92
- return version !== null && atLeast(version, FIRST_PLUGIN_VERSION_HANDLING[event]);
93
- };
94
- var appBundleResolves = (locator, probe) => resolveBridgeStub(locator, { ...probe, mdfind: NO_SPOTLIGHT }).kind === "bundle";
95
- var isLiveCursorGateCommand = (command, event, environment) => {
96
- const executable = pusharyHookExecutable(command);
97
- if (executable === null) return false;
98
- const target = fromHooksDirectory(executable, environment);
99
- if (isCursorGateScript(executable)) return gateScriptHandles(target, event, environment.probe);
100
- return isBridgeLocator(executable) && appBundleResolves(target, environment.probe);
101
- };
102
- var isCommandHook = (entry) => entry.type === void 0 || entry.type === COMMAND_HOOK_TYPE;
103
- var entriesOn = (hooks, event) => {
104
- const entries = Object.hasOwn(hooks, event) ? hooks[event] : void 0;
105
- return Array.isArray(entries) ? entries.filter(isRecord) : [];
106
- };
107
- var runsALiveGate = (entry, event, isLiveGate) => isCommandHook(entry) && typeof entry.command === "string" && isLiveGate(entry.command, event);
108
- var toolsCoveredOn = (hooks, coverage, isLiveGate) => entriesOn(hooks, coverage.event).filter((entry) => runsALiveGate(entry, coverage.event, isLiveGate)).flatMap((entry) => toolsCoveredByGateEntry(coverage, entry.matcher) ?? []);
109
- var cursorGateRegistrationOf = (document, isLiveGate) => {
110
- if (!isRecord(document) || !isRecord(document.hooks)) return NO_CURSOR_GATE;
111
- const hooks = document.hooks;
112
- return CURSOR_GATE_COVERAGE.flatMap((coverage) => toolsCoveredOn(hooks, coverage, isLiveGate));
113
- };
114
- var userCursorGateEnvironment = () => ({ hooksFile: cursorUserHooks(), probe: liveBridgeProbe() });
115
- var readCursorGateRegistration = (environment = userCursorGateEnvironment()) => {
116
- try {
117
- const raw = environment.probe.readFile(environment.hooksFile);
118
- if (raw === null) return NO_CURSOR_GATE;
119
- return cursorGateRegistrationOf(JSON.parse(raw), (command, event) => isLiveCursorGateCommand(command, event, environment));
120
- } catch {
121
- return NO_CURSOR_GATE;
122
- }
123
- };
124
- var cursorGateOwnsClaudeCall = (payload, readRegistration) => isCursorHookPayload(payload) && cursorGateOwnsToolCall(readRegistration(), payload.tool_name);
125
-
126
- // src/admission.ts
44
+ import { join } from "path";
127
45
  var NO_RULES = { version: 1, disabled: [] };
128
46
  var SUPPORTED_VERSION = 1;
129
47
  var parseAdmissionRules = (raw) => {
@@ -140,7 +58,7 @@ var parseAdmissionRules = (raw) => {
140
58
  return NO_RULES;
141
59
  }
142
60
  };
143
- var admissionRulesFile = () => process.env.PUSHARY_ADMISSION_FILE?.trim() || join2(homedir(), ".pushary", "admission-rules.json");
61
+ var admissionRulesFile = () => process.env.PUSHARY_ADMISSION_FILE?.trim() || join(homedir(), ".pushary", "admission-rules.json");
144
62
  var readAdmissionRules = () => {
145
63
  try {
146
64
  return parseAdmissionRules(readFileSync(admissionRulesFile(), "utf-8"));
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isFile
3
- } from "./chunk-QENTGE75.js";
3
+ } from "./chunk-T5I4PKOQ.js";
4
4
 
5
5
  // src/claude-native-install.ts
6
6
  import { accessSync, constants } from "fs";
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  macAppBridgeAvailable
3
- } from "./chunk-RDUY7MKN.js";
3
+ } from "./chunk-IHQRLJEP.js";
4
4
  import {
5
5
  keyPrefix
6
- } from "./chunk-NKA2PEQQ.js";
6
+ } from "./chunk-B7O4CXFX.js";
7
7
  import {
8
8
  bridgeAgentKey
9
- } from "./chunk-AYWX6M7J.js";
9
+ } from "./chunk-JCSJEMTA.js";
10
10
  import {
11
11
  readJsonSafe
12
- } from "./chunk-QENTGE75.js";
12
+ } from "./chunk-T5I4PKOQ.js";
13
13
  import {
14
14
  isRecord,
15
15
  isValidApiKey
16
- } from "./chunk-5YVBVJOH.js";
16
+ } from "./chunk-O5TB2LMQ.js";
17
17
 
18
18
  // src/shared-mcp-key.ts
19
19
  var asRecord = (value) => value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0;
@@ -521,7 +521,7 @@ var loadedOnce = (load) => {
521
521
  };
522
522
 
523
523
  // src/codex-desktop-proxy.ts
524
- var loadThePhone = () => import("./api-QOG7JVXE.js");
524
+ var loadThePhone = () => import("./api-RL5CPDTH.js");
525
525
  var theFirstCardLoadsAgain = () => {
526
526
  };
527
527
  var APP_SERVER_COMMAND = "app-server";
@@ -1062,7 +1062,7 @@ var codexDesktopCommand = async (args, entry, readAccount) => {
1062
1062
  return runCodexDesktopProxy(engine2, args.slice(3), readAccount, { watchesForCards: layoutIsKnown });
1063
1063
  }
1064
1064
  if (args[0] === APP_CARDS_FLAG) {
1065
- const { codexAppCardsCommandOnThisMac } = await import("./codex-app-cards-switch-6IDDWXYS.js");
1065
+ const { codexAppCardsCommandOnThisMac } = await import("./codex-app-cards-switch-FD2ZWLYL.js");
1066
1066
  return codexAppCardsCommandOnThisMac(args.slice(1), entry, readAccount);
1067
1067
  }
1068
1068
  if (args.length > 2) throw new Error("Usage: pushary codex --desktop [path/to/Codex.app]");
@@ -1,5 +1,5 @@
1
1
  // src/cli/fsx.ts
2
- import { copyFileSync, lstatSync, realpathSync, existsSync, fchmodSync, fsyncSync, mkdirSync, openSync, closeSync, readFileSync, renameSync, statSync, unlinkSync, writeFileSync } from "fs";
2
+ import { constants as fsConstants, copyFileSync, fstatSync, lstatSync, realpathSync, existsSync, fchmodSync, fsyncSync, mkdirSync, openSync, closeSync, readFileSync, renameSync, statSync, unlinkSync, writeFileSync } from "fs";
3
3
  import { dirname, join } from "path";
4
4
  var readJsonSafe = (filePath) => {
5
5
  let raw;
@@ -18,6 +18,40 @@ var readJsonSafe = (filePath) => {
18
18
  return { kind: "unparseable", error: err, raw };
19
19
  }
20
20
  };
21
+ var MISSING_FILE_CODES = /* @__PURE__ */ new Set(["ENOENT", "ENOTDIR"]);
22
+ var isMissingFileError = (error) => error instanceof Error && "code" in error && typeof error.code === "string" && MISSING_FILE_CODES.has(error.code);
23
+ var READ_WITHOUT_WAITING = fsConstants.O_RDONLY | (fsConstants.O_NONBLOCK ?? 0);
24
+ var notARegularFile = (filePath, maxBytes) => new Error(`${filePath} is not a regular file of at most ${maxBytes} bytes`);
25
+ var regularFileTextOf = (fd, filePath, maxBytes) => {
26
+ const stats = fstatSync(fd);
27
+ if (!stats.isFile() || stats.size > maxBytes) return { kind: "unreadable", error: notARegularFile(filePath, maxBytes) };
28
+ return { kind: "ok", value: readFileSync(fd, "utf-8") };
29
+ };
30
+ var readRegularTextFile = (filePath, maxBytes) => {
31
+ let fd;
32
+ try {
33
+ fd = openSync(filePath, READ_WITHOUT_WAITING);
34
+ } catch (error) {
35
+ return isMissingFileError(error) ? { kind: "missing" } : { kind: "unreadable", error: error instanceof Error ? error : new Error(String(error)) };
36
+ }
37
+ try {
38
+ return regularFileTextOf(fd, filePath, maxBytes);
39
+ } catch (error) {
40
+ return { kind: "unreadable", error: error instanceof Error ? error : new Error(String(error)) };
41
+ } finally {
42
+ closeSync(fd);
43
+ }
44
+ };
45
+ var readRegularJsonFile = (filePath, maxBytes) => {
46
+ const text = readRegularTextFile(filePath, maxBytes);
47
+ if (text.kind !== "ok") return text;
48
+ if (text.value.trim() === "") return { kind: "ok", value: {} };
49
+ try {
50
+ return { kind: "ok", value: JSON.parse(text.value) };
51
+ } catch (error) {
52
+ return { kind: "unparseable", error: error instanceof Error ? error : new Error(String(error)), raw: text.value };
53
+ }
54
+ };
21
55
  var isFile = (path) => {
22
56
  try {
23
57
  return statSync(path).isFile();
@@ -77,6 +111,8 @@ var writeJsonAtomicDurable = (filePath, data, mode) => {
77
111
 
78
112
  export {
79
113
  readJsonSafe,
114
+ readRegularTextFile,
115
+ readRegularJsonFile,
80
116
  isFile,
81
117
  readFileOrMissing,
82
118
  backupFile,
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  CODEX_HOOK_STATUS
3
- } from "./chunk-AE2BQ3XM.js";
3
+ } from "./chunk-VKTW5WVB.js";
4
4
  import {
5
5
  retryAgentCommand
6
- } from "./chunk-4QI6SBNR.js";
6
+ } from "./chunk-FJYUB3ZK.js";
7
7
  import {
8
8
  NPX_LATEST_COMMAND
9
- } from "./chunk-YDT6TVGN.js";
9
+ } from "./chunk-YDQ6OJMF.js";
10
10
 
11
11
  // src/setup/codex-trust.ts
12
12
  var CODEX_TRUST_TELEMETRY = {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  DEFAULT_SESSION
3
- } from "./chunk-UUYLBSAU.js";
3
+ } from "./chunk-KHZCJP7P.js";
4
4
 
5
5
  // src/answer.ts
6
6
  var isDeferAnswer = (value) => value === "defer";
@@ -4,13 +4,13 @@ import {
4
4
  configFailureKind,
5
5
  retryAgentCommand,
6
6
  writeSetupConfigFile
7
- } from "./chunk-4QI6SBNR.js";
7
+ } from "./chunk-FJYUB3ZK.js";
8
8
  import {
9
9
  MCP_BRIDGE_BINARY
10
- } from "./chunk-GV2MF4NY.js";
10
+ } from "./chunk-DA57ZI62.js";
11
11
  import {
12
12
  KEY_FILE_MODE
13
- } from "./chunk-NKA2PEQQ.js";
13
+ } from "./chunk-B7O4CXFX.js";
14
14
  import {
15
15
  CLINE_SERVER_NAME_TAKEN,
16
16
  CLINE_SETTINGS_REFUSALS,
@@ -32,15 +32,15 @@ import {
32
32
  withClinePusharyServer,
33
33
  withRefreshedClineKey,
34
34
  withoutClinePusharyServer
35
- } from "./chunk-AYWX6M7J.js";
35
+ } from "./chunk-JCSJEMTA.js";
36
36
  import {
37
37
  resolveGlobalBinary
38
- } from "./chunk-VAZCGOLS.js";
38
+ } from "./chunk-ZCBTCW3T.js";
39
39
  import {
40
40
  readJsonSafe,
41
41
  writeFileAtomic,
42
42
  writeJsonAtomic
43
- } from "./chunk-QENTGE75.js";
43
+ } from "./chunk-T5I4PKOQ.js";
44
44
 
45
45
  // src/fx-config.ts
46
46
  var FX_SERVER_NAME = "pushary";
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  autoUpdateLock
3
- } from "./chunk-AYWX6M7J.js";
3
+ } from "./chunk-JCSJEMTA.js";
4
4
  import {
5
5
  installPackageGlobally,
6
6
  npmErrorMessage,
7
7
  npmExitedOnPermissionDenied
8
- } from "./chunk-VAZCGOLS.js";
8
+ } from "./chunk-ZCBTCW3T.js";
9
9
  import {
10
10
  writeJsonAtomic
11
- } from "./chunk-QENTGE75.js";
11
+ } from "./chunk-T5I4PKOQ.js";
12
12
 
13
13
  // src/upgrade-lock.ts
14
14
  import { fork } from "child_process";
@@ -7,10 +7,10 @@ import {
7
7
  codexHome,
8
8
  codexHooksJsonIn,
9
9
  isPusharyCodexCommand
10
- } from "./chunk-AYWX6M7J.js";
10
+ } from "./chunk-JCSJEMTA.js";
11
11
  import {
12
12
  resolvePathBinary
13
- } from "./chunk-VAZCGOLS.js";
13
+ } from "./chunk-ZCBTCW3T.js";
14
14
  import {
15
15
  getPackageVersion
16
16
  } from "./chunk-ZVU6WMMU.js";
@@ -12,7 +12,7 @@ import {
12
12
  reachVerdict,
13
13
  reachesYou,
14
14
  verifyDelivery
15
- } from "./chunk-3KEY3453.js";
15
+ } from "./chunk-X4TZN52V.js";
16
16
  import {
17
17
  humanIsTty,
18
18
  writeHuman
@@ -24,14 +24,14 @@ import {
24
24
  } from "./chunk-FO3MDD26.js";
25
25
  import {
26
26
  reportedInstallSource
27
- } from "./chunk-FH6PHTUD.js";
27
+ } from "./chunk-Z5FV7LTD.js";
28
28
  import {
29
29
  NPX_LATEST_COMMAND
30
- } from "./chunk-YDT6TVGN.js";
30
+ } from "./chunk-YDQ6OJMF.js";
31
31
  import {
32
32
  NO_PAIRING_COMPUTER,
33
33
  PAIR_TTL_SECONDS
34
- } from "./chunk-5YVBVJOH.js";
34
+ } from "./chunk-O5TB2LMQ.js";
35
35
 
36
36
  // src/onboarding.ts
37
37
  import qrcodeTerminal from "qrcode-terminal";
@@ -0,0 +1,56 @@
1
+ import {
2
+ claudeConfigDir
3
+ } from "./chunk-JCSJEMTA.js";
4
+ import {
5
+ claudePermissionRulesFromSettings
6
+ } from "./chunk-O5TB2LMQ.js";
7
+
8
+ // src/claude-permission-rules.ts
9
+ import { readFileSync, statSync } from "fs";
10
+ import { homedir } from "os";
11
+ import { join } from "path";
12
+ var MANAGED_CLAUDE_SETTINGS_BY_PLATFORM = {
13
+ darwin: "/Library/Application Support/ClaudeCode/managed-settings.json",
14
+ linux: "/etc/claude-code/managed-settings.json",
15
+ win32: "C:\\ProgramData\\ClaudeCode\\managed-settings.json"
16
+ };
17
+ var MAX_CLAUDE_SETTINGS_BYTES = 1048576;
18
+ var claudeSettingsLocationFor = (cwd, environment = process.env, home = homedir(), platform = process.platform) => ({
19
+ configDir: claudeConfigDir(home, environment),
20
+ projectDir: environment.CLAUDE_PROJECT_DIR || cwd || void 0,
21
+ managedSettingsPath: MANAGED_CLAUDE_SETTINGS_BY_PLATFORM[platform]
22
+ });
23
+ var claudeSettingsSources = (location) => [
24
+ ...location.managedSettingsPath ? [{ path: location.managedSettingsPath, trust: "grants" }] : [],
25
+ { path: join(location.configDir, "settings.json"), trust: "grants" },
26
+ ...location.projectDir ? [
27
+ { path: join(location.projectDir, ".claude", "settings.json"), trust: "restricts_only" },
28
+ { path: join(location.projectDir, ".claude", "settings.local.json"), trust: "grants" }
29
+ ] : []
30
+ ];
31
+ var isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
32
+ var restrictionsOnly = (document) => {
33
+ if (!isRecord(document) || !isRecord(document.permissions)) return null;
34
+ const { ask, deny } = document.permissions;
35
+ return { permissions: { ask, deny } };
36
+ };
37
+ var readSettingsDocument = (path) => {
38
+ try {
39
+ const stats = statSync(path);
40
+ if (!stats.isFile() || stats.size > MAX_CLAUDE_SETTINGS_BYTES) return null;
41
+ return JSON.parse(readFileSync(path, "utf8"));
42
+ } catch {
43
+ return null;
44
+ }
45
+ };
46
+ var trustedDocument = ({ path, trust }) => {
47
+ const document = readSettingsDocument(path);
48
+ return trust === "grants" ? document : restrictionsOnly(document);
49
+ };
50
+ var readClaudePermissionRules = (location) => claudePermissionRulesFromSettings(claudeSettingsSources(location).map(trustedDocument));
51
+
52
+ export {
53
+ MANAGED_CLAUDE_SETTINGS_BY_PLATFORM,
54
+ claudeSettingsLocationFor,
55
+ readClaudePermissionRules
56
+ };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  readConfigFileKey
3
- } from "./chunk-NKA2PEQQ.js";
3
+ } from "./chunk-B7O4CXFX.js";
4
4
 
5
5
  // src/bell/fleet.ts
6
6
  import { closeSync, constants, futimesSync, lstatSync, mkdirSync, openSync, readdirSync, unlinkSync } from "fs";
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  APPROVAL_RULES_PATH,
3
3
  canChangeApprovalSettings
4
- } from "./chunk-4JBCPRWZ.js";
4
+ } from "./chunk-2HC5ISDW.js";
5
5
  import {
6
6
  callMcpTool
7
- } from "./chunk-PK6LBL3Z.js";
7
+ } from "./chunk-PFZCLG55.js";
8
8
  import {
9
9
  absoluteUrl
10
- } from "./chunk-NGY2WS3X.js";
10
+ } from "./chunk-EMSRB2KH.js";
11
11
  import {
12
12
  getBaseUrl
13
- } from "./chunk-3A7REECH.js";
13
+ } from "./chunk-GKCDMAUM.js";
14
14
  import {
15
15
  NPX_LATEST_COMMAND
16
- } from "./chunk-YDT6TVGN.js";
16
+ } from "./chunk-YDQ6OJMF.js";
17
17
  import {
18
18
  AGENT_STOP_DEFAULT_SECONDS,
19
19
  APPROVAL_MODE_META,
@@ -21,7 +21,7 @@ import {
21
21
  classifyConfirmResponse,
22
22
  isAnswerSource,
23
23
  roundTripAsk
24
- } from "./chunk-5YVBVJOH.js";
24
+ } from "./chunk-O5TB2LMQ.js";
25
25
 
26
26
  // src/reach.ts
27
27
  var reachVerdict = (channels) => {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  HOOK_HOLD_BUDGET_ENV,
3
3
  hookHoldBudgetProof
4
- } from "./chunk-5YVBVJOH.js";
4
+ } from "./chunk-O5TB2LMQ.js";
5
5
 
6
6
  // src/hold-budget.ts
7
7
  var takeHookHoldBudget = (args = process.argv.slice(2), env = process.env) => {
@@ -2,7 +2,7 @@ import {
2
2
  DISCONNECT_AGENT_IDS,
3
3
  SETUP_AGENT_CHOICES,
4
4
  isApprovalMode
5
- } from "./chunk-5YVBVJOH.js";
5
+ } from "./chunk-O5TB2LMQ.js";
6
6
 
7
7
  // src/cli/mode-request.ts
8
8
  var parseDuration = (value) => {
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  configFilePath
3
- } from "./chunk-3A7REECH.js";
3
+ } from "./chunk-GKCDMAUM.js";
4
4
  import {
5
5
  normalizeInstallSource
6
- } from "./chunk-5YVBVJOH.js";
6
+ } from "./chunk-O5TB2LMQ.js";
7
7
 
8
8
  // src/install-source.ts
9
9
  import { readFileSync } from "fs";
@@ -399,9 +399,9 @@ var installGlobally = (options) => {
399
399
  }
400
400
  const started = (async () => {
401
401
  if (!npmIsOnPath()) throw new NpmMissingError();
402
- const { withUpgradeLock } = await import("./global-upgrade-OOFEGR4H.js");
403
- const { installWithUpgradeLock, ownsUpgradeLock } = await import("./upgrade-lock-BJKRXNMC.js");
404
- const { autoUpdateLock } = await import("./paths-KFRRYJWL.js");
402
+ const { withUpgradeLock } = await import("./global-upgrade-NBSY5436.js");
403
+ const { installWithUpgradeLock, ownsUpgradeLock } = await import("./upgrade-lock-LWTVHYAJ.js");
404
+ const { autoUpdateLock } = await import("./paths-OE5APZ4Q.js");
405
405
  let result = "skipped";
406
406
  const install = async () => {
407
407
  const platform = process.platform;
@@ -22,22 +22,22 @@ import {
22
22
  turnCodexAppCardsOff,
23
23
  turnCodexAppCardsOn,
24
24
  whyLaunchctlFailed
25
- } from "./chunk-TMJK3CLD.js";
26
- import "./chunk-N4RIGNDX.js";
25
+ } from "./chunk-G5HGV6D4.js";
26
+ import "./chunk-S75UO75C.js";
27
27
  import "./chunk-XCEN33UP.js";
28
28
  import "./chunk-QCGNGEGE.js";
29
- import "./chunk-OPV6724W.js";
29
+ import "./chunk-HONSMBF2.js";
30
30
  import "./chunk-XHKBHWLX.js";
31
- import "./chunk-PYUN7HNY.js";
32
- import "./chunk-NKA2PEQQ.js";
33
- import "./chunk-FH6PHTUD.js";
34
- import "./chunk-AYWX6M7J.js";
35
- import "./chunk-VAZCGOLS.js";
36
- import "./chunk-3A7REECH.js";
37
- import "./chunk-QENTGE75.js";
38
- import "./chunk-YDT6TVGN.js";
31
+ import "./chunk-I3IUS4SR.js";
32
+ import "./chunk-B7O4CXFX.js";
33
+ import "./chunk-Z5FV7LTD.js";
34
+ import "./chunk-JCSJEMTA.js";
35
+ import "./chunk-ZCBTCW3T.js";
36
+ import "./chunk-GKCDMAUM.js";
37
+ import "./chunk-T5I4PKOQ.js";
38
+ import "./chunk-YDQ6OJMF.js";
39
39
  import "./chunk-ZVU6WMMU.js";
40
- import "./chunk-5YVBVJOH.js";
40
+ import "./chunk-O5TB2LMQ.js";
41
41
  import "./chunk-E46NE7FB.js";
42
42
  import "./chunk-MLKGABMK.js";
43
43
  export {
@@ -11,7 +11,7 @@ import {
11
11
  installedCodexApp,
12
12
  shellQuoted,
13
13
  writeDesktopProxy
14
- } from "./chunk-N4RIGNDX.js";
14
+ } from "./chunk-S75UO75C.js";
15
15
  import "./chunk-XCEN33UP.js";
16
16
  import {
17
17
  CODEX_APP_LAUNCH_VARIABLE
@@ -11,36 +11,36 @@ import {
11
11
  isCodexQuestionLeftWithTheLocalClient,
12
12
  planCodexElicitation,
13
13
  reportOwnedQuestion
14
- } from "./chunk-VZY4GD4T.js";
15
- import "./chunk-KDIZS7FN.js";
16
- import "./chunk-4OLWSYX5.js";
17
- import "./chunk-2MRLDEQY.js";
14
+ } from "./chunk-DIVVLBZZ.js";
15
+ import "./chunk-HH5NNPB5.js";
16
+ import "./chunk-GESW4OSZ.js";
17
+ import "./chunk-IGO5NDQY.js";
18
18
  import "./chunk-N5P2FLOJ.js";
19
- import "./chunk-HHEFOGT2.js";
20
- import "./chunk-VUFHYMSP.js";
21
- import "./chunk-HJ4EBHK4.js";
19
+ import "./chunk-FE5JENEJ.js";
20
+ import "./chunk-ROVLRXBI.js";
21
+ import "./chunk-4XE3DVF7.js";
22
22
  import "./chunk-XMSDA5WA.js";
23
- import "./chunk-GV5TEADP.js";
23
+ import "./chunk-LMDXQIYT.js";
24
24
  import {
25
25
  writeDegraded
26
- } from "./chunk-CC4LGKEZ.js";
26
+ } from "./chunk-IAASPG5B.js";
27
27
  import "./chunk-POFBE6ZY.js";
28
- import "./chunk-PK6LBL3Z.js";
29
- import "./chunk-NGY2WS3X.js";
30
- import "./chunk-ID4BZRBW.js";
28
+ import "./chunk-PFZCLG55.js";
29
+ import "./chunk-EMSRB2KH.js";
30
+ import "./chunk-LL7SW4RL.js";
31
31
  import "./chunk-XHKBHWLX.js";
32
- import "./chunk-PYUN7HNY.js";
33
- import "./chunk-AYWX6M7J.js";
34
- import "./chunk-VAZCGOLS.js";
35
- import "./chunk-3A7REECH.js";
32
+ import "./chunk-I3IUS4SR.js";
33
+ import "./chunk-JCSJEMTA.js";
34
+ import "./chunk-ZCBTCW3T.js";
35
+ import "./chunk-GKCDMAUM.js";
36
36
  import "./chunk-YU2EUD7O.js";
37
- import "./chunk-QENTGE75.js";
37
+ import "./chunk-T5I4PKOQ.js";
38
38
  import "./chunk-BG4HHB7E.js";
39
- import "./chunk-YDT6TVGN.js";
39
+ import "./chunk-YDQ6OJMF.js";
40
40
  import "./chunk-ZVU6WMMU.js";
41
41
  import {
42
42
  canonicalJsonText
43
- } from "./chunk-5YVBVJOH.js";
43
+ } from "./chunk-O5TB2LMQ.js";
44
44
  import "./chunk-MLKGABMK.js";
45
45
 
46
46
  // src/codex-session-launch.ts
@@ -3,9 +3,9 @@ import {
3
3
  getApiKey,
4
4
  getBaseUrl,
5
5
  resetKeyDriftWarning
6
- } from "./chunk-3A7REECH.js";
7
- import "./chunk-YDT6TVGN.js";
8
- import "./chunk-5YVBVJOH.js";
6
+ } from "./chunk-GKCDMAUM.js";
7
+ import "./chunk-YDQ6OJMF.js";
8
+ import "./chunk-O5TB2LMQ.js";
9
9
  import "./chunk-MLKGABMK.js";
10
10
  export {
11
11
  configFilePath,
@@ -7,20 +7,20 @@ import {
7
7
  recordUnfinishedUpgrade,
8
8
  upgradeInstalledPackage,
9
9
  withUpgradeLock
10
- } from "./chunk-AG7PFGGE.js";
11
- import "./chunk-4HBWXZPI.js";
12
- import "./chunk-4OLWSYX5.js";
13
- import "./chunk-2MRLDEQY.js";
14
- import "./chunk-VUFHYMSP.js";
15
- import "./chunk-SJJCCFD5.js";
10
+ } from "./chunk-CKWV3T7O.js";
11
+ import "./chunk-VCWLGM77.js";
12
+ import "./chunk-GESW4OSZ.js";
13
+ import "./chunk-IGO5NDQY.js";
14
+ import "./chunk-ROVLRXBI.js";
15
+ import "./chunk-5IAW6G3K.js";
16
16
  import "./chunk-POFBE6ZY.js";
17
- import "./chunk-AYWX6M7J.js";
18
- import "./chunk-VAZCGOLS.js";
19
- import "./chunk-QENTGE75.js";
17
+ import "./chunk-JCSJEMTA.js";
18
+ import "./chunk-ZCBTCW3T.js";
19
+ import "./chunk-T5I4PKOQ.js";
20
20
  import "./chunk-BG4HHB7E.js";
21
- import "./chunk-YDT6TVGN.js";
21
+ import "./chunk-YDQ6OJMF.js";
22
22
  import "./chunk-ZVU6WMMU.js";
23
- import "./chunk-5YVBVJOH.js";
23
+ import "./chunk-O5TB2LMQ.js";
24
24
  import "./chunk-MLKGABMK.js";
25
25
  export {
26
26
  finishGlobalUpgrade,