t3-code-android-nightly/packages/shared/src/t3McpToolPresentationCopy.ts

138 lines
7.7 KiB
TypeScript

import { mFallback, msg } from "gt-i18n";
import type { MFunctionType } from "gt-i18n/types";
import { resolveT3McpToolDefinition, type T3McpToolPresentation } from "./t3McpToolPresentation.ts";
// Same English as each tool's displayName; a name missing here shows as authored.
const DISPLAY_NAMES: ReadonlyMap<string, string> = new Map([
["Link a pull request", msg("Link a pull request")],
["Link pull requests", msg("Link pull requests")],
["Unlink a pull request", msg("Unlink a pull request")],
["Unlink pull requests by state", msg("Unlink pull requests by state")],
["Check linked pull requests", msg("Check linked pull requests")],
["Watch a pull request", msg("Watch a pull request")],
["Stop watching a pull request", msg("Stop watching a pull request")],
["Write review guides", msg("Write review guides")],
["Read a review guide", msg("Read a review guide")],
["Read a pull request", msg("Read a pull request")],
["List pull requests", msg("List pull requests")],
["Search pull requests", msg("Search pull requests")],
["Open a pull request", msg("Open a pull request")],
["Update a pull request", msg("Update a pull request")],
["Respond on a pull request", msg("Respond on a pull request")],
["Review a pull request", msg("Review a pull request")],
["Merge a pull request", msg("Merge a pull request")],
["Read CI logs", msg("Read CI logs")],
["Re-run CI", msg("Re-run CI")],
["List issues", msg("List issues")],
["Read an issue", msg("Read an issue")],
["File an issue", msg("File an issue")],
["Comment on an issue", msg("Comment on an issue")],
["Change an issue's state", msg("Change an issue's state")],
["Link an issue", msg("Link an issue")],
["Unlink an issue", msg("Unlink an issue")],
["Check linked issues", msg("Check linked issues")],
["Get orchestration capabilities", msg("Get orchestration capabilities")],
["Delegate a child task", msg("Delegate a child task")],
["Get delegated task status", msg("Get delegated task status")],
["Cancel a delegated task", msg("Cancel a delegated task")],
["Schedule a task", msg("Schedule a task")],
["List scheduled tasks", msg("List scheduled tasks")],
["Update a scheduled task", msg("Update a scheduled task")],
["Delete a scheduled task", msg("Delete a scheduled task")],
["Ask for a secret", msg("Ask for a secret")],
["Create T3 threads", msg("Create T3 threads")],
["Start a T3 thread", msg("Start a T3 thread")],
["List T3 threads", msg("List T3 threads")],
["Read a T3 thread", msg("Read a T3 thread")],
["Send to a T3 thread", msg("Send to a T3 thread")],
["Wait for a T3 thread", msg("Wait for a T3 thread")],
["Stop a workflow", msg("Stop a workflow")],
["Update background waits", msg("Update background waits")],
["Interrupt a T3 thread", msg("Interrupt a T3 thread")],
["Hand off thread to a git worktree", msg("Hand off thread to a git worktree")],
["Get thread worktree status", msg("Get thread worktree status")],
["Get preview browser status", msg("Get preview browser status")],
["Open a page in the preview browser", msg("Open a page in the preview browser")],
["Navigate the preview browser", msg("Navigate the preview browser")],
["Respond to a preview browser dialog", msg("Respond to a preview browser dialog")],
["Snapshot the preview page", msg("Snapshot the preview page")],
["Use the preview browser", msg("Use the preview browser")],
["Click in the preview browser", msg("Click in the preview browser")],
["Press a key in the preview browser", msg("Press a key in the preview browser")],
["Type in the preview browser", msg("Type in the preview browser")],
["Hover in the preview browser", msg("Hover in the preview browser")],
["Choose an option in the preview browser", msg("Choose an option in the preview browser")],
["Drag in the preview browser", msg("Drag in the preview browser")],
["Upload files to the preview browser", msg("Upload files to the preview browser")],
["Scroll the preview browser", msg("Scroll the preview browser")],
["Resize the preview browser", msg("Resize the preview browser")],
["Evaluate script in the preview browser", msg("Evaluate script in the preview browser")],
["Wait for the preview page", msg("Wait for the preview page")],
["Set preview browser appearance", msg("Set preview browser appearance")],
["Start recording the preview browser", msg("Start recording the preview browser")],
["Stop recording the preview browser", msg("Stop recording the preview browser")],
["List simulators and emulators", msg("List simulators and emulators")],
["Open a device in the Device panel", msg("Open a device in the Device panel")],
["Take a screenshot of the device", msg("Take a screenshot of the device")],
["Close a device", msg("Close a device")],
["Run a scheduled task", msg("Run a scheduled task")],
["Manage queued messages", msg("Manage queued messages")],
["Handle pending questions", msg("Handle pending questions")],
["List queued messages", msg("List queued messages")],
["Read a queued message", msg("Read a queued message")],
["Edit a queued message", msg("Edit a queued message")],
["Cancel a queued run", msg("Cancel a queued run")],
["Reorder a queued run", msg("Reorder a queued run")],
["Steer with a queued message", msg("Steer with a queued message")],
["List pending questions", msg("List pending questions")],
["Read pending questions", msg("Read pending questions")],
["Answer pending questions", msg("Answer pending questions")],
["Read thread configuration", msg("Read thread configuration")],
["Use thread model settings", msg("Use thread model settings")],
["Use thread transfers", msg("Use thread transfers")],
["Fork this thread", msg("Fork this thread")],
["Merge thread context", msg("Merge thread context")],
["Search thread content", msg("Search thread content")],
["Read thread transfers", msg("Read thread transfers")],
["Organize a thread", msg("Organize a thread")],
["Update T3 thread metadata", msg("Update T3 thread metadata")],
["List workspace branches", msg("List workspace branches")],
["List preview tabs", msg("List preview tabs")],
["Close a preview tab", msg("Close a preview tab")],
["Read environment preferences", msg("Read environment preferences")],
["List linked environments", msg("List linked environments")],
["Ask to link an environment", msg("Ask to link an environment")],
["Forget a linked environment", msg("Forget a linked environment")],
["Update environment preferences", msg("Update environment preferences")],
["Read themes", msg("Read themes")],
["Set the theme", msg("Set the theme")],
["Launch a project thread", msg("Launch a project thread")],
["List projects", msg("List projects")],
["Read a project", msg("Read a project")],
["Register a project", msg("Register a project")],
["Update a project", msg("Update a project")],
["Delete a project", msg("Delete a project")],
["Clone a repository", msg("Clone a repository")],
["Prepare an attachment upload", msg("Prepare an attachment upload")],
["Discard a pending attachment", msg("Discard a pending attachment")],
["Send attachments", msg("Send attachments")],
["Preview an HTML page", msg("Preview an HTML page")],
["Render an HTML page", msg("Render an HTML page")],
["Send a message", msg("Send a message")],
]);
/** @public */
export function resolveT3McpToolPresentation(
toolName: string | null | undefined,
input?: unknown,
resolve: MFunctionType = mFallback,
): T3McpToolPresentation | null {
const definition = resolveT3McpToolDefinition(toolName, input);
if (definition === null) return null;
const displayName = DISPLAY_NAMES.get(definition.displayName);
return {
displayName: displayName === undefined ? definition.displayName : resolve(displayName),
logo: "t3-code",
};
}