pushary 1.9.81 → 1.9.82
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 +7 -0
- package/dist/{api-VFUZ5HBR.js → api-TZO5ACOS.js} +8 -8
- package/dist/bin/pushary-bell-hook.js +19 -19
- package/dist/bin/pushary-bell.js +7 -7
- package/dist/bin/pushary-claude.js +20 -20
- package/dist/bin/pushary-clean.js +28 -28
- package/dist/bin/pushary-codex-bridge.js +15 -15
- package/dist/bin/pushary-codex-hook.js +22 -22
- package/dist/bin/pushary-codex-session.js +7 -7
- package/dist/bin/pushary-codex.js +9 -9
- package/dist/bin/pushary-connect.js +21 -21
- package/dist/bin/pushary-cowork.js +2 -2
- package/dist/bin/pushary-daemon.js +32 -32
- package/dist/bin/pushary-disconnect.js +20 -20
- package/dist/bin/pushary-display-hook.js +11 -11
- package/dist/bin/pushary-doctor.js +40 -36
- package/dist/bin/pushary-elicitation-hook.js +19 -19
- package/dist/bin/pushary-gemini-bridge.js +10 -10
- package/dist/bin/pushary-gemini-hook.js +20 -20
- package/dist/bin/pushary-hook.js +22 -22
- package/dist/bin/pushary-login.js +15 -15
- package/dist/bin/pushary-logout.js +18 -18
- package/dist/bin/pushary-mcp.js +9 -9
- package/dist/bin/pushary-mode.js +11 -11
- package/dist/bin/pushary-notification-hook.js +18 -18
- package/dist/bin/pushary-opencode-hook.js +19 -19
- package/dist/bin/pushary-permission-denied-hook.js +21 -21
- package/dist/bin/pushary-permission-hook.js +21 -21
- package/dist/bin/pushary-post-hook.js +18 -18
- package/dist/bin/pushary-prompt-hook.js +18 -18
- package/dist/bin/pushary-session-end-hook.js +20 -20
- package/dist/bin/pushary-session-start-hook.js +28 -28
- package/dist/bin/pushary-setup.js +43 -40
- package/dist/bin/pushary-stats.js +2 -2
- package/dist/bin/pushary-status.js +25 -25
- package/dist/bin/pushary-stop-hook.js +18 -18
- package/dist/bin/pushary-stopfailure-hook.js +18 -18
- package/dist/bin/pushary-suggestions.js +11 -11
- package/dist/bin/pushary-transcript-register.js +11 -11
- package/dist/bin/pushary-transcripts.js +15 -15
- package/dist/bin/pushary-upgrade.js +34 -34
- package/dist/bin/pushary-wait.js +11 -11
- package/dist/bin/pushary.js +5 -5
- package/dist/{chunk-IS5YVKUX.js → chunk-2BJZFA7X.js} +7 -5
- package/dist/{chunk-QZ666HLH.js → chunk-2TEX3APZ.js} +5 -5
- package/dist/{chunk-BYFFELB3.js → chunk-3UBYG4G7.js} +5 -5
- package/dist/{chunk-IA53GEP5.js → chunk-3V6G2GBJ.js} +5 -5
- package/dist/{chunk-VK2CHU3L.js → chunk-4S5XVFDV.js} +1 -1
- package/dist/{chunk-GOYYPBBJ.js → chunk-5LLZSX7I.js} +3 -3
- package/dist/{chunk-UUASO2FU.js → chunk-5TMGEQAC.js} +3 -3
- package/dist/{chunk-YIKIQ6YN.js → chunk-6224ENW3.js} +2 -2
- package/dist/{chunk-VII55DVC.js → chunk-6355HHSR.js} +2 -2
- package/dist/{chunk-TJZIUFWK.js → chunk-6L2U3TP3.js} +18 -17
- package/dist/{chunk-K5QN6V5K.js → chunk-72CIQCBA.js} +7 -4
- package/dist/{chunk-ZIJKTWNO.js → chunk-AM3H6HWG.js} +1 -1
- package/dist/{chunk-NVEDZZ3V.js → chunk-APSYBSMG.js} +13 -11
- package/dist/{chunk-74QJBFMG.js → chunk-AXE2ZOKS.js} +1 -1
- package/dist/{chunk-JTO6UPTJ.js → chunk-C6FQ4YST.js} +1 -1
- package/dist/{chunk-ALTTZKDU.js → chunk-CV56MBIZ.js} +7 -6
- package/dist/{chunk-3YOXBN7V.js → chunk-CXZAKS7S.js} +1 -1
- package/dist/{chunk-CRKODLLY.js → chunk-D3QGBMO3.js} +1 -1
- package/dist/{chunk-7JU6DPO7.js → chunk-DJILSCSU.js} +2 -2
- package/dist/{chunk-HG5EUDF3.js → chunk-DS5BR4K6.js} +1 -1
- package/dist/{chunk-ZBST77LF.js → chunk-DX45XQ36.js} +2 -2
- package/dist/{chunk-ZBYZCM6Y.js → chunk-ESRKYHWE.js} +2 -2
- package/dist/{chunk-KXSZ43Z6.js → chunk-FHPSVTS5.js} +5 -5
- package/dist/{chunk-VYRJAPZ6.js → chunk-FJZSJZCT.js} +1 -1
- package/dist/{chunk-LJ4TUZJV.js → chunk-G5BYSS6C.js} +4 -4
- package/dist/{chunk-35S7VB26.js → chunk-GUI2NYCX.js} +4 -4
- package/dist/{chunk-LFEJVQWI.js → chunk-GUM3WG4B.js} +3 -3
- package/dist/{chunk-IO3OLTED.js → chunk-I4RNLK5G.js} +3 -3
- package/dist/{chunk-X772USE7.js → chunk-IEAABGST.js} +5 -4
- package/dist/{chunk-47RUEZZA.js → chunk-J4TQYGHU.js} +4 -4
- package/dist/{chunk-ID46TTYS.js → chunk-JNCD2ZG3.js} +2 -2
- package/dist/{chunk-KERGWHCK.js → chunk-L77YWBMK.js} +6 -6
- package/dist/{chunk-YNWEE2WC.js → chunk-LGWTITVK.js} +1 -1
- package/dist/{chunk-HNUK557P.js → chunk-LNSCANYY.js} +1 -1
- package/dist/{chunk-LJFB5ZJ4.js → chunk-N3C3D4AV.js} +3 -3
- package/dist/{chunk-7WCB2BC4.js → chunk-NEWGYFKC.js} +6 -6
- package/dist/{chunk-DPP3ZCEE.js → chunk-O6T3CLWT.js} +3 -3
- package/dist/{chunk-IQQQ2LGB.js → chunk-OIW3JAWH.js} +3 -3
- package/dist/{chunk-AZV3DQQU.js → chunk-OXKVR2FP.js} +1 -1
- package/dist/{chunk-RVC7OSC7.js → chunk-OXTRF7CP.js} +1 -1
- package/dist/{chunk-ESS7CW3I.js → chunk-QJJJENT2.js} +4 -4
- package/dist/{chunk-5WC7TXSS.js → chunk-RL2KE6HG.js} +8 -8
- package/dist/{chunk-YAAJ3VZA.js → chunk-RRMRP62I.js} +3 -3
- package/dist/{chunk-5WIVX2NN.js → chunk-S2DLTWFG.js} +3 -3
- package/dist/{chunk-DLBUDQEE.js → chunk-TKFDPYXS.js} +3 -3
- package/dist/{chunk-QNEWV4JV.js → chunk-TO77OYLM.js} +1 -1
- package/dist/{chunk-DF7A5AWF.js → chunk-UB7VUSSX.js} +2 -2
- package/dist/{chunk-B2HMISVL.js → chunk-UOUUTDWF.js} +84 -44
- package/dist/{chunk-NK3I2QQA.js → chunk-UYTPCZ4M.js} +3 -3
- package/dist/{chunk-SFUJLUBM.js → chunk-VHLRXIMC.js} +1 -1
- package/dist/{chunk-FIMSM5SW.js → chunk-WLOVGZ7R.js} +2 -2
- package/dist/{chunk-BB4W35D6.js → chunk-WUS2LFTM.js} +7 -7
- package/dist/{chunk-WPGSQRMW.js → chunk-YAMNJXCD.js} +2 -2
- package/dist/{chunk-SEVGKJ7K.js → chunk-Z5HLACZT.js} +2 -2
- package/dist/{chunk-QTOLNRET.js → chunk-ZVU6WMMU.js} +10 -0
- package/dist/{codex-app-cards-switch-ZL6OHUXQ.js → codex-app-cards-switch-3FAIEEB2.js} +8 -8
- package/dist/{codex-desktop-launch-LQF5CPKU.js → codex-desktop-launch-LHMHRVGF.js} +1 -1
- package/dist/{codex-session-launch-5WBL5YHX.js → codex-session-launch-MXUBSTL2.js} +13 -13
- package/dist/{global-upgrade-HDDPHNGX.js → global-upgrade-ZDENZA42.js} +9 -9
- package/dist/{identity-RNZLFMKW.js → identity-YZRDJOGY.js} +4 -4
- package/dist/{live-capabilities-Y2Q5QBVK.js → live-capabilities-KSQDWVT6.js} +5 -5
- package/dist/{paths-WILX6YI3.js → paths-DYZZBVYI.js} +3 -3
- package/dist/{reapply-KF7ZZSA2.js → reapply-L3AI5KJH.js} +22 -22
- package/dist/src/index.js +21 -21
- package/dist/{upgrade-lock-7Q4VWMDA.js → upgrade-lock-X7F2OFYB.js} +4 -4
- package/dist/{usage-MSILPJVQ.js → usage-TKZALYXF.js} +2 -2
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
outcomeOfFailedAsk,
|
|
5
5
|
reportMachineDenial,
|
|
6
6
|
storedWaitDeadline
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-3UBYG4G7.js";
|
|
8
8
|
import {
|
|
9
9
|
isGatingMoment,
|
|
10
10
|
recordKeylessMoment
|
|
@@ -12,16 +12,16 @@ import {
|
|
|
12
12
|
import {
|
|
13
13
|
isAdmitted,
|
|
14
14
|
readAdmissionRules
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-NEWGYFKC.js";
|
|
16
16
|
import {
|
|
17
17
|
isDeferAnswer,
|
|
18
18
|
oncePerSession
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-AM3H6HWG.js";
|
|
20
20
|
import {
|
|
21
21
|
activeHookSource,
|
|
22
22
|
activeIdentity,
|
|
23
23
|
namedSource
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-5TMGEQAC.js";
|
|
25
25
|
import {
|
|
26
26
|
DEFAULT_SESSION,
|
|
27
27
|
UNNAMED_ACTION,
|
|
@@ -45,7 +45,7 @@ import {
|
|
|
45
45
|
reportEvent,
|
|
46
46
|
scopePathFor,
|
|
47
47
|
settleQuestionsForToolUse
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-FHPSVTS5.js";
|
|
49
49
|
import {
|
|
50
50
|
repoKeyFor
|
|
51
51
|
} from "./chunk-M5XNFUXN.js";
|
|
@@ -65,13 +65,13 @@ import {
|
|
|
65
65
|
waitForQuestion,
|
|
66
66
|
waitsForThePhone,
|
|
67
67
|
withdrawQuestion
|
|
68
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-OIW3JAWH.js";
|
|
69
69
|
import {
|
|
70
70
|
getMachineId
|
|
71
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-YAMNJXCD.js";
|
|
72
72
|
import {
|
|
73
73
|
claudeConfigDir
|
|
74
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-UOUUTDWF.js";
|
|
75
75
|
import {
|
|
76
76
|
getApiKey,
|
|
77
77
|
getBaseUrl
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
APPROVAL_RULES_PATH,
|
|
3
3
|
canChangeApprovalSettings
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-C6FQ4YST.js";
|
|
5
5
|
import {
|
|
6
6
|
callMcpTool
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-Z5HLACZT.js";
|
|
8
8
|
import {
|
|
9
9
|
absoluteUrl
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-LNSCANYY.js";
|
|
11
11
|
import {
|
|
12
12
|
getBaseUrl
|
|
13
13
|
} from "./chunk-ONUAAXAW.js";
|
|
@@ -3,18 +3,18 @@ import {
|
|
|
3
3
|
} from "./chunk-POFBE6ZY.js";
|
|
4
4
|
import {
|
|
5
5
|
autoUpdateState
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-UOUUTDWF.js";
|
|
7
7
|
import {
|
|
8
8
|
readJsonSafe,
|
|
9
9
|
writeJsonAtomic
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-2BJZFA7X.js";
|
|
11
11
|
import {
|
|
12
12
|
CLI_PACKAGE_NAMES,
|
|
13
13
|
POSIX_GLOBAL_ROOT_SEGMENTS,
|
|
14
14
|
cliPackagePathSegments,
|
|
15
15
|
globalUpgradeEntry,
|
|
16
16
|
ownPackageRoot
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-ZVU6WMMU.js";
|
|
18
18
|
import {
|
|
19
19
|
isAutoUpdateResult
|
|
20
20
|
} from "./chunk-WG67W43Y.js";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
notificationAnswerStep
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-RRMRP62I.js";
|
|
4
4
|
import {
|
|
5
5
|
canChangeApprovalSettings
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-C6FQ4YST.js";
|
|
7
7
|
import {
|
|
8
8
|
matchMacAccountStep,
|
|
9
9
|
retryAgentCommand
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-FJZSJZCT.js";
|
|
11
11
|
import {
|
|
12
12
|
EXIT
|
|
13
13
|
} from "./chunk-KZERVKTD.js";
|
|
@@ -4,7 +4,10 @@ import {
|
|
|
4
4
|
quoteIfNeeded,
|
|
5
5
|
shellDoubleQuoted,
|
|
6
6
|
writeFileAtomic
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-2BJZFA7X.js";
|
|
8
|
+
import {
|
|
9
|
+
cmdShimScriptOf
|
|
10
|
+
} from "./chunk-ZVU6WMMU.js";
|
|
8
11
|
import {
|
|
9
12
|
CLAUDE_PRETOOLUSE_MATCHER,
|
|
10
13
|
CODEX_QUESTION_TOOLS,
|
|
@@ -32,35 +35,6 @@ import { createHash } from "crypto";
|
|
|
32
35
|
import { homedir as homedir2 } from "os";
|
|
33
36
|
import { join as join2 } from "path";
|
|
34
37
|
|
|
35
|
-
// src/registration-holder.ts
|
|
36
|
-
var asRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value) ? value : null;
|
|
37
|
-
var registeredCommands = (document) => {
|
|
38
|
-
const hooks = asRecord(document?.hooks);
|
|
39
|
-
if (!hooks) return [];
|
|
40
|
-
const found = [];
|
|
41
|
-
for (const [event, value] of Object.entries(hooks)) {
|
|
42
|
-
if (!Array.isArray(value)) continue;
|
|
43
|
-
for (const item of value) {
|
|
44
|
-
const inner = asRecord(item)?.hooks;
|
|
45
|
-
if (!Array.isArray(inner)) continue;
|
|
46
|
-
for (const hook of inner) {
|
|
47
|
-
const command = asRecord(hook)?.command;
|
|
48
|
-
if (typeof command === "string") found.push({ event, command });
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
return found;
|
|
53
|
-
};
|
|
54
|
-
var wholeSegments = (command) => command.split(/[\s/\\"']+/).map((segment) => segment.replace(/\.(cmd|exe)$/i, ""));
|
|
55
|
-
var namesLocator = (command) => wholeSegments(command).includes(HOOK_LOCATOR_BINARY);
|
|
56
|
-
var namesCliBinary = (command, cliBinaries) => wholeSegments(command).some((segment) => cliBinaries.has(segment));
|
|
57
|
-
var namesOurBinary = (command, cliBinaries) => namesLocator(command) || namesCliBinary(command, cliBinaries);
|
|
58
|
-
var registrationHolderOf = (document, cliBinaries) => {
|
|
59
|
-
const commands = registeredCommands(document);
|
|
60
|
-
if (commands.some(({ command }) => namesLocator(command))) return "app";
|
|
61
|
-
return commands.some(({ command }) => namesCliBinary(command, cliBinaries)) ? "cli" : "none";
|
|
62
|
-
};
|
|
63
|
-
|
|
64
38
|
// src/hook-command.ts
|
|
65
39
|
var HOOK_SHELL = "/bin/sh -c";
|
|
66
40
|
var holdBudgetOf = (hook) => hook.holds ? hook.timeout : void 0;
|
|
@@ -93,12 +67,25 @@ var guardKindOf = (target) => {
|
|
|
93
67
|
};
|
|
94
68
|
var targetPath = (target) => target.kind === "binary" ? target.path : target.script;
|
|
95
69
|
var runsThroughNode = (target) => target.kind !== "binary";
|
|
96
|
-
var
|
|
70
|
+
var LAUNCHABLE_EXTENSION = /\.(cmd|exe|js|mjs)$/i;
|
|
71
|
+
var hookBinaryNameOf = (fileName) => fileName.replace(LAUNCHABLE_EXTENSION, "");
|
|
72
|
+
var windowsNodeLaunchOf = (target, launcher) => {
|
|
73
|
+
if (launcher === null) return null;
|
|
74
|
+
if (target.kind !== "binary") return { node: launcher.node, script: target.script };
|
|
75
|
+
if (target.runtime !== "node") return null;
|
|
76
|
+
const script = launcher.scriptFor(target.path);
|
|
77
|
+
return script === void 0 ? null : { node: launcher.node, script };
|
|
78
|
+
};
|
|
79
|
+
var guardHookCommand = (target, platform = process.platform, launcher = null) => {
|
|
97
80
|
const path = quoteIfNeeded(targetPath(target), platform);
|
|
98
|
-
if (platform === "win32")
|
|
81
|
+
if (platform === "win32") {
|
|
82
|
+
const launch = windowsNodeLaunchOf(target, launcher);
|
|
83
|
+
if (launch !== null) return `${quoteIfNeeded(launch.node, platform)} ${quoteIfNeeded(launch.script, platform)}`;
|
|
84
|
+
return runsThroughNode(target) ? `node ${path}` : path;
|
|
85
|
+
}
|
|
99
86
|
return `${HOOK_SHELL} '${HOOK_GUARD_SCRIPTS[guardKindOf(target)]}' ${path}`;
|
|
100
87
|
};
|
|
101
|
-
var guardBinary = (path, platform) => guardHookCommand({ kind: "binary", path, runtime: "node" }, platform);
|
|
88
|
+
var guardBinary = (path, platform, launcher) => guardHookCommand({ kind: "binary", path, runtime: "node" }, platform, launcher);
|
|
102
89
|
var SILENT_MISS = "exit 0";
|
|
103
90
|
var REFUSE = "R";
|
|
104
91
|
var definesRefusal = (refusal) => `${REFUSE}() { printf %s ${shellDoubleQuoted(refusal)}; exit 0; }`;
|
|
@@ -109,15 +96,64 @@ var guardBinaryRefusing = (path, refusal, platform = process.platform) => {
|
|
|
109
96
|
};
|
|
110
97
|
var guardNodeScript = (script, platform) => guardHookCommand({ kind: "node", script }, platform);
|
|
111
98
|
var guardCursorGate = (script, platform) => guardHookCommand({ kind: "cursor_gate", script }, platform);
|
|
112
|
-
var guardedArgv = (target, args = [], platform = process.platform) => {
|
|
99
|
+
var guardedArgv = (target, args = [], platform = process.platform, launcher = null) => {
|
|
113
100
|
const path = targetPath(target);
|
|
114
101
|
if (platform === "win32") {
|
|
102
|
+
const launch = windowsNodeLaunchOf(target, launcher);
|
|
103
|
+
if (launch !== null) return [launch.node, launch.script, ...args];
|
|
115
104
|
return runsThroughNode(target) ? ["node", path, ...args] : [path, ...args];
|
|
116
105
|
}
|
|
117
106
|
const [shell, ...shellArgs] = HOOK_SHELL.split(/\s+/);
|
|
118
107
|
return [shell, ...shellArgs, HOOK_GUARD_SCRIPTS[guardKindOf(target)], path, ...args];
|
|
119
108
|
};
|
|
120
109
|
|
|
110
|
+
// src/registration-holder.ts
|
|
111
|
+
var asRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value) ? value : null;
|
|
112
|
+
var registeredCommands = (document) => {
|
|
113
|
+
const hooks = asRecord(document?.hooks);
|
|
114
|
+
if (!hooks) return [];
|
|
115
|
+
const found = [];
|
|
116
|
+
for (const [event, value] of Object.entries(hooks)) {
|
|
117
|
+
if (!Array.isArray(value)) continue;
|
|
118
|
+
for (const item of value) {
|
|
119
|
+
const inner = asRecord(item)?.hooks;
|
|
120
|
+
if (!Array.isArray(inner)) continue;
|
|
121
|
+
for (const hook of inner) {
|
|
122
|
+
const command = asRecord(hook)?.command;
|
|
123
|
+
if (typeof command === "string") found.push({ event, command });
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return found;
|
|
128
|
+
};
|
|
129
|
+
var wholeSegments = (command) => command.split(/[\s/\\"']+/).map(hookBinaryNameOf);
|
|
130
|
+
var namesLocator = (command) => wholeSegments(command).includes(HOOK_LOCATOR_BINARY);
|
|
131
|
+
var namesCliBinary = (command, cliBinaries) => wholeSegments(command).some((segment) => cliBinaries.has(segment));
|
|
132
|
+
var namesOurBinary = (command, cliBinaries) => namesLocator(command) || namesCliBinary(command, cliBinaries);
|
|
133
|
+
var registrationHolderOf = (document, cliBinaries) => {
|
|
134
|
+
const commands = registeredCommands(document);
|
|
135
|
+
if (commands.some(({ command }) => namesLocator(command))) return "app";
|
|
136
|
+
return commands.some(({ command }) => namesCliBinary(command, cliBinaries)) ? "cli" : "none";
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
// src/windows-node-launcher.ts
|
|
140
|
+
import { existsSync, readFileSync } from "fs";
|
|
141
|
+
import { win32 } from "path";
|
|
142
|
+
var STANDARD_NODE_LOCATION = ["nodejs", "node.exe"];
|
|
143
|
+
var isStandardWindowsNode = (execPath, programFolders) => {
|
|
144
|
+
const running = win32.normalize(execPath).toLowerCase();
|
|
145
|
+
return programFolders.some((folder) => folder !== void 0 && folder !== "" && win32.join(folder, ...STANDARD_NODE_LOCATION).toLowerCase() === running);
|
|
146
|
+
};
|
|
147
|
+
var windowsHookScriptFor = (shim, files) => {
|
|
148
|
+
const script = cmdShimScriptOf(shim, files.readFile);
|
|
149
|
+
return script !== void 0 && files.exists(script) ? script : void 0;
|
|
150
|
+
};
|
|
151
|
+
var INSTALLED_FILES = {
|
|
152
|
+
exists: existsSync,
|
|
153
|
+
readFile: (path) => readFileSync(path, "utf8")
|
|
154
|
+
};
|
|
155
|
+
var windowsNodeLauncherFor = (platform) => platform === "win32" && process.platform === "win32" && isStandardWindowsNode(process.execPath, [process.env.ProgramFiles, process.env.ProgramW6432]) ? { node: process.execPath, scriptFor: (shim) => windowsHookScriptFor(shim, INSTALLED_FILES) } : null;
|
|
156
|
+
|
|
121
157
|
// src/hook-entries.ts
|
|
122
158
|
var registerHookEntry = (existing, isOurs, entry2) => {
|
|
123
159
|
const rewritten = [];
|
|
@@ -149,6 +185,7 @@ var canonicalJson = (value) => {
|
|
|
149
185
|
|
|
150
186
|
// src/codex-config.ts
|
|
151
187
|
var CODEX_HOOK_BINARY = "pushary-codex-hook";
|
|
188
|
+
var codexHookCommand = (resolvedBinary, platform = process.platform) => guardBinary(resolvedBinary ?? CODEX_HOOK_BINARY, platform, windowsNodeLauncherFor(platform));
|
|
152
189
|
var codexHome = () => codexHomeFrom(homedir2());
|
|
153
190
|
var codexHomeFrom = (home) => process.env.CODEX_HOME?.trim() || join2(home, ".codex");
|
|
154
191
|
var codexConfigToml = () => join2(codexHome(), "config.toml");
|
|
@@ -746,7 +783,7 @@ var removePusharySettings = (settings, scope) => {
|
|
|
746
783
|
};
|
|
747
784
|
|
|
748
785
|
// src/instruction-file.ts
|
|
749
|
-
import { accessSync, constants, existsSync, readFileSync, statSync, writeFileSync, mkdirSync, rmSync } from "fs";
|
|
786
|
+
import { accessSync, constants, existsSync as existsSync2, readFileSync as readFileSync2, statSync, writeFileSync, mkdirSync, rmSync } from "fs";
|
|
750
787
|
import { dirname } from "path";
|
|
751
788
|
var PUSHARY_BEGIN = "<!-- BEGIN PUSHARY (managed by @pushary/agent-hooks; do not edit this block) -->";
|
|
752
789
|
var PUSHARY_END = "<!-- END PUSHARY -->";
|
|
@@ -794,10 +831,10 @@ var withInstructionBlockReplaced = (existing, body) => {
|
|
|
794
831
|
};
|
|
795
832
|
var writeInstructionBlock = (filePath, body) => {
|
|
796
833
|
const dir = dirname(filePath);
|
|
797
|
-
if (!
|
|
834
|
+
if (!existsSync2(dir)) mkdirSync(dir, { recursive: true });
|
|
798
835
|
let existing = "";
|
|
799
836
|
try {
|
|
800
|
-
existing =
|
|
837
|
+
existing = readFileSync2(filePath, "utf-8");
|
|
801
838
|
} catch {
|
|
802
839
|
}
|
|
803
840
|
writeFileSync(filePath, withInstructionBlockReplaced(existing, body) ?? withInstructionBlockAppended(existing, body), "utf-8");
|
|
@@ -814,7 +851,7 @@ var CRLF = "\r\n";
|
|
|
814
851
|
var withLineEndingsOf = (sample, block) => sample.includes(CRLF) ? block.replaceAll("\n", CRLF) : block;
|
|
815
852
|
var readUtf8 = (filePath) => {
|
|
816
853
|
try {
|
|
817
|
-
const bytes =
|
|
854
|
+
const bytes = readFileSync2(filePath);
|
|
818
855
|
const text = bytes.toString("utf-8");
|
|
819
856
|
return Buffer.from(text, "utf-8").equals(bytes) ? { kind: "text", text } : { kind: "not_utf8" };
|
|
820
857
|
} catch {
|
|
@@ -830,7 +867,7 @@ var isWritable = (filePath) => {
|
|
|
830
867
|
}
|
|
831
868
|
};
|
|
832
869
|
var refreshInstructionBlock = (filePath, body) => {
|
|
833
|
-
if (!
|
|
870
|
+
if (!existsSync2(filePath)) return "absent";
|
|
834
871
|
const read = readUtf8(filePath);
|
|
835
872
|
if (read.kind !== "text") return read.kind;
|
|
836
873
|
const block = soleManagedBlock(read.text);
|
|
@@ -851,7 +888,7 @@ var refreshInstructionBlock = (filePath, body) => {
|
|
|
851
888
|
var removeInstructionBlock = (filePath) => {
|
|
852
889
|
let existing = "";
|
|
853
890
|
try {
|
|
854
|
-
existing =
|
|
891
|
+
existing = readFileSync2(filePath, "utf-8");
|
|
855
892
|
} catch {
|
|
856
893
|
return false;
|
|
857
894
|
}
|
|
@@ -868,7 +905,7 @@ var removeInstructionBlock = (filePath) => {
|
|
|
868
905
|
};
|
|
869
906
|
var hasInstructionBlock = (filePath) => {
|
|
870
907
|
try {
|
|
871
|
-
return
|
|
908
|
+
return readFileSync2(filePath, "utf-8").includes(PUSHARY_BEGIN);
|
|
872
909
|
} catch {
|
|
873
910
|
return false;
|
|
874
911
|
}
|
|
@@ -1079,20 +1116,23 @@ var clineRules = () => clineRulesFile(clineLocation());
|
|
|
1079
1116
|
export {
|
|
1080
1117
|
claudeConfigDir,
|
|
1081
1118
|
claudeUserConfigFile,
|
|
1082
|
-
registeredCommands,
|
|
1083
|
-
namesOurBinary,
|
|
1084
|
-
registrationHolderOf,
|
|
1085
1119
|
HOOK_SHELL,
|
|
1086
1120
|
holdBudgetOf,
|
|
1121
|
+
hookBinaryNameOf,
|
|
1087
1122
|
guardBinary,
|
|
1088
1123
|
guardBinaryRefusing,
|
|
1089
1124
|
guardNodeScript,
|
|
1090
1125
|
guardCursorGate,
|
|
1091
1126
|
guardedArgv,
|
|
1127
|
+
registeredCommands,
|
|
1128
|
+
namesOurBinary,
|
|
1129
|
+
registrationHolderOf,
|
|
1130
|
+
windowsNodeLauncherFor,
|
|
1092
1131
|
registerHookEntry,
|
|
1093
1132
|
isProtectedByScope,
|
|
1094
1133
|
canonicalJson,
|
|
1095
1134
|
CODEX_HOOK_BINARY,
|
|
1135
|
+
codexHookCommand,
|
|
1096
1136
|
codexHome,
|
|
1097
1137
|
codexHomeFrom,
|
|
1098
1138
|
codexConfigToml,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
realpath
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UB7VUSSX.js";
|
|
4
4
|
import {
|
|
5
5
|
findNativeClaudeInstall
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-TO77OYLM.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-
|
|
16
|
+
} from "./chunk-2BJZFA7X.js";
|
|
17
17
|
import {
|
|
18
18
|
MANAGED_PROVIDERS
|
|
19
19
|
} from "./chunk-WG67W43Y.js";
|
|
@@ -3,16 +3,16 @@ import {
|
|
|
3
3
|
loadPin,
|
|
4
4
|
savePin,
|
|
5
5
|
verifyRecipients
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-VHLRXIMC.js";
|
|
7
7
|
import {
|
|
8
8
|
SESSION_HISTORY_RETENTION_DAYS
|
|
9
9
|
} from "./chunk-MHUKYYYR.js";
|
|
10
10
|
import {
|
|
11
11
|
ensureDaemonRunning
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-6L2U3TP3.js";
|
|
13
13
|
import {
|
|
14
14
|
hookOwnerOf
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-IEAABGST.js";
|
|
16
16
|
import {
|
|
17
17
|
buildTranscriptRecords,
|
|
18
18
|
decodePublicKey,
|
|
@@ -30,19 +30,19 @@ import {
|
|
|
30
30
|
import {
|
|
31
31
|
transcriptEnvironmentPreference,
|
|
32
32
|
transcriptsEnabled
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-OXTRF7CP.js";
|
|
34
34
|
import {
|
|
35
35
|
readTranscriptPreference
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-CXZAKS7S.js";
|
|
37
37
|
import {
|
|
38
38
|
claudeConfigDir,
|
|
39
39
|
codexHome,
|
|
40
40
|
pusharyDir
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-UOUUTDWF.js";
|
|
42
42
|
import {
|
|
43
43
|
writeJsonAtomic,
|
|
44
44
|
writeJsonAtomicDurable
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-2BJZFA7X.js";
|
|
46
46
|
import {
|
|
47
47
|
getApiKey,
|
|
48
48
|
getBaseUrl
|
|
@@ -43,6 +43,15 @@ var cmdShimTarget = (shimDir, contents) => {
|
|
|
43
43
|
const relativeTarget = CMD_SHIM_TARGET.exec(contents)?.[1];
|
|
44
44
|
return relativeTarget === void 0 ? void 0 : win32.resolve(shimDir, relativeTarget);
|
|
45
45
|
};
|
|
46
|
+
var CMD_SHIM = /\.cmd$/i;
|
|
47
|
+
var cmdShimScriptOf = (shim, readFile) => {
|
|
48
|
+
if (!CMD_SHIM.test(shim)) return void 0;
|
|
49
|
+
try {
|
|
50
|
+
return cmdShimTarget(win32.dirname(shim), readFile(shim));
|
|
51
|
+
} catch {
|
|
52
|
+
return void 0;
|
|
53
|
+
}
|
|
54
|
+
};
|
|
46
55
|
var launchedPackage = (ownName) => ownName ?? LEGACY_PACKAGE;
|
|
47
56
|
var globalInstallTarget = (owner, ownName) => {
|
|
48
57
|
switch (owner.kind) {
|
|
@@ -153,6 +162,7 @@ export {
|
|
|
153
162
|
globalUpgradeEntry,
|
|
154
163
|
decideCommandOwner,
|
|
155
164
|
cmdShimTarget,
|
|
165
|
+
cmdShimScriptOf,
|
|
156
166
|
launchedPackage,
|
|
157
167
|
globalInstallTarget,
|
|
158
168
|
classifyGlobalFolder,
|
|
@@ -22,21 +22,21 @@ import {
|
|
|
22
22
|
turnCodexAppCardsOff,
|
|
23
23
|
turnCodexAppCardsOn,
|
|
24
24
|
whyLaunchctlFailed
|
|
25
|
-
} from "./chunk-
|
|
26
|
-
import "./chunk-
|
|
25
|
+
} from "./chunk-5LLZSX7I.js";
|
|
26
|
+
import "./chunk-6355HHSR.js";
|
|
27
27
|
import "./chunk-XCEN33UP.js";
|
|
28
28
|
import "./chunk-QCGNGEGE.js";
|
|
29
|
-
import "./chunk-
|
|
29
|
+
import "./chunk-6L2U3TP3.js";
|
|
30
30
|
import "./chunk-XHKBHWLX.js";
|
|
31
|
-
import "./chunk-
|
|
31
|
+
import "./chunk-CXZAKS7S.js";
|
|
32
32
|
import "./chunk-E46NE7FB.js";
|
|
33
|
-
import "./chunk-
|
|
33
|
+
import "./chunk-YAMNJXCD.js";
|
|
34
34
|
import "./chunk-NPBPH7KI.js";
|
|
35
|
-
import "./chunk-
|
|
36
|
-
import "./chunk-
|
|
35
|
+
import "./chunk-UOUUTDWF.js";
|
|
36
|
+
import "./chunk-2BJZFA7X.js";
|
|
37
37
|
import "./chunk-ONUAAXAW.js";
|
|
38
38
|
import "./chunk-TTTK44RK.js";
|
|
39
|
-
import "./chunk-
|
|
39
|
+
import "./chunk-ZVU6WMMU.js";
|
|
40
40
|
import "./chunk-WG67W43Y.js";
|
|
41
41
|
import "./chunk-MLKGABMK.js";
|
|
42
42
|
export {
|
|
@@ -11,32 +11,32 @@ import {
|
|
|
11
11
|
isCodexQuestionLeftWithTheLocalClient,
|
|
12
12
|
planCodexElicitation,
|
|
13
13
|
reportOwnedQuestion
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-GUM3WG4B.js";
|
|
15
15
|
import "./chunk-JTYZEP4Q.js";
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-UYTPCZ4M.js";
|
|
17
|
+
import "./chunk-UB7VUSSX.js";
|
|
18
18
|
import "./chunk-N5P2FLOJ.js";
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-DJILSCSU.js";
|
|
20
|
+
import "./chunk-TO77OYLM.js";
|
|
21
21
|
import "./chunk-W3VRQEL3.js";
|
|
22
22
|
import "./chunk-XMSDA5WA.js";
|
|
23
23
|
import "./chunk-XHKBHWLX.js";
|
|
24
24
|
import "./chunk-M5XNFUXN.js";
|
|
25
25
|
import {
|
|
26
26
|
writeDegraded
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-OIW3JAWH.js";
|
|
28
28
|
import "./chunk-POFBE6ZY.js";
|
|
29
|
-
import "./chunk-
|
|
30
|
-
import "./chunk-
|
|
31
|
-
import "./chunk-
|
|
32
|
-
import "./chunk-
|
|
33
|
-
import "./chunk-
|
|
34
|
-
import "./chunk-
|
|
29
|
+
import "./chunk-Z5HLACZT.js";
|
|
30
|
+
import "./chunk-LNSCANYY.js";
|
|
31
|
+
import "./chunk-JNCD2ZG3.js";
|
|
32
|
+
import "./chunk-YAMNJXCD.js";
|
|
33
|
+
import "./chunk-UOUUTDWF.js";
|
|
34
|
+
import "./chunk-2BJZFA7X.js";
|
|
35
35
|
import "./chunk-ONUAAXAW.js";
|
|
36
36
|
import "./chunk-PPY5N2E6.js";
|
|
37
37
|
import "./chunk-KZERVKTD.js";
|
|
38
38
|
import "./chunk-TTTK44RK.js";
|
|
39
|
-
import "./chunk-
|
|
39
|
+
import "./chunk-ZVU6WMMU.js";
|
|
40
40
|
import {
|
|
41
41
|
canonicalJsonText
|
|
42
42
|
} from "./chunk-WG67W43Y.js";
|
|
@@ -7,18 +7,18 @@ import {
|
|
|
7
7
|
recordUnfinishedUpgrade,
|
|
8
8
|
upgradeInstalledPackage,
|
|
9
9
|
withUpgradeLock
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-L77YWBMK.js";
|
|
11
|
+
import "./chunk-ESRKYHWE.js";
|
|
12
|
+
import "./chunk-UYTPCZ4M.js";
|
|
13
|
+
import "./chunk-UB7VUSSX.js";
|
|
14
|
+
import "./chunk-TO77OYLM.js";
|
|
15
|
+
import "./chunk-S2DLTWFG.js";
|
|
16
16
|
import "./chunk-POFBE6ZY.js";
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-UOUUTDWF.js";
|
|
18
|
+
import "./chunk-2BJZFA7X.js";
|
|
19
19
|
import "./chunk-KZERVKTD.js";
|
|
20
20
|
import "./chunk-TTTK44RK.js";
|
|
21
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-ZVU6WMMU.js";
|
|
22
22
|
import "./chunk-WG67W43Y.js";
|
|
23
23
|
import "./chunk-MLKGABMK.js";
|
|
24
24
|
export {
|
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
getMachineId,
|
|
3
3
|
getOrCreateMachineId,
|
|
4
4
|
readExistingMachineId
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-YAMNJXCD.js";
|
|
6
|
+
import "./chunk-UOUUTDWF.js";
|
|
7
|
+
import "./chunk-2BJZFA7X.js";
|
|
8
|
+
import "./chunk-ZVU6WMMU.js";
|
|
9
9
|
import "./chunk-WG67W43Y.js";
|
|
10
10
|
import "./chunk-MLKGABMK.js";
|
|
11
11
|
export {
|
|
@@ -22,11 +22,11 @@ import {
|
|
|
22
22
|
resolveControlPolicy,
|
|
23
23
|
resolveProviderBinary,
|
|
24
24
|
trackProviderInventory
|
|
25
|
-
} from "./chunk-
|
|
26
|
-
import "./chunk-
|
|
27
|
-
import "./chunk-
|
|
28
|
-
import "./chunk-
|
|
29
|
-
import "./chunk-
|
|
25
|
+
} from "./chunk-UYTPCZ4M.js";
|
|
26
|
+
import "./chunk-UB7VUSSX.js";
|
|
27
|
+
import "./chunk-TO77OYLM.js";
|
|
28
|
+
import "./chunk-2BJZFA7X.js";
|
|
29
|
+
import "./chunk-ZVU6WMMU.js";
|
|
30
30
|
import "./chunk-WG67W43Y.js";
|
|
31
31
|
import "./chunk-MLKGABMK.js";
|
|
32
32
|
export {
|