@air-jam/mcp-server 0.9.0
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/LICENSE +21 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +8284 -0
- package/dist/cli.js.map +1 -0
- package/dist/config.d.ts +13 -0
- package/dist/config.js +259 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +8081 -0
- package/dist/index.js.map +1 -0
- package/dist/server.d.ts +7 -0
- package/dist/server.js +8015 -0
- package/dist/server.js.map +1 -0
- package/dist/tools.d.ts +51 -0
- package/dist/tools.js +7910 -0
- package/dist/tools.js.map +1 -0
- package/dist/types.d.ts +18 -0
- package/dist/types.js +1 -0
- package/dist/types.js.map +1 -0
- package/package.json +57 -0
- package/src/cli.ts +22 -0
- package/src/config.ts +73 -0
- package/src/index.ts +4 -0
- package/src/server.ts +145 -0
- package/src/tools.ts +606 -0
- package/src/types.ts +17 -0
package/src/tools.ts
ADDED
|
@@ -0,0 +1,606 @@
|
|
|
1
|
+
import {
|
|
2
|
+
inspectGameAgentContract,
|
|
3
|
+
} from "@air-jam/devtools-core/agent";
|
|
4
|
+
import { inspectProject } from "@air-jam/devtools-core/context";
|
|
5
|
+
import {
|
|
6
|
+
getDevStatus,
|
|
7
|
+
getTopology,
|
|
8
|
+
resetLocalDev,
|
|
9
|
+
startDev,
|
|
10
|
+
stopDev,
|
|
11
|
+
} from "@air-jam/devtools-core/dev";
|
|
12
|
+
import {
|
|
13
|
+
closeGameSession,
|
|
14
|
+
invokeGameSessionAction,
|
|
15
|
+
openGameSession,
|
|
16
|
+
readGameSession,
|
|
17
|
+
sendGameSessionInput,
|
|
18
|
+
} from "@air-jam/devtools-core/game-session";
|
|
19
|
+
import {
|
|
20
|
+
inspectGame,
|
|
21
|
+
listGames,
|
|
22
|
+
listVisualCaptureSummaries,
|
|
23
|
+
readVisualCaptureSummary,
|
|
24
|
+
} from "@air-jam/devtools-core/games";
|
|
25
|
+
import { readDevLogs } from "@air-jam/devtools-core/logs";
|
|
26
|
+
import { getPlatformMachineAuthStatus } from "@air-jam/devtools-core/platform-auth";
|
|
27
|
+
import { runQualityGate } from "@air-jam/devtools-core/quality";
|
|
28
|
+
import {
|
|
29
|
+
bundleLocalRelease,
|
|
30
|
+
inspectLocalRelease,
|
|
31
|
+
inspectPlatformRelease,
|
|
32
|
+
listPlatformReleaseTargets,
|
|
33
|
+
listPlatformReleases,
|
|
34
|
+
publishPlatformRelease,
|
|
35
|
+
submitPlatformRelease,
|
|
36
|
+
validateLocalRelease,
|
|
37
|
+
} from "@air-jam/devtools-core/release";
|
|
38
|
+
import {
|
|
39
|
+
captureVisuals,
|
|
40
|
+
listVisualScenarios,
|
|
41
|
+
} from "@air-jam/devtools-core/visual";
|
|
42
|
+
import type { ToolExecution } from "@modelcontextprotocol/sdk/types.js";
|
|
43
|
+
import { z } from "zod";
|
|
44
|
+
|
|
45
|
+
type AirJamProjectMode = "monorepo" | "standalone-game" | "unknown";
|
|
46
|
+
type AirJamQualityGate =
|
|
47
|
+
| "typecheck"
|
|
48
|
+
| "lint"
|
|
49
|
+
| "test"
|
|
50
|
+
| "build"
|
|
51
|
+
| "format-check"
|
|
52
|
+
| "scaffold-smoke"
|
|
53
|
+
| "release-check";
|
|
54
|
+
|
|
55
|
+
export type AirJamMcpToolDefinition = {
|
|
56
|
+
description: string;
|
|
57
|
+
inputSchema: z.ZodTypeAny;
|
|
58
|
+
run: (args: never) => Promise<{
|
|
59
|
+
content: Array<{
|
|
60
|
+
type: "text";
|
|
61
|
+
text: string;
|
|
62
|
+
}>;
|
|
63
|
+
}>;
|
|
64
|
+
execution?: ToolExecution;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const withJsonText = <T>(value: T) => ({
|
|
68
|
+
content: [
|
|
69
|
+
{
|
|
70
|
+
type: "text" as const,
|
|
71
|
+
text: JSON.stringify(value, null, 2),
|
|
72
|
+
},
|
|
73
|
+
],
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
const buildQualityGateSchema = (projectMode: AirJamProjectMode) =>
|
|
77
|
+
z.object({
|
|
78
|
+
cwd: z.string().optional(),
|
|
79
|
+
gate:
|
|
80
|
+
projectMode === "monorepo"
|
|
81
|
+
? z.enum([
|
|
82
|
+
"typecheck",
|
|
83
|
+
"lint",
|
|
84
|
+
"test",
|
|
85
|
+
"build",
|
|
86
|
+
"format-check",
|
|
87
|
+
"scaffold-smoke",
|
|
88
|
+
"release-check",
|
|
89
|
+
] satisfies [AirJamQualityGate, ...AirJamQualityGate[]])
|
|
90
|
+
: z.enum([
|
|
91
|
+
"typecheck",
|
|
92
|
+
"lint",
|
|
93
|
+
"test",
|
|
94
|
+
"build",
|
|
95
|
+
"format-check",
|
|
96
|
+
] satisfies [AirJamQualityGate, ...AirJamQualityGate[]]),
|
|
97
|
+
packageFilter: z.string().optional(),
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
const buildStartDevSchema = (projectMode: AirJamProjectMode) =>
|
|
101
|
+
z.object({
|
|
102
|
+
cwd: z.string().optional(),
|
|
103
|
+
gameId: z.string().optional(),
|
|
104
|
+
mode:
|
|
105
|
+
projectMode === "monorepo"
|
|
106
|
+
? z.enum(["standalone-dev", "arcade-dev", "arcade-test"]).optional()
|
|
107
|
+
: z.literal("standalone-dev").optional(),
|
|
108
|
+
secure: z.boolean().optional(),
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
const buildTopologySchema = (projectMode: AirJamProjectMode) =>
|
|
112
|
+
z.object({
|
|
113
|
+
cwd: z.string().optional(),
|
|
114
|
+
gameId: z.string().optional(),
|
|
115
|
+
mode:
|
|
116
|
+
projectMode === "monorepo"
|
|
117
|
+
? z.enum(["standalone-dev", "arcade-dev", "arcade-test"]).optional()
|
|
118
|
+
: z.literal("standalone-dev").optional(),
|
|
119
|
+
secure: z.boolean().optional(),
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
const buildCaptureVisualsSchema = (projectMode: AirJamProjectMode) =>
|
|
123
|
+
z.object({
|
|
124
|
+
cwd: z.string().optional(),
|
|
125
|
+
gameId: z.string().optional(),
|
|
126
|
+
scenarioId: z.string().optional(),
|
|
127
|
+
mode:
|
|
128
|
+
projectMode === "monorepo"
|
|
129
|
+
? z.enum(["standalone-dev", "arcade-test"]).optional()
|
|
130
|
+
: z.literal("standalone-dev").optional(),
|
|
131
|
+
secure: z.boolean().optional(),
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
const buildHarnessModeSchema = (projectMode: AirJamProjectMode) =>
|
|
135
|
+
projectMode === "monorepo"
|
|
136
|
+
? z.enum(["standalone-dev", "arcade-dev", "arcade-test"]).optional()
|
|
137
|
+
: z.literal("standalone-dev").optional();
|
|
138
|
+
|
|
139
|
+
const RELEASE_PROJECT_INPUT_SCHEMA = z.object({
|
|
140
|
+
cwd: z.string().optional(),
|
|
141
|
+
distDir: z.string().optional(),
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
const RELEASE_PLATFORM_INPUT_SCHEMA = z.object({
|
|
145
|
+
platformUrl: z.string().url().optional(),
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
const RELEASE_VALIDATE_INPUT_SCHEMA = RELEASE_PROJECT_INPUT_SCHEMA.extend({
|
|
149
|
+
bundle: z.string().optional(),
|
|
150
|
+
skipBuild: z.boolean().optional(),
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
const RELEASE_BUNDLE_INPUT_SCHEMA = RELEASE_PROJECT_INPUT_SCHEMA.extend({
|
|
154
|
+
out: z.string().optional(),
|
|
155
|
+
skipBuild: z.boolean().optional(),
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
const RELEASE_LIST_INPUT_SCHEMA = RELEASE_PLATFORM_INPUT_SCHEMA.extend({
|
|
159
|
+
game: z.string().optional(),
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
const RELEASE_INSPECT_INPUT_SCHEMA = RELEASE_PLATFORM_INPUT_SCHEMA.extend({
|
|
163
|
+
releaseId: z.string().min(1),
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
const RELEASE_SUBMIT_INPUT_SCHEMA = RELEASE_PLATFORM_INPUT_SCHEMA.extend({
|
|
167
|
+
game: z.string().min(1),
|
|
168
|
+
versionLabel: z.string().optional(),
|
|
169
|
+
cwd: z.string().optional(),
|
|
170
|
+
distDir: z.string().optional(),
|
|
171
|
+
bundle: z.string().optional(),
|
|
172
|
+
skipBuild: z.boolean().optional(),
|
|
173
|
+
publish: z.boolean().optional(),
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
const RELEASE_PUBLISH_INPUT_SCHEMA = RELEASE_PLATFORM_INPUT_SCHEMA.extend({
|
|
177
|
+
releaseId: z.string().min(1),
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
export const READ_LOGS_INPUT_SCHEMA = z.object({
|
|
181
|
+
cwd: z.string().optional(),
|
|
182
|
+
view: z.string().optional(),
|
|
183
|
+
source: z.string().optional(),
|
|
184
|
+
trace: z.string().optional(),
|
|
185
|
+
room: z.string().optional(),
|
|
186
|
+
controller: z.string().optional(),
|
|
187
|
+
event: z.string().optional(),
|
|
188
|
+
process: z.string().optional(),
|
|
189
|
+
level: z.string().optional(),
|
|
190
|
+
runtime: z.string().optional(),
|
|
191
|
+
epoch: z.number().int().optional(),
|
|
192
|
+
consoleCategory: z.string().optional(),
|
|
193
|
+
file: z.string().optional(),
|
|
194
|
+
tail: z.number().int().nonnegative().optional(),
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
export const INSPECT_GAME_INPUT_SCHEMA = z.object({
|
|
198
|
+
cwd: z.string().optional(),
|
|
199
|
+
gameId: z.string().optional(),
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
export const STOP_DEV_INPUT_SCHEMA = z.object({
|
|
203
|
+
cwd: z.string().optional(),
|
|
204
|
+
processId: z.string().optional(),
|
|
205
|
+
mode: z.enum(["standalone-dev", "arcade-dev", "arcade-test"]).optional(),
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
const buildConnectControllerSchema = (projectMode: AirJamProjectMode) =>
|
|
209
|
+
z.object({
|
|
210
|
+
cwd: z.string().optional(),
|
|
211
|
+
gameId: z.string().optional(),
|
|
212
|
+
mode: buildHarnessModeSchema(projectMode),
|
|
213
|
+
secure: z.boolean().optional(),
|
|
214
|
+
roomId: z.string().min(1).optional(),
|
|
215
|
+
harnessSessionId: z.string().min(1).optional(),
|
|
216
|
+
controllerJoinUrl: z.string().url().optional(),
|
|
217
|
+
controllerId: z.string().min(3).optional(),
|
|
218
|
+
deviceId: z.string().min(8).optional(),
|
|
219
|
+
nickname: z.string().min(1).optional(),
|
|
220
|
+
avatarId: z.string().min(1).optional(),
|
|
221
|
+
capabilityToken: z.string().min(1).optional(),
|
|
222
|
+
timeoutMs: z.number().int().positive().optional(),
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
export const buildToolDefinitions = ({
|
|
226
|
+
projectMode,
|
|
227
|
+
}: {
|
|
228
|
+
projectMode: AirJamProjectMode;
|
|
229
|
+
}): Record<string, AirJamMcpToolDefinition> => {
|
|
230
|
+
const runQualityGateInputSchema = buildQualityGateSchema(projectMode);
|
|
231
|
+
const startDevInputSchema = buildStartDevSchema(projectMode);
|
|
232
|
+
const topologyInputSchema = buildTopologySchema(projectMode);
|
|
233
|
+
const captureVisualsInputSchema = buildCaptureVisualsSchema(projectMode);
|
|
234
|
+
const inspectGameAgentContractInputSchema = z.object({
|
|
235
|
+
cwd: z.string().optional(),
|
|
236
|
+
gameId: z.string().optional(),
|
|
237
|
+
});
|
|
238
|
+
const openGameSessionInputSchema = buildConnectControllerSchema(projectMode);
|
|
239
|
+
const gameSessionInputSchema = z.object({
|
|
240
|
+
gameSessionId: z.string().min(1),
|
|
241
|
+
});
|
|
242
|
+
const sendGameSessionInputSchema = gameSessionInputSchema.extend({
|
|
243
|
+
input: z.record(z.string(), z.unknown()),
|
|
244
|
+
});
|
|
245
|
+
const readGameSessionInputSchema = gameSessionInputSchema.extend({
|
|
246
|
+
requestSync: z.boolean().optional(),
|
|
247
|
+
timeoutMs: z.number().int().positive().optional(),
|
|
248
|
+
});
|
|
249
|
+
const invokeGameSessionActionInputSchema = gameSessionInputSchema.extend({
|
|
250
|
+
actionId: z.string().min(1),
|
|
251
|
+
payload: z.unknown().optional(),
|
|
252
|
+
timeoutMs: z.number().int().positive().optional(),
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
return {
|
|
256
|
+
"airjam.inspect_project": {
|
|
257
|
+
description:
|
|
258
|
+
"Inspect the current Air Jam project, detect monorepo vs standalone mode, and list available Air Jam capability groups.",
|
|
259
|
+
inputSchema: z.object({
|
|
260
|
+
cwd: z.string().optional(),
|
|
261
|
+
}),
|
|
262
|
+
run: async ({ cwd }: { cwd?: string }) =>
|
|
263
|
+
withJsonText(await inspectProject({ cwd })),
|
|
264
|
+
},
|
|
265
|
+
"airjam.list_games": {
|
|
266
|
+
description:
|
|
267
|
+
"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.",
|
|
268
|
+
inputSchema: z.object({
|
|
269
|
+
cwd: z.string().optional(),
|
|
270
|
+
}),
|
|
271
|
+
run: async ({ cwd }: { cwd?: string }) =>
|
|
272
|
+
withJsonText(await listGames({ cwd })),
|
|
273
|
+
},
|
|
274
|
+
"airjam.inspect_game": {
|
|
275
|
+
description:
|
|
276
|
+
"Inspect one Air Jam game, including config path, inferred controller route, agent-facing metadata, and available quality gates.",
|
|
277
|
+
inputSchema: INSPECT_GAME_INPUT_SCHEMA,
|
|
278
|
+
run: async ({ cwd, gameId }: { cwd?: string; gameId?: string }) =>
|
|
279
|
+
withJsonText(await inspectGame({ cwd, gameId })),
|
|
280
|
+
},
|
|
281
|
+
"airjam.inspect_game_agent_contract": {
|
|
282
|
+
description:
|
|
283
|
+
"Inspect one game's agent contract, including game-specific snapshot description and semantic controller action metadata.",
|
|
284
|
+
inputSchema: inspectGameAgentContractInputSchema,
|
|
285
|
+
run: async ({ cwd, gameId }: { cwd?: string; gameId?: string }) =>
|
|
286
|
+
withJsonText(await inspectGameAgentContract({ cwd, gameId })),
|
|
287
|
+
},
|
|
288
|
+
"airjam.read_logs": {
|
|
289
|
+
description:
|
|
290
|
+
"Read the canonical Air Jam unified dev log stream. Start with view=signal and a bounded tail before adding more filters.",
|
|
291
|
+
inputSchema: READ_LOGS_INPUT_SCHEMA,
|
|
292
|
+
run: async (input: z.infer<typeof READ_LOGS_INPUT_SCHEMA>) =>
|
|
293
|
+
withJsonText(await readDevLogs({ ...input, tail: input.tail ?? 200 })),
|
|
294
|
+
},
|
|
295
|
+
"airjam.run_quality_gate": {
|
|
296
|
+
description:
|
|
297
|
+
"Run one Air Jam quality gate such as typecheck, test, or build.",
|
|
298
|
+
inputSchema: runQualityGateInputSchema,
|
|
299
|
+
run: async (input: z.infer<typeof runQualityGateInputSchema>) =>
|
|
300
|
+
withJsonText(await runQualityGate(input)),
|
|
301
|
+
},
|
|
302
|
+
"airjam.auth_status": {
|
|
303
|
+
description:
|
|
304
|
+
"Inspect the locally stored Air Jam platform machine session used for hosted release operations.",
|
|
305
|
+
inputSchema: z.object({}),
|
|
306
|
+
run: async () => withJsonText(await getPlatformMachineAuthStatus()),
|
|
307
|
+
},
|
|
308
|
+
"airjam.release_doctor": {
|
|
309
|
+
description:
|
|
310
|
+
"Inspect a standalone Air Jam game project for hosted release readiness and return structured local doctor output.",
|
|
311
|
+
inputSchema: RELEASE_PROJECT_INPUT_SCHEMA,
|
|
312
|
+
run: async ({
|
|
313
|
+
cwd,
|
|
314
|
+
distDir,
|
|
315
|
+
}: z.infer<typeof RELEASE_PROJECT_INPUT_SCHEMA>) =>
|
|
316
|
+
withJsonText(await inspectLocalRelease({ cwd, distDir })),
|
|
317
|
+
},
|
|
318
|
+
"airjam.release_validate": {
|
|
319
|
+
description:
|
|
320
|
+
"Validate hosted release inputs for a standalone Air Jam game project or an existing hosted release zip.",
|
|
321
|
+
inputSchema: RELEASE_VALIDATE_INPUT_SCHEMA,
|
|
322
|
+
run: async ({
|
|
323
|
+
cwd,
|
|
324
|
+
distDir,
|
|
325
|
+
bundle,
|
|
326
|
+
skipBuild,
|
|
327
|
+
}: z.infer<typeof RELEASE_VALIDATE_INPUT_SCHEMA>) =>
|
|
328
|
+
withJsonText(
|
|
329
|
+
await validateLocalRelease({
|
|
330
|
+
cwd,
|
|
331
|
+
distDir,
|
|
332
|
+
bundlePath: bundle,
|
|
333
|
+
skipBuild,
|
|
334
|
+
}),
|
|
335
|
+
),
|
|
336
|
+
},
|
|
337
|
+
"airjam.release_bundle": {
|
|
338
|
+
description:
|
|
339
|
+
"Build and bundle a hosted release zip from a standalone Air Jam game project.",
|
|
340
|
+
inputSchema: RELEASE_BUNDLE_INPUT_SCHEMA,
|
|
341
|
+
execution: {
|
|
342
|
+
taskSupport: "required",
|
|
343
|
+
},
|
|
344
|
+
run: async ({
|
|
345
|
+
cwd,
|
|
346
|
+
distDir,
|
|
347
|
+
out,
|
|
348
|
+
skipBuild,
|
|
349
|
+
}: z.infer<typeof RELEASE_BUNDLE_INPUT_SCHEMA>) =>
|
|
350
|
+
withJsonText(
|
|
351
|
+
await bundleLocalRelease({
|
|
352
|
+
cwd,
|
|
353
|
+
distDir,
|
|
354
|
+
out,
|
|
355
|
+
skipBuild,
|
|
356
|
+
}),
|
|
357
|
+
),
|
|
358
|
+
},
|
|
359
|
+
"airjam.release_list": {
|
|
360
|
+
description:
|
|
361
|
+
"List owned hosted games or, when given a game slug or id, list its hosted releases.",
|
|
362
|
+
inputSchema: RELEASE_LIST_INPUT_SCHEMA,
|
|
363
|
+
run: async ({
|
|
364
|
+
platformUrl,
|
|
365
|
+
game,
|
|
366
|
+
}: z.infer<typeof RELEASE_LIST_INPUT_SCHEMA>) =>
|
|
367
|
+
withJsonText(
|
|
368
|
+
game
|
|
369
|
+
? await listPlatformReleases({
|
|
370
|
+
platformUrl,
|
|
371
|
+
slugOrId: game,
|
|
372
|
+
})
|
|
373
|
+
: await listPlatformReleaseTargets({
|
|
374
|
+
platformUrl,
|
|
375
|
+
}),
|
|
376
|
+
),
|
|
377
|
+
},
|
|
378
|
+
"airjam.release_inspect": {
|
|
379
|
+
description: "Inspect one hosted release on the Air Jam platform.",
|
|
380
|
+
inputSchema: RELEASE_INSPECT_INPUT_SCHEMA,
|
|
381
|
+
run: async ({
|
|
382
|
+
platformUrl,
|
|
383
|
+
releaseId,
|
|
384
|
+
}: z.infer<typeof RELEASE_INSPECT_INPUT_SCHEMA>) =>
|
|
385
|
+
withJsonText(
|
|
386
|
+
await inspectPlatformRelease({
|
|
387
|
+
platformUrl,
|
|
388
|
+
releaseId,
|
|
389
|
+
}),
|
|
390
|
+
),
|
|
391
|
+
},
|
|
392
|
+
"airjam.release_submit": {
|
|
393
|
+
description:
|
|
394
|
+
"Bundle a standalone Air Jam game if needed, upload it as a hosted release draft, finalize it, and optionally publish it.",
|
|
395
|
+
inputSchema: RELEASE_SUBMIT_INPUT_SCHEMA,
|
|
396
|
+
execution: {
|
|
397
|
+
taskSupport: "required",
|
|
398
|
+
},
|
|
399
|
+
run: async ({
|
|
400
|
+
platformUrl,
|
|
401
|
+
game,
|
|
402
|
+
versionLabel,
|
|
403
|
+
cwd,
|
|
404
|
+
distDir,
|
|
405
|
+
bundle,
|
|
406
|
+
skipBuild,
|
|
407
|
+
publish,
|
|
408
|
+
}: z.infer<typeof RELEASE_SUBMIT_INPUT_SCHEMA>) =>
|
|
409
|
+
withJsonText(
|
|
410
|
+
await submitPlatformRelease({
|
|
411
|
+
platformUrl,
|
|
412
|
+
slugOrId: game,
|
|
413
|
+
versionLabel,
|
|
414
|
+
cwd,
|
|
415
|
+
distDir,
|
|
416
|
+
bundlePath: bundle,
|
|
417
|
+
skipBuild,
|
|
418
|
+
publish,
|
|
419
|
+
}),
|
|
420
|
+
),
|
|
421
|
+
},
|
|
422
|
+
"airjam.release_publish": {
|
|
423
|
+
description: "Publish one ready hosted release on the Air Jam platform.",
|
|
424
|
+
inputSchema: RELEASE_PUBLISH_INPUT_SCHEMA,
|
|
425
|
+
run: async ({
|
|
426
|
+
platformUrl,
|
|
427
|
+
releaseId,
|
|
428
|
+
}: z.infer<typeof RELEASE_PUBLISH_INPUT_SCHEMA>) =>
|
|
429
|
+
withJsonText(
|
|
430
|
+
await publishPlatformRelease({
|
|
431
|
+
platformUrl,
|
|
432
|
+
releaseId,
|
|
433
|
+
}),
|
|
434
|
+
),
|
|
435
|
+
},
|
|
436
|
+
"airjam.start_dev": {
|
|
437
|
+
description:
|
|
438
|
+
"Start the Air Jam local dev stack for the current project and return the managed process id plus resolved topology.",
|
|
439
|
+
inputSchema: startDevInputSchema,
|
|
440
|
+
run: async (input: z.infer<typeof startDevInputSchema>) =>
|
|
441
|
+
withJsonText(await startDev(input)),
|
|
442
|
+
},
|
|
443
|
+
"airjam.stop_dev": {
|
|
444
|
+
description:
|
|
445
|
+
"Stop one or more Air Jam dev processes previously started by devtools-core.",
|
|
446
|
+
inputSchema: STOP_DEV_INPUT_SCHEMA,
|
|
447
|
+
run: async (input: z.infer<typeof STOP_DEV_INPUT_SCHEMA>) =>
|
|
448
|
+
withJsonText(await stopDev(input)),
|
|
449
|
+
},
|
|
450
|
+
"airjam.status": {
|
|
451
|
+
description:
|
|
452
|
+
"List Air Jam dev processes plus unmanaged listeners on known local Air Jam ports.",
|
|
453
|
+
inputSchema: z.object({
|
|
454
|
+
cwd: z.string().optional(),
|
|
455
|
+
}),
|
|
456
|
+
run: async ({ cwd }: { cwd?: string }) =>
|
|
457
|
+
withJsonText(await getDevStatus({ cwd })),
|
|
458
|
+
},
|
|
459
|
+
"airjam.reset_local": {
|
|
460
|
+
description:
|
|
461
|
+
"Best-effort cleanup for local Air Jam dev state: stop managed dev processes and stale known-port Air Jam listeners.",
|
|
462
|
+
inputSchema: z.object({
|
|
463
|
+
cwd: z.string().optional(),
|
|
464
|
+
}),
|
|
465
|
+
run: async ({ cwd }: { cwd?: string }) =>
|
|
466
|
+
withJsonText(await resetLocalDev({ cwd })),
|
|
467
|
+
},
|
|
468
|
+
"airjam.topology": {
|
|
469
|
+
description:
|
|
470
|
+
"Return the resolved runtime topology and endpoint summary for the current project mode.",
|
|
471
|
+
inputSchema: topologyInputSchema,
|
|
472
|
+
run: async (input: z.infer<typeof topologyInputSchema>) =>
|
|
473
|
+
withJsonText(await getTopology(input)),
|
|
474
|
+
},
|
|
475
|
+
"airjam.list_visual_scenarios": {
|
|
476
|
+
description:
|
|
477
|
+
"Internal experimental visual harness tool: load one game's visual scenario pack and list scenario ids plus harness action metadata.",
|
|
478
|
+
inputSchema: INSPECT_GAME_INPUT_SCHEMA,
|
|
479
|
+
run: async ({ cwd, gameId }: { cwd?: string; gameId?: string }) =>
|
|
480
|
+
withJsonText(await listVisualScenarios({ cwd, gameId })),
|
|
481
|
+
},
|
|
482
|
+
"airjam.capture_visuals": {
|
|
483
|
+
description:
|
|
484
|
+
"Internal experimental visual harness tool: run Air Jam visual capture for one game and return artifact metadata and screenshot paths. Prefer embedded browser screenshots for normal visual proof.",
|
|
485
|
+
inputSchema: captureVisualsInputSchema,
|
|
486
|
+
execution: {
|
|
487
|
+
taskSupport: "required",
|
|
488
|
+
},
|
|
489
|
+
run: async (input: z.infer<typeof captureVisualsInputSchema>) =>
|
|
490
|
+
withJsonText(await captureVisuals(input)),
|
|
491
|
+
},
|
|
492
|
+
"airjam.open_game_session": {
|
|
493
|
+
description:
|
|
494
|
+
"Open one high-level Air Jam game session by connecting a virtual controller and discovering published semantic game actions for the same room.",
|
|
495
|
+
inputSchema: openGameSessionInputSchema,
|
|
496
|
+
run: async (input: z.infer<typeof openGameSessionInputSchema>) =>
|
|
497
|
+
withJsonText(await openGameSession(input)),
|
|
498
|
+
},
|
|
499
|
+
"airjam.send_game_session_input": {
|
|
500
|
+
description:
|
|
501
|
+
"Send one real player-style input payload through a previously opened Air Jam game session.",
|
|
502
|
+
inputSchema: sendGameSessionInputSchema,
|
|
503
|
+
run: async (input: z.infer<typeof sendGameSessionInputSchema>) =>
|
|
504
|
+
withJsonText(await sendGameSessionInput(input)),
|
|
505
|
+
},
|
|
506
|
+
"airjam.read_game_session": {
|
|
507
|
+
description:
|
|
508
|
+
"Read one high-level Air Jam game session, including runtime controller state plus any available semantic game snapshot.",
|
|
509
|
+
inputSchema: readGameSessionInputSchema,
|
|
510
|
+
run: async (input: z.infer<typeof readGameSessionInputSchema>) =>
|
|
511
|
+
withJsonText(await readGameSession(input)),
|
|
512
|
+
},
|
|
513
|
+
"airjam.invoke_game_session_action": {
|
|
514
|
+
description:
|
|
515
|
+
"Invoke one discovered game-session action by its unified session action id, without manually choosing between player-semantic and host-staging internals.",
|
|
516
|
+
inputSchema: invokeGameSessionActionInputSchema,
|
|
517
|
+
run: async (input: z.infer<typeof invokeGameSessionActionInputSchema>) =>
|
|
518
|
+
withJsonText(await invokeGameSessionAction(input)),
|
|
519
|
+
},
|
|
520
|
+
"airjam.close_game_session": {
|
|
521
|
+
description:
|
|
522
|
+
"Close one previously opened Air Jam game session and disconnect its virtual controller.",
|
|
523
|
+
inputSchema: gameSessionInputSchema,
|
|
524
|
+
run: async ({ gameSessionId }: { gameSessionId: string }) =>
|
|
525
|
+
withJsonText(await closeGameSession({ gameSessionId })),
|
|
526
|
+
},
|
|
527
|
+
"airjam.list_visual_capture_summaries": {
|
|
528
|
+
description:
|
|
529
|
+
"Internal experimental visual harness tool: list existing visual capture summaries already written under .airjam/artifacts/visual.",
|
|
530
|
+
inputSchema: z.object({
|
|
531
|
+
cwd: z.string().optional(),
|
|
532
|
+
}),
|
|
533
|
+
run: async ({ cwd }: { cwd?: string }) =>
|
|
534
|
+
withJsonText(await listVisualCaptureSummaries({ cwd })),
|
|
535
|
+
},
|
|
536
|
+
"airjam.read_visual_capture_summary": {
|
|
537
|
+
description:
|
|
538
|
+
"Internal experimental visual harness tool: read one visual capture summary for a game from .airjam/artifacts/visual/<game>/capture-summary.json.",
|
|
539
|
+
inputSchema: INSPECT_GAME_INPUT_SCHEMA,
|
|
540
|
+
run: async ({ cwd, gameId }: { cwd?: string; gameId?: string }) =>
|
|
541
|
+
withJsonText(await readVisualCaptureSummary({ cwd, gameId })),
|
|
542
|
+
},
|
|
543
|
+
} as const;
|
|
544
|
+
};
|
|
545
|
+
|
|
546
|
+
export type AirJamMcpToolDefinitions = ReturnType<typeof buildToolDefinitions>;
|
|
547
|
+
|
|
548
|
+
export const getRegisteredToolNamesForProjectMode = (
|
|
549
|
+
projectMode: AirJamProjectMode,
|
|
550
|
+
): ReadonlyArray<keyof AirJamMcpToolDefinitions> => {
|
|
551
|
+
if (projectMode === "monorepo") {
|
|
552
|
+
return [
|
|
553
|
+
"airjam.inspect_project",
|
|
554
|
+
"airjam.auth_status",
|
|
555
|
+
"airjam.list_games",
|
|
556
|
+
"airjam.inspect_game",
|
|
557
|
+
"airjam.inspect_game_agent_contract",
|
|
558
|
+
"airjam.read_logs",
|
|
559
|
+
"airjam.run_quality_gate",
|
|
560
|
+
"airjam.release_list",
|
|
561
|
+
"airjam.release_inspect",
|
|
562
|
+
"airjam.release_publish",
|
|
563
|
+
"airjam.start_dev",
|
|
564
|
+
"airjam.stop_dev",
|
|
565
|
+
"airjam.status",
|
|
566
|
+
"airjam.reset_local",
|
|
567
|
+
"airjam.topology",
|
|
568
|
+
"airjam.open_game_session",
|
|
569
|
+
"airjam.send_game_session_input",
|
|
570
|
+
"airjam.read_game_session",
|
|
571
|
+
"airjam.invoke_game_session_action",
|
|
572
|
+
"airjam.close_game_session",
|
|
573
|
+
] as const;
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
if (projectMode === "standalone-game") {
|
|
577
|
+
return [
|
|
578
|
+
"airjam.inspect_project",
|
|
579
|
+
"airjam.auth_status",
|
|
580
|
+
"airjam.list_games",
|
|
581
|
+
"airjam.inspect_game",
|
|
582
|
+
"airjam.inspect_game_agent_contract",
|
|
583
|
+
"airjam.read_logs",
|
|
584
|
+
"airjam.run_quality_gate",
|
|
585
|
+
"airjam.release_doctor",
|
|
586
|
+
"airjam.release_validate",
|
|
587
|
+
"airjam.release_bundle",
|
|
588
|
+
"airjam.release_list",
|
|
589
|
+
"airjam.release_inspect",
|
|
590
|
+
"airjam.release_submit",
|
|
591
|
+
"airjam.release_publish",
|
|
592
|
+
"airjam.start_dev",
|
|
593
|
+
"airjam.stop_dev",
|
|
594
|
+
"airjam.status",
|
|
595
|
+
"airjam.reset_local",
|
|
596
|
+
"airjam.topology",
|
|
597
|
+
"airjam.open_game_session",
|
|
598
|
+
"airjam.send_game_session_input",
|
|
599
|
+
"airjam.read_game_session",
|
|
600
|
+
"airjam.invoke_game_session_action",
|
|
601
|
+
"airjam.close_game_session",
|
|
602
|
+
] as const;
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
return ["airjam.inspect_project"] as const;
|
|
606
|
+
};
|
package/src/types.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type AirJamProjectLocalMcpConfig = {
|
|
2
|
+
mcpServers: {
|
|
3
|
+
airjam: {
|
|
4
|
+
command: string;
|
|
5
|
+
args: string[];
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export type InspectMcpProjectSetupResult = {
|
|
11
|
+
projectDir: string;
|
|
12
|
+
configPath: string;
|
|
13
|
+
hasConfigFile: boolean;
|
|
14
|
+
hasMcpScript: boolean;
|
|
15
|
+
hasMcpDependency: boolean;
|
|
16
|
+
recommendedConfig: AirJamProjectLocalMcpConfig;
|
|
17
|
+
};
|