Skip to content
Merged
Show file tree
Hide file tree
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
23 changes: 16 additions & 7 deletions src/host/extension-catalog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,19 @@ export type OfficialExtension = {
manifestUrl: string;
};

export const OFFICIAL_EXTENSIONS: readonly OfficialExtension[] = [{
id: "scheduler",
name: "Scheduler",
description: "Create normal ZCode tasks from timezone-aware cron schedules while ZCode is open.",
repositoryUrl: "https://github.com/notmike101/zcode-scheduler",
manifestUrl: "https://github.com/notmike101/zcode-scheduler/releases/latest/download/extension-update.json",
}];
export const OFFICIAL_EXTENSIONS: readonly OfficialExtension[] = [
{
id: "scheduler",
name: "Scheduler",
description: "Create normal ZCode tasks from timezone-aware cron schedules while ZCode is open.",
repositoryUrl: "https://github.com/notmike101/zcode-scheduler",
manifestUrl: "https://github.com/notmike101/zcode-scheduler/releases/latest/download/extension-update.json",
},
{
id: "zcode-tps",
name: "Token Speed",
description: "Show live estimates and exact provider-reported token throughput for ZCode sessions.",
repositoryUrl: "https://github.com/notmike101/zcode-tps-extension",
manifestUrl: "https://github.com/notmike101/zcode-tps-extension/releases/latest/download/extension-update.json",
},
];
27 changes: 27 additions & 0 deletions tests/extension-catalog.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import {describe, expect, test} from "bun:test";
import {OFFICIAL_EXTENSIONS} from "../src/host/extension-catalog.ts";

describe("official extension catalog", () => {
test("uses unique ids and immutable HTTPS release-feed locations", () => {
expect(new Set(OFFICIAL_EXTENSIONS.map(({id}) => id)).size).toBe(OFFICIAL_EXTENSIONS.length);
for (const extension of OFFICIAL_EXTENSIONS) {
const repository = new URL(extension.repositoryUrl);
const manifest = new URL(extension.manifestUrl);
expect(repository.protocol).toBe("https:");
expect(repository.hostname).toBe("github.com");
expect(manifest.protocol).toBe("https:");
expect(manifest.hostname).toBe("github.com");
expect(manifest.pathname).toBe(`/${repository.pathname.slice(1)}/releases/latest/download/extension-update.json`);
}
});

test("lists Token Speed by its public release feed", () => {
expect(OFFICIAL_EXTENSIONS).toContainEqual({
id: "zcode-tps",
name: "Token Speed",
description: "Show live estimates and exact provider-reported token throughput for ZCode sessions.",
repositoryUrl: "https://github.com/notmike101/zcode-tps-extension",
manifestUrl: "https://github.com/notmike101/zcode-tps-extension/releases/latest/download/extension-update.json",
});
});
});