vantage-peers-mcp 5.0.2 → 5.1.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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,31 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [5.1.0] — 2026-11-25
6
+
7
+ A minor release: two new read tools. No existing tool input or output changes. Each entry names the product it concerns.
8
+
9
+ ### Added
10
+
11
+ - Cloud and Self-host: `get_repo_route` reads who owns and who reviews one GitHub repository in your organisation: `routed` (owner and reviewer), `unreviewed` (owner, no reviewer) or `absent` (no row), always a typed state, never an empty reply. Another organisation's row answers `absent`. ([Tool inputs and outputs](README.md#tool-inputs-and-outputs))
12
+ - Cloud and Self-host: `check_repo_routing` takes your organisation's real repository list and returns which repos are `routed`, `unreviewed`, `missing` (no row) and `stale` (a row for a repo not in your list), with `complete` true only when the last three are empty. It reads every page of your routing table. ([Tool inputs and outputs](README.md#tool-inputs-and-outputs))
13
+
14
+ ### Changed
15
+
16
+ - Self-host: the server calls one more backend function, `githubRepoMapping:getRoute` (154 called functions, 5.0.3: 153); the required backend contract stays 30. A backend that lacks `getRoute` is refused at start, naming it. Deploy the backend of this release first, then upgrade this package. ([Backend compatibility check](README.md#backend-compatibility-check))
17
+
18
+ ## [5.0.3] — 2026-11-25
19
+
20
+ A patch release. Tool inputs and outputs are unchanged. Each entry names the product it concerns.
21
+
22
+ ### Fixed
23
+
24
+ - Cloud and Self-host: `get_tool_usage` and `get_owner_tool_usage` serve a master-scope caller that has a verified agent ID. Such a caller got `RBAC_DENIED` (`claimless-service-account`) because it resolves no organisation; it now sends its agent as the claim, never beside an organisation claim. Organisation seats, person sessions and a master with no agent ID are unchanged. ([Tool inputs and outputs](README.md#tool-inputs-and-outputs))
25
+
26
+ ### Changed
27
+
28
+ - Self-host: the server requires backend contract version 30 (5.0.2: 29); the 153 called functions are unchanged. A backend of contract 29 is refused at start. Deploy the backend of this release first, then upgrade this package. ([Backend compatibility check](README.md#backend-compatibility-check))
29
+
5
30
  ## [5.0.2] — 2026-11-24
6
31
 
7
32
  A patch release. Tool inputs and outputs are unchanged. Each entry names the product it concerns.
package/README.md CHANGED
@@ -182,7 +182,7 @@ An agent is identified by its **agent ID** (the `agentId` that `list_peers` retu
182
182
  _Applies to: Cloud and Self-host._
183
183
 
184
184
  <!-- tools:start -->
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.
185
+ 97 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.
186
186
 
187
187
  ### Memory and search (10)
188
188
 
@@ -230,11 +230,9 @@ _Applies to: Cloud and Self-host._
230
230
  - `resume_recurring_task` (write) — Resume a paused recurring task template and recalculate its next scheduled run time.
231
231
  - `update_recurring_task` (write) — Update a recurring task template's fields; cronExpression change auto-recalculates nextRunAt.
232
232
 
233
- ### Tasks (18)
233
+ ### Tasks (17)
234
234
 
235
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.
238
236
  - `block_task` (write, destructive) — Mark a task as blocked with an optional reason and blocking task IDs, setting status to blocked.
239
237
  - `bulk_complete_tasks` (write) — Bulk-close the open tasks matching a filter, in one atomic mutation.
240
238
  - `checkout_task` (write) — Atomically claim a todo task, preventing race conditions when multiple orchestrators compete.
@@ -244,7 +242,8 @@ _Applies to: Cloud and Self-host._
244
242
  - `delete_task` (write, destructive) — Permanently delete a task; only the creator or system role may delete.
245
243
  - `fail_task` (write) — Mark a task as failed (a terminal state distinct from done/cancelled) with a mandatory failureNote describing how the work ended.
246
244
  - `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.
245
+ - `list_tasks` (read) — List tasks with optional filters by assignee, status, project, or creator, newest first.
246
+ - `next_task` (read) — Get the one task an agent should take next: among its todo tasks you may see, the first in queue order (ranked tasks by rank, then unranked by priority and age) whose dependencies are all done.
248
247
  - `pause_task` (write) — Close the task's open work segment and stop the duration clock, without ending the task.
249
248
  - `resume_task` (write) — Open a new work segment on a paused task and set it back to in_progress.
250
249
  - `search_tasks_by_keyword` (read) — BM25 full-text keyword search over task titles, ranked by relevance.
@@ -300,9 +299,10 @@ _Applies to: Cloud and Self-host._
300
299
  - `export_okf_bundle` (write) — Export a VantagePeers namespace as an OKF v0.1 bundle (tarball).
301
300
  - `import_okf_bundle` (write) — Import an OKF v0.1 bundle (memories + briefing-notes + tasks) into a target VantagePeers namespace.
302
301
 
303
- ### Other (15)
302
+ ### Other (18)
304
303
 
305
304
  - `add_repo_mapping` (write) — Register or update a GitHub repo to orchestrator mapping for webhook event routing.
305
+ - `check_repo_routing` (read) — Check that a list of repos is fully routed in your organisation, against the org's whole routing table.
306
306
  - `claim_upload` (write) — Claim an uploaded blob for your organisation with the single-use ticket generate_upload_url returned.
307
307
  - `debate_get_room` (read) — Read a debate room: its subject, frozen template, pointer and the full transcript.
308
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.
@@ -311,11 +311,13 @@ _Applies to: Cloud and Self-host._
311
311
  - `get_bulk_complete_run` (read) — Read the status of one live bulk_complete_tasks run by the `bulkRunId` its first call returned.
312
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.
313
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_repo_route` (read) — Get the review route of one GitHub repo in your organisation: routed, unreviewed or absent.
314
315
  - `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
316
  - `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).
316
317
  - `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.
317
318
  - `list_repo_mappings` (read) — List all GitHub repo to orchestrator webhook mappings, newest first with cursor paging support.
318
319
  - `remove_repo_mapping` (write, destructive) — Delete a GitHub repo mapping by repo name, stopping webhook event routing for that repo.
320
+ - `reorder_queue` (write) — Set the explicit work queue of one agent: the listed tasks get ranks 1..N in the order given (1 = next), and every other open task of that agent loses its rank.
319
321
  - `whoami` (read) — Report who this connection acts as and what it may read and write, read from its own credential only.
320
322
 
321
323
  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.
@@ -399,14 +401,28 @@ _Applies to: Self-host._
399
401
  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:
400
402
 
401
403
  - the backend has no manifest (it predates this check);
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);
404
+ - the backend's contract version is below **30**, the version this release requires;
405
+ - any of the **154** backend functions this release calls is missing (they are named in the log);
404
406
  - the server cannot present its service identity, or the backend refuses it.
405
407
 
406
408
  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.
407
409
 
408
410
  ## Release notes
409
411
 
412
+ ### 5.1.0
413
+
414
+ _Applies to: Cloud and Self-host._ A minor release: two new read tools; existing tools are unchanged.
415
+
416
+ - Cloud and Self-host: `get_repo_route` reads the review route of one repository (routed, unreviewed or absent) and `check_repo_routing` checks a repository list against your organisation's routing table (routed, unreviewed, missing, stale) (see [Tool inputs and outputs](#tool-inputs-and-outputs)).
417
+ - Self-host: one more called backend function (`githubRepoMapping:getRoute`, 154 in all), contract still 30; deploy the backend first (see [Backend compatibility check](#backend-compatibility-check)).
418
+
419
+ ### 5.0.3
420
+
421
+ _Applies to: Cloud and Self-host._ A patch release: tool inputs and outputs are unchanged.
422
+
423
+ - Cloud and Self-host: `get_tool_usage` and `get_owner_tool_usage` serve a master-scope caller that has a verified agent ID, which now sends the agent as its claim; organisation seats are unchanged (see [Tool inputs and outputs](#tool-inputs-and-outputs)).
424
+ - Self-host: the backend contract required moves from 29 to 30, with the same 153 called functions; deploy the backend first (see [Backend compatibility check](#backend-compatibility-check)).
425
+
410
426
  ### 5.0.2
411
427
 
412
428
  _Applies to: Cloud and Self-host._ A patch release: tool inputs and outputs are unchanged.
@@ -535,7 +551,7 @@ Full history: [CHANGELOG.md](https://github.com/vantageos-agency/vantage-peers/b
535
551
 
536
552
  _Applies to: Self-host._
537
553
 
538
- 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.
554
+ 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 30, see [Backend compatibility check](#backend-compatibility-check)). VantagePeers Cloud clients need nothing installed.
539
555
 
540
556
  ## License
541
557
 
@@ -39,7 +39,7 @@
39
39
  * to it -- write the literal.
40
40
  */
41
41
  /** Contract version this MCP build requires from the backend. */
42
- export declare const REQUIRED_CONTRACT_VERSION = 29;
42
+ export declare const REQUIRED_CONTRACT_VERSION = 30;
43
43
  /** Every public Convex function this MCP build calls (`module:function`). */
44
44
  export declare const MCP_CALLED_FUNCTIONS: readonly string[];
45
45
  export type BackendCompatFailure = "no-manifest" | "refused" | "cannot-authenticate" | "version-too-old" | "malformed" | "missing-functions" | "unreachable";
@@ -39,7 +39,7 @@
39
39
  * to it -- write the literal.
40
40
  */
41
41
  /** Contract version this MCP build requires from the backend. */
42
- export const REQUIRED_CONTRACT_VERSION = 29;
42
+ export const REQUIRED_CONTRACT_VERSION = 30;
43
43
  /** Every public Convex function this MCP build calls (`module:function`). */
44
44
  export const MCP_CALLED_FUNCTIONS = [
45
45
  "agentCredentials:resolveAgentCredential",
@@ -78,6 +78,7 @@ export const MCP_CALLED_FUNCTIONS = [
78
78
  "githubOwnerBinding:listUnprovenMappings",
79
79
  "githubRepoMapping:add",
80
80
  "githubRepoMapping:getByRepo",
81
+ "githubRepoMapping:getRoute",
81
82
  "githubRepoMapping:list",
82
83
  "githubRepoMapping:remove",
83
84
  "improvisationDigest:scanWindow",
@@ -70,6 +70,7 @@ export const DOOR_SCOPE = {
70
70
  "businessUnits:remove": { verifiedOrg: "always" },
71
71
  // GitHub repo mappings
72
72
  "githubRepoMapping:list": { verifiedOrg: "always" },
73
+ "githubRepoMapping:getRoute": { verifiedOrg: "always" },
73
74
  "githubRepoMapping:add": { verifiedOrg: "always" },
74
75
  "githubRepoMapping:remove": { verifiedOrg: "always" },
75
76
  // knowledge base: a seat reaches these as the service account, so the org it
@@ -515,6 +515,26 @@ export declare const removeRepoMappingServedOutputSchema: z.ZodObject<{
515
515
  repo: z.ZodString;
516
516
  deleted: z.ZodBoolean;
517
517
  }, z.core.$loose>;
518
+ /** get_repo_route: the typed route state of one repo (routed | unreviewed | absent). */
519
+ export declare const getRepoRouteServedOutputSchema: z.ZodObject<{
520
+ state: z.ZodEnum<{
521
+ routed: "routed";
522
+ unreviewed: "unreviewed";
523
+ absent: "absent";
524
+ }>;
525
+ repo: z.ZodString;
526
+ owner: z.ZodOptional<z.ZodString>;
527
+ reviewer: z.ZodOptional<z.ZodString>;
528
+ fallbackReviewer: z.ZodOptional<z.ZodString>;
529
+ }, z.core.$loose>;
530
+ /** check_repo_routing: the completeness verdict of a repo list against the org's routing table. */
531
+ export declare const checkRepoRoutingServedOutputSchema: z.ZodObject<{
532
+ routed: z.ZodArray<z.ZodString>;
533
+ unreviewed: z.ZodArray<z.ZodString>;
534
+ missing: z.ZodArray<z.ZodString>;
535
+ stale: z.ZodArray<z.ZodString>;
536
+ complete: z.ZodBoolean;
537
+ }, z.core.$loose>;
518
538
  /** validate_fix. */
519
539
  export declare const validateFixServedOutputSchema: z.ZodObject<{
520
540
  patternId: z.ZodString;
@@ -889,6 +889,43 @@ export const removeRepoMappingServedOutputSchema = z.looseObject({
889
889
  .boolean()
890
890
  .describe("True when a mapping was removed; false when none existed for that repo."),
891
891
  });
892
+ /** get_repo_route: the typed route state of one repo (routed | unreviewed | absent). */
893
+ export const getRepoRouteServedOutputSchema = z.looseObject({
894
+ state: z
895
+ .enum(["routed", "unreviewed", "absent"])
896
+ .describe("routed: an owner and a reviewer are named; unreviewed: an owner is named and no reviewer; absent: your organisation has no mapping for this repo."),
897
+ repo: z.string().describe("The repo the call was for, as 'owner/name'."),
898
+ owner: z
899
+ .string()
900
+ .optional()
901
+ .describe("The orchestrator that receives the repo's events; absent when the state is absent."),
902
+ reviewer: z
903
+ .string()
904
+ .optional()
905
+ .describe("Who reviews the repo's pull requests; present only when the state is routed."),
906
+ fallbackReviewer: z
907
+ .string()
908
+ .optional()
909
+ .describe("Who reviews when the reviewer is stopped; present only when one was set."),
910
+ });
911
+ /** check_repo_routing: the completeness verdict of a repo list against the org's routing table. */
912
+ export const checkRepoRoutingServedOutputSchema = z.looseObject({
913
+ routed: z
914
+ .array(z.string())
915
+ .describe("Repos of your list that have an owner and a reviewer."),
916
+ unreviewed: z
917
+ .array(z.string())
918
+ .describe("Repos of your list that have an owner and no reviewer."),
919
+ missing: z
920
+ .array(z.string())
921
+ .describe("Repos of your list that your organisation has no mapping for."),
922
+ stale: z
923
+ .array(z.string())
924
+ .describe("Repos mapped by your organisation that are not in your list."),
925
+ complete: z
926
+ .boolean()
927
+ .describe("True only when missing, unreviewed and stale are all empty."),
928
+ });
892
929
  /** validate_fix. */
893
930
  export const validateFixServedOutputSchema = z.looseObject({
894
931
  patternId: rowId("The fix pattern that was validated."),
@@ -254,12 +254,12 @@ export declare const updateTaskStatusSchema: z.ZodEnum<{
254
254
  cancelled: "cancelled";
255
255
  }>;
256
256
  export declare const missionStatusSchema: z.ZodEnum<{
257
+ complete: "complete";
257
258
  cancelled: "cancelled";
258
259
  brainstorm: "brainstorm";
259
260
  plan: "plan";
260
261
  execute: "execute";
261
262
  validate: "validate";
262
- complete: "complete";
263
263
  }>;
264
264
  export declare const taskStatusFilterSchema: z.ZodPreprocess<z.ZodPipe<z.ZodArray<z.ZodEnum<{
265
265
  [x: string]: string;
@@ -595,11 +595,11 @@ export declare const createMissionOutputSchema: z.ZodObject<{
595
595
  project: z.ZodString;
596
596
  pilot: z.ZodString;
597
597
  status: z.ZodEnum<{
598
+ complete: "complete";
598
599
  brainstorm: "brainstorm";
599
600
  plan: "plan";
600
601
  execute: "execute";
601
602
  validate: "validate";
602
- complete: "complete";
603
603
  }>;
604
604
  }, z.core.$strip>;
605
605
  export declare const listMissionsOutputSchema: z.ZodUnion<readonly [z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>, z.ZodObject<{
@@ -615,11 +615,11 @@ export declare const updateMissionOutputSchema: z.ZodObject<{
615
615
  export declare const updateMissionStatusOutputSchema: z.ZodObject<{
616
616
  missionId: z.ZodString;
617
617
  status: z.ZodEnum<{
618
+ complete: "complete";
618
619
  brainstorm: "brainstorm";
619
620
  plan: "plan";
620
621
  execute: "execute";
621
622
  validate: "validate";
622
- complete: "complete";
623
623
  }>;
624
624
  }, z.core.$strip>;
625
625
  export declare const writeDiaryOutputSchema: z.ZodObject<{
@@ -726,6 +726,8 @@ export declare const listRepoMappingsOutputSchema: z.ZodUnion<readonly [z.ZodArr
726
726
  nextCursor: z.ZodNullable<z.ZodString>;
727
727
  }, z.core.$strip>]>;
728
728
  export declare const removeRepoMappingOutputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
729
+ export declare const getRepoRouteOutputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
730
+ export declare const checkRepoRoutingOutputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
729
731
  export declare const listIssuesOutputSchema: z.ZodObject<{
730
732
  count: z.ZodNumber;
731
733
  issues: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
package/dist/src/tools.js CHANGED
@@ -20,7 +20,7 @@ import { listTasksGate } from "./list-tasks-gate.js";
20
20
  import { listContract } from "./listContract.js";
21
21
  import { refuseUnissuedListCursors } from "./listCursor.js";
22
22
  import { memberAuthorLabel } from "./memberAuthor.js";
23
- import { addFixAttemptServedOutputSchema, addRepoMappingServedOutputSchema, addTaskDependencyServedOutputSchema, billingSummaryByProjectServedOutputSchema, blockTaskServedOutputSchema, briefingNoteUpdatedServedOutputSchema, bulkCompleteTasksServedOutputSchema, checkMessagesServedOutputSchema, checkoutTaskServedOutputSchema, correctTaskSegmentServedOutputSchema, createBriefingNoteServedOutputSchema, createFixPatternServedOutputSchema, createMissionServedOutputSchema, createRecurringTaskServedOutputSchema, createTaskServedOutputSchema, debateGetRoomServedOutputSchema, debatePostTurnServedOutputSchema, deleteMessageServedOutputSchema, deletedServedOutputSchema, eraseMemoryServedOutputSchema, eraseFixPatternServedOutputSchema, eraseRowServedOutputSchema, getBriefingNoteServedOutputSchema, getBulkCompleteRunServedOutputSchema, getDiaryServedOutputSchema, getEpisodeServedOutputSchema, getFixPatternServedOutputSchema, getGithubOwnerBindingsServedOutputSchema, getMemoryServedOutputSchema, getMessageServedOutputSchema, getMissionServedOutputSchema, getMissionTemplateServedOutputSchema, getOwnerToolUsageServedOutputSchema, getProfileServedOutputSchema, getRecurringTaskServedOutputSchema, getTaskServedOutputSchema, getToolUsageServedOutputSchema, hybridSearchServedOutputSchema, improvisationDigestServedOutputSchema, instantiateTemplateIntoMissionServedOutputSchema, linkIssueToPatternServedOutputSchema, listBlockedOnMeServedOutputSchema, nextTaskServedOutputSchema, reorderQueueServedOutputSchema, listBriefingNotesServedOutputSchema, listBroadcastStatusServedOutputSchema, listDiariesServedOutputSchema, listEpisodesServedOutputSchema, listFixPatternsServedOutputSchema, listMemoriesServedOutputSchema, listMessagesServedOutputSchema, listMissionsServedOutputSchema, listPeersServedOutputSchema, listRecurringTasksServedOutputSchema, listRepoMappingsServedOutputSchema, listTasksByMissionServedOutputSchema, listTasksServedOutputSchema, markAsReadServedOutputSchema, missionStatusServedOutputSchema, missionUpdatedServedOutputSchema, pauseRecurringTaskServedOutputSchema, recallServedOutputSchema, removeRepoMappingServedOutputSchema, resumeRecurringTaskServedOutputSchema, searchBriefingNotesByKeywordServedOutputSchema, searchEpisodesByKeywordServedOutputSchema, searchEpisodesBySemanticServedOutputSchema, searchFixPatternsServedOutputSchema, searchMessagesByKeywordServedOutputSchema, searchTasksByKeywordServedOutputSchema, sendMessageServedOutputSchema, setSummaryServedOutputSchema, softDeleteMemoryServedOutputSchema, storeEpisodeServedOutputSchema, storeMemoryServedOutputSchema, taskClosedServedOutputSchema, taskStatusServedOutputSchema, taskUpdatedServedOutputSchema, textSearchServedOutputSchema, updateMissionTemplateServedOutputSchema, updateProfileServedOutputSchema, updateRecurringTaskServedOutputSchema, validateFixServedOutputSchema, writeDiaryServedOutputSchema, } from "./outputSchemas.js";
23
+ import { addFixAttemptServedOutputSchema, addRepoMappingServedOutputSchema, addTaskDependencyServedOutputSchema, billingSummaryByProjectServedOutputSchema, blockTaskServedOutputSchema, briefingNoteUpdatedServedOutputSchema, bulkCompleteTasksServedOutputSchema, checkMessagesServedOutputSchema, checkoutTaskServedOutputSchema, correctTaskSegmentServedOutputSchema, createBriefingNoteServedOutputSchema, createFixPatternServedOutputSchema, createMissionServedOutputSchema, createRecurringTaskServedOutputSchema, createTaskServedOutputSchema, debateGetRoomServedOutputSchema, debatePostTurnServedOutputSchema, deleteMessageServedOutputSchema, deletedServedOutputSchema, eraseMemoryServedOutputSchema, eraseFixPatternServedOutputSchema, eraseRowServedOutputSchema, getBriefingNoteServedOutputSchema, getBulkCompleteRunServedOutputSchema, getDiaryServedOutputSchema, getEpisodeServedOutputSchema, getFixPatternServedOutputSchema, getGithubOwnerBindingsServedOutputSchema, getMemoryServedOutputSchema, getMessageServedOutputSchema, getMissionServedOutputSchema, getMissionTemplateServedOutputSchema, getOwnerToolUsageServedOutputSchema, getProfileServedOutputSchema, getRecurringTaskServedOutputSchema, getTaskServedOutputSchema, getToolUsageServedOutputSchema, hybridSearchServedOutputSchema, improvisationDigestServedOutputSchema, instantiateTemplateIntoMissionServedOutputSchema, linkIssueToPatternServedOutputSchema, listBlockedOnMeServedOutputSchema, nextTaskServedOutputSchema, reorderQueueServedOutputSchema, listBriefingNotesServedOutputSchema, listBroadcastStatusServedOutputSchema, listDiariesServedOutputSchema, listEpisodesServedOutputSchema, listFixPatternsServedOutputSchema, listMemoriesServedOutputSchema, listMessagesServedOutputSchema, listMissionsServedOutputSchema, listPeersServedOutputSchema, listRecurringTasksServedOutputSchema, listRepoMappingsServedOutputSchema, listTasksByMissionServedOutputSchema, listTasksServedOutputSchema, markAsReadServedOutputSchema, missionStatusServedOutputSchema, missionUpdatedServedOutputSchema, pauseRecurringTaskServedOutputSchema, recallServedOutputSchema, removeRepoMappingServedOutputSchema, getRepoRouteServedOutputSchema, checkRepoRoutingServedOutputSchema, resumeRecurringTaskServedOutputSchema, searchBriefingNotesByKeywordServedOutputSchema, searchEpisodesByKeywordServedOutputSchema, searchEpisodesBySemanticServedOutputSchema, searchFixPatternsServedOutputSchema, searchMessagesByKeywordServedOutputSchema, searchTasksByKeywordServedOutputSchema, sendMessageServedOutputSchema, setSummaryServedOutputSchema, softDeleteMemoryServedOutputSchema, storeEpisodeServedOutputSchema, storeMemoryServedOutputSchema, taskClosedServedOutputSchema, taskStatusServedOutputSchema, taskUpdatedServedOutputSchema, textSearchServedOutputSchema, updateMissionTemplateServedOutputSchema, updateProfileServedOutputSchema, updateRecurringTaskServedOutputSchema, validateFixServedOutputSchema, writeDiaryServedOutputSchema, } from "./outputSchemas.js";
24
24
  import { normalizeOrchestratorId } from "./normalizeOrchestratorId.js";
25
25
  import { clampLimit, decodeCursor, encodeCursor, invalidCursorResult, scopedPageContinuation, } from "./paging.js";
26
26
  import { isRefusedEnvelope } from "./refusal.js";
@@ -1623,6 +1623,10 @@ export const listRepoMappingsOutputSchema = z.union([
1623
1623
  ]);
1624
1624
  // remove_repo_mapping
1625
1625
  export const removeRepoMappingOutputSchema = z.record(z.string(), z.unknown());
1626
+ // get_repo_route
1627
+ export const getRepoRouteOutputSchema = z.record(z.string(), z.unknown());
1628
+ // check_repo_routing
1629
+ export const checkRepoRoutingOutputSchema = z.record(z.string(), z.unknown());
1626
1630
  // list_issues
1627
1631
  export const listIssuesOutputSchema = z.object({
1628
1632
  count: z.number(),
@@ -5567,7 +5571,7 @@ options) {
5567
5571
  });
5568
5572
  // ── reorder_queue ───────────────────────────────────────────────────────────
5569
5573
  defineTool(server, authCtx, {
5570
- kind: "filtered",
5574
+ kind: "public",
5571
5575
  reason: "unresolvedOrgDenial() refuses a bearer whose organisation cannot be resolved before any call; the caller gate itself is decided by its Convex door tasks:reorderQueue on the verified principal (a seat's verifiedActor, forwarded by the wrapped client): over MCP the callers that succeed are the assignee agent itself and a listed queue coordinator, in the assignee's own organisation; a person bearer carries no verifiedActor over MCP (withVerifiedActor returns the client unchanged when no agent ID resolves), so the door resolves the service-account session and refuses it, and an organisation admin acts from a signed-in session, not through this tool; the tool takes no acting name and relays the door's refusal unchanged (tasks k176p84j83gac7reyycweacyb58jvtxg, k17c5xftwzvtts05ban1dhxazs8jv4h6)",
5572
5576
  }, "reorder_queue", "Set the explicit work queue of one agent: the listed tasks get ranks 1..N in the order given (1 = next), and every other open task of that agent loses its rank. " +
5573
5577
  "A FULL REPLACEMENT: an empty taskIds clears the whole queue. The order is set without dependencies: a task listed before the task it depends on is still not handed out by next_task until its dependencies are done. " +
@@ -5629,8 +5633,8 @@ options) {
5629
5633
  });
5630
5634
  // ── next_task ───────────────────────────────────────────────────────────────
5631
5635
  defineTool(server, authCtx, {
5632
- kind: "filtered",
5633
- reason: "tenant applied INSIDE the Convex read: doorScopeArgs() forwards verifiedOrg on every call to tasks:nextForAssignee for a bearer that resolves an organisation, and unresolvedOrgDenial() refuses a non-master bearer with none; the fleet master, which resolves no organisation, is admitted by its verified agent ID instead: withVerifiedActor forwards verifiedActor (MASTER_ACTOR_CLAIM_DOORS) only for a master scope and only when no verifiedOrg rides the call, so the door judges it as an operator-organisation agent, and a master with no agent ID forwards no claim and is refused by the door (claimless-service-account); a client-organisation seat is never sent an actor; the door resolves the assignee in the claimed organisation only and serves the caller's visible tasks (tasks k176p84j83gac7reyycweacyb58jvtxg, k178q6x954qeh4mxh0b4x6sss98jtarn)",
5636
+ kind: "public",
5637
+ reason: "decided by its Convex door tasks:nextForAssignee, which refuses an unresolved caller (requireResolvedCaller) and applies the tenant INSIDE the read: doorScopeArgs() forwards verifiedOrg on every call to tasks:nextForAssignee for a bearer that resolves an organisation, and unresolvedOrgDenial() refuses a non-master bearer with none; the fleet master, which resolves no organisation, is admitted by its verified agent ID instead: withVerifiedActor forwards verifiedActor (MASTER_ACTOR_CLAIM_DOORS) only for a master scope and only when no verifiedOrg rides the call, so the door judges it as an operator-organisation agent, and a master with no agent ID forwards no claim and is refused by the door (claimless-service-account); a client-organisation seat is never sent an actor; the door resolves the assignee in the claimed organisation only and serves the caller's visible tasks (tasks k176p84j83gac7reyycweacyb58jvtxg, k178q6x954qeh4mxh0b4x6sss98jtarn)",
5634
5638
  }, "next_task", "Get the one task an agent should take next: among its todo tasks you may see, the first in queue order (ranked tasks by rank, then unranked by priority and age) whose dependencies are all done. " +
5635
5639
  "Name the agent by assignedToAgentId (its agentId, as list_peers returns it) or by assignedTo (its name); one of the two is required. " +
5636
5640
  "Returns { found, task?{ _id, _creationTime, title, description?, status, priority, assignedTo, missionId?, queueRank? }, message? }: found is true with the task, or false with a message saying no task is pickable (an empty answer is stated, never silent). " +
@@ -8178,6 +8182,131 @@ options) {
8178
8182
  return mcpConvexError(error);
8179
8183
  }
8180
8184
  });
8185
+ // ── get_repo_route ──────────────────────────────────────────────────────────
8186
+ defineTool(server, authCtx, {
8187
+ kind: "public",
8188
+ reason: "decided by its Convex door githubRepoMapping:getRoute, which refuses an unresolved caller (requireResolvedCaller, alsoRefusePreOrg) and reads inside the caller's verified org: doorScopeArgs() forwards verifiedOrg, unresolvedOrgDenial() refuses a non-master bearer with none, another org's row answers absent",
8189
+ }, "get_repo_route", "Get the review route of one GitHub repo in your organisation: routed, unreviewed or absent. " +
8190
+ "Returns { state, repo, owner?, reviewer?, fallbackReviewer? }; absent is a typed state, never an empty reply. " +
8191
+ "WHEN: use to know who owns and who reviews a repo before opening a pull request, or why none is routed. " +
8192
+ "EXAMPLE: get_repo_route repo='vantageos-agency/vantage-peers'. " +
8193
+ "FR: Lire la route de revue d'un dépôt GitHub de votre organisation : routé, sans relecteur ou absent.", {
8194
+ repo: z
8195
+ .string()
8196
+ .min(1)
8197
+ .describe("The GitHub repository, as owner/name, e.g. 'vantageos-agency/vantage-peers'."),
8198
+ }, {
8199
+ outputSchema: getRepoRouteServedOutputSchema,
8200
+ readOnlyHint: true,
8201
+ idempotentHint: true,
8202
+ openWorldHint: false,
8203
+ destructiveHint: false,
8204
+ title: "Get repo route",
8205
+ }, async ({ repo }) => {
8206
+ try {
8207
+ const orgDenied = unresolvedOrgDenial("get_repo_route");
8208
+ if (orgDenied)
8209
+ return orgDenied;
8210
+ const route = (await convex.query("githubRepoMapping:getRoute", {
8211
+ repo,
8212
+ ...doorScopeArgs("githubRepoMapping:getRoute", undefined),
8213
+ }));
8214
+ if (route === null || typeof route !== "object" || typeof route.state !== "string") {
8215
+ return mcpError(`githubRepoMapping:getRoute returned no route state for ${repo}; refusing to report an empty success`);
8216
+ }
8217
+ const structured = { ...route, repo };
8218
+ return {
8219
+ content: [{ type: "text", text: JSON.stringify(structured, null, 2) }],
8220
+ structuredContent: structured,
8221
+ };
8222
+ }
8223
+ catch (error) {
8224
+ return mcpConvexError(error);
8225
+ }
8226
+ });
8227
+ // ── check_repo_routing ──────────────────────────────────────────────────────
8228
+ defineTool(server, authCtx, {
8229
+ kind: "public",
8230
+ reason: "decided by its Convex doors githubRepoMapping:getRoute and githubRepoMapping:list, which both refuse an unresolved caller (requireResolvedCaller) and read inside the caller's verified org: doorScopeArgs() forwards verifiedOrg on every call, unresolvedOrgDenial() refuses a non-master bearer with none",
8231
+ }, "check_repo_routing", "Check that a list of repos is fully routed in your organisation, against the org's whole routing table. " +
8232
+ "Returns { routed, unreviewed, missing, stale, complete }, each of the four a list of repos; stale are mapped repos not in your list, complete is true only when missing, unreviewed and stale are all empty. " +
8233
+ "WHEN: use after listing your real GitHub repos, to find repos with no owner, no reviewer, or a mapping for a repo that is gone. " +
8234
+ "EXAMPLE: check_repo_routing repos=['vantageos-agency/vantage-peers','vantageos-agency/vantage-registry']. " +
8235
+ "FR: Vérifier qu'une liste de dépôts est entièrement routée dans votre organisation.", {
8236
+ repos: z
8237
+ .array(z.string().min(1))
8238
+ .min(1)
8239
+ .max(500)
8240
+ .describe("The organisation's real repository list, each as owner/name. Duplicates are counted once."),
8241
+ }, {
8242
+ outputSchema: checkRepoRoutingServedOutputSchema,
8243
+ readOnlyHint: true,
8244
+ idempotentHint: true,
8245
+ openWorldHint: false,
8246
+ destructiveHint: false,
8247
+ title: "Check repo routing",
8248
+ }, async ({ repos }) => {
8249
+ try {
8250
+ const orgDenied = unresolvedOrgDenial("check_repo_routing");
8251
+ if (orgDenied)
8252
+ return orgDenied;
8253
+ const wanted = [...new Set(repos)];
8254
+ const routed = [];
8255
+ const unreviewed = [];
8256
+ const missing = [];
8257
+ const BATCH = 20;
8258
+ for (let i = 0; i < wanted.length; i += BATCH) {
8259
+ const batch = wanted.slice(i, i + BATCH);
8260
+ const answers = await Promise.all(batch.map((repo) => convex.query("githubRepoMapping:getRoute", {
8261
+ repo,
8262
+ ...doorScopeArgs("githubRepoMapping:getRoute", undefined),
8263
+ })));
8264
+ for (let j = 0; j < batch.length; j++) {
8265
+ const state = answers[j]?.state;
8266
+ if (state === "routed")
8267
+ routed.push(batch[j]);
8268
+ else if (state === "unreviewed")
8269
+ unreviewed.push(batch[j]);
8270
+ else if (state === "absent")
8271
+ missing.push(batch[j]);
8272
+ else {
8273
+ return mcpError(`githubRepoMapping:getRoute returned no route state for ${batch[j]}; refusing to report an incomplete check`);
8274
+ }
8275
+ }
8276
+ }
8277
+ // Every page of the org's table, until the door's cursor is exhausted.
8278
+ const known = new Set(wanted);
8279
+ const stale = [];
8280
+ let cursor;
8281
+ do {
8282
+ const page = (await convex.query("githubRepoMapping:list", {
8283
+ limit: 200,
8284
+ fields: "lite",
8285
+ cursor,
8286
+ ...doorScopeArgs("githubRepoMapping:list", undefined),
8287
+ }));
8288
+ const items = requireItems(page, "check_repo_routing", "githubRepoMapping:list");
8289
+ for (const row of items)
8290
+ if (!known.has(row.repo))
8291
+ stale.push(row.repo);
8292
+ cursor = typeof page.nextCursor === "string" ? page.nextCursor : undefined;
8293
+ } while (cursor !== undefined);
8294
+ const structured = {
8295
+ routed,
8296
+ unreviewed,
8297
+ missing,
8298
+ stale,
8299
+ complete: missing.length === 0 && unreviewed.length === 0 && stale.length === 0,
8300
+ };
8301
+ return {
8302
+ content: [{ type: "text", text: JSON.stringify(structured, null, 2) }],
8303
+ structuredContent: structured,
8304
+ };
8305
+ }
8306
+ catch (error) {
8307
+ return mcpConvexError(error);
8308
+ }
8309
+ });
8181
8310
  // ── get_github_owner_bindings ──────────────────────────────────────────────
8182
8311
  // oracle-disposition: CONSERVER — githubOwnerBindings is the proof an owner belongs to an org, the only basis on which a repo routes to it
8183
8312
  // oracle-justified: githubOwnerBindings rows carry the owning `orgId`. The tenant is resolved at the Convex
@@ -24,7 +24,8 @@ export declare const MASTER_UNNARROWED_DOORS: ReadonlySet<string>;
24
24
  * (RBAC_DENIED claimless-service-account). It is forwarded for a master scope only,
25
25
  * and only when no `verifiedOrg` rides the call, so a client-organisation seat (served
26
26
  * by verifiedOrg) is never sent an actor the door would refuse, and the two claims
27
- * never travel together. Every door here is pinned in test/next-task-claim.test.ts.
27
+ * never travel together. Every door here is pinned in test/next-task-claim.test.ts or
28
+ * test/tool-usage-claim.test.ts.
28
29
  */
29
30
  export declare const MASTER_ACTOR_CLAIM_DOORS: ReadonlySet<string>;
30
31
  export type VerifiedActorArg = {
@@ -133,10 +133,15 @@ export const MASTER_UNNARROWED_DOORS = new Set([
133
133
  * (RBAC_DENIED claimless-service-account). It is forwarded for a master scope only,
134
134
  * and only when no `verifiedOrg` rides the call, so a client-organisation seat (served
135
135
  * by verifiedOrg) is never sent an actor the door would refuse, and the two claims
136
- * never travel together. Every door here is pinned in test/next-task-claim.test.ts.
136
+ * never travel together. Every door here is pinned in test/next-task-claim.test.ts or
137
+ * test/tool-usage-claim.test.ts.
137
138
  */
138
139
  export const MASTER_ACTOR_CLAIM_DOORS = new Set([
139
140
  "tasks:nextForAssignee",
141
+ // Contract 30 (PR #1764): both tool-usage reads admit an operator-org verifiedActor.
142
+ // Pinned in test/tool-usage-claim.test.ts.
143
+ "toolUsage:getToolUsage",
144
+ "toolUsage:usageByOwner",
140
145
  ]);
141
146
  /**
142
147
  * The acting agent's ID and org for this request, or undefined.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vantage-peers-mcp",
3
- "version": "5.0.2",
3
+ "version": "5.1.0",
4
4
  "description": "MCP server for multi-agent teams: persistent memory, agent messaging, time-tracked tasks, missions",
5
5
  "type": "module",
6
6
  "main": "./dist/server.js",
@@ -7,6 +7,7 @@
7
7
  "block_task",
8
8
  "bulk_complete_tasks",
9
9
  "check_messages",
10
+ "check_repo_routing",
10
11
  "checkout_task",
11
12
  "claim_upload",
12
13
  "complete_task",
@@ -40,6 +41,7 @@
40
41
  "get_owner_tool_usage",
41
42
  "get_profile",
42
43
  "get_recurring_task",
44
+ "get_repo_route",
43
45
  "get_task",
44
46
  "get_tool_usage",
45
47
  "hybrid_search",