@pushary/agent-hooks 1.9.6 → 1.9.8
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 +19 -0
- package/README.md +3 -3
- package/data/cursor-plugin/README.md +3 -7
- package/data/vscode-plugin/README.md +1 -1
- package/dist/bin/pushary-bell-hook.js +22 -23
- package/dist/bin/pushary-bell.js +9 -9
- package/dist/bin/pushary-claude.js +27 -28
- package/dist/bin/pushary-clean.js +98 -76
- package/dist/bin/pushary-codex-bridge.js +18 -18
- package/dist/bin/pushary-codex-hook.js +32 -33
- package/dist/bin/pushary-codex.js +13 -13
- package/dist/bin/pushary-connect.js +24 -21
- package/dist/bin/pushary-cowork.js +5 -5
- package/dist/bin/pushary-daemon.js +51 -38
- package/dist/bin/pushary-disconnect.js +187 -52
- package/dist/bin/pushary-doctor.js +68 -56
- package/dist/bin/pushary-elicitation-hook.js +24 -25
- package/dist/bin/pushary-gemini-bridge.js +13 -13
- package/dist/bin/pushary-gemini-hook.js +29 -30
- package/dist/bin/pushary-hook.js +30 -32
- package/dist/bin/pushary-login.js +12 -12
- package/dist/bin/pushary-logout.js +105 -42
- package/dist/bin/pushary-mcp.js +9 -9
- package/dist/bin/pushary-mode.js +28 -31
- package/dist/bin/pushary-notification-hook.js +26 -28
- package/dist/bin/pushary-opencode-hook.js +28 -29
- package/dist/bin/pushary-permission-denied-hook.js +30 -32
- package/dist/bin/pushary-permission-hook.js +29 -31
- package/dist/bin/pushary-post-hook.js +26 -28
- package/dist/bin/pushary-prompt-hook.js +26 -28
- package/dist/bin/pushary-session-end-hook.js +26 -28
- package/dist/bin/pushary-session-start-hook.js +31 -31
- package/dist/bin/pushary-setup.js +98 -106
- package/dist/bin/pushary-stats.js +5 -5
- package/dist/bin/pushary-status.js +34 -18
- package/dist/bin/pushary-stop-hook.js +26 -28
- package/dist/bin/pushary-stopfailure-hook.js +26 -28
- package/dist/bin/pushary-suggestions.js +19 -21
- package/dist/bin/pushary-transcript-register.js +18 -19
- package/dist/bin/pushary-transcripts.js +7 -7
- package/dist/bin/pushary-upgrade.js +67 -31
- package/dist/bin/pushary-wait.js +23 -19
- package/dist/bin/pushary.js +15 -14
- package/dist/{chunk-BSZ7VBVT.js → chunk-2A53H4S6.js} +17 -15
- package/dist/{chunk-D7SOOVHX.js → chunk-2QGYMY7A.js} +83 -3
- package/dist/{chunk-SVTHEMM3.js → chunk-2QTO5YIT.js} +6 -6
- package/dist/{chunk-WN6WYUCV.js → chunk-2VZAALEJ.js} +5 -9
- package/dist/chunk-2WXF3QJR.js +49 -0
- package/dist/{chunk-UKNKYTTY.js → chunk-3I6IVOZV.js} +3 -3
- package/dist/chunk-3Z3A37WD.js +77 -0
- package/dist/{chunk-2QRE6QH2.js → chunk-5QUPKDI5.js} +1 -1
- package/dist/chunk-6TE27XZR.js +69 -0
- package/dist/{chunk-L6USMDTW.js → chunk-7DVNSQWF.js} +59 -15
- package/dist/{chunk-SNJ3BOCP.js → chunk-7PT35RY2.js} +27 -8
- package/dist/{chunk-CBVDW2N6.js → chunk-B64KHETR.js} +3 -3
- package/dist/chunk-BEJRK4DF.js +94 -0
- package/dist/chunk-BXET3ALR.js +46 -0
- package/dist/{chunk-DJ4BB264.js → chunk-CD47ZFFZ.js} +1 -1
- package/dist/{chunk-FBD3QGVJ.js → chunk-CKV3UPMU.js} +2 -2
- package/dist/{chunk-7JTVYR5B.js → chunk-CLOSJ4ES.js} +1 -1
- package/dist/{chunk-DA4FTGTK.js → chunk-DKMD6AWR.js} +4 -4
- package/dist/{chunk-SPXBXN23.js → chunk-DL7XWKYV.js} +7 -5
- package/dist/{chunk-VRT3EEZN.js → chunk-DPGSLWOS.js} +8 -8
- package/dist/{chunk-3BUAEQCY.js → chunk-DUZVXBBU.js} +1 -1
- package/dist/{chunk-6GERGJHF.js → chunk-EUW7JL2K.js} +0 -32
- package/dist/{chunk-75CA37FZ.js → chunk-FQ2GORVG.js} +2 -2
- package/dist/{chunk-WUKUXICK.js → chunk-HRULIYDU.js} +2 -2
- package/dist/{chunk-Q4E56K4X.js → chunk-I5IJRMNV.js} +78 -8
- package/dist/{chunk-MKJ3RTUS.js → chunk-I6MJXLMY.js} +2 -2
- package/dist/{chunk-YPXUD6DW.js → chunk-IAD2RT4L.js} +14 -14
- package/dist/{chunk-LBLCFD5K.js → chunk-IHFDPV7C.js} +2 -2
- package/dist/{chunk-BVCHY4OY.js → chunk-IHO3YQAN.js} +2 -2
- package/dist/{chunk-RDK7FX5F.js → chunk-KF3UZLYI.js} +1 -1
- package/dist/chunk-KFF7G225.js +599 -0
- package/dist/{chunk-TE5M6GGK.js → chunk-KHNFLYJO.js} +204 -28
- package/dist/{chunk-CCDVL63C.js → chunk-KRCR2CRQ.js} +9 -9
- package/dist/{chunk-ZC3TF4LR.js → chunk-LKLVTG3V.js} +18 -9
- package/dist/{chunk-4QKM44N6.js → chunk-LWOO567I.js} +4 -3
- package/dist/{chunk-KK54WQ74.js → chunk-M6BZZFVQ.js} +1 -1
- package/dist/{chunk-RIC6OOJX.js → chunk-MFF3ONG5.js} +21 -1
- package/dist/{chunk-IMGJYFCX.js → chunk-MGRFDGWU.js} +3 -2
- package/dist/{chunk-ZPW4MJOV.js → chunk-MKTJEXZ3.js} +3 -3
- package/dist/{chunk-2I23NFVT.js → chunk-MXHTGVFZ.js} +52 -9
- package/dist/{chunk-5BHROGRB.js → chunk-N4QSPI3B.js} +54 -5
- package/dist/{chunk-DGQTJDSJ.js → chunk-NWDG3MSW.js} +1 -1
- package/dist/chunk-OP7IHC2I.js +24 -0
- package/dist/{chunk-EVFY3VE6.js → chunk-QOLITCIP.js} +1 -1
- package/dist/{chunk-W4Q7NFXU.js → chunk-TCQ43LSG.js} +3 -3
- package/dist/chunk-TCWKTUAE.js +50 -0
- package/dist/{chunk-EZAFBC2C.js → chunk-V5HPPF3E.js} +8 -4
- package/dist/{chunk-Q23MMVTD.js → chunk-WG3K4TCH.js} +1 -1
- package/dist/{chunk-F56SB65Y.js → chunk-WS4H76EP.js} +2 -2
- package/dist/{chunk-HWQNQVY6.js → chunk-WWOHTTVP.js} +2 -2
- package/dist/{chunk-NVGDMTX3.js → chunk-YIG2R3BJ.js} +9 -7
- package/dist/{chunk-HJXZJF6O.js → chunk-ZBHUHJG6.js} +4 -4
- package/dist/{chunk-5AXCOTIT.js → chunk-ZBK6E2OR.js} +1 -1
- package/dist/{chunk-5PMTC2CB.js → chunk-ZN3C6GBG.js} +84 -673
- package/dist/{chunk-GQHZIBAZ.js → chunk-ZSTSEBG7.js} +1 -1
- package/dist/{chunk-PYZC54KA.js → chunk-ZW3XZLJC.js} +61 -17
- package/dist/{global-upgrade-7F5RP45B.js → global-upgrade-I56HNM23.js} +6 -6
- package/dist/{paths-MELXIVBO.js → paths-AGY43CXS.js} +2 -2
- package/dist/reapply-IA5XUKWW.js +57 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +19 -20
- package/dist/{upgrade-lock-AHRBA66K.js → upgrade-lock-B34TAUKV.js} +5 -3
- package/package.json +1 -1
- package/dist/chunk-HT3WMM6Q.js +0 -44
- package/dist/chunk-IR5FRUPQ.js +0 -197
- package/dist/chunk-JUFKJCZG.js +0 -38
- package/dist/chunk-SJN22ADZ.js +0 -86
- package/dist/reapply-NOB2Q6C4.js +0 -35
|
@@ -1,76 +1,112 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
declinedAgentsFile,
|
|
4
|
+
recordDeclinedAgent
|
|
5
|
+
} from "../chunk-BXET3ALR.js";
|
|
6
|
+
import {
|
|
7
|
+
macAppBridgeAvailable
|
|
8
|
+
} from "../chunk-3Z3A37WD.js";
|
|
9
|
+
import {
|
|
10
|
+
isCursorPluginLeftover,
|
|
11
|
+
isPusharyCursorPluginManifest
|
|
12
|
+
} from "../chunk-TCWKTUAE.js";
|
|
13
|
+
import {
|
|
14
|
+
planFxRemoval,
|
|
15
|
+
removeInstructionBlock
|
|
16
|
+
} from "../chunk-ZN3C6GBG.js";
|
|
17
|
+
import "../chunk-HRULIYDU.js";
|
|
2
18
|
import {
|
|
3
19
|
OPENCODE_PLUGIN_SIBLING,
|
|
4
20
|
OPENCODE_PLUGIN_SIBLING_CONTENTS,
|
|
5
21
|
hasForeignPlugins,
|
|
6
22
|
isOpenCodePluginOurs,
|
|
7
23
|
openCodeConfigFile,
|
|
24
|
+
openCodeInstructionsFile,
|
|
8
25
|
openCodePluginDir,
|
|
9
26
|
openCodePluginFile,
|
|
10
27
|
removeOpenCodeMcpServer
|
|
11
|
-
} from "../chunk-
|
|
28
|
+
} from "../chunk-MFF3ONG5.js";
|
|
12
29
|
import {
|
|
13
30
|
compatibleConfigFile,
|
|
31
|
+
compatibleInstructionsFile,
|
|
14
32
|
compatibleMcpFile,
|
|
15
33
|
compatiblePermissionRuleFile,
|
|
16
|
-
removeCompatibleHooks,
|
|
17
|
-
removeCompatibleMcpServer
|
|
18
|
-
} from "../chunk-TE5M6GGK.js";
|
|
19
|
-
import {
|
|
20
34
|
isClaudeMcpSnapshot,
|
|
21
35
|
removeClaudeMcpServers,
|
|
36
|
+
removeCompatibleHooks,
|
|
37
|
+
removeCompatibleMcpServer,
|
|
22
38
|
removePusharySettings,
|
|
23
39
|
removePusharyToolPermissions,
|
|
24
40
|
restoreClaudeMcpServer
|
|
25
|
-
} from "../chunk-
|
|
41
|
+
} from "../chunk-KHNFLYJO.js";
|
|
42
|
+
import "../chunk-YIG2R3BJ.js";
|
|
43
|
+
import "../chunk-DL7XWKYV.js";
|
|
44
|
+
import "../chunk-2QGYMY7A.js";
|
|
26
45
|
import {
|
|
27
46
|
removeGeminiSettings
|
|
28
|
-
} from "../chunk-
|
|
47
|
+
} from "../chunk-3I6IVOZV.js";
|
|
48
|
+
import "../chunk-WG3K4TCH.js";
|
|
29
49
|
import "../chunk-6ICPEJY5.js";
|
|
30
|
-
import "../chunk-
|
|
50
|
+
import "../chunk-KRCR2CRQ.js";
|
|
31
51
|
import "../chunk-N6IOSZOE.js";
|
|
32
|
-
import "../chunk-
|
|
33
|
-
import "../chunk-
|
|
34
|
-
import "../chunk-
|
|
52
|
+
import "../chunk-CD47ZFFZ.js";
|
|
53
|
+
import "../chunk-2VZAALEJ.js";
|
|
54
|
+
import "../chunk-DKMD6AWR.js";
|
|
35
55
|
import "../chunk-POFBE6ZY.js";
|
|
36
56
|
import {
|
|
37
57
|
exitOnHelpFlag
|
|
38
|
-
} from "../chunk-
|
|
39
|
-
import "../chunk-
|
|
40
|
-
import "../chunk-
|
|
41
|
-
import "../chunk-
|
|
42
|
-
import "../chunk-
|
|
58
|
+
} from "../chunk-CKV3UPMU.js";
|
|
59
|
+
import "../chunk-GMXKITVA.js";
|
|
60
|
+
import "../chunk-N4QSPI3B.js";
|
|
61
|
+
import "../chunk-MKTJEXZ3.js";
|
|
62
|
+
import "../chunk-LWOO567I.js";
|
|
63
|
+
import "../chunk-TCQ43LSG.js";
|
|
64
|
+
import "../chunk-DUZVXBBU.js";
|
|
43
65
|
import "../chunk-7QLSKOSU.js";
|
|
44
|
-
import
|
|
45
|
-
|
|
66
|
+
import {
|
|
67
|
+
EXIT
|
|
68
|
+
} from "../chunk-KZERVKTD.js";
|
|
69
|
+
import "../chunk-FQ2GORVG.js";
|
|
46
70
|
import {
|
|
47
71
|
claudeJson,
|
|
48
72
|
claudeMcpReceipt,
|
|
49
73
|
claudeSettings,
|
|
50
74
|
claudeSettingsLocal,
|
|
75
|
+
codexAgentsMd,
|
|
51
76
|
codexConfigToml,
|
|
52
77
|
codexHookPositions,
|
|
53
78
|
codexHooksJson,
|
|
79
|
+
cursorPluginDir,
|
|
80
|
+
cursorPluginManifest,
|
|
54
81
|
cursorUserHooks,
|
|
55
82
|
cursorUserMcp,
|
|
83
|
+
fxAgentsMd,
|
|
84
|
+
fxMcpProfile,
|
|
85
|
+
fxQuestionRuleReceipt,
|
|
86
|
+
fxSettings,
|
|
87
|
+
geminiMd,
|
|
56
88
|
geminiSettings,
|
|
57
89
|
removeCodexHooks,
|
|
58
90
|
removeCodexSettings
|
|
59
|
-
} from "../chunk-
|
|
91
|
+
} from "../chunk-ZBHUHJG6.js";
|
|
60
92
|
import "../chunk-T7E75EKA.js";
|
|
61
|
-
import "../chunk-
|
|
62
|
-
import
|
|
93
|
+
import "../chunk-5QUPKDI5.js";
|
|
94
|
+
import {
|
|
95
|
+
isInvocationOf
|
|
96
|
+
} from "../chunk-7DVNSQWF.js";
|
|
63
97
|
import {
|
|
64
98
|
DISCONNECTABLE_AGENTS,
|
|
65
|
-
|
|
66
|
-
|
|
99
|
+
DISCONNECT_AGENT_IDS,
|
|
100
|
+
hookCompatibleProfileBySource,
|
|
101
|
+
normalizeAgentId
|
|
102
|
+
} from "../chunk-I5IJRMNV.js";
|
|
67
103
|
|
|
68
104
|
// bin/pushary-disconnect.ts
|
|
69
105
|
import { readdirSync, readFileSync, rmSync, writeFileSync } from "fs";
|
|
70
106
|
import { parse as parseTOML, stringify as stringifyTOML } from "smol-toml";
|
|
71
107
|
|
|
72
108
|
// src/disconnect.ts
|
|
73
|
-
import { dirname } from "path";
|
|
109
|
+
import { dirname, join } from "path";
|
|
74
110
|
var isDisconnectableAgent = (value) => DISCONNECTABLE_AGENTS.includes(value);
|
|
75
111
|
var removeCursorHooks = (config) => {
|
|
76
112
|
const hooks = config.hooks;
|
|
@@ -161,9 +197,42 @@ var disconnectRemovals = (agent) => {
|
|
|
161
197
|
}
|
|
162
198
|
];
|
|
163
199
|
};
|
|
200
|
+
var disconnectDirectories = (agent) => {
|
|
201
|
+
if (agent !== "cursor") return [];
|
|
202
|
+
return [{ path: cursorPluginDir(), manifest: cursorPluginManifest(), ownedBy: isPusharyCursorPluginManifest }];
|
|
203
|
+
};
|
|
204
|
+
var disconnectLeftoverDirectories = (agent, list) => {
|
|
205
|
+
if (agent !== "cursor") return [];
|
|
206
|
+
const parent = dirname(cursorPluginDir());
|
|
207
|
+
return list(parent).filter(isCursorPluginLeftover).map((name) => join(parent, name));
|
|
208
|
+
};
|
|
209
|
+
var disconnectInstructionFile = (agent) => {
|
|
210
|
+
switch (agent) {
|
|
211
|
+
case "codex":
|
|
212
|
+
return codexAgentsMd();
|
|
213
|
+
case "gemini":
|
|
214
|
+
return geminiMd();
|
|
215
|
+
case "opencode":
|
|
216
|
+
return openCodeInstructionsFile();
|
|
217
|
+
case "qwen":
|
|
218
|
+
case "codebuddy":
|
|
219
|
+
case "qoder":
|
|
220
|
+
case "droid":
|
|
221
|
+
case "devin": {
|
|
222
|
+
const profile = hookCompatibleProfileBySource(agent);
|
|
223
|
+
return profile ? compatibleInstructionsFile(profile) : null;
|
|
224
|
+
}
|
|
225
|
+
case "claude":
|
|
226
|
+
case "cursor":
|
|
227
|
+
return null;
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
var GATE_STILL_REGISTERED_NOTE = "kept because its gate could not be removed from the hooks file that points into it";
|
|
164
231
|
var disconnectAgent = (agent, io) => {
|
|
165
232
|
const changed = [];
|
|
166
233
|
const untouched = [];
|
|
234
|
+
const unreadable = [];
|
|
235
|
+
const kept = [];
|
|
167
236
|
const claudeReceiptPath = claudeMcpReceipt();
|
|
168
237
|
const rawClaudeReceipt = agent === "claude" ? io.read(claudeReceiptPath) : null;
|
|
169
238
|
let claudeReceipt = null;
|
|
@@ -196,6 +265,7 @@ var disconnectAgent = (agent, io) => {
|
|
|
196
265
|
}
|
|
197
266
|
} catch {
|
|
198
267
|
untouched.push(edit.path);
|
|
268
|
+
unreadable.push(edit.path);
|
|
199
269
|
}
|
|
200
270
|
}
|
|
201
271
|
for (const removal of disconnectRemovals(agent)) {
|
|
@@ -226,40 +296,105 @@ var disconnectAgent = (agent, io) => {
|
|
|
226
296
|
untouched.push(claudeReceiptPath);
|
|
227
297
|
}
|
|
228
298
|
}
|
|
229
|
-
|
|
299
|
+
const removeDirectory = io.removeDirectory;
|
|
300
|
+
if (removeDirectory) {
|
|
301
|
+
const owned = disconnectDirectories(agent).filter((directory) => {
|
|
302
|
+
const manifest = io.read(directory.manifest);
|
|
303
|
+
return manifest !== null && directory.ownedBy(manifest);
|
|
304
|
+
});
|
|
305
|
+
const targets = [...owned.map((directory) => directory.path), ...disconnectLeftoverDirectories(agent, io.list ?? (() => []))];
|
|
306
|
+
for (const path of targets) {
|
|
307
|
+
if (unreadable.length > 0) {
|
|
308
|
+
kept.push(`${path} (${GATE_STILL_REGISTERED_NOTE})`);
|
|
309
|
+
continue;
|
|
310
|
+
}
|
|
311
|
+
try {
|
|
312
|
+
removeDirectory(path);
|
|
313
|
+
changed.push(path);
|
|
314
|
+
} catch {
|
|
315
|
+
untouched.push(path);
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
const instructions = disconnectInstructionFile(agent);
|
|
320
|
+
if (instructions && io.removeInstructionBlock?.(instructions)) changed.push(instructions);
|
|
321
|
+
return { agent, changed, untouched, kept };
|
|
322
|
+
};
|
|
323
|
+
var disconnectFx = (io) => {
|
|
324
|
+
const changed = [];
|
|
325
|
+
const kept = [];
|
|
326
|
+
for (const action of planFxRemoval(fxMcpProfile(), fxSettings(), fxQuestionRuleReceipt())) {
|
|
327
|
+
if (action.kind === "write") {
|
|
328
|
+
io.write(action.path, action.text);
|
|
329
|
+
changed.push(action.path);
|
|
330
|
+
} else if (action.kind === "remove-receipt") {
|
|
331
|
+
io.remove(action.path);
|
|
332
|
+
changed.push(action.path);
|
|
333
|
+
} else if (action.kind === "kept") {
|
|
334
|
+
kept.push(`${action.label}: ${action.detail}`);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
if (io.removeInstructionBlock(fxAgentsMd())) changed.push(fxAgentsMd());
|
|
338
|
+
return { changed, kept };
|
|
230
339
|
};
|
|
231
340
|
|
|
232
341
|
// bin/pushary-disconnect.ts
|
|
233
342
|
exitOnHelpFlag("disconnect");
|
|
343
|
+
var MAC_APP_LEAVES_IT_OFF = (agent) => `The Pushary Mac app will leave ${agent} off until you connect it again, from the app or with pushary setup.`;
|
|
344
|
+
var MAC_APP_MAY_RESTORE_IT = (agent, file) => `Could not write ${file}, so a running Pushary Mac app may connect ${agent} again. Turn it off in the app's Settings too.`;
|
|
234
345
|
var rest = process.argv.slice(2);
|
|
235
|
-
var
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
346
|
+
var typed = rest[0] !== void 0 && isInvocationOf(rest[0], "disconnect") ? rest[1] : rest[0];
|
|
347
|
+
var requested = typed === void 0 ? null : normalizeAgentId(typed, DISCONNECT_AGENT_IDS);
|
|
348
|
+
var printResult = (agent, changed, kept) => {
|
|
349
|
+
if (changed.length === 0) console.log(`${agent} was not connected.`);
|
|
350
|
+
else {
|
|
351
|
+
console.log(`Disconnected ${agent}:`);
|
|
352
|
+
for (const path of changed) console.log(` ${path}`);
|
|
353
|
+
}
|
|
354
|
+
if (kept.length > 0) {
|
|
355
|
+
console.log("Left as it is:");
|
|
356
|
+
for (const line of kept) console.log(` ${line}`);
|
|
357
|
+
}
|
|
358
|
+
};
|
|
359
|
+
if (requested === null) {
|
|
360
|
+
if (typed !== void 0) console.error(`Unknown agent: ${typed}`);
|
|
361
|
+
console.error(`Usage: pushary disconnect <${DISCONNECT_AGENT_IDS.join("|")}>`);
|
|
362
|
+
console.error("Setup ids such as claude_code and gemini_cli work too.");
|
|
363
|
+
process.exit(EXIT.FAILED);
|
|
239
364
|
}
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
365
|
+
if (isDisconnectableAgent(requested)) {
|
|
366
|
+
const decline = recordDeclinedAgent(requested);
|
|
367
|
+
const result = disconnectAgent(requested, {
|
|
368
|
+
read: (path) => {
|
|
369
|
+
try {
|
|
370
|
+
return readFileSync(path, "utf-8");
|
|
371
|
+
} catch {
|
|
372
|
+
return null;
|
|
373
|
+
}
|
|
374
|
+
},
|
|
375
|
+
write: (path, contents) => writeFileSync(path, contents, "utf-8"),
|
|
376
|
+
parseToml: (raw) => parseTOML(raw),
|
|
377
|
+
stringifyToml: (config) => stringifyTOML(config),
|
|
378
|
+
remove: (path) => rmSync(path, { force: true }),
|
|
379
|
+
list: (dir) => {
|
|
380
|
+
try {
|
|
381
|
+
return readdirSync(dir);
|
|
382
|
+
} catch {
|
|
383
|
+
return [];
|
|
384
|
+
}
|
|
385
|
+
},
|
|
386
|
+
removeDirectory: (path) => rmSync(path, { recursive: true, force: true }),
|
|
387
|
+
removeInstructionBlock
|
|
388
|
+
});
|
|
389
|
+
printResult(requested, result.changed, result.kept);
|
|
390
|
+
if (decline !== "unchanged" && macAppBridgeAvailable()) {
|
|
391
|
+
console.log(decline === "changed" ? MAC_APP_LEAVES_IT_OFF(requested) : MAC_APP_MAY_RESTORE_IT(requested, declinedAgentsFile()));
|
|
258
392
|
}
|
|
259
|
-
});
|
|
260
|
-
if (result.changed.length === 0) {
|
|
261
|
-
console.log(`${requested} was not connected.`);
|
|
262
393
|
} else {
|
|
263
|
-
|
|
264
|
-
|
|
394
|
+
const result = disconnectFx({
|
|
395
|
+
write: (path, contents) => writeFileSync(path, contents, "utf-8"),
|
|
396
|
+
remove: (path) => rmSync(path, { force: true }),
|
|
397
|
+
removeInstructionBlock
|
|
398
|
+
});
|
|
399
|
+
printResult(requested, result.changed, result.kept);
|
|
265
400
|
}
|
|
@@ -6,58 +6,62 @@ import {
|
|
|
6
6
|
readServiceExecPath,
|
|
7
7
|
versionManagerOf
|
|
8
8
|
} from "../chunk-GU3EJCVV.js";
|
|
9
|
+
import {
|
|
10
|
+
CODEX_HOOK_REMEDY
|
|
11
|
+
} from "../chunk-6TE27XZR.js";
|
|
9
12
|
import {
|
|
10
13
|
writeStdoutFully
|
|
11
14
|
} from "../chunk-EO23EUOK.js";
|
|
12
15
|
import {
|
|
13
16
|
assessCodexHookTrust,
|
|
14
17
|
readCodexTrustForPusharyHooks
|
|
15
|
-
} from "../chunk-
|
|
18
|
+
} from "../chunk-MGRFDGWU.js";
|
|
16
19
|
import {
|
|
17
20
|
readMachineReadiness,
|
|
18
21
|
readManagedControlEvidence
|
|
19
|
-
} from "../chunk-
|
|
22
|
+
} from "../chunk-2QTO5YIT.js";
|
|
20
23
|
import {
|
|
21
|
-
FX_PROFILE_REFUSALS,
|
|
22
|
-
FX_PUSHARY_TOOLS_RULE,
|
|
23
|
-
FX_QUESTION_TOOL,
|
|
24
24
|
HERMES_PIP_PACKAGE,
|
|
25
25
|
HERMES_PLUGIN_NAME,
|
|
26
26
|
agentProbes,
|
|
27
27
|
detectAgent,
|
|
28
28
|
detectAllAgents,
|
|
29
|
-
hasInstructionBlock,
|
|
30
29
|
hermesWiredByPushary,
|
|
31
|
-
inspectFxInstallation,
|
|
32
30
|
isDetected,
|
|
33
31
|
isPluginRegistered,
|
|
34
32
|
readHermesStatus,
|
|
35
33
|
resolveHermesPython,
|
|
36
|
-
retryAgentCommand,
|
|
37
34
|
shortenHome,
|
|
38
35
|
vscodeSettingsTargets
|
|
39
|
-
} from "../chunk-
|
|
40
|
-
import
|
|
36
|
+
} from "../chunk-KFF7G225.js";
|
|
37
|
+
import {
|
|
38
|
+
FX_PROFILE_REFUSALS,
|
|
39
|
+
FX_PUSHARY_TOOLS_RULE,
|
|
40
|
+
FX_QUESTION_TOOL,
|
|
41
|
+
hasInstructionBlock,
|
|
42
|
+
inspectFxInstallation,
|
|
43
|
+
retryAgentCommand
|
|
44
|
+
} from "../chunk-ZN3C6GBG.js";
|
|
45
|
+
import "../chunk-HRULIYDU.js";
|
|
41
46
|
import {
|
|
42
47
|
OPENCODE_PLUGIN_PLACEHOLDER,
|
|
43
48
|
openCodePluginDir,
|
|
44
49
|
openCodePluginFile,
|
|
45
50
|
openCodeWired
|
|
46
|
-
} from "../chunk-
|
|
51
|
+
} from "../chunk-MFF3ONG5.js";
|
|
47
52
|
import {
|
|
48
53
|
compatibleConfigFile,
|
|
49
54
|
compatibleInstructionsFile,
|
|
50
55
|
compatibleMcpFile,
|
|
51
56
|
hasCompatibleHooks,
|
|
52
57
|
missingCompatibleHookEvents
|
|
53
|
-
} from "../chunk-
|
|
54
|
-
import "../chunk-IR5FRUPQ.js";
|
|
58
|
+
} from "../chunk-KHNFLYJO.js";
|
|
55
59
|
import {
|
|
56
60
|
detectProviderLiveCapabilities,
|
|
57
61
|
expectedLaunchCapabilities,
|
|
58
62
|
hasSpawnProvider,
|
|
59
63
|
resolveControlPolicy
|
|
60
|
-
} from "../chunk-
|
|
64
|
+
} from "../chunk-I6MJXLMY.js";
|
|
61
65
|
import "../chunk-RIVNNBEK.js";
|
|
62
66
|
import {
|
|
63
67
|
AUTO_UPDATE_DISABLE_ENV,
|
|
@@ -66,16 +70,19 @@ import {
|
|
|
66
70
|
describeAutoUpdateCheck,
|
|
67
71
|
readAutoUpdateState,
|
|
68
72
|
takeAutoUpdateAnnouncement
|
|
69
|
-
} from "../chunk-
|
|
73
|
+
} from "../chunk-7PT35RY2.js";
|
|
70
74
|
import {
|
|
71
75
|
readLedgerSummary
|
|
72
|
-
} from "../chunk-
|
|
76
|
+
} from "../chunk-ZSTSEBG7.js";
|
|
73
77
|
import {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
78
|
+
daemonHasRemoteProof,
|
|
79
|
+
daemonServiceManagerAvailable,
|
|
80
|
+
describeDaemonLoginBlock,
|
|
81
|
+
hasDaemonServiceDefinition,
|
|
82
|
+
readDaemonNeedsLogin,
|
|
83
|
+
readDaemonStatus,
|
|
84
|
+
readInstalledDaemonService
|
|
85
|
+
} from "../chunk-LKLVTG3V.js";
|
|
79
86
|
import {
|
|
80
87
|
claudeOtherHolders,
|
|
81
88
|
claudeUnprovenHolds,
|
|
@@ -86,34 +93,29 @@ import {
|
|
|
86
93
|
cursorMcpAuthorization,
|
|
87
94
|
cursorOtherHolders,
|
|
88
95
|
cursorWired,
|
|
96
|
+
describeBridgeResolution,
|
|
89
97
|
describeHoldSentence,
|
|
90
98
|
describeOtherHolder,
|
|
91
99
|
geminiOtherHolders,
|
|
92
100
|
geminiWired,
|
|
93
101
|
holdsLong,
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
describeDaemonLoginBlock,
|
|
100
|
-
hasDaemonServiceDefinition,
|
|
101
|
-
readDaemonNeedsLogin,
|
|
102
|
-
readDaemonStatus,
|
|
103
|
-
readInstalledDaemonService
|
|
104
|
-
} from "../chunk-ZC3TF4LR.js";
|
|
102
|
+
isBridgeLocator,
|
|
103
|
+
liveBridgeProbe,
|
|
104
|
+
pusharyHookExecutable,
|
|
105
|
+
resolveBridgeStub
|
|
106
|
+
} from "../chunk-2QGYMY7A.js";
|
|
105
107
|
import {
|
|
106
108
|
GEMINI_HOOK_BINARY,
|
|
107
109
|
hasGeminiHooks,
|
|
108
110
|
missingGeminiHookEvents
|
|
109
|
-
} from "../chunk-
|
|
111
|
+
} from "../chunk-3I6IVOZV.js";
|
|
110
112
|
import "../chunk-XHKBHWLX.js";
|
|
111
113
|
import "../chunk-6ICPEJY5.js";
|
|
112
|
-
import "../chunk-
|
|
114
|
+
import "../chunk-KRCR2CRQ.js";
|
|
113
115
|
import "../chunk-N6IOSZOE.js";
|
|
114
|
-
import "../chunk-
|
|
115
|
-
import "../chunk-
|
|
116
|
-
import "../chunk-
|
|
116
|
+
import "../chunk-CD47ZFFZ.js";
|
|
117
|
+
import "../chunk-2VZAALEJ.js";
|
|
118
|
+
import "../chunk-DKMD6AWR.js";
|
|
117
119
|
import "../chunk-POFBE6ZY.js";
|
|
118
120
|
import {
|
|
119
121
|
describeReach,
|
|
@@ -122,15 +124,21 @@ import {
|
|
|
122
124
|
reachVerdict,
|
|
123
125
|
roundTripEvidence,
|
|
124
126
|
verifyRoundTrip
|
|
125
|
-
} from "../chunk-
|
|
127
|
+
} from "../chunk-IAD2RT4L.js";
|
|
126
128
|
import "../chunk-3EGEA4KH.js";
|
|
127
129
|
import "../chunk-QCGNGEGE.js";
|
|
130
|
+
import {
|
|
131
|
+
SIGNED_OUT_ON_MAC_MESSAGE,
|
|
132
|
+
activeKeyVerdictOf,
|
|
133
|
+
describeSignedOutKey,
|
|
134
|
+
readSignedOutDiagnosis
|
|
135
|
+
} from "../chunk-2WXF3QJR.js";
|
|
128
136
|
import {
|
|
129
137
|
createIo
|
|
130
138
|
} from "../chunk-U4TMAANR.js";
|
|
131
139
|
import {
|
|
132
140
|
exitOnHelpFlag
|
|
133
|
-
} from "../chunk-
|
|
141
|
+
} from "../chunk-CKV3UPMU.js";
|
|
134
142
|
import {
|
|
135
143
|
parseFlags
|
|
136
144
|
} from "../chunk-GMXKITVA.js";
|
|
@@ -138,26 +146,26 @@ import {
|
|
|
138
146
|
keyPrefix,
|
|
139
147
|
readControlMode,
|
|
140
148
|
readKeySource
|
|
141
|
-
} from "../chunk-
|
|
149
|
+
} from "../chunk-N4QSPI3B.js";
|
|
142
150
|
import {
|
|
143
151
|
callMcpTool,
|
|
144
152
|
sendMcpRequest
|
|
145
|
-
} from "../chunk-
|
|
153
|
+
} from "../chunk-MKTJEXZ3.js";
|
|
146
154
|
import {
|
|
147
155
|
checkApiKey,
|
|
148
156
|
describeKeyCheck
|
|
149
|
-
} from "../chunk-
|
|
150
|
-
import "../chunk-
|
|
157
|
+
} from "../chunk-LWOO567I.js";
|
|
158
|
+
import "../chunk-TCQ43LSG.js";
|
|
151
159
|
import {
|
|
152
160
|
getMachineId
|
|
153
|
-
} from "../chunk-
|
|
161
|
+
} from "../chunk-DUZVXBBU.js";
|
|
154
162
|
import {
|
|
155
163
|
UsageError
|
|
156
164
|
} from "../chunk-7QLSKOSU.js";
|
|
157
165
|
import {
|
|
158
166
|
EXIT
|
|
159
167
|
} from "../chunk-KZERVKTD.js";
|
|
160
|
-
import "../chunk-
|
|
168
|
+
import "../chunk-FQ2GORVG.js";
|
|
161
169
|
import {
|
|
162
170
|
CODEX_HOOK_EVENTS,
|
|
163
171
|
CODEX_REQUIRED_APPROVAL_EVENTS,
|
|
@@ -188,14 +196,14 @@ import {
|
|
|
188
196
|
readGlobalCliInstall,
|
|
189
197
|
resolvePathBinary,
|
|
190
198
|
vscodePluginDir
|
|
191
|
-
} from "../chunk-
|
|
199
|
+
} from "../chunk-ZBHUHJG6.js";
|
|
192
200
|
import "../chunk-T7E75EKA.js";
|
|
193
201
|
import {
|
|
194
202
|
getBaseUrl
|
|
195
|
-
} from "../chunk-
|
|
203
|
+
} from "../chunk-5QUPKDI5.js";
|
|
196
204
|
import {
|
|
197
205
|
NPX_LATEST_COMMAND
|
|
198
|
-
} from "../chunk-
|
|
206
|
+
} from "../chunk-7DVNSQWF.js";
|
|
199
207
|
import {
|
|
200
208
|
AGENTS,
|
|
201
209
|
CURSOR_GATE_EVENTS,
|
|
@@ -211,7 +219,7 @@ import {
|
|
|
211
219
|
hookCompatibleProfile,
|
|
212
220
|
isHookActivationReport,
|
|
213
221
|
isNewerVersion
|
|
214
|
-
} from "../chunk-
|
|
222
|
+
} from "../chunk-I5IJRMNV.js";
|
|
215
223
|
|
|
216
224
|
// bin/pushary-doctor.ts
|
|
217
225
|
import { existsSync, readFileSync, writeFileSync } from "fs";
|
|
@@ -633,10 +641,10 @@ var reportCodexOwnTrust = (assessment) => {
|
|
|
633
641
|
}
|
|
634
642
|
};
|
|
635
643
|
var describeStoredCodexTrust = (untrusted, disabled, missing, asynchronous) => {
|
|
636
|
-
if (asynchronous.length > 0) return `asynchronous (${asynchronous.join(", ")}) \u2014
|
|
637
|
-
if (missing.length > 0) return `missing (${missing.join(", ")}) \u2014
|
|
638
|
-
if (disabled.length > 0) return `disabled (${disabled.join(", ")}) \u2014
|
|
639
|
-
if (untrusted.length > 0) return `untrusted (${untrusted.join(", ")}) \u2014
|
|
644
|
+
if (asynchronous.length > 0) return `asynchronous (${asynchronous.join(", ")}) \u2014 ${CODEX_HOOK_REMEDY.asynchronous}`;
|
|
645
|
+
if (missing.length > 0) return `missing (${missing.join(", ")}) \u2014 ${CODEX_HOOK_REMEDY.missing}`;
|
|
646
|
+
if (disabled.length > 0) return `disabled (${disabled.join(", ")}) \u2014 ${CODEX_HOOK_REMEDY.disabled}`;
|
|
647
|
+
if (untrusted.length > 0) return `untrusted (${untrusted.join(", ")}) \u2014 ${CODEX_HOOK_REMEDY.untrusted}`;
|
|
640
648
|
return "all events trusted";
|
|
641
649
|
};
|
|
642
650
|
var skipped = (label, why) => {
|
|
@@ -688,8 +696,12 @@ var main = async () => {
|
|
|
688
696
|
);
|
|
689
697
|
}
|
|
690
698
|
let keyVerdict = null;
|
|
691
|
-
if (apiKey)
|
|
692
|
-
|
|
699
|
+
if (apiKey) keyVerdict = await checkApiKey(apiKey);
|
|
700
|
+
const signedOut = readSignedOutDiagnosis(apiKey ?? null, activeKeyVerdictOf(keyVerdict));
|
|
701
|
+
if (signedOut.kind === "signed_out_on_mac") {
|
|
702
|
+
check(false, "Key still signed in", SIGNED_OUT_ON_MAC_MESSAGE);
|
|
703
|
+
for (const line of describeSignedOutKey(signedOut)) console.log(` ${dim(line)}`);
|
|
704
|
+
} else if (keyVerdict) {
|
|
693
705
|
switch (keyVerdict.kind) {
|
|
694
706
|
case "ok":
|
|
695
707
|
check(
|
|
@@ -1345,7 +1357,7 @@ var main = async () => {
|
|
|
1345
1357
|
check(
|
|
1346
1358
|
verdict.kind === "yours",
|
|
1347
1359
|
"Phone reachable",
|
|
1348
|
-
verdict.kind === "yours" ? describeReach(channels) : verdict.kind === "nobody" ? "
|
|
1360
|
+
verdict.kind === "yours" ? describeReach(channels) : verdict.kind === "nobody" ? "no phone paired, run pushary pair or get the app at https://pushary.com/download" : `${describeReach(channels)}; run pushary pair to pair your own`,
|
|
1349
1361
|
"reachability"
|
|
1350
1362
|
);
|
|
1351
1363
|
}
|
|
@@ -1,53 +1,52 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
readHookInput
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-WWOHTTVP.js";
|
|
5
5
|
import {
|
|
6
6
|
announceSubscriptionRequired,
|
|
7
7
|
isDeferAnswer
|
|
8
8
|
} from "../chunk-5OP5MQI7.js";
|
|
9
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-DPGSLWOS.js";
|
|
10
10
|
import "../chunk-SGZJ5LYH.js";
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
14
|
-
import "../chunk-
|
|
15
|
-
import "../chunk-
|
|
16
|
-
import "../chunk-
|
|
17
|
-
import "../chunk-
|
|
18
|
-
import "../chunk-
|
|
19
|
-
import "../chunk-
|
|
20
|
-
import "../chunk-KK54WQ74.js";
|
|
11
|
+
import "../chunk-YIG2R3BJ.js";
|
|
12
|
+
import "../chunk-DL7XWKYV.js";
|
|
13
|
+
import "../chunk-LKLVTG3V.js";
|
|
14
|
+
import "../chunk-2QGYMY7A.js";
|
|
15
|
+
import "../chunk-3I6IVOZV.js";
|
|
16
|
+
import "../chunk-WG3K4TCH.js";
|
|
17
|
+
import "../chunk-ZBK6E2OR.js";
|
|
18
|
+
import "../chunk-CLOSJ4ES.js";
|
|
19
|
+
import "../chunk-M6BZZFVQ.js";
|
|
21
20
|
import "../chunk-XHKBHWLX.js";
|
|
22
21
|
import "../chunk-6ICPEJY5.js";
|
|
23
22
|
import "../chunk-N6IOSZOE.js";
|
|
24
|
-
import "../chunk-
|
|
23
|
+
import "../chunk-CD47ZFFZ.js";
|
|
25
24
|
import {
|
|
26
25
|
askUser,
|
|
27
26
|
isDecisionStopped,
|
|
28
27
|
waitForQuestion
|
|
29
|
-
} from "../chunk-
|
|
30
|
-
import "../chunk-
|
|
28
|
+
} from "../chunk-2VZAALEJ.js";
|
|
29
|
+
import "../chunk-DKMD6AWR.js";
|
|
31
30
|
import "../chunk-POFBE6ZY.js";
|
|
32
31
|
import "../chunk-GMXKITVA.js";
|
|
33
|
-
import "../chunk-
|
|
32
|
+
import "../chunk-N4QSPI3B.js";
|
|
34
33
|
import {
|
|
35
34
|
SubscriptionRequiredError
|
|
36
|
-
} from "../chunk-
|
|
37
|
-
import "../chunk-
|
|
38
|
-
import "../chunk-
|
|
35
|
+
} from "../chunk-MKTJEXZ3.js";
|
|
36
|
+
import "../chunk-LWOO567I.js";
|
|
37
|
+
import "../chunk-TCQ43LSG.js";
|
|
39
38
|
import {
|
|
40
39
|
getMachineId
|
|
41
|
-
} from "../chunk-
|
|
40
|
+
} from "../chunk-DUZVXBBU.js";
|
|
42
41
|
import "../chunk-7QLSKOSU.js";
|
|
43
42
|
import "../chunk-KZERVKTD.js";
|
|
44
|
-
import "../chunk-
|
|
45
|
-
import "../chunk-
|
|
43
|
+
import "../chunk-FQ2GORVG.js";
|
|
44
|
+
import "../chunk-ZBHUHJG6.js";
|
|
46
45
|
import "../chunk-T7E75EKA.js";
|
|
47
46
|
import {
|
|
48
47
|
getApiKey
|
|
49
|
-
} from "../chunk-
|
|
50
|
-
import "../chunk-
|
|
48
|
+
} from "../chunk-5QUPKDI5.js";
|
|
49
|
+
import "../chunk-7DVNSQWF.js";
|
|
51
50
|
import {
|
|
52
51
|
ELICITATION_ANSWERABLE_MODE,
|
|
53
52
|
effectiveWaitSeconds,
|
|
@@ -58,7 +57,7 @@ import {
|
|
|
58
57
|
planElicitationAsk,
|
|
59
58
|
readElicitationFields,
|
|
60
59
|
renderElicitationOutput
|
|
61
|
-
} from "../chunk-
|
|
60
|
+
} from "../chunk-I5IJRMNV.js";
|
|
62
61
|
|
|
63
62
|
// bin/pushary-elicitation-hook.ts
|
|
64
63
|
import { basename } from "path";
|