@pushary/agent-hooks 1.9.7 → 1.9.9
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 +18 -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 -24
- package/dist/bin/pushary-bell.js +13 -13
- package/dist/bin/pushary-claude.js +28 -30
- package/dist/bin/pushary-clean.js +113 -94
- package/dist/bin/pushary-codex-bridge.js +20 -20
- package/dist/bin/pushary-codex-hook.js +36 -38
- package/dist/bin/pushary-codex.js +13 -13
- package/dist/bin/pushary-connect.js +48 -22
- package/dist/bin/pushary-cowork.js +5 -5
- package/dist/bin/pushary-daemon.js +50 -40
- package/dist/bin/pushary-disconnect.js +188 -56
- package/dist/bin/pushary-doctor.js +105 -85
- package/dist/bin/pushary-elicitation-hook.js +25 -27
- package/dist/bin/pushary-gemini-bridge.js +13 -13
- package/dist/bin/pushary-gemini-hook.js +31 -33
- package/dist/bin/pushary-hook.js +36 -39
- 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 +29 -32
- package/dist/bin/pushary-opencode-hook.js +30 -32
- package/dist/bin/pushary-permission-denied-hook.js +30 -33
- package/dist/bin/pushary-permission-hook.js +33 -36
- package/dist/bin/pushary-post-hook.js +30 -33
- package/dist/bin/pushary-prompt-hook.js +29 -32
- package/dist/bin/pushary-session-end-hook.js +29 -32
- package/dist/bin/pushary-session-start-hook.js +33 -36
- package/dist/bin/pushary-setup.js +168 -160
- package/dist/bin/pushary-stats.js +5 -5
- package/dist/bin/pushary-status.js +65 -19
- package/dist/bin/pushary-stop-hook.js +29 -32
- package/dist/bin/pushary-stopfailure-hook.js +29 -32
- package/dist/bin/pushary-suggestions.js +19 -21
- package/dist/bin/pushary-transcript-register.js +18 -20
- package/dist/bin/pushary-transcripts.js +7 -7
- package/dist/bin/pushary-upgrade.js +50 -26
- package/dist/bin/pushary-wait.js +23 -19
- package/dist/bin/pushary.js +15 -14
- package/dist/{chunk-4FK6RZVJ.js → chunk-462EQA6K.js} +1 -1
- package/dist/{chunk-STQRUH3S.js → chunk-5DCDQ5VW.js} +59 -15
- package/dist/{chunk-JXISQ7DT.js → chunk-5N5L6DNN.js} +3 -3
- package/dist/{chunk-QR6VE5ME.js → chunk-5RGA636G.js} +79 -17
- package/dist/{chunk-L76HTPU6.js → chunk-6AYSKVLL.js} +3 -3
- package/dist/{chunk-NIBFSARF.js → chunk-6EBGOHDJ.js} +33 -13
- package/dist/{chunk-QQ4HBXZC.js → chunk-6W5M3MSE.js} +84 -673
- package/dist/{chunk-R3YW55MY.js → chunk-AI7RMFVV.js} +29 -26
- package/dist/{chunk-AUUXS44H.js → chunk-APP43AW7.js} +1 -1
- package/dist/{chunk-RQGODFQN.js → chunk-AZOKPWVI.js} +1 -1
- package/dist/{chunk-3GNUXXDZ.js → chunk-B5NMSP3V.js} +2 -2
- package/dist/{chunk-4D2AYNSE.js → chunk-BNSKVIAW.js} +2 -2
- package/dist/chunk-BYLKCZ2G.js +367 -0
- package/dist/{chunk-X5NXPCIC.js → chunk-BZLHTMT6.js} +89 -7
- package/dist/{chunk-BTQGAXZ3.js → chunk-COQ64C4F.js} +10 -10
- package/dist/{chunk-N4EUSDKX.js → chunk-DCCSULXK.js} +14 -14
- package/dist/{chunk-JWKBDSPF.js → chunk-DP3WX7FW.js} +2 -2
- package/dist/chunk-E5HOHIUV.js +52 -0
- package/dist/{chunk-GU3EJCVV.js → chunk-EA5NWDK7.js} +4 -0
- package/dist/chunk-EIAEUG7G.js +46 -0
- package/dist/{chunk-EB4XGVBG.js → chunk-EUW7JL2K.js} +0 -32
- package/dist/{chunk-T7Y5EADL.js → chunk-F7R3SZ4Q.js} +2 -2
- package/dist/{chunk-H37L7TT3.js → chunk-G7RIDXAT.js} +2 -2
- package/dist/{chunk-W2KI5KPD.js → chunk-H5T27W7M.js} +2 -2
- package/dist/chunk-HBWYMRR5.js +94 -0
- package/dist/{chunk-CBQACHKY.js → chunk-IIVZZMSO.js} +1 -1
- package/dist/{chunk-Z6HPS67T.js → chunk-IRHABAQT.js} +1 -1
- package/dist/{chunk-QTO6HEZD.js → chunk-K545B734.js} +2 -2
- package/dist/{chunk-KYO45G5L.js → chunk-KOWFRUIT.js} +1 -1
- package/dist/{chunk-QFEM7R6T.js → chunk-KQFTBQ66.js} +11 -11
- package/dist/chunk-LENBKYRB.js +50 -0
- package/dist/{chunk-JCWZ23MJ.js → chunk-M3STIAGU.js} +3 -3
- package/dist/{chunk-6DJTDHBI.js → chunk-MD4SVNT6.js} +1 -1
- package/dist/{chunk-7264S5HZ.js → chunk-MLGIVVSG.js} +1 -1
- package/dist/{chunk-H7MMU64M.js → chunk-NGKUXZID.js} +2 -2
- package/dist/{chunk-JWQZSYCK.js → chunk-NUVGDBZC.js} +1 -1
- package/dist/{chunk-AQ55ZSSS.js → chunk-OAYWO5NP.js} +1 -1
- package/dist/chunk-Q6C6ILUS.js +49 -0
- package/dist/{chunk-MBK7N46B.js → chunk-QIOIO7VN.js} +6 -6
- package/dist/{chunk-KFKL3FHS.js → chunk-QRXPWW3M.js} +4 -3
- package/dist/{chunk-7OIWWZAD.js → chunk-QTIUJZRX.js} +3 -3
- package/dist/{chunk-XWAYAO3V.js → chunk-R5RIVOPL.js} +2 -2
- package/dist/{chunk-ADSQDYYG.js → chunk-REU2VQPH.js} +54 -5
- package/dist/{chunk-GKI6LFAV.js → chunk-RQ32ADJP.js} +2 -2
- package/dist/{chunk-VXRXFU6Q.js → chunk-SZ4Q6ZVS.js} +14 -7
- package/dist/{chunk-KT5E2RLS.js → chunk-T6ZN4TEF.js} +1 -1
- package/dist/{chunk-UFVGSEWH.js → chunk-TO3PS646.js} +2 -2
- package/dist/chunk-UAP5DS6P.js +599 -0
- package/dist/{chunk-MZPXVH4A.js → chunk-UF6RBP5V.js} +204 -28
- package/dist/{chunk-AVNKVF7N.js → chunk-UPIZSCYD.js} +4 -4
- package/dist/{chunk-3PVDOCFI.js → chunk-VHPFNLRS.js} +5 -5
- package/dist/{chunk-HPRZJKRO.js → chunk-VIIHC42X.js} +1 -1
- package/dist/{chunk-D6S5EKXA.js → chunk-WRPYCIV2.js} +8 -12
- package/dist/{chunk-ZUTU43FT.js → chunk-Z23ZBYDW.js} +6 -4
- package/dist/{chunk-SBLPHUEB.js → chunk-ZGADIZDS.js} +8 -6
- package/dist/{global-upgrade-E2HUEB4B.js → global-upgrade-H272QOGD.js} +6 -6
- package/dist/{paths-QVTEGNZV.js → paths-HMVOTFUN.js} +2 -2
- package/dist/reapply-Q5NHDTVU.js +55 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +19 -20
- package/dist/{upgrade-lock-JCIDZMHF.js → upgrade-lock-L3GHFIRW.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-4YO4T5FV.js +0 -149
- package/dist/chunk-ANEAA37E.js +0 -197
- package/dist/chunk-MNWRUGMH.js +0 -86
- package/dist/chunk-RQSOEB4S.js +0 -44
- package/dist/chunk-SD3272LS.js +0 -143
- package/dist/reapply-5QVKM6LA.js +0 -38
|
@@ -1,76 +1,109 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
declinedAgentsFile,
|
|
4
|
+
recordDeclinedAgent
|
|
5
|
+
} from "../chunk-EIAEUG7G.js";
|
|
6
|
+
import {
|
|
7
|
+
isCursorPluginLeftover,
|
|
8
|
+
isPusharyCursorPluginManifest
|
|
9
|
+
} from "../chunk-LENBKYRB.js";
|
|
10
|
+
import {
|
|
11
|
+
planFxRemoval,
|
|
12
|
+
removeInstructionBlock
|
|
13
|
+
} from "../chunk-6W5M3MSE.js";
|
|
14
|
+
import "../chunk-H5T27W7M.js";
|
|
9
15
|
import {
|
|
10
16
|
OPENCODE_PLUGIN_SIBLING,
|
|
11
17
|
OPENCODE_PLUGIN_SIBLING_CONTENTS,
|
|
12
18
|
hasForeignPlugins,
|
|
13
19
|
isOpenCodePluginOurs,
|
|
20
|
+
macAppBridgeAvailable,
|
|
14
21
|
openCodeConfigFile,
|
|
22
|
+
openCodeInstructionsFile,
|
|
15
23
|
openCodePluginDir,
|
|
16
24
|
openCodePluginFile,
|
|
17
25
|
removeOpenCodeMcpServer
|
|
18
|
-
} from "../chunk-
|
|
26
|
+
} from "../chunk-BZLHTMT6.js";
|
|
19
27
|
import {
|
|
28
|
+
compatibleConfigFile,
|
|
29
|
+
compatibleInstructionsFile,
|
|
30
|
+
compatibleMcpFile,
|
|
31
|
+
compatiblePermissionRuleFile,
|
|
20
32
|
isClaudeMcpSnapshot,
|
|
21
33
|
removeClaudeMcpServers,
|
|
34
|
+
removeCompatibleHooks,
|
|
35
|
+
removeCompatibleMcpServer,
|
|
22
36
|
removePusharySettings,
|
|
23
37
|
removePusharyToolPermissions,
|
|
24
38
|
restoreClaudeMcpServer
|
|
25
|
-
} from "../chunk-
|
|
39
|
+
} from "../chunk-UF6RBP5V.js";
|
|
40
|
+
import {
|
|
41
|
+
exitOnHelpFlag
|
|
42
|
+
} from "../chunk-TO3PS646.js";
|
|
43
|
+
import "../chunk-BYLKCZ2G.js";
|
|
26
44
|
import {
|
|
27
45
|
removeGeminiSettings
|
|
28
|
-
} from "../chunk-
|
|
46
|
+
} from "../chunk-M3STIAGU.js";
|
|
47
|
+
import "../chunk-ZGADIZDS.js";
|
|
48
|
+
import "../chunk-MLGIVVSG.js";
|
|
49
|
+
import "../chunk-GMXKITVA.js";
|
|
29
50
|
import "../chunk-6ICPEJY5.js";
|
|
30
|
-
import "../chunk-
|
|
51
|
+
import "../chunk-REU2VQPH.js";
|
|
52
|
+
import "../chunk-KQFTBQ66.js";
|
|
31
53
|
import "../chunk-N6IOSZOE.js";
|
|
32
|
-
import "../chunk-
|
|
33
|
-
import "../chunk-
|
|
34
|
-
import "../chunk-
|
|
54
|
+
import "../chunk-MD4SVNT6.js";
|
|
55
|
+
import "../chunk-WRPYCIV2.js";
|
|
56
|
+
import "../chunk-6AYSKVLL.js";
|
|
57
|
+
import "../chunk-QRXPWW3M.js";
|
|
58
|
+
import "../chunk-UPIZSCYD.js";
|
|
35
59
|
import "../chunk-POFBE6ZY.js";
|
|
36
|
-
import
|
|
37
|
-
|
|
38
|
-
} from "../chunk-UFVGSEWH.js";
|
|
39
|
-
import "../chunk-L76HTPU6.js";
|
|
40
|
-
import "../chunk-KFKL3FHS.js";
|
|
41
|
-
import "../chunk-JXISQ7DT.js";
|
|
42
|
-
import "../chunk-KYO45G5L.js";
|
|
60
|
+
import "../chunk-5N5L6DNN.js";
|
|
61
|
+
import "../chunk-KOWFRUIT.js";
|
|
43
62
|
import "../chunk-7QLSKOSU.js";
|
|
44
|
-
import
|
|
45
|
-
|
|
63
|
+
import {
|
|
64
|
+
EXIT
|
|
65
|
+
} from "../chunk-KZERVKTD.js";
|
|
66
|
+
import "../chunk-BNSKVIAW.js";
|
|
46
67
|
import {
|
|
47
68
|
claudeJson,
|
|
48
69
|
claudeMcpReceipt,
|
|
49
70
|
claudeSettings,
|
|
50
71
|
claudeSettingsLocal,
|
|
72
|
+
codexAgentsMd,
|
|
51
73
|
codexConfigToml,
|
|
52
74
|
codexHookPositions,
|
|
53
75
|
codexHooksJson,
|
|
76
|
+
cursorPluginDir,
|
|
77
|
+
cursorPluginManifest,
|
|
54
78
|
cursorUserHooks,
|
|
55
79
|
cursorUserMcp,
|
|
80
|
+
fxAgentsMd,
|
|
81
|
+
fxMcpProfile,
|
|
82
|
+
fxQuestionRuleReceipt,
|
|
83
|
+
fxSettings,
|
|
84
|
+
geminiMd,
|
|
56
85
|
geminiSettings,
|
|
57
86
|
removeCodexHooks,
|
|
58
87
|
removeCodexSettings
|
|
59
|
-
} from "../chunk-
|
|
88
|
+
} from "../chunk-Z23ZBYDW.js";
|
|
60
89
|
import "../chunk-T7E75EKA.js";
|
|
61
|
-
import "../chunk-
|
|
62
|
-
import
|
|
90
|
+
import "../chunk-IRHABAQT.js";
|
|
91
|
+
import {
|
|
92
|
+
isInvocationOf
|
|
93
|
+
} from "../chunk-5DCDQ5VW.js";
|
|
63
94
|
import {
|
|
64
95
|
DISCONNECTABLE_AGENTS,
|
|
65
|
-
|
|
66
|
-
|
|
96
|
+
DISCONNECT_AGENT_IDS,
|
|
97
|
+
hookCompatibleProfileBySource,
|
|
98
|
+
normalizeAgentId
|
|
99
|
+
} from "../chunk-5RGA636G.js";
|
|
67
100
|
|
|
68
101
|
// bin/pushary-disconnect.ts
|
|
69
102
|
import { readdirSync, readFileSync, rmSync, writeFileSync } from "fs";
|
|
70
103
|
import { parse as parseTOML, stringify as stringifyTOML } from "smol-toml";
|
|
71
104
|
|
|
72
105
|
// src/disconnect.ts
|
|
73
|
-
import { dirname } from "path";
|
|
106
|
+
import { dirname, join } from "path";
|
|
74
107
|
var isDisconnectableAgent = (value) => DISCONNECTABLE_AGENTS.includes(value);
|
|
75
108
|
var removeCursorHooks = (config) => {
|
|
76
109
|
const hooks = config.hooks;
|
|
@@ -161,9 +194,42 @@ var disconnectRemovals = (agent) => {
|
|
|
161
194
|
}
|
|
162
195
|
];
|
|
163
196
|
};
|
|
197
|
+
var disconnectDirectories = (agent) => {
|
|
198
|
+
if (agent !== "cursor") return [];
|
|
199
|
+
return [{ path: cursorPluginDir(), manifest: cursorPluginManifest(), ownedBy: isPusharyCursorPluginManifest }];
|
|
200
|
+
};
|
|
201
|
+
var disconnectLeftoverDirectories = (agent, list) => {
|
|
202
|
+
if (agent !== "cursor") return [];
|
|
203
|
+
const parent = dirname(cursorPluginDir());
|
|
204
|
+
return list(parent).filter(isCursorPluginLeftover).map((name) => join(parent, name));
|
|
205
|
+
};
|
|
206
|
+
var disconnectInstructionFile = (agent) => {
|
|
207
|
+
switch (agent) {
|
|
208
|
+
case "codex":
|
|
209
|
+
return codexAgentsMd();
|
|
210
|
+
case "gemini":
|
|
211
|
+
return geminiMd();
|
|
212
|
+
case "opencode":
|
|
213
|
+
return openCodeInstructionsFile();
|
|
214
|
+
case "qwen":
|
|
215
|
+
case "codebuddy":
|
|
216
|
+
case "qoder":
|
|
217
|
+
case "droid":
|
|
218
|
+
case "devin": {
|
|
219
|
+
const profile = hookCompatibleProfileBySource(agent);
|
|
220
|
+
return profile ? compatibleInstructionsFile(profile) : null;
|
|
221
|
+
}
|
|
222
|
+
case "claude":
|
|
223
|
+
case "cursor":
|
|
224
|
+
return null;
|
|
225
|
+
}
|
|
226
|
+
};
|
|
227
|
+
var GATE_STILL_REGISTERED_NOTE = "kept because its gate could not be removed from the hooks file that points into it";
|
|
164
228
|
var disconnectAgent = (agent, io) => {
|
|
165
229
|
const changed = [];
|
|
166
230
|
const untouched = [];
|
|
231
|
+
const unreadable = [];
|
|
232
|
+
const kept = [];
|
|
167
233
|
const claudeReceiptPath = claudeMcpReceipt();
|
|
168
234
|
const rawClaudeReceipt = agent === "claude" ? io.read(claudeReceiptPath) : null;
|
|
169
235
|
let claudeReceipt = null;
|
|
@@ -196,6 +262,7 @@ var disconnectAgent = (agent, io) => {
|
|
|
196
262
|
}
|
|
197
263
|
} catch {
|
|
198
264
|
untouched.push(edit.path);
|
|
265
|
+
unreadable.push(edit.path);
|
|
199
266
|
}
|
|
200
267
|
}
|
|
201
268
|
for (const removal of disconnectRemovals(agent)) {
|
|
@@ -226,40 +293,105 @@ var disconnectAgent = (agent, io) => {
|
|
|
226
293
|
untouched.push(claudeReceiptPath);
|
|
227
294
|
}
|
|
228
295
|
}
|
|
229
|
-
|
|
296
|
+
const removeDirectory = io.removeDirectory;
|
|
297
|
+
if (removeDirectory) {
|
|
298
|
+
const owned = disconnectDirectories(agent).filter((directory) => {
|
|
299
|
+
const manifest = io.read(directory.manifest);
|
|
300
|
+
return manifest !== null && directory.ownedBy(manifest);
|
|
301
|
+
});
|
|
302
|
+
const targets = [...owned.map((directory) => directory.path), ...disconnectLeftoverDirectories(agent, io.list ?? (() => []))];
|
|
303
|
+
for (const path of targets) {
|
|
304
|
+
if (unreadable.length > 0) {
|
|
305
|
+
kept.push(`${path} (${GATE_STILL_REGISTERED_NOTE})`);
|
|
306
|
+
continue;
|
|
307
|
+
}
|
|
308
|
+
try {
|
|
309
|
+
removeDirectory(path);
|
|
310
|
+
changed.push(path);
|
|
311
|
+
} catch {
|
|
312
|
+
untouched.push(path);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
const instructions = disconnectInstructionFile(agent);
|
|
317
|
+
if (instructions && io.removeInstructionBlock?.(instructions)) changed.push(instructions);
|
|
318
|
+
return { agent, changed, untouched, kept };
|
|
319
|
+
};
|
|
320
|
+
var disconnectFx = (io) => {
|
|
321
|
+
const changed = [];
|
|
322
|
+
const kept = [];
|
|
323
|
+
for (const action of planFxRemoval(fxMcpProfile(), fxSettings(), fxQuestionRuleReceipt())) {
|
|
324
|
+
if (action.kind === "write") {
|
|
325
|
+
io.write(action.path, action.text);
|
|
326
|
+
changed.push(action.path);
|
|
327
|
+
} else if (action.kind === "remove-receipt") {
|
|
328
|
+
io.remove(action.path);
|
|
329
|
+
changed.push(action.path);
|
|
330
|
+
} else if (action.kind === "kept") {
|
|
331
|
+
kept.push(`${action.label}: ${action.detail}`);
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
if (io.removeInstructionBlock(fxAgentsMd())) changed.push(fxAgentsMd());
|
|
335
|
+
return { changed, kept };
|
|
230
336
|
};
|
|
231
337
|
|
|
232
338
|
// bin/pushary-disconnect.ts
|
|
233
339
|
exitOnHelpFlag("disconnect");
|
|
340
|
+
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.`;
|
|
341
|
+
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
342
|
var rest = process.argv.slice(2);
|
|
235
|
-
var
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
343
|
+
var typed = rest[0] !== void 0 && isInvocationOf(rest[0], "disconnect") ? rest[1] : rest[0];
|
|
344
|
+
var requested = typed === void 0 ? null : normalizeAgentId(typed, DISCONNECT_AGENT_IDS);
|
|
345
|
+
var printResult = (agent, changed, kept) => {
|
|
346
|
+
if (changed.length === 0) console.log(`${agent} was not connected.`);
|
|
347
|
+
else {
|
|
348
|
+
console.log(`Disconnected ${agent}:`);
|
|
349
|
+
for (const path of changed) console.log(` ${path}`);
|
|
350
|
+
}
|
|
351
|
+
if (kept.length > 0) {
|
|
352
|
+
console.log("Left as it is:");
|
|
353
|
+
for (const line of kept) console.log(` ${line}`);
|
|
354
|
+
}
|
|
355
|
+
};
|
|
356
|
+
if (requested === null) {
|
|
357
|
+
if (typed !== void 0) console.error(`Unknown agent: ${typed}`);
|
|
358
|
+
console.error(`Usage: pushary disconnect <${DISCONNECT_AGENT_IDS.join("|")}>`);
|
|
359
|
+
console.error("Setup ids such as claude_code and gemini_cli work too.");
|
|
360
|
+
process.exit(EXIT.FAILED);
|
|
239
361
|
}
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
362
|
+
if (isDisconnectableAgent(requested)) {
|
|
363
|
+
const decline = recordDeclinedAgent(requested);
|
|
364
|
+
const result = disconnectAgent(requested, {
|
|
365
|
+
read: (path) => {
|
|
366
|
+
try {
|
|
367
|
+
return readFileSync(path, "utf-8");
|
|
368
|
+
} catch {
|
|
369
|
+
return null;
|
|
370
|
+
}
|
|
371
|
+
},
|
|
372
|
+
write: (path, contents) => writeFileSync(path, contents, "utf-8"),
|
|
373
|
+
parseToml: (raw) => parseTOML(raw),
|
|
374
|
+
stringifyToml: (config) => stringifyTOML(config),
|
|
375
|
+
remove: (path) => rmSync(path, { force: true }),
|
|
376
|
+
list: (dir) => {
|
|
377
|
+
try {
|
|
378
|
+
return readdirSync(dir);
|
|
379
|
+
} catch {
|
|
380
|
+
return [];
|
|
381
|
+
}
|
|
382
|
+
},
|
|
383
|
+
removeDirectory: (path) => rmSync(path, { recursive: true, force: true }),
|
|
384
|
+
removeInstructionBlock
|
|
385
|
+
});
|
|
386
|
+
printResult(requested, result.changed, result.kept);
|
|
387
|
+
if (decline !== "unchanged" && macAppBridgeAvailable()) {
|
|
388
|
+
console.log(decline === "changed" ? MAC_APP_LEAVES_IT_OFF(requested) : MAC_APP_MAY_RESTORE_IT(requested, declinedAgentsFile()));
|
|
258
389
|
}
|
|
259
|
-
});
|
|
260
|
-
if (result.changed.length === 0) {
|
|
261
|
-
console.log(`${requested} was not connected.`);
|
|
262
390
|
} else {
|
|
263
|
-
|
|
264
|
-
|
|
391
|
+
const result = disconnectFx({
|
|
392
|
+
write: (path, contents) => writeFileSync(path, contents, "utf-8"),
|
|
393
|
+
remove: (path) => rmSync(path, { force: true }),
|
|
394
|
+
removeInstructionBlock
|
|
395
|
+
});
|
|
396
|
+
printResult(requested, result.changed, result.kept);
|
|
265
397
|
}
|
|
@@ -3,64 +3,53 @@ import {
|
|
|
3
3
|
describeWaitLadder
|
|
4
4
|
} from "../chunk-CVWG2N3Y.js";
|
|
5
5
|
import {
|
|
6
|
+
CURSOR_GATE_SCRIPT,
|
|
6
7
|
readServiceExecPath,
|
|
7
8
|
versionManagerOf
|
|
8
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-EA5NWDK7.js";
|
|
9
10
|
import {
|
|
10
11
|
CODEX_HOOK_REMEDY
|
|
11
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-DP3WX7FW.js";
|
|
12
13
|
import {
|
|
13
14
|
writeStdoutFully
|
|
14
15
|
} from "../chunk-EO23EUOK.js";
|
|
15
16
|
import {
|
|
16
17
|
assessCodexHookTrust,
|
|
17
18
|
readCodexTrustForPusharyHooks
|
|
18
|
-
} from "../chunk-
|
|
19
|
+
} from "../chunk-NGKUXZID.js";
|
|
19
20
|
import {
|
|
20
21
|
readMachineReadiness,
|
|
21
22
|
readManagedControlEvidence
|
|
22
|
-
} from "../chunk-
|
|
23
|
+
} from "../chunk-QIOIO7VN.js";
|
|
23
24
|
import {
|
|
24
|
-
FX_PROFILE_REFUSALS,
|
|
25
|
-
FX_PUSHARY_TOOLS_RULE,
|
|
26
|
-
FX_QUESTION_TOOL,
|
|
27
25
|
HERMES_PIP_PACKAGE,
|
|
28
26
|
HERMES_PLUGIN_NAME,
|
|
29
27
|
agentProbes,
|
|
30
28
|
detectAgent,
|
|
31
29
|
detectAllAgents,
|
|
32
|
-
hasInstructionBlock,
|
|
33
30
|
hermesWiredByPushary,
|
|
34
|
-
inspectFxInstallation,
|
|
35
31
|
isDetected,
|
|
36
32
|
isPluginRegistered,
|
|
37
33
|
readHermesStatus,
|
|
38
34
|
resolveHermesPython,
|
|
39
|
-
retryAgentCommand,
|
|
40
35
|
shortenHome,
|
|
41
36
|
vscodeSettingsTargets
|
|
42
|
-
} from "../chunk-
|
|
43
|
-
import "../chunk-W2KI5KPD.js";
|
|
44
|
-
import {
|
|
45
|
-
compatibleConfigFile,
|
|
46
|
-
compatibleInstructionsFile,
|
|
47
|
-
compatibleMcpFile,
|
|
48
|
-
hasCompatibleHooks,
|
|
49
|
-
missingCompatibleHookEvents
|
|
50
|
-
} from "../chunk-MZPXVH4A.js";
|
|
37
|
+
} from "../chunk-UAP5DS6P.js";
|
|
51
38
|
import {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
39
|
+
FX_PROFILE_REFUSALS,
|
|
40
|
+
FX_PUSHARY_TOOLS_RULE,
|
|
41
|
+
FX_QUESTION_TOOL,
|
|
42
|
+
hasInstructionBlock,
|
|
43
|
+
inspectFxInstallation,
|
|
44
|
+
retryAgentCommand
|
|
45
|
+
} from "../chunk-6W5M3MSE.js";
|
|
46
|
+
import "../chunk-H5T27W7M.js";
|
|
58
47
|
import {
|
|
59
48
|
detectProviderLiveCapabilities,
|
|
60
49
|
expectedLaunchCapabilities,
|
|
61
50
|
hasSpawnProvider,
|
|
62
51
|
resolveControlPolicy
|
|
63
|
-
} from "../chunk-
|
|
52
|
+
} from "../chunk-F7R3SZ4Q.js";
|
|
64
53
|
import "../chunk-RIVNNBEK.js";
|
|
65
54
|
import {
|
|
66
55
|
AUTO_UPDATE_DISABLE_ENV,
|
|
@@ -69,33 +58,10 @@ import {
|
|
|
69
58
|
describeAutoUpdateCheck,
|
|
70
59
|
readAutoUpdateState,
|
|
71
60
|
takeAutoUpdateAnnouncement
|
|
72
|
-
} from "../chunk-
|
|
61
|
+
} from "../chunk-K545B734.js";
|
|
73
62
|
import {
|
|
74
63
|
readLedgerSummary
|
|
75
|
-
} from "../chunk-
|
|
76
|
-
import {
|
|
77
|
-
describeBridgeResolution,
|
|
78
|
-
isBridgeLocator,
|
|
79
|
-
liveBridgeProbe,
|
|
80
|
-
resolveBridgeStub
|
|
81
|
-
} from "../chunk-MNWRUGMH.js";
|
|
82
|
-
import {
|
|
83
|
-
claudeOtherHolders,
|
|
84
|
-
claudeUnprovenHolds,
|
|
85
|
-
claudeWired,
|
|
86
|
-
codexOtherHolders,
|
|
87
|
-
codexUnprovenHolds,
|
|
88
|
-
codexWired,
|
|
89
|
-
cursorMcpAuthorization,
|
|
90
|
-
cursorOtherHolders,
|
|
91
|
-
cursorWired,
|
|
92
|
-
describeHoldSentence,
|
|
93
|
-
describeOtherHolder,
|
|
94
|
-
geminiOtherHolders,
|
|
95
|
-
geminiWired,
|
|
96
|
-
holdsLong,
|
|
97
|
-
pusharyHookExecutable
|
|
98
|
-
} from "../chunk-4YO4T5FV.js";
|
|
64
|
+
} from "../chunk-IIVZZMSO.js";
|
|
99
65
|
import {
|
|
100
66
|
daemonHasRemoteProof,
|
|
101
67
|
daemonServiceManagerAvailable,
|
|
@@ -104,20 +70,8 @@ import {
|
|
|
104
70
|
readDaemonNeedsLogin,
|
|
105
71
|
readDaemonStatus,
|
|
106
72
|
readInstalledDaemonService
|
|
107
|
-
} from "../chunk-
|
|
108
|
-
import {
|
|
109
|
-
GEMINI_HOOK_BINARY,
|
|
110
|
-
hasGeminiHooks,
|
|
111
|
-
missingGeminiHookEvents
|
|
112
|
-
} from "../chunk-JCWZ23MJ.js";
|
|
73
|
+
} from "../chunk-SZ4Q6ZVS.js";
|
|
113
74
|
import "../chunk-XHKBHWLX.js";
|
|
114
|
-
import "../chunk-6ICPEJY5.js";
|
|
115
|
-
import "../chunk-QFEM7R6T.js";
|
|
116
|
-
import "../chunk-N6IOSZOE.js";
|
|
117
|
-
import "../chunk-6DJTDHBI.js";
|
|
118
|
-
import "../chunk-D6S5EKXA.js";
|
|
119
|
-
import "../chunk-AVNKVF7N.js";
|
|
120
|
-
import "../chunk-POFBE6ZY.js";
|
|
121
75
|
import {
|
|
122
76
|
describeReach,
|
|
123
77
|
describeRoundTrip,
|
|
@@ -125,42 +79,100 @@ import {
|
|
|
125
79
|
reachVerdict,
|
|
126
80
|
roundTripEvidence,
|
|
127
81
|
verifyRoundTrip
|
|
128
|
-
} from "../chunk-
|
|
82
|
+
} from "../chunk-DCCSULXK.js";
|
|
129
83
|
import "../chunk-3EGEA4KH.js";
|
|
130
84
|
import "../chunk-QCGNGEGE.js";
|
|
85
|
+
import {
|
|
86
|
+
SIGNED_OUT_ON_MAC_MESSAGE,
|
|
87
|
+
activeKeyVerdictOf,
|
|
88
|
+
describeSignedOutKey,
|
|
89
|
+
readSignedOutDiagnosis
|
|
90
|
+
} from "../chunk-Q6C6ILUS.js";
|
|
91
|
+
import {
|
|
92
|
+
CONNECTED_THROUGH_MAC_APP,
|
|
93
|
+
readMacAppConnectionWhenKeyless
|
|
94
|
+
} from "../chunk-E5HOHIUV.js";
|
|
95
|
+
import {
|
|
96
|
+
OPENCODE_PLUGIN_PLACEHOLDER,
|
|
97
|
+
openCodePluginDir,
|
|
98
|
+
openCodePluginFile,
|
|
99
|
+
openCodeWired
|
|
100
|
+
} from "../chunk-BZLHTMT6.js";
|
|
101
|
+
import {
|
|
102
|
+
compatibleConfigFile,
|
|
103
|
+
compatibleInstructionsFile,
|
|
104
|
+
compatibleMcpFile,
|
|
105
|
+
hasCompatibleHooks,
|
|
106
|
+
missingCompatibleHookEvents
|
|
107
|
+
} from "../chunk-UF6RBP5V.js";
|
|
131
108
|
import {
|
|
132
109
|
createIo
|
|
133
110
|
} from "../chunk-U4TMAANR.js";
|
|
134
111
|
import {
|
|
135
112
|
exitOnHelpFlag
|
|
136
|
-
} from "../chunk-
|
|
113
|
+
} from "../chunk-TO3PS646.js";
|
|
114
|
+
import {
|
|
115
|
+
claudeOtherHolders,
|
|
116
|
+
claudeUnprovenHolds,
|
|
117
|
+
claudeWired,
|
|
118
|
+
codexOtherHolders,
|
|
119
|
+
codexUnprovenHolds,
|
|
120
|
+
codexWired,
|
|
121
|
+
cursorMcpAuthorization,
|
|
122
|
+
cursorOtherHolders,
|
|
123
|
+
cursorWired,
|
|
124
|
+
describeBridgeResolution,
|
|
125
|
+
describeHoldSentence,
|
|
126
|
+
describeOtherHolder,
|
|
127
|
+
geminiOtherHolders,
|
|
128
|
+
geminiWired,
|
|
129
|
+
holdsLong,
|
|
130
|
+
isBridgeLocator,
|
|
131
|
+
liveBridgeProbe,
|
|
132
|
+
pusharyHookExecutable,
|
|
133
|
+
resolveBridgeStub
|
|
134
|
+
} from "../chunk-BYLKCZ2G.js";
|
|
135
|
+
import {
|
|
136
|
+
GEMINI_HOOK_BINARY,
|
|
137
|
+
hasGeminiHooks,
|
|
138
|
+
missingGeminiHookEvents
|
|
139
|
+
} from "../chunk-M3STIAGU.js";
|
|
140
|
+
import "../chunk-ZGADIZDS.js";
|
|
141
|
+
import "../chunk-MLGIVVSG.js";
|
|
137
142
|
import {
|
|
138
143
|
parseFlags
|
|
139
144
|
} from "../chunk-GMXKITVA.js";
|
|
145
|
+
import "../chunk-6ICPEJY5.js";
|
|
140
146
|
import {
|
|
141
147
|
keyPrefix,
|
|
142
148
|
readControlMode,
|
|
143
149
|
readKeySource
|
|
144
|
-
} from "../chunk-
|
|
150
|
+
} from "../chunk-REU2VQPH.js";
|
|
151
|
+
import "../chunk-KQFTBQ66.js";
|
|
152
|
+
import "../chunk-N6IOSZOE.js";
|
|
153
|
+
import "../chunk-MD4SVNT6.js";
|
|
154
|
+
import "../chunk-WRPYCIV2.js";
|
|
145
155
|
import {
|
|
146
156
|
callMcpTool,
|
|
147
157
|
sendMcpRequest
|
|
148
|
-
} from "../chunk-
|
|
158
|
+
} from "../chunk-6AYSKVLL.js";
|
|
149
159
|
import {
|
|
150
160
|
checkApiKey,
|
|
151
161
|
describeKeyCheck
|
|
152
|
-
} from "../chunk-
|
|
153
|
-
import "../chunk-
|
|
162
|
+
} from "../chunk-QRXPWW3M.js";
|
|
163
|
+
import "../chunk-UPIZSCYD.js";
|
|
164
|
+
import "../chunk-POFBE6ZY.js";
|
|
165
|
+
import "../chunk-5N5L6DNN.js";
|
|
154
166
|
import {
|
|
155
167
|
getMachineId
|
|
156
|
-
} from "../chunk-
|
|
168
|
+
} from "../chunk-KOWFRUIT.js";
|
|
157
169
|
import {
|
|
158
170
|
UsageError
|
|
159
171
|
} from "../chunk-7QLSKOSU.js";
|
|
160
172
|
import {
|
|
161
173
|
EXIT
|
|
162
174
|
} from "../chunk-KZERVKTD.js";
|
|
163
|
-
import "../chunk-
|
|
175
|
+
import "../chunk-BNSKVIAW.js";
|
|
164
176
|
import {
|
|
165
177
|
CODEX_HOOK_EVENTS,
|
|
166
178
|
CODEX_REQUIRED_APPROVAL_EVENTS,
|
|
@@ -191,14 +203,14 @@ import {
|
|
|
191
203
|
readGlobalCliInstall,
|
|
192
204
|
resolvePathBinary,
|
|
193
205
|
vscodePluginDir
|
|
194
|
-
} from "../chunk-
|
|
206
|
+
} from "../chunk-Z23ZBYDW.js";
|
|
195
207
|
import "../chunk-T7E75EKA.js";
|
|
196
208
|
import {
|
|
197
209
|
getBaseUrl
|
|
198
|
-
} from "../chunk-
|
|
210
|
+
} from "../chunk-IRHABAQT.js";
|
|
199
211
|
import {
|
|
200
212
|
NPX_LATEST_COMMAND
|
|
201
|
-
} from "../chunk-
|
|
213
|
+
} from "../chunk-5DCDQ5VW.js";
|
|
202
214
|
import {
|
|
203
215
|
AGENTS,
|
|
204
216
|
CURSOR_GATE_EVENTS,
|
|
@@ -214,7 +226,7 @@ import {
|
|
|
214
226
|
hookCompatibleProfile,
|
|
215
227
|
isHookActivationReport,
|
|
216
228
|
isNewerVersion
|
|
217
|
-
} from "../chunk-
|
|
229
|
+
} from "../chunk-5RGA636G.js";
|
|
218
230
|
|
|
219
231
|
// bin/pushary-doctor.ts
|
|
220
232
|
import { existsSync, readFileSync, writeFileSync } from "fs";
|
|
@@ -405,9 +417,6 @@ function inertRegistrations(configs, resolves) {
|
|
|
405
417
|
var describeInertRegistration = ({ named }) => `hooks here are registered for "${named}", which this CLI has no profile for, so every one of them stands aside`;
|
|
406
418
|
var inertRegistrationRemedy = () => `Upgrade with ${NPX_LATEST_COMMAND} upgrade, or re-run setup to rewrite them for an agent this version knows`;
|
|
407
419
|
|
|
408
|
-
// src/hooks-spec.ts
|
|
409
|
-
var CURSOR_GATE_SCRIPT = "pushary-gate.mjs";
|
|
410
|
-
|
|
411
420
|
// src/diagnostics/activation.ts
|
|
412
421
|
import { realpathSync } from "fs";
|
|
413
422
|
import { basename, dirname, join, resolve } from "path";
|
|
@@ -671,6 +680,7 @@ var main = async () => {
|
|
|
671
680
|
}
|
|
672
681
|
}
|
|
673
682
|
const maskKey = (k) => `pk_${k.split(".")[0]?.slice(3, 7)}...`;
|
|
683
|
+
const macApp = readMacAppConnectionWhenKeyless(apiKey);
|
|
674
684
|
if (keySource === "config-file") {
|
|
675
685
|
console.log(` ${pass} API key in ${dim(source.origin ?? "the config file")} ${dim(`(${maskKey(apiKey)})`)}`);
|
|
676
686
|
} else if (keySource === "profile") {
|
|
@@ -680,6 +690,8 @@ var main = async () => {
|
|
|
680
690
|
`found only in a shell profile (${maskKey(apiKey)}), which hooks do not read \u2014 re-run setup, or open a new terminal`
|
|
681
691
|
);
|
|
682
692
|
console.log(` ${dim("Hooks read $PUSHARY_API_KEY, then")} ${dim(pusharyConfigFile())}`);
|
|
693
|
+
} else if (macApp.kind === "connected") {
|
|
694
|
+
check(true, CONNECTED_THROUGH_MAC_APP, `${macApp.keyPrefix}, held by the app; the CLI has no key of its own`);
|
|
683
695
|
} else {
|
|
684
696
|
check(!!apiKey, "API key in environment", apiKey ? maskKey(apiKey) : "PUSHARY_API_KEY not set");
|
|
685
697
|
}
|
|
@@ -691,8 +703,12 @@ var main = async () => {
|
|
|
691
703
|
);
|
|
692
704
|
}
|
|
693
705
|
let keyVerdict = null;
|
|
694
|
-
if (apiKey)
|
|
695
|
-
|
|
706
|
+
if (apiKey) keyVerdict = await checkApiKey(apiKey);
|
|
707
|
+
const signedOut = readSignedOutDiagnosis(apiKey ?? null, activeKeyVerdictOf(keyVerdict));
|
|
708
|
+
if (signedOut.kind === "signed_out_on_mac") {
|
|
709
|
+
check(false, "Key still signed in", SIGNED_OUT_ON_MAC_MESSAGE);
|
|
710
|
+
for (const line of describeSignedOutKey(signedOut)) console.log(` ${dim(line)}`);
|
|
711
|
+
} else if (keyVerdict) {
|
|
696
712
|
switch (keyVerdict.kind) {
|
|
697
713
|
case "ok":
|
|
698
714
|
check(
|
|
@@ -1289,9 +1305,13 @@ var main = async () => {
|
|
|
1289
1305
|
console.log();
|
|
1290
1306
|
console.log(` ${dim("Connectivity")}`);
|
|
1291
1307
|
if (!apiKey) {
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1308
|
+
if (macApp.kind === "connected") {
|
|
1309
|
+
console.log(` ${dim("\u2013")} MCP server, key and handshake ${dim("(the Pushary Mac app holds this computer's key and checks its own connection)")}`);
|
|
1310
|
+
} else {
|
|
1311
|
+
check(false, "MCP server reachable", "skipped \u2014 no API key");
|
|
1312
|
+
check(false, "API key valid", "skipped");
|
|
1313
|
+
check(false, "MCP handshake", "skipped");
|
|
1314
|
+
}
|
|
1295
1315
|
const keylessSummary = readLedgerSummary(7);
|
|
1296
1316
|
if (keylessSummary.count > 0) {
|
|
1297
1317
|
check(false, "Keyless approval moments (7d)", `${keylessSummary.count} counted locally. See them with ${NPX_LATEST_COMMAND} stats`);
|
|
@@ -1348,7 +1368,7 @@ var main = async () => {
|
|
|
1348
1368
|
check(
|
|
1349
1369
|
verdict.kind === "yours",
|
|
1350
1370
|
"Phone reachable",
|
|
1351
|
-
verdict.kind === "yours" ? describeReach(channels) : verdict.kind === "nobody" ? "
|
|
1371
|
+
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
1372
|
"reachability"
|
|
1353
1373
|
);
|
|
1354
1374
|
}
|