@listen-fire/engine-contracts 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.
Files changed (49) hide show
  1. package/dist/adapter.d.ts +64 -180
  2. package/dist/arrivals.d.ts +82 -0
  3. package/dist/arrivals.js +9 -0
  4. package/dist/catalog.d.ts +393 -57
  5. package/dist/catalog.js +689 -78
  6. package/dist/config_blocks.d.ts +99 -0
  7. package/dist/config_blocks.js +76 -0
  8. package/dist/conformance/arrival-triggers.json +51 -0
  9. package/dist/conformance/expression-samples.json +815 -0
  10. package/dist/conformance/index.d.ts +1 -0
  11. package/dist/conformance/index.js +3 -1
  12. package/dist/conformance/listen-arrivals.json +1818 -0
  13. package/dist/conformance/listen-field-names.json +47 -0
  14. package/dist/conformance/listen-hears.json +11 -0
  15. package/dist/conformance/listen-landings.json +98 -0
  16. package/dist/conformance/listen-pipelines.json +98 -0
  17. package/dist/conformance/listen_arrivals.d.ts +26 -0
  18. package/dist/conformance/listen_arrivals.js +34 -0
  19. package/dist/conformance/recording.d.ts +286 -128
  20. package/dist/conformance/recording.js +20 -12
  21. package/dist/conformance/store-waits.json +695 -0
  22. package/dist/conformance/taken-comparisons.json +911 -0
  23. package/dist/event.d.ts +42 -2
  24. package/dist/event.js +34 -2
  25. package/dist/expression/expression.js +17 -8
  26. package/dist/expression/schemas.d.ts +106 -74
  27. package/dist/expression/schemas.js +18 -2
  28. package/dist/file_ref.js +3 -0
  29. package/dist/host_families.d.ts +63 -10
  30. package/dist/host_families.js +2 -3
  31. package/dist/index.d.ts +3 -3
  32. package/dist/index.js +3 -3
  33. package/dist/listen_plan.d.ts +116 -0
  34. package/dist/listen_plan.js +86 -0
  35. package/dist/park_state.d.ts +19 -17
  36. package/dist/park_state.js +1 -1
  37. package/dist/protocol.d.ts +773 -197
  38. package/dist/protocol.js +261 -106
  39. package/dist/run_input.d.ts +5 -7
  40. package/dist/run_input.js +1 -1
  41. package/dist/versions.d.ts +13 -12
  42. package/dist/versions.js +14 -8
  43. package/package.json +2 -2
  44. package/dist/awaitable.d.ts +0 -65
  45. package/dist/awaitable.js +0 -13
  46. package/dist/callback.d.ts +0 -24
  47. package/dist/callback.js +0 -19
  48. package/dist/trigger_config.d.ts +0 -154
  49. package/dist/trigger_config.js +0 -116
package/dist/adapter.d.ts CHANGED
@@ -1,15 +1,16 @@
1
1
  import type { ExternalRecordRef, FieldEvidence, Resource } from './records';
2
2
  import type { TriggerEvent, TriggerType } from './event';
3
3
  import type { MutationContext } from './mutation_context';
4
- import type { AwaitableCapability } from './awaitable';
4
+ import type { Arrival, ArrivalsCapability } from './arrivals';
5
5
  import type { Actor } from './mutation_context';
6
6
  import type { UniquenessConstraints } from './uniqueness';
7
- import type { ConfigBlock } from './trigger_config';
7
+ import type { ConfigBlock } from './config_blocks';
8
8
  import type { HandbookSection } from './handbook_section';
9
9
  import type { WireCheckInboundInputShape } from './protocol';
10
10
  import type { SchemaEntryPoint, SchemaTypeDescriptor, SourcePosition } from './catalog';
11
11
  import type { Expression } from '@listen-fire/movement-lang/expression/types';
12
- export type { ConfigBlock, TriggerConfigField } from './trigger_config';
12
+ import type { SettingsBecome } from '@listen-fire/movement-lang';
13
+ export type { ConfigBlock } from './config_blocks';
13
14
  export { fileDescriptorOf, fileHandle, fileValue, fileValueOf, filesAtType, isFileValue, ownedFileSource } from './file_ref';
14
15
  export type { EarlierFileSource, FileRef, FileSource, FileValue } from './file_ref';
15
16
  export type { ExternalRecordRef, Fact, FieldEvidence, Resource, ResourceProvenance } from './records';
@@ -213,29 +214,6 @@ export interface AdapterManifest {
213
214
  * shipping something that can never fire. Absent ⇒ nothing missing.
214
215
  */
215
216
  configurationGap?: string;
216
- /**
217
- * Config BLOCKS rendered for this adapter's TRIGGER role — the per-trigger
218
- * config on the automation detail page. An ordered {@link ConfigBlock} list:
219
- * value blocks (input/slug/select) collect values that persist to
220
- * `automations.trigger.config`; presentation blocks (section) frame them; an
221
- * action block (rare here) dispatches to an app handler. Carried on the
222
- * manifest so construction-free readers (the movement catalog's listen
223
- * vocabulary, provisioning, the adapters/trigger views) can see it without
224
- * building the adapter. The adapter instance's `triggerConfig` references it.
225
- *
226
- * This is the widened successor to the former `triggerConfigSchema`
227
- * (`TriggerConfigField[]`) — value blocks ARE that union; section/action are
228
- * the new arms. It is also where an adapter declares its INBOUND ROUTING KEY
229
- * (a value block marked `routingKey`) — the de-named successor to the former
230
- * `inboundChannel: 'forwarding-address'` flag. An adapter whose events arrive
231
- * addressed by a key (email's plus-suffix `key`) declares that block here,
232
- * and the framework routes generically off the declaration; there is no named
233
- * "forwarding address" concept in the engine.
234
- *
235
- * Omitted ⇒ the adapter's trigger role needs no user-editable config.
236
- *
237
- */
238
- triggerConfig?: readonly ConfigBlock[];
239
217
  /**
240
218
  * Config BLOCKS rendered for this adapter's CONSTRUCTION role — shown at an
241
219
  * adapter-instance slot in the movement editor (and the chat equivalent).
@@ -247,52 +225,15 @@ export interface AdapterManifest {
247
225
  */
248
226
  construction?: readonly ConfigBlock[];
249
227
  /**
250
- * The adapter's subscribable-event vocabulary — the named events external
251
- * subscriptions can be registered for (attio: `record.created` /
252
- * `record.updated` / `record.deleted`; the KG: its mutation change kinds
253
- * `create` / `update` / `delete`). One declaration drives:
254
- * - listen-config validation: a `listen to <instance> { events: […] }`
255
- * value outside this set is rejected at check time (the movement
256
- * catalog projects it as the `events` key's value vocabulary);
257
- * - subscription provisioning: `ensureEventSubscription` receives the
258
- * union of the events the team's listens actually want.
259
- * Omitted ⇒ the adapter declares no subscribable events (its channel is
260
- * push-free or interpreted elsewhere — inbound email routed by its
261
- * `key`, the web Send box).
262
- */
263
- subscribableEvents?: readonly string[];
264
- /**
265
- * The `events:` selection a listen WITHOUT one is subscribed to — the
266
- * adapter's own dispatch default, declared so the checker derives the same
267
- * event type the runtime will deliver. WhatsApp is the motivating case: a
268
- * config-less listen receives MESSAGES ONLY (`triggerAcceptsWhatsappKind`),
269
- * so reactions/locations never fire a movement that didn't opt in — and the
270
- * checker must not type a config-less listen as delivering them. Absent ⇒
271
- * every subscribable event (the attio/airtable registration default).
272
- */
273
- defaultSubscribedEvents?: readonly string[];
274
- /**
275
- * Listen-config keys whose VALUES jointly scope an external subscription
276
- * channel, beyond the (adapter, credential) pair. Airtable's `['base',
277
- * 'table']` is the motivating case: webhooks are per-(base, table), so two
278
- * listens on different tables need distinct registrations. The listen
279
- * reconciler folds these config values into the channel key (one
280
- * `webhook_subscription` row + external webhook per distinct scope) and passes
281
- * them as `EnsureEventSubscriptionInput.scope`. Omitted ⇒ one channel per
282
- * (adapter, credential) — the Attio default.
283
- *
284
- */
285
- subscriptionScopeKeys?: readonly string[];
286
- /**
287
- * Additional listen routing-config keys this adapter declares, beyond
288
- * the derived ones (the inbound routing `key` from `triggerConfigSchema`,
289
- * the subscribable `events`). Each entry names the key, whether a listen MUST carry it,
290
- * and an optional value format the checker validates statically
291
- * (`'cron'` — a five-field cron expression, see movement-lang/cron).
292
- * The cron adapter's `schedule` is the motivating case:
293
- * `listen to timer { schedule: "0 9 * * 1" } fire digest`.
228
+ * What a 0.12 settings listen on this module becomes as a traversal in 0.13
229
+ * (`listen to x { events: [...] }` → `listen to x-[n:Notifications WHERE
230
+ * n.Reason IN [...]]->`): the edges from the connection to the listened
231
+ * edge, an alias per hop, the 0.12 event position a fired parameter was
232
+ * typed as, and the hop and field each settings key narrows.
233
+ * `listen-fire upgrade` rewrites a settings listen by it; a key it does not
234
+ * map leaves the listen for the author.
294
235
  */
295
- listenConfig?: readonly ListenConfigKey[];
236
+ listenSettingsBecome?: SettingsBecome;
296
237
  /**
297
238
  * Plain-language truth about WHAT a listener on this adapter actually fires
298
239
  * on — surfaced to the authoring agent via `describeInstance` so it grounds
@@ -327,6 +268,12 @@ export interface AdapterManifest {
327
268
  * describeInstance costs upstream API calls, so callers should scope with
328
269
  * `types`. Absent/false = the schema is static and describing is free. */
329
270
  introspectedSchema?: boolean;
271
+ /**
272
+ * How long, in seconds, the provider may re-send an arrival it already sent
273
+ * (Stripe retries an event for three days): the host drops a repeat inside
274
+ * it by identity. A default: lf.yaml overrides it per connection.
275
+ */
276
+ resendWindowSeconds?: number;
330
277
  /**
331
278
  * Construction args that pick the instance's ENTRY POSITION — the node the
332
279
  * cursor starts at, instead of the meta node (Sheets' `spreadsheet:`,
@@ -377,8 +324,8 @@ export interface EventPhraseTemplate {
377
324
  }
378
325
  /**
379
326
  * The adapter's event-phrasing vocabulary — "When an email arrives at …",
380
- * "When a record changes in Attio". Keyed by the adapter's own
381
- * `subscribableEvents` names where it has discrete events (Attio's
327
+ * "When a record changes in Attio". Keyed by the adapter's own event
328
+ * names where it has discrete events (Attio's
382
329
  * `record.created`, the KG's `create`); `default` is rendered when the
383
330
  * config's selected events don't match a more specific key, or the adapter
384
331
  * has no discrete event vocabulary at all (email, Slack — one implicit
@@ -404,79 +351,25 @@ interface PositionArg {
404
351
  /** Author-facing label (defaults to `name`). */
405
352
  label?: string;
406
353
  }
407
- /** One adapter-declared listen routing-config key (see
408
- * `AdapterManifest.listenConfig`). */
409
- export interface ListenConfigKey {
410
- key: string;
411
- /** A listen on this adapter must carry the key. */
412
- required?: boolean;
413
- /** Static value validation the movement checker applies. `'cron'` = a
414
- * five-field cron expression; `'timezone'` = an IANA time-zone id;
415
- * `'fields'` = a list of BARE property names, validated against the position
416
- * the listen's address lands on (the changed-attribute filter — any adapter
417
- * with a "only fire when one of these changed" surface declares it);
418
- * `'strings'` = a non-empty list of non-empty quoted strings (Gmail's
419
- * `labels`); `'type'` = a node the program declares (`payload: <Payment>`),
420
- * which the listen's events are typed as; `'field'` = one quoted field name
421
- * of the record the listen's address lands on; `'field-value'` = a literal
422
- * value of the field the `'field'`-format key names, held to that field's
423
- * type (an adapter declaring it declares exactly one `'field'` key). */
424
- format?: 'cron' | 'timezone' | 'fields' | 'strings' | 'type' | 'field' | 'field-value';
425
- /**
426
- * This key is one HOP of the address that narrows the event's record edge.
427
- *
428
- * A listen is shorthand for a WHERE. `listen to at { base: "appDevLoop",
429
- * table: "tblDeals" }` says which table the event's `record` edge lands on,
430
- * so the author must not have to restate it in the movement — the config IS
431
- * the address.
432
- *
433
- * The keys that declare `narrows` form a PATH, in declaration order, each hop
434
- * selecting a member of `collection` whose published data has `matchField`
435
- * equal to the config value:
436
- *
437
- * -[:Base WHERE `Id` == "appDevLoop"]->-[:Table WHERE `Id` == "tblDeals"]->
438
- *
439
- * A path, NOT one hop with a compound WHERE — that is the whole cost
440
- * argument. Read as one hop, "narrowed by (base, table)" must know the valid
441
- * (base, table) pairs, which is a `listTables` per base: the 1+N this plan
442
- * exists to kill. As a path the base resolves first (1 call) and only THAT
443
- * base's tables are walked (1 call).
444
- *
445
- * The final hop's `collection` is the type the record edge narrows FROM —
446
- * an event edge targeting it is retargeted at whatever the walk landed on.
447
- *
448
- */
449
- narrows?: {
450
- /** The meta-graph collection whose members this hop selects from
451
- * (Airtable's `Base`, then `Table`). */
452
- collection: string;
453
- /** The field of a member's PUBLISHED DATA the config value is matched
454
- * against. A listen names things by ID while type-space addresses by NAME,
455
- * so this is normally the id field — and the adapter must publish it on
456
- * the member's position or nothing can narrow. */
457
- matchField: string;
458
- };
459
- }
354
+ /** A subscription for one listenable edge's arrivals (adapter protocol
355
+ * 2.6), made once for every listen on the same connection, edge, filter and
356
+ * scope, when the edge declares `delivery: connection` or `scope`. */
460
357
  export interface EnsureEventSubscriptionInput {
461
- /** The events the subscription should now cover — the union of every
462
- * listen's `events` config on this (adapter, credential[, scope]) channel,
463
- * defaulting to the manifest's full `subscribableEvents`. */
464
- events: string[];
465
- /** The stable per-channel URL the source should POST to. */
358
+ /** The edge, by its name in the schema (`Notes`). */
359
+ edge: string;
360
+ /** The part of the listens' WHERE on the edge the adapter takes; absent
361
+ * when it takes none of it. */
362
+ filter?: unknown;
363
+ /** The record the edge hangs off, by its id, when the listens watch it
364
+ * under one; absent for the whole connection. */
365
+ scope?: string;
366
+ /** The stable per-subscription URL the source should POST to. */
466
367
  callbackUrl: string;
467
- /** The registration currently held for this URL, when one exists — the
468
- * diff-sync input. `events` is what the source is registered for now. */
368
+ /** The registration currently held for this URL, when one exists: keep
369
+ * it rather than adding another. */
469
370
  current?: {
470
371
  externalId?: string;
471
- events: string[];
472
372
  };
473
- /**
474
- * The channel's adapter-declared scope (the `subscriptionScopeKeys` config
475
- * values) — e.g. Airtable's `{ base, table }`. Empty/absent for adapters
476
- * whose channel is just (adapter, credential). The adapter reads what it
477
- * declared; the reconciler passes it through opaquely.
478
- */
479
- scope?: Record<string, string>;
480
373
  }
481
374
  /** What the source issued — the platform persists it on the subscription
482
375
  * row (the secret verifies inbound signatures). Returning `undefined`
@@ -494,7 +387,7 @@ export interface EventSubscriptionRegistration {
494
387
  export interface RefreshEventSubscriptionInput {
495
388
  /** The source-issued id of the subscription to extend. */
496
389
  externalId: string;
497
- /** The channel's scope (mirrors {@link EnsureEventSubscriptionInput.scope}). */
390
+ /** A 0.12 settings listen's webhook's scope (Airtable's `{ base, table }`). */
498
391
  scope?: Record<string, string>;
499
392
  }
500
393
  /** A refreshed subscription: when it now expires, when the source says. */
@@ -505,22 +398,22 @@ export interface RemoveEventSubscriptionInput {
505
398
  callbackUrl: string;
506
399
  /** The source-issued id held for this URL, when one exists. */
507
400
  externalId?: string;
508
- /** The channel's adapter-declared scope (mirrors
509
- * {@link EnsureEventSubscriptionInput.scope}) — Airtable's per-base delete
510
- * needs the `base` to address the webhook. Absent for unscoped channels. */
401
+ /** A 0.12 settings listen's webhook's adapter-declared scope: Airtable's
402
+ * per-base delete needs the `base` to address the webhook. Absent for
403
+ * unscoped channels. */
511
404
  scope?: Record<string, string>;
512
405
  }
513
406
  export interface Adapter {
514
407
  /** Stable identifier — matches `MutationContext.source.adapterType`. */
515
408
  readonly adapterType: string;
516
409
  /**
517
- * The AWAITABLE capability (asks-as-adapter §A) — present ONLY on adapters
518
- * that advertise awaitable edges (`await x-[:E]->`). It answers whether an
519
- * awaited edge has resolved and, if not, the key that will wake it; the engine
520
- * keeps the correlation itself. Absent on every ordinary adapter.
521
- * Delivery-orthogonal (P12) — this is not rendering or delivery.
410
+ * Arrivals (adapter protocol 2.5) — present on adapters with listenable
411
+ * edges. It names the key each record's edge is waited on under; what
412
+ * lands there the adapter reports with the inbound delivery it read
413
+ * (`preprocessInbound`'s or `checkInbound`'s `arrivals`) or at the `wake`
414
+ * door. The host keeps the waits and the log of arrivals.
522
415
  */
523
- readonly awaitable?: AwaitableCapability;
416
+ readonly arrivals?: ArrivalsCapability;
524
417
  /**
525
418
  * Triggers this adapter declares it can fire (P11). Poll is universal
526
419
  * fallback, not framework default. Snapshot/changes-feed/webhook/mutation
@@ -634,23 +527,11 @@ export interface Adapter {
634
527
  */
635
528
  readonly metaRecordType?: string;
636
529
  /**
637
- * Config blocks this adapter exposes for its trigger role — the
638
- * {@link ConfigBlock} list a user's automation-detail form renders for a
639
- * `automations.trigger` whose `kind` resolves to this adapter (e.g. the
640
- * inbound-email forwarding-address framing + slug). One declaration drives
641
- * the form, the write-path validation (`updateTriggerConfig`), and the
642
- * runtime config-validity check. Pure config; omitted by adapters whose
643
- * trigger role needs no user-editable settings. Mirrors the manifest's
644
- * `triggerConfig`.
645
- *
646
- */
647
- readonly triggerConfig?: readonly ConfigBlock[];
648
- /**
649
- * Ensure the source system delivers the named events to `callbackUrl` —
530
+ * Ensure the source system delivers an edge's arrivals to `callbackUrl` —
650
531
  * the listen-reconciliation seam (see the module-level event-subscription
651
- * notes above `EnsureEventSubscriptionInput`). Idempotent: called with
652
- * the full desired event set every time the team's listens change; the
653
- * adapter diffs against `current` and registers / updates as needed.
532
+ * notes above `EnsureEventSubscriptionInput`). Idempotent: called each time
533
+ * the listens sharing the subscription change; the adapter keeps
534
+ * `current` where it is still registered.
654
535
  * Implemented for real where the source has a subscription API (attio
655
536
  * webhooks); a documented no-op (return undefined) where it doesn't;
656
537
  * omitted where events need no external registration at all.
@@ -728,22 +609,14 @@ export interface Adapter {
728
609
  checkpoint?: unknown;
729
610
  }): Promise<{
730
611
  events: DiscriminableEvent[];
612
+ /** What the delivery says landed on listenable edges (2.5). */
613
+ arrivals?: Arrival[];
731
614
  checkpoint?: unknown;
732
615
  }>;
733
- /**
734
- * The wake door, separate from `preprocessInbound`'s events: the correlation
735
- * keys (as `awaitable.resolveAwait` names them when pending) that this raw
736
- * inbound payload may have resolved. The engine resumes whatever is parked on
737
- * them; a key nothing waits on is a no-op. No ordering against the events —
738
- * a resumed await re-checks live, so it never relies on the payload.
739
- */
740
- wakeKeys?(input: {
741
- raw: unknown;
742
- }): Promise<string[]>;
743
616
  /**
744
617
  * The module checks its own inbound requests (its manifest declares
745
618
  * `inbound.scheme: module`): one request at its door, raw, in place of the
746
- * host's signature check, `preprocessInbound` and `wakeKeys`. The answer is
619
+ * host's signature check and `preprocessInbound`. The answer is
747
620
  * its events, a refusal, or a reply the host sends as it is (a handshake).
748
621
  */
749
622
  checkInbound?(input: InboundCheckInput): Promise<InboundCheck>;
@@ -1572,22 +1445,33 @@ export type InboundCheckInput = WireCheckInboundInputShape;
1572
1445
  export type InboundCheck = {
1573
1446
  outcome: 'accepted';
1574
1447
  events: DiscriminableEvent[];
1575
- wakeKeys?: string[];
1448
+ /** What the request says landed on listenable edges (2.5). */
1449
+ arrivals?: Arrival[];
1576
1450
  checkpoint?: unknown;
1577
1451
  /** The provider's id for this delivery: a redelivery under an id the
1578
1452
  * host kept before is acked and runs nothing. */
1579
1453
  deliveryId?: string;
1454
+ /** What the door answers once the delivery is kept, in place of its
1455
+ * own acknowledgement: a 2xx with `text`, `html` or `json`. */
1456
+ reply?: {
1457
+ status: number;
1458
+ text?: string;
1459
+ html?: string;
1460
+ json?: unknown;
1461
+ };
1580
1462
  }
1581
1463
  /** The host answers `status` (401 when absent) with `signature_invalid`. */
1582
1464
  | {
1583
1465
  outcome: 'refused';
1584
1466
  status?: number;
1585
1467
  }
1586
- /** Sent as it is, nothing run: `text` as text/plain, `json` as JSON. */
1468
+ /** Sent as it is, nothing run: `text` as text/plain, `html` as text/html,
1469
+ * `json` as JSON. */
1587
1470
  | {
1588
1471
  outcome: 'reply';
1589
1472
  status: number;
1590
1473
  text?: string;
1474
+ html?: string;
1591
1475
  json?: unknown;
1592
1476
  };
1593
1477
  export interface ReadInput {
@@ -0,0 +1,82 @@
1
+ import type { ActorIdentity } from './adapter';
2
+ /** A record a run waits on: the id its write answered, the data it
3
+ * carried (Slack keys a thread by the channel in it, not by its id), and its
4
+ * record type, as the module names it, wherever the host knows it (2.6). A
5
+ * module whose ids collide across its record types qualifies its keys by it,
6
+ * in the answer and in each arrival's `key` alike. */
7
+ export interface AwaitHead {
8
+ recordId: string;
9
+ headData?: Record<string, unknown>;
10
+ recordType?: string;
11
+ }
12
+ /** The key one head's edge is waited on under, or the record is gone and
13
+ * nothing more arrives on it. */
14
+ export type AwaitKey = {
15
+ key: string;
16
+ } | {
17
+ gone: true;
18
+ };
19
+ /** One landing along a listenable edge. Its `fields` are read back through
20
+ * the module's own `getFieldValue` for `recordType`. */
21
+ export interface AwaitLanding {
22
+ recordId?: string;
23
+ recordType?: string;
24
+ fields: Record<string, unknown>;
25
+ /** The fields the module could not read for it (a lookup its provider did
26
+ * not answer: Slack's channel `Name`, a message's `Mentions App`): a
27
+ * listen whose filter reads one cannot be judged, and the host reports it
28
+ * (2.6). Whatever `fields` holds for one is not read by the judge. */
29
+ unknown?: string[];
30
+ }
31
+ /** One arrival on the edge of the record `key` names. `identity` is the
32
+ * landing's value of the field the edge declares as its identity; `version`
33
+ * of its version field. A gone arrival says the record went: nothing more
34
+ * arrives on its edges. */
35
+ export type Arrival = {
36
+ edge: string;
37
+ /** The record whose edge it landed on; absent on one of the
38
+ * connection's root edges (2.6), which no wait is on. */
39
+ key?: string;
40
+ identity: string;
41
+ version?: string;
42
+ landing: AwaitLanding;
43
+ /** The records it carries from the earlier hops the edge declares
44
+ * (`carries`), in that order; null for one it cannot carry (2.6). */
45
+ parents?: (AwaitLanding | null)[];
46
+ /** The record the arrival is about, when that is not its landing: a
47
+ * change to a row names the row (2.6). */
48
+ about?: {
49
+ recordType: string;
50
+ externalId: string;
51
+ };
52
+ /** The listen it must not run, by its pipeline (on listen-fire
53
+ * `listen:<file>:<movement>:<digest>`, the first 8 hex digits of the
54
+ * sha256 of the listen's identity): its own failure, reported to the
55
+ * listens on the edge it failed on (2.6). */
56
+ notFor?: string;
57
+ /** The module applied the listen's taken filter before reporting it
58
+ * (a filtered poll or subscription): the host does not judge it again (2.6). */
59
+ takenApplied?: boolean;
60
+ /** When it happened at its provider (an ISO instant), where the
61
+ * provider says: a host measures from it whether a run's write caused
62
+ * it, however late a poll finds it (2.6), and the run it fires
63
+ * stamps its writes with it (2.7). */
64
+ occurredAt?: string;
65
+ /** Who acted, where the provider says: the member who posted, the
66
+ * sender of the mail, the owner of the meeting (2.7). The run's
67
+ * `@actor_*` reads it, and a host resolves the acting user from it;
68
+ * set at the door, so nothing after it needs the raw event. */
69
+ actor?: ActorIdentity;
70
+ } | {
71
+ edge: string;
72
+ key: string;
73
+ gone: true;
74
+ };
75
+ export interface ArrivalsCapability {
76
+ /** The key each head's `edge` is waited on under, in the order of `heads`.
77
+ * Computed from the heads alone: no call to the system. */
78
+ awaitKeys(input: {
79
+ edge: string;
80
+ heads: AwaitHead[];
81
+ }): Promise<AwaitKey[]>;
82
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ // Arrivals (adapter protocol 2.5; 2.6 for root edges, carried parents and
3
+ // listens): what lands on a listenable edge, reported by the module that owns it. The host keeps the waiting state: a log of
4
+ // arrivals per record's edge, and a wait per run that reads it. The module
5
+ // answers two things only. Which key names the edge of each record a run
6
+ // waits on (`awaitKeys`), and, with each inbound delivery it reads, what
7
+ // arrived on which key (`arrivals` on its acceptance, or the `wake` door).
8
+ // No run identity crosses into the module.
9
+ Object.defineProperty(exports, "__esModule", { value: true });