@pushary/agent-hooks 1.9.7 → 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 +11 -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 +101 -79
- 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 -39
- package/dist/bin/pushary-disconnect.js +189 -54
- package/dist/bin/pushary-doctor.js +67 -58
- 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 -32
- package/dist/bin/pushary-setup.js +91 -101
- 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 +55 -25
- package/dist/bin/pushary-wait.js +23 -19
- package/dist/bin/pushary.js +15 -14
- package/dist/{chunk-R3YW55MY.js → chunk-2A53H4S6.js} +17 -15
- package/dist/{chunk-4YO4T5FV.js → chunk-2QGYMY7A.js} +83 -3
- package/dist/{chunk-MBK7N46B.js → chunk-2QTO5YIT.js} +6 -6
- package/dist/{chunk-D6S5EKXA.js → chunk-2VZAALEJ.js} +5 -9
- package/dist/chunk-2WXF3QJR.js +49 -0
- package/dist/{chunk-JCWZ23MJ.js → chunk-3I6IVOZV.js} +3 -3
- package/dist/chunk-3Z3A37WD.js +77 -0
- package/dist/{chunk-Z6HPS67T.js → chunk-5QUPKDI5.js} +1 -1
- package/dist/{chunk-JWKBDSPF.js → chunk-6TE27XZR.js} +2 -2
- package/dist/{chunk-STQRUH3S.js → chunk-7DVNSQWF.js} +59 -15
- package/dist/{chunk-QTO6HEZD.js → chunk-7PT35RY2.js} +2 -2
- package/dist/{chunk-7OIWWZAD.js → chunk-B64KHETR.js} +3 -3
- package/dist/chunk-BEJRK4DF.js +94 -0
- package/dist/chunk-BXET3ALR.js +46 -0
- package/dist/{chunk-6DJTDHBI.js → chunk-CD47ZFFZ.js} +1 -1
- package/dist/{chunk-UFVGSEWH.js → chunk-CKV3UPMU.js} +2 -2
- package/dist/{chunk-4FK6RZVJ.js → chunk-CLOSJ4ES.js} +1 -1
- package/dist/{chunk-AVNKVF7N.js → chunk-DKMD6AWR.js} +4 -4
- package/dist/{chunk-SBLPHUEB.js → chunk-DL7XWKYV.js} +7 -5
- package/dist/{chunk-BTQGAXZ3.js → chunk-DPGSLWOS.js} +8 -8
- package/dist/{chunk-KYO45G5L.js → chunk-DUZVXBBU.js} +1 -1
- package/dist/{chunk-EB4XGVBG.js → chunk-EUW7JL2K.js} +0 -32
- package/dist/{chunk-4D2AYNSE.js → chunk-FQ2GORVG.js} +2 -2
- package/dist/{chunk-W2KI5KPD.js → chunk-HRULIYDU.js} +2 -2
- package/dist/{chunk-QR6VE5ME.js → chunk-I5IJRMNV.js} +58 -8
- package/dist/{chunk-T7Y5EADL.js → chunk-I6MJXLMY.js} +2 -2
- package/dist/{chunk-N4EUSDKX.js → chunk-IAD2RT4L.js} +14 -14
- package/dist/{chunk-H37L7TT3.js → chunk-IHFDPV7C.js} +2 -2
- package/dist/{chunk-3GNUXXDZ.js → chunk-IHO3YQAN.js} +2 -2
- package/dist/{chunk-JWQZSYCK.js → chunk-KF3UZLYI.js} +1 -1
- package/dist/chunk-KFF7G225.js +599 -0
- package/dist/{chunk-MZPXVH4A.js → chunk-KHNFLYJO.js} +204 -28
- package/dist/{chunk-QFEM7R6T.js → chunk-KRCR2CRQ.js} +9 -9
- package/dist/{chunk-VXRXFU6Q.js → chunk-LKLVTG3V.js} +14 -7
- package/dist/{chunk-KFKL3FHS.js → chunk-LWOO567I.js} +4 -3
- package/dist/{chunk-HPRZJKRO.js → chunk-M6BZZFVQ.js} +1 -1
- package/dist/{chunk-X5NXPCIC.js → chunk-MFF3ONG5.js} +16 -2
- package/dist/{chunk-H7MMU64M.js → chunk-MGRFDGWU.js} +2 -2
- package/dist/{chunk-L76HTPU6.js → chunk-MKTJEXZ3.js} +3 -3
- package/dist/{chunk-NIBFSARF.js → chunk-MXHTGVFZ.js} +33 -9
- package/dist/{chunk-ADSQDYYG.js → chunk-N4QSPI3B.js} +54 -5
- package/dist/{chunk-AQ55ZSSS.js → chunk-NWDG3MSW.js} +1 -1
- package/dist/chunk-OP7IHC2I.js +24 -0
- package/dist/{chunk-KT5E2RLS.js → chunk-QOLITCIP.js} +1 -1
- package/dist/{chunk-JXISQ7DT.js → chunk-TCQ43LSG.js} +3 -3
- package/dist/chunk-TCWKTUAE.js +50 -0
- package/dist/{chunk-RQGODFQN.js → chunk-V5HPPF3E.js} +1 -1
- package/dist/{chunk-7264S5HZ.js → chunk-WG3K4TCH.js} +1 -1
- package/dist/{chunk-GKI6LFAV.js → chunk-WS4H76EP.js} +2 -2
- package/dist/{chunk-XWAYAO3V.js → chunk-WWOHTTVP.js} +2 -2
- package/dist/{chunk-SD3272LS.js → chunk-YIG2R3BJ.js} +9 -7
- package/dist/{chunk-ZUTU43FT.js → chunk-ZBHUHJG6.js} +4 -4
- package/dist/{chunk-AUUXS44H.js → chunk-ZBK6E2OR.js} +1 -1
- package/dist/{chunk-QQ4HBXZC.js → chunk-ZN3C6GBG.js} +84 -673
- package/dist/{chunk-CBQACHKY.js → chunk-ZSTSEBG7.js} +1 -1
- package/dist/{chunk-3PVDOCFI.js → chunk-ZW3XZLJC.js} +5 -5
- package/dist/{global-upgrade-E2HUEB4B.js → global-upgrade-I56HNM23.js} +6 -6
- package/dist/{paths-QVTEGNZV.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-JCIDZMHF.js → upgrade-lock-B34TAUKV.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-ANEAA37E.js +0 -197
- package/dist/chunk-MNWRUGMH.js +0 -86
- package/dist/chunk-RQSOEB4S.js +0 -44
- package/dist/reapply-5QVKM6LA.js +0 -38
|
@@ -1,76 +1,112 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
} from "../chunk-
|
|
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";
|
|
9
18
|
import {
|
|
10
19
|
OPENCODE_PLUGIN_SIBLING,
|
|
11
20
|
OPENCODE_PLUGIN_SIBLING_CONTENTS,
|
|
12
21
|
hasForeignPlugins,
|
|
13
22
|
isOpenCodePluginOurs,
|
|
14
23
|
openCodeConfigFile,
|
|
24
|
+
openCodeInstructionsFile,
|
|
15
25
|
openCodePluginDir,
|
|
16
26
|
openCodePluginFile,
|
|
17
27
|
removeOpenCodeMcpServer
|
|
18
|
-
} from "../chunk-
|
|
28
|
+
} from "../chunk-MFF3ONG5.js";
|
|
19
29
|
import {
|
|
30
|
+
compatibleConfigFile,
|
|
31
|
+
compatibleInstructionsFile,
|
|
32
|
+
compatibleMcpFile,
|
|
33
|
+
compatiblePermissionRuleFile,
|
|
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
|
}
|
|
@@ -8,59 +8,60 @@ import {
|
|
|
8
8
|
} from "../chunk-GU3EJCVV.js";
|
|
9
9
|
import {
|
|
10
10
|
CODEX_HOOK_REMEDY
|
|
11
|
-
} from "../chunk-
|
|
11
|
+
} from "../chunk-6TE27XZR.js";
|
|
12
12
|
import {
|
|
13
13
|
writeStdoutFully
|
|
14
14
|
} from "../chunk-EO23EUOK.js";
|
|
15
15
|
import {
|
|
16
16
|
assessCodexHookTrust,
|
|
17
17
|
readCodexTrustForPusharyHooks
|
|
18
|
-
} from "../chunk-
|
|
18
|
+
} from "../chunk-MGRFDGWU.js";
|
|
19
19
|
import {
|
|
20
20
|
readMachineReadiness,
|
|
21
21
|
readManagedControlEvidence
|
|
22
|
-
} from "../chunk-
|
|
22
|
+
} from "../chunk-2QTO5YIT.js";
|
|
23
23
|
import {
|
|
24
|
-
FX_PROFILE_REFUSALS,
|
|
25
|
-
FX_PUSHARY_TOOLS_RULE,
|
|
26
|
-
FX_QUESTION_TOOL,
|
|
27
24
|
HERMES_PIP_PACKAGE,
|
|
28
25
|
HERMES_PLUGIN_NAME,
|
|
29
26
|
agentProbes,
|
|
30
27
|
detectAgent,
|
|
31
28
|
detectAllAgents,
|
|
32
|
-
hasInstructionBlock,
|
|
33
29
|
hermesWiredByPushary,
|
|
34
|
-
inspectFxInstallation,
|
|
35
30
|
isDetected,
|
|
36
31
|
isPluginRegistered,
|
|
37
32
|
readHermesStatus,
|
|
38
33
|
resolveHermesPython,
|
|
39
|
-
retryAgentCommand,
|
|
40
34
|
shortenHome,
|
|
41
35
|
vscodeSettingsTargets
|
|
42
|
-
} from "../chunk-
|
|
43
|
-
import "../chunk-W2KI5KPD.js";
|
|
36
|
+
} from "../chunk-KFF7G225.js";
|
|
44
37
|
import {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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";
|
|
51
46
|
import {
|
|
52
47
|
OPENCODE_PLUGIN_PLACEHOLDER,
|
|
53
48
|
openCodePluginDir,
|
|
54
49
|
openCodePluginFile,
|
|
55
50
|
openCodeWired
|
|
56
|
-
} from "../chunk-
|
|
57
|
-
import
|
|
51
|
+
} from "../chunk-MFF3ONG5.js";
|
|
52
|
+
import {
|
|
53
|
+
compatibleConfigFile,
|
|
54
|
+
compatibleInstructionsFile,
|
|
55
|
+
compatibleMcpFile,
|
|
56
|
+
hasCompatibleHooks,
|
|
57
|
+
missingCompatibleHookEvents
|
|
58
|
+
} from "../chunk-KHNFLYJO.js";
|
|
58
59
|
import {
|
|
59
60
|
detectProviderLiveCapabilities,
|
|
60
61
|
expectedLaunchCapabilities,
|
|
61
62
|
hasSpawnProvider,
|
|
62
63
|
resolveControlPolicy
|
|
63
|
-
} from "../chunk-
|
|
64
|
+
} from "../chunk-I6MJXLMY.js";
|
|
64
65
|
import "../chunk-RIVNNBEK.js";
|
|
65
66
|
import {
|
|
66
67
|
AUTO_UPDATE_DISABLE_ENV,
|
|
@@ -69,16 +70,19 @@ import {
|
|
|
69
70
|
describeAutoUpdateCheck,
|
|
70
71
|
readAutoUpdateState,
|
|
71
72
|
takeAutoUpdateAnnouncement
|
|
72
|
-
} from "../chunk-
|
|
73
|
+
} from "../chunk-7PT35RY2.js";
|
|
73
74
|
import {
|
|
74
75
|
readLedgerSummary
|
|
75
|
-
} from "../chunk-
|
|
76
|
+
} from "../chunk-ZSTSEBG7.js";
|
|
76
77
|
import {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
78
|
+
daemonHasRemoteProof,
|
|
79
|
+
daemonServiceManagerAvailable,
|
|
80
|
+
describeDaemonLoginBlock,
|
|
81
|
+
hasDaemonServiceDefinition,
|
|
82
|
+
readDaemonNeedsLogin,
|
|
83
|
+
readDaemonStatus,
|
|
84
|
+
readInstalledDaemonService
|
|
85
|
+
} from "../chunk-LKLVTG3V.js";
|
|
82
86
|
import {
|
|
83
87
|
claudeOtherHolders,
|
|
84
88
|
claudeUnprovenHolds,
|
|
@@ -89,34 +93,29 @@ import {
|
|
|
89
93
|
cursorMcpAuthorization,
|
|
90
94
|
cursorOtherHolders,
|
|
91
95
|
cursorWired,
|
|
96
|
+
describeBridgeResolution,
|
|
92
97
|
describeHoldSentence,
|
|
93
98
|
describeOtherHolder,
|
|
94
99
|
geminiOtherHolders,
|
|
95
100
|
geminiWired,
|
|
96
101
|
holdsLong,
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
describeDaemonLoginBlock,
|
|
103
|
-
hasDaemonServiceDefinition,
|
|
104
|
-
readDaemonNeedsLogin,
|
|
105
|
-
readDaemonStatus,
|
|
106
|
-
readInstalledDaemonService
|
|
107
|
-
} from "../chunk-VXRXFU6Q.js";
|
|
102
|
+
isBridgeLocator,
|
|
103
|
+
liveBridgeProbe,
|
|
104
|
+
pusharyHookExecutable,
|
|
105
|
+
resolveBridgeStub
|
|
106
|
+
} from "../chunk-2QGYMY7A.js";
|
|
108
107
|
import {
|
|
109
108
|
GEMINI_HOOK_BINARY,
|
|
110
109
|
hasGeminiHooks,
|
|
111
110
|
missingGeminiHookEvents
|
|
112
|
-
} from "../chunk-
|
|
111
|
+
} from "../chunk-3I6IVOZV.js";
|
|
113
112
|
import "../chunk-XHKBHWLX.js";
|
|
114
113
|
import "../chunk-6ICPEJY5.js";
|
|
115
|
-
import "../chunk-
|
|
114
|
+
import "../chunk-KRCR2CRQ.js";
|
|
116
115
|
import "../chunk-N6IOSZOE.js";
|
|
117
|
-
import "../chunk-
|
|
118
|
-
import "../chunk-
|
|
119
|
-
import "../chunk-
|
|
116
|
+
import "../chunk-CD47ZFFZ.js";
|
|
117
|
+
import "../chunk-2VZAALEJ.js";
|
|
118
|
+
import "../chunk-DKMD6AWR.js";
|
|
120
119
|
import "../chunk-POFBE6ZY.js";
|
|
121
120
|
import {
|
|
122
121
|
describeReach,
|
|
@@ -125,15 +124,21 @@ import {
|
|
|
125
124
|
reachVerdict,
|
|
126
125
|
roundTripEvidence,
|
|
127
126
|
verifyRoundTrip
|
|
128
|
-
} from "../chunk-
|
|
127
|
+
} from "../chunk-IAD2RT4L.js";
|
|
129
128
|
import "../chunk-3EGEA4KH.js";
|
|
130
129
|
import "../chunk-QCGNGEGE.js";
|
|
130
|
+
import {
|
|
131
|
+
SIGNED_OUT_ON_MAC_MESSAGE,
|
|
132
|
+
activeKeyVerdictOf,
|
|
133
|
+
describeSignedOutKey,
|
|
134
|
+
readSignedOutDiagnosis
|
|
135
|
+
} from "../chunk-2WXF3QJR.js";
|
|
131
136
|
import {
|
|
132
137
|
createIo
|
|
133
138
|
} from "../chunk-U4TMAANR.js";
|
|
134
139
|
import {
|
|
135
140
|
exitOnHelpFlag
|
|
136
|
-
} from "../chunk-
|
|
141
|
+
} from "../chunk-CKV3UPMU.js";
|
|
137
142
|
import {
|
|
138
143
|
parseFlags
|
|
139
144
|
} from "../chunk-GMXKITVA.js";
|
|
@@ -141,26 +146,26 @@ import {
|
|
|
141
146
|
keyPrefix,
|
|
142
147
|
readControlMode,
|
|
143
148
|
readKeySource
|
|
144
|
-
} from "../chunk-
|
|
149
|
+
} from "../chunk-N4QSPI3B.js";
|
|
145
150
|
import {
|
|
146
151
|
callMcpTool,
|
|
147
152
|
sendMcpRequest
|
|
148
|
-
} from "../chunk-
|
|
153
|
+
} from "../chunk-MKTJEXZ3.js";
|
|
149
154
|
import {
|
|
150
155
|
checkApiKey,
|
|
151
156
|
describeKeyCheck
|
|
152
|
-
} from "../chunk-
|
|
153
|
-
import "../chunk-
|
|
157
|
+
} from "../chunk-LWOO567I.js";
|
|
158
|
+
import "../chunk-TCQ43LSG.js";
|
|
154
159
|
import {
|
|
155
160
|
getMachineId
|
|
156
|
-
} from "../chunk-
|
|
161
|
+
} from "../chunk-DUZVXBBU.js";
|
|
157
162
|
import {
|
|
158
163
|
UsageError
|
|
159
164
|
} from "../chunk-7QLSKOSU.js";
|
|
160
165
|
import {
|
|
161
166
|
EXIT
|
|
162
167
|
} from "../chunk-KZERVKTD.js";
|
|
163
|
-
import "../chunk-
|
|
168
|
+
import "../chunk-FQ2GORVG.js";
|
|
164
169
|
import {
|
|
165
170
|
CODEX_HOOK_EVENTS,
|
|
166
171
|
CODEX_REQUIRED_APPROVAL_EVENTS,
|
|
@@ -191,14 +196,14 @@ import {
|
|
|
191
196
|
readGlobalCliInstall,
|
|
192
197
|
resolvePathBinary,
|
|
193
198
|
vscodePluginDir
|
|
194
|
-
} from "../chunk-
|
|
199
|
+
} from "../chunk-ZBHUHJG6.js";
|
|
195
200
|
import "../chunk-T7E75EKA.js";
|
|
196
201
|
import {
|
|
197
202
|
getBaseUrl
|
|
198
|
-
} from "../chunk-
|
|
203
|
+
} from "../chunk-5QUPKDI5.js";
|
|
199
204
|
import {
|
|
200
205
|
NPX_LATEST_COMMAND
|
|
201
|
-
} from "../chunk-
|
|
206
|
+
} from "../chunk-7DVNSQWF.js";
|
|
202
207
|
import {
|
|
203
208
|
AGENTS,
|
|
204
209
|
CURSOR_GATE_EVENTS,
|
|
@@ -214,7 +219,7 @@ import {
|
|
|
214
219
|
hookCompatibleProfile,
|
|
215
220
|
isHookActivationReport,
|
|
216
221
|
isNewerVersion
|
|
217
|
-
} from "../chunk-
|
|
222
|
+
} from "../chunk-I5IJRMNV.js";
|
|
218
223
|
|
|
219
224
|
// bin/pushary-doctor.ts
|
|
220
225
|
import { existsSync, readFileSync, writeFileSync } from "fs";
|
|
@@ -691,8 +696,12 @@ var main = async () => {
|
|
|
691
696
|
);
|
|
692
697
|
}
|
|
693
698
|
let keyVerdict = null;
|
|
694
|
-
if (apiKey)
|
|
695
|
-
|
|
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) {
|
|
696
705
|
switch (keyVerdict.kind) {
|
|
697
706
|
case "ok":
|
|
698
707
|
check(
|
|
@@ -1348,7 +1357,7 @@ var main = async () => {
|
|
|
1348
1357
|
check(
|
|
1349
1358
|
verdict.kind === "yours",
|
|
1350
1359
|
"Phone reachable",
|
|
1351
|
-
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`,
|
|
1352
1361
|
"reachability"
|
|
1353
1362
|
);
|
|
1354
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-HPRZJKRO.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";
|