@ldclabs/kip-lang 0.4.0 → 2.0.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 (54) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/LICENSE +21 -0
  3. package/README.md +89 -64
  4. package/dist/ast.d.ts +511 -145
  5. package/dist/ast.d.ts.map +1 -1
  6. package/dist/diagnostics.d.ts +8 -2
  7. package/dist/diagnostics.d.ts.map +1 -1
  8. package/dist/diagnostics.js +32 -3
  9. package/dist/diagnostics.js.map +1 -1
  10. package/dist/exec-ast.d.ts +514 -149
  11. package/dist/exec-ast.d.ts.map +1 -1
  12. package/dist/exec-ast.js +8 -7
  13. package/dist/exec-ast.js.map +1 -1
  14. package/dist/formatter.d.ts.map +1 -1
  15. package/dist/formatter.js +870 -479
  16. package/dist/formatter.js.map +1 -1
  17. package/dist/index.d.ts +4 -4
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +2 -2
  20. package/dist/index.js.map +1 -1
  21. package/dist/lexer.d.ts.map +1 -1
  22. package/dist/lexer.js +12 -30
  23. package/dist/lexer.js.map +1 -1
  24. package/dist/lower.d.ts +1 -2
  25. package/dist/lower.d.ts.map +1 -1
  26. package/dist/lower.js +1287 -598
  27. package/dist/lower.js.map +1 -1
  28. package/dist/parser.d.ts.map +1 -1
  29. package/dist/parser.js +2410 -1300
  30. package/dist/parser.js.map +1 -1
  31. package/dist/semantics.d.ts +11 -7
  32. package/dist/semantics.d.ts.map +1 -1
  33. package/dist/semantics.js +295 -180
  34. package/dist/semantics.js.map +1 -1
  35. package/dist/token.d.ts +130 -40
  36. package/dist/token.d.ts.map +1 -1
  37. package/dist/token.js +264 -83
  38. package/dist/token.js.map +1 -1
  39. package/dist/version.d.ts +2 -2
  40. package/dist/version.js +2 -2
  41. package/package.json +35 -5
  42. package/src/ast.ts +914 -0
  43. package/src/budget.ts +108 -0
  44. package/src/diagnostics.ts +182 -0
  45. package/src/errors.ts +42 -0
  46. package/src/exec-ast.ts +614 -0
  47. package/src/formatter.ts +1339 -0
  48. package/src/index.ts +226 -0
  49. package/src/lexer.ts +459 -0
  50. package/src/lower.ts +2011 -0
  51. package/src/parser.ts +3506 -0
  52. package/src/semantics.ts +392 -0
  53. package/src/token.ts +408 -0
  54. package/src/version.ts +13 -0
@@ -0,0 +1,614 @@
1
+ /**
2
+ * The *executable* KIP 2.0 AST.
3
+ *
4
+ * This is a different tree from `ast.ts`, on purpose. `ast.ts` is a syntax
5
+ * tree: it keeps ranges, comments, quoting style and raw number text, because
6
+ * a formatter and an editor need to reproduce the source. This tree is what an
7
+ * engine needs instead — every construct already collapsed to the one shape it
8
+ * means, with the open-ended parts of the grammar closed:
9
+ *
10
+ * - a predicate is an atom or a path, not a nested alternation/quantifier tree;
11
+ * - a filter is a comparison, a logical node, a negation, or a call to one of
12
+ * the registered functions, not a general expression tree;
13
+ * - a variable is a name and a path of steps, not a chain of member accesses;
14
+ * - `ASSERT` is gone: it has been desugared to the parts it is defined as.
15
+ *
16
+ * A consumer switching on these tags is total: there is no "some other
17
+ * function name" case to defend against, because `lower` rejected it.
18
+ *
19
+ * The shape follows serde's default externally-tagged enum encoding, so a
20
+ * Rust engine can consume it directly and a differential test can compare the
21
+ * two field for field.
22
+ */
23
+
24
+ /**
25
+ * A `data_value`: a value that may still contain unbound parameters.
26
+ *
27
+ * The grammar admits `parameter` at every depth of an array or object, so no
28
+ * assignment, option block or epistemic setting is plain JSON. A subtree with
29
+ * nothing left to bind collapses to `Value`; anything else keeps its shape so
30
+ * the runtime envelope can fill the holes without touching text.
31
+ */
32
+ export type BoundValue =
33
+ | { Value: KipValue }
34
+ | { Param: string }
35
+ | { Handle: string }
36
+ | { Variable: DotPathVar }
37
+ | { Array: BoundValue[] }
38
+ | { Object: [string, BoundValue][] }
39
+
40
+ /**
41
+ * A KIP literal. Externally tagged; `Null` is a bare string.
42
+ *
43
+ * Arrays and objects are not baseline Core Literals (Spec §9.2); they appear
44
+ * here only as the option/assignment payloads that the grammar admits.
45
+ */
46
+ export type KipValue =
47
+ | 'Null'
48
+ | { Bool: boolean }
49
+ | { Number: number }
50
+ | { String: string }
51
+ | { Array: KipValue[] }
52
+ | { Object: Record<string, KipValue> }
53
+
54
+ /**
55
+ * A value slot the grammar spells `parameter | literal`.
56
+ *
57
+ * KIP 2.0 parameters are structurally bound data, never string-spliced, so an
58
+ * unbound `:name` survives lowering as a `Param` for the runtime envelope to
59
+ * fill — it is not an error and never becomes text.
60
+ */
61
+ export type Scalar = { Literal: KipValue } | { Param: string }
62
+
63
+ /** A schema symbol: `string_literal | parameter`. */
64
+ export type SymbolRef = { Name: string } | { Param: string }
65
+
66
+ /** A mutation target: `variable | parameter | string_literal`. */
67
+ export type ElementRef =
68
+ | { Handle: string }
69
+ | { Param: string }
70
+ | { Id: string }
71
+
72
+ /** One parsed command. */
73
+ export type Command =
74
+ | { Kql: KqlQuery }
75
+ | { Kml: KmlStatement }
76
+ | { Meta: MetaCommand }
77
+
78
+ // ---------------------------------------------------------------------------
79
+ // Shared terms
80
+ // ---------------------------------------------------------------------------
81
+
82
+ /** `?var` plus a resolved path, e.g. `?x.facets["MnemonicState"].salience`. */
83
+ export interface DotPathVar {
84
+ var: string
85
+ path: PathStep[]
86
+ }
87
+
88
+ /** A dot step names a field; an index step keys into a map-valued field. */
89
+ export type PathStep = { Field: string } | { Key: string }
90
+
91
+ /** `predicate_atom` — the exact predicate slot. */
92
+ export type PredAtom =
93
+ | { Variable: string }
94
+ | { Literal: string }
95
+ | { Param: string }
96
+
97
+ export interface HopRange {
98
+ min: number
99
+ /** `null` means unbounded. */
100
+ max: number | null
101
+ }
102
+
103
+ export interface PredPathAtom {
104
+ predicate: PredAtom
105
+ hops: HopRange | null
106
+ }
107
+
108
+ /**
109
+ * `Atom` is the plain predicate every language accepts. `Path` carries the
110
+ * KQL-only traversal forms — alternation and hop quantifiers — which never
111
+ * propagate belief and are rejected in KML and EXPORT selections.
112
+ */
113
+ export type PredTerm = { Atom: PredAtom } | { Path: PredPathAtom[] }
114
+
115
+ /** One endpoint of a tuple. A term may itself be a tuple: KIP states things about statements. */
116
+ export type Term =
117
+ | { Variable: string }
118
+ | { Param: string }
119
+ | { Literal: KipValue }
120
+ | { Match: ObjectMatcher }
121
+ | { Proposition: PropositionMatcher }
122
+
123
+ /**
124
+ * `object_pattern` — an open, schema-validated field map.
125
+ *
126
+ * Unlike KIP 1.x, v2 does not close this to a fixed set of identity forms:
127
+ * which fields identify an element is Schema's decision, not the grammar's.
128
+ */
129
+ export type ObjectMatcher = Record<string, MatchValue>
130
+
131
+ export type MatchValue =
132
+ | { Variable: string }
133
+ | { Param: string }
134
+ | { Literal: KipValue }
135
+ | { Array: MatchValue[] }
136
+ | { Match: ObjectMatcher }
137
+ | { Proposition: PropositionMatcher }
138
+
139
+ export interface PropositionTriple {
140
+ subject: Term
141
+ predicate: PredTerm
142
+ object: Term
143
+ }
144
+
145
+ /**
146
+ * The Proposition expression slot (Spec §43.2).
147
+ *
148
+ * `Tuple` addresses a Proposition by structure, `Id` by record identity. Both
149
+ * live in the same slot, which is why an id reference works everywhere a
150
+ * triple does — including as a {@link Term} endpoint. `Id` is match-only: it
151
+ * never resolves-or-creates, so `lower` rejects it in ENSURE PROPOSITION and
152
+ * in the ASSERT sugar that desugars through it.
153
+ */
154
+ export type PropositionMatcher =
155
+ | { Tuple: PropositionTriple }
156
+ | { Id: Scalar }
157
+
158
+ // ---------------------------------------------------------------------------
159
+ // KQL
160
+ // ---------------------------------------------------------------------------
161
+
162
+ export interface KqlQuery {
163
+ find_clause: FindClause
164
+ where_clauses: WhereClause[]
165
+ /** Cognitive history basis — what the Brain contained/believed then. */
166
+ as_of: AsOf | null
167
+ /** World-valid time — what was applicable then. An independent axis. */
168
+ for_time: Scalar | null
169
+ epistemic: Record<string, BoundValue> | null
170
+ order_by: OrderByItem[] | null
171
+ limit: Scalar | null
172
+ cursor: Scalar | null
173
+ }
174
+
175
+ export type AsOf = { Seq: Scalar } | { Tx: Scalar } | { Time: Scalar }
176
+
177
+ export interface FindClause {
178
+ expressions: FindExpression[]
179
+ }
180
+
181
+ export type FindExpression =
182
+ | { Variable: DotPathVar }
183
+ | {
184
+ Aggregation: {
185
+ func: AggregationFunction
186
+ var: DotPathVar
187
+ distinct: boolean
188
+ }
189
+ }
190
+
191
+ export type AggregationFunction = 'Count' | 'Sum' | 'Avg' | 'Min' | 'Max'
192
+
193
+ export interface OrderByItem {
194
+ variable: DotPathVar
195
+ direction: OrderDirection
196
+ aggregation: AggregationFunction | null
197
+ }
198
+
199
+ export type OrderDirection = 'Asc' | 'Desc'
200
+
201
+ export type WhereClause =
202
+ | { Concept: { variable: string; matcher: ObjectMatcher } }
203
+ | { Proposition: { variable: string | null; matcher: PropositionMatcher } }
204
+ | { Assertion: { variable: string; matcher: ObjectMatcher } }
205
+ | { Evidence: { variable: string; matcher: ObjectMatcher } }
206
+ | { Activity: { variable: string; matcher: ObjectMatcher } }
207
+ | {
208
+ Structural: {
209
+ variable: string | null
210
+ subject: Term
211
+ field: SymbolRef
212
+ object: Term
213
+ }
214
+ }
215
+ | { Belief: { variable: string; target: BeliefTarget } }
216
+ | { BeliefSlot: { variable: string; subject: Term; predicate: PredAtom } }
217
+ | { Filter: { expression: FilterExpression } }
218
+ | { Not: WhereClause[] }
219
+ | { Optional: WhereClause[] }
220
+ | { Union: WhereClause[] }
221
+
222
+ /**
223
+ * What a BELIEF projects: an already-bound Proposition variable, a Proposition
224
+ * named by id, or a tuple stated inline.
225
+ *
226
+ * `BELIEF (...)` is the Proposition expression slot, so the id form that names
227
+ * a Proposition in a pattern names it here too (Spec §43.2 / §46.1). The
228
+ * inline tuple always carries an exact predicate: projection never walks a
229
+ * raw path (Spec §45).
230
+ */
231
+ export type BeliefTarget =
232
+ | { Proposition: string }
233
+ | { Id: Scalar }
234
+ | { Tuple: PropositionTriple }
235
+
236
+ export type FilterExpression =
237
+ | {
238
+ Comparison: {
239
+ left: FilterOperand
240
+ operator: ComparisonOperator
241
+ right: FilterOperand
242
+ }
243
+ }
244
+ | {
245
+ Logical: {
246
+ left: FilterExpression
247
+ operator: LogicalOperator
248
+ right: FilterExpression
249
+ }
250
+ }
251
+ | { Not: FilterExpression }
252
+ | { Function: { func: FilterFunction; args: FilterOperand[] } }
253
+
254
+ export type FilterOperand =
255
+ | { Variable: DotPathVar }
256
+ | { Literal: KipValue }
257
+ | { Param: string }
258
+ | { List: FilterOperand[] }
259
+ | { Negate: FilterOperand }
260
+
261
+ export type ComparisonOperator =
262
+ | 'Equal'
263
+ | 'NotEqual'
264
+ | 'LessThan'
265
+ | 'GreaterThan'
266
+ | 'LessEqual'
267
+ | 'GreaterEqual'
268
+
269
+ export type LogicalOperator = 'And' | 'Or'
270
+
271
+ export type FilterFunction =
272
+ | 'Contains'
273
+ | 'StartsWith'
274
+ | 'EndsWith'
275
+ | 'Regex'
276
+ /** `IN(?expr, [a, b])` — membership. A function, not a comparison operator. */
277
+ | 'In'
278
+ | 'IsNull'
279
+ | 'IsNotNull'
280
+ | 'IsLiteral'
281
+ | 'IsElement'
282
+ | 'IsKind'
283
+ | 'LiteralType'
284
+
285
+ // ---------------------------------------------------------------------------
286
+ // KML
287
+ // ---------------------------------------------------------------------------
288
+
289
+ /**
290
+ * One atomic cognitive transition.
291
+ *
292
+ * A KML mutation becomes durable only via a Transaction, so a statement
293
+ * written on its own is still a one-clause transaction. `explicit_transaction`
294
+ * records which spelling the source used without changing that meaning.
295
+ */
296
+ export interface KmlStatement {
297
+ explicit_transaction: boolean
298
+ clauses: MutationClause[]
299
+ }
300
+
301
+ export type MutationClause =
302
+ | { CreateConcept: ConceptCreate }
303
+ | { UpsertConcept: ConceptUpsert }
304
+ | { EnsureProposition: EnsureProposition }
305
+ | { CreateEvidence: RecordCreate }
306
+ | { CreateAssertion: RecordCreate }
307
+ | { CreateActivity: RecordCreate }
308
+ | { Update: UpdateStatement }
309
+ | { RetractAssertion: RetractAssertion }
310
+ | { SupersedeAssertion: SupersedeAssertion }
311
+ | { CorrectEvidence: CorrectEvidence }
312
+ | { TransitionActivity: TransitionActivity }
313
+ | { SetRetention: SetRetention }
314
+ | { Archive: RemovalStatement }
315
+ | { Tombstone: RemovalStatement }
316
+ | { Purge: PurgeStatement }
317
+ | { MergeConcept: MergeConcept }
318
+
319
+ export interface ConceptCreate {
320
+ handle: string
321
+ type: SymbolRef | null
322
+ client_key: Scalar | null
323
+ name: Scalar | null
324
+ set_fields: Assignments | null
325
+ set_attributes: Assignments | null
326
+ set_facets: FacetAssignment[]
327
+ set_structural: StructuralEdge[] | null
328
+ }
329
+
330
+ export interface ConceptUpsert {
331
+ handle: string
332
+ match: ObjectMatcher | null
333
+ expect_version: Scalar | null
334
+ set_fields: Assignments | null
335
+ set_attributes: Assignments | null
336
+ set_facets: FacetAssignment[]
337
+ unset_attributes: string[] | null
338
+ unset_facets: FacetUnset[]
339
+ set_structural: StructuralEdge[] | null
340
+ unset_structural: StructuralRemoval[] | null
341
+ }
342
+
343
+ /** CREATE EVIDENCE / ASSERTION / ACTIVITY share one shape. */
344
+ export interface RecordCreate {
345
+ handle: string
346
+ client_key: Scalar | null
347
+ set_fields: Assignments | null
348
+ set_facets: FacetAssignment[]
349
+ set_structural: StructuralEdge[] | null
350
+ }
351
+
352
+ export interface EnsureProposition {
353
+ handle: string | null
354
+ subject: Term
355
+ predicate: PredAtom
356
+ object: Term
357
+ expect_version: Scalar | null
358
+ }
359
+
360
+ export interface FacetAssignment {
361
+ facet: SymbolRef
362
+ values: Assignments
363
+ }
364
+
365
+ export interface FacetUnset {
366
+ facet: SymbolRef
367
+ fields: string[]
368
+ }
369
+
370
+ export interface StructuralEdge {
371
+ field: SymbolRef
372
+ value: MutationValue
373
+ /** Edge options; `index` is meaningful only on an ordered field. */
374
+ options: Record<string, BoundValue> | null
375
+ }
376
+
377
+ /**
378
+ * `UNSET STRUCTURAL { (field, target) }` — one reference to remove.
379
+ *
380
+ * The SET STRUCTURAL edge without options: removal is per reference, ordered
381
+ * fields re-densify, cardinality is validated at commit (Spec §17.5).
382
+ */
383
+ export interface StructuralRemoval {
384
+ field: SymbolRef
385
+ value: MutationValue
386
+ }
387
+
388
+ /** Assignment pairs, kept ordered so lowering stays deterministic. */
389
+ export type Assignments = [string, MutationValue][]
390
+
391
+ /**
392
+ * A KML right-hand side: a bound value, or arithmetic over the target's *own*
393
+ * fields. References to any other variable are rejected during lowering, which
394
+ * is what lets each matched element be updated from its own row without a join.
395
+ */
396
+ export type MutationValue = BoundValue | { Expr: UpdateExpr }
397
+
398
+ export type UpdateExpr =
399
+ | { Variable: DotPathVar }
400
+ | { Number: number }
401
+ | { Param: string }
402
+ | { Function: { func: UpdateFunction; args: UpdateExpr[] } }
403
+
404
+ export type UpdateFunction = 'Add' | 'Mul' | 'Clamp' | 'Coalesce'
405
+
406
+ export interface UpdateStatement {
407
+ target: ElementRef
408
+ expect_version: Scalar | null
409
+ actions: UpdateAction[]
410
+ /**
411
+ * `null` when the statement names its target directly and omits WHERE —
412
+ * the same shape as the removal family (Spec §58).
413
+ */
414
+ where_clauses: WhereClause[] | null
415
+ limit: Scalar | null
416
+ }
417
+
418
+ export type UpdateAction =
419
+ | { SetFields: Assignments }
420
+ | { SetAttributes: Assignments }
421
+ | { SetFacet: FacetAssignment }
422
+ | { UnsetAttributes: string[] }
423
+ | { UnsetFacet: FacetUnset }
424
+ | { SetStructural: StructuralEdge[] }
425
+ | { UnsetStructural: StructuralRemoval[] }
426
+
427
+ export interface RetractAssertion {
428
+ target: ElementRef
429
+ where_clauses: WhereClause[] | null
430
+ limit: Scalar | null
431
+ expect_state: Scalar | null
432
+ }
433
+
434
+ export interface SupersedeAssertion {
435
+ target: ElementRef
436
+ by: ElementRef
437
+ expect_state: Scalar | null
438
+ }
439
+
440
+ export interface CorrectEvidence {
441
+ target: ElementRef
442
+ by: ElementRef
443
+ expect_state: Scalar | null
444
+ }
445
+
446
+ export interface TransitionActivity {
447
+ target: ElementRef
448
+ to: Scalar
449
+ set_fields: Assignments | null
450
+ set_structural: StructuralEdge[] | null
451
+ expect_state: Scalar | null
452
+ }
453
+
454
+ export interface SetRetention {
455
+ target: ElementRef
456
+ values: Assignments
457
+ where_clauses: WhereClause[] | null
458
+ limit: Scalar | null
459
+ expect_version: Scalar | null
460
+ }
461
+
462
+ export interface RemovalStatement {
463
+ target: ElementRef
464
+ where_clauses: WhereClause[] | null
465
+ limit: Scalar | null
466
+ expect_state: Scalar | null
467
+ }
468
+
469
+ export interface PurgeStatement {
470
+ target: ElementRef
471
+ where_clauses: WhereClause[] | null
472
+ limit: Scalar | null
473
+ reference_policy: Scalar | null
474
+ /** Always the literal `PURGE`; the grammar freezes the spelling. */
475
+ confirm: string
476
+ }
477
+
478
+ export interface MergeConcept {
479
+ source: ElementRef
480
+ into: ElementRef
481
+ where_clauses: WhereClause[] | null
482
+ expect_version: Scalar | null
483
+ }
484
+
485
+ // ---------------------------------------------------------------------------
486
+ // META
487
+ // ---------------------------------------------------------------------------
488
+
489
+ export type MetaCommand =
490
+ | { Describe: DescribeTarget }
491
+ | { List: ListCommand }
492
+ | { Search: SearchCommand }
493
+ | { Verify: { target: VerifyTarget; value: Scalar } }
494
+ | { Validate: ValidateCommand }
495
+ | { Preview: PreviewCommand }
496
+ | { History: HistoryCommand }
497
+ | { Changes: ChangesCommand }
498
+ | { Snapshot: { as_of: AsOf | null } }
499
+ | { ExportCapsule: ExportCapsuleCommand }
500
+
501
+ export type DescribeTarget =
502
+ | { Primer: { mode: Scalar | null } }
503
+ | 'Protocol'
504
+ | 'ExecutionContext'
505
+ | 'Capabilities'
506
+ | { Space: { value: Scalar | null } }
507
+ | { SchemaEnvironment: { as_of: AsOf | null } }
508
+ | { Package: Scalar }
509
+ | { Type: Scalar }
510
+ | { Predicate: Scalar }
511
+ | { Facet: Scalar }
512
+ | { StructuralField: Scalar }
513
+ | { Compatibility: { from: Scalar; to: Scalar } }
514
+ | { Error: Scalar }
515
+ | { Transaction: Scalar }
516
+ | { TransactionByIdempotencyKey: Scalar }
517
+ | { Snapshot: { as_of: AsOf | null } }
518
+ | { Capsule: Scalar }
519
+ | { EpistemicPolicy: { value: Scalar | null } }
520
+ | 'ProjectionCapability'
521
+ | { Trust: { value: Scalar | null } }
522
+ | { Access: { with: Record<string, BoundValue> | null } }
523
+
524
+ export interface ListCommand {
525
+ target: ListTarget
526
+ /** `LIST SCHEMA PACKAGES STATUS ...` only. */
527
+ status: Scalar | null
528
+ limit: Scalar | null
529
+ cursor: Scalar | null
530
+ }
531
+
532
+ export type ListTarget =
533
+ | 'Spaces'
534
+ | 'SchemaPackages'
535
+ | 'Types'
536
+ | 'Predicates'
537
+ | 'Facets'
538
+ | 'StructuralFields'
539
+ | 'EpistemicPolicies'
540
+
541
+ export interface SearchCommand {
542
+ target: SearchTarget
543
+ term: Scalar
544
+ with_type: Scalar | null
545
+ with_predicate: Scalar | null
546
+ mode: Scalar | null
547
+ threshold: Scalar | null
548
+ /** Historical index basis, `AS OF SEQ`. */
549
+ as_of_seq: Scalar | null
550
+ limit: Scalar | null
551
+ cursor: Scalar | null
552
+ }
553
+
554
+ export type SearchTarget =
555
+ | 'Concept'
556
+ | 'Proposition'
557
+ | 'Assertion'
558
+ | 'Evidence'
559
+ | 'Activity'
560
+ | 'Cognition'
561
+
562
+ export type VerifyTarget =
563
+ | 'Capsule'
564
+ | 'SchemaPackage'
565
+ | 'Receipt'
566
+ | 'Blob'
567
+ | 'Checkpoint'
568
+
569
+ export interface ValidateCommand {
570
+ target: ValidateTarget
571
+ value: Scalar
572
+ options: Record<string, BoundValue> | null
573
+ }
574
+
575
+ export type ValidateTarget =
576
+ | 'Kql'
577
+ | 'Kml'
578
+ | 'Capsule'
579
+ | 'SchemaPackage'
580
+ | 'ImportPlan'
581
+
582
+ export type PreviewCommand =
583
+ | { Kml: Scalar }
584
+ | { ImportCapsule: { capsule: Scalar; into: Scalar } }
585
+
586
+ export type HistoryCommand =
587
+ | {
588
+ Element: {
589
+ value: Scalar
590
+ from_seq: Scalar | null
591
+ to_seq: Scalar | null
592
+ limit: Scalar | null
593
+ cursor: Scalar | null
594
+ }
595
+ }
596
+ | {
597
+ Space: {
598
+ from_seq: Scalar | null
599
+ to_seq: Scalar | null
600
+ limit: Scalar | null
601
+ cursor: Scalar | null
602
+ }
603
+ }
604
+
605
+ export type ChangesCommand =
606
+ | { Since: { cursor: Scalar; limit: Scalar | null } }
607
+ | { AfterSeq: { seq: Scalar; limit: Scalar | null } }
608
+
609
+ export interface ExportCapsuleCommand {
610
+ target: ElementRef
611
+ where_clauses: WhereClause[]
612
+ options: Record<string, BoundValue> | null
613
+ as_of: AsOf | null
614
+ }