shoplazza-ai-dev-cli 0.1.7 → 0.1.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/dist/_chunks/test.mjs +1 -3
- package/dist/cli.mjs +18 -48
- package/package.json +1 -1
package/dist/_chunks/test.mjs
CHANGED
|
@@ -495,7 +495,7 @@ async function create$2(client, args, json) {
|
|
|
495
495
|
const { named } = parseNamedArgs(args);
|
|
496
496
|
const body = {
|
|
497
497
|
name: requireArg(named, "name", "name"),
|
|
498
|
-
kind: requireArg(named, "kind", "regression|
|
|
498
|
+
kind: requireArg(named, "kind", "regression|flow|baseline|custom"),
|
|
499
499
|
selection_mode: "manual"
|
|
500
500
|
};
|
|
501
501
|
const data = await client.post("/api/test/case-sets", body);
|
|
@@ -767,7 +767,6 @@ async function mark(client, args, json) {
|
|
|
767
767
|
}
|
|
768
768
|
body["duration_ms"] = n;
|
|
769
769
|
}
|
|
770
|
-
if (typeof named["executor"] === "string") body["executor"] = named["executor"];
|
|
771
770
|
const data = await client.post("/api/test/case-results", body);
|
|
772
771
|
if (json) {
|
|
773
772
|
printJson(data);
|
|
@@ -788,7 +787,6 @@ async function batch(client, args, json) {
|
|
|
788
787
|
}
|
|
789
788
|
const payload = readFileInput(requireArg(named, "file", "path"));
|
|
790
789
|
payload["plan_id"] = planId;
|
|
791
|
-
if (typeof named["executor"] === "string") payload["executor"] = named["executor"];
|
|
792
790
|
const data = await client.post("/api/test/case-results:batch", payload);
|
|
793
791
|
if (json) {
|
|
794
792
|
printJson(data);
|
package/dist/cli.mjs
CHANGED
|
@@ -302,7 +302,14 @@ const agents = {
|
|
|
302
302
|
skillsDir: ".claude/skills",
|
|
303
303
|
globalSkillsDir: join(claudeHome, "skills"),
|
|
304
304
|
detectInstalled: async () => {
|
|
305
|
-
|
|
305
|
+
try {
|
|
306
|
+
execFileSync("which", ["claude"], { stdio: "pipe" });
|
|
307
|
+
return true;
|
|
308
|
+
} catch {}
|
|
309
|
+
if (existsSync("/Applications/Claude.app")) return true;
|
|
310
|
+
if (existsSync(join(claudeHome, "history.jsonl"))) return true;
|
|
311
|
+
if (existsSync(join(claudeHome, "projects"))) return true;
|
|
312
|
+
return false;
|
|
306
313
|
}
|
|
307
314
|
},
|
|
308
315
|
codex: {
|
|
@@ -318,8 +325,8 @@ const agents = {
|
|
|
318
325
|
cursor: {
|
|
319
326
|
name: "cursor",
|
|
320
327
|
displayName: "Cursor",
|
|
321
|
-
skillsDir: ".
|
|
322
|
-
globalSkillsDir: join(
|
|
328
|
+
skillsDir: ".claude/skills",
|
|
329
|
+
globalSkillsDir: join(claudeHome, "skills"),
|
|
323
330
|
detectInstalled: async () => {
|
|
324
331
|
return existsSync(join(home, ".cursor"));
|
|
325
332
|
}
|
|
@@ -2334,7 +2341,7 @@ async function unregisterClaudePlugin(pluginName, opts) {
|
|
|
2334
2341
|
} catch {}
|
|
2335
2342
|
}
|
|
2336
2343
|
const LOCAL_MARKETPLACE = "ai-dev-hub-local";
|
|
2337
|
-
function localPluginsRoot
|
|
2344
|
+
function localPluginsRoot(codexHome) {
|
|
2338
2345
|
return join(codexHome, "plugin-marketplaces", "local", "plugins");
|
|
2339
2346
|
}
|
|
2340
2347
|
function pluginKey(pluginName) {
|
|
@@ -2347,7 +2354,7 @@ async function registerCodexPlugin(params) {
|
|
|
2347
2354
|
skip: [".claude-plugin", ".cursor-plugin"],
|
|
2348
2355
|
skipFiles: ["hooks-claude.json", "hooks-cursor.json"]
|
|
2349
2356
|
};
|
|
2350
|
-
const dest = join(localPluginsRoot
|
|
2357
|
+
const dest = join(localPluginsRoot(home), params.pluginName);
|
|
2351
2358
|
await rm(dest, {
|
|
2352
2359
|
recursive: true,
|
|
2353
2360
|
force: true
|
|
@@ -2404,7 +2411,7 @@ async function upsertCodexMarketplaceIndex(codexHome, pluginName) {
|
|
|
2404
2411
|
}
|
|
2405
2412
|
async function unregisterCodexPlugin(pluginName) {
|
|
2406
2413
|
const home = getAgentHome("codex");
|
|
2407
|
-
const dest = join(localPluginsRoot
|
|
2414
|
+
const dest = join(localPluginsRoot(home), pluginName);
|
|
2408
2415
|
await Promise.allSettled([rm(dest, {
|
|
2409
2416
|
recursive: true,
|
|
2410
2417
|
force: true
|
|
@@ -2420,42 +2427,6 @@ async function unregisterCodexPlugin(pluginName) {
|
|
|
2420
2427
|
await writeFile(configPath, toml, "utf-8");
|
|
2421
2428
|
} catch {}
|
|
2422
2429
|
}
|
|
2423
|
-
function localPluginsRoot(cursorHome) {
|
|
2424
|
-
return join(cursorHome, "plugins", "local");
|
|
2425
|
-
}
|
|
2426
|
-
function cursorStateDbPath() {
|
|
2427
|
-
const base = platform() === "darwin" ? join(homedir(), "Library", "Application Support", "Cursor", "User", "globalStorage", "state.vscdb") : join(homedir(), ".config", "Cursor", "User", "globalStorage", "state.vscdb");
|
|
2428
|
-
return existsSync(base) ? base : null;
|
|
2429
|
-
}
|
|
2430
|
-
function clearCursorSkillCache() {
|
|
2431
|
-
const db = cursorStateDbPath();
|
|
2432
|
-
if (!db) return;
|
|
2433
|
-
try {
|
|
2434
|
-
execFileSync("sqlite3", [db, "DELETE FROM ItemTable WHERE key LIKE 'agentData.cacheStorage.agentEnvironment.slashMenuItems%';"], { stdio: "pipe" });
|
|
2435
|
-
} catch {}
|
|
2436
|
-
}
|
|
2437
|
-
async function registerCursorPlugin(params) {
|
|
2438
|
-
const dest = join(localPluginsRoot(getAgentHome("cursor")), params.pluginName);
|
|
2439
|
-
await rm(dest, {
|
|
2440
|
-
recursive: true,
|
|
2441
|
-
force: true
|
|
2442
|
-
});
|
|
2443
|
-
await copyDirRecursive$1(params.installPath, dest, {
|
|
2444
|
-
skip: [".claude-plugin", ".codex-plugin"],
|
|
2445
|
-
skipFiles: ["hooks-claude.json", "hooks-codex.json"]
|
|
2446
|
-
});
|
|
2447
|
-
clearCursorSkillCache();
|
|
2448
|
-
}
|
|
2449
|
-
async function unregisterCursorPlugin(pluginName) {
|
|
2450
|
-
const dest = join(localPluginsRoot(getAgentHome("cursor")), pluginName);
|
|
2451
|
-
try {
|
|
2452
|
-
await rm(dest, {
|
|
2453
|
-
recursive: true,
|
|
2454
|
-
force: true
|
|
2455
|
-
});
|
|
2456
|
-
} catch {}
|
|
2457
|
-
clearCursorSkillCache();
|
|
2458
|
-
}
|
|
2459
2430
|
async function installPlugin(ref, opts) {
|
|
2460
2431
|
const cfg = loadConfig();
|
|
2461
2432
|
const { buffer: tarball, commitSha } = await fetchPluginArchive(ref, cfg.portal, cfg.token);
|
|
@@ -2567,6 +2538,7 @@ function componentDisplayName(c) {
|
|
|
2567
2538
|
function buildPreflightList(pluginCanonical, components, opts) {
|
|
2568
2539
|
const preflight = [];
|
|
2569
2540
|
for (const agent of opts.agents) {
|
|
2541
|
+
if (agent === "claude-code" || agent === "cursor") continue;
|
|
2570
2542
|
for (const skillName of components.skills) {
|
|
2571
2543
|
const c = {
|
|
2572
2544
|
kind: "plugin-skill",
|
|
@@ -2804,10 +2776,6 @@ async function commitPluginInstall(params) {
|
|
|
2804
2776
|
installPath: pluginCanonical,
|
|
2805
2777
|
version
|
|
2806
2778
|
}).catch((e) => warn(`codex plugin registration failed: ${e instanceof Error ? e.message : String(e)}`));
|
|
2807
|
-
if (opts.agents.includes("cursor")) await registerCursorPlugin({
|
|
2808
|
-
pluginName,
|
|
2809
|
-
installPath: pluginCanonical
|
|
2810
|
-
}).catch((e) => warn(`cursor plugin registration failed: ${e instanceof Error ? e.message : String(e)}`));
|
|
2811
2779
|
await ensureForgeCliWrapper().catch((e) => warn(`forge-cli.sh wrapper generation failed: ${e instanceof Error ? e.message : String(e)}`));
|
|
2812
2780
|
return {
|
|
2813
2781
|
ledger,
|
|
@@ -5945,12 +5913,15 @@ async function scanStore(cwd, agentFilter) {
|
|
|
5945
5913
|
else if (c.type === "agent-manifest" || c.type === "agent-deps-dir") components.agents.push(c.name);
|
|
5946
5914
|
else if (c.type === "rule-manifest" || c.type === "rule-deps-dir") components.rules.push(c.name);
|
|
5947
5915
|
const links = await collectPluginLinks(canonical, installedComponents, agentList, cwd);
|
|
5916
|
+
const NATIVE_REG_AGENTS = new Set(["claude-code", "cursor"]);
|
|
5917
|
+
const agentsFromNative = (ledger.install_modes ?? []).filter((a) => NATIVE_REG_AGENTS.has(a) && agentList.includes(a));
|
|
5918
|
+
const allAgents = Array.from(new Set([...uniqueAgents(links), ...agentsFromNative]));
|
|
5948
5919
|
plugins.push({
|
|
5949
5920
|
name: ledger.name,
|
|
5950
5921
|
ref: ledger.ref,
|
|
5951
5922
|
canonical,
|
|
5952
5923
|
components,
|
|
5953
|
-
agents:
|
|
5924
|
+
agents: allAgents,
|
|
5954
5925
|
links
|
|
5955
5926
|
});
|
|
5956
5927
|
}
|
|
@@ -6362,7 +6333,6 @@ async function uninstallPlugin(plugin, cwd, agentFilter) {
|
|
|
6362
6333
|
if (installModes.includes("codex")) for (const scope of ["project", "global"]) await cleanupCodexConfigToml(ledger, scope, cwd);
|
|
6363
6334
|
const warnUnregister = (agent) => (e) => M.warn(`${agent} plugin unregistration failed: ${e instanceof Error ? e.message : String(e)}`);
|
|
6364
6335
|
if (installModes.includes("claude-code") || installModes.includes("cursor")) await unregisterClaudePlugin(plugin.name, { cwd }).catch(warnUnregister("claude-code"));
|
|
6365
|
-
if (installModes.includes("cursor")) await unregisterCursorPlugin(plugin.name).catch(warnUnregister("cursor"));
|
|
6366
6336
|
if (installModes.includes("codex")) await unregisterCodexPlugin(plugin.name).catch(warnUnregister("codex"));
|
|
6367
6337
|
await rm(plugin.canonical, {
|
|
6368
6338
|
recursive: true,
|