@requence/task 0.8.2-edge.1154 → 0.8.2-edge.1155

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 (31) hide show
  1. package/build/chunk-vnx9bdvh.js +181 -0
  2. package/build/chunk-vnx9bdvh.js.map +14 -0
  3. package/build/cli.js +11 -13
  4. package/build/cli.js.map +3 -3
  5. package/build/index.js +11 -11
  6. package/build/index.js.map +6 -6
  7. package/build/types/helpers/src/index.d.ts +4 -0
  8. package/build/types/helpers/src/index.d.ts.map +1 -1
  9. package/build/types/helpers/src/protocol/NodeTree.d.ts +20 -0
  10. package/build/types/helpers/src/protocol/NodeTree.d.ts.map +1 -1
  11. package/build/types/helpers/src/protocol/command.d.ts +74 -13
  12. package/build/types/helpers/src/protocol/command.d.ts.map +1 -1
  13. package/build/types/helpers/src/protocol/update.d.ts +128 -10
  14. package/build/types/helpers/src/protocol/update.d.ts.map +1 -1
  15. package/build/types/helpers/src/utils/matchSchema.d.ts +14 -0
  16. package/build/types/helpers/src/utils/matchSchema.d.ts.map +1 -1
  17. package/build/types/helpers/src/utils/serviceRender.d.ts +73 -0
  18. package/build/types/helpers/src/utils/serviceRender.d.ts.map +1 -0
  19. package/build/types/helpers/src/utils/surfaceComponent.d.ts +116 -0
  20. package/build/types/helpers/src/utils/surfaceComponent.d.ts.map +1 -0
  21. package/build/types/helpers/src/utils/surfaceHandler.d.ts +171 -0
  22. package/build/types/helpers/src/utils/surfaceHandler.d.ts.map +1 -0
  23. package/build/types/helpers/src/utils/uiRebuild.d.ts +48 -0
  24. package/build/types/helpers/src/utils/uiRebuild.d.ts.map +1 -0
  25. package/build/types/task/src/createTask.d.ts.map +1 -1
  26. package/build/types/task/src/getTask.d.ts.map +1 -1
  27. package/build/types/task/src/types.d.ts +4 -4
  28. package/build/types/task/src/types.d.ts.map +1 -1
  29. package/package.json +2 -2
  30. package/build/chunk-f7g9gsa0.js +0 -65
  31. package/build/chunk-f7g9gsa0.js.map +0 -11
@@ -58,7 +58,7 @@ export declare function createCommandSchemaWith(parseTreeList: (treeList: InputT
58
58
  references: z.ZodOptional<z.ZodArray<z.ZodAny>>;
59
59
  schemas: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
60
60
  }, z.core.$strip>;
61
- input: z.ZodAny;
61
+ input: z.ZodOptional<z.ZodAny>;
62
62
  options: z.ZodObject<{
63
63
  maxExecutions: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
64
64
  mode: z.ZodDefault<z.ZodEnum<{
@@ -83,7 +83,7 @@ export declare function createCommandSchemaWith(parseTreeList: (treeList: InputT
83
83
  }, z.core.$strip>;
84
84
  }, z.core.$strip>, z.ZodTransform<{
85
85
  type: "CREATE";
86
- input: any;
86
+ input?: any;
87
87
  options: {
88
88
  maxExecutions: number;
89
89
  mode: "CONTINUOUS" | "LINEAR";
@@ -393,7 +393,7 @@ export declare function createCommandSchemaWith(parseTreeList: (treeList: InputT
393
393
  references?: any[] | undefined;
394
394
  schemas?: Record<string, any> | undefined;
395
395
  };
396
- input: any;
396
+ input?: any;
397
397
  options: {
398
398
  maxExecutions: number;
399
399
  mode: "CONTINUOUS" | "LINEAR";
@@ -437,7 +437,7 @@ export declare function createCommandSchemaWithAsync(parseTreeList: (treeList: I
437
437
  references: z.ZodOptional<z.ZodArray<z.ZodAny>>;
438
438
  schemas: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
439
439
  }, z.core.$strip>;
440
- input: z.ZodAny;
440
+ input: z.ZodOptional<z.ZodAny>;
441
441
  options: z.ZodObject<{
442
442
  maxExecutions: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
443
443
  mode: z.ZodDefault<z.ZodEnum<{
@@ -462,7 +462,7 @@ export declare function createCommandSchemaWithAsync(parseTreeList: (treeList: I
462
462
  }, z.core.$strip>;
463
463
  }, z.core.$strip>, z.ZodTransform<{
464
464
  type: "CREATE";
465
- input: any;
465
+ input?: any;
466
466
  options: {
467
467
  maxExecutions: number;
468
468
  mode: "CONTINUOUS" | "LINEAR";
@@ -772,7 +772,7 @@ export declare function createCommandSchemaWithAsync(parseTreeList: (treeList: I
772
772
  references?: any[] | undefined;
773
773
  schemas?: Record<string, any> | undefined;
774
774
  };
775
- input: any;
775
+ input?: any;
776
776
  options: {
777
777
  maxExecutions: number;
778
778
  mode: "CONTINUOUS" | "LINEAR";
@@ -803,7 +803,7 @@ export declare const createCommandSchema: z.ZodPipe<z.ZodObject<{
803
803
  references: z.ZodOptional<z.ZodArray<z.ZodAny>>;
804
804
  schemas: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
805
805
  }, z.core.$strip>;
806
- input: z.ZodAny;
806
+ input: z.ZodOptional<z.ZodAny>;
807
807
  options: z.ZodObject<{
808
808
  maxExecutions: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
809
809
  mode: z.ZodDefault<z.ZodEnum<{
@@ -828,7 +828,7 @@ export declare const createCommandSchema: z.ZodPipe<z.ZodObject<{
828
828
  }, z.core.$strip>;
829
829
  }, z.core.$strip>, z.ZodTransform<{
830
830
  type: "CREATE";
831
- input: any;
831
+ input?: any;
832
832
  options: {
833
833
  maxExecutions: number;
834
834
  mode: "CONTINUOUS" | "LINEAR";
@@ -1138,7 +1138,7 @@ export declare const createCommandSchema: z.ZodPipe<z.ZodObject<{
1138
1138
  references?: any[] | undefined;
1139
1139
  schemas?: Record<string, any> | undefined;
1140
1140
  };
1141
- input: any;
1141
+ input?: any;
1142
1142
  options: {
1143
1143
  maxExecutions: number;
1144
1144
  mode: "CONTINUOUS" | "LINEAR";
@@ -1160,6 +1160,49 @@ export declare const createCommandSchema: z.ZodPipe<z.ZodObject<{
1160
1160
  };
1161
1161
  }>>;
1162
1162
  export type CreateCommand = z.infer<typeof createCommandSchema>;
1163
+ /**
1164
+ * A viewer drove a service-provided surface (#104).
1165
+ *
1166
+ * A command rather than a result, because there is no service process behind a
1167
+ * click: ui/backend holds no capability of the service's, opens no connection on
1168
+ * its behalf and composes no service-protocol message — it forwards *which
1169
+ * handler, with what*, and the operator publishes the invocation. It travels the
1170
+ * one channel ui/backend already has to the operator, so it hashes onto the
1171
+ * task's own shard and cannot overtake or be overtaken by that task's other
1172
+ * commands (knowledge/task-sharding.md).
1173
+ *
1174
+ * `nodeId` — not a message id — is what names the service the handler belongs
1175
+ * to. The pair `(name, version)` is read off the node, and the node is the only
1176
+ * one of the two that a **durable** handler can still be resolved through: it
1177
+ * outlives the message that published the render, which is the whole point of
1178
+ * being durable.
1179
+ *
1180
+ * The handler reference travels verbatim, exactly as the render carried it out
1181
+ * (#103): its `lifetime` is what decides whether the operator publishes to the
1182
+ * version's handler queue or to one connection's backchannel, and the browser
1183
+ * never sees either — it names a props path, and ui/backend resolves it against
1184
+ * what it stored.
1185
+ */
1186
+ export declare const invokeSurfaceHandlerCommandSchema: z.ZodObject<{
1187
+ type: z.ZodLiteral<"INVOKE_SURFACE_HANDLER">;
1188
+ nodeId: z.ZodUUID;
1189
+ surface: z.ZodUUID;
1190
+ handler: z.ZodDiscriminatedUnion<[z.ZodObject<{
1191
+ __REQUENCE_type: z.ZodLiteral<"RequenceHandler">;
1192
+ lifetime: z.ZodLiteral<"durable">;
1193
+ uiId: z.ZodString;
1194
+ path: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodInt]>>;
1195
+ }, z.core.$strip>, z.ZodObject<{
1196
+ __REQUENCE_type: z.ZodLiteral<"RequenceHandler">;
1197
+ lifetime: z.ZodLiteral<"connection">;
1198
+ uiId: z.ZodString;
1199
+ path: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodInt]>>;
1200
+ connectionId: z.ZodString;
1201
+ handlerId: z.ZodUUID;
1202
+ }, z.core.$strip>], "lifetime">;
1203
+ arg: z.ZodOptional<z.ZodUnknown>;
1204
+ }, z.core.$strip>;
1205
+ export type InvokeSurfaceHandlerCommand = z.infer<typeof invokeSurfaceHandlerCommandSchema>;
1163
1206
  export declare const commandSchema: z.ZodUnion<readonly [z.ZodObject<{
1164
1207
  type: z.ZodLiteral<"ABORT">;
1165
1208
  reason: z.ZodOptional<z.ZodString>;
@@ -1175,7 +1218,7 @@ export declare const commandSchema: z.ZodUnion<readonly [z.ZodObject<{
1175
1218
  references: z.ZodOptional<z.ZodArray<z.ZodAny>>;
1176
1219
  schemas: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
1177
1220
  }, z.core.$strip>;
1178
- input: z.ZodAny;
1221
+ input: z.ZodOptional<z.ZodAny>;
1179
1222
  options: z.ZodObject<{
1180
1223
  maxExecutions: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
1181
1224
  mode: z.ZodDefault<z.ZodEnum<{
@@ -1200,7 +1243,7 @@ export declare const commandSchema: z.ZodUnion<readonly [z.ZodObject<{
1200
1243
  }, z.core.$strip>;
1201
1244
  }, z.core.$strip>, z.ZodTransform<{
1202
1245
  type: "CREATE";
1203
- input: any;
1246
+ input?: any;
1204
1247
  options: {
1205
1248
  maxExecutions: number;
1206
1249
  mode: "CONTINUOUS" | "LINEAR";
@@ -1510,7 +1553,7 @@ export declare const commandSchema: z.ZodUnion<readonly [z.ZodObject<{
1510
1553
  references?: any[] | undefined;
1511
1554
  schemas?: Record<string, any> | undefined;
1512
1555
  };
1513
- input: any;
1556
+ input?: any;
1514
1557
  options: {
1515
1558
  maxExecutions: number;
1516
1559
  mode: "CONTINUOUS" | "LINEAR";
@@ -1530,7 +1573,25 @@ export declare const commandSchema: z.ZodUnion<readonly [z.ZodObject<{
1530
1573
  epoch?: string | undefined;
1531
1574
  } | undefined;
1532
1575
  };
1533
- }>>]>;
1576
+ }>>, z.ZodObject<{
1577
+ type: z.ZodLiteral<"INVOKE_SURFACE_HANDLER">;
1578
+ nodeId: z.ZodUUID;
1579
+ surface: z.ZodUUID;
1580
+ handler: z.ZodDiscriminatedUnion<[z.ZodObject<{
1581
+ __REQUENCE_type: z.ZodLiteral<"RequenceHandler">;
1582
+ lifetime: z.ZodLiteral<"durable">;
1583
+ uiId: z.ZodString;
1584
+ path: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodInt]>>;
1585
+ }, z.core.$strip>, z.ZodObject<{
1586
+ __REQUENCE_type: z.ZodLiteral<"RequenceHandler">;
1587
+ lifetime: z.ZodLiteral<"connection">;
1588
+ uiId: z.ZodString;
1589
+ path: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodInt]>>;
1590
+ connectionId: z.ZodString;
1591
+ handlerId: z.ZodUUID;
1592
+ }, z.core.$strip>], "lifetime">;
1593
+ arg: z.ZodOptional<z.ZodUnknown>;
1594
+ }, z.core.$strip>]>;
1534
1595
  export type Command = z.infer<typeof commandSchema>;
1535
1596
  export type CommandInput = z.input<typeof commandSchema>;
1536
1597
  //# sourceMappingURL=command.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../../../../helpers/src/protocol/command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAG1B,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,QAAQ,EAEd,MAAM,gBAAgB,CAAA;AAEvB,eAAO,MAAM,kBAAkB;;;iBAG7B,CAAA;AAEF,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAE7D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,sBAAsB;;iBAEjC,CAAA;AAEF,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;AA0BrE;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,uBAAuB,CACrC,aAAa,EAAE,CAAC,QAAQ,EAAE,aAAa,KAAK,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;mBAKxB,CAAA;AACF,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAA;AACnD,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAA"}
@@ -90,7 +90,7 @@ declare const nodeUpdateSchema: z.ZodObject<{
90
90
  }, z.core.$strip>;
91
91
  type: z.ZodLiteral<"NODE_UPDATE">;
92
92
  output: z.ZodNullable<z.ZodString>;
93
- data: z.ZodUnknown;
93
+ data: z.ZodOptional<z.ZodUnknown>;
94
94
  overwrite: z.ZodBoolean;
95
95
  }, z.core.$strip>;
96
96
  export type NodeUpdate = z.infer<typeof nodeUpdateSchema>;
@@ -122,7 +122,7 @@ declare const nodeCallbackSchema: z.ZodObject<{
122
122
  }, z.core.$strip>;
123
123
  propertyPath: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
124
124
  output: z.ZodNullable<z.ZodString>;
125
- data: z.ZodUnknown;
125
+ data: z.ZodOptional<z.ZodUnknown>;
126
126
  }, z.core.$strip>;
127
127
  export type NodeCallback = z.infer<typeof nodeCallbackSchema>;
128
128
  declare const nodeEndUpdateSchema: z.ZodObject<{
@@ -166,9 +166,72 @@ declare const nodeDebugUpdateSchema: z.ZodObject<{
166
166
  system: "system";
167
167
  warn: "warn";
168
168
  }>;
169
- data: z.ZodUnknown;
169
+ data: z.ZodOptional<z.ZodUnknown>;
170
170
  }, z.core.$strip>;
171
171
  export type NodeDebugUpdate = z.infer<typeof nodeDebugUpdateSchema>;
172
+ declare const nodeRenderUpdateSchema: z.ZodObject<{
173
+ component: z.ZodObject<{
174
+ id: z.ZodString;
175
+ hash: z.ZodString;
176
+ source: z.ZodDefault<z.ZodNullable<z.ZodString>>;
177
+ }, z.core.$strip>;
178
+ props: z.ZodUnknown;
179
+ defaults: z.ZodOptional<z.ZodUnknown>;
180
+ surfaceId: z.ZodString;
181
+ devSession: z.ZodDefault<z.ZodNullable<z.ZodString>>;
182
+ timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<Date, number>>;
183
+ id: z.ZodUUID;
184
+ rootTaskId: z.ZodOptional<z.ZodUUID>;
185
+ traceIds: z.ZodArray<z.ZodString>;
186
+ node: z.ZodObject<{
187
+ id: z.ZodUUID;
188
+ type: z.ZodEnum<{
189
+ logic: "logic";
190
+ or: "or";
191
+ reference: "reference";
192
+ service: "service";
193
+ }>;
194
+ alias: z.ZodOptional<z.ZodString>;
195
+ }, z.core.$strip>;
196
+ type: z.ZodLiteral<"NODE_RENDER">;
197
+ messageId: z.ZodUUID;
198
+ connectionId: z.ZodUUID;
199
+ ownTraceId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
200
+ handlerQueue: z.ZodDefault<z.ZodNullable<z.ZodString>>;
201
+ }, z.core.$strip>;
202
+ export type NodeRenderUpdate = z.infer<typeof nodeRenderUpdateSchema>;
203
+ declare const surfaceDeadUpdateSchema: z.ZodObject<{
204
+ timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<Date, number>>;
205
+ id: z.ZodUUID;
206
+ rootTaskId: z.ZodOptional<z.ZodUUID>;
207
+ traceIds: z.ZodArray<z.ZodString>;
208
+ type: z.ZodLiteral<"SURFACE_DEAD">;
209
+ messageId: z.ZodUUID;
210
+ connectionId: z.ZodDefault<z.ZodNullable<z.ZodUUID>>;
211
+ }, z.core.$strip>;
212
+ export type SurfaceDeadUpdate = z.infer<typeof surfaceDeadUpdateSchema>;
213
+ declare const surfaceInteractionErrorUpdateSchema: z.ZodObject<{
214
+ timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<Date, number>>;
215
+ id: z.ZodUUID;
216
+ rootTaskId: z.ZodOptional<z.ZodUUID>;
217
+ traceIds: z.ZodArray<z.ZodString>;
218
+ type: z.ZodLiteral<"SURFACE_INTERACTION_ERROR">;
219
+ surface: z.ZodUUID;
220
+ message: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
221
+ }, z.core.$strip>;
222
+ export type SurfaceInteractionErrorUpdate = z.infer<typeof surfaceInteractionErrorUpdateSchema>;
223
+ declare const uiRebuiltUpdateSchema: z.ZodObject<{
224
+ devSession: z.ZodString;
225
+ uiId: z.ZodString;
226
+ hash: z.ZodString;
227
+ source: z.ZodString;
228
+ timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<Date, number>>;
229
+ id: z.ZodUUID;
230
+ rootTaskId: z.ZodOptional<z.ZodUUID>;
231
+ traceIds: z.ZodArray<z.ZodString>;
232
+ type: z.ZodLiteral<"UI_REBUILT">;
233
+ }, z.core.$strip>;
234
+ export type UiRebuiltUpdate = z.infer<typeof uiRebuiltUpdateSchema>;
172
235
  declare const nodeDeferUpdateSchema: z.ZodObject<{
173
236
  timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<Date, number>>;
174
237
  id: z.ZodUUID;
@@ -185,7 +248,7 @@ declare const nodeDeferUpdateSchema: z.ZodObject<{
185
248
  alias: z.ZodOptional<z.ZodString>;
186
249
  }, z.core.$strip>;
187
250
  type: z.ZodLiteral<"NODE_DEFER">;
188
- reason: z.ZodUnknown;
251
+ reason: z.ZodOptional<z.ZodUnknown>;
189
252
  }, z.core.$strip>;
190
253
  export type NodeDeferUpdate = z.infer<typeof nodeDeferUpdateSchema>;
191
254
  declare const taskStartUpdateSchema: z.ZodObject<{
@@ -200,7 +263,7 @@ declare const taskStartUpdateSchema: z.ZodObject<{
200
263
  nodeId: z.ZodUUID;
201
264
  messageId: z.ZodUUID;
202
265
  }, z.core.$strip>>>;
203
- input: z.ZodUnknown;
266
+ input: z.ZodOptional<z.ZodUnknown>;
204
267
  }, z.core.$strip>;
205
268
  export type TaskStartUpdate = z.infer<typeof taskStartUpdateSchema>;
206
269
  declare const taskErrorUpdateSchema: z.ZodObject<{
@@ -307,7 +370,7 @@ export declare const updateSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
307
370
  }, z.core.$strip>;
308
371
  type: z.ZodLiteral<"NODE_UPDATE">;
309
372
  output: z.ZodNullable<z.ZodString>;
310
- data: z.ZodUnknown;
373
+ data: z.ZodOptional<z.ZodUnknown>;
311
374
  overwrite: z.ZodBoolean;
312
375
  }, z.core.$strip>, z.ZodObject<{
313
376
  timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<Date, number>>;
@@ -337,7 +400,7 @@ export declare const updateSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
337
400
  }, z.core.$strip>;
338
401
  propertyPath: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
339
402
  output: z.ZodNullable<z.ZodString>;
340
- data: z.ZodUnknown;
403
+ data: z.ZodOptional<z.ZodUnknown>;
341
404
  }, z.core.$strip>, z.ZodObject<{
342
405
  timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<Date, number>>;
343
406
  id: z.ZodUUID;
@@ -377,7 +440,62 @@ export declare const updateSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
377
440
  system: "system";
378
441
  warn: "warn";
379
442
  }>;
380
- data: z.ZodUnknown;
443
+ data: z.ZodOptional<z.ZodUnknown>;
444
+ }, z.core.$strip>, z.ZodObject<{
445
+ component: z.ZodObject<{
446
+ id: z.ZodString;
447
+ hash: z.ZodString;
448
+ source: z.ZodDefault<z.ZodNullable<z.ZodString>>;
449
+ }, z.core.$strip>;
450
+ props: z.ZodUnknown;
451
+ defaults: z.ZodOptional<z.ZodUnknown>;
452
+ surfaceId: z.ZodString;
453
+ devSession: z.ZodDefault<z.ZodNullable<z.ZodString>>;
454
+ timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<Date, number>>;
455
+ id: z.ZodUUID;
456
+ rootTaskId: z.ZodOptional<z.ZodUUID>;
457
+ traceIds: z.ZodArray<z.ZodString>;
458
+ node: z.ZodObject<{
459
+ id: z.ZodUUID;
460
+ type: z.ZodEnum<{
461
+ logic: "logic";
462
+ or: "or";
463
+ reference: "reference";
464
+ service: "service";
465
+ }>;
466
+ alias: z.ZodOptional<z.ZodString>;
467
+ }, z.core.$strip>;
468
+ type: z.ZodLiteral<"NODE_RENDER">;
469
+ messageId: z.ZodUUID;
470
+ connectionId: z.ZodUUID;
471
+ ownTraceId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
472
+ handlerQueue: z.ZodDefault<z.ZodNullable<z.ZodString>>;
473
+ }, z.core.$strip>, z.ZodObject<{
474
+ timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<Date, number>>;
475
+ id: z.ZodUUID;
476
+ rootTaskId: z.ZodOptional<z.ZodUUID>;
477
+ traceIds: z.ZodArray<z.ZodString>;
478
+ type: z.ZodLiteral<"SURFACE_DEAD">;
479
+ messageId: z.ZodUUID;
480
+ connectionId: z.ZodDefault<z.ZodNullable<z.ZodUUID>>;
481
+ }, z.core.$strip>, z.ZodObject<{
482
+ timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<Date, number>>;
483
+ id: z.ZodUUID;
484
+ rootTaskId: z.ZodOptional<z.ZodUUID>;
485
+ traceIds: z.ZodArray<z.ZodString>;
486
+ type: z.ZodLiteral<"SURFACE_INTERACTION_ERROR">;
487
+ surface: z.ZodUUID;
488
+ message: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
489
+ }, z.core.$strip>, z.ZodObject<{
490
+ devSession: z.ZodString;
491
+ uiId: z.ZodString;
492
+ hash: z.ZodString;
493
+ source: z.ZodString;
494
+ timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<Date, number>>;
495
+ id: z.ZodUUID;
496
+ rootTaskId: z.ZodOptional<z.ZodUUID>;
497
+ traceIds: z.ZodArray<z.ZodString>;
498
+ type: z.ZodLiteral<"UI_REBUILT">;
381
499
  }, z.core.$strip>, z.ZodObject<{
382
500
  timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<Date, number>>;
383
501
  id: z.ZodUUID;
@@ -394,7 +512,7 @@ export declare const updateSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
394
512
  alias: z.ZodOptional<z.ZodString>;
395
513
  }, z.core.$strip>;
396
514
  type: z.ZodLiteral<"NODE_DEFER">;
397
- reason: z.ZodUnknown;
515
+ reason: z.ZodOptional<z.ZodUnknown>;
398
516
  }, z.core.$strip>, z.ZodObject<{
399
517
  timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<Date, number>>;
400
518
  id: z.ZodUUID;
@@ -407,7 +525,7 @@ export declare const updateSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
407
525
  nodeId: z.ZodUUID;
408
526
  messageId: z.ZodUUID;
409
527
  }, z.core.$strip>>>;
410
- input: z.ZodUnknown;
528
+ input: z.ZodOptional<z.ZodUnknown>;
411
529
  }, z.core.$strip>, z.ZodObject<{
412
530
  timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<Date, number>>;
413
531
  id: z.ZodUUID;
@@ -1 +1 @@
1
- {"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../../../../helpers/src/protocol/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAsB1B,QAAA,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;iBAIxB,CAAA;AACF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAYjE,QAAA,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAezB,CAAA;AACF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAEnE,QAAA,MAAM,qBAAqB;;;;;;;;;;;;;;;;;iBAGzB,CAAA;AACF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAEnE,QAAA,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;iBAKpB,CAAA;AAEF,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAiBvB,CAAA;AAEF,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAA"}
@@ -1,4 +1,18 @@
1
1
  import type { z } from 'zod/v4';
2
+ /**
3
+ * Curried on **arity**, never on the value — which is what the rest parameter
4
+ * buys over an optional one.
5
+ *
6
+ * It used to branch on `if (input)`, so a falsy second argument fell through to
7
+ * the curried arm and the caller was handed a predicate *function* instead of an
8
+ * answer. A function is truthy, so `if (!matchSchema(schema, value))` passed on
9
+ * exactly the input it was written to catch (a missing `correlationId`, an absent
10
+ * `taskId` header), and `if (matchSchema(schema, value))` fired on values that
11
+ * match nothing — `resolveAccept`'s unresolvable `#/definitions/…` hop reached
12
+ * `undefined.const` that way. The mirror image was just as wrong: `0`, `''` and
13
+ * `false` are legitimate values a guard must be able to say *yes* about, and
14
+ * `index: 0` is the first publish of every service message.
15
+ */
2
16
  export declare function matchSchema<Schema extends z.ZodSchema>(schema: Schema, input: unknown): input is z.infer<Schema>;
3
17
  export declare function matchSchema<Schema extends z.ZodSchema>(schema: Schema): (input: unknown) => input is z.infer<Schema>;
4
18
  //# sourceMappingURL=matchSchema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"matchSchema.d.ts","sourceRoot":"","sources":["../../../../../../helpers/src/utils/matchSchema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAE/B,wBAAgB,WAAW,CAAC,MAAM,SAAS,CAAC,CAAC,SAAS,EACpD,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;AAC3B,wBAAgB,WAAW,CAAC,MAAM,SAAS,CAAC,CAAC,SAAS,EACpD,MAAM,EAAE,MAAM,GACb,CAAC,KAAK,EAAE,OAAO,KAAK,KAAK,IAAI,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA"}
1
+ {"version":3,"file":"matchSchema.d.ts","sourceRoot":"","sources":["../../../../../../helpers/src/utils/matchSchema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAE/B;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CAAC,MAAM,SAAS,CAAC,CAAC,SAAS,EACpD,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;AAC3B,wBAAgB,WAAW,CAAC,MAAM,SAAS,CAAC,CAAC,SAAS,EACpD,MAAM,EAAE,MAAM,GACb,CAAC,KAAK,EAAE,OAAO,KAAK,KAAK,IAAI,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA"}
@@ -0,0 +1,73 @@
1
+ import { z } from 'zod/v4';
2
+ /**
3
+ * The render payload a service publishes when a handler calls
4
+ * `context.render(ui, props)` — the wire shape shared by the service SDK
5
+ * (which composes it) and the operator (which parses it before emitting the
6
+ * render as a task update). See `knowledge/service-ui-surfaces.md`.
7
+ *
8
+ * `component.source` travels only on the **first** render of a given hash into a
9
+ * given task; later renders carry the hash alone, because ui/backend stores the
10
+ * bundle hash-addressed and that row outlives every render. A hash arriving
11
+ * without a source that ui/backend has never seen is an error state on the
12
+ * surface, not a silent fallback (D16).
13
+ *
14
+ * Per task rather than per connection because bundle retention is per task
15
+ * (D19): the last-referent sweep removes a bundle once no task references it, and
16
+ * a connection can outlive every task that referenced its component.
17
+ *
18
+ * Every field is deliberately a *top-level* key, because that is the granularity
19
+ * the size-triggered claim-check works at: it offloads a record body's largest
20
+ * top-level values first, and the publisher pins every one of these inline except
21
+ * `props`. So an oversized render always offloads `props` — the one value whose
22
+ * loss is a named error state rather than a broken surface. The source is capped
23
+ * at {@link MAX_UI_SOURCE_BYTES} anyway, well under the offload threshold, so the
24
+ * bundle always travels inline (D4).
25
+ */
26
+ export declare const serviceRenderSchema: z.ZodObject<{
27
+ component: z.ZodObject<{
28
+ id: z.ZodString;
29
+ hash: z.ZodString;
30
+ source: z.ZodDefault<z.ZodNullable<z.ZodString>>;
31
+ }, z.core.$strip>;
32
+ props: z.ZodUnknown;
33
+ defaults: z.ZodOptional<z.ZodUnknown>;
34
+ surfaceId: z.ZodString;
35
+ devSession: z.ZodDefault<z.ZodNullable<z.ZodString>>;
36
+ }, z.core.$strip>;
37
+ export type ServiceRender = z.infer<typeof serviceRenderSchema>;
38
+ /**
39
+ * Hard cap on a UI component bundle, enforced when the component is registered
40
+ * (D4). Fits a self-contained React component, stays storable inline in
41
+ * Postgres, and fails fast on an accidental whole-app bundle.
42
+ */
43
+ export declare const MAX_UI_SOURCE_BYTES: number;
44
+ /**
45
+ * The surface a render targets when it names none (D3). A node's surfaces are
46
+ * keyed by this id, so the default is a single surface per node/trace.
47
+ */
48
+ export declare const DEFAULT_SURFACE_ID = "default";
49
+ /**
50
+ * Hard cap on one value a browser sends into a surface — a callback
51
+ * invocation's argument, or a deferred form's submitted response — enforced in
52
+ * ui/backend before either is published (D7).
53
+ *
54
+ * One number for both because they are the same thing arriving by two routes:
55
+ * viewer-authored bytes that reach service code, bounded before they enter the
56
+ * fabric. A response additionally has to fit the node's own output, which the
57
+ * operator enforces on the way in as it does for any service result.
58
+ *
59
+ * An interaction is exactly that — a click, a form submit, an approval — not
60
+ * a data transfer, and unlike a service's own publishes it crosses no outbound
61
+ * boundary: nothing offloads it, so its bytes reach the broker as they are. The
62
+ * cap is what keeps that true, and it is deliberately far below any message
63
+ * limit rather than tuned to one, so a task's `maxPayloadSize` can never make
64
+ * the difference between a usable synchronous rejection and a dropped AMQP
65
+ * connection.
66
+ *
67
+ * Lives here, next to {@link MAX_UI_SOURCE_BYTES}, rather than inside ui/backend:
68
+ * the browser is the other party that has to respect it, and when the surface
69
+ * host starts refusing an oversized argument before the round trip it should
70
+ * read the number from where the server enforces it, not restate it.
71
+ */
72
+ export declare const MAX_SURFACE_INTERACTION_BYTES: number;
73
+ //# sourceMappingURL=serviceRender.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serviceRender.d.ts","sourceRoot":"","sources":["../../../../../../helpers/src/utils/serviceRender.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAE1B;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;iBAkD9B,CAAA;AAEF,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAE/D;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,QAAc,CAAA;AAE9C;;;GAGG;AACH,eAAO,MAAM,kBAAkB,YAAY,CAAA;AAE3C;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,6BAA6B,QAAY,CAAA"}
@@ -0,0 +1,116 @@
1
+ /**
2
+ * What a **surface component** is handed, declared once (#113).
3
+ *
4
+ * These types have three readers and no natural owner among them: the service
5
+ * SDK ships them to the component author (`@requence/service`), the frame
6
+ * protocol describes the object the bootstrap actually builds
7
+ * (`ui/frontend/src/routes/tasks/Show/surface/protocol.ts`), and the shared
8
+ * runtime's facade *implements* them in `createSurface`
9
+ * (`ui/frontend/surface-runtime/ui.tsx`). They lived in the SDK and were mirrored
10
+ * in the protocol, which was survivable while the mirror was two fields wide; a
11
+ * third copy in the facade is not, because the drift would land as a helper whose
12
+ * signature promises state the frame does not deliver — and the author's types
13
+ * would be the last thing to find out.
14
+ *
15
+ * So they live here, beside the render wire shape (`serviceRender.ts`) and the
16
+ * handler reference (`surfaceHandler.ts`), which is the seam both verticals
17
+ * already share for exactly this reason.
18
+ *
19
+ * Nothing here has a runtime half: the props themselves cross as
20
+ * `serviceRender`'s payload, and the rest is the browser's own object.
21
+ */
22
+ /** The viewer's app theme, as the surface host reports it. */
23
+ export type SurfaceTheme = 'dark' | 'light';
24
+ /**
25
+ * Everything about a surface that can change while the component is mounted —
26
+ * what `ctx` carries at mount and what `onUpdate` hands over afterwards. Named
27
+ * once so the two cannot drift.
28
+ *
29
+ * There is no surface-wide liveness flag on it (#106). Reachability rides on
30
+ * each handler prop instead — `props.onSubmit.reachable` — because a surface can
31
+ * carry a durable handler and a connection-bound one at once and one flag over
32
+ * both necessarily lies about one of them.
33
+ *
34
+ * It is also what a component written with `createSurface` receives as its own
35
+ * props (#113), which is why the three fields are named for a component and not
36
+ * for the message that carries them.
37
+ */
38
+ export interface SurfaceState<Props> {
39
+ props: Props;
40
+ canInvoke: boolean;
41
+ theme: SurfaceTheme;
42
+ }
43
+ /**
44
+ * The context a mounted component is handed. `props` is the object the service
45
+ * sent (handlers invokable, each carrying its own `reachable`); `canInvoke` is
46
+ * the viewer's `task: UPDATE` verdict; `theme` is the viewer's app theme;
47
+ * `onUpdate` fires on every re-render and returns an unsubscribe.
48
+ *
49
+ * A React component rarely touches this: `createSurface` subscribes for it and
50
+ * hands the state down as props. It is the layer underneath — what a component
51
+ * written without the helper, or in another framework, works against.
52
+ *
53
+ * `canInvoke` is an **affordance signal only** — disable the control, label it
54
+ * read-only. It is not the check: a viewer without the permission has their
55
+ * invocation refused by the parent frame, and ui/backend enforces it again on
56
+ * the mutation, so a component that ignores the flag cannot grant anything.
57
+ *
58
+ * **Reachability is separate, and per prop.** AND the two: `canInvoke` says
59
+ * whether this viewer may drive the surface, `reachable` says whether there is
60
+ * anything at the other end of that particular prop. The flag a form used to get
61
+ * this wrong with — one `live` for the whole surface — is gone, because a
62
+ * **durable** handler is reachable with no live message at all (which is the whole
63
+ * point of the kind: the service renders a form and exits within seconds while
64
+ * the node waits for days) while a connection-bound one on the same surface is
65
+ * not.
66
+ *
67
+ * There is no `submit` here. A form answers its node by calling a handler its own
68
+ * service put in the props — an ordinary function like every other interaction —
69
+ * rather than through a channel Requence defines. Write that handler in the UI's
70
+ * **defaults** so it is durable, and let it `act()` on the key the props carry.
71
+ *
72
+ * **A failed interaction is not reported here either** (#143). Calling a handler
73
+ * prop is *accepted* and nothing more: no return value, no promise, no request.
74
+ * When one could not run — it threw, nothing was registered under it, the version
75
+ * is gone — Requence records a generic sentence and renders it itself, beside the
76
+ * surface, in the same place as a refused click. Nothing arrives in this context,
77
+ * and a component must not try to render it.
78
+ *
79
+ * To say something better than the generic sentence, catch the error **in the
80
+ * handler** and **re-render** the surface with a prop of your own
81
+ * (`{ error: 'unknown address' }`). That statement is in the props, so no generic
82
+ * report can overwrite it, and both can be shown at once — the handler said
83
+ * something *and* it threw.
84
+ *
85
+ * **A `<form>` works, and it must call `preventDefault()`** (D31). The frame is
86
+ * sandboxed with `allow-scripts allow-forms`, so `<form onSubmit>` fires normally
87
+ * and Enter-to-submit comes with it. What the sandbox does *not* grant is
88
+ * `allow-top-navigation` or `allow-popups`, so a submission can only ever navigate
89
+ * **this frame** — which unloads the component. Call `preventDefault()` and invoke
90
+ * the handler prop instead. Forget it and the frame reloads; the surface
91
+ * re-initialises and remounts with its current props rather than going blank, but
92
+ * whatever the component held in local state is gone. A plain `onClick` button is
93
+ * still fine and needs none of this.
94
+ *
95
+ * A component that paints its own colours can follow a theme switch through
96
+ * `onUpdate` — but it rarely has to: the surface host also writes the theme onto
97
+ * `<html data-theme>`, which is what the shared runtime's CSS keys off, so a
98
+ * component drawn with the primitives facade follows the app for free.
99
+ */
100
+ export interface SurfaceContext<Props> {
101
+ readonly props: Props;
102
+ readonly canInvoke: boolean;
103
+ readonly theme: SurfaceTheme;
104
+ onUpdate(callback: (next: SurfaceState<Props>) => void): () => void;
105
+ }
106
+ /**
107
+ * The component contract: one default-exported `mount(element, ctx)` that
108
+ * optionally returns a teardown. Typing the export with `Mount<PropsOf<typeof
109
+ * ui>>` checks the component against exactly what the service sends.
110
+ *
111
+ * A React component does not write one by hand — `createSurface` returns one
112
+ * (#113) — but it is still what the frame calls, and what any other framework
113
+ * exports.
114
+ */
115
+ export type Mount<Props> = (element: HTMLElement, ctx: SurfaceContext<Props>) => (() => void) | void;
116
+ //# sourceMappingURL=surfaceComponent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"surfaceComponent.d.ts","sourceRoot":"","sources":["../../../../../../helpers/src/utils/surfaceComponent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,8DAA8D;AAC9D,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,OAAO,CAAA;AAE3C;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,YAAY,CAAC,KAAK;IACjC,KAAK,EAAE,KAAK,CAAA;IACZ,SAAS,EAAE,OAAO,CAAA;IAClB,KAAK,EAAE,YAAY,CAAA;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,MAAM,WAAW,cAAc,CAAC,KAAK;IACnC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAA;IACrB,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;IAC3B,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAA;IAC5B,QAAQ,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,YAAY,CAAC,KAAK,CAAC,KAAK,IAAI,GAAG,MAAM,IAAI,CAAA;CACpE;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,KAAK,CAAC,KAAK,IAAI,CACzB,OAAO,EAAE,WAAW,EACpB,GAAG,EAAE,cAAc,CAAC,KAAK,CAAC,KACvB,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAAA"}