@ai-matrx/records 0.42.0 → 0.44.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
- import { g as Timestamp, U as Uuid, h as RecordDocument, i as RecordsResult, j as RecordRead, k as ReadRow, l as Field, m as StoredRecord, N as NewFieldDeclaration, n as FieldPatch, o as RecordRevision, p as ReadValue, q as FieldProposal, r as TableProposal, s as RecordsError, W as WriteConflict, P as PgError, t as StaleWriteDetail, u as PredictedRefusal } from '../field-IOFl9Kvu.cjs';
2
- export { A as ABSENCE_REASONS, v as ACTOR_VOCABULARY, w as AbsenceReason, x as Actor, y as COMPUTE_ON, z as CONTEXT_POLICIES, C as ComputeOn, e as ContextPolicy, D as DELIVERIES, B as Delivery, E as ENTITY_TOKENS, G as EntityToken, H as FIELD_SENSITIVITIES, I as FIELD_SOURCES, J as FRESHNESS, K as FieldBehavior, c as FieldRule, d as FieldSensitivity, b as FieldSource, F as FieldTypeWord, L as ForbiddenEnvelopeWord, M as Freshness, Q as HiddenFieldNotice, V as KERNEL_TABLES, X as KernelTableName, Y as MERGE_FIELD_MODIFIERS, Z as MERGE_FIELD_SEMANTIC_TYPES, _ as MERGE_FIELD_SOURCES, $ as MergeFieldModifier, a0 as MergeFieldSemanticType, a1 as MergeFieldSource, a2 as ON_DELETE, a3 as OVERRIDE_POLICIES, O as OnDelete, a4 as OverridePolicy, a5 as PARITY_FIELD_TYPES, a6 as PER_VALUE_ACCESS_WORDS, a7 as ParityFieldType, a8 as ParityFieldTypeDescriptor, a9 as PerValueAccessWord, aa as ProvenancePointer, ab as RELATION_BINDINGS, ac as RELATION_CARDINALITIES, ad as RELATION_FLAVORS, ae as RETIRED_ACTOR_WORDS, af as RULE_NODE_KINDS, ag as RULE_USES, ah as RecordsErrorCode, ai as RelationBinding, f as RelationCardinality, R as RelationFlavor, aj as RetiredActorWord, ak as RuleNodeKind, al as RuleUse, am as STORAGE_MODES, an as STORE_DOORS, ao as STORE_KNOBS, ap as STORE_REFUSAL_CODES, S as StorageMode, aq as StoreDoorName, ar as StoreRefusalCode, as as TABLE_DISPLAYS, at as TABLE_ORIGINS, au as TABLE_TYPES, a as TableDisplay, av as TableOrigin, T as TableType, aw as VALUE_ALTERNATE_KEYS, ax as VALUE_ENVELOPE_KEYS, ay as ValueAlternate, az as ValueAlternateKey, aA as ValueEnvelope, aB as ValueEnvelopeKey, aC as ValueSource, aD as err, aE as isRecordsErr, aF as ok } from '../field-IOFl9Kvu.cjs';
1
+ import { g as Timestamp, U as Uuid, h as RecordDocument, i as RecordsResult, j as RecordRead, k as ReadRow, l as Field, m as StoredRecord, N as NewFieldDeclaration, n as FieldPatch, o as RecordRevision, p as ReadValue, q as FieldProposal, r as TableProposal, s as RecordsError, W as WriteConflict, P as PgError, t as StaleWriteDetail, u as PredictedRefusal } from '../field-D0Rr4Cqb.cjs';
2
+ export { A as ABSENCE_REASONS, v as ACTOR_VOCABULARY, w as AbsenceReason, x as Actor, y as COMPUTE_ON, z as CONTEXT_POLICIES, C as ComputeOn, e as ContextPolicy, D as DELIVERIES, B as Delivery, E as ENTITY_TOKENS, G as EntityToken, H as FIELD_SENSITIVITIES, I as FIELD_SOURCES, J as FRESHNESS, K as FieldBehavior, c as FieldRule, d as FieldSensitivity, b as FieldSource, F as FieldTypeWord, L as ForbiddenEnvelopeWord, M as Freshness, Q as HiddenFieldNotice, V as KERNEL_TABLES, X as KernelTableName, Y as MERGE_FIELD_MODIFIERS, Z as MERGE_FIELD_SEMANTIC_TYPES, _ as MERGE_FIELD_SOURCES, $ as MergeFieldModifier, a0 as MergeFieldSemanticType, a1 as MergeFieldSource, a2 as ON_DELETE, a3 as OVERRIDE_POLICIES, O as OnDelete, a4 as OverridePolicy, a5 as PARITY_FIELD_TYPES, a6 as PER_VALUE_ACCESS_WORDS, a7 as ParityFieldType, a8 as ParityFieldTypeDescriptor, a9 as PerValueAccessWord, aa as ProvenancePointer, ab as RELATION_BINDINGS, ac as RELATION_CARDINALITIES, ad as RELATION_FLAVORS, ae as RETIRED_ACTOR_WORDS, af as RULE_NODE_KINDS, ag as RULE_USES, ah as RecordsErrorCode, ai as RelationBinding, f as RelationCardinality, aj as RelationDisplay, R as RelationFlavor, ak as RetiredActorWord, al as RuleNodeKind, am as RuleUse, an as STORAGE_MODES, ao as STORE_DOORS, ap as STORE_KNOBS, aq as STORE_REFUSAL_CODES, S as StorageMode, ar as StoreDoorName, as as StoreRefusalCode, at as TABLE_DISPLAYS, au as TABLE_ORIGINS, av as TABLE_TYPES, a as TableDisplay, aw as TableOrigin, T as TableType, ax as VALUE_ALTERNATE_KEYS, ay as VALUE_ENVELOPE_KEYS, az as ValueAlternate, aA as ValueAlternateKey, aB as ValueEnvelope, aC as ValueEnvelopeKey, aD as ValueSource, aE as err, aF as isRecordsErr, aG as ok } from '../field-D0Rr4Cqb.cjs';
3
3
  import { RelationCoordinate, RecordsConfig, Table, TableCapacity, EntityTableFacts, NewEntityFieldDeclaration, EntityFieldRights, EntityRecordRead, EntityRecordsFound, Pipeline, PipelineColumn, PipelineVerdict, PipelineMoveResult, PipelineSpec, PipelineDeclared, StageRuleOnFail, StageRuleEnforcement, StagePending, StagePendingOnBoard, PipelineGate, PipelineGatePreview, FormSummary, BookingSummary, BookingAvailability, BookingDeclared, ImportPlan, ImportPolicy, ImportOpened, ImportBatchResult, ImportFinished, ImportReport, ImportRun, InboundDeclared, InboundAddress, PortalSummary, PortalCard, PortalInvitation, PortalRevocation, PortalPreviewRow, DashboardSummary, DashboardBlock, AggregateFilter, DashboardRunResult, StuckRow, CaptureSheetSummary, CaptureSheetFace, CaptureFileRef, CaptureOutcome, EnrichmentSummary, EnrichDeclared, EnrichDueRow, EnrichCell, EnrichRun, AggregateMeasure, AggregateBucket, AggregateRow, Subscription, MySubscription, SubscriptionSpec, DigestPreview, SavedViewRow, SavedViewSpecIn, DocToken, DocUnresolvedToken, DocTemplateRow, DocRenderRow, DocSignatureRow, RecordHistoryEntry, RecordScopeContext, ConversationScope, ConversationScopeContext, FieldHistoryEntry, RestorePreview, RestoreResult, CommentThreadRead, CommentWritten, AnonTokenBinding, ChecklistSpec, ChecklistDeclared, ChecklistTemplateSummary, ChecklistTemplateShape, ChecklistRunStarted, ChecklistRunStep, ChecklistRunSummary, ChecklistStepCompleted, WorkState, WorkGraph, WorkInstantiation, WorkTurn, WorkAssignmentField, WorkSlotHold, WorkInboxItem, WorkListFlavour, WorkListItem, WorkAssignment, WorkRecordState, WorkApprover, WorkChange, WorkApprovalFiled, WorkApprovalDecision, ExternalPrincipalCard, PublishBinding, ResolvedPublishBinding, MyLevel, RecordsDataSource } from '../index.cjs';
4
- export { AggregateOperation, AggregateWindow, BookingWindow, CaptureField, CaptureQuestion, CaptureQueue, CaptureQueueCounts, CaptureQueueOptions, CaptureQueuePorts, CaptureQueueStore, CaptureSyncReport, ChecklistRequirement, ChecklistRequirementKind, ChecklistRoleSpec, ChecklistStepSpec, ChecklistTrigger, ChecklistTriggerKind, ChoiceOption, CustomFieldTableType, DashboardBlockKind, DashboardBlockResult, DocSignatureCheck, EnrichAlternate, EnrichSource, Enrichment, EntityFieldValue, EntityRecordMatch, HistoryActor, HistoryActorKind, HistoryChange, Home, ImportColumnPlan, ImportOutcome, ImportProposal, MergeField, MergeFieldProvenance, MergeFieldResolution, MergeFieldTransform, MissingBehavior, PERMISSION_LEVELS, PIPELINE_RULE_KINDS, PermissionLevel, PipelineMissingField, PipelineRule, PipelineRuleKind, PipelineStage, PortalPrincipal, PortalTableExposure, QueuedCapture, QueuedCaptureFile, QueuedCaptureState, QuietHours, REFUSALS_WORTH_REPEATING, RecordComment, RecordScopeComment, RecordScopeField, RecordScopeHistoryEntry, RecordScopeRelation, RecordScopeWithheld, RecordsActor, RecordsErrorSink, RecordsFilter, RecordsRealtimePort, RecordsResolverPort, RecordsResponse, RecordsTableQuery, RegisteredTable, Relation, RelationCarries, RelationProperties, RelationTarget, ResolutionTriple, Rule, RuleAnswer, RuleExpression, STAGE_RULE_ENFORCEMENT, STAGE_RULE_ON_FAIL, StageRuleWarning, SubscriptionBlock, SubscriptionCadence, WorkDueState, WorkInboxKind, WorkOrigin, WorkTemplateNode, WorkTemplateRelation, asPermissionLevel, atLeast, bookingPath, choiceSlug, choiceValuesOf, choicesOf, highestLevel, holdsARetiredChoice, indexedDbStore, isDecided, isTheChosen, looksLikeAnId, mayDrag, measureKey, memoryStore, mintClientKey, openCaptureQueue, optionKey, optionLabel, portalPath, publicFormPath, scopeChip } from '../index.cjs';
4
+ export { AggregateOperation, AggregateWindow, BookingWindow, CaptureField, CaptureQuestion, CaptureQueue, CaptureQueueCounts, CaptureQueueOptions, CaptureQueuePorts, CaptureQueueStore, CaptureSyncReport, ChecklistRequirement, ChecklistRequirementKind, ChecklistRoleSpec, ChecklistStepSpec, ChecklistTrigger, ChecklistTriggerKind, ChoiceOption, CustomFieldTableType, DashboardBlockKind, DashboardBlockResult, DocSignatureCheck, EnrichAlternate, EnrichSource, Enrichment, EntityFieldValue, EntityRecordMatch, HistoryActor, HistoryActorKind, HistoryChange, Home, ImportColumnPlan, ImportOutcome, ImportProposal, MergeField, MergeFieldProvenance, MergeFieldResolution, MergeFieldTransform, MissingBehavior, PERMISSION_LEVELS, PIPELINE_RULE_KINDS, PermissionLevel, PipelineMissingField, PipelineRule, PipelineRuleKind, PipelineStage, PortalPrincipal, PortalTableExposure, QueuedCapture, QueuedCaptureFile, QueuedCaptureState, QuietHours, REFUSALS_WORTH_REPEATING, RecordComment, RecordScopeComment, RecordScopeField, RecordScopeHistoryEntry, RecordScopeRelation, RecordScopeWithheld, RecordsActor, RecordsChangeSink, RecordsErrorSink, RecordsFilter, RecordsRealtimePort, RecordsResolverPort, RecordsResponse, RecordsTableQuery, RegisteredTable, Relation, RelationCarries, RelationProperties, RelationTarget, ResolutionTriple, Rule, RuleAnswer, RuleExpression, STAGE_RULE_ENFORCEMENT, STAGE_RULE_ON_FAIL, StageRuleWarning, SubscriptionBlock, SubscriptionCadence, WorkDueState, WorkInboxKind, WorkOrigin, WorkTemplateNode, WorkTemplateRelation, asPermissionLevel, atLeast, bookingPath, choiceSlug, choiceValuesOf, choicesOf, forgetAllOps, highestLevel, holdsARetiredChoice, indexedDbStore, isDecided, isOwnOp, isTheChosen, looksLikeAnId, mayDrag, measureKey, memoryStore, mintClientKey, mintOpId, openCaptureQueue, optionKey, optionLabel, portalPath, publicFormPath, rememberedOpCount, scopeChip } from '../index.cjs';
5
5
 
6
6
  /**
7
7
  * DOOR-8. As-of on EITHER clock, and they are different questions:
@@ -143,6 +143,21 @@ interface RecordsClient {
143
143
  rows: ReadRow[];
144
144
  total: number | null;
145
145
  }>>;
146
+ /**
147
+ * DOOR-1 FOR AN ID SET. Exactly these records of this Table, through
148
+ * `custom.read_records_by_ids` — the same ladder, the same level, the same
149
+ * field masking and the same page ceiling as `list`, addressed by id instead
150
+ * of by page. An id the reader may not see simply does not come back, which
151
+ * is the same answer `list` gives by omission.
152
+ *
153
+ * It exists because a realtime notice has always named the exact ids that
154
+ * moved and no door could take them: three cells changing re-read a fifty-row
155
+ * page in every watching browser.
156
+ */
157
+ listByIds(args: {
158
+ table_id: Uuid;
159
+ ids: readonly Uuid[];
160
+ }): Promise<RecordsResult<ReadRow[]>>;
146
161
  query(query: RecordQuery): Promise<RecordsResult<{
147
162
  rows: ReadRow[];
148
163
  total: number | null;
@@ -196,6 +211,28 @@ interface RecordsClient {
196
211
  field_id: Uuid;
197
212
  patch: FieldPatch;
198
213
  }): Promise<RecordsResult<Uuid>>;
214
+ /**
215
+ * REL-DISP. THE WORDS ONE RELATION CELL SHOWS, resolved by the store through
216
+ * that column's own display spec — one column or several, joined by its
217
+ * separator. Never resolve a relation label any other way: the store's
218
+ * `custom._words_for` is the one body that decides what a record is called, it
219
+ * asks the visibility ladder BEFORE it reads the name, and a record this reader
220
+ * may not open comes back as the withheld sentence rather than its name or id.
221
+ * A value that is not an id is handed straight back — it is already words.
222
+ */
223
+ relationWords(args: {
224
+ field_id: Uuid;
225
+ value: string;
226
+ }): Promise<RecordsResult<string | null>>;
227
+ /**
228
+ * The same answer for a WHOLE PAGE of cells in one round trip. Prefer this
229
+ * wherever a grid, board, list or picker resolves more than one chip: the
230
+ * per-id lane is what made a page of relation cells a page of requests.
231
+ */
232
+ relationWordsMany(args: {
233
+ field_id: Uuid;
234
+ record_ids: Uuid[];
235
+ }): Promise<RecordsResult<Record<string, string>>>;
199
236
  /** Take a field off a table. Refuses the title field, the last field, and one another field reads through. */
200
237
  fieldRetire(args: {
201
238
  field_id: Uuid;
@@ -1322,6 +1359,7 @@ declare function doorAbsent(name: string): RecordsError;
1322
1359
  declare const DOORS: {
1323
1360
  readonly readRecord: "read_record";
1324
1361
  readonly readRecords: "read_records";
1362
+ readonly readRecordsByIds: "read_records_by_ids";
1325
1363
  readonly queryRecordAsOf: "query_record_as_of";
1326
1364
  readonly queryTableAsOf: "query_table_as_of";
1327
1365
  readonly recordWrite: "record_write";
@@ -1358,6 +1396,8 @@ declare const DOORS: {
1358
1396
  readonly promotedRead: "promoted_read";
1359
1397
  readonly relationTargets: "relation_targets";
1360
1398
  readonly relationOwn: "relation_own";
1399
+ readonly relationWords: "relation_words";
1400
+ readonly relationWordsMany: "relation_words_many";
1361
1401
  readonly homeAdd: "home_add";
1362
1402
  readonly recordReparent: "record_reparent";
1363
1403
  readonly containmentChain: "containment_chain";
@@ -1,7 +1,7 @@
1
- import { g as Timestamp, U as Uuid, h as RecordDocument, i as RecordsResult, j as RecordRead, k as ReadRow, l as Field, m as StoredRecord, N as NewFieldDeclaration, n as FieldPatch, o as RecordRevision, p as ReadValue, q as FieldProposal, r as TableProposal, s as RecordsError, W as WriteConflict, P as PgError, t as StaleWriteDetail, u as PredictedRefusal } from '../field-IOFl9Kvu.js';
2
- export { A as ABSENCE_REASONS, v as ACTOR_VOCABULARY, w as AbsenceReason, x as Actor, y as COMPUTE_ON, z as CONTEXT_POLICIES, C as ComputeOn, e as ContextPolicy, D as DELIVERIES, B as Delivery, E as ENTITY_TOKENS, G as EntityToken, H as FIELD_SENSITIVITIES, I as FIELD_SOURCES, J as FRESHNESS, K as FieldBehavior, c as FieldRule, d as FieldSensitivity, b as FieldSource, F as FieldTypeWord, L as ForbiddenEnvelopeWord, M as Freshness, Q as HiddenFieldNotice, V as KERNEL_TABLES, X as KernelTableName, Y as MERGE_FIELD_MODIFIERS, Z as MERGE_FIELD_SEMANTIC_TYPES, _ as MERGE_FIELD_SOURCES, $ as MergeFieldModifier, a0 as MergeFieldSemanticType, a1 as MergeFieldSource, a2 as ON_DELETE, a3 as OVERRIDE_POLICIES, O as OnDelete, a4 as OverridePolicy, a5 as PARITY_FIELD_TYPES, a6 as PER_VALUE_ACCESS_WORDS, a7 as ParityFieldType, a8 as ParityFieldTypeDescriptor, a9 as PerValueAccessWord, aa as ProvenancePointer, ab as RELATION_BINDINGS, ac as RELATION_CARDINALITIES, ad as RELATION_FLAVORS, ae as RETIRED_ACTOR_WORDS, af as RULE_NODE_KINDS, ag as RULE_USES, ah as RecordsErrorCode, ai as RelationBinding, f as RelationCardinality, R as RelationFlavor, aj as RetiredActorWord, ak as RuleNodeKind, al as RuleUse, am as STORAGE_MODES, an as STORE_DOORS, ao as STORE_KNOBS, ap as STORE_REFUSAL_CODES, S as StorageMode, aq as StoreDoorName, ar as StoreRefusalCode, as as TABLE_DISPLAYS, at as TABLE_ORIGINS, au as TABLE_TYPES, a as TableDisplay, av as TableOrigin, T as TableType, aw as VALUE_ALTERNATE_KEYS, ax as VALUE_ENVELOPE_KEYS, ay as ValueAlternate, az as ValueAlternateKey, aA as ValueEnvelope, aB as ValueEnvelopeKey, aC as ValueSource, aD as err, aE as isRecordsErr, aF as ok } from '../field-IOFl9Kvu.js';
1
+ import { g as Timestamp, U as Uuid, h as RecordDocument, i as RecordsResult, j as RecordRead, k as ReadRow, l as Field, m as StoredRecord, N as NewFieldDeclaration, n as FieldPatch, o as RecordRevision, p as ReadValue, q as FieldProposal, r as TableProposal, s as RecordsError, W as WriteConflict, P as PgError, t as StaleWriteDetail, u as PredictedRefusal } from '../field-D0Rr4Cqb.js';
2
+ export { A as ABSENCE_REASONS, v as ACTOR_VOCABULARY, w as AbsenceReason, x as Actor, y as COMPUTE_ON, z as CONTEXT_POLICIES, C as ComputeOn, e as ContextPolicy, D as DELIVERIES, B as Delivery, E as ENTITY_TOKENS, G as EntityToken, H as FIELD_SENSITIVITIES, I as FIELD_SOURCES, J as FRESHNESS, K as FieldBehavior, c as FieldRule, d as FieldSensitivity, b as FieldSource, F as FieldTypeWord, L as ForbiddenEnvelopeWord, M as Freshness, Q as HiddenFieldNotice, V as KERNEL_TABLES, X as KernelTableName, Y as MERGE_FIELD_MODIFIERS, Z as MERGE_FIELD_SEMANTIC_TYPES, _ as MERGE_FIELD_SOURCES, $ as MergeFieldModifier, a0 as MergeFieldSemanticType, a1 as MergeFieldSource, a2 as ON_DELETE, a3 as OVERRIDE_POLICIES, O as OnDelete, a4 as OverridePolicy, a5 as PARITY_FIELD_TYPES, a6 as PER_VALUE_ACCESS_WORDS, a7 as ParityFieldType, a8 as ParityFieldTypeDescriptor, a9 as PerValueAccessWord, aa as ProvenancePointer, ab as RELATION_BINDINGS, ac as RELATION_CARDINALITIES, ad as RELATION_FLAVORS, ae as RETIRED_ACTOR_WORDS, af as RULE_NODE_KINDS, ag as RULE_USES, ah as RecordsErrorCode, ai as RelationBinding, f as RelationCardinality, aj as RelationDisplay, R as RelationFlavor, ak as RetiredActorWord, al as RuleNodeKind, am as RuleUse, an as STORAGE_MODES, ao as STORE_DOORS, ap as STORE_KNOBS, aq as STORE_REFUSAL_CODES, S as StorageMode, ar as StoreDoorName, as as StoreRefusalCode, at as TABLE_DISPLAYS, au as TABLE_ORIGINS, av as TABLE_TYPES, a as TableDisplay, aw as TableOrigin, T as TableType, ax as VALUE_ALTERNATE_KEYS, ay as VALUE_ENVELOPE_KEYS, az as ValueAlternate, aA as ValueAlternateKey, aB as ValueEnvelope, aC as ValueEnvelopeKey, aD as ValueSource, aE as err, aF as isRecordsErr, aG as ok } from '../field-D0Rr4Cqb.js';
3
3
  import { RelationCoordinate, RecordsConfig, Table, TableCapacity, EntityTableFacts, NewEntityFieldDeclaration, EntityFieldRights, EntityRecordRead, EntityRecordsFound, Pipeline, PipelineColumn, PipelineVerdict, PipelineMoveResult, PipelineSpec, PipelineDeclared, StageRuleOnFail, StageRuleEnforcement, StagePending, StagePendingOnBoard, PipelineGate, PipelineGatePreview, FormSummary, BookingSummary, BookingAvailability, BookingDeclared, ImportPlan, ImportPolicy, ImportOpened, ImportBatchResult, ImportFinished, ImportReport, ImportRun, InboundDeclared, InboundAddress, PortalSummary, PortalCard, PortalInvitation, PortalRevocation, PortalPreviewRow, DashboardSummary, DashboardBlock, AggregateFilter, DashboardRunResult, StuckRow, CaptureSheetSummary, CaptureSheetFace, CaptureFileRef, CaptureOutcome, EnrichmentSummary, EnrichDeclared, EnrichDueRow, EnrichCell, EnrichRun, AggregateMeasure, AggregateBucket, AggregateRow, Subscription, MySubscription, SubscriptionSpec, DigestPreview, SavedViewRow, SavedViewSpecIn, DocToken, DocUnresolvedToken, DocTemplateRow, DocRenderRow, DocSignatureRow, RecordHistoryEntry, RecordScopeContext, ConversationScope, ConversationScopeContext, FieldHistoryEntry, RestorePreview, RestoreResult, CommentThreadRead, CommentWritten, AnonTokenBinding, ChecklistSpec, ChecklistDeclared, ChecklistTemplateSummary, ChecklistTemplateShape, ChecklistRunStarted, ChecklistRunStep, ChecklistRunSummary, ChecklistStepCompleted, WorkState, WorkGraph, WorkInstantiation, WorkTurn, WorkAssignmentField, WorkSlotHold, WorkInboxItem, WorkListFlavour, WorkListItem, WorkAssignment, WorkRecordState, WorkApprover, WorkChange, WorkApprovalFiled, WorkApprovalDecision, ExternalPrincipalCard, PublishBinding, ResolvedPublishBinding, MyLevel, RecordsDataSource } from '../index.js';
4
- export { AggregateOperation, AggregateWindow, BookingWindow, CaptureField, CaptureQuestion, CaptureQueue, CaptureQueueCounts, CaptureQueueOptions, CaptureQueuePorts, CaptureQueueStore, CaptureSyncReport, ChecklistRequirement, ChecklistRequirementKind, ChecklistRoleSpec, ChecklistStepSpec, ChecklistTrigger, ChecklistTriggerKind, ChoiceOption, CustomFieldTableType, DashboardBlockKind, DashboardBlockResult, DocSignatureCheck, EnrichAlternate, EnrichSource, Enrichment, EntityFieldValue, EntityRecordMatch, HistoryActor, HistoryActorKind, HistoryChange, Home, ImportColumnPlan, ImportOutcome, ImportProposal, MergeField, MergeFieldProvenance, MergeFieldResolution, MergeFieldTransform, MissingBehavior, PERMISSION_LEVELS, PIPELINE_RULE_KINDS, PermissionLevel, PipelineMissingField, PipelineRule, PipelineRuleKind, PipelineStage, PortalPrincipal, PortalTableExposure, QueuedCapture, QueuedCaptureFile, QueuedCaptureState, QuietHours, REFUSALS_WORTH_REPEATING, RecordComment, RecordScopeComment, RecordScopeField, RecordScopeHistoryEntry, RecordScopeRelation, RecordScopeWithheld, RecordsActor, RecordsErrorSink, RecordsFilter, RecordsRealtimePort, RecordsResolverPort, RecordsResponse, RecordsTableQuery, RegisteredTable, Relation, RelationCarries, RelationProperties, RelationTarget, ResolutionTriple, Rule, RuleAnswer, RuleExpression, STAGE_RULE_ENFORCEMENT, STAGE_RULE_ON_FAIL, StageRuleWarning, SubscriptionBlock, SubscriptionCadence, WorkDueState, WorkInboxKind, WorkOrigin, WorkTemplateNode, WorkTemplateRelation, asPermissionLevel, atLeast, bookingPath, choiceSlug, choiceValuesOf, choicesOf, highestLevel, holdsARetiredChoice, indexedDbStore, isDecided, isTheChosen, looksLikeAnId, mayDrag, measureKey, memoryStore, mintClientKey, openCaptureQueue, optionKey, optionLabel, portalPath, publicFormPath, scopeChip } from '../index.js';
4
+ export { AggregateOperation, AggregateWindow, BookingWindow, CaptureField, CaptureQuestion, CaptureQueue, CaptureQueueCounts, CaptureQueueOptions, CaptureQueuePorts, CaptureQueueStore, CaptureSyncReport, ChecklistRequirement, ChecklistRequirementKind, ChecklistRoleSpec, ChecklistStepSpec, ChecklistTrigger, ChecklistTriggerKind, ChoiceOption, CustomFieldTableType, DashboardBlockKind, DashboardBlockResult, DocSignatureCheck, EnrichAlternate, EnrichSource, Enrichment, EntityFieldValue, EntityRecordMatch, HistoryActor, HistoryActorKind, HistoryChange, Home, ImportColumnPlan, ImportOutcome, ImportProposal, MergeField, MergeFieldProvenance, MergeFieldResolution, MergeFieldTransform, MissingBehavior, PERMISSION_LEVELS, PIPELINE_RULE_KINDS, PermissionLevel, PipelineMissingField, PipelineRule, PipelineRuleKind, PipelineStage, PortalPrincipal, PortalTableExposure, QueuedCapture, QueuedCaptureFile, QueuedCaptureState, QuietHours, REFUSALS_WORTH_REPEATING, RecordComment, RecordScopeComment, RecordScopeField, RecordScopeHistoryEntry, RecordScopeRelation, RecordScopeWithheld, RecordsActor, RecordsChangeSink, RecordsErrorSink, RecordsFilter, RecordsRealtimePort, RecordsResolverPort, RecordsResponse, RecordsTableQuery, RegisteredTable, Relation, RelationCarries, RelationProperties, RelationTarget, ResolutionTriple, Rule, RuleAnswer, RuleExpression, STAGE_RULE_ENFORCEMENT, STAGE_RULE_ON_FAIL, StageRuleWarning, SubscriptionBlock, SubscriptionCadence, WorkDueState, WorkInboxKind, WorkOrigin, WorkTemplateNode, WorkTemplateRelation, asPermissionLevel, atLeast, bookingPath, choiceSlug, choiceValuesOf, choicesOf, forgetAllOps, highestLevel, holdsARetiredChoice, indexedDbStore, isDecided, isOwnOp, isTheChosen, looksLikeAnId, mayDrag, measureKey, memoryStore, mintClientKey, mintOpId, openCaptureQueue, optionKey, optionLabel, portalPath, publicFormPath, rememberedOpCount, scopeChip } from '../index.js';
5
5
 
6
6
  /**
7
7
  * DOOR-8. As-of on EITHER clock, and they are different questions:
@@ -143,6 +143,21 @@ interface RecordsClient {
143
143
  rows: ReadRow[];
144
144
  total: number | null;
145
145
  }>>;
146
+ /**
147
+ * DOOR-1 FOR AN ID SET. Exactly these records of this Table, through
148
+ * `custom.read_records_by_ids` — the same ladder, the same level, the same
149
+ * field masking and the same page ceiling as `list`, addressed by id instead
150
+ * of by page. An id the reader may not see simply does not come back, which
151
+ * is the same answer `list` gives by omission.
152
+ *
153
+ * It exists because a realtime notice has always named the exact ids that
154
+ * moved and no door could take them: three cells changing re-read a fifty-row
155
+ * page in every watching browser.
156
+ */
157
+ listByIds(args: {
158
+ table_id: Uuid;
159
+ ids: readonly Uuid[];
160
+ }): Promise<RecordsResult<ReadRow[]>>;
146
161
  query(query: RecordQuery): Promise<RecordsResult<{
147
162
  rows: ReadRow[];
148
163
  total: number | null;
@@ -196,6 +211,28 @@ interface RecordsClient {
196
211
  field_id: Uuid;
197
212
  patch: FieldPatch;
198
213
  }): Promise<RecordsResult<Uuid>>;
214
+ /**
215
+ * REL-DISP. THE WORDS ONE RELATION CELL SHOWS, resolved by the store through
216
+ * that column's own display spec — one column or several, joined by its
217
+ * separator. Never resolve a relation label any other way: the store's
218
+ * `custom._words_for` is the one body that decides what a record is called, it
219
+ * asks the visibility ladder BEFORE it reads the name, and a record this reader
220
+ * may not open comes back as the withheld sentence rather than its name or id.
221
+ * A value that is not an id is handed straight back — it is already words.
222
+ */
223
+ relationWords(args: {
224
+ field_id: Uuid;
225
+ value: string;
226
+ }): Promise<RecordsResult<string | null>>;
227
+ /**
228
+ * The same answer for a WHOLE PAGE of cells in one round trip. Prefer this
229
+ * wherever a grid, board, list or picker resolves more than one chip: the
230
+ * per-id lane is what made a page of relation cells a page of requests.
231
+ */
232
+ relationWordsMany(args: {
233
+ field_id: Uuid;
234
+ record_ids: Uuid[];
235
+ }): Promise<RecordsResult<Record<string, string>>>;
199
236
  /** Take a field off a table. Refuses the title field, the last field, and one another field reads through. */
200
237
  fieldRetire(args: {
201
238
  field_id: Uuid;
@@ -1322,6 +1359,7 @@ declare function doorAbsent(name: string): RecordsError;
1322
1359
  declare const DOORS: {
1323
1360
  readonly readRecord: "read_record";
1324
1361
  readonly readRecords: "read_records";
1362
+ readonly readRecordsByIds: "read_records_by_ids";
1325
1363
  readonly queryRecordAsOf: "query_record_as_of";
1326
1364
  readonly queryTableAsOf: "query_table_as_of";
1327
1365
  readonly recordWrite: "record_write";
@@ -1358,6 +1396,8 @@ declare const DOORS: {
1358
1396
  readonly promotedRead: "promoted_read";
1359
1397
  readonly relationTargets: "relation_targets";
1360
1398
  readonly relationOwn: "relation_own";
1399
+ readonly relationWords: "relation_words";
1400
+ readonly relationWordsMany: "relation_words_many";
1361
1401
  readonly homeAdd: "home_add";
1362
1402
  readonly recordReparent: "record_reparent";
1363
1403
  readonly containmentChain: "containment_chain";
@@ -436,6 +436,45 @@ function isRecordsErr(result) {
436
436
  var ok = (data) => ({ ok: true, data });
437
437
  var err = (error) => ({ ok: false, error });
438
438
 
439
+ // src/ops.ts
440
+ var REMEMBER_MS = 3e4;
441
+ var REMEMBER_MAX = 500;
442
+ var ours = /* @__PURE__ */ new Map();
443
+ function trim(now) {
444
+ for (const [id, at] of ours) {
445
+ if (now - at <= REMEMBER_MS) break;
446
+ ours.delete(id);
447
+ }
448
+ while (ours.size > REMEMBER_MAX) {
449
+ const oldest = ours.keys().next();
450
+ if (oldest.done === true) break;
451
+ ours.delete(oldest.value);
452
+ }
453
+ }
454
+ function mintOpId() {
455
+ const id = crypto.randomUUID();
456
+ const now = Date.now();
457
+ ours.set(id, now);
458
+ trim(now);
459
+ return id;
460
+ }
461
+ function isOwnOp(opId) {
462
+ if (!opId) return false;
463
+ const at = ours.get(opId);
464
+ if (at === void 0) return false;
465
+ if (Date.now() - at > REMEMBER_MS) {
466
+ ours.delete(opId);
467
+ return false;
468
+ }
469
+ return true;
470
+ }
471
+ function forgetAllOps() {
472
+ ours.clear();
473
+ }
474
+ function rememberedOpCount() {
475
+ return ours.size;
476
+ }
477
+
439
478
  // src/store.generated.ts
440
479
  var ACTOR_VOCABULARY = ["user", "agent", "system"];
441
480
  var RETIRED_ACTOR_WORDS = { "ai": "agent", "code": "system", "human": "user" };
@@ -879,6 +918,7 @@ var STORE_DOORS = [
879
918
  { name: "read_paths_outside_the_door", args: "", returns: "TABLE(object_name text, why text)", security: "invoker" },
880
919
  { name: "read_record", args: "p_organization_id uuid, p_record_id uuid, p_by_id boolean DEFAULT false", returns: "jsonb", security: "definer" },
881
920
  { name: "read_records", args: "p_organization_id uuid, p_table_id uuid, p_by_id boolean DEFAULT false, p_limit integer DEFAULT 200, p_offset integer DEFAULT 0", returns: "TABLE(id uuid, document jsonb, level permission_level)", security: "definer" },
921
+ { name: "read_records_by_ids", args: "p_organization_id uuid, p_table_id uuid, p_record_ids uuid[], p_by_id boolean DEFAULT false", returns: "TABLE(id uuid, document jsonb, level permission_level)", security: "definer" },
882
922
  { name: "realtime_topic_admits", args: "p_topic text", returns: "boolean", security: "definer" },
883
923
  { name: "record_aggregate", args: "p_organization_id uuid, p_table_id uuid, p_group_by jsonb DEFAULT '[]'::jsonb, p_measures jsonb DEFAULT '[]'::jsonb, p_bucket jsonb DEFAULT NULL::jsonb, p_filter jsonb DEFAULT '{}'::jsonb, p_limit integer DEFAULT 200, p_required text DEFAULT 'viewer'::text", returns: "TABLE(groups jsonb, measures jsonb, row_count bigint)", security: "definer" },
884
924
  { name: "record_applicability", args: "p_organization_id uuid, p_record_id uuid", returns: "TABLE(rule_id uuid, rule_name text, rule_version integer, applies boolean, answer jsonb)", security: "invoker" },
@@ -903,6 +943,7 @@ var STORE_DOORS = [
903
943
  { name: "record_values", args: "p_organization_id uuid, p_record_id uuid", returns: "jsonb", security: "invoker" },
904
944
  { name: "record_values_of", args: "p_row custom.record", returns: "jsonb", security: "invoker" },
905
945
  { name: "record_values_versioned", args: "p_organization_id uuid, p_record_id uuid", returns: "TABLE(field_key text, field_id uuid, value jsonb, value_version integer, source jsonb, absent_reason text, actor text, on_behalf_of text, written_at timestamp with time zone, alternates jsonb)", security: "definer" },
946
+ { name: "record_words", args: "p_organization_id uuid, p_record_id uuid, p_noun text DEFAULT NULL::text", returns: "text", security: "definer" },
906
947
  { name: "record_write", args: "p_organization_id uuid, p_table_id uuid, p_data jsonb", returns: "uuid", security: "definer" },
907
948
  { name: "record_write_many", args: "p_organization_id uuid, p_table_id uuid, p_rows jsonb[], p_ids uuid[] DEFAULT NULL::uuid[]", returns: "uuid[]", security: "definer" },
908
949
  { name: "refusals_claiming_a_level_never_asked", args: "", returns: "TABLE(function_name text, identity_args text, why text)", security: "invoker" },
@@ -914,6 +955,8 @@ var STORE_DOORS = [
914
955
  { name: "relation_target_ours", args: "p_entity_token text, p_row_id uuid", returns: "jsonb", security: "definer" },
915
956
  { name: "relation_targets", args: "p_organization_id uuid, p_record_id uuid, p_via_key text", returns: "SETOF uuid", security: "definer" },
916
957
  { name: "relation_uncarry", args: "p_organization_id uuid, p_container_id uuid, p_item_id uuid", returns: "integer", security: "definer" },
958
+ { name: "relation_words", args: "p_organization_id uuid, p_field_id uuid, p_value text", returns: "text", security: "definer" },
959
+ { name: "relation_words_many", args: "p_organization_id uuid, p_field_id uuid, p_record_ids uuid[]", returns: "TABLE(record_id uuid, words text)", security: "definer" },
917
960
  { name: "reopen_declared_doors", args: "", returns: "TABLE(reopened text)", security: "definer" },
918
961
  { name: "required_epoch", args: "p_container_type text, p_container_id uuid, p_item_type text, p_item_id uuid", returns: "bigint", security: "definer" },
919
962
  { name: "resolve_first_match", args: "p_organization_id uuid, p_record_id uuid", returns: "jsonb", security: "invoker" },
@@ -1103,18 +1146,18 @@ var STORE_KNOBS = [
1103
1146
  { key: "world_publish_enabled", value: "false", type: "boolean" }
1104
1147
  ];
1105
1148
  var STORE_REFUSAL_CODES = [
1106
- { code: "02000", raised_by: "_checklist_instantiate,checklist_declare,checklist_run,checklist_step_complete,checklist_step_refusal,checklist_template_shape,conversation_scope_bind,dashboard_delete,dashboard_run,doc_letterhead,doc_render_body,doc_render_document,doc_render_read,doc_sign,doc_signature_intact,doc_signature_read,doc_template_delete,doc_template_read,doc_template_save,enrich_pin,entity_field_retire,entity_field_update,entity_record_read,entity_value_write,external_history_event,external_rows,external_stub_upsert,external_writes_set,io_restore,migrate_delete,migrate_extract_parent,migrate_merge,migrate_reclass,migrate_rename,migrate_reparent,migrate_retype,migrate_split,migrate_undo,organization_clear,portal_card,portal_declare,portal_invite,portal_preview,portal_principal_bind,portal_revoke,read_record,record_delete,record_restore,record_restore_preview,record_table,record_update,relation_uncarry,share_access,share_grant,share_lane_set,share_people,share_revoke,sign_request_cancel,sign_request_create,sign_request_remind,sign_request_unchanged,table_share_outside_accept,table_share_outside_invite,table_share_outside_resend,table_share_outside_revoke,visibility_as_of,work_approval_decide,work_approval_read,work_approval_request,work_assign,work_record_states,work_set_state" },
1149
+ { code: "02000", raised_by: "_checklist_instantiate,_table_share_invite_payload,checklist_declare,checklist_run,checklist_step_complete,checklist_step_refusal,checklist_template_shape,conversation_scope_bind,dashboard_delete,dashboard_run,doc_letterhead,doc_render_body,doc_render_document,doc_render_read,doc_sign,doc_signature_intact,doc_signature_read,doc_template_delete,doc_template_read,doc_template_save,enrich_pin,entity_field_retire,entity_field_update,entity_record_read,entity_value_write,external_history_event,external_rows,external_stub_upsert,external_writes_set,io_restore,migrate_delete,migrate_extract_parent,migrate_merge,migrate_reclass,migrate_rename,migrate_reparent,migrate_retype,migrate_split,migrate_undo,organization_clear,portal_card,portal_declare,portal_invite,portal_preview,portal_principal_bind,portal_revoke,read_record,record_delete,record_restore,record_restore_preview,record_table,record_update,relation_uncarry,share_access,share_grant,share_lane_set,share_people,share_revoke,sign_request_cancel,sign_request_create,sign_request_remind,sign_request_unchanged,table_share_outside_accept,table_share_outside_invite,table_share_outside_resend,table_share_outside_revoke,visibility_as_of,work_approval_decide,work_approval_read,work_approval_request,work_assign,work_record_states,work_set_state" },
1107
1150
  { code: "0A000", raised_by: "checklist_step_complete,external_rows,external_source_declare,external_write_through,promote_field,promoted_index_expr,promoted_query_sql,promoted_read,rule_eval,work_assign" },
1108
1151
  { code: "22003", raised_by: "context_resolve" },
1109
1152
  { code: "22004", raised_by: "_entity_custom_fields_guard,_value_envelope,actor_word,agg_assert_key,agg_sql,anon_capture,anon_token_issue,anon_write,assert_client_may_reach,booking_declare,capture_submit,checklist_declare,context_resolve,dashboard_block_normalize,dashboard_declare,dashboard_window_sql,doc_render_write,doc_sign,doc_signature_write,doc_template_save,enrich_land,enrich_normalize,external_history_event,external_rows,external_source_declare,external_stub_upsert,external_write_through,external_writes_set,field_history,form_declare,form_submit,home_add,io_comment_write,io_import_begin,io_infer_column,io_outbox_drain,io_restore,migrate_choice_keys,migrate_purge,migrate_reclass,migrate_split,migrate_undo,organization_clear,organization_contents,pipeline_declare,pipeline_gate_preview,portal_declare,portal_invite,portal_principal_bind,provenance_retention_days,provenance_write,query_across_homes,query_by_coordinates,query_rollup,record_delete,record_reparent,record_resolve,record_restore,record_update,record_write,record_write_many,relation_carry,relation_own,rule_declare,share_grant,sign_request_create,sign_request_sign,subscription_declare,table_declare,table_share_outside_invite,value_restore,view_declare,work_approval_decide,work_approval_request,work_template_declare" },
1110
1153
  { code: "22007", raised_by: "dashboard_window_sql" },
1111
1154
  { code: "22012", raised_by: "rule_eval" },
1112
- { code: "22023", raised_by: "_booking_availability,_entity_custom_fields_guard,_value_envelope,_work_shape_guard,actor_word,agg_assert_key,agg_sql,anon_token_issue,booking_declare,containment_parent,dashboard_block_normalize,dashboard_window_sql,doc_render_body,doc_render_write,doc_signature_write,enrich_declare,enrich_land,enrich_normalize,enrich_pin,entity_value_write,external_history_event,external_source_declare,external_stub_upsert,external_write_through,field_history,io_export,io_import_begin,io_import_finish,io_import_plan,io_import_report,io_proposal_accept,migrate_merge,migrate_reclass,my_levels,organization_clear,page_size,pin_agent_cells,pipeline_move,portal_declare,provenance_write,query_by_coordinates,query_rollup,record_update,record_write_many,relation_carry,rule_eval,rule_members,share_grant,share_lane_set,sign_request_create,sign_request_sign,subscription_declare,table_rules,visibility_as_of,work_approval_request,work_list,work_slot_hold" },
1113
- { code: "23503", raised_by: "_booking_availability,_checklist_instantiate,_containment_guard,_field_document_for,_pipeline_stage_key,_record_rule_uses,agg_digest_assemble,anon_publish,anon_rate_take,anon_token_issue,anon_write,assert_organization_wall,booking_cancel,booking_confirm,booking_declare,booking_hold,booking_reschedule,capture_publish,checklist_declare,checklist_steps_table,comment_write,dashboard_declare,delete_rule,doc_sign,doc_template_save,enrich_declare,enrich_due,enrich_land,form_declare,form_submit,home_add,inbound_declare,inbound_mail_land,inbound_set,io_comment_write,io_import_begin,io_import_finish,io_import_report,io_import_rows,io_proposal_accept,migrate_demote,migrate_promote,pipeline_board,pipeline_declare,pipeline_move,pipeline_read,pipeline_transition_refusal,promote_field,promote_table,record_applicability,record_reparent,relation_carry,relation_own,resolve_first_match,rule_applies,rule_declare,rule_eval,rule_members,rule_run,sign_request_create,subscription_mute,subscription_preview,view_declare,work_set_state,work_take_assignment,work_template_instantiate" },
1155
+ { code: "22023", raised_by: "_booking_availability,_entity_custom_fields_guard,_take_op_id,_value_envelope,_work_shape_guard,actor_word,agg_assert_key,agg_sql,anon_token_issue,booking_declare,containment_parent,dashboard_block_normalize,dashboard_window_sql,doc_render_body,doc_render_write,doc_signature_write,enrich_declare,enrich_land,enrich_normalize,enrich_pin,entity_value_write,external_history_event,external_source_declare,external_stub_upsert,external_write_through,field_history,io_export,io_import_begin,io_import_finish,io_import_plan,io_import_report,io_proposal_accept,migrate_merge,migrate_reclass,my_levels,organization_clear,page_size,pin_agent_cells,pipeline_move,portal_declare,provenance_write,query_by_coordinates,query_rollup,record_update,record_write_many,relation_carry,rule_eval,rule_members,share_grant,share_lane_set,sign_request_create,sign_request_sign,subscription_declare,table_rules,visibility_as_of,work_approval_request,work_list,work_slot_hold" },
1156
+ { code: "23503", raised_by: "_booking_availability,_checklist_instantiate,_containment_guard,_display_spec_for,_field_document_for,_pipeline_stage_key,_record_rule_uses,agg_digest_assemble,anon_publish,anon_rate_take,anon_token_issue,anon_write,assert_organization_wall,booking_cancel,booking_confirm,booking_declare,booking_hold,booking_reschedule,capture_publish,checklist_declare,checklist_steps_table,comment_write,dashboard_declare,delete_rule,doc_sign,doc_template_save,enrich_declare,enrich_due,enrich_land,form_declare,form_submit,home_add,inbound_declare,inbound_mail_land,inbound_set,io_comment_write,io_import_begin,io_import_finish,io_import_report,io_import_rows,io_proposal_accept,migrate_demote,migrate_promote,pipeline_board,pipeline_declare,pipeline_move,pipeline_read,pipeline_transition_refusal,promote_field,promote_table,record_applicability,record_reparent,relation_carry,relation_own,resolve_first_match,rule_applies,rule_declare,rule_eval,rule_members,rule_run,sign_request_create,subscription_mute,subscription_preview,view_declare,work_set_state,work_take_assignment,work_template_instantiate" },
1114
1157
  { code: "23505", raised_by: "_unique_rule_holds,doc_sign,doc_signature_write,entity_field_declare,field_declare,home_add,inbound_declare,io_proposal_accept,relation_carry,relation_own,share_grant,sign_request_cancel,sign_request_create,table_share_outside_invite,table_share_outside_resend,work_approval_decide,work_slot_hold" },
1115
- { code: "23514", raised_by: "_checklist_instantiate,_checklist_step_guard,_containment_guard,_dated_values_guard,_derived_fields,_entity_custom_fields_guard,_field_class_guard,_field_document_for,_field_shape_guard,_field_type_parity_guard,_merge_field_shape_guard,_merge_field_temporal_guard,_promoted_field_cap_guard,_record_rule_uses,_resolve_choice_words,_rule_shape_guard,_rule_topology_guard,_store_relation_edge_names_its_field,_table_columns_word_guard,_table_shape_guard,_undeclared_key_guard,_value_envelope,_work_shape_guard,_workdoors_approval_guard,assert_columns_are_defined,assert_entity_is_organization_scoped,capture_publish,capture_sheet_declare,checklist_declare,checklist_step_complete,doc_sign,doc_signature_write,doc_template_save,entity_field_declare,entity_field_retire,entity_field_update,entity_records_find,entity_table,field_declare,field_retire,field_update,home_add,io_import_rows,migrate_merge,relation_carry,relation_own,sign_request_create,sign_request_sign,table_declare,validate_value_envelope,validate_values,work_set_state,work_slots_declare,work_take_assignment,work_template_instantiate" },
1158
+ { code: "23514", raised_by: "_checklist_instantiate,_checklist_step_guard,_containment_guard,_dated_values_guard,_derived_fields,_display_spec_for,_entity_custom_fields_guard,_field_class_guard,_field_document_for,_field_shape_guard,_field_type_parity_guard,_merge_field_shape_guard,_merge_field_temporal_guard,_promoted_field_cap_guard,_record_rule_uses,_resolve_choice_words,_rule_shape_guard,_rule_topology_guard,_store_relation_edge_names_its_field,_table_columns_word_guard,_table_shape_guard,_undeclared_key_guard,_value_envelope,_with_display,_work_shape_guard,_workdoors_approval_guard,assert_columns_are_defined,assert_entity_is_organization_scoped,booking_declare,capture_publish,capture_sheet_declare,checklist_declare,checklist_step_complete,doc_sign,doc_signature_write,doc_template_save,entity_field_declare,entity_field_retire,entity_field_update,entity_records_find,entity_table,field_declare,field_retire,field_update,home_add,io_import_rows,migrate_merge,relation_carry,relation_own,sign_request_create,sign_request_sign,table_declare,validate_value_envelope,validate_values,work_set_state,work_slots_declare,work_take_assignment,work_template_instantiate" },
1116
1159
  { code: "40001", raised_by: "has_visibility_at" },
1117
- { code: "42501", raised_by: "_doc_render_immutable,_doc_signature_immutable,_field_definition_write,_field_write_door,_rule_definition_write,_store_door,anon_capture,anon_inbound_land,anon_publish,anon_token_issue,anon_token_verify,anon_write,assert_client_may_change,assert_client_may_open,assert_client_may_reach,assert_may_know_table,assert_organization_admin,assert_store_door,booking_confirm,booking_declare,booking_hold,capture_submit,checklist_run,comment_write,conversation_scope_bind,conversation_scope_unbind,enrich_declare,enrich_due,enrich_land,enrich_normalize,entity_field_declare,entity_field_retire,entity_field_update,entity_value_write,external_write_through,form_declare,form_submit,inbound_mail_land,io_comment_resolve,io_comment_write,io_import_begin,io_import_finish,io_restore,migrate_purge,migrate_reclass,my_levels,organization_clear,portal_declare,portal_invitation,portal_invite,portal_principal_bind,promote_table,query_visibility_parity,read_record,read_records,record_table,share_grant,subscription_mute,subscription_preview,table_share_outside_accept,table_share_outside_invite,table_share_outside_resend,visibility_as_of,work_approval_decide,work_approval_read,work_approval_request,work_person" },
1160
+ { code: "42501", raised_by: "_doc_render_immutable,_doc_signature_immutable,_field_definition_write,_field_write_door,_rule_definition_write,_store_door,anon_capture,anon_inbound_land,anon_publish,anon_token_issue,anon_token_verify,anon_write,assert_client_may_change,assert_client_may_open,assert_client_may_reach,assert_may_know_table,assert_organization_admin,assert_store_door,booking_confirm,booking_declare,booking_hold,capture_submit,checklist_run,comment_write,conversation_scope_bind,conversation_scope_unbind,enrich_declare,enrich_due,enrich_land,enrich_normalize,entity_field_declare,entity_field_retire,entity_field_update,entity_value_write,external_write_through,form_declare,form_submit,inbound_mail_land,io_comment_resolve,io_comment_write,io_import_begin,io_import_finish,io_restore,migrate_purge,migrate_reclass,my_levels,organization_clear,portal_declare,portal_invitation,portal_invite,portal_principal_bind,promote_table,query_visibility_parity,read_record,read_records,read_records_by_ids,record_table,share_grant,subscription_mute,subscription_preview,table_share_outside_accept,table_share_outside_invite,table_share_outside_resend,visibility_as_of,work_approval_decide,work_approval_read,work_approval_request,work_person" },
1118
1161
  { code: "42703", raised_by: "entity_table,portal_declare" },
1119
1162
  { code: "53400", raised_by: "anon_rate_take,delete_cascade_closure,enrich_due,enrich_land,promote_field" },
1120
1163
  { code: "54001", raised_by: "record_delete" },
@@ -2202,6 +2245,13 @@ var DOORS = {
2202
2245
  // this person could see.
2203
2246
  readRecord: "read_record",
2204
2247
  readRecords: "read_records",
2248
+ // THE SAME READ DOOR, ADDRESSED BY AN ID SET. A realtime notice names the exact ids that
2249
+ // moved; before this existed the only door that took them was the PAGE door, so a
2250
+ // three-cell change re-read fifty rows in every watching browser. It is a separate NAME
2251
+ // rather than a sixth argument to `read_records` because adding a defaulted argument to a
2252
+ // live Postgres function makes every existing call ambiguous — `is not unique`. Same
2253
+ // ladder, same level, same masking, same page ceiling.
2254
+ readRecordsByIds: "read_records_by_ids",
2205
2255
  // DOOR-8, the two clocks. `p_recorded_at` is what the store SAID then;
2206
2256
  // `p_world_on` is what was TRUE of the world on that date, read out of dated
2207
2257
  // values. A client that answered either one itself would be guessing.
@@ -2261,6 +2311,18 @@ var DOORS = {
2261
2311
  promotedRead: "promoted_read",
2262
2312
  relationTargets: "relation_targets",
2263
2313
  relationOwn: "relation_own",
2314
+ // REL-DISP, 2026-09-21. WHAT A RELATION CELL READS, through that column's own
2315
+ // display spec. `custom.record_words` is declared server_only — it takes a bare
2316
+ // record id with no field to scope it — so these are how a screen gets the
2317
+ // words, and they are the ONE way in: three separate copies of "read tableList,
2318
+ // find title_field, call rowName" lived in labels.tsx, RelationPicker.tsx and
2319
+ // PortalsPanel.tsx, and none of them could ever have shown two columns joined.
2320
+ // The `_many` door is the batch TAILS-2 recorded as missing ("there is still no
2321
+ // batch door on the store"), which is why the browser resolved labels one id at
2322
+ // a time. The ladder is NOT batched: the store asks it per record inside
2323
+ // `custom._words_for`, so batching buys a round trip and never a disclosure.
2324
+ relationWords: "relation_words",
2325
+ relationWordsMany: "relation_words_many",
2264
2326
  homeAdd: "home_add",
2265
2327
  recordReparent: "record_reparent",
2266
2328
  containmentChain: "containment_chain",
@@ -2786,17 +2848,18 @@ function createRecordsClient(config) {
2786
2848
  async recordWrite({ table_id, data }) {
2787
2849
  return callDoor(
2788
2850
  DOORS.recordWrite,
2789
- { p_organization_id: org, p_table_id: table_id, p_data: data },
2851
+ { p_organization_id: org, p_table_id: table_id, p_data: { ...data, _op_id: mintOpId() } },
2790
2852
  "recordWrite"
2791
2853
  );
2792
2854
  },
2793
2855
  async recordWriteMany({ table_id, rows, ids }) {
2856
+ const opId = mintOpId();
2794
2857
  return callDoor(
2795
2858
  DOORS.recordWriteMany,
2796
2859
  {
2797
2860
  p_organization_id: org,
2798
2861
  p_table_id: table_id,
2799
- p_rows: rows,
2862
+ p_rows: rows.map((row) => ({ ...row, _op_id: opId })),
2800
2863
  ...ids === void 0 ? {} : { p_ids: ids }
2801
2864
  },
2802
2865
  "recordWriteMany"
@@ -2808,7 +2871,7 @@ function createRecordsClient(config) {
2808
2871
  {
2809
2872
  p_organization_id: org,
2810
2873
  p_record_id: record_id,
2811
- p_patch: patch,
2874
+ p_patch: { ...patch, _op_id: mintOpId() },
2812
2875
  ...expectedVersion === void 0 ? {} : { p_expected_version: expectedVersion }
2813
2876
  },
2814
2877
  "recordUpdate"
@@ -2850,6 +2913,21 @@ function createRecordsClient(config) {
2850
2913
  }
2851
2914
  return ok({ record_id, document, hidden, computed, computedUnavailable });
2852
2915
  },
2916
+ async listByIds({ table_id, ids }) {
2917
+ if (ids.length === 0) return ok([]);
2918
+ const door = await callDoor(
2919
+ DOORS.readRecordsByIds,
2920
+ { p_organization_id: org, p_table_id: table_id, p_record_ids: ids },
2921
+ "listByIds"
2922
+ );
2923
+ if (!door.ok) return err(door.error);
2924
+ return ok(
2925
+ (door.data ?? []).map((row) => {
2926
+ const { document, hidden } = unfold(row.document);
2927
+ return { id: row.id, document, level: row.level, hidden };
2928
+ })
2929
+ );
2930
+ },
2853
2931
  async list({ table_id, limit = 50, offset = 0 }) {
2854
2932
  const door = await callDoor(
2855
2933
  DOORS.readRecords,
@@ -3124,6 +3202,26 @@ function createRecordsClient(config) {
3124
3202
  "fieldRetire"
3125
3203
  );
3126
3204
  },
3205
+ async relationWords({ field_id, value }) {
3206
+ return callDoor(
3207
+ DOORS.relationWords,
3208
+ { p_organization_id: org, p_field_id: field_id, p_value: value },
3209
+ "relationWords"
3210
+ );
3211
+ },
3212
+ async relationWordsMany({ field_id, record_ids }) {
3213
+ const result = await callDoor(
3214
+ DOORS.relationWordsMany,
3215
+ { p_organization_id: org, p_field_id: field_id, p_record_ids: record_ids },
3216
+ "relationWordsMany"
3217
+ );
3218
+ if (!result.ok) return result;
3219
+ const map = {};
3220
+ for (const row of result.data ?? []) {
3221
+ if (row?.record_id && typeof row.words === "string") map[row.record_id] = row.words;
3222
+ }
3223
+ return { ok: true, data: map };
3224
+ },
3127
3225
  async tableDeclare({ spec, homeId }) {
3128
3226
  return callDoor(
3129
3227
  DOORS.tableDeclare,
@@ -5031,6 +5129,7 @@ export {
5031
5129
  err,
5032
5130
  exportCsv,
5033
5131
  exportXlsx,
5132
+ forgetAllOps,
5034
5133
  highestLevel,
5035
5134
  holdsARetiredChoice,
5036
5135
  importCsv,
@@ -5038,6 +5137,7 @@ export {
5038
5137
  indexedDbStore,
5039
5138
  intersectIds,
5040
5139
  isDecided,
5140
+ isOwnOp,
5041
5141
  isRecordsErr,
5042
5142
  isTheChosen,
5043
5143
  looksLikeAnId,
@@ -5046,6 +5146,7 @@ export {
5046
5146
  measureKey,
5047
5147
  memoryStore,
5048
5148
  mintClientKey,
5149
+ mintOpId,
5049
5150
  ok,
5050
5151
  openCaptureQueue,
5051
5152
  optionKey,
@@ -5058,6 +5159,7 @@ export {
5058
5159
  predictValueRefusals,
5059
5160
  predictWriteRefusals,
5060
5161
  publicFormPath,
5162
+ rememberedOpCount,
5061
5163
  scopeChip,
5062
5164
  staleWriteDetail,
5063
5165
  supabaseDataSource,