@pushary/agent-hooks 1.8.1 → 1.8.3
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 +13 -0
- package/dist/bin/pushary-bell-hook.js +12 -11
- package/dist/bin/pushary-bell.js +2 -2
- package/dist/bin/pushary-claude.js +16 -15
- package/dist/bin/pushary-clean.js +19 -18
- package/dist/bin/pushary-codex-bridge.js +14 -12
- package/dist/bin/pushary-codex-hook.js +19 -18
- package/dist/bin/pushary-codex.js +8 -8
- package/dist/bin/pushary-connect.js +7 -7
- package/dist/bin/pushary-daemon.js +92 -25
- package/dist/bin/pushary-disconnect.js +12 -11
- package/dist/bin/pushary-doctor.js +24 -21
- package/dist/bin/pushary-elicitation-hook.js +15 -14
- package/dist/bin/pushary-gemini-bridge.js +9 -6
- package/dist/bin/pushary-gemini-hook.js +17 -16
- package/dist/bin/pushary-hook.js +20 -19
- package/dist/bin/pushary-login.js +5 -5
- package/dist/bin/pushary-logout.js +1 -1
- package/dist/bin/pushary-mcp.js +6 -6
- package/dist/bin/pushary-mode.js +5 -5
- package/dist/bin/pushary-notification-hook.js +18 -17
- package/dist/bin/pushary-opencode-hook.js +16 -15
- package/dist/bin/pushary-permission-denied-hook.js +20 -19
- package/dist/bin/pushary-permission-hook.js +20 -19
- package/dist/bin/pushary-post-hook.js +18 -17
- package/dist/bin/pushary-prompt-hook.js +18 -17
- package/dist/bin/pushary-session-end-hook.js +18 -17
- package/dist/bin/pushary-session-start-hook.js +22 -21
- package/dist/bin/pushary-setup.js +37 -93
- package/dist/bin/pushary-status.js +11 -9
- package/dist/bin/pushary-stop-hook.js +18 -17
- package/dist/bin/pushary-stopfailure-hook.js +18 -17
- package/dist/bin/pushary-transcript-register.js +9 -8
- package/dist/bin/pushary-upgrade.js +219 -141
- package/dist/bin/pushary-wait.js +5 -5
- package/dist/bin/pushary.js +3 -3
- package/dist/{chunk-W2LJ4O3A.js → chunk-27A7L4DA.js} +1 -1
- package/dist/{chunk-I4HKMUZQ.js → chunk-34EQOFMH.js} +2 -2
- package/dist/{chunk-2SLCHCVN.js → chunk-4CW5EAOI.js} +1 -1
- package/dist/{chunk-F6NTWZZC.js → chunk-4DYHBXX4.js} +5 -5
- package/dist/{chunk-INSMZNS7.js → chunk-4SJIPHR3.js} +1 -1
- package/dist/chunk-6ICPEJY5.js +20 -0
- package/dist/{chunk-ZJYJAD52.js → chunk-6SS74UHS.js} +1 -1
- package/dist/{chunk-DVW2MYCM.js → chunk-6UDK5TY6.js} +1 -1
- package/dist/{chunk-MMVCI6DT.js → chunk-AKCE6ZRF.js} +3 -3
- package/dist/{chunk-HBWC3JVZ.js → chunk-APURTMSW.js} +2 -2
- package/dist/{chunk-QB6QYZ6B.js → chunk-CTNLP4A5.js} +4 -4
- package/dist/{chunk-GH6KGWMC.js → chunk-CXYKQAL2.js} +11 -9
- package/dist/{chunk-4A3UQERT.js → chunk-DMU5E6HJ.js} +1 -1
- package/dist/{chunk-FLQPM2GQ.js → chunk-E5JGQGLD.js} +2 -2
- package/dist/{chunk-JRQRNNGA.js → chunk-EJXEHNB5.js} +2 -2
- package/dist/{chunk-5DGNEUXK.js → chunk-FBTUF2PH.js} +1 -1
- package/dist/{chunk-EIGJYCOE.js → chunk-IEXWWAJY.js} +2 -2
- package/dist/{chunk-HQRCVEI2.js → chunk-MSMKCO4Y.js} +6 -6
- package/dist/{chunk-TKQ6LZQZ.js → chunk-OLYTGVCC.js} +5 -4
- package/dist/{chunk-ASWRMBOM.js → chunk-RIVNNBEK.js} +2 -1
- package/dist/{chunk-6TK4IY3A.js → chunk-SD6OLZJX.js} +3 -3
- package/dist/chunk-SOUJG6UY.js +198 -0
- package/dist/{chunk-KB2FTO4O.js → chunk-UXKXGRKG.js} +2 -2
- package/dist/{chunk-T55H6YEP.js → chunk-VF3X4MDB.js} +1 -1
- package/dist/{chunk-64H5IZZD.js → chunk-VI55VXDH.js} +1 -1
- package/dist/{chunk-NHCUXTEM.js → chunk-VUP5BMOD.js} +1 -1
- package/dist/{chunk-HOEB6AKG.js → chunk-XH7UNEHO.js} +1 -1
- package/dist/{chunk-LK2S5XIV.js → chunk-XNJ4MQF3.js} +2 -2
- package/dist/{chunk-HTEGMMT3.js → chunk-YLJ26RR2.js} +5 -18
- package/dist/{chunk-OCVVSRDA.js → chunk-YOYSXLUB.js} +2 -2
- package/dist/{chunk-GBNQXYN4.js → chunk-ZOKXZ3AS.js} +2 -2
- package/dist/{chunk-UPLV5AJF.js → chunk-ZR7LIQKO.js} +57 -5
- package/dist/{reapply-ICGTBHVE.js → reapply-DYOQAVUP.js} +8 -7
- package/dist/src/index.js +14 -13
- package/package.json +1 -1
- package/dist/chunk-VZMIHERK.js +0 -59
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
inspectConfiguredManagedProviders
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-W2LJ4O3A.js";
|
|
4
|
+
} from "../chunk-CXYKQAL2.js";
|
|
5
|
+
import "../chunk-27A7L4DA.js";
|
|
7
6
|
import {
|
|
8
7
|
HEARTBEAT_INTERVAL_MS,
|
|
9
8
|
sendHeartbeat
|
|
10
|
-
} from "../chunk-
|
|
11
|
-
import "../chunk-
|
|
9
|
+
} from "../chunk-OLYTGVCC.js";
|
|
10
|
+
import "../chunk-EJXEHNB5.js";
|
|
12
11
|
import {
|
|
12
|
+
codexBinaryIsBroken,
|
|
13
13
|
detectProviderLiveCapabilities,
|
|
14
14
|
hasSpawnProvider,
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
launchAdvertisement,
|
|
16
|
+
launchableProviders,
|
|
17
|
+
resolveControlPolicy,
|
|
18
|
+
trackProviderInventory
|
|
19
|
+
} from "../chunk-SOUJG6UY.js";
|
|
20
|
+
import "../chunk-RIVNNBEK.js";
|
|
17
21
|
import {
|
|
18
22
|
SESSION_REAP_SILENCE_MS,
|
|
19
23
|
describeIdleWindow,
|
|
@@ -21,15 +25,15 @@ import {
|
|
|
21
25
|
listProcessProofs,
|
|
22
26
|
ownsLiveProcess,
|
|
23
27
|
silentSpawnedProofs
|
|
24
|
-
} from "../chunk-
|
|
28
|
+
} from "../chunk-6SS74UHS.js";
|
|
25
29
|
import {
|
|
26
30
|
startRegisteredTranscripts
|
|
27
|
-
} from "../chunk-
|
|
31
|
+
} from "../chunk-SD6OLZJX.js";
|
|
28
32
|
import "../chunk-SGZJ5LYH.js";
|
|
29
|
-
import "../chunk-
|
|
33
|
+
import "../chunk-ZOKXZ3AS.js";
|
|
30
34
|
import "../chunk-DLEKCAQL.js";
|
|
31
35
|
import "../chunk-MYHG7PX2.js";
|
|
32
|
-
import "../chunk-
|
|
36
|
+
import "../chunk-YOYSXLUB.js";
|
|
33
37
|
import {
|
|
34
38
|
DAEMON_LEASE_RENEW_INTERVAL_MS,
|
|
35
39
|
acquireDaemonLease,
|
|
@@ -46,15 +50,16 @@ import {
|
|
|
46
50
|
requestDaemonHandoff,
|
|
47
51
|
stopDaemonRunning,
|
|
48
52
|
writeDaemonNeedsLogin
|
|
49
|
-
} from "../chunk-
|
|
50
|
-
import "../chunk-
|
|
51
|
-
import "../chunk-
|
|
53
|
+
} from "../chunk-IEXWWAJY.js";
|
|
54
|
+
import "../chunk-YLJ26RR2.js";
|
|
55
|
+
import "../chunk-XH7UNEHO.js";
|
|
52
56
|
import "../chunk-URNXU3FO.js";
|
|
53
57
|
import "../chunk-UMMCHS6P.js";
|
|
54
58
|
import "../chunk-72WOCX22.js";
|
|
55
59
|
import {
|
|
56
60
|
spawnClaude
|
|
57
61
|
} from "../chunk-XHKBHWLX.js";
|
|
62
|
+
import "../chunk-6ICPEJY5.js";
|
|
58
63
|
import "../chunk-VFFHQC7W.js";
|
|
59
64
|
import {
|
|
60
65
|
writeHuman
|
|
@@ -68,7 +73,7 @@ import {
|
|
|
68
73
|
} from "../chunk-TJMAXQ5Q.js";
|
|
69
74
|
import {
|
|
70
75
|
getMachineId
|
|
71
|
-
} from "../chunk-
|
|
76
|
+
} from "../chunk-DMU5E6HJ.js";
|
|
72
77
|
import "../chunk-7QLSKOSU.js";
|
|
73
78
|
import {
|
|
74
79
|
EXIT
|
|
@@ -76,7 +81,7 @@ import {
|
|
|
76
81
|
import "../chunk-5Y2DY6X4.js";
|
|
77
82
|
import {
|
|
78
83
|
resolveBinary
|
|
79
|
-
} from "../chunk-
|
|
84
|
+
} from "../chunk-ZR7LIQKO.js";
|
|
80
85
|
import "../chunk-T7E75EKA.js";
|
|
81
86
|
import {
|
|
82
87
|
getApiKey,
|
|
@@ -231,6 +236,37 @@ var providerLaunchError = (requestedAgent, binaries, configuredProviders) => {
|
|
|
231
236
|
if (binaries[agent]) return null;
|
|
232
237
|
return agent === "claude" ? "Claude Code is not installed on this machine" : `${agent === "codex" ? "Codex" : "Gemini"} CLI is not installed on this machine`;
|
|
233
238
|
};
|
|
239
|
+
var brokenCodexMessage = (binary) => `Codex at ${binary} cannot start: the program it launches is missing. Reinstall Codex on this machine, then try again.`;
|
|
240
|
+
var plural = (count, unit) => `${count} ${unit}${count === 1 ? "" : "s"}`;
|
|
241
|
+
var describeRunTime = (ms) => {
|
|
242
|
+
const seconds = Math.max(0, Math.floor(ms / 1e3));
|
|
243
|
+
if (seconds < 60) return `${seconds}s`;
|
|
244
|
+
const minutes = Math.floor(seconds / 60);
|
|
245
|
+
return minutes < 60 ? plural(minutes, "minute") : plural(Math.floor(minutes / 60), "hour");
|
|
246
|
+
};
|
|
247
|
+
var INTERRUPTED_EXIT_CODES = /* @__PURE__ */ new Set([130, 143]);
|
|
248
|
+
var exitedInterrupted = (code) => code !== null && INTERRUPTED_EXIT_CODES.has(code);
|
|
249
|
+
var describeSessionExit = (agent, exit) => {
|
|
250
|
+
const ranFor = describeRunTime(exit.ranForMs);
|
|
251
|
+
if (exit.stoppedByPushary) return `${agent} session was stopped from Pushary after ${ranFor}`;
|
|
252
|
+
if (exit.signal) return `${agent} session was stopped by ${exit.signal} after ${ranFor}`;
|
|
253
|
+
if (exitedInterrupted(exit.code)) return `${agent} session was interrupted (exit code ${exit.code}) after ${ranFor}`;
|
|
254
|
+
return exit.code === 0 ? `${agent} session finished after ${ranFor}` : `${agent} session exited with code ${exit.code} after ${ranFor}`;
|
|
255
|
+
};
|
|
256
|
+
var sessionExitFailed = (exit) => !exit.stoppedByPushary && exit.signal === null && exit.code !== 0 && !exitedInterrupted(exit.code);
|
|
257
|
+
var reportSessionExit = (child, report) => {
|
|
258
|
+
const launchedAt = report.now();
|
|
259
|
+
child.once("exit", (code, signal) => {
|
|
260
|
+
const exit = { code, signal, ranForMs: report.now() - launchedAt, stoppedByPushary: report.stoppedByPushary() };
|
|
261
|
+
const line = `spawn ${report.spawnId}: ${describeSessionExit(report.agent, exit)}`;
|
|
262
|
+
report.log(line);
|
|
263
|
+
if (sessionExitFailed(exit)) report.recordError(line);
|
|
264
|
+
});
|
|
265
|
+
};
|
|
266
|
+
var describeLaunchableProviders = (capabilities) => {
|
|
267
|
+
const providers = launchableProviders(capabilities);
|
|
268
|
+
return providers.length > 0 ? `the phone can start: ${providers.join(", ")}` : "the phone cannot start any agent on this machine";
|
|
269
|
+
};
|
|
234
270
|
var resolveSpawnDirectory = (requested, options = {}) => {
|
|
235
271
|
const fallbackDir = options.fallbackDir ?? process.cwd();
|
|
236
272
|
const value = requested?.trim();
|
|
@@ -323,7 +359,13 @@ var runSpawnDaemon = async () => {
|
|
|
323
359
|
const baseUrl = getBaseUrl();
|
|
324
360
|
const pusharyBin = resolveBinary("pushary") ?? "pushary";
|
|
325
361
|
const configuredProviders = inspectConfiguredManagedProviders();
|
|
326
|
-
|
|
362
|
+
let describedProviders;
|
|
363
|
+
const inventory = await trackProviderInventory(configuredProviders, (next) => {
|
|
364
|
+
const description = describeLaunchableProviders(next.capabilities);
|
|
365
|
+
if (description !== describedProviders) log(`agents changed: ${description}`);
|
|
366
|
+
describedProviders = description;
|
|
367
|
+
});
|
|
368
|
+
describedProviders = describeLaunchableProviders(inventory.current.capabilities);
|
|
327
369
|
const siblingEntry = process.argv[1] ? join(dirname(process.argv[1]), "pushary.js") : "";
|
|
328
370
|
const codexBridgeEntry = process.argv[1] ? join(dirname(process.argv[1]), "pushary-codex-bridge.js") : "pushary-codex-bridge";
|
|
329
371
|
const geminiBridgeEntry = process.argv[1] ? join(dirname(process.argv[1]), "pushary-gemini-bridge.js") : "pushary-gemini-bridge";
|
|
@@ -333,21 +375,25 @@ var runSpawnDaemon = async () => {
|
|
|
333
375
|
try {
|
|
334
376
|
handoff = await requestDaemonHandoff(existing);
|
|
335
377
|
} catch (err) {
|
|
378
|
+
inventory.stop();
|
|
336
379
|
stderr(`[pushary] daemon could not request a handoff: ${err instanceof Error ? err.message : String(err)}
|
|
337
380
|
`);
|
|
338
381
|
return 1;
|
|
339
382
|
}
|
|
340
383
|
if (existing.pid !== null && handoff.pid === existing.pid && handoff.processAlive === true) {
|
|
384
|
+
inventory.stop();
|
|
341
385
|
stderr("[pushary] daemon could not replace the existing process; run `pushary doctor` for details\n");
|
|
342
386
|
return 1;
|
|
343
387
|
}
|
|
344
388
|
const lifecycle = acquireDaemonLease({ machineId });
|
|
345
389
|
if (lifecycle.kind === "already-running") {
|
|
390
|
+
inventory.stop();
|
|
346
391
|
writeHuman(`[pushary] daemon already online as pid ${lifecycle.status.pid ?? "unknown"}
|
|
347
392
|
`);
|
|
348
393
|
return 0;
|
|
349
394
|
}
|
|
350
395
|
if (lifecycle.kind === "unavailable") {
|
|
396
|
+
inventory.stop();
|
|
351
397
|
stderr(`[pushary] daemon could not acquire its local lease: ${lifecycle.detail}
|
|
352
398
|
`);
|
|
353
399
|
return 1;
|
|
@@ -362,6 +408,7 @@ var runSpawnDaemon = async () => {
|
|
|
362
408
|
let lastControlProbeAt = 0;
|
|
363
409
|
const spawnTimestamps = [];
|
|
364
410
|
const launchedProcesses = /* @__PURE__ */ new Map();
|
|
411
|
+
const stoppedByPushary = /* @__PURE__ */ new Set();
|
|
365
412
|
const completedStops = /* @__PURE__ */ new Map();
|
|
366
413
|
let timer;
|
|
367
414
|
let inflight;
|
|
@@ -381,13 +428,16 @@ var runSpawnDaemon = async () => {
|
|
|
381
428
|
if (!directory.ok) return Promise.reject(new Error(directory.message));
|
|
382
429
|
const agent = normalizeLaunchAgent(req.agent);
|
|
383
430
|
if (!agent) return Promise.reject(new Error(`Unsupported agent provider: ${req.agent}`));
|
|
384
|
-
const providerBin =
|
|
431
|
+
const providerBin = inventory.current.binaries[agent];
|
|
385
432
|
const unavailable = providerLaunchError(req.agent, {
|
|
386
433
|
claude: agent === "claude" ? providerBin ?? null : null,
|
|
387
434
|
codex: agent === "codex" ? providerBin ?? null : null,
|
|
388
435
|
gemini: agent === "gemini" ? providerBin ?? null : null
|
|
389
436
|
}, configuredProviders);
|
|
390
437
|
if (unavailable) return Promise.reject(new Error(unavailable));
|
|
438
|
+
if (agent === "codex" && providerBin && codexBinaryIsBroken(providerBin)) {
|
|
439
|
+
return Promise.reject(new Error(brokenCodexMessage(providerBin)));
|
|
440
|
+
}
|
|
391
441
|
spawnTimestamps.push(Date.now());
|
|
392
442
|
const cwd = directory.cwd;
|
|
393
443
|
const env = {
|
|
@@ -431,9 +481,20 @@ var runSpawnDaemon = async () => {
|
|
|
431
481
|
});
|
|
432
482
|
child.once("spawn", () => {
|
|
433
483
|
started = true;
|
|
484
|
+
reportSessionExit(child, {
|
|
485
|
+
spawnId: req.id,
|
|
486
|
+
agent: plan.agent,
|
|
487
|
+
now: Date.now,
|
|
488
|
+
stoppedByPushary: () => typeof child.pid === "number" && stoppedByPushary.has(child.pid),
|
|
489
|
+
log,
|
|
490
|
+
recordError: (line) => daemonLease.recordError(line)
|
|
491
|
+
});
|
|
434
492
|
if (typeof child.pid === "number") {
|
|
435
493
|
launchedProcesses.set(child.pid, req.id);
|
|
436
|
-
child.once("close", () =>
|
|
494
|
+
child.once("close", () => {
|
|
495
|
+
launchedProcesses.delete(child.pid);
|
|
496
|
+
stoppedByPushary.delete(child.pid);
|
|
497
|
+
});
|
|
437
498
|
}
|
|
438
499
|
child.unref();
|
|
439
500
|
log(`spawn ${req.id}: launched a phone-requested ${plan.agent} session in ${basename(cwd)} (pid ${child.pid ?? "unknown"})`);
|
|
@@ -448,7 +509,10 @@ var runSpawnDaemon = async () => {
|
|
|
448
509
|
execFileSync("taskkill", windowsTaskkillArgs(pid), { stdio: "ignore" });
|
|
449
510
|
} : process.kill.bind(process);
|
|
450
511
|
const stopDeps = {
|
|
451
|
-
kill,
|
|
512
|
+
kill: (pid, signal) => {
|
|
513
|
+
if (launchedProcesses.has(pid)) stoppedByPushary.add(pid);
|
|
514
|
+
kill(pid, signal);
|
|
515
|
+
},
|
|
452
516
|
ownsProcess: (request) => {
|
|
453
517
|
const launched = request.spawnId ? launchedProcesses.get(request.pid) === request.spawnId : !request.id && launchedProcesses.has(request.pid);
|
|
454
518
|
return launched || ownsLiveProcess(request);
|
|
@@ -668,6 +732,7 @@ var runSpawnDaemon = async () => {
|
|
|
668
732
|
if (leaseRenewal) clearInterval(leaseRenewal);
|
|
669
733
|
if (sessionReaper) clearInterval(sessionReaper);
|
|
670
734
|
inflight?.abort();
|
|
735
|
+
inventory.stop();
|
|
671
736
|
try {
|
|
672
737
|
daemonLease.release();
|
|
673
738
|
} catch (err) {
|
|
@@ -683,10 +748,9 @@ var runSpawnDaemon = async () => {
|
|
|
683
748
|
const result = await sendHeartbeat(apiKey, {
|
|
684
749
|
repoKey: basename(process.cwd()),
|
|
685
750
|
capabilities: [
|
|
686
|
-
...
|
|
751
|
+
...launchAdvertisement(inventory.current.capabilities),
|
|
687
752
|
STOP_CAPABILITY,
|
|
688
|
-
STOP_ACK_CAPABILITY
|
|
689
|
-
...providerCapabilities
|
|
753
|
+
STOP_ACK_CAPABILITY
|
|
690
754
|
]
|
|
691
755
|
});
|
|
692
756
|
if (result.kind === "ok") {
|
|
@@ -701,13 +765,16 @@ var runSpawnDaemon = async () => {
|
|
|
701
765
|
}
|
|
702
766
|
};
|
|
703
767
|
void beat();
|
|
704
|
-
heartbeat = setInterval(() =>
|
|
768
|
+
heartbeat = setInterval(() => {
|
|
769
|
+
void inventory.refresh().catch((err) => log(`agent discovery failed: ${errMsg(err)}`));
|
|
770
|
+
void beat();
|
|
771
|
+
}, HEARTBEAT_INTERVAL_MS);
|
|
705
772
|
leaseRenewal = setInterval(() => daemonLease.renew(), DAEMON_LEASE_RENEW_INTERVAL_MS);
|
|
706
773
|
versionWatch = setInterval(() => {
|
|
707
774
|
if (daemonLease.shouldYield()) finish();
|
|
708
775
|
}, VERSION_CHECK_INTERVAL_MS);
|
|
709
776
|
sessionReaper = setInterval(() => void reapSilentSessions(), SESSION_REAP_INTERVAL_MS);
|
|
710
|
-
log(hasSpawnProvider(
|
|
777
|
+
log(hasSpawnProvider(inventory.current.capabilities) ? `daemon online (pid ${process.pid}): this machine (${machineId}) can now be sent a new session from your phone. Ctrl-C to stop.` : `daemon online (pid ${process.pid}): no supported Claude, Codex, or Gemini CLI was found, so phone-start is unavailable. Ctrl-C to stop.`);
|
|
711
778
|
timer = setTimeout(tick, 0);
|
|
712
779
|
const signals = daemonSignals();
|
|
713
780
|
await new Promise((resolve) => {
|
|
@@ -15,30 +15,31 @@ import {
|
|
|
15
15
|
compatiblePermissionRuleFile,
|
|
16
16
|
removeCompatibleHooks,
|
|
17
17
|
removeCompatibleMcpServer
|
|
18
|
-
} from "../chunk-
|
|
18
|
+
} from "../chunk-CTNLP4A5.js";
|
|
19
19
|
import {
|
|
20
20
|
isClaudeMcpSnapshot,
|
|
21
21
|
removeClaudeMcpServers,
|
|
22
22
|
removePusharySettings,
|
|
23
23
|
removePusharyToolPermissions,
|
|
24
24
|
restoreClaudeMcpServer
|
|
25
|
-
} from "../chunk-
|
|
25
|
+
} from "../chunk-EJXEHNB5.js";
|
|
26
26
|
import {
|
|
27
27
|
removeGeminiSettings
|
|
28
|
-
} from "../chunk-
|
|
29
|
-
import "../chunk-
|
|
28
|
+
} from "../chunk-YLJ26RR2.js";
|
|
29
|
+
import "../chunk-6ICPEJY5.js";
|
|
30
|
+
import "../chunk-4DYHBXX4.js";
|
|
30
31
|
import "../chunk-N6IOSZOE.js";
|
|
31
32
|
import "../chunk-VFFHQC7W.js";
|
|
32
|
-
import "../chunk-
|
|
33
|
-
import "../chunk-
|
|
33
|
+
import "../chunk-AKCE6ZRF.js";
|
|
34
|
+
import "../chunk-UXKXGRKG.js";
|
|
34
35
|
import "../chunk-POFBE6ZY.js";
|
|
35
36
|
import {
|
|
36
37
|
exitOnHelpFlag
|
|
37
38
|
} from "../chunk-CB23AO4D.js";
|
|
38
|
-
import "../chunk-
|
|
39
|
-
import "../chunk-
|
|
40
|
-
import "../chunk-
|
|
41
|
-
import "../chunk-
|
|
39
|
+
import "../chunk-34EQOFMH.js";
|
|
40
|
+
import "../chunk-6UDK5TY6.js";
|
|
41
|
+
import "../chunk-4CW5EAOI.js";
|
|
42
|
+
import "../chunk-DMU5E6HJ.js";
|
|
42
43
|
import "../chunk-7QLSKOSU.js";
|
|
43
44
|
import "../chunk-KZERVKTD.js";
|
|
44
45
|
import "../chunk-5Y2DY6X4.js";
|
|
@@ -55,7 +56,7 @@ import {
|
|
|
55
56
|
geminiSettings,
|
|
56
57
|
removeCodexHooks,
|
|
57
58
|
removeCodexSettings
|
|
58
|
-
} from "../chunk-
|
|
59
|
+
} from "../chunk-ZR7LIQKO.js";
|
|
59
60
|
import "../chunk-T7E75EKA.js";
|
|
60
61
|
import "../chunk-ON5JW2HP.js";
|
|
61
62
|
import "../chunk-35X5UDML.js";
|
|
@@ -9,11 +9,11 @@ import {
|
|
|
9
9
|
import {
|
|
10
10
|
assessCodexHookTrust,
|
|
11
11
|
readCodexTrustForPusharyHooks
|
|
12
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-27A7L4DA.js";
|
|
13
13
|
import {
|
|
14
14
|
readMachineReadiness,
|
|
15
15
|
readManagedControlEvidence
|
|
16
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-OLYTGVCC.js";
|
|
17
17
|
import {
|
|
18
18
|
FX_PROFILE_REFUSALS,
|
|
19
19
|
FX_PUSHARY_TOOLS_RULE,
|
|
@@ -33,8 +33,8 @@ import {
|
|
|
33
33
|
retryAgentCommand,
|
|
34
34
|
shortenHome,
|
|
35
35
|
vscodeSettingsTargets
|
|
36
|
-
} from "../chunk-
|
|
37
|
-
import "../chunk-
|
|
36
|
+
} from "../chunk-XNJ4MQF3.js";
|
|
37
|
+
import "../chunk-VF3X4MDB.js";
|
|
38
38
|
import {
|
|
39
39
|
OPENCODE_PLUGIN_PLACEHOLDER,
|
|
40
40
|
openCodePluginDir,
|
|
@@ -47,13 +47,15 @@ import {
|
|
|
47
47
|
compatibleMcpFile,
|
|
48
48
|
hasCompatibleHooks,
|
|
49
49
|
missingCompatibleHookEvents
|
|
50
|
-
} from "../chunk-
|
|
51
|
-
import "../chunk-
|
|
50
|
+
} from "../chunk-CTNLP4A5.js";
|
|
51
|
+
import "../chunk-EJXEHNB5.js";
|
|
52
52
|
import {
|
|
53
53
|
detectProviderLiveCapabilities,
|
|
54
|
+
expectedLaunchCapabilities,
|
|
54
55
|
hasSpawnProvider,
|
|
55
56
|
resolveControlPolicy
|
|
56
|
-
} from "../chunk-
|
|
57
|
+
} from "../chunk-SOUJG6UY.js";
|
|
58
|
+
import "../chunk-RIVNNBEK.js";
|
|
57
59
|
import {
|
|
58
60
|
AUTO_UPDATE_DISABLE_ENV,
|
|
59
61
|
autoUpdateOffReason,
|
|
@@ -61,7 +63,7 @@ import {
|
|
|
61
63
|
describeAutoUpdateCheck,
|
|
62
64
|
readAutoUpdateState,
|
|
63
65
|
takeAutoUpdateAnnouncement
|
|
64
|
-
} from "../chunk-
|
|
66
|
+
} from "../chunk-VI55VXDH.js";
|
|
65
67
|
import {
|
|
66
68
|
readLedgerSummary
|
|
67
69
|
} from "../chunk-7ITOAMCD.js";
|
|
@@ -87,7 +89,7 @@ import {
|
|
|
87
89
|
geminiWired,
|
|
88
90
|
holdsLong,
|
|
89
91
|
pusharyHookExecutable
|
|
90
|
-
} from "../chunk-
|
|
92
|
+
} from "../chunk-YOYSXLUB.js";
|
|
91
93
|
import {
|
|
92
94
|
daemonHasRemoteProof,
|
|
93
95
|
daemonServiceManagerAvailable,
|
|
@@ -96,18 +98,19 @@ import {
|
|
|
96
98
|
readDaemonNeedsLogin,
|
|
97
99
|
readDaemonStatus,
|
|
98
100
|
readInstalledDaemonService
|
|
99
|
-
} from "../chunk-
|
|
101
|
+
} from "../chunk-IEXWWAJY.js";
|
|
100
102
|
import {
|
|
101
103
|
GEMINI_HOOK_BINARY,
|
|
102
104
|
hasGeminiHooks,
|
|
103
105
|
missingGeminiHookEvents
|
|
104
|
-
} from "../chunk-
|
|
106
|
+
} from "../chunk-YLJ26RR2.js";
|
|
105
107
|
import "../chunk-XHKBHWLX.js";
|
|
106
|
-
import "../chunk-
|
|
108
|
+
import "../chunk-6ICPEJY5.js";
|
|
109
|
+
import "../chunk-4DYHBXX4.js";
|
|
107
110
|
import "../chunk-N6IOSZOE.js";
|
|
108
111
|
import "../chunk-VFFHQC7W.js";
|
|
109
|
-
import "../chunk-
|
|
110
|
-
import "../chunk-
|
|
112
|
+
import "../chunk-AKCE6ZRF.js";
|
|
113
|
+
import "../chunk-UXKXGRKG.js";
|
|
111
114
|
import "../chunk-POFBE6ZY.js";
|
|
112
115
|
import {
|
|
113
116
|
describeReach,
|
|
@@ -116,7 +119,7 @@ import {
|
|
|
116
119
|
reachVerdict,
|
|
117
120
|
roundTripEvidence,
|
|
118
121
|
verifyRoundTrip
|
|
119
|
-
} from "../chunk-
|
|
122
|
+
} from "../chunk-4SJIPHR3.js";
|
|
120
123
|
import "../chunk-3EGEA4KH.js";
|
|
121
124
|
import "../chunk-QCGNGEGE.js";
|
|
122
125
|
import {
|
|
@@ -136,15 +139,15 @@ import {
|
|
|
136
139
|
import {
|
|
137
140
|
callMcpTool,
|
|
138
141
|
sendMcpRequest
|
|
139
|
-
} from "../chunk-
|
|
142
|
+
} from "../chunk-34EQOFMH.js";
|
|
140
143
|
import {
|
|
141
144
|
checkApiKey,
|
|
142
145
|
describeKeyCheck
|
|
143
|
-
} from "../chunk-
|
|
144
|
-
import "../chunk-
|
|
146
|
+
} from "../chunk-6UDK5TY6.js";
|
|
147
|
+
import "../chunk-4CW5EAOI.js";
|
|
145
148
|
import {
|
|
146
149
|
getMachineId
|
|
147
|
-
} from "../chunk-
|
|
150
|
+
} from "../chunk-DMU5E6HJ.js";
|
|
148
151
|
import {
|
|
149
152
|
UsageError
|
|
150
153
|
} from "../chunk-7QLSKOSU.js";
|
|
@@ -181,7 +184,7 @@ import {
|
|
|
181
184
|
readGlobalCliInstall,
|
|
182
185
|
resolvePathBinary,
|
|
183
186
|
vscodePluginDir
|
|
184
|
-
} from "../chunk-
|
|
187
|
+
} from "../chunk-ZR7LIQKO.js";
|
|
185
188
|
import "../chunk-T7E75EKA.js";
|
|
186
189
|
import {
|
|
187
190
|
getBaseUrl
|
|
@@ -982,7 +985,7 @@ var main = async () => {
|
|
|
982
985
|
}
|
|
983
986
|
let serverProof = null;
|
|
984
987
|
if (controlPolicy === "enabled" && apiKey && daemon.machineId) {
|
|
985
|
-
serverProof = await readMachineReadiness(apiKey,
|
|
988
|
+
serverProof = await readMachineReadiness(apiKey, expectedLaunchCapabilities(configuredManagedProviders), {
|
|
986
989
|
machineId: daemon.machineId
|
|
987
990
|
});
|
|
988
991
|
if (serverProof.kind === "unsupported") {
|
|
@@ -1,47 +1,48 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
readHookInput
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-E5JGQGLD.js";
|
|
5
5
|
import {
|
|
6
6
|
announceSubscriptionRequired,
|
|
7
7
|
isDeferAnswer
|
|
8
8
|
} from "../chunk-5OP5MQI7.js";
|
|
9
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-SD6OLZJX.js";
|
|
10
10
|
import "../chunk-SGZJ5LYH.js";
|
|
11
|
-
import "../chunk-
|
|
11
|
+
import "../chunk-ZOKXZ3AS.js";
|
|
12
12
|
import "../chunk-DLEKCAQL.js";
|
|
13
13
|
import "../chunk-MYHG7PX2.js";
|
|
14
|
-
import "../chunk-
|
|
15
|
-
import "../chunk-
|
|
16
|
-
import "../chunk-
|
|
17
|
-
import "../chunk-
|
|
14
|
+
import "../chunk-YOYSXLUB.js";
|
|
15
|
+
import "../chunk-IEXWWAJY.js";
|
|
16
|
+
import "../chunk-YLJ26RR2.js";
|
|
17
|
+
import "../chunk-XH7UNEHO.js";
|
|
18
18
|
import "../chunk-URNXU3FO.js";
|
|
19
19
|
import "../chunk-UMMCHS6P.js";
|
|
20
20
|
import "../chunk-72WOCX22.js";
|
|
21
21
|
import "../chunk-XHKBHWLX.js";
|
|
22
|
+
import "../chunk-6ICPEJY5.js";
|
|
22
23
|
import "../chunk-N6IOSZOE.js";
|
|
23
24
|
import "../chunk-VFFHQC7W.js";
|
|
24
25
|
import {
|
|
25
26
|
askUser,
|
|
26
27
|
isDecisionStopped,
|
|
27
28
|
waitForQuestion
|
|
28
|
-
} from "../chunk-
|
|
29
|
-
import "../chunk-
|
|
29
|
+
} from "../chunk-AKCE6ZRF.js";
|
|
30
|
+
import "../chunk-UXKXGRKG.js";
|
|
30
31
|
import "../chunk-POFBE6ZY.js";
|
|
31
32
|
import "../chunk-GMXKITVA.js";
|
|
32
33
|
import "../chunk-TJMAXQ5Q.js";
|
|
33
34
|
import {
|
|
34
35
|
SubscriptionRequiredError
|
|
35
|
-
} from "../chunk-
|
|
36
|
-
import "../chunk-
|
|
37
|
-
import "../chunk-
|
|
36
|
+
} from "../chunk-34EQOFMH.js";
|
|
37
|
+
import "../chunk-6UDK5TY6.js";
|
|
38
|
+
import "../chunk-4CW5EAOI.js";
|
|
38
39
|
import {
|
|
39
40
|
getMachineId
|
|
40
|
-
} from "../chunk-
|
|
41
|
+
} from "../chunk-DMU5E6HJ.js";
|
|
41
42
|
import "../chunk-7QLSKOSU.js";
|
|
42
43
|
import "../chunk-KZERVKTD.js";
|
|
43
44
|
import "../chunk-5Y2DY6X4.js";
|
|
44
|
-
import "../chunk-
|
|
45
|
+
import "../chunk-ZR7LIQKO.js";
|
|
45
46
|
import "../chunk-T7E75EKA.js";
|
|
46
47
|
import {
|
|
47
48
|
getApiKey
|
|
@@ -6,13 +6,17 @@ import {
|
|
|
6
6
|
postLiveSessionUntilAccepted,
|
|
7
7
|
startLiveSessionHeartbeat
|
|
8
8
|
} from "../chunk-HVDMGDYV.js";
|
|
9
|
+
import {
|
|
10
|
+
resolveProviderBinary
|
|
11
|
+
} from "../chunk-SOUJG6UY.js";
|
|
12
|
+
import "../chunk-RIVNNBEK.js";
|
|
9
13
|
import {
|
|
10
14
|
SESSION_IDLE_TIMEOUT_MS,
|
|
11
15
|
describeIdleWindow,
|
|
12
16
|
idleDeadlinePassed,
|
|
13
17
|
startProcessOwnership,
|
|
14
18
|
withSpawnProcessOwnership
|
|
15
|
-
} from "../chunk-
|
|
19
|
+
} from "../chunk-6SS74UHS.js";
|
|
16
20
|
import "../chunk-URNXU3FO.js";
|
|
17
21
|
import "../chunk-UMMCHS6P.js";
|
|
18
22
|
import {
|
|
@@ -21,14 +25,13 @@ import {
|
|
|
21
25
|
import {
|
|
22
26
|
spawnClaude
|
|
23
27
|
} from "../chunk-XHKBHWLX.js";
|
|
28
|
+
import "../chunk-6ICPEJY5.js";
|
|
24
29
|
import "../chunk-TJMAXQ5Q.js";
|
|
25
30
|
import {
|
|
26
31
|
getMachineId
|
|
27
|
-
} from "../chunk-
|
|
32
|
+
} from "../chunk-DMU5E6HJ.js";
|
|
28
33
|
import "../chunk-5Y2DY6X4.js";
|
|
29
|
-
import
|
|
30
|
-
resolveBinary
|
|
31
|
-
} from "../chunk-UPLV5AJF.js";
|
|
34
|
+
import "../chunk-ZR7LIQKO.js";
|
|
32
35
|
import "../chunk-T7E75EKA.js";
|
|
33
36
|
import {
|
|
34
37
|
getApiKey,
|
|
@@ -331,7 +334,7 @@ var outcome = await withSpawnProcessOwnership(spawnId, () => runGeminiBridge({
|
|
|
331
334
|
prompt: process.env.PUSHARY_BRIDGE_PROMPT?.trim() || void 0,
|
|
332
335
|
model: process.env.PUSHARY_BRIDGE_MODEL?.trim() || void 0,
|
|
333
336
|
resumeSessionId: process.env.PUSHARY_BRIDGE_RESUME_SESSION_ID?.trim() || void 0,
|
|
334
|
-
command: { command: process.env.PUSHARY_GEMINI_COMMAND?.trim() ||
|
|
337
|
+
command: { command: process.env.PUSHARY_GEMINI_COMMAND?.trim() || resolveProviderBinary("gemini") || "gemini" },
|
|
335
338
|
signal: abort.signal,
|
|
336
339
|
transcripts: transcriptsEnabled()
|
|
337
340
|
}));
|
|
@@ -1,32 +1,33 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
triggerAutoUpdate
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-VI55VXDH.js";
|
|
5
5
|
import {
|
|
6
6
|
isGatingMoment,
|
|
7
7
|
recordKeylessMoment
|
|
8
8
|
} from "../chunk-7ITOAMCD.js";
|
|
9
9
|
import {
|
|
10
10
|
readHookInput
|
|
11
|
-
} from "../chunk-
|
|
11
|
+
} from "../chunk-E5JGQGLD.js";
|
|
12
12
|
import {
|
|
13
13
|
announceSubscriptionRequired,
|
|
14
14
|
denyReasonFrom,
|
|
15
15
|
isDeferAnswer
|
|
16
16
|
} from "../chunk-5OP5MQI7.js";
|
|
17
|
-
import "../chunk-
|
|
17
|
+
import "../chunk-SD6OLZJX.js";
|
|
18
18
|
import "../chunk-SGZJ5LYH.js";
|
|
19
|
-
import "../chunk-
|
|
19
|
+
import "../chunk-ZOKXZ3AS.js";
|
|
20
20
|
import "../chunk-DLEKCAQL.js";
|
|
21
21
|
import "../chunk-MYHG7PX2.js";
|
|
22
|
-
import "../chunk-
|
|
23
|
-
import "../chunk-
|
|
24
|
-
import "../chunk-
|
|
25
|
-
import "../chunk-
|
|
22
|
+
import "../chunk-YOYSXLUB.js";
|
|
23
|
+
import "../chunk-IEXWWAJY.js";
|
|
24
|
+
import "../chunk-YLJ26RR2.js";
|
|
25
|
+
import "../chunk-XH7UNEHO.js";
|
|
26
26
|
import "../chunk-URNXU3FO.js";
|
|
27
27
|
import "../chunk-UMMCHS6P.js";
|
|
28
28
|
import "../chunk-72WOCX22.js";
|
|
29
29
|
import "../chunk-XHKBHWLX.js";
|
|
30
|
+
import "../chunk-6ICPEJY5.js";
|
|
30
31
|
import {
|
|
31
32
|
UNNAMED_ACTION,
|
|
32
33
|
deriveActionBody,
|
|
@@ -45,7 +46,7 @@ import {
|
|
|
45
46
|
repoKeyFor,
|
|
46
47
|
reportEvent,
|
|
47
48
|
scopePathFor
|
|
48
|
-
} from "../chunk-
|
|
49
|
+
} from "../chunk-4DYHBXX4.js";
|
|
49
50
|
import {
|
|
50
51
|
DEFAULT_SESSION
|
|
51
52
|
} from "../chunk-N6IOSZOE.js";
|
|
@@ -58,27 +59,27 @@ import {
|
|
|
58
59
|
isLocalQuestionHandoff,
|
|
59
60
|
sendNotification,
|
|
60
61
|
waitForQuestion
|
|
61
|
-
} from "../chunk-
|
|
62
|
+
} from "../chunk-AKCE6ZRF.js";
|
|
62
63
|
import {
|
|
63
64
|
exitAfterClientReports
|
|
64
|
-
} from "../chunk-
|
|
65
|
+
} from "../chunk-UXKXGRKG.js";
|
|
65
66
|
import "../chunk-POFBE6ZY.js";
|
|
66
67
|
import "../chunk-GMXKITVA.js";
|
|
67
68
|
import "../chunk-TJMAXQ5Q.js";
|
|
68
69
|
import {
|
|
69
70
|
SubscriptionRequiredError
|
|
70
|
-
} from "../chunk-
|
|
71
|
-
import "../chunk-
|
|
72
|
-
import "../chunk-
|
|
71
|
+
} from "../chunk-34EQOFMH.js";
|
|
72
|
+
import "../chunk-6UDK5TY6.js";
|
|
73
|
+
import "../chunk-4CW5EAOI.js";
|
|
73
74
|
import {
|
|
74
75
|
getMachineId
|
|
75
|
-
} from "../chunk-
|
|
76
|
+
} from "../chunk-DMU5E6HJ.js";
|
|
76
77
|
import "../chunk-7QLSKOSU.js";
|
|
77
78
|
import {
|
|
78
79
|
EXIT
|
|
79
80
|
} from "../chunk-KZERVKTD.js";
|
|
80
81
|
import "../chunk-5Y2DY6X4.js";
|
|
81
|
-
import "../chunk-
|
|
82
|
+
import "../chunk-ZR7LIQKO.js";
|
|
82
83
|
import "../chunk-T7E75EKA.js";
|
|
83
84
|
import {
|
|
84
85
|
getApiKey
|