@pome-sh/cli 0.21.10 → 0.21.11

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.
@@ -1,12 +1,109 @@
1
1
  import './chunk-FKZZWWYC.js';
2
2
  import { defaultSeedState, parseSeed } from './chunk-SGDUD7KK.js';
3
3
  export { defaultSeedState, parseSeed, seedSchema } from './chunk-SGDUD7KK.js';
4
- import { defineTwin, twinBuildInfo, UnknownToolError, openTwinDatabase, createApp } from './chunk-35TG2GHS.js';
4
+ import { loadMcpToolFixture, defineTwin, twinBuildInfo, deriveMcpToolTable, UnknownToolError, openTwinDatabase, createApp } from './chunk-TV5S6WQV.js';
5
5
  import './chunk-VBATFCWR.js';
6
6
  import './chunk-SG6ZTIMT.js';
7
7
  import { z, ZodError } from 'zod';
8
8
  import { createHash, randomUUID } from 'node:crypto';
9
9
 
10
+ // ../packages/twin-github/dist/fixtures/mcp-tools-list.meta.json
11
+ var mcp_tools_list_meta_default = {
12
+ twin: "github",
13
+ substrate: "twin-code-transcription",
14
+ endpoint: "in-process://twin-github/s/:sid/mcp",
15
+ method: "tools/list",
16
+ protocol: "JSON-RPC 2.0 over Streamable HTTP",
17
+ protocolVersion: "2025-06-18",
18
+ captureDate: "2026-08-06",
19
+ rawFileSha256: "33b1264298ed3be13f75f8aa76ef88b44e97777f8c546e53d7ba20675457b2c1",
20
+ liveToolCount: 65,
21
+ liveToolOrder: [
22
+ "search_repositories",
23
+ "create_repository",
24
+ "fork_repository",
25
+ "get_repository",
26
+ "search_code",
27
+ "search_users",
28
+ "get_file_contents",
29
+ "list_commits",
30
+ "create_or_update_file",
31
+ "create_branch",
32
+ "push_files",
33
+ "get_issue",
34
+ "update_issue",
35
+ "search_issues",
36
+ "list_issues",
37
+ "add_issue_comment",
38
+ "list_issue_comments",
39
+ "create_issue",
40
+ "list_repository_labels",
41
+ "create_label",
42
+ "list_issue_labels",
43
+ "add_issue_labels",
44
+ "remove_issue_label",
45
+ "list_collaborators",
46
+ "add_assignees",
47
+ "get_pull_request",
48
+ "get_pull_request_reviews",
49
+ "create_pull_request_review",
50
+ "get_pull_request_comments",
51
+ "get_pull_request_files",
52
+ "get_pull_request_status",
53
+ "list_pull_requests",
54
+ "merge_pull_request",
55
+ "update_pull_request_branch",
56
+ "create_pull_request",
57
+ "list_branches",
58
+ "get_branch",
59
+ "delete_branch",
60
+ "delete_file",
61
+ "get_commit",
62
+ "compare_commits",
63
+ "get_pull_request_diff",
64
+ "update_pull_request",
65
+ "get_pull_request_commits",
66
+ "create_pull_request_review_comment",
67
+ "add_reply_to_pull_request_comment",
68
+ "update_issue_comment",
69
+ "delete_issue_comment",
70
+ "list_milestones",
71
+ "create_milestone",
72
+ "update_milestone",
73
+ "delete_milestone",
74
+ "create_commit_status",
75
+ "get_combined_status_for_ref",
76
+ "create_check_run",
77
+ "list_check_runs_for_ref",
78
+ "list_tags",
79
+ "list_releases",
80
+ "get_latest_release",
81
+ "create_release",
82
+ "get_me",
83
+ "add_collaborator",
84
+ "search_commits",
85
+ "get_release_by_tag",
86
+ "get_tag"
87
+ ],
88
+ transcription: {
89
+ readFrom: "twin-github's own tools/list, booted on defaultSeedState() and driven through Hono's app.request, read immediately before this table became fixture-driven (F-1325)",
90
+ contentOrigin: "packages/twin-github/src/tools.ts \u2014 a hand-written TypeScript array of 65 tools. Each inputSchema is z.toJSONSchema() of that tool's zod schema, frozen here verbatim including the $schema key it emits.",
91
+ comparedToUpstream: "never. F-1326's upstream golden (fixtures/mcp-tools-list/github.canonical.json) records 44 tools for the `default` toolset that examples/support-triage actually points at, against the 65 declared here. That gap is real; reporting it is F-1327's job and this fixture deliberately does not close it."
92
+ },
93
+ notes: [
94
+ "65 tools, deliberately. This is a transcription of what the twin already served, not a reduction to the upstream 44.",
95
+ "Seeded from the code table rather than from upstream on purpose. F-1325 is name-neutral by construction: every byte this twin serves is identical before and after it."
96
+ ],
97
+ canonicalFileSha256: "cb0b4f41d76d13f810aaa3251edfe198f07df1ce4f68c7c9570db3eba8dc992b",
98
+ files: {
99
+ raw: "mcp-tools-list.raw.json",
100
+ canonical: "mcp-tools-list.canonical.json"
101
+ }
102
+ };
103
+
104
+ // ../packages/twin-github/dist/fixtures/mcp-tools-list.raw.json
105
+ var mcp_tools_list_raw_default = { jsonrpc: "2.0", id: 1, result: { tools: [{ name: "search_repositories", description: "Search local repositories by name or description.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { query: { type: "string" }, q: { type: "string" }, page: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, per_page: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, perPage: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 } }, additionalProperties: false } }, { name: "create_repository", description: "Create a repository with an initial README and main branch.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { name: { type: "string", minLength: 1 }, owner: { type: "string", minLength: 1 }, description: { type: "string" }, private: { type: "boolean" } }, required: ["name"], additionalProperties: false } }, { name: "fork_repository", description: "Fork a repository into the current user or an organization.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 }, organization: { type: "string", minLength: 1 } }, required: ["owner", "repo"], additionalProperties: false } }, { name: "get_repository", description: "Get one repository.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 } }, required: ["owner", "repo"], additionalProperties: false } }, { name: "search_code", description: "Search files in the local GitHub twin.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { query: { type: "string" }, q: { type: "string" }, owner: { type: "string" }, repo: { type: "string" }, page: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, per_page: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, perPage: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 } }, additionalProperties: false } }, { name: "search_users", description: "Search seeded users and organizations.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { query: { type: "string" }, q: { type: "string" }, page: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, per_page: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, perPage: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 } }, additionalProperties: false } }, { name: "get_file_contents", description: "Read a file or directory from a repository branch.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 }, path: { type: "string" }, ref: { type: "string" } }, required: ["owner", "repo"], additionalProperties: false } }, { name: "list_commits", description: "List commits for a repository.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 }, sha: { type: "string" }, page: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, per_page: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, perPage: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 } }, required: ["owner", "repo"], additionalProperties: false } }, { name: "create_or_update_file", description: "Create or update one file and advance the branch head atomically.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 }, path: { type: "string", minLength: 1 }, message: { type: "string", minLength: 1 }, content: { type: "string" }, branch: { type: "string" }, sha: { type: "string" }, encoding: { type: "string", enum: ["utf-8", "base64"] } }, required: ["owner", "repo", "path", "message", "content"], additionalProperties: false } }, { name: "create_branch", description: "Create a branch from an existing branch or SHA.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 }, branch: { type: "string", minLength: 1 }, from_branch: { type: "string" }, sha: { type: "string" } }, required: ["owner", "repo", "branch"], additionalProperties: false } }, { name: "push_files", description: "Push multiple files in a single commit.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 }, branch: { type: "string" }, message: { type: "string", minLength: 1 }, files: { minItems: 1, type: "array", items: { type: "object", properties: { path: { type: "string", minLength: 1 }, content: { type: "string" }, encoding: { type: "string", enum: ["utf-8", "base64"] } }, required: ["path", "content"], additionalProperties: false } } }, required: ["owner", "repo", "message", "files"], additionalProperties: false } }, { name: "get_issue", description: "Get one issue.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 }, issue_number: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, issueNumber: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 } }, required: ["owner", "repo"], additionalProperties: false } }, { name: "update_issue", description: "Update an issue title, body, state, labels, or assignees.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 }, issue_number: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, issueNumber: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, title: { type: "string" }, body: { type: "string" }, state: { type: "string", enum: ["open", "closed"] }, labels: { type: "array", items: { type: "string" } }, assignees: { type: "array", items: { type: "string" } } }, required: ["owner", "repo"], additionalProperties: false } }, { name: "search_issues", description: "Search all local issues.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { query: { type: "string" }, q: { type: "string" }, state: { type: "string", enum: ["open", "closed", "all"] }, page: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, per_page: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, perPage: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 } }, additionalProperties: false } }, { name: "list_issues", description: "List repository issues with common filters.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 }, state: { type: "string", enum: ["open", "closed", "all"] }, labels: { type: "string" }, assignee: { type: "string" }, page: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, per_page: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, perPage: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 } }, required: ["owner", "repo"], additionalProperties: false } }, { name: "add_issue_comment", description: "Add an issue comment.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 }, issue_number: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, issueNumber: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, body: { type: "string", minLength: 1 } }, required: ["owner", "repo", "body"], additionalProperties: false } }, { name: "list_issue_comments", description: "List comments on an issue.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 }, issue_number: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, issueNumber: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, page: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, per_page: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, perPage: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 } }, required: ["owner", "repo"], additionalProperties: false } }, { name: "create_issue", description: "Create an issue.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 }, title: { type: "string", minLength: 1 }, body: { type: "string" }, labels: { type: "array", items: { type: "string" } }, assignees: { type: "array", items: { type: "string" } } }, required: ["owner", "repo", "title"], additionalProperties: false } }, { name: "list_repository_labels", description: "List labels defined on a repository.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 } }, required: ["owner", "repo"], additionalProperties: false } }, { name: "create_label", description: "Create a repository label.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 }, name: { type: "string", minLength: 1 }, color: { default: "ededed", type: "string" }, description: { default: "", type: "string" } }, required: ["owner", "repo", "name", "color", "description"], additionalProperties: false } }, { name: "list_issue_labels", description: "List labels applied to an issue.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 }, issue_number: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, issueNumber: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 } }, required: ["owner", "repo"], additionalProperties: false } }, { name: "add_issue_labels", description: "Apply one or more labels to an issue.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 }, issue_number: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, issueNumber: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, labels: { minItems: 1, type: "array", items: { type: "string", minLength: 1 } } }, required: ["owner", "repo", "labels"], additionalProperties: false } }, { name: "remove_issue_label", description: "Remove one label from an issue.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 }, issue_number: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, issueNumber: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, label: { type: "string", minLength: 1 } }, required: ["owner", "repo", "label"], additionalProperties: false } }, { name: "list_collaborators", description: "List repository collaborators.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 } }, required: ["owner", "repo"], additionalProperties: false } }, { name: "add_assignees", description: "Add assignees to an issue.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 }, issue_number: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, issueNumber: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, assignees: { minItems: 1, type: "array", items: { type: "string", minLength: 1 } } }, required: ["owner", "repo", "assignees"], additionalProperties: false } }, { name: "get_pull_request", description: "Get one pull request.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 }, pull_number: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, pullNumber: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 } }, required: ["owner", "repo"], additionalProperties: false } }, { name: "get_pull_request_reviews", description: "List pull request reviews.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 }, pull_number: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, pullNumber: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, page: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, per_page: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, perPage: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 } }, required: ["owner", "repo"], additionalProperties: false } }, { name: "create_pull_request_review", description: "Create a pull request review.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 }, pull_number: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, pullNumber: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, event: { type: "string", enum: ["APPROVE", "REQUEST_CHANGES", "COMMENT"] }, body: { type: "string" } }, required: ["owner", "repo", "event"], additionalProperties: false } }, { name: "get_pull_request_comments", description: "List review comments on a pull request.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 }, pull_number: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, pullNumber: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, page: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, per_page: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, perPage: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 } }, required: ["owner", "repo"], additionalProperties: false } }, { name: "get_pull_request_files", description: "List files changed by a pull request.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 }, pull_number: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, pullNumber: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, page: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, per_page: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, perPage: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 } }, required: ["owner", "repo"], additionalProperties: false } }, { name: "get_pull_request_status", description: "Get combined status for a pull request head commit.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 }, pull_number: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, pullNumber: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 } }, required: ["owner", "repo"], additionalProperties: false } }, { name: "list_pull_requests", description: "List repository pull requests.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 }, state: { type: "string", enum: ["open", "closed", "all"] }, page: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, per_page: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, perPage: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 } }, required: ["owner", "repo"], additionalProperties: false } }, { name: "merge_pull_request", description: "Merge a pull request using simplified local merge semantics.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 }, pull_number: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, pullNumber: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, commit_title: { type: "string" }, commit_message: { type: "string" } }, required: ["owner", "repo"], additionalProperties: false } }, { name: "update_pull_request_branch", description: "Update a PR branch from its base branch.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 }, pull_number: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, pullNumber: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, expected_head_sha: { type: "string" } }, required: ["owner", "repo"], additionalProperties: false } }, { name: "create_pull_request", description: "Create a pull request from a head branch to a base branch.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 }, title: { type: "string", minLength: 1 }, body: { type: "string" }, head: { type: "string", minLength: 1 }, base: { type: "string" } }, required: ["owner", "repo", "title", "head"], additionalProperties: false } }, { name: "list_branches", description: "List branches for a repository.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 }, page: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, per_page: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, perPage: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 } }, required: ["owner", "repo"], additionalProperties: false } }, { name: "get_branch", description: "Get one branch by name.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 }, branch: { type: "string", minLength: 1 } }, required: ["owner", "repo", "branch"], additionalProperties: false } }, { name: "delete_branch", description: "Delete a branch (cannot delete the default branch or a branch backing an open PR).", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 }, branch: { type: "string", minLength: 1 } }, required: ["owner", "repo", "branch"], additionalProperties: false } }, { name: "delete_file", description: "Delete one file and advance the branch head atomically.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 }, path: { type: "string", minLength: 1 }, message: { type: "string", minLength: 1 }, sha: { type: "string", minLength: 1 }, branch: { type: "string" } }, required: ["owner", "repo", "path", "message", "sha"], additionalProperties: false } }, { name: "get_commit", description: "Get one commit with its file changes and stats.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 }, ref: { type: "string", minLength: 1 } }, required: ["owner", "repo", "ref"], additionalProperties: false } }, { name: "compare_commits", description: "Compare two commits, branches, or tags. Returns ahead/behind/identical/diverged.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 }, base: { type: "string", minLength: 1 }, head: { type: "string", minLength: 1 } }, required: ["owner", "repo", "base", "head"], additionalProperties: false } }, { name: "get_pull_request_diff", description: "Get a unified-diff-style text representation of a pull request.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 }, pull_number: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, pullNumber: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 } }, required: ["owner", "repo"], additionalProperties: false } }, { name: "update_pull_request", description: "Update a pull request title, body, state, or base branch.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 }, pull_number: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, pullNumber: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, title: { type: "string" }, body: { type: "string" }, state: { type: "string", enum: ["open", "closed"] }, base: { type: "string" } }, required: ["owner", "repo"], additionalProperties: false } }, { name: "get_pull_request_commits", description: "List commits on a pull request, oldest first.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 }, pull_number: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, pullNumber: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, page: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, per_page: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, perPage: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 } }, required: ["owner", "repo"], additionalProperties: false } }, { name: "create_pull_request_review_comment", description: "Create an inline review comment on a pull request at a file path and line.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 }, pull_number: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, pullNumber: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, body: { type: "string", minLength: 1 }, path: { type: "string", minLength: 1 }, line: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, side: { type: "string", enum: ["LEFT", "RIGHT"] }, commit_id: { type: "string" }, commitId: { type: "string" } }, required: ["owner", "repo", "body", "path", "line"], additionalProperties: false } }, { name: "add_reply_to_pull_request_comment", description: "Reply to an existing pull request review comment.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 }, pull_number: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, pullNumber: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, comment_id: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, commentId: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, body: { type: "string", minLength: 1 } }, required: ["owner", "repo", "body"], additionalProperties: false } }, { name: "update_issue_comment", description: "Update the body of an existing issue comment.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 }, comment_id: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, commentId: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, body: { type: "string", minLength: 1 } }, required: ["owner", "repo", "body"], additionalProperties: false } }, { name: "delete_issue_comment", description: "Delete an issue comment by ID.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 }, comment_id: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, commentId: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 } }, required: ["owner", "repo"], additionalProperties: false } }, { name: "list_milestones", description: "List milestones for a repository.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 }, state: { type: "string", enum: ["open", "closed", "all"] }, page: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, per_page: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, perPage: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 } }, required: ["owner", "repo"], additionalProperties: false } }, { name: "create_milestone", description: "Create a milestone.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 }, title: { type: "string", minLength: 1 }, description: { type: "string" }, due_on: { type: "string" }, dueOn: { type: "string" }, state: { type: "string", enum: ["open", "closed"] } }, required: ["owner", "repo", "title"], additionalProperties: false } }, { name: "update_milestone", description: "Update a milestone.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 }, milestone_number: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, milestoneNumber: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, title: { type: "string" }, description: { type: "string" }, due_on: { type: "string" }, dueOn: { type: "string" }, state: { type: "string", enum: ["open", "closed"] } }, required: ["owner", "repo"], additionalProperties: false } }, { name: "delete_milestone", description: "Delete a milestone.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 }, milestone_number: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, milestoneNumber: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 } }, required: ["owner", "repo"], additionalProperties: false } }, { name: "create_commit_status", description: "Create a commit status (pending/success/failure/error) on a commit SHA.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 }, sha: { type: "string", minLength: 1 }, state: { type: "string", enum: ["error", "failure", "pending", "success"] }, context: { type: "string" }, description: { type: "string" }, target_url: { type: "string" }, targetUrl: { type: "string" } }, required: ["owner", "repo", "sha", "state"], additionalProperties: false } }, { name: "get_combined_status_for_ref", description: "Get the combined status for a ref (SHA, branch, or tag).", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 }, ref: { type: "string", minLength: 1 } }, required: ["owner", "repo", "ref"], additionalProperties: false } }, { name: "create_check_run", description: "Create a check run on a commit SHA.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 }, name: { type: "string", minLength: 1 }, head_sha: { type: "string", minLength: 1 }, headSha: { type: "string", minLength: 1 }, status: { type: "string", enum: ["queued", "in_progress", "completed"] }, conclusion: { type: "string", enum: ["success", "failure", "neutral", "cancelled", "timed_out", "action_required", "skipped", "stale"] }, details_url: { type: "string" }, detailsUrl: { type: "string" }, external_id: { type: "string" }, externalId: { type: "string" }, output: { type: "object", properties: { title: { type: "string" }, summary: { type: "string" } }, additionalProperties: false }, started_at: { type: "string" }, startedAt: { type: "string" }, completed_at: { type: "string" }, completedAt: { type: "string" } }, required: ["owner", "repo", "name"], additionalProperties: false } }, { name: "list_check_runs_for_ref", description: "List check runs for a ref (SHA, branch, or tag).", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 }, ref: { type: "string", minLength: 1 }, page: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, per_page: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, perPage: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 } }, required: ["owner", "repo", "ref"], additionalProperties: false } }, { name: "list_tags", description: "List tags for a repository, most recent first.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 }, page: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, per_page: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, perPage: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 } }, required: ["owner", "repo"], additionalProperties: false } }, { name: "list_releases", description: "List releases for a repository, most recent first.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 }, page: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, per_page: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, perPage: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 } }, required: ["owner", "repo"], additionalProperties: false } }, { name: "get_latest_release", description: "Get the latest published (non-draft, non-prerelease) release.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 } }, required: ["owner", "repo"], additionalProperties: false } }, { name: "create_release", description: "Create a release. Auto-creates the tag if it doesn't exist.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 }, tag_name: { type: "string", minLength: 1 }, tagName: { type: "string", minLength: 1 }, target_commitish: { type: "string" }, targetCommitish: { type: "string" }, name: { type: "string" }, body: { type: "string" }, draft: { type: "boolean" }, prerelease: { type: "boolean" } }, required: ["owner", "repo"], additionalProperties: false } }, { name: "get_me", description: "Get the authenticated user.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: {}, additionalProperties: false } }, { name: "add_collaborator", description: "Add a collaborator to a repository. Returns 201 + invitation envelope for new users, 204 when already a collaborator.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 }, username: { type: "string", minLength: 1 }, permission: { type: "string", enum: ["pull", "push", "admin", "maintain", "triage"] } }, required: ["owner", "repo", "username"], additionalProperties: false } }, { name: "search_commits", description: "Search commits on repository default branches by message or author.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { query: { type: "string" }, q: { type: "string" }, owner: { type: "string" }, repo: { type: "string" }, page: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, per_page: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, perPage: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 } }, additionalProperties: false } }, { name: "get_release_by_tag", description: "Get a release by its tag name.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 }, tag: { type: "string", minLength: 1 } }, required: ["owner", "repo", "tag"], additionalProperties: false } }, { name: "get_tag", description: "Get a tag by name, including the commit it points at.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { owner: { type: "string", minLength: 1 }, repo: { type: "string", minLength: 1 }, tag: { type: "string", minLength: 1 } }, required: ["owner", "repo", "tag"], additionalProperties: false } }] } };
106
+
10
107
  // ../packages/twin-github/dist/src/errors.js
11
108
  var TwinError = class extends Error {
12
109
  status;
@@ -43,6 +140,7 @@ function validationFailed(field, code, value) {
43
140
  }
44
141
 
45
142
  // ../packages/twin-github/dist/src/tools.js
143
+ var githubToolFixture = loadMcpToolFixture({ raw: mcp_tools_list_raw_default, meta: mcp_tools_list_meta_default });
46
144
  var pageShape = {
47
145
  page: z.coerce.number().int().positive().optional(),
48
146
  per_page: z.coerce.number().int().positive().optional(),
@@ -78,349 +176,280 @@ function normalizeHeadSha(input) {
78
176
  function normalizeTagName(input) {
79
177
  return { ...input, tag_name: input.tag_name ?? input.tagName };
80
178
  }
81
- var toolDefinitions = [
179
+ var toolArgumentSchemas = [
82
180
  {
83
181
  name: "search_repositories",
84
- description: "Search local repositories by name or description.",
85
182
  schema: z.object({ query: z.string().optional(), q: z.string().optional(), ...pageShape })
86
183
  },
87
184
  {
88
185
  name: "create_repository",
89
- description: "Create a repository with an initial README and main branch.",
90
186
  schema: z.object({ name: z.string().min(1), owner: z.string().min(1).optional(), description: z.string().optional(), private: z.boolean().optional() })
91
187
  },
92
188
  {
93
189
  name: "fork_repository",
94
- description: "Fork a repository into the current user or an organization.",
95
190
  schema: z.object({ ...ownerRepo, organization: z.string().min(1).optional() })
96
191
  },
97
192
  {
98
193
  name: "get_repository",
99
- description: "Get one repository.",
100
194
  schema: z.object({ ...ownerRepo })
101
195
  },
102
196
  {
103
197
  name: "search_code",
104
- description: "Search files in the local GitHub twin.",
105
198
  schema: z.object({ query: z.string().optional(), q: z.string().optional(), owner: z.string().optional(), repo: z.string().optional(), ...pageShape })
106
199
  },
107
200
  {
108
201
  name: "search_users",
109
- description: "Search seeded users and organizations.",
110
202
  schema: z.object({ query: z.string().optional(), q: z.string().optional(), ...pageShape })
111
203
  },
112
204
  {
113
205
  name: "get_file_contents",
114
- description: "Read a file or directory from a repository branch.",
115
206
  schema: z.object({ ...ownerRepo, path: z.string().optional(), ref: z.string().optional() })
116
207
  },
117
208
  {
118
209
  name: "list_commits",
119
- description: "List commits for a repository.",
120
210
  schema: z.object({ ...ownerRepo, sha: z.string().optional(), ...pageShape })
121
211
  },
122
212
  {
123
213
  name: "create_or_update_file",
124
- description: "Create or update one file and advance the branch head atomically.",
125
214
  schema: z.object({ ...ownerRepo, path: z.string().min(1), message: z.string().min(1), content: z.string(), branch: z.string().optional(), sha: z.string().optional(), encoding: z.enum(["utf-8", "base64"]).optional() })
126
215
  },
127
216
  {
128
217
  name: "create_branch",
129
- description: "Create a branch from an existing branch or SHA.",
130
218
  schema: z.object({ ...ownerRepo, branch: z.string().min(1), from_branch: z.string().optional(), sha: z.string().optional() })
131
219
  },
132
220
  {
133
221
  name: "push_files",
134
- description: "Push multiple files in a single commit.",
135
222
  schema: z.object({ ...ownerRepo, branch: z.string().optional(), message: z.string().min(1), files: z.array(z.object({ path: z.string().min(1), content: z.string(), encoding: z.enum(["utf-8", "base64"]).optional() })).min(1) })
136
223
  },
137
224
  {
138
225
  name: "get_issue",
139
- description: "Get one issue.",
140
226
  schema: z.object({ ...ownerRepo, issue_number: z.coerce.number().int().positive().optional(), issueNumber: z.coerce.number().int().positive().optional() }).refine((value) => value.issue_number ?? value.issueNumber, "issue_number is required")
141
227
  },
142
228
  {
143
229
  name: "update_issue",
144
- description: "Update an issue title, body, state, labels, or assignees.",
145
230
  schema: z.object({ ...ownerRepo, issue_number: z.coerce.number().int().positive().optional(), issueNumber: z.coerce.number().int().positive().optional(), title: z.string().optional(), body: z.string().optional(), state: z.enum(["open", "closed"]).optional(), labels: z.array(z.string()).optional(), assignees: z.array(z.string()).optional() }).refine((value) => value.issue_number ?? value.issueNumber, "issue_number is required")
146
231
  },
147
232
  {
148
233
  name: "search_issues",
149
- description: "Search all local issues.",
150
234
  schema: z.object({ query: z.string().optional(), q: z.string().optional(), state: z.enum(["open", "closed", "all"]).optional(), ...pageShape })
151
235
  },
152
236
  {
153
237
  name: "list_issues",
154
- description: "List repository issues with common filters.",
155
238
  schema: z.object({ ...ownerRepo, state: z.enum(["open", "closed", "all"]).optional(), labels: z.string().optional(), assignee: z.string().optional(), ...pageShape })
156
239
  },
157
240
  {
158
241
  name: "add_issue_comment",
159
- description: "Add an issue comment.",
160
242
  schema: z.object({ ...ownerRepo, issue_number: z.coerce.number().int().positive().optional(), issueNumber: z.coerce.number().int().positive().optional(), body: z.string().min(1) }).refine((value) => value.issue_number ?? value.issueNumber, "issue_number is required")
161
243
  },
162
244
  {
163
245
  name: "list_issue_comments",
164
- description: "List comments on an issue.",
165
246
  schema: z.object({ ...ownerRepo, issue_number: z.coerce.number().int().positive().optional(), issueNumber: z.coerce.number().int().positive().optional(), ...pageShape }).refine((value) => value.issue_number ?? value.issueNumber, "issue_number is required")
166
247
  },
167
248
  {
168
249
  name: "create_issue",
169
- description: "Create an issue.",
170
250
  schema: z.object({ ...ownerRepo, title: z.string().min(1), body: z.string().optional(), labels: z.array(z.string()).optional(), assignees: z.array(z.string()).optional() })
171
251
  },
172
252
  {
173
253
  name: "list_repository_labels",
174
- description: "List labels defined on a repository.",
175
254
  schema: z.object({ ...ownerRepo })
176
255
  },
177
256
  {
178
257
  name: "create_label",
179
- description: "Create a repository label.",
180
258
  schema: z.object({ ...ownerRepo, name: z.string().min(1), color: z.string().default("ededed"), description: z.string().default("") })
181
259
  },
182
260
  {
183
261
  name: "list_issue_labels",
184
- description: "List labels applied to an issue.",
185
262
  schema: z.object({ ...ownerRepo, issue_number: z.coerce.number().int().positive().optional(), issueNumber: z.coerce.number().int().positive().optional() }).refine((value) => value.issue_number ?? value.issueNumber, "issue_number is required")
186
263
  },
187
264
  {
188
265
  name: "add_issue_labels",
189
- description: "Apply one or more labels to an issue.",
190
266
  schema: z.object({ ...ownerRepo, issue_number: z.coerce.number().int().positive().optional(), issueNumber: z.coerce.number().int().positive().optional(), labels: z.array(z.string().min(1)).min(1) }).refine((value) => value.issue_number ?? value.issueNumber, "issue_number is required")
191
267
  },
192
268
  {
193
269
  name: "remove_issue_label",
194
- description: "Remove one label from an issue.",
195
270
  schema: z.object({ ...ownerRepo, issue_number: z.coerce.number().int().positive().optional(), issueNumber: z.coerce.number().int().positive().optional(), label: z.string().min(1) }).refine((value) => value.issue_number ?? value.issueNumber, "issue_number is required")
196
271
  },
197
272
  {
198
273
  name: "list_collaborators",
199
- description: "List repository collaborators.",
200
274
  schema: z.object({ ...ownerRepo })
201
275
  },
202
276
  {
203
277
  name: "add_assignees",
204
- description: "Add assignees to an issue.",
205
278
  schema: z.object({ ...ownerRepo, issue_number: z.coerce.number().int().positive().optional(), issueNumber: z.coerce.number().int().positive().optional(), assignees: z.array(z.string().min(1)).min(1) }).refine((value) => value.issue_number ?? value.issueNumber, "issue_number is required")
206
279
  },
207
280
  {
208
281
  name: "get_pull_request",
209
- description: "Get one pull request.",
210
282
  schema: z.object({ ...ownerRepo, pull_number: z.coerce.number().int().positive().optional(), pullNumber: z.coerce.number().int().positive().optional() }).refine((value) => value.pull_number ?? value.pullNumber, "pull_number is required")
211
283
  },
212
284
  {
213
285
  name: "get_pull_request_reviews",
214
- description: "List pull request reviews.",
215
286
  schema: z.object({ ...ownerRepo, pull_number: z.coerce.number().int().positive().optional(), pullNumber: z.coerce.number().int().positive().optional(), ...pageShape }).refine((value) => value.pull_number ?? value.pullNumber, "pull_number is required")
216
287
  },
217
288
  {
218
289
  name: "create_pull_request_review",
219
- description: "Create a pull request review.",
220
290
  schema: z.object({ ...ownerRepo, pull_number: z.coerce.number().int().positive().optional(), pullNumber: z.coerce.number().int().positive().optional(), event: z.enum(["APPROVE", "REQUEST_CHANGES", "COMMENT"]), body: z.string().optional() }).refine((value) => value.pull_number ?? value.pullNumber, "pull_number is required")
221
291
  },
222
292
  {
223
293
  name: "get_pull_request_comments",
224
- description: "List review comments on a pull request.",
225
294
  schema: z.object({ ...ownerRepo, pull_number: z.coerce.number().int().positive().optional(), pullNumber: z.coerce.number().int().positive().optional(), ...pageShape }).refine((value) => value.pull_number ?? value.pullNumber, "pull_number is required")
226
295
  },
227
296
  {
228
297
  name: "get_pull_request_files",
229
- description: "List files changed by a pull request.",
230
298
  schema: z.object({ ...ownerRepo, pull_number: z.coerce.number().int().positive().optional(), pullNumber: z.coerce.number().int().positive().optional(), ...pageShape }).refine((value) => value.pull_number ?? value.pullNumber, "pull_number is required")
231
299
  },
232
300
  {
233
301
  name: "get_pull_request_status",
234
- description: "Get combined status for a pull request head commit.",
235
302
  schema: z.object({ ...ownerRepo, pull_number: z.coerce.number().int().positive().optional(), pullNumber: z.coerce.number().int().positive().optional() }).refine((value) => value.pull_number ?? value.pullNumber, "pull_number is required")
236
303
  },
237
304
  {
238
305
  name: "list_pull_requests",
239
- description: "List repository pull requests.",
240
306
  schema: z.object({ ...ownerRepo, state: z.enum(["open", "closed", "all"]).optional(), ...pageShape })
241
307
  },
242
308
  {
243
309
  name: "merge_pull_request",
244
- description: "Merge a pull request using simplified local merge semantics.",
245
310
  schema: z.object({ ...ownerRepo, pull_number: z.coerce.number().int().positive().optional(), pullNumber: z.coerce.number().int().positive().optional(), commit_title: z.string().optional(), commit_message: z.string().optional() }).refine((value) => value.pull_number ?? value.pullNumber, "pull_number is required")
246
311
  },
247
312
  {
248
313
  name: "update_pull_request_branch",
249
- description: "Update a PR branch from its base branch.",
250
314
  schema: z.object({ ...ownerRepo, pull_number: z.coerce.number().int().positive().optional(), pullNumber: z.coerce.number().int().positive().optional(), expected_head_sha: z.string().optional() }).refine((value) => value.pull_number ?? value.pullNumber, "pull_number is required")
251
315
  },
252
316
  {
253
317
  name: "create_pull_request",
254
- description: "Create a pull request from a head branch to a base branch.",
255
318
  schema: z.object({ ...ownerRepo, title: z.string().min(1), body: z.string().optional(), head: z.string().min(1), base: z.string().optional() })
256
319
  },
257
320
  // ===== v2 hot paths (FDRS-300) ==========================================
258
321
  // Cluster A — branches & files
259
322
  {
260
323
  name: "list_branches",
261
- description: "List branches for a repository.",
262
324
  schema: z.object({ ...ownerRepo, ...pageShape })
263
325
  },
264
326
  {
265
327
  name: "get_branch",
266
- description: "Get one branch by name.",
267
328
  schema: z.object({ ...ownerRepo, branch: z.string().min(1) })
268
329
  },
269
330
  {
270
331
  name: "delete_branch",
271
- description: "Delete a branch (cannot delete the default branch or a branch backing an open PR).",
272
332
  schema: z.object({ ...ownerRepo, branch: z.string().min(1) })
273
333
  },
274
334
  {
275
335
  name: "delete_file",
276
- description: "Delete one file and advance the branch head atomically.",
277
336
  schema: z.object({ ...ownerRepo, path: z.string().min(1), message: z.string().min(1), sha: z.string().min(1), branch: z.string().optional() })
278
337
  },
279
338
  // Cluster B — commits & diffs
280
339
  {
281
340
  name: "get_commit",
282
- description: "Get one commit with its file changes and stats.",
283
341
  schema: z.object({ ...ownerRepo, ref: z.string().min(1) })
284
342
  },
285
343
  {
286
344
  name: "compare_commits",
287
- description: "Compare two commits, branches, or tags. Returns ahead/behind/identical/diverged.",
288
345
  schema: z.object({ ...ownerRepo, base: z.string().min(1), head: z.string().min(1) })
289
346
  },
290
347
  {
291
348
  name: "get_pull_request_diff",
292
- description: "Get a unified-diff-style text representation of a pull request.",
293
349
  schema: z.object({ ...ownerRepo, ...prNumber }).refine((value) => value.pull_number ?? value.pullNumber, "pull_number is required")
294
350
  },
295
351
  // Cluster C — PR deeper
296
352
  {
297
353
  name: "update_pull_request",
298
- description: "Update a pull request title, body, state, or base branch.",
299
354
  schema: z.object({ ...ownerRepo, ...prNumber, title: z.string().optional(), body: z.string().optional(), state: z.enum(["open", "closed"]).optional(), base: z.string().optional() }).refine((value) => value.pull_number ?? value.pullNumber, "pull_number is required")
300
355
  },
301
356
  {
302
357
  name: "get_pull_request_commits",
303
- description: "List commits on a pull request, oldest first.",
304
358
  schema: z.object({ ...ownerRepo, ...prNumber, ...pageShape }).refine((value) => value.pull_number ?? value.pullNumber, "pull_number is required")
305
359
  },
306
360
  {
307
361
  name: "create_pull_request_review_comment",
308
- description: "Create an inline review comment on a pull request at a file path and line.",
309
362
  schema: z.object({ ...ownerRepo, ...prNumber, body: z.string().min(1), path: z.string().min(1), line: z.coerce.number().int().positive(), side: z.enum(["LEFT", "RIGHT"]).optional(), commit_id: z.string().optional(), commitId: z.string().optional() }).refine((value) => value.pull_number ?? value.pullNumber, "pull_number is required")
310
363
  },
311
364
  {
312
365
  name: "add_reply_to_pull_request_comment",
313
- description: "Reply to an existing pull request review comment.",
314
366
  schema: z.object({ ...ownerRepo, ...prNumber, comment_id: z.coerce.number().int().positive().optional(), commentId: z.coerce.number().int().positive().optional(), body: z.string().min(1) }).refine((value) => (value.pull_number ?? value.pullNumber) && (value.comment_id ?? value.commentId), "pull_number and comment_id are required")
315
367
  },
316
368
  // Cluster D — issue comments deeper
317
369
  {
318
370
  name: "update_issue_comment",
319
- description: "Update the body of an existing issue comment.",
320
371
  schema: z.object({ ...ownerRepo, comment_id: z.coerce.number().int().positive().optional(), commentId: z.coerce.number().int().positive().optional(), body: z.string().min(1) }).refine((value) => value.comment_id ?? value.commentId, "comment_id is required")
321
372
  },
322
373
  {
323
374
  name: "delete_issue_comment",
324
- description: "Delete an issue comment by ID.",
325
375
  schema: z.object({ ...ownerRepo, comment_id: z.coerce.number().int().positive().optional(), commentId: z.coerce.number().int().positive().optional() }).refine((value) => value.comment_id ?? value.commentId, "comment_id is required")
326
376
  },
327
377
  // Cluster E — milestones
328
378
  {
329
379
  name: "list_milestones",
330
- description: "List milestones for a repository.",
331
380
  schema: z.object({ ...ownerRepo, state: z.enum(["open", "closed", "all"]).optional(), ...pageShape })
332
381
  },
333
382
  {
334
383
  name: "create_milestone",
335
- description: "Create a milestone.",
336
384
  schema: z.object({ ...ownerRepo, title: z.string().min(1), description: z.string().optional(), due_on: z.string().optional(), dueOn: z.string().optional(), state: z.enum(["open", "closed"]).optional() })
337
385
  },
338
386
  {
339
387
  name: "update_milestone",
340
- description: "Update a milestone.",
341
388
  schema: z.object({ ...ownerRepo, milestone_number: z.coerce.number().int().positive().optional(), milestoneNumber: z.coerce.number().int().positive().optional(), title: z.string().optional(), description: z.string().optional(), due_on: z.string().optional(), dueOn: z.string().optional(), state: z.enum(["open", "closed"]).optional() }).refine((value) => value.milestone_number ?? value.milestoneNumber, "milestone_number is required")
342
389
  },
343
390
  {
344
391
  name: "delete_milestone",
345
- description: "Delete a milestone.",
346
392
  schema: z.object({ ...ownerRepo, milestone_number: z.coerce.number().int().positive().optional(), milestoneNumber: z.coerce.number().int().positive().optional() }).refine((value) => value.milestone_number ?? value.milestoneNumber, "milestone_number is required")
347
393
  },
348
394
  // Cluster F — status + checks
349
395
  {
350
396
  name: "create_commit_status",
351
- description: "Create a commit status (pending/success/failure/error) on a commit SHA.",
352
397
  schema: z.object({ ...ownerRepo, sha: z.string().min(1), state: z.enum(["error", "failure", "pending", "success"]), context: z.string().optional(), description: z.string().optional(), target_url: z.string().optional(), targetUrl: z.string().optional() })
353
398
  },
354
399
  {
355
400
  name: "get_combined_status_for_ref",
356
- description: "Get the combined status for a ref (SHA, branch, or tag).",
357
401
  schema: z.object({ ...ownerRepo, ref: z.string().min(1) })
358
402
  },
359
403
  {
360
404
  name: "create_check_run",
361
- description: "Create a check run on a commit SHA.",
362
405
  schema: z.object({ ...ownerRepo, name: z.string().min(1), head_sha: z.string().min(1).optional(), headSha: z.string().min(1).optional(), status: z.enum(["queued", "in_progress", "completed"]).optional(), conclusion: z.enum(["success", "failure", "neutral", "cancelled", "timed_out", "action_required", "skipped", "stale"]).optional(), details_url: z.string().optional(), detailsUrl: z.string().optional(), external_id: z.string().optional(), externalId: z.string().optional(), output: z.object({ title: z.string().optional(), summary: z.string().optional() }).optional(), started_at: z.string().optional(), startedAt: z.string().optional(), completed_at: z.string().optional(), completedAt: z.string().optional() }).refine((value) => value.head_sha ?? value.headSha, "head_sha is required")
363
406
  },
364
407
  {
365
408
  name: "list_check_runs_for_ref",
366
- description: "List check runs for a ref (SHA, branch, or tag).",
367
409
  schema: z.object({ ...ownerRepo, ref: z.string().min(1), ...pageShape })
368
410
  },
369
411
  // Cluster G — tags & releases
370
412
  {
371
413
  name: "list_tags",
372
- description: "List tags for a repository, most recent first.",
373
414
  schema: z.object({ ...ownerRepo, ...pageShape })
374
415
  },
375
416
  {
376
417
  name: "list_releases",
377
- description: "List releases for a repository, most recent first.",
378
418
  schema: z.object({ ...ownerRepo, ...pageShape })
379
419
  },
380
420
  {
381
421
  name: "get_latest_release",
382
- description: "Get the latest published (non-draft, non-prerelease) release.",
383
422
  schema: z.object({ ...ownerRepo })
384
423
  },
385
424
  {
386
425
  name: "create_release",
387
- description: "Create a release. Auto-creates the tag if it doesn't exist.",
388
426
  schema: z.object({ ...ownerRepo, tag_name: z.string().min(1).optional(), tagName: z.string().min(1).optional(), target_commitish: z.string().optional(), targetCommitish: z.string().optional(), name: z.string().optional(), body: z.string().optional(), draft: z.boolean().optional(), prerelease: z.boolean().optional() }).refine((value) => value.tag_name ?? value.tagName, "tag_name is required")
389
427
  },
390
428
  // Cluster H — identity & collaborators
391
429
  {
392
430
  name: "get_me",
393
- description: "Get the authenticated user.",
394
431
  schema: z.object({})
395
432
  },
396
433
  {
397
434
  name: "add_collaborator",
398
- description: "Add a collaborator to a repository. Returns 201 + invitation envelope for new users, 204 when already a collaborator.",
399
435
  schema: z.object({ ...ownerRepo, username: z.string().min(1), permission: z.enum(["pull", "push", "admin", "maintain", "triage"]).optional() })
400
436
  },
401
437
  // M5 hot gaps (F-735)
402
438
  {
403
439
  name: "search_commits",
404
- description: "Search commits on repository default branches by message or author.",
405
440
  schema: z.object({ query: z.string().optional(), q: z.string().optional(), owner: z.string().optional(), repo: z.string().optional(), ...pageShape })
406
441
  },
407
442
  {
408
443
  name: "get_release_by_tag",
409
- description: "Get a release by its tag name.",
410
444
  schema: z.object({ ...ownerRepo, tag: z.string().min(1) })
411
445
  },
412
446
  {
413
447
  name: "get_tag",
414
- description: "Get a tag by name, including the commit it points at.",
415
448
  schema: z.object({ ...ownerRepo, tag: z.string().min(1) })
416
449
  }
417
450
  ];
418
- function listTools() {
419
- return toolDefinitions.map((tool) => ({
420
- name: tool.name,
421
- description: tool.description,
422
- input_schema: z.toJSONSchema(tool.schema)
423
- }));
451
+ function githubToolInputSchema(schema) {
452
+ return z.toJSONSchema(schema);
424
453
  }
425
454
  var MUTATING_TOOL_NAMES = /* @__PURE__ */ new Set([
426
455
  "create_repository",
@@ -459,7 +488,7 @@ function isMutatingTool(name) {
459
488
  return MUTATING_TOOL_NAMES.has(name);
460
489
  }
461
490
  function executeTool(domain, name, input, onDelta, options = {}) {
462
- const definition = toolDefinitions.find((tool) => tool.name === name);
491
+ const definition = toolArgumentSchemas.find((tool) => tool.name === name);
463
492
  if (!definition) {
464
493
  validationFailed("tool", "invalid", name);
465
494
  }
@@ -792,7 +821,7 @@ function githubAccessControlToolNames(catalog = GITHUB_ACCESS_CONTROL_CATALOG) {
792
821
  return catalog.endpoints.map((endpoint) => endpoint.tool);
793
822
  }
794
823
  function assertAccessControlCatalogMatchesTools() {
795
- const toolNames = new Set(toolDefinitions.map((tool) => tool.name));
824
+ const toolNames = new Set(githubToolFixture.toolNames);
796
825
  const missing = githubAccessControlToolNames().filter((name) => !toolNames.has(name));
797
826
  if (missing.length > 0) {
798
827
  throw new Error(`access-control catalog references unknown tools: ${missing.join(", ")}`);
@@ -4161,7 +4190,16 @@ function githubErrorEnvelope(err) {
4161
4190
  body: githubError(err instanceof Error ? err.message : "Internal Server Error", 500)
4162
4191
  };
4163
4192
  }
4164
- var toolListing = new Map(listTools().map((tool) => [tool.name, tool]));
4193
+ var githubToolImplementations = Object.fromEntries(toolArgumentSchemas.map((def) => [
4194
+ def.name,
4195
+ {
4196
+ schema: def.schema,
4197
+ mutation: isMutatingTool(def.name),
4198
+ handler: (domain, args, ctx) => executeTool(domain, def.name, args, ctx.reportDelta, {
4199
+ actor: actorFromSession(ctx.session)
4200
+ })
4201
+ }
4202
+ ]));
4165
4203
  var githubTwinDefinition = defineTwin({
4166
4204
  id: "github",
4167
4205
  version: process.env.POME_TWIN_VERSION ?? "0.1.0",
@@ -4189,16 +4227,7 @@ var githubTwinDefinition = defineTwin({
4189
4227
  // The admin-gate 403 body is the gate's default GitHub envelope
4190
4228
  // ({message: "Forbidden"}); no per-twin override needed.
4191
4229
  },
4192
- tools: toolDefinitions.map((def) => ({
4193
- name: def.name,
4194
- description: def.description,
4195
- schema: def.schema,
4196
- mutation: isMutatingTool(def.name),
4197
- inputSchema: toolListing.get(def.name)?.input_schema,
4198
- handler: (domain, args, ctx) => executeTool(domain, def.name, args, ctx.reportDelta, {
4199
- actor: actorFromSession(ctx.session)
4200
- })
4201
- })),
4230
+ tools: deriveMcpToolTable(githubToolFixture, githubToolImplementations),
4202
4231
  // Frozen healthz shape: {ok, twin, implementation, fidelity, tools,
4203
4232
  // access_control, runtime} — no version field (github never carried it).
4204
4233
  healthz: () => ({
@@ -4258,4 +4287,4 @@ function createGitHubCloneApp(options = {}) {
4258
4287
  });
4259
4288
  }
4260
4289
 
4261
- export { GitHubDomain, createGitHubCloneApp, executeTool, githubTwinDefinition, listTools, openGitHubCloneDatabase, resetDatabase, toolDefinitions };
4290
+ export { GitHubDomain, createGitHubCloneApp, executeTool, githubToolFixture, githubToolInputSchema, githubTwinDefinition, openGitHubCloneDatabase, resetDatabase, toolArgumentSchemas };