Skip to content

Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.

fix(ui): installing a skill from a community card now records its origin

Harald6d652e06f6fe
diff --git a/jarvis/ui/web/frontend/src/views/PluginsCommunity.test.tsx b/jarvis/ui/web/frontend/src/views/PluginsCommunity.test.tsx
index aa34fa4184..886dde5d4c 100644
--- a/jarvis/ui/web/frontend/src/views/PluginsCommunity.test.tsx
+++ b/jarvis/ui/web/frontend/src/views/PluginsCommunity.test.tsx
@@ -65,11 +65,11 @@ function installFetchMock(overrides?: Partial<CommunityResponse>) {
json: async () => ({ ok: true, plugin: { id: "todo-fox" } }),
} as Response;
}
- if (url === "/api/skills/catalog/install") {
+ if (url === "/api/marketplace/community/install/three-point-check") {
return {
ok: true,
status: 200,
- json: async () => ({ ok: true, name: "three-point-check" }),
+ json: async () => ({ ok: true, kind: "skill", id: "three-point-check" }),
} as Response;
}
throw new Error(`unexpected fetch ${method} ${url}`);
@@ -167,18 +167,18 @@ describe("CommunityTab", () => {
);
fireEvent.click(confirm!);
+ // The by-name route, not the bare catalog install: that one downloads the
+ // skill but writes no origin receipt, so a skill installed from this very
+ // card showed up in Skills with nothing saying where it came from.
await waitFor(() => {
expect(fetchMock).toHaveBeenCalledWith(
- "/api/skills/catalog/install",
+ "/api/marketplace/community/install/three-point-check",
expect.objectContaining({ method: "POST" }),
);
});
- const body = JSON.parse(
- (fetchMock.mock.calls.find(([u]) => u === "/api/skills/catalog/install")![1] as RequestInit)
- .body as string,
- );
- expect(body.name).toBe("three-point-check");
- expect(body.raw_url).toBe("https://raw.example/skills/three-point-check/SKILL.md");
+ expect(
+ fetchMock.mock.calls.some(([u]) => u === "/api/skills/catalog/install"),
+ ).toBe(false);
});
it("says honestly when it is showing a stale saved copy", async () => {
diff --git a/jarvis/ui/web/frontend/src/views/PluginsCommunity.tsx b/jarvis/ui/web/frontend/src/views/PluginsCommunity.tsx
index 5ff21f3c53..0025408085 100644
--- a/jarvis/ui/web/frontend/src/views/PluginsCommunity.tsx
+++ b/jarvis/ui/web/frontend/src/views/PluginsCommunity.tsx
@@ -233,18 +233,16 @@ export function CommunityTab() {
const skillInstallMutation = useMutation({
mutationFn: async (skill: CommunitySkillWire) => {
- // The existing skill-catalog install route does the download,
- // validation, and registry hot-swap.
- const res = await fetch("/api/skills/catalog/install", {
- method: "POST",
- headers: { "Content-Type": "application/json" },
- body: JSON.stringify({
- name: skill.name,
- title: skill.title,
- raw_url: skill.raw_url,
- source_url: skill.source_url ?? "",
- }),
- });
+ // The by-name route, same as the wallpaper below: it runs the existing
+ // catalog install (download, validation, registry hot-swap) and then
+ // writes the origin receipt. Posting to the catalog route directly
+ // skipped that receipt, so a skill installed from this card arrived
+ // with no mark on it — installed from the marketplace and unable to
+ // say so, which is the one thing this card exists to make visible.
+ const res = await fetch(
+ `/api/marketplace/community/install/${encodeURIComponent(skill.name)}`,
+ { method: "POST" },
+ );
if (!res.ok) {
const detail = await res
.json()
@@ -332,9 +330,9 @@ export function CommunityTab() {
Community marketplace
</h2>
<p className="text-xs text-muted-foreground">
- Plugins and skills published by anyone. Nothing here is reviewed by
- the {PRODUCT_NAME} team — read what a card would connect to before
- installing it.
+ Plugins, skills and wallpapers published by anyone. Nothing here is
+ reviewed by the {PRODUCT_NAME} team — read what a card would connect
+ to before installing it.
</p>
</div>
<Button
@@ -370,7 +368,7 @@ export function CommunityTab() {
<input
value={query}
onChange={(e) => setQuery(e.target.value)}
- placeholder="Search community plugins and skills…"
+ placeholder="Search community plugins, skills and wallpapers…"
className="w-full bg-transparent text-sm text-foreground outline-none placeholder:text-muted-foreground"
/>
</label>