Skip to content
Myr

Merge build/1107 into main

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by oscabriel · committed by oscabriel · parents efa96f3, 90169de · Browse files · 13 files+795 added−23 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

13 files+795 added−23 removed

  • tests:+407 added−2 removed
  • other:+388 added−21 removed

13 files+795 added−23 removed

added:apps/web/src/features/agents/setup-page.tsx+73 added
modified:apps/web/src/features/shared/layout.tsx+21 added-5 removed
added:apps/web/src/routes/agents.tsx+36 added
added:apps/web/src/routes/agents[.]md.ts+32 added
added:apps/web/test/agents.test.tsx+104 added
1/**2 * The Agents page: how each agent connects, drawn from `@repo/agent-kit`'s3 * `agentSetup`, so the page has no text of its own for a snippet4 * (principle 4); `/agents.md` is the same channels as Markdown.5 */6import { describe, expect, it } from "@effect/vitest";7import { agentSetup, agentSetupMarkdown } from "@repo/agent-kit/agent-setup";8import { Effect } from "effect";9import type { ReactElement } from "react";10import { renderToStaticMarkup } from "react-dom/server";1112import { commands } from "../src/features/agents/catalog.ts";13import { AgentSetupView } from "../src/features/agents/setup-page.tsx";14import { agentsMarkdownHandler } from "../src/routes/agents[.]md.ts";1516const platformUrl = "https://platform-test.example.workers.dev";1718const webUrl = "https://web-test.example.workers.dev";1920const channels = agentSetup({ commands, platformUrl, webUrl });2122/** The entities React writes for text, and what each reads as. */23const ENTITIES: ReadonlyMap<string, string> = new Map([24 ["&#x27;", "'"],25 ["&amp;", "&"],26 ["&gt;", ">"],27 ["&lt;", "<"],28 ["&quot;", '"'],29]);3031const decoded = (html: string) =>32 html.replaceAll(33 /&(?:#x27|amp|gt|lt|quot);/gu,34 (entity) => ENTITIES.get(entity) ?? entity35 );3637const markupOf = (element: ReactElement) => renderToStaticMarkup(element);3839/** What a reader sees: the markup without its tags, entities decoded. */40const textOf = (element: ReactElement) =>41 decoded(markupOf(element).replaceAll(/<[^>]+>/gu, ""));4243/** The text of every `<code>` on the page, in order. */44const codeOf = (element: ReactElement) =>45 [...markupOf(element).matchAll(/<code\b[^>]*>(?<body>.*?)<\/code>/gsu)].map(46 ({ groups }) => decoded(groups?.body ?? "")47 );4849describe("the Agents page", () => {50 const page = <AgentSetupView channels={channels} />;5152 it("shows every snippet agentSetup gives, and no code of its own", () => {53 expect(codeOf(page)).toStrictEqual(54 channels.flatMap(({ snippets }) => snippets.map(({ text }) => text))55 );56 });5758 it("heads each channel with its title and says when to use it", () => {59 const text = textOf(page);6061 for (const { snippets, title, useWhen } of channels) {62 expect(text).toContain(title);63 expect(text).toContain(useWhen);6465 for (const { label } of snippets) {66 expect(text).toContain(label);67 }68 }69 });7071 it("gives every snippet a button that copies it", () => {72 const buttons = markupOf(page).match(73 /<button\b[^>]*>.*?Copy.*?<\/button>/gu74 );7576 expect(buttons).toHaveLength(77 channels.reduce((count, { snippets }) => count + snippets.length, 0)78 );79 });8081 it("links the same channels as Markdown", () => {82 expect(markupOf(page)).toMatch(/<a\b[^>]*href="\/agents\.md"[^>]*>/u);83 });84});8586describe("/agents.md", () => {87 it.effect("answers the channels as Markdown for the web's own origin", () =>88 Effect.gen(function* () {89 const response = yield* Effect.promise(() =>90 agentsMarkdownHandler(platformUrl)({91 request: new Request(`${webUrl}/agents.md`),92 })93 );9495 expect(response.status).toBe(200);96 expect(response.headers.get("content-type")).toBe(97 "text/markdown; charset=utf-8"98 );99 expect(yield* Effect.promise(() => response.text())).toBe(100 agentSetupMarkdown({ commands, platformUrl, webUrl })101 );102 })103 );104});
modified:apps/web/test/routes.test.ts+2 added
38 unmodified lines
39describe("the web's own paths", () => {40 it("are found: every page and file the web serves at its top", () => {41 expect(segments).toStrictEqual([42 ".well-known",43 "agents",44 "agents.md",45 "apple-touch-icon.png",46 "assets",47 "auth",48 "favicon.ico",
23 unmodified lines
modified:apps/web/test/shared.test.tsx+30 added-1 removed
409 unmodified lines
410 expect(markup).not.toMatch(/<a\b[^>]*aria-current="page"[^>]*>Asks<\/a>/u);411 expect(markup).toContain(">Sign in</a>");412 });413414 it("links Asks, Today and Agents in the header, marking Agents current on its page", () => {415 const markup = markupOf(<SiteHeader pathname="/agents" session={null} />);416417 const links = [418 ...markup.matchAll(419 /<a\b[^>]*href="(?<href>[^"]+)"[^>]*>(?<label>[^<]+)<\/a>/gu420 ),421 ].map(({ groups }) => [groups?.href, groups?.label]);422423 expect(links).toStrictEqual([424 ["#main", "Skip to content"],425 ["/", Brand.name],426 ["/", "Asks"],427 ["/today", "Today"],428 ["/agents", "Agents"],429 ]);430 expect(markup).toMatch(/<a\b[^>]*aria-current="page"[^>]*>Agents<\/a>/u);431 expect(markup).not.toMatch(/<a\b[^>]*aria-current="page"[^>]*>Today<\/a>/u);432 });433414 it("gives the two ways in at the foot of every page: plain git and the CLI", () => {434 it("gives the command-line ways in at the foot of every page: plain git and the CLI", () => {435 const text = textOf(<SiteFooter platformUrl={platformUrl} />);436437 expect(text).toContain("Plain git: clone any project");438 expect(text).toContain(`git clone ${platformUrl}/<project>.git`);439 expect(text).toContain(`curl -fsSL ${platformUrl}/install.sh | sh`);440 });441442 it("sends a reader who wants to connect an agent to the Agents page", () => {443 const markup = markupOf(<SiteFooter platformUrl={platformUrl} />);444445 expect(markup).toMatch(/<a\b[^>]*href="\/agents"[^>]*>/u);446 expect(textOf(<SiteFooter platformUrl={platformUrl} />)).toContain(447 "Connect an agent"448 );449 });450451 it("names the paper colours the theme-color meta repeats", () => {452 expect(styles).toContain(`--background: ${themeColors.light};`);453 expect(styles).toContain(`--background: ${themeColors.dark};`);454 });
23 unmodified lines
added:packages/agent-kit/src/agent-setup.ts+177 added
1/**2 * How an agent connects to the platform, one channel at a time: remote MCP3 * for a client that signs in over OAuth, MCP over stdio through the CLI,4 * the CLI itself, a sentence any agent can be handed, and the skills. Each5 * channel says when to use it and gives the snippets to copy. The web draws6 * it as `/agents` and serves `agentSetupMarkdown` as `/agents.md`.7 *8 * Pure: the hosts hand in the CLI's commands as this package's one list9 * holds them and the two hosts' URLs. Each client's MCP JSON comes from10 * `mcpServersFor`, the builder the plugin bundles use, and every name from11 * `Brand`, the MCP server's name being `Brand.slug`.12 *13 * Client facts, as each client's docs give them: Claude Code adds a remote14 * server with `claude mcp add --transport http <name> <url>` and signs in15 * from `/mcp`; Cursor reads `.cursor/mcp.json`'s `mcpServers`, a remote16 * entry being its `url`; VS Code reads `.vscode/mcp.json`'s `servers`, a17 * remote entry being `{type: "http", url}`.18 */19import { Brand } from "@repo/brand";20import { Array as Arr } from "effect";2122import type { CommandDoc } from "./command-doc.ts";23import { mcpServersFor } from "./platform.ts";24import { page, printJson } from "./text.ts";2526export interface SetupSnippet {27 /** What the snippet is, or where it goes: a client, a file. */28 readonly label: string;29 readonly language: "sh" | "json" | "text";30 /** The text to copy, whole, with no trailing newline. */31 readonly text: string;32}3334export interface SetupChannel {35 readonly title: string;36 /** One plain sentence, no Markdown: the agent this channel is for. */37 readonly useWhen: string;38 readonly snippets: readonly SetupSnippet[];39}4041export interface SetupInput {42 /** Every CLI command, as `commandDocs` lists them. */43 readonly commands: readonly CommandDoc[];44 /** The platform's origin: its MCP endpoint and the CLI's sign-in. */45 readonly platformUrl: string;46 /** The web's origin: its Markdown, the CLI's downloads and the skills. */47 readonly webUrl: string;48}4950/** Whether the CLI has the command whose words are `words`. */51const has = (commands: readonly CommandDoc[], words: string) =>52 Arr.some(commands, ({ path }) => path.join(" ") === words);5354/** JSON as a snippet holds it: the generators' printing, without its final newline. */55const json = (value: Parameters<typeof printJson>[0]) =>56 printJson(value).trimEnd();5758const remoteMcp = ({ platformUrl }: SetupInput): SetupChannel => ({59 snippets: [60 {61 label: "Claude Code, then /mcp in a session to sign in",62 language: "sh",63 text: `claude mcp add --transport http ${Brand.slug} ${platformUrl}/mcp`,64 },65 {66 label: "Cursor, in .cursor/mcp.json",67 language: "json",68 text: json({ mcpServers: mcpServersFor(platformUrl, "cursor") }),69 },70 {71 label: "VS Code, in .vscode/mcp.json",72 language: "json",73 text: json({ servers: mcpServersFor(platformUrl, "claude") }),74 },75 ],76 title: "Remote MCP",77 useWhen: `Your client signs in over OAuth: it opens a browser once, you sign in with your account on ${Brand.name}, and it calls the platform's tools at ${platformUrl}/mcp.`,78});7980const stdioMcp = (): SetupChannel => ({81 snippets: [82 {83 label: "The server's command, once you have signed in with the CLI",84 language: "sh",85 text: `${Brand.cli} mcp`,86 },87 ],88 title: "MCP over stdio",89 useWhen: `Your client starts its MCP servers as local commands, or cannot sign in over OAuth: the CLI serves the same tools over stdio, with the token the CLI stored when you signed in.`,90});9192const theCli = ({93 commands,94 platformUrl,95 webUrl,96}: SetupInput): SetupChannel => ({97 snippets: [98 {99 label: "Install",100 language: "sh",101 // The web forwards the CLI's downloads to the platform, as `llms.txt` says.102 text: `curl -fsSL ${webUrl}/install.sh | sh`,103 },104 ...(has(commands, "login")105 ? [106 {107 label: "Sign in once; git pushes with your token from then on",108 language: "sh" as const,109 text: `${Brand.cli} login --url ${platformUrl}`,110 },111 ]112 : []),113 ],114 title: "The CLI",115 useWhen: `Your agent has a shell: it finds and claims asks, checks an answer before it pushes and reads verdicts with the CLI, and pushes with git.`,116});117118const anyAgent = ({ webUrl }: SetupInput): SetupChannel => ({119 snippets: [120 {121 label: "Paste into the agent's prompt",122 language: "text",123 text: `Use ${webUrl}/llms.txt as the source of truth for ${Brand.name}: it says how to take an ask and lists every command and project. Each ask reads as Markdown at ${webUrl}/<project>/asks/<ask>.md.`,124 },125 ],126 title: "Text for any agent",127 useWhen:128 "Your agent can fetch a URL but has no MCP client or CLI set up: hand it the platform's index and it reads the rest as Markdown.",129});130131const skills = ({ webUrl }: SetupInput): SetupChannel => ({132 snippets: [133 {134 label: "Add every project's contribute skill",135 language: "sh",136 text: `npx skills add ${webUrl}`,137 },138 ],139 title: "Skills",140 useWhen: `Your agent loads skills: each project's contribute skill is listed, with its digest, at ${webUrl}/.well-known/agent-skills/index.json.`,141});142143/** Every channel, in the order the page shows them; stdio only when the CLI has `mcp`. */144export const agentSetup = (input: SetupInput): readonly SetupChannel[] => [145 remoteMcp(input),146 ...(has(input.commands, "mcp") ? [stdioMcp()] : []),147 theCli(input),148 anyAgent(input),149 skills(input),150];151152const snippetLines = ({ label, language, text }: SetupSnippet) => [153 `${label}:`,154 "",155 `\`\`\`${language}`,156 text,157 "```",158 "",159];160161const channelLines = ({ snippets, title, useWhen }: SetupChannel) => [162 `## ${title}`,163 "",164 `Use this when ${useWhen.charAt(0).toLowerCase()}${useWhen.slice(1)}`,165 "",166 ...snippets.flatMap(snippetLines),167];168169/** The same channels as one Markdown document: `/agents.md`. */170export const agentSetupMarkdown = (input: SetupInput) =>171 page([172 "# Agents",173 "",174 `> How an agent connects to ${Brand.name}: over MCP, through the CLI, with a sentence to paste, or as skills. Each section says when to use it.`,175 "",176 ...agentSetup(input).flatMap(channelLines),177 ]);
modified:packages/agent-kit/src/platform.ts+43 added-12 removed
118 unmodified lines
119 input: PlatformInput120): Effect.Effect<readonly GeneratedFile[]> =>121 skillFile(input).pipe(Effect.map((content) => [{ content, path: SKILL }]));122123// --- The MCP server, as each client's config names it ----------------------------124125/**126 * How each config spells the platform's MCP server: Claude Code's `.mcp.json`127 * (and VS Code's `servers`, the same entry), Agent Plugins 1.0's `mcp.json`,128 * and Cursor's `mcp.json`, whose remote entry is a bare `url` (its docs give129 * a `type` only for stdio).130 */131const servers = {132 "agent-plugins": {133 remote: (url: string) => ({ type: "streamable-http", url }),134 stdio: { args: ["mcp"], command: Brand.cli, type: "stdio" },135 },136 claude: {137 remote: (url: string) => ({ type: "http", url }),138 stdio: { args: ["mcp"], command: Brand.cli },139 },140 cursor: {141 remote: (url: string) => ({ url }),142 stdio: { args: ["mcp"], command: Brand.cli, type: "stdio" },143 },144} as const;145146export type McpFlavour = keyof typeof servers;147148/**149 * The `mcpServers` object a client's config holds: the platform's `/mcp`150 * over HTTP, or `<cli> mcp` over stdio without a URL, under the brand's151 * slug. The plugin bundles and the Agents page (`agent-setup.ts`) both152 * build theirs here, so no client's snippet can drift from a bundle's.153 */154export const mcpServersFor = (155 platformUrl: string | undefined,156 flavour: McpFlavour157) => ({158 [Brand.slug]:159 platformUrl === undefined160 ? servers[flavour].stdio161 : servers[flavour].remote(`${platformUrl}/mcp`),162});163164// --- The Claude Code plugin ------------------------------------------------------165166const hookCommand = (event: HookEvent) => ({167 hooks: [{ command: `${Brand.cli} hook ${event} --json`, type: "command" }],
44 unmodified lines
212 },213 { content: skill, path: `${PLUGIN}/${SKILL}` },214 {215 content: printJson({175 mcpServers: {176 [Brand.slug]:177 input.platformUrl === undefined178 ? { args: ["mcp"], command: Brand.cli }179 : { type: "http", url: `${input.platformUrl}/mcp` },180 },216 mcpServers: mcpServersFor(input.platformUrl, "claude"),217 }),218 path: `${PLUGIN}/.mcp.json`,219 },220 { content: hooksJson(), path: `${PLUGIN}/hooks/hooks.json` },
27 unmodified lines
248 { content: skill, path: `${PLUGIN}/${SKILL}` },249 {250 content: printJson({251 $schema: `${SCHEMAS}/mcp.schema.json`,216 mcpServers: {217 [Brand.slug]:218 input.platformUrl === undefined219 ? { args: ["mcp"], command: Brand.cli, type: "stdio" }220 : { type: "streamable-http", url: `${input.platformUrl}/mcp` },221 },252 mcpServers: mcpServersFor(input.platformUrl, "agent-plugins"),253 }),254 path: `${PLUGIN}/mcp.json`,255 },256 ])
1 unmodified line
added:packages/agent-kit/test/golden/agent-setup.txt+84 added
1# Agents23> How an agent connects to __NAME__: over MCP, through the CLI, with a sentence to paste, or as skills. Each section says when to use it.45## Remote MCP67Use this when your client signs in over OAuth: it opens a browser once, you sign in with your account on __NAME__, and it calls the platform's tools at https://platform-test.example.workers.dev/mcp.89Claude Code, then /mcp in a session to sign in:1011```sh12claude mcp add --transport http __SLUG__ https://platform-test.example.workers.dev/mcp13```1415Cursor, in .cursor/mcp.json:1617```json18{19 "mcpServers": {20 "__SLUG__": {21 "url": "https://platform-test.example.workers.dev/mcp"22 }23 }24}25```2627VS Code, in .vscode/mcp.json:2829```json30{31 "servers": {32 "__SLUG__": {33 "type": "http",34 "url": "https://platform-test.example.workers.dev/mcp"35 }36 }37}38```3940## MCP over stdio4142Use this when your client starts its MCP servers as local commands, or cannot sign in over OAuth: the CLI serves the same tools over stdio, with the token the CLI stored when you signed in.4344The server's command, once you have signed in with the CLI:4546```sh47__CLI__ mcp48```4950## The CLI5152Use this when your agent has a shell: it finds and claims asks, checks an answer before it pushes and reads verdicts with the CLI, and pushes with git.5354Install:5556```sh57curl -fsSL https://web-test.example.workers.dev/install.sh | sh58```5960Sign in once; git pushes with your token from then on:6162```sh63__CLI__ login --url https://platform-test.example.workers.dev64```6566## Text for any agent6768Use this when your agent can fetch a URL but has no MCP client or CLI set up: hand it the platform's index and it reads the rest as Markdown.6970Paste into the agent's prompt:7172```text73Use https://web-test.example.workers.dev/llms.txt as the source of truth for __NAME__: it says how to take an ask and lists every command and project. Each ask reads as Markdown at https://web-test.example.workers.dev/<project>/asks/<ask>.md.74```7576## Skills7778Use this when your agent loads skills: each project's contribute skill is listed, with its digest, at https://web-test.example.workers.dev/.well-known/agent-skills/index.json.7980Add every project's contribute skill:8182```sh83npx skills add https://web-test.example.workers.dev84```
added:packages/agent-kit/test/agent-setup.test.ts+177 added
1/**2 * The Agents page's one source: how each agent connects (remote MCP, MCP3 * over stdio, the CLI, text to paste, skills), each channel with when to4 * use it and the snippets to copy. A pure function of the CLI's commands5 * and the two hosts' URLs; the web draws it as `/agents` and serves it as6 * `/agents.md`, and its MCP JSON is the object the plugin bundles carry.7 */8import { NodeServices } from "@effect/platform-node";9import { describe, expect, it } from "@effect/vitest";10import { Brand } from "@repo/brand";11import { Array as Arr, Effect, Option, Schema } from "effect";1213import { agentSetup, agentSetupMarkdown } from "../src/agent-setup.ts";14import type { SetupChannel } from "../src/agent-setup.ts";15import type { CommandDoc } from "../src/command-doc.ts";16import { claudePlugin } from "../src/platform.ts";17import { commands as someCommands } from "./fixtures.ts";18import { expectGolden } from "./golden.ts";1920const platformUrl = "https://platform-test.example.workers.dev";2122const webUrl = "https://web-test.example.workers.dev";2324const login: CommandDoc = {25 flags: ["--url", "--json"],26 needsApproval: false,27 path: ["login"],28 positional: [],29 readOnly: false,30 source: "local",31 summary: "Sign in to a platform.",32};3334const mcp: CommandDoc = {35 flags: [],36 needsApproval: false,37 path: ["mcp"],38 positional: [],39 readOnly: true,40 source: "local",41 summary: "Serve the platform's tools over MCP on stdio.",42};4344const commands: readonly CommandDoc[] = [...someCommands, login, mcp];4546const channels = agentSetup({ commands, platformUrl, webUrl });4748/** The channel titled `title`; fails the test without one. */49const channel = (from: readonly SetupChannel[], title: string) =>50 Option.getOrThrow(Arr.findFirst(from, (each) => each.title === title));5152/** The snippet labelled `label` in the channel titled `title`. */53const snippet = (title: string, label: string) =>54 Option.getOrThrow(55 Arr.findFirst(channel(channels, title).snippets, (each) =>56 each.label.startsWith(label)57 )58 );5960/** A JSON object's text, decoded. */61const parsed = Schema.decodeUnknownSync(62 Schema.fromJsonString(Schema.Record(Schema.String, Schema.Unknown))63);6465/** The `.mcp.json` the Claude Code plugin carries for the same platform. */66const pluginMcpJson = claudePlugin({ commands, platformUrl }).pipe(67 Effect.map((files) =>68 Option.getOrThrow(69 Arr.findFirst(files, ({ path }) => path.endsWith("/.mcp.json"))70 )71 )72);7374describe("the Agents page's source", () => {75 it.effect("as Markdown, is the golden text", () =>76 expectGolden(77 "agent-setup",78 agentSetupMarkdown({ commands, platformUrl, webUrl })79 ).pipe(Effect.provide(NodeServices.layer))80 );8182 it("lists every channel in order, each saying when to use it", () => {83 expect(channels.map(({ title }) => title)).toStrictEqual([84 "Remote MCP",85 "MCP over stdio",86 "The CLI",87 "Text for any agent",88 "Skills",89 ]);9091 for (const each of channels) {92 expect(each.useWhen).not.toBe("");93 expect(each.snippets.length).toBeGreaterThan(0);94 }95 });9697 it("adds the platform's MCP endpoint to Claude Code under the brand's slug", () => {98 expect(snippet("Remote MCP", "Claude Code").text).toBe(99 `claude mcp add --transport http ${Brand.slug} ${platformUrl}/mcp`100 );101 });102103 it.effect(104 "gives VS Code the server the Claude Code plugin's .mcp.json carries",105 () =>106 Effect.gen(function* () {107 const plugin = yield* pluginMcpJson;108 const vscode = snippet("Remote MCP", "VS Code");109110 expect(vscode.language).toBe("json");111 expect(parsed(vscode.text)).toStrictEqual({112 servers: parsed(plugin.content).mcpServers,113 });114 expect(parsed(vscode.text)).toStrictEqual({115 servers: {116 [Brand.slug]: { type: "http", url: `${platformUrl}/mcp` },117 },118 });119 })120 );121122 it("gives Cursor its mcpServers entry with the endpoint's url", () => {123 const cursor = snippet("Remote MCP", "Cursor");124125 expect(cursor.language).toBe("json");126 expect(parsed(cursor.text)).toStrictEqual({127 mcpServers: { [Brand.slug]: { url: `${platformUrl}/mcp` } },128 });129 });130131 it("serves MCP over stdio through the CLI only when the CLI has mcp", () => {132 expect(snippet("MCP over stdio", "").text).toBe(`${Brand.cli} mcp`);133134 const without = agentSetup({135 commands: commands.filter(({ path }) => path.join(" ") !== "mcp"),136 platformUrl,137 webUrl,138 });139140 expect(without.map(({ title }) => title)).not.toContain("MCP over stdio");141 });142143 it("installs the CLI from the web and signs in to the platform", () => {144 expect(145 channel(channels, "The CLI").snippets.map(({ text }) => text)146 ).toStrictEqual([147 `curl -fsSL ${webUrl}/install.sh | sh`,148 `${Brand.cli} login --url ${platformUrl}`,149 ]);150 });151152 it("points any agent at llms.txt and each ask's Markdown", () => {153 const { text } = snippet("Text for any agent", "");154155 expect(text).toContain(`${webUrl}/llms.txt`);156 expect(text).toContain(`${webUrl}/<project>/asks/<ask>.md`);157 });158159 it("adds the skills from the web's index", () => {160 expect(snippet("Skills", "").text).toBe(`npx skills add ${webUrl}`);161 expect(channel(channels, "Skills").useWhen).toContain(162 `${webUrl}/.well-known/agent-skills/index.json`163 );164 });165166 it("writes every snippet into the Markdown whole", () => {167 const text = agentSetupMarkdown({ commands, platformUrl, webUrl });168169 for (const each of channels) {170 expect(text).toContain(`## ${each.title}`);171172 for (const { text: body } of each.snippets) {173 expect(text).toContain(body);174 }175 }176 });177});
modified:packages/protocol/src/ids.ts+6 added-4 removed
227 unmodified lines
228export type RepoPath = typeof RepoPath.Type;229230/**231 * Words a project may not be named: the web serves its own pages and files232 * at these first path segments (`/today`, `/people/<handle>`, `/auth/…`,233 * `/rpc`, `/releases/…`, `/icons/…` and the client build's `/assets/…`), so a234 * project so named would be unreachable at `<web>/<project>`. A name with a235 * dot (`llms.txt`, `install.sh`, `.well-known`) is no project's name anyway.232 * at these first path segments (`/agents`, `/today`, `/people/<handle>`,233 * `/auth/…`, `/rpc`, `/releases/…`, `/icons/…` and the client build's234 * `/assets/…`), so a project so named would be unreachable at235 * `<web>/<project>`. A name with a dot (`llms.txt`, `agents.md`,236 * `install.sh`, `.well-known`) is no project's name anyway.237 * `apps/web/test/routes.test.ts` holds this list to the web's routes.238 */239export const reservedProjectNames = [240 "agents",241 "assets",242 "auth",243 "icons",244 "people",
49 unmodified lines
modified:packages/protocol/test/domain.test.ts+10 added-1 removed
300 unmodified lines
301302 // The web serves its own pages and files at these first path segments, so303 // a project so named would be unreachable at `<web>/<project>`.304 // An ask may still take them: an ask's page is under its project.305 it.each(["assets", "auth", "icons", "people", "releases", "rpc", "today"])(305 it.each([306 "agents",307 "assets",308 "auth",309 "icons",310 "people",311 "releases",312 "rpc",313 "today",314 ])(315 "a project may not be named %j, a path the web takes for itself",316 (name) => {317 expect(refuses(ProjectName, name)).toBeTruthy();318 expect(refuses(AskId, name)).toBeFalsy();
60 unmodified lines