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
Check · Review · Land · Live done — Landed and live in production.
talk/llms-once → main 0 commits 2 threads · 2 unresolved
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"; | ||
| 4 | 4 | |
| 5 | 5 | export const tool: Tool = { |
| 6 | 6 | 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", | |
| 8 | 8 | description: "Reset a person's access with a one-time link, or end their sessions.", |
| 9 | 9 | inputSchema: { |
| 10 | 10 | type: "object", |
src/http/mcp/tools/account_role.ts +1 −1
| @@ -5,7 +5,7 @@ import { good, bad, type Tool, mayBoards } from "../shared.ts"; | ||
| 5 | 5 | |
| 6 | 6 | export const tool: Tool = { |
| 7 | 7 | 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", | |
| 9 | 9 | description: |
| 10 | 10 | "Make a person a member or a guest; promoting may grant `usdPerMonth`.", |
| 11 | 11 | 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 | ||
| 5 | 5 | |
| 6 | 6 | export const tool: Tool = { |
| 7 | 7 | 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", | |
| 9 | 9 | description: |
| 10 | 10 | "Archive or wake a repository (`archived`). Plans first; admin token.", |
| 11 | 11 | inputSchema: { |
src/http/mcp/tools/asks_act.ts +1 −1
| @@ -20,7 +20,7 @@ export const tool: Tool = { | ||
| 20 | 20 | required: ["action"], |
| 21 | 21 | }, |
| 22 | 22 | 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`", | |
| 24 | 24 | writes: true, |
| 25 | 25 | dryByDefault: true, |
| 26 | 26 | 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 | ||
| 5 | 5 | |
| 6 | 6 | export const tool: Tool = { |
| 7 | 7 | 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", | |
| 9 | 9 | description: |
| 10 | 10 | "Attach a PNG/JPEG (base64 `image`, max 5 MB) to an open pull: `phone`/`desktop`, `says`.", |
| 11 | 11 | inputSchema: { |
src/http/mcp/tools/capacity.ts +1 −1
| @@ -6,7 +6,7 @@ import { good, bad, type Tool } from "../shared.ts"; | ||
| 6 | 6 | export const tool: Tool = { |
| 7 | 7 | name: "capacity", |
| 8 | 8 | 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", | |
| 10 | 10 | description: |
| 11 | 11 | "Forge capacity and guards, live. With `key` and `value` (\"\" restores default), plans.", |
| 12 | 12 | 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" | ||
| 18 | 18 | |
| 19 | 19 | export const tool: Tool = { |
| 20 | 20 | 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`", | |
| 22 | 22 | description: "List a repository's crew, or add or remove an agent. Plans first; admin token.", |
| 23 | 23 | inputSchema: { |
| 24 | 24 | 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" | ||
| 5 | 5 | |
| 6 | 6 | export const tool: Tool = { |
| 7 | 7 | 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", | |
| 9 | 9 | description: |
| 10 | 10 | "Who decides parked hand-over cards: `me`, `decider`, `decider_tell`. No `by` reads.", |
| 11 | 11 | inputSchema: { |
src/http/mcp/tools/economics.ts +1 −1
| @@ -11,7 +11,7 @@ type Field = (typeof FIELDS)[number]; | ||
| 11 | 11 | |
| 12 | 12 | export const tool: Tool = { |
| 13 | 13 | 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`", | |
| 15 | 15 | description: "Read the profit slider, its policy, placement, the prices and the month's cost, or set them (admin).", |
| 16 | 16 | inputSchema: { |
| 17 | 17 | type: "object", |
src/http/mcp/tools/features.ts +1 −1
| @@ -7,7 +7,7 @@ import { good, bad, type Tool } from "../shared.ts"; | ||
| 7 | 7 | export const tool: Tool = { |
| 8 | 8 | name: "features", |
| 9 | 9 | 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", | |
| 11 | 11 | description: "Apps absorbed as forge features: list, read, absorb or un-absorb, change typed settings.", |
| 12 | 12 | inputSchema: { |
| 13 | 13 | type: "object", |
src/http/mcp/tools/forge.ts +1 −1
| @@ -17,7 +17,7 @@ export const tool: Tool = { | ||
| 17 | 17 | }, |
| 18 | 18 | }, |
| 19 | 19 | 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`)", | |
| 21 | 21 | writes: true, |
| 22 | 22 | dryByDefault: true, |
| 23 | 23 | readsWithout: "apply", |
src/http/mcp/tools/knobs.ts +1 −1
| @@ -6,7 +6,7 @@ import { good, bad, type Tool } from "../shared.ts"; | ||
| 6 | 6 | export const tool: Tool = { |
| 7 | 7 | name: "knobs", |
| 8 | 8 | 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", | |
| 10 | 10 | description: "What each crew knob does now; with `knob` and `value`, plans.", |
| 11 | 11 | inputSchema: { |
| 12 | 12 | type: "object", |
src/http/mcp/tools/limits.ts +1 −1
| @@ -8,7 +8,7 @@ import { good, bad, type Tool } from "../shared.ts"; | ||
| 8 | 8 | export const tool: Tool = { |
| 9 | 9 | name: "limits", |
| 10 | 10 | 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", | |
| 12 | 12 | description: |
| 13 | 13 | "Every limit the owner can hit. `key`+`value` (\"\" restores) plans.", |
| 14 | 14 | 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" | ||
| 5 | 5 | |
| 6 | 6 | export const tool: Tool = { |
| 7 | 7 | 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", | |
| 9 | 9 | description: |
| 10 | 10 | "Whether non-writers may direct an app's crew (off by default). No `on` reads it.", |
| 11 | 11 | inputSchema: { |
src/http/mcp/tools/quotas.ts +1 −1
| @@ -6,7 +6,7 @@ import { good, bad, type Tool } from "../shared.ts"; | ||
| 6 | 6 | export const tool: Tool = { |
| 7 | 7 | name: "quotas", |
| 8 | 8 | 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", | |
| 10 | 10 | description: |
| 11 | 11 | "Enforced per-account quotas (never an admin): repositories, apps, storage, previews, runs, checks. key+value plans.", |
| 12 | 12 | inputSchema: { |
src/http/mcp/tools/signup.ts +1 −1
| @@ -8,7 +8,7 @@ import { SIGNUP_WORDS } from "../../../core/arg_words.ts"; | ||
| 8 | 8 | export const tool: Tool = { |
| 9 | 9 | name: "signup", |
| 10 | 10 | 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", | |
| 12 | 12 | description: |
| 13 | 13 | "Sign-ups: open (default); invite lets in only a person with an open invite link; closed refuses every new account", |
| 14 | 14 | 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 | ||
| 5 | 5 | |
| 6 | 6 | export const tool: Tool = { |
| 7 | 7 | 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", | |
| 9 | 9 | description: |
| 10 | 10 | "Spawn a child forge. Plans first.", |
| 11 | 11 | 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" | ||
| 7 | 7 | |
| 8 | 8 | export const tool: Tool = { |
| 9 | 9 | 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", | |
| 11 | 11 | description: |
| 12 | 12 | "A migrated repository's source and forks; `shown` shows or hides them (admin).", |
| 13 | 13 | inputSchema: { |
src/http/mcp/tools/valves.ts +1 −1
| @@ -7,7 +7,7 @@ import { good, bad, type Tool } from "../shared.ts"; | ||
| 7 | 7 | export const tool: Tool = { |
| 8 | 8 | name: "valves", |
| 9 | 9 | 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", | |
| 11 | 11 | description: "The week's pipes and valves; with `repo` and `level`, turns a valve (plans first).", |
| 12 | 12 | inputSchema: { |
| 13 | 13 | type: "object", |
src/web/llms_tools.ts +13 −6
| @@ -23,23 +23,30 @@ export function toolLine(t: Listed): string { | ||
| 23 | 23 | return `- ${t.name}: ${oneLine(t.doc ?? t.description)}${admin}${writes}${open}`; |
| 24 | 24 | } |
| 25 | 25 | |
| 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 | |
| 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[] => [ | |
| 27 | 34 | "## MCP tools", |
| 28 | 35 | "", |
| 29 | ...tools.map(toolLine), | |
| 30 | "", | |
| 36 | ...(lines.some((l) => l.includes("planned first")) ? [PLANNED_LINE, ""] : []), | |
| 37 | ...lines, | |
| 31 | 38 | ]; |
| 32 | 39 | |
| 40 | export const toolsSection = (tools: readonly Listed[]): string[] => [...headed(tools.map(toolLine)), ""]; | |
| 41 | ||
| 33 | 42 | /** |
| 34 | 43 | * What a stranger can call, in full, then one line for the rest: the tools an |
| 35 | 44 | * account opens are counted, not listed, and the line says where the list is. |
| 36 | 45 | */ |
| 37 | 46 | export const anonymousToolsSection = (open: readonly Listed[], more: number, origin: string): string[] => [ |
| 38 | "## MCP tools", | |
| 39 | "", | |
| 40 | 47 | // A read (explore, search) is told by its short description here: the anonymous text |
| 41 | 48 | // 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 }))), | |
| 43 | 50 | `- ${more} more tools with an account: call tools/list on ${origin}/mcp once signed in, or read ${origin}/contract/openapi.json.`, |
| 44 | 51 | "", |
| 45 | 52 | ]; |
test/llms-tools.test.ts +25 −1
| @@ -14,12 +14,13 @@ import { OFFER_TOOL, REPORT_TOOL, START_TOOL } from "../src/http/mcp.ts"; | ||
| 14 | 14 | import { TOOLS } from "../src/http/mcp/tools.ts"; |
| 15 | 15 | import { createToken } from "../src/core/tokens.ts"; |
| 16 | 16 | 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"; | |
| 18 | 18 | |
| 19 | 19 | describe("/llms.txt MCP tools", () => { |
| 20 | 20 | let dataDir: string; |
| 21 | 21 | let servers: Servers; |
| 22 | 22 | let token: string; |
| 23 | let member: string; | |
| 23 | 24 | |
| 24 | 25 | beforeAll(async () => { |
| 25 | 26 | dataDir = await mkdtemp(join(tmpdir(), "forge-llms-tools-")); |
| @@ -36,6 +37,9 @@ describe("/llms.txt MCP tools", () => { | ||
| 36 | 37 | }); |
| 37 | 38 | if (!made.ok) throw new Error(made.error); |
| 38 | 39 | 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; | |
| 39 | 43 | }); |
| 40 | 44 | afterAll(async () => { |
| 41 | 45 | await servers.stop(); |
| @@ -56,7 +60,27 @@ describe("/llms.txt MCP tools", () => { | ||
| 56 | 60 | return `- ${t.name}: ${(t.doc ?? t.description).replace(/\s+/g, " ").trim()}${admin}${t.writes ? " (writes)" : ""}${TOKEN_FREE_TOOLS.includes(t.name) ? " (no account)" : ""}`; |
| 57 | 61 | }); |
outdated
This pins only the exact string "planned first ( |
||
| 58 | 62 | 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([]); | |
| 59 | 66 | expect(TOOLS.some((t) => t.writes)).toBe(true); |
| 60 | 67 | expect(TOOLS.some((t) => t.adminOnly === true)).toBe(true); |
| 61 | 68 | }); |
| 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 | }); | |
| 62 | 86 | }); |
new above
offline
Principle 8 (plain words): good, but this is only true if every tool's "planned first" really is the
dryRundefault. signup.ts and forge.ts still repeat the parenthetical, so the one-way rule is not yet one-way.