Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

t3McpToolPresentationCopy.ts

138 lines7.7 KB

1import { mFallback, msg } from "gt-i18n";
2import type { M } from "gt-i18n";
3​
4import { resolveT3McpToolDefinition, type T3McpToolPresentation } from "./t3McpToolPresentation.ts";
5​
6// Same English as each tool's displayName; a name missing here shows as authored.
7const DISPLAY_NAMES: ReadonlyMap<string, string> = new Map([
8 ["Link a pull request", msg("Link a pull request")],
9 ["Link pull requests", msg("Link pull requests")],
10 ["Unlink a pull request", msg("Unlink a pull request")],
11 ["Unlink pull requests by state", msg("Unlink pull requests by state")],
12 ["Check linked pull requests", msg("Check linked pull requests")],
13 ["Watch a pull request", msg("Watch a pull request")],
14 ["Stop watching a pull request", msg("Stop watching a pull request")],
15 ["Write review guides", msg("Write review guides")],
16 ["Read a review guide", msg("Read a review guide")],
17 ["Read a pull request", msg("Read a pull request")],
18 ["List pull requests", msg("List pull requests")],
19 ["Search pull requests", msg("Search pull requests")],
20 ["Open a pull request", msg("Open a pull request")],
21 ["Update a pull request", msg("Update a pull request")],
22 ["Respond on a pull request", msg("Respond on a pull request")],
23 ["Review a pull request", msg("Review a pull request")],
24 ["Merge a pull request", msg("Merge a pull request")],
25 ["Read CI logs", msg("Read CI logs")],
26 ["Re-run CI", msg("Re-run CI")],
27 ["List issues", msg("List issues")],
28 ["Read an issue", msg("Read an issue")],
29 ["File an issue", msg("File an issue")],
30 ["Comment on an issue", msg("Comment on an issue")],
31 ["Change an issue's state", msg("Change an issue's state")],
32 ["Link an issue", msg("Link an issue")],
33 ["Unlink an issue", msg("Unlink an issue")],
34 ["Check linked issues", msg("Check linked issues")],
35 ["Get orchestration capabilities", msg("Get orchestration capabilities")],
36 ["Delegate a child task", msg("Delegate a child task")],
37 ["Get delegated task status", msg("Get delegated task status")],
38 ["Cancel a delegated task", msg("Cancel a delegated task")],
39 ["Schedule a task", msg("Schedule a task")],
40 ["List scheduled tasks", msg("List scheduled tasks")],
41 ["Update a scheduled task", msg("Update a scheduled task")],
42 ["Delete a scheduled task", msg("Delete a scheduled task")],
43 ["Ask for a secret", msg("Ask for a secret")],
44 ["Create T3 threads", msg("Create T3 threads")],
45 ["Start a T3 thread", msg("Start a T3 thread")],
46 ["List T3 threads", msg("List T3 threads")],
47 ["Read a T3 thread", msg("Read a T3 thread")],
48 ["Send to a T3 thread", msg("Send to a T3 thread")],
49 ["Wait for a T3 thread", msg("Wait for a T3 thread")],
50 ["Stop a workflow", msg("Stop a workflow")],
51 ["Update background waits", msg("Update background waits")],
52 ["Interrupt a T3 thread", msg("Interrupt a T3 thread")],
53 ["Hand off thread to a git worktree", msg("Hand off thread to a git worktree")],
54 ["Get thread worktree status", msg("Get thread worktree status")],
55 ["Get preview browser status", msg("Get preview browser status")],
56 ["Open a page in the preview browser", msg("Open a page in the preview browser")],
57 ["Navigate the preview browser", msg("Navigate the preview browser")],
58 ["Respond to a preview browser dialog", msg("Respond to a preview browser dialog")],
59 ["Snapshot the preview page", msg("Snapshot the preview page")],
60 ["Use the preview browser", msg("Use the preview browser")],
61 ["Click in the preview browser", msg("Click in the preview browser")],
62 ["Press a key in the preview browser", msg("Press a key in the preview browser")],
63 ["Type in the preview browser", msg("Type in the preview browser")],
64 ["Hover in the preview browser", msg("Hover in the preview browser")],
65 ["Choose an option in the preview browser", msg("Choose an option in the preview browser")],
66 ["Drag in the preview browser", msg("Drag in the preview browser")],
67 ["Upload files to the preview browser", msg("Upload files to the preview browser")],
68 ["Scroll the preview browser", msg("Scroll the preview browser")],
69 ["Resize the preview browser", msg("Resize the preview browser")],
70 ["Evaluate script in the preview browser", msg("Evaluate script in the preview browser")],
71 ["Wait for the preview page", msg("Wait for the preview page")],
72 ["Set preview browser appearance", msg("Set preview browser appearance")],
73 ["Start recording the preview browser", msg("Start recording the preview browser")],
74 ["Stop recording the preview browser", msg("Stop recording the preview browser")],
75 ["List simulators and emulators", msg("List simulators and emulators")],
76 ["Open a device in the Device panel", msg("Open a device in the Device panel")],
77 ["Take a screenshot of the device", msg("Take a screenshot of the device")],
78 ["Close a device", msg("Close a device")],
79 ["Run a scheduled task", msg("Run a scheduled task")],
80 ["Manage queued messages", msg("Manage queued messages")],
81 ["Handle pending questions", msg("Handle pending questions")],
82 ["List queued messages", msg("List queued messages")],
83 ["Read a queued message", msg("Read a queued message")],
84 ["Edit a queued message", msg("Edit a queued message")],
85 ["Cancel a queued run", msg("Cancel a queued run")],
86 ["Reorder a queued run", msg("Reorder a queued run")],
87 ["Steer with a queued message", msg("Steer with a queued message")],
88 ["List pending questions", msg("List pending questions")],
89 ["Read pending questions", msg("Read pending questions")],
90 ["Answer pending questions", msg("Answer pending questions")],
91 ["Read thread configuration", msg("Read thread configuration")],
92 ["Use thread model settings", msg("Use thread model settings")],
93 ["Use thread transfers", msg("Use thread transfers")],
94 ["Fork this thread", msg("Fork this thread")],
95 ["Merge thread context", msg("Merge thread context")],
96 ["Search thread content", msg("Search thread content")],
97 ["Read thread transfers", msg("Read thread transfers")],
98 ["Organize a thread", msg("Organize a thread")],
99 ["Update T3 thread metadata", msg("Update T3 thread metadata")],
100 ["List workspace branches", msg("List workspace branches")],
101 ["List preview tabs", msg("List preview tabs")],
102 ["Close a preview tab", msg("Close a preview tab")],
103 ["Read environment preferences", msg("Read environment preferences")],
104 ["List linked environments", msg("List linked environments")],
105 ["Ask to link an environment", msg("Ask to link an environment")],
106 ["Forget a linked environment", msg("Forget a linked environment")],
107 ["Update environment preferences", msg("Update environment preferences")],
108 ["Read themes", msg("Read themes")],
109 ["Set the theme", msg("Set the theme")],
110 ["Launch a project thread", msg("Launch a project thread")],
111 ["List projects", msg("List projects")],
112 ["Read a project", msg("Read a project")],
113 ["Register a project", msg("Register a project")],
114 ["Update a project", msg("Update a project")],
115 ["Delete a project", msg("Delete a project")],
116 ["Clone a repository", msg("Clone a repository")],
117 ["Prepare an attachment upload", msg("Prepare an attachment upload")],
118 ["Discard a pending attachment", msg("Discard a pending attachment")],
119 ["Send attachments", msg("Send attachments")],
120 ["Preview an HTML page", msg("Preview an HTML page")],
121 ["Render an HTML page", msg("Render an HTML page")],
122 ["Send a message", msg("Send a message")],
123]);
124​
125/** @public */
126export function resolveT3McpToolPresentation(
127 toolName: string | null | undefined,
128 input?: unknown,
129 resolve: M = mFallback,
130): T3McpToolPresentation | null {
131 const definition = resolveT3McpToolDefinition(toolName, input);
132 if (definition === null) return null;
133 const displayName = DISPLAY_NAMES.get(definition.displayName);
134 return {
135 displayName: displayName === undefined ? definition.displayName : resolve(displayName),
136 logo: "t3-code",
137 };