New page plugin: AIHOT's Token 羊毛 (free model allowances), sorted into "ready" / "plugin to set up" / "no plugin" against the user's own magpie plugins. Only the vendors in src/allowlist.js are shown; anything else (relays included) is dropped before it reaches the page. AIHOT's written approval (2026-11-10) is quoted on the PR: free, no ads or sponsors, each user reads it once on their own computer, no proxy, mirror or redistribution, credited in the footer. Run at 07da91b0 (on mote): - bun test packages/free-tokens: 62 pass. bun scripts/check.mjs free-tokens: ok. - The page served with magpie's page CSP in a sandbox="allow-scripts" frame, Chromium and WebKit: tiles 1/2/1 for a fixture of MiniMax (signed in, checked in today), ZCode (installed, not signed in), Zed (not installed), DeepSeek (no plugin) and an unlisted relay (dropped); install popover gives @magpie-community/opencode-zed-auth, login popover "magpie plugin login zcode"; a title holding <img onerror> is shown as text; brand icons load; no dialog. - Every mapped package checked: 8 on npm, 5 on the dist branch, and each pid is the package's provider id. - Broken by hand: checkin null guard removed, title unescaped, Zed's npm name unscoped; each turns a test red. Not tried: a real magpie window with the plugin installed, and the live aihot.news route (no network in the run). Co-authored-by: sljdxde <sljdxde@users.noreply.github.com>
12 lines
466 B
JavaScript
12 lines
466 B
JavaScript
import { test } from "bun:test";
|
|
import assert from "node:assert/strict";
|
|
import { MAPPING } from "../src/mapping.js";
|
|
|
|
test("every mapping npm is a scoped package (never a bare short name)", () => {
|
|
for (const [k, v] of Object.entries(MAPPING)) {
|
|
assert.match(v.npm, /^@[a-z0-9][\w.-]*\/[a-z0-9][\w.-]*$/i, `${k}: npm=${v.npm}`);
|
|
assert.equal(v.cli, undefined, `${k}: cli field must be removed`);
|
|
assert.ok(v.pid && v.name, `${k}: pid/name`);
|
|
}
|
|
});
|