@ai-matrx/records 0.92.1 → 0.93.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/README.md +4 -4
  3. package/dist/{client-Dzd8gtAo.d.ts → client-DsPuWFp0.d.ts} +8 -8
  4. package/dist/{client-Cn3odIIB.d.cts → client-EyD3rS0T.d.cts} +8 -8
  5. package/dist/core/index.cjs +101 -32
  6. package/dist/core/index.cjs.map +1 -1
  7. package/dist/core/index.d.cts +16 -15
  8. package/dist/core/index.d.ts +16 -15
  9. package/dist/core/index.js +101 -32
  10. package/dist/core/index.js.map +1 -1
  11. package/dist/data/index.cjs +46 -24
  12. package/dist/data/index.cjs.map +1 -1
  13. package/dist/data/index.d.cts +11 -11
  14. package/dist/data/index.d.ts +11 -11
  15. package/dist/data/index.js +46 -24
  16. package/dist/data/index.js.map +1 -1
  17. package/dist/{declareTable-CrL6AZKB.d.cts → declareTable-Bkk_Ewib.d.cts} +4 -4
  18. package/dist/{declareTable-ZRW5EsTQ.d.ts → declareTable-kL5qZoTe.d.ts} +4 -4
  19. package/dist/entity/index.cjs +43 -29
  20. package/dist/entity/index.cjs.map +1 -1
  21. package/dist/entity/index.d.cts +7 -6
  22. package/dist/entity/index.d.ts +7 -6
  23. package/dist/entity/index.js +43 -29
  24. package/dist/entity/index.js.map +1 -1
  25. package/dist/entity/react.cjs +43 -29
  26. package/dist/entity/react.cjs.map +1 -1
  27. package/dist/entity/react.js +43 -29
  28. package/dist/entity/react.js.map +1 -1
  29. package/dist/{field-CCY1rG9l.d.cts → field-6rwt4ejZ.d.cts} +1 -1
  30. package/dist/{field-enufS5ry.d.ts → field-B-WaVZnS.d.ts} +1 -1
  31. package/dist/forms/index.d.cts +3 -3
  32. package/dist/forms/index.d.ts +3 -3
  33. package/dist/index.cjs +92 -25
  34. package/dist/index.cjs.map +1 -1
  35. package/dist/index.d.cts +13 -33
  36. package/dist/index.d.ts +13 -33
  37. package/dist/index.js +92 -25
  38. package/dist/index.js.map +1 -1
  39. package/dist/memory/index.d.cts +7 -7
  40. package/dist/memory/index.d.ts +7 -7
  41. package/dist/objectOrganization-BII_K3Gm.d.ts +45 -0
  42. package/dist/objectOrganization-DfjDQtDb.d.cts +45 -0
  43. package/dist/{port-C54ykAOv.d.ts → port--acgmxh5.d.ts} +5 -2
  44. package/dist/{port-Drioh9al.d.cts → port-Cx76dq-X.d.cts} +5 -2
  45. package/dist/{portal-DRdmZ-xv.d.cts → portal-9sRr6cpG.d.cts} +1 -1
  46. package/dist/{portal-or_f7BkT.d.ts → portal-BDAqsGkg.d.ts} +1 -1
  47. package/dist/{ports-s0D2jvqn.d.cts → ports-9BQ3zo2y.d.cts} +108 -2
  48. package/dist/{ports-BeOgjwYl.d.ts → ports-DYWE1ENo.d.ts} +108 -2
  49. package/dist/react/index.cjs +101 -32
  50. package/dist/react/index.cjs.map +1 -1
  51. package/dist/react/index.d.cts +1463 -1363
  52. package/dist/react/index.d.ts +1463 -1363
  53. package/dist/react/index.js +101 -32
  54. package/dist/react/index.js.map +1 -1
  55. package/dist/realtime/index.cjs +43 -13
  56. package/dist/realtime/index.cjs.map +1 -1
  57. package/dist/realtime/index.d.cts +9 -3
  58. package/dist/realtime/index.d.ts +9 -3
  59. package/dist/realtime/index.js +43 -13
  60. package/dist/realtime/index.js.map +1 -1
  61. package/dist/{record-BwCf9wKW.d.cts → record-DmmeuUrC.d.cts} +1 -1
  62. package/dist/{record-BwCf9wKW.d.ts → record-DmmeuUrC.d.ts} +1 -1
  63. package/dist/{relation-eLMgv_dV.d.ts → relation-Op1M67le.d.ts} +2 -2
  64. package/dist/{relation-8vAWCa67.d.cts → relation-qrb2NbHf.d.cts} +2 -2
  65. package/dist/{rule-wHI5B0Ka.d.cts → rule-CeHg1sy1.d.cts} +1 -1
  66. package/dist/{rule-D9yNiorf.d.ts → rule-tN2lxvJ1.d.ts} +1 -1
  67. package/dist/search/index.d.cts +1 -1
  68. package/dist/search/index.d.ts +1 -1
  69. package/dist/setup/index.cjs +117 -42
  70. package/dist/setup/index.cjs.map +1 -1
  71. package/dist/setup/index.d.cts +25 -11
  72. package/dist/setup/index.d.ts +25 -11
  73. package/dist/setup/index.js +117 -42
  74. package/dist/setup/index.js.map +1 -1
  75. package/dist/{subscription-CdoI-UaB.d.cts → subscription-Drbxn-9Z.d.cts} +3 -3
  76. package/dist/{subscription-BynsG1K6.d.ts → subscription-hdTaRrfK.d.ts} +3 -3
  77. package/dist/{table-kind-i3lZJa3f.d.ts → table-kind-BZkvzBgc.d.ts} +4 -29
  78. package/dist/{table-kind-DzctQ7dO.d.cts → table-kind-C-hZxDN7.d.cts} +4 -29
  79. package/dist/templates/index.d.cts +10 -10
  80. package/dist/templates/index.d.ts +10 -10
  81. package/dist/typed-table/index.cjs +46 -24
  82. package/dist/typed-table/index.cjs.map +1 -1
  83. package/dist/typed-table/index.d.cts +10 -10
  84. package/dist/typed-table/index.d.ts +10 -10
  85. package/dist/typed-table/index.js +46 -24
  86. package/dist/typed-table/index.js.map +1 -1
  87. package/dist/{types-BvL_oKFl.d.ts → types-BauAeFW8.d.ts} +2 -2
  88. package/dist/{types-DAFP6XFe.d.cts → types-CBmUdBT0.d.cts} +2 -2
  89. package/dist/{types-BKYEeFt4.d.cts → types-Dek9owBe.d.cts} +2 -2
  90. package/dist/{types-D8qdG3Lg.d.cts → types-DsgXrESm.d.cts} +2 -2
  91. package/dist/{types-cpKY7Pjb.d.ts → types-HVgWcZDY.d.ts} +2 -2
  92. package/dist/{types-DYzXhD7j.d.ts → types-hrw-Eff1.d.ts} +2 -2
  93. package/dist/use-cases/index.d.cts +5 -5
  94. package/dist/use-cases/index.d.ts +5 -5
  95. package/dist/{validate-DfNMxjmU.d.cts → validate-B_iUeyh2.d.cts} +1 -1
  96. package/dist/{validate-DbvAParj.d.ts → validate-w-HGGTf-.d.ts} +1 -1
  97. package/dist/views/index.cjs +438 -0
  98. package/dist/views/index.cjs.map +1 -0
  99. package/dist/views/index.d.cts +401 -0
  100. package/dist/views/index.d.ts +401 -0
  101. package/dist/views/index.js +415 -0
  102. package/dist/views/index.js.map +1 -0
  103. package/package.json +12 -2
@@ -11524,1135 +11524,595 @@ interface SubscriptionBlock {
11524
11524
  }
11525
11525
 
11526
11526
  /**
11527
- * The data seam: a structural subset of `SupabaseClient`. The package never
11528
- * opens a database connection of its own and never holds a key — the HOST
11529
- * supplies a client that already carries the operating person's session, which
11530
- * is what makes DOOR-5 and AGT-N-4 true (the store sees the person, not us).
11527
+ * One of the five states, as `custom.work_states()` lists them — with what it
11528
+ * may become next and whether it is the end. A screen that hardcoded these
11529
+ * would be a second source of truth for the one question the store answers.
11531
11530
  */
11532
- interface RecordsDataSource {
11533
- /**
11534
- * Call a door. The name is always a door the live catalogue has; `/core`
11535
- * refuses `door_absent` before it ever reaches here for one that does not.
11536
- */
11537
- rpc(fn: string, args: Record<string, unknown>,
11538
- /**
11539
- * THE SCHEMA THE DOOR LIVES IN, always supplied: `custom` for the store's
11540
- * own doors, `iam` for the trust doors (the external principal and the
11541
- * publish binding, which are the PLATFORM's). A host binding supabase-js
11542
- * routes this to `client.schema(options.schema).rpc(fn, args)`; a host that
11543
- * ignores it calls its own default PostgREST profile — `public` — and is
11544
- * refused by name, which is the failure we want rather than a silent answer
11545
- * from the wrong system. (Before 2026-09-18 this was described as "only ever
11546
- * `iam`" and the store's doors went unqualified; the extension's first real
11547
- * turn proved that asks `public.store_is_open` and finds nothing.)
11548
- */
11549
- options?: {
11550
- schema?: string;
11551
- }): PromiseLike<{
11552
- data: unknown;
11553
- error: PgError | null;
11554
- }>;
11555
- /**
11556
- * OPTIONAL. True for the real supabase adapters: the client may open a table page with ONE
11557
- * `custom.table_page_bundle` call instead of a dozen shape doors one after another (PAGE-BUNDLE).
11558
- * Leave it off for a test or replay source that does not model the bundle door.
11559
- */
11560
- opensInOneCall?: boolean;
11561
- /** Reads of `custom.*` go through the schema-qualified builder, never a bare `from`. */
11562
- schema(name: string): {
11563
- from(table: string): RecordsTableQuery;
11564
- };
11531
+ interface WorkState {
11532
+ sort: number;
11533
+ name: string;
11534
+ terminal: boolean;
11535
+ next: string[];
11565
11536
  }
11566
- /** The read surface the list and query paths use. A real supabase-js client satisfies it. */
11567
- interface RecordsTableQuery {
11568
- select(columns: string, options?: {
11569
- count?: "exact" | "planned" | "estimated";
11570
- head?: boolean;
11571
- }): RecordsFilter;
11537
+ /** One node of a template graph: a record-to-be, in a named Table, under a ref. */
11538
+ interface WorkTemplateNode {
11539
+ /** The name the graph refers to this node by, and the key an override is filed under. */
11540
+ ref: string;
11541
+ /** The Table the record lands in. */
11542
+ table: Uuid;
11543
+ /** The document it starts life with. An override merges on top at instantiation. */
11544
+ data?: Record<string, unknown>;
11572
11545
  }
11573
- interface RecordsFilter extends PromiseLike<RecordsResponse> {
11574
- eq(column: string, value: unknown): RecordsFilter;
11575
- neq(column: string, value: unknown): RecordsFilter;
11576
- in(column: string, values: readonly unknown[]): RecordsFilter;
11577
- is(column: string, value: null | boolean): RecordsFilter;
11578
- gte(column: string, value: unknown): RecordsFilter;
11579
- lte(column: string, value: unknown): RecordsFilter;
11580
- order(column: string, options?: {
11581
- ascending?: boolean;
11582
- }): RecordsFilter;
11583
- range(from: number, to: number): RecordsFilter;
11584
- limit(count: number): RecordsFilter;
11546
+ /** One edge. `owned` is what `custom.relation_own` makes; W1-REL owns the rest. */
11547
+ interface WorkTemplateRelation {
11548
+ from: string;
11549
+ to: string;
11550
+ kind?: string;
11585
11551
  }
11586
- interface RecordsResponse {
11587
- data: unknown;
11588
- error: PgError | null;
11589
- count?: number | null;
11552
+ /**
11553
+ * THE WHOLE TEMPLATE, DECLARATIVELY. REC-70: the graph is created in ONE act
11554
+ * and judged before any of it is written, so an agent writes a twelve-step
11555
+ * checklist in a single call and a half-made checklist is not a state the store
11556
+ * can be in.
11557
+ */
11558
+ interface WorkGraph {
11559
+ nodes: WorkTemplateNode[];
11560
+ relations?: WorkTemplateRelation[];
11561
+ }
11562
+ /** What `custom.work_template_instantiate` answers: what it made, and how much. */
11563
+ interface WorkInstantiation {
11564
+ template_id: Uuid;
11565
+ /** The log row. Until W3-HIST lands, this row IS the log of the act, and says so. */
11566
+ instantiation_id: Uuid;
11567
+ records_created: number;
11568
+ relations_created: number;
11569
+ relation_kind: string;
11570
+ /** ref → the record it became, which is how a step finds its own record. */
11571
+ refs: Record<string, Uuid>;
11572
+ records: Uuid[];
11573
+ relations: Uuid[];
11574
+ ms?: number;
11575
+ }
11576
+ /** One row of `custom.work_whose_turn`: a record, whose turn it is, and where it is up to. */
11577
+ interface WorkTurn {
11578
+ record_id: Uuid;
11579
+ title: string | null;
11580
+ assignee_id: Uuid | null;
11581
+ turn: string | null;
11582
+ due_on: Timestamp | null;
11583
+ state: string | null;
11584
+ status: string | null;
11585
+ terminal: boolean | null;
11586
+ }
11587
+ /** A Field assignment is made of, as the store itself describes it. */
11588
+ interface WorkAssignmentField {
11589
+ key: string;
11590
+ label: string;
11591
+ spec: Record<string, unknown>;
11590
11592
  }
11591
11593
  /**
11592
- * WHO IS ACTING. AGT-N-4: an agent carries the exact authority of the person
11593
- * operating it — there is no agent identity and there are no service roles. So
11594
- * the actor word and the person are two separate facts, and `on_behalf_of` is
11595
- * meaningful only when the actor is `agent`.
11594
+ * One hold on one slot. `expired` is the STORE's answer, not a clock comparison
11595
+ * a screen ran: a hold whose time is up is named as lapsed rather than quietly
11596
+ * disappearing, so a person can see why the slot came back.
11596
11597
  */
11597
- interface RecordsActor {
11598
- actor: Actor;
11599
- /** The signed-in person. The store reads this from the session, not from us; this is for the client's own mirror. */
11600
- user_id?: Uuid;
11601
- /** Only an agent acts on behalf of a person (the store refuses it otherwise). */
11602
- on_behalf_of?: Uuid;
11598
+ interface WorkSlotHold {
11599
+ hold_id: Uuid;
11600
+ slot_key: string;
11601
+ holder: string;
11602
+ expires_at: Timestamp | null;
11603
+ expired: boolean;
11603
11604
  }
11604
11605
  /**
11605
- * OPTIONAL. A live-updates seam. The default degradation is stated rather than
11606
- * silent: with no port bound, `useRecords` reports `live: false` and the screen
11607
- * can say "not live" instead of quietly going stale.
11608
- *
11609
- * A host binds this with `@ai-matrx/data/react`'s channel hygiene — the package
11610
- * deliberately does NOT depend on it, so the headless core stays free of a
11611
- * realtime client and a host that has one keeps using the one it already has.
11606
+ * What an embed token is good for, from `custom.anon_token_verify`. A token
11607
+ * carries ONE decision: `read` or `write`, never both.
11612
11608
  */
11613
- interface RecordsRealtimePort {
11609
+ interface AnonTokenBinding {
11610
+ token_id: Uuid;
11611
+ organization_id: Uuid;
11612
+ form_id: Uuid | null;
11613
+ saved_view_id: Uuid | null;
11614
+ record_id: Uuid | null;
11615
+ mode: "read" | "write";
11616
+ }
11617
+ /** The three things that land in the one inbox. Closed, one word each. */
11618
+ type WorkInboxKind = "assignment" | "approval" | "proposal";
11619
+ /** Who filed it: a colleague, or an agent acting for one. */
11620
+ type WorkOrigin = "person" | "agent";
11621
+ /** Where a due date stands, in the store's own words. */
11622
+ type WorkDueState = "overdue" | "due_today" | "scheduled" | "undated" | "finished";
11623
+ /** One row of `custom.work_inbox` — the SAME shape whichever of the three it is. */
11624
+ interface WorkInboxItem {
11625
+ item_id: Uuid;
11626
+ kind: WorkInboxKind;
11627
+ origin: WorkOrigin;
11628
+ title: string;
11629
+ subject_id: Uuid | null;
11630
+ subject_kind: string;
11631
+ summary: string | null;
11632
+ state: string;
11633
+ due_on: Timestamp | null;
11634
+ due_state: WorkDueState | null;
11635
+ /** False for a decided row a person asked to see. A screen shows it, inert. */
11636
+ actionable: boolean;
11637
+ requested_by: Uuid | null;
11638
+ requested_by_name: string | null;
11639
+ at: Timestamp;
11614
11640
  /**
11615
- * Watch one organization's records of one table. Returns an unsubscribe.
11616
- *
11617
- * THE HOST NUDGES THROUGH THIS SINK AND REACHES AROUND NOTHING. Until 0.43.0 the callback
11618
- * was `(recordId: Uuid) => void` and a host that also wanted to say "the SHAPE moved"
11619
- * imported `tableShapeChanged` from `@ai-matrx/records/react` and called it directly —
11620
- * which worked, and which meant the port contract did not describe half of what a port
11621
- * actually does. A column appearing is not a row changing, and the package owns the
11622
- * difference.
11623
- *
11624
- * NOTHING THAT ARRIVES HERE IS DATA. A nudge has not passed the read door, so the hook
11625
- * re-reads — by id set when the nudge names ids, whole-page when it cannot.
11641
+ * The table it is about (lane S5-PRIME): the table itself for a new column, new records or a
11642
+ * template; the record's table for a change to a record; null for a new table (it waits on a
11643
+ * home). An assignment carries its record's table. What an inbox groups by.
11626
11644
  */
11627
- subscribeRecords(args: {
11628
- organization_id: Uuid;
11629
- table_id: Uuid;
11630
- }, sink: RecordsChangeSink): () => void;
11631
- }
11632
- /** What a realtime port may tell the package. Two calls, because a column is not a row. */
11633
- interface RecordsChangeSink {
11645
+ table_id?: Uuid | null;
11646
+ table_name?: string | null;
11634
11647
  /**
11635
- * THESE RECORDS MOVED. `null` means "I cannot tell you which" — a reconnect, a tab wake, or
11636
- * a change above the store's own id cap — and is the one case that costs a whole-page read.
11637
- * An EMPTY array is not the same thing and is not a nudge at all.
11648
+ * A CLOSED ITEM SAYS WHO AND WHEN (lane S5-PRIME). Null while it is waiting. For `withdrawn`
11649
+ * — nobody decided it; the thing it would change was archived — `decided_by` is whoever
11650
+ * archived it (null when the store's own backlog sweep closed it).
11638
11651
  */
11639
- records(ids: readonly Uuid[] | null): void;
11652
+ decided_by?: Uuid | null;
11653
+ decided_by_name?: string | null;
11654
+ decided_at?: Timestamp | null;
11655
+ /** The store's own sentence: what was applied, what was left alone, or why it was withdrawn. */
11656
+ outcome?: string | null;
11640
11657
  /**
11641
- * THIS TABLE'S SHAPE MOVED — a column added, retired or changed. Re-reading the rows would
11642
- * redraw the same table without the new column in it, which is a screen that is out of date
11643
- * while looking healthy.
11658
+ * THIS PERSON'S OWN STATE (lane S5-PRIME-2). Set only in the view that shows it: `snoozed_until`
11659
+ * in the snoozed view, `cleared_at` in the done view. Nobody else's snooze or clear is ever read.
11644
11660
  */
11645
- shape(): void;
11661
+ snoozed_until?: Timestamp | null;
11662
+ cleared_at?: Timestamp | null;
11663
+ /** How many of this person's items are snoozed / cleared right now — the same on every row. */
11664
+ snoozed_count?: number;
11665
+ cleared_count?: number;
11666
+ /**
11667
+ * HOW LONG A DECISION ON THIS ROW IS HELD WITH UNDO before it is made (VERIFIER-20), in seconds:
11668
+ * the organization's `custom/decision_undo_seconds` (default 5) for a pending approval or
11669
+ * proposal; 0 when something already waits on the answer; null for work and closed rows.
11670
+ */
11671
+ undo_seconds?: number | null;
11672
+ /** Why a decision here cannot be held (it is made at once) — the store's sentence, or null. */
11673
+ undo_refusal?: string | null;
11646
11674
  }
11647
11675
  /**
11648
- * OPTIONAL. Where a refusal that nobody asked about goes — the loud funnel.
11649
- * Default degradation: `console.error` with the store's own words, never
11650
- * silence.
11651
- */
11652
- type RecordsErrorSink = (error: {
11653
- code: string;
11654
- message: string;
11655
- hint?: string;
11656
- where: string;
11657
- }) => void;
11658
- /**
11659
- * OPTIONAL. The merge-field resolver's server half (`W5-MERGE-B`). While it is
11660
- * not bound, `useMergeField` answers `pending` WITH THE REASON — never a blank,
11661
- * never a literal placeholder left in the text (DYN-14).
11676
+ * Which of a person's three inbox views `custom.work_inbox` answers (lane S5-PRIME-2): what is
11677
+ * waiting now, what they snoozed (soonest back first), what they cleared (latest first).
11662
11678
  */
11663
- interface RecordsResolverPort {
11664
- resolve(args: {
11665
- organization_id: Uuid;
11666
- merge_field_keys: string[];
11667
- /** The live selection the `state` source reads (DYNAMIC-VALUES §C). */
11668
- state?: Record<string, unknown>;
11669
- }): Promise<unknown>;
11670
- }
11671
- /** The one config a host binds. */
11672
- interface RecordsConfig {
11673
- /** REQUIRED. */
11674
- dataSource: RecordsDataSource;
11675
- /** REQUIRED. */
11676
- actor: RecordsActor;
11677
- /**
11678
- * REQUIRED. REC-29: organizations are hard walls, and the store is keyed
11679
- * `(organization_id, id)`. There is no "current organization" this package
11680
- * discovers for itself — the host says which one, every time.
11681
- *
11682
- * `null` is the ALL-ORGANIZATIONS mode (access belongs to the person, not the selected
11683
- * organization): a host whose page lists across every organization the person belongs to
11684
- * mounts with none. Doors that answer for the person (`custom.data_home*`) take it; a door that
11685
- * needs one is sent NULL and refuses in its own words, never a guessed organization.
11686
- */
11687
- organizationId: Uuid | null;
11688
- /**
11689
- * EVERY organization the person belongs to (active-org-is-never-a-list-filter.md).
11690
- * `organizationId` above is where NEW things are written and which org a write
11691
- * runs in; it never decides what a READ shows. With this set, `tableList` /
11692
- * `tableFacts` span all of these organizations (or one, when the page passes
11693
- * its `organization_id` filter), and `tableRead` / `recordRead` /
11694
- * `recordValuesVersioned` open a record in ITS OWN organization. Absent ⇒ the
11695
- * client reads only `organizationId`, exactly as before.
11696
- */
11697
- organizationIds?: readonly Uuid[];
11698
- realtime?: RecordsRealtimePort;
11699
- onError?: RecordsErrorSink;
11700
- resolver?: RecordsResolverPort;
11701
- /**
11702
- * The schema the record store lives in. Exists so a rehearsal branch and
11703
- * production can differ without a fork; it is `custom` everywhere today.
11704
- */
11705
- schema?: string;
11706
- /**
11707
- * Doors the generated catalogue (`STORE_DOORS`) does not list YET but this store is known to have —
11708
- * the nightly clone after a rehearsal, a test store. A screen reading an owed door asks
11709
- * `doorReady(config, name)` first, so production (which lacks the door until the chair applies it)
11710
- * is never asked and logs nothing. Leave it out in a shipped host: the regenerated catalogue is
11711
- * the switch.
11712
- */
11713
- knownDoors?: readonly string[];
11714
- }
11715
-
11716
- /**
11717
- * REL-6. Whether Visibility flows along this relation and the MAXIMUM access
11718
- * level it carries. Default off on `referenced`, on for `owned`.
11719
- */
11720
- interface RelationCarries {
11721
- carries: boolean;
11722
- /** The ceiling — a relation never carries more access than this. */
11723
- max_access: string | null;
11724
- }
11725
- /** The seven properties, each its own question. */
11726
- interface RelationProperties {
11727
- /** REL-1. Stored once on the contained table, read from the field's side. */
11728
- flavor: RelationFlavor;
11729
- /** REL-2. Separate from flavour. */
11730
- on_delete: OnDelete;
11731
- /** REL-3. A snapshot is a frozen copy in the relation's payload — never a pointer into History. */
11732
- binding: RelationBinding;
11733
- /** REL-4. */
11734
- ordered: boolean;
11735
- /** REL-5. */
11736
- loops: "allowed" | "refused";
11737
- /** REL-6. */
11738
- carries: RelationCarries;
11739
- /** REL-7. */
11740
- cardinality: RelationCardinality;
11679
+ type WorkInboxView = "inbox" | "snoozed" | "done";
11680
+ /** What `custom.inbox_snooze` / `inbox_unsnooze` / `inbox_clear` / `inbox_unclear` answer. */
11681
+ interface InboxStateChange {
11682
+ item_id: Uuid;
11683
+ /** Where the item stands for this person now. */
11684
+ state: "snoozed" | "cleared" | "waiting";
11685
+ /** False when an un-snooze / un-clear found nothing to undo (it says so in `sentence`). */
11686
+ changed?: boolean;
11687
+ snoozed_until?: Timestamp;
11688
+ cleared_at?: Timestamp;
11689
+ /** The store's own sentence, for the person. */
11690
+ sentence: string;
11741
11691
  }
11742
11692
  /**
11743
- * REL-8 / REL-N-1. A target is a REFERENCE, written that way from the first
11744
- * line of code, because it may name a row outside our database. One Table,
11745
- * several, or any — polymorphic without restriction. External targets are
11746
- * read-only in v1.
11693
+ * One organization's line of `custom.inbox_counts` — what waits on this person there, counted by
11694
+ * the same predicate the inbox lists with. The shell badge's number.
11747
11695
  */
11748
- type RelationTarget = {
11749
- kind: "ours";
11750
- entity_token: string;
11751
- row_id: Uuid;
11752
- } | {
11753
- kind: "external";
11754
- connection_token: string;
11755
- external_table: string;
11756
- external_key: string;
11757
- } | {
11758
- kind: "any";
11759
- };
11760
- /** One edge, as the store holds it in `platform.associations`. */
11761
- interface Relation {
11762
- id: Uuid;
11696
+ interface InboxCounts {
11763
11697
  organization_id: Uuid;
11764
- /** REL-10. The field key, which is what `role` holds. */
11765
- role: string;
11766
- source: RelationTarget;
11767
- target: RelationTarget;
11768
- properties: RelationProperties;
11769
- /** REL-4. Meaningful only when `ordered`. */
11770
- position: number | null;
11771
- /** REL-3. The frozen copy, when `binding` is `snapshot`. */
11772
- payload: Record<string, unknown> | null;
11773
- /** REL-14. Hydrated from the target's title field AT READ — never stored. */
11774
- label: string | null;
11775
- created_at: Timestamp;
11776
- updated_at: Timestamp;
11777
- /** REL-13 / REL-16. Associations are versioned, so relation history exists. */
11778
- version: number;
11698
+ organization_name: string | null;
11699
+ waiting: number;
11700
+ snoozed: number;
11701
+ cleared: number;
11702
+ overdue: number;
11703
+ oldest_waiting_at: Timestamp | null;
11779
11704
  }
11780
11705
  /**
11781
- * DOOR-6. A query coordinate: "related to THIS, along THAT role, in that
11782
- * direction". Any combination, and any subset of them.
11706
+ * The states an approval moves through. `withdrawn` (lane S5-PRIME) is closed by the store, not
11707
+ * decided by a person: the record or table it would change was archived.
11783
11708
  */
11784
- interface RelationCoordinate {
11785
- /** The record at the other end. */
11709
+ type WorkApprovalState = "pending" | "approved" | "declined" | "withdrawn";
11710
+ /** Which of the three lists `custom.work_list` answers. */
11711
+ type WorkListFlavour = "mine" | "assigned" | "unassigned";
11712
+ /** One row of `custom.work_list`: a record, whose it is, and where it is up to. */
11713
+ interface WorkListItem {
11786
11714
  record_id: Uuid;
11787
- /** The field key the edge carries as its role. Omit to mean any role. */
11788
- role?: string;
11789
- /** Which way to walk. `out` is this record's own relation fields. */
11790
- direction?: "out" | "in" | "either";
11715
+ table_id: Uuid;
11716
+ table_name: string | null;
11717
+ title: string | null;
11718
+ assignee_id: Uuid | null;
11719
+ assignee_name: string | null;
11720
+ assignee_user_id: Uuid | null;
11721
+ due_on: Timestamp | null;
11722
+ due_state: WorkDueState;
11723
+ status: string | null;
11724
+ terminal: boolean;
11725
+ assigned_by: Uuid | null;
11726
+ updated_at: Timestamp;
11791
11727
  }
11792
11728
  /**
11793
- * The arguments of the ONE relation-words resolver: the FIELD, because that is where its display
11794
- * spec is declared and judged (`custom._display_of_field` reads it server-side; the caller never
11795
- * carries it), and the ids of a page of cells.
11729
+ * One state a record may be moved to, with the model's own answer about whether
11730
+ * it may — and, when it may not, the sentence saying why. A screen offers what
11731
+ * is allowed and explains what is not; it never renders a dead control.
11796
11732
  */
11797
- /** A linked record's icon, and its table's icon for a record that has none (`relationWordsMany`). */
11798
- interface RelationIcons {
11799
- icon: string | null;
11800
- tableIcon: string | null;
11733
+ interface WorkRecordState {
11734
+ state_id: Uuid;
11735
+ name: string;
11736
+ sort: number;
11737
+ terminal: boolean;
11738
+ is_current: boolean;
11739
+ allowed: boolean;
11740
+ refusal: string | null;
11801
11741
  }
11802
- interface RelationWordsManyArgs {
11803
- field_id: Uuid;
11804
- record_ids: Uuid[];
11742
+ /** The change a pending approval carries. Two kinds, because two can be applied. */
11743
+ type WorkChange = {
11744
+ kind: "record_patch";
11745
+ patch: Record<string, unknown>;
11746
+ } | {
11747
+ kind: "field_add";
11748
+ field: Record<string, unknown>;
11749
+ };
11750
+ /** Somebody who may decide a particular request, and the reason they may. */
11751
+ interface WorkApprover {
11752
+ user_id: Uuid;
11753
+ name: string;
11754
+ why: string;
11805
11755
  }
11806
- /** One reference as the store keeps it. */
11807
- interface EntityRef {
11808
- /** The `platform.entity_types` token: `note`, `web_site`, `agent` … */
11809
- token: string;
11810
- id: Uuid;
11756
+ /** What `custom.work_approval_request` answers: it is filed, and who it waits on. */
11757
+ interface WorkApprovalFiled {
11758
+ approval_id: Uuid;
11759
+ state: "pending";
11760
+ subject_id: Uuid;
11761
+ subject_kind: string;
11762
+ origin: WorkOrigin;
11763
+ approvers: WorkApprover[];
11764
+ message: string;
11811
11765
  }
11812
- /** One reference as a read door answers it. */
11813
- interface EntityRefWithWords extends EntityRef {
11814
- /**
11815
- * The thing's own title — or the store's withheld sentence when the reader
11816
- * may not open it; `null` when the kind names no title.
11817
- */
11818
- label: string | null;
11766
+ /** What a decision answers — including whether the change was actually made. */
11767
+ interface WorkApprovalDecision {
11768
+ approval_id: Uuid;
11769
+ state: "approved" | "declined";
11770
+ subject_id: Uuid;
11771
+ /** The whole point: approving APPLIES the change, in the same transaction. */
11772
+ applied: boolean;
11773
+ field_id: Uuid | null;
11774
+ version: number | null;
11775
+ message: string;
11819
11776
  }
11820
- /** One kind of platform thing a record may point at (`custom.entity_reference_kinds`). */
11821
- interface EntityReferenceKind {
11822
- token: string;
11823
- /** What a person reads: "Note", "Site", "Agent". */
11824
- label: string;
11825
- /** The picker's grouping: the admin-assigned reference category, else the schema. */
11826
- category: string;
11777
+ /** One inbox decision of a batch (`custom.work_decide_many`). */
11778
+ interface WorkDecideManyItem {
11779
+ /** The inbox item — a `work_approval` record's id (`WorkInboxItem.item_id`). */
11780
+ item: Uuid;
11781
+ decision: "approve" | "decline";
11782
+ note?: string | null;
11827
11783
  }
11828
11784
  /**
11829
- * The references a cell holds, whichever shape it arrived in — one object, a
11830
- * list, or what a read door rendered (with labels). Anything that is not a
11831
- * reference is left out, never guessed at.
11832
- */
11833
- declare function entityRefsOf(value: unknown): EntityRefWithWords[];
11834
- /**
11835
- * What to WRITE for an entity-reference cell: `{token, id}` only, each thing
11836
- * once, first mention first — the label a read door added is dropped, because
11837
- * the store reads it and never keeps it (REL-14). A single-valued column gets
11838
- * the one object (or `null`), a multi-valued one the list.
11839
- */
11840
- declare function entityRefsToWrite(value: unknown, multi: boolean): EntityRef | EntityRef[] | null;
11841
- /**
11842
- * The kinds of platform thing a record may point at — what the field editor's
11843
- * kind picker lists. `custom.entity_reference_kinds()`.
11844
- */
11845
- declare function entityReferenceKinds(source: RecordsDataSource): Promise<RecordsResult<EntityReferenceKind[]>>;
11846
- /**
11847
- * THE SEARCH DOOR (lane REFERENCE-CARRY). The platform things of these kinds whose words hold
11848
- * `search`, that THIS person may point a record at — each one a thing the store's own write check
11849
- * (`custom._entity_reference_target_ok`) would accept, so a picked reference is never refused on
11850
- * save. `custom.entity_reference_search`. An empty search lists the first things by name.
11785
+ * `archived` (lane S5-PRIME): the thing it would change is archived, so it cannot be decided; the
11786
+ * sentence names it. A withdrawn approval answers `already_decided` with "That was withdrawn on …".
11851
11787
  */
11852
- declare function entityReferenceSearch(source: RecordsDataSource, organizationId: Uuid | null, tokens: readonly string[], search: string, limit?: number): Promise<RecordsResult<EntityRefWithWords[]>>;
11853
- /**
11854
- * THE WORDS HELPER. The words of each `{token, id}` for a picker or a chip
11855
- * before anything is saved — each label read by the store for THIS person and
11856
- * withheld when they may not open the thing. `custom.entity_reference_words`.
11857
- * A saved cell needs no call: every read door already answers its labels.
11858
- */
11859
- declare function entityReferenceWords(source: RecordsDataSource, organizationId: Uuid | null, refs: readonly EntityRef[]): Promise<RecordsResult<EntityRefWithWords[]>>;
11860
- /** One reverse column of a Table, as `custom.reverse_columns` answers it. */
11861
- interface ReverseColumn {
11862
- /** Stable key: the linking Field's `inverse_key`, else `linked_<field id>`. Never a Field key of B. */
11863
- key: string;
11864
- /** What the column is called on B: the linking table's name (plus the column's when ambiguous). */
11865
- label: string;
11866
- /** The relation Field on the linking table. */
11867
- source_field_id: Uuid;
11868
- source_field_key: string;
11869
- source_field_label: string;
11870
- /** The linking table. */
11871
- source_table_id: Uuid;
11872
- source_table_name: string;
11873
- /** Always `many`: any number of records may link to one. */
11874
- cardinality: "many";
11875
- /**
11876
- * True for a virtual back-link (written only from the linking table's side). False for a TWO-WAY
11877
- * LINK (NOTION-PROPS): the reverse end is a real Field on this table — `key` is its key, `label`
11878
- * its label — and `relationReverseSet` writes its links from here.
11879
- */
11880
- read_only: boolean;
11788
+ type WorkDecideVerdict = "approved" | "declined" | "already_decided" | "no_right" | "archived" | "refused";
11789
+ interface WorkDecideManyResult {
11790
+ index: number;
11791
+ item: Uuid;
11792
+ decision: "approve" | "decline";
11793
+ verdict: WorkDecideVerdict;
11794
+ /** The store's own sentence: what was applied, or why it was not. */
11795
+ sentence: string;
11796
+ subject_id?: Uuid;
11797
+ version?: number | null;
11798
+ record_ids?: Uuid[];
11799
+ code?: string;
11881
11800
  }
11882
- /**
11883
- * NOTION-PROPS. A two-way link's reverse Field: a relation whose `config.reverse_of` names the
11884
- * forward relation it mirrors. It holds no value of its own — its links are the forward Field's.
11885
- */
11886
- declare function isReverseField(field: {
11887
- type?: unknown;
11888
- config?: unknown;
11889
- } | null | undefined): boolean;
11890
- /** One linking record, as a chip shows it. */
11891
- interface ReverseLink {
11892
- id: Uuid;
11893
- /** The linking record's name, read by the store for this reader. */
11894
- words: string;
11801
+ /** What `custom.work_decide_many` answers: the counts, then one verdict per item in order. */
11802
+ interface WorkDecideMany {
11803
+ asked: number;
11804
+ approved: number;
11805
+ declined: number;
11806
+ not_decided: number;
11807
+ results: WorkDecideManyResult[];
11895
11808
  }
11896
- /** The links of one record through one reverse column: how many the reader may see, and one page. */
11897
- interface ReverseLinks {
11898
- total: number;
11899
- links: ReverseLink[];
11809
+ /** What `custom.work_assign` answers: the value, the access, and who holds it now. */
11810
+ interface WorkAssignment {
11811
+ record_id: Uuid;
11812
+ assigned: boolean;
11813
+ assignee: Uuid | null;
11814
+ assignee_user_id: Uuid | null;
11815
+ assignee_name: string | null;
11816
+ was: Uuid | null;
11817
+ due_date: Timestamp | null;
11818
+ version: number | null;
11819
+ /** The share sentence, or why nothing was taken away when un-assigning. */
11820
+ access: string;
11821
+ message: string;
11900
11822
  }
11901
- interface ReverseLinksManyArgs {
11902
- /** The Table whose records are being shown (B). */
11903
- table_id: Uuid;
11904
- /** `ReverseColumn.source_field_id`. */
11905
- source_field_id: Uuid;
11906
- /** A page of B's record ids — up to 200 a call; more are sent in groups by the client. */
11907
- record_ids: readonly Uuid[];
11908
- /** Links per record, 1–50 (the store holds it there). Default 10. */
11909
- limit?: number;
11910
- /** Skip this many links of each record — the next page of one hub record. Default 0. */
11911
- offset?: number;
11823
+
11824
+ /** What a step asks for before it counts as done. Every one of these is CHECKED. */
11825
+ type ChecklistRequirementKind =
11826
+ /** A person says it is done. */
11827
+ "none"
11828
+ /** A sentence of evidence, under `note`. */
11829
+ | "note"
11830
+ /** A named value filled in on the step itself. */
11831
+ | "answer"
11832
+ /** A named Field on the record the run is about must hold a value. */
11833
+ | "record_field"
11834
+ /** The step IS a form (SCR-19): finishing it needs a response record. */
11835
+ | "form"
11836
+ /** The step IS a document from a doc template (REC-68): finishing it needs a render. */
11837
+ | "document";
11838
+ interface ChecklistRequirement {
11839
+ kind: ChecklistRequirementKind;
11840
+ /** For `answer` and `record_field`: which value. */
11841
+ key?: string;
11842
+ /** What a person is asked for, in their words. */
11843
+ label?: string;
11844
+ /** For `form`: the published form this step is. */
11845
+ form_id?: Uuid;
11846
+ /** For `document`: the doc template this step renders. */
11847
+ template_id?: Uuid;
11912
11848
  }
11913
- /** `reverseLinksFields`: the links of a page through several reverse columns, in one call. */
11914
- interface ReverseLinksFieldsArgs {
11915
- table_id: Uuid;
11916
- /** Each `ReverseColumn.source_field_id` — at most 20. */
11917
- source_field_ids: readonly Uuid[];
11918
- record_ids: readonly Uuid[];
11919
- limit?: number;
11920
- offset?: number;
11849
+ /** One step of a checklist, as it is WRITTEN — not as it is run. */
11850
+ interface ChecklistStepSpec {
11851
+ /** The name the checklist refers to this step by; lower-case, unique. */
11852
+ ref: string;
11853
+ /** What a person reads in their work. */
11854
+ title: string;
11855
+ /** Which role owns it. A role the checklist never declares is refused at save. */
11856
+ role?: string;
11857
+ /** How many days after the run starts it is due. */
11858
+ due_days?: number;
11859
+ /** Steps it waits for. A step waits only for steps listed above it. */
11860
+ depends_on?: string[];
11861
+ requires?: ChecklistRequirement;
11921
11862
  }
11922
- /** The store's per-call ceiling on records for `custom.reverse_links_many`. */
11923
- declare const REVERSE_LINKS_RECORDS_PER_CALL = 200;
11924
- /** The store's ceiling on links a record per call. */
11925
- declare const REVERSE_LINKS_PAGE_MAX = 50;
11926
- /** The store's typed "source archived" answer for a lookup or roll-up. */
11927
- interface SourceArchived {
11928
- __unavailable: "source_archived";
11929
- /** `link`: the relation it reads through is archived; `column`: the far column it reads is. */
11930
- reads: "link" | "column";
11931
- /** The archived Field. Absent when the reader may not know its Table. */
11932
- field_id?: Uuid;
11933
- /** Its label. Absent when the reader may not know its Table. */
11863
+ /** A role, and the person who stands in it by default. */
11864
+ interface ChecklistRoleSpec {
11865
+ role: string;
11934
11866
  label?: string;
11867
+ user_id?: Uuid | null;
11868
+ }
11869
+ /** What starts a run. */
11870
+ type ChecklistTriggerKind = "manual" | "record_created" | "status_reached";
11871
+ interface ChecklistTrigger {
11872
+ kind: ChecklistTriggerKind;
11873
+ /** The Table being watched, for the two kinds that watch one. */
11935
11874
  table_id?: Uuid;
11936
- /** Its Table's name. Absent when the reader may not know that Table. */
11937
- table?: string;
11875
+ /** The state, for `status_reached`. */
11876
+ status?: string;
11938
11877
  }
11939
- /** The typed "source archived" answer, when `value` is one; null for any other value. */
11940
- declare function sourceArchivedOf(value: unknown): SourceArchived | null;
11941
-
11942
- /**
11943
- * DYN-14 / DYN-15. An ordered list of merge fields ENDING IN A LITERAL, or the
11944
- * decision to block the turn, or a named absence. No unresolved value is ever
11945
- * rendered blank or left as a literal placeholder.
11946
- */
11947
- type MissingBehavior = {
11948
- kind: "fallback";
11949
- chain: Array<{
11950
- merge_field_key: string;
11951
- } | {
11952
- literal: unknown;
11953
- }>;
11954
- } | {
11955
- kind: "block_turn";
11956
- } | {
11957
- kind: "named_absence";
11958
- say: string;
11959
- };
11960
- /** DYN-16. Applied AFTER resolution, on the merge field and never on the Field. */
11961
- interface MergeFieldTransform {
11962
- /** e.g. `currency`, `upper`, `date`; the organization's own list. */
11878
+ /** THE COMPLETE DECLARATIVE CHECKLIST — one object, one call, a whole process. */
11879
+ interface ChecklistSpec {
11963
11880
  name: string;
11964
- options?: Record<string, unknown>;
11965
- }
11966
- /** DYN-1. A Record of the kernel Table `Merge Field`. */
11967
- interface MergeField {
11968
- id: Uuid;
11969
- organization_id: Uuid;
11970
- key: string;
11971
- label: string;
11972
- /** DYN-3. Exactly one of eight. Relationships and rules are NOT sources. */
11973
- source: MergeFieldSource;
11974
- /** DYN-4. What it resolves INTO. The consumer never learns which. */
11975
- semantic_type: MergeFieldSemanticType;
11976
- /** §A. Any number. Never fused into the source. */
11977
- modifiers: MergeFieldModifier[];
11978
- /**
11979
- * DYN-12. Exactly one, and it drives the input surface. It OUTRANKS the
11980
- * precedence ladder: `server_fixed` is not offered as an input at all, and a
11981
- * value sent for one anyway is discarded and recorded — never merged.
11982
- */
11983
- override_policy: OverridePolicy;
11984
- /**
11985
- * DYN-13. Whether an override is POSSIBLE and WHO MAY perform it are two
11986
- * settings. This is the second one: an access level or an organization role.
11987
- */
11988
- override_requires: string | null;
11989
- /** DYN-16. */
11990
- format: MergeFieldTransform | null;
11991
- /** DYN-17. `inline`, `on_demand`, or `auto` by budget. A value in no tier is a defect. */
11992
- delivery?: Delivery;
11993
- /** DYN-14. Declared, always. */
11994
- missing?: MissingBehavior;
11995
- /**
11996
- * What the source needs: for `record`, the starting record and the chain; for
11997
- * `tool`, the connection token and the freshness ceiling (DYN-20); for
11998
- * `literal`, the literal.
11999
- */
12000
- source_config: Record<string, unknown>;
12001
- created_by: Uuid | null;
12002
- updated_by: Uuid | null;
12003
- created_at: Timestamp;
12004
- updated_at: Timestamp;
12005
- version: number;
12006
- metadata: Record<string, unknown>;
12007
- visibility: string;
11881
+ /** The Table a run is ABOUT: People, Hires, Jobs, Matters. */
11882
+ about_table_id: Uuid;
11883
+ roles?: ChecklistRoleSpec[];
11884
+ trigger?: ChecklistTrigger;
11885
+ steps: ChecklistStepSpec[];
12008
11886
  }
12009
- /** DYN-8. The triple the RUN gets. Every audit question is answerable from it. */
12010
- interface ResolutionTriple {
12011
- record_id: Uuid | null;
12012
- field_id: Uuid | null;
12013
- value_version: number | null;
11887
+ /** What `custom.checklist_declare` answers. */
11888
+ interface ChecklistDeclared {
11889
+ template_id: Uuid;
11890
+ name: string;
11891
+ about_table_id: Uuid;
11892
+ steps_table_id: Uuid;
11893
+ steps: number;
11894
+ roles: number;
11895
+ trigger: ChecklistTrigger;
11896
+ created: boolean;
11897
+ message: string;
11898
+ ms: number;
12014
11899
  }
12015
- /** DYN-22. The one provenance row per merge field per turn. */
12016
- interface MergeFieldProvenance {
12017
- merge_field_id: Uuid;
12018
- declared_source: MergeFieldSource;
12019
- /** Which source actually answered — the fallback chain makes these differ. */
12020
- actual_source: MergeFieldSource | null;
12021
- record_id: Uuid | null;
12022
- field_id: Uuid | null;
12023
- value_version: number | null;
12024
- rule_id: Uuid | null;
12025
- rule_version: number | null;
12026
- /** DYN-11. Who overrode it, and every LOSER of the ladder, not only the winner. */
12027
- override_by: Uuid | null;
12028
- losers?: Array<{
12029
- source: MergeFieldSource;
12030
- value: unknown;
12031
- why_lost: string;
12032
- }>;
12033
- /** DYN-11/DYN-12. A value a client sent for a field it may not supply, discarded and recorded. */
12034
- discarded_attempt?: {
12035
- value: unknown;
12036
- because: string;
12037
- } | null;
12038
- resolved_at: Timestamp;
12039
- freshness: Freshness;
12040
- outcome: string;
12041
- }
12042
- /**
12043
- * What a consumer gets back. `pending` is a first-class answer, not a blank:
12044
- * until the server's resolver exists, a merge field says so and says WHY
12045
- * (AGT-N-7 — anything that could not be delivered is named, never omitted).
12046
- */
12047
- type MergeFieldResolution = {
12048
- state: "resolved";
12049
- /** The rendered string the prompt gets. */
12050
- rendered: string;
12051
- value: unknown;
12052
- triple: ResolutionTriple;
12053
- provenance: MergeFieldProvenance;
12054
- } | {
12055
- state: "absent";
12056
- /** DYN-14's named absence — what the screen says instead of a blank. */
12057
- say: string;
12058
- reason: string;
12059
- provenance: MergeFieldProvenance | null;
12060
- } | {
12061
- state: "pending";
12062
- /** WHY it is pending, in the words a person can act on. Never empty. */
12063
- reason: string;
12064
- };
12065
-
12066
- /**
12067
- * One of the five states, as `custom.work_states()` lists them — with what it
12068
- * may become next and whether it is the end. A screen that hardcoded these
12069
- * would be a second source of truth for the one question the store answers.
12070
- */
12071
- interface WorkState {
12072
- sort: number;
11900
+ /** One row of `custom.checklist_templates`. */
11901
+ interface ChecklistTemplateSummary {
11902
+ template_id: Uuid;
12073
11903
  name: string;
12074
- terminal: boolean;
12075
- next: string[];
12076
- }
12077
- /** One node of a template graph: a record-to-be, in a named Table, under a ref. */
12078
- interface WorkTemplateNode {
12079
- /** The name the graph refers to this node by, and the key an override is filed under. */
12080
- ref: string;
12081
- /** The Table the record lands in. */
12082
- table: Uuid;
12083
- /** The document it starts life with. An override merges on top at instantiation. */
12084
- data?: Record<string, unknown>;
12085
- }
12086
- /** One edge. `owned` is what `custom.relation_own` makes; W1-REL owns the rest. */
12087
- interface WorkTemplateRelation {
12088
- from: string;
12089
- to: string;
12090
- kind?: string;
12091
- }
12092
- /**
12093
- * THE WHOLE TEMPLATE, DECLARATIVELY. REC-70: the graph is created in ONE act
12094
- * and judged before any of it is written, so an agent writes a twelve-step
12095
- * checklist in a single call and a half-made checklist is not a state the store
12096
- * can be in.
12097
- */
12098
- interface WorkGraph {
12099
- nodes: WorkTemplateNode[];
12100
- relations?: WorkTemplateRelation[];
11904
+ about_table_id: Uuid | null;
11905
+ about_table: string | null;
11906
+ steps: number;
11907
+ roles: number;
11908
+ trigger_kind: ChecklistTriggerKind;
11909
+ trigger_status: string | null;
11910
+ open_runs: number;
11911
+ total_runs: number;
11912
+ updated_at: Timestamp;
12101
11913
  }
12102
- /** What `custom.work_template_instantiate` answers: what it made, and how much. */
12103
- interface WorkInstantiation {
11914
+ /** `custom.checklist_template_shape` — the spec, plus what the editor needs. */
11915
+ type ChecklistTemplateShape = ChecklistSpec & {
12104
11916
  template_id: Uuid;
12105
- /** The log row. Until W3-HIST lands, this row IS the log of the act, and says so. */
12106
- instantiation_id: Uuid;
12107
- records_created: number;
12108
- relations_created: number;
12109
- relation_kind: string;
12110
- /** ref → the record it became, which is how a step finds its own record. */
12111
- refs: Record<string, Uuid>;
12112
- records: Uuid[];
12113
- relations: Uuid[];
12114
- ms?: number;
11917
+ steps_table_id: Uuid | null;
11918
+ may_change: boolean;
11919
+ };
11920
+ /** What `custom.checklist_start` answers. */
11921
+ interface ChecklistRunStarted {
11922
+ run_id: Uuid;
11923
+ template_id: Uuid;
11924
+ template: string;
11925
+ about_record_id: Uuid | null;
11926
+ about: string | null;
11927
+ steps_table_id: Uuid;
11928
+ steps_created: number;
11929
+ assigned: number;
11930
+ unassigned: number;
11931
+ origin: string;
11932
+ steps: Array<{
11933
+ ref: string;
11934
+ step_id: Uuid;
11935
+ title: string;
11936
+ role: string | null;
11937
+ }>;
11938
+ /** Roles nobody is named for, so the screen can say so rather than show blanks. */
11939
+ waiting_on_a_name: string[];
11940
+ message: string;
11941
+ ms: number;
12115
11942
  }
12116
- /** One row of `custom.work_whose_turn`: a record, whose turn it is, and where it is up to. */
12117
- interface WorkTurn {
12118
- record_id: Uuid;
12119
- title: string | null;
12120
- assignee_id: Uuid | null;
12121
- turn: string | null;
11943
+ /** One step of a RUN, as `custom.checklist_run` answers it. */
11944
+ interface ChecklistRunStep {
11945
+ step_id: Uuid;
11946
+ step_order: number;
11947
+ ref: string;
11948
+ title: string;
11949
+ role: string | null;
11950
+ assignee_name: string | null;
11951
+ assignee_user_id: Uuid | null;
12122
11952
  due_on: Timestamp | null;
12123
- state: string | null;
11953
+ due_state: WorkDueState;
12124
11954
  status: string | null;
12125
- terminal: boolean | null;
11955
+ finished: boolean;
11956
+ requires: ChecklistRequirementKind;
11957
+ /**
11958
+ * The key the answer is filed under, as the checklist named it. A screen files
11959
+ * evidence under THIS, never under a name it invented — the store looks for
11960
+ * exactly this key and nothing else.
11961
+ */
11962
+ requires_key: string | null;
11963
+ requires_label: string | null;
11964
+ /** The form or the document template this step is, when it is one. */
11965
+ requires_id: Uuid | null;
11966
+ evidence: Record<string, unknown>;
11967
+ /** The titles of the steps it is still waiting for. */
11968
+ blocked_by: string[];
11969
+ may_complete: boolean;
11970
+ /** Why it cannot be finished right now, in the words a person would use. */
11971
+ refusal: string | null;
12126
11972
  }
12127
- /** A Field assignment is made of, as the store itself describes it. */
12128
- interface WorkAssignmentField {
12129
- key: string;
12130
- label: string;
12131
- spec: Record<string, unknown>;
11973
+ /** One row of `custom.checklist_runs`. */
11974
+ interface ChecklistRunSummary {
11975
+ run_id: Uuid;
11976
+ name: string;
11977
+ template_id: Uuid | null;
11978
+ template: string | null;
11979
+ about_record_id: Uuid | null;
11980
+ about: string | null;
11981
+ about_table_id: Uuid | null;
11982
+ started_at: Timestamp | null;
11983
+ started_by: Uuid | null;
11984
+ origin: string;
11985
+ step_count: number;
11986
+ done: number;
11987
+ overdue: number;
11988
+ next_step: string | null;
11989
+ next_due: Timestamp | null;
11990
+ closed_at: Timestamp | null;
12132
11991
  }
12133
- /**
12134
- * One hold on one slot. `expired` is the STORE's answer, not a clock comparison
12135
- * a screen ran: a hold whose time is up is named as lapsed rather than quietly
12136
- * disappearing, so a person can see why the slot came back.
12137
- */
12138
- interface WorkSlotHold {
12139
- hold_id: Uuid;
12140
- slot_key: string;
12141
- holder: string;
12142
- expires_at: Timestamp | null;
12143
- expired: boolean;
11992
+ /** What `custom.checklist_step_complete` answers. */
11993
+ interface ChecklistStepCompleted {
11994
+ step_id: Uuid;
11995
+ run_id?: Uuid;
11996
+ completed: boolean;
11997
+ evidence?: Record<string, unknown>;
11998
+ steps_left?: number;
11999
+ run_closed?: boolean;
12000
+ message: string;
12144
12001
  }
12002
+
12145
12003
  /**
12146
- * What an embed token is good for, from `custom.anon_token_verify`. A token
12147
- * carries ONE decision: `read` or `write`, never both.
12004
+ * VIS-31. A signed-in OUTSIDER, with the reason in plain English.
12005
+ *
12006
+ * "No organization" cannot mean "no row in the membership table": signup mints
12007
+ * every account a PERSONAL organization, so under that reading nobody would
12008
+ * ever be external. It means no membership of a NON-personal organization, and
12009
+ * `iam.is_external_principal` says that once so no surface can invent a second
12010
+ * answer.
12148
12011
  */
12149
- interface AnonTokenBinding {
12150
- token_id: Uuid;
12012
+ interface ExternalPrincipalCard {
12013
+ user_id: Uuid | null;
12014
+ /** The answer itself. */
12015
+ external: boolean;
12016
+ signed_in: boolean;
12017
+ /**
12018
+ * WHY, in the platform's own words — the sentence a portal shows instead of
12019
+ * an empty screen. `iam` writes it, not us, so the portal and the API and the
12020
+ * admin screen all say the same thing about the same person.
12021
+ */
12022
+ explanation: string;
12023
+ /** How many NON-personal organizations they belong to. Zero is what external means. */
12024
+ organization_memberships: number;
12025
+ [key: string]: unknown;
12026
+ }
12027
+ /** VIS-32. A record or a view bound to a public address, with a declared render mode. */
12028
+ interface PublishBinding {
12029
+ id: Uuid;
12030
+ slug: string;
12031
+ resource_type: string;
12032
+ resource_id: Uuid;
12151
12033
  organization_id: Uuid;
12152
- form_id: Uuid | null;
12153
- saved_view_id: Uuid | null;
12154
- record_id: Uuid | null;
12155
- mode: "read" | "write";
12156
- }
12157
- /** The three things that land in the one inbox. Closed, one word each. */
12158
- type WorkInboxKind = "assignment" | "approval" | "proposal";
12159
- /** Who filed it: a colleague, or an agent acting for one. */
12160
- type WorkOrigin = "person" | "agent";
12161
- /** Where a due date stands, in the store's own words. */
12162
- type WorkDueState = "overdue" | "due_today" | "scheduled" | "undated" | "finished";
12163
- /** One row of `custom.work_inbox` — the SAME shape whichever of the three it is. */
12164
- interface WorkInboxItem {
12165
- item_id: Uuid;
12166
- kind: WorkInboxKind;
12167
- origin: WorkOrigin;
12168
- title: string;
12169
- subject_id: Uuid | null;
12170
- subject_kind: string;
12171
- summary: string | null;
12172
- state: string;
12173
- due_on: Timestamp | null;
12174
- due_state: WorkDueState | null;
12175
- /** False for a decided row a person asked to see. A screen shows it, inert. */
12176
- actionable: boolean;
12177
- requested_by: Uuid | null;
12178
- requested_by_name: string | null;
12179
- at: Timestamp;
12180
- /**
12181
- * The table it is about (lane S5-PRIME): the table itself for a new column, new records or a
12182
- * template; the record's table for a change to a record; null for a new table (it waits on a
12183
- * home). An assignment carries its record's table. What an inbox groups by.
12184
- */
12185
- table_id?: Uuid | null;
12186
- table_name?: string | null;
12187
- /**
12188
- * A CLOSED ITEM SAYS WHO AND WHEN (lane S5-PRIME). Null while it is waiting. For `withdrawn`
12189
- * — nobody decided it; the thing it would change was archived — `decided_by` is whoever
12190
- * archived it (null when the store's own backlog sweep closed it).
12191
- */
12192
- decided_by?: Uuid | null;
12193
- decided_by_name?: string | null;
12194
- decided_at?: Timestamp | null;
12195
- /** The store's own sentence: what was applied, what was left alone, or why it was withdrawn. */
12196
- outcome?: string | null;
12197
- /**
12198
- * THIS PERSON'S OWN STATE (lane S5-PRIME-2). Set only in the view that shows it: `snoozed_until`
12199
- * in the snoozed view, `cleared_at` in the done view. Nobody else's snooze or clear is ever read.
12200
- */
12201
- snoozed_until?: Timestamp | null;
12202
- cleared_at?: Timestamp | null;
12203
- /** How many of this person's items are snoozed / cleared right now — the same on every row. */
12204
- snoozed_count?: number;
12205
- cleared_count?: number;
12206
- /**
12207
- * HOW LONG A DECISION ON THIS ROW IS HELD WITH UNDO before it is made (VERIFIER-20), in seconds:
12208
- * the organization's `custom/decision_undo_seconds` (default 5) for a pending approval or
12209
- * proposal; 0 when something already waits on the answer; null for work and closed rows.
12210
- */
12211
- undo_seconds?: number | null;
12212
- /** Why a decision here cannot be held (it is made at once) — the store's sentence, or null. */
12213
- undo_refusal?: string | null;
12214
- }
12215
- /**
12216
- * Which of a person's three inbox views `custom.work_inbox` answers (lane S5-PRIME-2): what is
12217
- * waiting now, what they snoozed (soonest back first), what they cleared (latest first).
12218
- */
12219
- type WorkInboxView = "inbox" | "snoozed" | "done";
12220
- /** What `custom.inbox_snooze` / `inbox_unsnooze` / `inbox_clear` / `inbox_unclear` answer. */
12221
- interface InboxStateChange {
12222
- item_id: Uuid;
12223
- /** Where the item stands for this person now. */
12224
- state: "snoozed" | "cleared" | "waiting";
12225
- /** False when an un-snooze / un-clear found nothing to undo (it says so in `sentence`). */
12226
- changed?: boolean;
12227
- snoozed_until?: Timestamp;
12228
- cleared_at?: Timestamp;
12229
- /** The store's own sentence, for the person. */
12230
- sentence: string;
12034
+ render_mode: string;
12035
+ is_active: boolean;
12036
+ created_at?: Timestamp;
12037
+ [key: string]: unknown;
12231
12038
  }
12232
12039
  /**
12233
- * One organization's line of `custom.inbox_counts` — what waits on this person there, counted by
12234
- * the same predicate the inbox lists with. The shell badge's number.
12040
+ * What a SIGNED-OUT visitor resolves. An invented address, a revoked one and an
12041
+ * unpublished one all resolve to NOTHING — the same 404 — because an address
12042
+ * that answered differently for a revoked binding would be an existence oracle.
12043
+ *
12044
+ * `notice` is D-15's admission, carried on every read: nothing was scanned
12045
+ * before this was listed, and nothing here pretends otherwise.
12235
12046
  */
12236
- interface InboxCounts {
12047
+ interface ResolvedPublishBinding {
12048
+ slug: string;
12049
+ resource_type: string;
12050
+ resource_id: Uuid;
12237
12051
  organization_id: Uuid;
12238
- organization_name: string | null;
12239
- waiting: number;
12240
- snoozed: number;
12241
- cleared: number;
12242
- overdue: number;
12243
- oldest_waiting_at: Timestamp | null;
12052
+ render_mode: string;
12053
+ namespace: string | null;
12054
+ notice: string;
12244
12055
  }
12056
+ /** What a public address holds, as `iam.resolve_publish_binding_kind` names it. */
12057
+ type PublishBindingKind = "table" | "record" | "dashboard" | "page" | "view";
12245
12058
  /**
12246
- * The states an approval moves through. `withdrawn` (lane S5-PRIME) is closed by the store, not
12247
- * decided by a person: the record or table it would change was archived.
12059
+ * `iam.resolve_publish_binding_kind` — the same resolution, plus WHAT the address holds. Tables,
12060
+ * records and dashboards all carry the entity token `record`, so the token alone cannot say which;
12061
+ * this door can. `table_id` is the table a list or a record belongs to (a view's subject, a
12062
+ * dashboard's subject table); `title` is its name. Anon may call it.
12248
12063
  */
12249
- type WorkApprovalState = "pending" | "approved" | "declined" | "withdrawn";
12250
- /** Which of the three lists `custom.work_list` answers. */
12251
- type WorkListFlavour = "mine" | "assigned" | "unassigned";
12252
- /** One row of `custom.work_list`: a record, whose it is, and where it is up to. */
12253
- interface WorkListItem {
12254
- record_id: Uuid;
12255
- table_id: Uuid;
12256
- table_name: string | null;
12064
+ interface ResolvedPublishBindingKind extends ResolvedPublishBinding {
12065
+ kind: PublishBindingKind | string;
12066
+ table_id: Uuid | null;
12257
12067
  title: string | null;
12258
- assignee_id: Uuid | null;
12259
- assignee_name: string | null;
12260
- assignee_user_id: Uuid | null;
12261
- due_on: Timestamp | null;
12262
- due_state: WorkDueState;
12263
- status: string | null;
12264
- terminal: boolean;
12265
- assigned_by: Uuid | null;
12266
- updated_at: Timestamp;
12267
- }
12268
- /**
12269
- * One state a record may be moved to, with the model's own answer about whether
12270
- * it may — and, when it may not, the sentence saying why. A screen offers what
12271
- * is allowed and explains what is not; it never renders a dead control.
12272
- */
12273
- interface WorkRecordState {
12274
- state_id: Uuid;
12275
- name: string;
12276
- sort: number;
12277
- terminal: boolean;
12278
- is_current: boolean;
12279
- allowed: boolean;
12280
- refusal: string | null;
12281
- }
12282
- /** The change a pending approval carries. Two kinds, because two can be applied. */
12283
- type WorkChange = {
12284
- kind: "record_patch";
12285
- patch: Record<string, unknown>;
12286
- } | {
12287
- kind: "field_add";
12288
- field: Record<string, unknown>;
12289
- };
12290
- /** Somebody who may decide a particular request, and the reason they may. */
12291
- interface WorkApprover {
12292
- user_id: Uuid;
12293
- name: string;
12294
- why: string;
12295
- }
12296
- /** What `custom.work_approval_request` answers: it is filed, and who it waits on. */
12297
- interface WorkApprovalFiled {
12298
- approval_id: Uuid;
12299
- state: "pending";
12300
- subject_id: Uuid;
12301
- subject_kind: string;
12302
- origin: WorkOrigin;
12303
- approvers: WorkApprover[];
12304
- message: string;
12305
12068
  }
12306
- /** What a decision answers — including whether the change was actually made. */
12307
- interface WorkApprovalDecision {
12308
- approval_id: Uuid;
12309
- state: "approved" | "declined";
12310
- subject_id: Uuid;
12311
- /** The whole point: approving APPLIES the change, in the same transaction. */
12312
- applied: boolean;
12313
- field_id: Uuid | null;
12314
- version: number | null;
12315
- message: string;
12069
+
12070
+ /** One value the agent was given, with the triple that makes it citable. */
12071
+ interface RecordScopeField {
12072
+ key: string;
12073
+ label: string;
12074
+ type: string;
12075
+ value: unknown;
12076
+ /** DYN: a merge field resolves to a TRIPLE, not a string. */
12077
+ cite: {
12078
+ record_id: Uuid;
12079
+ field_id: Uuid;
12080
+ value_version: number;
12081
+ written_at: string | null;
12082
+ };
12316
12083
  }
12317
- /** One inbox decision of a batch (`custom.work_decide_many`). */
12318
- interface WorkDecideManyItem {
12319
- /** The inbox item — a `work_approval` record's id (`WorkInboxItem.item_id`). */
12320
- item: Uuid;
12321
- decision: "approve" | "decline";
12322
- note?: string | null;
12084
+ /** A Field the agent was NOT given, and which of the two reasons it is. */
12085
+ interface RecordScopeWithheld {
12086
+ key: string;
12087
+ label: string;
12088
+ because: "masked" | "policy";
12089
+ reason: string;
12090
+ needs?: string;
12091
+ /** The whole sentence, already written — a screen prints it rather than composing one. */
12092
+ says: string;
12323
12093
  }
12324
- /**
12325
- * `archived` (lane S5-PRIME): the thing it would change is archived, so it cannot be decided; the
12326
- * sentence names it. A withdrawn approval answers `already_decided` with "That was withdrawn on …".
12327
- */
12328
- type WorkDecideVerdict = "approved" | "declined" | "already_decided" | "no_right" | "archived" | "refused";
12329
- interface WorkDecideManyResult {
12330
- index: number;
12331
- item: Uuid;
12332
- decision: "approve" | "decline";
12333
- verdict: WorkDecideVerdict;
12334
- /** The store's own sentence: what was applied, or why it was not. */
12335
- sentence: string;
12336
- subject_id?: Uuid;
12337
- version?: number | null;
12338
- record_ids?: Uuid[];
12339
- code?: string;
12094
+ interface RecordScopeRelation {
12095
+ via: string;
12096
+ target_id: Uuid;
12097
+ foreign: boolean;
12098
+ masked: boolean;
12099
+ your_level: PermissionLevel | null;
12100
+ card: Record<string, unknown> | null;
12101
+ why: string | null;
12340
12102
  }
12341
- /** What `custom.work_decide_many` answers: the counts, then one verdict per item in order. */
12342
- interface WorkDecideMany {
12343
- asked: number;
12344
- approved: number;
12345
- declined: number;
12346
- not_decided: number;
12347
- results: WorkDecideManyResult[];
12103
+ interface RecordScopeHistoryEntry {
12104
+ version: number;
12105
+ at: string;
12106
+ what: string;
12107
+ who: string | null;
12108
+ changes: Array<Record<string, unknown>>;
12348
12109
  }
12349
- /** What `custom.work_assign` answers: the value, the access, and who holds it now. */
12350
- interface WorkAssignment {
12351
- record_id: Uuid;
12352
- assigned: boolean;
12353
- assignee: Uuid | null;
12354
- assignee_user_id: Uuid | null;
12355
- assignee_name: string | null;
12356
- was: Uuid | null;
12357
- due_date: Timestamp | null;
12358
- version: number | null;
12359
- /** The share sentence, or why nothing was taken away when un-assigning. */
12360
- access: string;
12361
- message: string;
12362
- }
12363
-
12364
- /** What a step asks for before it counts as done. Every one of these is CHECKED. */
12365
- type ChecklistRequirementKind =
12366
- /** A person says it is done. */
12367
- "none"
12368
- /** A sentence of evidence, under `note`. */
12369
- | "note"
12370
- /** A named value filled in on the step itself. */
12371
- | "answer"
12372
- /** A named Field on the record the run is about must hold a value. */
12373
- | "record_field"
12374
- /** The step IS a form (SCR-19): finishing it needs a response record. */
12375
- | "form"
12376
- /** The step IS a document from a doc template (REC-68): finishing it needs a render. */
12377
- | "document";
12378
- interface ChecklistRequirement {
12379
- kind: ChecklistRequirementKind;
12380
- /** For `answer` and `record_field`: which value. */
12381
- key?: string;
12382
- /** What a person is asked for, in their words. */
12383
- label?: string;
12384
- /** For `form`: the published form this step is. */
12385
- form_id?: Uuid;
12386
- /** For `document`: the doc template this step renders. */
12387
- template_id?: Uuid;
12388
- }
12389
- /** One step of a checklist, as it is WRITTEN — not as it is run. */
12390
- interface ChecklistStepSpec {
12391
- /** The name the checklist refers to this step by; lower-case, unique. */
12392
- ref: string;
12393
- /** What a person reads in their work. */
12394
- title: string;
12395
- /** Which role owns it. A role the checklist never declares is refused at save. */
12396
- role?: string;
12397
- /** How many days after the run starts it is due. */
12398
- due_days?: number;
12399
- /** Steps it waits for. A step waits only for steps listed above it. */
12400
- depends_on?: string[];
12401
- requires?: ChecklistRequirement;
12402
- }
12403
- /** A role, and the person who stands in it by default. */
12404
- interface ChecklistRoleSpec {
12405
- role: string;
12406
- label?: string;
12407
- user_id?: Uuid | null;
12408
- }
12409
- /** What starts a run. */
12410
- type ChecklistTriggerKind = "manual" | "record_created" | "status_reached";
12411
- interface ChecklistTrigger {
12412
- kind: ChecklistTriggerKind;
12413
- /** The Table being watched, for the two kinds that watch one. */
12414
- table_id?: Uuid;
12415
- /** The state, for `status_reached`. */
12416
- status?: string;
12417
- }
12418
- /** THE COMPLETE DECLARATIVE CHECKLIST — one object, one call, a whole process. */
12419
- interface ChecklistSpec {
12420
- name: string;
12421
- /** The Table a run is ABOUT: People, Hires, Jobs, Matters. */
12422
- about_table_id: Uuid;
12423
- roles?: ChecklistRoleSpec[];
12424
- trigger?: ChecklistTrigger;
12425
- steps: ChecklistStepSpec[];
12426
- }
12427
- /** What `custom.checklist_declare` answers. */
12428
- interface ChecklistDeclared {
12429
- template_id: Uuid;
12430
- name: string;
12431
- about_table_id: Uuid;
12432
- steps_table_id: Uuid;
12433
- steps: number;
12434
- roles: number;
12435
- trigger: ChecklistTrigger;
12436
- created: boolean;
12437
- message: string;
12438
- ms: number;
12439
- }
12440
- /** One row of `custom.checklist_templates`. */
12441
- interface ChecklistTemplateSummary {
12442
- template_id: Uuid;
12443
- name: string;
12444
- about_table_id: Uuid | null;
12445
- about_table: string | null;
12446
- steps: number;
12447
- roles: number;
12448
- trigger_kind: ChecklistTriggerKind;
12449
- trigger_status: string | null;
12450
- open_runs: number;
12451
- total_runs: number;
12452
- updated_at: Timestamp;
12453
- }
12454
- /** `custom.checklist_template_shape` — the spec, plus what the editor needs. */
12455
- type ChecklistTemplateShape = ChecklistSpec & {
12456
- template_id: Uuid;
12457
- steps_table_id: Uuid | null;
12458
- may_change: boolean;
12459
- };
12460
- /** What `custom.checklist_start` answers. */
12461
- interface ChecklistRunStarted {
12462
- run_id: Uuid;
12463
- template_id: Uuid;
12464
- template: string;
12465
- about_record_id: Uuid | null;
12466
- about: string | null;
12467
- steps_table_id: Uuid;
12468
- steps_created: number;
12469
- assigned: number;
12470
- unassigned: number;
12471
- origin: string;
12472
- steps: Array<{
12473
- ref: string;
12474
- step_id: Uuid;
12475
- title: string;
12476
- role: string | null;
12477
- }>;
12478
- /** Roles nobody is named for, so the screen can say so rather than show blanks. */
12479
- waiting_on_a_name: string[];
12480
- message: string;
12481
- ms: number;
12482
- }
12483
- /** One step of a RUN, as `custom.checklist_run` answers it. */
12484
- interface ChecklistRunStep {
12485
- step_id: Uuid;
12486
- step_order: number;
12487
- ref: string;
12488
- title: string;
12489
- role: string | null;
12490
- assignee_name: string | null;
12491
- assignee_user_id: Uuid | null;
12492
- due_on: Timestamp | null;
12493
- due_state: WorkDueState;
12494
- status: string | null;
12495
- finished: boolean;
12496
- requires: ChecklistRequirementKind;
12497
- /**
12498
- * The key the answer is filed under, as the checklist named it. A screen files
12499
- * evidence under THIS, never under a name it invented — the store looks for
12500
- * exactly this key and nothing else.
12501
- */
12502
- requires_key: string | null;
12503
- requires_label: string | null;
12504
- /** The form or the document template this step is, when it is one. */
12505
- requires_id: Uuid | null;
12506
- evidence: Record<string, unknown>;
12507
- /** The titles of the steps it is still waiting for. */
12508
- blocked_by: string[];
12509
- may_complete: boolean;
12510
- /** Why it cannot be finished right now, in the words a person would use. */
12511
- refusal: string | null;
12512
- }
12513
- /** One row of `custom.checklist_runs`. */
12514
- interface ChecklistRunSummary {
12515
- run_id: Uuid;
12516
- name: string;
12517
- template_id: Uuid | null;
12518
- template: string | null;
12519
- about_record_id: Uuid | null;
12520
- about: string | null;
12521
- about_table_id: Uuid | null;
12522
- started_at: Timestamp | null;
12523
- started_by: Uuid | null;
12524
- origin: string;
12525
- step_count: number;
12526
- done: number;
12527
- overdue: number;
12528
- next_step: string | null;
12529
- next_due: Timestamp | null;
12530
- closed_at: Timestamp | null;
12531
- }
12532
- /** What `custom.checklist_step_complete` answers. */
12533
- interface ChecklistStepCompleted {
12534
- step_id: Uuid;
12535
- run_id?: Uuid;
12536
- completed: boolean;
12537
- evidence?: Record<string, unknown>;
12538
- steps_left?: number;
12539
- run_closed?: boolean;
12540
- message: string;
12541
- }
12542
-
12543
- /**
12544
- * VIS-31. A signed-in OUTSIDER, with the reason in plain English.
12545
- *
12546
- * "No organization" cannot mean "no row in the membership table": signup mints
12547
- * every account a PERSONAL organization, so under that reading nobody would
12548
- * ever be external. It means no membership of a NON-personal organization, and
12549
- * `iam.is_external_principal` says that once so no surface can invent a second
12550
- * answer.
12551
- */
12552
- interface ExternalPrincipalCard {
12553
- user_id: Uuid | null;
12554
- /** The answer itself. */
12555
- external: boolean;
12556
- signed_in: boolean;
12557
- /**
12558
- * WHY, in the platform's own words — the sentence a portal shows instead of
12559
- * an empty screen. `iam` writes it, not us, so the portal and the API and the
12560
- * admin screen all say the same thing about the same person.
12561
- */
12562
- explanation: string;
12563
- /** How many NON-personal organizations they belong to. Zero is what external means. */
12564
- organization_memberships: number;
12565
- [key: string]: unknown;
12566
- }
12567
- /** VIS-32. A record or a view bound to a public address, with a declared render mode. */
12568
- interface PublishBinding {
12569
- id: Uuid;
12570
- slug: string;
12571
- resource_type: string;
12572
- resource_id: Uuid;
12573
- organization_id: Uuid;
12574
- render_mode: string;
12575
- is_active: boolean;
12576
- created_at?: Timestamp;
12577
- [key: string]: unknown;
12578
- }
12579
- /**
12580
- * What a SIGNED-OUT visitor resolves. An invented address, a revoked one and an
12581
- * unpublished one all resolve to NOTHING — the same 404 — because an address
12582
- * that answered differently for a revoked binding would be an existence oracle.
12583
- *
12584
- * `notice` is D-15's admission, carried on every read: nothing was scanned
12585
- * before this was listed, and nothing here pretends otherwise.
12586
- */
12587
- interface ResolvedPublishBinding {
12588
- slug: string;
12589
- resource_type: string;
12590
- resource_id: Uuid;
12591
- organization_id: Uuid;
12592
- render_mode: string;
12593
- namespace: string | null;
12594
- notice: string;
12595
- }
12596
- /** What a public address holds, as `iam.resolve_publish_binding_kind` names it. */
12597
- type PublishBindingKind = "table" | "record" | "dashboard" | "page" | "view";
12598
- /**
12599
- * `iam.resolve_publish_binding_kind` — the same resolution, plus WHAT the address holds. Tables,
12600
- * records and dashboards all carry the entity token `record`, so the token alone cannot say which;
12601
- * this door can. `table_id` is the table a list or a record belongs to (a view's subject, a
12602
- * dashboard's subject table); `title` is its name. Anon may call it.
12603
- */
12604
- interface ResolvedPublishBindingKind extends ResolvedPublishBinding {
12605
- kind: PublishBindingKind | string;
12606
- table_id: Uuid | null;
12607
- title: string | null;
12608
- }
12609
-
12610
- /** One value the agent was given, with the triple that makes it citable. */
12611
- interface RecordScopeField {
12612
- key: string;
12613
- label: string;
12614
- type: string;
12615
- value: unknown;
12616
- /** DYN: a merge field resolves to a TRIPLE, not a string. */
12617
- cite: {
12618
- record_id: Uuid;
12619
- field_id: Uuid;
12620
- value_version: number;
12621
- written_at: string | null;
12622
- };
12623
- }
12624
- /** A Field the agent was NOT given, and which of the two reasons it is. */
12625
- interface RecordScopeWithheld {
12626
- key: string;
12627
- label: string;
12628
- because: "masked" | "policy";
12629
- reason: string;
12630
- needs?: string;
12631
- /** The whole sentence, already written — a screen prints it rather than composing one. */
12632
- says: string;
12633
- }
12634
- interface RecordScopeRelation {
12635
- via: string;
12636
- target_id: Uuid;
12637
- foreign: boolean;
12638
- masked: boolean;
12639
- your_level: PermissionLevel | null;
12640
- card: Record<string, unknown> | null;
12641
- why: string | null;
12642
- }
12643
- interface RecordScopeHistoryEntry {
12644
- version: number;
12645
- at: string;
12646
- what: string;
12647
- who: string | null;
12648
- changes: Array<Record<string, unknown>>;
12649
- }
12650
- interface RecordScopeComment {
12651
- id: Uuid;
12652
- body: string;
12653
- created_at: string;
12654
- created_by_name: string;
12655
- field_key: string | null;
12110
+ interface RecordScopeComment {
12111
+ id: Uuid;
12112
+ body: string;
12113
+ created_at: string;
12114
+ created_by_name: string;
12115
+ field_key: string | null;
12656
12116
  }
12657
12117
  interface RecordScopeContext {
12658
12118
  record: {
@@ -15106,365 +14566,1005 @@ interface RecordsClient {
15106
14566
  discoverable?: boolean;
15107
14567
  }): Promise<RecordsResult<unknown>>;
15108
14568
  /**
15109
- * Declare a Rule. It is NOT `recordWrite` into the rule kernel, and that is
15110
- * the whole point: `custom.record_write` inserts `data_class = 'record'`, so a
15111
- * document written that way is not a Rule and the store's own rule doors
15112
- * (`custom.rule_members`, `custom.agg_subscriptions`) never see it. Writing
15113
- * one through the record door and calling it a Rule would be a silent
15114
- * failure — a screen that looked like it had subscribed you to something.
14569
+ * Declare a Rule. It is NOT `recordWrite` into the rule kernel, and that is
14570
+ * the whole point: `custom.record_write` inserts `data_class = 'record'`, so a
14571
+ * document written that way is not a Rule and the store's own rule doors
14572
+ * (`custom.rule_members`, `custom.agg_subscriptions`) never see it. Writing
14573
+ * one through the record door and calling it a Rule would be a silent
14574
+ * failure — a screen that looked like it had subscribed you to something.
14575
+ */
14576
+ ruleDeclare(args: {
14577
+ spec: Record<string, unknown>;
14578
+ rule_id?: Uuid | null;
14579
+ }): Promise<RecordsResult<Uuid>>;
14580
+ fieldPropose(proposal: FieldProposal): Promise<RecordsResult<never>>;
14581
+ tablePropose(proposal: TableProposal): Promise<RecordsResult<never>>;
14582
+ promoteTable(args: {
14583
+ table_id: Uuid;
14584
+ }): Promise<RecordsResult<unknown>>;
14585
+ promoteField(args: {
14586
+ table_id: Uuid;
14587
+ field_id: Uuid;
14588
+ }): Promise<RecordsResult<unknown>>;
14589
+ /**
14590
+ * @deprecated The record store is never off (owner ruling, 2026-10-03: everything is on by
14591
+ * default). This answers `true` whenever the door answers; a refusal means the store could not
14592
+ * be reached, never that it is off. Do not gate a screen on it.
14593
+ */
14594
+ storeIsOpen(): Promise<RecordsResult<boolean>>;
14595
+ /**
14596
+ * WHAT THIS PERSON MAY DO TO THESE THINGS — asked once, for a whole page.
14597
+ *
14598
+ * There is no principal argument, on purpose: the door resolves the caller
14599
+ * from the session, so a person can ask about their OWN access and about
14600
+ * nobody else's. A subject they hold nothing on answers `level: null`, which
14601
+ * is an answer; the row is never omitted, because a screen that could not
14602
+ * tell "no access" from "not asked yet" would draw one of them as the other.
14603
+ */
14604
+ myLevels(args: {
14605
+ ids: Uuid[];
14606
+ subject?: "record";
14607
+ }): Promise<RecordsResult<MyLevel[]>>;
14608
+ /** G1. Write ONE leaf of a Table's colors, or clear it with `null`. Editor on the Table. */
14609
+ tableDecorate(args: {
14610
+ table_id: Uuid;
14611
+ path: DecorationPath;
14612
+ value: unknown;
14613
+ }): Promise<RecordsResult<TableDecorations>>;
14614
+ /** G1. A Table's colors as a screen paints them, with what went stale named. */
14615
+ tableDecorations(args: {
14616
+ table_id: Uuid;
14617
+ }): Promise<RecordsResult<TableDecorations>>;
14618
+ /** G1. The layout a grid opens with: platform → organization knob → the view's own. */
14619
+ gridLayout(args: {
14620
+ table_id: Uuid;
14621
+ view_id?: Uuid | null;
14622
+ }): Promise<RecordsResult<GridLayout>>;
14623
+ /** G3. The older grid's formula text → the store's expression. Never refuses a typo: answers ok:false. */
14624
+ formulaParse(args: {
14625
+ table_id: Uuid;
14626
+ text: string;
14627
+ }): Promise<RecordsResult<FormulaParse>>;
14628
+ /**
14629
+ * NOTION-PROPS. The formula being typed, parsed AND worked out for one record of the table
14630
+ * (`custom.formula_preview`): the parse, plus `value` — what a saved formula column would show on
14631
+ * that record — or `error` when it parses and cannot be worked out there. Writes nothing.
14632
+ */
14633
+ formulaPreview(args: {
14634
+ table_id: Uuid;
14635
+ record_id: Uuid | null;
14636
+ text: string;
14637
+ }): Promise<RecordsResult<FormulaPreview>>;
14638
+ /** G2. Declare a Table's row actions — the whole list. Editor on the Table. */
14639
+ actionDeclare(args: {
14640
+ table_id: Uuid;
14641
+ actions: RowAction[];
14642
+ }): Promise<RecordsResult<RowAction[]>>;
14643
+ /** G2. A Table's row actions, each saying whether it can run here. */
14644
+ rowActions(args: {
14645
+ table_id: Uuid;
14646
+ }): Promise<RecordsResult<{
14647
+ actions: RowAction[];
14648
+ stale: unknown[];
14649
+ }>>;
14650
+ /**
14651
+ * G2. Run one action on a selection, in ONE transaction. A refusal changed NOTHING; read
14652
+ * every record and field that refused with `actionRefusals(result.error)`.
14653
+ */
14654
+ actionRun(args: {
14655
+ action_id: Uuid;
14656
+ record_ids: Uuid[];
14657
+ }): Promise<RecordsResult<ActionRunResult>>;
14658
+ /**
14659
+ * AUTOMATION-DOOR. Declare (or, with `automation_id`, replace) one automation on a Table — editor on the Table.
14660
+ * A spec the store refuses comes back as `data.ok === false` with `_errors`, one sentence per path.
14661
+ */
14662
+ automationDeclare(args: {
14663
+ table_id: Uuid;
14664
+ spec: AutomationSpec;
14665
+ automation_id?: Uuid | null;
14666
+ }): Promise<RecordsResult<AutomationDeclared>>;
14667
+ /** AUTOMATION-DOOR. A Table's automations with their last run; archived ones only when asked. */
14668
+ automations(args: {
14669
+ table_id: Uuid;
14670
+ include_archived?: boolean;
14671
+ }): Promise<RecordsResult<AutomationList>>;
14672
+ /** AUTOMATION-DOOR. Archive one (it switches off and keeps its history). Editor on the Table. */
14673
+ automationArchive(args: {
14674
+ automation_id: Uuid;
14675
+ }): Promise<RecordsResult<AutomationFlipped>>;
14676
+ /** AUTOMATION-DOOR. Bring an archived one back (it stays off until `automationSetEnabled`). */
14677
+ automationRestore(args: {
14678
+ automation_id: Uuid;
14679
+ }): Promise<RecordsResult<AutomationFlipped>>;
14680
+ /** AUTOMATION-DOOR. Switch one on or off. */
14681
+ automationSetEnabled(args: {
14682
+ automation_id: Uuid;
14683
+ enabled: boolean;
14684
+ }): Promise<RecordsResult<AutomationFlipped>>;
14685
+ /** AUTOMATION-DOOR. Run history, newest first: status, the store's own sentence, every step. */
14686
+ automationRuns(args: {
14687
+ automation_id: Uuid;
14688
+ limit?: number;
14689
+ cursor?: string | null;
14690
+ }): Promise<RecordsResult<AutomationRuns>>;
14691
+ /** G4. Send every change to this Table's records to an https webhook. Admin. The secret is shown once. */
14692
+ tableWebhookDeclare(args: {
14693
+ table_id: Uuid;
14694
+ target_url: string;
14695
+ events?: RecordEvent[] | null;
14696
+ description?: string | null;
14697
+ }): Promise<RecordsResult<TableWebhookDeclared>>;
14698
+ /** G4. The webhooks a Table sends to, with their delivery health — never the secret. */
14699
+ tableWebhooks(args: {
14700
+ table_id: Uuid;
14701
+ }): Promise<RecordsResult<TableWebhook[]>>;
14702
+ /** G4. Switch one off. It is never deleted. */
14703
+ tableWebhookArchive(args: {
14704
+ webhook_id: Uuid;
14705
+ }): Promise<RecordsResult<boolean>>;
14706
+ /** G5. Number the records an autonumber column found already there, in creation order. */
14707
+ autonumberBackfill(args: {
14708
+ field_id: Uuid;
14709
+ }): Promise<RecordsResult<{
14710
+ numbered: number;
14711
+ highest: number | null;
14712
+ says: string;
14713
+ }>>;
14714
+ /**
14715
+ * NOTION-PROPS-3. PRESS A BUTTON COLUMN ON ONE ROW (`custom.button_press`): a link comes back filled from
14716
+ * the row for the screen to open; a row action or an automation runs in the store and its result comes
14717
+ * back. A button with nothing set up is refused by name (22023).
14718
+ */
14719
+ buttonPress(args: {
14720
+ record_id: Uuid;
14721
+ field_id: Uuid;
14722
+ }): Promise<RecordsResult<ButtonPressed>>;
14723
+ /**
14724
+ * NOTION-PROPS-3. The knob `data/timeline_dependency_shift` for the signed-in person in this organization:
14725
+ * whether moving a record on a timeline moves the records waiting on it (default true).
15115
14726
  */
15116
- ruleDeclare(args: {
15117
- spec: Record<string, unknown>;
15118
- rule_id?: Uuid | null;
15119
- }): Promise<RecordsResult<Uuid>>;
15120
- fieldPropose(proposal: FieldProposal): Promise<RecordsResult<never>>;
15121
- tablePropose(proposal: TableProposal): Promise<RecordsResult<never>>;
15122
- promoteTable(args: {
15123
- table_id: Uuid;
15124
- }): Promise<RecordsResult<unknown>>;
15125
- promoteField(args: {
14727
+ timelineDependencyShift(): Promise<RecordsResult<boolean>>;
14728
+ /** G5. One page of the export door — exactly the rows and columns the read door serves this person. */
14729
+ ioExport(args: {
15126
14730
  table_id: Uuid;
15127
- field_id: Uuid;
15128
- }): Promise<RecordsResult<unknown>>;
14731
+ columns?: string[] | null;
14732
+ limit?: number;
14733
+ }): Promise<RecordsResult<IoExportPage>>;
14734
+ /** G5. That page as an .xlsx; a withheld column is named on its own sheet. */
15129
14735
  /**
15130
- * @deprecated The record store is never off (owner ruling, 2026-10-03: everything is on by
15131
- * default). This answers `true` whenever the door answers; a refusal means the store could not
15132
- * be reached, never that it is off. Do not gate a screen on it.
14736
+ * G9. Every table a picker may offer here, from BOTH stores, each saying which store opens it.
14737
+ * A table the app keeps out of default lists (`custom.table_kept_out_of_lists`: an agent's
14738
+ * outputs) is left out unless `include_platform_tables` is true — the "Show platform tables" switch.
15133
14739
  */
15134
- storeIsOpen(): Promise<RecordsResult<boolean>>;
14740
+ tableListEverywhere(args?: {
14741
+ include_platform_tables?: boolean;
14742
+ }): Promise<RecordsResult<{
14743
+ success: boolean;
14744
+ tables: TableListEntry[];
14745
+ }>>;
15135
14746
  /**
15136
- * WHAT THIS PERSON MAY DO TO THESE THINGS — asked once, for a whole page.
15137
- *
15138
- * There is no principal argument, on purpose: the door resolves the caller
15139
- * from the session, so a person can ask about their OWN access and about
15140
- * nobody else's. A subject they hold nothing on answers `level: null`, which
15141
- * is an answer; the row is never omitted, because a screen that could not
15142
- * tell "no access" from "not asked yet" would draw one of them as the other.
14747
+ * Every table the person reaches (`custom.data_home_tables`), as the data home lists them.
14748
+ * `organization_id` names one organization; `null` asks for every organization the person
14749
+ * reaches — never the client's bound organization by default. A table the app keeps out of
14750
+ * default lists (an agent's outputs) is answered only with `include_platform_tables: true`.
15143
14751
  */
15144
- myLevels(args: {
14752
+ dataHomeTables(args: {
14753
+ organization_id: Uuid | null;
14754
+ include_platform_tables?: boolean;
14755
+ }): Promise<RecordsResult<DataHomeTable[]>>;
14756
+ /**
14757
+ * G10. Refresh a synced source (a sheet tab) into ONE Table under `home_id`: new rows added,
14758
+ * changed rows updated, rows the source dropped archived — never destroyed; columns the
14759
+ * person added in Matrx survive. Build the spec with `sheetSyncSpec`.
14760
+ */
14761
+ tableSync(args: {
14762
+ home_id: Uuid;
14763
+ spec: TableSyncSpec;
14764
+ }): Promise<RecordsResult<TableSyncResult>>;
14765
+ /**
14766
+ * G11. The record-store Table a context scope's template-bound item provisions — one per item
14767
+ * and scope. A scope provisioned before the move answers with its moved Table (same id); the
14768
+ * Home defaults to the organization's own.
14769
+ */
14770
+ scopeTableProvision(args: {
14771
+ item_id: Uuid;
14772
+ scope_id: Uuid;
14773
+ home_id?: Uuid | null;
14774
+ }): Promise<RecordsResult<Uuid>>;
14775
+ /** G12. The rows of each Table this reader may see, in one call (fold with `withRowCounts`). A Table she may not know gets no row. */
14776
+ tableRowCounts(args: {
14777
+ table_ids: Uuid[];
14778
+ }): Promise<RecordsResult<TableRowCount[]>>;
14779
+ /** G12. Each live record's own header (created, updated, version) that the read door does not answer. */
14780
+ recordHeaders(args: {
15145
14781
  ids: Uuid[];
15146
- subject?: "record";
15147
- }): Promise<RecordsResult<MyLevel[]>>;
15148
- /** G1. Write ONE leaf of a Table's colors, or clear it with `null`. Editor on the Table. */
15149
- tableDecorate(args: {
15150
- table_id: Uuid;
15151
- path: DecorationPath;
15152
- value: unknown;
15153
- }): Promise<RecordsResult<TableDecorations>>;
15154
- /** G1. A Table's colors as a screen paints them, with what went stale named. */
15155
- tableDecorations(args: {
15156
- table_id: Uuid;
15157
- }): Promise<RecordsResult<TableDecorations>>;
15158
- /** G1. The layout a grid opens with: platform → organization knob → the view's own. */
15159
- gridLayout(args: {
14782
+ }): Promise<RecordsResult<RecordHeader[]>>;
14783
+ /**
14784
+ * G14. Share a Table with a person by email or account id: an existing account outside the
14785
+ * organization is granted at once and notified (never made a member); an address with no
14786
+ * account is invited. The organization's outside-sharing setting decides first.
14787
+ */
14788
+ tableShareOutsideGrant(args: {
15160
14789
  table_id: Uuid;
15161
- view_id?: Uuid | null;
15162
- }): Promise<RecordsResult<GridLayout>>;
15163
- /** G3. The older grid's formula text → the store's expression. Never refuses a typo: answers ok:false. */
15164
- formulaParse(args: {
14790
+ person: string;
14791
+ level?: "viewer" | "commenter" | "editor" | "admin";
14792
+ }): Promise<RecordsResult<OutsideShareAnswer>>;
14793
+ /** G13. Keep a hand-set order on a saved view: the named rows first, in this order (build it with `moveInOrder`). */
14794
+ viewRecordOrderSet(args: {
14795
+ view_id: Uuid;
14796
+ record_ids: Uuid[];
14797
+ }): Promise<RecordsResult<ViewOrderSet>>;
14798
+ /**
14799
+ * G13 + ORDER-FILTER. A page of a hand-ordered view: placed rows by position, then the rest by
14800
+ * created time. `filter` is the list door's question (`StoreFilter`: a flat map or a nested
14801
+ * Rule — the view's own `where`, or a number clicked on a dashboard); given, the store reads
14802
+ * exactly the rows that match, in their places, and `limit`/`offset` page THAT order. Each row
14803
+ * answers the position stored for it; rows the filter hides keep theirs.
14804
+ */
14805
+ readInViewOrder(args: {
14806
+ view_id: Uuid;
14807
+ filter?: StoreFilter | null | undefined;
14808
+ limit?: number;
14809
+ offset?: number;
14810
+ }): Promise<RecordsResult<Array<ReadRow & {
14811
+ position: number | null;
14812
+ }>>>;
14813
+ exportXlsx(args: {
15165
14814
  table_id: Uuid;
15166
- text: string;
15167
- }): Promise<RecordsResult<FormulaParse>>;
14815
+ columns?: string[] | null;
14816
+ limit?: number;
14817
+ labels?: Record<string, string>;
14818
+ sheetLabel?: string;
14819
+ }): Promise<RecordsResult<Uint8Array>>;
14820
+ }
14821
+ /** One Table's two lane facts, as `custom.table_facts` answers them. */
14822
+ interface TableFact {
14823
+ table_id: Uuid;
14824
+ /**
14825
+ * The old lane word (personal · internal · public), now worked out by the store from `shown_to`
14826
+ * and `published_to_web` (access ladder). Read those two; this stays for older stores.
14827
+ */
14828
+ visibility: string;
14829
+ /** Whether the person signed in MADE this Table. Never who did. */
14830
+ mine: boolean;
14831
+ /** Access ladder "Shown to": only_me · my_team · everyone · everyone_on_ai_matrx; null = the default. */
14832
+ shown_to?: string | null;
14833
+ /** Access ladder "Published to the web": the only way anyone outside the organization opens it. */
14834
+ published_to_web?: boolean;
14835
+ }
14836
+ /**
14837
+ * WHERE A TABLE IS CURRENTLY READ AND WRITTEN during the older-table cutover.
14838
+ * `tableHome` is an address read from one Table record; this applies the
14839
+ * organization's migration switch to a batch of ids, including same-id copies.
14840
+ */
14841
+ interface TableLiveLocation {
14842
+ table_id: Uuid;
14843
+ lives_in: "record" | "older";
14844
+ why: string | null;
14845
+ }
14846
+
14847
+ /** One Field a person asked for, in the words a person uses (FLD-1 / FLD-11). */
14848
+ interface NewFieldSpec {
14849
+ key: string;
14850
+ label: string;
14851
+ /**
14852
+ * The word for what this column holds — any word `custom._field_document_for`
14853
+ * resolves for `type` (a parity type, a behaviour, a plain synonym, or a kind
14854
+ * such as `signature`, `relation`, `entity_reference`, `autonumber`). It is
14855
+ * sent to the door as `type`, unmapped; a word that means nothing is refused
14856
+ * by name, with the list.
14857
+ */
14858
+ type: FieldTypeWord;
14859
+ sort?: number;
14860
+ required?: boolean;
14861
+ multi?: boolean;
14862
+ config?: Record<string, unknown>;
14863
+ /** A choice list's choices, as words. The store keeps them as a Table (FLD-5). */
14864
+ options?: string[];
14865
+ /** A column that points at another Table of this organization (FLD-11 / REL-8). */
14866
+ relationTarget?: Uuid;
14867
+ /** A currency column's symbol; a date column's day-or-day-and-time. */
14868
+ unit?: string;
14869
+ kind?: "date" | "datetime";
14870
+ /**
14871
+ * An `entity_reference` column's kinds: the platform entity tokens it may point
14872
+ * at (`ai_model`, `note`, `web_site` …; `custom.entity_reference_kinds()` lists
14873
+ * them). The store refuses an entity reference that names none.
14874
+ */
14875
+ allowedTypes?: string[];
14876
+ /**
14877
+ * No two live records may hold the same value here (a `unique` Rule, FLD-3 / B1). A column
14878
+ * `recordUpsert` finds a record by must carry it.
14879
+ */
14880
+ unique?: boolean;
14881
+ /**
14882
+ * An EXISTING choice list's Table — the column uses those very option records instead of making a
14883
+ * new list (a drafts table copying its source table's column keeps the same choices). Sent as
14884
+ * `config.options_table_id`.
14885
+ */
14886
+ optionsTableId?: Uuid;
14887
+ /**
14888
+ * Anything else `custom.field_declare` accepts, passed through verbatim and applied LAST (a stored
14889
+ * Field document copied key for key, `format`, `sensitivity`, `via` / `pick` / `agg` / `of`, …).
14890
+ * The store judges every key; a word it does not take is refused by name.
14891
+ */
14892
+ declaration?: Partial<NewFieldDeclaration> & Record<string, unknown>;
14893
+ }
14894
+
14895
+ /** One door's answer, under its exact arguments. Plain JSON: it crosses from server to browser. */
14896
+ interface RecordsSeedAnswer {
14897
+ door: string;
14898
+ args: Record<string, unknown>;
14899
+ data: unknown;
14900
+ }
14901
+ /** What a server asked for a page, as the person, and when. */
14902
+ interface RecordsSeed {
14903
+ /** Epoch ms when the server asked. */
14904
+ at: number;
14905
+ answers: RecordsSeedAnswer[];
14906
+ }
14907
+
14908
+ /**
14909
+ * One client's memory of its own operations. `mint()` names a write and remembers it; `isOwn(opId)`
14910
+ * answers whether a notice is that write's echo.
14911
+ *
14912
+ * OWN-WRITE DETECTION IS PER CLIENT INSTANCE. Two setups in ONE process (a server holding two
14913
+ * identities, a worker beside a UI) must hear each other: a realm-wide ledger made A's write "ours" to
14914
+ * B as well, and B dropped it as an echo (2026-10-08, the README proof). `createRecords` gives every
14915
+ * setup its own ledger and hands it to its client, its entity port and its live-changes port.
14916
+ */
14917
+ interface OpLedger {
14918
+ mint(): Uuid;
14919
+ isOwn(opId: string | null | undefined): boolean;
14920
+ /** Test seam: forget everything. */
14921
+ clear(): void;
14922
+ /** Test seam: how many operations are currently remembered. */
14923
+ readonly size: number;
14924
+ }
14925
+ /** A ledger of one client's own: hand the SAME one to the client that writes and the port that listens. */
14926
+ declare function createOpLedger(): OpLedger;
14927
+ /**
14928
+ * THE REALM'S DEFAULT LEDGER, IN A GLOBAL SLOT — for hosts that mount one client per realm (a browser
14929
+ * tab) and never name a ledger. Every section of the built package (root, core, react, realtime, data,
14930
+ * typed-table) carries its own copy of this module, and the ESM and CJS builds are two more graphs; a
14931
+ * module-level Map split it so `records/core` minted in one and `records/realtime` checked another — own
14932
+ * writes came back as strangers' changes (2026-10-08). Guarded on the packed tarball by
14933
+ * scripts/check-shared-state.mjs.
14934
+ */
14935
+ declare const defaultOpLedger: OpLedger;
14936
+ /**
14937
+ * Mint the id for one client operation and remember it as ours (the realm's default ledger).
14938
+ *
14939
+ * ONE CALL IS ONE OPERATION. A fifty-row paste through `recordWriteMany` is ONE op id, because
14940
+ * the store announces one statement once — and it REFUSES a batch carrying two different ones
14941
+ * by name, for exactly that reason.
14942
+ */
14943
+ declare function mintOpId(): Uuid;
14944
+ /**
14945
+ * Is this notice the echo of a write this realm's default ledger made?
14946
+ *
14947
+ * `undefined`/`null` is NOT ours and never has been: a notice with no `op_id` came from a
14948
+ * server-side write, an agent tool, another client, or a store older than this mechanism —
14949
+ * all of which are changes this browser has not seen and must read.
14950
+ */
14951
+ declare function isOwnOp(opId: string | null | undefined): boolean;
14952
+ /** Test seam: forget everything. Never called by product code. */
14953
+ declare function forgetAllOps(): void;
14954
+ /** Test seam: how many operations are currently remembered. */
14955
+ declare function rememberedOpCount(): number;
14956
+
14957
+ /**
14958
+ * The data seam: a structural subset of `SupabaseClient`. The package never
14959
+ * opens a database connection of its own and never holds a key — the HOST
14960
+ * supplies a client that already carries the operating person's session, which
14961
+ * is what makes DOOR-5 and AGT-N-4 true (the store sees the person, not us).
14962
+ */
14963
+ interface RecordsDataSource {
15168
14964
  /**
15169
- * NOTION-PROPS. The formula being typed, parsed AND worked out for one record of the table
15170
- * (`custom.formula_preview`): the parse, plus `value` — what a saved formula column would show on
15171
- * that record — or `error` when it parses and cannot be worked out there. Writes nothing.
14965
+ * Call a door. The name is always a door the live catalogue has; `/core`
14966
+ * refuses `door_absent` before it ever reaches here for one that does not.
15172
14967
  */
15173
- formulaPreview(args: {
15174
- table_id: Uuid;
15175
- record_id: Uuid | null;
15176
- text: string;
15177
- }): Promise<RecordsResult<FormulaPreview>>;
15178
- /** G2. Declare a Table's row actions — the whole list. Editor on the Table. */
15179
- actionDeclare(args: {
15180
- table_id: Uuid;
15181
- actions: RowAction[];
15182
- }): Promise<RecordsResult<RowAction[]>>;
15183
- /** G2. A Table's row actions, each saying whether it can run here. */
15184
- rowActions(args: {
15185
- table_id: Uuid;
15186
- }): Promise<RecordsResult<{
15187
- actions: RowAction[];
15188
- stale: unknown[];
15189
- }>>;
14968
+ rpc(fn: string, args: Record<string, unknown>,
15190
14969
  /**
15191
- * G2. Run one action on a selection, in ONE transaction. A refusal changed NOTHING; read
15192
- * every record and field that refused with `actionRefusals(result.error)`.
14970
+ * THE SCHEMA THE DOOR LIVES IN, always supplied: `custom` for the store's
14971
+ * own doors, `iam` for the trust doors (the external principal and the
14972
+ * publish binding, which are the PLATFORM's). A host binding supabase-js
14973
+ * routes this to `client.schema(options.schema).rpc(fn, args)`; a host that
14974
+ * ignores it calls its own default PostgREST profile — `public` — and is
14975
+ * refused by name, which is the failure we want rather than a silent answer
14976
+ * from the wrong system. (Before 2026-09-18 this was described as "only ever
14977
+ * `iam`" and the store's doors went unqualified; the extension's first real
14978
+ * turn proved that asks `public.store_is_open` and finds nothing.)
15193
14979
  */
15194
- actionRun(args: {
15195
- action_id: Uuid;
15196
- record_ids: Uuid[];
15197
- }): Promise<RecordsResult<ActionRunResult>>;
14980
+ options?: {
14981
+ schema?: string;
14982
+ }): PromiseLike<{
14983
+ data: unknown;
14984
+ error: PgError | null;
14985
+ }>;
15198
14986
  /**
15199
- * AUTOMATION-DOOR. Declare (or, with `automation_id`, replace) one automation on a Table — editor on the Table.
15200
- * A spec the store refuses comes back as `data.ok === false` with `_errors`, one sentence per path.
14987
+ * OPTIONAL. True for the real supabase adapters: the client may open a table page with ONE
14988
+ * `custom.table_page_bundle` call instead of a dozen shape doors one after another (PAGE-BUNDLE).
14989
+ * Leave it off for a test or replay source that does not model the bundle door.
15201
14990
  */
15202
- automationDeclare(args: {
15203
- table_id: Uuid;
15204
- spec: AutomationSpec;
15205
- automation_id?: Uuid | null;
15206
- }): Promise<RecordsResult<AutomationDeclared>>;
15207
- /** AUTOMATION-DOOR. A Table's automations with their last run; archived ones only when asked. */
15208
- automations(args: {
15209
- table_id: Uuid;
15210
- include_archived?: boolean;
15211
- }): Promise<RecordsResult<AutomationList>>;
15212
- /** AUTOMATION-DOOR. Archive one (it switches off and keeps its history). Editor on the Table. */
15213
- automationArchive(args: {
15214
- automation_id: Uuid;
15215
- }): Promise<RecordsResult<AutomationFlipped>>;
15216
- /** AUTOMATION-DOOR. Bring an archived one back (it stays off until `automationSetEnabled`). */
15217
- automationRestore(args: {
15218
- automation_id: Uuid;
15219
- }): Promise<RecordsResult<AutomationFlipped>>;
15220
- /** AUTOMATION-DOOR. Switch one on or off. */
15221
- automationSetEnabled(args: {
15222
- automation_id: Uuid;
15223
- enabled: boolean;
15224
- }): Promise<RecordsResult<AutomationFlipped>>;
15225
- /** AUTOMATION-DOOR. Run history, newest first: status, the store's own sentence, every step. */
15226
- automationRuns(args: {
15227
- automation_id: Uuid;
15228
- limit?: number;
15229
- cursor?: string | null;
15230
- }): Promise<RecordsResult<AutomationRuns>>;
15231
- /** G4. Send every change to this Table's records to an https webhook. Admin. The secret is shown once. */
15232
- tableWebhookDeclare(args: {
15233
- table_id: Uuid;
15234
- target_url: string;
15235
- events?: RecordEvent[] | null;
15236
- description?: string | null;
15237
- }): Promise<RecordsResult<TableWebhookDeclared>>;
15238
- /** G4. The webhooks a Table sends to, with their delivery health — never the secret. */
15239
- tableWebhooks(args: {
15240
- table_id: Uuid;
15241
- }): Promise<RecordsResult<TableWebhook[]>>;
15242
- /** G4. Switch one off. It is never deleted. */
15243
- tableWebhookArchive(args: {
15244
- webhook_id: Uuid;
15245
- }): Promise<RecordsResult<boolean>>;
15246
- /** G5. Number the records an autonumber column found already there, in creation order. */
15247
- autonumberBackfill(args: {
15248
- field_id: Uuid;
15249
- }): Promise<RecordsResult<{
15250
- numbered: number;
15251
- highest: number | null;
15252
- says: string;
15253
- }>>;
14991
+ opensInOneCall?: boolean;
14992
+ /** Reads of `custom.*` go through the schema-qualified builder, never a bare `from`. */
14993
+ schema(name: string): {
14994
+ from(table: string): RecordsTableQuery;
14995
+ };
14996
+ }
14997
+ /** The read surface the list and query paths use. A real supabase-js client satisfies it. */
14998
+ interface RecordsTableQuery {
14999
+ select(columns: string, options?: {
15000
+ count?: "exact" | "planned" | "estimated";
15001
+ head?: boolean;
15002
+ }): RecordsFilter;
15003
+ }
15004
+ interface RecordsFilter extends PromiseLike<RecordsResponse> {
15005
+ eq(column: string, value: unknown): RecordsFilter;
15006
+ neq(column: string, value: unknown): RecordsFilter;
15007
+ in(column: string, values: readonly unknown[]): RecordsFilter;
15008
+ is(column: string, value: null | boolean): RecordsFilter;
15009
+ gte(column: string, value: unknown): RecordsFilter;
15010
+ lte(column: string, value: unknown): RecordsFilter;
15011
+ order(column: string, options?: {
15012
+ ascending?: boolean;
15013
+ }): RecordsFilter;
15014
+ range(from: number, to: number): RecordsFilter;
15015
+ limit(count: number): RecordsFilter;
15016
+ }
15017
+ interface RecordsResponse {
15018
+ data: unknown;
15019
+ error: PgError | null;
15020
+ count?: number | null;
15021
+ }
15022
+ /**
15023
+ * WHO IS ACTING. AGT-N-4: an agent carries the exact authority of the person
15024
+ * operating it — there is no agent identity and there are no service roles. So
15025
+ * the actor word and the person are two separate facts, and `on_behalf_of` is
15026
+ * meaningful only when the actor is `agent`.
15027
+ */
15028
+ interface RecordsActor {
15029
+ actor: Actor;
15030
+ /** The signed-in person. The store reads this from the session, not from us; this is for the client's own mirror. */
15031
+ user_id?: Uuid;
15032
+ /** Only an agent acts on behalf of a person (the store refuses it otherwise). */
15033
+ on_behalf_of?: Uuid;
15034
+ }
15035
+ /**
15036
+ * OPTIONAL. A live-updates seam. The default degradation is stated rather than
15037
+ * silent: with no port bound, `useRecords` reports `live: false` and the screen
15038
+ * can say "not live" instead of quietly going stale.
15039
+ *
15040
+ * A host binds this with `@ai-matrx/data/react`'s channel hygiene — the package
15041
+ * deliberately does NOT depend on it, so the headless core stays free of a
15042
+ * realtime client and a host that has one keeps using the one it already has.
15043
+ */
15044
+ interface RecordsRealtimePort {
15254
15045
  /**
15255
- * NOTION-PROPS-3. PRESS A BUTTON COLUMN ON ONE ROW (`custom.button_press`): a link comes back filled from
15256
- * the row for the screen to open; a row action or an automation runs in the store and its result comes
15257
- * back. A button with nothing set up is refused by name (22023).
15046
+ * Watch one organization's records of one table. Returns an unsubscribe.
15047
+ *
15048
+ * THE HOST NUDGES THROUGH THIS SINK AND REACHES AROUND NOTHING. Until 0.43.0 the callback
15049
+ * was `(recordId: Uuid) => void` and a host that also wanted to say "the SHAPE moved"
15050
+ * imported `tableShapeChanged` from `@ai-matrx/records/react` and called it directly —
15051
+ * which worked, and which meant the port contract did not describe half of what a port
15052
+ * actually does. A column appearing is not a row changing, and the package owns the
15053
+ * difference.
15054
+ *
15055
+ * NOTHING THAT ARRIVES HERE IS DATA. A nudge has not passed the read door, so the hook
15056
+ * re-reads — by id set when the nudge names ids, whole-page when it cannot.
15258
15057
  */
15259
- buttonPress(args: {
15260
- record_id: Uuid;
15261
- field_id: Uuid;
15262
- }): Promise<RecordsResult<ButtonPressed>>;
15058
+ subscribeRecords(args: {
15059
+ organization_id: Uuid;
15060
+ table_id: Uuid;
15061
+ }, sink: RecordsChangeSink): () => void;
15062
+ }
15063
+ /** What a realtime port may tell the package. Two calls, because a column is not a row. */
15064
+ interface RecordsChangeSink {
15263
15065
  /**
15264
- * NOTION-PROPS-3. The knob `data/timeline_dependency_shift` for the signed-in person in this organization:
15265
- * whether moving a record on a timeline moves the records waiting on it (default true).
15066
+ * THESE RECORDS MOVED. `null` means "I cannot tell you which" — a reconnect, a tab wake, or
15067
+ * a change above the store's own id cap — and is the one case that costs a whole-page read.
15068
+ * An EMPTY array is not the same thing and is not a nudge at all.
15266
15069
  */
15267
- timelineDependencyShift(): Promise<RecordsResult<boolean>>;
15268
- /** G5. One page of the export door — exactly the rows and columns the read door serves this person. */
15269
- ioExport(args: {
15270
- table_id: Uuid;
15271
- columns?: string[] | null;
15272
- limit?: number;
15273
- }): Promise<RecordsResult<IoExportPage>>;
15274
- /** G5. That page as an .xlsx; a withheld column is named on its own sheet. */
15070
+ records(ids: readonly Uuid[] | null): void;
15275
15071
  /**
15276
- * G9. Every table a picker may offer here, from BOTH stores, each saying which store opens it.
15277
- * A table the app keeps out of default lists (`custom.table_kept_out_of_lists`: an agent's
15278
- * outputs) is left out unless `include_platform_tables` is true — the "Show platform tables" switch.
15072
+ * THIS TABLE'S SHAPE MOVED — a column added, retired or changed. Re-reading the rows would
15073
+ * redraw the same table without the new column in it, which is a screen that is out of date
15074
+ * while looking healthy.
15279
15075
  */
15280
- tableListEverywhere(args?: {
15281
- include_platform_tables?: boolean;
15282
- }): Promise<RecordsResult<{
15283
- success: boolean;
15284
- tables: TableListEntry[];
15285
- }>>;
15076
+ shape(): void;
15077
+ }
15078
+ /**
15079
+ * OPTIONAL. Where a refusal that nobody asked about goes — the loud funnel.
15080
+ * Default degradation: `console.error` with the store's own words, never
15081
+ * silence.
15082
+ */
15083
+ type RecordsErrorSink = (error: {
15084
+ code: string;
15085
+ message: string;
15086
+ hint?: string;
15087
+ where: string;
15088
+ }) => void;
15089
+ /**
15090
+ * OPTIONAL. The merge-field resolver's server half (`W5-MERGE-B`). While it is
15091
+ * not bound, `useMergeField` answers `pending` WITH THE REASON — never a blank,
15092
+ * never a literal placeholder left in the text (DYN-14).
15093
+ */
15094
+ interface RecordsResolverPort {
15095
+ resolve(args: {
15096
+ organization_id: Uuid;
15097
+ merge_field_keys: string[];
15098
+ /** The live selection the `state` source reads (DYNAMIC-VALUES §C). */
15099
+ state?: Record<string, unknown>;
15100
+ }): Promise<unknown>;
15101
+ }
15102
+ /** The one config a host binds. */
15103
+ interface RecordsConfig {
15104
+ /** REQUIRED. */
15105
+ dataSource: RecordsDataSource;
15106
+ /** REQUIRED. */
15107
+ actor: RecordsActor;
15286
15108
  /**
15287
- * Every table the person reaches (`custom.data_home_tables`), as the data home lists them.
15288
- * `organization_id` names one organization; `null` asks for every organization the person
15289
- * reaches — never the client's bound organization by default. A table the app keeps out of
15290
- * default lists (an agent's outputs) is answered only with `include_platform_tables: true`.
15109
+ * REQUIRED. REC-29: organizations are hard walls, and the store is keyed
15110
+ * `(organization_id, id)`. There is no "current organization" this package
15111
+ * discovers for itself — the host says which one, every time.
15112
+ *
15113
+ * `null` is the ALL-ORGANIZATIONS mode (access belongs to the person, not the selected
15114
+ * organization): a host whose page lists across every organization the person belongs to
15115
+ * mounts with none. Doors that answer for the person (`custom.data_home*`) take it; a door that
15116
+ * needs one is sent NULL and refuses in its own words, never a guessed organization.
15291
15117
  */
15292
- dataHomeTables(args: {
15293
- organization_id: Uuid | null;
15294
- include_platform_tables?: boolean;
15295
- }): Promise<RecordsResult<DataHomeTable[]>>;
15118
+ organizationId: Uuid | null;
15296
15119
  /**
15297
- * G10. Refresh a synced source (a sheet tab) into ONE Table under `home_id`: new rows added,
15298
- * changed rows updated, rows the source dropped archived — never destroyed; columns the
15299
- * person added in Matrx survive. Build the spec with `sheetSyncSpec`.
15120
+ * EVERY organization the person belongs to (active-org-is-never-a-list-filter.md).
15121
+ * `organizationId` above is where NEW things are written and which org a write
15122
+ * runs in; it never decides what a READ shows. With this set, `tableList` /
15123
+ * `tableFacts` span all of these organizations (or one, when the page passes
15124
+ * its `organization_id` filter), and `tableRead` / `recordRead` /
15125
+ * `recordValuesVersioned` open a record in ITS OWN organization. Absent ⇒ the
15126
+ * client reads only `organizationId`, exactly as before.
15300
15127
  */
15301
- tableSync(args: {
15302
- home_id: Uuid;
15303
- spec: TableSyncSpec;
15304
- }): Promise<RecordsResult<TableSyncResult>>;
15128
+ organizationIds?: readonly Uuid[];
15129
+ realtime?: RecordsRealtimePort;
15305
15130
  /**
15306
- * G11. The record-store Table a context scope's template-bound item provisions — one per item
15307
- * and scope. A scope provisioned before the move answers with its moved Table (same id); the
15308
- * Home defaults to the organization's own.
15131
+ * This client's own-write memory (`createOpLedger()`). Hand the SAME ledger to the live-changes port
15132
+ * that listens for this client. Absent ⇒ the realm's default ledger (one client per browser tab).
15309
15133
  */
15310
- scopeTableProvision(args: {
15311
- item_id: Uuid;
15312
- scope_id: Uuid;
15313
- home_id?: Uuid | null;
15314
- }): Promise<RecordsResult<Uuid>>;
15315
- /** G12. The rows of each Table this reader may see, in one call (fold with `withRowCounts`). A Table she may not know gets no row. */
15316
- tableRowCounts(args: {
15317
- table_ids: Uuid[];
15318
- }): Promise<RecordsResult<TableRowCount[]>>;
15319
- /** G12. Each live record's own header (created, updated, version) that the read door does not answer. */
15320
- recordHeaders(args: {
15321
- ids: Uuid[];
15322
- }): Promise<RecordsResult<RecordHeader[]>>;
15134
+ opLedger?: OpLedger;
15135
+ onError?: RecordsErrorSink;
15136
+ resolver?: RecordsResolverPort;
15323
15137
  /**
15324
- * G14. Share a Table with a person by email or account id: an existing account outside the
15325
- * organization is granted at once and notified (never made a member); an address with no
15326
- * account is invited. The organization's outside-sharing setting decides first.
15138
+ * The schema the record store lives in. Exists so a rehearsal branch and
15139
+ * production can differ without a fork; it is `custom` everywhere today.
15327
15140
  */
15328
- tableShareOutsideGrant(args: {
15329
- table_id: Uuid;
15330
- person: string;
15331
- level?: "viewer" | "commenter" | "editor" | "admin";
15332
- }): Promise<RecordsResult<OutsideShareAnswer>>;
15333
- /** G13. Keep a hand-set order on a saved view: the named rows first, in this order (build it with `moveInOrder`). */
15334
- viewRecordOrderSet(args: {
15335
- view_id: Uuid;
15336
- record_ids: Uuid[];
15337
- }): Promise<RecordsResult<ViewOrderSet>>;
15141
+ schema?: string;
15338
15142
  /**
15339
- * G13 + ORDER-FILTER. A page of a hand-ordered view: placed rows by position, then the rest by
15340
- * created time. `filter` is the list door's question (`StoreFilter`: a flat map or a nested
15341
- * Rule — the view's own `where`, or a number clicked on a dashboard); given, the store reads
15342
- * exactly the rows that match, in their places, and `limit`/`offset` page THAT order. Each row
15343
- * answers the position stored for it; rows the filter hides keep theirs.
15143
+ * Doors the generated catalogue (`STORE_DOORS`) does not list YET but this store is known to have —
15144
+ * the nightly clone after a rehearsal, a test store. A screen reading an owed door asks
15145
+ * `doorReady(config, name)` first, so production (which lacks the door until the chair applies it)
15146
+ * is never asked and logs nothing. Leave it out in a shipped host: the regenerated catalogue is
15147
+ * the switch.
15344
15148
  */
15345
- readInViewOrder(args: {
15346
- view_id: Uuid;
15347
- filter?: StoreFilter | null | undefined;
15348
- limit?: number;
15349
- offset?: number;
15350
- }): Promise<RecordsResult<Array<ReadRow & {
15351
- position: number | null;
15352
- }>>>;
15353
- exportXlsx(args: {
15354
- table_id: Uuid;
15355
- columns?: string[] | null;
15356
- limit?: number;
15357
- labels?: Record<string, string>;
15358
- sheetLabel?: string;
15359
- }): Promise<RecordsResult<Uint8Array>>;
15149
+ knownDoors?: readonly string[];
15360
15150
  }
15361
- /** One Table's two lane facts, as `custom.table_facts` answers them. */
15362
- interface TableFact {
15363
- table_id: Uuid;
15151
+ /**
15152
+ * RUN AN AGENT ON THIS ROW — a PORT (step 10, 2026-10-08). A table's agent button ("Draft follow-up") hands
15153
+ * the row to an agent with the action's own prompt. The store ships no agent: the host binds the run (the
15154
+ * agent run itself belongs to `@ai-matrx/agents`; the website starts it through the `data.row_action`
15155
+ * mandate). Everything the run needs rides the target, read as THIS reader sees it — no second read.
15156
+ */
15157
+ interface RowAgentTarget {
15158
+ tableId: Uuid;
15159
+ recordId: Uuid;
15160
+ title: string;
15161
+ action: string;
15162
+ prompt: string;
15163
+ /** The table's name, as the reader sees it. */
15164
+ tableName: string;
15165
+ /** The table's columns. */
15166
+ fields: readonly Field[];
15167
+ /** The row, masked for this reader. */
15168
+ document: RecordDocument;
15169
+ /** This reader's level on the row. */
15170
+ level: PermissionLevel | null;
15171
+ }
15172
+ /** The host's agent runner — `createRecords({ rowAgent })`; records-ui's grid calls it for `kind: "agent"` actions. */
15173
+ interface RowAgentPort {
15174
+ run(target: RowAgentTarget): void | Promise<void>;
15175
+ }
15176
+
15177
+ /**
15178
+ * REL-6. Whether Visibility flows along this relation and the MAXIMUM access
15179
+ * level it carries. Default off on `referenced`, on for `owned`.
15180
+ */
15181
+ interface RelationCarries {
15182
+ carries: boolean;
15183
+ /** The ceiling — a relation never carries more access than this. */
15184
+ max_access: string | null;
15185
+ }
15186
+ /** The seven properties, each its own question. */
15187
+ interface RelationProperties {
15188
+ /** REL-1. Stored once on the contained table, read from the field's side. */
15189
+ flavor: RelationFlavor;
15190
+ /** REL-2. Separate from flavour. */
15191
+ on_delete: OnDelete;
15192
+ /** REL-3. A snapshot is a frozen copy in the relation's payload — never a pointer into History. */
15193
+ binding: RelationBinding;
15194
+ /** REL-4. */
15195
+ ordered: boolean;
15196
+ /** REL-5. */
15197
+ loops: "allowed" | "refused";
15198
+ /** REL-6. */
15199
+ carries: RelationCarries;
15200
+ /** REL-7. */
15201
+ cardinality: RelationCardinality;
15202
+ }
15203
+ /**
15204
+ * REL-8 / REL-N-1. A target is a REFERENCE, written that way from the first
15205
+ * line of code, because it may name a row outside our database. One Table,
15206
+ * several, or any — polymorphic without restriction. External targets are
15207
+ * read-only in v1.
15208
+ */
15209
+ type RelationTarget = {
15210
+ kind: "ours";
15211
+ entity_token: string;
15212
+ row_id: Uuid;
15213
+ } | {
15214
+ kind: "external";
15215
+ connection_token: string;
15216
+ external_table: string;
15217
+ external_key: string;
15218
+ } | {
15219
+ kind: "any";
15220
+ };
15221
+ /** One edge, as the store holds it in `platform.associations`. */
15222
+ interface Relation {
15223
+ id: Uuid;
15224
+ organization_id: Uuid;
15225
+ /** REL-10. The field key, which is what `role` holds. */
15226
+ role: string;
15227
+ source: RelationTarget;
15228
+ target: RelationTarget;
15229
+ properties: RelationProperties;
15230
+ /** REL-4. Meaningful only when `ordered`. */
15231
+ position: number | null;
15232
+ /** REL-3. The frozen copy, when `binding` is `snapshot`. */
15233
+ payload: Record<string, unknown> | null;
15234
+ /** REL-14. Hydrated from the target's title field AT READ — never stored. */
15235
+ label: string | null;
15236
+ created_at: Timestamp;
15237
+ updated_at: Timestamp;
15238
+ /** REL-13 / REL-16. Associations are versioned, so relation history exists. */
15239
+ version: number;
15240
+ }
15241
+ /**
15242
+ * DOOR-6. A query coordinate: "related to THIS, along THAT role, in that
15243
+ * direction". Any combination, and any subset of them.
15244
+ */
15245
+ interface RelationCoordinate {
15246
+ /** The record at the other end. */
15247
+ record_id: Uuid;
15248
+ /** The field key the edge carries as its role. Omit to mean any role. */
15249
+ role?: string;
15250
+ /** Which way to walk. `out` is this record's own relation fields. */
15251
+ direction?: "out" | "in" | "either";
15252
+ }
15253
+ /**
15254
+ * The arguments of the ONE relation-words resolver: the FIELD, because that is where its display
15255
+ * spec is declared and judged (`custom._display_of_field` reads it server-side; the caller never
15256
+ * carries it), and the ids of a page of cells.
15257
+ */
15258
+ /** A linked record's icon, and its table's icon for a record that has none (`relationWordsMany`). */
15259
+ interface RelationIcons {
15260
+ icon: string | null;
15261
+ tableIcon: string | null;
15262
+ }
15263
+ interface RelationWordsManyArgs {
15264
+ field_id: Uuid;
15265
+ record_ids: Uuid[];
15266
+ }
15267
+ /** One reference as the store keeps it. */
15268
+ interface EntityRef {
15269
+ /** The `platform.entity_types` token: `note`, `web_site`, `agent` … */
15270
+ token: string;
15271
+ id: Uuid;
15272
+ }
15273
+ /** One reference as a read door answers it. */
15274
+ interface EntityRefWithWords extends EntityRef {
15364
15275
  /**
15365
- * The old lane word (personal · internal · public), now worked out by the store from `shown_to`
15366
- * and `published_to_web` (access ladder). Read those two; this stays for older stores.
15276
+ * The thing's own title — or the store's withheld sentence when the reader
15277
+ * may not open it; `null` when the kind names no title.
15367
15278
  */
15368
- visibility: string;
15369
- /** Whether the person signed in MADE this Table. Never who did. */
15370
- mine: boolean;
15371
- /** Access ladder "Shown to": only_me · my_team · everyone · everyone_on_ai_matrx; null = the default. */
15372
- shown_to?: string | null;
15373
- /** Access ladder "Published to the web": the only way anyone outside the organization opens it. */
15374
- published_to_web?: boolean;
15279
+ label: string | null;
15280
+ }
15281
+ /** One kind of platform thing a record may point at (`custom.entity_reference_kinds`). */
15282
+ interface EntityReferenceKind {
15283
+ token: string;
15284
+ /** What a person reads: "Note", "Site", "Agent". */
15285
+ label: string;
15286
+ /** The picker's grouping: the admin-assigned reference category, else the schema. */
15287
+ category: string;
15288
+ }
15289
+ /**
15290
+ * The references a cell holds, whichever shape it arrived in — one object, a
15291
+ * list, or what a read door rendered (with labels). Anything that is not a
15292
+ * reference is left out, never guessed at.
15293
+ */
15294
+ declare function entityRefsOf(value: unknown): EntityRefWithWords[];
15295
+ /**
15296
+ * What to WRITE for an entity-reference cell: `{token, id}` only, each thing
15297
+ * once, first mention first — the label a read door added is dropped, because
15298
+ * the store reads it and never keeps it (REL-14). A single-valued column gets
15299
+ * the one object (or `null`), a multi-valued one the list.
15300
+ */
15301
+ declare function entityRefsToWrite(value: unknown, multi: boolean): EntityRef | EntityRef[] | null;
15302
+ /**
15303
+ * The kinds of platform thing a record may point at — what the field editor's
15304
+ * kind picker lists. `custom.entity_reference_kinds()`.
15305
+ */
15306
+ declare function entityReferenceKinds(source: RecordsDataSource): Promise<RecordsResult<EntityReferenceKind[]>>;
15307
+ /**
15308
+ * THE SEARCH DOOR (lane REFERENCE-CARRY). The platform things of these kinds whose words hold
15309
+ * `search`, that THIS person may point a record at — each one a thing the store's own write check
15310
+ * (`custom._entity_reference_target_ok`) would accept, so a picked reference is never refused on
15311
+ * save. `custom.entity_reference_search`. An empty search lists the first things by name.
15312
+ */
15313
+ declare function entityReferenceSearch(source: RecordsDataSource, organizationId: Uuid | null, tokens: readonly string[], search: string, limit?: number): Promise<RecordsResult<EntityRefWithWords[]>>;
15314
+ /**
15315
+ * THE WORDS HELPER. The words of each `{token, id}` for a picker or a chip
15316
+ * before anything is saved — each label read by the store for THIS person and
15317
+ * withheld when they may not open the thing. `custom.entity_reference_words`.
15318
+ * A saved cell needs no call: every read door already answers its labels.
15319
+ */
15320
+ declare function entityReferenceWords(source: RecordsDataSource, organizationId: Uuid | null, refs: readonly EntityRef[]): Promise<RecordsResult<EntityRefWithWords[]>>;
15321
+ /** One reverse column of a Table, as `custom.reverse_columns` answers it. */
15322
+ interface ReverseColumn {
15323
+ /** Stable key: the linking Field's `inverse_key`, else `linked_<field id>`. Never a Field key of B. */
15324
+ key: string;
15325
+ /** What the column is called on B: the linking table's name (plus the column's when ambiguous). */
15326
+ label: string;
15327
+ /** The relation Field on the linking table. */
15328
+ source_field_id: Uuid;
15329
+ source_field_key: string;
15330
+ source_field_label: string;
15331
+ /** The linking table. */
15332
+ source_table_id: Uuid;
15333
+ source_table_name: string;
15334
+ /** Always `many`: any number of records may link to one. */
15335
+ cardinality: "many";
15336
+ /**
15337
+ * True for a virtual back-link (written only from the linking table's side). False for a TWO-WAY
15338
+ * LINK (NOTION-PROPS): the reverse end is a real Field on this table — `key` is its key, `label`
15339
+ * its label — and `relationReverseSet` writes its links from here.
15340
+ */
15341
+ read_only: boolean;
15375
15342
  }
15376
15343
  /**
15377
- * WHERE A TABLE IS CURRENTLY READ AND WRITTEN during the older-table cutover.
15378
- * `tableHome` is an address read from one Table record; this applies the
15379
- * organization's migration switch to a batch of ids, including same-id copies.
15344
+ * NOTION-PROPS. A two-way link's reverse Field: a relation whose `config.reverse_of` names the
15345
+ * forward relation it mirrors. It holds no value of its own — its links are the forward Field's.
15380
15346
  */
15381
- interface TableLiveLocation {
15347
+ declare function isReverseField(field: {
15348
+ type?: unknown;
15349
+ config?: unknown;
15350
+ } | null | undefined): boolean;
15351
+ /** One linking record, as a chip shows it. */
15352
+ interface ReverseLink {
15353
+ id: Uuid;
15354
+ /** The linking record's name, read by the store for this reader. */
15355
+ words: string;
15356
+ }
15357
+ /** The links of one record through one reverse column: how many the reader may see, and one page. */
15358
+ interface ReverseLinks {
15359
+ total: number;
15360
+ links: ReverseLink[];
15361
+ }
15362
+ interface ReverseLinksManyArgs {
15363
+ /** The Table whose records are being shown (B). */
15382
15364
  table_id: Uuid;
15383
- lives_in: "record" | "older";
15384
- why: string | null;
15365
+ /** `ReverseColumn.source_field_id`. */
15366
+ source_field_id: Uuid;
15367
+ /** A page of B's record ids — up to 200 a call; more are sent in groups by the client. */
15368
+ record_ids: readonly Uuid[];
15369
+ /** Links per record, 1–50 (the store holds it there). Default 10. */
15370
+ limit?: number;
15371
+ /** Skip this many links of each record — the next page of one hub record. Default 0. */
15372
+ offset?: number;
15373
+ }
15374
+ /** `reverseLinksFields`: the links of a page through several reverse columns, in one call. */
15375
+ interface ReverseLinksFieldsArgs {
15376
+ table_id: Uuid;
15377
+ /** Each `ReverseColumn.source_field_id` — at most 20. */
15378
+ source_field_ids: readonly Uuid[];
15379
+ record_ids: readonly Uuid[];
15380
+ limit?: number;
15381
+ offset?: number;
15382
+ }
15383
+ /** The store's per-call ceiling on records for `custom.reverse_links_many`. */
15384
+ declare const REVERSE_LINKS_RECORDS_PER_CALL = 200;
15385
+ /** The store's ceiling on links a record per call. */
15386
+ declare const REVERSE_LINKS_PAGE_MAX = 50;
15387
+ /** The store's typed "source archived" answer for a lookup or roll-up. */
15388
+ interface SourceArchived {
15389
+ __unavailable: "source_archived";
15390
+ /** `link`: the relation it reads through is archived; `column`: the far column it reads is. */
15391
+ reads: "link" | "column";
15392
+ /** The archived Field. Absent when the reader may not know its Table. */
15393
+ field_id?: Uuid;
15394
+ /** Its label. Absent when the reader may not know its Table. */
15395
+ label?: string;
15396
+ table_id?: Uuid;
15397
+ /** Its Table's name. Absent when the reader may not know that Table. */
15398
+ table?: string;
15385
15399
  }
15400
+ /** The typed "source archived" answer, when `value` is one; null for any other value. */
15401
+ declare function sourceArchivedOf(value: unknown): SourceArchived | null;
15386
15402
 
15387
- /** One Field a person asked for, in the words a person uses (FLD-1 / FLD-11). */
15388
- interface NewFieldSpec {
15403
+ /**
15404
+ * DYN-14 / DYN-15. An ordered list of merge fields ENDING IN A LITERAL, or the
15405
+ * decision to block the turn, or a named absence. No unresolved value is ever
15406
+ * rendered blank or left as a literal placeholder.
15407
+ */
15408
+ type MissingBehavior = {
15409
+ kind: "fallback";
15410
+ chain: Array<{
15411
+ merge_field_key: string;
15412
+ } | {
15413
+ literal: unknown;
15414
+ }>;
15415
+ } | {
15416
+ kind: "block_turn";
15417
+ } | {
15418
+ kind: "named_absence";
15419
+ say: string;
15420
+ };
15421
+ /** DYN-16. Applied AFTER resolution, on the merge field and never on the Field. */
15422
+ interface MergeFieldTransform {
15423
+ /** e.g. `currency`, `upper`, `date`; the organization's own list. */
15424
+ name: string;
15425
+ options?: Record<string, unknown>;
15426
+ }
15427
+ /** DYN-1. A Record of the kernel Table `Merge Field`. */
15428
+ interface MergeField {
15429
+ id: Uuid;
15430
+ organization_id: Uuid;
15389
15431
  key: string;
15390
15432
  label: string;
15433
+ /** DYN-3. Exactly one of eight. Relationships and rules are NOT sources. */
15434
+ source: MergeFieldSource;
15435
+ /** DYN-4. What it resolves INTO. The consumer never learns which. */
15436
+ semantic_type: MergeFieldSemanticType;
15437
+ /** §A. Any number. Never fused into the source. */
15438
+ modifiers: MergeFieldModifier[];
15391
15439
  /**
15392
- * The word for what this column holds — any word `custom._field_document_for`
15393
- * resolves for `type` (a parity type, a behaviour, a plain synonym, or a kind
15394
- * such as `signature`, `relation`, `entity_reference`, `autonumber`). It is
15395
- * sent to the door as `type`, unmapped; a word that means nothing is refused
15396
- * by name, with the list.
15397
- */
15398
- type: FieldTypeWord;
15399
- sort?: number;
15400
- required?: boolean;
15401
- multi?: boolean;
15402
- config?: Record<string, unknown>;
15403
- /** A choice list's choices, as words. The store keeps them as a Table (FLD-5). */
15404
- options?: string[];
15405
- /** A column that points at another Table of this organization (FLD-11 / REL-8). */
15406
- relationTarget?: Uuid;
15407
- /** A currency column's symbol; a date column's day-or-day-and-time. */
15408
- unit?: string;
15409
- kind?: "date" | "datetime";
15410
- /**
15411
- * An `entity_reference` column's kinds: the platform entity tokens it may point
15412
- * at (`ai_model`, `note`, `web_site` …; `custom.entity_reference_kinds()` lists
15413
- * them). The store refuses an entity reference that names none.
15414
- */
15415
- allowedTypes?: string[];
15416
- /**
15417
- * No two live records may hold the same value here (a `unique` Rule, FLD-3 / B1). A column
15418
- * `recordUpsert` finds a record by must carry it.
15440
+ * DYN-12. Exactly one, and it drives the input surface. It OUTRANKS the
15441
+ * precedence ladder: `server_fixed` is not offered as an input at all, and a
15442
+ * value sent for one anyway is discarded and recorded — never merged.
15419
15443
  */
15420
- unique?: boolean;
15444
+ override_policy: OverridePolicy;
15421
15445
  /**
15422
- * An EXISTING choice list's Table — the column uses those very option records instead of making a
15423
- * new list (a drafts table copying its source table's column keeps the same choices). Sent as
15424
- * `config.options_table_id`.
15446
+ * DYN-13. Whether an override is POSSIBLE and WHO MAY perform it are two
15447
+ * settings. This is the second one: an access level or an organization role.
15425
15448
  */
15426
- optionsTableId?: Uuid;
15449
+ override_requires: string | null;
15450
+ /** DYN-16. */
15451
+ format: MergeFieldTransform | null;
15452
+ /** DYN-17. `inline`, `on_demand`, or `auto` by budget. A value in no tier is a defect. */
15453
+ delivery?: Delivery;
15454
+ /** DYN-14. Declared, always. */
15455
+ missing?: MissingBehavior;
15427
15456
  /**
15428
- * Anything else `custom.field_declare` accepts, passed through verbatim and applied LAST (a stored
15429
- * Field document copied key for key, `format`, `sensitivity`, `via` / `pick` / `agg` / `of`, …).
15430
- * The store judges every key; a word it does not take is refused by name.
15457
+ * What the source needs: for `record`, the starting record and the chain; for
15458
+ * `tool`, the connection token and the freshness ceiling (DYN-20); for
15459
+ * `literal`, the literal.
15431
15460
  */
15432
- declaration?: Partial<NewFieldDeclaration> & Record<string, unknown>;
15461
+ source_config: Record<string, unknown>;
15462
+ created_by: Uuid | null;
15463
+ updated_by: Uuid | null;
15464
+ created_at: Timestamp;
15465
+ updated_at: Timestamp;
15466
+ version: number;
15467
+ metadata: Record<string, unknown>;
15468
+ visibility: string;
15433
15469
  }
15434
-
15435
- /** One door's answer, under its exact arguments. Plain JSON: it crosses from server to browser. */
15436
- interface RecordsSeedAnswer {
15437
- door: string;
15438
- args: Record<string, unknown>;
15439
- data: unknown;
15470
+ /** DYN-8. The triple the RUN gets. Every audit question is answerable from it. */
15471
+ interface ResolutionTriple {
15472
+ record_id: Uuid | null;
15473
+ field_id: Uuid | null;
15474
+ value_version: number | null;
15440
15475
  }
15441
- /** What a server asked for a page, as the person, and when. */
15442
- interface RecordsSeed {
15443
- /** Epoch ms when the server asked. */
15444
- at: number;
15445
- answers: RecordsSeedAnswer[];
15476
+ /** DYN-22. The one provenance row per merge field per turn. */
15477
+ interface MergeFieldProvenance {
15478
+ merge_field_id: Uuid;
15479
+ declared_source: MergeFieldSource;
15480
+ /** Which source actually answered — the fallback chain makes these differ. */
15481
+ actual_source: MergeFieldSource | null;
15482
+ record_id: Uuid | null;
15483
+ field_id: Uuid | null;
15484
+ value_version: number | null;
15485
+ rule_id: Uuid | null;
15486
+ rule_version: number | null;
15487
+ /** DYN-11. Who overrode it, and every LOSER of the ladder, not only the winner. */
15488
+ override_by: Uuid | null;
15489
+ losers?: Array<{
15490
+ source: MergeFieldSource;
15491
+ value: unknown;
15492
+ why_lost: string;
15493
+ }>;
15494
+ /** DYN-11/DYN-12. A value a client sent for a field it may not supply, discarded and recorded. */
15495
+ discarded_attempt?: {
15496
+ value: unknown;
15497
+ because: string;
15498
+ } | null;
15499
+ resolved_at: Timestamp;
15500
+ freshness: Freshness;
15501
+ outcome: string;
15446
15502
  }
15447
-
15448
- /**
15449
- * Mint the id for one client operation and remember it as ours.
15450
- *
15451
- * ONE CALL IS ONE OPERATION. A fifty-row paste through `recordWriteMany` is ONE op id, because
15452
- * the store announces one statement once — and it REFUSES a batch carrying two different ones
15453
- * by name, for exactly that reason.
15454
- */
15455
- declare function mintOpId(): Uuid;
15456
15503
  /**
15457
- * Is this notice the echo of a write this browser made?
15458
- *
15459
- * `undefined`/`null` is NOT ours and never has been: a notice with no `op_id` came from a
15460
- * server-side write, an agent tool, another client, or a store older than this mechanism —
15461
- * all of which are changes this browser has not seen and must read.
15504
+ * What a consumer gets back. `pending` is a first-class answer, not a blank:
15505
+ * until the server's resolver exists, a merge field says so and says WHY
15506
+ * (AGT-N-7 — anything that could not be delivered is named, never omitted).
15462
15507
  */
15463
- declare function isOwnOp(opId: string | null | undefined): boolean;
15464
- /** Test seam: forget everything. Never called by product code. */
15465
- declare function forgetAllOps(): void;
15466
- /** Test seam: how many operations are currently remembered. */
15467
- declare function rememberedOpCount(): number;
15508
+ type MergeFieldResolution = {
15509
+ state: "resolved";
15510
+ /** The rendered string the prompt gets. */
15511
+ rendered: string;
15512
+ value: unknown;
15513
+ triple: ResolutionTriple;
15514
+ provenance: MergeFieldProvenance;
15515
+ } | {
15516
+ state: "absent";
15517
+ /** DYN-14's named absence — what the screen says instead of a blank. */
15518
+ say: string;
15519
+ reason: string;
15520
+ provenance: MergeFieldProvenance | null;
15521
+ } | {
15522
+ state: "pending";
15523
+ /** WHY it is pending, in the words a person can act on. Never empty. */
15524
+ reason: string;
15525
+ };
15526
+
15527
+ /** What kind of object the id is, as `custom.where_id_opens` names it — carried as the door's own word. */
15528
+ type ObjectKind = string;
15529
+ type ObjectOrganizationAnswer =
15530
+ /** The store named the object's organization, and the person may open the object. */
15531
+ {
15532
+ state: "found";
15533
+ organizationId: string;
15534
+ kind: ObjectKind;
15535
+ /** The screen the store says opens it (`/data/<table>?record=…`), or null for a part with none. */
15536
+ path: string | null;
15537
+ /** False when it is in the trash — the person may still open it, to bring it back. */
15538
+ live: boolean;
15539
+ /** The id it answers as — a merged record's survivor. */
15540
+ resolvedId: string;
15541
+ }
15542
+ /** Not given to this person — or not there at all. The store does not say which, on purpose. */
15543
+ | {
15544
+ state: "not-given";
15545
+ }
15546
+ /** We could not ask. NOT an answer about the person's access. */
15547
+ | {
15548
+ state: "unavailable";
15549
+ why: string;
15550
+ };
15551
+ /** Which organization owns an object — the port `createRecords({ organizationOf })` accepts. */
15552
+ interface RecordOrganizationPort {
15553
+ organizationOf(id: string): Promise<ObjectOrganizationAnswer>;
15554
+ }
15555
+ declare const WHERE_ID_OPENS_DOOR = "where_id_opens";
15556
+ /** Ask the store which organization `id` lives in — the one call an object page makes before any other door. */
15557
+ declare function resolveObjectOrganization(dataSource: Pick<RecordsDataSource, "rpc">, id: string): Promise<ObjectOrganizationAnswer>;
15558
+ /** Read one `custom.where_id_opens` answer — asked here, or asked by a server render as the same person. */
15559
+ declare function readObjectOrganizationAnswer(answered: {
15560
+ data: unknown;
15561
+ error: {
15562
+ code?: string | null;
15563
+ message?: string | null;
15564
+ } | null;
15565
+ }, id: string): ObjectOrganizationAnswer;
15566
+ /** The default port: one `custom.where_id_opens` call per ask, nothing kept. */
15567
+ declare function whereIdOpensPort(dataSource: Pick<RecordsDataSource, "rpc">): RecordOrganizationPort;
15468
15568
 
15469
15569
  interface RecordsProviderProps {
15470
15570
  config: RecordsConfig;
@@ -16537,4 +16637,4 @@ interface AppAutomationSpec {
16537
16637
  */
16538
16638
  declare function ensureAppAutomations(client: RecordsClient, def: AnyTypedTableDef, specs: readonly AppAutomationSpec[], options?: TypedTableOrgOptions): Promise<RecordsResult<Uuid[]>>;
16539
16639
 
16540
- export { ABSENCE_REASONS, ACTOR_VOCABULARY, ADDRESS_PARTS, AGENT_WRITER_WORDS, APP_ROWS_CEILING, ARCHIVE_LANES, ARCHIVE_LANE_LABEL, ARCHIVE_LANE_MEANS, type AbsenceReason, type ActionRefusal, type ActionRunResult, type Actor, type AddressPart, type AddressValue, type AggregateBucket, type AggregateCompare, type AggregateCompareKind, type AggregateCompareWindows, type AggregateDelta, type AggregateFilter, type AggregateGroupValue, type AggregateMeasure, type AggregateOperation, type AggregateRow, type AggregateWindow, type AnonTokenBinding, type AnyStoreTable, type AnyTypedTableDef, type AppAutomationSpec, type AppField, type AppFields, type AppRows, type AppUpsertOptions, type ArchiveDeliberatelyArgs, type ArchiveLane, type ArchivedChecklistTemplate, type ArchivedDoorRow, type ArchivedForm, type ArchivedRow, type AutomationAction, type AutomationDeclared, type AutomationFilter, type AutomationFlipped, type AutomationItem, type AutomationLastRun, type AutomationList, type AutomationRun, type AutomationRunStatus, type AutomationRuns, type AutomationSpec, type AutomationStep, type AutomationTrigger, type AutomationValue, type AutomationValues, BARCODE_SYMBOLOGIES, BUILT_KIND_WORD, BUTTON_DOES, type BookingAvailability, type BookingDeclared, type BookingSummary, type BookingWindow, type ButtonDoes, type ButtonPressed, type ButtonSettings, CHOICE_NUDGES, COMPUTE_ON, CONTEXT_POLICIES, type CaptureField, type CaptureFileRef, type CaptureOutcome, type CaptureQuestion, type CaptureQueue, type CaptureQueueCounts, type CaptureQueueOptions, type CaptureQueuePorts, type CaptureQueueStore, type CaptureSheetFace, type CaptureSheetSummary, type CaptureSyncReport, type ChecklistDeclared, type ChecklistRequirement, type ChecklistRequirementKind, type ChecklistRoleSpec, type ChecklistRunStarted, type ChecklistRunStep, type ChecklistRunSummary, type ChecklistSpec, type ChecklistStepCompleted, type ChecklistStepSpec, type ChecklistTemplateShape, type ChecklistTemplateSummary, type ChecklistTrigger, type ChecklistTriggerKind, type ChoiceCellBack, type ChoiceLike, type ChoiceNudge, type ChoiceOption, type ChoiceOptions, type ChoiceRehome, type ChoiceUsage, type ChoicesRehomed, type CoerceOptions, type Coerced, type CoercedAnswers, type CoercibleField, type CommentThreadRead, type CommentWritten, type ComputeOn, type ConfidentialRequest, type ConfidentialState, type ContextPolicy, type ConversationScope, type ConversationScopeContext, type CustomFieldTableType, DECLARABLE_FIELD_KINDS, DEFAULT_ARCHIVE_LANE, DEFAULT_PORTAL_ARCHIVE_FILTER, DELIVERIES, DRILL_CHART_TOKENS, DRILL_DESCRIPTION_MAX, DRILL_DOORS, DRILL_SCHEMA, type DashboardBlock, type DashboardBlockKind, type DashboardBlockResult, type DashboardRunResult, type DashboardSummary, type DashboardTarget, type DashboardTargetBase, type DashboardTargetOp, type DashboardTargetResult, type DashboardTotals, type DataHomeTable, type DeclarableFieldKind, type DecorationColor, type DecorationPath, type DecorationRule, type DecorationRuleOp, type DecorationTarget, type Delivery, type DigestPreview, type DocRenderRow, type DocSignatureCheck, type DocSignatureRow, type DocTemplateRow, type DocToken, type DocUnresolvedToken, type DrillAdHocOp, type DrillAnswer, type DrillAnswerRow, type DrillChartToken, type DrillDeclaration, type DrillDefinition, type DrillDimension, type DrillFinding, type DrillGrain, type DrillHaving, type DrillLane, type DrillLevel, type DrillMeasure, type DrillMeasureOp, type DrillMeasureWhereValue, type DrillPath, type DrillQuestion, type DrillRecords, type DrillRowsPage, type DrillSource, type DrillView, ENTITY_TOKENS, type EnrichAlternate, type EnrichCell, type EnrichDeclared, type EnrichDueRow, type EnrichRun, type EnrichSource, type Enrichment, type EnrichmentSummary, type EntityBackLinkItem, type EntityBackLinks, type EntityFieldRights, type EntityFieldValue, type EntityFieldsAcross, type EntityRecordMatch, type EntityRecordRead, type EntityRecordsFound, type EntityRef, type EntityRefWithWords, type EntityReferenceKind, type EntityReferenceRead, type EntityRowWritten, type EntityTableFacts, type EntityToken, type ExternalPrincipalCard, FIELD_KINDS, FIELD_SENSITIVITIES, FIELD_SOURCES, FRESHNESS, type Field, type FieldBehavior, type FieldDrift, type FieldDriftAspect, type FieldDuplicated, type FieldHistoryEntry, type FieldKind, type FieldOptionEdit, type FieldOptions, type FieldPatch, type FieldProposal, type FieldRetyped, type FieldRule, type FieldSensitivity, type FieldSource, type FieldTypeWord, type ForbiddenEnvelopeWord, type FormArchiveAnswer, type FormLookOptions, type FormResults, type FormRoute, type FormSummary, type FormulaParse, type FormulaPreview, type Freshness, GRADUATION_BASE_COLUMNS, type GraduatedRelation, type GraduatedRow, type GridLayout, type GridLayoutMode, type GridRowHeight, type HiddenFieldNotice, type HistoryActor, type HistoryActorKind, type HistoryChange, type Home, type ImportBatchResult, type ImportColumnPlan, type ImportColumnsDeclared, type ImportFinished, type ImportOpened, type ImportOutcome, type ImportPlan, type ImportPolicy, type ImportProposal, type ImportReport, type ImportRun, type InboundAddress, type InboundDeclared, type InboxCounts, type InboxStateChange, type InsertOf, type IoExportPage, KERNEL_TABLES, type KernelTableName, type KernelTargets, type KeysetRow, type ListTableRowsOptions, MERGE_FIELD_MODIFIERS, MERGE_FIELD_SEMANTIC_TYPES, MERGE_FIELD_SOURCES, type MergeField, type MergeFieldModifier, type MergeFieldProvenance, type MergeFieldResolution, type MergeFieldSemanticType, type MergeFieldSource, type MergeFieldTransform, type MigrationUndone, type MissingBehavior, type MyLevel, type MySubscription, NEWER_FIELD_KINDS, NOT_A_MEMBER_WORDS, type NewEntityFieldDeclaration, type NewFieldDeclaration, type NewerFieldKind, ON_DELETE, OVERRIDE_POLICIES, type OnDelete, type OutsideShareAnswer, type OverridePolicy, PARITY_FIELD_TYPES, PERMISSION_LEVELS, PER_VALUE_ACCESS_WORDS, PIPELINE_RULE_KINDS, PORTAL_ACCENTS, PORTAL_ARCHIVE_FILTERS, type ParityFieldType, type ParityFieldTypeDescriptor, type PerValueAccessWord, type PermissionLevel, type PersonStamp, type PgError, type Pipeline, type PipelineColumn, type PipelineDeclared, type PipelineGate, type PipelineGatePreview, type PipelineMissingField, type PipelineMoveMany, type PipelineMoveManyItem, type PipelineMoveManyResult, type PipelineMoveResult, type PipelineMoveVerdict, type PipelineRule, type PipelineRuleKind, type PipelineSpec, type PipelineStage, type PipelineVerdict, type PortalAccent, type PortalArchiveAnswer, type PortalArchiveFilter, type PortalCard, type PortalConfig, type PortalConfigInput, type PortalFooterLink, type PortalFormAnswer, type PortalFormInput, type PortalFormRef, type PortalFormSpec, type PortalInvitation, type PortalPreviewRow, type PortalPrincipal, type PortalRevocation, type PortalStage, type PortalStyle, type PortalStyleInput, type PortalSummary, type PortalTableExposure, type PortalTableRef, type PredictedRefusal, type ProvenancePointer, type PublicPicture, type PublishBinding, type PublishBindingKind, type QueuedCapture, type QueuedCaptureFile, type QueuedCaptureState, type QuietHours, RECORDS_CACHE_GRACE_MS, REFUSALS_WORTH_REPEATING, RELATION_BINDINGS, RELATION_CARDINALITIES, RELATION_FLAVORS, RETIRED_ACTOR_WORDS, REVERSE_LINKS_PAGE_MAX, REVERSE_LINKS_RECORDS_PER_CALL, ROW_WEB_NOT_READY, RULE_NODE_KINDS, RULE_USES, type ReadRow, type ReadValue, type RecordChange, type RecordChangeAction, type RecordChangeResult, type RecordComment, type RecordDocument, type RecordEvent, type RecordFilter, type RecordGraphWritten, type RecordHeader, type RecordHistoryEntry, type RecordKeysetPage, type RecordPage, type RecordPageData, type RecordPageSort, type RecordRead, type RecordRevision, type RecordRowControls, type RecordScopeComment, type RecordScopeContext, type RecordScopeField, type RecordScopeHistoryEntry, type RecordScopeRelation, type RecordScopeWithheld, type RecordsActor, type RecordsChangeSink, type RecordsConfig, type RecordsDataSource, type RecordsError, type RecordsErrorCode, type RecordsErrorSink, type RecordsFilter, RecordsHoldScope, type RecordsMerged, RecordsProvider, type RecordsProviderProps, type RecordsRealtimePort, type RecordsResolverPort, type RecordsResponse, type RecordsResult, RecordsSeedProvider, type RecordsSeedProviderProps, type RecordsTableQuery, type RegisteredTable, type Relation, type RelationBinding, type RelationCardinality, type RelationCarries, type RelationCoordinate, type RelationDisplay, type RelationFlavor, type RelationIcons, type RelationNameIndex, type RelationNameMatch, type RelationNamesAnswer, type RelationProperties, type RelationTarget, type RelationWordsManyArgs, type ResolutionTriple, type ResolvedPublishBinding, type ResolvedPublishBindingKind, type RestorePreview, type RestoreResult, type RetiredActorWord, type RetypeBehaviour, type RetypePreview, type ReverseColumn, type ReverseLink, type ReverseLinks, type ReverseLinksFieldsArgs, type ReverseLinksManyArgs, type RowAction, type RowActionStep, type RowDefaultsApplied, type RowOf, type RowTemplateRow, type Rule, type RuleAnswer, type RuleExpression, type RuleNodeKind, type RuleUse, SEED_FRESH_MS, SHOWN_TO_LABEL, SHOWN_TO_VALUES, SHOWN_TO_WHO_MAY_CHANGE, STAGE_RULE_ENFORCEMENT, STAGE_RULE_ON_FAIL, STATUS_GROUPS, STATUS_GROUP_WORDS, STORAGE_MODES, STORE_DOORS, STORE_KNOBS, STORE_REFUSAL_CODES, STORE_ROWS_CEILING, SYSTEM_WRITER_WORDS, type SavedViewColorBy, type SavedViewDefinition, type SavedViewLayout, type SavedViewRow, type SavedViewSpecIn, type ShownTo, type SourceArchived, type StagePending, type StagePendingOnBoard, type StageRuleEnforcement, type StageRuleOnFail, type StageRuleWarning, type StaleWriteDetail, type StatusGroup, type StorageMode, type StoreDoorName, type StoreFilter, type StoreInsertOf, type StoreRefusalCode, type StoreRowOf, type StoreRowSnapshot, type StoreTable, type StoreTableColumn, type StoreTableRows, type StoreTableSort, type StoreTableWhere, type StoredRecord, type StuckRow, type Subscription, type SubscriptionBlock, type SubscriptionCadence, type SubscriptionSpec, TABLE_DISPLAYS, TABLE_KIND_PREFIX, TABLE_ORIGINS, TABLE_TYPES, TO_ASSOCIATION, TO_CUSTOM_FIELDS, type Table, type TableArchiveProgress, type TableCapacity, type TableCopyInProgress, type TableDecorations, type TableDisplay, type TableDuplicateProgress, type TableDuplicated, type TableHome, type TableHomeDestination, type TableKindFacts, type TableLevel, type TableLevelApproval, type TableLevelFacts, type TableLevelSet, type TableListEntry, type TableMoved, type TableOrigin, type TablePlacement, type TablePlacementFact, type TableProposal, type TableReaderRule, type TableRenderSchema, type TableRestoreProgress, type TableRowCount, type TableRowDefaults, type TableRowDefaultsPatch, type TableSchemaMode, type TableSyncResult, type TableSyncSource, type TableSyncSpec, type TableType, type TableWebhook, type TableWebhookDeclared, type Timestamp, type TypedChoiceDecision, type TypedDate, type TypedMatchScore, type TypedNumber, type TypedTableChecked, type TypedTableConfidential, type TypedTableDef, type TypedTableEnsured, type TypedTableGraduation, type TypedTableInput, type TypedTableOrgOptions, type TypedTableReader, type TypedTableScope, type TypedTableStatus, type TypedTime, type UniqueKeys, type UseEntityBackLinks, type UseEntityFieldMutation, type UseFieldMutation, type UseRecordMutation, type UseRecordOptions, type UseRecordPageOptions, type UseRecordPageState, type UseRecordsOptions, type UseRecordsState, type UseStoreTable, type UseTableArchive, type UseTypedTable, type UseTypedTableOptions, type Uuid, VALUE_ALTERNATE_KEYS, VALUE_ENVELOPE_KEYS, type ValueAlternate, type ValueAlternateKey, type ValueEnvelope, type ValueEnvelopeKey, type ValueSource, type ViewLayout, type ViewOrderSet, type WorkApprovalDecision, type WorkApprovalFiled, type WorkApprovalState, type WorkApprover, type WorkAssignment, type WorkAssignmentField, type WorkChange, type WorkDecideMany, type WorkDecideManyItem, type WorkDecideManyResult, type WorkDecideVerdict, type WorkDueState, type WorkGraph, type WorkInboxItem, type WorkInboxKind, type WorkInboxView, type WorkInstantiation, type WorkListFlavour, type WorkListItem, type WorkOrigin, type WorkRecordState, type WorkSlotHold, type WorkState, type WorkTemplateNode, type WorkTemplateRelation, type WorkTurn, type WriteConflict, actionRefusals, addressFromText, addressMapUrl, addressText, allowsOtherValues, archiveTableRow, archiveTypedTableDeliberately, archivedByLine, archivedWhen, asChoiceNudge, asPermissionLevel, atLeast, autonumberJoin, autonumberPrefixOf, autonumberSearchOf, autonumberWords, bookingPath, buttonNeeds, buttonOf, buttonUrlPlaceholders, callersTimeZone, checkTypedTable, choiceSlug, choiceValuesOf, choicesOf, coerceTypedAnswer, coerceTypedAnswers, coercionLabel, confidentialGate, confidentialRefusal, confidentialRequest, confidentialState, decideTypedChoice, declareDrillDefinition, defineTypedTable, drillAnswerOf, drillFindingKnob, durationText, emptyArchiveLine, emptyPortalArchiveLine, ensureAppAutomations, ensureTypedTable, entityReferenceKinds, entityReferenceKindsOf, entityReferenceSearch, entityReferenceWords, entityRefsOf, entityRefsToWrite, err, exportPageXlsx, f, fieldKindFor, fieldKindOf, filterWithAutonumber, forgetAllOps, graduatedRow, graduationProblems, hasQuietHours, highestLevel, holdsARetiredChoice, indexedDbStore, isAddressValue, isArchiveLane, isAutonumberField, isButtonField, isDecided, isEntityReferenceConfig, isFoundation, isLockedStub, isOwnOp, isPersonStamp, isPortalAccent, isPortalArchiveFilter, isRecordsErr, isReverseField, isRuleFilter, isShownTo, isTableKind, isTheChosen, keptGroups, keptOutOfSight, keptTableHref, levelHasShownTo, liftWithheld, listAppRows, listTableRows, localeDateOrder, looksLikeAnId, mayDrag, measureKey, memoryStore, mintClientKey, mintOpId, moveConsequence, moveInOrder, newerKindExportWords, newerKindOf, newerKindWords, offeredAsContext, ok, openCaptureQueue, optionKey, optionLabel, parseFieldDrift, parseTableCopiesInProgress, parseTableDuplicateProgress, parseTableDuplicated, parseTableHome, parseTableMoved, personStampText, portalArchiveConsequence, portalConfirmLine, portalPath, portalTitleTypedBack, previewRetype, previewRuleChange, publicFormPath, rankTypedMatches, ratingMaxOf, readTypedDate, readTypedDuration, readTypedNumber, readTypedTime, readersMatch, recordChangeTrigger, recordSourceKey, recordSourceTable, recordsCacheCounters, recordsUseSentence, rehomeSentence, relationNameIndexOf, relationNameKey, relationNamesIn, rememberedOpCount, removeAppRow, removedChoicesInUse, richTextPlain, rowFromDocument, ruleThatRefuses, rulesWithTopStar, safeLinkHref, sameDocument, scopeChip, sha256Hex, sheetSyncSpec, sourceArchivedOf, splitListCell, splitLockedRows, stableFilterKey, statusGroupOf, storeTable, tableIdOf, tableJsonSchema, tableKindMapping, tableKindSlug, tableRenderSchema, tableShapeChanged, twoDigitYear, typedDateText, typedMatchScore, typedTimeText, updateTableRow, upsertAppRow, useEntityBackLinks, useEntityFieldMutation, useEntityFieldRights, useEntityFields, useEntityRecord, useEntityReferenceKinds, useEntityReferenceSearch, useEntityReferenceWords, useEntityTable, useFieldMutation, useFields, useMergeField, useMyLevel, useMyLevels, useOptionalRecordsClient, useRecord, useRecordChangeRevision, useRecordMutation, useRecordPage, useRecordWrites, useRecords, useRecordsActor, useRecordsClient, useRecordsHold, useReverseColumns, useReverseLinks, useRowActions, useSeededAggregate, useSeededAnswer, useSeededAnswerAt, useSeededSource, useStoreTable, useTable, useTableArchive, useTables, useTypedTable, valueConverts, withCallersClock, withRowCounts, withTablePlacement, writeTableRow };
16640
+ export { ABSENCE_REASONS, ACTOR_VOCABULARY, ADDRESS_PARTS, AGENT_WRITER_WORDS, APP_ROWS_CEILING, ARCHIVE_LANES, ARCHIVE_LANE_LABEL, ARCHIVE_LANE_MEANS, type AbsenceReason, type ActionRefusal, type ActionRunResult, type Actor, type AddressPart, type AddressValue, type AggregateBucket, type AggregateCompare, type AggregateCompareKind, type AggregateCompareWindows, type AggregateDelta, type AggregateFilter, type AggregateGroupValue, type AggregateMeasure, type AggregateOperation, type AggregateRow, type AggregateWindow, type AnonTokenBinding, type AnyStoreTable, type AnyTypedTableDef, type AppAutomationSpec, type AppField, type AppFields, type AppRows, type AppUpsertOptions, type ArchiveDeliberatelyArgs, type ArchiveLane, type ArchivedChecklistTemplate, type ArchivedDoorRow, type ArchivedForm, type ArchivedRow, type AutomationAction, type AutomationDeclared, type AutomationFilter, type AutomationFlipped, type AutomationItem, type AutomationLastRun, type AutomationList, type AutomationRun, type AutomationRunStatus, type AutomationRuns, type AutomationSpec, type AutomationStep, type AutomationTrigger, type AutomationValue, type AutomationValues, BARCODE_SYMBOLOGIES, BUILT_KIND_WORD, BUTTON_DOES, type BookingAvailability, type BookingDeclared, type BookingSummary, type BookingWindow, type ButtonDoes, type ButtonPressed, type ButtonSettings, CHOICE_NUDGES, COMPUTE_ON, CONTEXT_POLICIES, type CaptureField, type CaptureFileRef, type CaptureOutcome, type CaptureQuestion, type CaptureQueue, type CaptureQueueCounts, type CaptureQueueOptions, type CaptureQueuePorts, type CaptureQueueStore, type CaptureSheetFace, type CaptureSheetSummary, type CaptureSyncReport, type ChecklistDeclared, type ChecklistRequirement, type ChecklistRequirementKind, type ChecklistRoleSpec, type ChecklistRunStarted, type ChecklistRunStep, type ChecklistRunSummary, type ChecklistSpec, type ChecklistStepCompleted, type ChecklistStepSpec, type ChecklistTemplateShape, type ChecklistTemplateSummary, type ChecklistTrigger, type ChecklistTriggerKind, type ChoiceCellBack, type ChoiceLike, type ChoiceNudge, type ChoiceOption, type ChoiceOptions, type ChoiceRehome, type ChoiceUsage, type ChoicesRehomed, type CoerceOptions, type Coerced, type CoercedAnswers, type CoercibleField, type CommentThreadRead, type CommentWritten, type ComputeOn, type ConfidentialRequest, type ConfidentialState, type ContextPolicy, type ConversationScope, type ConversationScopeContext, type CustomFieldTableType, DECLARABLE_FIELD_KINDS, DEFAULT_ARCHIVE_LANE, DEFAULT_PORTAL_ARCHIVE_FILTER, DELIVERIES, DRILL_CHART_TOKENS, DRILL_DESCRIPTION_MAX, DRILL_DOORS, DRILL_SCHEMA, type DashboardBlock, type DashboardBlockKind, type DashboardBlockResult, type DashboardRunResult, type DashboardSummary, type DashboardTarget, type DashboardTargetBase, type DashboardTargetOp, type DashboardTargetResult, type DashboardTotals, type DataHomeTable, type DeclarableFieldKind, type DecorationColor, type DecorationPath, type DecorationRule, type DecorationRuleOp, type DecorationTarget, type Delivery, type DigestPreview, type DocRenderRow, type DocSignatureCheck, type DocSignatureRow, type DocTemplateRow, type DocToken, type DocUnresolvedToken, type DrillAdHocOp, type DrillAnswer, type DrillAnswerRow, type DrillChartToken, type DrillDeclaration, type DrillDefinition, type DrillDimension, type DrillFinding, type DrillGrain, type DrillHaving, type DrillLane, type DrillLevel, type DrillMeasure, type DrillMeasureOp, type DrillMeasureWhereValue, type DrillPath, type DrillQuestion, type DrillRecords, type DrillRowsPage, type DrillSource, type DrillView, ENTITY_TOKENS, type EnrichAlternate, type EnrichCell, type EnrichDeclared, type EnrichDueRow, type EnrichRun, type EnrichSource, type Enrichment, type EnrichmentSummary, type EntityBackLinkItem, type EntityBackLinks, type EntityFieldRights, type EntityFieldValue, type EntityFieldsAcross, type EntityRecordMatch, type EntityRecordRead, type EntityRecordsFound, type EntityRef, type EntityRefWithWords, type EntityReferenceKind, type EntityReferenceRead, type EntityRowWritten, type EntityTableFacts, type EntityToken, type ExternalPrincipalCard, FIELD_KINDS, FIELD_SENSITIVITIES, FIELD_SOURCES, FRESHNESS, type Field, type FieldBehavior, type FieldDrift, type FieldDriftAspect, type FieldDuplicated, type FieldHistoryEntry, type FieldKind, type FieldOptionEdit, type FieldOptions, type FieldPatch, type FieldProposal, type FieldRetyped, type FieldRule, type FieldSensitivity, type FieldSource, type FieldTypeWord, type ForbiddenEnvelopeWord, type FormArchiveAnswer, type FormLookOptions, type FormResults, type FormRoute, type FormSummary, type FormulaParse, type FormulaPreview, type Freshness, GRADUATION_BASE_COLUMNS, type GraduatedRelation, type GraduatedRow, type GridLayout, type GridLayoutMode, type GridRowHeight, type HiddenFieldNotice, type HistoryActor, type HistoryActorKind, type HistoryChange, type Home, type ImportBatchResult, type ImportColumnPlan, type ImportColumnsDeclared, type ImportFinished, type ImportOpened, type ImportOutcome, type ImportPlan, type ImportPolicy, type ImportProposal, type ImportReport, type ImportRun, type InboundAddress, type InboundDeclared, type InboxCounts, type InboxStateChange, type InsertOf, type IoExportPage, KERNEL_TABLES, type KernelTableName, type KernelTargets, type KeysetRow, type ListTableRowsOptions, MERGE_FIELD_MODIFIERS, MERGE_FIELD_SEMANTIC_TYPES, MERGE_FIELD_SOURCES, type MergeField, type MergeFieldModifier, type MergeFieldProvenance, type MergeFieldResolution, type MergeFieldSemanticType, type MergeFieldSource, type MergeFieldTransform, type MigrationUndone, type MissingBehavior, type MyLevel, type MySubscription, NEWER_FIELD_KINDS, NOT_A_MEMBER_WORDS, type NewEntityFieldDeclaration, type NewFieldDeclaration, type NewerFieldKind, ON_DELETE, OVERRIDE_POLICIES, type ObjectKind, type ObjectOrganizationAnswer, type OnDelete, type OpLedger, type OutsideShareAnswer, type OverridePolicy, PARITY_FIELD_TYPES, PERMISSION_LEVELS, PER_VALUE_ACCESS_WORDS, PIPELINE_RULE_KINDS, PORTAL_ACCENTS, PORTAL_ARCHIVE_FILTERS, type ParityFieldType, type ParityFieldTypeDescriptor, type PerValueAccessWord, type PermissionLevel, type PersonStamp, type PgError, type Pipeline, type PipelineColumn, type PipelineDeclared, type PipelineGate, type PipelineGatePreview, type PipelineMissingField, type PipelineMoveMany, type PipelineMoveManyItem, type PipelineMoveManyResult, type PipelineMoveResult, type PipelineMoveVerdict, type PipelineRule, type PipelineRuleKind, type PipelineSpec, type PipelineStage, type PipelineVerdict, type PortalAccent, type PortalArchiveAnswer, type PortalArchiveFilter, type PortalCard, type PortalConfig, type PortalConfigInput, type PortalFooterLink, type PortalFormAnswer, type PortalFormInput, type PortalFormRef, type PortalFormSpec, type PortalInvitation, type PortalPreviewRow, type PortalPrincipal, type PortalRevocation, type PortalStage, type PortalStyle, type PortalStyleInput, type PortalSummary, type PortalTableExposure, type PortalTableRef, type PredictedRefusal, type ProvenancePointer, type PublicPicture, type PublishBinding, type PublishBindingKind, type QueuedCapture, type QueuedCaptureFile, type QueuedCaptureState, type QuietHours, RECORDS_CACHE_GRACE_MS, REFUSALS_WORTH_REPEATING, RELATION_BINDINGS, RELATION_CARDINALITIES, RELATION_FLAVORS, RETIRED_ACTOR_WORDS, REVERSE_LINKS_PAGE_MAX, REVERSE_LINKS_RECORDS_PER_CALL, ROW_WEB_NOT_READY, RULE_NODE_KINDS, RULE_USES, type ReadRow, type ReadValue, type RecordChange, type RecordChangeAction, type RecordChangeResult, type RecordComment, type RecordDocument, type RecordEvent, type RecordFilter, type RecordGraphWritten, type RecordHeader, type RecordHistoryEntry, type RecordKeysetPage, type RecordOrganizationPort, type RecordPage, type RecordPageData, type RecordPageSort, type RecordRead, type RecordRevision, type RecordRowControls, type RecordScopeComment, type RecordScopeContext, type RecordScopeField, type RecordScopeHistoryEntry, type RecordScopeRelation, type RecordScopeWithheld, type RecordsActor, type RecordsChangeSink, type RecordsConfig, type RecordsDataSource, type RecordsError, type RecordsErrorCode, type RecordsErrorSink, type RecordsFilter, RecordsHoldScope, type RecordsMerged, RecordsProvider, type RecordsProviderProps, type RecordsRealtimePort, type RecordsResolverPort, type RecordsResponse, type RecordsResult, RecordsSeedProvider, type RecordsSeedProviderProps, type RecordsTableQuery, type RegisteredTable, type Relation, type RelationBinding, type RelationCardinality, type RelationCarries, type RelationCoordinate, type RelationDisplay, type RelationFlavor, type RelationIcons, type RelationNameIndex, type RelationNameMatch, type RelationNamesAnswer, type RelationProperties, type RelationTarget, type RelationWordsManyArgs, type ResolutionTriple, type ResolvedPublishBinding, type ResolvedPublishBindingKind, type RestorePreview, type RestoreResult, type RetiredActorWord, type RetypeBehaviour, type RetypePreview, type ReverseColumn, type ReverseLink, type ReverseLinks, type ReverseLinksFieldsArgs, type ReverseLinksManyArgs, type RowAction, type RowActionStep, type RowAgentPort, type RowAgentTarget, type RowDefaultsApplied, type RowOf, type RowTemplateRow, type Rule, type RuleAnswer, type RuleExpression, type RuleNodeKind, type RuleUse, SEED_FRESH_MS, SHOWN_TO_LABEL, SHOWN_TO_VALUES, SHOWN_TO_WHO_MAY_CHANGE, STAGE_RULE_ENFORCEMENT, STAGE_RULE_ON_FAIL, STATUS_GROUPS, STATUS_GROUP_WORDS, STORAGE_MODES, STORE_DOORS, STORE_KNOBS, STORE_REFUSAL_CODES, STORE_ROWS_CEILING, SYSTEM_WRITER_WORDS, type SavedViewColorBy, type SavedViewDefinition, type SavedViewLayout, type SavedViewRow, type SavedViewSpecIn, type ShownTo, type SourceArchived, type StagePending, type StagePendingOnBoard, type StageRuleEnforcement, type StageRuleOnFail, type StageRuleWarning, type StaleWriteDetail, type StatusGroup, type StorageMode, type StoreDoorName, type StoreFilter, type StoreInsertOf, type StoreRefusalCode, type StoreRowOf, type StoreRowSnapshot, type StoreTable, type StoreTableColumn, type StoreTableRows, type StoreTableSort, type StoreTableWhere, type StoredRecord, type StuckRow, type Subscription, type SubscriptionBlock, type SubscriptionCadence, type SubscriptionSpec, TABLE_DISPLAYS, TABLE_KIND_PREFIX, TABLE_ORIGINS, TABLE_TYPES, TO_ASSOCIATION, TO_CUSTOM_FIELDS, type Table, type TableArchiveProgress, type TableCapacity, type TableCopyInProgress, type TableDecorations, type TableDisplay, type TableDuplicateProgress, type TableDuplicated, type TableHome, type TableHomeDestination, type TableKindFacts, type TableLevel, type TableLevelApproval, type TableLevelFacts, type TableLevelSet, type TableListEntry, type TableMoved, type TableOrigin, type TablePlacement, type TablePlacementFact, type TableProposal, type TableReaderRule, type TableRenderSchema, type TableRestoreProgress, type TableRowCount, type TableRowDefaults, type TableRowDefaultsPatch, type TableSchemaMode, type TableSyncResult, type TableSyncSource, type TableSyncSpec, type TableType, type TableWebhook, type TableWebhookDeclared, type Timestamp, type TypedChoiceDecision, type TypedDate, type TypedMatchScore, type TypedNumber, type TypedTableChecked, type TypedTableConfidential, type TypedTableDef, type TypedTableEnsured, type TypedTableGraduation, type TypedTableInput, type TypedTableOrgOptions, type TypedTableReader, type TypedTableScope, type TypedTableStatus, type TypedTime, type UniqueKeys, type UseEntityBackLinks, type UseEntityFieldMutation, type UseFieldMutation, type UseRecordMutation, type UseRecordOptions, type UseRecordPageOptions, type UseRecordPageState, type UseRecordsOptions, type UseRecordsState, type UseStoreTable, type UseTableArchive, type UseTypedTable, type UseTypedTableOptions, type Uuid, VALUE_ALTERNATE_KEYS, VALUE_ENVELOPE_KEYS, type ValueAlternate, type ValueAlternateKey, type ValueEnvelope, type ValueEnvelopeKey, type ValueSource, type ViewLayout, type ViewOrderSet, WHERE_ID_OPENS_DOOR, type WorkApprovalDecision, type WorkApprovalFiled, type WorkApprovalState, type WorkApprover, type WorkAssignment, type WorkAssignmentField, type WorkChange, type WorkDecideMany, type WorkDecideManyItem, type WorkDecideManyResult, type WorkDecideVerdict, type WorkDueState, type WorkGraph, type WorkInboxItem, type WorkInboxKind, type WorkInboxView, type WorkInstantiation, type WorkListFlavour, type WorkListItem, type WorkOrigin, type WorkRecordState, type WorkSlotHold, type WorkState, type WorkTemplateNode, type WorkTemplateRelation, type WorkTurn, type WriteConflict, actionRefusals, addressFromText, addressMapUrl, addressText, allowsOtherValues, archiveTableRow, archiveTypedTableDeliberately, archivedByLine, archivedWhen, asChoiceNudge, asPermissionLevel, atLeast, autonumberJoin, autonumberPrefixOf, autonumberSearchOf, autonumberWords, bookingPath, buttonNeeds, buttonOf, buttonUrlPlaceholders, callersTimeZone, checkTypedTable, choiceSlug, choiceValuesOf, choicesOf, coerceTypedAnswer, coerceTypedAnswers, coercionLabel, confidentialGate, confidentialRefusal, confidentialRequest, confidentialState, createOpLedger, decideTypedChoice, declareDrillDefinition, defaultOpLedger, defineTypedTable, drillAnswerOf, drillFindingKnob, durationText, emptyArchiveLine, emptyPortalArchiveLine, ensureAppAutomations, ensureTypedTable, entityReferenceKinds, entityReferenceKindsOf, entityReferenceSearch, entityReferenceWords, entityRefsOf, entityRefsToWrite, err, exportPageXlsx, f, fieldKindFor, fieldKindOf, filterWithAutonumber, forgetAllOps, graduatedRow, graduationProblems, hasQuietHours, highestLevel, holdsARetiredChoice, indexedDbStore, isAddressValue, isArchiveLane, isAutonumberField, isButtonField, isDecided, isEntityReferenceConfig, isFoundation, isLockedStub, isOwnOp, isPersonStamp, isPortalAccent, isPortalArchiveFilter, isRecordsErr, isReverseField, isRuleFilter, isShownTo, isTableKind, isTheChosen, keptGroups, keptOutOfSight, keptTableHref, levelHasShownTo, liftWithheld, listAppRows, listTableRows, localeDateOrder, looksLikeAnId, mayDrag, measureKey, memoryStore, mintClientKey, mintOpId, moveConsequence, moveInOrder, newerKindExportWords, newerKindOf, newerKindWords, offeredAsContext, ok, openCaptureQueue, optionKey, optionLabel, parseFieldDrift, parseTableCopiesInProgress, parseTableDuplicateProgress, parseTableDuplicated, parseTableHome, parseTableMoved, personStampText, portalArchiveConsequence, portalConfirmLine, portalPath, portalTitleTypedBack, previewRetype, previewRuleChange, publicFormPath, rankTypedMatches, ratingMaxOf, readObjectOrganizationAnswer, readTypedDate, readTypedDuration, readTypedNumber, readTypedTime, readersMatch, recordChangeTrigger, recordSourceKey, recordSourceTable, recordsCacheCounters, recordsUseSentence, rehomeSentence, relationNameIndexOf, relationNameKey, relationNamesIn, rememberedOpCount, removeAppRow, removedChoicesInUse, resolveObjectOrganization, richTextPlain, rowFromDocument, ruleThatRefuses, rulesWithTopStar, safeLinkHref, sameDocument, scopeChip, sha256Hex, sheetSyncSpec, sourceArchivedOf, splitListCell, splitLockedRows, stableFilterKey, statusGroupOf, storeTable, tableIdOf, tableJsonSchema, tableKindMapping, tableKindSlug, tableRenderSchema, tableShapeChanged, twoDigitYear, typedDateText, typedMatchScore, typedTimeText, updateTableRow, upsertAppRow, useEntityBackLinks, useEntityFieldMutation, useEntityFieldRights, useEntityFields, useEntityRecord, useEntityReferenceKinds, useEntityReferenceSearch, useEntityReferenceWords, useEntityTable, useFieldMutation, useFields, useMergeField, useMyLevel, useMyLevels, useOptionalRecordsClient, useRecord, useRecordChangeRevision, useRecordMutation, useRecordPage, useRecordWrites, useRecords, useRecordsActor, useRecordsClient, useRecordsHold, useReverseColumns, useReverseLinks, useRowActions, useSeededAggregate, useSeededAnswer, useSeededAnswerAt, useSeededSource, useStoreTable, useTable, useTableArchive, useTables, useTypedTable, valueConverts, whereIdOpensPort, withCallersClock, withRowCounts, withTablePlacement, writeTableRow };