From 01759eefcb0032f0398e6b1d82744f5e6c0ae05c Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 10 Feb 2026 00:22:02 +0000 Subject: [PATCH] Hoist shell.openInEditor input schema for reuse Co-authored-by: Theo Browne --- apps/t3/src/runtimeApiServer.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/t3/src/runtimeApiServer.ts b/apps/t3/src/runtimeApiServer.ts index 4708218e36..89382ff453 100644 --- a/apps/t3/src/runtimeApiServer.ts +++ b/apps/t3/src/runtimeApiServer.ts @@ -70,6 +70,10 @@ const agentWriteInputSchema = z.object({ sessionId: z.string().min(1), data: z.string(), }); +const shellOpenInEditorInputSchema = z.object({ + cwd: z.string().min(1), + editor: z.enum(EDITORS.map((entry) => entry.id) as [string, ...string[]]), +}); interface RuntimeApiServerOptions { port: number; @@ -524,11 +528,7 @@ export async function startRuntimeApiServer( if (method === "providers.listSessions") return providerManager.listSessions(); if (method === "shell.openInEditor") { - const schema = z.object({ - cwd: z.string().min(1), - editor: z.enum(EDITORS.map((entry) => entry.id) as [string, ...string[]]), - }); - const parsed = schema.parse(params); + const parsed = shellOpenInEditorInputSchema.parse(params); const editor = EDITORS.find((entry) => entry.id === parsed.editor); if (!editor) { throw new Error(`Unknown editor: ${parsed.editor}`);