@listen-fire/movement-lang 0.12.13 → 0.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/catalog/types.d.ts +256 -178
- package/dist/checker/handbook_pointers.d.ts +6 -0
- package/dist/checker/handbook_pointers.js +9 -0
- package/dist/checker/rust_checker.d.ts +24 -3
- package/dist/checker/rust_checker.js +34 -0
- package/dist/checker/story_analysis.d.ts +8 -10
- package/dist/checker/story_analysis.js +20 -5
- package/dist/expression/filter.d.ts +4 -3
- package/dist/expression/filter.js +76 -7
- package/dist/expression/types.d.ts +5 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +6 -1
- package/dist/language_version.d.ts +2 -2
- package/dist/language_version.js +2 -2
- package/dist/language_version_value.d.ts +1 -1
- package/dist/language_version_value.js +1 -1
- package/dist/parser/ast.d.ts +53 -66
- package/dist/parser/ast.js +9 -5
- package/dist/parser/await_words.d.ts +6 -0
- package/dist/parser/await_words.js +9 -0
- package/dist/service/snapshot.d.ts +3 -2
- package/dist/service/snapshot.js +38 -2
- package/dist/wasm/loader.d.ts +49 -0
- package/dist/wasm/loader.js +53 -0
- package/dist/wasm/movement.wasm +0 -0
- package/dist/wasm/movement_parser.wasm +0 -0
- package/package.json +1 -1
package/dist/catalog/types.d.ts
CHANGED
|
@@ -26,9 +26,13 @@ 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 {
|
|
30
|
+
/**
|
|
31
|
+
* The package the module is installed from (`@lf/github`), which a
|
|
32
|
+
* `connect` names it by. Absent for a module known only by its key: a
|
|
33
|
+
* project's local command, file or server, an embedding host's adapter.
|
|
34
|
+
*/
|
|
35
|
+
package?: string;
|
|
32
36
|
/**
|
|
33
37
|
* The adapter's full construction signature — the credential (if any) folded
|
|
34
38
|
* in as a `kind: 'credential'` entry, plus every entry-position arg.
|
|
@@ -56,76 +60,6 @@ export interface AdapterSpec {
|
|
|
56
60
|
* provision valid and stay silent forever.
|
|
57
61
|
*/
|
|
58
62
|
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
63
|
/**
|
|
130
64
|
* Interactive "connect" actions the adapter offers when authoring against
|
|
131
65
|
* one of its instances. The checker never reads these — they're carried
|
|
@@ -171,7 +105,99 @@ export interface AdapterSpec {
|
|
|
171
105
|
/** What the adapter says it is (its manifest's `description`). The checker
|
|
172
106
|
* never reads it; the language service's hover leads with it. */
|
|
173
107
|
description?: string;
|
|
108
|
+
/**
|
|
109
|
+
* How long, by default, a provider may re-send an arrival it already sent
|
|
110
|
+
* (Stripe: three days): a repeat inside it is dropped by identity. lf.yaml
|
|
111
|
+
* overrides it per connection.
|
|
112
|
+
*/
|
|
113
|
+
resendWindowSeconds?: number;
|
|
114
|
+
/** What a 0.12 settings listen on this module becomes as a traversal: the
|
|
115
|
+
* upgrade's rewrite of `listen to x { … }`. */
|
|
116
|
+
listenSettingsBecome?: SettingsBecome;
|
|
174
117
|
}
|
|
118
|
+
/**
|
|
119
|
+
* A module's mapping from its 0.12 listen settings to the traversal a listen
|
|
120
|
+
* is in 0.13: the path from the connection to the edge its events arrive on,
|
|
121
|
+
* and the hop and field each settings key narrows.
|
|
122
|
+
*/
|
|
123
|
+
export interface SettingsBecome {
|
|
124
|
+
/** The edges from the connection's root to the listened edge. */
|
|
125
|
+
path: string[];
|
|
126
|
+
/** One per hop: the alias its rewritten WHERE reads the hop's record by. */
|
|
127
|
+
aliases: string[];
|
|
128
|
+
/** The 0.12 event position a fired parameter was typed as: a parameter
|
|
129
|
+
* naming it is retyped by the landing. */
|
|
130
|
+
paramFrom?: string;
|
|
131
|
+
/** Each settings key, by name. */
|
|
132
|
+
keys: Record<string, KeyBecomes>;
|
|
133
|
+
/** The mapping a listen naming one of these events in `events` becomes
|
|
134
|
+
* instead, when the module's events arrive on more than one edge (gmail's
|
|
135
|
+
* `label_added` lands on `Labelings`, not `Messages`); `events` is then
|
|
136
|
+
* spent choosing it. A listen naming events of two mappings has no
|
|
137
|
+
* rewrite: one listen per edge. One level deep. */
|
|
138
|
+
byEvent?: Record<string, Omit<SettingsBecome, 'byEvent'>>;
|
|
139
|
+
/** How the `field` and `becomes` keys of a module whose records hold their
|
|
140
|
+
* row before and after compare those rows. */
|
|
141
|
+
fieldChange?: FieldChange;
|
|
142
|
+
/** Where the traversal hears otherwise than the settings listen did
|
|
143
|
+
* (gmail's `label_added`: a label removed and added again fires again): a
|
|
144
|
+
* listen taking this mapping is told the note and rewritten never safely,
|
|
145
|
+
* so `listen-fire upgrade` holds the pin until `--all`. */
|
|
146
|
+
changed?: string;
|
|
147
|
+
/** The other paths these events arrive on (Slack's messages: a thread
|
|
148
|
+
* reply arrives on its root message's `Replies`): a listen taking this
|
|
149
|
+
* mapping heard more than one edge, so it has no rewrite, one listen per
|
|
150
|
+
* edge. */
|
|
151
|
+
alsoArrivesOn?: string[][];
|
|
152
|
+
}
|
|
153
|
+
/** Two settings keys that compare a record's row before and after on one
|
|
154
|
+
* hop (Airtable's `{ field: "Stage", becomes: "Interview" }`): the field
|
|
155
|
+
* alone changed; with a value, it came to hold it (`exists(c.Current) AND
|
|
156
|
+
* c.Current.Stage == "Interview" AND (NOT exists(c.Previous) OR
|
|
157
|
+
* c.Previous.Stage != "Interview")`), each row tested present before a
|
|
158
|
+
* field is read through it. A value with no field compares nothing. The
|
|
159
|
+
* field is the row's own, by name. */
|
|
160
|
+
export interface FieldChange {
|
|
161
|
+
/** The index into `path` of the hop whose records hold the rows. */
|
|
162
|
+
hop: number;
|
|
163
|
+
/** The settings key naming the field. */
|
|
164
|
+
field: string;
|
|
165
|
+
/** The settings key naming the value the field came to hold. */
|
|
166
|
+
becomes: string;
|
|
167
|
+
/** The record's field holding the row as the change left it. */
|
|
168
|
+
current: string;
|
|
169
|
+
/** The record's field holding the row as it was before. */
|
|
170
|
+
previous: string;
|
|
171
|
+
}
|
|
172
|
+
/** What one settings key becomes: a comparison on a hop's field (`eq`, `neq`,
|
|
173
|
+
* `in`, `contains`: a member of a list field, several values an OR of
|
|
174
|
+
* them), or the landing's declared type (`type`, `payload: <T>`). */
|
|
175
|
+
export interface KeyBecomes {
|
|
176
|
+
/** The index into `path` of the hop it narrows. */
|
|
177
|
+
hop: number;
|
|
178
|
+
/** The field it compares (absent for `type`). */
|
|
179
|
+
field?: string;
|
|
180
|
+
op: KeyOp;
|
|
181
|
+
/** A settings value's spelling as a field value (`"record.created"` →
|
|
182
|
+
* `"created"`, or Slack's `"app_mention"` → `true` on a flag), by its text
|
|
183
|
+
* (`true` and `false` by theirs); `null`, a value that narrowed nothing
|
|
184
|
+
* (GitHub's `participating: false`: every thread), so the key compares
|
|
185
|
+
* nothing. Absent, a value is the field's as written. */
|
|
186
|
+
values?: Record<string, string | boolean | null>;
|
|
187
|
+
/** What a 0.12 listen meant by leaving the key out, as a settings value
|
|
188
|
+
* (`""`: mail sent to the box itself; a list: the events it heard). The
|
|
189
|
+
* rewrite of a listen that omits the key compares it, so the traversal
|
|
190
|
+
* hears what the listen heard. Absent, omitting the key narrowed nothing. */
|
|
191
|
+
absent?: string | string[];
|
|
192
|
+
/** The field `absent` is compared on, when leaving the key out meant
|
|
193
|
+
* something about another field than the key's own (gmail's `labels` left
|
|
194
|
+
* out of a `label_added` listen meant its own labels: `Label Type == "user"`). */
|
|
195
|
+
absentField?: string;
|
|
196
|
+
/** 0.12 compared this key's values lowercased: the rewrite writes them
|
|
197
|
+
* lowercased, so `{ key: "Deals" }` still hears what it heard. */
|
|
198
|
+
lowercase?: boolean;
|
|
199
|
+
}
|
|
200
|
+
export type KeyOp = 'eq' | 'neq' | 'in' | 'contains' | 'type';
|
|
175
201
|
/**
|
|
176
202
|
* The credential arg in a construction signature, if the adapter needs one.
|
|
177
203
|
* Replaces the old dedicated `credentialArg` field — the credential is just the
|
|
@@ -242,8 +268,8 @@ export interface PluginSpec {
|
|
|
242
268
|
*/
|
|
243
269
|
argTypes?: Record<string, SchemaFieldType>;
|
|
244
270
|
/**
|
|
245
|
-
* Arguments (⊆ `args`) a call MUST supply
|
|
246
|
-
*
|
|
271
|
+
* Arguments (⊆ `args`) a call MUST supply: a call missing one is
|
|
272
|
+
* MOV_THROUGH_ARG_MISSING.
|
|
247
273
|
*
|
|
248
274
|
* This is an AUTHORING gate, not a runtime one, and the two stay
|
|
249
275
|
* deliberately different: the engine's skip-on-absent sentinel covers a
|
|
@@ -356,8 +382,58 @@ export type PluginOutput = {
|
|
|
356
382
|
kind: 'records';
|
|
357
383
|
fields: Record<string, SchemaFieldType>;
|
|
358
384
|
};
|
|
385
|
+
/** How a listenable edge's arrivals reach the host: pushed to the
|
|
386
|
+
* connection (one subscription serves every listen on it), pushed per scope
|
|
387
|
+
* (one per watched parent, a table), or polled. */
|
|
388
|
+
export type Delivery = 'connection' | 'scope' | 'polled';
|
|
389
|
+
/**
|
|
390
|
+
* What an edge, or a root collection, says about being listened to and about
|
|
391
|
+
* being listed under a listen. Each member is present only when the module
|
|
392
|
+
* declared it. Every number is a default the operator's lf.yaml overrides.
|
|
393
|
+
*/
|
|
394
|
+
export interface EdgeListening {
|
|
395
|
+
/**
|
|
396
|
+
* Absent means bounded: the edge holds what one record has. `false`: it
|
|
397
|
+
* spans more than any listen should range over (every schedule, every
|
|
398
|
+
* team's mail), and only a filter on `boundedBy` narrows it.
|
|
399
|
+
*/
|
|
400
|
+
bounded?: boolean;
|
|
401
|
+
/** The landing's fields whose `==` or `IN [literals]` make an unbounded
|
|
402
|
+
* edge bounded. */
|
|
403
|
+
boundedBy?: string[];
|
|
404
|
+
delivery?: Delivery;
|
|
405
|
+
/** How often a polled edge is polled, by default (lf.yaml's `pollEvery`
|
|
406
|
+
* overrides it per connection). */
|
|
407
|
+
pollEverySeconds?: number;
|
|
408
|
+
/** The earlier hops' edges whose records an arrival carries, outermost
|
|
409
|
+
* first: a filter on one of them is judged on the arrival. */
|
|
410
|
+
carries?: string[];
|
|
411
|
+
/** An edge delivered per scope whose subscription is made per record an
|
|
412
|
+
* earlier hop, this edge named, landed on, not per record it hangs off
|
|
413
|
+
* (Airtable's `Changes`, one data webhook per base: `Bases`). Each arrival
|
|
414
|
+
* still names the record it is under, and a listen keeps only those under
|
|
415
|
+
* its own. */
|
|
416
|
+
scopedBy?: string;
|
|
417
|
+
/** An arrival names the record it is about. */
|
|
418
|
+
attributes?: boolean;
|
|
419
|
+
/** Each arrival is sent to an address its sender chose (mail's plus-suffix),
|
|
420
|
+
* so one that no listen's WHERE takes is a misdirected message the host
|
|
421
|
+
* says so at its default level; on any other edge that is said only under
|
|
422
|
+
* `LF_LOG=debug`. */
|
|
423
|
+
addressed?: boolean;
|
|
424
|
+
/** How a listen learns its members changed, so a filter on it as an
|
|
425
|
+
* earlier hop is re-resolved: declared only where listing it is cheap (a
|
|
426
|
+
* base's tables; never every message in a workspace). `"pushed"`: the
|
|
427
|
+
* module reports each member created, renamed or removed, so a listen
|
|
428
|
+
* re-resolves on the report and never on a clock. `{ relistEverySeconds }`:
|
|
429
|
+
* its members are re-listed this often by default (lf.yaml's
|
|
430
|
+
* `resolveEvery` overrides it). */
|
|
431
|
+
membersChange?: 'pushed' | {
|
|
432
|
+
relistEverySeconds: number;
|
|
433
|
+
};
|
|
434
|
+
}
|
|
359
435
|
/** A reference (edge) declared by a position type. */
|
|
360
|
-
export interface EdgeSchema {
|
|
436
|
+
export interface EdgeSchema extends EdgeListening {
|
|
361
437
|
/** The position type (or union) the edge points at. */
|
|
362
438
|
target: string;
|
|
363
439
|
/**
|
|
@@ -459,40 +535,27 @@ export interface EdgeSchema {
|
|
|
459
535
|
*/
|
|
460
536
|
subject?: boolean;
|
|
461
537
|
/**
|
|
462
|
-
* The
|
|
463
|
-
*
|
|
464
|
-
*
|
|
465
|
-
*
|
|
466
|
-
*
|
|
467
|
-
*
|
|
468
|
-
* type error (MOV_NOT_AWAITABLE).
|
|
538
|
+
* The module ANNOUNCES ARRIVALS on this edge, so it can be listened to and
|
|
539
|
+
* awaited (`await …-[:edge]->` parks until an arrival wakes it). Separate
|
|
540
|
+
* from whether the edge can be LISTED, which is `readable`: an edge may be
|
|
541
|
+
* one, the other, or both. An email's `Replies` is both; a table's `Changes`
|
|
542
|
+
* only announces. Absent ⇒ nothing is announced, and `await`-ing the edge is
|
|
543
|
+
* refused.
|
|
469
544
|
*/
|
|
470
|
-
|
|
545
|
+
listenable?: boolean;
|
|
471
546
|
/**
|
|
472
|
-
*
|
|
473
|
-
*
|
|
474
|
-
* carries the flag; the `T | absent` typing it drives is chunk C.
|
|
547
|
+
* Whether the module can list the arrivals since a mark it hands out. Without
|
|
548
|
+
* one, an arrival announced while nobody was listening is lost.
|
|
475
549
|
*/
|
|
476
|
-
|
|
550
|
+
cursor?: boolean;
|
|
551
|
+
/** The landing's field that names an arrival, so a repeat is dropped. */
|
|
552
|
+
identity?: string;
|
|
477
553
|
/**
|
|
478
|
-
*
|
|
479
|
-
*
|
|
480
|
-
*
|
|
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
|
-
*
|
|
554
|
+
* The landing's field that changes when an arrival changes. Without one,
|
|
555
|
+
* only a new member counts as an arrival; a change that makes an existing
|
|
556
|
+
* member match is not seen.
|
|
494
557
|
*/
|
|
495
|
-
|
|
558
|
+
version?: string;
|
|
496
559
|
/**
|
|
497
560
|
* This edge's LANDING TYPE is generic over the CONSTRUCTION SITE: the literal
|
|
498
561
|
* value(s) the write body gives `field` fix the landing's shape. An ask's
|
|
@@ -523,6 +586,28 @@ export interface EdgeSchema {
|
|
|
523
586
|
field: string;
|
|
524
587
|
onNonLiteral?: 'error' | 'warn';
|
|
525
588
|
};
|
|
589
|
+
/**
|
|
590
|
+
* Fields of what lands on this edge that take the literals the write it
|
|
591
|
+
* hangs off wrote at a path: `{ at: ['Actions', 'Value'], from:
|
|
592
|
+
* 'Buttons[].Value' }` makes the `Value` of each action an answer carries an
|
|
593
|
+
* enum of exactly the `Value`s of the buttons written. `at` walks from the
|
|
594
|
+
* landing by edge names and ends at the field; `from` is the write's field,
|
|
595
|
+
* `[]` going into each entry of a list and `.` into a field of an entry. A
|
|
596
|
+
* value there that is not a text literal leaves the field its declared type,
|
|
597
|
+
* with a warning (MOV_WRITE_GENERIC_UNTYPED).
|
|
598
|
+
*/
|
|
599
|
+
literalsFrom?: {
|
|
600
|
+
at: string[];
|
|
601
|
+
from: string;
|
|
602
|
+
}[];
|
|
603
|
+
/**
|
|
604
|
+
* The field of the write this edge hangs off that names a node declared in
|
|
605
|
+
* the program (`Fields: Refund`): what lands here has that node's fields
|
|
606
|
+
* too, typed as the node declares them. The field's value reaches the
|
|
607
|
+
* module as the node's fields (`{ fields: { <name>: <field type> } }`).
|
|
608
|
+
* A value there that is not a node is MOV_ANSWER_SHAPE.
|
|
609
|
+
*/
|
|
610
|
+
answerShapeFrom?: string;
|
|
526
611
|
/**
|
|
527
612
|
* The edge is the one the system declared as its records' resources (the
|
|
528
613
|
* describe's reserved `_resources` reference — the knowledge graph's
|
|
@@ -688,6 +773,20 @@ export interface PositionSchema {
|
|
|
688
773
|
/** What the adapter says each field is, by name — every field it described,
|
|
689
774
|
* readable or write-only. */
|
|
690
775
|
fieldDocs?: Record<string, string>;
|
|
776
|
+
/** The id its module keys a record's field by, by the field's name, where
|
|
777
|
+
* the two differ: a host reads an arrival's fields by name before judging
|
|
778
|
+
* it, as a run reads them. */
|
|
779
|
+
fieldIds?: Record<string, string>;
|
|
780
|
+
/** The fields whose meaning its module changed in a release, by name: a
|
|
781
|
+
* check for an upgrade from before that release warns where a program
|
|
782
|
+
* reads one (gmail's `Labels`, ids before 0.13 and names since).
|
|
783
|
+
* `unchangedValues`: the values whose meaning did not change; a comparison
|
|
784
|
+
* with literals all among them is not warned. */
|
|
785
|
+
changedFields?: Record<string, {
|
|
786
|
+
release: string;
|
|
787
|
+
note: string;
|
|
788
|
+
unchangedValues?: string[];
|
|
789
|
+
}>;
|
|
691
790
|
}
|
|
692
791
|
/**
|
|
693
792
|
* A DISCRIMINATED write shape — the write-side dual of read narrowing. On the
|
|
@@ -873,12 +972,19 @@ export interface WritableRootSchema {
|
|
|
873
972
|
* stays silent.
|
|
874
973
|
*
|
|
875
974
|
*/
|
|
876
|
-
export interface CollectionSchema {
|
|
975
|
+
export interface CollectionSchema extends EdgeListening {
|
|
877
976
|
/** The position type name the collection's members land on. */
|
|
878
977
|
target: string;
|
|
879
978
|
/** Whether — and how — filter / order / limit push across this collection.
|
|
880
979
|
* Read by the hop gate exactly as `EdgeSchema.capability` is. */
|
|
881
980
|
capability?: EdgeCapability;
|
|
981
|
+
/** Absent: it can be listed. `false`: it is only written to or listened to. */
|
|
982
|
+
readable?: false;
|
|
983
|
+
/** As `EdgeSchema.listenable`, `cursor`, `identity` and `version` say. */
|
|
984
|
+
listenable?: true;
|
|
985
|
+
cursor?: boolean;
|
|
986
|
+
identity?: string;
|
|
987
|
+
version?: string;
|
|
882
988
|
}
|
|
883
989
|
/**
|
|
884
990
|
* The schema of a constructed instance — produced per construction because
|
|
@@ -972,6 +1078,15 @@ export interface InstanceSchema {
|
|
|
972
1078
|
* carry may belong to one member, and narrowing is how it becomes readable.
|
|
973
1079
|
*/
|
|
974
1080
|
narrowBy?: Record<string, string[]>;
|
|
1081
|
+
/**
|
|
1082
|
+
* A hop's `WHERE` the host evaluated over a type's members and found to
|
|
1083
|
+
* select none of them, under the same `refinementKey` as `refinements`: the
|
|
1084
|
+
* members there are, by name. The checker refuses the hop where it is
|
|
1085
|
+
* written (`MOV_UNKNOWN_POSITION`), naming them. Absent ⇒ either the WHERE
|
|
1086
|
+
* selected a member (`refinements`) or the members could not decide it, and
|
|
1087
|
+
* the hop stays on the unnarrowed type.
|
|
1088
|
+
*/
|
|
1089
|
+
unselected?: Record<string, string[]>;
|
|
975
1090
|
/**
|
|
976
1091
|
* Construction-site landings (2026-07-30): positions synthesized from ONE
|
|
977
1092
|
* write's own literals, keyed by `genericLandingKey`. The refinements
|
|
@@ -986,71 +1101,6 @@ export interface InstanceSchema {
|
|
|
986
1101
|
*
|
|
987
1102
|
*/
|
|
988
1103
|
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
1104
|
}
|
|
1055
1105
|
/**
|
|
1056
1106
|
* Canonical key into `InstanceSchema.refinements`: the hop's target type plus
|
|
@@ -1208,15 +1258,16 @@ export declare function isArtificialEdge(edge: string): boolean;
|
|
|
1208
1258
|
*/
|
|
1209
1259
|
export declare function eventAddressEventName(key: string): string;
|
|
1210
1260
|
/**
|
|
1211
|
-
* What an adapter SURFACE can declare — every field type
|
|
1212
|
-
*
|
|
1261
|
+
* What an adapter SURFACE can declare — every field type, nested collections
|
|
1262
|
+
* included, a record by the name of its position.
|
|
1213
1263
|
*
|
|
1214
|
-
* A record
|
|
1215
|
-
*
|
|
1216
|
-
*
|
|
1217
|
-
*
|
|
1218
|
-
*
|
|
1219
|
-
*
|
|
1264
|
+
* A record field holds a record as its value (a change's row before and
|
|
1265
|
+
* after), read on with `.` and never fetched. It names its position as the
|
|
1266
|
+
* checker's `PositionTypeRef` does, less the instance: the schema declaring
|
|
1267
|
+
* it is the instance's own. That is what keeps a schema clear of the position
|
|
1268
|
+
* model — a schema crosses the wire (`InstanceSchema` is a tRPC response),
|
|
1269
|
+
* and a field type that carried an instance would reach back into schemas
|
|
1270
|
+
* again, a cycle no serialiser's type can follow.
|
|
1220
1271
|
*
|
|
1221
1272
|
* The collections are spelled a second time because TypeScript cannot subtract
|
|
1222
1273
|
* a member from a RECURSIVE union — `Exclude` removes the record at the top
|
|
@@ -1241,9 +1292,36 @@ export type SchemaFieldType = 'text' | 'number' | 'boolean' | 'date' | 'datetime
|
|
|
1241
1292
|
open?: {
|
|
1242
1293
|
allowPattern?: string;
|
|
1243
1294
|
};
|
|
1295
|
+
}
|
|
1296
|
+
/** A named scalar its owner (the module that declared it) parses: a cron
|
|
1297
|
+
* schedule, a mailbox key. `allowPattern` is the least an owner says of
|
|
1298
|
+
* its values; `format`, a format the checker validates a literal by. */
|
|
1299
|
+
| {
|
|
1300
|
+
kind: 'owned';
|
|
1301
|
+
name: string;
|
|
1302
|
+
owner: string;
|
|
1303
|
+
allowPattern?: string;
|
|
1304
|
+
format?: 'cron' | 'timeZone';
|
|
1244
1305
|
} | {
|
|
1245
1306
|
kind: 'maybeAbsent';
|
|
1246
1307
|
of: SchemaFieldType;
|
|
1308
|
+
}
|
|
1309
|
+
/** A record's fields held as the field's value (`c.Current`): typed as a
|
|
1310
|
+
* plain object of that position's fields, never as the record. It has no
|
|
1311
|
+
* edges and no identity, so a checker refuses a walk, a write or a record
|
|
1312
|
+
* parameter on it, bound to a name or not. */
|
|
1313
|
+
| {
|
|
1314
|
+
kind: 'record';
|
|
1315
|
+
position: SchemaPositionRef;
|
|
1316
|
+
};
|
|
1317
|
+
/** Which record a `record` field holds: one record type of the instance, or
|
|
1318
|
+
* one of several (`unions`). */
|
|
1319
|
+
export type SchemaPositionRef = {
|
|
1320
|
+
kind: 'position';
|
|
1321
|
+
position: string;
|
|
1322
|
+
} | {
|
|
1323
|
+
kind: 'union';
|
|
1324
|
+
union: string;
|
|
1247
1325
|
};
|
|
1248
1326
|
/** `T | absent` over a surface type; a surface type in is a surface type out. */
|
|
1249
1327
|
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),
|
|
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). */
|