// Run with Node's test runner and Playwright on the module path; see README.md. // FakeshadowzZ on X: the Library's Claude plugins tab. A Claude Code plugin // is one row: its parts (skills, MCP servers, hooks, subagents), the agents // it is given to, a switch that turns it on or off as a whole, and a dialog // with what it holds, what magpie doesn't carry, Update and Remove (which // asks first). Find plugins posts plugins/probe and lists what it found // with an Install that posts plugins/install; a chip posts plugins/agents, // the switch plugins/on. No native "); // the switch turns every part off at once await press(page, row("code-kit").locator(".lib-switch")); await page.waitForFunction(() => document.querySelector("#view-library .lib-plugin.off")); assert.deepEqual(posts.shift(), { what: "plugins/on", body: { name: "code-kit", on: false } }); await press(page, row("code-kit").locator(".lib-switch")); await page.waitForFunction(() => !document.querySelector("#view-library .lib-plugin.off")); assert.deepEqual(posts.shift(), { what: "plugins/on", body: { name: "code-kit", on: true } }); // a chip changes its agents await press(page, row("code-kit").locator('.lib-ag[data-agent="codex"]')); await page.waitForTimeout(250); assert.deepEqual(posts.shift(), { what: "plugins/agents", body: { name: "code-kit", agents: ["claude"] } }); // find: probe, pick the new one, install await v.locator('input[data-lib="plsource"]').fill("/Users/chuan/market"); await v.locator(".lib-plfind .lib-find button").click(); await v.locator(".lib-plpick").first().waitFor(); assert.deepEqual(posts.shift(), { what: "plugins/probe", body: { source: "/Users/chuan/market" } }); assert.equal(await v.locator(".lib-plpick input:checked").count(), 1); assert.equal(await v.locator(".lib-plpick input:disabled").count(), 0); assert.deepEqual(await sideways(page), [], "sideways scroll with the finds at 420"); await v.locator(".lib-plfind .lib-probefoot button.primary", { hasText: w("Install 1 plugin") }).click(); await row("fresh-kit").waitFor(); const inst = posts.shift(); assert.equal(inst.what, "plugins/install"); assert.deepEqual(inst.body.names, ["fresh-kit"]); assert.equal(inst.body.source, "/Users/chuan/market"); // the dialog: parts, what isn't carried; Remove asks first await press(page, row("code-kit")); const d = page.locator("#modal .lib-pldetail"); await d.waitFor(); await settled(page); assert.equal((await d.locator(".lib-plleft").textContent()).trim(), "commands/ship.md — slash commands aren't carried"); await d.locator(".bar button.danger").click(); const sheet = page.locator("dialog.action-confirm"); await sheet.waitFor(); await sheet.locator("button", { hasText: w("Cancel") }).click(); await sheet.waitFor({ state: "detached" }); await page.waitForTimeout(150); assert.deepEqual(posts, [], "Cancel posts nothing"); await d.locator(".bar button.danger").click(); await sheet.waitFor(); await sheet.locator("button.danger-fill").click(); await d.waitFor({ state: "detached" }); assert.deepEqual(posts.shift(), { what: "plugins/remove", body: { name: "code-kit" } }); assert.equal(await row("code-kit").count(), 0); assert.deepEqual(posts, []); assert.deepEqual(errors, []); await ctx.close(); }); } }); }