@dreamboard-games/sdk 0.2.0 → 0.2.1-alpha.1

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 (90) hide show
  1. package/dist/{ThemeProvider-fy0_QzgO.d.ts → ThemeProvider-BBMVT3KG.d.ts} +1 -1
  2. package/dist/attributes-BeRyboMS.d.ts +279 -0
  3. package/dist/browser-interaction.d.ts +708 -0
  4. package/dist/browser-interaction.js +106 -0
  5. package/dist/browser-interaction.js.map +1 -0
  6. package/dist/{bundle-TIZcw8LB.d.ts → bundle-CDd5FKeD.d.ts} +3 -1
  7. package/dist/{chunk-U5C6BONG.js → chunk-326PGVAA.js} +2 -2
  8. package/dist/{chunk-VFTAA4WO.js → chunk-MKXPVOUT.js} +4 -2
  9. package/dist/chunk-MKXPVOUT.js.map +1 -0
  10. package/dist/{chunk-GKKBPPSW.js → chunk-MZNVHMJ5.js} +4 -4
  11. package/dist/{chunk-KAELH4KC.js → chunk-NKCRKGR2.js} +2 -2
  12. package/dist/{chunk-WN74KVNY.js → chunk-PEI3FIL2.js} +2 -2
  13. package/dist/chunk-PEI3FIL2.js.map +1 -0
  14. package/dist/chunk-QLG6VEMW.js +1691 -0
  15. package/dist/chunk-QLG6VEMW.js.map +1 -0
  16. package/dist/{chunk-WYPQ3GG5.js → chunk-WG4JQL3S.js} +4 -1
  17. package/dist/{chunk-WYPQ3GG5.js.map → chunk-WG4JQL3S.js.map} +1 -1
  18. package/dist/{chunk-7YAHLYBR.js → chunk-XV6D3ET4.js} +8 -4
  19. package/dist/{chunk-7YAHLYBR.js.map → chunk-XV6D3ET4.js.map} +1 -1
  20. package/dist/{chunk-TDSWKVZ4.js → chunk-ZABVH7AO.js} +1236 -17
  21. package/dist/chunk-ZABVH7AO.js.map +1 -0
  22. package/dist/{components-D5ZRE2Hl.d.ts → components-BoiVSYqx.d.ts} +1 -1
  23. package/dist/generated/runtime/primitives.d.ts +5 -4
  24. package/dist/generated/runtime/primitives.js +4 -3
  25. package/dist/generated/runtime-api.d.ts +1 -1
  26. package/dist/generated/runtime.d.ts +5 -4
  27. package/dist/generated/runtime.js +7 -6
  28. package/dist/generated/workspace-contract.d.ts +5 -4
  29. package/dist/generated/workspace-contract.js +6 -5
  30. package/dist/{hex-board-view-D_07hO6O.d.ts → hex-board-view-1iAyJRFn.d.ts} +1 -0
  31. package/dist/index.js +1 -1
  32. package/dist/infrastructure/reducer-bundle-abi.d.ts +113 -113
  33. package/dist/infrastructure/reducer-bundle-abi.js +1 -1
  34. package/dist/package-set.d.ts +2 -2
  35. package/dist/package-set.js +1 -1
  36. package/dist/reducer.d.ts +1 -1
  37. package/dist/reducer.js +305 -12
  38. package/dist/reducer.js.map +1 -1
  39. package/dist/runtime/primitives.d.ts +6 -5
  40. package/dist/runtime/primitives.js +4 -3
  41. package/dist/runtime/workspace-contract.d.ts +6 -5
  42. package/dist/runtime/workspace-contract.js +6 -5
  43. package/dist/{runtime-api-DWxvTr-O.d.ts → runtime-api-CPLm_XDG.d.ts} +6 -0
  44. package/dist/runtime.d.ts +5 -4
  45. package/dist/runtime.js +6 -5
  46. package/dist/testing.d.ts +2 -2
  47. package/dist/ui/components.d.ts +2 -2
  48. package/dist/ui/components.js +1 -1
  49. package/dist/{ui-contract-iQfTtUSL.d.ts → ui-contract-rzKBwOLC.d.ts} +5 -3
  50. package/dist/ui.d.ts +5 -5
  51. package/dist/ui.js +2 -2
  52. package/package.json +15 -9
  53. package/src/browser-interaction/attributes.ts +211 -0
  54. package/src/browser-interaction/canonical.ts +77 -0
  55. package/src/browser-interaction/constants.ts +77 -0
  56. package/src/browser-interaction/effects.ts +176 -0
  57. package/src/browser-interaction/index.ts +111 -0
  58. package/src/browser-interaction/normalize.ts +997 -0
  59. package/src/browser-interaction/registry.ts +70 -0
  60. package/src/browser-interaction/resolve.ts +596 -0
  61. package/src/browser-interaction/schemas.ts +152 -0
  62. package/src/browser-interaction/types.ts +304 -0
  63. package/src/browser-interaction.ts +1 -0
  64. package/src/generated/reducer-contract/wire.ts +1 -1
  65. package/src/generated/reducer-contract/zod.ts +3 -1
  66. package/src/package-set.ts +1 -1
  67. package/src/reducer/bundle/ingress-bundle.ts +1 -1
  68. package/src/reducer/bundle/trusted/interaction-types.ts +3 -0
  69. package/src/reducer/bundle/trusted/projection-builder.ts +337 -13
  70. package/src/reducer/ingress/input-codec.ts +1 -1
  71. package/src/reducer/ingress/session-codec.ts +1 -1
  72. package/src/runtime-internal/components/InteractionForm.tsx +345 -7
  73. package/src/runtime-internal/components/PluginRuntime.tsx +2 -0
  74. package/src/runtime-internal/components/board/target-layer.ts +2 -0
  75. package/src/runtime-internal/context/PluginStateContext.tsx +41 -0
  76. package/src/runtime-internal/hooks/useBoardInteractions.ts +73 -11
  77. package/src/runtime-internal/primitives/board.tsx +71 -0
  78. package/src/runtime-internal/primitives/interaction.tsx +160 -1
  79. package/src/runtime-internal/types/plugin-state.ts +6 -0
  80. package/src/runtime-internal/utils/browser-interaction-effects.ts +240 -0
  81. package/src/runtime-internal/utils/interaction-draft-digest.ts +252 -0
  82. package/src/runtime-internal/utils/semantic-projection-digest.ts +407 -0
  83. package/src/ui/components/board/HexGrid.tsx +3 -0
  84. package/src/ui/components/board/target-layer.ts +1 -0
  85. package/dist/chunk-TDSWKVZ4.js.map +0 -1
  86. package/dist/chunk-VFTAA4WO.js.map +0 -1
  87. package/dist/chunk-WN74KVNY.js.map +0 -1
  88. /package/dist/{chunk-U5C6BONG.js.map → chunk-326PGVAA.js.map} +0 -0
  89. /package/dist/{chunk-GKKBPPSW.js.map → chunk-MZNVHMJ5.js.map} +0 -0
  90. /package/dist/{chunk-KAELH4KC.js.map → chunk-NKCRKGR2.js.map} +0 -0
@@ -0,0 +1,152 @@
1
+ import { z } from "zod";
2
+ import {
3
+ BROWSER_INTERACTION_ACTUATOR_KINDS,
4
+ BROWSER_INTERACTION_CANDIDATE_STATES,
5
+ BROWSER_INTERACTION_READINESS_VALUES,
6
+ DREAMBOARD_BROWSER_INTERACTION_PROTOCOL_NAME,
7
+ DREAMBOARD_BROWSER_INTERACTION_PROTOCOL_VERSION,
8
+ GAMEPLAY_BROWSER_INTERACTION_SURFACE,
9
+ } from "./constants.js";
10
+
11
+ const jsonValueSchema: z.ZodType<unknown> = z.lazy(() =>
12
+ z.union([
13
+ z.null(),
14
+ z.boolean(),
15
+ z.number().finite(),
16
+ z.string(),
17
+ z.array(jsonValueSchema),
18
+ z.record(z.string(), jsonValueSchema),
19
+ ]),
20
+ );
21
+
22
+ export const browserInteractionEffectSchema = z
23
+ .object({
24
+ kind: z.string().min(1),
25
+ })
26
+ .catchall(jsonValueSchema);
27
+
28
+ export const browserInteractionEffectPatternSchema = z.union([
29
+ z.object({
30
+ kind: z.literal("exact"),
31
+ effect: browserInteractionEffectSchema,
32
+ }),
33
+ z.object({
34
+ kind: z.literal("match"),
35
+ effectKind: z.string().min(1),
36
+ fields: z.record(z.string(), jsonValueSchema).optional(),
37
+ scalar: z
38
+ .object({
39
+ field: z.string().min(1),
40
+ min: z.number().finite().optional(),
41
+ max: z.number().finite().optional(),
42
+ integer: z.boolean().optional(),
43
+ })
44
+ .optional(),
45
+ }),
46
+ ]);
47
+
48
+ export const gameplaySemanticEffectSchema = z.union([
49
+ z.object({
50
+ kind: z.literal("setCandidate"),
51
+ inputKey: z.string(),
52
+ candidateValue: jsonValueSchema,
53
+ beforeSelected: z.boolean(),
54
+ afterSelected: z.boolean(),
55
+ }),
56
+ z.object({
57
+ kind: z.literal("adjustResource"),
58
+ inputKey: z.string(),
59
+ resourceKey: jsonValueSchema,
60
+ delta: z.union([z.literal(-1), z.literal(1)]),
61
+ }),
62
+ z.object({
63
+ kind: z.literal("setScalar"),
64
+ inputKey: z.string(),
65
+ value: z.number().finite(),
66
+ }),
67
+ z.object({
68
+ kind: z.literal("commit"),
69
+ }),
70
+ z.object({
71
+ kind: z.literal("invoke"),
72
+ }),
73
+ ]);
74
+
75
+ export const browserInteractionDiagnosticSchema = z.object({
76
+ code: z.string(),
77
+ severity: z.enum(["error", "warning"]),
78
+ message: z.string(),
79
+ surface: z.string().optional(),
80
+ scopeId: z.string().optional(),
81
+ interactionKey: z.string().optional(),
82
+ intent: z.string().optional(),
83
+ actuatorId: z.string().optional(),
84
+ });
85
+
86
+ export const browserInteractionActuatorSchema = z.object({
87
+ actuatorId: z.string(),
88
+ intent: z.string(),
89
+ inputKey: z.string().optional(),
90
+ candidateValue: jsonValueSchema.optional(),
91
+ candidateValueKey: z.string().optional(),
92
+ candidateState: z.enum(BROWSER_INTERACTION_CANDIDATE_STATES).optional(),
93
+ enabled: z.boolean(),
94
+ actuatorKind: z.enum(BROWSER_INTERACTION_ACTUATOR_KINDS),
95
+ semanticEffects: z.array(browserInteractionEffectSchema),
96
+ acceptedEffectPatterns: z.array(browserInteractionEffectPatternSchema),
97
+ preparationPatterns: z.array(browserInteractionEffectPatternSchema),
98
+ prepares: z
99
+ .object({
100
+ intent: z.string(),
101
+ inputKey: z.string().optional(),
102
+ candidateValue: jsonValueSchema.optional(),
103
+ candidateValueKey: z.string().optional(),
104
+ actuatorKind: z.enum(BROWSER_INTERACTION_ACTUATOR_KINDS).optional(),
105
+ })
106
+ .optional(),
107
+ diagnostics: z.array(browserInteractionDiagnosticSchema),
108
+ });
109
+
110
+ export const browserGameplayInteractionSchema = z.object({
111
+ interactionKey: z.string(),
112
+ interactionId: z.string(),
113
+ descriptorDigest: z.string().optional(),
114
+ draftDigest: z.string().optional(),
115
+ readiness: z.enum(BROWSER_INTERACTION_READINESS_VALUES),
116
+ actuators: z.array(browserInteractionActuatorSchema),
117
+ diagnostics: z.array(browserInteractionDiagnosticSchema),
118
+ });
119
+
120
+ export const browserGameplaySurfaceSnapshotSchema = z.object({
121
+ surface: z.literal(GAMEPLAY_BROWSER_INTERACTION_SURFACE),
122
+ scopeId: z.string(),
123
+ interactions: z.array(browserGameplayInteractionSchema),
124
+ diagnostics: z.array(browserInteractionDiagnosticSchema),
125
+ });
126
+
127
+ export const browserSemanticSurfaceSnapshotSchema = z.object({
128
+ surface: z.string(),
129
+ scopeId: z.string(),
130
+ interactions: z.array(browserGameplayInteractionSchema),
131
+ diagnostics: z.array(browserInteractionDiagnosticSchema),
132
+ });
133
+
134
+ export const browserUnknownSurfaceSnapshotSchema = z.object({
135
+ surface: z.string(),
136
+ scopeId: z.string(),
137
+ diagnostics: z.array(browserInteractionDiagnosticSchema),
138
+ });
139
+
140
+ export const browserInteractionSnapshotSchema = z.object({
141
+ protocol: z.object({
142
+ name: z.literal(DREAMBOARD_BROWSER_INTERACTION_PROTOCOL_NAME),
143
+ version: z.literal(DREAMBOARD_BROWSER_INTERACTION_PROTOCOL_VERSION),
144
+ }),
145
+ surfaces: z.array(
146
+ z.union([
147
+ browserSemanticSurfaceSnapshotSchema,
148
+ browserUnknownSurfaceSnapshotSchema,
149
+ ]),
150
+ ),
151
+ diagnostics: z.array(browserInteractionDiagnosticSchema),
152
+ });
@@ -0,0 +1,304 @@
1
+ import type {
2
+ BROWSER_INTERACTION_ACTUATOR_KINDS,
3
+ BROWSER_INTERACTION_CANDIDATE_STATES,
4
+ BROWSER_INTERACTION_READINESS_VALUES,
5
+ BROWSER_INTERACTION_RECORD_ROLES,
6
+ GAMEPLAY_BROWSER_INTERACTION_EFFECT_KINDS,
7
+ GAMEPLAY_BROWSER_INTERACTION_INTENTS,
8
+ GAMEPLAY_BROWSER_INTERACTION_SURFACE,
9
+ } from "./constants.js";
10
+ import type { CanonicalBrowserInteractionValue } from "./canonical.js";
11
+
12
+ export type BrowserInteractionSurface = string;
13
+ export type BrowserInteractionIntent = string;
14
+ export type BrowserInteractionRole =
15
+ (typeof BROWSER_INTERACTION_RECORD_ROLES)[number];
16
+ export type GameplayBrowserInteractionSurface =
17
+ typeof GAMEPLAY_BROWSER_INTERACTION_SURFACE;
18
+ export type GameplayBrowserInteractionIntent =
19
+ (typeof GAMEPLAY_BROWSER_INTERACTION_INTENTS)[number];
20
+ export type GameplayBrowserInteractionEffectKind =
21
+ (typeof GAMEPLAY_BROWSER_INTERACTION_EFFECT_KINDS)[number];
22
+ export type BrowserInteractionReadiness =
23
+ (typeof BROWSER_INTERACTION_READINESS_VALUES)[number];
24
+ export type BrowserInteractionCandidateState =
25
+ (typeof BROWSER_INTERACTION_CANDIDATE_STATES)[number];
26
+ export type BrowserInteractionActuatorKind =
27
+ (typeof BROWSER_INTERACTION_ACTUATOR_KINDS)[number];
28
+
29
+ export interface BrowserInteractionProtocolIdentity {
30
+ readonly name: "dreamboard-browser-interaction";
31
+ readonly version: "2.0.0";
32
+ }
33
+
34
+ export type BrowserInteractionSurfaceEffect = {
35
+ readonly kind: string;
36
+ readonly [key: string]: CanonicalBrowserInteractionValue;
37
+ };
38
+
39
+ export interface BrowserInteractionScalarPattern {
40
+ readonly field: string;
41
+ readonly min?: number;
42
+ readonly max?: number;
43
+ readonly integer?: boolean;
44
+ }
45
+
46
+ export type BrowserInteractionEffectPattern<
47
+ Effect extends BrowserInteractionSurfaceEffect =
48
+ BrowserInteractionSurfaceEffect,
49
+ > =
50
+ | {
51
+ readonly kind: "exact";
52
+ readonly effect: Effect;
53
+ }
54
+ | {
55
+ readonly kind: "match";
56
+ readonly effectKind: Effect["kind"] & string;
57
+ readonly fields?: Readonly<
58
+ Record<string, CanonicalBrowserInteractionValue>
59
+ >;
60
+ readonly scalar?: BrowserInteractionScalarPattern;
61
+ };
62
+
63
+ export type GameplaySemanticEffect =
64
+ | {
65
+ readonly kind: "setCandidate";
66
+ readonly inputKey: string;
67
+ readonly candidateValue: CanonicalBrowserInteractionValue;
68
+ readonly beforeSelected: boolean;
69
+ readonly afterSelected: boolean;
70
+ }
71
+ | {
72
+ readonly kind: "adjustResource";
73
+ readonly inputKey: string;
74
+ readonly resourceKey: CanonicalBrowserInteractionValue;
75
+ readonly delta: -1 | 1;
76
+ }
77
+ | {
78
+ readonly kind: "setScalar";
79
+ readonly inputKey: string;
80
+ readonly value: number;
81
+ }
82
+ | {
83
+ readonly kind: "commit";
84
+ }
85
+ | {
86
+ readonly kind: "invoke";
87
+ };
88
+
89
+ export type GameplaySemanticEffectPattern =
90
+ BrowserInteractionEffectPattern<GameplaySemanticEffect>;
91
+
92
+ export interface BrowserInteractionDiagnostic {
93
+ readonly code:
94
+ | "ambiguous-actuator"
95
+ | "ambiguous-effect-match"
96
+ | "ambiguous-preparation-pattern"
97
+ | "disabled-effect-actuator"
98
+ | "duplicate-accepted-effect-pattern-match"
99
+ | "duplicate-enabled-actuator"
100
+ | "duplicate-enabled-effect-actuator"
101
+ | "effect-actuator-kind-incompatibility"
102
+ | "effect-intent-incompatibility"
103
+ | "invalid-candidate"
104
+ | "invalid-effect-payload"
105
+ | "invalid-effect-pattern"
106
+ | "invalid-protocol"
107
+ | "invalid-record"
108
+ | "invalid-scalar-argument"
109
+ | "missing-effect"
110
+ | "orphan-actuator"
111
+ | "preparation-cycle"
112
+ | "surface-intent-collision"
113
+ | "unknown-surface-effect"
114
+ | "unknown-intent"
115
+ | "unknown-surface"
116
+ | "unavailable-actuator";
117
+ readonly severity: "error" | "warning";
118
+ readonly message: string;
119
+ readonly surface?: BrowserInteractionSurface;
120
+ readonly scopeId?: string;
121
+ readonly interactionKey?: string;
122
+ readonly intent?: BrowserInteractionIntent;
123
+ readonly actuatorId?: string;
124
+ }
125
+
126
+ export interface BrowserInteractionRawRecord {
127
+ readonly attributes: Readonly<
128
+ Record<string, string | boolean | null | undefined>
129
+ >;
130
+ }
131
+
132
+ export interface BrowserInteractionPreparationTarget {
133
+ readonly intent: BrowserInteractionIntent;
134
+ readonly inputKey?: string;
135
+ readonly candidateValue?: CanonicalBrowserInteractionValue;
136
+ readonly candidateValueKey?: string;
137
+ readonly actuatorKind?: BrowserInteractionActuatorKind;
138
+ }
139
+
140
+ export interface BrowserInteractionActuator {
141
+ readonly actuatorId: string;
142
+ readonly intent: BrowserInteractionIntent;
143
+ readonly descriptorDigest?: string;
144
+ readonly draftDigest?: string;
145
+ readonly inputKey?: string;
146
+ readonly candidateValue?: CanonicalBrowserInteractionValue;
147
+ readonly candidateValueKey?: string;
148
+ readonly candidateState?: BrowserInteractionCandidateState;
149
+ readonly enabled: boolean;
150
+ readonly actuatorKind: BrowserInteractionActuatorKind;
151
+ readonly semanticEffects: readonly BrowserInteractionSurfaceEffect[];
152
+ readonly acceptedEffectPatterns: readonly BrowserInteractionEffectPattern[];
153
+ readonly preparationPatterns: readonly BrowserInteractionEffectPattern[];
154
+ readonly prepares?: BrowserInteractionPreparationTarget;
155
+ readonly diagnostics: readonly BrowserInteractionDiagnostic[];
156
+ }
157
+
158
+ export interface BrowserInteractionEntity {
159
+ readonly interactionKey: string;
160
+ readonly interactionId: string;
161
+ readonly descriptorDigest?: string;
162
+ readonly draftDigest?: string;
163
+ readonly readiness: BrowserInteractionReadiness;
164
+ readonly actuators: readonly BrowserInteractionActuator[];
165
+ readonly diagnostics: readonly BrowserInteractionDiagnostic[];
166
+ }
167
+
168
+ export type BrowserGameplayInteraction = BrowserInteractionEntity;
169
+
170
+ export interface BrowserInteractionSemanticSurfaceSnapshot<
171
+ Surface extends BrowserInteractionSurface = BrowserInteractionSurface,
172
+ > {
173
+ readonly surface: Surface;
174
+ readonly scopeId: string;
175
+ readonly interactions: readonly BrowserInteractionEntity[];
176
+ readonly diagnostics: readonly BrowserInteractionDiagnostic[];
177
+ }
178
+
179
+ export type BrowserSemanticSurfaceSnapshot<
180
+ Surface extends BrowserInteractionSurface = BrowserInteractionSurface,
181
+ > = BrowserInteractionSemanticSurfaceSnapshot<Surface>;
182
+
183
+ export interface BrowserGameplaySurfaceSnapshot {
184
+ readonly surface: GameplayBrowserInteractionSurface;
185
+ readonly scopeId: string;
186
+ readonly interactions: readonly BrowserGameplayInteraction[];
187
+ readonly diagnostics: readonly BrowserInteractionDiagnostic[];
188
+ }
189
+
190
+ export interface BrowserInteractionUnknownSurfaceSnapshot {
191
+ readonly surface: BrowserInteractionSurface;
192
+ readonly scopeId: string;
193
+ readonly interactions?: never;
194
+ readonly diagnostics: readonly BrowserInteractionDiagnostic[];
195
+ }
196
+
197
+ export type BrowserInteractionSurfaceSnapshot =
198
+ | BrowserGameplaySurfaceSnapshot
199
+ | BrowserInteractionSemanticSurfaceSnapshot
200
+ | BrowserInteractionUnknownSurfaceSnapshot;
201
+
202
+ export interface BrowserInteractionSnapshot {
203
+ readonly protocol: BrowserInteractionProtocolIdentity;
204
+ readonly surfaces: readonly BrowserInteractionSurfaceSnapshot[];
205
+ readonly diagnostics: readonly BrowserInteractionDiagnostic[];
206
+ }
207
+
208
+ export interface BrowserInteractionSurfaceDefinition<
209
+ Surface extends BrowserInteractionSurface = BrowserInteractionSurface,
210
+ Intent extends BrowserInteractionIntent = BrowserInteractionIntent,
211
+ EffectKind extends string = string,
212
+ > {
213
+ readonly surface: Surface;
214
+ readonly intents: readonly Intent[];
215
+ readonly effectKinds?: readonly EffectKind[];
216
+ }
217
+
218
+ export interface BrowserInteractionRegistry {
219
+ readonly surfaces: ReadonlyMap<
220
+ BrowserInteractionSurface,
221
+ BrowserInteractionSurfaceDefinition
222
+ >;
223
+ }
224
+
225
+ export interface BrowserInteractionIntentRequest {
226
+ readonly surface: BrowserInteractionSurface;
227
+ readonly scopeId?: string;
228
+ readonly interactionKey?: string;
229
+ readonly interactionId?: string;
230
+ readonly intent: BrowserInteractionIntent;
231
+ readonly inputKey?: string;
232
+ readonly candidateValue?: unknown;
233
+ readonly candidateValueKey?: string;
234
+ readonly actuatorKind?: BrowserInteractionActuatorKind;
235
+ readonly allowDisabled?: boolean;
236
+ }
237
+
238
+ export interface BrowserInteractionEffectRequest<
239
+ Effect extends BrowserInteractionSurfaceEffect =
240
+ BrowserInteractionSurfaceEffect,
241
+ > {
242
+ readonly surface: BrowserInteractionSurface;
243
+ readonly scopeId?: string;
244
+ readonly interactionKey?: string;
245
+ readonly interactionId?: string;
246
+ readonly effect: Effect;
247
+ readonly allowDisabled?: boolean;
248
+ }
249
+
250
+ export type GameplayBrowserInteractionEffectRequest =
251
+ BrowserInteractionEffectRequest<GameplaySemanticEffect>;
252
+
253
+ export interface BrowserInteractionResolutionSuccess {
254
+ readonly ok: true;
255
+ readonly actuator: BrowserInteractionActuator;
256
+ readonly surface: BrowserInteractionSurface;
257
+ readonly scopeId: string;
258
+ readonly interactionKey: string;
259
+ readonly diagnostics: readonly BrowserInteractionDiagnostic[];
260
+ }
261
+
262
+ export interface BrowserInteractionResolutionFailure {
263
+ readonly ok: false;
264
+ readonly code:
265
+ | "ambiguous"
266
+ | "invalid-snapshot"
267
+ | "not-found"
268
+ | "preparation-required"
269
+ | "unavailable";
270
+ readonly diagnostics: readonly BrowserInteractionDiagnostic[];
271
+ readonly preparation?: readonly BrowserInteractionActuator[];
272
+ }
273
+
274
+ export type BrowserInteractionResolution =
275
+ | BrowserInteractionResolutionSuccess
276
+ | BrowserInteractionResolutionFailure;
277
+
278
+ export interface BrowserInteractionEffectResolutionSuccess {
279
+ readonly ok: true;
280
+ readonly actuator: BrowserInteractionActuator;
281
+ readonly surface: BrowserInteractionSurface;
282
+ readonly scopeId: string;
283
+ readonly interactionKey: string;
284
+ readonly match: "exact" | "accepted-pattern";
285
+ readonly effect: BrowserInteractionSurfaceEffect;
286
+ readonly diagnostics: readonly BrowserInteractionDiagnostic[];
287
+ }
288
+
289
+ export interface BrowserInteractionEffectResolutionFailure {
290
+ readonly ok: false;
291
+ readonly code:
292
+ | "ambiguous"
293
+ | "invalid-effect"
294
+ | "invalid-snapshot"
295
+ | "not-found"
296
+ | "preparation-required"
297
+ | "unavailable";
298
+ readonly diagnostics: readonly BrowserInteractionDiagnostic[];
299
+ readonly preparation?: readonly BrowserInteractionActuator[];
300
+ }
301
+
302
+ export type BrowserInteractionEffectResolution =
303
+ | BrowserInteractionEffectResolutionSuccess
304
+ | BrowserInteractionEffectResolutionFailure;
@@ -0,0 +1 @@
1
+ export * from "./browser-interaction/index.js";
@@ -11,7 +11,7 @@ export type ContinuationToken = { "id": string; "data": JsonValue };
11
11
 
12
12
  export type ContinuationMap = Record<string, ContinuationToken>;
13
13
 
14
- export type JsonValue = Record<string, unknown> | Array<unknown> | string | number | boolean | null;
14
+ export type JsonValue = string | number | boolean | null | JsonValue[] | { [key: string]: JsonValue };
15
15
 
16
16
  export type ReducerSetupSelection = { "profileId": string; "optionValues": Record<string, string | null> };
17
17
 
@@ -8,7 +8,9 @@ export const ReducerContractVersionSchema = z.string().regex(new RegExp("^[0-9]+
8
8
 
9
9
  export const EffectIdSchema = z.string().min(1);
10
10
 
11
- export const JsonValueSchema = z.union([z.record(z.string(), z.unknown()), z.array(z.unknown()), z.string(), z.number(), z.boolean(), z.null()]);
11
+ let JsonValueSchemaInternal: z.ZodType<unknown>;
12
+ JsonValueSchemaInternal = z.lazy(() => z.union([z.record(z.string(), JsonValueSchemaInternal), z.array(JsonValueSchemaInternal), z.string(), z.number(), z.boolean(), z.null()]));
13
+ export const JsonValueSchema = JsonValueSchemaInternal;
12
14
 
13
15
  export const ContinuationTokenSchema = z.object({ "id": z.string().min(1), "data": JsonValueSchema }).strict();
14
16
 
@@ -1,4 +1,4 @@
1
- export const DREAMBOARD_SDK_VERSION = "0.2.0";
1
+ export const DREAMBOARD_SDK_VERSION = "0.2.1-alpha.1";
2
2
 
3
3
  export const DREAMBOARD_SDK_PACKAGES = {
4
4
  "@dreamboard-games/sdk": DREAMBOARD_SDK_VERSION,
@@ -320,7 +320,7 @@ export function createReducerBundle<
320
320
  }: Wire.InitializeRequest) {
321
321
  const { table: parsedTable, playerIds: parsedPlayerIds } =
322
322
  codec.parseInitialTable(
323
- table as Parameters<typeof codec.parseInitialTable>[0],
323
+ table as unknown as Parameters<typeof codec.parseInitialTable>[0],
324
324
  playerIds,
325
325
  );
326
326
  return codec.serializeState(
@@ -54,6 +54,9 @@ type InteractionDescriptorBaseShape<
54
54
  interactionKey: `${PhaseName}.${InteractionId}`;
55
55
  interactionId: InteractionId;
56
56
  commit: InteractionCommitPolicyShape;
57
+ descriptorDigest?: string;
58
+ actorSeat?: number;
59
+ draftDigest?: string;
57
60
  zoneId?: ZoneId;
58
61
  zoneIds?: readonly ZoneId[];
59
62
  inputs: InteractionInputDescriptorShape[];