Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ async function writeJson(file, value) {
await writeFile(file, `${JSON.stringify(value, null, 2)}\n`);
}

// --- Fixture primitives -----------------------------------------------------
// Each helper owns exactly one layer of the package (catalog entry, plugin
// manifest, skill folder) and every helper starts from a valid default, so a
// test mutates one field and can attribute every emitted code to that mutation.
Expand Down Expand Up @@ -124,8 +123,6 @@ async function completePlugin(t, { directory = "sample-plugin", manifest, skill
return pluginRoot;
}

// --- Happy paths ------------------------------------------------------------

test("accepts a complete local marketplace", async (t) => {
const result = await validateTarget(await completeMarketplace(t));
assert.deepEqual(result.errors, []);
Expand All @@ -151,8 +148,6 @@ test("plugin root target checks the manifest name against the folder name", asyn
assert.deepEqual(errorCodes(result), new Set(["plugin-name-mismatch"]));
});

// --- Target detection -------------------------------------------------------

test("rejects a directory that is neither a marketplace nor a plugin", async (t) => {
const result = await validateTarget(await tempRoot(t));
assert.deepEqual(errorCodes(result), new Set(["unknown-target"]));
Expand All @@ -166,8 +161,6 @@ test("treats a non-directory path component as an absent entry point", async (t)
assert.deepEqual(errorCodes(result), new Set(["unknown-target"]));
});

// --- Catalog-level checks ---------------------------------------------------

test("rejects an unparsable marketplace file", async (t) => {
const root = await tempRoot(t);
await mkdir(path.join(root, ".agents", "plugins"), { recursive: true });
Expand Down Expand Up @@ -252,8 +245,6 @@ test("reports a local source whose manifest directory is a file", async (t) => {
assert.deepEqual(errorCodes(result), new Set(["missing-plugin-manifest"]));
});

// --- Remote sources ---------------------------------------------------------

test("accepts complete remote sources but warns that they are not expanded", async (t) => {
const root = await tempRoot(t);
await writeMarketplace(root, {
Expand Down Expand Up @@ -300,8 +291,6 @@ test("rejects an entry with no source at all", async (t) => {
assert.deepEqual(errorCodes(result), new Set(["unsupported-marketplace-source"]));
});

// --- Plugin manifest checks -------------------------------------------------

test("requires a plugin name", async (t) => {
const result = await validateTarget(await completeMarketplace(t, { manifest: { name: "" } }));
assert.deepEqual(errorCodes(result), new Set(["missing-plugin-name", "plugin-name-mismatch"]));
Expand Down Expand Up @@ -346,8 +335,6 @@ for (const field of ["displayName", "shortDescription", "longDescription", "deve
});
}

// --- Declared component paths (apps, mcpServers, skills) --------------------

test("accepts a declared apps file that exists", async (t) => {
const root = await completeMarketplace(t, { manifest: { apps: "./.app.json" } });
await writeJson(path.join(root, "plugins", "sample-plugin", ".app.json"), { servers: {} });
Expand Down Expand Up @@ -420,8 +407,6 @@ test("reports an uninspectable skills path rather than crashing", async (t) => {
assert.deepEqual(errorCodes(result), new Set(["unreadable-path"]));
});

// --- Skill checks -----------------------------------------------------------

test("rejects missing skill frontmatter", async (t) => {
const result = await validateTarget(await completeMarketplace(t, { skill: { frontmatter: false } }));
assert.deepEqual(errorCodes(result), new Set(["missing-skill-frontmatter"]));
Expand Down Expand Up @@ -487,8 +472,6 @@ test("rejects the same skill name declared twice inside one plugin", async (t) =
assert.deepEqual(errorCodes(result), new Set(["duplicate-skill-name", "skill-name-mismatch"]));
});

// --- Manifest layouts and precedence ----------------------------------------

const AGENT_SCHEMA = "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json";

function agentManifest(overrides = {}) {
Expand Down Expand Up @@ -709,8 +692,6 @@ test("accepts an inline mcpServers map and a skills list in a Claude manifest",
assert.deepEqual(result.errors, []);
});

// --- Catalog layouts --------------------------------------------------------

test("prefers api_marketplace.json over a Claude catalog", async (t) => {
const root = await tempRoot(t);
await writeJson(path.join(root, ".agents", "plugins", "api_marketplace.json"), { name: "sample", plugins: [marketplaceEntry()] });
Expand Down Expand Up @@ -809,8 +790,6 @@ test("warns that a Claude catalog is shadowed by .agents/plugins/marketplace.jso
assert.equal(result.catalog, path.join(root, ".agents", "plugins", "marketplace.json"));
});

// --- Command-line behavior --------------------------------------------------

test("command line reports PASS and exits zero for a valid target", async (t) => {
const root = await completeMarketplace(t);
const { stdout } = await run(process.execPath, [VALIDATOR, root]);
Expand Down
Loading