@pushary/agent-hooks 0.89.11 → 0.89.13
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 +55 -0
- package/README.md +4 -2
- package/dist/bin/pushary-bell-hook.js +5 -5
- package/dist/bin/pushary-bell.js +11 -11
- package/dist/bin/pushary-claude.js +225 -48
- package/dist/bin/pushary-clean.js +49 -29
- package/dist/bin/pushary-codex-bridge.js +17 -16
- package/dist/bin/pushary-codex-hook.js +11 -10
- package/dist/bin/pushary-codex.js +7 -7
- package/dist/bin/pushary-connect.js +12 -12
- package/dist/bin/pushary-daemon-supervisor.d.ts +1 -0
- package/dist/bin/pushary-daemon-supervisor.js +27 -0
- package/dist/bin/pushary-daemon.js +22 -22
- package/dist/bin/pushary-disconnect.js +9 -9
- package/dist/bin/pushary-doctor.js +59 -49
- package/dist/bin/pushary-elicitation-hook.js +4 -4
- package/dist/bin/pushary-gemini-bridge.js +16 -15
- package/dist/bin/pushary-gemini-hook.js +10 -9
- package/dist/bin/pushary-hook.js +13 -13
- package/dist/bin/pushary-login.js +11 -11
- package/dist/bin/pushary-logout.js +11 -11
- package/dist/bin/pushary-mode.js +5 -5
- package/dist/bin/pushary-notification-hook.js +7 -7
- package/dist/bin/pushary-opencode-hook.js +10 -9
- package/dist/bin/pushary-permission-denied-hook.js +11 -11
- package/dist/bin/pushary-permission-hook.js +11 -11
- package/dist/bin/pushary-post-hook.js +7 -7
- package/dist/bin/pushary-prompt-hook.js +7 -7
- package/dist/bin/pushary-session-end-hook.js +7 -7
- package/dist/bin/pushary-session-start-hook.js +7 -7
- package/dist/bin/pushary-setup.js +87 -59
- package/dist/bin/pushary-stats.js +4 -4
- package/dist/bin/pushary-status.js +14 -14
- package/dist/bin/pushary-stop-hook.js +7 -7
- package/dist/bin/pushary-stopfailure-hook.js +7 -7
- package/dist/bin/pushary-suggestions.js +2 -2
- package/dist/bin/pushary-transcripts.d.ts +1 -0
- package/dist/bin/pushary-transcripts.js +79 -0
- package/dist/bin/pushary-upgrade.js +21 -21
- package/dist/bin/pushary-wait.js +5 -5
- package/dist/bin/pushary.js +3 -2
- package/dist/{chunk-6XUABEX2.js → chunk-3OXHYPZG.js} +1 -1
- package/dist/{chunk-QA72MKIT.js → chunk-3YGGEDJK.js} +5 -5
- package/dist/{chunk-IUN6VOKV.js → chunk-4IPSMEGT.js} +68 -46
- package/dist/{chunk-XX2V4QS5.js → chunk-4LL6LG5X.js} +2 -2
- package/dist/{chunk-J4K75V4D.js → chunk-5MNTWAAJ.js} +10 -9
- package/dist/{chunk-KVE5RCQL.js → chunk-5YEF55AX.js} +1 -1
- package/dist/{chunk-3SQYKLBW.js → chunk-7JZCADBR.js} +46 -18
- package/dist/{chunk-IUWRVTQK.js → chunk-ANMHIZZY.js} +1 -1
- package/dist/{chunk-6EKQZA6R.js → chunk-B2HND22S.js} +1 -1
- package/dist/{chunk-TRVIRETT.js → chunk-C56VHSXU.js} +1 -1
- package/dist/{chunk-TEZ2FZD6.js → chunk-CBGGUEKE.js} +2 -2
- package/dist/{chunk-3HFK3UXM.js → chunk-FOGW6O2Y.js} +1 -1
- package/dist/{chunk-3XTFX4CL.js → chunk-GMJDQDXU.js} +17 -2
- package/dist/{chunk-DKWM5T3P.js → chunk-JTBDBKHU.js} +2 -2
- package/dist/{chunk-Q223OM5J.js → chunk-JVLB5CAJ.js} +4 -4
- package/dist/{chunk-2LPEZYMC.js → chunk-KNLKHJZR.js} +1 -1
- package/dist/{chunk-X4ZUUFKV.js → chunk-L4ZCFMWW.js} +63 -1
- package/dist/chunk-M3UABYRT.js +20 -0
- package/dist/{chunk-PZRWFWSR.js → chunk-MNTZKFZI.js} +7 -7
- package/dist/{chunk-FZ73G2RO.js → chunk-MSTHT2M7.js} +25 -6
- package/dist/{chunk-TG3T3M4K.js → chunk-N4QJ3CLX.js} +6 -2
- package/dist/{chunk-3CUDMTL4.js → chunk-NBDU3R3G.js} +10 -3
- package/dist/{chunk-FXIL7RCL.js → chunk-OX35BSPV.js} +4 -4
- package/dist/{chunk-UDBJHQMG.js → chunk-QFJZHVVL.js} +1 -1
- package/dist/chunk-QZCFVWA7.js +58 -0
- package/dist/{chunk-TY5HVMXT.js → chunk-RAEPAUNJ.js} +1 -1
- package/dist/{chunk-NCVIWGVA.js → chunk-S4BLNILH.js} +1 -1
- package/dist/{chunk-MZGWKIUZ.js → chunk-VASZ6TWW.js} +7 -3
- package/dist/{chunk-SYUIXXQW.js → chunk-VF3RTVWY.js} +1 -1
- package/dist/{chunk-LURY4WNF.js → chunk-WHDSJ6PD.js} +1 -1
- package/dist/chunk-YKLCWWEI.js +76 -0
- package/dist/{chunk-253WC6O5.js → chunk-YXT55PYF.js} +1 -1
- package/dist/{chunk-BLODMQKJ.js → chunk-ZO43JTT3.js} +1 -1
- package/dist/{chunk-OLAGKKSR.js → chunk-ZP3SNUP7.js} +16 -6
- package/dist/{chunk-34GN3IPX.js → chunk-ZWEKONU6.js} +1 -1
- package/dist/src/index.d.ts +3 -1
- package/dist/src/index.js +15 -11
- package/package.json +4 -2
- /package/dist/{chunk-X6RXX2NF.js → chunk-QINYXLA5.js} +0 -0
|
@@ -3,13 +3,16 @@ import {
|
|
|
3
3
|
HERMES_CONFIG_SCRIPT,
|
|
4
4
|
resolveHermesPython,
|
|
5
5
|
runHermesPythonScript
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-QFJZHVVL.js";
|
|
7
7
|
import {
|
|
8
8
|
removeInstructionBlock,
|
|
9
9
|
shortenHome,
|
|
10
10
|
unregisterPluginLocation,
|
|
11
11
|
vscodeSettingsTargets
|
|
12
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-VASZ6TWW.js";
|
|
13
|
+
import {
|
|
14
|
+
pusharyHookExecutable
|
|
15
|
+
} from "../chunk-MSTHT2M7.js";
|
|
13
16
|
import {
|
|
14
17
|
OPENCODE_PLUGIN_SIBLING,
|
|
15
18
|
OPENCODE_PLUGIN_SIBLING_CONTENTS,
|
|
@@ -19,25 +22,25 @@ import {
|
|
|
19
22
|
openCodePluginDir,
|
|
20
23
|
openCodePluginFile,
|
|
21
24
|
removeOpenCodeMcpServer
|
|
22
|
-
} from "../chunk-
|
|
25
|
+
} from "../chunk-ZWEKONU6.js";
|
|
23
26
|
import {
|
|
24
27
|
isClaudeMcpSnapshot,
|
|
25
28
|
removeClaudeMcpServers,
|
|
26
29
|
removeGeminiSettings,
|
|
27
30
|
removePusharySettings,
|
|
28
31
|
restoreClaudeMcpServer
|
|
29
|
-
} from "../chunk-
|
|
30
|
-
import "../chunk-
|
|
31
|
-
import "../chunk-
|
|
32
|
+
} from "../chunk-JVLB5CAJ.js";
|
|
33
|
+
import "../chunk-B2HND22S.js";
|
|
34
|
+
import "../chunk-VF3RTVWY.js";
|
|
32
35
|
import {
|
|
33
36
|
disableDaemonService
|
|
34
|
-
} from "../chunk-
|
|
37
|
+
} from "../chunk-7JZCADBR.js";
|
|
35
38
|
import "../chunk-XHKBHWLX.js";
|
|
36
39
|
import {
|
|
37
40
|
execNpm
|
|
38
|
-
} from "../chunk-
|
|
39
|
-
import "../chunk-
|
|
40
|
-
import "../chunk-
|
|
41
|
+
} from "../chunk-L4ZCFMWW.js";
|
|
42
|
+
import "../chunk-N4QJ3CLX.js";
|
|
43
|
+
import "../chunk-JTBDBKHU.js";
|
|
41
44
|
import {
|
|
42
45
|
claudeJson,
|
|
43
46
|
claudeMcpReceipt,
|
|
@@ -55,32 +58,33 @@ import {
|
|
|
55
58
|
geminiMd,
|
|
56
59
|
geminiSettings,
|
|
57
60
|
hermesConfigReceipt,
|
|
61
|
+
isProtectedByScope,
|
|
58
62
|
pusharyDir,
|
|
59
63
|
removeCodexHookTrust,
|
|
60
64
|
removeCodexHooks,
|
|
61
65
|
vscodePluginDir
|
|
62
|
-
} from "../chunk-
|
|
66
|
+
} from "../chunk-3YGGEDJK.js";
|
|
63
67
|
import {
|
|
64
68
|
rejectUnknownFlags
|
|
65
69
|
} from "../chunk-GMXKITVA.js";
|
|
66
70
|
import {
|
|
67
71
|
exitOnHelpFlag
|
|
68
|
-
} from "../chunk-
|
|
69
|
-
import "../chunk-
|
|
72
|
+
} from "../chunk-WHDSJ6PD.js";
|
|
73
|
+
import "../chunk-GMJDQDXU.js";
|
|
74
|
+
import "../chunk-DINDL2CF.js";
|
|
70
75
|
import {
|
|
71
76
|
removeClaudeAlias
|
|
72
77
|
} from "../chunk-BC3VCZ3E.js";
|
|
73
|
-
import "../chunk-DINDL2CF.js";
|
|
74
78
|
import "../chunk-7QLSKOSU.js";
|
|
75
79
|
import {
|
|
76
80
|
EXIT
|
|
77
81
|
} from "../chunk-KZERVKTD.js";
|
|
78
|
-
import "../chunk-
|
|
82
|
+
import "../chunk-4LL6LG5X.js";
|
|
79
83
|
import "../chunk-2UMNXADU.js";
|
|
80
84
|
import {
|
|
81
85
|
CURSOR_GATE_EVENTS,
|
|
82
86
|
HOOK_LOCATOR_BINARY
|
|
83
|
-
} from "../chunk-
|
|
87
|
+
} from "../chunk-QINYXLA5.js";
|
|
84
88
|
|
|
85
89
|
// bin/pushary-clean.ts
|
|
86
90
|
import { existsSync, readFileSync, copyFileSync, readdirSync } from "fs";
|
|
@@ -118,7 +122,16 @@ var APP_OWNED_ENTRIES = [
|
|
|
118
122
|
// Shared: AgentInstaller.vscodePlugin writes .pushary/plugins/vscode, and so
|
|
119
123
|
// does the CLI. Not attributable, so it is kept whenever the app is installed
|
|
120
124
|
// rather than removed and left registered against a path that is gone.
|
|
121
|
-
"plugins"
|
|
125
|
+
"plugins",
|
|
126
|
+
// Shared, and the one whose loss is silent. `identity.ts` writes this Mac's id
|
|
127
|
+
// here and `DeviceIdentity.current()` reads it in preference to its own
|
|
128
|
+
// UserDefaults copy, precisely so one Mac has one id. Deleting it while the app
|
|
129
|
+
// is installed does not stop the app: it falls back to the copy it minted
|
|
130
|
+
// before that reconciliation existed, and the Mac starts reporting two ids that
|
|
131
|
+
// can never compare equal. A session tagged with the other one is then a
|
|
132
|
+
// session the app refuses to fetch messages for, and one `TerminalJump` calls
|
|
133
|
+
// `.onAnotherMachine`.
|
|
134
|
+
"machine-id"
|
|
122
135
|
];
|
|
123
136
|
var isAppOwned = (name) => APP_OWNED_ENTRIES.includes(name);
|
|
124
137
|
|
|
@@ -146,9 +159,9 @@ var VSCODE_PLUGIN_DIR = vscodePluginDir();
|
|
|
146
159
|
var PUSHARY_DIR = pusharyDir();
|
|
147
160
|
var SHELL_FILES = [".zshrc", ".zprofile", ".bashrc", ".bash_profile"].map((f) => join(homedir(), f));
|
|
148
161
|
var macAppInstalled = () => existsSync(join(PUSHARY_DIR, "bin", HOOK_LOCATOR_BINARY));
|
|
149
|
-
var removalScope = () => ({
|
|
162
|
+
var removalScope = (keepMcpServer) => ({
|
|
150
163
|
keepAppWiring: true,
|
|
151
|
-
keepMcpServer
|
|
164
|
+
keepMcpServer
|
|
152
165
|
});
|
|
153
166
|
var readJson = (path) => {
|
|
154
167
|
try {
|
|
@@ -189,7 +202,7 @@ var guardedAliasRemoval = () => {
|
|
|
189
202
|
var writeJson = (path, data) => {
|
|
190
203
|
guardedWrite(path, JSON.stringify(data, null, 2) + "\n");
|
|
191
204
|
};
|
|
192
|
-
var removeCursorUserHook = () => {
|
|
205
|
+
var removeCursorUserHook = (scope) => {
|
|
193
206
|
if (!existsSync(CURSOR_USER_HOOKS)) return "absent";
|
|
194
207
|
let parsed;
|
|
195
208
|
try {
|
|
@@ -202,7 +215,10 @@ var removeCursorUserHook = () => {
|
|
|
202
215
|
let removedAny = false;
|
|
203
216
|
for (const event of CURSOR_GATE_EVENTS) {
|
|
204
217
|
const existing = Array.isArray(hooks[event]) ? hooks[event] : [];
|
|
205
|
-
const others = existing.filter((h) =>
|
|
218
|
+
const others = existing.filter((h) => {
|
|
219
|
+
const command = String(h.command ?? "");
|
|
220
|
+
return pusharyHookExecutable(command) === null || isProtectedByScope(command, scope);
|
|
221
|
+
});
|
|
206
222
|
if (others.length === existing.length) continue;
|
|
207
223
|
removedAny = true;
|
|
208
224
|
if (others.length === 0) delete hooks[event];
|
|
@@ -221,7 +237,10 @@ var removeCursorUserHook = () => {
|
|
|
221
237
|
const afterHooks = after?.hooks ?? {};
|
|
222
238
|
const stillThere = CURSOR_GATE_EVENTS.some((event) => {
|
|
223
239
|
const entries = afterHooks[event];
|
|
224
|
-
return Array.isArray(entries) && entries.some((h) =>
|
|
240
|
+
return Array.isArray(entries) && entries.some((h) => {
|
|
241
|
+
const command = String(h?.command ?? "");
|
|
242
|
+
return pusharyHookExecutable(command) !== null && !isProtectedByScope(command, scope);
|
|
243
|
+
});
|
|
225
244
|
});
|
|
226
245
|
if (stillThere) return "failed";
|
|
227
246
|
} catch {
|
|
@@ -229,13 +248,13 @@ var removeCursorUserHook = () => {
|
|
|
229
248
|
}
|
|
230
249
|
return "removed";
|
|
231
250
|
};
|
|
232
|
-
var cleanSettingsFile = (path, label) => {
|
|
251
|
+
var cleanSettingsFile = (path, label, scope) => {
|
|
233
252
|
const data = readJson(path);
|
|
234
253
|
if (!data) {
|
|
235
254
|
console.log(` ${skip} ${label} ${dim("(not found)")}`);
|
|
236
255
|
return;
|
|
237
256
|
}
|
|
238
|
-
const changed = removePusharySettings(data,
|
|
257
|
+
const changed = removePusharySettings(data, scope);
|
|
239
258
|
if (changed) {
|
|
240
259
|
writeJson(path, data);
|
|
241
260
|
console.log(` ${check} ${label} ${dim(did("cleaned"))}`);
|
|
@@ -280,6 +299,7 @@ var main = async () => {
|
|
|
280
299
|
}
|
|
281
300
|
console.log();
|
|
282
301
|
const keepShared = macAppInstalled();
|
|
302
|
+
const scope = removalScope(keepShared);
|
|
283
303
|
if (keepShared) {
|
|
284
304
|
console.log(` ${dim("The Mac app is installed, so its wiring and the state it owns are left alone.")}`);
|
|
285
305
|
console.log();
|
|
@@ -293,8 +313,8 @@ var main = async () => {
|
|
|
293
313
|
process.exit(EXIT.FAILED);
|
|
294
314
|
}
|
|
295
315
|
console.log(` ${check} Background service ${dim(did("uninstalled"))}`);
|
|
296
|
-
cleanSettingsFile(CLAUDE_SETTINGS, "Claude Code settings");
|
|
297
|
-
cleanSettingsFile(CLAUDE_SETTINGS_LOCAL, "Claude Code settings.local");
|
|
316
|
+
cleanSettingsFile(CLAUDE_SETTINGS, "Claude Code settings", scope);
|
|
317
|
+
cleanSettingsFile(CLAUDE_SETTINGS_LOCAL, "Claude Code settings.local", scope);
|
|
298
318
|
const claudeJson2 = keepShared ? null : readJson(CLAUDE_JSON);
|
|
299
319
|
if (keepShared) {
|
|
300
320
|
console.log(` ${skip} Claude Code MCP servers ${dim("(kept: the Mac app uses it)")}`);
|
|
@@ -332,7 +352,7 @@ var main = async () => {
|
|
|
332
352
|
} else {
|
|
333
353
|
console.log(` ${skip} Cursor MCP config ${dim("(not found)")}`);
|
|
334
354
|
}
|
|
335
|
-
const cursorGate = removeCursorUserHook();
|
|
355
|
+
const cursorGate = removeCursorUserHook(scope);
|
|
336
356
|
if (cursorGate === "removed") {
|
|
337
357
|
console.log(` ${check} Cursor gate ${dim("(removed from ~/.cursor/hooks.json)")}`);
|
|
338
358
|
} else if (cursorGate === "absent") {
|
|
@@ -410,7 +430,7 @@ var main = async () => {
|
|
|
410
430
|
console.log(` ${skip} Codex config ${dim("(not found)")}`);
|
|
411
431
|
}
|
|
412
432
|
if (codexHooksData) {
|
|
413
|
-
if (removeCodexHooks(codexHooksData,
|
|
433
|
+
if (removeCodexHooks(codexHooksData, scope)) {
|
|
414
434
|
writeJson(codexHooksJson2, codexHooksData);
|
|
415
435
|
console.log(` ${check} Codex hooks ${dim("(removed from ~/.codex/hooks.json)")}`);
|
|
416
436
|
} else {
|
|
@@ -435,7 +455,7 @@ var main = async () => {
|
|
|
435
455
|
const geminiSettingsPath = geminiSettings();
|
|
436
456
|
const geminiSettings2 = readJson(geminiSettingsPath);
|
|
437
457
|
if (geminiSettings2) {
|
|
438
|
-
if (removeGeminiSettings(geminiSettings2,
|
|
458
|
+
if (removeGeminiSettings(geminiSettings2, scope)) {
|
|
439
459
|
writeJson(geminiSettingsPath, geminiSettings2);
|
|
440
460
|
console.log(` ${check} Gemini CLI settings ${dim(did("cleaned"))}`);
|
|
441
461
|
} else {
|
|
@@ -1,33 +1,40 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import "../chunk-
|
|
2
|
+
import "../chunk-3OXHYPZG.js";
|
|
3
3
|
import {
|
|
4
4
|
LiveTranscriptRelay,
|
|
5
5
|
liveSessionSleep,
|
|
6
6
|
postLiveSession,
|
|
7
7
|
postLiveSessionUntilAccepted,
|
|
8
8
|
startLiveSessionHeartbeat
|
|
9
|
-
} from "../chunk-
|
|
10
|
-
import "../chunk-
|
|
9
|
+
} from "../chunk-ZP3SNUP7.js";
|
|
10
|
+
import "../chunk-4IPSMEGT.js";
|
|
11
|
+
import "../chunk-QZCFVWA7.js";
|
|
12
|
+
import {
|
|
13
|
+
transcriptsEnabled
|
|
14
|
+
} from "../chunk-M3UABYRT.js";
|
|
11
15
|
import {
|
|
12
16
|
startProcessOwnership,
|
|
13
17
|
withSpawnProcessOwnership
|
|
14
|
-
} from "../chunk-
|
|
18
|
+
} from "../chunk-CBGGUEKE.js";
|
|
15
19
|
import {
|
|
16
20
|
spawnClaude
|
|
17
21
|
} from "../chunk-XHKBHWLX.js";
|
|
18
22
|
import {
|
|
19
23
|
resolveBinary
|
|
20
|
-
} from "../chunk-
|
|
24
|
+
} from "../chunk-L4ZCFMWW.js";
|
|
21
25
|
import {
|
|
22
26
|
getMachineId
|
|
23
|
-
} from "../chunk-
|
|
24
|
-
import "../chunk-
|
|
25
|
-
import "../chunk-
|
|
27
|
+
} from "../chunk-JTBDBKHU.js";
|
|
28
|
+
import "../chunk-3YGGEDJK.js";
|
|
29
|
+
import "../chunk-NBDU3R3G.js";
|
|
30
|
+
import "../chunk-BC3VCZ3E.js";
|
|
31
|
+
import "../chunk-ANMHIZZY.js";
|
|
32
|
+
import "../chunk-4LL6LG5X.js";
|
|
26
33
|
import {
|
|
27
34
|
getApiKey,
|
|
28
35
|
getBaseUrl
|
|
29
36
|
} from "../chunk-2UMNXADU.js";
|
|
30
|
-
import "../chunk-
|
|
37
|
+
import "../chunk-QINYXLA5.js";
|
|
31
38
|
|
|
32
39
|
// bin/pushary-codex-bridge.ts
|
|
33
40
|
import { existsSync } from "fs";
|
|
@@ -371,13 +378,7 @@ var outcome = await withSpawnProcessOwnership(spawnId, () => runCodexBridge({
|
|
|
371
378
|
args: ["app-server", "--stdio"]
|
|
372
379
|
},
|
|
373
380
|
signal: abort.signal,
|
|
374
|
-
|
|
375
|
-
// on an explicit `false`), but `=== '1'` can never produce `undefined`, so an
|
|
376
|
-
// unset env var forced the opt-out on every spawn and the live relay was never
|
|
377
|
-
// built. Pass the opt-out only when the user asks for one. The relay stays a
|
|
378
|
-
// hard no-op until this account's phone has registered a public key, and what
|
|
379
|
-
// it sends is encrypted to that key on this machine.
|
|
380
|
-
...process.env.PUSHARY_TRANSCRIPTS === "0" ? { transcripts: false } : {}
|
|
381
|
+
transcripts: transcriptsEnabled()
|
|
381
382
|
}));
|
|
382
383
|
for (const signal of signals) process.off(signal, stop);
|
|
383
384
|
process.exit(outcome === "stopped" ? 0 : 1);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
defersToNativeMode
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-S4BLNILH.js";
|
|
5
5
|
import {
|
|
6
6
|
isGatingMoment,
|
|
7
7
|
recordKeylessMoment
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-FOGW6O2Y.js";
|
|
9
9
|
import {
|
|
10
10
|
readHookInput
|
|
11
11
|
} from "../chunk-6CUUA7HO.js";
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
toCodexWire,
|
|
35
35
|
toPolicyLookup,
|
|
36
36
|
toPolicyLookups
|
|
37
|
-
} from "../chunk-
|
|
37
|
+
} from "../chunk-OX35BSPV.js";
|
|
38
38
|
import {
|
|
39
39
|
DEFAULT_SESSION,
|
|
40
40
|
askUser,
|
|
@@ -44,24 +44,25 @@ import {
|
|
|
44
44
|
sendNotification
|
|
45
45
|
} from "../chunk-JHJHCMAF.js";
|
|
46
46
|
import {
|
|
47
|
+
UNNAMED_ACTION,
|
|
47
48
|
deriveActionBody,
|
|
48
49
|
deriveBlocker,
|
|
49
50
|
deriveToolTarget,
|
|
50
51
|
describeToolCall,
|
|
51
52
|
scopePathFor
|
|
52
|
-
} from "../chunk-
|
|
53
|
+
} from "../chunk-N4QJ3CLX.js";
|
|
53
54
|
import {
|
|
54
55
|
getMachineId
|
|
55
|
-
} from "../chunk-
|
|
56
|
+
} from "../chunk-JTBDBKHU.js";
|
|
56
57
|
import {
|
|
57
58
|
canonicalJson
|
|
58
|
-
} from "../chunk-
|
|
59
|
+
} from "../chunk-3YGGEDJK.js";
|
|
59
60
|
import "../chunk-BSZYIAZL.js";
|
|
60
61
|
import "../chunk-SAF6HGAA.js";
|
|
61
|
-
import "../chunk-IUWRVTQK.js";
|
|
62
62
|
import "../chunk-7QLSKOSU.js";
|
|
63
63
|
import "../chunk-KZERVKTD.js";
|
|
64
|
-
import "../chunk-
|
|
64
|
+
import "../chunk-ANMHIZZY.js";
|
|
65
|
+
import "../chunk-4LL6LG5X.js";
|
|
65
66
|
import {
|
|
66
67
|
getApiKey
|
|
67
68
|
} from "../chunk-2UMNXADU.js";
|
|
@@ -72,7 +73,7 @@ import {
|
|
|
72
73
|
hookWaitClamped,
|
|
73
74
|
hookWaitDeadline,
|
|
74
75
|
resolveGate
|
|
75
|
-
} from "../chunk-
|
|
76
|
+
} from "../chunk-QINYXLA5.js";
|
|
76
77
|
|
|
77
78
|
// bin/pushary-codex-hook.ts
|
|
78
79
|
import { basename } from "path";
|
|
@@ -179,7 +180,7 @@ var pushQuestion = async (apiKey, input, lookup, waitSeconds, mode) => {
|
|
|
179
180
|
const projectName = basename(input.cwd ?? process.cwd());
|
|
180
181
|
const description = describeFor(input, lookup);
|
|
181
182
|
const result = await askUser(apiKey, {
|
|
182
|
-
question: `Allow ${description}?`,
|
|
183
|
+
question: `Allow ${description || UNNAMED_ACTION}?`,
|
|
183
184
|
type: "confirm",
|
|
184
185
|
context: `Agent wants to run this in ${projectName}`,
|
|
185
186
|
agentName: agentNameFor(input),
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
reportEvent
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-OX35BSPV.js";
|
|
5
5
|
import {
|
|
6
6
|
askUser,
|
|
7
7
|
waitForAnswer
|
|
8
8
|
} from "../chunk-JHJHCMAF.js";
|
|
9
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-N4QJ3CLX.js";
|
|
10
10
|
import {
|
|
11
11
|
getMachineId
|
|
12
|
-
} from "../chunk-
|
|
13
|
-
import "../chunk-
|
|
12
|
+
} from "../chunk-JTBDBKHU.js";
|
|
13
|
+
import "../chunk-3YGGEDJK.js";
|
|
14
14
|
import "../chunk-BSZYIAZL.js";
|
|
15
15
|
import "../chunk-SAF6HGAA.js";
|
|
16
|
-
import "../chunk-IUWRVTQK.js";
|
|
17
16
|
import "../chunk-7QLSKOSU.js";
|
|
18
17
|
import "../chunk-KZERVKTD.js";
|
|
19
|
-
import "../chunk-
|
|
18
|
+
import "../chunk-ANMHIZZY.js";
|
|
19
|
+
import "../chunk-4LL6LG5X.js";
|
|
20
20
|
import {
|
|
21
21
|
getApiKey
|
|
22
22
|
} from "../chunk-2UMNXADU.js";
|
|
23
|
-
import "../chunk-
|
|
23
|
+
import "../chunk-QINYXLA5.js";
|
|
24
24
|
|
|
25
25
|
// bin/pushary-codex.ts
|
|
26
26
|
import { basename } from "path";
|
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
printKeyCheck
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-YXT55PYF.js";
|
|
5
5
|
import {
|
|
6
6
|
confirmAppConnection,
|
|
7
7
|
connectDevice,
|
|
8
8
|
printConnectInstructions
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-KNLKHJZR.js";
|
|
10
10
|
import "../chunk-3EGEA4KH.js";
|
|
11
11
|
import {
|
|
12
12
|
checkApiKey
|
|
13
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-ZO43JTT3.js";
|
|
14
14
|
import {
|
|
15
15
|
createIo
|
|
16
16
|
} from "../chunk-5RUIFDTP.js";
|
|
17
|
-
import {
|
|
18
|
-
readKeySource
|
|
19
|
-
} from "../chunk-3CUDMTL4.js";
|
|
20
17
|
import {
|
|
21
18
|
parseFlags
|
|
22
19
|
} from "../chunk-GMXKITVA.js";
|
|
23
20
|
import {
|
|
24
21
|
exitOnHelpFlag
|
|
25
|
-
} from "../chunk-
|
|
26
|
-
import "../chunk-
|
|
27
|
-
import "../chunk-BC3VCZ3E.js";
|
|
22
|
+
} from "../chunk-WHDSJ6PD.js";
|
|
23
|
+
import "../chunk-GMJDQDXU.js";
|
|
28
24
|
import "../chunk-DINDL2CF.js";
|
|
25
|
+
import {
|
|
26
|
+
readKeySource
|
|
27
|
+
} from "../chunk-NBDU3R3G.js";
|
|
28
|
+
import "../chunk-BC3VCZ3E.js";
|
|
29
29
|
import "../chunk-BSZYIAZL.js";
|
|
30
30
|
import "../chunk-SAF6HGAA.js";
|
|
31
|
-
import "../chunk-IUWRVTQK.js";
|
|
32
31
|
import {
|
|
33
32
|
UsageError
|
|
34
33
|
} from "../chunk-7QLSKOSU.js";
|
|
35
34
|
import {
|
|
36
35
|
EXIT
|
|
37
36
|
} from "../chunk-KZERVKTD.js";
|
|
38
|
-
import "../chunk-
|
|
37
|
+
import "../chunk-ANMHIZZY.js";
|
|
38
|
+
import "../chunk-4LL6LG5X.js";
|
|
39
39
|
import "../chunk-2UMNXADU.js";
|
|
40
|
-
import "../chunk-
|
|
40
|
+
import "../chunk-QINYXLA5.js";
|
|
41
41
|
|
|
42
42
|
// bin/pushary-connect.ts
|
|
43
43
|
exitOnHelpFlag("connect");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// bin/pushary-daemon-supervisor.ts
|
|
4
|
+
import { spawn } from "child_process";
|
|
5
|
+
var FIRST_DELAY_MS = 1e4;
|
|
6
|
+
var MAX_DELAY_MS = 5 * 6e4;
|
|
7
|
+
var HEALTHY_RUN_MS = 6e4;
|
|
8
|
+
var daemonEntry = process.argv[2];
|
|
9
|
+
if (!daemonEntry) {
|
|
10
|
+
process.stderr.write("Missing daemon entry.\n");
|
|
11
|
+
process.exitCode = 64;
|
|
12
|
+
} else {
|
|
13
|
+
const wait = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
14
|
+
const run = () => new Promise((resolve) => {
|
|
15
|
+
const child = spawn(process.execPath, [daemonEntry], { stdio: "inherit", windowsHide: true });
|
|
16
|
+
child.once("error", () => resolve(1));
|
|
17
|
+
child.once("exit", (code) => resolve(code ?? 1));
|
|
18
|
+
});
|
|
19
|
+
let delay = FIRST_DELAY_MS;
|
|
20
|
+
for (; ; ) {
|
|
21
|
+
const startedAt = Date.now();
|
|
22
|
+
if (await run() === 0) break;
|
|
23
|
+
if (Date.now() - startedAt >= HEALTHY_RUN_MS) delay = FIRST_DELAY_MS;
|
|
24
|
+
await wait(delay);
|
|
25
|
+
delay = Math.min(delay * 2, MAX_DELAY_MS);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
inspectConfiguredManagedProviders
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-FZ73G2RO.js";
|
|
4
|
+
} from "../chunk-MNTZKFZI.js";
|
|
5
|
+
import "../chunk-5YEF55AX.js";
|
|
7
6
|
import {
|
|
8
7
|
HEARTBEAT_INTERVAL_MS,
|
|
9
8
|
sendHeartbeat
|
|
10
|
-
} from "../chunk-
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
9
|
+
} from "../chunk-RAEPAUNJ.js";
|
|
10
|
+
import "../chunk-MSTHT2M7.js";
|
|
11
|
+
import "../chunk-JVLB5CAJ.js";
|
|
12
|
+
import "../chunk-B2HND22S.js";
|
|
13
|
+
import "../chunk-VF3RTVWY.js";
|
|
14
14
|
import {
|
|
15
15
|
DAEMON_LEASE_RENEW_INTERVAL_MS,
|
|
16
16
|
acquireDaemonLease,
|
|
@@ -23,45 +23,45 @@ import {
|
|
|
23
23
|
replaceDaemonService,
|
|
24
24
|
requestDaemonHandoff,
|
|
25
25
|
stopDaemonRunning
|
|
26
|
-
} from "../chunk-
|
|
26
|
+
} from "../chunk-7JZCADBR.js";
|
|
27
27
|
import {
|
|
28
28
|
detectProviderLiveCapabilities,
|
|
29
29
|
hasSpawnProvider,
|
|
30
30
|
resolveControlPolicy
|
|
31
|
-
} from "../chunk-
|
|
31
|
+
} from "../chunk-3OXHYPZG.js";
|
|
32
32
|
import {
|
|
33
33
|
findLiveProcessBySpawnId,
|
|
34
34
|
ownsLiveProcess
|
|
35
|
-
} from "../chunk-
|
|
35
|
+
} from "../chunk-CBGGUEKE.js";
|
|
36
36
|
import {
|
|
37
37
|
spawnClaude
|
|
38
38
|
} from "../chunk-XHKBHWLX.js";
|
|
39
39
|
import {
|
|
40
40
|
resolveBinary
|
|
41
|
-
} from "../chunk-
|
|
41
|
+
} from "../chunk-L4ZCFMWW.js";
|
|
42
42
|
import {
|
|
43
43
|
getMachineId
|
|
44
|
-
} from "../chunk-
|
|
45
|
-
import "../chunk-
|
|
46
|
-
import {
|
|
47
|
-
readControlMode
|
|
48
|
-
} from "../chunk-3CUDMTL4.js";
|
|
44
|
+
} from "../chunk-JTBDBKHU.js";
|
|
45
|
+
import "../chunk-3YGGEDJK.js";
|
|
49
46
|
import {
|
|
50
47
|
exitOnHelpFlag
|
|
51
|
-
} from "../chunk-
|
|
52
|
-
import "../chunk-
|
|
53
|
-
import "../chunk-BC3VCZ3E.js";
|
|
48
|
+
} from "../chunk-WHDSJ6PD.js";
|
|
49
|
+
import "../chunk-GMJDQDXU.js";
|
|
54
50
|
import "../chunk-DINDL2CF.js";
|
|
55
|
-
import
|
|
51
|
+
import {
|
|
52
|
+
readControlMode
|
|
53
|
+
} from "../chunk-NBDU3R3G.js";
|
|
54
|
+
import "../chunk-BC3VCZ3E.js";
|
|
56
55
|
import {
|
|
57
56
|
EXIT
|
|
58
57
|
} from "../chunk-KZERVKTD.js";
|
|
59
|
-
import "../chunk-
|
|
58
|
+
import "../chunk-ANMHIZZY.js";
|
|
59
|
+
import "../chunk-4LL6LG5X.js";
|
|
60
60
|
import {
|
|
61
61
|
getApiKey,
|
|
62
62
|
getBaseUrl
|
|
63
63
|
} from "../chunk-2UMNXADU.js";
|
|
64
|
-
import "../chunk-
|
|
64
|
+
import "../chunk-QINYXLA5.js";
|
|
65
65
|
|
|
66
66
|
// src/spawn-daemon.ts
|
|
67
67
|
import { execFileSync, spawn } from "child_process";
|
|
@@ -8,17 +8,17 @@ import {
|
|
|
8
8
|
openCodePluginDir,
|
|
9
9
|
openCodePluginFile,
|
|
10
10
|
removeOpenCodeMcpServer
|
|
11
|
-
} from "../chunk-
|
|
11
|
+
} from "../chunk-ZWEKONU6.js";
|
|
12
12
|
import {
|
|
13
13
|
isClaudeMcpSnapshot,
|
|
14
14
|
removeClaudeMcpServers,
|
|
15
15
|
removeGeminiSettings,
|
|
16
16
|
removePusharySettings,
|
|
17
17
|
restoreClaudeMcpServer
|
|
18
|
-
} from "../chunk-
|
|
19
|
-
import "../chunk-
|
|
20
|
-
import "../chunk-
|
|
21
|
-
import "../chunk-
|
|
18
|
+
} from "../chunk-JVLB5CAJ.js";
|
|
19
|
+
import "../chunk-B2HND22S.js";
|
|
20
|
+
import "../chunk-VF3RTVWY.js";
|
|
21
|
+
import "../chunk-L4ZCFMWW.js";
|
|
22
22
|
import {
|
|
23
23
|
claudeJson,
|
|
24
24
|
claudeMcpReceipt,
|
|
@@ -32,14 +32,14 @@ import {
|
|
|
32
32
|
geminiSettings,
|
|
33
33
|
removeCodexHooks,
|
|
34
34
|
removeCodexSettings
|
|
35
|
-
} from "../chunk-
|
|
35
|
+
} from "../chunk-3YGGEDJK.js";
|
|
36
36
|
import {
|
|
37
37
|
exitOnHelpFlag
|
|
38
|
-
} from "../chunk-
|
|
39
|
-
import "../chunk-
|
|
38
|
+
} from "../chunk-WHDSJ6PD.js";
|
|
39
|
+
import "../chunk-GMJDQDXU.js";
|
|
40
40
|
import "../chunk-DINDL2CF.js";
|
|
41
41
|
import "../chunk-KZERVKTD.js";
|
|
42
|
-
import "../chunk-
|
|
42
|
+
import "../chunk-QINYXLA5.js";
|
|
43
43
|
|
|
44
44
|
// bin/pushary-disconnect.ts
|
|
45
45
|
import { readdirSync, readFileSync, rmSync, writeFileSync } from "fs";
|