@air-jam/devtools 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.
Files changed (263) hide show
  1. package/README.md +60 -0
  2. package/dist/{chunk-VKMJO6VN.js → chunk-2O67AXCU.js} +150 -40
  3. package/dist/chunk-2O67AXCU.js.map +1 -0
  4. package/dist/chunk-AO3ZDXF6.js +142 -0
  5. package/dist/chunk-AO3ZDXF6.js.map +1 -0
  6. package/dist/chunk-ART5TEYT.js +472 -0
  7. package/dist/chunk-ART5TEYT.js.map +1 -0
  8. package/dist/chunk-ASC2CK2R.js +77 -0
  9. package/dist/chunk-ASC2CK2R.js.map +1 -0
  10. package/dist/chunk-E3UZZGAV.js +50 -0
  11. package/dist/chunk-E3UZZGAV.js.map +1 -0
  12. package/dist/chunk-EJTE7UKX.js +64 -0
  13. package/dist/chunk-EJTE7UKX.js.map +1 -0
  14. package/dist/chunk-ESFKNN75.js +110 -0
  15. package/dist/chunk-ESFKNN75.js.map +1 -0
  16. package/dist/chunk-EU7A6PXW.js +1339 -0
  17. package/dist/chunk-EU7A6PXW.js.map +1 -0
  18. package/dist/chunk-FN7E6EA7.js +549 -0
  19. package/dist/chunk-FN7E6EA7.js.map +1 -0
  20. package/dist/chunk-GDFAWHGA.js +190 -0
  21. package/dist/chunk-GDFAWHGA.js.map +1 -0
  22. package/dist/chunk-HZUGBH4Y.js +347 -0
  23. package/dist/chunk-HZUGBH4Y.js.map +1 -0
  24. package/dist/chunk-ITKAOEGX.js +93 -0
  25. package/dist/chunk-ITKAOEGX.js.map +1 -0
  26. package/dist/chunk-JBCUTWRI.js +897 -0
  27. package/dist/chunk-JBCUTWRI.js.map +1 -0
  28. package/dist/chunk-JSI5S4WP.js +1174 -0
  29. package/dist/chunk-JSI5S4WP.js.map +1 -0
  30. package/dist/chunk-L4D675BG.js +97 -0
  31. package/dist/chunk-L4D675BG.js.map +1 -0
  32. package/dist/chunk-M6CJ7GQC.js +133 -0
  33. package/dist/chunk-M6CJ7GQC.js.map +1 -0
  34. package/dist/{chunk-CKFT2ZJE.js → chunk-MEIMOSZC.js} +53 -105
  35. package/dist/chunk-MEIMOSZC.js.map +1 -0
  36. package/dist/{chunk-GUEZP773.js → chunk-O3XG3FNL.js} +204 -41
  37. package/dist/chunk-O3XG3FNL.js.map +1 -0
  38. package/dist/chunk-OM6SCJ7H.js +18 -0
  39. package/dist/chunk-OM6SCJ7H.js.map +1 -0
  40. package/dist/chunk-PKD4WVX5.js +63 -0
  41. package/dist/chunk-PKD4WVX5.js.map +1 -0
  42. package/dist/chunk-PMBLXGFM.js +3384 -0
  43. package/dist/chunk-PMBLXGFM.js.map +1 -0
  44. package/dist/chunk-PMNE5GIN.js +279 -0
  45. package/dist/chunk-PMNE5GIN.js.map +1 -0
  46. package/dist/chunk-QAWI64VR.js +148 -0
  47. package/dist/chunk-QAWI64VR.js.map +1 -0
  48. package/dist/chunk-QGADSPHZ.js +449 -0
  49. package/dist/chunk-QGADSPHZ.js.map +1 -0
  50. package/dist/chunk-SPYN66UV.js +338 -0
  51. package/dist/chunk-SPYN66UV.js.map +1 -0
  52. package/dist/context.d.ts +9 -3
  53. package/dist/context.js +2 -1
  54. package/dist/controller.d.ts +33 -7
  55. package/dist/controller.js +18 -8
  56. package/dist/dependencies.d.ts +44 -0
  57. package/dist/dependencies.js +10 -0
  58. package/dist/dev.d.ts +9 -3
  59. package/dist/dev.js +3 -4
  60. package/dist/game-builds.d.ts +200 -0
  61. package/dist/game-builds.js +16 -0
  62. package/dist/game-builds.js.map +1 -0
  63. package/dist/game-run-watch-CEd_SpAT.d.ts +84 -0
  64. package/dist/game-runs.d.ts +1452 -0
  65. package/dist/game-runs.js +76 -0
  66. package/dist/game-runs.js.map +1 -0
  67. package/dist/game-session-broker-CUvORfMd.d.ts +439 -0
  68. package/dist/game-session-broker.d.ts +4 -57
  69. package/dist/game-session-broker.js +33 -228
  70. package/dist/game-session-broker.js.map +1 -1
  71. package/dist/game-session.d.ts +3931 -10
  72. package/dist/game-session.js +186 -15
  73. package/dist/game-session.js.map +1 -1
  74. package/dist/game-settings.d.ts +16 -0
  75. package/dist/game-settings.js +237 -0
  76. package/dist/game-settings.js.map +1 -0
  77. package/dist/games.d.ts +11 -4
  78. package/dist/games.js +4 -2
  79. package/dist/harness/visual.d.ts +34 -151
  80. package/dist/harness/visual.js +6 -1
  81. package/dist/logs.d.ts +8 -2
  82. package/dist/logs.js +3 -4
  83. package/dist/logs.js.map +1 -1
  84. package/dist/managed-process-scope-BicYi_t9.d.ts +3 -0
  85. package/dist/mcp-config.js +2 -1
  86. package/dist/mcp-config.js.map +1 -1
  87. package/dist/platform-auth.d.ts +8 -111
  88. package/dist/platform-auth.js +9 -1
  89. package/dist/platform-game-analytics.d.ts +51 -0
  90. package/dist/platform-game-analytics.js +49 -0
  91. package/dist/platform-game-analytics.js.map +1 -0
  92. package/dist/platform-game-app-id.d.ts +46 -0
  93. package/dist/platform-game-app-id.js +93 -0
  94. package/dist/platform-game-app-id.js.map +1 -0
  95. package/dist/platform-game-media.d.ts +40 -2
  96. package/dist/platform-game-media.js +1 -1
  97. package/dist/platform-games.d.ts +24 -2
  98. package/dist/platform-games.js +16 -84
  99. package/dist/platform-games.js.map +1 -1
  100. package/dist/quality.d.ts +9 -3
  101. package/dist/quality.js +3 -4
  102. package/dist/quality.js.map +1 -1
  103. package/dist/release.d.ts +226 -16
  104. package/dist/release.js +18 -1331
  105. package/dist/release.js.map +1 -1
  106. package/dist/rooms-check.d.ts +90 -0
  107. package/dist/rooms-check.js +717 -0
  108. package/dist/rooms-check.js.map +1 -0
  109. package/dist/source-tree-contract.d.ts +16 -0
  110. package/dist/source-tree-contract.js +13 -0
  111. package/dist/source-tree-contract.js.map +1 -0
  112. package/dist/testing.d.ts +464 -0
  113. package/dist/testing.js +27 -0
  114. package/dist/testing.js.map +1 -0
  115. package/dist/tooling/describe-game.js +54 -0
  116. package/dist/tooling/describe-game.js.map +1 -0
  117. package/dist/tooling/game-session-broker.js +28 -0
  118. package/dist/tooling/game-session-broker.js.map +1 -0
  119. package/dist/tooling/hold-runtime-host.js +769 -67
  120. package/dist/tooling/hold-runtime-host.js.map +1 -1
  121. package/dist/tooling/list-visual-scenarios.js +18 -55
  122. package/dist/tooling/list-visual-scenarios.js.map +1 -1
  123. package/dist/tooling/process-scope-bootstrap.mjs +24 -0
  124. package/dist/tooling/process-scope-guard.d.ts +2 -0
  125. package/dist/tooling/process-scope-guard.js +388 -0
  126. package/dist/tooling/process-scope-guard.js.map +1 -0
  127. package/dist/tooling/process-scope-windows.ps1 +148 -0
  128. package/dist/tooling/rooms-check-device.d.ts +2 -0
  129. package/dist/tooling/rooms-check-device.js +498 -0
  130. package/dist/tooling/rooms-check-device.js.map +1 -0
  131. package/dist/tooling/run-headless-room.d.ts +2 -0
  132. package/dist/tooling/run-headless-room.js +287 -0
  133. package/dist/tooling/run-headless-room.js.map +1 -0
  134. package/dist/tooling/run-test-profile.d.ts +2 -0
  135. package/dist/tooling/run-test-profile.js +181 -0
  136. package/dist/tooling/run-test-profile.js.map +1 -0
  137. package/dist/tooling/run-visual-capture.js +70 -34
  138. package/dist/tooling/run-visual-capture.js.map +1 -1
  139. package/dist/tooling/seal-game-build.d.ts +2 -0
  140. package/dist/tooling/seal-game-build.js +120 -0
  141. package/dist/tooling/seal-game-build.js.map +1 -0
  142. package/dist/{types-C6NrHt88.d.ts → types-CdYrgrG_.d.ts} +337 -76
  143. package/dist/types-DyRD-ym1.d.ts +141 -0
  144. package/dist/visual.d.ts +9 -3
  145. package/dist/visual.js +24 -68
  146. package/dist/visual.js.map +1 -1
  147. package/package.json +51 -14
  148. package/src/bounded-response.ts +28 -0
  149. package/src/built-game-runtime.ts +152 -0
  150. package/src/context.ts +2 -13
  151. package/src/controller-protocol.ts +22 -0
  152. package/src/controller.ts +747 -597
  153. package/src/current-room-host.ts +166 -0
  154. package/src/decision-provider.ts +102 -0
  155. package/src/dependencies.ts +176 -0
  156. package/src/dependency-install-contract.ts +12 -0
  157. package/src/dev.ts +46 -50
  158. package/src/game-action-observation.ts +11 -1
  159. package/src/game-build-protocol.ts +72 -0
  160. package/src/game-build.ts +483 -0
  161. package/src/game-run-owner.ts +2358 -0
  162. package/src/game-run-protocol.ts +448 -0
  163. package/src/game-run-record.ts +92 -0
  164. package/src/game-run-replay.ts +95 -0
  165. package/src/game-run-watch.ts +155 -0
  166. package/src/game-session-broker.ts +689 -197
  167. package/src/game-session-operations.ts +61 -0
  168. package/src/game-session-protocol.ts +180 -0
  169. package/src/game-session-runtime.ts +861 -0
  170. package/src/game-session.ts +164 -417
  171. package/src/game-settings.ts +295 -0
  172. package/src/games.ts +88 -92
  173. package/src/harness/visual/browser.ts +100 -0
  174. package/src/harness/visual/controller-observation.ts +181 -0
  175. package/src/harness/visual/runner.ts +24 -21
  176. package/src/harness/visual/runtime-controller-observations.ts +151 -0
  177. package/src/harness/visual/scenario-contract.ts +1 -2
  178. package/src/harness/visual/scenario-helpers.ts +5 -1
  179. package/src/harness/visual/screencast.ts +155 -0
  180. package/src/harness/visual/session.ts +72 -41
  181. package/src/harness/visual/types.ts +8 -5
  182. package/src/headless-room-protocol.ts +112 -0
  183. package/src/headless-room.ts +222 -0
  184. package/src/helper-channel.ts +229 -0
  185. package/src/helper-scripts.ts +25 -5
  186. package/src/installed-dependencies.ts +74 -0
  187. package/src/managed-process-scope.ts +481 -0
  188. package/src/node-process-environment.ts +10 -0
  189. package/src/platform-auth.ts +194 -55
  190. package/src/platform-game-analytics.ts +50 -0
  191. package/src/platform-game-app-id.ts +99 -0
  192. package/src/platform-games.ts +13 -111
  193. package/src/policy-artifact-contract.ts +52 -0
  194. package/src/policy-artifacts.ts +134 -0
  195. package/src/process-scope-admission.ts +50 -0
  196. package/src/process-scope-protocol.ts +66 -0
  197. package/src/process-scope.ts +327 -0
  198. package/src/release.ts +28 -42
  199. package/src/rooms-check-fleet.ts +194 -0
  200. package/src/rooms-check-link.ts +138 -0
  201. package/src/rooms-check-protocol.ts +244 -0
  202. package/src/rooms-check.ts +797 -0
  203. package/src/runtime-owner-protocol.ts +106 -18
  204. package/src/source-tree-contract.ts +70 -0
  205. package/src/source-tree.ts +84 -0
  206. package/src/test-profile-process.ts +153 -0
  207. package/src/test-profile-protocol.ts +116 -0
  208. package/src/testing.ts +430 -0
  209. package/src/tooling/declaration-hook.ts +52 -0
  210. package/src/tooling/describe-game.ts +49 -0
  211. package/src/tooling/game-session-broker.ts +7 -0
  212. package/src/tooling/hold-runtime-host.ts +255 -38
  213. package/src/tooling/list-visual-scenarios.ts +19 -62
  214. package/src/tooling/load-game.ts +79 -0
  215. package/src/tooling/process-scope-bootstrap.mjs +24 -0
  216. package/src/tooling/process-scope-guard.ts +213 -0
  217. package/src/tooling/process-scope-windows.ps1 +148 -0
  218. package/src/tooling/rooms-check-device.ts +493 -0
  219. package/src/tooling/run-headless-room.ts +326 -0
  220. package/src/tooling/run-test-profile.ts +190 -0
  221. package/src/tooling/run-visual-capture.ts +37 -23
  222. package/src/tooling/runtime-owner-actions.ts +23 -0
  223. package/src/tooling/seal-game-build.ts +118 -0
  224. package/src/tooling/visual-pack.ts +10 -45
  225. package/src/types.ts +54 -77
  226. package/src/visual.ts +14 -22
  227. package/src/windows-process-scopes.ts +189 -0
  228. package/dist/agent.d.ts +0 -15
  229. package/dist/agent.js +0 -19
  230. package/dist/chunk-5YAARMW5.js +0 -36
  231. package/dist/chunk-5YAARMW5.js.map +0 -1
  232. package/dist/chunk-6WQODT37.js +0 -1019
  233. package/dist/chunk-6WQODT37.js.map +0 -1
  234. package/dist/chunk-CKFT2ZJE.js.map +0 -1
  235. package/dist/chunk-ER3Q2C4G.js +0 -358
  236. package/dist/chunk-ER3Q2C4G.js.map +0 -1
  237. package/dist/chunk-GUEZP773.js.map +0 -1
  238. package/dist/chunk-HIDNI56E.js +0 -33
  239. package/dist/chunk-HIDNI56E.js.map +0 -1
  240. package/dist/chunk-QKXS5D35.js +0 -43
  241. package/dist/chunk-QKXS5D35.js.map +0 -1
  242. package/dist/chunk-S4LSCEVE.js +0 -261
  243. package/dist/chunk-S4LSCEVE.js.map +0 -1
  244. package/dist/chunk-VKMJO6VN.js.map +0 -1
  245. package/dist/chunk-WFUR3MXY.js +0 -67
  246. package/dist/chunk-WFUR3MXY.js.map +0 -1
  247. package/dist/chunk-XEMR7KUE.js +0 -361
  248. package/dist/chunk-XEMR7KUE.js.map +0 -1
  249. package/dist/chunk-ZLPD7FY5.js +0 -191
  250. package/dist/chunk-ZLPD7FY5.js.map +0 -1
  251. package/dist/tooling/agent-contract.js +0 -193
  252. package/dist/tooling/agent-contract.js.map +0 -1
  253. package/dist/tooling/inspect-airjam-agent.js +0 -37
  254. package/dist/tooling/inspect-airjam-agent.js.map +0 -1
  255. package/src/agent.ts +0 -380
  256. package/src/tooling/agent-contract.ts +0 -232
  257. package/src/tooling/agent-declaration.ts +0 -36
  258. package/src/tooling/airjam-agent-inspection.ts +0 -45
  259. package/src/tooling/airjam-agent.ts +0 -118
  260. package/src/tooling/inspect-airjam-agent.ts +0 -20
  261. /package/dist/{agent.js.map → dependencies.js.map} +0 -0
  262. /package/dist/tooling/{agent-contract.d.ts → describe-game.d.ts} +0 -0
  263. /package/dist/tooling/{inspect-airjam-agent.d.ts → game-session-broker.d.ts} +0 -0
@@ -0,0 +1,190 @@
1
+ // src/rooms-check-protocol.ts
2
+ import { z } from "zod";
3
+ var keySchema = z.string().min(16).max(128);
4
+ var codeSchema = z.string().min(4).max(8);
5
+ var linkSchema = z.object({
6
+ url: z.string(),
7
+ /** The Origin header each connection sends. */
8
+ origin: z.string().optional()
9
+ });
10
+ var credentialCommandSchema = z.string().min(1).optional();
11
+ var deviceCommandSchema = z.discriminatedUnion("type", [
12
+ z.object({
13
+ type: z.literal("host"),
14
+ link: linkSchema,
15
+ key: keySchema,
16
+ code: codeSchema.optional(),
17
+ /** A host resuming its instance asks for no credential. */
18
+ instance: z.string().optional(),
19
+ credentialCommand: credentialCommandSchema,
20
+ seats: z.number().int().min(1).max(16),
21
+ statesPerSecond: z.number().nonnegative(),
22
+ /** False sends no client pings, as a hidden tab's throttled timers do. */
23
+ heartbeat: z.boolean()
24
+ }),
25
+ z.object({
26
+ type: z.literal("phone"),
27
+ link: linkSchema,
28
+ key: keySchema,
29
+ code: codeSchema,
30
+ instance: z.string().optional(),
31
+ inputsPerSecond: z.number().nonnegative()
32
+ }),
33
+ /** An idle phone taps once. */
34
+ z.object({ type: z.literal("press") }),
35
+ /** The device's network stalls, holding every byte both ways, or comes back. */
36
+ z.object({ type: z.literal("network"), stalled: z.boolean() }),
37
+ /** The connection the device asked to open with `dial` may open now. */
38
+ z.object({ type: z.literal("dial"), id: z.number().int() }),
39
+ z.object({
40
+ type: z.literal("load"),
41
+ link: linkSchema,
42
+ credentialCommand: credentialCommandSchema,
43
+ rooms: z.number().int().positive(),
44
+ phonesPerRoom: z.number().int().min(1).max(16),
45
+ inputsPerSecond: z.number().positive(),
46
+ statesPerSecond: z.number().nonnegative(),
47
+ durationMs: z.number().int().positive()
48
+ })
49
+ ]);
50
+ var statusSchema = z.object({
51
+ phase: z.enum(["connecting", "waiting", "open", "reconnecting", "closed"]),
52
+ reason: z.string().optional()
53
+ });
54
+ var latencySummarySchema = z.object({
55
+ count: z.number(),
56
+ medianMs: z.number().nullable(),
57
+ p99Ms: z.number().nullable(),
58
+ maximumMs: z.number().nullable()
59
+ });
60
+ var trafficSchema = z.object({
61
+ /** Messages and payload bytes the devices sent to the room server. */
62
+ messagesIn: z.number(),
63
+ bytesIn: z.number(),
64
+ /** Messages and payload bytes the room server sent to the devices. */
65
+ messagesOut: z.number(),
66
+ bytesOut: z.number()
67
+ });
68
+ var loadResultSchema = z.object({
69
+ roomsOpened: z.number(),
70
+ phonesJoined: z.number(),
71
+ roomOpenMs: z.array(z.number()),
72
+ phoneJoinMs: z.array(z.number()),
73
+ /** Tap to host, per press, measured within the worker on one clock. */
74
+ inputLatencyMs: z.array(z.number()),
75
+ pressesSent: z.number(),
76
+ pressesLost: z.number(),
77
+ stateLatencyMs: z.array(z.number()),
78
+ /** Joined phones whose copy did not end equal to what their host last published. */
79
+ phonesWithoutState: z.number(),
80
+ traffic: trafficSchema,
81
+ cpuMs: z.number()
82
+ });
83
+ var linkProblemSchema = z.discriminatedUnion("kind", [
84
+ /** The server answered the upgrade with this HTTP status instead of a socket. */
85
+ z.object({ kind: z.literal("refused"), status: z.number() }),
86
+ /** No answer: the network or TLS error, or the handshake timing out. */
87
+ z.object({ kind: z.literal("failed"), error: z.string() }),
88
+ /** An open connection closed without the device asking, with the room's reason when the code has one. */
89
+ z.object({
90
+ kind: z.literal("closed"),
91
+ code: z.number(),
92
+ reason: z.string().nullable()
93
+ })
94
+ ]);
95
+ var describeLinkProblem = (problem) => {
96
+ switch (problem.kind) {
97
+ case "refused":
98
+ return `refused with HTTP ${problem.status}`;
99
+ case "failed":
100
+ return `failed to open: ${problem.error}`;
101
+ case "closed":
102
+ return `closed with ${problem.code}${problem.reason ? ` (${problem.reason})` : ""}`;
103
+ }
104
+ };
105
+ var deviceEventSchema = z.discriminatedUnion("type", [
106
+ z.object({
107
+ type: z.literal("status"),
108
+ at: z.number(),
109
+ status: statusSchema,
110
+ code: z.string().optional(),
111
+ instance: z.string().optional(),
112
+ seat: z.string().optional(),
113
+ hostGraceMs: z.number().optional()
114
+ }),
115
+ z.object({
116
+ type: z.literal("seats"),
117
+ at: z.number(),
118
+ seats: z.array(z.object({ id: z.string(), connected: z.boolean() }))
119
+ }),
120
+ z.object({ type: z.literal("host"), at: z.number(), present: z.boolean() }),
121
+ /** A phone pressed: its button's press count went up to `presses`. */
122
+ z.object({ type: z.literal("pressed"), at: z.number(), presses: z.number() }),
123
+ /** A host saw a seat's press count reach `presses`. */
124
+ z.object({
125
+ type: z.literal("received"),
126
+ at: z.number(),
127
+ seat: z.string(),
128
+ presses: z.number()
129
+ }),
130
+ z.object({ type: z.literal("published"), at: z.number(), tick: z.number() }),
131
+ z.object({ type: z.literal("state"), at: z.number(), tick: z.number() }),
132
+ z.object({
133
+ type: z.literal("load"),
134
+ at: z.number(),
135
+ result: loadResultSchema
136
+ }),
137
+ z.object({ type: z.literal("failed"), at: z.number(), message: z.string() }),
138
+ /** Asks for a grant to open a connection; the check paces opens across devices. */
139
+ z.object({ type: z.literal("dial"), at: z.number(), id: z.number().int() }),
140
+ /** A connection began opening. */
141
+ z.object({ type: z.literal("dialing"), at: z.number() }),
142
+ z.object({
143
+ type: z.literal("problem"),
144
+ at: z.number(),
145
+ problem: linkProblemSchema
146
+ })
147
+ ]);
148
+ var ROOMS_CHECK_SCENARIOS = [
149
+ "join",
150
+ "phone-brief-freeze",
151
+ "phone-long-freeze",
152
+ "network-switch",
153
+ "network-stall",
154
+ "duplicate-join",
155
+ "host-reload",
156
+ "host-gone",
157
+ "background-host",
158
+ "crowd",
159
+ "load"
160
+ ];
161
+ var DEFAULT_ROOMS_CHECK_SCENARIOS = ROOMS_CHECK_SCENARIOS.filter(
162
+ (scenario) => scenario !== "load"
163
+ );
164
+ var sharedNow = () => performance.timeOrigin + performance.now();
165
+ var summarizeLatency = (samples) => {
166
+ if (samples.length === 0)
167
+ return { count: 0, medianMs: null, p99Ms: null, maximumMs: null };
168
+ const sorted = [...samples].sort((left, right) => left - right);
169
+ const at = (fraction) => round(
170
+ sorted[Math.min(sorted.length - 1, Math.floor(fraction * sorted.length))] ?? 0
171
+ );
172
+ return {
173
+ count: sorted.length,
174
+ medianMs: at(0.5),
175
+ p99Ms: at(0.99),
176
+ maximumMs: round(sorted.at(-1) ?? 0)
177
+ };
178
+ };
179
+ var round = (value) => Math.round(value * 100) / 100;
180
+
181
+ export {
182
+ deviceCommandSchema,
183
+ describeLinkProblem,
184
+ deviceEventSchema,
185
+ ROOMS_CHECK_SCENARIOS,
186
+ DEFAULT_ROOMS_CHECK_SCENARIOS,
187
+ sharedNow,
188
+ summarizeLatency
189
+ };
190
+ //# sourceMappingURL=chunk-GDFAWHGA.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/rooms-check-protocol.ts"],"sourcesContent":["import { z } from \"zod\";\n\n/**\n * The messages between `airjam rooms check` and its device processes. Each\n * edge-case device (one host or one phone) runs in its own process, so the\n * check can freeze it as a locked phone is frozen, kill it as a closed tab\n * is, and start a replacement; load runs whole rooms in a few workers.\n */\nconst keySchema = z.string().min(16).max(128);\nconst codeSchema = z.string().min(4).max(8);\n\n/** How every device reaches the room server. */\nconst linkSchema = z.object({\n url: z.string(),\n /** The Origin header each connection sends. */\n origin: z.string().optional(),\n});\nexport type DeviceLink = z.infer<typeof linkSchema>;\n\n/** A shell command whose trimmed output is one fresh host credential. */\nconst credentialCommandSchema = z.string().min(1).optional();\n\nexport const deviceCommandSchema = z.discriminatedUnion(\"type\", [\n z.object({\n type: z.literal(\"host\"),\n link: linkSchema,\n key: keySchema,\n code: codeSchema.optional(),\n /** A host resuming its instance asks for no credential. */\n instance: z.string().optional(),\n credentialCommand: credentialCommandSchema,\n seats: z.number().int().min(1).max(16),\n statesPerSecond: z.number().nonnegative(),\n /** False sends no client pings, as a hidden tab's throttled timers do. */\n heartbeat: z.boolean(),\n }),\n z.object({\n type: z.literal(\"phone\"),\n link: linkSchema,\n key: keySchema,\n code: codeSchema,\n instance: z.string().optional(),\n inputsPerSecond: z.number().nonnegative(),\n }),\n /** An idle phone taps once. */\n z.object({ type: z.literal(\"press\") }),\n /** The device's network stalls, holding every byte both ways, or comes back. */\n z.object({ type: z.literal(\"network\"), stalled: z.boolean() }),\n /** The connection the device asked to open with `dial` may open now. */\n z.object({ type: z.literal(\"dial\"), id: z.number().int() }),\n z.object({\n type: z.literal(\"load\"),\n link: linkSchema,\n credentialCommand: credentialCommandSchema,\n rooms: z.number().int().positive(),\n phonesPerRoom: z.number().int().min(1).max(16),\n inputsPerSecond: z.number().positive(),\n statesPerSecond: z.number().nonnegative(),\n durationMs: z.number().int().positive(),\n }),\n]);\nexport type DeviceCommand = z.infer<typeof deviceCommandSchema>;\n\nconst statusSchema = z.object({\n phase: z.enum([\"connecting\", \"waiting\", \"open\", \"reconnecting\", \"closed\"]),\n reason: z.string().optional(),\n});\n\nexport const latencySummarySchema = z.object({\n count: z.number(),\n medianMs: z.number().nullable(),\n p99Ms: z.number().nullable(),\n maximumMs: z.number().nullable(),\n});\nexport type LatencySummary = z.infer<typeof latencySummarySchema>;\n\nconst trafficSchema = z.object({\n /** Messages and payload bytes the devices sent to the room server. */\n messagesIn: z.number(),\n bytesIn: z.number(),\n /** Messages and payload bytes the room server sent to the devices. */\n messagesOut: z.number(),\n bytesOut: z.number(),\n});\nexport type RoomTraffic = z.infer<typeof trafficSchema>;\n\nexport const loadResultSchema = z.object({\n roomsOpened: z.number(),\n phonesJoined: z.number(),\n roomOpenMs: z.array(z.number()),\n phoneJoinMs: z.array(z.number()),\n /** Tap to host, per press, measured within the worker on one clock. */\n inputLatencyMs: z.array(z.number()),\n pressesSent: z.number(),\n pressesLost: z.number(),\n stateLatencyMs: z.array(z.number()),\n /** Joined phones whose copy did not end equal to what their host last published. */\n phonesWithoutState: z.number(),\n traffic: trafficSchema,\n cpuMs: z.number(),\n});\nexport type LoadResult = z.infer<typeof loadResultSchema>;\n\nexport const linkProblemSchema = z.discriminatedUnion(\"kind\", [\n /** The server answered the upgrade with this HTTP status instead of a socket. */\n z.object({ kind: z.literal(\"refused\"), status: z.number() }),\n /** No answer: the network or TLS error, or the handshake timing out. */\n z.object({ kind: z.literal(\"failed\"), error: z.string() }),\n /** An open connection closed without the device asking, with the room's reason when the code has one. */\n z.object({\n kind: z.literal(\"closed\"),\n code: z.number(),\n reason: z.string().nullable(),\n }),\n]);\nexport type LinkProblem = z.infer<typeof linkProblemSchema>;\n\nexport const describeLinkProblem = (problem: LinkProblem): string => {\n switch (problem.kind) {\n case \"refused\":\n return `refused with HTTP ${problem.status}`;\n case \"failed\":\n return `failed to open: ${problem.error}`;\n case \"closed\":\n return `closed with ${problem.code}${problem.reason ? ` (${problem.reason})` : \"\"}`;\n }\n};\n\n/** Everything a device reports, each stamped with the shared wall clock. */\nexport const deviceEventSchema = z.discriminatedUnion(\"type\", [\n z.object({\n type: z.literal(\"status\"),\n at: z.number(),\n status: statusSchema,\n code: z.string().optional(),\n instance: z.string().optional(),\n seat: z.string().optional(),\n hostGraceMs: z.number().optional(),\n }),\n z.object({\n type: z.literal(\"seats\"),\n at: z.number(),\n seats: z.array(z.object({ id: z.string(), connected: z.boolean() })),\n }),\n z.object({ type: z.literal(\"host\"), at: z.number(), present: z.boolean() }),\n /** A phone pressed: its button's press count went up to `presses`. */\n z.object({ type: z.literal(\"pressed\"), at: z.number(), presses: z.number() }),\n /** A host saw a seat's press count reach `presses`. */\n z.object({\n type: z.literal(\"received\"),\n at: z.number(),\n seat: z.string(),\n presses: z.number(),\n }),\n z.object({ type: z.literal(\"published\"), at: z.number(), tick: z.number() }),\n z.object({ type: z.literal(\"state\"), at: z.number(), tick: z.number() }),\n z.object({\n type: z.literal(\"load\"),\n at: z.number(),\n result: loadResultSchema,\n }),\n z.object({ type: z.literal(\"failed\"), at: z.number(), message: z.string() }),\n /** Asks for a grant to open a connection; the check paces opens across devices. */\n z.object({ type: z.literal(\"dial\"), at: z.number(), id: z.number().int() }),\n /** A connection began opening. */\n z.object({ type: z.literal(\"dialing\"), at: z.number() }),\n z.object({\n type: z.literal(\"problem\"),\n at: z.number(),\n problem: linkProblemSchema,\n }),\n]);\nexport type DeviceEvent = z.infer<typeof deviceEventSchema>;\n\nexport const ROOMS_CHECK_SCENARIOS = [\n \"join\",\n \"phone-brief-freeze\",\n \"phone-long-freeze\",\n \"network-switch\",\n \"network-stall\",\n \"duplicate-join\",\n \"host-reload\",\n \"host-gone\",\n \"background-host\",\n \"crowd\",\n \"load\",\n] as const;\nexport type RoomsCheckScenario = (typeof ROOMS_CHECK_SCENARIOS)[number];\n\n/** Every scenario but load, which is heavy enough to be asked for by name. */\nexport const DEFAULT_ROOMS_CHECK_SCENARIOS = ROOMS_CHECK_SCENARIOS.filter(\n (scenario) => scenario !== \"load\",\n);\n\nexport interface RoomsCheckScenarioResult {\n readonly scenario: RoomsCheckScenario;\n readonly passed: boolean;\n /** Why it failed, in one sentence. */\n readonly failure?: string;\n readonly durationMs: number;\n /** What it measured, in milliseconds unless the name says otherwise. */\n readonly measurements: Readonly<Record<string, unknown>>;\n /** Every connection that failed to open or closed without its device asking, expected or not. */\n readonly connectionProblems: readonly ConnectionProblem[];\n}\n\nexport interface ConnectionProblem {\n readonly device: string;\n /** Since the scenario began. */\n readonly atMs: number;\n readonly problem: LinkProblem;\n}\n\nexport interface RoomsCheckReport {\n readonly url: string;\n readonly passed: boolean;\n readonly scenarios: readonly RoomsCheckScenarioResult[];\n}\n\n/** The wall clock every device process shares, with sub-millisecond precision. */\nexport const sharedNow = (): number =>\n performance.timeOrigin + performance.now();\n\nexport const summarizeLatency = (\n samples: readonly number[],\n): LatencySummary => {\n if (samples.length === 0)\n return { count: 0, medianMs: null, p99Ms: null, maximumMs: null };\n const sorted = [...samples].sort((left, right) => left - right);\n const at = (fraction: number) =>\n round(\n sorted[\n Math.min(sorted.length - 1, Math.floor(fraction * sorted.length))\n ] ?? 0,\n );\n return {\n count: sorted.length,\n medianMs: at(0.5),\n p99Ms: at(0.99),\n maximumMs: round(sorted.at(-1) ?? 0),\n };\n};\n\nconst round = (value: number) => Math.round(value * 100) / 100;\n"],"mappings":";AAAA,SAAS,SAAS;AAQlB,IAAM,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,IAAI,GAAG;AAC5C,IAAM,aAAa,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC;AAG1C,IAAM,aAAa,EAAE,OAAO;AAAA,EAC1B,KAAK,EAAE,OAAO;AAAA;AAAA,EAEd,QAAQ,EAAE,OAAO,EAAE,SAAS;AAC9B,CAAC;AAID,IAAM,0BAA0B,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS;AAEpD,IAAM,sBAAsB,EAAE,mBAAmB,QAAQ;AAAA,EAC9D,EA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gC,sBAAsB;AAAA,EACjE,CAAC,aAAa,aAAa;AAC7B;AA4BO,IAAM,YAAY,MACvB,YAAY,aAAa,YAAY,IAAI;AAEpC,IAAM,mBAAmB,CAC9B,YACmB;AACnB,MAAI,QAAQ,WAAW;AACrB,WAAO,EAAE,OAAO,GAAG,UAAU,MAAM,OAAO,MAAM,WAAW,KAAK;AAClE,QAAM,SAAS,CAAC,GAAG,OAAO,EAAE,KAAK,CAAC,MAAM,UAAU,OAAO,KAAK;AAC9D,QAAM,KAAK,CAAC,aACV;AAAA,IACE,OACE,KAAK,IAAI,OAAO,SAAS,GAAG,KAAK,MAAM,WAAW,OAAO,MAAM,CAAC,CAClE,KAAK;AAAA,EACP;AACF,SAAO;AAAA,IACL,OAAO,OAAO;AAAA,IACd,UAAU,GAAG,GAAG;AAAA,IAChB,OAAO,GAAG,IAAI;AAAA,IACd,WAAW,MAAM,OAAO,GAAG,EAAE,KAAK,CAAC;AAAA,EACrC;AACF;AAEA,IAAM,QAAQ,CAAC,UAAkB,KAAK,MAAM,QAAQ,GAAG,IAAI;","names":[]}
@@ -0,0 +1,347 @@
1
+ import {
2
+ airJamScenarioVerdictSchema,
3
+ airJamTestProfileDescriptionSchema,
4
+ policyArtifactReceiptSchema,
5
+ policyPreparationSchema
6
+ } from "./chunk-PMNE5GIN.js";
7
+ import {
8
+ gameBuildIdentitySchema
9
+ } from "./chunk-ASC2CK2R.js";
10
+
11
+ // src/game-run-protocol.ts
12
+ import { airJamSettingsValuesSchema } from "@air-jam/sdk/core";
13
+ import { controllerLeasedControlAckSchema as controllerLeasedControlAckSchema2 } from "@air-jam/sdk/protocol";
14
+ import { seatIdSchema } from "@air-jam/sdk/room-protocol";
15
+ import {
16
+ clipNotCapturedReasonSchema,
17
+ hostAgentRequestSchema,
18
+ hostObservationIdentitySchema,
19
+ hostRuntimeFaultSchema,
20
+ inputLogNotReplayableReasonSchema
21
+ } from "@air-jam/sdk/runtime-control";
22
+ import { z as z2 } from "zod";
23
+
24
+ // src/controller-protocol.ts
25
+ import { controllerLeasedControlAckSchema } from "@air-jam/sdk/protocol";
26
+ import { z } from "zod";
27
+ var controllerDisconnectionSchema = z.object({
28
+ release: z.union([
29
+ controllerLeasedControlAckSchema,
30
+ z.object({ status: z.literal("not-leased") }).strict()
31
+ ]),
32
+ leave: z.discriminatedUnion("status", [
33
+ z.object({ status: z.literal("acknowledged") }).strict(),
34
+ z.object({ status: z.literal("not-connected") }).strict(),
35
+ z.object({ status: z.literal("rejected"), message: z.string() }).strict(),
36
+ z.object({ status: z.literal("unconfirmed"), message: z.string() }).strict()
37
+ ])
38
+ }).strict();
39
+
40
+ // src/game-run-protocol.ts
41
+ var GAME_RUN_PROTOCOL_VERSION = 5;
42
+ var MAXIMUM_GAME_RUN_BUILD_LOG_BYTES = 1048576;
43
+ var gameRunBuildLogSchema = z2.object({
44
+ path: z2.string().min(1),
45
+ sha256: z2.string().regex(/^[a-f0-9]{64}$/),
46
+ bytes: z2.number().int().nonnegative().max(MAXIMUM_GAME_RUN_BUILD_LOG_BYTES),
47
+ truncated: z2.boolean()
48
+ });
49
+ var MAXIMUM_GAME_RUN_MS = 6e5;
50
+ var MAXIMUM_GAME_RUN_TRACE_BYTES = 16 * 1024 * 1024;
51
+ var MAXIMUM_GAME_RUN_STEERING_CHANGES = 64;
52
+ var GAME_SESSION_BROKER_STATE_FILE = ".airjam/devtools/game-session-broker.json";
53
+ var attachmentUrlSchema = z2.url().max(4096).refine((value) => {
54
+ const url = new URL(value);
55
+ return ["http:", "https:"].includes(url.protocol) && !url.username && !url.password;
56
+ }, "An attachment requires an HTTP(S) URL without embedded credentials.");
57
+ var MAXIMUM_CURRENT_ROOM_SEATS = 8;
58
+ var currentRoomAttachmentSchema = z2.object({
59
+ controllerJoinUrl: attachmentUrlSchema.refine(
60
+ (value) => Boolean(new URL(value).searchParams.get("room")),
61
+ "A controller attachment requires a room."
62
+ ),
63
+ /**
64
+ * How many seats the run may claim in the creator's room. The room
65
+ * assigns seat ids, so each player joins first and then claims its seat.
66
+ */
67
+ seats: z2.number().int().min(1).max(MAXIMUM_CURRENT_ROOM_SEATS),
68
+ host: z2.object({
69
+ endpoint: attachmentUrlSchema,
70
+ targetId: z2.string().min(1).max(128)
71
+ }).strict()
72
+ }).strict();
73
+ var currentRoomHostRequestSchema = z2.object({
74
+ targetId: currentRoomAttachmentSchema.shape.host.shape.targetId,
75
+ ownerInstanceId: z2.uuid(),
76
+ request: hostAgentRequestSchema
77
+ }).strict();
78
+ var currentRoomSeatClaimSchema = z2.object({
79
+ targetId: currentRoomAttachmentSchema.shape.host.shape.targetId,
80
+ ownerInstanceId: z2.uuid(),
81
+ claim: z2.object({ instance: z2.string().min(1).max(64), seat: seatIdSchema }).strict()
82
+ }).strict();
83
+ var seatIntentSchema = z2.string().trim().min(1).max(500);
84
+ var steeringSourceSchema = z2.enum(["creator", "agent", "operator"]);
85
+ var gameRunStartBaseSchema = z2.object({
86
+ cwd: z2.string().min(1).optional(),
87
+ runId: z2.uuid(),
88
+ gameId: z2.string().min(1).optional(),
89
+ target: z2.discriminatedUnion("kind", [
90
+ z2.object({ kind: z2.literal("owned") }).strict(),
91
+ z2.object({ kind: z2.literal("current") }).strict(),
92
+ /** Plays in a room with no page, on game time, as fast as the host runs. */
93
+ z2.object({ kind: z2.literal("headless") }).strict()
94
+ ]),
95
+ settings: airJamSettingsValuesSchema.optional(),
96
+ seed: z2.number().int().min(0).max(4294967295).default(0)
97
+ }).strict();
98
+ var startTestGameRunSchema = gameRunStartBaseSchema.extend({
99
+ kind: z2.literal("test").default("test"),
100
+ profileId: z2.string().min(1).max(64),
101
+ policyId: z2.string().min(1).max(64),
102
+ budget: z2.object({
103
+ durationMs: z2.number().int().min(1e3).max(MAXIMUM_GAME_RUN_MS),
104
+ steps: z2.number().int().min(1).max(1e4)
105
+ }).strict(),
106
+ intents: z2.record(z2.string().min(1).max(64), seatIntentSchema).optional()
107
+ }).refine(
108
+ (request) => request.settings === void 0 || request.target.kind !== "current",
109
+ {
110
+ message: "Initial settings require a new owned or headless room; use settings-update for an existing room.",
111
+ path: ["settings"]
112
+ }
113
+ );
114
+ var startPlayGameRunSchema = gameRunStartBaseSchema.omit({ settings: true }).extend({
115
+ kind: z2.literal("play"),
116
+ target: z2.object({ kind: z2.literal("current") }).strict(),
117
+ intent: seatIntentSchema.optional()
118
+ });
119
+ var startGameRunSchema = z2.union([
120
+ startTestGameRunSchema,
121
+ startPlayGameRunSchema
122
+ ]);
123
+ var gameRunAddressSchema = z2.object({ cwd: z2.string().min(1).optional(), runId: z2.uuid() }).strict();
124
+ var gameRunSteerSchema = gameRunAddressSchema.extend({
125
+ seatId: z2.string().min(1).max(64),
126
+ intent: seatIntentSchema.nullable(),
127
+ source: steeringSourceSchema.default("operator")
128
+ }).strict();
129
+ var gameRunWaitSchema = gameRunAddressSchema.extend({
130
+ timeoutMs: z2.number().int().min(1).max(3e4).default(25e3)
131
+ });
132
+ var gameRunDiscoverySchema = z2.object({
133
+ cwd: z2.string().min(1).optional(),
134
+ gameId: z2.string().min(1).optional()
135
+ }).strict();
136
+ var gameRunEndReasonSchema = z2.enum([
137
+ "completed",
138
+ "failed",
139
+ "budget",
140
+ "safety_deadline",
141
+ "stopped",
142
+ "owner_stopping",
143
+ "owner_lost",
144
+ "session_expired",
145
+ "runtime_replaced",
146
+ "policy_unresponsive",
147
+ "decision_latency",
148
+ "host_not_advancing",
149
+ "seat_replaced",
150
+ "untested_seat",
151
+ "evaluator_unresponsive",
152
+ "trace_budget",
153
+ "error"
154
+ ]);
155
+ var gameRunSessionIdentitySchema = z2.object({
156
+ gameSessionId: z2.uuid(),
157
+ gameId: z2.string().nullable(),
158
+ roomId: z2.string().min(1),
159
+ controllerId: z2.string().min(1),
160
+ semanticAccess: z2.enum(["owned-host", "delegated-host", "participant-only"]),
161
+ connected: z2.boolean()
162
+ });
163
+ var gameRunRecordSchema = z2.object({
164
+ version: z2.literal(1),
165
+ runId: z2.uuid(),
166
+ ownerInstanceId: z2.uuid(),
167
+ request: startGameRunSchema,
168
+ state: z2.enum(["starting", "setup", "playing", "stopping", "ended"]),
169
+ startedAt: z2.iso.datetime(),
170
+ endedAt: z2.iso.datetime().optional(),
171
+ stopRequestedAt: z2.iso.datetime().optional(),
172
+ abortedAt: z2.iso.datetime().optional(),
173
+ lastInputAt: z2.iso.datetime().optional(),
174
+ releaseAcknowledgedAt: z2.iso.datetime().optional(),
175
+ rosterJoinedAt: z2.iso.datetime().optional(),
176
+ /** When play began, after setup; play ends at `abortedAt`. */
177
+ playStartedAt: z2.iso.datetime().optional(),
178
+ watched: z2.literal(true).optional(),
179
+ profile: airJamTestProfileDescriptionSchema.optional(),
180
+ policyPreparation: policyPreparationSchema.optional(),
181
+ policyInitializationMs: z2.number().finite().nonnegative().optional(),
182
+ policyArtifacts: policyArtifactReceiptSchema.optional(),
183
+ decisionModel: z2.string().min(1).max(200).optional(),
184
+ build: gameBuildIdentitySchema.extend({ integrity: z2.enum(["sealed", "verified", "changed"]) }).optional(),
185
+ session: gameRunSessionIdentitySchema.optional(),
186
+ expected: hostObservationIdentitySchema.optional(),
187
+ seats: z2.array(
188
+ z2.object({
189
+ seatId: z2.string(),
190
+ controllerId: z2.string(),
191
+ expected: hostObservationIdentitySchema.optional(),
192
+ counters: z2.object({
193
+ decisions: z2.number().int().nonnegative(),
194
+ applied: z2.number().int().nonnegative(),
195
+ rejected: z2.number().int().nonnegative(),
196
+ unconfirmed: z2.number().int().nonnegative(),
197
+ timeout: z2.number().int().nonnegative(),
198
+ blocked: z2.number().int().nonnegative(),
199
+ effects: z2.number().int().nonnegative()
200
+ }).strict(),
201
+ intent: seatIntentSchema.nullable().default(null),
202
+ answers: z2.object({
203
+ asked: z2.number().int().nonnegative(),
204
+ answered: z2.number().int().nonnegative(),
205
+ automatic: z2.number().int().nonnegative().optional(),
206
+ missed: z2.number().int().nonnegative(),
207
+ lowConfidence: z2.number().int().nonnegative(),
208
+ lowConfidenceStretches: z2.number().int().nonnegative(),
209
+ choices: z2.record(z2.string(), z2.number().int().nonnegative())
210
+ }).strict().optional()
211
+ }).strict()
212
+ ).max(8).default([]),
213
+ /** The host's frame rate and simulation speed during play (1 = real time). */
214
+ hostPace: z2.object({
215
+ framesPerSecond: z2.number().nonnegative(),
216
+ simulationSpeed: z2.number().nonnegative()
217
+ }).strict().optional(),
218
+ steering: z2.array(
219
+ z2.object({
220
+ at: z2.iso.datetime(),
221
+ seatId: z2.string(),
222
+ intent: seatIntentSchema.nullable(),
223
+ source: steeringSourceSchema
224
+ }).strict()
225
+ ).max(MAXIMUM_GAME_RUN_STEERING_CHANGES).optional(),
226
+ evaluation: z2.object({
227
+ play: airJamScenarioVerdictSchema.optional(),
228
+ final: airJamScenarioVerdictSchema.optional()
229
+ }).strict().optional(),
230
+ counters: z2.object({
231
+ steps: z2.number().int().nonnegative(),
232
+ applied: z2.number().int().nonnegative(),
233
+ rejected: z2.number().int().nonnegative(),
234
+ unconfirmed: z2.number().int().nonnegative(),
235
+ missed: z2.number().int().nonnegative()
236
+ }).strict(),
237
+ end: z2.object({
238
+ reason: gameRunEndReasonSchema,
239
+ outcome: z2.enum(["passed", "failed", "inconclusive"]).optional(),
240
+ message: z2.string(),
241
+ hostFault: hostRuntimeFaultSchema.optional()
242
+ }).strict().optional(),
243
+ cleanup: z2.object({
244
+ participantsClosed: z2.boolean(),
245
+ processesClosed: z2.boolean().optional(),
246
+ seats: z2.array(
247
+ z2.object({
248
+ seatId: z2.string(),
249
+ release: controllerLeasedControlAckSchema2.optional(),
250
+ disconnection: controllerDisconnectionSchema.optional()
251
+ }).strict()
252
+ ).max(8),
253
+ close: z2.object({
254
+ closed: z2.boolean(),
255
+ disconnection: controllerDisconnectionSchema
256
+ }).strict().optional(),
257
+ forced: z2.literal(true).optional(),
258
+ /**
259
+ * Whether a test in the creator's room returned it through its
260
+ * profile's hand-back steps, had none to run, or failed (see errors).
261
+ */
262
+ handBack: z2.enum(["returned", "undeclared", "failed"]).optional(),
263
+ errors: z2.array(z2.string())
264
+ }).strict().optional(),
265
+ evidence: z2.object({
266
+ clip: z2.discriminatedUnion("status", [
267
+ z2.object({
268
+ status: z2.literal("captured"),
269
+ path: z2.string().min(1),
270
+ sha256: z2.string().regex(/^[a-f0-9]{64}$/),
271
+ bytes: z2.number().int().positive(),
272
+ frames: z2.number().int().min(1).max(150),
273
+ durationMs: z2.number().nonnegative()
274
+ }).strict(),
275
+ z2.object({
276
+ status: z2.literal("not-captured"),
277
+ reason: clipNotCapturedReasonSchema
278
+ }).strict()
279
+ ]).optional(),
280
+ buildLog: gameRunBuildLogSchema.optional(),
281
+ trace: z2.object({
282
+ path: z2.string().min(1),
283
+ sha256: z2.string().regex(/^[a-f0-9]{64}$/),
284
+ bytes: z2.number().int().nonnegative().max(MAXIMUM_GAME_RUN_TRACE_BYTES),
285
+ truncated: z2.boolean()
286
+ }).strict().optional(),
287
+ observation: z2.object({
288
+ path: z2.string().min(1),
289
+ sha256: z2.string().regex(/^[a-f0-9]{64}$/)
290
+ }).strict().nullable(),
291
+ replay: z2.object({
292
+ reason: inputLogNotReplayableReasonSchema,
293
+ message: z2.string()
294
+ }).strict().optional(),
295
+ /** The match input log paired with the final observation. */
296
+ inputLog: z2.object({
297
+ path: z2.string().min(1),
298
+ sha256: z2.string().regex(/^[a-f0-9]{64}$/),
299
+ ticks: z2.number().int().nonnegative(),
300
+ stepMs: z2.number().positive(),
301
+ entries: z2.number().int().nonnegative(),
302
+ fromTick: z2.number().int().nonnegative(),
303
+ full: z2.boolean()
304
+ }).strict().optional(),
305
+ error: z2.string().nullable()
306
+ }).strict().optional()
307
+ }).strict().refine(
308
+ (record) => record.request.kind !== "play" || record.profile === void 0 && record.evaluation === void 0 && record.end?.outcome === void 0,
309
+ "Play records have no authored profile, evaluation or verdict."
310
+ ).refine(
311
+ (record) => record.request.kind !== "test" || record.end === void 0 || record.end.outcome !== void 0,
312
+ "Finished test records require a verdict."
313
+ );
314
+ var gameRunCancellationSchema = z2.object({
315
+ runId: z2.uuid(),
316
+ ownerInstanceId: z2.uuid(),
317
+ fenced: z2.literal(true),
318
+ record: gameRunRecordSchema.nullable()
319
+ }).strict();
320
+
321
+ export {
322
+ GAME_RUN_PROTOCOL_VERSION,
323
+ MAXIMUM_GAME_RUN_BUILD_LOG_BYTES,
324
+ gameRunBuildLogSchema,
325
+ MAXIMUM_GAME_RUN_MS,
326
+ MAXIMUM_GAME_RUN_TRACE_BYTES,
327
+ MAXIMUM_GAME_RUN_STEERING_CHANGES,
328
+ GAME_SESSION_BROKER_STATE_FILE,
329
+ MAXIMUM_CURRENT_ROOM_SEATS,
330
+ currentRoomAttachmentSchema,
331
+ currentRoomHostRequestSchema,
332
+ currentRoomSeatClaimSchema,
333
+ seatIntentSchema,
334
+ steeringSourceSchema,
335
+ startTestGameRunSchema,
336
+ startPlayGameRunSchema,
337
+ startGameRunSchema,
338
+ gameRunAddressSchema,
339
+ gameRunSteerSchema,
340
+ gameRunWaitSchema,
341
+ gameRunDiscoverySchema,
342
+ gameRunEndReasonSchema,
343
+ gameRunSessionIdentitySchema,
344
+ gameRunRecordSchema,
345
+ gameRunCancellationSchema
346
+ };
347
+ //# sourceMappingURL=chunk-HZUGBH4Y.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/game-run-protocol.ts","../src/controller-protocol.ts"],"sourcesContent":["import { airJamSettingsValuesSchema } from \"@air-jam/sdk/core\";\nimport { controllerLeasedControlAckSchema } from \"@air-jam/sdk/protocol\";\nimport { seatIdSchema } from \"@air-jam/sdk/room-protocol\";\nimport {\n clipNotCapturedReasonSchema,\n hostAgentRequestSchema,\n hostObservationIdentitySchema,\n hostRuntimeFaultSchema,\n inputLogNotReplayableReasonSchema,\n} from \"@air-jam/sdk/runtime-control\";\nimport { z } from \"zod\";\nimport { controllerDisconnectionSchema } from \"./controller-protocol.js\";\nimport { gameBuildIdentitySchema } from \"./game-build-protocol.js\";\nimport { policyArtifactReceiptSchema } from \"./policy-artifact-contract.js\";\nimport {\n airJamScenarioVerdictSchema,\n airJamTestProfileDescriptionSchema,\n policyPreparationSchema,\n} from \"./testing.js\";\nexport const GAME_RUN_PROTOCOL_VERSION = 5;\nexport const MAXIMUM_GAME_RUN_BUILD_LOG_BYTES = 1_048_576;\nexport const gameRunBuildLogSchema = z.object({\n path: z.string().min(1),\n sha256: z.string().regex(/^[a-f0-9]{64}$/),\n bytes: z.number().int().nonnegative().max(MAXIMUM_GAME_RUN_BUILD_LOG_BYTES),\n truncated: z.boolean(),\n});\nexport type AirJamGameRunBuildLog = z.infer<typeof gameRunBuildLogSchema>;\nexport const MAXIMUM_GAME_RUN_MS = 600_000;\nexport const MAXIMUM_GAME_RUN_TRACE_BYTES = 16 * 1024 * 1024;\nexport const MAXIMUM_GAME_RUN_STEERING_CHANGES = 64;\nexport const GAME_SESSION_BROKER_STATE_FILE =\n \".airjam/devtools/game-session-broker.json\";\nconst attachmentUrlSchema = z\n .url()\n .max(4096)\n .refine((value) => {\n const url = new URL(value);\n return (\n [\"http:\", \"https:\"].includes(url.protocol) &&\n !url.username &&\n !url.password\n );\n }, \"An attachment requires an HTTP(S) URL without embedded credentials.\");\n/** The most players one run can seat in a creator's room. */\nexport const MAXIMUM_CURRENT_ROOM_SEATS = 8;\nexport const currentRoomAttachmentSchema = z\n .object({\n controllerJoinUrl: attachmentUrlSchema.refine(\n (value) => Boolean(new URL(value).searchParams.get(\"room\")),\n \"A controller attachment requires a room.\",\n ),\n /**\n * How many seats the run may claim in the creator's room. The room\n * assigns seat ids, so each player joins first and then claims its seat.\n */\n seats: z.number().int().min(1).max(MAXIMUM_CURRENT_ROOM_SEATS),\n host: z\n .object({\n endpoint: attachmentUrlSchema,\n targetId: z.string().min(1).max(128),\n })\n .strict(),\n })\n .strict();\nexport type CurrentRoomAttachment = z.infer<typeof currentRoomAttachmentSchema>;\n/** A request to the creator's host, answered through the editor that granted the room. */\nexport const currentRoomHostRequestSchema = z\n .object({\n targetId: currentRoomAttachmentSchema.shape.host.shape.targetId,\n ownerInstanceId: z.uuid(),\n request: hostAgentRequestSchema,\n })\n .strict();\n\n/**\n * A run's claim on a seat one of its players holds in the creator's room,\n * made through the editor that granted the room. A claim names the room\n * instance, since seat ids are unique only within one.\n */\nexport const currentRoomSeatClaimSchema = z\n .object({\n targetId: currentRoomAttachmentSchema.shape.host.shape.targetId,\n ownerInstanceId: z.uuid(),\n claim: z\n .object({ instance: z.string().min(1).max(64), seat: seatIdSchema })\n .strict(),\n })\n .strict();\nexport type CurrentRoomSeatClaim = z.infer<\n typeof currentRoomSeatClaimSchema\n>[\"claim\"];\n\n/** What a seat is trying to do, in words its decision model reads. */\nexport const seatIntentSchema = z.string().trim().min(1).max(500);\nexport const steeringSourceSchema = z.enum([\"creator\", \"agent\", \"operator\"]);\n\nconst gameRunStartBaseSchema = z\n .object({\n cwd: z.string().min(1).optional(),\n runId: z.uuid(),\n gameId: z.string().min(1).optional(),\n target: z.discriminatedUnion(\"kind\", [\n z.object({ kind: z.literal(\"owned\") }).strict(),\n z.object({ kind: z.literal(\"current\") }).strict(),\n /** Plays in a room with no page, on game time, as fast as the host runs. */\n z.object({ kind: z.literal(\"headless\") }).strict(),\n ]),\n\n settings: airJamSettingsValuesSchema.optional(),\n seed: z.number().int().min(0).max(0xffff_ffff).default(0),\n })\n .strict();\nexport const startTestGameRunSchema = gameRunStartBaseSchema\n .extend({\n kind: z.literal(\"test\").default(\"test\"),\n profileId: z.string().min(1).max(64),\n policyId: z.string().min(1).max(64),\n budget: z\n .object({\n durationMs: z.number().int().min(1000).max(MAXIMUM_GAME_RUN_MS),\n steps: z.number().int().min(1).max(10_000),\n })\n .strict(),\n intents: z.record(z.string().min(1).max(64), seatIntentSchema).optional(),\n })\n .refine(\n (request) =>\n request.settings === undefined || request.target.kind !== \"current\",\n {\n message:\n \"Initial settings require a new owned or headless room; use settings-update for an existing room.\",\n path: [\"settings\"],\n },\n );\nexport const startPlayGameRunSchema = gameRunStartBaseSchema\n .omit({ settings: true })\n .extend({\n kind: z.literal(\"play\"),\n target: z.object({ kind: z.literal(\"current\") }).strict(),\n intent: seatIntentSchema.optional(),\n });\nexport const startGameRunSchema = z.union([\n startTestGameRunSchema,\n startPlayGameRunSchema,\n]);\nexport type StartGameRunOptions = z.input<typeof startGameRunSchema>;\nexport const gameRunAddressSchema = z\n .object({ cwd: z.string().min(1).optional(), runId: z.uuid() })\n .strict();\nexport const gameRunSteerSchema = gameRunAddressSchema\n .extend({\n seatId: z.string().min(1).max(64),\n intent: seatIntentSchema.nullable(),\n source: steeringSourceSchema.default(\"operator\"),\n })\n .strict();\nexport type GameRunSteerOptions = z.input<typeof gameRunSteerSchema>;\nexport const gameRunWaitSchema = gameRunAddressSchema.extend({\n timeoutMs: z.number().int().min(1).max(30_000).default(25_000),\n});\nexport const gameRunDiscoverySchema = z\n .object({\n cwd: z.string().min(1).optional(),\n gameId: z.string().min(1).optional(),\n })\n .strict();\n\nexport const gameRunEndReasonSchema = z.enum([\n \"completed\",\n \"failed\",\n \"budget\",\n \"safety_deadline\",\n \"stopped\",\n \"owner_stopping\",\n \"owner_lost\",\n \"session_expired\",\n \"runtime_replaced\",\n \"policy_unresponsive\",\n \"decision_latency\",\n \"host_not_advancing\",\n \"seat_replaced\",\n \"untested_seat\",\n \"evaluator_unresponsive\",\n \"trace_budget\",\n \"error\",\n]);\nexport const gameRunSessionIdentitySchema = z.object({\n gameSessionId: z.uuid(),\n gameId: z.string().nullable(),\n roomId: z.string().min(1),\n controllerId: z.string().min(1),\n semanticAccess: z.enum([\"owned-host\", \"delegated-host\", \"participant-only\"]),\n connected: z.boolean(),\n});\nexport const gameRunRecordSchema = z\n .object({\n version: z.literal(1),\n runId: z.uuid(),\n ownerInstanceId: z.uuid(),\n request: startGameRunSchema,\n state: z.enum([\"starting\", \"setup\", \"playing\", \"stopping\", \"ended\"]),\n startedAt: z.iso.datetime(),\n endedAt: z.iso.datetime().optional(),\n stopRequestedAt: z.iso.datetime().optional(),\n abortedAt: z.iso.datetime().optional(),\n lastInputAt: z.iso.datetime().optional(),\n releaseAcknowledgedAt: z.iso.datetime().optional(),\n rosterJoinedAt: z.iso.datetime().optional(),\n /** When play began, after setup; play ends at `abortedAt`. */\n playStartedAt: z.iso.datetime().optional(),\n watched: z.literal(true).optional(),\n profile: airJamTestProfileDescriptionSchema.optional(),\n policyPreparation: policyPreparationSchema.optional(),\n policyInitializationMs: z.number().finite().nonnegative().optional(),\n policyArtifacts: policyArtifactReceiptSchema.optional(),\n decisionModel: z.string().min(1).max(200).optional(),\n build: gameBuildIdentitySchema\n .extend({ integrity: z.enum([\"sealed\", \"verified\", \"changed\"]) })\n .optional(),\n session: gameRunSessionIdentitySchema.optional(),\n expected: hostObservationIdentitySchema.optional(),\n seats: z\n .array(\n z\n .object({\n seatId: z.string(),\n controllerId: z.string(),\n expected: hostObservationIdentitySchema.optional(),\n counters: z\n .object({\n decisions: z.number().int().nonnegative(),\n applied: z.number().int().nonnegative(),\n rejected: z.number().int().nonnegative(),\n unconfirmed: z.number().int().nonnegative(),\n timeout: z.number().int().nonnegative(),\n blocked: z.number().int().nonnegative(),\n effects: z.number().int().nonnegative(),\n })\n .strict(),\n intent: seatIntentSchema.nullable().default(null),\n answers: z\n .object({\n asked: z.number().int().nonnegative(),\n answered: z.number().int().nonnegative(),\n automatic: z.number().int().nonnegative().optional(),\n missed: z.number().int().nonnegative(),\n lowConfidence: z.number().int().nonnegative(),\n lowConfidenceStretches: z.number().int().nonnegative(),\n choices: z.record(z.string(), z.number().int().nonnegative()),\n })\n .strict()\n .optional(),\n })\n .strict(),\n )\n .max(8)\n .default([]),\n /** The host's frame rate and simulation speed during play (1 = real time). */\n hostPace: z\n .object({\n framesPerSecond: z.number().nonnegative(),\n simulationSpeed: z.number().nonnegative(),\n })\n .strict()\n .optional(),\n steering: z\n .array(\n z\n .object({\n at: z.iso.datetime(),\n seatId: z.string(),\n intent: seatIntentSchema.nullable(),\n source: steeringSourceSchema,\n })\n .strict(),\n )\n .max(MAXIMUM_GAME_RUN_STEERING_CHANGES)\n .optional(),\n evaluation: z\n .object({\n play: airJamScenarioVerdictSchema.optional(),\n final: airJamScenarioVerdictSchema.optional(),\n })\n .strict()\n .optional(),\n counters: z\n .object({\n steps: z.number().int().nonnegative(),\n applied: z.number().int().nonnegative(),\n rejected: z.number().int().nonnegative(),\n unconfirmed: z.number().int().nonnegative(),\n missed: z.number().int().nonnegative(),\n })\n .strict(),\n end: z\n .object({\n reason: gameRunEndReasonSchema,\n outcome: z.enum([\"passed\", \"failed\", \"inconclusive\"]).optional(),\n message: z.string(),\n hostFault: hostRuntimeFaultSchema.optional(),\n })\n .strict()\n .optional(),\n cleanup: z\n .object({\n participantsClosed: z.boolean(),\n processesClosed: z.boolean().optional(),\n seats: z\n .array(\n z\n .object({\n seatId: z.string(),\n release: controllerLeasedControlAckSchema.optional(),\n disconnection: controllerDisconnectionSchema.optional(),\n })\n .strict(),\n )\n .max(8),\n close: z\n .object({\n closed: z.boolean(),\n disconnection: controllerDisconnectionSchema,\n })\n .strict()\n .optional(),\n forced: z.literal(true).optional(),\n /**\n * Whether a test in the creator's room returned it through its\n * profile's hand-back steps, had none to run, or failed (see errors).\n */\n handBack: z.enum([\"returned\", \"undeclared\", \"failed\"]).optional(),\n errors: z.array(z.string()),\n })\n .strict()\n .optional(),\n evidence: z\n .object({\n clip: z\n .discriminatedUnion(\"status\", [\n z\n .object({\n status: z.literal(\"captured\"),\n path: z.string().min(1),\n sha256: z.string().regex(/^[a-f0-9]{64}$/),\n bytes: z.number().int().positive(),\n frames: z.number().int().min(1).max(150),\n durationMs: z.number().nonnegative(),\n })\n .strict(),\n z\n .object({\n status: z.literal(\"not-captured\"),\n reason: clipNotCapturedReasonSchema,\n })\n .strict(),\n ])\n .optional(),\n buildLog: gameRunBuildLogSchema.optional(),\n trace: z\n .object({\n path: z.string().min(1),\n sha256: z.string().regex(/^[a-f0-9]{64}$/),\n bytes: z\n .number()\n .int()\n .nonnegative()\n .max(MAXIMUM_GAME_RUN_TRACE_BYTES),\n truncated: z.boolean(),\n })\n .strict()\n .optional(),\n observation: z\n .object({\n path: z.string().min(1),\n sha256: z.string().regex(/^[a-f0-9]{64}$/),\n })\n .strict()\n .nullable(),\n replay: z\n .object({\n reason: inputLogNotReplayableReasonSchema,\n message: z.string(),\n })\n .strict()\n .optional(),\n /** The match input log paired with the final observation. */\n inputLog: z\n .object({\n path: z.string().min(1),\n sha256: z.string().regex(/^[a-f0-9]{64}$/),\n ticks: z.number().int().nonnegative(),\n stepMs: z.number().positive(),\n entries: z.number().int().nonnegative(),\n fromTick: z.number().int().nonnegative(),\n full: z.boolean(),\n })\n .strict()\n .optional(),\n error: z.string().nullable(),\n })\n .strict()\n .optional(),\n })\n .strict()\n .refine(\n (record) =>\n record.request.kind !== \"play\" ||\n (record.profile === undefined &&\n record.evaluation === undefined &&\n record.end?.outcome === undefined),\n \"Play records have no authored profile, evaluation or verdict.\",\n )\n .refine(\n (record) =>\n record.request.kind !== \"test\" ||\n record.end === undefined ||\n record.end.outcome !== undefined,\n \"Finished test records require a verdict.\",\n );\nexport type AirJamGameRunRecord = z.infer<typeof gameRunRecordSchema>;\nexport const gameRunCancellationSchema = z\n .object({\n runId: z.uuid(),\n ownerInstanceId: z.uuid(),\n fenced: z.literal(true),\n record: gameRunRecordSchema.nullable(),\n })\n .strict();\nexport type AirJamGameRunCancellation = z.infer<\n typeof gameRunCancellationSchema\n>;\n\nexport {\n formatGameRunWatchSurface,\n GAME_WATCH_HEARTBEAT_MS,\n gameRunWatchEventSchema,\n gameRunWatchRequestSchema,\n gameRunWatchSurfaceSchema,\n GameRunWatchWriter,\n MAXIMUM_GAME_WATCH_FRAME_BASE64,\n parseGameRunWatchSurface,\n readGameRunWatchStream,\n} from \"./game-run-watch.js\";\nexport type {\n GameRunWatchEvent,\n GameRunWatchSurface,\n} from \"./game-run-watch.js\";\n","import { controllerLeasedControlAckSchema } from \"@air-jam/sdk/protocol\";\nimport { z } from \"zod\";\n\nexport const controllerDisconnectionSchema = z\n .object({\n release: z.union([\n controllerLeasedControlAckSchema,\n z.object({ status: z.literal(\"not-leased\") }).strict(),\n ]),\n leave: z.discriminatedUnion(\"status\", [\n z.object({ status: z.literal(\"acknowledged\") }).strict(),\n z.object({ status: z.literal(\"not-connected\") }).strict(),\n z.object({ status: z.literal(\"rejected\"), message: z.string() }).strict(),\n z\n .object({ status: z.literal(\"unconfirmed\"), message: z.string() })\n .strict(),\n ]),\n })\n .strict();\nexport type ControllerDisconnection = z.infer<\n typeof controllerDisconnectionSchema\n>;\n"],"mappings":";;;;;;;;;;;AAAA,SAAS,kCAAkC;AAC3C,SAAS,oCAAAA,yCAAwC;AACjD,SAAS,oBAAoB;AAC7B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,KAAAC,UAAS;;;ACVlB,SAAS,wCAAwC;AACjD,SAAS,SAAS;AAEX,IAAM,gCAAgC,EAC1C,OAAO;AAAA,EACN,SAAS,EAAE,MAAM;AAAA,IACf;AAAA,IACA,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,YAAY,EAAE,CAAC,EAAE,OAAO;AAAA,EACvD,CAAC;AAAA,EACD,OAAO,EAAE,mBAAmB,UAAU;AAAA,IACpC,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,cAAc,EAAE,CAAC,EAAE,OAAO;AAAA,IACvD,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,eAAe,EAAE,CAAC,EAAE,OAAO;AAAA,IACxD,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,UAAU,GAAG,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO;AAAA,IACxE,EACG,OAAO,EAAE,QAAQ,EAAE,QAAQ,aAAa,GAAG,SAAS,EAAE,OAAO,EAAE,CAAC,EAChE,OAAO;AAAA,EACZ,CAAC;AACH,CAAC,EACA,OAAO;;;ADCH,IAAM,4BAA4B;AAClC,IAAM,mCAAmC;AACzC,IAAM,wBAAwBC,GAAE,OAAO;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