pushary 1.8.0
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 +1943 -0
- package/LICENSE +21 -0
- package/README.md +330 -0
- package/data/SKILL.md +591 -0
- package/data/cowork/SKILL.md +77 -0
- package/data/cursor-plugin/.cursor-plugin/plugin.json +25 -0
- package/data/cursor-plugin/CHANGELOG.md +70 -0
- package/data/cursor-plugin/CONTRIBUTING.md +40 -0
- package/data/cursor-plugin/LICENSE +21 -0
- package/data/cursor-plugin/README.md +113 -0
- package/data/cursor-plugin/SECURITY.md +33 -0
- package/data/cursor-plugin/assets/logo.png +0 -0
- package/data/cursor-plugin/commands/notify-when-done.md +14 -0
- package/data/cursor-plugin/commands/pushary-test.md +13 -0
- package/data/cursor-plugin/hooks/hooks.json +75 -0
- package/data/cursor-plugin/mcp.json +11 -0
- package/data/cursor-plugin/rules/pushary.mdc +40 -0
- package/data/cursor-plugin/scripts/pushary-gate.mjs +724 -0
- package/data/cursor-plugin/scripts/pushary-gate.test.mjs +137 -0
- package/data/cursor-plugin/scripts/redaction.mjs +51 -0
- package/data/cursor-plugin/skills/pushary/SKILL.md +584 -0
- package/data/vscode-plugin/.claude-plugin/plugin.json +28 -0
- package/data/vscode-plugin/.mcp.json +11 -0
- package/data/vscode-plugin/CHANGELOG.md +49 -0
- package/data/vscode-plugin/CONTRIBUTING.md +40 -0
- package/data/vscode-plugin/LICENSE +21 -0
- package/data/vscode-plugin/README.md +128 -0
- package/data/vscode-plugin/SECURITY.md +56 -0
- package/data/vscode-plugin/assets/logo.png +0 -0
- package/data/vscode-plugin/commands/notify-when-done.md +14 -0
- package/data/vscode-plugin/commands/pushary-test.md +13 -0
- package/data/vscode-plugin/hooks/hooks.json +60 -0
- package/data/vscode-plugin/scripts/pushary-gate.mjs +762 -0
- package/data/vscode-plugin/scripts/redaction.mjs +51 -0
- package/data/vscode-plugin/skills/pushary/SKILL.md +584 -0
- package/dist/bin/pushary-bell-hook.d.ts +1 -0
- package/dist/bin/pushary-bell-hook.js +46 -0
- package/dist/bin/pushary-bell.d.ts +1 -0
- package/dist/bin/pushary-bell.js +146 -0
- package/dist/bin/pushary-claude.d.ts +1 -0
- package/dist/bin/pushary-claude.js +1916 -0
- package/dist/bin/pushary-clean.d.ts +1 -0
- package/dist/bin/pushary-clean.js +1300 -0
- package/dist/bin/pushary-codex-bridge.d.ts +1 -0
- package/dist/bin/pushary-codex-bridge.js +599 -0
- package/dist/bin/pushary-codex-hook.d.ts +1 -0
- package/dist/bin/pushary-codex-hook.js +886 -0
- package/dist/bin/pushary-codex.d.ts +1 -0
- package/dist/bin/pushary-codex.js +125 -0
- package/dist/bin/pushary-connect.d.ts +1 -0
- package/dist/bin/pushary-connect.js +100 -0
- package/dist/bin/pushary-cowork.d.ts +1 -0
- package/dist/bin/pushary-cowork.js +36 -0
- package/dist/bin/pushary-daemon-supervisor.d.ts +1 -0
- package/dist/bin/pushary-daemon-supervisor.js +27 -0
- package/dist/bin/pushary-daemon.d.ts +1 -0
- package/dist/bin/pushary-daemon.js +878 -0
- package/dist/bin/pushary-disconnect.d.ts +1 -0
- package/dist/bin/pushary-disconnect.js +264 -0
- package/dist/bin/pushary-doctor.d.ts +1 -0
- package/dist/bin/pushary-doctor.js +1433 -0
- package/dist/bin/pushary-elicitation-hook.d.ts +1 -0
- package/dist/bin/pushary-elicitation-hook.js +149 -0
- package/dist/bin/pushary-gemini-bridge.d.ts +1 -0
- package/dist/bin/pushary-gemini-bridge.js +339 -0
- package/dist/bin/pushary-gemini-hook.d.ts +1 -0
- package/dist/bin/pushary-gemini-hook.js +381 -0
- package/dist/bin/pushary-hook.d.ts +1 -0
- package/dist/bin/pushary-hook.js +95 -0
- package/dist/bin/pushary-login.d.ts +1 -0
- package/dist/bin/pushary-login.js +198 -0
- package/dist/bin/pushary-logout.d.ts +1 -0
- package/dist/bin/pushary-logout.js +147 -0
- package/dist/bin/pushary-mcp.d.ts +1 -0
- package/dist/bin/pushary-mcp.js +114 -0
- package/dist/bin/pushary-mode.d.ts +1 -0
- package/dist/bin/pushary-mode.js +130 -0
- package/dist/bin/pushary-notification-hook.d.ts +1 -0
- package/dist/bin/pushary-notification-hook.js +56 -0
- package/dist/bin/pushary-opencode-hook.d.ts +1 -0
- package/dist/bin/pushary-opencode-hook.js +338 -0
- package/dist/bin/pushary-permission-denied-hook.d.ts +1 -0
- package/dist/bin/pushary-permission-denied-hook.js +60 -0
- package/dist/bin/pushary-permission-hook.d.ts +1 -0
- package/dist/bin/pushary-permission-hook.js +65 -0
- package/dist/bin/pushary-post-hook.d.ts +1 -0
- package/dist/bin/pushary-post-hook.js +70 -0
- package/dist/bin/pushary-prompt-hook.d.ts +1 -0
- package/dist/bin/pushary-prompt-hook.js +61 -0
- package/dist/bin/pushary-session-end-hook.d.ts +1 -0
- package/dist/bin/pushary-session-end-hook.js +59 -0
- package/dist/bin/pushary-session-start-hook.d.ts +1 -0
- package/dist/bin/pushary-session-start-hook.js +72 -0
- package/dist/bin/pushary-setup.d.ts +1 -0
- package/dist/bin/pushary-setup.js +2660 -0
- package/dist/bin/pushary-stats.d.ts +1 -0
- package/dist/bin/pushary-stats.js +44 -0
- package/dist/bin/pushary-status.d.ts +1 -0
- package/dist/bin/pushary-status.js +262 -0
- package/dist/bin/pushary-stop-hook.d.ts +1 -0
- package/dist/bin/pushary-stop-hook.js +63 -0
- package/dist/bin/pushary-stopfailure-hook.d.ts +1 -0
- package/dist/bin/pushary-stopfailure-hook.js +56 -0
- package/dist/bin/pushary-suggestions.d.ts +1 -0
- package/dist/bin/pushary-suggestions.js +100 -0
- package/dist/bin/pushary-transcript-register.d.ts +1 -0
- package/dist/bin/pushary-transcript-register.js +40 -0
- package/dist/bin/pushary-transcripts.d.ts +1 -0
- package/dist/bin/pushary-transcripts.js +77 -0
- package/dist/bin/pushary-upgrade.d.ts +1 -0
- package/dist/bin/pushary-upgrade.js +599 -0
- package/dist/bin/pushary-wait.d.ts +1 -0
- package/dist/bin/pushary-wait.js +122 -0
- package/dist/bin/pushary.d.ts +1 -0
- package/dist/bin/pushary.js +74 -0
- package/dist/chunk-2ABTSGFT.js +173 -0
- package/dist/chunk-2OY3ZZ5N.js +124 -0
- package/dist/chunk-3EGEA4KH.js +44 -0
- package/dist/chunk-3EVPNIBE.js +185 -0
- package/dist/chunk-5OP5MQI7.js +45 -0
- package/dist/chunk-6J2JC2RT.js +149 -0
- package/dist/chunk-7QLSKOSU.js +19 -0
- package/dist/chunk-7Z7Q4GGS.js +88 -0
- package/dist/chunk-A2A2YTMG.js +835 -0
- package/dist/chunk-AHV4LNB5.js +377 -0
- package/dist/chunk-AXPCESYO.js +197 -0
- package/dist/chunk-C2WCPBF7.js +86 -0
- package/dist/chunk-CJVVKOSR.js +73 -0
- package/dist/chunk-CULUZTWQ.js +2117 -0
- package/dist/chunk-CVQYGMSR.js +142 -0
- package/dist/chunk-CVWG2N3Y.js +16 -0
- package/dist/chunk-D2FX3EPW.js +15 -0
- package/dist/chunk-DB3ONZB4.js +44 -0
- package/dist/chunk-DE4Y6TCC.js +160 -0
- package/dist/chunk-E4FJTUH4.js +249 -0
- package/dist/chunk-EPCXUP3P.js +41 -0
- package/dist/chunk-EX3GAPA4.js +44 -0
- package/dist/chunk-EYK3GSRH.js +143 -0
- package/dist/chunk-GMXKITVA.js +70 -0
- package/dist/chunk-GPEGOGRJ.js +49 -0
- package/dist/chunk-GU3EJCVV.js +43 -0
- package/dist/chunk-HQ6G3B5R.js +59 -0
- package/dist/chunk-HZVVNGEW.js +22 -0
- package/dist/chunk-IPVKH2ST.js +231 -0
- package/dist/chunk-J5TIV3J6.js +238 -0
- package/dist/chunk-JU6W3XAU.js +64 -0
- package/dist/chunk-JYG4B33G.js +227 -0
- package/dist/chunk-JZTHGAPA.js +503 -0
- package/dist/chunk-KGDWDSNL.js +102 -0
- package/dist/chunk-KVQBWI5T.js +99 -0
- package/dist/chunk-KZERVKTD.js +16 -0
- package/dist/chunk-LXQ5FBBD.js +47 -0
- package/dist/chunk-M5ICYGHT.js +138 -0
- package/dist/chunk-M5JDZ45W.js +943 -0
- package/dist/chunk-MDEPU45E.js +1226 -0
- package/dist/chunk-MPWXGONV.js +157 -0
- package/dist/chunk-N6IOSZOE.js +185 -0
- package/dist/chunk-NGDD6TXY.js +192 -0
- package/dist/chunk-NQTHFF4W.js +2830 -0
- package/dist/chunk-OKXS7WDZ.js +68 -0
- package/dist/chunk-OLQRRFBX.js +21 -0
- package/dist/chunk-P7WQEVWA.js +307 -0
- package/dist/chunk-POFBE6ZY.js +12 -0
- package/dist/chunk-PQ4K74WL.js +30 -0
- package/dist/chunk-PUZZELE6.js +37 -0
- package/dist/chunk-Q7E4I6UA.js +767 -0
- package/dist/chunk-QCGNGEGE.js +15 -0
- package/dist/chunk-R7437YI3.js +151 -0
- package/dist/chunk-RHR6NARM.js +305 -0
- package/dist/chunk-SAXBC4AZ.js +60 -0
- package/dist/chunk-SGZJ5LYH.js +76 -0
- package/dist/chunk-SIFVFP6T.js +70 -0
- package/dist/chunk-SLFABHW3.js +150 -0
- package/dist/chunk-T7E75EKA.js +67 -0
- package/dist/chunk-TY4JT7W3.js +38 -0
- package/dist/chunk-U4TMAANR.js +111 -0
- package/dist/chunk-UI36QSBI.js +177 -0
- package/dist/chunk-VQKRG3AC.js +339 -0
- package/dist/chunk-WE2J62NC.js +1131 -0
- package/dist/chunk-XHKBHWLX.js +14 -0
- package/dist/chunk-ZSZSSJCV.js +275 -0
- package/dist/chunk-ZVSKMPBZ.js +135 -0
- package/dist/reapply-CW3MA66V.js +34 -0
- package/dist/src/index.d.ts +204 -0
- package/dist/src/index.js +64 -0
- package/package.json +108 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
OPENCODE_PLUGIN_SIBLING,
|
|
4
|
+
OPENCODE_PLUGIN_SIBLING_CONTENTS,
|
|
5
|
+
hasForeignPlugins,
|
|
6
|
+
isOpenCodePluginOurs,
|
|
7
|
+
openCodeConfigFile,
|
|
8
|
+
openCodePluginDir,
|
|
9
|
+
openCodePluginFile,
|
|
10
|
+
removeOpenCodeMcpServer
|
|
11
|
+
} from "../chunk-AHV4LNB5.js";
|
|
12
|
+
import {
|
|
13
|
+
compatibleConfigFile,
|
|
14
|
+
compatibleMcpFile,
|
|
15
|
+
compatiblePermissionRuleFile,
|
|
16
|
+
removeCompatibleHooks,
|
|
17
|
+
removeCompatibleMcpServer
|
|
18
|
+
} from "../chunk-J5TIV3J6.js";
|
|
19
|
+
import {
|
|
20
|
+
isClaudeMcpSnapshot,
|
|
21
|
+
removeClaudeMcpServers,
|
|
22
|
+
removePusharySettings,
|
|
23
|
+
removePusharyToolPermissions,
|
|
24
|
+
restoreClaudeMcpServer
|
|
25
|
+
} from "../chunk-AXPCESYO.js";
|
|
26
|
+
import {
|
|
27
|
+
removeGeminiSettings
|
|
28
|
+
} from "../chunk-3EVPNIBE.js";
|
|
29
|
+
import "../chunk-CULUZTWQ.js";
|
|
30
|
+
import "../chunk-N6IOSZOE.js";
|
|
31
|
+
import "../chunk-EPCXUP3P.js";
|
|
32
|
+
import "../chunk-NGDD6TXY.js";
|
|
33
|
+
import "../chunk-CVQYGMSR.js";
|
|
34
|
+
import "../chunk-POFBE6ZY.js";
|
|
35
|
+
import {
|
|
36
|
+
exitOnHelpFlag
|
|
37
|
+
} from "../chunk-HZVVNGEW.js";
|
|
38
|
+
import "../chunk-M5ICYGHT.js";
|
|
39
|
+
import "../chunk-2ABTSGFT.js";
|
|
40
|
+
import "../chunk-2OY3ZZ5N.js";
|
|
41
|
+
import "../chunk-LXQ5FBBD.js";
|
|
42
|
+
import "../chunk-7QLSKOSU.js";
|
|
43
|
+
import "../chunk-KZERVKTD.js";
|
|
44
|
+
import "../chunk-DB3ONZB4.js";
|
|
45
|
+
import {
|
|
46
|
+
claudeJson,
|
|
47
|
+
claudeMcpReceipt,
|
|
48
|
+
claudeSettings,
|
|
49
|
+
claudeSettingsLocal,
|
|
50
|
+
codexConfigToml,
|
|
51
|
+
codexHookPositions,
|
|
52
|
+
codexHooksJson,
|
|
53
|
+
cursorUserHooks,
|
|
54
|
+
cursorUserMcp,
|
|
55
|
+
geminiSettings,
|
|
56
|
+
removeCodexHooks,
|
|
57
|
+
removeCodexSettings
|
|
58
|
+
} from "../chunk-A2A2YTMG.js";
|
|
59
|
+
import "../chunk-T7E75EKA.js";
|
|
60
|
+
import "../chunk-GPEGOGRJ.js";
|
|
61
|
+
import "../chunk-E4FJTUH4.js";
|
|
62
|
+
import {
|
|
63
|
+
DISCONNECTABLE_AGENTS,
|
|
64
|
+
hookCompatibleProfileBySource
|
|
65
|
+
} from "../chunk-NQTHFF4W.js";
|
|
66
|
+
|
|
67
|
+
// bin/pushary-disconnect.ts
|
|
68
|
+
import { readdirSync, readFileSync, rmSync, writeFileSync } from "fs";
|
|
69
|
+
import { parse as parseTOML, stringify as stringifyTOML } from "smol-toml";
|
|
70
|
+
|
|
71
|
+
// src/disconnect.ts
|
|
72
|
+
import { dirname } from "path";
|
|
73
|
+
var isDisconnectableAgent = (value) => DISCONNECTABLE_AGENTS.includes(value);
|
|
74
|
+
var removeCursorHooks = (config) => {
|
|
75
|
+
const hooks = config.hooks;
|
|
76
|
+
if (!hooks) return false;
|
|
77
|
+
let changed = false;
|
|
78
|
+
for (const [event, entries] of Object.entries(hooks)) {
|
|
79
|
+
if (!Array.isArray(entries)) continue;
|
|
80
|
+
const kept = entries.filter((entry) => !String(entry?.command ?? "").includes("pushary"));
|
|
81
|
+
if (kept.length === entries.length) continue;
|
|
82
|
+
changed = true;
|
|
83
|
+
if (kept.length === 0) delete hooks[event];
|
|
84
|
+
else hooks[event] = kept;
|
|
85
|
+
}
|
|
86
|
+
if (changed && Object.keys(hooks).length === 0) delete config.hooks;
|
|
87
|
+
return changed;
|
|
88
|
+
};
|
|
89
|
+
var disconnectPlan = (agent) => {
|
|
90
|
+
switch (agent) {
|
|
91
|
+
case "claude":
|
|
92
|
+
return [
|
|
93
|
+
{ path: claudeSettings(), format: "json", remove: removePusharySettings },
|
|
94
|
+
{ path: claudeSettingsLocal(), format: "json", remove: removePusharySettings },
|
|
95
|
+
{ path: claudeJson(), format: "json", remove: removeClaudeMcpServers }
|
|
96
|
+
];
|
|
97
|
+
case "codex": {
|
|
98
|
+
const positions = {};
|
|
99
|
+
return [
|
|
100
|
+
{
|
|
101
|
+
path: codexHooksJson(),
|
|
102
|
+
format: "json",
|
|
103
|
+
remove: (config) => {
|
|
104
|
+
Object.assign(positions, codexHookPositions(config));
|
|
105
|
+
return removeCodexHooks(config);
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
path: codexConfigToml(),
|
|
110
|
+
format: "toml",
|
|
111
|
+
remove: (config) => removeCodexSettings(config, codexHooksJson(), positions)
|
|
112
|
+
}
|
|
113
|
+
];
|
|
114
|
+
}
|
|
115
|
+
case "gemini":
|
|
116
|
+
return [{ path: geminiSettings(), format: "json", remove: removeGeminiSettings }];
|
|
117
|
+
case "cursor":
|
|
118
|
+
return [
|
|
119
|
+
{ path: cursorUserHooks(), format: "json", remove: removeCursorHooks },
|
|
120
|
+
{ path: cursorUserMcp(), format: "json", remove: removeClaudeMcpServers }
|
|
121
|
+
];
|
|
122
|
+
// The plugin itself is a whole file of ours and comes out in
|
|
123
|
+
// `disconnectRemovals` below; the MCP entry is an ordinary edit to a config
|
|
124
|
+
// that is otherwise the person's own.
|
|
125
|
+
case "opencode":
|
|
126
|
+
return [{ path: openCodeConfigFile(), format: "json", remove: removeOpenCodeMcpServer }];
|
|
127
|
+
case "qwen":
|
|
128
|
+
case "codebuddy":
|
|
129
|
+
case "qoder":
|
|
130
|
+
case "droid":
|
|
131
|
+
case "devin":
|
|
132
|
+
return compatibleDisconnectPlan(agent);
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
var compatibleDisconnectPlan = (source) => {
|
|
136
|
+
const profile = hookCompatibleProfileBySource(source);
|
|
137
|
+
if (!profile) return [];
|
|
138
|
+
const removers = /* @__PURE__ */ new Map();
|
|
139
|
+
const add = (path, remove) => {
|
|
140
|
+
if (!path) return;
|
|
141
|
+
removers.set(path, [...removers.get(path) ?? [], remove]);
|
|
142
|
+
};
|
|
143
|
+
add(compatibleConfigFile(profile), (config) => removeCompatibleHooks(config, profile));
|
|
144
|
+
add(compatibleMcpFile(profile), (config) => removeCompatibleMcpServer(config, profile));
|
|
145
|
+
add(compatiblePermissionRuleFile(profile), removePusharyToolPermissions);
|
|
146
|
+
return [...removers].map(([path, edits]) => ({
|
|
147
|
+
path,
|
|
148
|
+
format: "json",
|
|
149
|
+
remove: (config) => edits.reduce((changed, edit) => edit(config) || changed, false)
|
|
150
|
+
}));
|
|
151
|
+
};
|
|
152
|
+
var disconnectRemovals = (agent) => {
|
|
153
|
+
if (agent !== "opencode") return [];
|
|
154
|
+
return [
|
|
155
|
+
{ path: openCodePluginFile(), ownedBy: isOpenCodePluginOurs },
|
|
156
|
+
{
|
|
157
|
+
path: `${openCodePluginDir()}/${OPENCODE_PLUGIN_SIBLING}`,
|
|
158
|
+
ownedBy: (contents) => contents === OPENCODE_PLUGIN_SIBLING_CONTENTS,
|
|
159
|
+
onlyIfLast: true
|
|
160
|
+
}
|
|
161
|
+
];
|
|
162
|
+
};
|
|
163
|
+
var disconnectAgent = (agent, io) => {
|
|
164
|
+
const changed = [];
|
|
165
|
+
const untouched = [];
|
|
166
|
+
const claudeReceiptPath = claudeMcpReceipt();
|
|
167
|
+
const rawClaudeReceipt = agent === "claude" ? io.read(claudeReceiptPath) : null;
|
|
168
|
+
let claudeReceipt = null;
|
|
169
|
+
if (rawClaudeReceipt !== null) {
|
|
170
|
+
try {
|
|
171
|
+
const parsed = JSON.parse(rawClaudeReceipt);
|
|
172
|
+
if (isClaudeMcpSnapshot(parsed)) claudeReceipt = parsed;
|
|
173
|
+
} catch {
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
let restoredClaudeReceipt = false;
|
|
177
|
+
for (const edit of disconnectPlan(agent)) {
|
|
178
|
+
const raw = io.read(edit.path);
|
|
179
|
+
if (raw === null) continue;
|
|
180
|
+
try {
|
|
181
|
+
const config = edit.format === "toml" ? io.parseToml(raw) : JSON.parse(raw);
|
|
182
|
+
const changedConfig = agent === "claude" && edit.path === claudeJson() && rawClaudeReceipt !== null ? claudeReceipt !== null && restoreClaudeMcpServer(config, claudeReceipt) : edit.remove(config);
|
|
183
|
+
if (!changedConfig) {
|
|
184
|
+
untouched.push(edit.path);
|
|
185
|
+
continue;
|
|
186
|
+
}
|
|
187
|
+
io.write(
|
|
188
|
+
edit.path,
|
|
189
|
+
edit.format === "toml" ? io.stringifyToml(config) : `${JSON.stringify(config, null, 2)}
|
|
190
|
+
`
|
|
191
|
+
);
|
|
192
|
+
changed.push(edit.path);
|
|
193
|
+
if (agent === "claude" && edit.path === claudeJson() && claudeReceipt) {
|
|
194
|
+
restoredClaudeReceipt = true;
|
|
195
|
+
}
|
|
196
|
+
} catch {
|
|
197
|
+
untouched.push(edit.path);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
for (const removal of disconnectRemovals(agent)) {
|
|
201
|
+
const raw = io.read(removal.path);
|
|
202
|
+
if (raw === null) continue;
|
|
203
|
+
if (!removal.ownedBy(raw)) {
|
|
204
|
+
untouched.push(removal.path);
|
|
205
|
+
continue;
|
|
206
|
+
}
|
|
207
|
+
if (removal.onlyIfLast) {
|
|
208
|
+
const entries = io.list?.(dirname(removal.path));
|
|
209
|
+
if (entries === void 0 || hasForeignPlugins(entries)) {
|
|
210
|
+
untouched.push(removal.path);
|
|
211
|
+
continue;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
try {
|
|
215
|
+
io.remove?.(removal.path);
|
|
216
|
+
changed.push(removal.path);
|
|
217
|
+
} catch {
|
|
218
|
+
untouched.push(removal.path);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
if (restoredClaudeReceipt && io.remove) {
|
|
222
|
+
try {
|
|
223
|
+
io.remove(claudeReceiptPath);
|
|
224
|
+
} catch {
|
|
225
|
+
untouched.push(claudeReceiptPath);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
return { agent, changed, untouched };
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
// bin/pushary-disconnect.ts
|
|
232
|
+
exitOnHelpFlag("disconnect");
|
|
233
|
+
var rest = process.argv.slice(2);
|
|
234
|
+
var requested = rest[0] === "disconnect" ? rest[1] : rest[0];
|
|
235
|
+
if (!requested || !isDisconnectableAgent(requested)) {
|
|
236
|
+
console.error(`Usage: pushary disconnect <${DISCONNECTABLE_AGENTS.join("|")}>`);
|
|
237
|
+
process.exit(1);
|
|
238
|
+
}
|
|
239
|
+
var result = disconnectAgent(requested, {
|
|
240
|
+
read: (path) => {
|
|
241
|
+
try {
|
|
242
|
+
return readFileSync(path, "utf-8");
|
|
243
|
+
} catch {
|
|
244
|
+
return null;
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
write: (path, contents) => writeFileSync(path, contents, "utf-8"),
|
|
248
|
+
parseToml: (raw) => parseTOML(raw),
|
|
249
|
+
stringifyToml: (config) => stringifyTOML(config),
|
|
250
|
+
remove: (path) => rmSync(path, { force: true }),
|
|
251
|
+
list: (dir) => {
|
|
252
|
+
try {
|
|
253
|
+
return readdirSync(dir);
|
|
254
|
+
} catch {
|
|
255
|
+
return [];
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
if (result.changed.length === 0) {
|
|
260
|
+
console.log(`${requested} was not connected.`);
|
|
261
|
+
} else {
|
|
262
|
+
console.log(`Disconnected ${requested}:`);
|
|
263
|
+
for (const path of result.changed) console.log(` ${path}`);
|
|
264
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#!/usr/bin/env node
|