process-graph 1.1.1 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/README.md +22 -19
  2. package/dist/bin.js +4 -3
  3. package/dist/cli.d.ts +100 -14
  4. package/dist/cli.js +3 -2
  5. package/dist/{control-aDk9560d.js → control-DiygoEhm.js} +163 -1
  6. package/dist/data-file-BVMxkTug.js +95 -0
  7. package/dist/dist-81kTKnMq.js +3 -0
  8. package/dist/{dist-HLlW8vgT.js → dist-BI01yxFA.js} +256 -103
  9. package/dist/{dist-BpCBmnMl.js → dist-arkejVz2.js} +2 -112
  10. package/dist/{graphql-C1j5wQFz.d.ts → graphql-BE7xm5dB.d.ts} +3 -2
  11. package/dist/{index-DricKcyl.d.ts → index-9Au8pAmP.d.ts} +4 -4
  12. package/dist/{index-CrM5qWUA.d.ts → index-BC4tmAuQ.d.ts} +2 -2
  13. package/dist/{index-DhbvDgK4.d.ts → index-CR8xUK3S.d.ts} +388 -580
  14. package/dist/{index-CoA6vXqe.d.ts → index-D06bcdfw.d.ts} +1 -1
  15. package/dist/{index-CCfe0csl.d.ts → index-D4CnOhNf.d.ts} +34 -3
  16. package/dist/{index-CmZOswkx.d.ts → index-Dvz_I_uQ.d.ts} +17 -8
  17. package/dist/{index-CptUHq6F.d.ts → index-hri2a13-.d.ts} +1 -1
  18. package/dist/index.d.ts +4 -4
  19. package/dist/index.js +5 -5
  20. package/dist/layout.d.ts +1 -1
  21. package/dist/{parse-CuipC_2K.js → parse-C1Q1zsGt.js} +1 -1
  22. package/dist/{queries-CCexJAE2.js → queries-C8kIDRiY.js} +2 -93
  23. package/dist/react-flow.d.ts +5 -5
  24. package/dist/react-flow.js +3 -3
  25. package/dist/react.d.ts +1 -1
  26. package/dist/react.js +2 -2
  27. package/dist/{router-D4gtTlXm.js → router-Dk91O_9p.js} +27 -2
  28. package/dist/{schema-CVnS6HiX.js → schema-BPT8fmfa.js} +2 -2
  29. package/dist/{selection-BW_xXWOy.js → selection-iet5RAlP.js} +1 -1
  30. package/dist/source/github/node.d.ts +1 -1
  31. package/dist/source/github.d.ts +2 -2
  32. package/dist/source/github.js +1 -1
  33. package/dist/{source-DRDpEA8Q.js → source-D51N7K3A.js} +23 -3
  34. package/dist/store/node.d.ts +27 -2
  35. package/dist/store/node.js +2 -2
  36. package/dist/store/wasm/worker.js +2 -2
  37. package/dist/store/wasm.d.ts +1 -1
  38. package/dist/{store-BcR70CaO.js → store-DKzvLGgl.js} +252 -37
  39. package/dist/store.d.ts +115 -3
  40. package/dist/store.js +43 -9
  41. package/dist/theme-values-BJJhAkUn-ORyRUrPf.js +114 -0
  42. package/dist/theme-values-BybZ-cle.d.ts +116 -0
  43. package/dist/ui/theme.d.ts +2 -0
  44. package/dist/ui/theme.js +2 -0
  45. package/dist/ui.d.ts +6 -120
  46. package/dist/ui.js +2 -1
  47. package/dist/version-Dagrkvwt.js +5 -0
  48. package/package.json +28 -23
  49. package/dist/dist-IjrgWhHQ.js +0 -3
  50. package/dist/open-CyRXJ4bt.js +0 -29
@@ -1,4 +1,5 @@
1
- import { K as OpenIds, a as Overlay, d as Issue, g as Model } from "./index-CmZOswkx.js";
1
+ import { k as FactRecord } from "./index-D4CnOhNf.js";
2
+ import { _ as Model, f as Issue, i as ModelSchema, o as Overlay, q as OpenIds } from "./index-Dvz_I_uQ.js";
2
3
  import { z } from "zod";
3
4
  import { ContractRouterClient } from "@orpc/contract";
4
5
  import { ContractedRouter } from "@orpc/server";
@@ -30,196 +31,7 @@ declare const graphStoreContract: {
30
31
  }, never> & object>;
31
32
  save: import("@orpc/contract").ProcedureContract<z.ZodReadonly<z.ZodObject<{
32
33
  modelId: z.ZodString;
33
- model: z.ZodReadonly<z.ZodObject<{
34
- participants: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
35
- id: z.ZodString;
36
- label: z.ZodString;
37
- kind: z.ZodEnum<{
38
- role: "role";
39
- system: "system";
40
- entity: "entity";
41
- }>;
42
- }, z.core.$strict>>>>;
43
- events: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
44
- id: z.ZodString;
45
- name: z.ZodString;
46
- payload: z.ZodExactOptional<z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodString>>>;
47
- }, z.core.$strict>>>>;
48
- actions: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
49
- id: z.ZodString;
50
- name: z.ZodString;
51
- }, z.core.$strict>>>>;
52
- artefacts: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
53
- id: z.ZodString;
54
- name: z.ZodString;
55
- deliverable: z.ZodExactOptional<z.ZodBoolean>;
56
- }, z.core.$strict>>>>;
57
- elements: z.ZodReadonly<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
58
- kind: z.ZodLiteral<"activity">;
59
- id: z.ZodString;
60
- extensions: z.ZodExactOptional<z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodType<import("trilean").JsonValue, unknown, z.core.$ZodTypeInternals<import("trilean").JsonValue, unknown>>>>>;
61
- label: z.ZodString;
62
- actor: z.ZodExactOptional<z.ZodString>;
63
- action: z.ZodExactOptional<z.ZodString>;
64
- source: z.ZodExactOptional<z.ZodString>;
65
- affects: z.ZodExactOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
66
- consumes: z.ZodExactOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
67
- produces: z.ZodExactOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
68
- }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
69
- kind: z.ZodLiteral<"decision">;
70
- id: z.ZodString;
71
- extensions: z.ZodExactOptional<z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodType<import("trilean").JsonValue, unknown, z.core.$ZodTypeInternals<import("trilean").JsonValue, unknown>>>>>;
72
- label: z.ZodString;
73
- actor: z.ZodExactOptional<z.ZodString>;
74
- }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
75
- kind: z.ZodLiteral<"state">;
76
- id: z.ZodString;
77
- extensions: z.ZodExactOptional<z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodType<import("trilean").JsonValue, unknown, z.core.$ZodTypeInternals<import("trilean").JsonValue, unknown>>>>>;
78
- label: z.ZodString;
79
- parent: z.ZodExactOptional<z.ZodString>;
80
- entry: z.ZodExactOptional<z.ZodString>;
81
- exit: z.ZodExactOptional<z.ZodString>;
82
- }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
83
- kind: z.ZodLiteral<"pseudo">;
84
- id: z.ZodString;
85
- extensions: z.ZodExactOptional<z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodType<import("trilean").JsonValue, unknown, z.core.$ZodTypeInternals<import("trilean").JsonValue, unknown>>>>>;
86
- role: z.ZodEnum<{
87
- initial: "initial";
88
- final: "final";
89
- fork: "fork";
90
- join: "join";
91
- history: "history";
92
- }>;
93
- parent: z.ZodExactOptional<z.ZodString>;
94
- }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
95
- kind: z.ZodLiteral<"message">;
96
- id: z.ZodString;
97
- extensions: z.ZodExactOptional<z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodType<import("trilean").JsonValue, unknown, z.core.$ZodTypeInternals<import("trilean").JsonValue, unknown>>>>>;
98
- label: z.ZodString;
99
- from: z.ZodString;
100
- to: z.ZodString;
101
- mode: z.ZodEnum<{
102
- sync: "sync";
103
- async: "async";
104
- reply: "reply";
105
- create: "create";
106
- destroy: "destroy";
107
- }>;
108
- event: z.ZodExactOptional<z.ZodString>;
109
- }, z.core.$strict>>], "kind">>>;
110
- transitions: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
111
- id: z.ZodString;
112
- source: z.ZodString;
113
- target: z.ZodString;
114
- trigger: z.ZodExactOptional<z.ZodString>;
115
- guard: z.ZodExactOptional<z.ZodString>;
116
- condition: z.ZodExactOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
117
- kind: z.ZodLiteral<"not">;
118
- operand: typeof import("trilean").PredicateNodeSchema;
119
- }, z.core.$strip>, z.ZodObject<{
120
- kind: z.ZodLiteral<"and">;
121
- left: typeof import("trilean").PredicateNodeSchema;
122
- right: typeof import("trilean").PredicateNodeSchema;
123
- }, z.core.$strip>, z.ZodObject<{
124
- kind: z.ZodLiteral<"or">;
125
- left: typeof import("trilean").PredicateNodeSchema;
126
- right: typeof import("trilean").PredicateNodeSchema;
127
- }, z.core.$strip>, z.ZodObject<{
128
- kind: z.ZodLiteral<"allOf">;
129
- operands: z.ZodArray<typeof import("trilean").PredicateNodeSchema>;
130
- }, z.core.$strip>, z.ZodObject<{
131
- kind: z.ZodLiteral<"anyOf">;
132
- operands: z.ZodArray<typeof import("trilean").PredicateNodeSchema>;
133
- }, z.core.$strip>, z.ZodObject<{
134
- kind: z.ZodLiteral<"compare">;
135
- op: z.ZodEnum<{
136
- gt: "gt";
137
- gte: "gte";
138
- lt: "lt";
139
- lte: "lte";
140
- eq: "eq";
141
- neq: "neq";
142
- }>;
143
- left: typeof import("trilean").ExpressionNodeSchema;
144
- right: typeof import("trilean").ExpressionNodeSchema;
145
- }, z.core.$strip>, z.ZodObject<{
146
- kind: z.ZodLiteral<"textCompare">;
147
- op: z.ZodEnum<{
148
- equals: "equals";
149
- notEquals: "notEquals";
150
- matches: "matches";
151
- notMatches: "notMatches";
152
- portableMatches: "portableMatches";
153
- portableNotMatches: "portableNotMatches";
154
- }>;
155
- left: typeof import("trilean").ExpressionNodeSchema;
156
- right: typeof import("trilean").ExpressionNodeSchema;
157
- }, z.core.$strip>, z.ZodObject<{
158
- kind: z.ZodLiteral<"memberOf">;
159
- op: z.ZodEnum<{
160
- in: "in";
161
- notIn: "notIn";
162
- }>;
163
- operand: typeof import("trilean").ExpressionNodeSchema;
164
- candidates: z.ZodArray<typeof import("trilean").ExpressionNodeSchema>;
165
- }, z.core.$strip>, z.ZodObject<{
166
- kind: z.ZodLiteral<"exists">;
167
- operand: typeof import("trilean").ExpressionNodeSchema;
168
- }, z.core.$strip>, z.ZodObject<{
169
- kind: z.ZodLiteral<"some">;
170
- collection: z.ZodType<import("trilean").JsonValue, unknown, z.core.$ZodTypeInternals<import("trilean").JsonValue, unknown>>;
171
- item: typeof import("trilean").PredicateNodeSchema;
172
- filter: z.ZodOptional<typeof import("trilean").PredicateNodeSchema>;
173
- }, z.core.$strip>, z.ZodObject<{
174
- kind: z.ZodLiteral<"every">;
175
- collection: z.ZodType<import("trilean").JsonValue, unknown, z.core.$ZodTypeInternals<import("trilean").JsonValue, unknown>>;
176
- item: typeof import("trilean").PredicateNodeSchema;
177
- filter: z.ZodOptional<typeof import("trilean").PredicateNodeSchema>;
178
- }, z.core.$strip>, z.ZodObject<{
179
- kind: z.ZodLiteral<"treeReference">;
180
- key: z.ZodType<import("trilean").JsonValue, unknown, z.core.$ZodTypeInternals<import("trilean").JsonValue, unknown>>;
181
- }, z.core.$strip>], "kind">>;
182
- effect: z.ZodExactOptional<z.ZodString>;
183
- }, z.core.$strict>>>>;
184
- fragments: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
185
- id: z.ZodString;
186
- operator: z.ZodEnum<{
187
- alt: "alt";
188
- opt: "opt";
189
- loop: "loop";
190
- par: "par";
191
- break: "break";
192
- }>;
193
- operands: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
194
- guard: z.ZodExactOptional<z.ZodString>;
195
- body: z.ZodReadonly<z.ZodArray<z.ZodString>>;
196
- }, z.core.$strict>>>>;
197
- }, z.core.$strict>>>>;
198
- projections: z.ZodReadonly<z.ZodArray<z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
199
- id: z.ZodString;
200
- notation: z.ZodEnum<{
201
- flowchart: "flowchart";
202
- swimlane: "swimlane";
203
- }>;
204
- }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
205
- id: z.ZodString;
206
- notation: z.ZodLiteral<"stateMachine">;
207
- subject: z.ZodString;
208
- }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
209
- id: z.ZodString;
210
- notation: z.ZodLiteral<"sequence">;
211
- scenario: z.ZodReadonly<z.ZodArray<z.ZodString>>;
212
- }, z.core.$strict>>]>>>;
213
- views: z.ZodExactOptional<z.ZodReadonly<z.ZodRecord<z.ZodEnum<{
214
- flowchart: "flowchart";
215
- swimlane: "swimlane";
216
- stateMachine: "stateMachine";
217
- sequence: "sequence";
218
- }> & z.core.$partial, z.ZodReadonly<z.ZodRecord<z.ZodString & z.core.$partial, z.ZodReadonly<z.ZodObject<{
219
- x: z.ZodNumber;
220
- y: z.ZodNumber;
221
- }, z.core.$strict>>>>>>>;
222
- }, z.core.$strict>>;
34
+ model: ModelSchema;
223
35
  }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
224
36
  revision: z.ZodInt;
225
37
  }, z.core.$strict>>, Omit<{
@@ -245,201 +57,44 @@ declare const graphStoreContract: {
245
57
  }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
246
58
  modelId: z.ZodString;
247
59
  revision: z.ZodInt;
248
- model: z.ZodReadonly<z.ZodObject<{
249
- participants: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
250
- id: z.ZodString;
251
- label: z.ZodString;
252
- kind: z.ZodEnum<{
253
- role: "role";
254
- system: "system";
255
- entity: "entity";
256
- }>;
257
- }, z.core.$strict>>>>;
258
- events: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
259
- id: z.ZodString;
260
- name: z.ZodString;
261
- payload: z.ZodExactOptional<z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodString>>>;
262
- }, z.core.$strict>>>>;
263
- actions: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
264
- id: z.ZodString;
265
- name: z.ZodString;
266
- }, z.core.$strict>>>>;
267
- artefacts: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
268
- id: z.ZodString;
269
- name: z.ZodString;
270
- deliverable: z.ZodExactOptional<z.ZodBoolean>;
271
- }, z.core.$strict>>>>;
272
- elements: z.ZodReadonly<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
273
- kind: z.ZodLiteral<"activity">;
274
- id: z.ZodString;
275
- extensions: z.ZodExactOptional<z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodType<import("trilean").JsonValue, unknown, z.core.$ZodTypeInternals<import("trilean").JsonValue, unknown>>>>>;
276
- label: z.ZodString;
277
- actor: z.ZodExactOptional<z.ZodString>;
278
- action: z.ZodExactOptional<z.ZodString>;
279
- source: z.ZodExactOptional<z.ZodString>;
280
- affects: z.ZodExactOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
281
- consumes: z.ZodExactOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
282
- produces: z.ZodExactOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
283
- }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
284
- kind: z.ZodLiteral<"decision">;
285
- id: z.ZodString;
286
- extensions: z.ZodExactOptional<z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodType<import("trilean").JsonValue, unknown, z.core.$ZodTypeInternals<import("trilean").JsonValue, unknown>>>>>;
287
- label: z.ZodString;
288
- actor: z.ZodExactOptional<z.ZodString>;
289
- }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
290
- kind: z.ZodLiteral<"state">;
291
- id: z.ZodString;
292
- extensions: z.ZodExactOptional<z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodType<import("trilean").JsonValue, unknown, z.core.$ZodTypeInternals<import("trilean").JsonValue, unknown>>>>>;
293
- label: z.ZodString;
294
- parent: z.ZodExactOptional<z.ZodString>;
295
- entry: z.ZodExactOptional<z.ZodString>;
296
- exit: z.ZodExactOptional<z.ZodString>;
297
- }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
298
- kind: z.ZodLiteral<"pseudo">;
299
- id: z.ZodString;
300
- extensions: z.ZodExactOptional<z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodType<import("trilean").JsonValue, unknown, z.core.$ZodTypeInternals<import("trilean").JsonValue, unknown>>>>>;
301
- role: z.ZodEnum<{
302
- initial: "initial";
303
- final: "final";
304
- fork: "fork";
305
- join: "join";
306
- history: "history";
307
- }>;
308
- parent: z.ZodExactOptional<z.ZodString>;
309
- }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
310
- kind: z.ZodLiteral<"message">;
311
- id: z.ZodString;
312
- extensions: z.ZodExactOptional<z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodType<import("trilean").JsonValue, unknown, z.core.$ZodTypeInternals<import("trilean").JsonValue, unknown>>>>>;
313
- label: z.ZodString;
314
- from: z.ZodString;
315
- to: z.ZodString;
316
- mode: z.ZodEnum<{
317
- sync: "sync";
318
- async: "async";
319
- reply: "reply";
320
- create: "create";
321
- destroy: "destroy";
322
- }>;
323
- event: z.ZodExactOptional<z.ZodString>;
324
- }, z.core.$strict>>], "kind">>>;
325
- transitions: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
326
- id: z.ZodString;
327
- source: z.ZodString;
328
- target: z.ZodString;
329
- trigger: z.ZodExactOptional<z.ZodString>;
330
- guard: z.ZodExactOptional<z.ZodString>;
331
- condition: z.ZodExactOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
332
- kind: z.ZodLiteral<"not">;
333
- operand: typeof import("trilean").PredicateNodeSchema;
334
- }, z.core.$strip>, z.ZodObject<{
335
- kind: z.ZodLiteral<"and">;
336
- left: typeof import("trilean").PredicateNodeSchema;
337
- right: typeof import("trilean").PredicateNodeSchema;
338
- }, z.core.$strip>, z.ZodObject<{
339
- kind: z.ZodLiteral<"or">;
340
- left: typeof import("trilean").PredicateNodeSchema;
341
- right: typeof import("trilean").PredicateNodeSchema;
342
- }, z.core.$strip>, z.ZodObject<{
343
- kind: z.ZodLiteral<"allOf">;
344
- operands: z.ZodArray<typeof import("trilean").PredicateNodeSchema>;
345
- }, z.core.$strip>, z.ZodObject<{
346
- kind: z.ZodLiteral<"anyOf">;
347
- operands: z.ZodArray<typeof import("trilean").PredicateNodeSchema>;
348
- }, z.core.$strip>, z.ZodObject<{
349
- kind: z.ZodLiteral<"compare">;
350
- op: z.ZodEnum<{
351
- gt: "gt";
352
- gte: "gte";
353
- lt: "lt";
354
- lte: "lte";
355
- eq: "eq";
356
- neq: "neq";
357
- }>;
358
- left: typeof import("trilean").ExpressionNodeSchema;
359
- right: typeof import("trilean").ExpressionNodeSchema;
360
- }, z.core.$strip>, z.ZodObject<{
361
- kind: z.ZodLiteral<"textCompare">;
362
- op: z.ZodEnum<{
363
- equals: "equals";
364
- notEquals: "notEquals";
365
- matches: "matches";
366
- notMatches: "notMatches";
367
- portableMatches: "portableMatches";
368
- portableNotMatches: "portableNotMatches";
369
- }>;
370
- left: typeof import("trilean").ExpressionNodeSchema;
371
- right: typeof import("trilean").ExpressionNodeSchema;
372
- }, z.core.$strip>, z.ZodObject<{
373
- kind: z.ZodLiteral<"memberOf">;
374
- op: z.ZodEnum<{
375
- in: "in";
376
- notIn: "notIn";
377
- }>;
378
- operand: typeof import("trilean").ExpressionNodeSchema;
379
- candidates: z.ZodArray<typeof import("trilean").ExpressionNodeSchema>;
380
- }, z.core.$strip>, z.ZodObject<{
381
- kind: z.ZodLiteral<"exists">;
382
- operand: typeof import("trilean").ExpressionNodeSchema;
383
- }, z.core.$strip>, z.ZodObject<{
384
- kind: z.ZodLiteral<"some">;
385
- collection: z.ZodType<import("trilean").JsonValue, unknown, z.core.$ZodTypeInternals<import("trilean").JsonValue, unknown>>;
386
- item: typeof import("trilean").PredicateNodeSchema;
387
- filter: z.ZodOptional<typeof import("trilean").PredicateNodeSchema>;
388
- }, z.core.$strip>, z.ZodObject<{
389
- kind: z.ZodLiteral<"every">;
390
- collection: z.ZodType<import("trilean").JsonValue, unknown, z.core.$ZodTypeInternals<import("trilean").JsonValue, unknown>>;
391
- item: typeof import("trilean").PredicateNodeSchema;
392
- filter: z.ZodOptional<typeof import("trilean").PredicateNodeSchema>;
393
- }, z.core.$strip>, z.ZodObject<{
394
- kind: z.ZodLiteral<"treeReference">;
395
- key: z.ZodType<import("trilean").JsonValue, unknown, z.core.$ZodTypeInternals<import("trilean").JsonValue, unknown>>;
396
- }, z.core.$strip>], "kind">>;
397
- effect: z.ZodExactOptional<z.ZodString>;
398
- }, z.core.$strict>>>>;
399
- fragments: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
400
- id: z.ZodString;
401
- operator: z.ZodEnum<{
402
- alt: "alt";
403
- opt: "opt";
404
- loop: "loop";
405
- par: "par";
406
- break: "break";
407
- }>;
408
- operands: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
409
- guard: z.ZodExactOptional<z.ZodString>;
410
- body: z.ZodReadonly<z.ZodArray<z.ZodString>>;
411
- }, z.core.$strict>>>>;
412
- }, z.core.$strict>>>>;
413
- projections: z.ZodReadonly<z.ZodArray<z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
414
- id: z.ZodString;
415
- notation: z.ZodEnum<{
416
- flowchart: "flowchart";
417
- swimlane: "swimlane";
418
- }>;
419
- }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
420
- id: z.ZodString;
421
- notation: z.ZodLiteral<"stateMachine">;
422
- subject: z.ZodString;
423
- }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
424
- id: z.ZodString;
425
- notation: z.ZodLiteral<"sequence">;
426
- scenario: z.ZodReadonly<z.ZodArray<z.ZodString>>;
427
- }, z.core.$strict>>]>>>;
428
- views: z.ZodExactOptional<z.ZodReadonly<z.ZodRecord<z.ZodEnum<{
429
- flowchart: "flowchart";
430
- swimlane: "swimlane";
431
- stateMachine: "stateMachine";
432
- sequence: "sequence";
433
- }> & z.core.$partial, z.ZodReadonly<z.ZodRecord<z.ZodString & z.core.$partial, z.ZodReadonly<z.ZodObject<{
434
- x: z.ZodNumber;
435
- y: z.ZodNumber;
436
- }, z.core.$strict>>>>>>>;
437
- }, z.core.$strict>>;
60
+ model: ModelSchema;
438
61
  overlay: z.ZodReadonly<z.ZodRecord<z.ZodString & z.core.$partial, z.ZodEnum<{
439
62
  done: "done";
440
63
  open: "open";
441
64
  unknown: "unknown";
442
65
  }>>>;
66
+ facts: z.ZodReadonly<z.ZodObject<{
67
+ artefacts: z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
68
+ values: z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
69
+ kind: z.ZodLiteral<"number">;
70
+ value: z.ZodNumber;
71
+ unit: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
72
+ }, z.core.$strip>, z.ZodObject<{
73
+ kind: z.ZodLiteral<"text">;
74
+ value: z.ZodString;
75
+ }, z.core.$strip>, z.ZodObject<{
76
+ kind: z.ZodLiteral<"boolean">;
77
+ value: z.ZodBoolean;
78
+ }, z.core.$strip>, z.ZodObject<{
79
+ kind: z.ZodLiteral<"instant">;
80
+ value: z.ZodString;
81
+ }, z.core.$strip>, z.ZodObject<{
82
+ kind: z.ZodLiteral<"duration">;
83
+ value: z.ZodNumber;
84
+ unit: z.ZodEnum<{
85
+ ms: "ms";
86
+ s: "s";
87
+ min: "min";
88
+ h: "h";
89
+ d: "d";
90
+ }>;
91
+ }, z.core.$strip>, z.ZodObject<{
92
+ kind: z.ZodLiteral<"complex">;
93
+ re: z.ZodNumber;
94
+ im: z.ZodNumber;
95
+ unit: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
96
+ }, z.core.$strip>], "kind">>>;
97
+ }, z.core.$strict>>;
443
98
  }, z.core.$strict>>, Omit<{
444
99
  NOT_FOUND: {
445
100
  message: string;
@@ -513,6 +168,145 @@ declare const graphStoreContract: {
513
168
  };
514
169
  }, never> & object>;
515
170
  };
171
+ facts: {
172
+ read: import("@orpc/contract").ProcedureContract<z.ZodReadonly<z.ZodObject<{
173
+ modelId: z.ZodString;
174
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
175
+ modelId: z.ZodString;
176
+ revision: z.ZodInt;
177
+ facts: z.ZodReadonly<z.ZodObject<{
178
+ artefacts: z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
179
+ values: z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
180
+ kind: z.ZodLiteral<"number">;
181
+ value: z.ZodNumber;
182
+ unit: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
183
+ }, z.core.$strip>, z.ZodObject<{
184
+ kind: z.ZodLiteral<"text">;
185
+ value: z.ZodString;
186
+ }, z.core.$strip>, z.ZodObject<{
187
+ kind: z.ZodLiteral<"boolean">;
188
+ value: z.ZodBoolean;
189
+ }, z.core.$strip>, z.ZodObject<{
190
+ kind: z.ZodLiteral<"instant">;
191
+ value: z.ZodString;
192
+ }, z.core.$strip>, z.ZodObject<{
193
+ kind: z.ZodLiteral<"duration">;
194
+ value: z.ZodNumber;
195
+ unit: z.ZodEnum<{
196
+ ms: "ms";
197
+ s: "s";
198
+ min: "min";
199
+ h: "h";
200
+ d: "d";
201
+ }>;
202
+ }, z.core.$strip>, z.ZodObject<{
203
+ kind: z.ZodLiteral<"complex">;
204
+ re: z.ZodNumber;
205
+ im: z.ZodNumber;
206
+ unit: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
207
+ }, z.core.$strip>], "kind">>>;
208
+ }, z.core.$strict>>;
209
+ }, z.core.$strict>>, Omit<{
210
+ NOT_FOUND: {
211
+ message: string;
212
+ data: z.ZodObject<{
213
+ modelId: z.ZodString;
214
+ element: z.ZodExactOptional<z.ZodString>;
215
+ }, z.core.$strict>;
216
+ };
217
+ UNPROCESSABLE_CONTENT: {
218
+ message: string;
219
+ data: z.ZodObject<{
220
+ issues: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
221
+ code: z.ZodString;
222
+ message: z.ZodString;
223
+ }, z.core.$strict>>>>;
224
+ }, z.core.$strict>;
225
+ };
226
+ }, never> & object>;
227
+ set: import("@orpc/contract").ProcedureContract<z.ZodReadonly<z.ZodObject<{
228
+ modelId: z.ZodString;
229
+ facts: z.ZodReadonly<z.ZodObject<{
230
+ artefacts: z.ZodExactOptional<z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodBoolean>>>;
231
+ values: z.ZodExactOptional<z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
232
+ kind: z.ZodLiteral<"number">;
233
+ value: z.ZodNumber;
234
+ unit: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
235
+ }, z.core.$strip>, z.ZodObject<{
236
+ kind: z.ZodLiteral<"text">;
237
+ value: z.ZodString;
238
+ }, z.core.$strip>, z.ZodObject<{
239
+ kind: z.ZodLiteral<"boolean">;
240
+ value: z.ZodBoolean;
241
+ }, z.core.$strip>, z.ZodObject<{
242
+ kind: z.ZodLiteral<"instant">;
243
+ value: z.ZodString;
244
+ }, z.core.$strip>, z.ZodObject<{
245
+ kind: z.ZodLiteral<"duration">;
246
+ value: z.ZodNumber;
247
+ unit: z.ZodEnum<{
248
+ ms: "ms";
249
+ s: "s";
250
+ min: "min";
251
+ h: "h";
252
+ d: "d";
253
+ }>;
254
+ }, z.core.$strip>, z.ZodObject<{
255
+ kind: z.ZodLiteral<"complex">;
256
+ re: z.ZodNumber;
257
+ im: z.ZodNumber;
258
+ unit: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
259
+ }, z.core.$strip>], "kind">>>>;
260
+ }, z.core.$strict>>;
261
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
262
+ revision: z.ZodInt;
263
+ }, z.core.$strict>>, Omit<{
264
+ NOT_FOUND: {
265
+ message: string;
266
+ data: z.ZodObject<{
267
+ modelId: z.ZodString;
268
+ element: z.ZodExactOptional<z.ZodString>;
269
+ }, z.core.$strict>;
270
+ };
271
+ UNPROCESSABLE_CONTENT: {
272
+ message: string;
273
+ data: z.ZodObject<{
274
+ issues: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
275
+ code: z.ZodString;
276
+ message: z.ZodString;
277
+ }, z.core.$strict>>>>;
278
+ }, z.core.$strict>;
279
+ };
280
+ }, never> & object>;
281
+ clear: import("@orpc/contract").ProcedureContract<z.ZodReadonly<z.ZodObject<{
282
+ modelId: z.ZodString;
283
+ facts: z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
284
+ artefacts: z.ZodExactOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
285
+ values: z.ZodExactOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
286
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
287
+ all: z.ZodLiteral<true>;
288
+ }, z.core.$strict>>]>;
289
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
290
+ revision: z.ZodInt;
291
+ }, z.core.$strict>>, Omit<{
292
+ NOT_FOUND: {
293
+ message: string;
294
+ data: z.ZodObject<{
295
+ modelId: z.ZodString;
296
+ element: z.ZodExactOptional<z.ZodString>;
297
+ }, z.core.$strict>;
298
+ };
299
+ UNPROCESSABLE_CONTENT: {
300
+ message: string;
301
+ data: z.ZodObject<{
302
+ issues: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
303
+ code: z.ZodString;
304
+ message: z.ZodString;
305
+ }, z.core.$strict>>>>;
306
+ }, z.core.$strict>;
307
+ };
308
+ }, never> & object>;
309
+ };
516
310
  items: {
517
311
  upsert: import("@orpc/contract").ProcedureContract<z.ZodReadonly<z.ZodObject<{
518
312
  modelId: z.ZodString;
@@ -836,14 +630,14 @@ declare const graphStoreContract: {
836
630
  since: z.ZodExactOptional<z.ZodInt>;
837
631
  }, z.core.$strict>>, import("@orpc/contract").Schema<AsyncIteratorObject<Readonly<{
838
632
  modelId: string;
839
- kind: "overlay" | "saved" | "items" | "deleted";
633
+ kind: "overlay" | "facts" | "saved" | "items" | "deleted";
840
634
  revision: number;
841
635
  }> | Readonly<{
842
636
  modelId: string;
843
637
  kind: "missed";
844
638
  }>, unknown, void>, import("@orpc/server").AsyncIteratorClass<Readonly<{
845
639
  modelId: string;
846
- kind: "overlay" | "saved" | "items" | "deleted";
640
+ kind: "overlay" | "facts" | "saved" | "items" | "deleted";
847
641
  revision: number;
848
642
  }> | Readonly<{
849
643
  modelId: string;
@@ -1021,206 +815,167 @@ declare const boundItemsSchema: z.ZodReadonly<z.ZodObject<{
1021
815
  to: z.ZodString;
1022
816
  }, z.core.$strict>>>>>;
1023
817
  }, z.core.$strict>>;
1024
- /** One stored model and the run state laid over it, at the revision of its last change. */
818
+ /** The name of a fact a condition reads: the string key of its `reference` node. */
819
+ declare const factNameSchema: z.ZodString;
820
+ /**
821
+ * What is known from outside the process about one model's run, kept beside its overlay: which artefacts are provided (`true`) or known not to be (`false`), by artefact id, and the trilean value of each named fact, by name. What the record does not name is unknown. It is graph-domain's `FactRecord`, which `factsFrom` adapts to the `Facts` port the reasoning reads.
822
+ */
823
+ declare const factRecordSchema: z.ZodReadonly<z.ZodObject<{
824
+ artefacts: z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
825
+ values: z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
826
+ kind: z.ZodLiteral<"number">;
827
+ value: z.ZodNumber;
828
+ unit: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
829
+ }, z.core.$strip>, z.ZodObject<{
830
+ kind: z.ZodLiteral<"text">;
831
+ value: z.ZodString;
832
+ }, z.core.$strip>, z.ZodObject<{
833
+ kind: z.ZodLiteral<"boolean">;
834
+ value: z.ZodBoolean;
835
+ }, z.core.$strip>, z.ZodObject<{
836
+ kind: z.ZodLiteral<"instant">;
837
+ value: z.ZodString;
838
+ }, z.core.$strip>, z.ZodObject<{
839
+ kind: z.ZodLiteral<"duration">;
840
+ value: z.ZodNumber;
841
+ unit: z.ZodEnum<{
842
+ ms: "ms";
843
+ s: "s";
844
+ min: "min";
845
+ h: "h";
846
+ d: "d";
847
+ }>;
848
+ }, z.core.$strip>, z.ZodObject<{
849
+ kind: z.ZodLiteral<"complex">;
850
+ re: z.ZodNumber;
851
+ im: z.ZodNumber;
852
+ unit: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
853
+ }, z.core.$strip>], "kind">>>;
854
+ }, z.core.$strict>>;
855
+ /** One stored model, the run state laid over it and the facts known about its run, at the revision of its last change. */
1025
856
  declare const storedModelSchema: z.ZodReadonly<z.ZodObject<{
1026
857
  modelId: z.ZodString;
1027
858
  revision: z.ZodInt;
1028
- model: z.ZodReadonly<z.ZodObject<{
1029
- participants: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
1030
- id: z.ZodString;
1031
- label: z.ZodString;
1032
- kind: z.ZodEnum<{
1033
- role: "role";
1034
- system: "system";
1035
- entity: "entity";
1036
- }>;
1037
- }, z.core.$strict>>>>;
1038
- events: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
1039
- id: z.ZodString;
1040
- name: z.ZodString;
1041
- payload: z.ZodExactOptional<z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodString>>>;
1042
- }, z.core.$strict>>>>;
1043
- actions: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
1044
- id: z.ZodString;
1045
- name: z.ZodString;
1046
- }, z.core.$strict>>>>;
1047
- artefacts: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
1048
- id: z.ZodString;
1049
- name: z.ZodString;
1050
- deliverable: z.ZodExactOptional<z.ZodBoolean>;
1051
- }, z.core.$strict>>>>;
1052
- elements: z.ZodReadonly<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
1053
- kind: z.ZodLiteral<"activity">;
1054
- id: z.ZodString;
1055
- extensions: z.ZodExactOptional<z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodType<import("trilean").JsonValue, unknown, z.core.$ZodTypeInternals<import("trilean").JsonValue, unknown>>>>>;
1056
- label: z.ZodString;
1057
- actor: z.ZodExactOptional<z.ZodString>;
1058
- action: z.ZodExactOptional<z.ZodString>;
1059
- source: z.ZodExactOptional<z.ZodString>;
1060
- affects: z.ZodExactOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
1061
- consumes: z.ZodExactOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
1062
- produces: z.ZodExactOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
1063
- }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1064
- kind: z.ZodLiteral<"decision">;
1065
- id: z.ZodString;
1066
- extensions: z.ZodExactOptional<z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodType<import("trilean").JsonValue, unknown, z.core.$ZodTypeInternals<import("trilean").JsonValue, unknown>>>>>;
1067
- label: z.ZodString;
1068
- actor: z.ZodExactOptional<z.ZodString>;
1069
- }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1070
- kind: z.ZodLiteral<"state">;
1071
- id: z.ZodString;
1072
- extensions: z.ZodExactOptional<z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodType<import("trilean").JsonValue, unknown, z.core.$ZodTypeInternals<import("trilean").JsonValue, unknown>>>>>;
1073
- label: z.ZodString;
1074
- parent: z.ZodExactOptional<z.ZodString>;
1075
- entry: z.ZodExactOptional<z.ZodString>;
1076
- exit: z.ZodExactOptional<z.ZodString>;
1077
- }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1078
- kind: z.ZodLiteral<"pseudo">;
1079
- id: z.ZodString;
1080
- extensions: z.ZodExactOptional<z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodType<import("trilean").JsonValue, unknown, z.core.$ZodTypeInternals<import("trilean").JsonValue, unknown>>>>>;
1081
- role: z.ZodEnum<{
1082
- initial: "initial";
1083
- final: "final";
1084
- fork: "fork";
1085
- join: "join";
1086
- history: "history";
1087
- }>;
1088
- parent: z.ZodExactOptional<z.ZodString>;
1089
- }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1090
- kind: z.ZodLiteral<"message">;
1091
- id: z.ZodString;
1092
- extensions: z.ZodExactOptional<z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodType<import("trilean").JsonValue, unknown, z.core.$ZodTypeInternals<import("trilean").JsonValue, unknown>>>>>;
1093
- label: z.ZodString;
1094
- from: z.ZodString;
1095
- to: z.ZodString;
1096
- mode: z.ZodEnum<{
1097
- sync: "sync";
1098
- async: "async";
1099
- reply: "reply";
1100
- create: "create";
1101
- destroy: "destroy";
1102
- }>;
1103
- event: z.ZodExactOptional<z.ZodString>;
1104
- }, z.core.$strict>>], "kind">>>;
1105
- transitions: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
1106
- id: z.ZodString;
1107
- source: z.ZodString;
1108
- target: z.ZodString;
1109
- trigger: z.ZodExactOptional<z.ZodString>;
1110
- guard: z.ZodExactOptional<z.ZodString>;
1111
- condition: z.ZodExactOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
1112
- kind: z.ZodLiteral<"not">;
1113
- operand: typeof import("trilean").PredicateNodeSchema;
1114
- }, z.core.$strip>, z.ZodObject<{
1115
- kind: z.ZodLiteral<"and">;
1116
- left: typeof import("trilean").PredicateNodeSchema;
1117
- right: typeof import("trilean").PredicateNodeSchema;
1118
- }, z.core.$strip>, z.ZodObject<{
1119
- kind: z.ZodLiteral<"or">;
1120
- left: typeof import("trilean").PredicateNodeSchema;
1121
- right: typeof import("trilean").PredicateNodeSchema;
1122
- }, z.core.$strip>, z.ZodObject<{
1123
- kind: z.ZodLiteral<"allOf">;
1124
- operands: z.ZodArray<typeof import("trilean").PredicateNodeSchema>;
1125
- }, z.core.$strip>, z.ZodObject<{
1126
- kind: z.ZodLiteral<"anyOf">;
1127
- operands: z.ZodArray<typeof import("trilean").PredicateNodeSchema>;
1128
- }, z.core.$strip>, z.ZodObject<{
1129
- kind: z.ZodLiteral<"compare">;
1130
- op: z.ZodEnum<{
1131
- gt: "gt";
1132
- gte: "gte";
1133
- lt: "lt";
1134
- lte: "lte";
1135
- eq: "eq";
1136
- neq: "neq";
1137
- }>;
1138
- left: typeof import("trilean").ExpressionNodeSchema;
1139
- right: typeof import("trilean").ExpressionNodeSchema;
1140
- }, z.core.$strip>, z.ZodObject<{
1141
- kind: z.ZodLiteral<"textCompare">;
1142
- op: z.ZodEnum<{
1143
- equals: "equals";
1144
- notEquals: "notEquals";
1145
- matches: "matches";
1146
- notMatches: "notMatches";
1147
- portableMatches: "portableMatches";
1148
- portableNotMatches: "portableNotMatches";
1149
- }>;
1150
- left: typeof import("trilean").ExpressionNodeSchema;
1151
- right: typeof import("trilean").ExpressionNodeSchema;
1152
- }, z.core.$strip>, z.ZodObject<{
1153
- kind: z.ZodLiteral<"memberOf">;
1154
- op: z.ZodEnum<{
1155
- in: "in";
1156
- notIn: "notIn";
1157
- }>;
1158
- operand: typeof import("trilean").ExpressionNodeSchema;
1159
- candidates: z.ZodArray<typeof import("trilean").ExpressionNodeSchema>;
1160
- }, z.core.$strip>, z.ZodObject<{
1161
- kind: z.ZodLiteral<"exists">;
1162
- operand: typeof import("trilean").ExpressionNodeSchema;
1163
- }, z.core.$strip>, z.ZodObject<{
1164
- kind: z.ZodLiteral<"some">;
1165
- collection: z.ZodType<import("trilean").JsonValue, unknown, z.core.$ZodTypeInternals<import("trilean").JsonValue, unknown>>;
1166
- item: typeof import("trilean").PredicateNodeSchema;
1167
- filter: z.ZodOptional<typeof import("trilean").PredicateNodeSchema>;
1168
- }, z.core.$strip>, z.ZodObject<{
1169
- kind: z.ZodLiteral<"every">;
1170
- collection: z.ZodType<import("trilean").JsonValue, unknown, z.core.$ZodTypeInternals<import("trilean").JsonValue, unknown>>;
1171
- item: typeof import("trilean").PredicateNodeSchema;
1172
- filter: z.ZodOptional<typeof import("trilean").PredicateNodeSchema>;
1173
- }, z.core.$strip>, z.ZodObject<{
1174
- kind: z.ZodLiteral<"treeReference">;
1175
- key: z.ZodType<import("trilean").JsonValue, unknown, z.core.$ZodTypeInternals<import("trilean").JsonValue, unknown>>;
1176
- }, z.core.$strip>], "kind">>;
1177
- effect: z.ZodExactOptional<z.ZodString>;
1178
- }, z.core.$strict>>>>;
1179
- fragments: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
1180
- id: z.ZodString;
1181
- operator: z.ZodEnum<{
1182
- alt: "alt";
1183
- opt: "opt";
1184
- loop: "loop";
1185
- par: "par";
1186
- break: "break";
1187
- }>;
1188
- operands: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
1189
- guard: z.ZodExactOptional<z.ZodString>;
1190
- body: z.ZodReadonly<z.ZodArray<z.ZodString>>;
1191
- }, z.core.$strict>>>>;
1192
- }, z.core.$strict>>>>;
1193
- projections: z.ZodReadonly<z.ZodArray<z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
1194
- id: z.ZodString;
1195
- notation: z.ZodEnum<{
1196
- flowchart: "flowchart";
1197
- swimlane: "swimlane";
1198
- }>;
1199
- }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1200
- id: z.ZodString;
1201
- notation: z.ZodLiteral<"stateMachine">;
1202
- subject: z.ZodString;
1203
- }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
1204
- id: z.ZodString;
1205
- notation: z.ZodLiteral<"sequence">;
1206
- scenario: z.ZodReadonly<z.ZodArray<z.ZodString>>;
1207
- }, z.core.$strict>>]>>>;
1208
- views: z.ZodExactOptional<z.ZodReadonly<z.ZodRecord<z.ZodEnum<{
1209
- flowchart: "flowchart";
1210
- swimlane: "swimlane";
1211
- stateMachine: "stateMachine";
1212
- sequence: "sequence";
1213
- }> & z.core.$partial, z.ZodReadonly<z.ZodRecord<z.ZodString & z.core.$partial, z.ZodReadonly<z.ZodObject<{
1214
- x: z.ZodNumber;
1215
- y: z.ZodNumber;
1216
- }, z.core.$strict>>>>>>>;
1217
- }, z.core.$strict>>;
859
+ model: ModelSchema;
1218
860
  overlay: z.ZodReadonly<z.ZodRecord<z.ZodString & z.core.$partial, z.ZodEnum<{
1219
861
  done: "done";
1220
862
  open: "open";
1221
863
  unknown: "unknown";
1222
864
  }>>>;
865
+ facts: z.ZodReadonly<z.ZodObject<{
866
+ artefacts: z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
867
+ values: z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
868
+ kind: z.ZodLiteral<"number">;
869
+ value: z.ZodNumber;
870
+ unit: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
871
+ }, z.core.$strip>, z.ZodObject<{
872
+ kind: z.ZodLiteral<"text">;
873
+ value: z.ZodString;
874
+ }, z.core.$strip>, z.ZodObject<{
875
+ kind: z.ZodLiteral<"boolean">;
876
+ value: z.ZodBoolean;
877
+ }, z.core.$strip>, z.ZodObject<{
878
+ kind: z.ZodLiteral<"instant">;
879
+ value: z.ZodString;
880
+ }, z.core.$strip>, z.ZodObject<{
881
+ kind: z.ZodLiteral<"duration">;
882
+ value: z.ZodNumber;
883
+ unit: z.ZodEnum<{
884
+ ms: "ms";
885
+ s: "s";
886
+ min: "min";
887
+ h: "h";
888
+ d: "d";
889
+ }>;
890
+ }, z.core.$strip>, z.ZodObject<{
891
+ kind: z.ZodLiteral<"complex">;
892
+ re: z.ZodNumber;
893
+ im: z.ZodNumber;
894
+ unit: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
895
+ }, z.core.$strip>], "kind">>>;
896
+ }, z.core.$strict>>;
897
+ }, z.core.$strict>>;
898
+ /** A model's fact record at the revision of the model's last change. */
899
+ declare const storedFactsSchema: z.ZodReadonly<z.ZodObject<{
900
+ modelId: z.ZodString;
901
+ revision: z.ZodInt;
902
+ facts: z.ZodReadonly<z.ZodObject<{
903
+ artefacts: z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
904
+ values: z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
905
+ kind: z.ZodLiteral<"number">;
906
+ value: z.ZodNumber;
907
+ unit: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
908
+ }, z.core.$strip>, z.ZodObject<{
909
+ kind: z.ZodLiteral<"text">;
910
+ value: z.ZodString;
911
+ }, z.core.$strip>, z.ZodObject<{
912
+ kind: z.ZodLiteral<"boolean">;
913
+ value: z.ZodBoolean;
914
+ }, z.core.$strip>, z.ZodObject<{
915
+ kind: z.ZodLiteral<"instant">;
916
+ value: z.ZodString;
917
+ }, z.core.$strip>, z.ZodObject<{
918
+ kind: z.ZodLiteral<"duration">;
919
+ value: z.ZodNumber;
920
+ unit: z.ZodEnum<{
921
+ ms: "ms";
922
+ s: "s";
923
+ min: "min";
924
+ h: "h";
925
+ d: "d";
926
+ }>;
927
+ }, z.core.$strip>, z.ZodObject<{
928
+ kind: z.ZodLiteral<"complex">;
929
+ re: z.ZodNumber;
930
+ im: z.ZodNumber;
931
+ unit: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
932
+ }, z.core.$strip>], "kind">>>;
933
+ }, z.core.$strict>>;
934
+ }, z.core.$strict>>;
935
+ /**
936
+ * Facts to record for a model: each artefact's provision and each named fact's value replaces what the record held for it, and everything the change does not name is kept. Every artefact must be one the model declares.
937
+ */
938
+ declare const factChangeSchema: z.ZodReadonly<z.ZodObject<{
939
+ artefacts: z.ZodExactOptional<z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodBoolean>>>;
940
+ values: z.ZodExactOptional<z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
941
+ kind: z.ZodLiteral<"number">;
942
+ value: z.ZodNumber;
943
+ unit: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
944
+ }, z.core.$strip>, z.ZodObject<{
945
+ kind: z.ZodLiteral<"text">;
946
+ value: z.ZodString;
947
+ }, z.core.$strip>, z.ZodObject<{
948
+ kind: z.ZodLiteral<"boolean">;
949
+ value: z.ZodBoolean;
950
+ }, z.core.$strip>, z.ZodObject<{
951
+ kind: z.ZodLiteral<"instant">;
952
+ value: z.ZodString;
953
+ }, z.core.$strip>, z.ZodObject<{
954
+ kind: z.ZodLiteral<"duration">;
955
+ value: z.ZodNumber;
956
+ unit: z.ZodEnum<{
957
+ ms: "ms";
958
+ s: "s";
959
+ min: "min";
960
+ h: "h";
961
+ d: "d";
962
+ }>;
963
+ }, z.core.$strip>, z.ZodObject<{
964
+ kind: z.ZodLiteral<"complex">;
965
+ re: z.ZodNumber;
966
+ im: z.ZodNumber;
967
+ unit: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
968
+ }, z.core.$strip>], "kind">>>>;
1223
969
  }, z.core.$strict>>;
970
+ /**
971
+ * Facts to forget, so they are unknown again: either the named artefacts and named facts, or, with `all`, the whole record. A name the record does not hold is ignored.
972
+ */
973
+ declare const factClearingSchema: z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
974
+ artefacts: z.ZodExactOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
975
+ values: z.ZodExactOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
976
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
977
+ all: z.ZodLiteral<true>;
978
+ }, z.core.$strict>>]>;
1224
979
  /** A stored model's name and the revision of its last change. */
1225
980
  declare const modelSummarySchema: z.ZodReadonly<z.ZodObject<{
1226
981
  modelId: z.ZodString;
@@ -1232,7 +987,7 @@ declare const reachSchema: z.ZodReadonly<z.ZodObject<{
1232
987
  distance: z.ZodInt;
1233
988
  }, z.core.$strict>>;
1234
989
  /** The kinds of change a store reports. */
1235
- declare const changeKinds: readonly ["saved", "overlay", "items", "deleted"];
990
+ declare const changeKinds: readonly ["saved", "overlay", "items", "facts", "deleted"];
1236
991
  /**
1237
992
  * A change to a model. `revision` is the revision the change took. `missed` says the subscriber missed one or more changes and should load the model again: it is sent at the start of a subscription that names a revision the model is no longer at (the model changed, or has gone), and in place of the changes a subscriber that reads too slowly has let pile up beyond its subscription's capacity.
1238
993
  */
@@ -1240,6 +995,7 @@ declare const storeChangeSchema: z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<
1240
995
  modelId: z.ZodString;
1241
996
  kind: z.ZodEnum<{
1242
997
  overlay: "overlay";
998
+ facts: "facts";
1243
999
  saved: "saved";
1244
1000
  items: "items";
1245
1001
  deleted: "deleted";
@@ -1261,6 +1017,9 @@ type BoundItems = z.infer<typeof boundItemsSchema>;
1261
1017
  type Relation = z.infer<typeof relationSchema>;
1262
1018
  type RelationKind = (typeof relationKinds)[number];
1263
1019
  type StoredModel = z.infer<typeof storedModelSchema>;
1020
+ type StoredFacts = z.infer<typeof storedFactsSchema>;
1021
+ type FactChange = z.infer<typeof factChangeSchema>;
1022
+ type FactClearing = z.infer<typeof factClearingSchema>;
1264
1023
  type ModelSummary = z.infer<typeof modelSummarySchema>;
1265
1024
  type Reach = z.infer<typeof reachSchema>;
1266
1025
  type ChangeKind = (typeof changeKinds)[number];
@@ -1372,19 +1131,19 @@ interface GraphStore {
1372
1131
  readonly signal: AbortSignal | undefined;
1373
1132
  }) => Promise<readonly ModelSummary[]>;
1374
1133
  /**
1375
- * Stores a model under an id, replacing any model stored there and dropping the run state and relations of what the new model does not declare (see `relationsWithin`).
1134
+ * Stores a model under an id, replacing any model stored there and dropping the run state, relations and artefact facts of what the new model does not declare (see `overlayWithin`, `relationsWithin` and `factsWithin`).
1376
1135
  * @returns The revision the save took.
1377
1136
  */
1378
1137
  readonly saveModel: (request: ModelRequest & {
1379
1138
  readonly model: Model<OpenIds>;
1380
1139
  }) => Promise<Revision>;
1381
1140
  /**
1382
- * Reads a model back exactly as saved or merged, in its declared order, with its run state.
1383
- * @returns The model, its overlay and its revision.
1141
+ * Reads a model back exactly as saved or merged, in its declared order, with its run state and its fact record.
1142
+ * @returns The model, its overlay, its facts and its revision.
1384
1143
  */
1385
1144
  readonly loadModel: (request: ModelRequest) => Promise<StoredModel>;
1386
1145
  /**
1387
- * Removes a model, its run state and its relations.
1146
+ * Removes a model, its run state, its relations and its facts.
1388
1147
  * @returns The revision the deletion took, or `undefined` when there was no such model and nothing changed.
1389
1148
  */
1390
1149
  readonly deleteModel: (request: ModelRequest) => Promise<Revision | undefined>;
@@ -1395,6 +1154,25 @@ interface GraphStore {
1395
1154
  readonly applyOverlay: (request: ModelRequest & {
1396
1155
  readonly overlay: Overlay<OpenIds>;
1397
1156
  }) => Promise<Revision>;
1157
+ /**
1158
+ * A model's fact record.
1159
+ * @returns The record and the model's revision.
1160
+ */
1161
+ readonly readFacts: (request: ModelRequest) => Promise<StoredFacts>;
1162
+ /**
1163
+ * Records facts about a model's run (see `mergeFacts`). Every artefact named must be one the model declares (`factIssues`); otherwise nothing is written.
1164
+ * @returns The revision the change took.
1165
+ */
1166
+ readonly setFacts: (request: ModelRequest & {
1167
+ readonly facts: FactChange;
1168
+ }) => Promise<Revision>;
1169
+ /**
1170
+ * Forgets facts about a model's run, so what they named is unknown again (see `withoutFacts`).
1171
+ * @returns The revision the change took.
1172
+ */
1173
+ readonly clearFacts: (request: ModelRequest & {
1174
+ readonly facts: FactClearing;
1175
+ }) => Promise<Revision>;
1398
1176
  /**
1399
1177
  * Merges items read from a source into a model by id (see `mergeBoundItems`), and adds their relations (see `mergeRelations`), creating the model from an empty one when it does not exist. Every relation stored must name what the merged model declares (`relationIssues`); otherwise nothing is written.
1400
1178
  * @returns The revision the change took.
@@ -1473,6 +1251,36 @@ declare const overlayWithin: (model: Model<OpenIds>, overlay: Overlay<OpenIds>)
1473
1251
  */
1474
1252
  declare const checkStored: (model: Model<OpenIds>, overlay: Overlay<OpenIds>) => void;
1475
1253
  //#endregion
1254
+ //#region ../../core/graph/store-contract/dist/facts.d.ts
1255
+ /**
1256
+ * Keeps only the artefact entries of a record that name an artefact the model declares, so replacing a model drops what was known about artefacts it no longer has. Named facts belong to the run rather than to any record of the model, so they are all kept.
1257
+ * @param model - The model the record is for.
1258
+ * @param facts - The record to narrow.
1259
+ * @returns The record with its artefacts narrowed to the model's.
1260
+ */
1261
+ declare const factsWithin: (model: Model<OpenIds>, facts: FactRecord) => FactRecord;
1262
+ /**
1263
+ * Applies a change to a record: each artefact and named fact the change gives replaces what the record held for it, and the rest is kept. The result is not checked; see `factIssues`.
1264
+ * @param facts - The stored record.
1265
+ * @param change - The facts to record.
1266
+ * @returns The merged record.
1267
+ */
1268
+ declare const mergeFacts: (facts: FactRecord, change: FactChange) => FactRecord;
1269
+ /**
1270
+ * Forgets facts, so what they named is unknown again: the whole record with `all`, otherwise the named artefacts and named facts. A name the record does not hold is ignored.
1271
+ * @param facts - The stored record.
1272
+ * @param clearing - What to forget.
1273
+ * @returns The record without what was forgotten.
1274
+ */
1275
+ declare const withoutFacts: (facts: FactRecord, clearing: FactClearing) => FactRecord;
1276
+ /**
1277
+ * The issues with a change to a model's facts: an artefact the model does not declare is an `unknown-reference`, as an unknown reference anywhere else in a model is. Named facts are free names, since any `reference` key in a condition may read one.
1278
+ * @param model - The model the facts are for.
1279
+ * @param change - The facts to record.
1280
+ * @returns One issue per undeclared artefact, empty when every artefact resolves.
1281
+ */
1282
+ declare const factIssues: (model: Model<OpenIds>, change: FactChange) => readonly Issue[];
1283
+ //#endregion
1476
1284
  //#region ../../core/graph/store-contract/dist/hierarchy.d.ts
1477
1285
  /**
1478
1286
  * Adds relations to a stored list: one already there is kept in its place, and a new one is appended in its incoming order, each distinct relation once.
@@ -1579,4 +1387,4 @@ type GraphStoreRouter = ContractedRouter<typeof graphStoreContract, object>;
1579
1387
  */
1580
1388
  declare const createFakeGraphStore: () => GraphStore;
1581
1389
  //#endregion
1582
- export { graphStoreContract as $, BoundItems as A, boundActivitySchema as B, ChangeFeedOptions as C, GraphStoreError as D, defaultSubscriptionCapacity as E, Relation as F, modelSummarySchema as G, changeKinds as H, RelationKind as I, relationSchema as J, reachSchema as K, Revision as L, ModelId as M, ModelSummary as N, GraphStoreFailure as O, Reach as P, GraphStoreClient as Q, StoreChange as R, ChangeFeed as S, SubscribeOptions as T, issueSchema as U, boundItemsSchema as V, modelIdSchema as W, storeChangeSchema as X, revisionSchema as Y, storedModelSchema as Z, mergeBoundItems as _, blockedChainOf as a, GraphStore as b, structureOf as c, descendantsOf as d, mergeRelations as f, emptyModel as g, checkStored as h, Structure as i, ChangeKind as j, BoundActivity as k, ancestorsOf as l, relationsWithin as m, GraphStoreRouter as n, impactOf as o, relationIssues as p, relationKinds as q, createGraphStoreRouter as r, readyOf as s, createFakeGraphStore as t, childrenOf as u, overlayWithin as v, ChangeSubscription as w, ModelRequest as x, ElementRequest as y, StoredModel as z };
1390
+ export { factRecordSchema as $, defaultSubscriptionCapacity as A, Reach as B, ElementRequest as C, ChangeFeedOptions as D, ChangeFeed as E, ChangeKind as F, StoredFacts as G, RelationKind as H, FactChange as I, boundItemsSchema as J, StoredModel as K, FactClearing as L, GraphStoreFailure as M, BoundActivity as N, ChangeSubscription as O, BoundItems as P, factNameSchema as Q, ModelId as R, overlayWithin as S, ModelRequest as T, Revision as U, Relation as V, StoreChange as W, factChangeSchema as X, changeKinds as Y, factClearingSchema as Z, mergeFacts as _, blockedChainOf as a, relationSchema as at, emptyModel as b, structureOf as c, storedFactsSchema as ct, descendantsOf as d, graphStoreContract as dt, issueSchema as et, mergeRelations as f, factsWithin as g, factIssues as h, Structure as i, relationKinds as it, GraphStoreError as j, SubscribeOptions as k, ancestorsOf as l, storedModelSchema as lt, relationsWithin as m, GraphStoreRouter as n, modelSummarySchema as nt, impactOf as o, revisionSchema as ot, relationIssues as p, boundActivitySchema as q, createGraphStoreRouter as r, reachSchema as rt, readyOf as s, storeChangeSchema as st, createFakeGraphStore as t, modelIdSchema as tt, childrenOf as u, GraphStoreClient as ut, withoutFacts as v, GraphStore as w, mergeBoundItems as x, checkStored as y, ModelSummary as z };