@air-jam/mcp-server 0.9.3 → 1.0.0-beta.2
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/README.md +10 -0
- package/dist/cli.js +178 -56
- package/dist/cli.js.map +1 -1
- package/dist/index.js +171 -53
- package/dist/index.js.map +1 -1
- package/dist/server.d.ts +2 -1
- package/dist/server.js +171 -53
- package/dist/server.js.map +1 -1
- package/dist/tools.d.ts +2 -7
- package/dist/tools.js +150 -52
- package/dist/tools.js.map +1 -1
- package/package.json +3 -3
- package/src/cli.ts +5 -1
- package/src/server.ts +27 -0
- package/src/tools.ts +152 -62
- package/tool-contract.json +24 -2
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/config.ts","../src/server.ts","../src/tools.ts","../tool-contract.json","../src/version.ts"],"sourcesContent":["export {\n AIRJAM_CODEX_PROJECT_MCP_FILE,\n AIRJAM_PROJECT_MCP_FILE,\n createAirJamMcpServerDeclaration,\n createProjectLocalMcpConfig,\n inspectMcpProjectSetup,\n renderMcpClientProfile,\n writeProjectLocalMcpConfig,\n} from \"@air-jam/devtools/mcp-config\";\nexport type {\n AirJamMcpClientProfile,\n AirJamMcpClientProfileRender,\n AirJamMcpRegistrationInspection,\n AirJamMcpServerDeclaration,\n AirJamProjectLocalMcpConfig,\n InspectMcpProjectSetupResult,\n} from \"@air-jam/devtools/mcp-config\";\n","import { detectProjectContext } from \"@air-jam/devtools/context\";\nimport type {\n CreateTaskRequestHandlerExtra,\n TaskRequestHandlerExtra,\n} from \"@modelcontextprotocol/sdk/experimental/tasks\";\nimport { InMemoryTaskStore } from \"@modelcontextprotocol/sdk/experimental/tasks\";\nimport { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport type { CallToolResult } from \"@modelcontextprotocol/sdk/types.js\";\nimport {\n buildToolDefinitions,\n getRegisteredToolNamesForProjectMode,\n} from \"./tools.js\";\nimport { AIR_JAM_MCP_SERVER_VERSION } from \"./version.js\";\n\nconst DEFAULT_TASK_TTL_MS = 5 * 60 * 1000;\nconst TASK_CAPABLE_CLIENT_NOTE =\n \" Requires an MCP client with task-backed tool execution support.\";\n\nconst describeToolForRegistration = ({\n description,\n requiresTaskSupport,\n}: {\n description: string;\n requiresTaskSupport: boolean;\n}): string =>\n requiresTaskSupport\n ? `${description}${TASK_CAPABLE_CLIENT_NOTE}`\n : description;\n\nconst createToolErrorResult = (error: unknown): CallToolResult => ({\n content: [\n {\n type: \"text\",\n text:\n error instanceof Error\n ? error.message\n : `Air Jam MCP task failed: ${String(error)}`,\n },\n ],\n isError: true,\n});\n\nexport const createAirJamMcpServer = async ({\n cwd = process.cwd(),\n}: {\n cwd?: string;\n} = {}): Promise<McpServer> => {\n const context = await detectProjectContext({ cwd });\n const toolDefinitions = buildToolDefinitions({\n projectMode: context.mode,\n });\n const registeredToolNames = getRegisteredToolNamesForProjectMode(\n context.mode,\n );\n const taskStore = new InMemoryTaskStore();\n const server = new McpServer(\n {\n name: \"air-jam\",\n version: AIR_JAM_MCP_SERVER_VERSION,\n },\n {\n capabilities: {\n tasks: {\n list: {},\n cancel: {},\n requests: {\n tools: {\n call: {},\n },\n },\n },\n },\n instructions:\n \"Use Air Jam tools before falling back to raw shell commands for Air Jam-native workflows. Start with inspect_project, read_logs with view=signal, and inspect_game when debugging runtime or game issues. If a tool advertises task-backed execution support as required, call it through an MCP client flow that supports tasks instead of assuming one blocking request/response call.\",\n taskStore,\n },\n );\n\n for (const toolName of registeredToolNames) {\n const tool = toolDefinitions[toolName];\n const description = describeToolForRegistration({\n description: tool.description,\n requiresTaskSupport: tool.execution?.taskSupport === \"required\",\n });\n const baseConfig = {\n description,\n inputSchema: tool.inputSchema,\n };\n\n if (tool.execution?.taskSupport === \"required\") {\n server.experimental.tasks.registerToolTask(\n toolName,\n {\n ...baseConfig,\n execution: {\n taskSupport: \"required\",\n },\n },\n {\n createTask: async (\n args: unknown,\n { taskStore, taskRequestedTtl }: CreateTaskRequestHandlerExtra,\n ) => {\n const task = await taskStore.createTask({\n ttl: taskRequestedTtl ?? DEFAULT_TASK_TTL_MS,\n });\n\n void (async () => {\n try {\n const result = await tool.run(args as never);\n await taskStore.storeTaskResult(\n task.taskId,\n \"completed\",\n result,\n );\n } catch (error) {\n await taskStore.storeTaskResult(\n task.taskId,\n \"failed\",\n createToolErrorResult(error),\n );\n }\n })();\n\n return { task };\n },\n getTask: async (\n _args: unknown,\n { taskId, taskStore }: TaskRequestHandlerExtra,\n ) => taskStore.getTask(taskId),\n getTaskResult: async (\n _args: unknown,\n { taskId, taskStore }: TaskRequestHandlerExtra,\n ) => taskStore.getTaskResult(taskId) as Promise<CallToolResult>,\n },\n );\n continue;\n }\n\n server.registerTool(toolName, baseConfig, async (args: unknown) =>\n tool.run(args as never),\n );\n }\n\n return server;\n};\n","import { inspectGameAgentContract } from \"@air-jam/devtools/agent\";\nimport { inspectProject } from \"@air-jam/devtools/context\";\nimport {\n getDevStatus,\n getTopology,\n resetLocalDev,\n startDev,\n stopDev,\n} from \"@air-jam/devtools/dev\";\nimport {\n captureGameSessionVisuals,\n closeGameSession,\n invokeGameSessionAction,\n openGameSession,\n readGameSession,\n sendGameSessionInput,\n} from \"@air-jam/devtools/game-session\";\nimport { inspectGame, listGames } from \"@air-jam/devtools/games\";\nimport { readDevLogs } from \"@air-jam/devtools/logs\";\nimport { getPlatformMachineAuthStatus } from \"@air-jam/devtools/platform-auth\";\nimport {\n runCompleteEvaluation,\n runQualityGate,\n} from \"@air-jam/devtools/quality\";\nimport {\n bundleLocalRelease,\n exportPlatformReleaseGeneration,\n finalizePlatformReleaseGeneration,\n inspectLocalRelease,\n inspectPlatformRelease,\n listPlatformReleaseTargets,\n listPlatformReleases,\n publishPlatformRelease,\n submitPlatformRelease,\n uploadPlatformReleaseGeneration,\n validateLocalRelease,\n} from \"@air-jam/devtools/release\";\nimport type { ToolExecution } from \"@modelcontextprotocol/sdk/types.js\";\nimport { z } from \"zod\";\nimport toolContract from \"../tool-contract.json\" with { type: \"json\" };\n\ntype AirJamProjectMode = \"monorepo\" | \"standalone-game\" | \"unknown\";\ntype AirJamQualityGate =\n | \"typecheck\"\n | \"lint\"\n | \"test\"\n | \"build\"\n | \"format-check\"\n | \"scaffold-smoke\"\n | \"release-check\";\n\nexport type AirJamMcpToolDefinition = {\n description: string;\n inputSchema: z.ZodTypeAny;\n run: (args: never) => Promise<{\n content: Array<{\n type: \"text\";\n text: string;\n }>;\n }>;\n execution?: ToolExecution;\n};\n\nconst withJsonText = <T>(value: T) => ({\n content: [\n {\n type: \"text\" as const,\n text: JSON.stringify(value, null, 2),\n },\n ],\n});\n\nconst buildQualityGateSchema = (projectMode: AirJamProjectMode) =>\n z.object({\n cwd: z.string().optional(),\n gate:\n projectMode === \"monorepo\"\n ? z.enum([\n \"typecheck\",\n \"lint\",\n \"test\",\n \"build\",\n \"format-check\",\n \"scaffold-smoke\",\n \"release-check\",\n ] satisfies [AirJamQualityGate, ...AirJamQualityGate[]])\n : z.enum([\n \"typecheck\",\n \"lint\",\n \"test\",\n \"build\",\n \"format-check\",\n ] satisfies [AirJamQualityGate, ...AirJamQualityGate[]]),\n packageFilter: z.string().optional(),\n });\n\nconst buildStartDevSchema = (projectMode: AirJamProjectMode) =>\n z.object({\n cwd: z.string().optional(),\n gameId: z.string().optional(),\n mode:\n projectMode === \"monorepo\"\n ? z.enum([\"standalone-dev\", \"arcade-dev\", \"arcade-test\"]).optional()\n : z.literal(\"standalone-dev\").optional(),\n secure: z.boolean().optional(),\n });\n\nconst buildTopologySchema = (projectMode: AirJamProjectMode) =>\n z.object({\n cwd: z.string().optional(),\n gameId: z.string().optional(),\n mode:\n projectMode === \"monorepo\"\n ? z.enum([\"standalone-dev\", \"arcade-dev\", \"arcade-test\"]).optional()\n : z.literal(\"standalone-dev\").optional(),\n secure: z.boolean().optional(),\n });\n\nconst buildGameSessionModeSchema = (projectMode: AirJamProjectMode) =>\n projectMode === \"monorepo\"\n ? z.enum([\"standalone-dev\", \"arcade-dev\", \"arcade-test\"]).optional()\n : z.literal(\"standalone-dev\").optional();\n\nconst RELEASE_PROJECT_INPUT_SCHEMA = z.object({\n cwd: z.string().optional(),\n distDir: z.string().optional(),\n});\n\nconst RELEASE_PLATFORM_INPUT_SCHEMA = z.object({\n platformUrl: z.string().url().optional(),\n});\n\nconst RELEASE_VALIDATE_INPUT_SCHEMA = RELEASE_PROJECT_INPUT_SCHEMA.extend({\n bundle: z.string().optional(),\n skipBuild: z.boolean().optional(),\n});\n\nconst RELEASE_BUNDLE_INPUT_SCHEMA = RELEASE_PROJECT_INPUT_SCHEMA.extend({\n out: z.string().optional(),\n skipBuild: z.boolean().optional(),\n});\n\nconst RELEASE_LIST_INPUT_SCHEMA = RELEASE_PLATFORM_INPUT_SCHEMA.extend({\n game: z.string().optional(),\n});\n\nconst RELEASE_INSPECT_INPUT_SCHEMA = RELEASE_PLATFORM_INPUT_SCHEMA.extend({\n releaseId: z.string().min(1),\n});\n\nconst RELEASE_SUBMIT_INPUT_SCHEMA = RELEASE_PLATFORM_INPUT_SCHEMA.extend({\n game: z.string().min(1),\n versionLabel: z.string().optional(),\n cwd: z.string().optional(),\n distDir: z.string().optional(),\n bundle: z.string().optional(),\n skipBuild: z.boolean().optional(),\n waitForProcessing: z.boolean().optional(),\n processingTimeoutSeconds: z.number().int().min(1).max(3_600).optional(),\n publish: z.boolean().optional(),\n});\n\nconst RELEASE_UPLOAD_INPUT_SCHEMA = RELEASE_PLATFORM_INPUT_SCHEMA.extend({\n releaseId: z.string().min(1),\n cwd: z.string().optional(),\n bundle: z.string().min(1),\n});\n\nconst RELEASE_FINALIZE_INPUT_SCHEMA = RELEASE_PLATFORM_INPUT_SCHEMA.extend({\n releaseId: z.string().min(1),\n generationId: z.string().min(1),\n});\n\nconst RELEASE_EXPORT_INPUT_SCHEMA = RELEASE_PLATFORM_INPUT_SCHEMA.extend({\n releaseId: z.string().min(1),\n generationId: z.string().min(1),\n cwd: z.string().optional(),\n out: z.string().optional(),\n});\n\nconst RELEASE_PUBLISH_INPUT_SCHEMA = RELEASE_PLATFORM_INPUT_SCHEMA.extend({\n releaseId: z.string().min(1),\n});\n\nexport const READ_LOGS_INPUT_SCHEMA = z.object({\n cwd: z.string().optional(),\n view: z.string().optional(),\n source: z.string().optional(),\n trace: z.string().optional(),\n room: z.string().optional(),\n controller: z.string().optional(),\n event: z.string().optional(),\n process: z.string().optional(),\n level: z.string().optional(),\n runtime: z.string().optional(),\n epoch: z.number().int().optional(),\n consoleCategory: z.string().optional(),\n file: z.string().optional(),\n tail: z.number().int().nonnegative().optional(),\n});\n\nexport const INSPECT_GAME_INPUT_SCHEMA = z.object({\n cwd: z.string().optional(),\n gameId: z.string().optional(),\n});\n\nexport const STOP_DEV_INPUT_SCHEMA = z.object({\n cwd: z.string().optional(),\n processId: z.string().optional(),\n mode: z.enum([\"standalone-dev\", \"arcade-dev\", \"arcade-test\"]).optional(),\n});\n\nconst buildConnectControllerSchema = (projectMode: AirJamProjectMode) =>\n z.object({\n cwd: z.string().optional(),\n gameId: z.string().optional(),\n mode: buildGameSessionModeSchema(projectMode),\n secure: z.boolean().optional(),\n roomId: z.string().min(1).optional(),\n controllerJoinUrl: z.string().url().optional(),\n controllerId: z.string().min(3).optional(),\n deviceId: z.string().min(8).optional(),\n nickname: z.string().min(1).optional(),\n avatarId: z.string().min(1).optional(),\n capabilityToken: z.string().min(1).optional(),\n timeoutMs: z.number().int().positive().optional(),\n });\n\nexport const buildToolDefinitions = ({\n projectMode,\n}: {\n projectMode: AirJamProjectMode;\n}): Record<string, AirJamMcpToolDefinition> => {\n const runQualityGateInputSchema = buildQualityGateSchema(projectMode);\n const startDevInputSchema = buildStartDevSchema(projectMode);\n const topologyInputSchema = buildTopologySchema(projectMode);\n const inspectGameAgentContractInputSchema = z.object({\n cwd: z.string().optional(),\n gameId: z.string().optional(),\n });\n const openGameSessionInputSchema = buildConnectControllerSchema(projectMode);\n const captureGameSessionInputSchema = z.object({\n gameSessionId: z.string().uuid(),\n timeoutMs: z.number().int().positive().optional(),\n });\n const gameSessionInputSchema = z.object({\n gameSessionId: z.string().min(1),\n });\n const sendGameSessionInputSchema = gameSessionInputSchema.extend({\n input: z.record(z.string(), z.unknown()),\n });\n const readGameSessionInputSchema = gameSessionInputSchema.extend({\n requestSync: z.boolean().optional(),\n timeoutMs: z.number().int().positive().optional(),\n });\n const invokeGameSessionActionInputSchema = gameSessionInputSchema.extend({\n actionId: z.string().min(1),\n payload: z.unknown().optional(),\n timeoutMs: z.number().int().positive().optional(),\n });\n\n return {\n \"airjam.inspect_project\": {\n description:\n \"Inspect the current Air Jam project, detect monorepo vs standalone mode, and list available Air Jam capability groups.\",\n inputSchema: z.object({\n cwd: z.string().optional(),\n }),\n run: async ({ cwd }: { cwd?: string }) =>\n withJsonText(await inspectProject({ cwd })),\n },\n \"airjam.list_games\": {\n description:\n \"List Air Jam games visible from the current project. In the monorepo this returns first-party repo games; in a generated project it returns the current game.\",\n inputSchema: z.object({\n cwd: z.string().optional(),\n }),\n run: async ({ cwd }: { cwd?: string }) =>\n withJsonText(await listGames({ cwd })),\n },\n \"airjam.inspect_game\": {\n description:\n \"Inspect one Air Jam game, including config path, inferred controller route, agent-facing metadata, and available quality gates.\",\n inputSchema: INSPECT_GAME_INPUT_SCHEMA,\n run: async ({ cwd, gameId }: { cwd?: string; gameId?: string }) =>\n withJsonText(await inspectGame({ cwd, gameId })),\n },\n \"airjam.inspect_game_agent_contract\": {\n description:\n \"Inspect one game's agent contract, including game-specific snapshot description and semantic controller action metadata.\",\n inputSchema: inspectGameAgentContractInputSchema,\n run: async ({ cwd, gameId }: { cwd?: string; gameId?: string }) =>\n withJsonText(await inspectGameAgentContract({ cwd, gameId })),\n },\n \"airjam.read_logs\": {\n description:\n \"Read the canonical Air Jam unified dev log stream. Start with view=signal and a bounded tail before adding more filters.\",\n inputSchema: READ_LOGS_INPUT_SCHEMA,\n run: async (input: z.infer<typeof READ_LOGS_INPUT_SCHEMA>) =>\n withJsonText(await readDevLogs({ ...input, tail: input.tail ?? 200 })),\n },\n \"airjam.run_quality_gate\": {\n description:\n \"Run one Air Jam quality gate such as typecheck, test, or build.\",\n inputSchema: runQualityGateInputSchema,\n run: async (input: z.infer<typeof runQualityGateInputSchema>) =>\n withJsonText(await runQualityGate(input)),\n },\n \"airjam.evaluate\": {\n description:\n \"Run the complete Air Jam game evaluation: typecheck, lint, tests, and a production build. Returns every gate result in one stable document.\",\n inputSchema: z.object({ cwd: z.string().optional() }),\n run: async ({ cwd }: { cwd?: string }) =>\n withJsonText(await runCompleteEvaluation({ cwd })),\n },\n \"airjam.auth_status\": {\n description:\n \"Inspect the locally stored Air Jam platform machine session used for hosted release operations.\",\n inputSchema: z.object({}),\n run: async () => withJsonText(await getPlatformMachineAuthStatus()),\n },\n \"airjam.release_doctor\": {\n description:\n \"Inspect a standalone Air Jam game project for hosted release readiness and return structured local doctor output.\",\n inputSchema: RELEASE_PROJECT_INPUT_SCHEMA,\n run: async ({\n cwd,\n distDir,\n }: z.infer<typeof RELEASE_PROJECT_INPUT_SCHEMA>) =>\n withJsonText(await inspectLocalRelease({ cwd, distDir })),\n },\n \"airjam.release_validate\": {\n description:\n \"Validate hosted release inputs for a standalone Air Jam game project or an existing hosted release zip.\",\n inputSchema: RELEASE_VALIDATE_INPUT_SCHEMA,\n run: async ({\n cwd,\n distDir,\n bundle,\n skipBuild,\n }: z.infer<typeof RELEASE_VALIDATE_INPUT_SCHEMA>) =>\n withJsonText(\n await validateLocalRelease({\n cwd,\n distDir,\n bundlePath: bundle,\n skipBuild,\n }),\n ),\n },\n \"airjam.release_bundle\": {\n description:\n \"Build and bundle a hosted release zip from a standalone Air Jam game project.\",\n inputSchema: RELEASE_BUNDLE_INPUT_SCHEMA,\n execution: {\n taskSupport: \"required\",\n },\n run: async ({\n cwd,\n distDir,\n out,\n skipBuild,\n }: z.infer<typeof RELEASE_BUNDLE_INPUT_SCHEMA>) =>\n withJsonText(\n await bundleLocalRelease({\n cwd,\n distDir,\n out,\n skipBuild,\n }),\n ),\n },\n \"airjam.release_list\": {\n description:\n \"List owned hosted games or, when given a game slug or id, list its hosted releases.\",\n inputSchema: RELEASE_LIST_INPUT_SCHEMA,\n run: async ({\n platformUrl,\n game,\n }: z.infer<typeof RELEASE_LIST_INPUT_SCHEMA>) =>\n withJsonText(\n game\n ? await listPlatformReleases({\n platformUrl,\n slugOrId: game,\n })\n : await listPlatformReleaseTargets({\n platformUrl,\n }),\n ),\n },\n \"airjam.release_inspect\": {\n description: \"Inspect one hosted release on the Air Jam platform.\",\n inputSchema: RELEASE_INSPECT_INPUT_SCHEMA,\n run: async ({\n platformUrl,\n releaseId,\n }: z.infer<typeof RELEASE_INSPECT_INPUT_SCHEMA>) =>\n withJsonText(\n await inspectPlatformRelease({\n platformUrl,\n releaseId,\n }),\n ),\n },\n \"airjam.release_upload\": {\n description:\n \"Upload an existing hosted release zip as a new immutable generation and return the exact generation needed for resumable finalization.\",\n inputSchema: RELEASE_UPLOAD_INPUT_SCHEMA,\n execution: {\n taskSupport: \"required\",\n },\n run: async ({\n platformUrl,\n releaseId,\n cwd,\n bundle,\n }: z.infer<typeof RELEASE_UPLOAD_INPUT_SCHEMA>) =>\n withJsonText(\n await uploadPlatformReleaseGeneration({\n platformUrl,\n releaseId,\n cwd,\n bundlePath: bundle,\n }),\n ),\n },\n \"airjam.release_finalize\": {\n description:\n \"Durably enqueue processing for one exact immutable hosted release generation and return its job; use release inspection to follow or recover it.\",\n inputSchema: RELEASE_FINALIZE_INPUT_SCHEMA,\n run: async ({\n platformUrl,\n releaseId,\n generationId,\n }: z.infer<typeof RELEASE_FINALIZE_INPUT_SCHEMA>) =>\n withJsonText(\n await finalizePlatformReleaseGeneration({\n platformUrl,\n releaseId,\n generationId,\n }),\n ),\n },\n \"airjam.release_export\": {\n description:\n \"Download one exact immutable hosted release generation without overwriting an existing local archive.\",\n inputSchema: RELEASE_EXPORT_INPUT_SCHEMA,\n execution: {\n taskSupport: \"required\",\n },\n run: async ({\n platformUrl,\n releaseId,\n generationId,\n cwd,\n out,\n }: z.infer<typeof RELEASE_EXPORT_INPUT_SCHEMA>) =>\n withJsonText(\n await exportPlatformReleaseGeneration({\n platformUrl,\n releaseId,\n generationId,\n cwd,\n out,\n }),\n ),\n },\n \"airjam.release_submit\": {\n description:\n \"Bundle a standalone Air Jam game if needed, upload it as a hosted release draft, enqueue durable processing, optionally wait, and optionally publish after readiness.\",\n inputSchema: RELEASE_SUBMIT_INPUT_SCHEMA,\n execution: {\n taskSupport: \"required\",\n },\n run: async ({\n platformUrl,\n game,\n versionLabel,\n cwd,\n distDir,\n bundle,\n skipBuild,\n waitForProcessing,\n processingTimeoutSeconds,\n publish,\n }: z.infer<typeof RELEASE_SUBMIT_INPUT_SCHEMA>) =>\n withJsonText(\n await submitPlatformRelease({\n platformUrl,\n slugOrId: game,\n versionLabel,\n cwd,\n distDir,\n bundlePath: bundle,\n skipBuild,\n waitForProcessing,\n ...(processingTimeoutSeconds === undefined\n ? {}\n : { processingTimeoutMs: processingTimeoutSeconds * 1_000 }),\n publish,\n }),\n ),\n },\n \"airjam.release_publish\": {\n description: \"Publish one ready hosted release on the Air Jam platform.\",\n inputSchema: RELEASE_PUBLISH_INPUT_SCHEMA,\n run: async ({\n platformUrl,\n releaseId,\n }: z.infer<typeof RELEASE_PUBLISH_INPUT_SCHEMA>) =>\n withJsonText(\n await publishPlatformRelease({\n platformUrl,\n releaseId,\n }),\n ),\n },\n \"airjam.start_dev\": {\n description:\n \"Start the Air Jam local dev stack for the current project and return the managed process id plus resolved topology.\",\n inputSchema: startDevInputSchema,\n run: async (input: z.infer<typeof startDevInputSchema>) =>\n withJsonText(await startDev(input)),\n },\n \"airjam.stop_dev\": {\n description:\n \"Stop one or more Air Jam dev processes previously started by devtools.\",\n inputSchema: STOP_DEV_INPUT_SCHEMA,\n run: async (input: z.infer<typeof STOP_DEV_INPUT_SCHEMA>) =>\n withJsonText(await stopDev(input)),\n },\n \"airjam.status\": {\n description:\n \"List Air Jam dev processes plus unmanaged listeners on known local Air Jam ports.\",\n inputSchema: z.object({\n cwd: z.string().optional(),\n }),\n run: async ({ cwd }: { cwd?: string }) =>\n withJsonText(await getDevStatus({ cwd })),\n },\n \"airjam.reset_local\": {\n description:\n \"Best-effort cleanup for local Air Jam dev state: stop managed dev processes and stale known-port Air Jam listeners.\",\n inputSchema: z.object({\n cwd: z.string().optional(),\n }),\n run: async ({ cwd }: { cwd?: string }) =>\n withJsonText(await resetLocalDev({ cwd })),\n },\n \"airjam.topology\": {\n description:\n \"Return the resolved runtime topology and endpoint summary for the current project mode.\",\n inputSchema: topologyInputSchema,\n run: async (input: z.infer<typeof topologyInputSchema>) =>\n withJsonText(await getTopology(input)),\n },\n \"airjam.open_game_session\": {\n description:\n \"Open one high-level Air Jam game session by connecting a virtual controller and discovering published semantic game actions for the same room.\",\n inputSchema: openGameSessionInputSchema,\n run: async (input: z.infer<typeof openGameSessionInputSchema>) =>\n withJsonText(await openGameSession(input)),\n },\n \"airjam.send_game_session_input\": {\n description:\n \"Send one real player-style input payload through a previously opened Air Jam game session.\",\n inputSchema: sendGameSessionInputSchema,\n run: async (input: z.infer<typeof sendGameSessionInputSchema>) =>\n withJsonText(await sendGameSessionInput(input)),\n },\n \"airjam.read_game_session\": {\n description:\n \"Read one high-level Air Jam game session, including runtime controller state plus any available semantic game snapshot.\",\n inputSchema: readGameSessionInputSchema,\n run: async (input: z.infer<typeof readGameSessionInputSchema>) =>\n withJsonText(await readGameSession(input)),\n },\n \"airjam.invoke_game_session_action\": {\n description:\n \"Invoke one discovered game-session action by its unified session action id, without manually choosing between player-semantic and host-staging internals.\",\n inputSchema: invokeGameSessionActionInputSchema,\n run: async (input: z.infer<typeof invokeGameSessionActionInputSchema>) =>\n withJsonText(await invokeGameSessionAction(input)),\n },\n \"airjam.capture_game_session_visuals\": {\n description:\n \"Capture canonical host and controller screenshots from the browser runtime owned by an open game session.\",\n inputSchema: captureGameSessionInputSchema,\n run: async (input: z.infer<typeof captureGameSessionInputSchema>) =>\n withJsonText(await captureGameSessionVisuals(input)),\n },\n \"airjam.close_game_session\": {\n description:\n \"Close one previously opened Air Jam game session and disconnect its virtual controller.\",\n inputSchema: gameSessionInputSchema,\n run: async ({ gameSessionId }: { gameSessionId: string }) =>\n withJsonText(await closeGameSession({ gameSessionId })),\n },\n } as const;\n};\n\nexport type AirJamMcpToolDefinitions = ReturnType<typeof buildToolDefinitions>;\n\nexport const getRegisteredToolNamesForProjectMode = (\n projectMode: AirJamProjectMode,\n): ReadonlyArray<keyof AirJamMcpToolDefinitions> => {\n const mode =\n projectMode === \"monorepo\" || projectMode === \"standalone-game\"\n ? projectMode\n : \"unknown\";\n return toolContract[mode] as ReadonlyArray<keyof AirJamMcpToolDefinitions>;\n};\n","{\n \"monorepo\": [\n \"airjam.inspect_project\",\n \"airjam.auth_status\",\n \"airjam.list_games\",\n \"airjam.inspect_game\",\n \"airjam.inspect_game_agent_contract\",\n \"airjam.read_logs\",\n \"airjam.run_quality_gate\",\n \"airjam.evaluate\",\n \"airjam.release_list\",\n \"airjam.release_inspect\",\n \"airjam.release_upload\",\n \"airjam.release_finalize\",\n \"airjam.release_export\",\n \"airjam.release_publish\",\n \"airjam.start_dev\",\n \"airjam.stop_dev\",\n \"airjam.status\",\n \"airjam.reset_local\",\n \"airjam.topology\",\n \"airjam.open_game_session\",\n \"airjam.send_game_session_input\",\n \"airjam.read_game_session\",\n \"airjam.invoke_game_session_action\",\n \"airjam.capture_game_session_visuals\",\n \"airjam.close_game_session\"\n ],\n \"standalone-game\": [\n \"airjam.inspect_project\",\n \"airjam.auth_status\",\n \"airjam.list_games\",\n \"airjam.inspect_game\",\n \"airjam.inspect_game_agent_contract\",\n \"airjam.read_logs\",\n \"airjam.run_quality_gate\",\n \"airjam.evaluate\",\n \"airjam.release_doctor\",\n \"airjam.release_validate\",\n \"airjam.release_bundle\",\n \"airjam.release_list\",\n \"airjam.release_inspect\",\n \"airjam.release_upload\",\n \"airjam.release_finalize\",\n \"airjam.release_export\",\n \"airjam.release_submit\",\n \"airjam.release_publish\",\n \"airjam.start_dev\",\n \"airjam.stop_dev\",\n \"airjam.status\",\n \"airjam.reset_local\",\n \"airjam.topology\",\n \"airjam.open_game_session\",\n \"airjam.send_game_session_input\",\n \"airjam.read_game_session\",\n \"airjam.invoke_game_session_action\",\n \"airjam.capture_game_session_visuals\",\n \"airjam.close_game_session\"\n ],\n \"unknown\": [\"airjam.inspect_project\"]\n}\n","import fs from \"node:fs\";\n\ntype PackageManifest = {\n version?: unknown;\n};\n\nconst manifest = JSON.parse(\n fs.readFileSync(new URL(\"../package.json\", import.meta.url), \"utf8\"),\n) as PackageManifest;\n\nif (typeof manifest.version !== \"string\" || manifest.version.length === 0) {\n throw new Error(\"@air-jam/mcp-server package version is missing.\");\n}\n\nexport const AIR_JAM_MCP_SERVER_VERSION = manifest.version;\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;;;ACRP,SAAS,4BAA4B;AAKrC,SAAS,yBAAyB;AAClC,SAAS,iBAAiB;;;ACN1B,SAAS,gCAAgC;AACzC,SAAS,sBAAsB;AAC/B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,aAAa,iBAAiB;AACvC,SAAS,mBAAmB;AAC5B,SAAS,oCAAoC;AAC7C;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,SAAS;;;ACtClB;AAAA,EACE,UAAY;AAAA,IACV;AAAA,IACA;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OAAO,SAC/C,KAAK,IAAI,IAAa;AAAA,IACxB;AAAA,EACF;AAEA,SAAO;AACT;","names":["taskStore"]}
|
|
1
|
+
{"version":3,"sources":["../src/config.ts","../src/server.ts","../src/tools.ts","../tool-contract.json","../src/version.ts"],"sourcesContent":["export {\n AIRJAM_CODEX_PROJECT_MCP_FILE,\n AIRJAM_PROJECT_MCP_FILE,\n createAirJamMcpServerDeclaration,\n createProjectLocalMcpConfig,\n inspectMcpProjectSetup,\n renderMcpClientProfile,\n writeProjectLocalMcpConfig,\n} from \"@air-jam/devtools/mcp-config\";\nexport type {\n AirJamMcpClientProfile,\n AirJamMcpClientProfileRender,\n AirJamMcpRegistrationInspection,\n AirJamMcpServerDeclaration,\n AirJamProjectLocalMcpConfig,\n InspectMcpProjectSetupResult,\n} from \"@air-jam/devtools/mcp-config\";\n","import { detectProjectContext } from \"@air-jam/devtools/context\";\nimport type {\n CreateTaskRequestHandlerExtra,\n TaskRequestHandlerExtra,\n} from \"@modelcontextprotocol/sdk/experimental/tasks\";\nimport { InMemoryTaskStore } from \"@modelcontextprotocol/sdk/experimental/tasks\";\nimport { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport type { CallToolResult } from \"@modelcontextprotocol/sdk/types.js\";\nimport {\n buildToolDefinitions,\n getRegisteredToolNamesForProjectMode,\n} from \"./tools.js\";\nimport { AIR_JAM_MCP_SERVER_VERSION } from \"./version.js\";\n\nconst DEFAULT_TASK_TTL_MS = 5 * 60 * 1000;\nconst TASK_CAPABLE_CLIENT_NOTE =\n \" Requires an MCP client with task-backed tool execution support.\";\n\nconst describeToolForRegistration = ({\n description,\n requiresTaskSupport,\n}: {\n description: string;\n requiresTaskSupport: boolean;\n}): string =>\n requiresTaskSupport\n ? `${description}${TASK_CAPABLE_CLIENT_NOTE}`\n : description;\n\nconst createToolErrorResult = (error: unknown): CallToolResult => ({\n content: [\n {\n type: \"text\",\n text:\n error instanceof Error\n ? error.message\n : `Air Jam MCP task failed: ${String(error)}`,\n },\n ],\n isError: true,\n});\n\n/**\n * Tools an embedding application replaces when it owns the game room: it runs\n * the development server, hosts the game and admits test runs into that room,\n * so agents never start another host, dev server or run of their own.\n */\nconst EMBEDDED_ROOM_OMITTED_TOOLS = new Set([\n \"airjam.start_dev\",\n \"airjam.stop_dev\",\n \"airjam.reset_local\",\n \"airjam.start_game_run\",\n \"airjam.stop_game_run\",\n \"airjam.steer_game_run\",\n \"airjam.open_game_session\",\n \"airjam.control_game_session_participant\",\n \"airjam.send_game_session_input\",\n \"airjam.read_game_session\",\n \"airjam.observe_game_session\",\n \"airjam.read_game_settings\",\n \"airjam.update_game_settings\",\n \"airjam.invoke_game_session_action\",\n \"airjam.capture_game_session_visuals\",\n \"airjam.close_game_session\",\n]);\n\nexport const createAirJamMcpServer = async ({\n cwd = process.cwd(),\n embeddedRoom = false,\n}: {\n cwd?: string;\n embeddedRoom?: boolean;\n} = {}): Promise<McpServer> => {\n const context = await detectProjectContext({ cwd });\n const toolDefinitions = buildToolDefinitions({\n projectMode: context.mode,\n });\n const registeredToolNames = getRegisteredToolNamesForProjectMode(\n context.mode,\n );\n const taskStore = new InMemoryTaskStore();\n const server = new McpServer(\n {\n name: \"air-jam\",\n version: AIR_JAM_MCP_SERVER_VERSION,\n },\n {\n capabilities: {\n tasks: {\n list: {},\n cancel: {},\n requests: {\n tools: {\n call: {},\n },\n },\n },\n },\n instructions:\n \"Use Air Jam tools before falling back to raw shell commands for Air Jam-native workflows. Start with inspect_project, read_logs with view=signal, and inspect_game when debugging runtime or game issues. If a tool advertises task-backed execution support as required, call it through an MCP client flow that supports tasks instead of assuming one blocking request/response call.\",\n taskStore,\n },\n );\n\n for (const toolName of registeredToolNames) {\n if (embeddedRoom && EMBEDDED_ROOM_OMITTED_TOOLS.has(toolName)) continue;\n const tool = toolDefinitions[toolName];\n const description = describeToolForRegistration({\n description: tool.description,\n requiresTaskSupport: tool.execution?.taskSupport === \"required\",\n });\n const baseConfig = {\n description,\n inputSchema: tool.inputSchema,\n };\n\n if (tool.execution?.taskSupport === \"required\") {\n server.experimental.tasks.registerToolTask(\n toolName,\n {\n ...baseConfig,\n execution: {\n taskSupport: \"required\",\n },\n },\n {\n createTask: async (\n args: unknown,\n { taskStore, taskRequestedTtl }: CreateTaskRequestHandlerExtra,\n ) => {\n const task = await taskStore.createTask({\n ttl: taskRequestedTtl ?? DEFAULT_TASK_TTL_MS,\n });\n\n void (async () => {\n try {\n const result = await tool.run(args as never);\n await taskStore.storeTaskResult(\n task.taskId,\n \"completed\",\n result,\n );\n } catch (error) {\n await taskStore.storeTaskResult(\n task.taskId,\n \"failed\",\n createToolErrorResult(error),\n );\n }\n })();\n\n return { task };\n },\n getTask: async (\n _args: unknown,\n { taskId, taskStore }: TaskRequestHandlerExtra,\n ) => taskStore.getTask(taskId),\n getTaskResult: async (\n _args: unknown,\n { taskId, taskStore }: TaskRequestHandlerExtra,\n ) => taskStore.getTaskResult(taskId) as Promise<CallToolResult>,\n },\n );\n continue;\n }\n\n server.registerTool(toolName, baseConfig, async (args: unknown) =>\n tool.run(args as never),\n );\n }\n\n return server;\n};\n","import { inspectProject } from \"@air-jam/devtools/context\";\nimport {\n getDevStatus,\n getTopology,\n resetLocalDev,\n startDev,\n stopDev,\n} from \"@air-jam/devtools/dev\";\nimport {\n gameRunAddressSchema,\n gameRunDiscoverySchema,\n gameRunSteerSchema,\n gameRunWaitSchema,\n startGameRunSchema,\n startPlayGameRunSchema,\n startTestGameRunSchema,\n} from \"@air-jam/devtools/game-runs\";\nimport {\n captureGameSessionVisuals,\n closeGameSession,\n controlGameSessionParticipant,\n gameSessionOperationSchemas,\n invokeGameSessionAction,\n listGameRuns,\n listGameTestProfiles,\n observeGameSession,\n openGameSession,\n readGameRun,\n readGameSession,\n readGameSettings,\n replayGameRun,\n sendGameSessionInput,\n startGameRun,\n steerGameRun,\n stopGameRun,\n updateGameSettings,\n waitGameRun,\n} from \"@air-jam/devtools/game-session\";\nimport { inspectGame, listGames } from \"@air-jam/devtools/games\";\nimport { readDevLogs } from \"@air-jam/devtools/logs\";\nimport { getPlatformMachineAuthStatus } from \"@air-jam/devtools/platform-auth\";\nimport {\n runCompleteEvaluation,\n runQualityGate,\n} from \"@air-jam/devtools/quality\";\nimport {\n archivePlatformRelease,\n bundleLocalRelease,\n exportPlatformReleaseGeneration,\n finalizePlatformReleaseGeneration,\n inspectLocalRelease,\n inspectPlatformRelease,\n listPlatformReleaseTargets,\n listPlatformReleases,\n publishPlatformRelease,\n submitPlatformRelease,\n uploadPlatformReleaseGeneration,\n validateLocalRelease,\n} from \"@air-jam/devtools/release\";\nimport type {\n CallToolResult,\n ToolExecution,\n} from \"@modelcontextprotocol/sdk/types.js\";\nimport { z } from \"zod\";\nimport toolContract from \"../tool-contract.json\" with { type: \"json\" };\n\ntype AirJamProjectMode = \"monorepo\" | \"standalone-game\" | \"unknown\";\ntype AirJamQualityGate =\n | \"typecheck\"\n | \"lint\"\n | \"test\"\n | \"build\"\n | \"format-check\"\n | \"scaffold-smoke\"\n | \"release-check\";\n\nexport type AirJamMcpToolDefinition = {\n description: string;\n inputSchema: z.ZodTypeAny;\n run: (args: never) => Promise<Pick<CallToolResult, \"content\">>;\n execution?: ToolExecution;\n};\n\nconst withJsonText = <T>(value: T) => ({\n content: [\n {\n type: \"text\" as const,\n text: JSON.stringify(value, null, 2),\n },\n ],\n});\n\nconst buildQualityGateSchema = (projectMode: AirJamProjectMode) =>\n z.object({\n cwd: z.string().optional(),\n gate:\n projectMode === \"monorepo\"\n ? z.enum([\n \"typecheck\",\n \"lint\",\n \"test\",\n \"build\",\n \"format-check\",\n \"scaffold-smoke\",\n \"release-check\",\n ] satisfies [AirJamQualityGate, ...AirJamQualityGate[]])\n : z.enum([\n \"typecheck\",\n \"lint\",\n \"test\",\n \"build\",\n \"format-check\",\n ] satisfies [AirJamQualityGate, ...AirJamQualityGate[]]),\n packageFilter: z.string().optional(),\n });\n\nconst buildStartDevSchema = (projectMode: AirJamProjectMode) =>\n z.object({\n cwd: z.string().optional(),\n gameId: z.string().optional(),\n mode:\n projectMode === \"monorepo\"\n ? z.enum([\"standalone-dev\", \"arcade-dev\", \"arcade-test\"]).optional()\n : z.literal(\"standalone-dev\").optional(),\n secure: z.boolean().optional(),\n });\n\nconst buildTopologySchema = (projectMode: AirJamProjectMode) =>\n z.object({\n cwd: z.string().optional(),\n gameId: z.string().optional(),\n mode:\n projectMode === \"monorepo\"\n ? z.enum([\"standalone-dev\", \"arcade-dev\", \"arcade-test\"]).optional()\n : z.literal(\"standalone-dev\").optional(),\n secure: z.boolean().optional(),\n });\n\nconst buildGameSessionModeSchema = (projectMode: AirJamProjectMode) =>\n projectMode === \"monorepo\"\n ? z.enum([\"standalone-dev\", \"arcade-dev\", \"arcade-test\"]).optional()\n : z.literal(\"standalone-dev\").optional();\n\nconst RELEASE_PROJECT_INPUT_SCHEMA = z.object({\n cwd: z.string().optional(),\n distDir: z.string().optional(),\n});\n\nconst RELEASE_PLATFORM_INPUT_SCHEMA = z.object({\n platformUrl: z.string().url().optional(),\n});\n\nconst RELEASE_VALIDATE_INPUT_SCHEMA = RELEASE_PROJECT_INPUT_SCHEMA.extend({\n bundle: z.string().optional(),\n skipBuild: z.boolean().optional(),\n});\n\nconst RELEASE_BUNDLE_INPUT_SCHEMA = RELEASE_PROJECT_INPUT_SCHEMA.extend({\n out: z.string().optional(),\n skipBuild: z.boolean().optional(),\n});\n\nconst RELEASE_LIST_INPUT_SCHEMA = RELEASE_PLATFORM_INPUT_SCHEMA.extend({\n game: z.string().optional(),\n});\n\nconst RELEASE_INSPECT_INPUT_SCHEMA = RELEASE_PLATFORM_INPUT_SCHEMA.extend({\n releaseId: z.string().min(1),\n});\n\nconst RELEASE_SUBMIT_INPUT_SCHEMA = RELEASE_PLATFORM_INPUT_SCHEMA.extend({\n game: z.string().min(1),\n versionLabel: z.string().optional(),\n cwd: z.string().optional(),\n distDir: z.string().optional(),\n bundle: z.string().optional(),\n skipBuild: z.boolean().optional(),\n waitForProcessing: z.boolean().optional(),\n processingTimeoutSeconds: z.number().int().min(1).max(3_600).optional(),\n publish: z.boolean().optional(),\n});\n\nconst RELEASE_UPLOAD_INPUT_SCHEMA = RELEASE_PLATFORM_INPUT_SCHEMA.extend({\n releaseId: z.string().min(1),\n cwd: z.string().optional(),\n bundle: z.string().min(1),\n});\n\nconst RELEASE_FINALIZE_INPUT_SCHEMA = RELEASE_PLATFORM_INPUT_SCHEMA.extend({\n releaseId: z.string().min(1),\n generationId: z.string().min(1),\n});\n\nconst RELEASE_EXPORT_INPUT_SCHEMA = RELEASE_PLATFORM_INPUT_SCHEMA.extend({\n releaseId: z.string().min(1),\n generationId: z.string().min(1),\n cwd: z.string().optional(),\n out: z.string().optional(),\n});\n\nconst RELEASE_MUTATION_INPUT_SCHEMA = RELEASE_PLATFORM_INPUT_SCHEMA.extend({\n releaseId: z.string().min(1),\n});\n\nexport const READ_LOGS_INPUT_SCHEMA = z.object({\n cwd: z.string().optional(),\n view: z.string().optional(),\n source: z.string().optional(),\n trace: z.string().optional(),\n room: z.string().optional(),\n controller: z.string().optional(),\n event: z.string().optional(),\n process: z.string().optional(),\n level: z.string().optional(),\n runtime: z.string().optional(),\n epoch: z.number().int().optional(),\n consoleCategory: z.string().optional(),\n file: z.string().optional(),\n tail: z.number().int().nonnegative().optional(),\n});\n\nexport const INSPECT_GAME_INPUT_SCHEMA = z.object({\n cwd: z.string().optional(),\n gameId: z.string().optional(),\n});\n\nexport const STOP_DEV_INPUT_SCHEMA = z.object({\n cwd: z.string().optional(),\n processId: z.string().optional(),\n mode: z.enum([\"standalone-dev\", \"arcade-dev\", \"arcade-test\"]).optional(),\n});\n\nexport const buildToolDefinitions = ({\n projectMode,\n}: {\n projectMode: AirJamProjectMode;\n}): Record<string, AirJamMcpToolDefinition> => {\n const runQualityGateInputSchema = buildQualityGateSchema(projectMode);\n const startDevInputSchema = buildStartDevSchema(projectMode);\n const topologyInputSchema = buildTopologySchema(projectMode);\n const openGameSessionInputSchema = gameSessionOperationSchemas.open.extend({\n mode: buildGameSessionModeSchema(projectMode),\n });\n const captureGameSessionInputSchema = gameSessionOperationSchemas.capture;\n const gameSessionInputSchema = gameSessionOperationSchemas.close;\n const sendGameSessionInputSchema = gameSessionOperationSchemas.input;\n const readGameSessionInputSchema = gameSessionOperationSchemas.read;\n const observeGameSessionInputSchema = gameSessionOperationSchemas.observe;\n const invokeGameSessionActionInputSchema = gameSessionOperationSchemas.invoke;\n\n return {\n \"airjam.inspect_project\": {\n description:\n \"Inspect the current Air Jam project, detect monorepo vs standalone mode, and list available Air Jam capability groups.\",\n inputSchema: z.object({\n cwd: z.string().optional(),\n }),\n run: async ({ cwd }: { cwd?: string }) =>\n withJsonText(await inspectProject({ cwd })),\n },\n \"airjam.list_games\": {\n description:\n \"List Air Jam games visible from the current project. In the monorepo this returns first-party repo games; in a generated project it returns the current game.\",\n inputSchema: z.object({\n cwd: z.string().optional(),\n }),\n run: async ({ cwd }: { cwd?: string }) =>\n withJsonText(await listGames({ cwd })),\n },\n \"airjam.inspect_game\": {\n description:\n \"Inspect one Air Jam game, including config path, inferred controller route, agent-facing metadata, and available quality gates.\",\n inputSchema: INSPECT_GAME_INPUT_SCHEMA,\n run: async ({ cwd, gameId }: { cwd?: string; gameId?: string }) =>\n withJsonText(await inspectGame({ cwd, gameId })),\n },\n \"airjam.read_logs\": {\n description:\n \"Read the canonical Air Jam unified dev log stream. Start with view=signal and a bounded tail before adding more filters.\",\n inputSchema: READ_LOGS_INPUT_SCHEMA,\n run: async (input: z.infer<typeof READ_LOGS_INPUT_SCHEMA>) =>\n withJsonText(await readDevLogs({ ...input, tail: input.tail ?? 200 })),\n },\n \"airjam.run_quality_gate\": {\n description:\n \"Run one Air Jam quality gate such as typecheck, test, or build.\",\n inputSchema: runQualityGateInputSchema,\n run: async (input: z.infer<typeof runQualityGateInputSchema>) =>\n withJsonText(await runQualityGate(input)),\n },\n \"airjam.evaluate\": {\n description:\n \"Run the complete Air Jam game evaluation: typecheck, lint, tests, and a production build. Returns every gate result in one stable document.\",\n inputSchema: z.object({ cwd: z.string().optional() }),\n run: async ({ cwd }: { cwd?: string }) =>\n withJsonText(await runCompleteEvaluation({ cwd })),\n },\n \"airjam.auth_status\": {\n description:\n \"Inspect the locally stored Air Jam platform machine session used for hosted release operations.\",\n inputSchema: z.object({}),\n run: async () => withJsonText(await getPlatformMachineAuthStatus()),\n },\n \"airjam.release_doctor\": {\n description:\n \"Inspect a standalone Air Jam game project for hosted release readiness and return structured local doctor output.\",\n inputSchema: RELEASE_PROJECT_INPUT_SCHEMA,\n run: async ({\n cwd,\n distDir,\n }: z.infer<typeof RELEASE_PROJECT_INPUT_SCHEMA>) =>\n withJsonText(await inspectLocalRelease({ cwd, distDir })),\n },\n \"airjam.release_validate\": {\n description:\n \"Validate hosted release inputs for a standalone Air Jam game project or an existing hosted release zip.\",\n inputSchema: RELEASE_VALIDATE_INPUT_SCHEMA,\n run: async ({\n cwd,\n distDir,\n bundle,\n skipBuild,\n }: z.infer<typeof RELEASE_VALIDATE_INPUT_SCHEMA>) =>\n withJsonText(\n await validateLocalRelease({\n cwd,\n distDir,\n bundlePath: bundle,\n skipBuild,\n }),\n ),\n },\n \"airjam.release_bundle\": {\n description:\n \"Build and bundle a hosted release zip from a standalone Air Jam game project.\",\n inputSchema: RELEASE_BUNDLE_INPUT_SCHEMA,\n execution: {\n taskSupport: \"required\",\n },\n run: async ({\n cwd,\n distDir,\n out,\n skipBuild,\n }: z.infer<typeof RELEASE_BUNDLE_INPUT_SCHEMA>) =>\n withJsonText(\n await bundleLocalRelease({\n cwd,\n distDir,\n out,\n skipBuild,\n }),\n ),\n },\n \"airjam.release_list\": {\n description:\n \"List owned hosted games or, when given a game slug or id, list its hosted releases.\",\n inputSchema: RELEASE_LIST_INPUT_SCHEMA,\n run: async ({\n platformUrl,\n game,\n }: z.infer<typeof RELEASE_LIST_INPUT_SCHEMA>) =>\n withJsonText(\n game\n ? await listPlatformReleases({\n platformUrl,\n slugOrId: game,\n })\n : await listPlatformReleaseTargets({\n platformUrl,\n }),\n ),\n },\n \"airjam.release_inspect\": {\n description: \"Inspect one hosted release on the Air Jam platform.\",\n inputSchema: RELEASE_INSPECT_INPUT_SCHEMA,\n run: async ({\n platformUrl,\n releaseId,\n }: z.infer<typeof RELEASE_INSPECT_INPUT_SCHEMA>) =>\n withJsonText(\n await inspectPlatformRelease({\n platformUrl,\n releaseId,\n }),\n ),\n },\n \"airjam.release_upload\": {\n description:\n \"Upload an existing hosted release zip as a new immutable generation and return the exact generation needed for resumable finalization.\",\n inputSchema: RELEASE_UPLOAD_INPUT_SCHEMA,\n execution: {\n taskSupport: \"required\",\n },\n run: async ({\n platformUrl,\n releaseId,\n cwd,\n bundle,\n }: z.infer<typeof RELEASE_UPLOAD_INPUT_SCHEMA>) =>\n withJsonText(\n await uploadPlatformReleaseGeneration({\n platformUrl,\n releaseId,\n cwd,\n bundlePath: bundle,\n }),\n ),\n },\n \"airjam.release_finalize\": {\n description:\n \"Durably enqueue processing for one exact immutable hosted release generation and return its job; use release inspection to follow or recover it.\",\n inputSchema: RELEASE_FINALIZE_INPUT_SCHEMA,\n run: async ({\n platformUrl,\n releaseId,\n generationId,\n }: z.infer<typeof RELEASE_FINALIZE_INPUT_SCHEMA>) =>\n withJsonText(\n await finalizePlatformReleaseGeneration({\n platformUrl,\n releaseId,\n generationId,\n }),\n ),\n },\n \"airjam.release_export\": {\n description:\n \"Download one exact immutable hosted release generation without overwriting an existing local archive.\",\n inputSchema: RELEASE_EXPORT_INPUT_SCHEMA,\n execution: {\n taskSupport: \"required\",\n },\n run: async ({\n platformUrl,\n releaseId,\n generationId,\n cwd,\n out,\n }: z.infer<typeof RELEASE_EXPORT_INPUT_SCHEMA>) =>\n withJsonText(\n await exportPlatformReleaseGeneration({\n platformUrl,\n releaseId,\n generationId,\n cwd,\n out,\n }),\n ),\n },\n \"airjam.release_submit\": {\n description:\n \"Bundle a standalone Air Jam game if needed, upload it as a hosted release draft, enqueue durable processing, optionally wait, and optionally publish after readiness.\",\n inputSchema: RELEASE_SUBMIT_INPUT_SCHEMA,\n execution: {\n taskSupport: \"required\",\n },\n run: async ({\n platformUrl,\n game,\n versionLabel,\n cwd,\n distDir,\n bundle,\n skipBuild,\n waitForProcessing,\n processingTimeoutSeconds,\n publish,\n }: z.infer<typeof RELEASE_SUBMIT_INPUT_SCHEMA>) =>\n withJsonText(\n await submitPlatformRelease({\n platformUrl,\n slugOrId: game,\n versionLabel,\n cwd,\n distDir,\n bundlePath: bundle,\n skipBuild,\n waitForProcessing,\n ...(processingTimeoutSeconds === undefined\n ? {}\n : { processingTimeoutMs: processingTimeoutSeconds * 1_000 }),\n publish,\n }),\n ),\n },\n \"airjam.release_publish\": {\n description: \"Publish one ready hosted release on the Air Jam platform.\",\n inputSchema: RELEASE_MUTATION_INPUT_SCHEMA,\n run: async ({\n platformUrl,\n releaseId,\n }: z.infer<typeof RELEASE_MUTATION_INPUT_SCHEMA>) =>\n withJsonText(\n await publishPlatformRelease({\n platformUrl,\n releaseId,\n }),\n ),\n },\n \"airjam.release_archive\": {\n description:\n \"Retire one exact owned hosted release so it can no longer be played.\",\n inputSchema: RELEASE_MUTATION_INPUT_SCHEMA,\n run: async ({\n platformUrl,\n releaseId,\n }: z.infer<typeof RELEASE_MUTATION_INPUT_SCHEMA>) =>\n withJsonText(await archivePlatformRelease({ platformUrl, releaseId })),\n },\n \"airjam.start_dev\": {\n description:\n \"Start the Air Jam local dev stack for the current project and return the managed process id plus resolved topology.\",\n inputSchema: startDevInputSchema,\n run: async (input: z.infer<typeof startDevInputSchema>) =>\n withJsonText(await startDev(input)),\n },\n \"airjam.stop_dev\": {\n description:\n \"Stop one or more Air Jam dev processes previously started by devtools.\",\n inputSchema: STOP_DEV_INPUT_SCHEMA,\n run: async (input: z.infer<typeof STOP_DEV_INPUT_SCHEMA>) =>\n withJsonText(await stopDev(input)),\n },\n \"airjam.status\": {\n description:\n \"List Air Jam dev processes plus unmanaged listeners on known local Air Jam ports.\",\n inputSchema: z.object({\n cwd: z.string().optional(),\n }),\n run: async ({ cwd }: { cwd?: string }) =>\n withJsonText(await getDevStatus({ cwd })),\n },\n \"airjam.reset_local\": {\n description:\n \"Best-effort cleanup for local Air Jam dev state: stop managed dev processes and stale known-port Air Jam listeners.\",\n inputSchema: z.object({\n cwd: z.string().optional(),\n }),\n run: async ({ cwd }: { cwd?: string }) =>\n withJsonText(await resetLocalDev({ cwd })),\n },\n \"airjam.topology\": {\n description:\n \"Return the resolved runtime topology and endpoint summary for the current project mode.\",\n inputSchema: topologyInputSchema,\n run: async (input: z.infer<typeof topologyInputSchema>) =>\n withJsonText(await getTopology(input)),\n },\n \"airjam.list_game_test_profiles\": {\n description:\n \"Discover authored game scenarios and their code, random or model policies. Runs own bounded participant lifetimes, with actual host observations and retained receipts.\",\n inputSchema: gameRunDiscoverySchema,\n run: async (input) => withJsonText(await listGameTestProfiles(input)),\n },\n \"airjam.start_game_run\": {\n description:\n \"Start an authored test (kind=test, profile, policy and budget) or a profile-free model player (kind=play, current room only, optional intent, ten-minute safety deadline and no verdict). Supply a stable UUID runId; retries return the same admission. Play requires the creator's granted current room. Tests may also target owned or headless rooms. Target headless plays with no page on game time, far faster than real time; owned plays the built page. Read or stop by runId.\",\n inputSchema: z.object({\n ...z.object(startTestGameRunSchema.shape).partial().shape,\n ...z.object(startPlayGameRunSchema.shape).partial().shape,\n kind: z.enum([\"test\", \"play\"]).default(\"test\"),\n runId: startTestGameRunSchema.shape.runId,\n target: startTestGameRunSchema.shape.target,\n }),\n run: async (input) =>\n withJsonText(await startGameRun(startGameRunSchema.parse(input))),\n },\n \"airjam.read_game_run\": {\n description:\n \"Read a run's actual state, controller ownership, counters, terminal reason and cleanup/evidence receipts.\",\n inputSchema: gameRunAddressSchema,\n run: async (input) => withJsonText(await readGameRun(input)),\n },\n \"airjam.wait_game_run\": {\n description:\n \"Wait for a terminal run or a bounded timeout. Returns the actual record; a timeout or disconnected client never stops the run.\",\n inputSchema: gameRunWaitSchema,\n run: async (input) => withJsonText(await waitGameRun(input)),\n },\n \"airjam.replay_game_run\": {\n description:\n \"Replay an ended headless run from its recorded input log on a fresh copy of the game, with no server or page, and report whether it ends where the run ended: the same agent view, simulation and step.\",\n inputSchema: gameRunAddressSchema,\n run: async (input) => withJsonText(await replayGameRun(input)),\n },\n \"airjam.stop_game_run\": {\n description:\n \"Stop a policy run, release its inputs, retain a final actual observation, and disconnect its owned controllers/host. Idempotent.\",\n inputSchema: gameRunAddressSchema,\n run: async (input) => withJsonText(await stopGameRun(input)),\n },\n \"airjam.steer_game_run\": {\n description:\n \"Change what one seat of an active run is trying to do, in words its decision-model policy reads, or clear it with null. Never sends a control; the policy still decides. Each change is recorded on the run with its time and source.\",\n inputSchema: gameRunSteerSchema,\n run: async (input) => withJsonText(await steerGameRun(input)),\n },\n \"airjam.list_game_runs\": {\n description:\n \"List activities admitted by this project's current session owner.\",\n inputSchema: gameRunDiscoverySchema.pick({ cwd: true }),\n run: async (input) => withJsonText(await listGameRuns(input)),\n },\n \"airjam.open_game_session\": {\n description:\n \"Open a separate owned test host with a virtual controller and live semantic actions. Omit roomId/controllerJoinUrl for semantic testing. Explicit room attachments are participant-only: inputs and raw controller tools, no semantic source interpretation or host actions.\",\n inputSchema: openGameSessionInputSchema,\n run: async (input: z.infer<typeof openGameSessionInputSchema>) =>\n withJsonText(await openGameSession(input)),\n },\n \"airjam.control_game_session_participant\": {\n description:\n \"Send a bounded agent participant input, semantic action or release through the actual room. Requires a fresh observed runtime identity and explicit controller-lifetime lease/sequence. Never grants host actions. Retry an unconfirmed command with the identical lease, sequence and envelope; never invent a new sequence to repeat an uncertain action.\",\n inputSchema: gameSessionOperationSchemas.control,\n run: async (input: z.infer<typeof gameSessionOperationSchemas.control>) =>\n withJsonText(await controlGameSessionParticipant(input)),\n },\n \"airjam.send_game_session_input\": {\n description:\n \"Send a player's declared controls through a previously opened Air Jam game session: a button true or false (false then true is one press), an axis a number from -1 to 1, a stick an { x, y }.\",\n inputSchema: sendGameSessionInputSchema,\n run: async (input: z.infer<typeof sendGameSessionInputSchema>) =>\n withJsonText(await sendGameSessionInput(input)),\n },\n \"airjam.read_game_session\": {\n description:\n \"Read authoritative live state and current semantic actions from an owned game host. Requires semanticAccess=owned-host; never interprets local source for someone else's room.\",\n inputSchema: readGameSessionInputSchema,\n run: async (input: z.infer<typeof readGameSessionInputSchema>) =>\n withJsonText(await readGameSession(input)),\n },\n \"airjam.observe_game_session\": {\n description:\n \"Observe fresh live semantic and host-local state from an owned game, with a bounded real render image when supported. Returns runtime identity, sample interval and surface coverage. Does not join a player or invoke actions; unsupported images are explicit.\",\n inputSchema: observeGameSessionInputSchema,\n run: async (input: z.infer<typeof observeGameSessionInputSchema>) => {\n const observation = await observeGameSession(input);\n const { visual, ...metadata } = observation;\n if (visual.status !== \"captured\") return withJsonText(observation);\n const { data, ...image } = visual.image;\n return {\n content: [\n ...withJsonText({\n ...metadata,\n visual: { status: \"captured\", image },\n }).content,\n { type: \"image\" as const, mimeType: image.mimeType, data },\n ],\n };\n },\n },\n \"airjam.read_game_settings\": {\n description:\n \"Read the current settings and revision from an owned live game host.\",\n inputSchema: gameSessionOperationSchemas[\"settings-read\"],\n run: async (\n input: z.infer<(typeof gameSessionOperationSchemas)[\"settings-read\"]>,\n ) => withJsonText(await readGameSettings(input)),\n },\n \"airjam.update_game_settings\": {\n description:\n \"Atomically change live settings on an owned game host using its current revision. Non-live settings require a new room.\",\n inputSchema: gameSessionOperationSchemas[\"settings-update\"],\n run: async (\n input: z.infer<(typeof gameSessionOperationSchemas)[\"settings-update\"]>,\n ) => withJsonText(await updateGameSettings(input)),\n },\n \"airjam.invoke_game_session_action\": {\n description:\n \"Invoke one discovered game-session action by its unified session action id, without manually choosing between player-semantic and host-staging internals.\",\n inputSchema: invokeGameSessionActionInputSchema,\n run: async (input: z.infer<typeof invokeGameSessionActionInputSchema>) =>\n withJsonText(await invokeGameSessionAction(input)),\n },\n \"airjam.capture_game_session_visuals\": {\n description:\n \"Capture canonical host and controller screenshots from the browser runtime owned by an open game session.\",\n inputSchema: captureGameSessionInputSchema,\n run: async (input: z.infer<typeof captureGameSessionInputSchema>) =>\n withJsonText(await captureGameSessionVisuals(input)),\n },\n \"airjam.close_game_session\": {\n description:\n \"Close one previously opened Air Jam game session and disconnect its virtual controller.\",\n inputSchema: gameSessionInputSchema,\n run: async (input: z.infer<typeof gameSessionInputSchema>) =>\n withJsonText(await closeGameSession(input)),\n },\n } as const;\n};\n\nexport type AirJamMcpToolDefinitions = ReturnType<typeof buildToolDefinitions>;\n\nexport const getRegisteredToolNamesForProjectMode = (\n projectMode: AirJamProjectMode,\n): ReadonlyArray<keyof AirJamMcpToolDefinitions> => {\n const mode =\n projectMode === \"monorepo\" || projectMode === \"standalone-game\"\n ? projectMode\n : \"unknown\";\n return toolContract[mode] as ReadonlyArray<keyof AirJamMcpToolDefinitions>;\n};\n","{\n \"monorepo\": [\n \"airjam.inspect_project\",\n \"airjam.auth_status\",\n \"airjam.list_games\",\n \"airjam.inspect_game\",\n \"airjam.read_logs\",\n \"airjam.run_quality_gate\",\n \"airjam.evaluate\",\n \"airjam.release_list\",\n \"airjam.release_inspect\",\n \"airjam.release_upload\",\n \"airjam.release_finalize\",\n \"airjam.release_export\",\n \"airjam.release_publish\",\n \"airjam.release_archive\",\n \"airjam.start_dev\",\n \"airjam.stop_dev\",\n \"airjam.status\",\n \"airjam.reset_local\",\n \"airjam.topology\",\n \"airjam.list_game_test_profiles\",\n \"airjam.start_game_run\",\n \"airjam.read_game_run\",\n \"airjam.wait_game_run\",\n \"airjam.stop_game_run\",\n \"airjam.steer_game_run\",\n \"airjam.list_game_runs\",\n \"airjam.open_game_session\",\n \"airjam.control_game_session_participant\",\n \"airjam.send_game_session_input\",\n \"airjam.read_game_session\",\n \"airjam.observe_game_session\",\n \"airjam.invoke_game_session_action\",\n \"airjam.read_game_settings\",\n \"airjam.update_game_settings\",\n \"airjam.capture_game_session_visuals\",\n \"airjam.close_game_session\"\n ],\n \"standalone-game\": [\n \"airjam.inspect_project\",\n \"airjam.auth_status\",\n \"airjam.list_games\",\n \"airjam.inspect_game\",\n \"airjam.read_logs\",\n \"airjam.run_quality_gate\",\n \"airjam.evaluate\",\n \"airjam.release_doctor\",\n \"airjam.release_validate\",\n \"airjam.release_bundle\",\n \"airjam.release_list\",\n \"airjam.release_inspect\",\n \"airjam.release_upload\",\n \"airjam.release_finalize\",\n \"airjam.release_export\",\n \"airjam.release_submit\",\n \"airjam.release_publish\",\n \"airjam.release_archive\",\n \"airjam.start_dev\",\n \"airjam.stop_dev\",\n \"airjam.status\",\n \"airjam.reset_local\",\n \"airjam.topology\",\n \"airjam.list_game_test_profiles\",\n \"airjam.start_game_run\",\n \"airjam.read_game_run\",\n \"airjam.wait_game_run\",\n \"airjam.stop_game_run\",\n \"airjam.steer_game_run\",\n \"airjam.list_game_runs\",\n \"airjam.open_game_session\",\n \"airjam.control_game_session_participant\",\n \"airjam.send_game_session_input\",\n \"airjam.read_game_session\",\n \"airjam.observe_game_session\",\n \"airjam.invoke_game_session_action\",\n \"airjam.read_game_settings\",\n \"airjam.update_game_settings\",\n \"airjam.capture_game_session_visuals\",\n \"airjam.close_game_session\"\n ],\n \"unknown\": [\"airjam.inspect_project\"]\n}\n","import fs from \"node:fs\";\n\ntype PackageManifest = {\n version?: unknown;\n};\n\nconst manifest = JSON.parse(\n fs.readFileSync(new URL(\"../package.json\", import.meta.url), \"utf8\"),\n) as PackageManifest;\n\nif (typeof manifest.version !== \"string\" || manifest.version.length === 0) {\n throw new Error(\"@air-jam/mcp-server package version is missing.\");\n}\n\nexport const AIR_JAM_MCP_SERVER_VERSION = manifest.version;\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;;;ACRP,SAAS,4BAA4B;AAKrC,SAAS,yBAAyB;AAClC,SAAS,iBAAiB;;;ACN1B,SAAS,sBAAsB;AAC/B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,aAAa,iBAAiB;AACvC,SAAS,mBAAmB;AAC5B,SAAS,oCAAoC;AAC7C;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAKP,SAAS,SAAS;;;AC/DlB;AAAA,EACE,UAAY;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,mBAAmB;AAAA,IACjB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA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AEA,QAAI,KAAK,WAAW,gBAAgB,YAAY;AAC9C,aAAO,aAAa,MAAM;AAAA,QACxB;AAAA,QACA;AAAA,UACE,GAAG;AAAA,UACH,WAAW;AAAA,YACT,aAAa;AAAA,UACf;AAAA,QACF;AAAA,QACA;AAAA,UACE,YAAY,OACV,MACA,EAAE,WAAAA,YAAW,iBAAiB,MAC3B;AACH,kBAAM,OAAO,MAAMA,WAAU,WAAW;AAAA,cACtC,KAAK,oBAAoB;AAAA,YAC3B,CAAC;AAED,kBAAM,YAAY;AAChB,kBAAI;AACF,sBAAM,SAAS,MAAM,KAAK,IAAI,IAAa;AAC3C,sBAAMA,WAAU;AAAA,kBACd,KAAK;AAAA,kBACL;AAAA,kBACA;AAAA,gBACF;AAAA,cACF,SAAS,OAAO;AACd,sBAAMA,WAAU;AAAA,kBACd,KAAK;AAAA,kBACL;AAAA,kBACA,sBAAsB,KAAK;AAAA,gBAC7B;AAAA,cACF;AAAA,YACF,GAAG;AAEH,mBAAO,EAAE,KAAK;AAAA,UAChB;AAAA,UACA,SAAS,OACP,OACA,EAAE,QAAQ,WAAAA,WAAU,MACjBA,WAAU,QAAQ,MAAM;AAAA,UAC7B,eAAe,OACb,OACA,EAAE,QAAQ,WAAAA,WAAU,MACjBA,WAAU,cAAc,MAAM;AAAA,QACrC;AAAA,MACF;AACA;AAAA,IACF;AAEA,WAAO;AAAA,MAAa;AAAA,MAAU;AAAA,MAAY,OAAO,SAC/C,KAAK,IAAI,IAAa;AAAA,IACxB;AAAA,EACF;AAEA,SAAO;AACT;","names":["taskStore"]}
|
package/dist/server.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
2
|
|
|
3
|
-
declare const createAirJamMcpServer: ({ cwd, }?: {
|
|
3
|
+
declare const createAirJamMcpServer: ({ cwd, embeddedRoom, }?: {
|
|
4
4
|
cwd?: string;
|
|
5
|
+
embeddedRoom?: boolean;
|
|
5
6
|
}) => Promise<McpServer>;
|
|
6
7
|
|
|
7
8
|
export { createAirJamMcpServer };
|
package/dist/server.js
CHANGED
|
@@ -4,7 +4,6 @@ import { InMemoryTaskStore } from "@modelcontextprotocol/sdk/experimental/tasks"
|
|
|
4
4
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
5
5
|
|
|
6
6
|
// src/tools.ts
|
|
7
|
-
import { inspectGameAgentContract } from "@air-jam/devtools/agent";
|
|
8
7
|
import { inspectProject } from "@air-jam/devtools/context";
|
|
9
8
|
import {
|
|
10
9
|
getDevStatus,
|
|
@@ -13,13 +12,35 @@ import {
|
|
|
13
12
|
startDev,
|
|
14
13
|
stopDev
|
|
15
14
|
} from "@air-jam/devtools/dev";
|
|
15
|
+
import {
|
|
16
|
+
gameRunAddressSchema,
|
|
17
|
+
gameRunDiscoverySchema,
|
|
18
|
+
gameRunSteerSchema,
|
|
19
|
+
gameRunWaitSchema,
|
|
20
|
+
startGameRunSchema,
|
|
21
|
+
startPlayGameRunSchema,
|
|
22
|
+
startTestGameRunSchema
|
|
23
|
+
} from "@air-jam/devtools/game-runs";
|
|
16
24
|
import {
|
|
17
25
|
captureGameSessionVisuals,
|
|
18
26
|
closeGameSession,
|
|
27
|
+
controlGameSessionParticipant,
|
|
28
|
+
gameSessionOperationSchemas,
|
|
19
29
|
invokeGameSessionAction,
|
|
30
|
+
listGameRuns,
|
|
31
|
+
listGameTestProfiles,
|
|
32
|
+
observeGameSession,
|
|
20
33
|
openGameSession,
|
|
34
|
+
readGameRun,
|
|
21
35
|
readGameSession,
|
|
22
|
-
|
|
36
|
+
readGameSettings,
|
|
37
|
+
replayGameRun,
|
|
38
|
+
sendGameSessionInput,
|
|
39
|
+
startGameRun,
|
|
40
|
+
steerGameRun,
|
|
41
|
+
stopGameRun,
|
|
42
|
+
updateGameSettings,
|
|
43
|
+
waitGameRun
|
|
23
44
|
} from "@air-jam/devtools/game-session";
|
|
24
45
|
import { inspectGame, listGames } from "@air-jam/devtools/games";
|
|
25
46
|
import { readDevLogs } from "@air-jam/devtools/logs";
|
|
@@ -29,6 +50,7 @@ import {
|
|
|
29
50
|
runQualityGate
|
|
30
51
|
} from "@air-jam/devtools/quality";
|
|
31
52
|
import {
|
|
53
|
+
archivePlatformRelease,
|
|
32
54
|
bundleLocalRelease,
|
|
33
55
|
exportPlatformReleaseGeneration,
|
|
34
56
|
finalizePlatformReleaseGeneration,
|
|
@@ -50,7 +72,6 @@ var tool_contract_default = {
|
|
|
50
72
|
"airjam.auth_status",
|
|
51
73
|
"airjam.list_games",
|
|
52
74
|
"airjam.inspect_game",
|
|
53
|
-
"airjam.inspect_game_agent_contract",
|
|
54
75
|
"airjam.read_logs",
|
|
55
76
|
"airjam.run_quality_gate",
|
|
56
77
|
"airjam.evaluate",
|
|
@@ -60,15 +81,27 @@ var tool_contract_default = {
|
|
|
60
81
|
"airjam.release_finalize",
|
|
61
82
|
"airjam.release_export",
|
|
62
83
|
"airjam.release_publish",
|
|
84
|
+
"airjam.release_archive",
|
|
63
85
|
"airjam.start_dev",
|
|
64
86
|
"airjam.stop_dev",
|
|
65
87
|
"airjam.status",
|
|
66
88
|
"airjam.reset_local",
|
|
67
89
|
"airjam.topology",
|
|
90
|
+
"airjam.list_game_test_profiles",
|
|
91
|
+
"airjam.start_game_run",
|
|
92
|
+
"airjam.read_game_run",
|
|
93
|
+
"airjam.wait_game_run",
|
|
94
|
+
"airjam.stop_game_run",
|
|
95
|
+
"airjam.steer_game_run",
|
|
96
|
+
"airjam.list_game_runs",
|
|
68
97
|
"airjam.open_game_session",
|
|
98
|
+
"airjam.control_game_session_participant",
|
|
69
99
|
"airjam.send_game_session_input",
|
|
70
100
|
"airjam.read_game_session",
|
|
101
|
+
"airjam.observe_game_session",
|
|
71
102
|
"airjam.invoke_game_session_action",
|
|
103
|
+
"airjam.read_game_settings",
|
|
104
|
+
"airjam.update_game_settings",
|
|
72
105
|
"airjam.capture_game_session_visuals",
|
|
73
106
|
"airjam.close_game_session"
|
|
74
107
|
],
|
|
@@ -77,7 +110,6 @@ var tool_contract_default = {
|
|
|
77
110
|
"airjam.auth_status",
|
|
78
111
|
"airjam.list_games",
|
|
79
112
|
"airjam.inspect_game",
|
|
80
|
-
"airjam.inspect_game_agent_contract",
|
|
81
113
|
"airjam.read_logs",
|
|
82
114
|
"airjam.run_quality_gate",
|
|
83
115
|
"airjam.evaluate",
|
|
@@ -91,15 +123,27 @@ var tool_contract_default = {
|
|
|
91
123
|
"airjam.release_export",
|
|
92
124
|
"airjam.release_submit",
|
|
93
125
|
"airjam.release_publish",
|
|
126
|
+
"airjam.release_archive",
|
|
94
127
|
"airjam.start_dev",
|
|
95
128
|
"airjam.stop_dev",
|
|
96
129
|
"airjam.status",
|
|
97
130
|
"airjam.reset_local",
|
|
98
131
|
"airjam.topology",
|
|
132
|
+
"airjam.list_game_test_profiles",
|
|
133
|
+
"airjam.start_game_run",
|
|
134
|
+
"airjam.read_game_run",
|
|
135
|
+
"airjam.wait_game_run",
|
|
136
|
+
"airjam.stop_game_run",
|
|
137
|
+
"airjam.steer_game_run",
|
|
138
|
+
"airjam.list_game_runs",
|
|
99
139
|
"airjam.open_game_session",
|
|
140
|
+
"airjam.control_game_session_participant",
|
|
100
141
|
"airjam.send_game_session_input",
|
|
101
142
|
"airjam.read_game_session",
|
|
143
|
+
"airjam.observe_game_session",
|
|
102
144
|
"airjam.invoke_game_session_action",
|
|
145
|
+
"airjam.read_game_settings",
|
|
146
|
+
"airjam.update_game_settings",
|
|
103
147
|
"airjam.capture_game_session_visuals",
|
|
104
148
|
"airjam.close_game_session"
|
|
105
149
|
],
|
|
@@ -194,7 +238,7 @@ var RELEASE_EXPORT_INPUT_SCHEMA = RELEASE_PLATFORM_INPUT_SCHEMA.extend({
|
|
|
194
238
|
cwd: z.string().optional(),
|
|
195
239
|
out: z.string().optional()
|
|
196
240
|
});
|
|
197
|
-
var
|
|
241
|
+
var RELEASE_MUTATION_INPUT_SCHEMA = RELEASE_PLATFORM_INPUT_SCHEMA.extend({
|
|
198
242
|
releaseId: z.string().min(1)
|
|
199
243
|
});
|
|
200
244
|
var READ_LOGS_INPUT_SCHEMA = z.object({
|
|
@@ -222,50 +266,21 @@ var STOP_DEV_INPUT_SCHEMA = z.object({
|
|
|
222
266
|
processId: z.string().optional(),
|
|
223
267
|
mode: z.enum(["standalone-dev", "arcade-dev", "arcade-test"]).optional()
|
|
224
268
|
});
|
|
225
|
-
var buildConnectControllerSchema = (projectMode) => z.object({
|
|
226
|
-
cwd: z.string().optional(),
|
|
227
|
-
gameId: z.string().optional(),
|
|
228
|
-
mode: buildGameSessionModeSchema(projectMode),
|
|
229
|
-
secure: z.boolean().optional(),
|
|
230
|
-
roomId: z.string().min(1).optional(),
|
|
231
|
-
controllerJoinUrl: z.string().url().optional(),
|
|
232
|
-
controllerId: z.string().min(3).optional(),
|
|
233
|
-
deviceId: z.string().min(8).optional(),
|
|
234
|
-
nickname: z.string().min(1).optional(),
|
|
235
|
-
avatarId: z.string().min(1).optional(),
|
|
236
|
-
capabilityToken: z.string().min(1).optional(),
|
|
237
|
-
timeoutMs: z.number().int().positive().optional()
|
|
238
|
-
});
|
|
239
269
|
var buildToolDefinitions = ({
|
|
240
270
|
projectMode
|
|
241
271
|
}) => {
|
|
242
272
|
const runQualityGateInputSchema = buildQualityGateSchema(projectMode);
|
|
243
273
|
const startDevInputSchema = buildStartDevSchema(projectMode);
|
|
244
274
|
const topologyInputSchema = buildTopologySchema(projectMode);
|
|
245
|
-
const
|
|
246
|
-
|
|
247
|
-
gameId: z.string().optional()
|
|
248
|
-
});
|
|
249
|
-
const openGameSessionInputSchema = buildConnectControllerSchema(projectMode);
|
|
250
|
-
const captureGameSessionInputSchema = z.object({
|
|
251
|
-
gameSessionId: z.string().uuid(),
|
|
252
|
-
timeoutMs: z.number().int().positive().optional()
|
|
253
|
-
});
|
|
254
|
-
const gameSessionInputSchema = z.object({
|
|
255
|
-
gameSessionId: z.string().min(1)
|
|
256
|
-
});
|
|
257
|
-
const sendGameSessionInputSchema = gameSessionInputSchema.extend({
|
|
258
|
-
input: z.record(z.string(), z.unknown())
|
|
259
|
-
});
|
|
260
|
-
const readGameSessionInputSchema = gameSessionInputSchema.extend({
|
|
261
|
-
requestSync: z.boolean().optional(),
|
|
262
|
-
timeoutMs: z.number().int().positive().optional()
|
|
263
|
-
});
|
|
264
|
-
const invokeGameSessionActionInputSchema = gameSessionInputSchema.extend({
|
|
265
|
-
actionId: z.string().min(1),
|
|
266
|
-
payload: z.unknown().optional(),
|
|
267
|
-
timeoutMs: z.number().int().positive().optional()
|
|
275
|
+
const openGameSessionInputSchema = gameSessionOperationSchemas.open.extend({
|
|
276
|
+
mode: buildGameSessionModeSchema(projectMode)
|
|
268
277
|
});
|
|
278
|
+
const captureGameSessionInputSchema = gameSessionOperationSchemas.capture;
|
|
279
|
+
const gameSessionInputSchema = gameSessionOperationSchemas.close;
|
|
280
|
+
const sendGameSessionInputSchema = gameSessionOperationSchemas.input;
|
|
281
|
+
const readGameSessionInputSchema = gameSessionOperationSchemas.read;
|
|
282
|
+
const observeGameSessionInputSchema = gameSessionOperationSchemas.observe;
|
|
283
|
+
const invokeGameSessionActionInputSchema = gameSessionOperationSchemas.invoke;
|
|
269
284
|
return {
|
|
270
285
|
"airjam.inspect_project": {
|
|
271
286
|
description: "Inspect the current Air Jam project, detect monorepo vs standalone mode, and list available Air Jam capability groups.",
|
|
@@ -286,11 +301,6 @@ var buildToolDefinitions = ({
|
|
|
286
301
|
inputSchema: INSPECT_GAME_INPUT_SCHEMA,
|
|
287
302
|
run: async ({ cwd, gameId }) => withJsonText(await inspectGame({ cwd, gameId }))
|
|
288
303
|
},
|
|
289
|
-
"airjam.inspect_game_agent_contract": {
|
|
290
|
-
description: "Inspect one game's agent contract, including game-specific snapshot description and semantic controller action metadata.",
|
|
291
|
-
inputSchema: inspectGameAgentContractInputSchema,
|
|
292
|
-
run: async ({ cwd, gameId }) => withJsonText(await inspectGameAgentContract({ cwd, gameId }))
|
|
293
|
-
},
|
|
294
304
|
"airjam.read_logs": {
|
|
295
305
|
description: "Read the canonical Air Jam unified dev log stream. Start with view=signal and a bounded tail before adding more filters.",
|
|
296
306
|
inputSchema: READ_LOGS_INPUT_SCHEMA,
|
|
@@ -475,7 +485,7 @@ var buildToolDefinitions = ({
|
|
|
475
485
|
},
|
|
476
486
|
"airjam.release_publish": {
|
|
477
487
|
description: "Publish one ready hosted release on the Air Jam platform.",
|
|
478
|
-
inputSchema:
|
|
488
|
+
inputSchema: RELEASE_MUTATION_INPUT_SCHEMA,
|
|
479
489
|
run: async ({
|
|
480
490
|
platformUrl,
|
|
481
491
|
releaseId
|
|
@@ -486,6 +496,14 @@ var buildToolDefinitions = ({
|
|
|
486
496
|
})
|
|
487
497
|
)
|
|
488
498
|
},
|
|
499
|
+
"airjam.release_archive": {
|
|
500
|
+
description: "Retire one exact owned hosted release so it can no longer be played.",
|
|
501
|
+
inputSchema: RELEASE_MUTATION_INPUT_SCHEMA,
|
|
502
|
+
run: async ({
|
|
503
|
+
platformUrl,
|
|
504
|
+
releaseId
|
|
505
|
+
}) => withJsonText(await archivePlatformRelease({ platformUrl, releaseId }))
|
|
506
|
+
},
|
|
489
507
|
"airjam.start_dev": {
|
|
490
508
|
description: "Start the Air Jam local dev stack for the current project and return the managed process id plus resolved topology.",
|
|
491
509
|
inputSchema: startDevInputSchema,
|
|
@@ -515,21 +533,101 @@ var buildToolDefinitions = ({
|
|
|
515
533
|
inputSchema: topologyInputSchema,
|
|
516
534
|
run: async (input) => withJsonText(await getTopology(input))
|
|
517
535
|
},
|
|
536
|
+
"airjam.list_game_test_profiles": {
|
|
537
|
+
description: "Discover authored game scenarios and their code, random or model policies. Runs own bounded participant lifetimes, with actual host observations and retained receipts.",
|
|
538
|
+
inputSchema: gameRunDiscoverySchema,
|
|
539
|
+
run: async (input) => withJsonText(await listGameTestProfiles(input))
|
|
540
|
+
},
|
|
541
|
+
"airjam.start_game_run": {
|
|
542
|
+
description: "Start an authored test (kind=test, profile, policy and budget) or a profile-free model player (kind=play, current room only, optional intent, ten-minute safety deadline and no verdict). Supply a stable UUID runId; retries return the same admission. Play requires the creator's granted current room. Tests may also target owned or headless rooms. Target headless plays with no page on game time, far faster than real time; owned plays the built page. Read or stop by runId.",
|
|
543
|
+
inputSchema: z.object({
|
|
544
|
+
...z.object(startTestGameRunSchema.shape).partial().shape,
|
|
545
|
+
...z.object(startPlayGameRunSchema.shape).partial().shape,
|
|
546
|
+
kind: z.enum(["test", "play"]).default("test"),
|
|
547
|
+
runId: startTestGameRunSchema.shape.runId,
|
|
548
|
+
target: startTestGameRunSchema.shape.target
|
|
549
|
+
}),
|
|
550
|
+
run: async (input) => withJsonText(await startGameRun(startGameRunSchema.parse(input)))
|
|
551
|
+
},
|
|
552
|
+
"airjam.read_game_run": {
|
|
553
|
+
description: "Read a run's actual state, controller ownership, counters, terminal reason and cleanup/evidence receipts.",
|
|
554
|
+
inputSchema: gameRunAddressSchema,
|
|
555
|
+
run: async (input) => withJsonText(await readGameRun(input))
|
|
556
|
+
},
|
|
557
|
+
"airjam.wait_game_run": {
|
|
558
|
+
description: "Wait for a terminal run or a bounded timeout. Returns the actual record; a timeout or disconnected client never stops the run.",
|
|
559
|
+
inputSchema: gameRunWaitSchema,
|
|
560
|
+
run: async (input) => withJsonText(await waitGameRun(input))
|
|
561
|
+
},
|
|
562
|
+
"airjam.replay_game_run": {
|
|
563
|
+
description: "Replay an ended headless run from its recorded input log on a fresh copy of the game, with no server or page, and report whether it ends where the run ended: the same agent view, simulation and step.",
|
|
564
|
+
inputSchema: gameRunAddressSchema,
|
|
565
|
+
run: async (input) => withJsonText(await replayGameRun(input))
|
|
566
|
+
},
|
|
567
|
+
"airjam.stop_game_run": {
|
|
568
|
+
description: "Stop a policy run, release its inputs, retain a final actual observation, and disconnect its owned controllers/host. Idempotent.",
|
|
569
|
+
inputSchema: gameRunAddressSchema,
|
|
570
|
+
run: async (input) => withJsonText(await stopGameRun(input))
|
|
571
|
+
},
|
|
572
|
+
"airjam.steer_game_run": {
|
|
573
|
+
description: "Change what one seat of an active run is trying to do, in words its decision-model policy reads, or clear it with null. Never sends a control; the policy still decides. Each change is recorded on the run with its time and source.",
|
|
574
|
+
inputSchema: gameRunSteerSchema,
|
|
575
|
+
run: async (input) => withJsonText(await steerGameRun(input))
|
|
576
|
+
},
|
|
577
|
+
"airjam.list_game_runs": {
|
|
578
|
+
description: "List activities admitted by this project's current session owner.",
|
|
579
|
+
inputSchema: gameRunDiscoverySchema.pick({ cwd: true }),
|
|
580
|
+
run: async (input) => withJsonText(await listGameRuns(input))
|
|
581
|
+
},
|
|
518
582
|
"airjam.open_game_session": {
|
|
519
|
-
description: "Open
|
|
583
|
+
description: "Open a separate owned test host with a virtual controller and live semantic actions. Omit roomId/controllerJoinUrl for semantic testing. Explicit room attachments are participant-only: inputs and raw controller tools, no semantic source interpretation or host actions.",
|
|
520
584
|
inputSchema: openGameSessionInputSchema,
|
|
521
585
|
run: async (input) => withJsonText(await openGameSession(input))
|
|
522
586
|
},
|
|
587
|
+
"airjam.control_game_session_participant": {
|
|
588
|
+
description: "Send a bounded agent participant input, semantic action or release through the actual room. Requires a fresh observed runtime identity and explicit controller-lifetime lease/sequence. Never grants host actions. Retry an unconfirmed command with the identical lease, sequence and envelope; never invent a new sequence to repeat an uncertain action.",
|
|
589
|
+
inputSchema: gameSessionOperationSchemas.control,
|
|
590
|
+
run: async (input) => withJsonText(await controlGameSessionParticipant(input))
|
|
591
|
+
},
|
|
523
592
|
"airjam.send_game_session_input": {
|
|
524
|
-
description: "Send
|
|
593
|
+
description: "Send a player's declared controls through a previously opened Air Jam game session: a button true or false (false then true is one press), an axis a number from -1 to 1, a stick an { x, y }.",
|
|
525
594
|
inputSchema: sendGameSessionInputSchema,
|
|
526
595
|
run: async (input) => withJsonText(await sendGameSessionInput(input))
|
|
527
596
|
},
|
|
528
597
|
"airjam.read_game_session": {
|
|
529
|
-
description: "Read
|
|
598
|
+
description: "Read authoritative live state and current semantic actions from an owned game host. Requires semanticAccess=owned-host; never interprets local source for someone else's room.",
|
|
530
599
|
inputSchema: readGameSessionInputSchema,
|
|
531
600
|
run: async (input) => withJsonText(await readGameSession(input))
|
|
532
601
|
},
|
|
602
|
+
"airjam.observe_game_session": {
|
|
603
|
+
description: "Observe fresh live semantic and host-local state from an owned game, with a bounded real render image when supported. Returns runtime identity, sample interval and surface coverage. Does not join a player or invoke actions; unsupported images are explicit.",
|
|
604
|
+
inputSchema: observeGameSessionInputSchema,
|
|
605
|
+
run: async (input) => {
|
|
606
|
+
const observation = await observeGameSession(input);
|
|
607
|
+
const { visual, ...metadata } = observation;
|
|
608
|
+
if (visual.status !== "captured") return withJsonText(observation);
|
|
609
|
+
const { data, ...image } = visual.image;
|
|
610
|
+
return {
|
|
611
|
+
content: [
|
|
612
|
+
...withJsonText({
|
|
613
|
+
...metadata,
|
|
614
|
+
visual: { status: "captured", image }
|
|
615
|
+
}).content,
|
|
616
|
+
{ type: "image", mimeType: image.mimeType, data }
|
|
617
|
+
]
|
|
618
|
+
};
|
|
619
|
+
}
|
|
620
|
+
},
|
|
621
|
+
"airjam.read_game_settings": {
|
|
622
|
+
description: "Read the current settings and revision from an owned live game host.",
|
|
623
|
+
inputSchema: gameSessionOperationSchemas["settings-read"],
|
|
624
|
+
run: async (input) => withJsonText(await readGameSettings(input))
|
|
625
|
+
},
|
|
626
|
+
"airjam.update_game_settings": {
|
|
627
|
+
description: "Atomically change live settings on an owned game host using its current revision. Non-live settings require a new room.",
|
|
628
|
+
inputSchema: gameSessionOperationSchemas["settings-update"],
|
|
629
|
+
run: async (input) => withJsonText(await updateGameSettings(input))
|
|
630
|
+
},
|
|
533
631
|
"airjam.invoke_game_session_action": {
|
|
534
632
|
description: "Invoke one discovered game-session action by its unified session action id, without manually choosing between player-semantic and host-staging internals.",
|
|
535
633
|
inputSchema: invokeGameSessionActionInputSchema,
|
|
@@ -543,7 +641,7 @@ var buildToolDefinitions = ({
|
|
|
543
641
|
"airjam.close_game_session": {
|
|
544
642
|
description: "Close one previously opened Air Jam game session and disconnect its virtual controller.",
|
|
545
643
|
inputSchema: gameSessionInputSchema,
|
|
546
|
-
run: async (
|
|
644
|
+
run: async (input) => withJsonText(await closeGameSession(input))
|
|
547
645
|
}
|
|
548
646
|
};
|
|
549
647
|
};
|
|
@@ -578,8 +676,27 @@ var createToolErrorResult = (error) => ({
|
|
|
578
676
|
],
|
|
579
677
|
isError: true
|
|
580
678
|
});
|
|
679
|
+
var EMBEDDED_ROOM_OMITTED_TOOLS = /* @__PURE__ */ new Set([
|
|
680
|
+
"airjam.start_dev",
|
|
681
|
+
"airjam.stop_dev",
|
|
682
|
+
"airjam.reset_local",
|
|
683
|
+
"airjam.start_game_run",
|
|
684
|
+
"airjam.stop_game_run",
|
|
685
|
+
"airjam.steer_game_run",
|
|
686
|
+
"airjam.open_game_session",
|
|
687
|
+
"airjam.control_game_session_participant",
|
|
688
|
+
"airjam.send_game_session_input",
|
|
689
|
+
"airjam.read_game_session",
|
|
690
|
+
"airjam.observe_game_session",
|
|
691
|
+
"airjam.read_game_settings",
|
|
692
|
+
"airjam.update_game_settings",
|
|
693
|
+
"airjam.invoke_game_session_action",
|
|
694
|
+
"airjam.capture_game_session_visuals",
|
|
695
|
+
"airjam.close_game_session"
|
|
696
|
+
]);
|
|
581
697
|
var createAirJamMcpServer = async ({
|
|
582
|
-
cwd = process.cwd()
|
|
698
|
+
cwd = process.cwd(),
|
|
699
|
+
embeddedRoom = false
|
|
583
700
|
} = {}) => {
|
|
584
701
|
const context = await detectProjectContext({ cwd });
|
|
585
702
|
const toolDefinitions = buildToolDefinitions({
|
|
@@ -611,6 +728,7 @@ var createAirJamMcpServer = async ({
|
|
|
611
728
|
}
|
|
612
729
|
);
|
|
613
730
|
for (const toolName of registeredToolNames) {
|
|
731
|
+
if (embeddedRoom && EMBEDDED_ROOM_OMITTED_TOOLS.has(toolName)) continue;
|
|
614
732
|
const tool = toolDefinitions[toolName];
|
|
615
733
|
const description = describeToolForRegistration({
|
|
616
734
|
description: tool.description,
|