forge-cw 0.1.17 → 0.1.19
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/console/index.html
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
8
8
|
<title>Forge Console</title>
|
|
9
9
|
<script type="importmap">{"imports":{"preact":"/shared/preact.js","preact/hooks":"/shared/preact-hooks.js","preact/jsx-runtime":"/shared/preact-jsx-runtime.js","preact/compat":"/shared/preact-compat.js","@preact/signals":"/shared/preact-signals.js","@forge-dev/ui":"/shared/forge-dev-ui.js","@forge-dev/sdk":"/shared/forge-dev-sdk.js"}}</script>
|
|
10
|
-
<script type="module" crossorigin src="/assets/index-
|
|
10
|
+
<script type="module" crossorigin src="/assets/index-WdL2WXjO.js"></script>
|
|
11
11
|
<link rel="stylesheet" crossorigin href="/assets/index-DPf7M8cb.css">
|
|
12
12
|
<link rel="stylesheet" href="/shared/forge-dev-ui.css">
|
|
13
13
|
</head>
|
package/dist/index.js
CHANGED
|
@@ -2630,10 +2630,19 @@ function skillDirs(installPath, manifest) {
|
|
|
2630
2630
|
}
|
|
2631
2631
|
return scanDirs(join8(installPath, "skills"));
|
|
2632
2632
|
}
|
|
2633
|
-
function readSkill(reader, dir) {
|
|
2633
|
+
function readSkill(reader, dir, plugin) {
|
|
2634
2634
|
try {
|
|
2635
2635
|
const { frontmatter } = reader.parseFrontmatter(readFileSync6(join8(dir, "SKILL.md"), "utf-8"));
|
|
2636
|
-
|
|
2636
|
+
const name = String(frontmatter["name"] ?? basename2(dir));
|
|
2637
|
+
const hint = frontmatter["argument-hint"];
|
|
2638
|
+
const invocable = String(frontmatter["user-invocable"]) !== "false";
|
|
2639
|
+
return {
|
|
2640
|
+
name,
|
|
2641
|
+
description: String(frontmatter["description"] ?? ""),
|
|
2642
|
+
path: dir,
|
|
2643
|
+
...invocable ? { command: `/${plugin}:${name}` } : {},
|
|
2644
|
+
...invocable && typeof hint === "string" && hint ? { argumentHint: hint } : {}
|
|
2645
|
+
};
|
|
2637
2646
|
} catch {
|
|
2638
2647
|
return null;
|
|
2639
2648
|
}
|
|
@@ -2772,7 +2781,7 @@ async function listPlugins(reader, remoteOf) {
|
|
|
2772
2781
|
description: String(manifest["description"] ?? ""),
|
|
2773
2782
|
repo,
|
|
2774
2783
|
installs: list.map((f) => f.install),
|
|
2775
|
-
skills: skillDirs(newest.install.installPath, manifest).flatMap((dir) => readSkill(reader, dir) ?? []),
|
|
2784
|
+
skills: skillDirs(newest.install.installPath, manifest).flatMap((dir) => readSkill(reader, dir, splitPluginId(id).name) ?? []),
|
|
2776
2785
|
commands: readCommands(reader, newest.install.installPath),
|
|
2777
2786
|
project: match?.name,
|
|
2778
2787
|
contributing: match ? existsSync6(join8(match.path, "CONTRIBUTING.md")) : false,
|
|
@@ -3132,6 +3141,19 @@ function skillRoutes(reader, options = {}) {
|
|
|
3132
3141
|
const version = (await find())?.installs.find((i) => i.scope === install.scope && i.scopeRef === ref)?.version ?? install.version;
|
|
3133
3142
|
return c.json({ ok: true, version });
|
|
3134
3143
|
});
|
|
3144
|
+
app.post("/plugins/:id/uninstall", async (c) => {
|
|
3145
|
+
const id = c.req.param("id");
|
|
3146
|
+
const { scope, scopeRef } = await c.req.json().catch(() => ({}));
|
|
3147
|
+
const ref = scope === "global" ? "global" : scopeRef ?? "";
|
|
3148
|
+
const plugin = (await listPlugins(reader, remoteOf)).find((p) => p.id === id);
|
|
3149
|
+
const install = plugin?.installs.find((i) => i.scope === scope && i.scopeRef === ref);
|
|
3150
|
+
if (!plugin || !install)
|
|
3151
|
+
return c.json({ error: `${id} is not installed in ${ref || "that scope"}` }, 404);
|
|
3152
|
+
const failed = await runClaude(install.scope, ref, [["plugin", "uninstall", plugin.id, "--scope", "user"]], `Failed to uninstall ${plugin.name}`);
|
|
3153
|
+
if (failed)
|
|
3154
|
+
return c.json({ error: failed.error }, failed.status);
|
|
3155
|
+
return c.json({ ok: true });
|
|
3156
|
+
});
|
|
3135
3157
|
app.get("/marketplaces", (c) => c.json(listMarketplaces(reader)));
|
|
3136
3158
|
app.post("/marketplaces", async (c) => {
|
|
3137
3159
|
const body2 = await c.req.json().catch(() => ({}));
|