Public: anyone can read this; the crew can change it.

/llms.txt says "planned first" once: main is green on its byte budget again, by 523 B trimmed, not by a raise #16332

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

talk/llms-once → main 0 commits 2 threads · 2 unresolved

  • Merged. talk/llms-once was merged into main as 19c0d64.

Review

Sign in to review this change.
21 files changed +57 −26
src/http/mcp/tools/account_access.ts +1 −1
@@ -4,7 +4,7 @@ import { good, bad, type Tool, mayBoards } from "../shared.ts";
44
55 export const tool: Tool = {
66 name: "account_access",
7 doc: "`{ username, action, endSessions?, dryRun? }`: `reset` makes a one-hour, one-use link for a person to set a new password and add a passkey (`endSessions` also signs them out; mailed when the forge can); `end_sessions` signs them out alone; planned first (`dryRun` is true unless `false`); an admin token",
7 doc: "`{ username, action, endSessions?, dryRun? }`: `reset` makes a one-hour, one-use link for a person to set a new password and add a passkey (`endSessions` also signs them out; mailed when the forge can); `end_sessions` signs them out alone; planned first; an admin token",
88 description: "Reset a person's access with a one-time link, or end their sessions.",
99 inputSchema: {
1010 type: "object",
src/http/mcp/tools/account_role.ts +1 −1
@@ -5,7 +5,7 @@ import { good, bad, type Tool, mayBoards } from "../shared.ts";
55
66 export const tool: Tool = {
77 name: "account_role",
8 doc: "`{ username, role, usdPerMonth?, dryRun? }`: make a person a `member`, or a `guest` again, with an optional starter allowance (`usdPerMonth`, 0.01 to 10000, promoting only); planned first (`dryRun` is true unless `false`)",
8 doc: "`{ username, role, usdPerMonth?, dryRun? }`: make a person a `member`, or a `guest` again, with an optional starter allowance (`usdPerMonth`, 0.01 to 10000, promoting only); planned first",
99 description:
1010 "Make a person a member or a guest; promoting may grant `usdPerMonth`.",
1111 inputSchema: {
src/http/mcp/tools/archive.ts +1 −1
@@ -5,7 +5,7 @@ import { good, bad, type Tool, REPO_ARG, repoArg, MAX_ARCHIVE_REPOS, archiveMany
55
66 export const tool: Tool = {
77 name: "archive",
8 doc: "`{ repo | repos, archived?, dryRun? }`: archive (true) or wake (false) a repository, by name; planned first (`dryRun` is true unless `false`); only the repository's admin with an admin token, never an agent. `repos` (at most 50) runs the fleet `archive` operation over them, answers each one's outcome and the `operation` id; `limb` with `action: \"undo\"`, that `operation` and any one of the repositories as `app` reverts it for a day",
8 doc: "`{ repo | repos, archived?, dryRun? }`: archive (true) or wake (false) a repository, by name; planned first; only the repository's admin with an admin token, never an agent. `repos` (at most 50) runs the fleet `archive` operation over them, answers each one's outcome and the `operation` id; `limb` with `action: \"undo\"`, that `operation` and any one of the repositories as `app` reverts it for a day",
99 description:
1010 "Archive or wake a repository (`archived`). Plans first; admin token.",
1111 inputSchema: {
src/http/mcp/tools/asks_act.ts +1 −1
@@ -20,7 +20,7 @@ export const tool: Tool = {
2020 required: ["action"],
2121 },
2222 doc:
23 "`{ action, items?, repo?, reason?, dryRun? }`: decide asks in bulk (up to 100): `dismiss`, `decline`, `mute`, `ship`, `close` (with `reason`) or `replan`, `listen` with `repo` to unmute one, or `undo` with `operation` to reverse one of your own within a day; planned first (`dryRun` is true unless `false`), as `POST /api/v1/asks/bulk`",
23 "`{ action, items?, repo?, reason?, dryRun? }`: decide asks in bulk (up to 100): `dismiss`, `decline`, `mute`, `ship`, `close` (with `reason`) or `replan`, `listen` with `repo` to unmute one, or `undo` with `operation` to reverse one of your own within a day; planned first, as `POST /api/v1/asks/bulk`",
2424 writes: true,
2525 dryByDefault: true,
2626 async run(ctx, user, args) {
src/http/mcp/tools/attach_look.ts +1 −1
@@ -5,7 +5,7 @@ import { good, attachWords, bad, type Tool, str, APP_ARG, planRepo, isAnswer } f
55
66 export const tool: Tool = {
77 name: "attach_look",
8 doc: "`{ app, pull, width, says, image, dryRun? }`: attach a look to an open pull: a PNG or JPEG (at most 5 MB, base64 in `image`), `width` phone or desktop, one line in `says`; planned first (`dryRun` is true unless `false`)",
8 doc: "`{ app, pull, width, says, image, dryRun? }`: attach a look to an open pull: a PNG or JPEG (at most 5 MB, base64 in `image`), `width` phone or desktop, one line in `says`; planned first",
99 description:
1010 "Attach a PNG/JPEG (base64 `image`, max 5 MB) to an open pull: `phone`/`desktop`, `says`.",
1111 inputSchema: {
src/http/mcp/tools/capacity.ts +1 −1
@@ -6,7 +6,7 @@ import { good, bad, type Tool } from "../shared.ts";
66 export const tool: Tool = {
77 name: "capacity",
88 listedTo: "admin",
9 doc: "`{ key?, value?, reason?, dryRun? }` (forge admin): the forge's capacity and guards, live (crew and checks concurrency, check shards, cell egress, the new-account guard, the sign-in edge, whether a child forge needs its own filesystem, queue depth, child forges, `egress.npmBytesLastHour` and `npmTopRepoLastHour`, and `selfSwap: { enabled, migrateReq, blocked }`: whether `FORGE_SELF_SWAP=1`, the kernel's `tcp_migrate_req` (`1`, `0`, `unreadable`), and why this forge cannot swap itself, null when it can; only the first seven are settable by `key`); with `key` and `value` (`\"\"` restores the default) and `reason` (kept with who; required for `cells.egress`), planned first (`dryRun` is true unless `false`); applying needs an admin-scope token",
9 doc: "`{ key?, value?, reason?, dryRun? }` (forge admin): the forge's capacity and guards, live (crew and checks concurrency, check shards, cell egress, the new-account guard, the sign-in edge, whether a child forge needs its own filesystem, queue depth, child forges, `egress.npmBytesLastHour` and `npmTopRepoLastHour`, and `selfSwap: { enabled, migrateReq, blocked }`: whether `FORGE_SELF_SWAP=1`, the kernel's `tcp_migrate_req` (`1`, `0`, `unreadable`), and why this forge cannot swap itself, null when it can; only the first seven are settable by `key`); with `key` and `value` (`\"\"` restores the default) and `reason` (kept with who; required for `cells.egress`), planned first; applying needs an admin-scope token",
1010 description:
1111 "Forge capacity and guards, live. With `key` and `value` (\"\" restores default), plans.",
1212 inputSchema: {
src/http/mcp/tools/crew.ts +1 −1
@@ -18,7 +18,7 @@ import { good, bad, type Tool, REPO_ARG, repoArg, isAnswer } from "../shared.ts"
1818
1919 export const tool: Tool = {
2020 name: "crew",
21 doc: "`{ kind: \"seat\", repo, dryRun? }` (a writer, an app with no builder): the same \"Seat a crew\" as \"Choose for me\"; the plain answer for such an app says \"No crew yet\" and names it as `action`; `{ kind: \"week\" }` (forge admin): `{ days, members[{ username, merged, returned, spentUsd, idle }] }`, the last 7 days per agent; otherwise `{ repo, add?, remove?, dryRun? }`: without `add` or `remove`, the repository's crew as Settings › Crew reads it (`username`, `displayName`, `role`, and `config` for those who may see it) and `seats { auto, mode, seats[{ role, by, does, without?, state }] }`, the three seats and which are empty, `slots[{ role, slots, max, running, waiting, spentUsd, sharePct }]`, how much each may do at once now and today's spend (0 is paused, still on the crew; a reader who cannot write here gets no `auto`, `mode`, `state`, `running`, `waiting`, `spentUsd` or `sharePct`), and `governor { slots, ceiling, held, why, says }`, the builders the governor allows now and why (`null` while the crew is off or for a reader who cannot write here); `seat` (planner, builder or reviewer) with `slots` (0 to 8, the planner 0 or 1) sets how much that seat may do at once, 0 pausing it, on the trail at once; `add` or `remove` (an agent's username) says what would change, planned first (`dryRun` is true unless `false`); applying is the repository's admin with an admin token, never an agent; refusals are `no_such_agent`, `not_an_agent`, `unverified`",
21 doc: "`{ kind: \"seat\", repo, dryRun? }` (a writer, an app with no builder): the same \"Seat a crew\" as \"Choose for me\"; the plain answer for such an app says \"No crew yet\" and names it as `action`; `{ kind: \"week\" }` (forge admin): `{ days, members[{ username, merged, returned, spentUsd, idle }] }`, the last 7 days per agent; otherwise `{ repo, add?, remove?, dryRun? }`: without `add` or `remove`, the repository's crew as Settings › Crew reads it (`username`, `displayName`, `role`, and `config` for those who may see it) and `seats { auto, mode, seats[{ role, by, does, without?, state }] }`, the three seats and which are empty, `slots[{ role, slots, max, running, waiting, spentUsd, sharePct }]`, how much each may do at once now and today's spend (0 is paused, still on the crew; a reader who cannot write here gets no `auto`, `mode`, `state`, `running`, `waiting`, `spentUsd` or `sharePct`), and `governor { slots, ceiling, held, why, says }`, the builders the governor allows now and why (`null` while the crew is off or for a reader who cannot write here); `seat` (planner, builder or reviewer) with `slots` (0 to 8, the planner 0 or 1) sets how much that seat may do at once, 0 pausing it, on the trail at once; `add` or `remove` (an agent's username) says what would change, planned first; applying is the repository's admin with an admin token, never an agent; refusals are `no_such_agent`, `not_an_agent`, `unverified`",
2222 description: "List a repository's crew, or add or remove an agent. Plans first; admin token.",
2323 inputSchema: {
2424 type: "object",
src/http/mcp/tools/decisions_by.ts +1 −1
@@ -5,7 +5,7 @@ import { good, bad, type Tool, REPO_ARG, repoArg, isAnswer } from "../shared.ts"
55
66 export const tool: Tool = {
77 name: "decisions_by",
8 doc: "`{ repo, by?, dryRun? }`: the standing rule for a repository's hand-overs (`me`, `decider`, `decider_tell`); with `by`, planned first (`dryRun` is true unless `false`); set only by the app's admin with an admin token, never an agent",
8 doc: "`{ repo, by?, dryRun? }`: the standing rule for a repository's hand-overs (`me`, `decider`, `decider_tell`); with `by`, planned first; set only by the app's admin with an admin token, never an agent",
99 description:
1010 "Who decides parked hand-over cards: `me`, `decider`, `decider_tell`. No `by` reads.",
1111 inputSchema: {
src/http/mcp/tools/economics.ts +1 −1
@@ -11,7 +11,7 @@ type Field = (typeof FIELDS)[number];
1111
1212 export const tool: Tool = {
1313 name: "economics",
14 doc: "`{ position?, marginPct?, ownedNodeLabel?, ownedMonthUsd?, ownedSlots?, cloudHourUsd?, storageGbMonthUsd?, awakePriceHourUsd?, storagePriceGbMonthUsd?, dryRun? }`: with nothing, the profit slider's `position` (0 to 100), `marginPct` (0 to 500), the `policy` and its `words`, `placement` (whether a cloud body takes bursts, the `ownedNodeLabel` that selects owned nodes), the operator's `prices` and the list prices a customer pays (`awakePriceHourUsd`, `storagePriceGbMonthUsd`; US dollars) and this UTC `month`'s cost, as `GET /api/v1/forge/economics` answers; with any field, set it (prices in US dollars with at most two decimals, non-negative; `ownedSlots` a whole number of app-slots; a label as `key=value`, blank for the default `plat.sh/site=vxrail`) with an admin token, a forge admin who is a person, never an agent, planned first (`dryRun` is true unless `false`); anyone else is told `not_found`",
14 doc: "`{ position?, marginPct?, ownedNodeLabel?, ownedMonthUsd?, ownedSlots?, cloudHourUsd?, storageGbMonthUsd?, awakePriceHourUsd?, storagePriceGbMonthUsd?, dryRun? }`: with nothing, the profit slider's `position` (0 to 100), `marginPct` (0 to 500), the `policy` and its `words`, `placement` (whether a cloud body takes bursts, the `ownedNodeLabel` that selects owned nodes), the operator's `prices` and the list prices a customer pays (`awakePriceHourUsd`, `storagePriceGbMonthUsd`; US dollars) and this UTC `month`'s cost, as `GET /api/v1/forge/economics` answers; with any field, set it (prices in US dollars with at most two decimals, non-negative; `ownedSlots` a whole number of app-slots; a label as `key=value`, blank for the default `plat.sh/site=vxrail`) with an admin token, a forge admin who is a person, never an agent, planned first; anyone else is told `not_found`",
1515 description: "Read the profit slider, its policy, placement, the prices and the month's cost, or set them (admin).",
1616 inputSchema: {
1717 type: "object",
src/http/mcp/tools/features.ts +1 −1
@@ -7,7 +7,7 @@ import { good, bad, type Tool } from "../shared.ts";
77 export const tool: Tool = {
88 name: "features",
99 listedTo: "admin",
10 doc: "`{ slug?, feed?, absorb?, settings?, tool?, args?, dryRun? }`: apps absorbed as the forge's own features, and the forge's own switches, listed first and named by `slug` (`absorb: true|false` turns one on or off). With nothing, every app whose forge.json declares a `feature`, absorbed or not (forge admin); with `slug`, that one and its typed settings (its readers), or with `feed: true` its feed items; `absorb: true|false` absorbs or un-absorbs it, `settings: { name: value }` changes an absorbed one's settings (each checked against its declaration, the app restarts with them as `FORGE_SETTING_*`); `tool` calls one of the absorbed app's declared tools (listed as `tools` with `slug`) with `args`: a read tool answers at once, one that writes is for a repo writer and planned first; absorbing and settings changes are planned first (`dryRun` is true unless `false`) and need an admin-scope token",
10 doc: "`{ slug?, feed?, absorb?, settings?, tool?, args?, dryRun? }`: apps absorbed as the forge's own features, and the forge's own switches, listed first and named by `slug` (`absorb: true|false` turns one on or off). With nothing, every app whose forge.json declares a `feature`, absorbed or not (forge admin); with `slug`, that one and its typed settings (its readers), or with `feed: true` its feed items; `absorb: true|false` absorbs or un-absorbs it, `settings: { name: value }` changes an absorbed one's settings (each checked against its declaration, the app restarts with them as `FORGE_SETTING_*`); `tool` calls one of the absorbed app's declared tools (listed as `tools` with `slug`) with `args`: a read tool answers at once, one that writes is for a repo writer and planned first; absorbing and settings changes are planned first and need an admin-scope token",
1111 description: "Apps absorbed as forge features: list, read, absorb or un-absorb, change typed settings.",
1212 inputSchema: {
1313 type: "object",
src/http/mcp/tools/forge.ts +1 −1
@@ -17,7 +17,7 @@ export const tool: Tool = {
1717 },
1818 },
1919 doc:
20 "`{ apply?, dryRun? }`: `{ says, needs, recommended }`: one or two sentences, then what needs you (the stack `/asks` shows, most consequential first: `sentence`, `why`, `choices`, `recommended` with `reason`, `undo`, `safe`, and the `ask` to put to the owner when not), and the call that applies them. A repository standing still (every open pull red or untouched; never one that is turned off) is a need named `stuck:<id>`: `{ apply: \"stuck:<id>\", choice: \"recheck\" | \"builders\" | \"close\" | \"off\", reason? }` takes one choice (planned first, `dryRun` true unless `false`), answering `acted` and `left` with why. `off` turns the app off, which is `archive` by another door: the app, its previews and its crew stop, the repository and its data stay, and the answer's `undo` is the exact call that turns it back on (`archive { repo, archived: false, dryRun: false }`); like `archive`, it takes the repository's admin and an admin token. `apply: \"recommended\"` (or one need's `id`) takes the recommended choice of each safe need (a close the crew advised, a restore drill, a stopped run or assigned issue handed to the crew) and answers `done` with what each did; a ship is never one (a merge has no undo), nor a need with no safe default: those say `Needs your decision` with their real `options`, and are listed under `left` by name; planned first (`dryRun` is true unless `false`); each receipt names its undo (`asks_act` `undo`)",
20 "`{ apply?, dryRun? }`: `{ says, needs, recommended }`: one or two sentences, then what needs you (the stack `/asks` shows, most consequential first: `sentence`, `why`, `choices`, `recommended` with `reason`, `undo`, `safe`, and the `ask` to put to the owner when not), and the call that applies them. A repository standing still (every open pull red or untouched; never one that is turned off) is a need named `stuck:<id>`: `{ apply: \"stuck:<id>\", choice: \"recheck\" | \"builders\" | \"close\" | \"off\", reason? }` takes one choice (planned first), answering `acted` and `left` with why. `off` turns the app off, which is `archive` by another door: the app, its previews and its crew stop, the repository and its data stay, and the answer's `undo` is the exact call that turns it back on (`archive { repo, archived: false, dryRun: false }`); like `archive`, it takes the repository's admin and an admin token. `apply: \"recommended\"` (or one need's `id`) takes the recommended choice of each safe need (a close the crew advised, a restore drill, a stopped run or assigned issue handed to the crew) and answers `done` with what each did; a ship is never one (a merge has no undo), nor a need with no safe default: those say `Needs your decision` with their real `options`, and are listed under `left` by name; planned first; each receipt names its undo (`asks_act` `undo`)",
2121 writes: true,
2222 dryByDefault: true,
2323 readsWithout: "apply",
src/http/mcp/tools/knobs.ts +1 −1
@@ -6,7 +6,7 @@ import { good, bad, type Tool } from "../shared.ts";
66 export const tool: Tool = {
77 name: "knobs",
88 listedTo: "admin",
9 doc: "`{ knob?, value?, repo?, dryRun? }` (forge admin): the crew's seven knobs in the page's words, each with its live effect: `speed` (runs at once, 1-16), `budget` (percent of the week to use, 10-100), `polish` (percent share, 0-50), `boxes` and `chars` (most checklist boxes and characters an issue may have before the planner splits it), `autonomy` (`off`, `ask` or `go`, with `repo` as `owner/name`), and `feedback` (always on). With `knob` and `value`, planned first (`dryRun` is true unless `false`); applying needs an admin-scope token",
9 doc: "`{ knob?, value?, repo?, dryRun? }` (forge admin): the crew's seven knobs in the page's words, each with its live effect: `speed` (runs at once, 1-16), `budget` (percent of the week to use, 10-100), `polish` (percent share, 0-50), `boxes` and `chars` (most checklist boxes and characters an issue may have before the planner splits it), `autonomy` (`off`, `ask` or `go`, with `repo` as `owner/name`), and `feedback` (always on). With `knob` and `value`, planned first; applying needs an admin-scope token",
1010 description: "What each crew knob does now; with `knob` and `value`, plans.",
1111 inputSchema: {
1212 type: "object",
src/http/mcp/tools/limits.ts +1 −1
@@ -8,7 +8,7 @@ import { good, bad, type Tool } from "../shared.ts";
88 export const tool: Tool = {
99 name: "limits",
1010 listedTo: "admin",
11 doc: "`{ key?, value?, plans?, dryRun? }` (forge admin): every limit the forge's owner can hit, with its value, default and bounds; with `key` and `value` (`\"\"` restores the default), planned first (`dryRun` is true unless `false`); a value out of bounds is refused, applying needs an admin-scope token; the answer lists the plans; `plans`, a list of `{ key, name, says, size, priceUsd, creditUsd, forges }`, replaces them",
11 doc: "`{ key?, value?, plans?, dryRun? }` (forge admin): every limit the forge's owner can hit, with its value, default and bounds; with `key` and `value` (`\"\"` restores the default), planned first; a value out of bounds is refused, applying needs an admin-scope token; the answer lists the plans; `plans`, a list of `{ key, name, says, size, priceUsd, creditUsd, forges }`, replaces them",
1212 description:
1313 "Every limit the owner can hit. `key`+`value` (\"\" restores) plans.",
1414 inputSchema: {
src/http/mcp/tools/outsiders.ts +1 −1
@@ -5,7 +5,7 @@ import { good, bad, type Tool, REPO_ARG, repoArg, isAnswer } from "../shared.ts"
55
66 export const tool: Tool = {
77 name: "outsiders",
8 doc: "`{ repo, on?, dryRun? }`: whether people who cannot write may direct the crew; with `on`, planned first (`dryRun` is true unless `false`); set only by the app's admin with an admin token, never an agent",
8 doc: "`{ repo, on?, dryRun? }`: whether people who cannot write may direct the crew; with `on`, planned first; set only by the app's admin with an admin token, never an agent",
99 description:
1010 "Whether non-writers may direct an app's crew (off by default). No `on` reads it.",
1111 inputSchema: {
src/http/mcp/tools/quotas.ts +1 −1
@@ -6,7 +6,7 @@ import { good, bad, type Tool } from "../shared.ts";
66 export const tool: Tool = {
77 name: "quotas",
88 listedTo: "admin",
9 doc: "`{ key?, value?, dryRun? }` (forge admin): the per-account quotas `repositories`, `apps`, `storage` (MB), `previews`, `runs`, `checks`, each a number or null for none. `repositories` bounds repos on create, fork and copy; `apps` the apps made; `storage` the MB of repos plus app data, asked on push, create and fork; `previews` live previews; `runs` concurrent agent runs; `checks` concurrent checks. Each is asked before the thing is made or started and a forge admin is never limited; with `key` and `value` (`\"\"` clears), planned first (`dryRun` is true unless `false`); applying needs an admin-scope token",
9 doc: "`{ key?, value?, dryRun? }` (forge admin): the per-account quotas `repositories`, `apps`, `storage` (MB), `previews`, `runs`, `checks`, each a number or null for none. `repositories` bounds repos on create, fork and copy; `apps` the apps made; `storage` the MB of repos plus app data, asked on push, create and fork; `previews` live previews; `runs` concurrent agent runs; `checks` concurrent checks. Each is asked before the thing is made or started and a forge admin is never limited; with `key` and `value` (`\"\"` clears), planned first; applying needs an admin-scope token",
1010 description:
1111 "Enforced per-account quotas (never an admin): repositories, apps, storage, previews, runs, checks. key+value plans.",
1212 inputSchema: {
src/http/mcp/tools/signup.ts +1 −1
@@ -8,7 +8,7 @@ import { SIGNUP_WORDS } from "../../../core/arg_words.ts";
88 export const tool: Tool = {
99 name: "signup",
1010 listedTo: "admin",
11 doc: "`{ mode?, billingLinks?, dryRun? }`: who may sign up: `open` (default), `invite` (only a person with an open invite link) or `closed` (no new accounts); without `mode` it reads the setting, with `mode` it plans first (`dryRun` is true unless `false`); `billingLinks` `{small?, medium?, large?}` (https URLs) sets the home page's buy links; applying needs an admin token",
11 doc: "`{ mode?, billingLinks?, dryRun? }`: who may sign up: `open` (default), `invite` (only a person with an open invite link) or `closed` (no new accounts); without `mode` it reads the setting, with `mode` it is planned first; `billingLinks` `{small?, medium?, large?}` (https URLs) sets the home page's buy links; applying needs an admin token",
1212 description:
1313 "Sign-ups: open (default); invite lets in only a person with an open invite link; closed refuses every new account",
1414 inputSchema: {
src/http/mcp/tools/spawn.ts +1 −1
@@ -5,7 +5,7 @@ import { good, bad, type Tool, APP_ARG, REVEAL_ARG, LINK_KEPT, LINK_REVEALED } f
55
66 export const tool: Tool = {
77 name: "spawn",
8 doc: "`{ name, config? | recipe?, apps?, crew?, direction?, fresh?, purpose?, followMode?, size?, plan?, template?, keepAccess?, migration?, dryRun?, reveal? }`: a child forge to keep (`purpose: \"contribute\"` makes none: it answers the fork path), planned first (`dryRun` is true unless `false`); an admin's, and an `ro` token may plan but not make; `reveal: true` shows the claim link",
8 doc: "`{ name, config? | recipe?, apps?, crew?, direction?, fresh?, purpose?, followMode?, size?, plan?, template?, keepAccess?, migration?, dryRun?, reveal? }`: a child forge to keep (`purpose: \"contribute\"` makes none: it answers the fork path), planned first; an admin's, and an `ro` token may plan but not make; `reveal: true` shows the claim link",
99 description:
1010 "Spawn a child forge. Plans first.",
1111 inputSchema: {
src/http/mcp/tools/trail.ts +1 −1
@@ -7,7 +7,7 @@ import { good, bad, type Tool, REPO_ARG, repoArg, isAnswer } from "../shared.ts"
77
88 export const tool: Tool = {
99 name: "trail",
10 doc: "`{ repo, shown?, dryRun? }`: where a migrated repository came from (`provenance`: source, sourceUrl, parents, migratedAt) and whether it is shown; with `shown`, shows or hides the trail — planned first (`dryRun` is true unless `false`), only the repository's admin with an admin token, never an agent. Hiding keeps the record; a hidden one reads `null` to anyone but an admin",
10 doc: "`{ repo, shown?, dryRun? }`: where a migrated repository came from (`provenance`: source, sourceUrl, parents, migratedAt) and whether it is shown; with `shown`, shows or hides the trail — planned first, only the repository's admin with an admin token, never an agent. Hiding keeps the record; a hidden one reads `null` to anyone but an admin",
1111 description:
1212 "A migrated repository's source and forks; `shown` shows or hides them (admin).",
1313 inputSchema: {
src/http/mcp/tools/valves.ts +1 −1
@@ -7,7 +7,7 @@ import { good, bad, type Tool } from "../shared.ts";
77 export const tool: Tool = {
88 name: "valves",
99 listedTo: "admin",
10 doc: "`{ repo?, level?, dryRun? }` (a forge admin who is a person; an agent is told no such tool): the week's budget as pipes, the same page as /flow: `{ usd, shipped, sources, valves: [{ slug, level, mode, usd, runs, shipped, next: { queued, goes, yields, held }, turned?, suggestion? }] }`; with `repo` (`owner/name`) and `level` (0 shut, 1 to 99 the share of the week's starts, 100 open), planned first (`dryRun` is true unless `false`); applying needs an admin-scope token and takes effect on the next tick. A valve is the owner's alone, so no agent turns one; `suggestion` is where the owner looks, and moves nothing",
10 doc: "`{ repo?, level?, dryRun? }` (a forge admin who is a person; an agent is told no such tool): the week's budget as pipes, the same page as /flow: `{ usd, shipped, sources, valves: [{ slug, level, mode, usd, runs, shipped, next: { queued, goes, yields, held }, turned?, suggestion? }] }`; with `repo` (`owner/name`) and `level` (0 shut, 1 to 99 the share of the week's starts, 100 open), planned first; applying needs an admin-scope token and takes effect on the next tick. A valve is the owner's alone, so no agent turns one; `suggestion` is where the owner looks, and moves nothing",
1111 description: "The week's pipes and valves; with `repo` and `level`, turns a valve (plans first).",
1212 inputSchema: {
1313 type: "object",
src/web/llms_tools.ts +13 −6
@@ -23,23 +23,30 @@ export function toolLine(t: Listed): string {
2323 return `- ${t.name}: ${oneLine(t.doc ?? t.description)}${admin}${writes}${open}`;
2424 }
2525
26 export const toolsSection = (tools: readonly Listed[]): string[] => [
26 /** What every "planned first" in a tool line means, said once at the head of the list. */
27 export const PLANNED_LINE = "A tool with `dryRun` only plans unless it is `false`; \"planned first\" below means that.";
28
29 /**
30 * A role's `## MCP tools` lines: the head says what "planned first" means when, and only when, a
outdated

Principle 8 (plain words): good, but this is only true if every tool's "planned first" really is the dryRun default. signup.ts and forge.ts still repeat the parenthetical, so the one-way rule is not yet one-way.

31 * line below says it, so each role's text explains what it uses and nothing more.
32 */
33 const headed = (lines: readonly string[]): string[] => [
2734 "## MCP tools",
2835 "",
29 ...tools.map(toolLine),
30 "",
36 ...(lines.some((l) => l.includes("planned first")) ? [PLANNED_LINE, ""] : []),
37 ...lines,
3138 ];
3239
40 export const toolsSection = (tools: readonly Listed[]): string[] => [...headed(tools.map(toolLine)), ""];
41
3342 /**
3443 * What a stranger can call, in full, then one line for the rest: the tools an
3544 * account opens are counted, not listed, and the line says where the list is.
3645 */
3746 export const anonymousToolsSection = (open: readonly Listed[], more: number, origin: string): string[] => [
38 "## MCP tools",
39 "",
4047 // A read (explore, search) is told by its short description here: the anonymous text
4148 // stays small, and the signed-in one has the full `doc`.
42 ...open.map((t) => toolLine(t.writes ? t : { ...t, doc: t.description })),
49 ...headed(open.map((t) => toolLine(t.writes ? t : { ...t, doc: t.description }))),
4350 `- ${more} more tools with an account: call tools/list on ${origin}/mcp once signed in, or read ${origin}/contract/openapi.json.`,
4451 "",
4552 ];
test/llms-tools.test.ts +25 −1
@@ -14,12 +14,13 @@ import { OFFER_TOOL, REPORT_TOOL, START_TOOL } from "../src/http/mcp.ts";
1414 import { TOOLS } from "../src/http/mcp/tools.ts";
1515 import { createToken } from "../src/core/tokens.ts";
1616 import { createUser } from "../src/core/users.ts";
17 import type { Listed } from "../src/web/llms_tools.ts";
17 import { PLANNED_LINE, type Listed } from "../src/web/llms_tools.ts";
1818
1919 describe("/llms.txt MCP tools", () => {
2020 let dataDir: string;
2121 let servers: Servers;
2222 let token: string;
23 let member: string;
2324
2425 beforeAll(async () => {
2526 dataDir = await mkdtemp(join(tmpdir(), "forge-llms-tools-"));
@@ -36,6 +37,9 @@ describe("/llms.txt MCP tools", () => {
3637 });
3738 if (!made.ok) throw new Error(made.error);
3839 token = createToken(app.db, made.value.id, "rw", "admin").token;
40 const bob = await createUser(app.db, { origin: "seed", trusted: true, username: "bob", email: "[email protected]", password: "a-good-passphrase" });
41 if (!bob.ok) throw new Error(bob.error);
42 member = createToken(app.db, bob.value.id, "rw", "rw").token;
3943 });
4044 afterAll(async () => {
4145 await servers.stop();
@@ -56,7 +60,27 @@ describe("/llms.txt MCP tools", () => {
5660 return `- ${t.name}: ${(t.doc ?? t.description).replace(/\s+/g, " ").trim()}${admin}${t.writes ? " (writes)" : ""}${TOKEN_FREE_TOOLS.includes(t.name) ? " (no account)" : ""}`;
5761 });
outdated

This pins only the exact string "planned first (dryRun". It passes while signup.ts and forge.ts keep "(dryRun is true unless false)". Match on "unless false" in the listed lines instead.

5862 expect(listed).toEqual(expected);
63 // What every "planned first" means is said once, at the head of the list, not in each line.
64 expect(lines[start + 2]).toBe("A tool with `dryRun` only plans unless it is `false`; \"planned first\" below means that.");
65 expect(listed.filter((l) => l.includes("unless `false`"))).toEqual([]);
5966 expect(TOOLS.some((t) => t.writes)).toBe(true);
6067 expect(TOOLS.some((t) => t.adminOnly === true)).toBe(true);
6168 });
69
70 test("each role's list says what \"planned first\" means once, at its head, exactly when a line below uses it, and no line says it again", async () => {
71 const roles: Record<string, string | undefined> = { anonymous: undefined, member, admin: token };
72 for (const [role, bearer] of Object.entries(roles)) {
73 const res = await fetch(`${servers.url}/llms.txt`, { headers: bearer === undefined ? {} : { authorization: `Bearer ${bearer}` } });
74 const lines = (await res.text()).split("\n");
75 const start = lines.indexOf("## MCP tools");
76 const end = lines.findIndex((l, i) => i > start && l.startsWith("## "));
77 const tools = lines.slice(start + 1, end).filter((l) => l.startsWith("- "));
78 const plans = tools.some((l) => l.includes("planned first"));
79 expect(lines[start + 2] === PLANNED_LINE, `${role}: head line`).toBe(plans);
80 expect(lines.slice(start + 1, end).filter((l) => l === PLANNED_LINE).length, role).toBe(plans ? 1 : 0);
81 expect(tools.filter((l) => l.includes("unless `false`")), role).toEqual([]);
82 // A member and an admin are listed tools that plan first; a stranger's short list is not.
83 if (role !== "anonymous") expect(plans, role).toBe(true);
84 }
85 });
6286 });

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs