@pushary/agent-hooks 1.5.1 → 1.6.1
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 +17 -0
- package/dist/bin/pushary-bell-hook.js +18 -18
- package/dist/bin/pushary-bell.js +6 -6
- package/dist/bin/pushary-claude.js +19 -19
- package/dist/bin/pushary-clean.js +20 -20
- package/dist/bin/pushary-codex-bridge.js +95 -20
- package/dist/bin/pushary-codex-hook.js +24 -24
- package/dist/bin/pushary-codex.js +7 -7
- package/dist/bin/pushary-connect.js +6 -6
- package/dist/bin/pushary-cowork.js +3 -3
- package/dist/bin/pushary-daemon.js +23 -23
- package/dist/bin/pushary-disconnect.js +11 -11
- package/dist/bin/pushary-doctor.js +23 -23
- package/dist/bin/pushary-elicitation-hook.js +18 -18
- package/dist/bin/pushary-gemini-bridge.js +9 -9
- package/dist/bin/pushary-gemini-hook.js +21 -21
- package/dist/bin/pushary-hook.js +24 -24
- package/dist/bin/pushary-login.js +7 -7
- package/dist/bin/pushary-logout.js +4 -4
- package/dist/bin/pushary-mode.js +3 -3
- package/dist/bin/pushary-notification-hook.js +21 -21
- package/dist/bin/pushary-opencode-hook.js +20 -20
- package/dist/bin/pushary-permission-denied-hook.js +25 -25
- package/dist/bin/pushary-permission-hook.js +24 -24
- package/dist/bin/pushary-post-hook.js +21 -21
- package/dist/bin/pushary-prompt-hook.js +21 -21
- package/dist/bin/pushary-session-end-hook.js +21 -21
- package/dist/bin/pushary-session-start-hook.js +25 -25
- package/dist/bin/pushary-setup.js +29 -30
- package/dist/bin/pushary-stats.js +2 -2
- package/dist/bin/pushary-status.js +10 -10
- package/dist/bin/pushary-stop-hook.js +21 -21
- package/dist/bin/pushary-stopfailure-hook.js +21 -21
- package/dist/bin/pushary-transcript-register.js +16 -16
- package/dist/bin/pushary-transcripts.js +4 -4
- package/dist/bin/pushary-upgrade.js +44 -26
- package/dist/bin/pushary-wait.js +3 -3
- package/dist/{chunk-X7FESZTD.js → chunk-2PHHXWA4.js} +3 -3
- package/dist/{chunk-M2LMXPJZ.js → chunk-3ROHFC7Q.js} +1 -1
- package/dist/{chunk-2AUIEZYS.js → chunk-3TKMWW34.js} +3 -3
- package/dist/{chunk-6EEANS74.js → chunk-45BA4RL6.js} +8 -3
- package/dist/{chunk-TUXFIVOH.js → chunk-5NDOV3UU.js} +1 -1
- package/dist/{chunk-HUAOMX4U.js → chunk-5TRIYAHM.js} +1 -1
- package/dist/{chunk-HVBF35GT.js → chunk-7H4HD2WR.js} +1 -1
- package/dist/{chunk-43ZDACBO.js → chunk-7WRJFRNF.js} +1 -1
- package/dist/{chunk-YAWXKL2X.js → chunk-7XGW7IKI.js} +1 -1
- package/dist/{chunk-KHXVTWYS.js → chunk-B75OQ2E7.js} +3 -3
- package/dist/{chunk-5UQ5ATIE.js → chunk-CATEMFAP.js} +1 -1
- package/dist/{chunk-JKBDGZFL.js → chunk-CNJWNFBL.js} +22 -12
- package/dist/{chunk-XWEONSLV.js → chunk-DACRA27R.js} +1 -1
- package/dist/{chunk-5ZZG76S2.js → chunk-GE64YOTX.js} +2 -2
- package/dist/{chunk-5HYNICS7.js → chunk-GOQC7R3F.js} +1 -1
- package/dist/{chunk-HU5LSYL2.js → chunk-IEXXFXSP.js} +1 -1
- package/dist/{chunk-WNJSGZY7.js → chunk-J7X5YVTP.js} +4 -4
- package/dist/{chunk-KJRALILH.js → chunk-K5BPU3RG.js} +2 -2
- package/dist/{chunk-6IU45EHE.js → chunk-L2FPZQQM.js} +1 -1
- package/dist/{chunk-TZGCUNOX.js → chunk-LNMHLXNR.js} +6 -6
- package/dist/{chunk-PYCQXCI5.js → chunk-LVHGSD5E.js} +2 -0
- package/dist/{chunk-TFKBFQCE.js → chunk-MK7ZJ2JN.js} +1 -1
- package/dist/{chunk-UYDTFCHW.js → chunk-MR2GHF3F.js} +1 -1
- package/dist/{chunk-43LJSM4F.js → chunk-MZCYOUBR.js} +1 -1
- package/dist/{chunk-T4QY64OR.js → chunk-NTTMJFJU.js} +383 -13
- package/dist/{chunk-Z4VGIBJ7.js → chunk-NYFBIXA7.js} +3 -3
- package/dist/{chunk-MU3WU2FO.js → chunk-O6MHM25J.js} +1 -1
- package/dist/{chunk-USQDVBEV.js → chunk-OLD4YGZR.js} +1 -1
- package/dist/{chunk-DTQNDR7C.js → chunk-PWQHK3F7.js} +1 -1
- package/dist/{chunk-D573TLP6.js → chunk-ROCRCXTP.js} +8 -7
- package/dist/{chunk-6QFEQIPM.js → chunk-TPD6LCQI.js} +2 -2
- package/dist/{chunk-PJ27EHCD.js → chunk-UJ4O22GU.js} +67 -13
- package/dist/{chunk-4ERLRNOK.js → chunk-UMVM4HVV.js} +3 -3
- package/dist/{chunk-K3QVDAZW.js → chunk-VT5TVFM3.js} +1 -1
- package/dist/{chunk-TIWURSLS.js → chunk-VT63XWPR.js} +1 -1
- package/dist/{chunk-3ZSGKLSO.js → chunk-W5JUN4TF.js} +2 -2
- package/dist/{chunk-2QT3GCU4.js → chunk-WBWF7WU7.js} +1 -1
- package/dist/{chunk-WOLPADR6.js → chunk-WHOD4YGB.js} +1 -1
- package/dist/{chunk-R5KY3PBN.js → chunk-X4G4MQEV.js} +5 -5
- package/dist/{chunk-IV3RHICU.js → chunk-XTXCQ4QE.js} +4 -4
- package/dist/{chunk-MDJJW3LP.js → chunk-ZR4NP264.js} +3 -3
- package/dist/{reapply-5CZSTJZI.js → reapply-GGHT2YJX.js} +9 -9
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +13 -13
- package/package.json +1 -1
|
@@ -5,18 +5,18 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
ensureCodexTrustAfterReapply,
|
|
7
7
|
reapplyAllAgents
|
|
8
|
-
} from "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
8
|
+
} from "../chunk-CNJWNFBL.js";
|
|
9
|
+
import "../chunk-5TRIYAHM.js";
|
|
10
|
+
import "../chunk-45BA4RL6.js";
|
|
11
11
|
import {
|
|
12
12
|
waitForMachineReadiness
|
|
13
|
-
} from "../chunk-
|
|
14
|
-
import "../chunk-
|
|
13
|
+
} from "../chunk-XTXCQ4QE.js";
|
|
14
|
+
import "../chunk-UMVM4HVV.js";
|
|
15
15
|
import {
|
|
16
16
|
detectProviderLiveCapabilities,
|
|
17
17
|
hasSpawnProvider,
|
|
18
18
|
resolveControlPolicy
|
|
19
|
-
} from "../chunk-
|
|
19
|
+
} from "../chunk-GE64YOTX.js";
|
|
20
20
|
import {
|
|
21
21
|
AUTO_UPDATE_DISABLE_ENV,
|
|
22
22
|
describeAutoUpdateCheck,
|
|
@@ -27,8 +27,8 @@ import {
|
|
|
27
27
|
readAutoUpdateState,
|
|
28
28
|
updateAutoUpdateState,
|
|
29
29
|
upgradeEntryFor
|
|
30
|
-
} from "../chunk-
|
|
31
|
-
import "../chunk-
|
|
30
|
+
} from "../chunk-O6MHM25J.js";
|
|
31
|
+
import "../chunk-NYFBIXA7.js";
|
|
32
32
|
import {
|
|
33
33
|
daemonHasRemoteProof,
|
|
34
34
|
daemonServiceManagerAvailable,
|
|
@@ -39,13 +39,13 @@ import {
|
|
|
39
39
|
replaceDaemonService,
|
|
40
40
|
stopDaemonService,
|
|
41
41
|
waitForDaemonRemoteProof
|
|
42
|
-
} from "../chunk-
|
|
43
|
-
import "../chunk-
|
|
42
|
+
} from "../chunk-2PHHXWA4.js";
|
|
43
|
+
import "../chunk-3TKMWW34.js";
|
|
44
44
|
import {
|
|
45
45
|
needsShell
|
|
46
46
|
} from "../chunk-XHKBHWLX.js";
|
|
47
|
-
import "../chunk-
|
|
48
|
-
import "../chunk-
|
|
47
|
+
import "../chunk-MR2GHF3F.js";
|
|
48
|
+
import "../chunk-WHOD4YGB.js";
|
|
49
49
|
import {
|
|
50
50
|
LATEST_TAG,
|
|
51
51
|
autoUpdateLock,
|
|
@@ -61,22 +61,22 @@ import {
|
|
|
61
61
|
npmErrorMessage,
|
|
62
62
|
resolveGlobalBinary,
|
|
63
63
|
vscodePluginDir
|
|
64
|
-
} from "../chunk-
|
|
64
|
+
} from "../chunk-L2FPZQQM.js";
|
|
65
65
|
import {
|
|
66
66
|
exitOnHelpFlag
|
|
67
67
|
} from "../chunk-P4BNYJ5Q.js";
|
|
68
68
|
import {
|
|
69
69
|
readControlMode
|
|
70
|
-
} from "../chunk-
|
|
70
|
+
} from "../chunk-OLD4YGZR.js";
|
|
71
71
|
import {
|
|
72
72
|
EXIT
|
|
73
73
|
} from "../chunk-KZERVKTD.js";
|
|
74
|
-
import "../chunk-
|
|
74
|
+
import "../chunk-IEXXFXSP.js";
|
|
75
75
|
import "../chunk-T7E75EKA.js";
|
|
76
76
|
import {
|
|
77
77
|
getApiKey
|
|
78
78
|
} from "../chunk-OSJEMXSR.js";
|
|
79
|
-
import "../chunk-
|
|
79
|
+
import "../chunk-NTTMJFJU.js";
|
|
80
80
|
import {
|
|
81
81
|
NPX_LATEST_COMMAND
|
|
82
82
|
} from "../chunk-EA3IELHP.js";
|
|
@@ -189,14 +189,16 @@ var finishInstalledUpgrade = (context, from, to) => {
|
|
|
189
189
|
return pending;
|
|
190
190
|
}
|
|
191
191
|
};
|
|
192
|
+
var isInstallableRelease = (latest, installed) => latest !== void 0 && isNewerVersion(latest, installed) && isSameMajorVersion(latest, installed);
|
|
192
193
|
var checkAndInstall = async (context) => {
|
|
193
194
|
const installed = packageVersionAt(context.packageRoot);
|
|
194
195
|
if (installed === void 0 || !isReleaseVersion(installed)) {
|
|
195
196
|
return { result: "failed", from: installed, detail: UNREADABLE_INSTALLED_VERSION };
|
|
196
197
|
}
|
|
197
198
|
const previous = readAutoUpdateState(context.statePath);
|
|
198
|
-
|
|
199
|
+
const pendingFinish = hasPendingUpgradeFinish(previous, installed);
|
|
199
200
|
const latest = await fetchLatestPublishedVersion({ fetchImpl: context.fetchImpl });
|
|
201
|
+
if (pendingFinish && !isInstallableRelease(latest, installed)) return finishInstalledUpgrade(context, previous.from, installed);
|
|
200
202
|
if (latest === void 0) return { result: "failed", from: installed, detail: UNREACHABLE_REGISTRY };
|
|
201
203
|
if (!isNewerVersion(latest, installed)) return { result: "current", from: installed };
|
|
202
204
|
if (!isSameMajorVersion(latest, installed)) {
|
|
@@ -206,6 +208,7 @@ var checkAndInstall = async (context) => {
|
|
|
206
208
|
try {
|
|
207
209
|
installAgentHooksGlobally({ version: latest, prefix: context.prefix, timeoutMs: INSTALL_TIMEOUT_MS }, context.runNpm);
|
|
208
210
|
} catch (error) {
|
|
211
|
+
if (pendingFinish) return finishInstalledUpgrade(context, previous.from, installed);
|
|
209
212
|
return { result: "failed", from: installed, to: latest, detail: npmErrorMessage(error) };
|
|
210
213
|
}
|
|
211
214
|
return finishInstalledUpgrade(context, installed, latest);
|
|
@@ -302,6 +305,7 @@ var finishUpgrade = async () => {
|
|
|
302
305
|
const inspectedAgents = reapplyAllAgents(apiKey);
|
|
303
306
|
const codexTrust = await ensureCodexTrustAfterReapply(inspectedAgents);
|
|
304
307
|
const refreshed = inspectedAgents.filter((agent) => agent.result.reapplied);
|
|
308
|
+
const failedRefreshes = inspectedAgents.filter((agent) => agent.result.failed);
|
|
305
309
|
const configuredControlProviders = inspectedAgents.filter((agent) => agent.result.configured && (agent.id === "claude" || agent.id === "codex" || agent.id === "gemini")).map((agent) => agent.id);
|
|
306
310
|
const controlMode = readControlMode();
|
|
307
311
|
const daemonStatus = readDaemonStatus();
|
|
@@ -346,7 +350,7 @@ var finishUpgrade = async () => {
|
|
|
346
350
|
console.log();
|
|
347
351
|
console.log("No key was readable here, so MCP entries kept the key they already had.");
|
|
348
352
|
}
|
|
349
|
-
} else {
|
|
353
|
+
} else if (failedRefreshes.length === 0) {
|
|
350
354
|
console.log("No agent config on this machine needed refreshing.");
|
|
351
355
|
}
|
|
352
356
|
if (codexTrust) {
|
|
@@ -359,6 +363,11 @@ var finishUpgrade = async () => {
|
|
|
359
363
|
process.exitCode = 1;
|
|
360
364
|
return;
|
|
361
365
|
}
|
|
366
|
+
if (failedRefreshes.length > 0) {
|
|
367
|
+
console.error(`Upgrade installed, but refreshing agent configuration failed for: ${failedRefreshes.map((agent) => agent.label).join(", ")}. Check the config files and run pushary upgrade again.`);
|
|
368
|
+
process.exitCode = 1;
|
|
369
|
+
return;
|
|
370
|
+
}
|
|
362
371
|
console.log(controlPolicy === "disabled" ? "Done. Your hooks use the new global install; phone-start remains disabled." : controlPolicy === "unsupported" || controlPolicy === "preserve-absent" ? "Done. Your hooks use the new global install; no background service was added." : "Done. Your hooks and background service use the new global install.");
|
|
363
372
|
console.log("Verify with: pushary doctor");
|
|
364
373
|
};
|
|
@@ -385,16 +394,24 @@ var runAutomaticUpdate = async () => {
|
|
|
385
394
|
console.log(`Automatic update: ${describeAutoUpdateCheck(outcome.state)}`);
|
|
386
395
|
if (outcome.state.lastResult === "failed" || outcome.state.lastResult === "finish_pending") process.exitCode = 1;
|
|
387
396
|
};
|
|
397
|
+
var FINISH_FAILED_MESSAGE = "Upgrade installed, but refreshing the agent configs did not finish. Fix the problem printed above, then run pushary upgrade again.";
|
|
388
398
|
var finishGlobalUpgrade = () => {
|
|
389
399
|
const upgradedBinary = resolveGlobalBinary("pushary-upgrade");
|
|
390
400
|
if (!upgradedBinary) {
|
|
391
401
|
console.error("Upgrade installed, but the new pushary-upgrade binary could not be found on PATH.");
|
|
392
402
|
process.exit(1);
|
|
393
403
|
}
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
404
|
+
try {
|
|
405
|
+
execFileSync2(upgradedBinary, [FINISH_UPGRADE_FLAG], {
|
|
406
|
+
stdio: "inherit",
|
|
407
|
+
shell: needsShell(upgradedBinary)
|
|
408
|
+
});
|
|
409
|
+
return true;
|
|
410
|
+
} catch {
|
|
411
|
+
console.error(FINISH_FAILED_MESSAGE);
|
|
412
|
+
process.exitCode = 1;
|
|
413
|
+
return false;
|
|
414
|
+
}
|
|
398
415
|
};
|
|
399
416
|
var main = async () => {
|
|
400
417
|
if (process.argv.includes(FINISH_UPGRADE_FLAG)) {
|
|
@@ -433,12 +450,13 @@ var main = async () => {
|
|
|
433
450
|
console.log("Check the result with: pushary doctor");
|
|
434
451
|
return;
|
|
435
452
|
}
|
|
436
|
-
const
|
|
437
|
-
|
|
438
|
-
|
|
453
|
+
const pendingFinish = hasPendingUpgradeFinish(readAutoUpdateState(autoUpdateState()), installed);
|
|
454
|
+
const latest = await fetchLatestPublishedVersion();
|
|
455
|
+
const newerPublished = latest !== void 0 && isNewerVersion(latest, installed);
|
|
456
|
+
if (pendingFinish && !newerPublished) {
|
|
457
|
+
if (!finishGlobalUpgrade()) return;
|
|
439
458
|
updateAutoUpdateState(autoUpdateState(), { lastResult: "updated", detail: void 0, announced: false });
|
|
440
459
|
}
|
|
441
|
-
const latest = await fetchLatestPublishedVersion();
|
|
442
460
|
if (latest && !isNewerVersion(latest, installed)) {
|
|
443
461
|
console.log(`Already on the latest version (${installed}).`);
|
|
444
462
|
return;
|
package/dist/bin/pushary-wait.js
CHANGED
|
@@ -4,8 +4,8 @@ import {
|
|
|
4
4
|
} from "../chunk-CVWG2N3Y.js";
|
|
5
5
|
import {
|
|
6
6
|
exitOnFailedResponse
|
|
7
|
-
} from "../chunk-
|
|
8
|
-
import "../chunk-
|
|
7
|
+
} from "../chunk-DACRA27R.js";
|
|
8
|
+
import "../chunk-MZCYOUBR.js";
|
|
9
9
|
import {
|
|
10
10
|
createIo
|
|
11
11
|
} from "../chunk-5RUIFDTP.js";
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
getApiKey,
|
|
27
27
|
getBaseUrl
|
|
28
28
|
} from "../chunk-OSJEMXSR.js";
|
|
29
|
-
import "../chunk-
|
|
29
|
+
import "../chunk-NTTMJFJU.js";
|
|
30
30
|
import "../chunk-EA3IELHP.js";
|
|
31
31
|
import "../chunk-HWJW3CPO.js";
|
|
32
32
|
|
|
@@ -4,14 +4,14 @@ import {
|
|
|
4
4
|
} from "./chunk-XHKBHWLX.js";
|
|
5
5
|
import {
|
|
6
6
|
getMachineId
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-WHOD4YGB.js";
|
|
8
8
|
import {
|
|
9
9
|
pusharyDir,
|
|
10
10
|
resolveGlobalBinary
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-L2FPZQQM.js";
|
|
12
12
|
import {
|
|
13
13
|
readControlMode
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-OLD4YGZR.js";
|
|
15
15
|
import {
|
|
16
16
|
readJsonSafe,
|
|
17
17
|
writeFileAtomic,
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
NOTIFICATION_MATCHED_TYPES,
|
|
3
3
|
POSTTOOLUSE_MIRRORED_TOOLS
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-MR2GHF3F.js";
|
|
5
5
|
import {
|
|
6
6
|
isProtectedByScope,
|
|
7
7
|
registerHookEntry
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-L2FPZQQM.js";
|
|
9
9
|
import {
|
|
10
10
|
CLAUDE_PRETOOLUSE_MATCHER,
|
|
11
11
|
HOOK_BUDGETS,
|
|
12
12
|
HOOK_LOCATOR_BINARY
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-NTTMJFJU.js";
|
|
14
14
|
|
|
15
15
|
// src/gemini-config.ts
|
|
16
16
|
var GEMINI_HOOK_BINARY = "pushary-gemini-hook";
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
codexHooksJsonIn,
|
|
7
7
|
isPusharyCodexCommand,
|
|
8
8
|
resolvePathBinary
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-L2FPZQQM.js";
|
|
10
10
|
import {
|
|
11
11
|
getPackageVersion
|
|
12
12
|
} from "./chunk-HWJW3CPO.js";
|
|
@@ -37,7 +37,8 @@ var CODEX_INSTALLATION_ID_FILE = "installation_id";
|
|
|
37
37
|
var CODEX_NOT_ASKED = {
|
|
38
38
|
notInteractive: "Pushary only starts Codex when you run setup, upgrade or doctor yourself at a terminal",
|
|
39
39
|
noCodexOnPath: "there is no codex command on PATH",
|
|
40
|
-
neverOpened: "Codex has not been opened on this machine yet"
|
|
40
|
+
neverOpened: "Codex has not been opened on this machine yet",
|
|
41
|
+
insideAnApp: "the codex command resolves inside an app bundle, which Pushary does not run"
|
|
41
42
|
};
|
|
42
43
|
var UNRECOGNISED_LISTING = "Codex answered hooks/list in a shape Pushary does not recognise";
|
|
43
44
|
var isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
@@ -115,6 +116,9 @@ var mayAskCodex = (conditions) => {
|
|
|
115
116
|
if (!conditions.interactive) return { kind: "skipped", reason: CODEX_NOT_ASKED.notInteractive };
|
|
116
117
|
if (!conditions.codexOnPath) return { kind: "skipped", reason: CODEX_NOT_ASKED.noCodexOnPath };
|
|
117
118
|
if (!conditions.codexOpenedBefore) return { kind: "skipped", reason: CODEX_NOT_ASKED.neverOpened };
|
|
119
|
+
if (conditions.codexOnPath.split(/[\\/]/).some((part) => part.toLowerCase().endsWith(".app"))) {
|
|
120
|
+
return { kind: "skipped", reason: CODEX_NOT_ASKED.insideAnApp };
|
|
121
|
+
}
|
|
118
122
|
return { kind: "ask", binary: conditions.codexOnPath };
|
|
119
123
|
};
|
|
120
124
|
var canonicalPath = (path) => {
|
|
@@ -233,9 +237,10 @@ var runCodexAppServer = (launch, conversation) => {
|
|
|
233
237
|
};
|
|
234
238
|
var launchOf = (options) => {
|
|
235
239
|
const home = options.codexHome ?? codexHome();
|
|
240
|
+
const binary = options.codexOnPath === void 0 ? resolvePathBinary("codex") ?? null : options.codexOnPath;
|
|
236
241
|
const decision = mayAskCodex({
|
|
237
242
|
interactive: options.interactive ?? process.stdout.isTTY === true,
|
|
238
|
-
codexOnPath:
|
|
243
|
+
codexOnPath: binary ? canonicalPath(binary) : null,
|
|
239
244
|
codexOpenedBefore: existsSync(join(home, CODEX_INSTALLATION_ID_FILE))
|
|
240
245
|
});
|
|
241
246
|
if (decision.kind === "skipped") return decision;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
openCodeConfigDirFrom
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-5NDOV3UU.js";
|
|
4
4
|
import {
|
|
5
5
|
codexHomeFrom
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-L2FPZQQM.js";
|
|
7
7
|
import {
|
|
8
8
|
HOOK_COMPATIBLE_PROFILES
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-NTTMJFJU.js";
|
|
10
10
|
|
|
11
11
|
// src/vscode-config.ts
|
|
12
12
|
import { homedir } from "os";
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
detectClaudeVersion
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-5TRIYAHM.js";
|
|
4
4
|
import {
|
|
5
5
|
ensureCodexTrustsPusharyHooks
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-45BA4RL6.js";
|
|
7
7
|
import {
|
|
8
8
|
addClaudeMcpServer,
|
|
9
9
|
addPusharyHooks,
|
|
10
10
|
addPusharyToolPermissions
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-UMVM4HVV.js";
|
|
12
12
|
import {
|
|
13
13
|
claudeUnprovenHolds,
|
|
14
14
|
claudeWired,
|
|
15
15
|
codexUnprovenHolds,
|
|
16
16
|
codexWired,
|
|
17
17
|
geminiWired
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-NYFBIXA7.js";
|
|
19
19
|
import {
|
|
20
20
|
CLAUDE_HOOK_BINARY,
|
|
21
21
|
CLAUDE_HOOK_EVENTS,
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
needsReregistration,
|
|
28
28
|
registrationSignatures,
|
|
29
29
|
supportedClaudeEvents
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-3TKMWW34.js";
|
|
31
31
|
import {
|
|
32
32
|
CODEX_HOOK_BINARY,
|
|
33
33
|
addCodexHookTrust,
|
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
registrationHolderOf,
|
|
48
48
|
resolveGlobalBinary,
|
|
49
49
|
vscodePluginMcp
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-L2FPZQQM.js";
|
|
51
51
|
import {
|
|
52
52
|
readJsonSafe,
|
|
53
53
|
writeFileAtomic,
|
|
@@ -126,6 +126,7 @@ var reapplyClaudeSettings = (apiKey, paths = {}) => {
|
|
|
126
126
|
const claudeJsonWritable = claudeJson != null;
|
|
127
127
|
let hooks = false;
|
|
128
128
|
let mcp = false;
|
|
129
|
+
let failed = false;
|
|
129
130
|
try {
|
|
130
131
|
if (!settingsWritable) throw new Error("settings.json could not be parsed");
|
|
131
132
|
const s = settings;
|
|
@@ -135,6 +136,7 @@ var reapplyClaudeSettings = (apiKey, paths = {}) => {
|
|
|
135
136
|
writeJson(settingsPath, s);
|
|
136
137
|
hooks = true;
|
|
137
138
|
} catch {
|
|
139
|
+
failed = true;
|
|
138
140
|
}
|
|
139
141
|
if (apiKey) {
|
|
140
142
|
try {
|
|
@@ -144,9 +146,10 @@ var reapplyClaudeSettings = (apiKey, paths = {}) => {
|
|
|
144
146
|
writeJson(claudeJsonPath, cj);
|
|
145
147
|
mcp = true;
|
|
146
148
|
} catch {
|
|
149
|
+
failed = true;
|
|
147
150
|
}
|
|
148
151
|
}
|
|
149
|
-
return { configured: true, reapplied: hooks || mcp, hooks, mcp };
|
|
152
|
+
return { configured: true, reapplied: hooks || mcp, hooks, mcp, failed };
|
|
150
153
|
};
|
|
151
154
|
var reapplyClaudeForVersion = (apiKey, paths = {}) => {
|
|
152
155
|
const idle = { verdict: "current", rewrote: false, missing: [] };
|
|
@@ -215,6 +218,7 @@ var reapplyCodexSettings = (apiKey, paths = {}) => {
|
|
|
215
218
|
const command = guardBinary((paths.resolveBinary ?? resolveGlobalBinary)(CODEX_HOOK_BINARY) ?? CODEX_HOOK_BINARY);
|
|
216
219
|
let hooks = false;
|
|
217
220
|
let mcp = false;
|
|
221
|
+
let failed = hooksConfig === null || config === null;
|
|
218
222
|
const vacated = codexVacatedIndexes(hooksConfig ?? void 0);
|
|
219
223
|
if (hooksConfig != null) {
|
|
220
224
|
try {
|
|
@@ -222,6 +226,7 @@ var reapplyCodexSettings = (apiKey, paths = {}) => {
|
|
|
222
226
|
writeJson(hooksPath, hooksConfig);
|
|
223
227
|
hooks = true;
|
|
224
228
|
} catch {
|
|
229
|
+
failed = true;
|
|
225
230
|
}
|
|
226
231
|
}
|
|
227
232
|
if (config != null) {
|
|
@@ -232,15 +237,18 @@ var reapplyCodexSettings = (apiKey, paths = {}) => {
|
|
|
232
237
|
}
|
|
233
238
|
if (apiKey) {
|
|
234
239
|
addCodexMcpServer(config, apiKey);
|
|
235
|
-
mcp = true;
|
|
236
240
|
}
|
|
237
241
|
if (hooks || apiKey) {
|
|
238
242
|
writeFileAtomic(configPath, stringifyTOML(config), modeToPreserve(configPath), "utf-8");
|
|
243
|
+
mcp = Boolean(apiKey);
|
|
239
244
|
}
|
|
240
245
|
} catch {
|
|
246
|
+
failed = true;
|
|
247
|
+
hooks = false;
|
|
241
248
|
}
|
|
242
249
|
}
|
|
243
|
-
|
|
250
|
+
if (config === null) hooks = false;
|
|
251
|
+
return { configured: true, reapplied: hooks || mcp, hooks, mcp, failed };
|
|
244
252
|
};
|
|
245
253
|
var repairCodexHolds = (paths = {}) => {
|
|
246
254
|
const idle = { configured: false, reapplied: false, hooks: false, mcp: false };
|
|
@@ -265,13 +273,14 @@ var reapplyGeminiSettings = (apiKey, paths = {}) => {
|
|
|
265
273
|
let mcp = false;
|
|
266
274
|
try {
|
|
267
275
|
addGeminiHooks(settings, guardBinary(resolveGlobalBinary(GEMINI_HOOK_BINARY) ?? GEMINI_HOOK_BINARY));
|
|
268
|
-
hooks = true;
|
|
269
276
|
if (apiKey) {
|
|
270
277
|
addGeminiMcpServer(settings, apiKey);
|
|
271
|
-
mcp = true;
|
|
272
278
|
}
|
|
273
279
|
writeJson(settingsPath, settings);
|
|
280
|
+
hooks = true;
|
|
281
|
+
mcp = Boolean(apiKey);
|
|
274
282
|
} catch {
|
|
283
|
+
return { configured: true, reapplied: false, hooks: false, mcp: false, failed: true };
|
|
275
284
|
}
|
|
276
285
|
return { configured: true, reapplied: hooks || mcp, hooks, mcp };
|
|
277
286
|
};
|
|
@@ -286,7 +295,7 @@ var reapplyPluginMcp = (mcpPath, apiKey) => {
|
|
|
286
295
|
writeJson(mcpPath, mcpConfig);
|
|
287
296
|
return { configured: true, reapplied: true, hooks: false, mcp: true };
|
|
288
297
|
} catch {
|
|
289
|
-
return { configured: true, reapplied: false, hooks: false, mcp: false };
|
|
298
|
+
return { configured: true, reapplied: false, hooks: false, mcp: false, failed: true };
|
|
290
299
|
}
|
|
291
300
|
};
|
|
292
301
|
var reapplyCursorPlugin = (apiKey, paths = {}) => reapplyPluginMcp(
|
|
@@ -308,6 +317,7 @@ var reapplyAllAgents = (apiKey) => {
|
|
|
308
317
|
const result = runner.run();
|
|
309
318
|
if (result.configured) done.push({ id: runner.id, label: runner.label, result });
|
|
310
319
|
} catch {
|
|
320
|
+
done.push({ id: runner.id, label: runner.label, result: { configured: false, reapplied: false, hooks: false, mcp: false, failed: true } });
|
|
311
321
|
}
|
|
312
322
|
}
|
|
313
323
|
return done;
|
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
resolveBinary,
|
|
3
3
|
resolveGlobalPackageVersion,
|
|
4
4
|
resolvePackageVersionFromBinary
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-L2FPZQQM.js";
|
|
6
6
|
import {
|
|
7
7
|
MANAGED_PROVIDERS
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-NTTMJFJU.js";
|
|
9
9
|
|
|
10
10
|
// src/live-capabilities.ts
|
|
11
11
|
var CLAUDE_BRIDGE_CAPABILITY = "claude-bridge";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AGENT_CHOICES
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MK7ZJ2JN.js";
|
|
4
4
|
import {
|
|
5
5
|
isBridgeLocator
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-VT5TVFM3.js";
|
|
7
7
|
import {
|
|
8
8
|
pusharyHookExecutable
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-NYFBIXA7.js";
|
|
10
10
|
import {
|
|
11
11
|
BELL_HOOK_BINARY
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-CATEMFAP.js";
|
|
13
13
|
|
|
14
14
|
// src/setup/hook-ownership.ts
|
|
15
15
|
var commandsIn = (value) => {
|
|
@@ -15,11 +15,11 @@ import {
|
|
|
15
15
|
} from "./chunk-HETOKNIL.js";
|
|
16
16
|
import {
|
|
17
17
|
reportedInstallSource
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-IEXXFXSP.js";
|
|
19
19
|
import {
|
|
20
20
|
PAIR_TTL_SECONDS,
|
|
21
21
|
isAnswerSource
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-NTTMJFJU.js";
|
|
23
23
|
import {
|
|
24
24
|
NPX_LATEST_COMMAND
|
|
25
25
|
} from "./chunk-EA3IELHP.js";
|
|
@@ -6,16 +6,16 @@ import {
|
|
|
6
6
|
} from "./chunk-SGZJ5LYH.js";
|
|
7
7
|
import {
|
|
8
8
|
hookOwnerOf
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-J7X5YVTP.js";
|
|
10
10
|
import {
|
|
11
11
|
ensureDaemonRunning
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-2PHHXWA4.js";
|
|
13
13
|
import {
|
|
14
14
|
buildTranscriptRecords,
|
|
15
15
|
decodePublicKey,
|
|
16
16
|
generateSessionKey,
|
|
17
17
|
wrapSessionKey
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-VT63XWPR.js";
|
|
19
19
|
import {
|
|
20
20
|
fetchTranscriptRecipients,
|
|
21
21
|
uploadTranscriptRecords
|
|
@@ -23,14 +23,14 @@ import {
|
|
|
23
23
|
import {
|
|
24
24
|
transcriptEnvironmentPreference,
|
|
25
25
|
transcriptsEnabled
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-WBWF7WU7.js";
|
|
27
27
|
import {
|
|
28
28
|
codexHome,
|
|
29
29
|
pusharyDir
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-L2FPZQQM.js";
|
|
31
31
|
import {
|
|
32
32
|
readTranscriptPreference
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-OLD4YGZR.js";
|
|
34
34
|
import {
|
|
35
35
|
writeJsonAtomic
|
|
36
36
|
} from "./chunk-T7E75EKA.js";
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
COMPATIBLE_AGENT_TYPES,
|
|
9
9
|
isValidApiKey
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-NTTMJFJU.js";
|
|
11
11
|
|
|
12
12
|
// src/setup/options.ts
|
|
13
13
|
var AGENT_CHOICES = ["claude_code", "codex", "gemini_cli", "hermes", "cursor", "vscode", "opencode", ...COMPATIBLE_AGENT_TYPES, "custom"];
|