mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-05-12 14:20:17 +00:00
feat: add agent stats & metadata to manifest (#1501)
Enrich each agent entry with curated metadata fields: creator, repo, license, created/added dates, GitHub stars, language, runtime, category, tagline, and tags. This helps users compare and choose agents. - Extend AgentDef interface with 12 optional metadata fields - Add metadata to all 6 agents in manifest.json - Add type validation tests for new fields - Bump CLI version 0.5.12 → 0.5.13 Co-authored-by: lab <6723574+louisgv@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
9f172ffd12
commit
6ae650b5e8
4 changed files with 187 additions and 20 deletions
|
|
@ -421,6 +421,102 @@ describe("Interactive prompts structure", () => {
|
|||
}
|
||||
});
|
||||
|
||||
// ── Agent metadata field types ────────────────────────────────────────
|
||||
|
||||
describe("Agent metadata field types (when present)", () => {
|
||||
for (const [key, agent] of allAgents) {
|
||||
const a = agent as any;
|
||||
|
||||
if (a.creator !== undefined) {
|
||||
it(`agent "${key}" creator should be a non-empty string`, () => {
|
||||
expect(typeof a.creator).toBe("string");
|
||||
expect(a.creator.length).toBeGreaterThan(0);
|
||||
});
|
||||
}
|
||||
|
||||
if (a.repo !== undefined) {
|
||||
it(`agent "${key}" repo should match owner/repo format`, () => {
|
||||
expect(typeof a.repo).toBe("string");
|
||||
expect(a.repo).toMatch(/^[A-Za-z0-9._-]+\/[A-Za-z0-9._-]+$/);
|
||||
});
|
||||
}
|
||||
|
||||
if (a.license !== undefined) {
|
||||
it(`agent "${key}" license should be a non-empty string`, () => {
|
||||
expect(typeof a.license).toBe("string");
|
||||
expect(a.license.length).toBeGreaterThan(0);
|
||||
});
|
||||
}
|
||||
|
||||
if (a.created !== undefined) {
|
||||
it(`agent "${key}" created should be YYYY-MM format`, () => {
|
||||
expect(typeof a.created).toBe("string");
|
||||
expect(a.created).toMatch(/^\d{4}-\d{2}$/);
|
||||
});
|
||||
}
|
||||
|
||||
if (a.added !== undefined) {
|
||||
it(`agent "${key}" added should be YYYY-MM format`, () => {
|
||||
expect(typeof a.added).toBe("string");
|
||||
expect(a.added).toMatch(/^\d{4}-\d{2}$/);
|
||||
});
|
||||
}
|
||||
|
||||
if (a.github_stars !== undefined) {
|
||||
it(`agent "${key}" github_stars should be a non-negative number`, () => {
|
||||
expect(typeof a.github_stars).toBe("number");
|
||||
expect(a.github_stars).toBeGreaterThanOrEqual(0);
|
||||
expect(Number.isInteger(a.github_stars)).toBe(true);
|
||||
});
|
||||
}
|
||||
|
||||
if (a.stars_updated !== undefined) {
|
||||
it(`agent "${key}" stars_updated should be YYYY-MM-DD format`, () => {
|
||||
expect(typeof a.stars_updated).toBe("string");
|
||||
expect(a.stars_updated).toMatch(/^\d{4}-\d{2}-\d{2}$/);
|
||||
});
|
||||
}
|
||||
|
||||
if (a.language !== undefined) {
|
||||
it(`agent "${key}" language should be a non-empty string`, () => {
|
||||
expect(typeof a.language).toBe("string");
|
||||
expect(a.language.length).toBeGreaterThan(0);
|
||||
});
|
||||
}
|
||||
|
||||
if (a.runtime !== undefined) {
|
||||
it(`agent "${key}" runtime should be a non-empty string`, () => {
|
||||
expect(typeof a.runtime).toBe("string");
|
||||
expect(a.runtime.length).toBeGreaterThan(0);
|
||||
});
|
||||
}
|
||||
|
||||
if (a.category !== undefined) {
|
||||
it(`agent "${key}" category should be cli, tui, or ide-extension`, () => {
|
||||
expect(typeof a.category).toBe("string");
|
||||
expect(["cli", "tui", "ide-extension"]).toContain(a.category);
|
||||
});
|
||||
}
|
||||
|
||||
if (a.tagline !== undefined) {
|
||||
it(`agent "${key}" tagline should be a non-empty string`, () => {
|
||||
expect(typeof a.tagline).toBe("string");
|
||||
expect(a.tagline.length).toBeGreaterThan(0);
|
||||
});
|
||||
}
|
||||
|
||||
if (a.tags !== undefined) {
|
||||
it(`agent "${key}" tags should be an array of non-empty strings`, () => {
|
||||
expect(Array.isArray(a.tags)).toBe(true);
|
||||
for (const tag of a.tags) {
|
||||
expect(typeof tag).toBe("string");
|
||||
expect(tag.length).toBeGreaterThan(0);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// ── Config files structure ────────────────────────────────────────────────
|
||||
|
||||
describe("Config files structure", () => {
|
||||
|
|
|
|||
|
|
@ -19,6 +19,18 @@ export interface AgentDef {
|
|||
notes?: string;
|
||||
icon?: string;
|
||||
featured_cloud?: string[];
|
||||
creator?: string;
|
||||
repo?: string;
|
||||
license?: string;
|
||||
created?: string;
|
||||
added?: string;
|
||||
github_stars?: number;
|
||||
stars_updated?: string;
|
||||
language?: string;
|
||||
runtime?: string;
|
||||
category?: string;
|
||||
tagline?: string;
|
||||
tags?: string[];
|
||||
}
|
||||
|
||||
export interface CloudDef {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue