@ai-matrx/records 0.20.0 → 0.21.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.
package/dist/index.d.cts CHANGED
@@ -4772,6 +4772,185 @@ interface WorkAssignment {
4772
4772
  message: string;
4773
4773
  }
4774
4774
 
4775
+ /** What a step asks for before it counts as done. Every one of these is CHECKED. */
4776
+ type ChecklistRequirementKind =
4777
+ /** A person says it is done. */
4778
+ "none"
4779
+ /** A sentence of evidence, under `note`. */
4780
+ | "note"
4781
+ /** A named value filled in on the step itself. */
4782
+ | "answer"
4783
+ /** A named Field on the record the run is about must hold a value. */
4784
+ | "record_field"
4785
+ /** The step IS a form (SCR-19): finishing it needs a response record. */
4786
+ | "form"
4787
+ /** The step IS a document from a doc template (REC-68): finishing it needs a render. */
4788
+ | "document";
4789
+ interface ChecklistRequirement {
4790
+ kind: ChecklistRequirementKind;
4791
+ /** For `answer` and `record_field`: which value. */
4792
+ key?: string;
4793
+ /** What a person is asked for, in their words. */
4794
+ label?: string;
4795
+ /** For `form`: the published form this step is. */
4796
+ form_id?: Uuid;
4797
+ /** For `document`: the doc template this step renders. */
4798
+ template_id?: Uuid;
4799
+ }
4800
+ /** One step of a checklist, as it is WRITTEN — not as it is run. */
4801
+ interface ChecklistStepSpec {
4802
+ /** The name the checklist refers to this step by; lower-case, unique. */
4803
+ ref: string;
4804
+ /** What a person reads in their work. */
4805
+ title: string;
4806
+ /** Which role owns it. A role the checklist never declares is refused at save. */
4807
+ role?: string;
4808
+ /** How many days after the run starts it is due. */
4809
+ due_days?: number;
4810
+ /** Steps it waits for. A step waits only for steps listed above it. */
4811
+ depends_on?: string[];
4812
+ requires?: ChecklistRequirement;
4813
+ }
4814
+ /** A role, and the person who stands in it by default. */
4815
+ interface ChecklistRoleSpec {
4816
+ role: string;
4817
+ label?: string;
4818
+ user_id?: Uuid | null;
4819
+ }
4820
+ /** What starts a run. */
4821
+ type ChecklistTriggerKind = "manual" | "record_created" | "status_reached";
4822
+ interface ChecklistTrigger {
4823
+ kind: ChecklistTriggerKind;
4824
+ /** The Table being watched, for the two kinds that watch one. */
4825
+ table_id?: Uuid;
4826
+ /** The state, for `status_reached`. */
4827
+ status?: string;
4828
+ }
4829
+ /** THE COMPLETE DECLARATIVE CHECKLIST — one object, one call, a whole process. */
4830
+ interface ChecklistSpec {
4831
+ name: string;
4832
+ /** The Table a run is ABOUT: People, Hires, Jobs, Matters. */
4833
+ about_table_id: Uuid;
4834
+ roles?: ChecklistRoleSpec[];
4835
+ trigger?: ChecklistTrigger;
4836
+ steps: ChecklistStepSpec[];
4837
+ }
4838
+ /** What `custom.checklist_declare` answers. */
4839
+ interface ChecklistDeclared {
4840
+ template_id: Uuid;
4841
+ name: string;
4842
+ about_table_id: Uuid;
4843
+ steps_table_id: Uuid;
4844
+ steps: number;
4845
+ roles: number;
4846
+ trigger: ChecklistTrigger;
4847
+ created: boolean;
4848
+ message: string;
4849
+ ms: number;
4850
+ }
4851
+ /** One row of `custom.checklist_templates`. */
4852
+ interface ChecklistTemplateSummary {
4853
+ template_id: Uuid;
4854
+ name: string;
4855
+ about_table_id: Uuid | null;
4856
+ about_table: string | null;
4857
+ steps: number;
4858
+ roles: number;
4859
+ trigger_kind: ChecklistTriggerKind;
4860
+ trigger_status: string | null;
4861
+ open_runs: number;
4862
+ total_runs: number;
4863
+ updated_at: Timestamp;
4864
+ }
4865
+ /** `custom.checklist_template_shape` — the spec, plus what the editor needs. */
4866
+ type ChecklistTemplateShape = ChecklistSpec & {
4867
+ template_id: Uuid;
4868
+ steps_table_id: Uuid | null;
4869
+ may_change: boolean;
4870
+ };
4871
+ /** What `custom.checklist_start` answers. */
4872
+ interface ChecklistRunStarted {
4873
+ run_id: Uuid;
4874
+ template_id: Uuid;
4875
+ template: string;
4876
+ about_record_id: Uuid | null;
4877
+ about: string | null;
4878
+ steps_table_id: Uuid;
4879
+ steps_created: number;
4880
+ assigned: number;
4881
+ unassigned: number;
4882
+ origin: string;
4883
+ steps: Array<{
4884
+ ref: string;
4885
+ step_id: Uuid;
4886
+ title: string;
4887
+ role: string | null;
4888
+ }>;
4889
+ /** Roles nobody is named for, so the screen can say so rather than show blanks. */
4890
+ waiting_on_a_name: string[];
4891
+ message: string;
4892
+ ms: number;
4893
+ }
4894
+ /** One step of a RUN, as `custom.checklist_run` answers it. */
4895
+ interface ChecklistRunStep {
4896
+ step_id: Uuid;
4897
+ step_order: number;
4898
+ ref: string;
4899
+ title: string;
4900
+ role: string | null;
4901
+ assignee_name: string | null;
4902
+ assignee_user_id: Uuid | null;
4903
+ due_on: Timestamp | null;
4904
+ due_state: WorkDueState;
4905
+ status: string | null;
4906
+ finished: boolean;
4907
+ requires: ChecklistRequirementKind;
4908
+ /**
4909
+ * The key the answer is filed under, as the checklist named it. A screen files
4910
+ * evidence under THIS, never under a name it invented — the store looks for
4911
+ * exactly this key and nothing else.
4912
+ */
4913
+ requires_key: string | null;
4914
+ requires_label: string | null;
4915
+ /** The form or the document template this step is, when it is one. */
4916
+ requires_id: Uuid | null;
4917
+ evidence: Record<string, unknown>;
4918
+ /** The titles of the steps it is still waiting for. */
4919
+ blocked_by: string[];
4920
+ may_complete: boolean;
4921
+ /** Why it cannot be finished right now, in the words a person would use. */
4922
+ refusal: string | null;
4923
+ }
4924
+ /** One row of `custom.checklist_runs`. */
4925
+ interface ChecklistRunSummary {
4926
+ run_id: Uuid;
4927
+ name: string;
4928
+ template_id: Uuid | null;
4929
+ template: string | null;
4930
+ about_record_id: Uuid | null;
4931
+ about: string | null;
4932
+ about_table_id: Uuid | null;
4933
+ started_at: Timestamp | null;
4934
+ started_by: Uuid | null;
4935
+ origin: string;
4936
+ step_count: number;
4937
+ done: number;
4938
+ overdue: number;
4939
+ next_step: string | null;
4940
+ next_due: Timestamp | null;
4941
+ closed_at: Timestamp | null;
4942
+ }
4943
+ /** What `custom.checklist_step_complete` answers. */
4944
+ interface ChecklistStepCompleted {
4945
+ step_id: Uuid;
4946
+ run_id?: Uuid;
4947
+ completed: boolean;
4948
+ evidence?: Record<string, unknown>;
4949
+ steps_left?: number;
4950
+ run_closed?: boolean;
4951
+ message: string;
4952
+ }
4953
+
4775
4954
  /**
4776
4955
  * VIS-31. A signed-in OUTSIDER, with the reason in plain English.
4777
4956
  *
@@ -5199,4 +5378,4 @@ interface ConversationScopeContext {
5199
5378
  /** `About: Acme Industrial` — the chip a bound chat wears. */
5200
5379
  declare function scopeChip(scope: ConversationScope): string;
5201
5380
 
5202
- export { ABSENCE_REASONS, ACTOR_VOCABULARY, type AbsenceReason, type Actor, type AggregateBucket, type AggregateFilter, type AggregateMeasure, type AggregateOperation, type AggregateRow, type AggregateWindow, type AnonTokenBinding, COMPUTE_ON, CONTEXT_POLICIES, type ChoiceOption, type CommentThreadRead, type CommentWritten, type ComputeOn, type ContextPolicy, type ConversationScope, type ConversationScopeContext, type CustomFieldTableType, DELIVERIES, type DashboardBlock, type DashboardBlockKind, type DashboardBlockResult, type DashboardRunResult, type DashboardSummary, type Delivery, type DocRenderRow, type DocSignatureCheck, type DocSignatureRow, type DocTemplateRow, type DocToken, type DocUnresolvedToken, ENTITY_TOKENS, type EntityFieldRights, type EntityFieldValue, type EntityRecordMatch, type EntityRecordRead, type EntityRecordsFound, type EntityTableFacts, type EntityToken, type ExternalPrincipalCard, FIELD_SENSITIVITIES, FIELD_SOURCES, FRESHNESS, type Field, type FieldBehavior, type FieldHistoryEntry, type FieldPatch, type FieldProposal, type FieldRule, type FieldSensitivity, type FieldSource, type FieldTypeWord, type ForbiddenEnvelopeWord, type FormSummary, type Freshness, type HiddenFieldNotice, type HistoryActor, type HistoryActorKind, type HistoryChange, type Home, type ImportBatchResult, type ImportColumnPlan, type ImportFinished, type ImportOpened, type ImportOutcome, type ImportPlan, type ImportPolicy, type ImportProposal, type ImportReport, type ImportRun, type InboundAddress, type InboundDeclared, KERNEL_TABLES, type KernelTableName, 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 MissingBehavior, type MyLevel, type MySubscription, type NewEntityFieldDeclaration, type NewFieldDeclaration, ON_DELETE, OVERRIDE_POLICIES, type OnDelete, type OverridePolicy, PARITY_FIELD_TYPES, PERMISSION_LEVELS, PER_VALUE_ACCESS_WORDS, type ParityFieldType, type ParityFieldTypeDescriptor, type PerValueAccessWord, type PermissionLevel, type PgError, type PortalCard, type PortalInvitation, type PortalPreviewRow, type PortalPrincipal, type PortalRevocation, type PortalSummary, type PortalTableExposure, type PredictedRefusal, type ProvenancePointer, type PublishBinding, RELATION_BINDINGS, RELATION_CARDINALITIES, RELATION_FLAVORS, RETIRED_ACTOR_WORDS, RULE_NODE_KINDS, RULE_USES, type ReadRow, type ReadValue, type RecordComment, type RecordDocument, type RecordHistoryEntry, type RecordRead, type RecordRevision, type RecordScopeComment, type RecordScopeContext, type RecordScopeField, type RecordScopeHistoryEntry, type RecordScopeRelation, type RecordScopeWithheld, type RecordsActor, type RecordsConfig, type RecordsDataSource, type RecordsError, type RecordsErrorCode, type RecordsErrorSink, type RecordsFilter, type RecordsRealtimePort, type RecordsResolverPort, type RecordsResponse, type RecordsResult, type RecordsTableQuery, type RegisteredTable, type Relation, type RelationBinding, type RelationCardinality, type RelationCarries, type RelationCoordinate, type RelationFlavor, type RelationProperties, type RelationTarget, type ResolutionTriple, type ResolvedPublishBinding, type RestorePreview, type RestoreResult, type RetiredActorWord, type Rule, type RuleAnswer, type RuleExpression, type RuleNodeKind, type RuleUse, STORAGE_MODES, STORE_DOORS, STORE_KNOBS, STORE_REFUSAL_CODES, type StaleWriteDetail, type StorageMode, type StoreDoorName, type StoreRefusalCode, type StoredRecord, type StuckRow, type Subscription, type SubscriptionBlock, type SubscriptionCadence, TABLE_DISPLAYS, TABLE_ORIGINS, TABLE_TYPES, type Table, type TableCapacity, type TableDisplay, type TableOrigin, type TableProposal, type TableType, type Timestamp, type Uuid, VALUE_ALTERNATE_KEYS, VALUE_ENVELOPE_KEYS, type ValueAlternate, type ValueAlternateKey, type ValueEnvelope, type ValueEnvelopeKey, type ValueSource, type WorkApprovalDecision, type WorkApprovalFiled, type WorkApprover, type WorkAssignment, type WorkAssignmentField, type WorkChange, type WorkDueState, type WorkGraph, type WorkInboxItem, type WorkInboxKind, type WorkInstantiation, type WorkListFlavour, type WorkListItem, type WorkOrigin, type WorkRecordState, type WorkSlotHold, type WorkState, type WorkTemplateNode, type WorkTemplateRelation, type WorkTurn, type WriteConflict, asPermissionLevel, atLeast, choiceSlug, choiceValuesOf, choicesOf, err, highestLevel, holdsARetiredChoice, isRecordsErr, isTheChosen, looksLikeAnId, measureKey, ok, optionKey, optionLabel, portalPath, publicFormPath, scopeChip };
5381
+ export { ABSENCE_REASONS, ACTOR_VOCABULARY, type AbsenceReason, type Actor, type AggregateBucket, type AggregateFilter, type AggregateMeasure, type AggregateOperation, type AggregateRow, type AggregateWindow, type AnonTokenBinding, COMPUTE_ON, CONTEXT_POLICIES, 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 ChoiceOption, type CommentThreadRead, type CommentWritten, type ComputeOn, type ContextPolicy, type ConversationScope, type ConversationScopeContext, type CustomFieldTableType, DELIVERIES, type DashboardBlock, type DashboardBlockKind, type DashboardBlockResult, type DashboardRunResult, type DashboardSummary, type Delivery, type DocRenderRow, type DocSignatureCheck, type DocSignatureRow, type DocTemplateRow, type DocToken, type DocUnresolvedToken, ENTITY_TOKENS, type EntityFieldRights, type EntityFieldValue, type EntityRecordMatch, type EntityRecordRead, type EntityRecordsFound, type EntityTableFacts, type EntityToken, type ExternalPrincipalCard, FIELD_SENSITIVITIES, FIELD_SOURCES, FRESHNESS, type Field, type FieldBehavior, type FieldHistoryEntry, type FieldPatch, type FieldProposal, type FieldRule, type FieldSensitivity, type FieldSource, type FieldTypeWord, type ForbiddenEnvelopeWord, type FormSummary, type Freshness, type HiddenFieldNotice, type HistoryActor, type HistoryActorKind, type HistoryChange, type Home, type ImportBatchResult, type ImportColumnPlan, type ImportFinished, type ImportOpened, type ImportOutcome, type ImportPlan, type ImportPolicy, type ImportProposal, type ImportReport, type ImportRun, type InboundAddress, type InboundDeclared, KERNEL_TABLES, type KernelTableName, 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 MissingBehavior, type MyLevel, type MySubscription, type NewEntityFieldDeclaration, type NewFieldDeclaration, ON_DELETE, OVERRIDE_POLICIES, type OnDelete, type OverridePolicy, PARITY_FIELD_TYPES, PERMISSION_LEVELS, PER_VALUE_ACCESS_WORDS, type ParityFieldType, type ParityFieldTypeDescriptor, type PerValueAccessWord, type PermissionLevel, type PgError, type PortalCard, type PortalInvitation, type PortalPreviewRow, type PortalPrincipal, type PortalRevocation, type PortalSummary, type PortalTableExposure, type PredictedRefusal, type ProvenancePointer, type PublishBinding, RELATION_BINDINGS, RELATION_CARDINALITIES, RELATION_FLAVORS, RETIRED_ACTOR_WORDS, RULE_NODE_KINDS, RULE_USES, type ReadRow, type ReadValue, type RecordComment, type RecordDocument, type RecordHistoryEntry, type RecordRead, type RecordRevision, type RecordScopeComment, type RecordScopeContext, type RecordScopeField, type RecordScopeHistoryEntry, type RecordScopeRelation, type RecordScopeWithheld, type RecordsActor, type RecordsConfig, type RecordsDataSource, type RecordsError, type RecordsErrorCode, type RecordsErrorSink, type RecordsFilter, type RecordsRealtimePort, type RecordsResolverPort, type RecordsResponse, type RecordsResult, type RecordsTableQuery, type RegisteredTable, type Relation, type RelationBinding, type RelationCardinality, type RelationCarries, type RelationCoordinate, type RelationFlavor, type RelationProperties, type RelationTarget, type ResolutionTriple, type ResolvedPublishBinding, type RestorePreview, type RestoreResult, type RetiredActorWord, type Rule, type RuleAnswer, type RuleExpression, type RuleNodeKind, type RuleUse, STORAGE_MODES, STORE_DOORS, STORE_KNOBS, STORE_REFUSAL_CODES, type StaleWriteDetail, type StorageMode, type StoreDoorName, type StoreRefusalCode, type StoredRecord, type StuckRow, type Subscription, type SubscriptionBlock, type SubscriptionCadence, TABLE_DISPLAYS, TABLE_ORIGINS, TABLE_TYPES, type Table, type TableCapacity, type TableDisplay, type TableOrigin, type TableProposal, type TableType, type Timestamp, type Uuid, VALUE_ALTERNATE_KEYS, VALUE_ENVELOPE_KEYS, type ValueAlternate, type ValueAlternateKey, type ValueEnvelope, type ValueEnvelopeKey, type ValueSource, type WorkApprovalDecision, type WorkApprovalFiled, type WorkApprover, type WorkAssignment, type WorkAssignmentField, type WorkChange, type WorkDueState, type WorkGraph, type WorkInboxItem, type WorkInboxKind, type WorkInstantiation, type WorkListFlavour, type WorkListItem, type WorkOrigin, type WorkRecordState, type WorkSlotHold, type WorkState, type WorkTemplateNode, type WorkTemplateRelation, type WorkTurn, type WriteConflict, asPermissionLevel, atLeast, choiceSlug, choiceValuesOf, choicesOf, err, highestLevel, holdsARetiredChoice, isRecordsErr, isTheChosen, looksLikeAnId, measureKey, ok, optionKey, optionLabel, portalPath, publicFormPath, scopeChip };
package/dist/index.d.ts CHANGED
@@ -4772,6 +4772,185 @@ interface WorkAssignment {
4772
4772
  message: string;
4773
4773
  }
4774
4774
 
4775
+ /** What a step asks for before it counts as done. Every one of these is CHECKED. */
4776
+ type ChecklistRequirementKind =
4777
+ /** A person says it is done. */
4778
+ "none"
4779
+ /** A sentence of evidence, under `note`. */
4780
+ | "note"
4781
+ /** A named value filled in on the step itself. */
4782
+ | "answer"
4783
+ /** A named Field on the record the run is about must hold a value. */
4784
+ | "record_field"
4785
+ /** The step IS a form (SCR-19): finishing it needs a response record. */
4786
+ | "form"
4787
+ /** The step IS a document from a doc template (REC-68): finishing it needs a render. */
4788
+ | "document";
4789
+ interface ChecklistRequirement {
4790
+ kind: ChecklistRequirementKind;
4791
+ /** For `answer` and `record_field`: which value. */
4792
+ key?: string;
4793
+ /** What a person is asked for, in their words. */
4794
+ label?: string;
4795
+ /** For `form`: the published form this step is. */
4796
+ form_id?: Uuid;
4797
+ /** For `document`: the doc template this step renders. */
4798
+ template_id?: Uuid;
4799
+ }
4800
+ /** One step of a checklist, as it is WRITTEN — not as it is run. */
4801
+ interface ChecklistStepSpec {
4802
+ /** The name the checklist refers to this step by; lower-case, unique. */
4803
+ ref: string;
4804
+ /** What a person reads in their work. */
4805
+ title: string;
4806
+ /** Which role owns it. A role the checklist never declares is refused at save. */
4807
+ role?: string;
4808
+ /** How many days after the run starts it is due. */
4809
+ due_days?: number;
4810
+ /** Steps it waits for. A step waits only for steps listed above it. */
4811
+ depends_on?: string[];
4812
+ requires?: ChecklistRequirement;
4813
+ }
4814
+ /** A role, and the person who stands in it by default. */
4815
+ interface ChecklistRoleSpec {
4816
+ role: string;
4817
+ label?: string;
4818
+ user_id?: Uuid | null;
4819
+ }
4820
+ /** What starts a run. */
4821
+ type ChecklistTriggerKind = "manual" | "record_created" | "status_reached";
4822
+ interface ChecklistTrigger {
4823
+ kind: ChecklistTriggerKind;
4824
+ /** The Table being watched, for the two kinds that watch one. */
4825
+ table_id?: Uuid;
4826
+ /** The state, for `status_reached`. */
4827
+ status?: string;
4828
+ }
4829
+ /** THE COMPLETE DECLARATIVE CHECKLIST — one object, one call, a whole process. */
4830
+ interface ChecklistSpec {
4831
+ name: string;
4832
+ /** The Table a run is ABOUT: People, Hires, Jobs, Matters. */
4833
+ about_table_id: Uuid;
4834
+ roles?: ChecklistRoleSpec[];
4835
+ trigger?: ChecklistTrigger;
4836
+ steps: ChecklistStepSpec[];
4837
+ }
4838
+ /** What `custom.checklist_declare` answers. */
4839
+ interface ChecklistDeclared {
4840
+ template_id: Uuid;
4841
+ name: string;
4842
+ about_table_id: Uuid;
4843
+ steps_table_id: Uuid;
4844
+ steps: number;
4845
+ roles: number;
4846
+ trigger: ChecklistTrigger;
4847
+ created: boolean;
4848
+ message: string;
4849
+ ms: number;
4850
+ }
4851
+ /** One row of `custom.checklist_templates`. */
4852
+ interface ChecklistTemplateSummary {
4853
+ template_id: Uuid;
4854
+ name: string;
4855
+ about_table_id: Uuid | null;
4856
+ about_table: string | null;
4857
+ steps: number;
4858
+ roles: number;
4859
+ trigger_kind: ChecklistTriggerKind;
4860
+ trigger_status: string | null;
4861
+ open_runs: number;
4862
+ total_runs: number;
4863
+ updated_at: Timestamp;
4864
+ }
4865
+ /** `custom.checklist_template_shape` — the spec, plus what the editor needs. */
4866
+ type ChecklistTemplateShape = ChecklistSpec & {
4867
+ template_id: Uuid;
4868
+ steps_table_id: Uuid | null;
4869
+ may_change: boolean;
4870
+ };
4871
+ /** What `custom.checklist_start` answers. */
4872
+ interface ChecklistRunStarted {
4873
+ run_id: Uuid;
4874
+ template_id: Uuid;
4875
+ template: string;
4876
+ about_record_id: Uuid | null;
4877
+ about: string | null;
4878
+ steps_table_id: Uuid;
4879
+ steps_created: number;
4880
+ assigned: number;
4881
+ unassigned: number;
4882
+ origin: string;
4883
+ steps: Array<{
4884
+ ref: string;
4885
+ step_id: Uuid;
4886
+ title: string;
4887
+ role: string | null;
4888
+ }>;
4889
+ /** Roles nobody is named for, so the screen can say so rather than show blanks. */
4890
+ waiting_on_a_name: string[];
4891
+ message: string;
4892
+ ms: number;
4893
+ }
4894
+ /** One step of a RUN, as `custom.checklist_run` answers it. */
4895
+ interface ChecklistRunStep {
4896
+ step_id: Uuid;
4897
+ step_order: number;
4898
+ ref: string;
4899
+ title: string;
4900
+ role: string | null;
4901
+ assignee_name: string | null;
4902
+ assignee_user_id: Uuid | null;
4903
+ due_on: Timestamp | null;
4904
+ due_state: WorkDueState;
4905
+ status: string | null;
4906
+ finished: boolean;
4907
+ requires: ChecklistRequirementKind;
4908
+ /**
4909
+ * The key the answer is filed under, as the checklist named it. A screen files
4910
+ * evidence under THIS, never under a name it invented — the store looks for
4911
+ * exactly this key and nothing else.
4912
+ */
4913
+ requires_key: string | null;
4914
+ requires_label: string | null;
4915
+ /** The form or the document template this step is, when it is one. */
4916
+ requires_id: Uuid | null;
4917
+ evidence: Record<string, unknown>;
4918
+ /** The titles of the steps it is still waiting for. */
4919
+ blocked_by: string[];
4920
+ may_complete: boolean;
4921
+ /** Why it cannot be finished right now, in the words a person would use. */
4922
+ refusal: string | null;
4923
+ }
4924
+ /** One row of `custom.checklist_runs`. */
4925
+ interface ChecklistRunSummary {
4926
+ run_id: Uuid;
4927
+ name: string;
4928
+ template_id: Uuid | null;
4929
+ template: string | null;
4930
+ about_record_id: Uuid | null;
4931
+ about: string | null;
4932
+ about_table_id: Uuid | null;
4933
+ started_at: Timestamp | null;
4934
+ started_by: Uuid | null;
4935
+ origin: string;
4936
+ step_count: number;
4937
+ done: number;
4938
+ overdue: number;
4939
+ next_step: string | null;
4940
+ next_due: Timestamp | null;
4941
+ closed_at: Timestamp | null;
4942
+ }
4943
+ /** What `custom.checklist_step_complete` answers. */
4944
+ interface ChecklistStepCompleted {
4945
+ step_id: Uuid;
4946
+ run_id?: Uuid;
4947
+ completed: boolean;
4948
+ evidence?: Record<string, unknown>;
4949
+ steps_left?: number;
4950
+ run_closed?: boolean;
4951
+ message: string;
4952
+ }
4953
+
4775
4954
  /**
4776
4955
  * VIS-31. A signed-in OUTSIDER, with the reason in plain English.
4777
4956
  *
@@ -5199,4 +5378,4 @@ interface ConversationScopeContext {
5199
5378
  /** `About: Acme Industrial` — the chip a bound chat wears. */
5200
5379
  declare function scopeChip(scope: ConversationScope): string;
5201
5380
 
5202
- export { ABSENCE_REASONS, ACTOR_VOCABULARY, type AbsenceReason, type Actor, type AggregateBucket, type AggregateFilter, type AggregateMeasure, type AggregateOperation, type AggregateRow, type AggregateWindow, type AnonTokenBinding, COMPUTE_ON, CONTEXT_POLICIES, type ChoiceOption, type CommentThreadRead, type CommentWritten, type ComputeOn, type ContextPolicy, type ConversationScope, type ConversationScopeContext, type CustomFieldTableType, DELIVERIES, type DashboardBlock, type DashboardBlockKind, type DashboardBlockResult, type DashboardRunResult, type DashboardSummary, type Delivery, type DocRenderRow, type DocSignatureCheck, type DocSignatureRow, type DocTemplateRow, type DocToken, type DocUnresolvedToken, ENTITY_TOKENS, type EntityFieldRights, type EntityFieldValue, type EntityRecordMatch, type EntityRecordRead, type EntityRecordsFound, type EntityTableFacts, type EntityToken, type ExternalPrincipalCard, FIELD_SENSITIVITIES, FIELD_SOURCES, FRESHNESS, type Field, type FieldBehavior, type FieldHistoryEntry, type FieldPatch, type FieldProposal, type FieldRule, type FieldSensitivity, type FieldSource, type FieldTypeWord, type ForbiddenEnvelopeWord, type FormSummary, type Freshness, type HiddenFieldNotice, type HistoryActor, type HistoryActorKind, type HistoryChange, type Home, type ImportBatchResult, type ImportColumnPlan, type ImportFinished, type ImportOpened, type ImportOutcome, type ImportPlan, type ImportPolicy, type ImportProposal, type ImportReport, type ImportRun, type InboundAddress, type InboundDeclared, KERNEL_TABLES, type KernelTableName, 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 MissingBehavior, type MyLevel, type MySubscription, type NewEntityFieldDeclaration, type NewFieldDeclaration, ON_DELETE, OVERRIDE_POLICIES, type OnDelete, type OverridePolicy, PARITY_FIELD_TYPES, PERMISSION_LEVELS, PER_VALUE_ACCESS_WORDS, type ParityFieldType, type ParityFieldTypeDescriptor, type PerValueAccessWord, type PermissionLevel, type PgError, type PortalCard, type PortalInvitation, type PortalPreviewRow, type PortalPrincipal, type PortalRevocation, type PortalSummary, type PortalTableExposure, type PredictedRefusal, type ProvenancePointer, type PublishBinding, RELATION_BINDINGS, RELATION_CARDINALITIES, RELATION_FLAVORS, RETIRED_ACTOR_WORDS, RULE_NODE_KINDS, RULE_USES, type ReadRow, type ReadValue, type RecordComment, type RecordDocument, type RecordHistoryEntry, type RecordRead, type RecordRevision, type RecordScopeComment, type RecordScopeContext, type RecordScopeField, type RecordScopeHistoryEntry, type RecordScopeRelation, type RecordScopeWithheld, type RecordsActor, type RecordsConfig, type RecordsDataSource, type RecordsError, type RecordsErrorCode, type RecordsErrorSink, type RecordsFilter, type RecordsRealtimePort, type RecordsResolverPort, type RecordsResponse, type RecordsResult, type RecordsTableQuery, type RegisteredTable, type Relation, type RelationBinding, type RelationCardinality, type RelationCarries, type RelationCoordinate, type RelationFlavor, type RelationProperties, type RelationTarget, type ResolutionTriple, type ResolvedPublishBinding, type RestorePreview, type RestoreResult, type RetiredActorWord, type Rule, type RuleAnswer, type RuleExpression, type RuleNodeKind, type RuleUse, STORAGE_MODES, STORE_DOORS, STORE_KNOBS, STORE_REFUSAL_CODES, type StaleWriteDetail, type StorageMode, type StoreDoorName, type StoreRefusalCode, type StoredRecord, type StuckRow, type Subscription, type SubscriptionBlock, type SubscriptionCadence, TABLE_DISPLAYS, TABLE_ORIGINS, TABLE_TYPES, type Table, type TableCapacity, type TableDisplay, type TableOrigin, type TableProposal, type TableType, type Timestamp, type Uuid, VALUE_ALTERNATE_KEYS, VALUE_ENVELOPE_KEYS, type ValueAlternate, type ValueAlternateKey, type ValueEnvelope, type ValueEnvelopeKey, type ValueSource, type WorkApprovalDecision, type WorkApprovalFiled, type WorkApprover, type WorkAssignment, type WorkAssignmentField, type WorkChange, type WorkDueState, type WorkGraph, type WorkInboxItem, type WorkInboxKind, type WorkInstantiation, type WorkListFlavour, type WorkListItem, type WorkOrigin, type WorkRecordState, type WorkSlotHold, type WorkState, type WorkTemplateNode, type WorkTemplateRelation, type WorkTurn, type WriteConflict, asPermissionLevel, atLeast, choiceSlug, choiceValuesOf, choicesOf, err, highestLevel, holdsARetiredChoice, isRecordsErr, isTheChosen, looksLikeAnId, measureKey, ok, optionKey, optionLabel, portalPath, publicFormPath, scopeChip };
5381
+ export { ABSENCE_REASONS, ACTOR_VOCABULARY, type AbsenceReason, type Actor, type AggregateBucket, type AggregateFilter, type AggregateMeasure, type AggregateOperation, type AggregateRow, type AggregateWindow, type AnonTokenBinding, COMPUTE_ON, CONTEXT_POLICIES, 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 ChoiceOption, type CommentThreadRead, type CommentWritten, type ComputeOn, type ContextPolicy, type ConversationScope, type ConversationScopeContext, type CustomFieldTableType, DELIVERIES, type DashboardBlock, type DashboardBlockKind, type DashboardBlockResult, type DashboardRunResult, type DashboardSummary, type Delivery, type DocRenderRow, type DocSignatureCheck, type DocSignatureRow, type DocTemplateRow, type DocToken, type DocUnresolvedToken, ENTITY_TOKENS, type EntityFieldRights, type EntityFieldValue, type EntityRecordMatch, type EntityRecordRead, type EntityRecordsFound, type EntityTableFacts, type EntityToken, type ExternalPrincipalCard, FIELD_SENSITIVITIES, FIELD_SOURCES, FRESHNESS, type Field, type FieldBehavior, type FieldHistoryEntry, type FieldPatch, type FieldProposal, type FieldRule, type FieldSensitivity, type FieldSource, type FieldTypeWord, type ForbiddenEnvelopeWord, type FormSummary, type Freshness, type HiddenFieldNotice, type HistoryActor, type HistoryActorKind, type HistoryChange, type Home, type ImportBatchResult, type ImportColumnPlan, type ImportFinished, type ImportOpened, type ImportOutcome, type ImportPlan, type ImportPolicy, type ImportProposal, type ImportReport, type ImportRun, type InboundAddress, type InboundDeclared, KERNEL_TABLES, type KernelTableName, 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 MissingBehavior, type MyLevel, type MySubscription, type NewEntityFieldDeclaration, type NewFieldDeclaration, ON_DELETE, OVERRIDE_POLICIES, type OnDelete, type OverridePolicy, PARITY_FIELD_TYPES, PERMISSION_LEVELS, PER_VALUE_ACCESS_WORDS, type ParityFieldType, type ParityFieldTypeDescriptor, type PerValueAccessWord, type PermissionLevel, type PgError, type PortalCard, type PortalInvitation, type PortalPreviewRow, type PortalPrincipal, type PortalRevocation, type PortalSummary, type PortalTableExposure, type PredictedRefusal, type ProvenancePointer, type PublishBinding, RELATION_BINDINGS, RELATION_CARDINALITIES, RELATION_FLAVORS, RETIRED_ACTOR_WORDS, RULE_NODE_KINDS, RULE_USES, type ReadRow, type ReadValue, type RecordComment, type RecordDocument, type RecordHistoryEntry, type RecordRead, type RecordRevision, type RecordScopeComment, type RecordScopeContext, type RecordScopeField, type RecordScopeHistoryEntry, type RecordScopeRelation, type RecordScopeWithheld, type RecordsActor, type RecordsConfig, type RecordsDataSource, type RecordsError, type RecordsErrorCode, type RecordsErrorSink, type RecordsFilter, type RecordsRealtimePort, type RecordsResolverPort, type RecordsResponse, type RecordsResult, type RecordsTableQuery, type RegisteredTable, type Relation, type RelationBinding, type RelationCardinality, type RelationCarries, type RelationCoordinate, type RelationFlavor, type RelationProperties, type RelationTarget, type ResolutionTriple, type ResolvedPublishBinding, type RestorePreview, type RestoreResult, type RetiredActorWord, type Rule, type RuleAnswer, type RuleExpression, type RuleNodeKind, type RuleUse, STORAGE_MODES, STORE_DOORS, STORE_KNOBS, STORE_REFUSAL_CODES, type StaleWriteDetail, type StorageMode, type StoreDoorName, type StoreRefusalCode, type StoredRecord, type StuckRow, type Subscription, type SubscriptionBlock, type SubscriptionCadence, TABLE_DISPLAYS, TABLE_ORIGINS, TABLE_TYPES, type Table, type TableCapacity, type TableDisplay, type TableOrigin, type TableProposal, type TableType, type Timestamp, type Uuid, VALUE_ALTERNATE_KEYS, VALUE_ENVELOPE_KEYS, type ValueAlternate, type ValueAlternateKey, type ValueEnvelope, type ValueEnvelopeKey, type ValueSource, type WorkApprovalDecision, type WorkApprovalFiled, type WorkApprover, type WorkAssignment, type WorkAssignmentField, type WorkChange, type WorkDueState, type WorkGraph, type WorkInboxItem, type WorkInboxKind, type WorkInstantiation, type WorkListFlavour, type WorkListItem, type WorkOrigin, type WorkRecordState, type WorkSlotHold, type WorkState, type WorkTemplateNode, type WorkTemplateRelation, type WorkTurn, type WriteConflict, asPermissionLevel, atLeast, choiceSlug, choiceValuesOf, choicesOf, err, highestLevel, holdsARetiredChoice, isRecordsErr, isTheChosen, looksLikeAnId, measureKey, ok, optionKey, optionLabel, portalPath, publicFormPath, scopeChip };
@@ -2083,6 +2083,16 @@ var DOORS = {
2083
2083
  workApprovalMayDecide: "work_approval_may_decide",
2084
2084
  workApprovalDecide: "work_approval_decide",
2085
2085
  workApprovalRead: "work_approval_read",
2086
+ // PRODUCTS row 13 — checklists and SOP runs.
2087
+ checklistRefusal: "checklist_refusal",
2088
+ checklistDeclare: "checklist_declare",
2089
+ checklistTemplates: "checklist_templates",
2090
+ checklistTemplateShape: "checklist_template_shape",
2091
+ checklistStart: "checklist_start",
2092
+ checklistRun: "checklist_run",
2093
+ checklistRuns: "checklist_runs",
2094
+ checklistStepComplete: "checklist_step_complete",
2095
+ checklistStepRefusal: "checklist_step_refusal",
2086
2096
  // Declared here BECAUSE they do not exist yet: naming them is what makes the
2087
2097
  // absence visible to `pnpm check:store-registry` and to the suite.
2088
2098
  metadataSearch: "metadata_search",
@@ -3413,6 +3423,86 @@ function createRecordsClient(config) {
3413
3423
  "workSlotExpire"
3414
3424
  );
3415
3425
  },
3426
+ // ── checklists and SOP runs ──────────────────────────────────────────
3427
+ async checklistRefusal({ spec }) {
3428
+ return callDoor(
3429
+ DOORS.checklistRefusal,
3430
+ { p_spec: spec },
3431
+ "checklistRefusal"
3432
+ );
3433
+ },
3434
+ async checklistDeclare({ spec, template_id = null }) {
3435
+ return callDoor(
3436
+ DOORS.checklistDeclare,
3437
+ { p_organization_id: org, p_spec: spec, p_template_id: template_id },
3438
+ "checklistDeclare"
3439
+ );
3440
+ },
3441
+ async checklistTemplates(args) {
3442
+ return callDoor(
3443
+ DOORS.checklistTemplates,
3444
+ {
3445
+ p_organization_id: org,
3446
+ p_about_table_id: args?.about_table_id ?? null,
3447
+ p_limit: args?.limit ?? 100
3448
+ },
3449
+ "checklistTemplates"
3450
+ );
3451
+ },
3452
+ async checklistTemplateShape({ template_id }) {
3453
+ return callDoor(
3454
+ DOORS.checklistTemplateShape,
3455
+ { p_organization_id: org, p_template_id: template_id },
3456
+ "checklistTemplateShape"
3457
+ );
3458
+ },
3459
+ async checklistStart({ template_id, about_record_id = null, roles = {}, startingAt = null }) {
3460
+ return callDoor(
3461
+ DOORS.checklistStart,
3462
+ {
3463
+ p_organization_id: org,
3464
+ p_template_id: template_id,
3465
+ p_about_record_id: about_record_id,
3466
+ p_roles: roles,
3467
+ p_starting_at: startingAt
3468
+ },
3469
+ "checklistStart"
3470
+ );
3471
+ },
3472
+ async checklistRun({ run_id }) {
3473
+ return callDoor(
3474
+ DOORS.checklistRun,
3475
+ { p_organization_id: org, p_run_id: run_id },
3476
+ "checklistRun"
3477
+ );
3478
+ },
3479
+ async checklistRuns(args) {
3480
+ return callDoor(
3481
+ DOORS.checklistRuns,
3482
+ {
3483
+ p_organization_id: org,
3484
+ p_about_table_id: args?.about_table_id ?? null,
3485
+ p_about_record_id: args?.about_record_id ?? null,
3486
+ p_include_closed: args?.includeClosed ?? true,
3487
+ p_limit: args?.limit ?? 100
3488
+ },
3489
+ "checklistRuns"
3490
+ );
3491
+ },
3492
+ async checklistStepComplete({ step_id, evidence = {} }) {
3493
+ return callDoor(
3494
+ DOORS.checklistStepComplete,
3495
+ { p_organization_id: org, p_step_id: step_id, p_evidence: evidence },
3496
+ "checklistStepComplete"
3497
+ );
3498
+ },
3499
+ async checklistStepRefusal({ step_id }) {
3500
+ return callDoor(
3501
+ DOORS.checklistStepRefusal,
3502
+ { p_organization_id: org, p_step_id: step_id },
3503
+ "checklistStepRefusal"
3504
+ );
3505
+ },
3416
3506
  // ── the work layer a person actually uses ────────────────────────────
3417
3507
  async workInbox(args) {
3418
3508
  return callDoor(