patchcord 0.6.11 → 0.6.12
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/.claude-plugin/plugin.json +1 -1
- package/bin/patchcord.mjs +68 -1
- package/package.json +1 -1
package/bin/patchcord.mjs
CHANGED
|
@@ -177,7 +177,73 @@ function _purgeLegacyKimiProjectConfig(dir) {
|
|
|
177
177
|
} catch {}
|
|
178
178
|
}
|
|
179
179
|
|
|
180
|
-
//
|
|
180
|
+
// Cursor indexes skills from multiple trees. Leftover Codex globals
|
|
181
|
+
// (~/.agents/skills/patchcord*) and Claude colon-named plugin skills bundled
|
|
182
|
+
// inside cursor-agent's node_modules/patchcord both register duplicate slash
|
|
183
|
+
// commands (/patchcordinbox vs /patchcord-inbox). Keep only skills-cursor.
|
|
184
|
+
function _purgeCursorSkillDuplicates() {
|
|
185
|
+
const staleNames = [
|
|
186
|
+
"patchcord",
|
|
187
|
+
"patchcord-inbox",
|
|
188
|
+
"patchcord-wait",
|
|
189
|
+
"patchcord-subscribe",
|
|
190
|
+
"patchcordinbox",
|
|
191
|
+
"patchcordwait",
|
|
192
|
+
"patchcordsubscribe",
|
|
193
|
+
"patchcord:inbox",
|
|
194
|
+
"patchcord:wait",
|
|
195
|
+
"patchcord:subscribe",
|
|
196
|
+
];
|
|
197
|
+
for (const root of [
|
|
198
|
+
join(HOME, ".agents", "skills"),
|
|
199
|
+
join(HOME, ".cursor", "skills-cursor"),
|
|
200
|
+
]) {
|
|
201
|
+
for (const name of staleNames) {
|
|
202
|
+
const d = join(root, name);
|
|
203
|
+
if (!existsSync(d)) continue;
|
|
204
|
+
try { rmSync(d, { recursive: true, force: true }); } catch {}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
// cursor-agent ships patchcord@* with Claude plugin skills/ — Cursor must not
|
|
208
|
+
// index those; only per-project skills-cursor copies are valid for Cursor CLI.
|
|
209
|
+
const cursorAgentRoot = join(HOME, ".local", "share", "cursor-agent");
|
|
210
|
+
if (existsSync(cursorAgentRoot)) {
|
|
211
|
+
const walk = (dir, depth = 0) => {
|
|
212
|
+
if (depth > 8) return;
|
|
213
|
+
let entries;
|
|
214
|
+
try { entries = readdirSync(dir, { withFileTypes: true }); } catch { return; }
|
|
215
|
+
for (const ent of entries) {
|
|
216
|
+
const p = join(dir, ent.name);
|
|
217
|
+
if (ent.isDirectory()) {
|
|
218
|
+
if (ent.name === "patchcord" && dir.endsWith("node_modules")) {
|
|
219
|
+
for (const pluginSkill of ["inbox", "wait", "subscribe"]) {
|
|
220
|
+
const sd = join(p, "skills", pluginSkill);
|
|
221
|
+
if (existsSync(sd)) {
|
|
222
|
+
try { rmSync(sd, { recursive: true, force: true }); } catch {}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
continue;
|
|
226
|
+
}
|
|
227
|
+
walk(p, depth + 1);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
walk(cursorAgentRoot);
|
|
232
|
+
}
|
|
233
|
+
const syncManifest = join(HOME, ".cursor", "skills-cursor", ".sync-manifest.json");
|
|
234
|
+
if (existsSync(syncManifest)) {
|
|
235
|
+
try {
|
|
236
|
+
const obj = JSON.parse(readFileSync(syncManifest, "utf-8"));
|
|
237
|
+
if (obj?.skills) {
|
|
238
|
+
for (const stale of ["patchcord", "patchcordinbox", "patchcordwait", "patchcordsubscribe", "patchcord:inbox", "patchcord:wait", "patchcord:subscribe"]) {
|
|
239
|
+
delete obj.skills[stale];
|
|
240
|
+
}
|
|
241
|
+
writeFileSync(syncManifest, JSON.stringify(obj, null, 2) + "\n");
|
|
242
|
+
}
|
|
243
|
+
} catch {}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
181
247
|
// preserving the rest of the user's YAML. Block-style only (what Hermes writes).
|
|
182
248
|
function upsertHermesConfig(existing, url, token) {
|
|
183
249
|
const block = [
|
|
@@ -1782,6 +1848,7 @@ if (!cmd || cmd === "install" || cmd === "agent" || cmd?.startsWith("--")) {
|
|
|
1782
1848
|
const cursorSkillsRoot = join(HOME, ".cursor", "skills-cursor");
|
|
1783
1849
|
const hasCursorAgent = run("which cursor-agent");
|
|
1784
1850
|
if (hasCursorAgent || existsSync(cursorSkillsRoot)) {
|
|
1851
|
+
_purgeCursorSkillDuplicates();
|
|
1785
1852
|
mkdirSync(cursorSkillsRoot, { recursive: true });
|
|
1786
1853
|
const cursorInboxDir = join(cursorSkillsRoot, "patchcord-inbox");
|
|
1787
1854
|
const cursorWaitDir = join(cursorSkillsRoot, "patchcord-wait");
|
package/package.json
CHANGED