vantage-peers-mcp 4.0.0 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/CHANGELOG.md +65 -0
  2. package/README.md +133 -30
  3. package/dist/server-http.d.ts +8 -0
  4. package/dist/server-http.js +330 -51
  5. package/dist/server.js +2 -2
  6. package/dist/src/auth.d.ts +62 -1
  7. package/dist/src/auth.js +140 -5
  8. package/dist/src/authenticatedConvexClient.d.ts +19 -3
  9. package/dist/src/authenticatedConvexClient.js +67 -1
  10. package/dist/src/authorize.d.ts +48 -16
  11. package/dist/src/authorize.js +181 -27
  12. package/dist/src/backendContract.d.ts +1 -1
  13. package/dist/src/backendContract.js +13 -1
  14. package/dist/src/brand.d.ts +63 -3
  15. package/dist/src/brand.js +97 -3
  16. package/dist/src/buildIdentity.d.ts +13 -0
  17. package/dist/src/buildIdentity.js +15 -0
  18. package/dist/src/clientMetadataDocument.d.ts +219 -0
  19. package/dist/src/clientMetadataDocument.js +887 -0
  20. package/dist/src/doorScope.d.ts +17 -0
  21. package/dist/src/doorScope.js +50 -3
  22. package/dist/src/eraseTables.d.ts +1 -0
  23. package/dist/src/eraseTables.js +21 -0
  24. package/dist/src/landingPage.d.ts +27 -0
  25. package/dist/src/landingPage.js +107 -0
  26. package/dist/src/listContract.d.ts +101 -0
  27. package/dist/src/listContract.js +106 -0
  28. package/dist/src/listCursor.d.ts +27 -0
  29. package/dist/src/listCursor.js +68 -0
  30. package/dist/src/outputSchemas.d.ts +927 -0
  31. package/dist/src/outputSchemas.js +1974 -0
  32. package/dist/src/paging.d.ts +30 -0
  33. package/dist/src/paging.js +32 -0
  34. package/dist/src/registerTool.d.ts +49 -0
  35. package/dist/src/registerTool.js +127 -7
  36. package/dist/src/serverCard.d.ts +65 -0
  37. package/dist/src/serverCard.js +90 -0
  38. package/dist/src/serverDiscovery.d.ts +26 -0
  39. package/dist/src/serverDiscovery.js +85 -0
  40. package/dist/src/structuredResult.d.ts +58 -0
  41. package/dist/src/structuredResult.js +58 -0
  42. package/dist/src/toolUsage.d.ts +33 -0
  43. package/dist/src/toolUsage.js +99 -0
  44. package/dist/src/tools/exportOkfBundle.js +13 -15
  45. package/dist/src/tools/importOkfBundle.d.ts +1 -1
  46. package/dist/src/tools/importOkfBundle.js +15 -6
  47. package/dist/src/tools/kbIngest.js +52 -46
  48. package/dist/src/tools.d.ts +126 -3
  49. package/dist/src/tools.js +2433 -1103
  50. package/dist/src/ui-resources/apps.d.ts +51 -0
  51. package/dist/src/ui-resources/apps.js +320 -0
  52. package/dist/src/ui-resources/index.d.ts +30 -10
  53. package/dist/src/ui-resources/index.js +45 -5
  54. package/dist/src/ui-resources/register.d.ts +38 -0
  55. package/dist/src/ui-resources/register.js +80 -0
  56. package/dist/src/verifiedActor.d.ts +10 -0
  57. package/dist/src/verifiedActor.js +43 -2
  58. package/package.json +5 -3
  59. package/tool-exposure.json +7 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,71 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [5.0.0] — 2026-11-24
6
+
7
+ Customer-facing summary of every `mcp-server/` change since 4.1.0. Each entry says which product it concerns (VantagePeers Cloud, the hosted service; VantagePeers Self-host, the separate product) and links the README section that documents it. This is a major release because tool inputs and output shapes changed (see the package's [Versioning](README.md#versioning) rules).
8
+
9
+ ### Breaking
10
+
11
+ - Cloud and Self-host: `create_task` requires a `project`. A call with no `project`, an empty one or a blank one is refused before any task is written, and `update_task` refuses setting `project` to empty. Caller change: pass a project name on every `create_task`. ([Tool inputs and outputs](README.md#tool-inputs-and-outputs))
12
+ - Cloud and Self-host: the text of `get_owner_tool_usage`, `list_diaries` and `get_profile` is now exactly the JSON of their `structuredContent`. `get_owner_tool_usage` answers `{ items, truncated? }` instead of a bare array; `list_diaries` answers `{ items, nextCursor, truncated }` on every page instead of a bare array or a page without those fields, and a cut is `truncated: true` (the `_meta` text envelope is gone); `get_profile` answers `{ found: true, item }`, or `{ found: false, id }` instead of `null` when no profile is visible. Caller change: read the `items` array, or `item` / `found`, from `structuredContent` (or from the parsed text), not the former array or `null`. ([Tool inputs and outputs](README.md#tool-inputs-and-outputs))
13
+ - Cloud and Self-host: `tools/list`, `resources/list` and `resources/templates/list` refuse any `cursor` with JSON-RPC error -32602 (these methods are served whole and never issue one); they used to ignore it and return the full list. Caller change: do not send a cursor on these three methods. ([Tool inputs and outputs](README.md#tool-inputs-and-outputs))
14
+ - Cloud and Self-host: `list_tasks` with `updatedSince` returns the rows newest-updated first (it was newest-created first) and its `nextCursor` resumes at that position. Caller change: a client that depended on creation order must sort the rows itself; a cursor minted by an earlier version still decodes. ([Tool inputs and outputs](README.md#tool-inputs-and-outputs))
15
+ - Cloud: `get_fix_pattern` answers `RBAC_DENIED` instead of "not found" to a caller outside the pattern's creator roster. Caller change: treat a refusal as "not allowed", not "does not exist". ([Tool inputs and outputs](README.md#tool-inputs-and-outputs))
16
+ - Self-host: the server requires backend contract version 29 and 153 backend functions (4.1.0: 17 and 144) and refuses to start against an older backend. Caller change: deploy the backend of this release first, then upgrade this package. ([Backend compatibility check](README.md#backend-compatibility-check))
17
+
18
+ ### Added
19
+
20
+ - Cloud and Self-host: explicit task queue order. New tool `reorder_queue` sets one agent's queue in a single call (listed tasks get ranks 1 to N, the agent's other open tasks lose their rank, an empty list clears the queue); it is open to the assignee, an organisation admin or a listed queue coordinator. New tool `next_task` returns the next task the agent can take (rank, then priority, then age, dependencies done) or an explicit `found: false`. `list_tasks` accepts `sort: "queue"`; a call without `sort` is unchanged. ([Tool inputs and outputs](README.md#tool-inputs-and-outputs))
21
+ - Cloud: new tools `erase_row` and `erase_fix_pattern`, and `erase_memory` now works for an agent seat. An organisation admin erases any row of the organisation; an author erases the rows it wrote (a person by verified identity, an agent by its agent ID). The row, and the rows that exist only for it, are deleted and a memory's search entry is purged. Erasing a memory erases every version of it. ([Tool inputs and outputs](README.md#tool-inputs-and-outputs))
22
+ - Cloud: a client can identify itself with a URL as its `client_id` (Client ID Metadata Documents, as Claude.ai's connector does). The server fetches the document under strict network limits (HTTPS only, public addresses only, no redirect, 5 KB, 3 seconds), shows the redirect origin on the consent page and flags the client as unverified. The service operator can unlist a client by URL, host or domain. ([OAuth endpoints](README.md#oauth-endpoints))
23
+ - Cloud and Self-host: `billing_summary_by_project` splits `unattributedTaskCount` into `noProjectCount` and `noDurationCount`, and the new optional `listNoDuration` returns the tasks that have a project but no measured duration. ([Tool inputs and outputs](README.md#tool-inputs-and-outputs))
24
+ - Cloud: `whoami` also names the agent and the workspace on every seat (`agent_name`, `agent_status`, `writableNamespaces`, `default_write_namespace`). `store_memory` and `store_episode` take an optional `namespace`: omitted, a person writes in `team/<organisation>` and a seat in its own `orchestrator/<agent ID>`. ([Agent identity](README.md#agent-identity))
25
+ - Cloud and Self-host: every tool now declares an `outputSchema` and returns `structuredContent` beside its unchanged text, every field of every output schema is described, every tool carries an `idempotentHint`, and every tool description states the result it returns. `check_messages` and `debate_get_room` keep their whole answer under the 60 000-byte response cap. ([Tool inputs and outputs](README.md#tool-inputs-and-outputs))
26
+ - Cloud: the public MCP Server Card now lists the server's `capabilities` and `tools`, and the `initialize` answer carries `serverInfo.commitSha`, the same build identity `/health` reports (`"unknown"` when no build stamped one). ([Tool inputs and outputs](README.md#tool-inputs-and-outputs))
27
+
28
+ ### Changed
29
+
30
+ - Cloud and Self-host: an invalid `cursor` argument on a paged tool answers `isError: true` with `structuredContent { error: { code: "invalid_cursor", message } }`. `tools/list`, `resources/list` and `resources/templates/list` refuse a cursor with JSON-RPC error -32602 instead of silently returning the full list. `get_github_owner_bindings` now hands out opaque cursors. ([Tool inputs and outputs](README.md#tool-inputs-and-outputs))
31
+ - Cloud and Self-host: `list_tasks` with `updatedSince` pages a window of any size and returns the rows newest-updated first; `updatedSince`, `createdBy` and a `createdBefore` cursor no longer fail with a scan-cap refusal. Combinations the indexes cannot serve are refused with the remedy named, never answered with a partial page. ([Tool inputs and outputs](README.md#tool-inputs-and-outputs))
32
+ - Cloud: a memory or episode read without `namespace` (`recall`, `text_search`, `hybrid_search`, `list_episodes`, `search_episodes_by_keyword`, `search_episodes_by_semantic`) reads your own space instead of being refused; `list_memories` and `export_okf_bundle` still require one. `list_episodes` without a namespace answers for the fleet master only. ([Tool inputs and outputs](README.md#tool-inputs-and-outputs))
33
+ - Cloud: the OAuth consent page offers the operator's own organisation, lists the agent already bound to the person and pre-selects it, refuses an Approve that silently connects a person as themselves while an agent is bound to them, and an agent created there joins its organisation's roster. An agent-less person connection that now has an agent to choose is asked to sign in again (`invalid_grant`, `agent-choice-pending`). ([The consent page](README.md#the-consent-page))
34
+ - Cloud: a refused agent credential answers `AGENT_CREDENTIAL_INVALID (<reason>)` when the backend names a reason code, for example `owner-missing`. ([Agent identity](README.md#agent-identity))
35
+ - Cloud and Self-host: the server's public description is "MCP server for multi-agent teams: persistent memory, agent messaging, time-tracked tasks, missions", the same text on `initialize`, the Server Card, the `/mcp` landing page and the package. The `fields` input is no longer published on seven list tools (`list_episodes`, `list_memories`, `list_peers`, `list_messages`, `list_diaries`, `list_recurring_tasks`, `list_fix_patterns`); a call that still sends it is accepted and the key is ignored. ([Tool inputs and outputs](README.md#tool-inputs-and-outputs))
36
+ - Cloud and Self-host: input descriptions say only what a field means and where its value comes from; the schema carries bounds, enums and defaults. The `createdBy` fields of `list_tasks_by_mission` and `list_diaries` and the `unprovenCursor` of `get_github_owner_bindings` name their source. ([Tool inputs and outputs](README.md#tool-inputs-and-outputs))
37
+
38
+ ### Security and fixes
39
+
40
+ - Cloud: `recall`, `text_search` and `hybrid_search` no longer return a superseded, soft-deleted or tombstoned memory or Knowledge Base chunk; an organisation member no longer reads a retired row through `get_memory` or `list_memories`. A client seat now finds through those three tools the memory it wrote in its own `orchestrator/<agent ID>` and `project/<organisation>` namespaces. ([Security](README.md#security))
41
+ - Cloud: a client-organisation agent whose name has capital letters (for example "Ada") can read and act on its own tasks, messages, briefing notes and profile; the roster is compared by normalised name on every door, and only narrows inside the organisation. A person seat can write a memory, episode or briefing note in its own name. `list_peers` lists a client organisation's agents to its own seats instead of refusing. ([Agent identity](README.md#agent-identity))
42
+ - Cloud and Self-host: `list_messages` with `from` and `sessionDay` applies both, newest first, and no longer fails on a busy sender or a large page; a page cut by the response cap keeps the cursor that resumes after its last row. `list_diaries` by `createdBy` and `list_recurring_tasks` by `assignedTo` and `active` return a full page. `list_issues` refuses `assignedTo` together with `project`, and filters `status` before the page is cut. `list_memories` and `list_episodes` return a cursor on a full first page. A fleet-master `list_diaries` by `createdBy` reads at most 250 rows per call and answers a partial page with a resuming cursor. ([Tool inputs and outputs](README.md#tool-inputs-and-outputs))
43
+ - Cloud and Self-host: `improvisation_digest` no longer fails on an orchestrator whose name has a non-ASCII letter (for example "hélios"). `get_fix_pattern` reads what `list_fix_patterns` lists and answers `RBAC_DENIED` instead of "not found" to a caller outside the creator roster. ([Tool inputs and outputs](README.md#tool-inputs-and-outputs))
44
+
45
+ ## [4.1.0] — 2026-11-03
46
+
47
+ Customer-facing summary of every `mcp-server/` change since 4.0.0. Each entry says which product it concerns (VantagePeers Cloud, the hosted service; VantagePeers Self-host, the separate product) and links the README section that documents it.
48
+
49
+ ### Action required
50
+
51
+ - Self-host: the server requires backend contract version 17 and 144 backend functions (4.0.0: 10 and 141) and refuses to start against an older backend. Deploy the backend of this release first, then upgrade this package. ([Backend compatibility check](README.md#backend-compatibility-check))
52
+
53
+ ### Added
54
+
55
+ - Cloud and Self-host: new tools `get_tool_usage` and `get_owner_tool_usage`: which MCP tools a caller, or all the agents a person owns, has called, with first call, last call and call count. ([Tool inputs and outputs](README.md#tool-inputs-and-outputs))
56
+ - Cloud and Self-host: `list_tasks`, `list_messages`, `list_missions`, `list_memories`, `get_diary` and `get_briefing_note` name an interactive MCP Apps view; a client without MCP Apps support shows the unchanged text result. ([MCP Apps](README.md#mcp-apps-interactive-views))
57
+ - Cloud: a native client's loopback `redirect_uri` (`http://127.0.0.1`, `http://localhost`, `http://[::1]`) may vary its port, so VS Code can connect (RFC 8252 section 7.3). ([Security](README.md#security))
58
+
59
+ ### Changed
60
+
61
+ - Cloud: `pause_recurring_task`, `resume_recurring_task` and `delete_recurring_task` are no longer refused to every non-operator caller; an agent manages the schedules it created. ([Tool inputs and outputs](README.md#tool-inputs-and-outputs))
62
+ - Cloud and Self-host: a refused `send_message` carries `RBAC_DENIED` or `INVALID_RECIPIENTS`, a missing message `MESSAGE_NOT_FOUND`, and a refused `store_memory` / `store_episode` write names the namespaces the caller may write. ([Tool inputs and outputs](README.md#tool-inputs-and-outputs))
63
+
64
+ ### Security and fixes
65
+
66
+ - Cloud: every call an OAuth bearer makes runs inside its own verified organisation, keyed by the permanent organisation ID, so a bearer no longer reads another organisation's diaries, mandate bindings, tasks or UI resources (cross-tenant leak, #1639). ([Security](README.md#security))
67
+ - Cloud: a seat reads and writes its own `orchestrator/<agent ID>` and `project/<org>` on every path into the server, whatever its token was minted with; a token's rights follow its scope profile as it is now; a one-agent seat resolves its agent by ID only. ([Agent identity](README.md#agent-identity))
68
+ - Cloud and Self-host: `add_task_dependency` and `block_task` append to a task's dependencies instead of replacing them, and `link_commit_to_issue` no longer records a SHA twice. ([Tool inputs and outputs](README.md#tool-inputs-and-outputs))
69
+
5
70
  ## [4.0.0] — 2026-11-01
6
71
 
7
72
  Customer-facing summary of every `mcp-server/` change since 3.0.0. Each entry says which product it concerns (VantagePeers Cloud, the hosted service; VantagePeers Self-host, the separate product) and links the README section that documents it. The repository changelog carries the full engineering record of the same release.
package/README.md CHANGED
@@ -90,6 +90,7 @@ Any client that supports remote MCP servers over Streamable HTTP can connect:
90
90
  - **URL:** the endpoint URL. It always ends in `/mcp` (for example `https://<your-host>/mcp`); enter it exactly, not the bare host.
91
91
  - **Protocol:** the server speaks MCP protocol `2026-07-28` (a client that opens with `server/discover`) and `2025-11-25` (a client that opens with `initialize`). Each client is answered in its own version; you choose nothing.
92
92
  - **Authentication:** OAuth 2.1. The server publishes its metadata at `/.well-known/oauth-protected-resource/mcp` (also at `/.well-known/oauth-protected-resource`), `/.well-known/oauth-authorization-server` and `/.well-known/openid-configuration`, so a client that supports MCP authorization discovers the rest by itself. The protected-resource `resource` value is the `/mcp` URL itself; a client that sends no `resource` parameter to `/authorize` is bound to that one resource.
93
+ - **Discovery:** the server publishes a public [MCP Server Card](https://github.com/modelcontextprotocol/experimental-ext-server-card) (name, title, description, version, icons, the `/mcp` endpoint over `streamable-http`, and an OAuth sign-in hint under `_meta["com.vantagepeers/auth"]`) at `/mcp/server-card`, `/.well-known/mcp/server-card.json`, `/.well-known/mcp-server-card`, `/mcp.json` and `/.well-known/mcp.json`. The `initialize` / `server/discover` answer carries the same `title`, `description` and `websiteUrl`, plus server `instructions` (what to call first). Opening the `/mcp` URL in a browser shows a short setup page; an MCP request on that URL is unchanged.
93
94
  - A client that cannot run OAuth can send an access token as `Authorization: Bearer <token>`. Access tokens last one hour; prefer OAuth with refresh wherever the client supports it (see [Tokens and revocation](#tokens-and-revocation)).
94
95
 
95
96
  ### Check the connection
@@ -98,6 +99,25 @@ _Applies to: Cloud._
98
99
 
99
100
  Ask your agent who it is (`whoami`), to list your peers (`list_peers`), or to store and then recall a short note (`store_memory`, then `recall`). `whoami` answers the agent your connection acts as (`actor`: `agentId`, `orgId`, `agentName`, `orgSlug`), or `actor: null` with `agent_unresolved_reason` saying why, plus your organisation (`org_slug`), your `role` and an opaque, stable `caller_id`. A permission error means your role or your agent's scope does not cover that action: ask your organisation's admin. You do not need new credentials for that.
100
101
 
102
+ ### MCP Apps (interactive views)
103
+
104
+ _Applies to: Cloud._
105
+
106
+ Six tools can show their result as an interactive view in clients that support [MCP Apps](https://github.com/modelcontextprotocol/ext-apps) (the MCP UI extension, protocol `2025-11-21`):
107
+
108
+ - `list_tasks`: a task table (`ui://vp/apps/v1/tasks-table`).
109
+ - `list_messages`: a message feed (`ui://vp/apps/v1/messages-feed`).
110
+ - `list_missions`: a mission list (`ui://vp/apps/v1/mission-timeline`).
111
+ - `list_memories`: a memory list (`ui://vp/apps/v1/memory-quote`).
112
+ - `get_diary`: a diary entry (`ui://vp/apps/v1/diary-entry`).
113
+ - `get_briefing_note`: a briefing note (`ui://vp/apps/v1/briefing-note`).
114
+
115
+ Each of these tools names its view in `tools/list` (`_meta.ui.resourceUri`), and the view is served by `resources/read` as `text/html;profile=mcp-app`. The view holds no data and calls nothing: your client hands it the tool's own result, so it shows exactly the rows the tool returned to you, after your scope was applied. A refusal is shown as a refusal, not as an empty list.
116
+
117
+ Every view declares one sandbox origin, `_meta.ui.domain`: the HTTPS origin the server was reached on (for the hosted service, `https://mcp.vantagepeers.com`), and a one-sentence `openai/widgetDescription`. The six tools also carry `openai/toolInvocation` status labels (for example "Listing tasks…" / "Listed tasks") for ChatGPT.
118
+
119
+ You turn nothing on. A client without MCP Apps support (Claude Code in a terminal, for example) shows the tool's text result, which is the same as before the views existed.
120
+
101
121
  ## Authentication
102
122
 
103
123
  _Applies to: Cloud._
@@ -122,7 +142,7 @@ _Applies to: Cloud._
122
142
  |---|---|---|
123
143
  | `GET` | `/.well-known/oauth-protected-resource/mcp` | Protected resource metadata (RFC 9728) for the `/mcp` resource; the 401 from `/mcp` points here |
124
144
  | `GET` | `/.well-known/oauth-protected-resource` | Same document, at the bare well-known path |
125
- | `GET` | `/.well-known/oauth-authorization-server` | Authorization server metadata (RFC 8414). Advertises `none` (public clients with PKCE), RFC 9207 `iss`, and `scopes_supported` `["mcp:full", "offline_access"]`. Client ID Metadata Documents are not supported. |
145
+ | `GET` | `/.well-known/oauth-authorization-server` | Authorization server metadata (RFC 8414). Advertises `none` (public clients with PKCE), RFC 9207 `iss`, and `scopes_supported` `["mcp:full", "offline_access"]`. A `client_id` that is an HTTPS URL is resolved from its Client ID Metadata Document (see below); `client_id_metadata_document_supported` is `true`. |
126
146
  | `GET` | `/.well-known/openid-configuration` | OpenID Connect discovery (adds `openid` and `email` to the scopes) |
127
147
  | `POST` | `/register` | Dynamic client registration (RFC 7591). Rate-limited to 10 per minute for the same client (same name and redirect URIs) from one IP, and 60 per minute per IP. The IP is `X-Real-IP` from the edge, else the rightmost `X-Forwarded-For` entry |
128
148
  | `GET` | `/authorize` | Authorization endpoint (authorization code with PKCE). Redirects to sign-in, then to the [consent page](#the-consent-page); the redirect carries `iss` (RFC 9207) |
@@ -132,6 +152,10 @@ _Applies to: Cloud._
132
152
  | `GET` | `/userinfo` | The signed-in person behind an access token |
133
153
  | `GET` | `/health` | Public status document: version, commit, serving runtime (`runtime`, `bun`, `node`), transport, agent-identity mode and its source |
134
154
  | `GET` | `/favicon.ico`, `/icon.png`, `/apple-touch-icon.png` | The VantagePeers icon, shown by clients next to the connector |
155
+ | `GET` | `/mcp/server-card`, `/.well-known/mcp/server-card.json`, `/.well-known/mcp-server-card`, `/mcp.json`, `/.well-known/mcp.json` | Public MCP Server Card (`application/mcp-server-card+json` when asked for, else `application/json`; `ETag`, `Cache-Control: public, max-age=3600`) |
156
+ | `GET` | `/mcp` from a browser | Public setup page (`text/html`), only for a request with no `Authorization` header whose `Accept` is absent, is `*/*` or names `text/html`, and does not name `text/event-stream`. Every other request on `/mcp` is an MCP request: without a credential it gets `401` and the `WWW-Authenticate` above |
157
+
158
+ **Client ID Metadata Documents.** An unregistered `client_id` that is an HTTPS URL (Claude.ai's connector uses one) is resolved at `/authorize` and `/token` by fetching its document. The fetch is bounded: HTTPS on the default port only, public addresses only, no redirect, 5 KB, 3 seconds, JSON only, and a limited number in flight. The document must carry the same `client_id`, exact `redirect_uris` and `token_endpoint_auth_method: "none"`. A wrong document is refused `400 invalid_client`; a failure that may pass (timeout, busy, rate limit) is `503 temporarily_unavailable`, so a client keeps its refresh token. The consent page names the redirect origin and flags such a client as unverified. The document grants nothing: the token's rights come from the signed-in person and the organisation, as for any client. Registered clients are never fetched. The service operator can unlist a client by URL, host or registrable domain; its tokens are then refused at once, and lifting the listing restores them.
135
159
 
136
160
  ### Tokens and revocation
137
161
 
@@ -151,31 +175,34 @@ An agent is identified by its **agent ID** (the `agentId` that `list_peers` retu
151
175
  - A typed agent name with no agent credential is refused (`AGENT_CREDENTIAL_REQUIRED`, naming the header). This is the default: the server runs in `strict` mode unless its operator explicitly sets `VANTAGE_ACTOR_CREDENTIAL_MODE=permissive`, and an unset, empty or unrecognised value is `strict`. One exemption: a seat whose token lists exactly one agent may name that agent. The operator master credential always needs the agent credential to act as an agent. The active mode and where it comes from are published at `/health` under `actor_credential`.
152
176
  - Naming another agent as the assignee of work (a mission `pilot`, a task `assignedTo`) is an assignment, not an identity claim: it is checked against your organisation's roster, not against your credential.
153
177
  - A call with no authorization context is refused `RBAC_DENIED` (reason `no-context`).
178
+ - A refused agent credential reads `AGENT_CREDENTIAL_INVALID (<reason>)` when the backend names a reason code (for example `owner-missing`). `whoami` names `agent_name`, `agent_status`, `writableNamespaces` and `default_write_namespace`. An agent's roster name is compared in normalised form, so a mixed-case agent reads and acts on its own tasks, messages and notes.
154
179
 
155
180
  ## Tools
156
181
 
157
182
  _Applies to: Cloud and Self-host._
158
183
 
159
184
  <!-- tools:start -->
160
- 88 tools are advertised to clients. This reference is generated from the server's own `tools/list` by `scripts/print-tools.mjs`; do not edit it by hand.
185
+ 95 tools are advertised to clients. This reference is generated from the server's own `tools/list` by `scripts/print-tools.mjs`; do not edit it by hand.
161
186
 
162
- ### Memory and search (9)
187
+ ### Memory and search (10)
163
188
 
164
- - `get_memory` (read) — Fetch a single memory by its Convex document ID, including relations and episode metadata.
189
+ - `erase_memory` (write, destructive) — Permanently erase a secret (a credential, token or key) from a memory: the matching text is replaced in the stored body, the content hash is recomputed and the search index entry is re-indexed and purged, so the original text is gone (unlike soft_delete_memory, which leaves the body readable).
190
+ - `get_memory` (read) — Fetch a single memory by its memoryId, including relations and episode metadata.
165
191
  - `hybrid_search` (read) — Combined vector + BM25 search via Reciprocal Rank Fusion for best semantic and keyword coverage.
166
192
  - `list_memories` (read) — List active (isLatest=true) memories for a namespace, ordered newest first.
167
193
  - `recall` (read) — Semantic vector search over VantagePeers memories, ranked by cosine similarity.
168
194
  - `soft_delete_document` (write) — Soft-delete all Knowledge Base chunks for a document.
169
195
  - `soft_delete_memory` (write, destructive) — Soft-delete a memory so it stops appearing in recall results while remaining in the audit log.
170
- - `store_document_chunked` (write) — Ingest a document binary (PDF, Markdown, plain text) into the Knowledge Base.
171
- - `store_memory` (write) — Store a typed memory entry (user/feedback/project/reference) in VantagePeers with optional graph relations.
196
+ - `store_document_chunked` (write) — Ingest a document binary (PDF, Markdown, plain text) into the Knowledge Base. storageId names a file already uploaded and claimed for your org: generate_upload_url (given the file's sha256) returns the upload URL and ticket, the file is POSTed there, and claim_upload (given the ticket) returns the storageId this tool takes.
197
+ - `store_memory` (write) — Store a typed memory entry in VantagePeers, optionally linked to an earlier memory.
172
198
  - `text_search` (read) — BM25 full-text keyword search over VantagePeers memories for exact term matching.
173
199
 
174
- ### Fix patterns (7)
200
+ ### Fix patterns (8)
175
201
 
176
- - `add_fix_attempt` (write) — Add a fix attempt record to a pattern with description, outcome, and optional commit reference.
202
+ - `add_fix_attempt` (write) — Record one attempt at fixing a known fix pattern: what was tried, whether it worked, why, and optionally its commit.
177
203
  - `create_fix_pattern` (write) — Create a fix pattern in the knowledge base documenting symptom, root cause, and optional validated fix.
178
- - `get_fix_pattern` (read) — Fetch a single fix pattern by its Convex document ID, including all linked fix attempts.
204
+ - `erase_fix_pattern` (write, destructive) — Permanently erase one fix pattern: the pattern, its fix attempts and its search entry are DELETED.
205
+ - `get_fix_pattern` (read) — Fetch a single fix pattern by its patternId, with up to 100 of its fix attempts.
179
206
  - `link_issue_to_pattern` (write) — Link a VantagePeers issue to a fix pattern creating a bidirectional reference.
180
207
  - `list_fix_patterns` (read) — List fix patterns filtered by source project, newest first with cursor paging support.
181
208
  - `search_fix_patterns` (read) — Semantic search over fix patterns by symptom description, ranked by relevance.
@@ -184,12 +211,12 @@ _Applies to: Cloud and Self-host._
184
211
  ### Missions and templates (9)
185
212
 
186
213
  - `create_mission` (write) — Create a mission grouping related tasks under a project with a pilot orchestrator and agent list.
187
- - `get_mission` (read) — Fetch a single mission by Convex ID with full details: status, pilot, agents, progress, and dates.
188
- - `get_mission_template` (read) — Fetch a mission template by name with all steps, or null if not found.
214
+ - `get_mission` (read) — Fetch a single mission by its ID with full details: status, pilot, agents, progress, start and target dates.
215
+ - `get_mission_template` (read) — Fetch a mission template by name with all its steps.
189
216
  - `instantiate_template_into_mission` (write) — Create one task per template step inside a mission, pre-assigned to each step's declared orchestrator.
190
217
  - `list_missions` (read) — List missions filtered by project, pilot, or status, newest first with cursor paging support.
191
218
  - `list_tasks_by_mission` (read) — List all tasks linked to a mission, optionally filtered by status, newest first.
192
- - `update_mission` (write) — Update any mutable field on a mission; only provided fields are patched, updatedAt auto-set.
219
+ - `update_mission` (write) — Update any mutable field on a mission.
193
220
  - `update_mission_status` (write) — Change a mission's lifecycle status in a single call without touching other fields.
194
221
  - `update_mission_template` (write) — Create or upsert a mission template by name; existing templates are overwritten.
195
222
 
@@ -197,25 +224,27 @@ _Applies to: Cloud and Self-host._
197
224
 
198
225
  - `create_recurring_task` (write) — Create a recurring task template that auto-generates tasks on a cron schedule.
199
226
  - `delete_recurring_task` (write, destructive) — Permanently delete a recurring task template, stopping all future scheduled task generation.
200
- - `get_recurring_task` (read) — Fetch a single recurring task definition by its Convex document ID with cron schedule, prompt, assignee, and last-fire metadata.
227
+ - `get_recurring_task` (read) — Fetch one recurring task template by its ID.
201
228
  - `list_recurring_tasks` (read) — List recurring task templates filtered by assignee or active status, newest first.
202
229
  - `pause_recurring_task` (write) — Pause a recurring task template to stop auto-creating tasks until explicitly resumed.
203
230
  - `resume_recurring_task` (write) — Resume a paused recurring task template and recalculate its next scheduled run time.
204
231
  - `update_recurring_task` (write) — Update a recurring task template's fields; cronExpression change auto-recalculates nextRunAt.
205
232
 
206
- ### Tasks (16)
233
+ ### Tasks (18)
207
234
 
208
235
  - `add_task_dependency` (write) — Add dependency task IDs to a task so it cannot start until all listed tasks complete.
236
+ - `next_task` (read) — Get the one task an agent should take next: its first todo task in queue order whose dependencies are all done, or an explicit `found: false`.
237
+ - `reorder_queue` (write) — Set the explicit work queue of one agent: the listed tasks get ranks 1..N, every other open task of that agent loses its rank, and an empty list clears the queue.
209
238
  - `block_task` (write, destructive) — Mark a task as blocked with an optional reason and blocking task IDs, setting status to blocked.
210
- - `bulk_complete_tasks` (write) — Bulk-close tasks that match a filter in one atomic mutation.
239
+ - `bulk_complete_tasks` (write) — Bulk-close the open tasks matching a filter, in one atomic mutation.
211
240
  - `checkout_task` (write) — Atomically claim a todo task, preventing race conditions when multiple orchestrators compete.
212
241
  - `complete_task` (write) — Mark a task as done with a mandatory completionNote; always notify the creator via send_message after.
213
242
  - `correct_task_segment` (write) — Restate the real boundaries of ONE recorded work segment, when it grew across an unrecorded break (e.g. a station's session ended without pause_task and the segment stayed open for days).
214
243
  - `create_task` (write) — Create a task assigned to an orchestrator with priority, status tracking, and optional mission link.
215
244
  - `delete_task` (write, destructive) — Permanently delete a task; only the creator or system role may delete.
216
245
  - `fail_task` (write) — Mark a task as failed (a terminal state distinct from done/cancelled) with a mandatory failureNote describing how the work ended.
217
- - `get_task` (read) — Fetch a single task by its Convex document ID with all fields: title, description, status, priority, assignment, dependencies, mission link, completion note.
218
- - `list_tasks` (read) — List tasks with optional filters by assignee, status, project, or creator, newest first.
246
+ - `get_task` (read) — Fetch one task by its taskId.
247
+ - `list_tasks` (read) — List tasks with optional filters by assignee, status, project, or creator, newest first; `sort: "queue"` orders by the assignee's explicit queue.
219
248
  - `pause_task` (write) — Close the task's open work segment and stop the duration clock, without ending the task.
220
249
  - `resume_task` (write) — Open a new work segment on a paused task and set it back to in_progress.
221
250
  - `search_tasks_by_keyword` (read) — BM25 full-text keyword search over task titles, ranked by relevance.
@@ -226,7 +255,7 @@ _Applies to: Cloud and Self-host._
226
255
 
227
256
  - `check_messages` (read) — Check for unread messages addressed to a recipient role, returning receiptIds for acknowledgment.
228
257
  - `delete_message` (write, destructive) — Delete a message and all its receipts; only the original sender or system may delete.
229
- - `get_message` (read) — Fetch a single peer message by its Convex document ID with full body, channel, sender, sessionDay, and tenant scope.
258
+ - `get_message` (read) — Fetch a single peer message: its full body, sender, channel, session day and organisation.
230
259
  - `list_broadcast_status` (read) — Show read/unread receipt status for a broadcast message by messageId.
231
260
  - `list_messages` (read) — List historical messages filtered by session day or sender, newest first; use check_messages for unread.
232
261
  - `mark_as_read` (write) — Mark one or more message receipts as read using receiptIds from check_messages.
@@ -235,8 +264,8 @@ _Applies to: Cloud and Self-host._
235
264
 
236
265
  ### Briefing notes (5)
237
266
 
238
- - `create_briefing_note` (write) — Create a structured briefing note capturing a topic discussion with participants, decisions, and memory links.
239
- - `get_briefing_note` (read) — Fetch a single briefing note by ID with all fields: title, topic, participants, content, decisions, and links.
267
+ - `create_briefing_note` (write) — Create a briefing note that records one discussion: its title, topic, participants, full content, the decisions reached and the memories it builds on.
268
+ - `get_briefing_note` (read) — Fetch one briefing note by its noteId.
240
269
  - `list_briefing_notes` (read) — List briefing notes filtered by topic, newest first, with cursor paging support.
241
270
  - `search_briefing_notes_by_keyword` (read) — BM25 full-text keyword search over briefing note content, ranked by relevance.
242
271
  - `update_briefing_note` (write) — Update an existing briefing note; only provided fields are patched (arrays are FULL REPLACE).
@@ -251,7 +280,7 @@ _Applies to: Cloud and Self-host._
251
280
 
252
281
  ### Diary (3)
253
282
 
254
- - `get_diary` (read) — Fetch a diary entry for a specific date and orchestrator, returning null if none exists.
283
+ - `get_diary` (read) — Fetch the diary entry of one orchestrator for one date.
255
284
  - `list_diaries` (read) — List diary entries filtered by orchestrator or author, newest first with cursor paging support.
256
285
  - `write_diary` (write) — Write or upsert a diary entry for a specific date and orchestrator with highlights and blockers.
257
286
 
@@ -262,8 +291,8 @@ _Applies to: Cloud and Self-host._
262
291
  ### Profiles and peers (4)
263
292
 
264
293
  - `get_profile` (read) — Fetch an orchestrator profile with static identity and dynamic session state fields.
265
- - `list_peers` (read) — List all orchestrator profiles with current status, summary, and session info, newest first.
266
- - `set_summary` (write) — Update the current-work summary for an orchestrator instance, visible via list_peers.
294
+ - `list_peers` (read) — List all orchestrator profiles with current task and session info, newest first.
295
+ - `set_summary` (write) — Set the status summary of an orchestrator instance: one or two sentences on what it is working on now, replacing the previous summary, which peers read in list_peers.
267
296
  - `update_profile` (write) — Create or update an orchestrator profile with static identity facts and dynamic session state.
268
297
 
269
298
  ### Knowledge bundles (OKF) (2)
@@ -271,20 +300,23 @@ _Applies to: Cloud and Self-host._
271
300
  - `export_okf_bundle` (write) — Export a VantagePeers namespace as an OKF v0.1 bundle (tarball).
272
301
  - `import_okf_bundle` (write) — Import an OKF v0.1 bundle (memories + briefing-notes + tasks) into a target VantagePeers namespace.
273
302
 
274
- ### Other (12)
303
+ ### Other (15)
275
304
 
276
305
  - `add_repo_mapping` (write) — Register or update a GitHub repo to orchestrator mapping for webhook event routing.
277
306
  - `claim_upload` (write) — Claim an uploaded blob for your organisation with the single-use ticket generate_upload_url returned.
278
307
  - `debate_get_room` (read) — Read a debate room: its subject, frozen template, pointer and the full transcript.
279
308
  - `debate_post_turn` (write) — Post your answer to the debate-room turn you were asked for; the only way a turn enters a room.
309
+ - `erase_row` (write, destructive) — Permanently erase one row you or your organisation own: the row is DELETED (and, for a memory, its search entry is purged), unlike the soft deletes that leave the body readable.
280
310
  - `generate_upload_url` (write) — Mint a Convex storage upload URL for the Knowledge Base ingest flow.
281
311
  - `get_bulk_complete_run` (read) — Read the status of one live bulk_complete_tasks run by the `bulkRunId` its first call returned.
282
312
  - `get_github_owner_bindings` (read) — List the GitHub owners bound to your organisation (master: all), and for master the org-owned repo mappings that have no proof.
283
- - `improvisation_digest` (read) — Scan a rolling time window of VP tasks, messages, and memories for durable artifacts that carry fleet/state tokens (commit SHA, PR#, VP id, or decisive verb such as merged/deployed/approved) but have NO VP-Sources footer.
313
+ - `get_owner_tool_usage` (read) — List which MCP tools a person has used across all the agents it owns (one per AI client) and its own direct calls, summed per tool with the earliest first call and the latest last call.
314
+ - `get_tool_usage` (read) — List which MCP tools a caller has called, with the first call time, the last call time and the call count of each.
315
+ - `improvisation_digest` (read) — Audit a rolling window of recent closed-task notes, messages and memories for claims about fleet state (a commit SHA, a PR number, a VantagePeers ID, or a decisive verb such as merged, deployed or approved) that carry no source citation line (a 'recall("<query>")→[ids]' or 'none-needed: <reason>' marker).
284
316
  - `list_blocked_on_me` (read) — List the tasks that other peers have BLOCKED on one of YOUR live tasks (blockedOnTaskId), oldest wait first, with the age of each wait.
285
317
  - `list_repo_mappings` (read) — List all GitHub repo to orchestrator webhook mappings, newest first with cursor paging support.
286
318
  - `remove_repo_mapping` (write, destructive) — Delete a GitHub repo mapping by repo name, stopping webhook event routing for that repo.
287
- - `whoami` (read) — Returns the orchestrator identity baked into the current bearer's scope context.
319
+ - `whoami` (read) — Report who this connection acts as and what it may read and write, read from its own credential only.
288
320
 
289
321
  The tools below are present in the server code but disabled in this release: a client can neither list nor call them. They are named so this reference matches the code exactly.
290
322
 
@@ -302,13 +334,31 @@ _Applies to: Cloud and Self-host._
302
334
  - **Rows your scope removed.** `list_peers`, `list_tasks_by_mission` and `list_recurring_tasks` answer a bare array when nothing was filtered out, and `{ items, nextCursor?, scopeFiltered }` when your scope removed rows of your own organisation from the page (`scopeFiltered` is that count; another organisation's rows are never counted). `list_broadcast_status` reports `scopeFiltered` and `truncated` beside its receipts. The cursor is decided on the raw page, so a narrowed page still carries its cursor.
303
335
  - **List arguments.** Every list argument a client fills (for example `mark_as_read` `receiptIds`) accepts a JSON array or the same array sent as a JSON string. The status filters of `list_tasks`, `list_tasks_by_mission` and `list_missions` are published as an array of statuses; a single status, or an alias (`open`, `active`, `all`) on its own, is still accepted.
304
336
  - **Output schemas are open.** A tool's `outputSchema` allows fields added in a later release, so a client connected before an upgrade keeps validating the answers.
337
+ - **Structured answers.** Every tool (95) declares an `outputSchema` and return `structuredContent`. For 50 it is the same object as their JSON text (which is unchanged): `whoami`; the single-row reads (`get_memory`, `get_episode`, `get_task`, `get_fix_pattern`, `get_message`, `get_recurring_task`, `get_briefing_note`, `get_bulk_complete_run`); `list_blocked_on_me`, `list_broadcast_status`, `get_github_owner_bindings`, `billing_summary_by_project`; and the writes whose answer is a fixed set of keys (task, mission, note, memory, episode, message, profile, recurring-task, repo-mapping and fix-pattern writes). For 21 lists and searches the text is unchanged too and `structuredContent` is its object form: `{ items }` for the ten searches whose text is a bare JSON array (`recall`, `text_search`, `hybrid_search`, the six `search_*` tools, `get_tool_usage`), and `{ items, nextCursor, truncated }` for eleven paged `list_*` tools, where `truncated` is true exactly when the 60 KB response cap cut the page (`nextCursor` is then null). Three reads that may find nothing (`get_mission`, `get_mission_template`, `get_diary`) keep their text (the row as JSON, or `null`) and answer `{ found: true, item }` or `{ found: false, id }`, `id` being what was asked for. For `get_owner_tool_usage` (`{ items, truncated? }`), `list_diaries` (`{ items, nextCursor, truncated }`) and `get_profile` (`{ found: true, item }` or `{ found: false, id }`) the text is the `structuredContent` itself as JSON, envelope included, cut or not, found or not. `check_messages` keeps its text and answers `{ messages, truncated, nextSince, stuckInProgress, peersStuckOnYou }`. The Knowledge Base and OKF tools (`generate_upload_url`, `claim_upload`, `store_document_chunked`, `soft_delete_document`, `export_okf_bundle`, `import_okf_bundle`) answer their result object; for `generate_upload_url` it is `{ uploadUrl, ticket, expiresAt?, note? }`, its two text items as one. The last eleven (`improvisation_digest`, `debate_get_room`, `debate_post_turn`, `erase_memory`, `erase_row`, `erase_fix_pattern`, `bulk_complete_tasks`, `create_fix_pattern`, `add_fix_attempt`, `update_mission_template`, `instantiate_template_into_mission`) answer the same object as their JSON text; `debate_get_room` keeps its whole answer under the 60 KB cap by cutting the transcript to its first turns and saying so (`truncated: true`, `_meta` in the text). Every tool is called end to end through `/mcp` in the test suite, which fails naming any served tool that is not.
305
338
  - **Agents by ID.** `send_message` takes `recipientAgentIds` (the `agentId` values `list_peers` returns) and `fromAgentId`; `create_task` and `update_task` take `assignedToAgentId`. A message to a fleet coordinator by channel name is refused (`coordinator-by-name-refused`); address it by ID.
306
339
  - **Evidence lines in messages.** In `send_message`, an `evidence:` line that states a live state (a pull request's state, a package version, a task status) must carry the command that produced it on the same line (for example `gh pr view 12 -R owner/repo --json state -> MERGED`) or a token (`{{pr:owner/repo#N}}`, `{{npm:pkg@tag}}`, `{{task:id}}`). A bare literal is refused, even when true, and nothing is sent; a stated state is still checked live.
307
340
  - **Tasks.** `create_task` and `update_task` take an optional `deliverable` (`{ pkg, export }`); `get_task` and `list_tasks` then show `deliverableState` and, when the export is published while the task is still open, `deliverableDivergence: "delivered-but-open"`. `bulk_complete_tasks` closes the first 500 matches in the call and the rest in the background; read the run with `get_bulk_complete_run` and the `bulkRunId` it returned. `list_blocked_on_me` lists the tasks other peers have blocked on your live tasks.
308
341
  - **Recurring tasks.** A schedule whose previous task is still open creates nothing at its next run and records the skip (`skippedRuns`, `lastSkippedAt`, `lastSkipReason`, shown by `get_recurring_task` and `list_recurring_tasks`).
309
342
  - **Debate rooms.** `debate_get_room` reads a room and its transcript; `debate_post_turn` posts your answer when it is your turn. Out-of-turn, non-participant, empty, stale or over-long posts are refused with their own codes (`not_your_turn`, `not_a_participant`, `empty`, `stale_turn`, `too_long`).
343
+ - **Dependencies append.** `add_task_dependency` and `block_task` (`blockedBy`) add to a task's existing dependencies, deduplicated, and answer the resulting list; they no longer replace it. `update_task` `dependsOn` stays the explicit replace. `link_commit_to_issue` skips a commit SHA already recorded.
344
+ - **Tool usage.** `get_tool_usage` lists which MCP tools a caller has called, with first call, last call and call count; `get_owner_tool_usage` sums that across the agents a person owns.
345
+ - **Refusal codes.** A refused `send_message` carries `RBAC_DENIED` or `INVALID_RECIPIENTS`, and a missing message `MESSAGE_NOT_FOUND`, instead of a bare server error.
346
+ - **Task queue.** `reorder_queue` sets one agent's queue (`assignedToAgentId`, `taskIds`): listed tasks get ranks 1 to N, the agent's other open tasks lose their rank, `[]` clears it. It is open to the assignee, an organisation admin or a listed queue coordinator. `next_task` returns the first task of that queue the agent can take (rank, then priority, then age, dependencies done) or `found: false`. `list_tasks` with `sort: "queue"` lists in that order; without `sort` it is unchanged.
347
+ - **Project is required.** `create_task` refuses a missing, empty or blank `project`; `update_task` refuses setting it to empty. `billing_summary_by_project` keeps `unattributedTaskCount` and adds `noProjectCount` and `noDurationCount`; `listNoDuration: true` also returns up to 200 tasks with a project and no measured duration (`noDurationTasks`, `noDurationTasksTruncated`).
348
+ - **Task windows.** `list_tasks` with `updatedSince` pages a window of any size, newest-updated first, with an opaque cursor. A combination the indexes cannot serve is refused with the remedy in the message, never answered with a partial page.
349
+ - **Erase.** `erase_row` deletes one row of the eleven covered tables, `erase_fix_pattern` one fix pattern, `erase_memory` the matching text of a memory. An organisation admin may erase any row of the organisation; an author the rows it wrote (a person by verified identity, an agent by its agent ID); any other caller is refused `RBAC_DENIED`. Erasing a memory covers every version of it.
350
+ - **Default namespace.** A memory or episode read without `namespace` reads your own space (a person's `team/<organisation>`, a seat's `orchestrator/<agent ID>`); `list_memories` and `export_okf_bundle` still require one. `store_memory` and `store_episode` write there when `namespace` is omitted. A refusal ends with the writable namespaces and the default.
351
+ - **Cursors.** An invalid `cursor` argument is an error result with `structuredContent { error: { code: "invalid_cursor", message } }`. `tools/list`, `resources/list` and `resources/templates/list` refuse any cursor with JSON-RPC -32602, because they are served whole.
352
+ - **Text that is JSON.** The text of `get_owner_tool_usage`, `list_diaries` and `get_profile` is the JSON of their `structuredContent` (`{ items, truncated? }`, `{ items, nextCursor, truncated }`, `{ found: false, id }`).
353
+ - **Build identity.** `initialize` returns `serverInfo.commitSha`, the value `/health` reports as `commit` (`"unknown"` when no build stamped one); the Server Card lists the server's `capabilities` and `tools`.
310
354
  - **Errors.** A protocol error thrown by a tool reads without the former `MCP error <code>:` prefix. `tools/list` stamps its JSON Schemas with the 2020-12 dialect and no longer carries `execution.taskSupport`.
311
355
 
356
+ ### Citing what an answer rests on (optional workflow)
357
+
358
+ _Applies to: Cloud and Self-host. This is guidance for you, the user; the tools themselves no longer ask the model to follow it._
359
+
360
+ A team that wants every factual claim about its own state (a task status, a deployment, a decision) to be traceable can ask its agents to search VantagePeers first (`recall`, `text_search`, `hybrid_search`, `list_briefing_notes`, `search_briefing_notes_by_keyword`) and to end such an answer with one line naming the search and the IDs it returned, for example `VP-Sources: recall("pricing decision")→[j57abc…]`, or `none-needed: <reason>` when the claim needs no lookup. Put that request in your own agent instructions (a system prompt, a `CLAUDE.md`, a project rule). `improvisation_digest` (fleet master only) counts the recent closed-task notes, messages and memories that state fleet facts without such a line.
361
+
312
362
  ## Security
313
363
 
314
364
  _Applies to: Cloud._
@@ -318,7 +368,8 @@ _Applies to: Cloud._
318
368
  - **Messages stay in your organisation.** A seat's direct messages and broadcasts reach its own organisation's roster, plus fleet coordinators your organisation is explicitly allowed to address.
319
369
  - **Agent identity comes from a credential, not a typed name.** See [Agent identity](#agent-identity). A caller from another organisation cannot send a message, or act on a task, under one of your agents' names, even when both organisations have an agent with the same name.
320
370
  - **A refusal never looks like an empty result.** A read you are not allowed to make returns an explicit error (for example, `list_peers`, `list_diaries` and `list_briefing_notes` return text opening with `REFUSED (RBAC_DENIED)`) rather than an empty list, so an agent cannot mistake "not allowed" for "nothing there". An agent credential that does not resolve is refused with its own code (`AGENT_CREDENTIAL_INVALID`, HTTP 401), distinct from a lookup failure. A signed-in user whose account has no organisation yet receives its own refusal, distinct from an invalid token.
321
- - **Token checks.** Clerk session tokens are verified against the issuer's published keys, with issuer and audience both bound. OAuth client secrets are compared in constant time. `redirect_uri` must match a registered URI exactly, and dynamic registration rejects non-HTTPS redirect URIs (except `localhost` / `127.0.0.1`). The consent page's form post must come from the same origin.
371
+ - **Token checks.** Clerk session tokens are verified against the issuer's published keys, with issuer and audience both bound. OAuth client secrets are compared in constant time. `redirect_uri` must match a registered URI exactly, and dynamic registration rejects non-HTTPS redirect URIs (except the loopback addresses `localhost`, `127.0.0.1` and `[::1]`, whose port may differ from the registered one, RFC 8252 section 7.3). The consent page's form post must come from the same origin.
372
+ - **Retired rows stay retired.** `recall`, `text_search` and `hybrid_search` drop a superseded, soft-deleted or tombstoned memory or Knowledge Base chunk, and `get_memory` and `list_memories` no longer serve one to an organisation member. A client seat finds through those searches what it wrote in its own `orchestrator/<agent ID>` and `project/<organisation>` namespaces.
322
373
  - **Health document.** `/health` is public and publishes only aggregates (version, commit, serving runtime, transport, the agent-identity mode and where it comes from). It never echoes a secret or a customer identifier.
323
374
 
324
375
  To report a vulnerability, open an issue at https://github.com/vantageos-agency/vantage-peers/issues without exploit details and ask for a private channel.
@@ -337,6 +388,8 @@ That is **VantagePeers Self-host**, a separate product with its own setup (backe
337
388
 
338
389
  The stdio server answers MCP protocol `2026-07-28` and `2025-11-25` clients alike. It presents the service identity of your deployment to your backend (`CLERK_SECRET_KEY` and `CLERK_SERVICE_ACCOUNT_USER_ID`, see the Self-host guide); without it, it refuses to start.
339
390
 
391
+ The stdio server registers the same tools, so `list_tasks`, `list_messages`, `list_missions`, `list_memories`, `get_diary` and `get_briefing_note` carry the same `_meta.ui.resourceUri` links and serve the same static `ui://vp/apps/v1/<view>` documents for an MCP Apps-capable local client.
392
+
340
393
  The package also exports typed function references for the VantagePeers backend at `vantage-peers-mcp/api`, for TypeScript services that call a deployment directly.
341
394
 
342
395
  ### Backend compatibility check
@@ -346,14 +399,64 @@ _Applies to: Self-host._
346
399
  Before it serves anything, the server asks your backend for its contract manifest (`meta:backendContract`) and refuses to start, with a log line beginning `BACKEND INCOMPATIBLE (<reason>)`, when:
347
400
 
348
401
  - the backend has no manifest (it predates this check);
349
- - the backend's contract version is below **10**, the version this release requires;
350
- - any of the **141** backend functions this release calls is missing (they are named in the log);
402
+ - the backend's contract version is below **29**, the version this release requires;
403
+ - any of the **153** backend functions this release calls is missing (they are named in the log);
351
404
  - the server cannot present its service identity, or the backend refuses it.
352
405
 
353
406
  So upgrade in this order: deploy the backend of the same release first, then upgrade this package. The check sees a missing function, not a changed argument; the contract version covers that.
354
407
 
355
408
  ## Release notes
356
409
 
410
+ ### 5.0.0
411
+
412
+ _Applies to: Cloud and Self-host._ Each item names the product it concerns. A major release: tool inputs and output shapes changed.
413
+
414
+ **Breaking**
415
+
416
+ - Cloud and Self-host: `create_task` requires a `project`; pass a project name on every create (see [Tool inputs and outputs](#tool-inputs-and-outputs)).
417
+ - Cloud and Self-host: the text of `get_owner_tool_usage` is `{ items, truncated? }`, of `list_diaries` `{ items, nextCursor, truncated }`, and of `get_profile` `{ found: true, item }` or `{ found: false, id }`; read the envelope or `structuredContent`, not a bare array or `null` (see [Tool inputs and outputs](#tool-inputs-and-outputs)).
418
+ - Cloud and Self-host: `tools/list`, `resources/list` and `resources/templates/list` refuse any cursor with -32602; do not send one (see [Tool inputs and outputs](#tool-inputs-and-outputs)).
419
+ - Cloud and Self-host: `list_tasks` with `updatedSince` returns newest-updated first (see [Tool inputs and outputs](#tool-inputs-and-outputs)).
420
+ - Cloud: `get_fix_pattern` answers `RBAC_DENIED`, not "not found", outside the creator roster (see [Tool inputs and outputs](#tool-inputs-and-outputs)).
421
+ - Self-host: the server requires backend contract version 29 and 153 backend functions (was 17 and 144). Deploy the backend of this release first, then upgrade the package; an older backend is refused at start (see [Backend compatibility check](#backend-compatibility-check)).
422
+
423
+ **Added**
424
+
425
+ - Cloud and Self-host: `reorder_queue`, `next_task` and `list_tasks` `sort: "queue"` (see [Tool inputs and outputs](#tool-inputs-and-outputs)).
426
+ - Cloud: `erase_row`, `erase_fix_pattern`, and `erase_memory` for agent seats (see [Tool inputs and outputs](#tool-inputs-and-outputs)).
427
+ - Cloud: Client ID Metadata Documents at `/authorize` and `/token` (see [OAuth endpoints](#oauth-endpoints)).
428
+ - Cloud and Self-host: `structuredContent` and a described `outputSchema` on every tool, split unattributed counts in `billing_summary_by_project`, build identity on `initialize` (see [Tool inputs and outputs](#tool-inputs-and-outputs)).
429
+ - Cloud: `whoami` names the agent and workspace; the default namespace for writes and reads (see [Agent identity](#agent-identity)).
430
+
431
+ **Changed**
432
+
433
+ - Cloud and Self-host: `invalid_cursor` error code, paged `list_tasks` windows, a read without namespace reads your own space, a `fields` input no longer published on seven lists (see [Tool inputs and outputs](#tool-inputs-and-outputs)).
434
+ - Cloud: the consent page offers the operator's organisation and the agent bound to the person (see [The consent page](#the-consent-page)).
435
+
436
+ **Fixes**
437
+
438
+ - Cloud: retired memories no longer come back through search; mixed-case agent names work on every door; client seats find their own memory (see [Security](#security), [Agent identity](#agent-identity)).
439
+ - Cloud and Self-host: `list_messages`, `list_diaries`, `list_recurring_tasks` and `list_issues` filters apply before the page is cut; `improvisation_digest` and `get_fix_pattern` fixes (see [Tool inputs and outputs](#tool-inputs-and-outputs)).
440
+
441
+ ### 4.1.0
442
+
443
+ _Applies to: Cloud and Self-host._ Each item names the product it concerns.
444
+
445
+ **Action required (Self-host)**
446
+
447
+ - Self-host: the server now requires backend contract version 17 and 144 backend functions (was 10 and 141). Deploy the backend of this release first, then upgrade the package; an older backend is refused at start (see [Backend compatibility check](#backend-compatibility-check)).
448
+
449
+ **Added**
450
+
451
+ - Cloud and Self-host: `get_tool_usage` and `get_owner_tool_usage` (see [Tool inputs and outputs](#tool-inputs-and-outputs)).
452
+ - Cloud and Self-host: six tools name an interactive MCP Apps view (see [MCP Apps](#mcp-apps-interactive-views)).
453
+ - Cloud: a native client's loopback `redirect_uri` may vary its port (see [Security](#security)).
454
+
455
+ **Fixes**
456
+
457
+ - Cloud: every call runs inside the bearer's verified organisation, keyed by its permanent ID; a seat reaches its own `orchestrator/<agent ID>` and `project/<org>` on every path; diaries and mandate bindings stay inside the organisation; an agent can pause, resume and delete its own recurring tasks (see [Security](#security), [Agent identity](#agent-identity)).
458
+ - Cloud and Self-host: dependencies append instead of replacing; refusals carry their code (see [Tool inputs and outputs](#tool-inputs-and-outputs)).
459
+
357
460
  ### 4.0.0
358
461
 
359
462
  _Applies to: Cloud and Self-host._ Each item names the product it concerns.
@@ -417,7 +520,7 @@ Full history: [CHANGELOG.md](https://github.com/vantageos-agency/vantage-peers/b
417
520
 
418
521
  _Applies to: Self-host._
419
522
 
420
- Node.js 26.12.1 (the October 2026 security release), for the Self-host stdio server and the `vantage-peers-mcp/api` exports: `engines.node` names that exact version. A backend of the same release (contract version 10, see [Backend compatibility check](#backend-compatibility-check)). VantagePeers Cloud clients need nothing installed.
523
+ Node.js 26.12.1 (the October 2026 security release), for the Self-host stdio server and the `vantage-peers-mcp/api` exports: `engines.node` names that exact version. A backend of the same release (contract version 29, see [Backend compatibility check](#backend-compatibility-check)). VantagePeers Cloud clients need nothing installed.
421
524
 
422
525
  ## License
423
526
 
@@ -62,6 +62,14 @@ export declare const REGISTER_RATE_LIMIT_PER_IP = 60;
62
62
  * is attacker-controlled and must never be the key (rotating it bypassed
63
63
  * the per-IP ceiling).
64
64
  * 3. else `"unknown"` — one shared bucket, as before.
65
+ *
66
+ * What is trusted, stated (round 2 of the CIMD audit; no new header is trusted):
67
+ * `x-real-ip` is the only header Railway documents for the client address
68
+ * (https://docs.railway.com/networking/public-networking/specs-and-limits,
69
+ * "Request Headers": "X-Real-IP for identifying client's remote IP"). That page
70
+ * does not document `x-forwarded-for`; the rightmost-entry fallback predates the
71
+ * CIMD work (the /register limiter) and is kept as it was. The CIMD limits key
72
+ * the result through `sourceKeyOf` (IPv6 on its /64, IPv4 in full).
65
73
  */
66
74
  export declare function clientIpForRateLimit(header: (name: string) => string | undefined): string;
67
75
  /** Test-only: clear every DCR rate-limit bucket. */