@air-jam/sdk 0.9.2 → 0.9.3
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 +25 -45
- package/dist/{agent-tooling-BSMGBix9.d.cts → agent-contract-CD2QnbBJ.d.cts} +1 -1
- package/dist/{agent-tooling-BSMGBix9.d.ts → agent-contract-CD2QnbBJ.d.ts} +1 -1
- package/dist/agent-tooling.cjs +139 -0
- package/dist/agent-tooling.cjs.map +1 -1
- package/dist/agent-tooling.d.cts +25 -1
- package/dist/agent-tooling.d.ts +25 -1
- package/dist/agent-tooling.js +138 -0
- package/dist/agent-tooling.js.map +1 -1
- package/dist/air-jam-context-BlLPvCup.d.cts +175 -0
- package/dist/air-jam-context-DTsxF-tP.d.ts +175 -0
- package/dist/arcade/bridge/controller.cjs +214 -194
- package/dist/arcade/bridge/controller.cjs.map +1 -1
- package/dist/arcade/bridge/controller.d.cts +2 -2
- package/dist/arcade/bridge/controller.d.ts +2 -2
- package/dist/arcade/bridge/controller.js +6 -4
- package/dist/arcade/bridge/host.cjs +1 -1
- package/dist/arcade/bridge/host.cjs.map +1 -1
- package/dist/arcade/bridge/host.d.cts +3 -3
- package/dist/arcade/bridge/host.d.ts +3 -3
- package/dist/arcade/bridge/host.js +4 -3
- package/dist/arcade/bridge/iframe.cjs +1 -1
- package/dist/arcade/bridge/iframe.cjs.map +1 -1
- package/dist/arcade/bridge/iframe.d.cts +2 -2
- package/dist/arcade/bridge/iframe.d.ts +2 -2
- package/dist/arcade/bridge/iframe.js +4 -4
- package/dist/arcade/bridge.cjs +251 -231
- package/dist/arcade/bridge.cjs.map +1 -1
- package/dist/arcade/bridge.d.cts +4 -4
- package/dist/arcade/bridge.d.ts +4 -4
- package/dist/arcade/bridge.js +9 -7
- package/dist/arcade/host.cjs +145 -122
- package/dist/arcade/host.cjs.map +1 -1
- package/dist/arcade/host.d.cts +5 -4
- package/dist/arcade/host.d.ts +5 -4
- package/dist/arcade/host.js +6 -5
- package/dist/arcade/runtime.cjs +6499 -0
- package/dist/arcade/runtime.cjs.map +1 -0
- package/dist/arcade/runtime.d.cts +22 -0
- package/dist/arcade/runtime.d.ts +22 -0
- package/dist/arcade/runtime.js +32 -0
- package/dist/arcade/runtime.js.map +1 -0
- package/dist/arcade/surface.cjs +9 -0
- package/dist/arcade/surface.cjs.map +1 -1
- package/dist/arcade/surface.d.cts +6 -1
- package/dist/arcade/surface.d.ts +6 -1
- package/dist/arcade/surface.js +6 -2
- package/dist/arcade/url.d.cts +4 -4
- package/dist/arcade/url.d.ts +4 -4
- package/dist/arcade/url.js +5 -5
- package/dist/arcade.cjs +322 -292
- package/dist/arcade.cjs.map +1 -1
- package/dist/arcade.d.cts +6 -6
- package/dist/arcade.d.ts +6 -6
- package/dist/arcade.js +35 -29
- package/dist/{chunk-Q4UALQO4.js → chunk-2SZ2YYGJ.js} +8 -16
- package/dist/chunk-2SZ2YYGJ.js.map +1 -0
- package/dist/{chunk-KOB73SPD.js → chunk-32RSSFSF.js} +10 -12
- package/dist/chunk-32RSSFSF.js.map +1 -0
- package/dist/chunk-3YMUAKPU.js +10 -0
- package/dist/chunk-3YMUAKPU.js.map +1 -0
- package/dist/chunk-56DM2KEW.js +14 -0
- package/dist/chunk-56DM2KEW.js.map +1 -0
- package/dist/chunk-CM53YLT5.js +59 -0
- package/dist/chunk-CM53YLT5.js.map +1 -0
- package/dist/{chunk-DY67S3LR.js → chunk-CV3PBXPT.js} +3 -3
- package/dist/chunk-D4VDEVTZ.js +80 -0
- package/dist/chunk-D4VDEVTZ.js.map +1 -0
- package/dist/{chunk-E5PVHEAX.js → chunk-FUA6EMSJ.js} +24 -60
- package/dist/chunk-FUA6EMSJ.js.map +1 -0
- package/dist/chunk-GMLU7RI5.js +70 -0
- package/dist/chunk-GMLU7RI5.js.map +1 -0
- package/dist/{chunk-NCL6WJCL.js → chunk-IG6GZZSS.js} +32 -1
- package/dist/chunk-IG6GZZSS.js.map +1 -0
- package/dist/{chunk-EDRQIOCV.js → chunk-ITMQSBTH.js} +3 -2
- package/dist/chunk-ITMQSBTH.js.map +1 -0
- package/dist/{chunk-32NYL7XI.js → chunk-J5MCII33.js} +189 -108
- package/dist/chunk-J5MCII33.js.map +1 -0
- package/dist/{chunk-ZLPL2R3R.js → chunk-K4OZ54UD.js} +7 -34
- package/dist/chunk-K4OZ54UD.js.map +1 -0
- package/dist/{chunk-6CMB356F.js → chunk-LIHEEAVE.js} +9 -11
- package/dist/chunk-LIHEEAVE.js.map +1 -0
- package/dist/{chunk-7OTQTT6H.js → chunk-MIMPMB7O.js} +2 -2
- package/dist/{chunk-NUJBMV3O.js → chunk-O6X7FJ6N.js} +29 -32
- package/dist/chunk-O6X7FJ6N.js.map +1 -0
- package/dist/chunk-PSUYTD2L.js +16 -0
- package/dist/chunk-PSUYTD2L.js.map +1 -0
- package/dist/{chunk-M4DKOI42.js → chunk-QO4KFUEI.js} +2 -2
- package/dist/chunk-QTLYZADF.js +125 -0
- package/dist/chunk-QTLYZADF.js.map +1 -0
- package/dist/chunk-TTQDHKXL.js +3017 -0
- package/dist/chunk-TTQDHKXL.js.map +1 -0
- package/dist/chunk-UCPY7UJC.js +8 -0
- package/dist/chunk-UCPY7UJC.js.map +1 -0
- package/dist/{chunk-JO2HR5PV.js → chunk-UPV6YWT5.js} +4 -4
- package/dist/chunk-X35LLCWV.js +65 -0
- package/dist/chunk-X35LLCWV.js.map +1 -0
- package/dist/{controller-DxVchfiA.d.ts → controller-PZEM_1cH.d.ts} +6 -2
- package/dist/{controller-Bod8YYr1.d.cts → controller-vj82tKm4.d.cts} +6 -2
- package/dist/{dev-log-events-CVAM29hx.d.cts → dev-log-events-BCJKmygo.d.cts} +0 -3
- package/dist/{dev-log-events-CVAM29hx.d.ts → dev-log-events-BCJKmygo.d.ts} +0 -3
- package/dist/{host-8hmq_Sgc.d.cts → host-B9pRy0Aa.d.cts} +20 -7
- package/dist/{host-Cw-N6e-5.d.ts → host-DylGsX7p.d.ts} +20 -7
- package/dist/index.cjs +4260 -3870
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +40 -649
- package/dist/index.d.ts +40 -649
- package/dist/index.js +1030 -3727
- package/dist/index.js.map +1 -1
- package/dist/metadata.cjs.map +1 -1
- package/dist/metadata.d.cts +2 -3
- package/dist/metadata.d.ts +2 -3
- package/dist/metadata.js.map +1 -1
- package/dist/{notices-CnGaaS8B.d.ts → notices-C4bao3oi.d.ts} +1 -1
- package/dist/{notices-NyDM5Mtz.d.cts → notices-DNdOjwtj.d.cts} +1 -1
- package/dist/platform-machine.cjs +115 -15
- package/dist/platform-machine.cjs.map +1 -1
- package/dist/platform-machine.d.cts +1338 -65
- package/dist/platform-machine.d.ts +1338 -65
- package/dist/platform-machine.js +88 -15
- package/dist/platform-machine.js.map +1 -1
- package/dist/{platform-settings-cuor3i11.d.cts → platform-settings-DUWs4JTy.d.cts} +1 -1
- package/dist/{platform-settings-cuor3i11.d.ts → platform-settings-DUWs4JTy.d.ts} +1 -1
- package/dist/preview.cjs +301 -253
- package/dist/preview.cjs.map +1 -1
- package/dist/preview.d.cts +6 -4
- package/dist/preview.d.ts +6 -4
- package/dist/preview.js +31 -21
- package/dist/preview.js.map +1 -1
- package/dist/protocol.cjs +282 -167
- package/dist/protocol.cjs.map +1 -1
- package/dist/protocol.d.cts +74 -21
- package/dist/protocol.d.ts +74 -21
- package/dist/protocol.js +28 -10
- package/dist/release.cjs +37 -0
- package/dist/release.cjs.map +1 -1
- package/dist/release.d.cts +27 -1
- package/dist/release.d.ts +27 -1
- package/dist/release.js +13 -1
- package/dist/runtime-control.cjs +46 -0
- package/dist/runtime-control.cjs.map +1 -0
- package/dist/runtime-control.d.cts +17 -0
- package/dist/runtime-control.d.ts +17 -0
- package/dist/runtime-control.js +8 -0
- package/dist/runtime-control.js.map +1 -0
- package/dist/runtime-inspection.cjs +655 -0
- package/dist/runtime-inspection.cjs.map +1 -0
- package/dist/runtime-inspection.d.cts +47 -0
- package/dist/runtime-inspection.d.ts +47 -0
- package/dist/runtime-inspection.js +30 -0
- package/dist/runtime-inspection.js.map +1 -0
- package/dist/runtime-reporting-pe-eryVz.d.cts +27 -0
- package/dist/runtime-reporting-pe-eryVz.d.ts +27 -0
- package/dist/signals-ZHftIKuc.d.cts +33 -0
- package/dist/signals-ZHftIKuc.d.ts +33 -0
- package/dist/{standard-match-phase-BucA5dYo.d.ts → standard-match-phase-BzSgBYFg.d.ts} +2 -2
- package/dist/{standard-match-phase-U2ra8J-0.d.cts → standard-match-phase-CvJUW8Oe.d.cts} +2 -2
- package/dist/{sync-B6QsNrXz.d.cts → sync-xtPfWhif.d.cts} +1 -45
- package/dist/{sync-B6QsNrXz.d.ts → sync-xtPfWhif.d.ts} +1 -45
- package/dist/ui.cjs +593 -610
- package/dist/ui.cjs.map +1 -1
- package/dist/ui.d.cts +3 -3
- package/dist/ui.d.ts +3 -3
- package/dist/ui.js +16 -11
- package/dist/ui.js.map +1 -1
- package/dist/use-air-jam-host-COLy8t4s.d.ts +403 -0
- package/dist/use-air-jam-host-DM-ybB3C.d.cts +403 -0
- package/package.json +55 -21
- package/src/agent/agent-contract-conformance.ts +201 -0
- package/src/agent-tooling.ts +5 -0
- package/src/arcade/runtime.ts +6 -0
- package/src/arcade/surface.ts +1 -0
- package/src/context/air-jam-context.tsx +8 -8
- package/src/context/socket-manager.ts +0 -7
- package/src/dev/browser-log-sink.ts +12 -15
- package/src/events.ts +0 -5
- package/src/hooks/internal/use-controller-runtime-api.ts +110 -21
- package/src/hooks/internal/use-host-runtime-api.ts +306 -49
- package/src/hooks/use-air-jam-controller.ts +9 -9
- package/src/hooks/use-air-jam-host.ts +7 -7
- package/src/hooks/use-get-input.ts +1 -1
- package/src/hooks/use-host-arcade-restore.ts +6 -1
- package/src/index.ts +6 -25
- package/src/metadata/manifest.ts +2 -3
- package/src/platform-machine.ts +109 -12
- package/src/preview/workspace.tsx +48 -29
- package/src/protocol/arcade-platform-actions.ts +19 -1
- package/src/protocol/controller.ts +8 -2
- package/src/protocol/dev-log-events.ts +0 -3
- package/src/protocol/host-grant.ts +58 -140
- package/src/protocol/host.ts +21 -9
- package/src/protocol/runtime-reporting.ts +32 -0
- package/src/protocol/signed-envelope.ts +176 -0
- package/src/protocol/socket-events.ts +8 -10
- package/src/protocol/sync.ts +0 -16
- package/src/protocol.ts +2 -0
- package/src/release.ts +32 -0
- package/src/runtime/admission-retry.ts +62 -0
- package/src/runtime/air-jam-config.ts +6 -16
- package/src/runtime/air-jam-error-boundary.tsx +46 -2
- package/src/runtime/bridge-envelope-args.ts +21 -0
- package/src/runtime/connected-runtime-error-boundary.tsx +31 -0
- package/src/runtime/contracts/control.ts +107 -59
- package/src/runtime/controller-bridge.ts +12 -24
- package/src/runtime/controller-identity.ts +55 -27
- package/src/runtime/controller-realtime-client.ts +8 -47
- package/src/runtime/create-air-jam-app.tsx +21 -13
- package/src/runtime/host-bridge.ts +16 -24
- package/src/runtime/local-reference-game-identity.ts +13 -0
- package/src/runtime/runtime-session-params.ts +4 -64
- package/src/runtime-control.ts +3 -8
- package/src/settings/platform-settings-runtime.tsx +1 -6
- package/src/settings/platform-settings.ts +7 -38
- package/src/state/connection-store.ts +13 -6
- package/src/store/create-air-jam-store.ts +59 -7
- package/src/utils/ids.ts +32 -5
- package/dist/capabilities.cjs +0 -39
- package/dist/capabilities.cjs.map +0 -1
- package/dist/capabilities.d.cts +0 -31
- package/dist/capabilities.d.ts +0 -31
- package/dist/capabilities.js +0 -12
- package/dist/capabilities.js.map +0 -1
- package/dist/chunk-32NYL7XI.js.map +0 -1
- package/dist/chunk-6CMB356F.js.map +0 -1
- package/dist/chunk-CVYR5RJT.js +0 -184
- package/dist/chunk-CVYR5RJT.js.map +0 -1
- package/dist/chunk-E5PVHEAX.js.map +0 -1
- package/dist/chunk-EDRQIOCV.js.map +0 -1
- package/dist/chunk-KOB73SPD.js.map +0 -1
- package/dist/chunk-NCL6WJCL.js.map +0 -1
- package/dist/chunk-NUJBMV3O.js.map +0 -1
- package/dist/chunk-Q4UALQO4.js.map +0 -1
- package/dist/chunk-ZLPL2R3R.js.map +0 -1
- package/dist/chunk-ZTQ5SP4H.js +0 -9
- package/dist/chunk-ZTQ5SP4H.js.map +0 -1
- package/src/capabilities/manifest.ts +0 -71
- package/src/capabilities.ts +0 -12
- package/src/hooks/internal/use-runtime-control-contract.ts +0 -15
- package/src/hooks/internal/use-runtime-observability-contract.ts +0 -24
- package/src/runtime/contracts/observability.ts +0 -94
- package/src/runtime-observability.ts +0 -9
- /package/dist/{chunk-DY67S3LR.js.map → chunk-CV3PBXPT.js.map} +0 -0
- /package/dist/{chunk-7OTQTT6H.js.map → chunk-MIMPMB7O.js.map} +0 -0
- /package/dist/{chunk-M4DKOI42.js.map → chunk-QO4KFUEI.js.map} +0 -0
- /package/dist/{chunk-JO2HR5PV.js.map → chunk-UPV6YWT5.js.map} +0 -0
package/README.md
CHANGED
|
@@ -15,22 +15,20 @@ against v1:
|
|
|
15
15
|
no incompatible type changes, and no silent behavior changes on the stable
|
|
16
16
|
lanes above. New functionality lands as additive APIs.
|
|
17
17
|
3. **Experimental leaves.** `@air-jam/sdk/preview`, `@air-jam/sdk/arcade*`,
|
|
18
|
-
`@air-jam/sdk/protocol`, `@air-jam/sdk/
|
|
19
|
-
`@air-jam/sdk/
|
|
18
|
+
`@air-jam/sdk/protocol`, `@air-jam/sdk/metadata`, and
|
|
19
|
+
`@air-jam/sdk/prefabs` are intentionally
|
|
20
20
|
unstable future-facing seams. They may change within `1.x` — each carries
|
|
21
21
|
a documented purpose in its leaf, and changes are noted in release notes.
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
re-exported as explicit experimental leaves when that happens.
|
|
22
|
+
Runtime inspection is moving to an explicit experimental leaf because it
|
|
23
|
+
has real machine-tooling consumers. Speculative control, observability, and
|
|
24
|
+
`contracts/v2` seams are not retained without a concrete consumer.
|
|
26
25
|
4. **v2 migration.** When v2 ships, we commit to publishing a codemod (or
|
|
27
26
|
migration notes if the surface is too narrow to automate) alongside the
|
|
28
27
|
release. v1 games will not be silently broken — the v1 SDK will remain
|
|
29
28
|
installable.
|
|
30
|
-
5. **Metadata and
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
versions during a transition window.
|
|
29
|
+
5. **Metadata and agent contracts.** Catalog metadata is versioned explicitly;
|
|
30
|
+
machine-operable game behavior is declared once through the semantic agent
|
|
31
|
+
contract used by CLI and MCP sessions.
|
|
34
32
|
|
|
35
33
|
Games built against v1 should declare `supportedSdkRange: "^1.0.0"` in their
|
|
36
34
|
metadata unless they intentionally pin tighter.
|
|
@@ -130,18 +128,16 @@ Selectors receive state fields only; call `useAirJamHost()` when a component
|
|
|
130
128
|
also needs runtime controls such as `joinUrl`, `sendSignal`, or `getInput`.
|
|
131
129
|
|
|
132
130
|
```tsx
|
|
133
|
-
import {
|
|
131
|
+
import { useAirJamHost } from "@air-jam/sdk";
|
|
132
|
+
import { airjam } from "./airjam.config";
|
|
134
133
|
|
|
135
134
|
const HostShell = () => (
|
|
136
|
-
<
|
|
137
|
-
topology={env.vite(import.meta.env).topology}
|
|
138
|
-
appId={import.meta.env.VITE_AIR_JAM_APP_ID}
|
|
139
|
-
input={{ schema: inputSchema }}
|
|
135
|
+
<airjam.Host
|
|
140
136
|
onPlayerJoin={(player) => console.log("joined", player.id)}
|
|
141
137
|
onPlayerLeave={(controllerId) => console.log("left", controllerId)}
|
|
142
138
|
>
|
|
143
139
|
<HostView />
|
|
144
|
-
</
|
|
140
|
+
</airjam.Host>
|
|
145
141
|
);
|
|
146
142
|
|
|
147
143
|
export const HostView = () => {
|
|
@@ -214,22 +210,17 @@ component also needs controls such as `sendSystemCommand`.
|
|
|
214
210
|
|
|
215
211
|
```tsx
|
|
216
212
|
import {
|
|
217
|
-
AirJamControllerRuntime,
|
|
218
|
-
env,
|
|
219
213
|
useAirJamController,
|
|
220
214
|
useControllerTick,
|
|
221
215
|
useInputWriter,
|
|
222
216
|
} from "@air-jam/sdk";
|
|
223
217
|
import { SurfaceViewport } from "@air-jam/sdk/ui";
|
|
218
|
+
import { airjam } from "./airjam.config";
|
|
224
219
|
|
|
225
220
|
const ControllerShell = () => (
|
|
226
|
-
<
|
|
227
|
-
topology={env.vite(import.meta.env).topology}
|
|
228
|
-
appId={import.meta.env.VITE_AIR_JAM_APP_ID}
|
|
229
|
-
nickname="Player 1"
|
|
230
|
-
>
|
|
221
|
+
<airjam.Controller nickname="Player 1">
|
|
231
222
|
<ControllerView />
|
|
232
|
-
</
|
|
223
|
+
</airjam.Controller>
|
|
233
224
|
);
|
|
234
225
|
|
|
235
226
|
export const ControllerView = () => {
|
|
@@ -279,7 +270,7 @@ instead of creating a duplicate player.
|
|
|
279
270
|
|
|
280
271
|
The important rule is:
|
|
281
272
|
|
|
282
|
-
1. mount `
|
|
273
|
+
1. mount `airjam.Host` / `airjam.Controller` once per runtime surface
|
|
283
274
|
2. use `useAirJamHost()` / `useAirJamController()` only as read hooks below that boundary
|
|
284
275
|
3. wrap controller UI in `SurfaceViewport` and set its `orientation` there
|
|
285
276
|
|
|
@@ -343,22 +334,12 @@ runtime so hosts can persist their preferred transparency level.
|
|
|
343
334
|
Keep preview usage inside explicit host-side UI and do not treat it as a stable
|
|
344
335
|
root-SDK contract yet.
|
|
345
336
|
|
|
346
|
-
## Runtime Contract
|
|
347
|
-
|
|
348
|
-
Air Jam also carries agent-facing runtime seams for control, inspection, and
|
|
349
|
-
observability. Those modules still exist in-source, but they are **not public
|
|
350
|
-
package exports in v1**, so consumers should not import:
|
|
337
|
+
## Runtime Inspection Contract
|
|
351
338
|
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
Current policy:
|
|
358
|
-
|
|
359
|
-
1. keep these seams private until a real first-party consumer lands
|
|
360
|
-
2. treat them as future agent-facing homes for bots, tests, previews, and agent tooling
|
|
361
|
-
3. re-export them later as explicit experimental leaves instead of implying they are stable root-SDK contracts
|
|
339
|
+
Runtime inspection is a real machine-tooling requirement and is published from
|
|
340
|
+
an explicit experimental leaf. Agent control remains game-semantic, and runtime
|
|
341
|
+
logs remain in the unified log stream; Air Jam does not keep parallel dormant
|
|
342
|
+
control or observability contracts for hypothetical consumers.
|
|
362
343
|
|
|
363
344
|
## Prefab Contract Leaf (Experimental)
|
|
364
345
|
|
|
@@ -424,7 +405,7 @@ Mount `AudioRuntime` once per runtime surface, then call `useAudio()` only below
|
|
|
424
405
|
Shared user settings are platform-owned and inherited by embedded games.
|
|
425
406
|
|
|
426
407
|
Mount `PlatformSettingsRuntime` once in the platform shell when you want a persisted owner runtime.
|
|
427
|
-
`
|
|
408
|
+
`airjam.Host` / `airjam.Controller` already provide a settings boundary for games, so repo games should not wrap each host/controller surface in another redundant `PlatformSettingsRuntime`.
|
|
428
409
|
|
|
429
410
|
```tsx
|
|
430
411
|
import {
|
|
@@ -458,7 +439,7 @@ const EmbeddedGame = () => {
|
|
|
458
439
|
Rules:
|
|
459
440
|
|
|
460
441
|
1. mount `PlatformSettingsRuntime persistence="local"` once in the platform shell
|
|
461
|
-
2. let `airjam.Host
|
|
442
|
+
2. let `airjam.Host` and `airjam.Controller` supply the in-game settings boundary automatically
|
|
462
443
|
3. embedded games inherit platform settings read-only
|
|
463
444
|
4. keep platform settings limited to shared cross-game concerns like audio, accessibility, and feedback
|
|
464
445
|
5. do not recreate feature-specific global settings stores alongside this runtime
|
|
@@ -642,9 +623,8 @@ export const App = () => (
|
|
|
642
623
|
);
|
|
643
624
|
```
|
|
644
625
|
|
|
645
|
-
This keeps runtime config, host input schema, route path ownership, and
|
|
646
|
-
|
|
647
|
-
Optional future-facing game capability metadata should also live here, but the schema is intentionally experimental and lives in `@air-jam/sdk/capabilities`.
|
|
626
|
+
This keeps runtime config, host input schema, route path ownership, and the
|
|
627
|
+
optional semantic agent contract in one place.
|
|
648
628
|
|
|
649
629
|
## Environment Variables
|
|
650
630
|
|
|
@@ -120,4 +120,4 @@ declare const agentAction: {
|
|
|
120
120
|
};
|
|
121
121
|
declare const defineAirJamAgentContract: <TSnapshot extends AirJamAgentJsonObject, TStoreDeclarations extends AirJamAgentStoreDeclarations>(contract: AirJamAgentContract<TSnapshot, TStoreDeclarations>) => AirJamAgentContract<TSnapshot, TStoreDeclarations>;
|
|
122
122
|
|
|
123
|
-
export { type
|
|
123
|
+
export { type AnyAirJamAgentContract as A, type AirJamAgentResolvedActionContract as B, type AirJamAgentSnapshotContext as C, type AirJamAgentStoreDeclaration as D, type AirJamAgentStoreDeclarations as E, type AirJamAgentStores as F, type InferAirJamAgentStores as G, type InferAirJamAgentActionInputPayload as I, describeAgentActionInputs as a, type AirJamAgentActionDescriptor as b, createAgentActionMetadata as c, defineAgentActionInput as d, type AirJamAgentActionInputDefinition as e, type AirJamAgentActionMetadata as f, type AirJamAgentActionOptions as g, type AirJamAgentActionParseMeta as h, type AirJamAgentActionPayloadKind as i, type AirJamAgentActionPayloadMetadata as j, type AirJamAgentActionCustomOptions as k, describeAirJamAgentAction as l, listAirJamAgentStoreDomains as m, type AirJamAgentActionContract as n, type AirJamAgentContract as o, agentActionInput as p, agentAction as q, resolveAirJamAgentActionPayload as r, agentStore as s, defineAirJamAgentContract as t, defineAirJamAgentStores as u, type AirJamAgentActionTarget as v, type AirJamAgentContractActionOptions as w, type AirJamAgentContractPayloadKind as x, type AirJamAgentContractPayloadMetadata as y, type AirJamAgentJsonObject as z };
|
|
@@ -120,4 +120,4 @@ declare const agentAction: {
|
|
|
120
120
|
};
|
|
121
121
|
declare const defineAirJamAgentContract: <TSnapshot extends AirJamAgentJsonObject, TStoreDeclarations extends AirJamAgentStoreDeclarations>(contract: AirJamAgentContract<TSnapshot, TStoreDeclarations>) => AirJamAgentContract<TSnapshot, TStoreDeclarations>;
|
|
122
122
|
|
|
123
|
-
export { type
|
|
123
|
+
export { type AnyAirJamAgentContract as A, type AirJamAgentResolvedActionContract as B, type AirJamAgentSnapshotContext as C, type AirJamAgentStoreDeclaration as D, type AirJamAgentStoreDeclarations as E, type AirJamAgentStores as F, type InferAirJamAgentStores as G, type InferAirJamAgentActionInputPayload as I, describeAgentActionInputs as a, type AirJamAgentActionDescriptor as b, createAgentActionMetadata as c, defineAgentActionInput as d, type AirJamAgentActionInputDefinition as e, type AirJamAgentActionMetadata as f, type AirJamAgentActionOptions as g, type AirJamAgentActionParseMeta as h, type AirJamAgentActionPayloadKind as i, type AirJamAgentActionPayloadMetadata as j, type AirJamAgentActionCustomOptions as k, describeAirJamAgentAction as l, listAirJamAgentStoreDomains as m, type AirJamAgentActionContract as n, type AirJamAgentContract as o, agentActionInput as p, agentAction as q, resolveAirJamAgentActionPayload as r, agentStore as s, defineAirJamAgentContract as t, defineAirJamAgentStores as u, type AirJamAgentActionTarget as v, type AirJamAgentContractActionOptions as w, type AirJamAgentContractPayloadKind as x, type AirJamAgentContractPayloadMetadata as y, type AirJamAgentJsonObject as z };
|
package/dist/agent-tooling.cjs
CHANGED
|
@@ -24,6 +24,7 @@ __export(agent_tooling_exports, {
|
|
|
24
24
|
defineAgentActionInput: () => defineAgentActionInput,
|
|
25
25
|
describeAgentActionInputs: () => describeAgentActionInputs,
|
|
26
26
|
describeAirJamAgentAction: () => describeAirJamAgentAction,
|
|
27
|
+
inspectAirJamAgentContractConformance: () => inspectAirJamAgentContractConformance,
|
|
27
28
|
listAirJamAgentStoreDomains: () => listAirJamAgentStoreDomains,
|
|
28
29
|
resolveAirJamAgentActionPayload: () => resolveAirJamAgentActionPayload
|
|
29
30
|
});
|
|
@@ -71,12 +72,150 @@ var resolveAirJamAgentActionPayload = (action, payload, meta) => {
|
|
|
71
72
|
const parsedInput = action.input.parse(payload, meta);
|
|
72
73
|
return action.toPayload ? action.toPayload(parsedInput) : parsedInput;
|
|
73
74
|
};
|
|
75
|
+
|
|
76
|
+
// src/agent/agent-contract-conformance.ts
|
|
77
|
+
var representativePayload = (kind, allowedValues) => {
|
|
78
|
+
switch (kind) {
|
|
79
|
+
case "none":
|
|
80
|
+
return void 0;
|
|
81
|
+
case "boolean":
|
|
82
|
+
return true;
|
|
83
|
+
case "number":
|
|
84
|
+
return 1;
|
|
85
|
+
case "string":
|
|
86
|
+
return "conformance";
|
|
87
|
+
case "enum":
|
|
88
|
+
return allowedValues?.[0];
|
|
89
|
+
case "json":
|
|
90
|
+
return {};
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
var inspectJsonValue = (value, path, seen, issues) => {
|
|
94
|
+
if (value === null || typeof value === "string" || typeof value === "boolean") {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
if (typeof value === "number") {
|
|
98
|
+
if (!Number.isFinite(value)) {
|
|
99
|
+
issues.push({
|
|
100
|
+
code: "snapshot-not-json",
|
|
101
|
+
path,
|
|
102
|
+
message: "Snapshot numbers must be finite."
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
if (typeof value !== "object") {
|
|
108
|
+
issues.push({
|
|
109
|
+
code: "snapshot-not-json",
|
|
110
|
+
path,
|
|
111
|
+
message: `Snapshot value has unsupported type ${typeof value}.`
|
|
112
|
+
});
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
if (seen.has(value)) {
|
|
116
|
+
issues.push({
|
|
117
|
+
code: "snapshot-not-json",
|
|
118
|
+
path,
|
|
119
|
+
message: "Snapshot contains a circular reference."
|
|
120
|
+
});
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
seen.add(value);
|
|
124
|
+
if (Array.isArray(value)) {
|
|
125
|
+
value.forEach(
|
|
126
|
+
(entry, index) => inspectJsonValue(entry, `${path}[${index}]`, seen, issues)
|
|
127
|
+
);
|
|
128
|
+
} else {
|
|
129
|
+
for (const [key, entry] of Object.entries(value)) {
|
|
130
|
+
inspectJsonValue(entry, `${path}.${key}`, seen, issues);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
seen.delete(value);
|
|
134
|
+
};
|
|
135
|
+
var inspectAirJamAgentContractConformance = async ({
|
|
136
|
+
gameId,
|
|
137
|
+
contract,
|
|
138
|
+
stores,
|
|
139
|
+
controllerId = "conformance-controller"
|
|
140
|
+
}) => {
|
|
141
|
+
const issues = [];
|
|
142
|
+
const storeDomains = Object.keys(contract.stores).sort();
|
|
143
|
+
const runtimeStoreDomains = Object.keys(stores).sort();
|
|
144
|
+
const actionNames = Object.keys(contract.actions).sort();
|
|
145
|
+
if (JSON.stringify(storeDomains) !== JSON.stringify(runtimeStoreDomains)) {
|
|
146
|
+
issues.push({
|
|
147
|
+
code: "store-domain-mismatch",
|
|
148
|
+
path: "stores",
|
|
149
|
+
message: `Declared domains [${storeDomains.join(", ")}] do not match runtime domains [${runtimeStoreDomains.join(", ")}].`
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
for (const [actionName, action] of Object.entries(contract.actions)) {
|
|
153
|
+
const targetDomain = action.target.storeDomain ?? "default";
|
|
154
|
+
const runtimeStore = stores[targetDomain];
|
|
155
|
+
if (!runtimeStore?.actions || typeof runtimeStore.actions !== "object") {
|
|
156
|
+
issues.push({
|
|
157
|
+
code: "missing-store-actions",
|
|
158
|
+
path: `actions.${actionName}.target`,
|
|
159
|
+
message: `Runtime store "${targetDomain}" does not expose an actions object.`
|
|
160
|
+
});
|
|
161
|
+
} else if (typeof runtimeStore.actions[action.target.actionName] !== "function") {
|
|
162
|
+
issues.push({
|
|
163
|
+
code: "missing-target-action",
|
|
164
|
+
path: `actions.${actionName}.target`,
|
|
165
|
+
message: `Runtime store "${targetDomain}" does not expose action "${action.target.actionName}".`
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
const metadata = describeAirJamAgentAction(action);
|
|
169
|
+
if (!metadata.description?.trim() || !metadata.resultDescription?.trim() || metadata.payload.kind === "enum" && !metadata.payload.allowedValues?.length) {
|
|
170
|
+
issues.push({
|
|
171
|
+
code: "invalid-action-metadata",
|
|
172
|
+
path: `actions.${actionName}`,
|
|
173
|
+
message: "Every semantic action must describe its intent, expected result, and enum values when applicable."
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
try {
|
|
177
|
+
resolveAirJamAgentActionPayload(
|
|
178
|
+
action,
|
|
179
|
+
representativePayload(
|
|
180
|
+
metadata.payload.kind,
|
|
181
|
+
metadata.payload.allowedValues
|
|
182
|
+
),
|
|
183
|
+
{ gameId, actionName, contractKind: "conformance" }
|
|
184
|
+
);
|
|
185
|
+
} catch (error) {
|
|
186
|
+
issues.push({
|
|
187
|
+
code: "payload-parse-failed",
|
|
188
|
+
path: `actions.${actionName}.input`,
|
|
189
|
+
message: error instanceof Error ? error.message : String(error)
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
try {
|
|
194
|
+
const snapshot = await contract.projectSnapshot({ controllerId, stores });
|
|
195
|
+
inspectJsonValue(snapshot, "snapshot", /* @__PURE__ */ new Set(), issues);
|
|
196
|
+
} catch (error) {
|
|
197
|
+
issues.push({
|
|
198
|
+
code: "snapshot-failed",
|
|
199
|
+
path: "snapshot",
|
|
200
|
+
message: error instanceof Error ? error.message : String(error)
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
return {
|
|
204
|
+
schemaVersion: 1,
|
|
205
|
+
gameId,
|
|
206
|
+
ok: issues.length === 0,
|
|
207
|
+
storeDomains,
|
|
208
|
+
actionNames,
|
|
209
|
+
issues
|
|
210
|
+
};
|
|
211
|
+
};
|
|
74
212
|
// Annotate the CommonJS export names for ESM import in node:
|
|
75
213
|
0 && (module.exports = {
|
|
76
214
|
createAgentActionMetadata,
|
|
77
215
|
defineAgentActionInput,
|
|
78
216
|
describeAgentActionInputs,
|
|
79
217
|
describeAirJamAgentAction,
|
|
218
|
+
inspectAirJamAgentContractConformance,
|
|
80
219
|
listAirJamAgentStoreDomains,
|
|
81
220
|
resolveAirJamAgentActionPayload
|
|
82
221
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/agent-tooling.ts","../src/agent/agent-action.ts","../src/agent/agent-contract.ts"],"sourcesContent":["export {\n createAgentActionMetadata,\n defineAgentActionInput,\n describeAgentActionInputs,\n type AirJamAgentActionDescriptor,\n type AirJamAgentActionInputDefinition,\n type AirJamAgentActionMetadata,\n type AirJamAgentActionOptions,\n type AirJamAgentActionParseMeta,\n type AirJamAgentActionPayloadKind,\n type AirJamAgentActionPayloadMetadata,\n} from \"./agent/agent-action\";\nexport type { AirJamAgentActionCustomOptions } from \"./agent/agent-action\";\nexport {\n describeAirJamAgentAction,\n listAirJamAgentStoreDomains,\n resolveAirJamAgentActionPayload,\n type AirJamAgentActionContract,\n type AirJamAgentContract,\n} from \"./agent/agent-contract\";\n","import type { ZodType } from \"zod\";\n\nexport type AirJamAgentActionPayloadKind =\n | \"none\"\n | \"boolean\"\n | \"number\"\n | \"string\"\n | \"enum\"\n | \"json\";\n\nexport type AirJamAgentActionPayloadMetadata = {\n kind: AirJamAgentActionPayloadKind;\n description?: string;\n allowedValues?: string[];\n};\n\nexport type AirJamAgentActionMetadata = {\n description?: string;\n payload: AirJamAgentActionPayloadMetadata;\n resultDescription?: string;\n};\n\nexport type AirJamAgentActionDescriptor = {\n name: string;\n description: string | null;\n payload: {\n kind: AirJamAgentActionPayloadKind;\n description: string | null;\n allowedValues?: string[];\n };\n resultDescription: string | null;\n};\n\nexport type AirJamAgentActionParseMeta = {\n gameId: string;\n actionName: string;\n contractKind?: string;\n};\n\nexport type AirJamAgentActionInputDefinition<TPayload = unknown> = {\n parse: (payload: unknown, meta: AirJamAgentActionParseMeta) => TPayload;\n metadata: AirJamAgentActionMetadata;\n};\n\nexport type InferAirJamAgentActionInputPayload<TInput> =\n TInput extends AirJamAgentActionInputDefinition<infer TPayload>\n ? TPayload\n : never;\n\nexport type AirJamAgentActionOptions = {\n description?: string;\n payloadDescription?: string;\n resultDescription?: string;\n};\n\nexport type AirJamAgentActionCustomOptions = AirJamAgentActionOptions & {\n payloadKind?: AirJamAgentActionPayloadKind;\n allowedValues?: string[];\n};\n\nconst createActionError = (\n meta: AirJamAgentActionParseMeta,\n message: string,\n): Error =>\n new Error(\n `[${meta.contractKind ?? \"action\"}:${meta.gameId}.${meta.actionName}] ${message}`,\n );\n\nexport const createAgentActionMetadata = (\n payload: AirJamAgentActionPayloadMetadata,\n options?: AirJamAgentActionOptions,\n): AirJamAgentActionMetadata => ({\n description: options?.description,\n payload: {\n ...payload,\n description: options?.payloadDescription ?? payload.description,\n },\n resultDescription: options?.resultDescription,\n});\n\nexport const defineAgentActionInput = <TPayload>(\n parse: (payload: unknown, meta: AirJamAgentActionParseMeta) => TPayload,\n metadata: AirJamAgentActionMetadata,\n): AirJamAgentActionInputDefinition<TPayload> => ({\n parse,\n metadata,\n});\n\nconst parseFiniteNumber = (\n payload: unknown,\n meta: AirJamAgentActionParseMeta,\n): number => {\n const nextValue =\n typeof payload === \"number\" && Number.isFinite(payload)\n ? payload\n : typeof payload === \"string\"\n ? Number(payload)\n : Number.NaN;\n\n if (!Number.isFinite(nextValue)) {\n throw createActionError(meta, \"expected a finite number payload\");\n }\n\n return nextValue;\n};\n\nconst parseStringValue = (\n payload: unknown,\n meta: AirJamAgentActionParseMeta,\n): string => {\n if (typeof payload !== \"string\") {\n throw createActionError(meta, \"expected a string payload\");\n }\n\n return payload;\n};\n\nconst parseBooleanValue = (\n payload: unknown,\n meta: AirJamAgentActionParseMeta,\n): boolean => {\n if (typeof payload === \"boolean\") {\n return payload;\n }\n\n if (payload === \"true\" || payload === \"1\") {\n return true;\n }\n\n if (payload === \"false\" || payload === \"0\") {\n return false;\n }\n\n throw createActionError(meta, \"expected a boolean payload\");\n};\n\nconst parseEnumValue = <const TValues extends readonly string[]>(\n values: TValues,\n payload: unknown,\n meta: AirJamAgentActionParseMeta,\n): TValues[number] => {\n if (typeof payload !== \"string\" || !values.includes(payload)) {\n throw createActionError(meta, `expected one of: ${values.join(\", \")}`);\n }\n\n return payload as TValues[number];\n};\n\ntype AirJamAgentActionCustomParser<TPayload> = (\n payload: unknown,\n meta: AirJamAgentActionParseMeta,\n) => TPayload;\n\ntype AirJamAgentActionZodSchema<TPayload> = ZodType<TPayload>;\n\nconst noneInput = (\n options?: AirJamAgentActionOptions,\n): AirJamAgentActionInputDefinition<void> =>\n defineAgentActionInput(\n () => undefined,\n createAgentActionMetadata({ kind: \"none\" }, options),\n );\n\nconst numberInput = (\n options?: AirJamAgentActionOptions,\n): AirJamAgentActionInputDefinition<number> =>\n defineAgentActionInput(\n parseFiniteNumber,\n createAgentActionMetadata({ kind: \"number\" }, options),\n );\n\nconst stringInput = (\n options?: AirJamAgentActionOptions,\n): AirJamAgentActionInputDefinition<string> =>\n defineAgentActionInput(\n parseStringValue,\n createAgentActionMetadata({ kind: \"string\" }, options),\n );\n\nconst booleanInput = (\n options?: AirJamAgentActionOptions,\n): AirJamAgentActionInputDefinition<boolean> =>\n defineAgentActionInput(\n parseBooleanValue,\n createAgentActionMetadata({ kind: \"boolean\" }, options),\n );\n\nconst enumInput = <const TValues extends readonly string[]>(\n values: TValues,\n options?: AirJamAgentActionOptions,\n): AirJamAgentActionInputDefinition<TValues[number]> =>\n defineAgentActionInput(\n (payload, meta) => parseEnumValue(values, payload, meta),\n createAgentActionMetadata(\n {\n kind: \"enum\",\n allowedValues: [...values],\n },\n options,\n ),\n );\n\nconst jsonInput = (\n options?: AirJamAgentActionOptions,\n): AirJamAgentActionInputDefinition<unknown> =>\n defineAgentActionInput(\n (payload) => payload,\n createAgentActionMetadata({ kind: \"json\" }, options),\n );\n\nfunction customInput<TPayload>(\n parse: AirJamAgentActionCustomParser<TPayload>,\n): AirJamAgentActionInputDefinition<TPayload>;\nfunction customInput<TPayload>(\n options: AirJamAgentActionCustomOptions,\n parse: AirJamAgentActionCustomParser<TPayload>,\n): AirJamAgentActionInputDefinition<TPayload>;\nfunction customInput<TPayload>(\n optionsOrParse:\n | AirJamAgentActionCustomOptions\n | AirJamAgentActionCustomParser<TPayload>,\n maybeParse?: AirJamAgentActionCustomParser<TPayload>,\n): AirJamAgentActionInputDefinition<TPayload> {\n if (typeof optionsOrParse === \"function\") {\n return defineAgentActionInput(\n optionsOrParse,\n createAgentActionMetadata({ kind: \"json\" }),\n );\n }\n\n if (typeof maybeParse === \"function\") {\n return defineAgentActionInput(\n maybeParse,\n createAgentActionMetadata(\n {\n kind: optionsOrParse.payloadKind ?? \"json\",\n allowedValues: optionsOrParse.allowedValues,\n },\n optionsOrParse,\n ),\n );\n }\n\n throw new Error(\"Invalid agent action input definition.\");\n}\n\nconst zodInput = <TPayload>(\n schema: AirJamAgentActionZodSchema<TPayload>,\n options?: AirJamAgentActionOptions,\n): AirJamAgentActionInputDefinition<TPayload> =>\n defineAgentActionInput(\n (payload, meta) => {\n const result = schema.safeParse(payload);\n if (result.success) {\n return result.data;\n }\n\n const firstIssue = result.error.issues[0];\n throw createActionError(\n meta,\n firstIssue?.message ?? \"payload failed schema validation\",\n );\n },\n createAgentActionMetadata({ kind: \"json\" }, options),\n );\n\nexport const agentActionInput = {\n none: noneInput,\n number: numberInput,\n string: stringInput,\n boolean: booleanInput,\n enum: enumInput,\n json: jsonInput,\n custom: customInput,\n zod: zodInput,\n};\n\nexport const describeAgentActionInputs = <\n TActions extends Record<\n string,\n { metadata?: AirJamAgentActionMetadata | undefined }\n >,\n>(\n actions: TActions,\n): AirJamAgentActionDescriptor[] =>\n Object.entries(actions)\n .map(([name, definition]) => {\n const metadata = definition.metadata;\n return {\n name,\n description: metadata?.description ?? null,\n payload: {\n kind: metadata?.payload.kind ?? \"json\",\n description: metadata?.payload.description ?? null,\n ...(metadata?.payload.allowedValues\n ? {\n allowedValues: [...metadata.payload.allowedValues],\n }\n : {}),\n },\n resultDescription: metadata?.resultDescription ?? null,\n };\n })\n .sort((left, right) => left.name.localeCompare(right.name));\n","import {\n type AirJamAgentActionInputDefinition,\n type AirJamAgentActionMetadata,\n type AirJamAgentActionOptions,\n type AirJamAgentActionParseMeta,\n type AirJamAgentActionPayloadKind,\n type AirJamAgentActionPayloadMetadata,\n} from \"./agent-action.js\";\n\nexport type AirJamAgentJsonObject = Record<string, unknown>;\n\nexport type AirJamAgentContractPayloadKind = AirJamAgentActionPayloadKind;\n\nexport type AirJamAgentContractPayloadMetadata =\n AirJamAgentActionPayloadMetadata;\n\nexport type AirJamAgentStoreDeclaration<TStore extends object = object> = {\n readonly __store?: TStore;\n};\n\nexport type AirJamAgentStoreDeclarations = Record<\n string,\n AirJamAgentStoreDeclaration<object>\n>;\n\nexport type AirJamAgentActionTarget = {\n kind: \"participant\" | \"host\";\n actionName: string;\n storeDomain?: string;\n};\n\nexport type AirJamAgentStores = Record<string, object>;\n\nexport type InferAirJamAgentStores<\n TDeclarations extends AirJamAgentStoreDeclarations,\n> = {\n [TKey in keyof TDeclarations]: TDeclarations[TKey] extends AirJamAgentStoreDeclaration<\n infer TStore\n >\n ? TStore\n : never;\n};\n\ntype AirJamAgentActionContractBase = {\n target: AirJamAgentActionTarget;\n description?: string;\n availability?: string;\n /**\n * Human and agent-facing description of the expected semantic effect.\n * This does not automatically become runtime result data; return\n * `acceptAirJamAction(result)` from the underlying store action when callers\n * need an actual result payload.\n */\n resultDescription?: string;\n};\n\nexport type AirJamAgentResolvedActionContract<\n TInput = unknown,\n TPayload = TInput,\n> = AirJamAgentActionContractBase & {\n input: AirJamAgentActionInputDefinition<TInput>;\n toPayload?: (input: TInput) => TPayload;\n};\n\n// Existential wildcard for heterogenous action contracts.\n/* eslint-disable @typescript-eslint/no-explicit-any -- These aliases intentionally erase generic action and store shapes at contract boundaries. */\nexport type AirJamAgentActionContract = AirJamAgentResolvedActionContract<\n any,\n any\n>;\n\n// Existential wildcard for published agent contracts with arbitrary snapshot/store shapes.\nexport type AnyAirJamAgentContract = AirJamAgentContract<any, any>;\n/* eslint-enable @typescript-eslint/no-explicit-any */\n\nexport type AirJamAgentContractActionOptions<\n TInput,\n TPayload = TInput,\n> = AirJamAgentActionOptions & {\n availability?: string;\n input: AirJamAgentActionInputDefinition<TInput>;\n toPayload?: (input: TInput) => TPayload;\n};\n\nexport type AirJamAgentSnapshotContext<\n TStores extends AirJamAgentStores = AirJamAgentStores,\n> = {\n controllerId: string | null;\n stores: Partial<TStores>;\n};\n\nexport type AirJamAgentContract<\n TSnapshot extends AirJamAgentJsonObject = AirJamAgentJsonObject,\n TStoreDeclarations extends AirJamAgentStoreDeclarations =\n AirJamAgentStoreDeclarations,\n> = {\n stores: TStoreDeclarations;\n snapshotDescription?: string;\n projectSnapshot: (\n context: AirJamAgentSnapshotContext<\n InferAirJamAgentStores<TStoreDeclarations>\n >,\n ) => TSnapshot | Promise<TSnapshot>;\n actions: Record<string, AirJamAgentActionContract>;\n};\n\nexport const agentStore = <\n TStore extends object,\n>(): AirJamAgentStoreDeclaration<TStore> =>\n ({}) as AirJamAgentStoreDeclaration<TStore>;\n\nexport const defineAirJamAgentStores = <\n TDeclarations extends AirJamAgentStoreDeclarations,\n>(\n stores: TDeclarations,\n): TDeclarations => stores;\n\nexport const listAirJamAgentStoreDomains = (\n contract: AnyAirJamAgentContract,\n): string[] => Object.keys(contract.stores);\n\nexport const describeAirJamAgentAction = (\n action: AirJamAgentActionContract,\n): AirJamAgentActionMetadata => ({\n description: action.description ?? action.input.metadata.description,\n payload: {\n ...action.input.metadata.payload,\n },\n resultDescription:\n action.resultDescription ?? action.input.metadata.resultDescription,\n});\n\nexport const resolveAirJamAgentActionPayload = (\n action: AirJamAgentActionContract,\n payload: unknown,\n meta: AirJamAgentActionParseMeta,\n): unknown => {\n const parsedInput = action.input.parse(payload, meta);\n return action.toPayload ? action.toPayload(parsedInput) : parsedInput;\n};\n\nexport const agentAction = {\n participant: <TInput, TPayload = TInput>(\n target: Omit<AirJamAgentActionTarget, \"kind\">,\n options: AirJamAgentContractActionOptions<TInput, TPayload>,\n ): AirJamAgentResolvedActionContract<TInput, TPayload> => ({\n target: {\n kind: \"participant\",\n actionName: target.actionName,\n ...(target.storeDomain ? { storeDomain: target.storeDomain } : {}),\n },\n description: options.description,\n availability: options.availability,\n input: options.input,\n toPayload: options.toPayload,\n resultDescription: options.resultDescription,\n }),\n host: <TInput, TPayload = TInput>(\n target: Omit<AirJamAgentActionTarget, \"kind\">,\n options: AirJamAgentContractActionOptions<TInput, TPayload>,\n ): AirJamAgentResolvedActionContract<TInput, TPayload> => ({\n target: {\n kind: \"host\",\n actionName: target.actionName,\n ...(target.storeDomain ? { storeDomain: target.storeDomain } : {}),\n },\n description: options.description,\n availability: options.availability,\n input: options.input,\n toPayload: options.toPayload,\n resultDescription: options.resultDescription,\n }),\n};\n\nexport const defineAirJamAgentContract = <\n TSnapshot extends AirJamAgentJsonObject,\n TStoreDeclarations extends AirJamAgentStoreDeclarations,\n>(\n contract: AirJamAgentContract<TSnapshot, TStoreDeclarations>,\n): AirJamAgentContract<TSnapshot, TStoreDeclarations> => contract;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACoEO,IAAM,4BAA4B,CACvC,SACA,aAC+B;AAAA,EAC/B,aAAa,SAAS;AAAA,EACtB,SAAS;AAAA,IACP,GAAG;AAAA,IACH,aAAa,SAAS,sBAAsB,QAAQ;AAAA,EACtD;AAAA,EACA,mBAAmB,SAAS;AAC9B;AAEO,IAAM,yBAAyB,CACpC,OACA,cACgD;AAAA,EAChD;AAAA,EACA;AACF;AA+LO,IAAM,4BAA4B,CAMvC,YAEA,OAAO,QAAQ,OAAO,EACnB,IAAI,CAAC,CAAC,MAAM,UAAU,MAAM;AAC3B,QAAM,WAAW,WAAW;AAC5B,SAAO;AAAA,IACL;AAAA,IACA,aAAa,UAAU,eAAe;AAAA,IACtC,SAAS;AAAA,MACP,MAAM,UAAU,QAAQ,QAAQ;AAAA,MAChC,aAAa,UAAU,QAAQ,eAAe;AAAA,MAC9C,GAAI,UAAU,QAAQ,gBAClB;AAAA,QACE,eAAe,CAAC,GAAG,SAAS,QAAQ,aAAa;AAAA,MACnD,IACA,CAAC;AAAA,IACP;AAAA,IACA,mBAAmB,UAAU,qBAAqB;AAAA,EACpD;AACF,CAAC,EACA,KAAK,CAAC,MAAM,UAAU,KAAK,KAAK,cAAc,MAAM,IAAI,CAAC;;;AC1LvD,IAAM,8BAA8B,CACzC,aACa,OAAO,KAAK,SAAS,MAAM;AAEnC,IAAM,4BAA4B,CACvC,YAC+B;AAAA,EAC/B,aAAa,OAAO,eAAe,OAAO,MAAM,SAAS;AAAA,EACzD,SAAS;AAAA,IACP,GAAG,OAAO,MAAM,SAAS;AAAA,EAC3B;AAAA,EACA,mBACE,OAAO,qBAAqB,OAAO,MAAM,SAAS;AACtD;AAEO,IAAM,kCAAkC,CAC7C,QACA,SACA,SACY;AACZ,QAAM,cAAc,OAAO,MAAM,MAAM,SAAS,IAAI;AACpD,SAAO,OAAO,YAAY,OAAO,UAAU,WAAW,IAAI;AAC5D;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/agent-tooling.ts","../src/agent/agent-action.ts","../src/agent/agent-contract.ts","../src/agent/agent-contract-conformance.ts"],"sourcesContent":["export {\n createAgentActionMetadata,\n defineAgentActionInput,\n describeAgentActionInputs,\n type AirJamAgentActionDescriptor,\n type AirJamAgentActionInputDefinition,\n type AirJamAgentActionMetadata,\n type AirJamAgentActionOptions,\n type AirJamAgentActionParseMeta,\n type AirJamAgentActionPayloadKind,\n type AirJamAgentActionPayloadMetadata,\n} from \"./agent/agent-action\";\nexport type { AirJamAgentActionCustomOptions } from \"./agent/agent-action\";\nexport {\n describeAirJamAgentAction,\n listAirJamAgentStoreDomains,\n resolveAirJamAgentActionPayload,\n type AirJamAgentActionContract,\n type AirJamAgentContract,\n} from \"./agent/agent-contract\";\nexport {\n inspectAirJamAgentContractConformance,\n type AirJamAgentContractConformanceIssue,\n type AirJamAgentContractConformanceReport,\n} from \"./agent/agent-contract-conformance\";\n","import type { ZodType } from \"zod\";\n\nexport type AirJamAgentActionPayloadKind =\n | \"none\"\n | \"boolean\"\n | \"number\"\n | \"string\"\n | \"enum\"\n | \"json\";\n\nexport type AirJamAgentActionPayloadMetadata = {\n kind: AirJamAgentActionPayloadKind;\n description?: string;\n allowedValues?: string[];\n};\n\nexport type AirJamAgentActionMetadata = {\n description?: string;\n payload: AirJamAgentActionPayloadMetadata;\n resultDescription?: string;\n};\n\nexport type AirJamAgentActionDescriptor = {\n name: string;\n description: string | null;\n payload: {\n kind: AirJamAgentActionPayloadKind;\n description: string | null;\n allowedValues?: string[];\n };\n resultDescription: string | null;\n};\n\nexport type AirJamAgentActionParseMeta = {\n gameId: string;\n actionName: string;\n contractKind?: string;\n};\n\nexport type AirJamAgentActionInputDefinition<TPayload = unknown> = {\n parse: (payload: unknown, meta: AirJamAgentActionParseMeta) => TPayload;\n metadata: AirJamAgentActionMetadata;\n};\n\nexport type InferAirJamAgentActionInputPayload<TInput> =\n TInput extends AirJamAgentActionInputDefinition<infer TPayload>\n ? TPayload\n : never;\n\nexport type AirJamAgentActionOptions = {\n description?: string;\n payloadDescription?: string;\n resultDescription?: string;\n};\n\nexport type AirJamAgentActionCustomOptions = AirJamAgentActionOptions & {\n payloadKind?: AirJamAgentActionPayloadKind;\n allowedValues?: string[];\n};\n\nconst createActionError = (\n meta: AirJamAgentActionParseMeta,\n message: string,\n): Error =>\n new Error(\n `[${meta.contractKind ?? \"action\"}:${meta.gameId}.${meta.actionName}] ${message}`,\n );\n\nexport const createAgentActionMetadata = (\n payload: AirJamAgentActionPayloadMetadata,\n options?: AirJamAgentActionOptions,\n): AirJamAgentActionMetadata => ({\n description: options?.description,\n payload: {\n ...payload,\n description: options?.payloadDescription ?? payload.description,\n },\n resultDescription: options?.resultDescription,\n});\n\nexport const defineAgentActionInput = <TPayload>(\n parse: (payload: unknown, meta: AirJamAgentActionParseMeta) => TPayload,\n metadata: AirJamAgentActionMetadata,\n): AirJamAgentActionInputDefinition<TPayload> => ({\n parse,\n metadata,\n});\n\nconst parseFiniteNumber = (\n payload: unknown,\n meta: AirJamAgentActionParseMeta,\n): number => {\n const nextValue =\n typeof payload === \"number\" && Number.isFinite(payload)\n ? payload\n : typeof payload === \"string\"\n ? Number(payload)\n : Number.NaN;\n\n if (!Number.isFinite(nextValue)) {\n throw createActionError(meta, \"expected a finite number payload\");\n }\n\n return nextValue;\n};\n\nconst parseStringValue = (\n payload: unknown,\n meta: AirJamAgentActionParseMeta,\n): string => {\n if (typeof payload !== \"string\") {\n throw createActionError(meta, \"expected a string payload\");\n }\n\n return payload;\n};\n\nconst parseBooleanValue = (\n payload: unknown,\n meta: AirJamAgentActionParseMeta,\n): boolean => {\n if (typeof payload === \"boolean\") {\n return payload;\n }\n\n if (payload === \"true\" || payload === \"1\") {\n return true;\n }\n\n if (payload === \"false\" || payload === \"0\") {\n return false;\n }\n\n throw createActionError(meta, \"expected a boolean payload\");\n};\n\nconst parseEnumValue = <const TValues extends readonly string[]>(\n values: TValues,\n payload: unknown,\n meta: AirJamAgentActionParseMeta,\n): TValues[number] => {\n if (typeof payload !== \"string\" || !values.includes(payload)) {\n throw createActionError(meta, `expected one of: ${values.join(\", \")}`);\n }\n\n return payload as TValues[number];\n};\n\ntype AirJamAgentActionCustomParser<TPayload> = (\n payload: unknown,\n meta: AirJamAgentActionParseMeta,\n) => TPayload;\n\ntype AirJamAgentActionZodSchema<TPayload> = ZodType<TPayload>;\n\nconst noneInput = (\n options?: AirJamAgentActionOptions,\n): AirJamAgentActionInputDefinition<void> =>\n defineAgentActionInput(\n () => undefined,\n createAgentActionMetadata({ kind: \"none\" }, options),\n );\n\nconst numberInput = (\n options?: AirJamAgentActionOptions,\n): AirJamAgentActionInputDefinition<number> =>\n defineAgentActionInput(\n parseFiniteNumber,\n createAgentActionMetadata({ kind: \"number\" }, options),\n );\n\nconst stringInput = (\n options?: AirJamAgentActionOptions,\n): AirJamAgentActionInputDefinition<string> =>\n defineAgentActionInput(\n parseStringValue,\n createAgentActionMetadata({ kind: \"string\" }, options),\n );\n\nconst booleanInput = (\n options?: AirJamAgentActionOptions,\n): AirJamAgentActionInputDefinition<boolean> =>\n defineAgentActionInput(\n parseBooleanValue,\n createAgentActionMetadata({ kind: \"boolean\" }, options),\n );\n\nconst enumInput = <const TValues extends readonly string[]>(\n values: TValues,\n options?: AirJamAgentActionOptions,\n): AirJamAgentActionInputDefinition<TValues[number]> =>\n defineAgentActionInput(\n (payload, meta) => parseEnumValue(values, payload, meta),\n createAgentActionMetadata(\n {\n kind: \"enum\",\n allowedValues: [...values],\n },\n options,\n ),\n );\n\nconst jsonInput = (\n options?: AirJamAgentActionOptions,\n): AirJamAgentActionInputDefinition<unknown> =>\n defineAgentActionInput(\n (payload) => payload,\n createAgentActionMetadata({ kind: \"json\" }, options),\n );\n\nfunction customInput<TPayload>(\n parse: AirJamAgentActionCustomParser<TPayload>,\n): AirJamAgentActionInputDefinition<TPayload>;\nfunction customInput<TPayload>(\n options: AirJamAgentActionCustomOptions,\n parse: AirJamAgentActionCustomParser<TPayload>,\n): AirJamAgentActionInputDefinition<TPayload>;\nfunction customInput<TPayload>(\n optionsOrParse:\n | AirJamAgentActionCustomOptions\n | AirJamAgentActionCustomParser<TPayload>,\n maybeParse?: AirJamAgentActionCustomParser<TPayload>,\n): AirJamAgentActionInputDefinition<TPayload> {\n if (typeof optionsOrParse === \"function\") {\n return defineAgentActionInput(\n optionsOrParse,\n createAgentActionMetadata({ kind: \"json\" }),\n );\n }\n\n if (typeof maybeParse === \"function\") {\n return defineAgentActionInput(\n maybeParse,\n createAgentActionMetadata(\n {\n kind: optionsOrParse.payloadKind ?? \"json\",\n allowedValues: optionsOrParse.allowedValues,\n },\n optionsOrParse,\n ),\n );\n }\n\n throw new Error(\"Invalid agent action input definition.\");\n}\n\nconst zodInput = <TPayload>(\n schema: AirJamAgentActionZodSchema<TPayload>,\n options?: AirJamAgentActionOptions,\n): AirJamAgentActionInputDefinition<TPayload> =>\n defineAgentActionInput(\n (payload, meta) => {\n const result = schema.safeParse(payload);\n if (result.success) {\n return result.data;\n }\n\n const firstIssue = result.error.issues[0];\n throw createActionError(\n meta,\n firstIssue?.message ?? \"payload failed schema validation\",\n );\n },\n createAgentActionMetadata({ kind: \"json\" }, options),\n );\n\nexport const agentActionInput = {\n none: noneInput,\n number: numberInput,\n string: stringInput,\n boolean: booleanInput,\n enum: enumInput,\n json: jsonInput,\n custom: customInput,\n zod: zodInput,\n};\n\nexport const describeAgentActionInputs = <\n TActions extends Record<\n string,\n { metadata?: AirJamAgentActionMetadata | undefined }\n >,\n>(\n actions: TActions,\n): AirJamAgentActionDescriptor[] =>\n Object.entries(actions)\n .map(([name, definition]) => {\n const metadata = definition.metadata;\n return {\n name,\n description: metadata?.description ?? null,\n payload: {\n kind: metadata?.payload.kind ?? \"json\",\n description: metadata?.payload.description ?? null,\n ...(metadata?.payload.allowedValues\n ? {\n allowedValues: [...metadata.payload.allowedValues],\n }\n : {}),\n },\n resultDescription: metadata?.resultDescription ?? null,\n };\n })\n .sort((left, right) => left.name.localeCompare(right.name));\n","import {\n type AirJamAgentActionInputDefinition,\n type AirJamAgentActionMetadata,\n type AirJamAgentActionOptions,\n type AirJamAgentActionParseMeta,\n type AirJamAgentActionPayloadKind,\n type AirJamAgentActionPayloadMetadata,\n} from \"./agent-action.js\";\n\nexport type AirJamAgentJsonObject = Record<string, unknown>;\n\nexport type AirJamAgentContractPayloadKind = AirJamAgentActionPayloadKind;\n\nexport type AirJamAgentContractPayloadMetadata =\n AirJamAgentActionPayloadMetadata;\n\nexport type AirJamAgentStoreDeclaration<TStore extends object = object> = {\n readonly __store?: TStore;\n};\n\nexport type AirJamAgentStoreDeclarations = Record<\n string,\n AirJamAgentStoreDeclaration<object>\n>;\n\nexport type AirJamAgentActionTarget = {\n kind: \"participant\" | \"host\";\n actionName: string;\n storeDomain?: string;\n};\n\nexport type AirJamAgentStores = Record<string, object>;\n\nexport type InferAirJamAgentStores<\n TDeclarations extends AirJamAgentStoreDeclarations,\n> = {\n [TKey in keyof TDeclarations]: TDeclarations[TKey] extends AirJamAgentStoreDeclaration<\n infer TStore\n >\n ? TStore\n : never;\n};\n\ntype AirJamAgentActionContractBase = {\n target: AirJamAgentActionTarget;\n description?: string;\n availability?: string;\n /**\n * Human and agent-facing description of the expected semantic effect.\n * This does not automatically become runtime result data; return\n * `acceptAirJamAction(result)` from the underlying store action when callers\n * need an actual result payload.\n */\n resultDescription?: string;\n};\n\nexport type AirJamAgentResolvedActionContract<\n TInput = unknown,\n TPayload = TInput,\n> = AirJamAgentActionContractBase & {\n input: AirJamAgentActionInputDefinition<TInput>;\n toPayload?: (input: TInput) => TPayload;\n};\n\n// Existential wildcard for heterogenous action contracts.\n/* eslint-disable @typescript-eslint/no-explicit-any -- These aliases intentionally erase generic action and store shapes at contract boundaries. */\nexport type AirJamAgentActionContract = AirJamAgentResolvedActionContract<\n any,\n any\n>;\n\n// Existential wildcard for published agent contracts with arbitrary snapshot/store shapes.\nexport type AnyAirJamAgentContract = AirJamAgentContract<any, any>;\n/* eslint-enable @typescript-eslint/no-explicit-any */\n\nexport type AirJamAgentContractActionOptions<\n TInput,\n TPayload = TInput,\n> = AirJamAgentActionOptions & {\n availability?: string;\n input: AirJamAgentActionInputDefinition<TInput>;\n toPayload?: (input: TInput) => TPayload;\n};\n\nexport type AirJamAgentSnapshotContext<\n TStores extends AirJamAgentStores = AirJamAgentStores,\n> = {\n controllerId: string | null;\n stores: Partial<TStores>;\n};\n\nexport type AirJamAgentContract<\n TSnapshot extends AirJamAgentJsonObject = AirJamAgentJsonObject,\n TStoreDeclarations extends AirJamAgentStoreDeclarations =\n AirJamAgentStoreDeclarations,\n> = {\n stores: TStoreDeclarations;\n snapshotDescription?: string;\n projectSnapshot: (\n context: AirJamAgentSnapshotContext<\n InferAirJamAgentStores<TStoreDeclarations>\n >,\n ) => TSnapshot | Promise<TSnapshot>;\n actions: Record<string, AirJamAgentActionContract>;\n};\n\nexport const agentStore = <\n TStore extends object,\n>(): AirJamAgentStoreDeclaration<TStore> =>\n ({}) as AirJamAgentStoreDeclaration<TStore>;\n\nexport const defineAirJamAgentStores = <\n TDeclarations extends AirJamAgentStoreDeclarations,\n>(\n stores: TDeclarations,\n): TDeclarations => stores;\n\nexport const listAirJamAgentStoreDomains = (\n contract: AnyAirJamAgentContract,\n): string[] => Object.keys(contract.stores);\n\nexport const describeAirJamAgentAction = (\n action: AirJamAgentActionContract,\n): AirJamAgentActionMetadata => ({\n description: action.description ?? action.input.metadata.description,\n payload: {\n ...action.input.metadata.payload,\n },\n resultDescription:\n action.resultDescription ?? action.input.metadata.resultDescription,\n});\n\nexport const resolveAirJamAgentActionPayload = (\n action: AirJamAgentActionContract,\n payload: unknown,\n meta: AirJamAgentActionParseMeta,\n): unknown => {\n const parsedInput = action.input.parse(payload, meta);\n return action.toPayload ? action.toPayload(parsedInput) : parsedInput;\n};\n\nexport const agentAction = {\n participant: <TInput, TPayload = TInput>(\n target: Omit<AirJamAgentActionTarget, \"kind\">,\n options: AirJamAgentContractActionOptions<TInput, TPayload>,\n ): AirJamAgentResolvedActionContract<TInput, TPayload> => ({\n target: {\n kind: \"participant\",\n actionName: target.actionName,\n ...(target.storeDomain ? { storeDomain: target.storeDomain } : {}),\n },\n description: options.description,\n availability: options.availability,\n input: options.input,\n toPayload: options.toPayload,\n resultDescription: options.resultDescription,\n }),\n host: <TInput, TPayload = TInput>(\n target: Omit<AirJamAgentActionTarget, \"kind\">,\n options: AirJamAgentContractActionOptions<TInput, TPayload>,\n ): AirJamAgentResolvedActionContract<TInput, TPayload> => ({\n target: {\n kind: \"host\",\n actionName: target.actionName,\n ...(target.storeDomain ? { storeDomain: target.storeDomain } : {}),\n },\n description: options.description,\n availability: options.availability,\n input: options.input,\n toPayload: options.toPayload,\n resultDescription: options.resultDescription,\n }),\n};\n\nexport const defineAirJamAgentContract = <\n TSnapshot extends AirJamAgentJsonObject,\n TStoreDeclarations extends AirJamAgentStoreDeclarations,\n>(\n contract: AirJamAgentContract<TSnapshot, TStoreDeclarations>,\n): AirJamAgentContract<TSnapshot, TStoreDeclarations> => contract;\n","import {\n describeAirJamAgentAction,\n resolveAirJamAgentActionPayload,\n type AnyAirJamAgentContract,\n} from \"./agent-contract.js\";\n\nexport type AirJamAgentContractConformanceIssue = {\n code:\n | \"store-domain-mismatch\"\n | \"missing-store-actions\"\n | \"missing-target-action\"\n | \"invalid-action-metadata\"\n | \"payload-parse-failed\"\n | \"snapshot-failed\"\n | \"snapshot-not-json\";\n path: string;\n message: string;\n};\n\nexport type AirJamAgentContractConformanceReport = {\n schemaVersion: 1;\n gameId: string;\n ok: boolean;\n storeDomains: string[];\n actionNames: string[];\n issues: AirJamAgentContractConformanceIssue[];\n};\n\ntype InspectAirJamAgentContractConformanceOptions = {\n gameId: string;\n contract: AnyAirJamAgentContract;\n stores: Record<string, object>;\n controllerId?: string | null;\n};\n\nconst representativePayload = (\n kind: ReturnType<typeof describeAirJamAgentAction>[\"payload\"][\"kind\"],\n allowedValues?: string[],\n): unknown => {\n switch (kind) {\n case \"none\":\n return undefined;\n case \"boolean\":\n return true;\n case \"number\":\n return 1;\n case \"string\":\n return \"conformance\";\n case \"enum\":\n return allowedValues?.[0];\n case \"json\":\n return {};\n }\n};\n\nconst inspectJsonValue = (\n value: unknown,\n path: string,\n seen: Set<object>,\n issues: AirJamAgentContractConformanceIssue[],\n): void => {\n if (\n value === null ||\n typeof value === \"string\" ||\n typeof value === \"boolean\"\n ) {\n return;\n }\n if (typeof value === \"number\") {\n if (!Number.isFinite(value)) {\n issues.push({\n code: \"snapshot-not-json\",\n path,\n message: \"Snapshot numbers must be finite.\",\n });\n }\n return;\n }\n if (typeof value !== \"object\") {\n issues.push({\n code: \"snapshot-not-json\",\n path,\n message: `Snapshot value has unsupported type ${typeof value}.`,\n });\n return;\n }\n if (seen.has(value)) {\n issues.push({\n code: \"snapshot-not-json\",\n path,\n message: \"Snapshot contains a circular reference.\",\n });\n return;\n }\n\n seen.add(value);\n if (Array.isArray(value)) {\n value.forEach((entry, index) =>\n inspectJsonValue(entry, `${path}[${index}]`, seen, issues),\n );\n } else {\n for (const [key, entry] of Object.entries(value)) {\n inspectJsonValue(entry, `${path}.${key}`, seen, issues);\n }\n }\n seen.delete(value);\n};\n\nexport const inspectAirJamAgentContractConformance = async ({\n gameId,\n contract,\n stores,\n controllerId = \"conformance-controller\",\n}: InspectAirJamAgentContractConformanceOptions): Promise<AirJamAgentContractConformanceReport> => {\n const issues: AirJamAgentContractConformanceIssue[] = [];\n const storeDomains = Object.keys(contract.stores).sort();\n const runtimeStoreDomains = Object.keys(stores).sort();\n const actionNames = Object.keys(contract.actions).sort();\n\n if (JSON.stringify(storeDomains) !== JSON.stringify(runtimeStoreDomains)) {\n issues.push({\n code: \"store-domain-mismatch\",\n path: \"stores\",\n message: `Declared domains [${storeDomains.join(\", \")}] do not match runtime domains [${runtimeStoreDomains.join(\", \")}].`,\n });\n }\n\n for (const [actionName, action] of Object.entries(contract.actions)) {\n const targetDomain = action.target.storeDomain ?? \"default\";\n const runtimeStore = stores[targetDomain] as\n | { actions?: Record<string, unknown> }\n | undefined;\n if (!runtimeStore?.actions || typeof runtimeStore.actions !== \"object\") {\n issues.push({\n code: \"missing-store-actions\",\n path: `actions.${actionName}.target`,\n message: `Runtime store \"${targetDomain}\" does not expose an actions object.`,\n });\n } else if (\n typeof runtimeStore.actions[action.target.actionName] !== \"function\"\n ) {\n issues.push({\n code: \"missing-target-action\",\n path: `actions.${actionName}.target`,\n message: `Runtime store \"${targetDomain}\" does not expose action \"${action.target.actionName}\".`,\n });\n }\n\n const metadata = describeAirJamAgentAction(action);\n if (\n !metadata.description?.trim() ||\n !metadata.resultDescription?.trim() ||\n (metadata.payload.kind === \"enum\" &&\n !metadata.payload.allowedValues?.length)\n ) {\n issues.push({\n code: \"invalid-action-metadata\",\n path: `actions.${actionName}`,\n message:\n \"Every semantic action must describe its intent, expected result, and enum values when applicable.\",\n });\n }\n\n try {\n resolveAirJamAgentActionPayload(\n action,\n representativePayload(\n metadata.payload.kind,\n metadata.payload.allowedValues,\n ),\n { gameId, actionName, contractKind: \"conformance\" },\n );\n } catch (error) {\n issues.push({\n code: \"payload-parse-failed\",\n path: `actions.${actionName}.input`,\n message: error instanceof Error ? error.message : String(error),\n });\n }\n }\n\n try {\n const snapshot = await contract.projectSnapshot({ controllerId, stores });\n inspectJsonValue(snapshot, \"snapshot\", new Set(), issues);\n } catch (error) {\n issues.push({\n code: \"snapshot-failed\",\n path: \"snapshot\",\n message: error instanceof Error ? error.message : String(error),\n });\n }\n\n return {\n schemaVersion: 1,\n gameId,\n ok: issues.length === 0,\n storeDomains,\n actionNames,\n issues,\n };\n};\n"],"mappings":"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","names":[]}
|
package/dist/agent-tooling.d.cts
CHANGED
|
@@ -1,2 +1,26 @@
|
|
|
1
|
-
|
|
1
|
+
import { A as AnyAirJamAgentContract } from './agent-contract-CD2QnbBJ.cjs';
|
|
2
|
+
export { n as AirJamAgentActionContract, k as AirJamAgentActionCustomOptions, b as AirJamAgentActionDescriptor, e as AirJamAgentActionInputDefinition, f as AirJamAgentActionMetadata, g as AirJamAgentActionOptions, h as AirJamAgentActionParseMeta, i as AirJamAgentActionPayloadKind, j as AirJamAgentActionPayloadMetadata, o as AirJamAgentContract, c as createAgentActionMetadata, d as defineAgentActionInput, a as describeAgentActionInputs, l as describeAirJamAgentAction, m as listAirJamAgentStoreDomains, r as resolveAirJamAgentActionPayload } from './agent-contract-CD2QnbBJ.cjs';
|
|
2
3
|
import 'zod';
|
|
4
|
+
|
|
5
|
+
type AirJamAgentContractConformanceIssue = {
|
|
6
|
+
code: "store-domain-mismatch" | "missing-store-actions" | "missing-target-action" | "invalid-action-metadata" | "payload-parse-failed" | "snapshot-failed" | "snapshot-not-json";
|
|
7
|
+
path: string;
|
|
8
|
+
message: string;
|
|
9
|
+
};
|
|
10
|
+
type AirJamAgentContractConformanceReport = {
|
|
11
|
+
schemaVersion: 1;
|
|
12
|
+
gameId: string;
|
|
13
|
+
ok: boolean;
|
|
14
|
+
storeDomains: string[];
|
|
15
|
+
actionNames: string[];
|
|
16
|
+
issues: AirJamAgentContractConformanceIssue[];
|
|
17
|
+
};
|
|
18
|
+
type InspectAirJamAgentContractConformanceOptions = {
|
|
19
|
+
gameId: string;
|
|
20
|
+
contract: AnyAirJamAgentContract;
|
|
21
|
+
stores: Record<string, object>;
|
|
22
|
+
controllerId?: string | null;
|
|
23
|
+
};
|
|
24
|
+
declare const inspectAirJamAgentContractConformance: ({ gameId, contract, stores, controllerId, }: InspectAirJamAgentContractConformanceOptions) => Promise<AirJamAgentContractConformanceReport>;
|
|
25
|
+
|
|
26
|
+
export { type AirJamAgentContractConformanceIssue, type AirJamAgentContractConformanceReport, inspectAirJamAgentContractConformance };
|
package/dist/agent-tooling.d.ts
CHANGED
|
@@ -1,2 +1,26 @@
|
|
|
1
|
-
|
|
1
|
+
import { A as AnyAirJamAgentContract } from './agent-contract-CD2QnbBJ.js';
|
|
2
|
+
export { n as AirJamAgentActionContract, k as AirJamAgentActionCustomOptions, b as AirJamAgentActionDescriptor, e as AirJamAgentActionInputDefinition, f as AirJamAgentActionMetadata, g as AirJamAgentActionOptions, h as AirJamAgentActionParseMeta, i as AirJamAgentActionPayloadKind, j as AirJamAgentActionPayloadMetadata, o as AirJamAgentContract, c as createAgentActionMetadata, d as defineAgentActionInput, a as describeAgentActionInputs, l as describeAirJamAgentAction, m as listAirJamAgentStoreDomains, r as resolveAirJamAgentActionPayload } from './agent-contract-CD2QnbBJ.js';
|
|
2
3
|
import 'zod';
|
|
4
|
+
|
|
5
|
+
type AirJamAgentContractConformanceIssue = {
|
|
6
|
+
code: "store-domain-mismatch" | "missing-store-actions" | "missing-target-action" | "invalid-action-metadata" | "payload-parse-failed" | "snapshot-failed" | "snapshot-not-json";
|
|
7
|
+
path: string;
|
|
8
|
+
message: string;
|
|
9
|
+
};
|
|
10
|
+
type AirJamAgentContractConformanceReport = {
|
|
11
|
+
schemaVersion: 1;
|
|
12
|
+
gameId: string;
|
|
13
|
+
ok: boolean;
|
|
14
|
+
storeDomains: string[];
|
|
15
|
+
actionNames: string[];
|
|
16
|
+
issues: AirJamAgentContractConformanceIssue[];
|
|
17
|
+
};
|
|
18
|
+
type InspectAirJamAgentContractConformanceOptions = {
|
|
19
|
+
gameId: string;
|
|
20
|
+
contract: AnyAirJamAgentContract;
|
|
21
|
+
stores: Record<string, object>;
|
|
22
|
+
controllerId?: string | null;
|
|
23
|
+
};
|
|
24
|
+
declare const inspectAirJamAgentContractConformance: ({ gameId, contract, stores, controllerId, }: InspectAirJamAgentContractConformanceOptions) => Promise<AirJamAgentContractConformanceReport>;
|
|
25
|
+
|
|
26
|
+
export { type AirJamAgentContractConformanceIssue, type AirJamAgentContractConformanceReport, inspectAirJamAgentContractConformance };
|
package/dist/agent-tooling.js
CHANGED
|
@@ -6,11 +6,149 @@ import {
|
|
|
6
6
|
listAirJamAgentStoreDomains,
|
|
7
7
|
resolveAirJamAgentActionPayload
|
|
8
8
|
} from "./chunk-TGRTEWYV.js";
|
|
9
|
+
|
|
10
|
+
// src/agent/agent-contract-conformance.ts
|
|
11
|
+
var representativePayload = (kind, allowedValues) => {
|
|
12
|
+
switch (kind) {
|
|
13
|
+
case "none":
|
|
14
|
+
return void 0;
|
|
15
|
+
case "boolean":
|
|
16
|
+
return true;
|
|
17
|
+
case "number":
|
|
18
|
+
return 1;
|
|
19
|
+
case "string":
|
|
20
|
+
return "conformance";
|
|
21
|
+
case "enum":
|
|
22
|
+
return allowedValues?.[0];
|
|
23
|
+
case "json":
|
|
24
|
+
return {};
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
var inspectJsonValue = (value, path, seen, issues) => {
|
|
28
|
+
if (value === null || typeof value === "string" || typeof value === "boolean") {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
if (typeof value === "number") {
|
|
32
|
+
if (!Number.isFinite(value)) {
|
|
33
|
+
issues.push({
|
|
34
|
+
code: "snapshot-not-json",
|
|
35
|
+
path,
|
|
36
|
+
message: "Snapshot numbers must be finite."
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
if (typeof value !== "object") {
|
|
42
|
+
issues.push({
|
|
43
|
+
code: "snapshot-not-json",
|
|
44
|
+
path,
|
|
45
|
+
message: `Snapshot value has unsupported type ${typeof value}.`
|
|
46
|
+
});
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
if (seen.has(value)) {
|
|
50
|
+
issues.push({
|
|
51
|
+
code: "snapshot-not-json",
|
|
52
|
+
path,
|
|
53
|
+
message: "Snapshot contains a circular reference."
|
|
54
|
+
});
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
seen.add(value);
|
|
58
|
+
if (Array.isArray(value)) {
|
|
59
|
+
value.forEach(
|
|
60
|
+
(entry, index) => inspectJsonValue(entry, `${path}[${index}]`, seen, issues)
|
|
61
|
+
);
|
|
62
|
+
} else {
|
|
63
|
+
for (const [key, entry] of Object.entries(value)) {
|
|
64
|
+
inspectJsonValue(entry, `${path}.${key}`, seen, issues);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
seen.delete(value);
|
|
68
|
+
};
|
|
69
|
+
var inspectAirJamAgentContractConformance = async ({
|
|
70
|
+
gameId,
|
|
71
|
+
contract,
|
|
72
|
+
stores,
|
|
73
|
+
controllerId = "conformance-controller"
|
|
74
|
+
}) => {
|
|
75
|
+
const issues = [];
|
|
76
|
+
const storeDomains = Object.keys(contract.stores).sort();
|
|
77
|
+
const runtimeStoreDomains = Object.keys(stores).sort();
|
|
78
|
+
const actionNames = Object.keys(contract.actions).sort();
|
|
79
|
+
if (JSON.stringify(storeDomains) !== JSON.stringify(runtimeStoreDomains)) {
|
|
80
|
+
issues.push({
|
|
81
|
+
code: "store-domain-mismatch",
|
|
82
|
+
path: "stores",
|
|
83
|
+
message: `Declared domains [${storeDomains.join(", ")}] do not match runtime domains [${runtimeStoreDomains.join(", ")}].`
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
for (const [actionName, action] of Object.entries(contract.actions)) {
|
|
87
|
+
const targetDomain = action.target.storeDomain ?? "default";
|
|
88
|
+
const runtimeStore = stores[targetDomain];
|
|
89
|
+
if (!runtimeStore?.actions || typeof runtimeStore.actions !== "object") {
|
|
90
|
+
issues.push({
|
|
91
|
+
code: "missing-store-actions",
|
|
92
|
+
path: `actions.${actionName}.target`,
|
|
93
|
+
message: `Runtime store "${targetDomain}" does not expose an actions object.`
|
|
94
|
+
});
|
|
95
|
+
} else if (typeof runtimeStore.actions[action.target.actionName] !== "function") {
|
|
96
|
+
issues.push({
|
|
97
|
+
code: "missing-target-action",
|
|
98
|
+
path: `actions.${actionName}.target`,
|
|
99
|
+
message: `Runtime store "${targetDomain}" does not expose action "${action.target.actionName}".`
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
const metadata = describeAirJamAgentAction(action);
|
|
103
|
+
if (!metadata.description?.trim() || !metadata.resultDescription?.trim() || metadata.payload.kind === "enum" && !metadata.payload.allowedValues?.length) {
|
|
104
|
+
issues.push({
|
|
105
|
+
code: "invalid-action-metadata",
|
|
106
|
+
path: `actions.${actionName}`,
|
|
107
|
+
message: "Every semantic action must describe its intent, expected result, and enum values when applicable."
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
try {
|
|
111
|
+
resolveAirJamAgentActionPayload(
|
|
112
|
+
action,
|
|
113
|
+
representativePayload(
|
|
114
|
+
metadata.payload.kind,
|
|
115
|
+
metadata.payload.allowedValues
|
|
116
|
+
),
|
|
117
|
+
{ gameId, actionName, contractKind: "conformance" }
|
|
118
|
+
);
|
|
119
|
+
} catch (error) {
|
|
120
|
+
issues.push({
|
|
121
|
+
code: "payload-parse-failed",
|
|
122
|
+
path: `actions.${actionName}.input`,
|
|
123
|
+
message: error instanceof Error ? error.message : String(error)
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
try {
|
|
128
|
+
const snapshot = await contract.projectSnapshot({ controllerId, stores });
|
|
129
|
+
inspectJsonValue(snapshot, "snapshot", /* @__PURE__ */ new Set(), issues);
|
|
130
|
+
} catch (error) {
|
|
131
|
+
issues.push({
|
|
132
|
+
code: "snapshot-failed",
|
|
133
|
+
path: "snapshot",
|
|
134
|
+
message: error instanceof Error ? error.message : String(error)
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
return {
|
|
138
|
+
schemaVersion: 1,
|
|
139
|
+
gameId,
|
|
140
|
+
ok: issues.length === 0,
|
|
141
|
+
storeDomains,
|
|
142
|
+
actionNames,
|
|
143
|
+
issues
|
|
144
|
+
};
|
|
145
|
+
};
|
|
9
146
|
export {
|
|
10
147
|
createAgentActionMetadata,
|
|
11
148
|
defineAgentActionInput,
|
|
12
149
|
describeAgentActionInputs,
|
|
13
150
|
describeAirJamAgentAction,
|
|
151
|
+
inspectAirJamAgentContractConformance,
|
|
14
152
|
listAirJamAgentStoreDomains,
|
|
15
153
|
resolveAirJamAgentActionPayload
|
|
16
154
|
};
|