pushary 1.9.50 → 1.9.52
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 +22 -0
- package/README.md +9 -1
- package/dist/api-K6ZROHYB.js +55 -0
- package/dist/bin/pushary-bell-hook.js +28 -25
- package/dist/bin/pushary-bell.js +13 -11
- package/dist/bin/pushary-claude.js +37 -33
- package/dist/bin/pushary-clean.js +68 -42
- package/dist/bin/pushary-codex-bridge.js +23 -20
- package/dist/bin/pushary-codex-hook.js +36 -32
- package/dist/bin/pushary-codex-session.js +17 -616
- package/dist/bin/pushary-codex.js +15 -12
- package/dist/bin/pushary-connect.js +31 -28
- package/dist/bin/pushary-cowork.js +7 -6
- package/dist/bin/pushary-daemon.js +57 -52
- package/dist/bin/pushary-disconnect.js +29 -26
- package/dist/bin/pushary-doctor.js +58 -53
- package/dist/bin/pushary-elicitation-hook.js +29 -26
- package/dist/bin/pushary-gemini-bridge.js +17 -15
- package/dist/bin/pushary-gemini-hook.js +33 -29
- package/dist/bin/pushary-hook.js +34 -31
- package/dist/bin/pushary-login.js +19 -16
- package/dist/bin/pushary-logout.js +30 -27
- package/dist/bin/pushary-mcp.js +16 -9
- package/dist/bin/pushary-mode.js +16 -14
- package/dist/bin/pushary-notification-hook.js +27 -24
- package/dist/bin/pushary-opencode-hook.js +32 -28
- package/dist/bin/pushary-permission-denied-hook.js +32 -29
- package/dist/bin/pushary-permission-hook.js +31 -28
- package/dist/bin/pushary-post-hook.js +27 -24
- package/dist/bin/pushary-prompt-hook.js +27 -24
- package/dist/bin/pushary-session-end-hook.js +27 -24
- package/dist/bin/pushary-session-start-hook.js +34 -29
- package/dist/bin/pushary-setup.js +195 -138
- package/dist/bin/pushary-stats.js +8 -7
- package/dist/bin/pushary-status.js +35 -32
- package/dist/bin/pushary-stop-hook.js +27 -24
- package/dist/bin/pushary-stopfailure-hook.js +27 -24
- package/dist/bin/pushary-suggestions.js +16 -14
- package/dist/bin/pushary-transcript-register.js +19 -17
- package/dist/bin/pushary-transcripts.js +10 -9
- package/dist/bin/pushary-upgrade.js +76 -46
- package/dist/bin/pushary-wait.js +16 -14
- package/dist/bin/pushary.js +10 -8
- package/dist/{chunk-GBKSCDEK.js → chunk-2LEH5IGX.js} +17 -4
- package/dist/chunk-36NGFHE4.js +72 -0
- package/dist/{chunk-B7LV6W7U.js → chunk-3RPN7AAT.js} +1 -1
- package/dist/{chunk-GDDXGBTM.js → chunk-46TC24ET.js} +2 -2
- package/dist/{chunk-KEAIIVW3.js → chunk-4QQEUJL4.js} +2 -2
- package/dist/{chunk-XNZB274I.js → chunk-5463UUO2.js} +1 -1
- package/dist/{chunk-FPKQGWAF.js → chunk-56ZTIY6D.js} +2 -2
- package/dist/{chunk-34AQAQKW.js → chunk-63IQRYVP.js} +4 -4
- package/dist/{chunk-25SYEAW4.js → chunk-6C4S3QYD.js} +3 -3
- package/dist/{chunk-4PCJ6DYK.js → chunk-6SWMKF5E.js} +2 -2
- package/dist/{chunk-Y7WD72J7.js → chunk-7CLLWDCP.js} +1 -1
- package/dist/{chunk-WLT6J3SB.js → chunk-ALZZVC3E.js} +2 -2
- package/dist/{chunk-ZMYLVFXC.js → chunk-BL3WAGIK.js} +14 -9
- package/dist/{chunk-PA54A437.js → chunk-BUXDR6US.js} +1 -1
- package/dist/{chunk-VUS6QGND.js → chunk-CQ5JGRML.js} +5 -1
- package/dist/{chunk-IF2UPWD2.js → chunk-DHJSBK63.js} +1 -1
- package/dist/chunk-DMJFW4KL.js +729 -0
- package/dist/{chunk-ABMEBN2R.js → chunk-EK7SZJ4K.js} +6 -4
- package/dist/{chunk-VCZN7NAB.js → chunk-EPOD7QHT.js} +7 -5
- package/dist/{chunk-KIO2MZQC.js → chunk-FCMWUYIE.js} +5 -3
- package/dist/{chunk-YTYXFA5M.js → chunk-FI73DGNB.js} +1 -1
- package/dist/{chunk-JGNYCRB2.js → chunk-FV34HT35.js} +1 -1
- package/dist/{chunk-KK2DIUVV.js → chunk-GCN73COS.js} +1 -1
- package/dist/{chunk-KBGKWB5T.js → chunk-H57DXSHR.js} +4 -2
- package/dist/{chunk-SALUTWPX.js → chunk-IHUFRAHB.js} +4 -4
- package/dist/chunk-JBT3ZSJS.js +92 -0
- package/dist/{chunk-5Q2FRMPC.js → chunk-JOWF4Y4P.js} +4 -4
- package/dist/{chunk-EP6S6VY3.js → chunk-JPABKXK6.js} +6 -6
- package/dist/{chunk-LLRYP5TR.js → chunk-K23WMLPY.js} +5 -5
- package/dist/{chunk-34RXPM5U.js → chunk-L5YTS2BP.js} +3 -3
- package/dist/{chunk-SE4JFMLW.js → chunk-LD4MWJMD.js} +8 -6
- package/dist/{chunk-OR5F63C2.js → chunk-LF3TLC7B.js} +2 -168
- package/dist/{chunk-XTVEW2NG.js → chunk-LIESRXK5.js} +1 -1
- package/dist/{chunk-ZOKMGBPR.js → chunk-MC4VY5LK.js} +16 -5
- package/dist/{chunk-K73CBZKW.js → chunk-MHQB62K5.js} +4 -4
- package/dist/{chunk-DH4BWFU7.js → chunk-MTKV4RUQ.js} +82 -16
- package/dist/{chunk-Y74IJ2IO.js → chunk-N77BH7H2.js} +10 -4
- package/dist/{chunk-ZTTCYHOM.js → chunk-NECZKPJN.js} +31 -6
- package/dist/{chunk-TGCIFEDE.js → chunk-NELH25J7.js} +13 -11
- package/dist/{chunk-HXRH7ZCK.js → chunk-NHVEQLQC.js} +2 -2
- package/dist/{chunk-OW4DNSQ6.js → chunk-NSY2V7XU.js} +1 -1
- package/dist/chunk-OHSHDQZF.js +271 -0
- package/dist/{chunk-ZYYQJSIO.js → chunk-OML4YFBN.js} +44 -462
- package/dist/{chunk-X3RCIOIH.js → chunk-ONCWYACA.js} +1 -1
- package/dist/{chunk-LZYJMSOY.js → chunk-P2546BBI.js} +3 -3
- package/dist/{chunk-WEY5ZHDB.js → chunk-Q7OXI6VS.js} +5 -5
- package/dist/{chunk-APASKZ2I.js → chunk-QKU46TK5.js} +5 -3
- package/dist/chunk-QTOLNRET.js +169 -0
- package/dist/{chunk-TYTIDEBW.js → chunk-RH6KR6EH.js} +5 -5
- package/dist/{chunk-7RMSB4A2.js → chunk-RL7EOD6I.js} +87 -24
- package/dist/{chunk-BOVSUH4N.js → chunk-S6RNS4UL.js} +2 -2
- package/dist/{chunk-LY3OJFBW.js → chunk-T6RIKJUO.js} +2 -1
- package/dist/{chunk-YVO4HIHX.js → chunk-U2L42GVI.js} +12 -10
- package/dist/{chunk-BXK6ZJVJ.js → chunk-UVT6B6XN.js} +2 -2
- package/dist/{chunk-UCF3EZZL.js → chunk-VQPSWD3A.js} +13 -13
- package/dist/{chunk-XH3F66VD.js → chunk-VYBH6D4X.js} +3 -3
- package/dist/chunk-XCEN33UP.js +7 -0
- package/dist/{chunk-GTGXQ7FJ.js → chunk-XDCXTDHH.js} +11 -11
- package/dist/{chunk-OZLGTMIY.js → chunk-XSUJ2PQY.js} +2 -2
- package/dist/chunk-XUW2DRAQ.js +427 -0
- package/dist/{chunk-UHVD7BSV.js → chunk-XZRLFBEA.js} +6 -6
- package/dist/{chunk-AWMMABVB.js → chunk-ZMPR436Z.js} +52 -138
- package/dist/{chunk-PXUNPXOX.js → chunk-ZOP3I2GQ.js} +3 -3
- package/dist/codex-app-cards-switch-OUQ3DUWF.js +52 -0
- package/dist/codex-desktop-launch-EIFLPLB7.js +27 -0
- package/dist/codex-session-launch-KLH2FSSJ.js +331 -0
- package/dist/config-HX6ZNOIL.js +14 -0
- package/dist/{global-upgrade-AIUSS2YH.js → global-upgrade-AZN3BPI3.js} +8 -6
- package/dist/identity-AQIMUWYN.js +15 -0
- package/dist/live-capabilities-4IIFAMHU.js +53 -0
- package/dist/{paths-RO34TYNM.js → paths-X4IPV2WJ.js} +4 -2
- package/dist/{reapply-KTNPP4XE.js → reapply-CXODG53B.js} +27 -21
- package/dist/src/index.d.ts +3 -3
- package/dist/src/index.js +22 -19
- package/dist/{upgrade-lock-5UAGXIW7.js → upgrade-lock-AHISGKER.js} +5 -3
- package/dist/usage-ZC6BKIE3.js +10 -0
- package/package.json +1 -1
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
// src/cli-package-name.ts
|
|
2
|
+
var CANONICAL_PACKAGE = "pushary";
|
|
3
|
+
var LEGACY_PACKAGE = "@pushary/agent-hooks";
|
|
4
|
+
var CLI_PACKAGE_NAMES = [CANONICAL_PACKAGE, LEGACY_PACKAGE];
|
|
5
|
+
var isCliPackageName = (value) => typeof value === "string" && CLI_PACKAGE_NAMES.some((name) => name === value);
|
|
6
|
+
var cliPackagePathSegments = (name) => name.split("/");
|
|
7
|
+
|
|
8
|
+
// src/global-package.ts
|
|
9
|
+
import { posix, win32 } from "path";
|
|
10
|
+
var OWNERSHIP_PROBE_COMMAND = "pushary-hook";
|
|
11
|
+
var pathApiFor = (platform) => platform === "win32" ? win32 : posix;
|
|
12
|
+
var POSIX_GLOBAL_ROOT_SEGMENTS = ["lib", "node_modules"];
|
|
13
|
+
var UPGRADE_ENTRY_SEGMENTS = ["dist", "bin", "pushary-upgrade.js"];
|
|
14
|
+
var globalRootFor = (prefix, platform) => platform === "win32" ? win32.join(prefix, "node_modules") : posix.join(prefix, ...POSIX_GLOBAL_ROOT_SEGMENTS);
|
|
15
|
+
var globalPackageFolder = (root, name, platform) => pathApiFor(platform).join(root, ...cliPackagePathSegments(name));
|
|
16
|
+
var globalUpgradeEntry = (prefix, name, platform) => pathApiFor(platform).join(globalPackageFolder(globalRootFor(prefix, platform), name, platform), ...UPGRADE_ENTRY_SEGMENTS);
|
|
17
|
+
var isInsideFolder = (target, folder, platform) => {
|
|
18
|
+
const pathApi = pathApiFor(platform);
|
|
19
|
+
const relativePath = pathApi.relative(folder, target);
|
|
20
|
+
return relativePath !== "" && !relativePath.startsWith("..") && !pathApi.isAbsolute(relativePath);
|
|
21
|
+
};
|
|
22
|
+
var linkPointsInto = (evidence, targets, name) => evidence.globalRoots.some((root) => {
|
|
23
|
+
const folder = globalPackageFolder(root, name, evidence.platform);
|
|
24
|
+
return targets.some((target) => isInsideFolder(target, folder, evidence.platform));
|
|
25
|
+
});
|
|
26
|
+
var ownerFromInstalled = (installed, whenNone) => {
|
|
27
|
+
const [only, ...others] = installed;
|
|
28
|
+
if (only === void 0) return whenNone;
|
|
29
|
+
if (others.length > 0) return { kind: "unknown", reason: "both_installed" };
|
|
30
|
+
return { kind: "owned", name: only };
|
|
31
|
+
};
|
|
32
|
+
var decideCommandOwner = (evidence) => {
|
|
33
|
+
const { link } = evidence;
|
|
34
|
+
if (link.kind === "resolved") {
|
|
35
|
+
const name = CLI_PACKAGE_NAMES.find((candidate) => linkPointsInto(evidence, link.targets, candidate));
|
|
36
|
+
return name === void 0 ? { kind: "unknown", reason: "foreign_command" } : { kind: "owned", name };
|
|
37
|
+
}
|
|
38
|
+
const whenNone = link.kind === "absent" ? { kind: "none" } : { kind: "unknown", reason: "unreadable_command" };
|
|
39
|
+
return ownerFromInstalled(evidence.installed, whenNone);
|
|
40
|
+
};
|
|
41
|
+
var CMD_SHIM_TARGET = /"%(?:~dp0|dp0%)\\([^"]+?)"\s+%[*]/;
|
|
42
|
+
var cmdShimTarget = (shimDir, contents) => {
|
|
43
|
+
const relativeTarget = CMD_SHIM_TARGET.exec(contents)?.[1];
|
|
44
|
+
return relativeTarget === void 0 ? void 0 : win32.resolve(shimDir, relativeTarget);
|
|
45
|
+
};
|
|
46
|
+
var launchedPackage = (ownName) => ownName ?? LEGACY_PACKAGE;
|
|
47
|
+
var globalInstallTarget = (owner, ownName) => {
|
|
48
|
+
switch (owner.kind) {
|
|
49
|
+
case "owned":
|
|
50
|
+
return owner.name;
|
|
51
|
+
case "none":
|
|
52
|
+
return launchedPackage(ownName);
|
|
53
|
+
case "unknown":
|
|
54
|
+
return LEGACY_PACKAGE;
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
var isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
58
|
+
var declaresOwnershipProbe = (bin) => isRecord(bin) && typeof bin[OWNERSHIP_PROBE_COMMAND] === "string";
|
|
59
|
+
var cliManifestName = (manifest) => {
|
|
60
|
+
if (!isRecord(manifest) || !isCliPackageName(manifest.name) || !declaresOwnershipProbe(manifest.bin)) return void 0;
|
|
61
|
+
return manifest.name;
|
|
62
|
+
};
|
|
63
|
+
var classifyGlobalFolder = (name, read) => {
|
|
64
|
+
if (read.kind === "unreadable") return { kind: "unseen" };
|
|
65
|
+
const { manifest } = read;
|
|
66
|
+
if (!isRecord(manifest) || cliManifestName(manifest) !== name) return { kind: "foreign" };
|
|
67
|
+
return { kind: "ours", installed: { name, version: typeof manifest.version === "string" ? manifest.version : void 0 } };
|
|
68
|
+
};
|
|
69
|
+
var classifyGlobalInstall = (installed, owner) => {
|
|
70
|
+
const [only, ...others] = installed;
|
|
71
|
+
if (only === void 0) return { kind: "absent" };
|
|
72
|
+
if (others.length === 0) return { kind: "single", installed: only };
|
|
73
|
+
return { kind: "both", installed, owner };
|
|
74
|
+
};
|
|
75
|
+
var isUninstallable = (evidence) => evidence.listing !== "absent" && evidence.folder !== "foreign";
|
|
76
|
+
var globalPackagesToUninstall = (evidence) => evidence.filter(isUninstallable).map((entry) => entry.name);
|
|
77
|
+
var commandsPackage = (install) => {
|
|
78
|
+
if (install.kind === "single") return install.installed;
|
|
79
|
+
if (install.kind !== "both" || install.owner.kind !== "owned") return void 0;
|
|
80
|
+
const ownerName = install.owner.name;
|
|
81
|
+
return install.installed.find((installed) => installed.name === ownerName);
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
// src/cli/version.ts
|
|
85
|
+
import { readFileSync } from "fs";
|
|
86
|
+
import { dirname, join, parse } from "path";
|
|
87
|
+
import { fileURLToPath } from "url";
|
|
88
|
+
var UNKNOWN_VERSION = "0.0.0";
|
|
89
|
+
var cliManifestNameAt = (manifestPath) => {
|
|
90
|
+
try {
|
|
91
|
+
return cliManifestName(JSON.parse(readFileSync(manifestPath, "utf-8")));
|
|
92
|
+
} catch {
|
|
93
|
+
return void 0;
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
var findOwnPackage = (start) => {
|
|
97
|
+
const { root } = parse(start);
|
|
98
|
+
let dir = start;
|
|
99
|
+
while (true) {
|
|
100
|
+
const name = cliManifestNameAt(join(dir, "package.json"));
|
|
101
|
+
if (name !== void 0) return { root: dir, name };
|
|
102
|
+
if (dir === root) return void 0;
|
|
103
|
+
const parent = dirname(dir);
|
|
104
|
+
if (parent === dir) return void 0;
|
|
105
|
+
dir = parent;
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
var runningPackage = () => {
|
|
109
|
+
try {
|
|
110
|
+
return findOwnPackage(dirname(fileURLToPath(import.meta.url)));
|
|
111
|
+
} catch {
|
|
112
|
+
return void 0;
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
var getPackageVersion = () => {
|
|
116
|
+
const root = ownPackageRoot();
|
|
117
|
+
return (root === void 0 ? void 0 : packageVersionAt(root)) ?? UNKNOWN_VERSION;
|
|
118
|
+
};
|
|
119
|
+
var ownPackageRoot = () => runningPackage()?.root;
|
|
120
|
+
var ownPackageName = () => runningPackage()?.name;
|
|
121
|
+
var packageVersionAt = (packageRoot) => {
|
|
122
|
+
try {
|
|
123
|
+
const manifest = JSON.parse(readFileSync(join(packageRoot, "package.json"), "utf-8"));
|
|
124
|
+
const version = manifest && typeof manifest === "object" && "version" in manifest ? manifest.version : void 0;
|
|
125
|
+
return typeof version === "string" ? version : void 0;
|
|
126
|
+
} catch {
|
|
127
|
+
return void 0;
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
var isNewerVersion = (candidate, current) => {
|
|
131
|
+
const a = candidate.split(".").map((part) => parseInt(part, 10) || 0);
|
|
132
|
+
const b = current.split(".").map((part) => parseInt(part, 10) || 0);
|
|
133
|
+
for (let i = 0; i < 3; i++) {
|
|
134
|
+
if ((a[i] ?? 0) > (b[i] ?? 0)) return true;
|
|
135
|
+
if ((a[i] ?? 0) < (b[i] ?? 0)) return false;
|
|
136
|
+
}
|
|
137
|
+
return false;
|
|
138
|
+
};
|
|
139
|
+
var RELEASE_VERSION = /^\d+\.\d+\.\d+$/;
|
|
140
|
+
var isReleaseVersion = (value) => RELEASE_VERSION.test(value);
|
|
141
|
+
var majorOf = (version) => parseInt(version.split(".")[0] ?? "", 10) || 0;
|
|
142
|
+
var isSameMajorVersion = (candidate, current) => majorOf(candidate) === majorOf(current);
|
|
143
|
+
|
|
144
|
+
export {
|
|
145
|
+
CANONICAL_PACKAGE,
|
|
146
|
+
LEGACY_PACKAGE,
|
|
147
|
+
CLI_PACKAGE_NAMES,
|
|
148
|
+
cliPackagePathSegments,
|
|
149
|
+
OWNERSHIP_PROBE_COMMAND,
|
|
150
|
+
POSIX_GLOBAL_ROOT_SEGMENTS,
|
|
151
|
+
globalRootFor,
|
|
152
|
+
globalPackageFolder,
|
|
153
|
+
globalUpgradeEntry,
|
|
154
|
+
decideCommandOwner,
|
|
155
|
+
cmdShimTarget,
|
|
156
|
+
launchedPackage,
|
|
157
|
+
globalInstallTarget,
|
|
158
|
+
classifyGlobalFolder,
|
|
159
|
+
classifyGlobalInstall,
|
|
160
|
+
globalPackagesToUninstall,
|
|
161
|
+
commandsPackage,
|
|
162
|
+
getPackageVersion,
|
|
163
|
+
ownPackageRoot,
|
|
164
|
+
ownPackageName,
|
|
165
|
+
packageVersionAt,
|
|
166
|
+
isNewerVersion,
|
|
167
|
+
isReleaseVersion,
|
|
168
|
+
isSameMajorVersion
|
|
169
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
APPROVAL_SETTINGS_PATH
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-JOWF4Y4P.js";
|
|
4
4
|
import {
|
|
5
5
|
readMacAppAgentKey
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-MHQB62K5.js";
|
|
7
7
|
import {
|
|
8
8
|
findExportedKeyLines,
|
|
9
9
|
isAdoptedMacAppKey,
|
|
@@ -13,13 +13,13 @@ import {
|
|
|
13
13
|
readConfigFileKey,
|
|
14
14
|
readKeySource,
|
|
15
15
|
readMacAppKeyPrefix
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-VYBH6D4X.js";
|
|
17
17
|
import {
|
|
18
18
|
absoluteUrl
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-L5YTS2BP.js";
|
|
20
20
|
import {
|
|
21
21
|
isValidApiKey
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-LF3TLC7B.js";
|
|
23
23
|
|
|
24
24
|
// src/key-revocation.ts
|
|
25
25
|
var SELF_REVOKE_PATH = "/api/v1/server/keys/self/revoke";
|
|
@@ -1,23 +1,39 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ensureCodexTrustsPusharyHooks
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FCMWUYIE.js";
|
|
4
|
+
import {
|
|
5
|
+
CODEX_INSTRUCTIONS_LABEL,
|
|
6
|
+
GEMINI_INSTRUCTIONS_LABEL,
|
|
7
|
+
OPENCODE_INSTRUCTIONS_LABEL,
|
|
8
|
+
fxIgnoresInstructionsFile,
|
|
9
|
+
fxInstructionsBody,
|
|
10
|
+
fxServerHolder,
|
|
11
|
+
macAppFxBridge,
|
|
12
|
+
refreshInstructionBlock,
|
|
13
|
+
renderAgentInstructions
|
|
14
|
+
} from "./chunk-MTKV4RUQ.js";
|
|
4
15
|
import {
|
|
5
16
|
OPENCODE_HOOK_BINARY,
|
|
6
17
|
agentHookOwner,
|
|
7
18
|
installOpenCodePlugin,
|
|
8
19
|
macAppBridgeAvailable,
|
|
9
20
|
openCodeHookArgv,
|
|
21
|
+
openCodeInstructionsFile,
|
|
10
22
|
openCodePluginDir,
|
|
11
23
|
openCodeWired
|
|
12
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-K23WMLPY.js";
|
|
25
|
+
import {
|
|
26
|
+
detectClaudeVersion
|
|
27
|
+
} from "./chunk-RIVNNBEK.js";
|
|
13
28
|
import {
|
|
14
29
|
addClaudeMcpServer,
|
|
15
30
|
addCompatibleHooks,
|
|
16
31
|
addPusharyHooks,
|
|
17
32
|
addPusharyToolPermissions,
|
|
18
33
|
compatibleConfigFile,
|
|
34
|
+
compatibleInstructionsFile,
|
|
19
35
|
hasCompatibleHooks
|
|
20
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-N77BH7H2.js";
|
|
21
37
|
import {
|
|
22
38
|
claudeUnprovenHolds,
|
|
23
39
|
claudeWired,
|
|
@@ -25,7 +41,7 @@ import {
|
|
|
25
41
|
codexWired,
|
|
26
42
|
geminiWired,
|
|
27
43
|
planHooks
|
|
28
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-Q7OXI6VS.js";
|
|
29
45
|
import {
|
|
30
46
|
CLAUDE_HOOK_BINARY,
|
|
31
47
|
CLAUDE_HOOK_EVENTS,
|
|
@@ -36,10 +52,7 @@ import {
|
|
|
36
52
|
needsReregistration,
|
|
37
53
|
registrationSignatures,
|
|
38
54
|
supportedClaudeEvents
|
|
39
|
-
} from "./chunk-
|
|
40
|
-
import {
|
|
41
|
-
detectClaudeVersion
|
|
42
|
-
} from "./chunk-RIVNNBEK.js";
|
|
55
|
+
} from "./chunk-6C4S3QYD.js";
|
|
43
56
|
import {
|
|
44
57
|
formatVersion
|
|
45
58
|
} from "./chunk-6ICPEJY5.js";
|
|
@@ -49,21 +62,29 @@ import {
|
|
|
49
62
|
addCodexHooks,
|
|
50
63
|
addCodexMcpServer,
|
|
51
64
|
claudeRegistrationReceipt,
|
|
65
|
+
codexAgentsMd,
|
|
52
66
|
codexConfigToml,
|
|
53
67
|
codexHookPositions,
|
|
54
68
|
codexHooksJson,
|
|
55
69
|
codexRegistrationHolder,
|
|
56
70
|
codexVacatedIndexes,
|
|
57
71
|
dropVacatedCodexHookTrust,
|
|
72
|
+
fxAgentsMd,
|
|
73
|
+
fxConfigDir,
|
|
74
|
+
fxMcpProfile,
|
|
75
|
+
geminiMd,
|
|
58
76
|
guardBinary,
|
|
59
77
|
hasCodexHooks,
|
|
60
78
|
namesOurBinary,
|
|
79
|
+
pusharyDir,
|
|
61
80
|
registeredCommands,
|
|
62
81
|
registrationHolderOf,
|
|
63
|
-
resolveGlobalBinDir,
|
|
64
|
-
resolveGlobalBinary,
|
|
65
82
|
vscodePluginMcp
|
|
66
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-OML4YFBN.js";
|
|
84
|
+
import {
|
|
85
|
+
resolveGlobalBinDir,
|
|
86
|
+
resolveGlobalBinary
|
|
87
|
+
} from "./chunk-XUW2DRAQ.js";
|
|
67
88
|
import {
|
|
68
89
|
readJsonSafe,
|
|
69
90
|
writeFileAtomic,
|
|
@@ -73,7 +94,7 @@ import {
|
|
|
73
94
|
HOOK_COMPATIBLE_PROFILES,
|
|
74
95
|
isCompatibleAgentType,
|
|
75
96
|
isRecord
|
|
76
|
-
} from "./chunk-
|
|
97
|
+
} from "./chunk-LF3TLC7B.js";
|
|
77
98
|
|
|
78
99
|
// src/reapply.ts
|
|
79
100
|
import { dirname, join } from "path";
|
|
@@ -350,31 +371,71 @@ var reapplyCompatibleHooks = (profile, paths = {}) => {
|
|
|
350
371
|
return CONFIGURED_BUT_FAILED;
|
|
351
372
|
}
|
|
352
373
|
};
|
|
374
|
+
var CONFIGURED_AND_UNCHANGED = { configured: true, reapplied: false, hooks: false, mcp: false };
|
|
375
|
+
var fxHolder = () => fxServerHolder(fxMcpProfile(), macAppFxBridge(pusharyDir()));
|
|
376
|
+
var inspectFxWiring = () => fxHolder() === "cli" ? CONFIGURED_AND_UNCHANGED : NOT_CONFIGURED;
|
|
377
|
+
var compatibleInstructionTarget = (profile) => {
|
|
378
|
+
const file = compatibleInstructionsFile(profile);
|
|
379
|
+
return file && profile.instructions ? { file, body: renderAgentInstructions(profile.instructions.label) } : null;
|
|
380
|
+
};
|
|
381
|
+
var fxInstructionTarget = () => fxIgnoresInstructionsFile(fxAgentsMd(), fxConfigDir()) ? null : { file: fxAgentsMd(), body: fxInstructionsBody() };
|
|
382
|
+
var instructionTargetOrNull = (target) => {
|
|
383
|
+
try {
|
|
384
|
+
return target();
|
|
385
|
+
} catch {
|
|
386
|
+
return null;
|
|
387
|
+
}
|
|
388
|
+
};
|
|
389
|
+
var refreshAgentInstructions = (target) => {
|
|
390
|
+
const resolved = instructionTargetOrNull(target);
|
|
391
|
+
return resolved ? { file: resolved.file, outcome: refreshInstructionBlock(resolved.file, resolved.body) } : null;
|
|
392
|
+
};
|
|
353
393
|
var SETUP_CHOICE_BY_REAPPLY_ID = {
|
|
354
394
|
claude: "claude_code",
|
|
355
395
|
codex: "codex",
|
|
356
396
|
gemini: "gemini_cli",
|
|
357
397
|
cursor: "cursor",
|
|
358
398
|
vscode: "vscode",
|
|
359
|
-
opencode: "opencode"
|
|
399
|
+
opencode: "opencode",
|
|
400
|
+
fx: "fx"
|
|
360
401
|
};
|
|
361
402
|
var setupChoiceOf = (id) => isCompatibleAgentType(id) ? id : SETUP_CHOICE_BY_REAPPLY_ID[id];
|
|
362
403
|
var reapplyHookOwner = (id, appAvailable) => agentHookOwner(setupChoiceOf(id), appAvailable);
|
|
363
|
-
var
|
|
404
|
+
var hooksHeldByApp = (id, appAvailable) => planHooks({ owner: reapplyHookOwner(id, appAvailable), takeOverHooks: false, nonInteractive: true }) === "keep";
|
|
405
|
+
var fxHeldByApp = (appAvailable) => appAvailable && fxHolder() === "app";
|
|
406
|
+
var reapplyHolder = (id, appAvailable) => (id === "fx" ? fxHeldByApp(appAvailable) : hooksHeldByApp(id, appAvailable)) ? "app" : "cli";
|
|
364
407
|
var KEPT_FOR_APP = { configured: true, reapplied: false, hooks: false, mcp: false };
|
|
365
408
|
var FAILED_REAPPLY = { configured: false, reapplied: false, hooks: false, mcp: false, failed: true };
|
|
409
|
+
var noInstructionBlock = () => null;
|
|
366
410
|
var reapplyAllAgents = (apiKey, options = {}) => {
|
|
367
411
|
const runners = [
|
|
368
|
-
{ id: "claude", label: "Claude Code", run: () => reapplyClaudeSettings(apiKey) },
|
|
369
|
-
{
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
412
|
+
{ id: "claude", label: "Claude Code", run: () => reapplyClaudeSettings(apiKey), instructions: noInstructionBlock },
|
|
413
|
+
{
|
|
414
|
+
id: "codex",
|
|
415
|
+
label: "Codex",
|
|
416
|
+
run: () => reapplyCodexSettings(apiKey),
|
|
417
|
+
instructions: () => ({ file: codexAgentsMd(), body: renderAgentInstructions(CODEX_INSTRUCTIONS_LABEL) })
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
id: "gemini",
|
|
421
|
+
label: "Gemini CLI",
|
|
422
|
+
run: () => reapplyGeminiSettings(apiKey),
|
|
423
|
+
instructions: () => ({ file: geminiMd(), body: renderAgentInstructions(GEMINI_INSTRUCTIONS_LABEL) })
|
|
424
|
+
},
|
|
425
|
+
{ id: "cursor", label: "Cursor", run: () => reapplyCursorPlugin(apiKey), instructions: noInstructionBlock },
|
|
426
|
+
{ id: "vscode", label: "VS Code", run: () => reapplyVsCodePlugin(apiKey), instructions: noInstructionBlock },
|
|
427
|
+
{
|
|
428
|
+
id: "opencode",
|
|
429
|
+
label: "OpenCode",
|
|
430
|
+
run: () => reapplyOpenCodePlugin(),
|
|
431
|
+
instructions: () => ({ file: openCodeInstructionsFile(), body: renderAgentInstructions(OPENCODE_INSTRUCTIONS_LABEL) })
|
|
432
|
+
},
|
|
433
|
+
{ id: "fx", label: "fx", run: inspectFxWiring, instructions: fxInstructionTarget },
|
|
374
434
|
...HOOK_COMPATIBLE_PROFILES.map((profile) => ({
|
|
375
435
|
id: profile.agentType,
|
|
376
436
|
label: profile.label,
|
|
377
|
-
run: () => reapplyCompatibleHooks(profile)
|
|
437
|
+
run: () => reapplyCompatibleHooks(profile),
|
|
438
|
+
instructions: () => compatibleInstructionTarget(profile)
|
|
378
439
|
}))
|
|
379
440
|
];
|
|
380
441
|
const appAvailable = (options.appAvailable ?? macAppBridgeAvailable)();
|
|
@@ -382,13 +443,15 @@ var reapplyAllAgents = (apiKey, options = {}) => {
|
|
|
382
443
|
for (const runner of runners) {
|
|
383
444
|
try {
|
|
384
445
|
if (reapplyHolder(runner.id, appAvailable) === "app") {
|
|
385
|
-
done.push({ id: runner.id, label: runner.label, heldBy: "app", result: KEPT_FOR_APP });
|
|
446
|
+
done.push({ id: runner.id, label: runner.label, heldBy: "app", result: KEPT_FOR_APP, instructions: null });
|
|
386
447
|
continue;
|
|
387
448
|
}
|
|
388
449
|
const result = runner.run();
|
|
389
|
-
if (result.configured)
|
|
450
|
+
if (result.configured) {
|
|
451
|
+
done.push({ id: runner.id, label: runner.label, heldBy: "cli", result, instructions: refreshAgentInstructions(runner.instructions) });
|
|
452
|
+
}
|
|
390
453
|
} catch {
|
|
391
|
-
done.push({ id: runner.id, label: runner.label, heldBy: "cli", result: FAILED_REAPPLY });
|
|
454
|
+
done.push({ id: runner.id, label: runner.label, heldBy: "cli", result: FAILED_REAPPLY, instructions: null });
|
|
392
455
|
}
|
|
393
456
|
}
|
|
394
457
|
return done;
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk-KZERVKTD.js";
|
|
4
4
|
import {
|
|
5
5
|
renderCommandHelp
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-MC4VY5LK.js";
|
|
7
7
|
import {
|
|
8
8
|
getPackageVersion
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-QTOLNRET.js";
|
|
10
10
|
|
|
11
11
|
// src/cli/usage.ts
|
|
12
12
|
var exitOnHelpFlag = (command) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
pusharyDir
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-OML4YFBN.js";
|
|
4
4
|
import {
|
|
5
5
|
writeFileAtomic
|
|
6
6
|
} from "./chunk-AQFEP65J.js";
|
|
@@ -43,5 +43,6 @@ var getMachineId = (options = {}) => getOrCreateMachineId(options);
|
|
|
43
43
|
|
|
44
44
|
export {
|
|
45
45
|
readExistingMachineId,
|
|
46
|
+
getOrCreateMachineId,
|
|
46
47
|
getMachineId
|
|
47
48
|
};
|
|
@@ -2,35 +2,37 @@ import {
|
|
|
2
2
|
IDLE_PROMPT_NOTIFICATION,
|
|
3
3
|
NOTIFICATION_PUSH_TYPES,
|
|
4
4
|
POSTTOOLUSE_MIRROR_ONLY_TOOLS
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-3RPN7AAT.js";
|
|
6
6
|
import {
|
|
7
|
-
|
|
8
|
-
} from "./chunk-
|
|
7
|
+
repoKeyFor
|
|
8
|
+
} from "./chunk-JBT3ZSJS.js";
|
|
9
9
|
import {
|
|
10
10
|
cancelQuestion,
|
|
11
11
|
clientErrorKindOf,
|
|
12
12
|
isPolicyConfig,
|
|
13
|
-
repoKeyFor,
|
|
14
13
|
reportClientError,
|
|
15
14
|
sendNotification,
|
|
16
15
|
waitForAnswer
|
|
17
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-ZMPR436Z.js";
|
|
18
17
|
import {
|
|
19
18
|
withRetry
|
|
20
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-P2546BBI.js";
|
|
21
20
|
import {
|
|
22
21
|
getMachineId
|
|
23
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-T6RIKJUO.js";
|
|
23
|
+
import {
|
|
24
|
+
reportedInstallSource
|
|
25
|
+
} from "./chunk-4QQEUJL4.js";
|
|
24
26
|
import {
|
|
25
27
|
canonicalJson
|
|
26
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-OML4YFBN.js";
|
|
27
29
|
import {
|
|
28
30
|
writeFileAtomic
|
|
29
31
|
} from "./chunk-AQFEP65J.js";
|
|
30
32
|
import {
|
|
31
33
|
getApiKey,
|
|
32
34
|
getBaseUrl
|
|
33
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-CQ5JGRML.js";
|
|
34
36
|
import {
|
|
35
37
|
ACTION_BODY_MAX,
|
|
36
38
|
AGENTS,
|
|
@@ -64,7 +66,7 @@ import {
|
|
|
64
66
|
toToolLookup,
|
|
65
67
|
truncateLine,
|
|
66
68
|
unansweredRefusalReason
|
|
67
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-LF3TLC7B.js";
|
|
68
70
|
|
|
69
71
|
// ../hook-mapping/src/describe.ts
|
|
70
72
|
import { isAbsolute, relative, resolve } from "path";
|
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
decodePublicKey,
|
|
4
4
|
generateSessionKey,
|
|
5
5
|
wrapSessionKey
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-5463UUO2.js";
|
|
7
7
|
import {
|
|
8
8
|
fetchTranscriptRecipients,
|
|
9
9
|
uploadTranscriptRecords
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-GCN73COS.js";
|
|
11
11
|
|
|
12
12
|
// src/live-session.ts
|
|
13
13
|
var MAX_TRANSCRIPT_QUEUE = 100;
|
|
@@ -6,38 +6,38 @@ import {
|
|
|
6
6
|
} from "./chunk-DWQYCOPI.js";
|
|
7
7
|
import {
|
|
8
8
|
ensureDaemonRunning
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-BL3WAGIK.js";
|
|
10
10
|
import {
|
|
11
11
|
hookOwnerOf
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import {
|
|
14
|
-
transcriptEnvironmentPreference,
|
|
15
|
-
transcriptsEnabled
|
|
16
|
-
} from "./chunk-JGNYCRB2.js";
|
|
17
|
-
import {
|
|
18
|
-
readTranscriptPreference
|
|
19
|
-
} from "./chunk-XH3F66VD.js";
|
|
12
|
+
} from "./chunk-Q7OXI6VS.js";
|
|
20
13
|
import {
|
|
21
14
|
buildTranscriptRecords,
|
|
22
15
|
decodePublicKey,
|
|
23
16
|
generateSessionKey,
|
|
24
17
|
wrapSessionKey
|
|
25
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-5463UUO2.js";
|
|
26
19
|
import {
|
|
27
20
|
fetchTranscriptRecipients,
|
|
28
21
|
uploadTranscriptRecords
|
|
29
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-GCN73COS.js";
|
|
23
|
+
import {
|
|
24
|
+
transcriptEnvironmentPreference,
|
|
25
|
+
transcriptsEnabled
|
|
26
|
+
} from "./chunk-FV34HT35.js";
|
|
27
|
+
import {
|
|
28
|
+
readTranscriptPreference
|
|
29
|
+
} from "./chunk-VYBH6D4X.js";
|
|
30
30
|
import {
|
|
31
31
|
codexHome,
|
|
32
32
|
pusharyDir
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-OML4YFBN.js";
|
|
34
34
|
import {
|
|
35
35
|
writeJsonAtomic
|
|
36
36
|
} from "./chunk-AQFEP65J.js";
|
|
37
37
|
import {
|
|
38
38
|
getApiKey,
|
|
39
39
|
getBaseUrl
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-CQ5JGRML.js";
|
|
41
41
|
|
|
42
42
|
// src/transcript-registration.ts
|
|
43
43
|
import { createHash } from "crypto";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveInstallSourceFor
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-4QQEUJL4.js";
|
|
4
4
|
import {
|
|
5
5
|
backupFile,
|
|
6
6
|
readJsonSafe,
|
|
@@ -9,11 +9,11 @@ import {
|
|
|
9
9
|
} from "./chunk-AQFEP65J.js";
|
|
10
10
|
import {
|
|
11
11
|
configFilePath
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-CQ5JGRML.js";
|
|
13
13
|
import {
|
|
14
14
|
API_KEY_PREFIX_PATTERN,
|
|
15
15
|
isRecord
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-LF3TLC7B.js";
|
|
17
17
|
|
|
18
18
|
// src/shell-alias.ts
|
|
19
19
|
import { homedir } from "os";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// src/process-group.ts
|
|
2
|
+
var GROUP_HAS_NOTHING_LEFT_TO_SIGNAL = /* @__PURE__ */ new Set(["ESRCH", "EPERM"]);
|
|
3
|
+
var processGroupHasNothingLeftToSignal = (error) => error !== null && typeof error === "object" && "code" in error && typeof error.code === "string" && GROUP_HAS_NOTHING_LEFT_TO_SIGNAL.has(error.code);
|
|
4
|
+
|
|
5
|
+
export {
|
|
6
|
+
processGroupHasNothingLeftToSignal
|
|
7
|
+
};
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
+
import {
|
|
2
|
+
detectProviderLiveCapabilities,
|
|
3
|
+
expectedLaunchCapabilities,
|
|
4
|
+
hasSpawnProvider,
|
|
5
|
+
resolveControlPolicy
|
|
6
|
+
} from "./chunk-2LEH5IGX.js";
|
|
1
7
|
import {
|
|
2
8
|
daemonHasRemoteProof,
|
|
3
9
|
daemonServiceManagerAvailable,
|
|
4
10
|
hasDaemonServiceDefinition,
|
|
5
11
|
readDaemonNeedsLogin,
|
|
6
12
|
readDaemonStatus
|
|
7
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-BL3WAGIK.js";
|
|
8
14
|
import {
|
|
9
15
|
readControlMode,
|
|
10
16
|
readKeySource
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import {
|
|
13
|
-
detectProviderLiveCapabilities,
|
|
14
|
-
expectedLaunchCapabilities,
|
|
15
|
-
hasSpawnProvider,
|
|
16
|
-
resolveControlPolicy
|
|
17
|
-
} from "./chunk-GBKSCDEK.js";
|
|
17
|
+
} from "./chunk-VYBH6D4X.js";
|
|
18
18
|
import {
|
|
19
19
|
getMachineId
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-T6RIKJUO.js";
|
|
21
21
|
import {
|
|
22
22
|
getBaseUrl
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-CQ5JGRML.js";
|
|
24
24
|
import {
|
|
25
25
|
getPackageVersion
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-QTOLNRET.js";
|
|
27
27
|
|
|
28
28
|
// src/machines.ts
|
|
29
29
|
import { hostname } from "os";
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
} from "./chunk-AQFEP65J.js";
|
|
5
5
|
import {
|
|
6
6
|
configFilePath
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-CQ5JGRML.js";
|
|
8
8
|
import {
|
|
9
9
|
readSetupOutcomeProperties
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-LF3TLC7B.js";
|
|
11
11
|
|
|
12
12
|
// src/hooks-spec.ts
|
|
13
13
|
var CURSOR_GATE_SCRIPT = "pushary-gate.mjs";
|