pushary 1.9.104 → 1.9.106
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.
- package/CHANGELOG.md +8 -0
- package/data/SKILL.md +3 -3
- package/data/cursor-plugin/skills/pushary/SKILL.md +2 -2
- package/data/vscode-plugin/skills/pushary/SKILL.md +2 -2
- package/dist/{api-QOG7JVXE.js → api-RL5CPDTH.js} +11 -11
- package/dist/bin/pushary-audit.js +4 -4
- package/dist/bin/pushary-bell-hook.js +28 -27
- package/dist/bin/pushary-bell.js +11 -11
- package/dist/bin/pushary-claude.js +28 -28
- package/dist/bin/pushary-clean.js +37 -37
- package/dist/bin/pushary-codex-bridge.js +22 -22
- package/dist/bin/pushary-codex-hook.js +33 -32
- package/dist/bin/pushary-codex-session.js +8 -8
- package/dist/bin/pushary-codex.js +15 -15
- package/dist/bin/pushary-connect.js +28 -28
- package/dist/bin/pushary-cowork.js +5 -5
- package/dist/bin/pushary-daemon.js +489 -62
- package/dist/bin/pushary-disconnect.js +27 -27
- package/dist/bin/pushary-display-hook.js +18 -18
- package/dist/bin/pushary-doctor.js +50 -50
- package/dist/bin/pushary-elicitation-hook.js +28 -27
- package/dist/bin/pushary-gemini-bridge.js +16 -16
- package/dist/bin/pushary-gemini-hook.js +30 -29
- package/dist/bin/pushary-hook.js +33 -31
- package/dist/bin/pushary-login.js +21 -21
- package/dist/bin/pushary-logout.js +26 -26
- package/dist/bin/pushary-mcp.js +12 -12
- package/dist/bin/pushary-mode.js +16 -16
- package/dist/bin/pushary-notification-hook.js +27 -26
- package/dist/bin/pushary-opencode-hook.js +29 -28
- package/dist/bin/pushary-permission-denied-hook.js +33 -31
- package/dist/bin/pushary-permission-hook.js +33 -31
- package/dist/bin/pushary-post-hook.js +27 -26
- package/dist/bin/pushary-prompt-hook.js +27 -26
- package/dist/bin/pushary-session-end-hook.js +29 -28
- package/dist/bin/pushary-session-start-hook.js +37 -36
- package/dist/bin/pushary-setup.js +49 -49
- package/dist/bin/pushary-stats.js +5 -5
- package/dist/bin/pushary-status.js +33 -33
- package/dist/bin/pushary-stop-hook.js +27 -26
- package/dist/bin/pushary-stopfailure-hook.js +27 -26
- package/dist/bin/pushary-suggestions.js +16 -16
- package/dist/bin/pushary-transcript-register.js +19 -19
- package/dist/bin/pushary-transcripts.js +27 -27
- package/dist/bin/pushary-upgrade.js +41 -41
- package/dist/bin/pushary-wait.js +16 -16
- package/dist/bin/pushary.js +8 -8
- package/dist/{chunk-4JBCPRWZ.js → chunk-2HC5ISDW.js} +2 -2
- package/dist/{chunk-HB7FHRTT.js → chunk-43PNDDB3.js} +6 -6
- package/dist/{chunk-SJCHJQKT.js → chunk-4EMPELDR.js} +4 -4
- package/dist/{chunk-XDTE55H7.js → chunk-4OUPD4KA.js} +4 -4
- package/dist/{chunk-HJ4EBHK4.js → chunk-4XE3DVF7.js} +2 -2
- package/dist/{chunk-SJJCCFD5.js → chunk-5IAW6G3K.js} +3 -3
- package/dist/{chunk-JVZVO3K5.js → chunk-6DKMZBRK.js} +1 -1
- package/dist/{chunk-OFRQNTJD.js → chunk-76JOLPST.js} +1 -1
- package/dist/{chunk-FYQHXN4X.js → chunk-772NHSQB.js} +2 -2
- package/dist/{chunk-BDSI2NEN.js → chunk-A37RKFI3.js} +4 -4
- package/dist/{chunk-UL52HYKN.js → chunk-ASCQXNCL.js} +1 -1
- package/dist/{chunk-XXPA3X6L.js → chunk-ATVZAEM5.js} +5 -5
- package/dist/{chunk-JMTOQXHV.js → chunk-B5Q44HKN.js} +1 -1
- package/dist/{chunk-NKA2PEQQ.js → chunk-B7O4CXFX.js} +4 -4
- package/dist/{chunk-SVZPRTCK.js → chunk-CJTJ55DR.js} +1 -1
- package/dist/{chunk-AG7PFGGE.js → chunk-CKWV3T7O.js} +6 -6
- package/dist/{chunk-GV2MF4NY.js → chunk-DA57ZI62.js} +2 -2
- package/dist/{chunk-ZBT3U2VB.js → chunk-DH22FQAS.js} +1 -1
- package/dist/{chunk-VZY4GD4T.js → chunk-DIVVLBZZ.js} +6 -6
- package/dist/{chunk-FXTUSTQG.js → chunk-DS672F57.js} +11 -11
- package/dist/{chunk-NGY2WS3X.js → chunk-EMSRB2KH.js} +3 -3
- package/dist/{chunk-HHEFOGT2.js → chunk-FE5JENEJ.js} +3 -3
- package/dist/{chunk-4QI6SBNR.js → chunk-FJYUB3ZK.js} +4 -4
- package/dist/{chunk-6B4R7HUV.js → chunk-FUTFQSRA.js} +1 -1
- package/dist/{chunk-TMJK3CLD.js → chunk-G5HGV6D4.js} +3 -3
- package/dist/{chunk-HXZYBYBD.js → chunk-GBHP3LML.js} +7 -5
- package/dist/{chunk-4OLWSYX5.js → chunk-GESW4OSZ.js} +4 -4
- package/dist/{chunk-3A7REECH.js → chunk-GKCDMAUM.js} +1 -1
- package/dist/{chunk-U5DBYW63.js → chunk-GUIS6ASL.js} +1 -1
- package/dist/{chunk-KDIZS7FN.js → chunk-HH5NNPB5.js} +1 -1
- package/dist/{chunk-XTMAVKO3.js → chunk-HLYZEZOI.js} +3 -3
- package/dist/{chunk-OPV6724W.js → chunk-HONSMBF2.js} +7 -7
- package/dist/{chunk-M7BDKARZ.js → chunk-HXBQTPKC.js} +1 -1
- package/dist/{chunk-PYUN7HNY.js → chunk-I3IUS4SR.js} +2 -2
- package/dist/{chunk-CC4LGKEZ.js → chunk-IAASPG5B.js} +5 -5
- package/dist/{chunk-2MRLDEQY.js → chunk-IGO5NDQY.js} +3 -3
- package/dist/{chunk-RDUY7MKN.js → chunk-IHQRLJEP.js} +12 -12
- package/dist/{chunk-RUN772MN.js → chunk-J2HIFUAT.js} +7 -7
- package/dist/{chunk-UYJLXAP4.js → chunk-J5PUKKCT.js} +8 -7
- package/dist/{chunk-AYWX6M7J.js → chunk-JCSJEMTA.js} +208 -60
- package/dist/{chunk-FVERRWDP.js → chunk-JDGLNYDZ.js} +2 -2
- package/dist/{chunk-5BX57BGT.js → chunk-JLJJRBTD.js} +6 -5
- package/dist/{chunk-UUYLBSAU.js → chunk-KHZCJP7P.js} +11 -11
- package/dist/{chunk-WBLK4WLO.js → chunk-LK3WA6MK.js} +3 -3
- package/dist/{chunk-ID4BZRBW.js → chunk-LL7SW4RL.js} +3 -3
- package/dist/{chunk-GV5TEADP.js → chunk-LMDXQIYT.js} +1 -1
- package/dist/{chunk-RYUIXLZ5.js → chunk-MFJHLVIZ.js} +11 -95
- package/dist/{chunk-XXNXMX2G.js → chunk-MLLL2ET6.js} +17 -61
- package/dist/{chunk-TYM6IH5F.js → chunk-NM44KCO6.js} +4 -4
- package/dist/{chunk-5YVBVJOH.js → chunk-O5TB2LMQ.js} +8 -0
- package/dist/{chunk-ZUXDGVW4.js → chunk-OBZQPBUI.js} +5 -5
- package/dist/chunk-OINGJICB.js +108 -0
- package/dist/{chunk-JGRBWTDW.js → chunk-P3H6I656.js} +11 -11
- package/dist/{chunk-IVAXF3JG.js → chunk-P3VVRBBI.js} +1 -1
- package/dist/{chunk-PK6LBL3Z.js → chunk-PFZCLG55.js} +4 -4
- package/dist/{chunk-I3T5YV5I.js → chunk-RKQVMFHN.js} +11 -93
- package/dist/{chunk-VUFHYMSP.js → chunk-ROVLRXBI.js} +1 -1
- package/dist/{chunk-7RHEZVAE.js → chunk-S2TTGX6F.js} +5 -5
- package/dist/{chunk-N4RIGNDX.js → chunk-S75UO75C.js} +2 -2
- package/dist/{chunk-QENTGE75.js → chunk-T5I4PKOQ.js} +37 -1
- package/dist/{chunk-SPM4VNED.js → chunk-TXMYET7E.js} +3 -3
- package/dist/{chunk-CFTPHNBY.js → chunk-UUJQK7DJ.js} +1 -1
- package/dist/{chunk-ORIVT4BL.js → chunk-UXIUCMFO.js} +6 -6
- package/dist/{chunk-4HBWXZPI.js → chunk-VCWLGM77.js} +3 -3
- package/dist/{chunk-3KEY3453.js → chunk-VK4PPVWB.js} +24 -10
- package/dist/{chunk-AE2BQ3XM.js → chunk-VKTW5WVB.js} +2 -2
- package/dist/chunk-WUIWHGKF.js +56 -0
- package/dist/{chunk-FQNMUJTK.js → chunk-X3QG5RT5.js} +1 -1
- package/dist/{chunk-TYH7SNKD.js → chunk-XN527J4W.js} +1 -1
- package/dist/{chunk-YDT6TVGN.js → chunk-YDQ6OJMF.js} +1 -1
- package/dist/{chunk-FH6PHTUD.js → chunk-Z5FV7LTD.js} +2 -2
- package/dist/{chunk-LIDIA5JW.js → chunk-ZB2WNJXZ.js} +4 -4
- package/dist/{chunk-VAZCGOLS.js → chunk-ZCBTCW3T.js} +3 -3
- package/dist/{codex-app-cards-switch-6IDDWXYS.js → codex-app-cards-switch-FD2ZWLYL.js} +12 -12
- package/dist/{codex-desktop-launch-VP4TXVCM.js → codex-desktop-launch-BN5OABPN.js} +1 -1
- package/dist/{codex-session-launch-OACJB5NN.js → codex-session-launch-O3PHQWTS.js} +19 -19
- package/dist/{config-S7HAIK6E.js → config-KWP7UXYG.js} +3 -3
- package/dist/{global-upgrade-OOFEGR4H.js → global-upgrade-NBSY5436.js} +11 -11
- package/dist/{identity-QSM6MVAH.js → identity-RP5I7KTV.js} +5 -5
- package/dist/{live-capabilities-NSVW362T.js → live-capabilities-XC6C47ZH.js} +6 -6
- package/dist/{paths-KFRRYJWL.js → paths-OE5APZ4Q.js} +8 -4
- package/dist/{reapply-7H3VCPW4.js → reapply-DRZ32BIB.js} +29 -29
- package/dist/src/index.js +32 -30
- package/dist/{upgrade-lock-BJKRXNMC.js → upgrade-lock-LWTVHYAJ.js} +5 -5
- package/dist/{usage-KGWL6WKQ.js → usage-5YESCANM.js} +3 -3
- 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-
|
|
7
|
+
} from "./chunk-DS672F57.js";
|
|
4
8
|
import {
|
|
5
9
|
namedEvent
|
|
6
|
-
} from "./chunk-
|
|
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-
|
|
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
|
-
|
|
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
|
|
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() ||
|
|
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,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
macAppBridgeAvailable
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-IHQRLJEP.js";
|
|
4
4
|
import {
|
|
5
5
|
keyPrefix
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-B7O4CXFX.js";
|
|
7
7
|
import {
|
|
8
8
|
bridgeAgentKey
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-JCSJEMTA.js";
|
|
10
10
|
import {
|
|
11
11
|
readJsonSafe
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-T5I4PKOQ.js";
|
|
13
13
|
import {
|
|
14
14
|
isRecord,
|
|
15
15
|
isValidApiKey
|
|
16
|
-
} from "./chunk-
|
|
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-
|
|
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-
|
|
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-
|
|
3
|
+
} from "./chunk-VKTW5WVB.js";
|
|
4
4
|
import {
|
|
5
5
|
retryAgentCommand
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-FJYUB3ZK.js";
|
|
7
7
|
import {
|
|
8
8
|
NPX_LATEST_COMMAND
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-YDQ6OJMF.js";
|
|
10
10
|
|
|
11
11
|
// src/setup/codex-trust.ts
|
|
12
12
|
var CODEX_TRUST_TELEMETRY = {
|
|
@@ -4,13 +4,13 @@ import {
|
|
|
4
4
|
configFailureKind,
|
|
5
5
|
retryAgentCommand,
|
|
6
6
|
writeSetupConfigFile
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-FJYUB3ZK.js";
|
|
8
8
|
import {
|
|
9
9
|
MCP_BRIDGE_BINARY
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-DA57ZI62.js";
|
|
11
11
|
import {
|
|
12
12
|
KEY_FILE_MODE
|
|
13
|
-
} from "./chunk-
|
|
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-
|
|
35
|
+
} from "./chunk-JCSJEMTA.js";
|
|
36
36
|
import {
|
|
37
37
|
resolveGlobalBinary
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-ZCBTCW3T.js";
|
|
39
39
|
import {
|
|
40
40
|
readJsonSafe,
|
|
41
41
|
writeFileAtomic,
|
|
42
42
|
writeJsonAtomic
|
|
43
|
-
} from "./chunk-
|
|
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-
|
|
3
|
+
} from "./chunk-JCSJEMTA.js";
|
|
4
4
|
import {
|
|
5
5
|
installPackageGlobally,
|
|
6
6
|
npmErrorMessage,
|
|
7
7
|
npmExitedOnPermissionDenied
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-ZCBTCW3T.js";
|
|
9
9
|
import {
|
|
10
10
|
writeJsonAtomic
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-T5I4PKOQ.js";
|
|
12
12
|
|
|
13
13
|
// src/upgrade-lock.ts
|
|
14
14
|
import { fork } from "child_process";
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
APPROVAL_RULES_PATH,
|
|
3
3
|
canChangeApprovalSettings
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-2HC5ISDW.js";
|
|
5
5
|
import {
|
|
6
6
|
callMcpTool
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-PFZCLG55.js";
|
|
8
8
|
import {
|
|
9
9
|
absoluteUrl
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-EMSRB2KH.js";
|
|
11
11
|
import {
|
|
12
12
|
getBaseUrl
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-GKCDMAUM.js";
|
|
14
14
|
import {
|
|
15
15
|
NPX_LATEST_COMMAND
|
|
16
|
-
} from "./chunk-
|
|
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-
|
|
24
|
+
} from "./chunk-O5TB2LMQ.js";
|
|
25
25
|
|
|
26
26
|
// src/reach.ts
|
|
27
27
|
var reachVerdict = (channels) => {
|
|
@@ -187,10 +187,24 @@ var defaultAsk = (apiKey, agentName) => (
|
|
|
187
187
|
// reporting "unanswered" after three seconds would be a lie about the product.
|
|
188
188
|
callMcpTool(apiKey, "ask_user", roundTripAsk(agentName), { timeoutMs: 15e3 })
|
|
189
189
|
);
|
|
190
|
-
var
|
|
190
|
+
var ROUND_TRIP_WAIT_REQUEST_SLACK_MS = 5e3;
|
|
191
|
+
var ROUND_TRIP_MIN_WAIT_MS = 1e3;
|
|
192
|
+
var ROUND_TRIP_MAX_WAITS = 4;
|
|
193
|
+
var defaultWait = (apiKey, correlationId, timeoutMs) => callMcpTool(apiKey, "wait_for_answer", {
|
|
191
194
|
correlationId,
|
|
192
|
-
timeoutMs
|
|
193
|
-
}, { timeoutMs:
|
|
195
|
+
timeoutMs
|
|
196
|
+
}, { timeoutMs: timeoutMs + ROUND_TRIP_WAIT_REQUEST_SLACK_MS });
|
|
197
|
+
var isStillPending = (answer) => answer.answered !== true && answer.status === "pending";
|
|
198
|
+
var waitUntilDeadline = async (wait, apiKey, correlationId, deadline, now, interruptRequested) => {
|
|
199
|
+
let answer = { answered: false, status: "pending" };
|
|
200
|
+
for (let attempt = 0; attempt < ROUND_TRIP_MAX_WAITS; attempt++) {
|
|
201
|
+
const remaining = deadline - now();
|
|
202
|
+
if (interruptRequested() || remaining < ROUND_TRIP_MIN_WAIT_MS) return answer;
|
|
203
|
+
answer = await wait(apiKey, correlationId, remaining);
|
|
204
|
+
if (!isStillPending(answer)) return answer;
|
|
205
|
+
}
|
|
206
|
+
return answer;
|
|
207
|
+
};
|
|
194
208
|
var defaultCancel = async (apiKey, correlationId) => {
|
|
195
209
|
await callMcpTool(apiKey, "cancel_question", { correlationId }, { timeoutMs: 1e4 }).catch(() => {
|
|
196
210
|
});
|
|
@@ -257,7 +271,7 @@ var verifyRoundTrip = async (apiKey, agentName = SETUP_AGENT_NAME, deps = {}) =>
|
|
|
257
271
|
if (asked.noDevices || asked.warning) return { kind: "no-recipients" };
|
|
258
272
|
if (asked.mode === "notify_only" || asked.status === "notified") return { kind: "notify-only" };
|
|
259
273
|
if (!asked.correlationId) return { kind: "error", detail: "no correlationId returned" };
|
|
260
|
-
const answer = asked.answered === true ? asked : await wait
|
|
274
|
+
const answer = asked.answered === true ? asked : await waitUntilDeadline(wait, apiKey, asked.correlationId, now() + ROUND_TRIP_TIMEOUT_MS, now, () => shutdown !== void 0);
|
|
261
275
|
if (answer.answered === true) {
|
|
262
276
|
const outcome = answeredRoundTrip(answer, asked.correlationId, now() - started);
|
|
263
277
|
answerObserved = outcome.kind === "answered";
|
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
codexHome,
|
|
8
8
|
codexHooksJsonIn,
|
|
9
9
|
isPusharyCodexCommand
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-JCSJEMTA.js";
|
|
11
11
|
import {
|
|
12
12
|
resolvePathBinary
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-ZCBTCW3T.js";
|
|
14
14
|
import {
|
|
15
15
|
getPackageVersion
|
|
16
16
|
} from "./chunk-ZVU6WMMU.js";
|
|
@@ -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
|
+
};
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
reachVerdict,
|
|
13
13
|
reachesYou,
|
|
14
14
|
verifyDelivery
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-VK4PPVWB.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-
|
|
27
|
+
} from "./chunk-Z5FV7LTD.js";
|
|
28
28
|
import {
|
|
29
29
|
NPX_LATEST_COMMAND
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-YDQ6OJMF.js";
|
|
31
31
|
import {
|
|
32
32
|
NO_PAIRING_COMPUTER,
|
|
33
33
|
PAIR_TTL_SECONDS
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-O5TB2LMQ.js";
|
|
35
35
|
|
|
36
36
|
// src/onboarding.ts
|
|
37
37
|
import qrcodeTerminal from "qrcode-terminal";
|
|
@@ -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-
|
|
403
|
-
const { installWithUpgradeLock, ownsUpgradeLock } = await import("./upgrade-lock-
|
|
404
|
-
const { autoUpdateLock } = await import("./paths-
|
|
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-
|
|
26
|
-
import "./chunk-
|
|
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-
|
|
29
|
+
import "./chunk-HONSMBF2.js";
|
|
30
30
|
import "./chunk-XHKBHWLX.js";
|
|
31
|
-
import "./chunk-
|
|
32
|
-
import "./chunk-
|
|
33
|
-
import "./chunk-
|
|
34
|
-
import "./chunk-
|
|
35
|
-
import "./chunk-
|
|
36
|
-
import "./chunk-
|
|
37
|
-
import "./chunk-
|
|
38
|
-
import "./chunk-
|
|
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-
|
|
40
|
+
import "./chunk-O5TB2LMQ.js";
|
|
41
41
|
import "./chunk-E46NE7FB.js";
|
|
42
42
|
import "./chunk-MLKGABMK.js";
|
|
43
43
|
export {
|
|
@@ -11,36 +11,36 @@ import {
|
|
|
11
11
|
isCodexQuestionLeftWithTheLocalClient,
|
|
12
12
|
planCodexElicitation,
|
|
13
13
|
reportOwnedQuestion
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
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-
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-FE5JENEJ.js";
|
|
20
|
+
import "./chunk-ROVLRXBI.js";
|
|
21
|
+
import "./chunk-4XE3DVF7.js";
|
|
22
22
|
import "./chunk-XMSDA5WA.js";
|
|
23
|
-
import "./chunk-
|
|
23
|
+
import "./chunk-LMDXQIYT.js";
|
|
24
24
|
import {
|
|
25
25
|
writeDegraded
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-IAASPG5B.js";
|
|
27
27
|
import "./chunk-POFBE6ZY.js";
|
|
28
|
-
import "./chunk-
|
|
29
|
-
import "./chunk-
|
|
30
|
-
import "./chunk-
|
|
28
|
+
import "./chunk-PFZCLG55.js";
|
|
29
|
+
import "./chunk-EMSRB2KH.js";
|
|
30
|
+
import "./chunk-LL7SW4RL.js";
|
|
31
31
|
import "./chunk-XHKBHWLX.js";
|
|
32
|
-
import "./chunk-
|
|
33
|
-
import "./chunk-
|
|
34
|
-
import "./chunk-
|
|
35
|
-
import "./chunk-
|
|
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-
|
|
37
|
+
import "./chunk-T5I4PKOQ.js";
|
|
38
38
|
import "./chunk-BG4HHB7E.js";
|
|
39
|
-
import "./chunk-
|
|
39
|
+
import "./chunk-YDQ6OJMF.js";
|
|
40
40
|
import "./chunk-ZVU6WMMU.js";
|
|
41
41
|
import {
|
|
42
42
|
canonicalJsonText
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-O5TB2LMQ.js";
|
|
44
44
|
import "./chunk-MLKGABMK.js";
|
|
45
45
|
|
|
46
46
|
// src/codex-session-launch.ts
|