@listen-fire/movement-lang 0.12.13 → 0.13.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.
@@ -26,8 +26,6 @@ export interface ConstructionArg {
26
26
  /** Author-facing label (defaults to `name`). */
27
27
  label?: string;
28
28
  }
29
- /** The listen config formats this release's checker validates. */
30
- export type KnownTriggerConfigFormat = 'cron' | 'timezone' | 'fields' | 'strings' | 'type' | 'field' | 'field-value';
31
29
  export interface AdapterSpec {
32
30
  /**
33
31
  * The adapter's full construction signature — the credential (if any) folded
@@ -56,76 +54,6 @@ export interface AdapterSpec {
56
54
  * provision valid and stay silent forever.
57
55
  */
58
56
  canFire?: boolean;
59
- /**
60
- * The config keys a `listen to <instance> { … }` accepts for this adapter
61
- * (e.g. the email plus-address routing `key`). When present, an unknown
62
- * key is MOV_LISTEN_BAD_CONFIG; when absent, listener config goes
63
- * unvalidated (the adapter declares no vocabulary).
64
- */
65
- triggerConfig?: string[];
66
- /**
67
- * Per-key VALUE vocabularies for listen config — the adapter's
68
- * subscribable-event surface, projected by the host from its manifest
69
- * (e.g. attio's `events` key accepts `record.created` / `record.updated`
70
- * / `record.deleted`). A key listed in `triggerConfig` with an entry
71
- * here has a CLOSED value set: a listen config value (string, or each
72
- * element of a list) outside it is MOV_LISTEN_BAD_CONFIG. Keys without
73
- * an entry stay value-unvalidated.
74
- */
75
- triggerConfigOptions?: Record<string, string[]>;
76
- /**
77
- * The `events:` selection a listen WITHOUT one is subscribed to — the
78
- * adapter's own dispatch default, so the checker derives the same event
79
- * type the runtime will deliver (whatsapp: messages only). Absent ⇒ every
80
- * subscribable event.
81
- */
82
- defaultEvents?: string[];
83
- /**
84
- * Keys (⊆ `triggerConfig`) a listen on this adapter MUST carry — a
85
- * listen missing one is MOV_LISTEN_BAD_CONFIG with a ready-to-paste
86
- * fix-it. The cron adapter's `schedule` is the motivating case: a
87
- * schedule-less cron listener would never fire.
88
- */
89
- triggerConfigRequired?: string[];
90
- /**
91
- * Why a required key is required, by key, said after the refusal — the
92
- * host's words, because only the host knows what the value does (email's
93
- * routing `key` IS the inbound address; without it no mail can reach the
94
- * listener). Keys without an entry are refused with the bare fix-it.
95
- */
96
- triggerConfigRequiredWhy?: Record<string, string>;
97
- /**
98
- * Per-key value FORMATS the checker validates statically. `'cron'`
99
- * validates the value as a five-field cron expression; `'timezone'`
100
- * validates it as an IANA time-zone id (movement-lang/cron — the same
101
- * parser the platform scheduler runs, so check time and fire time can
102
- * never disagree).
103
- *
104
- * `'fields'` is the changed-attribute filter: a list of BARE property
105
- * names, validated against the position the listen's address lands on
106
- * (the derived event type). Any adapter with a "only fire when one of
107
- * these attributes changed" surface declares it; it is not the graph's,
108
- * it is just the graph that needed it first.
109
- *
110
- * `'strings'` is a non-empty list of non-empty quoted strings — the shape
111
- * only; the values are the source system's own (Gmail's `labels`).
112
- *
113
- * `'type'` is a node the program declares (`payload: <Payment>`): the
114
- * listen's events are of that type, and the movement it fires is checked
115
- * against it.
116
- *
117
- * `'field'` is one quoted field name of the record the listen's address
118
- * lands on (TypeScript's `keyof T`); `'field-value'` is a literal value of
119
- * the field the listen's `'field'`-format key names (`T[K]`): an enum
120
- * field's choice, a number field's number. Paired by format, so an adapter
121
- * declares at most one `'field'` key.
122
- *
123
- * Any other string is a format a newer module declares and this release
124
- * does not know: the key's value is a plain value, unchecked, and the
125
- * checker says so once (an Info), so a module release never breaks a host
126
- * on an older core.
127
- */
128
- triggerConfigFormats?: Record<string, KnownTriggerConfigFormat | (string & {})>;
129
57
  /**
130
58
  * Interactive "connect" actions the adapter offers when authoring against
131
59
  * one of its instances. The checker never reads these — they're carried
@@ -171,7 +99,99 @@ export interface AdapterSpec {
171
99
  /** What the adapter says it is (its manifest's `description`). The checker
172
100
  * never reads it; the language service's hover leads with it. */
173
101
  description?: string;
102
+ /**
103
+ * How long, by default, a provider may re-send an arrival it already sent
104
+ * (Stripe: three days): a repeat inside it is dropped by identity. lf.yaml
105
+ * overrides it per connection.
106
+ */
107
+ resendWindowSeconds?: number;
108
+ /** What a 0.12 settings listen on this module becomes as a traversal: the
109
+ * upgrade's rewrite of `listen to x { … }`. */
110
+ listenSettingsBecome?: SettingsBecome;
111
+ }
112
+ /**
113
+ * A module's mapping from its 0.12 listen settings to the traversal a listen
114
+ * is in 0.13: the path from the connection to the edge its events arrive on,
115
+ * and the hop and field each settings key narrows.
116
+ */
117
+ export interface SettingsBecome {
118
+ /** The edges from the connection's root to the listened edge. */
119
+ path: string[];
120
+ /** One per hop: the alias its rewritten WHERE reads the hop's record by. */
121
+ aliases: string[];
122
+ /** The 0.12 event position a fired parameter was typed as: a parameter
123
+ * naming it is retyped by the landing. */
124
+ paramFrom?: string;
125
+ /** Each settings key, by name. */
126
+ keys: Record<string, KeyBecomes>;
127
+ /** The mapping a listen naming one of these events in `events` becomes
128
+ * instead, when the module's events arrive on more than one edge (gmail's
129
+ * `label_added` lands on `Labelings`, not `Messages`); `events` is then
130
+ * spent choosing it. A listen naming events of two mappings has no
131
+ * rewrite: one listen per edge. One level deep. */
132
+ byEvent?: Record<string, Omit<SettingsBecome, 'byEvent'>>;
133
+ /** How the `field` and `becomes` keys of a module whose records hold their
134
+ * row before and after compare those rows. */
135
+ fieldChange?: FieldChange;
136
+ /** Where the traversal hears otherwise than the settings listen did
137
+ * (gmail's `label_added`: a label removed and added again fires again): a
138
+ * listen taking this mapping is told the note and rewritten never safely,
139
+ * so `listen-fire upgrade` holds the pin until `--all`. */
140
+ changed?: string;
141
+ /** The other paths these events arrive on (Slack's messages: a thread
142
+ * reply arrives on its root message's `Replies`): a listen taking this
143
+ * mapping heard more than one edge, so it has no rewrite, one listen per
144
+ * edge. */
145
+ alsoArrivesOn?: string[][];
174
146
  }
147
+ /** Two settings keys that compare a record's row before and after on one
148
+ * hop (Airtable's `{ field: "Stage", becomes: "Interview" }`): the field
149
+ * alone changed; with a value, it came to hold it (`exists(c.Current) AND
150
+ * c.Current.Stage == "Interview" AND (NOT exists(c.Previous) OR
151
+ * c.Previous.Stage != "Interview")`), each row tested present before a
152
+ * field is read through it. A value with no field compares nothing. The
153
+ * field is the row's own, by name. */
154
+ export interface FieldChange {
155
+ /** The index into `path` of the hop whose records hold the rows. */
156
+ hop: number;
157
+ /** The settings key naming the field. */
158
+ field: string;
159
+ /** The settings key naming the value the field came to hold. */
160
+ becomes: string;
161
+ /** The record's field holding the row as the change left it. */
162
+ current: string;
163
+ /** The record's field holding the row as it was before. */
164
+ previous: string;
165
+ }
166
+ /** What one settings key becomes: a comparison on a hop's field (`eq`, `neq`,
167
+ * `in`, `contains`: a member of a list field, several values an OR of
168
+ * them), or the landing's declared type (`type`, `payload: <T>`). */
169
+ export interface KeyBecomes {
170
+ /** The index into `path` of the hop it narrows. */
171
+ hop: number;
172
+ /** The field it compares (absent for `type`). */
173
+ field?: string;
174
+ op: KeyOp;
175
+ /** A settings value's spelling as a field value (`"record.created"` →
176
+ * `"created"`, or Slack's `"app_mention"` → `true` on a flag), by its text
177
+ * (`true` and `false` by theirs); `null`, a value that narrowed nothing
178
+ * (GitHub's `participating: false`: every thread), so the key compares
179
+ * nothing. Absent, a value is the field's as written. */
180
+ values?: Record<string, string | boolean | null>;
181
+ /** What a 0.12 listen meant by leaving the key out, as a settings value
182
+ * (`""`: mail sent to the box itself; a list: the events it heard). The
183
+ * rewrite of a listen that omits the key compares it, so the traversal
184
+ * hears what the listen heard. Absent, omitting the key narrowed nothing. */
185
+ absent?: string | string[];
186
+ /** The field `absent` is compared on, when leaving the key out meant
187
+ * something about another field than the key's own (gmail's `labels` left
188
+ * out of a `label_added` listen meant its own labels: `Label Type == "user"`). */
189
+ absentField?: string;
190
+ /** 0.12 compared this key's values lowercased: the rewrite writes them
191
+ * lowercased, so `{ key: "Deals" }` still hears what it heard. */
192
+ lowercase?: boolean;
193
+ }
194
+ export type KeyOp = 'eq' | 'neq' | 'in' | 'contains' | 'type';
175
195
  /**
176
196
  * The credential arg in a construction signature, if the adapter needs one.
177
197
  * Replaces the old dedicated `credentialArg` field — the credential is just the
@@ -242,8 +262,8 @@ export interface PluginSpec {
242
262
  */
243
263
  argTypes?: Record<string, SchemaFieldType>;
244
264
  /**
245
- * Arguments (⊆ `args`) a call MUST supply — the `triggerConfigRequired`
246
- * shape, one door over: a call missing one is MOV_THROUGH_ARG_MISSING.
265
+ * Arguments (⊆ `args`) a call MUST supply: a call missing one is
266
+ * MOV_THROUGH_ARG_MISSING.
247
267
  *
248
268
  * This is an AUTHORING gate, not a runtime one, and the two stay
249
269
  * deliberately different: the engine's skip-on-absent sentinel covers a
@@ -356,8 +376,58 @@ export type PluginOutput = {
356
376
  kind: 'records';
357
377
  fields: Record<string, SchemaFieldType>;
358
378
  };
379
+ /** How a listenable edge's arrivals reach the host: pushed to the
380
+ * connection (one subscription serves every listen on it), pushed per scope
381
+ * (one per watched parent, a table), or polled. */
382
+ export type Delivery = 'connection' | 'scope' | 'polled';
383
+ /**
384
+ * What an edge, or a root collection, says about being listened to and about
385
+ * being listed under a listen. Each member is present only when the module
386
+ * declared it. Every number is a default the operator's lf.yaml overrides.
387
+ */
388
+ export interface EdgeListening {
389
+ /**
390
+ * Absent means bounded: the edge holds what one record has. `false`: it
391
+ * spans more than any listen should range over (every schedule, every
392
+ * team's mail), and only a filter on `boundedBy` narrows it.
393
+ */
394
+ bounded?: boolean;
395
+ /** The landing's fields whose `==` or `IN [literals]` make an unbounded
396
+ * edge bounded. */
397
+ boundedBy?: string[];
398
+ delivery?: Delivery;
399
+ /** How often a polled edge is polled, by default (lf.yaml's `pollEvery`
400
+ * overrides it per connection). */
401
+ pollEverySeconds?: number;
402
+ /** The earlier hops' edges whose records an arrival carries, outermost
403
+ * first: a filter on one of them is judged on the arrival. */
404
+ carries?: string[];
405
+ /** An edge delivered per scope whose subscription is made per record an
406
+ * earlier hop, this edge named, landed on, not per record it hangs off
407
+ * (Airtable's `Changes`, one data webhook per base: `Bases`). Each arrival
408
+ * still names the record it is under, and a listen keeps only those under
409
+ * its own. */
410
+ scopedBy?: string;
411
+ /** An arrival names the record it is about. */
412
+ attributes?: boolean;
413
+ /** Each arrival is sent to an address its sender chose (mail's plus-suffix),
414
+ * so one that no listen's WHERE takes is a misdirected message the host
415
+ * says so at its default level; on any other edge that is said only under
416
+ * `LF_LOG=debug`. */
417
+ addressed?: boolean;
418
+ /** How a listen learns its members changed, so a filter on it as an
419
+ * earlier hop is re-resolved: declared only where listing it is cheap (a
420
+ * base's tables; never every message in a workspace). `"pushed"`: the
421
+ * module reports each member created, renamed or removed, so a listen
422
+ * re-resolves on the report and never on a clock. `{ relistEverySeconds }`:
423
+ * its members are re-listed this often by default (lf.yaml's
424
+ * `resolveEvery` overrides it). */
425
+ membersChange?: 'pushed' | {
426
+ relistEverySeconds: number;
427
+ };
428
+ }
359
429
  /** A reference (edge) declared by a position type. */
360
- export interface EdgeSchema {
430
+ export interface EdgeSchema extends EdgeListening {
361
431
  /** The position type (or union) the edge points at. */
362
432
  target: string;
363
433
  /**
@@ -459,40 +529,27 @@ export interface EdgeSchema {
459
529
  */
460
530
  subject?: boolean;
461
531
  /**
462
- * The AWAITABLE promise for this edge (asks-as-adapter §A). `true` ⇒ the edge
463
- * is a promise in type-space: a BARE traversal is a type error
464
- * (MOV_AWAIT_REQUIRED, did-you-mean `await`), and `await …-[:edge]->`
465
- * untilNonEmpty waits for its resolution and binds the landed node(s). Such an
466
- * edge is honestly neither `readable` nor `writable` — you await it, you do
467
- * not read or write it. Absent ⇒ an ordinary edge, and `await`-ing it is a
468
- * type error (MOV_NOT_AWAITABLE).
532
+ * The module ANNOUNCES ARRIVALS on this edge, so it can be listened to and
533
+ * awaited (`await …-[:edge]->` parks until an arrival wakes it). Separate
534
+ * from whether the edge can be LISTED, which is `readable`: an edge may be
535
+ * one, the other, or both. An email's `Replies` is both; a table's `Changes`
536
+ * only announces. Absent ⇒ nothing is announced, and `await`-ing the edge is
537
+ * refused.
469
538
  */
470
- awaitable?: boolean;
539
+ listenable?: boolean;
471
540
  /**
472
- * Only meaningful with `awaitable` (F20): whether a resolution along this edge
473
- * may carry NO landing (an explicit cancel resolves awaiters empty). Chunk B
474
- * carries the flag; the `T | absent` typing it drives is chunk C.
541
+ * Whether the module can list the arrivals since a mark it hands out. Without
542
+ * one, an arrival announced while nobody was listening is lost.
475
543
  */
476
- resolvesEmpty?: boolean;
544
+ cursor?: boolean;
545
+ /** The landing's field that names an arrival, so a repeat is dropped. */
546
+ identity?: string;
477
547
  /**
478
- * THE PUSH promise, and like `writable` it is EXPLICIT: the platform DELIVERS
479
- * an event when this edge resolves, so a run parked on it is woken rather than
480
- * polled. Slack's `Replies` (an inbound webhook resolves the park), an ask's
481
- * `Response` (answering it resumes the run), a callback's `Called` (the tap
482
- * arrives as an event) are the three that can say this today.
483
- *
484
- * **Absent ⇒ NO push**, and `await FIRST(…)` on the edge is refused with the
485
- * cadence form the author owns instead (`await until(…, every: …)`). Absent
486
- * cannot mean "maybe": a park with nobody to wake it is a run that never
487
- * finishes, which is exactly the silent degradation this model refuses — an
488
- * adapter that has not said stays honest by being polled.
489
- *
490
- * Adapter-declared, live-schema data like the filter surface. When an adapter
491
- * GAINS it, existing polls don't silently improve: the checker nudges (a
492
- * warning), the author rewrites.
493
- *
548
+ * The landing's field that changes when an arrival changes. Without one,
549
+ * only a new member counts as an arrival; a change that makes an existing
550
+ * member match is not seen.
494
551
  */
495
- watchable?: boolean;
552
+ version?: string;
496
553
  /**
497
554
  * This edge's LANDING TYPE is generic over the CONSTRUCTION SITE: the literal
498
555
  * value(s) the write body gives `field` fix the landing's shape. An ask's
@@ -523,6 +580,28 @@ export interface EdgeSchema {
523
580
  field: string;
524
581
  onNonLiteral?: 'error' | 'warn';
525
582
  };
583
+ /**
584
+ * Fields of what lands on this edge that take the literals the write it
585
+ * hangs off wrote at a path: `{ at: ['Actions', 'Value'], from:
586
+ * 'Buttons[].Value' }` makes the `Value` of each action an answer carries an
587
+ * enum of exactly the `Value`s of the buttons written. `at` walks from the
588
+ * landing by edge names and ends at the field; `from` is the write's field,
589
+ * `[]` going into each entry of a list and `.` into a field of an entry. A
590
+ * value there that is not a text literal leaves the field its declared type,
591
+ * with a warning (MOV_WRITE_GENERIC_UNTYPED).
592
+ */
593
+ literalsFrom?: {
594
+ at: string[];
595
+ from: string;
596
+ }[];
597
+ /**
598
+ * The field of the write this edge hangs off that names a node declared in
599
+ * the program (`Fields: Refund`): what lands here has that node's fields
600
+ * too, typed as the node declares them. The field's value reaches the
601
+ * module as the node's fields (`{ fields: { <name>: <field type> } }`).
602
+ * A value there that is not a node is MOV_ANSWER_SHAPE.
603
+ */
604
+ answerShapeFrom?: string;
526
605
  /**
527
606
  * The edge is the one the system declared as its records' resources (the
528
607
  * describe's reserved `_resources` reference — the knowledge graph's
@@ -688,6 +767,17 @@ export interface PositionSchema {
688
767
  /** What the adapter says each field is, by name — every field it described,
689
768
  * readable or write-only. */
690
769
  fieldDocs?: Record<string, string>;
770
+ /** The id its module keys a record's field by, by the field's name, where
771
+ * the two differ: a host reads an arrival's fields by name before judging
772
+ * it, as a run reads them. */
773
+ fieldIds?: Record<string, string>;
774
+ /** The fields whose meaning its module changed in a release, by name: a
775
+ * check for an upgrade from before that release warns where a program
776
+ * reads one (gmail's `Labels`, ids before 0.13 and names since). */
777
+ changedFields?: Record<string, {
778
+ release: string;
779
+ note: string;
780
+ }>;
691
781
  }
692
782
  /**
693
783
  * A DISCRIMINATED write shape — the write-side dual of read narrowing. On the
@@ -873,12 +963,19 @@ export interface WritableRootSchema {
873
963
  * stays silent.
874
964
  *
875
965
  */
876
- export interface CollectionSchema {
966
+ export interface CollectionSchema extends EdgeListening {
877
967
  /** The position type name the collection's members land on. */
878
968
  target: string;
879
969
  /** Whether — and how — filter / order / limit push across this collection.
880
970
  * Read by the hop gate exactly as `EdgeSchema.capability` is. */
881
971
  capability?: EdgeCapability;
972
+ /** Absent: it can be listed. `false`: it is only written to or listened to. */
973
+ readable?: false;
974
+ /** As `EdgeSchema.listenable`, `cursor`, `identity` and `version` say. */
975
+ listenable?: true;
976
+ cursor?: boolean;
977
+ identity?: string;
978
+ version?: string;
882
979
  }
883
980
  /**
884
981
  * The schema of a constructed instance — produced per construction because
@@ -972,6 +1069,15 @@ export interface InstanceSchema {
972
1069
  * carry may belong to one member, and narrowing is how it becomes readable.
973
1070
  */
974
1071
  narrowBy?: Record<string, string[]>;
1072
+ /**
1073
+ * A hop's `WHERE` the host evaluated over a type's members and found to
1074
+ * select none of them, under the same `refinementKey` as `refinements`: the
1075
+ * members there are, by name. The checker refuses the hop where it is
1076
+ * written (`MOV_UNKNOWN_POSITION`), naming them. Absent ⇒ either the WHERE
1077
+ * selected a member (`refinements`) or the members could not decide it, and
1078
+ * the hop stays on the unnarrowed type.
1079
+ */
1080
+ unselected?: Record<string, string[]>;
975
1081
  /**
976
1082
  * Construction-site landings (2026-07-30): positions synthesized from ONE
977
1083
  * write's own literals, keyed by `genericLandingKey`. The refinements
@@ -986,71 +1092,6 @@ export interface InstanceSchema {
986
1092
  *
987
1093
  */
988
1094
  genericLandings?: Record<string, string>;
989
- /** The position a `listen` on this instance fires — the type its events
990
- * arrive as. The conformance check (a shape-typed movement parameter)
991
- * targets this position. The first declared event edge when the adapter
992
- * declares any (`eventPositions`); else the projection's single-readable
993
- * heuristic (a poll adapter whose one readable entry IS what a listen
994
- * delivers — granola). Undefined when the instance has no single event
995
- * position. */
996
- eventPosition?: string;
997
- /**
998
- * The instance's DECLARED event surface: one entry per event edge off the
999
- * meta node (`SchemaEntryPoint.fires`), in declaration order. THE EVENT IS
1000
- * JUST A NODE — the projection synthesizes nothing; each entry names the
1001
- * node an event edge lands on, and `on` lists the `events:` config values
1002
- * delivered along that edge (a subset of the adapter's subscribable-event
1003
- * vocabulary). `on` absent ⇒ every subscribable event (or the adapter has
1004
- * no vocabulary at all — cron's tick, a messaging Message Received).
1005
- *
1006
- * This replaces `eventActions` + the variant synthesis
1007
- * (`Record Created`/`Updated`/`Deleted` were nominal names for address
1008
- * narrowings — `Record Created` ≡ `` Record Change WHERE `action` ==
1009
- * "record.created" ``). Where a change-kind axis exists it is an ORDINARY
1010
- * FIELD on the event node (`action`, an enum of the same `events:`
1011
- * vocabulary — ONE namespace), and a listen's `events:` selection pins it
1012
- * in the derived address.
1013
- *
1014
- */
1015
- eventPositions?: Array<{
1016
- position: string;
1017
- on?: string[];
1018
- }>;
1019
- /**
1020
- * The listen-config keys that ADDRESS this instance's events, in hop order —
1021
- * the adapter's `ListenConfigKey.narrows` set (Airtable: `['base','table']`).
1022
- *
1023
- * A listen is a traversal of the event edge with a WHERE, so its config IS an
1024
- * address; these are the keys that say so. The checker reads them to derive
1025
- * the type a listen fires (`listenNarrowing`), which is what a signature's
1026
- * address is compared against. Absent ⇒ this adapter's events aren't
1027
- * addressable and every listen on it fires the plain event type.
1028
- *
1029
- */
1030
- eventNarrowingKeys?: string[];
1031
- /**
1032
- * What may legally be pinned at each event-address hop — keyed by the address
1033
- * PREFIX it is legal under (`narrowingPrefixKey` over the pins fixed so far).
1034
- *
1035
- * `` `table` == "tblDaels" `` is `enum == "a string literal that isn't in the
1036
- * enum"`, and that is where the typo dies: `MOV_ENUM_UNKNOWN_VALUE`, with a
1037
- * did-you-mean, through the same `checkEnumLiteral` every other enum
1038
- * comparison rides. Not a downstream read error, and not an error at the
1039
- * narrow — a narrowing that matches nothing is `never`, which is a TRUE
1040
- * statement about a typo'd address, not a failure.
1041
- *
1042
- * THE VARIANCE IS THE MODEL, not an obstacle to it. `base`'s options are free
1043
- * — the root walk already holds the bases. `table`'s options depend on WHICH
1044
- * base, so they exist only under a prefix that pins one, and cost exactly that
1045
- * base's hop. The drill-down, one level in, at 1 + 1: a base no signature
1046
- * names is never opened, so this can never become the `listTables`-per-base
1047
- * fanout the whole plan exists to kill.
1048
- *
1049
- * Absent (or absent for a prefix) ⇒ nobody published the options, and the pin
1050
- * is unchecked. Silence, never a guess.
1051
- *
1052
- */
1053
- eventNarrowingValues?: Record<string, Record<string, string[]>>;
1054
1095
  }
1055
1096
  /**
1056
1097
  * Canonical key into `InstanceSchema.refinements`: the hop's target type plus
@@ -1208,15 +1249,16 @@ export declare function isArtificialEdge(edge: string): boolean;
1208
1249
  */
1209
1250
  export declare function eventAddressEventName(key: string): string;
1210
1251
  /**
1211
- * What an adapter SURFACE can declare — every field type except a record,
1212
- * nested collections included.
1252
+ * What an adapter SURFACE can declare — every field type, nested collections
1253
+ * included, a record by the name of its position.
1213
1254
  *
1214
- * A record is a place in a graph, and no adapter field is one: a record type
1215
- * arises only where the checker types an EXPRESSION. Saying so here is what
1216
- * keeps a schema clear of the position model — and a schema crosses the wire
1217
- * (`InstanceSchema` is a tRPC response), where a field type that reached into
1218
- * positions would reach back into schemas again, a cycle no serialiser's type
1219
- * can follow.
1255
+ * A record field holds a record as its value (a change's row before and
1256
+ * after), read on with `.` and never fetched. It names its position as the
1257
+ * checker's `PositionTypeRef` does, less the instance: the schema declaring
1258
+ * it is the instance's own. That is what keeps a schema clear of the position
1259
+ * model — a schema crosses the wire (`InstanceSchema` is a tRPC response),
1260
+ * and a field type that carried an instance would reach back into schemas
1261
+ * again, a cycle no serialiser's type can follow.
1220
1262
  *
1221
1263
  * The collections are spelled a second time because TypeScript cannot subtract
1222
1264
  * a member from a RECURSIVE union — `Exclude` removes the record at the top
@@ -1241,9 +1283,36 @@ export type SchemaFieldType = 'text' | 'number' | 'boolean' | 'date' | 'datetime
1241
1283
  open?: {
1242
1284
  allowPattern?: string;
1243
1285
  };
1286
+ }
1287
+ /** A named scalar its owner (the module that declared it) parses: a cron
1288
+ * schedule, a mailbox key. `allowPattern` is the least an owner says of
1289
+ * its values; `format`, a format the checker validates a literal by. */
1290
+ | {
1291
+ kind: 'owned';
1292
+ name: string;
1293
+ owner: string;
1294
+ allowPattern?: string;
1295
+ format?: 'cron' | 'timeZone';
1244
1296
  } | {
1245
1297
  kind: 'maybeAbsent';
1246
1298
  of: SchemaFieldType;
1299
+ }
1300
+ /** A record's fields held as the field's value (`c.Current`): typed as a
1301
+ * plain object of that position's fields, never as the record. It has no
1302
+ * edges and no identity, so a checker refuses a walk, a write or a record
1303
+ * parameter on it, bound to a name or not. */
1304
+ | {
1305
+ kind: 'record';
1306
+ position: SchemaPositionRef;
1307
+ };
1308
+ /** Which record a `record` field holds: one record type of the instance, or
1309
+ * one of several (`unions`). */
1310
+ export type SchemaPositionRef = {
1311
+ kind: 'position';
1312
+ position: string;
1313
+ } | {
1314
+ kind: 'union';
1315
+ union: string;
1247
1316
  };
1248
1317
  /** `T | absent` over a surface type; a surface type in is a surface type out. */
1249
1318
  export declare function maybeAbsent(type: SchemaFieldType | undefined): SchemaFieldType | undefined;
@@ -14,6 +14,12 @@ export declare const HANDBOOK_POINTERS: {
14
14
  readonly match: "writes#match";
15
15
  /** What a write did — created, matched, changed — asked of its `@old`. */
16
16
  readonly writeOutcome: "writes#what-the-write-did";
17
+ /** A retired callback: the record a run writes and the edge it waits on. */
18
+ readonly waiting: "reviews#waiting-on-a-person";
19
+ /** A plain `await` that would guess which match is first, and `await new`. */
20
+ readonly awaitNew: "reviews#await-and-await-new";
21
+ /** What a wait's WHERE reads from the run, kept from when the wait is reached. */
22
+ readonly capturedValues: "reviews#captured-values";
17
23
  };
18
24
  export type HandbookPointer = (typeof HANDBOOK_POINTERS)[keyof typeof HANDBOOK_POINTERS];
19
25
  /** The suffix a diagnostic message carries: ` (see handbook: front#identity)`. */
@@ -25,6 +25,12 @@ exports.HANDBOOK_POINTERS = {
25
25
  match: 'writes#match',
26
26
  /** What a write did — created, matched, changed — asked of its `@old`. */
27
27
  writeOutcome: 'writes#what-the-write-did',
28
+ /** A retired callback: the record a run writes and the edge it waits on. */
29
+ waiting: 'reviews#waiting-on-a-person',
30
+ /** A plain `await` that would guess which match is first, and `await new`. */
31
+ awaitNew: 'reviews#await-and-await-new',
32
+ /** What a wait's WHERE reads from the run, kept from when the wait is reached. */
33
+ capturedValues: 'reviews#captured-values',
28
34
  };
29
35
  /** The suffix a diagnostic message carries: ` (see handbook: front#identity)`. */
30
36
  function seeHandbook(anchor) {
@@ -49,6 +55,9 @@ exports.HANDBOOK_POINTER_BY_CODE = {
49
55
  MOV_HANDLE_READ_FOUND: exports.HANDBOOK_POINTERS.writeOutcome,
50
56
  MOV_OLD_EDGE_NOT_A_WRITE: exports.HANDBOOK_POINTERS.writeOutcome,
51
57
  MOV_ARTIFICIAL_EDGE_UNKNOWN: exports.HANDBOOK_POINTERS.writeOutcome,
58
+ MOV_CALLBACK_RETIRED: exports.HANDBOOK_POINTERS.waiting,
59
+ MOV_AWAIT_UNORDERED: exports.HANDBOOK_POINTERS.awaitNew,
60
+ MOV_AWAIT_VALUE_CAPTURED: exports.HANDBOOK_POINTERS.capturedValues,
52
61
  };
53
62
  /** `diagnostic`, its message ending in the handbook pointer its code has (if any). */
54
63
  function withHandbookPointer(diagnostic) {
@@ -30,8 +30,14 @@ export declare function languageStanding(pin: string): {
30
30
  export declare function checkSourceInRust(source: string, snapshot: CatalogSnapshot, options: RustCheckOptions): Diagnostic[];
31
31
  /** A checker fact about one node, keyed by its AST path (a JSON Pointer from
32
32
  * the Program, `file` naming a library's): a write spread's field list, a
33
- * graph spread's copy plan (as plain data), or that a graph entry is a
34
- * reference. */
33
+ * graph spread's copy plan (as plain data), that a graph entry is a
34
+ * reference, the type a linked write off a record a hop's WHERE chose
35
+ * creates, the edges awaited off a record that enters the run there, on a
36
+ * fired function's parameter the edges awaited off each record type its
37
+ * trigger's arrival carries (by that type; the host's, never the
38
+ * engine's), that a plain `await` reads its edge's listing first, or the
39
+ * fields of a node a write field names as an answer's shape (sent as the
40
+ * field's value). */
35
41
  export type Stamp = {
36
42
  file?: string;
37
43
  path: string;
@@ -41,6 +47,16 @@ export type Stamp = {
41
47
  copy: unknown;
42
48
  } | {
43
49
  reference: true;
50
+ } | {
51
+ writtenType: string;
52
+ } | {
53
+ opensWaits: readonly string[];
54
+ } | {
55
+ carriedAwaits: Readonly<Record<string, readonly string[]>>;
56
+ } | {
57
+ listsFirst: true;
58
+ } | {
59
+ nodeSchema: Readonly<Record<string, unknown>>;
44
60
  });
45
61
  /** What an import binds: a movement or a node declaration. */
46
62
  export type LinkedKind = 'movement' | 'shape';
@@ -66,11 +82,14 @@ export interface LinkData {
66
82
  }>;
67
83
  }
68
84
  /** The check as the engine's `check.program` request is answered: every
69
- * diagnostic, the import link, the checker's stamps. */
85
+ * diagnostic, the import link, the checker's stamps, and a plan per
86
+ * `listen to <traversal>` that checked clean (absent when there is none),
87
+ * as JSON: the engine reads them (`listenPlansOf`). */
70
88
  export interface CheckAnswer {
71
89
  diagnostics: Diagnostic[];
72
90
  link?: LinkData;
73
91
  stamps: Stamp[];
92
+ listens?: unknown[];
74
93
  }
75
94
  /** `checkSourceInRust` as data (crates/movement-checker/src/answer.rs). */
76
95
  export declare function checkAnswerInRust(source: string, snapshot: CatalogSnapshot, options: RustCheckOptions): CheckAnswer;
@@ -89,6 +108,8 @@ export declare function compatibleInRust(request: {
89
108
  } | {
90
109
  undescribed: true;
91
110
  };
111
+ /** One stamp as the Rust checker answers it: a path, and exactly one fact. */
112
+ export declare function stampOf(value: unknown): Stamp;
92
113
  /** One diagnostic of an artifact's reply, validated.
93
114
  *
94
115
  * @internal Used by the story analysis's wrapper (checker/story_analysis.ts). */