@ai-matrx/records 0.17.0 → 0.20.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.
@@ -9,7 +9,7 @@ declare const RETIRED_ACTOR_WORDS: {
9
9
  readonly human: "user";
10
10
  };
11
11
  declare const ABSENCE_REASONS: readonly ["never asked", "none", "refused", "conflicting"];
12
- declare const VALUE_ENVELOPE_KEYS: readonly ["ver", "src", "actor", "on_behalf_of", "at", "absent", "alternates", "dated"];
12
+ declare const VALUE_ENVELOPE_KEYS: readonly ["ver", "src", "actor", "on_behalf_of", "at", "absent", "alternates", "dated", "pinned"];
13
13
  declare const VALUE_ALTERNATE_KEYS: readonly ["value", "src", "rank"];
14
14
  declare const STORAGE_MODES: readonly ["light", "heavy"];
15
15
  declare const RULE_USES: readonly ["validate", "compute", "membership", "applicability"];
@@ -372,6 +372,11 @@ declare const STORE_DOORS: readonly [{
372
372
  readonly args: "";
373
373
  readonly returns: "name";
374
374
  readonly security: "invoker";
375
+ }, {
376
+ readonly name: "carry_unchanged_value_stamps";
377
+ readonly args: "p_old jsonb, p_new jsonb";
378
+ readonly returns: "jsonb";
379
+ readonly security: "invoker";
375
380
  }, {
376
381
  readonly name: "carrying_edges_in";
377
382
  readonly args: "p_organization_id uuid";
@@ -382,6 +387,56 @@ declare const STORE_DOORS: readonly [{
382
387
  readonly args: "p_item_type text, p_item_id uuid";
383
388
  readonly returns: "TABLE(container_type text, container_id uuid, conveys_max permission_level)";
384
389
  readonly security: "definer";
390
+ }, {
391
+ readonly name: "checklist_declare";
392
+ readonly args: "p_organization_id uuid, p_spec jsonb, p_template_id uuid DEFAULT NULL::uuid";
393
+ readonly returns: "jsonb";
394
+ readonly security: "definer";
395
+ }, {
396
+ readonly name: "checklist_refusal";
397
+ readonly args: "p_spec jsonb";
398
+ readonly returns: "text";
399
+ readonly security: "invoker";
400
+ }, {
401
+ readonly name: "checklist_run";
402
+ readonly args: "p_organization_id uuid, p_run_id uuid";
403
+ readonly returns: "TABLE(step_id uuid, step_order integer, ref text, title text, role text, assignee_name text, assignee_user_id uuid, due_on timestamp with time zone, due_state text, status text, finished boolean, requires text, requires_key text, requires_label text, requires_id uuid, evidence jsonb, blocked_by text[], may_complete boolean, refusal text)";
404
+ readonly security: "definer";
405
+ }, {
406
+ readonly name: "checklist_runs";
407
+ readonly args: "p_organization_id uuid, p_about_table_id uuid DEFAULT NULL::uuid, p_about_record_id uuid DEFAULT NULL::uuid, p_include_closed boolean DEFAULT true, p_limit integer DEFAULT 100";
408
+ readonly returns: "TABLE(run_id uuid, name text, template_id uuid, template text, about_record_id uuid, about text, about_table_id uuid, started_at timestamp with time zone, started_by uuid, origin text, step_count integer, done integer, overdue integer, next_step text, next_due timestamp with time zone, closed_at timestamp with time zone)";
409
+ readonly security: "definer";
410
+ }, {
411
+ readonly name: "checklist_start";
412
+ readonly args: "p_organization_id uuid, p_template_id uuid, p_about_record_id uuid DEFAULT NULL::uuid, p_roles jsonb DEFAULT '{}'::jsonb, p_starting_at timestamp with time zone DEFAULT NULL::timestamp with time zone";
413
+ readonly returns: "jsonb";
414
+ readonly security: "definer";
415
+ }, {
416
+ readonly name: "checklist_step_complete";
417
+ readonly args: "p_organization_id uuid, p_step_id uuid, p_evidence jsonb DEFAULT '{}'::jsonb";
418
+ readonly returns: "jsonb";
419
+ readonly security: "definer";
420
+ }, {
421
+ readonly name: "checklist_step_refusal";
422
+ readonly args: "p_organization_id uuid, p_step_id uuid";
423
+ readonly returns: "text";
424
+ readonly security: "definer";
425
+ }, {
426
+ readonly name: "checklist_steps_table";
427
+ readonly args: "p_organization_id uuid";
428
+ readonly returns: "uuid";
429
+ readonly security: "definer";
430
+ }, {
431
+ readonly name: "checklist_template_shape";
432
+ readonly args: "p_organization_id uuid, p_template_id uuid";
433
+ readonly returns: "jsonb";
434
+ readonly security: "definer";
435
+ }, {
436
+ readonly name: "checklist_templates";
437
+ readonly args: "p_organization_id uuid, p_about_table_id uuid DEFAULT NULL::uuid, p_limit integer DEFAULT 100";
438
+ readonly returns: "TABLE(template_id uuid, name text, about_table_id uuid, about_table text, steps integer, roles integer, trigger_kind text, trigger_status text, open_runs integer, total_runs integer, updated_at timestamp with time zone)";
439
+ readonly security: "definer";
385
440
  }, {
386
441
  readonly name: "choice_census";
387
442
  readonly args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid";
@@ -497,6 +552,31 @@ declare const STORE_DOORS: readonly [{
497
552
  readonly args: "p_data jsonb";
498
553
  readonly returns: "uuid";
499
554
  readonly security: "invoker";
555
+ }, {
556
+ readonly name: "context_resolve";
557
+ readonly args: "p_organization_id uuid, p_bindings jsonb, p_scope_slug text DEFAULT 'scopes'::text";
558
+ readonly returns: "jsonb";
559
+ readonly security: "definer";
560
+ }, {
561
+ readonly name: "conversation_scope";
562
+ readonly args: "p_organization_id uuid, p_conversation_id uuid";
563
+ readonly returns: "jsonb";
564
+ readonly security: "definer";
565
+ }, {
566
+ readonly name: "conversation_scope_bind";
567
+ readonly args: "p_organization_id uuid, p_conversation_id uuid, p_record_id uuid";
568
+ readonly returns: "jsonb";
569
+ readonly security: "definer";
570
+ }, {
571
+ readonly name: "conversation_scope_context";
572
+ readonly args: "p_organization_id uuid, p_conversation_id uuid, p_relations integer DEFAULT 12, p_history integer DEFAULT 15, p_siblings integer DEFAULT 8";
573
+ readonly returns: "jsonb";
574
+ readonly security: "definer";
575
+ }, {
576
+ readonly name: "conversation_scope_unbind";
577
+ readonly args: "p_organization_id uuid, p_conversation_id uuid";
578
+ readonly returns: "jsonb";
579
+ readonly security: "definer";
500
580
  }, {
501
581
  readonly name: "cross_organization_links_open";
502
582
  readonly args: "p_source_organization_id uuid, p_target_organization_id uuid";
@@ -612,6 +692,21 @@ declare const STORE_DOORS: readonly [{
612
692
  readonly args: "p_field_data jsonb, p_value jsonb";
613
693
  readonly returns: "text";
614
694
  readonly security: "invoker";
695
+ }, {
696
+ readonly name: "doc_letterhead";
697
+ readonly args: "p_organization_id uuid";
698
+ readonly returns: "jsonb";
699
+ readonly security: "definer";
700
+ }, {
701
+ readonly name: "doc_name_token_pattern";
702
+ readonly args: "";
703
+ readonly returns: "text";
704
+ readonly security: "invoker";
705
+ }, {
706
+ readonly name: "doc_name_tokens";
707
+ readonly args: "p_body text";
708
+ readonly returns: "TABLE(ordinal integer, raw text)";
709
+ readonly security: "invoker";
615
710
  }, {
616
711
  readonly name: "doc_render_body";
617
712
  readonly args: "p_organization_id uuid, p_template_id uuid, p_record_id uuid";
@@ -712,6 +807,11 @@ declare const STORE_DOORS: readonly [{
712
807
  readonly args: "";
713
808
  readonly returns: "TABLE(function_name text, identity_args text, why text)";
714
809
  readonly security: "invoker";
810
+ }, {
811
+ readonly name: "doors_not_masking_fields";
812
+ readonly args: "";
813
+ readonly returns: "TABLE(function_name text, identity_args text, why text)";
814
+ readonly security: "invoker";
715
815
  }, {
716
816
  readonly name: "doors_not_on_one_ladder";
717
817
  readonly args: "";
@@ -722,6 +822,61 @@ declare const STORE_DOORS: readonly [{
722
822
  readonly args: "p_user_id uuid, p_organization_id uuid, p_id uuid, p_type text DEFAULT 'record'::text";
723
823
  readonly returns: "permission_level";
724
824
  readonly security: "definer";
825
+ }, {
826
+ readonly name: "enrich_cells";
827
+ readonly args: "p_organization_id uuid, p_table_id uuid, p_field_keys text[] DEFAULT NULL::text[], p_record_ids uuid[] DEFAULT NULL::uuid[]";
828
+ readonly returns: "TABLE(record_id uuid, field_key text, agent_owned boolean, value jsonb, value_version integer, actor text, on_behalf_of text, written_at timestamp with time zone, source jsonb, absent_reason text, alternates jsonb, pinned boolean, stale boolean, due_at timestamp with time zone)";
829
+ readonly security: "definer";
830
+ }, {
831
+ readonly name: "enrich_declare";
832
+ readonly args: "p_organization_id uuid, p_field_id uuid, p_spec jsonb";
833
+ readonly returns: "jsonb";
834
+ readonly security: "definer";
835
+ }, {
836
+ readonly name: "enrich_due";
837
+ readonly args: "p_organization_id uuid, p_field_id uuid, p_limit integer DEFAULT 50, p_include_fresh boolean DEFAULT false";
838
+ readonly returns: "TABLE(record_id uuid, title text, inputs jsonb, current_value jsonb, written_at timestamp with time zone, reason text, trimmed_to integer)";
839
+ readonly security: "definer";
840
+ }, {
841
+ readonly name: "enrich_land";
842
+ readonly args: "p_organization_id uuid, p_field_id uuid, p_results jsonb, p_run jsonb DEFAULT '{}'::jsonb";
843
+ readonly returns: "jsonb";
844
+ readonly security: "definer";
845
+ }, {
846
+ readonly name: "enrich_normalize";
847
+ readonly args: "p_organization_id uuid, p_table_id uuid, p_field_key text, p_spec jsonb";
848
+ readonly returns: "jsonb";
849
+ readonly security: "definer";
850
+ }, {
851
+ readonly name: "enrich_pin";
852
+ readonly args: "p_organization_id uuid, p_record_id uuid, p_field_key text, p_pinned boolean DEFAULT true";
853
+ readonly returns: "jsonb";
854
+ readonly security: "definer";
855
+ }, {
856
+ readonly name: "enrich_run_class";
857
+ readonly args: "";
858
+ readonly returns: "text";
859
+ readonly security: "invoker";
860
+ }, {
861
+ readonly name: "enrich_runs";
862
+ readonly args: "p_organization_id uuid, p_field_id uuid DEFAULT NULL::uuid, p_limit integer DEFAULT 50";
863
+ readonly returns: "TABLE(run_id uuid, field_id uuid, field_key text, model text, trigger_word text, rows_seen integer, rows_written integer, rows_absent integer, rows_below_floor integer, rows_pinned integer, rows_refused integer, cost_cents numeric, cost_per_row_cents numeric, ran_at timestamp with time zone)";
864
+ readonly security: "definer";
865
+ }, {
866
+ readonly name: "enrich_sensitivity_rank";
867
+ readonly args: "p_word text";
868
+ readonly returns: "integer";
869
+ readonly security: "invoker";
870
+ }, {
871
+ readonly name: "enrich_triggers";
872
+ readonly args: "";
873
+ readonly returns: "text[]";
874
+ readonly security: "invoker";
875
+ }, {
876
+ readonly name: "enrichments";
877
+ readonly args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid";
878
+ readonly returns: "TABLE(field_id uuid, table_id uuid, field_key text, label text, enrichment jsonb, enabled boolean, review_interval_days integer, rows_total integer, rows_filled integer, rows_stale integer, rows_pinned integer, rows_absent integer, runs integer, cost_cents numeric, cost_per_row_cents numeric, last_run_at timestamp with time zone, last_run jsonb)";
879
+ readonly security: "definer";
725
880
  }, {
726
881
  readonly name: "entity_field_declare";
727
882
  readonly args: "p_organization_id uuid, p_token text, p_spec jsonb";
@@ -947,6 +1102,11 @@ declare const STORE_DOORS: readonly [{
947
1102
  readonly args: "p_current jsonb, p_target jsonb, p_field_key text DEFAULT NULL::text";
948
1103
  readonly returns: "jsonb";
949
1104
  readonly security: "invoker";
1105
+ }, {
1106
+ readonly name: "history_restore_body";
1107
+ readonly args: "p_current jsonb, p_target jsonb, p_field_key text, p_author jsonb";
1108
+ readonly returns: "jsonb";
1109
+ readonly security: "invoker";
950
1110
  }, {
951
1111
  readonly name: "history_retention";
952
1112
  readonly args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid";
@@ -972,6 +1132,36 @@ declare const STORE_DOORS: readonly [{
972
1132
  readonly args: "";
973
1133
  readonly returns: "TABLE(table_id uuid, home_record_id uuid, organization_id uuid, relation_id uuid)";
974
1134
  readonly security: "invoker";
1135
+ }, {
1136
+ readonly name: "inbound_addresses";
1137
+ readonly args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid";
1138
+ readonly returns: "jsonb";
1139
+ readonly security: "definer";
1140
+ }, {
1141
+ readonly name: "inbound_declare";
1142
+ readonly args: "p_organization_id uuid, p_table_id uuid, p_label text DEFAULT NULL::text";
1143
+ readonly returns: "jsonb";
1144
+ readonly security: "definer";
1145
+ }, {
1146
+ readonly name: "inbound_domain";
1147
+ readonly args: "p_organization_id uuid";
1148
+ readonly returns: "text";
1149
+ readonly security: "invoker";
1150
+ }, {
1151
+ readonly name: "inbound_mail_land";
1152
+ readonly args: "p_address text, p_mail jsonb, p_secret text DEFAULT NULL::text";
1153
+ readonly returns: "jsonb";
1154
+ readonly security: "definer";
1155
+ }, {
1156
+ readonly name: "inbound_mail_map";
1157
+ readonly args: "p_organization_id uuid, p_table_id uuid, p_mail jsonb";
1158
+ readonly returns: "jsonb";
1159
+ readonly security: "invoker";
1160
+ }, {
1161
+ readonly name: "inbound_set";
1162
+ readonly args: "p_organization_id uuid, p_inbound_id uuid, p_enabled boolean";
1163
+ readonly returns: "jsonb";
1164
+ readonly security: "definer";
975
1165
  }, {
976
1166
  readonly name: "index_payload";
977
1167
  readonly args: "p_organization_id uuid, p_table_id uuid, p_limit integer DEFAULT 1000";
@@ -982,6 +1172,11 @@ declare const STORE_DOORS: readonly [{
982
1172
  readonly args: "p_data jsonb";
983
1173
  readonly returns: "jsonb";
984
1174
  readonly security: "invoker";
1175
+ }, {
1176
+ readonly name: "io_cell";
1177
+ readonly args: "p_organization_id uuid, p_field jsonb, p_word text, p_date_order text DEFAULT 'mdy'::text";
1178
+ readonly returns: "jsonb";
1179
+ readonly security: "invoker";
985
1180
  }, {
986
1181
  readonly name: "io_changed_field_ids";
987
1182
  readonly args: "p_organization_id uuid, p_table_id uuid, p_old jsonb, p_new jsonb";
@@ -1027,21 +1222,61 @@ declare const STORE_DOORS: readonly [{
1027
1222
  readonly args: "p_organization_id uuid, p_table_id uuid, p_columns text[] DEFAULT NULL::text[], p_limit integer DEFAULT 10000, p_delimiter text DEFAULT chr(44), p_required text DEFAULT 'viewer'::text";
1028
1223
  readonly returns: "text";
1029
1224
  readonly security: "definer";
1225
+ }, {
1226
+ readonly name: "io_import_begin";
1227
+ readonly args: "p_organization_id uuid, p_table_id uuid, p_format text DEFAULT 'csv'::text, p_source_name text DEFAULT NULL::text, p_source_columns jsonb DEFAULT '[]'::jsonb, p_file_hash text DEFAULT NULL::text, p_policy jsonb DEFAULT '{}'::jsonb, p_dedupe_key text DEFAULT NULL::text, p_file_bytes bigint DEFAULT NULL::bigint, p_force boolean DEFAULT false";
1228
+ readonly returns: "jsonb";
1229
+ readonly security: "definer";
1230
+ }, {
1231
+ readonly name: "io_import_finish";
1232
+ readonly args: "p_organization_id uuid, p_import_id uuid, p_unmapped text DEFAULT NULL::text";
1233
+ readonly returns: "jsonb";
1234
+ readonly security: "definer";
1235
+ }, {
1236
+ readonly name: "io_import_forget";
1237
+ readonly args: "p_organization_id uuid, p_import_id uuid";
1238
+ readonly returns: "boolean";
1239
+ readonly security: "definer";
1030
1240
  }, {
1031
1241
  readonly name: "io_import_open";
1032
1242
  readonly args: "p_organization_id uuid, p_table_id uuid, p_format text DEFAULT 'csv'::text, p_source_name text DEFAULT NULL::text, p_source_columns jsonb DEFAULT '[]'::jsonb";
1033
1243
  readonly returns: "uuid";
1034
1244
  readonly security: "definer";
1245
+ }, {
1246
+ readonly name: "io_import_plan";
1247
+ readonly args: "p_organization_id uuid, p_table_id uuid, p_columns jsonb DEFAULT '[]'::jsonb";
1248
+ readonly returns: "jsonb";
1249
+ readonly security: "definer";
1250
+ }, {
1251
+ readonly name: "io_import_report";
1252
+ readonly args: "p_organization_id uuid, p_import_id uuid, p_state text DEFAULT NULL::text, p_limit integer DEFAULT 100, p_offset integer DEFAULT 0";
1253
+ readonly returns: "jsonb";
1254
+ readonly security: "definer";
1035
1255
  }, {
1036
1256
  readonly name: "io_import_rows";
1037
1257
  readonly args: "p_organization_id uuid, p_import_id uuid, p_rows jsonb, p_mapping jsonb DEFAULT '{}'::jsonb";
1038
1258
  readonly returns: "jsonb";
1039
1259
  readonly security: "definer";
1260
+ }, {
1261
+ readonly name: "io_imports";
1262
+ readonly args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid, p_limit integer DEFAULT 25";
1263
+ readonly returns: "jsonb";
1264
+ readonly security: "definer";
1265
+ }, {
1266
+ readonly name: "io_infer_column";
1267
+ readonly args: "p_organization_id uuid, p_table_id uuid, p_header text, p_samples jsonb DEFAULT '[]'::jsonb";
1268
+ readonly returns: "jsonb";
1269
+ readonly security: "definer";
1040
1270
  }, {
1041
1271
  readonly name: "io_infer_type";
1042
1272
  readonly args: "p_samples jsonb";
1043
1273
  readonly returns: "text";
1044
1274
  readonly security: "invoker";
1275
+ }, {
1276
+ readonly name: "io_money_unit";
1277
+ readonly args: "p_word text";
1278
+ readonly returns: "text";
1279
+ readonly security: "invoker";
1045
1280
  }, {
1046
1281
  readonly name: "io_outbox_announce";
1047
1282
  readonly args: "";
@@ -1067,26 +1302,56 @@ declare const STORE_DOORS: readonly [{
1067
1302
  readonly args: "p_organization_id uuid, p_import_id uuid, p_column text";
1068
1303
  readonly returns: "boolean";
1069
1304
  readonly security: "definer";
1305
+ }, {
1306
+ readonly name: "io_proposal_spec";
1307
+ readonly args: "p_proposal jsonb";
1308
+ readonly returns: "jsonb";
1309
+ readonly security: "invoker";
1070
1310
  }, {
1071
1311
  readonly name: "io_record_changed";
1072
1312
  readonly args: "";
1073
1313
  readonly returns: "trigger";
1074
1314
  readonly security: "definer";
1315
+ }, {
1316
+ readonly name: "io_relation_candidate";
1317
+ readonly args: "p_organization_id uuid, p_table_id uuid, p_words text[]";
1318
+ readonly returns: "uuid";
1319
+ readonly security: "invoker";
1075
1320
  }, {
1076
1321
  readonly name: "io_restore";
1077
1322
  readonly args: "p_organization_id uuid, p_record_id uuid, p_version integer";
1078
1323
  readonly returns: "integer";
1079
1324
  readonly security: "definer";
1325
+ }, {
1326
+ readonly name: "io_restore";
1327
+ readonly args: "p_organization_id uuid, p_record_id uuid, p_version integer, p_author jsonb";
1328
+ readonly returns: "integer";
1329
+ readonly security: "definer";
1080
1330
  }, {
1081
1331
  readonly name: "io_revisions";
1082
1332
  readonly args: "p_organization_id uuid, p_record_id uuid";
1083
1333
  readonly returns: "TABLE(version integer, changed_at timestamp with time zone, changed_by uuid, summary text, operation text, changed_fields jsonb)";
1084
1334
  readonly security: "definer";
1335
+ }, {
1336
+ readonly name: "io_sample_words";
1337
+ readonly args: "p_samples jsonb";
1338
+ readonly returns: "TABLE(word text)";
1339
+ readonly security: "invoker";
1340
+ }, {
1341
+ readonly name: "io_value_shape";
1342
+ readonly args: "p_envelope jsonb";
1343
+ readonly returns: "jsonb";
1344
+ readonly security: "invoker";
1085
1345
  }, {
1086
1346
  readonly name: "is_a_retirement";
1087
1347
  readonly args: "p_old_deleted timestamp with time zone, p_new_deleted timestamp with time zone, p_old_data jsonb, p_new_data jsonb, p_old_table uuid, p_new_table uuid, p_old_org uuid, p_new_org uuid, p_old_class text, p_new_class text";
1088
1348
  readonly returns: "boolean";
1089
1349
  readonly security: "invoker";
1350
+ }, {
1351
+ readonly name: "ladder_replanners";
1352
+ readonly args: "p_roots text[] DEFAULT ARRAY['custom.has_visibility'::text, 'custom.effective_level'::text, 'custom.reaches_directly'::text, 'custom.visible_set'::text]";
1353
+ readonly returns: "TABLE(fn text, lang text, why text, remedy text)";
1354
+ readonly security: "definer";
1090
1355
  }, {
1091
1356
  readonly name: "list_door_disagreements";
1092
1357
  readonly args: "p_pretend text DEFAULT NULL::text, p_only_organization uuid DEFAULT NULL::uuid, p_sample integer DEFAULT 200";
@@ -1112,6 +1377,11 @@ declare const STORE_DOORS: readonly [{
1112
1377
  readonly args: "p_document jsonb, p_visible_keys text[], p_notices jsonb, p_by_id boolean DEFAULT false, p_key_ids jsonb DEFAULT '{}'::jsonb, p_declared_keys text[] DEFAULT NULL::text[]";
1113
1378
  readonly returns: "jsonb";
1114
1379
  readonly security: "invoker";
1380
+ }, {
1381
+ readonly name: "mask_says_withheld";
1382
+ readonly args: "p_mask jsonb, p_key text";
1383
+ readonly returns: "boolean";
1384
+ readonly security: "invoker";
1115
1385
  }, {
1116
1386
  readonly name: "merge_field_kernel_id";
1117
1387
  readonly args: "";
@@ -1187,6 +1457,11 @@ declare const STORE_DOORS: readonly [{
1187
1457
  readonly args: "p_organization_id uuid, p_target_id uuid DEFAULT NULL::uuid, p_limit integer DEFAULT 100";
1188
1458
  readonly returns: "TABLE(id uuid, verb text, target_kind text, target_id uuid, note text, applied_at timestamp with time zone, applied_by uuid, undone_at timestamp with time zone)";
1189
1459
  readonly security: "definer";
1460
+ }, {
1461
+ readonly name: "mirror_asks_the_whole_database";
1462
+ readonly args: "";
1463
+ readonly returns: "TABLE(schema_name text, table_name text, policy_name text, why text)";
1464
+ readonly security: "invoker";
1190
1465
  }, {
1191
1466
  readonly name: "my_level";
1192
1467
  readonly args: "p_organization_id uuid, p_id uuid, p_type text DEFAULT 'record'::text";
@@ -1252,6 +1527,11 @@ declare const STORE_DOORS: readonly [{
1252
1527
  readonly args: "";
1253
1528
  readonly returns: "uuid";
1254
1529
  readonly security: "invoker";
1530
+ }, {
1531
+ readonly name: "pin_agent_cells";
1532
+ readonly args: "p_new jsonb, p_old jsonb, p_agent_keys text[]";
1533
+ readonly returns: "jsonb";
1534
+ readonly security: "invoker";
1255
1535
  }, {
1256
1536
  readonly name: "portal_admits";
1257
1537
  readonly args: "p_organization_id uuid, p_user_id uuid DEFAULT NULL::uuid";
@@ -1502,6 +1782,11 @@ declare const STORE_DOORS: readonly [{
1502
1782
  readonly args: "p_organization_id uuid, p_table_id uuid, p_user uuid, p_required permission_level, p_sample integer";
1503
1783
  readonly returns: "TABLE(record_id uuid, set_based boolean, per_row boolean, verdict text)";
1504
1784
  readonly security: "definer";
1785
+ }, {
1786
+ readonly name: "read_mask";
1787
+ readonly args: "p_organization_id uuid, p_record_id uuid, p_action text DEFAULT 'read'::text";
1788
+ readonly returns: "jsonb";
1789
+ readonly security: "definer";
1505
1790
  }, {
1506
1791
  readonly name: "read_paths_outside_the_door";
1507
1792
  readonly args: "";
@@ -1582,6 +1867,16 @@ declare const STORE_DOORS: readonly [{
1582
1867
  readonly args: "p_organization_id uuid, p_record_id uuid, p_version integer";
1583
1868
  readonly returns: "jsonb";
1584
1869
  readonly security: "definer";
1870
+ }, {
1871
+ readonly name: "record_restore_version";
1872
+ readonly args: "p_organization_id uuid, p_record_id uuid, p_version integer, p_author jsonb";
1873
+ readonly returns: "jsonb";
1874
+ readonly security: "definer";
1875
+ }, {
1876
+ readonly name: "record_scope_context";
1877
+ readonly args: "p_organization_id uuid, p_record_id uuid, p_relations integer DEFAULT 12, p_history integer DEFAULT 15, p_siblings integer DEFAULT 8";
1878
+ readonly returns: "jsonb";
1879
+ readonly security: "definer";
1585
1880
  }, {
1586
1881
  readonly name: "record_state_as_of";
1587
1882
  readonly args: "p_record_id uuid, p_at timestamp with time zone";
@@ -1812,6 +2107,66 @@ declare const STORE_DOORS: readonly [{
1812
2107
  readonly args: "p_pretend text DEFAULT NULL::text";
1813
2108
  readonly returns: "TABLE(organization_id uuid, organization_name text, member_id uuid, record_id uuid, table_id uuid, ladder boolean, read_door boolean, rls_mirror boolean, why text)";
1814
2109
  readonly security: "invoker";
2110
+ }, {
2111
+ readonly name: "sign_request_cancel";
2112
+ readonly args: "p_organization_id uuid, p_request_id uuid, p_reason text DEFAULT NULL::text";
2113
+ readonly returns: "jsonb";
2114
+ readonly security: "definer";
2115
+ }, {
2116
+ readonly name: "sign_request_create";
2117
+ readonly args: "p_organization_id uuid, p_render_id uuid, p_field_key text, p_signer_email text, p_signer_name text, p_expires_in interval DEFAULT '14 days'::interval";
2118
+ readonly returns: "jsonb";
2119
+ readonly security: "definer";
2120
+ }, {
2121
+ readonly name: "sign_request_decline";
2122
+ readonly args: "p_token text, p_reason text DEFAULT NULL::text, p_ip text DEFAULT NULL::text, p_user_agent text DEFAULT NULL::text";
2123
+ readonly returns: "jsonb";
2124
+ readonly security: "definer";
2125
+ }, {
2126
+ readonly name: "sign_request_public";
2127
+ readonly args: "p_token text, p_origin text DEFAULT NULL::text";
2128
+ readonly returns: "jsonb";
2129
+ readonly security: "definer";
2130
+ }, {
2131
+ readonly name: "sign_request_remind";
2132
+ readonly args: "p_organization_id uuid, p_request_id uuid";
2133
+ readonly returns: "jsonb";
2134
+ readonly security: "definer";
2135
+ }, {
2136
+ readonly name: "sign_request_sentence";
2137
+ readonly args: "p_data jsonb";
2138
+ readonly returns: "text";
2139
+ readonly security: "invoker";
2140
+ }, {
2141
+ readonly name: "sign_request_sign";
2142
+ readonly args: "p_token text, p_signed_name text, p_mark text, p_image text DEFAULT NULL::text, p_ip text DEFAULT NULL::text, p_user_agent text DEFAULT NULL::text, p_origin text DEFAULT NULL::text";
2143
+ readonly returns: "jsonb";
2144
+ readonly security: "definer";
2145
+ }, {
2146
+ readonly name: "sign_request_state";
2147
+ readonly args: "p_data jsonb";
2148
+ readonly returns: "text";
2149
+ readonly security: "invoker";
2150
+ }, {
2151
+ readonly name: "sign_request_unchanged";
2152
+ readonly args: "p_organization_id uuid, p_request_id uuid";
2153
+ readonly returns: "boolean";
2154
+ readonly security: "definer";
2155
+ }, {
2156
+ readonly name: "sign_requests";
2157
+ readonly args: "p_organization_id uuid, p_record_id uuid";
2158
+ readonly returns: "TABLE(request_id uuid, render_id uuid, record_id uuid, field_key text, document_title text, signer_name text, signer_email text, signer_has_account boolean, state text, sentence text, document_version integer, document_hash text, sent_at timestamp with time zone, expires_at timestamp with time zone, viewed_at timestamp with time zone, signed_at timestamp with time zone, declined_at timestamp with time zone, invalidated_at timestamp with time zone, signature_id uuid, signature_mark text, reminder_count integer)";
2159
+ readonly security: "definer";
2160
+ }, {
2161
+ readonly name: "sign_token_decode";
2162
+ readonly args: "p_token text";
2163
+ readonly returns: "bytea";
2164
+ readonly security: "invoker";
2165
+ }, {
2166
+ readonly name: "sign_token_encode";
2167
+ readonly args: "p_bytes bytea";
2168
+ readonly returns: "text";
2169
+ readonly security: "invoker";
1815
2170
  }, {
1816
2171
  readonly name: "size_refusal";
1817
2172
  readonly args: "p_organization_id uuid, p_data jsonb";
@@ -1977,6 +2332,11 @@ declare const STORE_DOORS: readonly [{
1977
2332
  readonly args: "p_organization_id uuid, p_record_id uuid, p_field_key text, p_version integer";
1978
2333
  readonly returns: "jsonb";
1979
2334
  readonly security: "definer";
2335
+ }, {
2336
+ readonly name: "value_restore";
2337
+ readonly args: "p_organization_id uuid, p_record_id uuid, p_field_key text, p_version integer, p_author jsonb";
2338
+ readonly returns: "jsonb";
2339
+ readonly security: "definer";
1980
2340
  }, {
1981
2341
  readonly name: "value_versions";
1982
2342
  readonly args: "p_old jsonb, p_new jsonb";
@@ -2027,6 +2387,16 @@ declare const STORE_DOORS: readonly [{
2027
2387
  readonly args: "";
2028
2388
  readonly returns: "uuid";
2029
2389
  readonly security: "invoker";
2390
+ }, {
2391
+ readonly name: "withheld_marker";
2392
+ readonly args: "p_mask jsonb, p_key text";
2393
+ readonly returns: "jsonb";
2394
+ readonly security: "invoker";
2395
+ }, {
2396
+ readonly name: "withheld_sentence";
2397
+ readonly args: "p_mask jsonb, p_key text";
2398
+ readonly returns: "text";
2399
+ readonly security: "invoker";
2030
2400
  }, {
2031
2401
  readonly name: "work_approval_approvers";
2032
2402
  readonly args: "p_organization_id uuid, p_subject_id uuid, p_approver_id uuid DEFAULT NULL::uuid";
@@ -2249,6 +2619,10 @@ declare const STORE_KNOBS: readonly [{
2249
2619
  readonly key: "cross_organization_links";
2250
2620
  readonly value: "false";
2251
2621
  readonly type: "boolean";
2622
+ }, {
2623
+ readonly key: "document_letterhead";
2624
+ readonly value: "{}";
2625
+ readonly type: "json";
2252
2626
  }, {
2253
2627
  readonly key: "document_max_bytes";
2254
2628
  readonly value: "1048576";
@@ -2261,6 +2635,26 @@ declare const STORE_KNOBS: readonly [{
2261
2635
  readonly key: "emergency_door_sweep_enabled";
2262
2636
  readonly value: "false";
2263
2637
  readonly type: "boolean";
2638
+ }, {
2639
+ readonly key: "enrichment_batch_ceiling";
2640
+ readonly value: "200";
2641
+ readonly type: "integer";
2642
+ }, {
2643
+ readonly key: "enrichment_confidence_floor";
2644
+ readonly value: "0.6";
2645
+ readonly type: "number";
2646
+ }, {
2647
+ readonly key: "enrichment_cost_cap_cents";
2648
+ readonly value: "2000";
2649
+ readonly type: "integer";
2650
+ }, {
2651
+ readonly key: "enrichment_model";
2652
+ readonly value: "\"claude-fable-5-latest\"";
2653
+ readonly type: "string";
2654
+ }, {
2655
+ readonly key: "enrichment_sensitivity_ceiling";
2656
+ readonly value: "\"internal\"";
2657
+ readonly type: "string";
2264
2658
  }, {
2265
2659
  readonly key: "entity_custom_fields_guard";
2266
2660
  readonly value: "false";
@@ -2281,6 +2675,10 @@ declare const STORE_KNOBS: readonly [{
2281
2675
  readonly key: "field_sensitivity_levels";
2282
2676
  readonly value: "{\"edit\": {\"public\": \"editor\", \"internal\": \"editor\", \"restricted\": \"admin\", \"confidential\": \"admin\"}, \"read\": {\"public\": \"viewer\", \"internal\": \"viewer\", \"restricted\": \"admin\", \"confidential\": \"editor\"}}";
2283
2677
  readonly type: "json";
2678
+ }, {
2679
+ readonly key: "inbound_domain";
2680
+ readonly value: "\"inbound.matrxserver.com\"";
2681
+ readonly type: "string";
2284
2682
  }, {
2285
2683
  readonly key: "member_default_level";
2286
2684
  readonly value: "\"viewer\"";
@@ -2342,13 +2740,16 @@ declare const STORE_KNOBS: readonly [{
2342
2740
  */
2343
2741
  declare const STORE_REFUSAL_CODES: readonly [{
2344
2742
  readonly code: "02000";
2345
- readonly raised_by: "dashboard_delete,dashboard_run,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,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,visibility_as_of,work_approval_decide,work_approval_read,work_approval_request,work_assign,work_record_states,work_set_state";
2743
+ readonly 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,visibility_as_of,work_approval_decide,work_approval_read,work_approval_request,work_assign,work_record_states,work_set_state";
2346
2744
  }, {
2347
2745
  readonly code: "0A000";
2348
- readonly raised_by: "external_rows,external_source_declare,external_write_through,promote_field,promoted_index_expr,promoted_query_sql,promoted_read,rule_eval,work_assign";
2746
+ readonly 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";
2747
+ }, {
2748
+ readonly code: "22003";
2749
+ readonly raised_by: "context_resolve";
2349
2750
  }, {
2350
2751
  readonly code: "22004";
2351
- readonly 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,dashboard_block_normalize,dashboard_declare,dashboard_window_sql,doc_render_write,doc_sign,doc_signature_write,doc_template_save,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_open,io_outbox_drain,io_restore,migrate_choice_keys,migrate_purge,migrate_reclass,migrate_split,migrate_undo,organization_clear,organization_contents,portal_declare,portal_invite,portal_principal_bind,query_across_homes,query_by_coordinates,query_rollup,record_delete,record_reparent,record_resolve,record_restore,record_update,record_write,relation_carry,relation_own,rule_declare,share_grant,table_declare,value_restore,work_approval_decide,work_approval_request,work_template_declare";
2752
+ readonly 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,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,portal_declare,portal_invite,portal_principal_bind,query_across_homes,query_by_coordinates,query_rollup,record_delete,record_reparent,record_resolve,record_restore,record_update,record_write,relation_carry,relation_own,rule_declare,share_grant,sign_request_create,sign_request_sign,table_declare,value_restore,work_approval_decide,work_approval_request,work_template_declare";
2352
2753
  }, {
2353
2754
  readonly code: "22007";
2354
2755
  readonly raised_by: "dashboard_window_sql";
@@ -2357,28 +2758,28 @@ declare const STORE_REFUSAL_CODES: readonly [{
2357
2758
  readonly raised_by: "rule_eval";
2358
2759
  }, {
2359
2760
  readonly code: "22023";
2360
- readonly raised_by: "_entity_custom_fields_guard,_value_envelope,_work_shape_guard,actor_word,agg_assert_key,agg_sql,anon_token_issue,containment_parent,dashboard_block_normalize,dashboard_window_sql,doc_render_body,doc_render_write,doc_signature_write,entity_value_write,external_history_event,external_source_declare,external_stub_upsert,external_write_through,field_history,io_import_open,io_proposal_accept,migrate_merge,migrate_reclass,my_levels,organization_clear,portal_declare,query_by_coordinates,query_rollup,record_update,relation_carry,rule_eval,rule_members,share_grant,share_lane_set,table_rules,visibility_as_of,work_approval_request,work_list,work_slot_hold";
2761
+ readonly raised_by: "_entity_custom_fields_guard,_value_envelope,_work_shape_guard,actor_word,agg_assert_key,agg_sql,anon_token_issue,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_import_begin,io_import_finish,io_import_plan,io_import_report,io_proposal_accept,migrate_merge,migrate_reclass,my_levels,organization_clear,pin_agent_cells,portal_declare,query_by_coordinates,query_rollup,record_update,relation_carry,rule_eval,rule_members,share_grant,share_lane_set,sign_request_create,sign_request_sign,table_rules,visibility_as_of,work_approval_request,work_list,work_slot_hold";
2361
2762
  }, {
2362
2763
  readonly code: "23503";
2363
- readonly raised_by: "_containment_guard,_field_document_for,_record_rule_uses,anon_publish,anon_rate_take,anon_token_issue,anon_write,assert_organization_wall,comment_write,dashboard_declare,delete_rule,doc_sign,doc_template_save,form_declare,form_submit,home_add,io_comment_write,io_import_rows,io_proposal_accept,migrate_demote,migrate_promote,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,subscription_mute,work_set_state,work_take_assignment,work_template_instantiate";
2764
+ readonly raised_by: "_checklist_instantiate,_containment_guard,_field_document_for,_record_rule_uses,anon_publish,anon_rate_take,anon_token_issue,anon_write,assert_organization_wall,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,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,work_set_state,work_take_assignment,work_template_instantiate";
2364
2765
  }, {
2365
2766
  readonly code: "23505";
2366
- readonly raised_by: "_unique_rule_holds,doc_sign,doc_signature_write,entity_field_declare,field_declare,home_add,io_proposal_accept,relation_carry,relation_own,share_grant,work_approval_decide,work_slot_hold";
2767
+ readonly 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,work_approval_decide,work_slot_hold";
2367
2768
  }, {
2368
2769
  readonly code: "23514";
2369
- readonly raised_by: "_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_shape_guard,_value_envelope,_work_shape_guard,_workdoors_approval_guard,assert_entity_is_organization_scoped,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,migrate_merge,relation_carry,relation_own,validate_value_envelope,validate_values,work_set_state,work_slots_declare,work_take_assignment,work_template_instantiate";
2770
+ readonly 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_shape_guard,_value_envelope,_work_shape_guard,_workdoors_approval_guard,assert_entity_is_organization_scoped,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,validate_value_envelope,validate_values,work_set_state,work_slots_declare,work_take_assignment,work_template_instantiate";
2370
2771
  }, {
2371
2772
  readonly code: "40001";
2372
2773
  readonly raised_by: "has_visibility_at";
2373
2774
  }, {
2374
2775
  readonly code: "42501";
2375
- readonly 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,comment_write,entity_field_declare,entity_field_retire,entity_field_update,entity_value_write,external_write_through,form_declare,form_submit,io_comment_resolve,io_comment_write,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,visibility_as_of,work_approval_decide,work_approval_read,work_approval_request,work_person";
2776
+ readonly 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,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,visibility_as_of,work_approval_decide,work_approval_read,work_approval_request,work_person";
2376
2777
  }, {
2377
2778
  readonly code: "42703";
2378
2779
  readonly raised_by: "entity_table,portal_declare";
2379
2780
  }, {
2380
2781
  readonly code: "53400";
2381
- readonly raised_by: "anon_rate_take,delete_cascade_closure,promote_field";
2782
+ readonly raised_by: "anon_rate_take,delete_cascade_closure,enrich_due,enrich_land,promote_field";
2382
2783
  }, {
2383
2784
  readonly code: "54001";
2384
2785
  readonly raised_by: "record_delete";
@@ -3263,6 +3664,189 @@ interface FormSummary {
3263
3664
  */
3264
3665
  declare function publicFormPath(formId: string): string;
3265
3666
 
3667
+ /** What the store thinks one column of a file is. */
3668
+ interface ImportColumnPlan {
3669
+ /** The heading exactly as the file spells it. */
3670
+ header: string;
3671
+ /** Set when this table already has the column; then `type` is that Field's. */
3672
+ field_id: Uuid | null;
3673
+ /** The key this column would become, or the key it matched. */
3674
+ field_key: string;
3675
+ label: string;
3676
+ /**
3677
+ * A parity type, or one of the three plain words (`text`, `long_text`,
3678
+ * `number`). It is exactly what `custom.field_declare` takes, so a plan can be
3679
+ * handed on with nothing in between to reinterpret it.
3680
+ */
3681
+ type: ParityFieldType | "text" | "long_text" | "number" | "relation";
3682
+ matched: boolean;
3683
+ /** One sentence, in words a person reads, saying why the store said that. */
3684
+ why: string;
3685
+ /** Present on a money column. */
3686
+ unit?: string;
3687
+ /** Present when the store read the column as a dropdown: its words. */
3688
+ options?: string[];
3689
+ /** Present when the column points at another Table. */
3690
+ relation_target?: Uuid;
3691
+ /** A slashed date whose day/month order cannot be read off the file. */
3692
+ ambiguous?: boolean;
3693
+ /** Another column of the same file would make the same key. */
3694
+ collides_with?: string;
3695
+ samples?: unknown[];
3696
+ }
3697
+ interface ImportPlan {
3698
+ table_id: Uuid;
3699
+ columns: ImportColumnPlan[];
3700
+ matched: number;
3701
+ unmatched: number;
3702
+ fields: Array<{
3703
+ field_id: Uuid;
3704
+ key: string;
3705
+ label: string;
3706
+ type: string | null;
3707
+ }>;
3708
+ }
3709
+ /** What a run does when it meets something. Both defaults cannot lose anything. */
3710
+ interface ImportPolicy {
3711
+ /** `skip` leaves the record that is already there; `update` brings it up to date. */
3712
+ on_duplicate?: "skip" | "update";
3713
+ /** `propose` sends a new column to the ONE approvals inbox. `create` is an admin's. */
3714
+ unmapped?: "propose" | "create" | "ignore";
3715
+ /** How a slashed date is read. Chosen once for the run, never guessed per row. */
3716
+ date_order?: "mdy" | "dmy";
3717
+ }
3718
+ interface ImportOpened {
3719
+ import_id: Uuid;
3720
+ state: "open" | "written" | "finished";
3721
+ /**
3722
+ * TRUE means these exact bytes already landed on this Table and NOTHING was
3723
+ * written again. The numbers are the FIRST run's.
3724
+ */
3725
+ already: boolean;
3726
+ rows_seen: number;
3727
+ rows_written: number;
3728
+ rows_duplicate: number;
3729
+ source_name: string | null;
3730
+ opened_at?: Timestamp;
3731
+ message: string;
3732
+ }
3733
+ /** One row of the file, and what became of it. */
3734
+ type ImportOutcome = {
3735
+ row: number;
3736
+ outcome: "landed";
3737
+ record_id: Uuid;
3738
+ } | {
3739
+ row: number;
3740
+ outcome: "duplicate";
3741
+ record_id: Uuid;
3742
+ updated: boolean;
3743
+ reason: string;
3744
+ } | {
3745
+ row: number;
3746
+ outcome: "refused";
3747
+ reason: string;
3748
+ source: Record<string, unknown>;
3749
+ };
3750
+ interface ImportProposal {
3751
+ column: string;
3752
+ field_key: string;
3753
+ label: string;
3754
+ type: string;
3755
+ why: string;
3756
+ samples: unknown[];
3757
+ state: "proposed" | "waiting" | "accepted" | "rejected" | "ignored" | "refused";
3758
+ /** Set once the column is waiting in the approvals inbox. */
3759
+ approval_id?: Uuid;
3760
+ /** Set once an admin added it outright. */
3761
+ field_id?: Uuid;
3762
+ reason?: string;
3763
+ options?: string[];
3764
+ unit?: string;
3765
+ relation_target?: Uuid;
3766
+ }
3767
+ interface ImportBatchResult {
3768
+ import_id: Uuid;
3769
+ rows_seen: number;
3770
+ rows_written: number;
3771
+ rows_duplicate: number;
3772
+ rows_refused: number;
3773
+ outcomes: ImportOutcome[];
3774
+ proposals: ImportProposal[];
3775
+ }
3776
+ interface ImportFinished {
3777
+ import_id: Uuid;
3778
+ state: "finished";
3779
+ rows_seen: number;
3780
+ rows_written: number;
3781
+ rows_duplicate: number;
3782
+ rows_refused: number;
3783
+ columns_offered: number;
3784
+ columns_added: number;
3785
+ columns_ignored: number;
3786
+ proposals: ImportProposal[];
3787
+ message: string;
3788
+ }
3789
+ /**
3790
+ * The rows a person clicks through to. `capped` and `note` are the store saying
3791
+ * out loud which part of the total it can still show — a number with nothing
3792
+ * behind it is the thing this shape exists to prevent.
3793
+ */
3794
+ interface ImportReport {
3795
+ import_id: Uuid;
3796
+ table_id: Uuid;
3797
+ state: "refused" | "duplicate";
3798
+ rows: Array<Record<string, unknown>>;
3799
+ kept: number;
3800
+ total: number;
3801
+ capped: boolean;
3802
+ note: string | null;
3803
+ }
3804
+ interface ImportRun {
3805
+ import_id: Uuid;
3806
+ table_id: Uuid;
3807
+ format: "csv" | "xlsx";
3808
+ source_name: string | null;
3809
+ file_hash: string | null;
3810
+ dedupe_key: string | null;
3811
+ policy: ImportPolicy;
3812
+ state: string;
3813
+ rows_seen: number;
3814
+ rows_written: number;
3815
+ rows_duplicate: number;
3816
+ rows_refused: number;
3817
+ columns_offered: number;
3818
+ opened_at: Timestamp;
3819
+ finished_at: Timestamp | null;
3820
+ created_by: Uuid | null;
3821
+ }
3822
+ /** DOOR-19. An address a Table owns, and what has arrived at it. */
3823
+ interface InboundAddress {
3824
+ inbound_id: Uuid;
3825
+ table_id: Uuid | null;
3826
+ channel: string;
3827
+ address: string;
3828
+ source: string | null;
3829
+ enabled: boolean;
3830
+ last_received_at: Timestamp | null;
3831
+ created_at: Timestamp;
3832
+ received: number;
3833
+ }
3834
+ interface InboundDeclared {
3835
+ inbound_id: Uuid;
3836
+ table_id: Uuid;
3837
+ address: string;
3838
+ channel: string;
3839
+ enabled: boolean;
3840
+ /**
3841
+ * THE ONE THING THAT COULD FAIL SILENTLY, SAID OUT LOUD. The address is real
3842
+ * and stored the moment this comes back; whether mail REACHES it is a fact
3843
+ * about DNS that no door can make true. Show this sentence wherever the
3844
+ * address is shown.
3845
+ */
3846
+ mail_route: string;
3847
+ message: string;
3848
+ }
3849
+
3266
3850
  /** One portal as `custom.portals` reports it to its organization. */
3267
3851
  interface PortalSummary {
3268
3852
  portal_id: Uuid;
@@ -3521,6 +4105,174 @@ interface DashboardRunResult {
3521
4105
  blocks: DashboardBlockResult[];
3522
4106
  }
3523
4107
 
4108
+ /** VAL-8's whole vocabulary. There is no fourth word. */
4109
+ type HistoryActorKind = "user" | "agent" | "system";
4110
+ /**
4111
+ * WHO WROTE A VERSION.
4112
+ *
4113
+ * `kind` is the store's own word for the author. `name` is a person as a person
4114
+ * reads them — never a uuid; SCR-N-5 forbids printing one at a customer.
4115
+ * `on_behalf_of` is present only for an agent, and for an agent it is ALWAYS
4116
+ * present: an agent carries the exact authority of the person operating it
4117
+ * (AGT-N-4), so a screen that showed the machine without the person would be
4118
+ * hiding who is answerable.
4119
+ */
4120
+ interface HistoryActor {
4121
+ kind: HistoryActorKind;
4122
+ user_id: Uuid | null;
4123
+ name: string | null;
4124
+ on_behalf_of: {
4125
+ user_id: Uuid;
4126
+ name: string | null;
4127
+ } | null;
4128
+ }
4129
+ /**
4130
+ * ONE FIELD THAT MOVED, with what it said before and what it says after.
4131
+ *
4132
+ * `label` is the Field's own label, so a timeline reads "Price" and not
4133
+ * `day_rate`. `rule` is FLD-9's computed provenance AT THAT VERSION — which
4134
+ * Rule, and which VERSION of the Rule, produced a derived value. `source` is
4135
+ * VAL-1's provenance, resolved from the pointer the document interns it under,
4136
+ * so a screen never prints `s3` at anybody.
4137
+ */
4138
+ interface HistoryChange {
4139
+ key: string;
4140
+ field_id: Uuid | null;
4141
+ label: string;
4142
+ before: unknown;
4143
+ after: unknown;
4144
+ rule: {
4145
+ rule_id: Uuid;
4146
+ rule_version: number;
4147
+ computed_at: Timestamp;
4148
+ } | null;
4149
+ source: Record<string, unknown> | null;
4150
+ /** VAL-2: why a value is absent — never asked, none, refused, conflicting. */
4151
+ absent_reason: string | null;
4152
+ /** VAL-3: the other candidates the store kept, in rank order. */
4153
+ alternates: unknown[] | null;
4154
+ }
4155
+ /** One version of one record, as `custom.record_history` answers it, newest first. */
4156
+ interface RecordHistoryEntry {
4157
+ version: number;
4158
+ occurred_at: Timestamp;
4159
+ /** The machine word: `edit`, `merge`, `undo of merge`, `insert`… */
4160
+ operation: string;
4161
+ /** The same thing in the word a person used: "edited", "merge", "created". */
4162
+ operation_label: string;
4163
+ actor: HistoryActor;
4164
+ changes: HistoryChange[];
4165
+ /** Set when a compound verb wrote this version (HIS-8). */
4166
+ migration_id: Uuid | null;
4167
+ /**
4168
+ * HIS-8: this version was written by a compound operation whose Migration log
4169
+ * row is still there, so the WHOLE operation can be undone through
4170
+ * `custom.migrate_undo`. An ordinary edit is never "undoable" in that sense —
4171
+ * it is RESTORABLE, which is a different verb and a different button.
4172
+ */
4173
+ undoable: boolean;
4174
+ }
4175
+ /**
4176
+ * ONE CHANGE TO ONE COLUMN, ANYWHERE IN A TABLE — the half of the question no
4177
+ * revision panel answers. Airtable and Notion both make you open each record
4178
+ * and look. Only records this person may see contribute, decided as a predicate
4179
+ * in the same statement rather than a filter afterwards.
4180
+ */
4181
+ interface FieldHistoryEntry {
4182
+ record_id: Uuid;
4183
+ /** The Table's own title field, so a row names a record and not a uuid. */
4184
+ record_title: string;
4185
+ version: number;
4186
+ occurred_at: Timestamp;
4187
+ operation_label: string;
4188
+ actor: HistoryActor;
4189
+ before: unknown;
4190
+ after: unknown;
4191
+ }
4192
+ /**
4193
+ * WHAT A RESTORE WOULD DO, BEFORE IT DOES IT.
4194
+ *
4195
+ * `before` on each change is what the record says NOW and `after` is what it
4196
+ * would say. A key the target version did not have comes back with `after` of
4197
+ * `null` — the screen says "cleared", because that is what the write does to
4198
+ * it. Computed by the same body that computes the write, so the sentence and
4199
+ * the act cannot drift.
4200
+ */
4201
+ interface RestorePreview {
4202
+ record_id: Uuid;
4203
+ from_version: number;
4204
+ to_version: number;
4205
+ saved_at: Timestamp;
4206
+ /** Present when the preview is for one column rather than the whole record. */
4207
+ field_key: string | null;
4208
+ changes: HistoryChange[];
4209
+ count: number;
4210
+ }
4211
+ /** What a restore actually did. A NEW version, always. */
4212
+ interface RestoreResult {
4213
+ record_id: Uuid;
4214
+ restored_from_version: number;
4215
+ /** The version the restore WROTE. */
4216
+ version: number;
4217
+ changed: HistoryChange[];
4218
+ count: number;
4219
+ /** Always `false`, and said out loud because it is what people fear. */
4220
+ history_rewritten: boolean;
4221
+ /** Present on a single-value restore. */
4222
+ field_key?: string;
4223
+ }
4224
+ /** One comment, with the people on it named. */
4225
+ interface RecordComment {
4226
+ id: Uuid;
4227
+ body: string;
4228
+ anchor: Record<string, unknown>;
4229
+ /**
4230
+ * The column this comment is about, when it is about one. Notion anchors a
4231
+ * comment to a block; here the block is a Field, so "this price looks wrong"
4232
+ * sits on the price instead of at the bottom of the record.
4233
+ */
4234
+ field_key: string | null;
4235
+ parent_comment_id: Uuid | null;
4236
+ created_by: Uuid;
4237
+ created_by_name: string;
4238
+ created_at: Timestamp;
4239
+ resolved_at: Timestamp | null;
4240
+ resolved_by: Uuid | null;
4241
+ resolved_by_name: string | null;
4242
+ mentions: Array<{
4243
+ user_id: Uuid;
4244
+ name: string;
4245
+ }>;
4246
+ /** Mine, so a screen offers Resolve on my own and Reply on everybody's. */
4247
+ mine: boolean;
4248
+ }
4249
+ /**
4250
+ * A RECORD'S WHOLE THREAD, AND WHAT THIS PERSON MAY DO IN IT.
4251
+ *
4252
+ * The two booleans come from the STORE, in the same call that answers the
4253
+ * thread, because a composer drawn for somebody the write door will refuse is
4254
+ * the defect lane UI-HONEST spent a night removing. `commenter` is the second
4255
+ * rung: a viewer reads the conversation and cannot join it, which is exactly
4256
+ * what the two rungs mean.
4257
+ */
4258
+ interface CommentThreadRead {
4259
+ record_id: Uuid;
4260
+ comments: RecordComment[];
4261
+ may_comment: boolean;
4262
+ may_resolve: boolean;
4263
+ }
4264
+ /** What `custom.comment_write` answers. */
4265
+ interface CommentWritten {
4266
+ comment_id: Uuid;
4267
+ mentioned: Uuid[];
4268
+ /**
4269
+ * How many people were actually TOLD. "I mentioned three people" and "three
4270
+ * people were told" are different facts and a screen that conflates them is
4271
+ * lying quietly.
4272
+ */
4273
+ notified: number;
4274
+ }
4275
+
3524
4276
  /** One token found in a body, in the order it appears. */
3525
4277
  interface DocToken {
3526
4278
  ordinal: number;
@@ -4352,6 +5104,104 @@ interface RecordsConfig {
4352
5104
  schema?: string;
4353
5105
  }
4354
5106
 
5107
+ /** One value the agent was given, with the triple that makes it citable. */
5108
+ interface RecordScopeField {
5109
+ key: string;
5110
+ label: string;
5111
+ type: string;
5112
+ value: unknown;
5113
+ /** DYN: a merge field resolves to a TRIPLE, not a string. */
5114
+ cite: {
5115
+ record_id: Uuid;
5116
+ field_id: Uuid;
5117
+ value_version: number;
5118
+ written_at: string | null;
5119
+ };
5120
+ }
5121
+ /** A Field the agent was NOT given, and which of the two reasons it is. */
5122
+ interface RecordScopeWithheld {
5123
+ key: string;
5124
+ label: string;
5125
+ because: "masked" | "policy";
5126
+ reason: string;
5127
+ needs?: string;
5128
+ /** The whole sentence, already written — a screen prints it rather than composing one. */
5129
+ says: string;
5130
+ }
5131
+ interface RecordScopeRelation {
5132
+ via: string;
5133
+ target_id: Uuid;
5134
+ foreign: boolean;
5135
+ masked: boolean;
5136
+ your_level: PermissionLevel | null;
5137
+ card: Record<string, unknown> | null;
5138
+ why: string | null;
5139
+ }
5140
+ interface RecordScopeHistoryEntry {
5141
+ version: number;
5142
+ at: string;
5143
+ what: string;
5144
+ who: string | null;
5145
+ changes: Array<Record<string, unknown>>;
5146
+ }
5147
+ interface RecordScopeComment {
5148
+ id: Uuid;
5149
+ body: string;
5150
+ created_at: string;
5151
+ created_by_name: string;
5152
+ field_key: string | null;
5153
+ }
5154
+ interface RecordScopeContext {
5155
+ record: {
5156
+ id: Uuid;
5157
+ title: string;
5158
+ table_id: Uuid;
5159
+ table_name: string | null;
5160
+ scope_type: string;
5161
+ plural: string;
5162
+ version: number;
5163
+ updated_at: string;
5164
+ your_level: PermissionLevel;
5165
+ };
5166
+ fields: RecordScopeField[];
5167
+ withheld: RecordScopeWithheld[];
5168
+ relations: RecordScopeRelation[];
5169
+ history: RecordScopeHistoryEntry[];
5170
+ comments: RecordScopeComment[];
5171
+ may_comment: boolean;
5172
+ siblings: {
5173
+ shown: Array<{
5174
+ id: Uuid;
5175
+ title: string;
5176
+ }>;
5177
+ more_than_shown: boolean;
5178
+ says: string;
5179
+ };
5180
+ /** Questions derived from THIS record's shape — never a fixed list. */
5181
+ suggested: string[];
5182
+ /** One sentence naming what is not in the conversation. Printed verbatim. */
5183
+ says: string;
5184
+ assembled_at: string;
5185
+ }
5186
+ /** What a conversation is about. `readable` false means the person lost access to it. */
5187
+ interface ConversationScope {
5188
+ bound: boolean;
5189
+ readable?: boolean;
5190
+ record_id?: Uuid;
5191
+ table_id?: Uuid;
5192
+ scope_type?: string;
5193
+ title?: string;
5194
+ bound_at?: string;
5195
+ bound_by?: Uuid;
5196
+ because?: string;
5197
+ }
5198
+ interface ConversationScopeContext {
5199
+ scope: ConversationScope;
5200
+ context: RecordScopeContext | null;
5201
+ }
5202
+ /** `About: Acme Industrial` — the chip a bound chat wears. */
5203
+ declare function scopeChip(scope: ConversationScope): string;
5204
+
4355
5205
  /**
4356
5206
  * DOOR-8. As-of on EITHER clock, and they are different questions:
4357
5207
  * · `record` — the record clock: what this record looked like at version time.
@@ -4579,6 +5429,95 @@ interface RecordsClient {
4579
5429
  form_id?: Uuid | null;
4580
5430
  slug?: string | null;
4581
5431
  }): Promise<RecordsResult<Uuid>>;
5432
+ /**
5433
+ * What the store makes of a file's columns, before anything is written.
5434
+ * `columns` is `[{header, samples}]` — the first page of the file is plenty.
5435
+ */
5436
+ importPlan(args: {
5437
+ table_id: Uuid;
5438
+ columns: Array<{
5439
+ header: string;
5440
+ samples: unknown[];
5441
+ }>;
5442
+ }): Promise<RecordsResult<ImportPlan>>;
5443
+ /**
5444
+ * Open a run. `file_hash` is the run's IDENTITY: the same bytes into the same
5445
+ * table a second time answer the FIRST run with `already: true` and write
5446
+ * nothing, so a re-import doubles nothing. `force` re-opens deliberately.
5447
+ */
5448
+ importBegin(args: {
5449
+ table_id: Uuid;
5450
+ format?: "csv" | "xlsx";
5451
+ source_name?: string | null;
5452
+ source_columns?: unknown[];
5453
+ file_hash?: string | null;
5454
+ policy?: ImportPolicy;
5455
+ /** A Field key. A row whose value for it is already here is a duplicate. */
5456
+ dedupe_key?: string | null;
5457
+ file_bytes?: number | null;
5458
+ force?: boolean;
5459
+ }): Promise<RecordsResult<ImportOpened>>;
5460
+ /**
5461
+ * One BATCH of rows. Every row is written through the ONE write door inside
5462
+ * its own subtransaction, so a refused row leaves nothing behind and never
5463
+ * costs the rows before it. Send a few hundred at a time.
5464
+ */
5465
+ importRows(args: {
5466
+ import_id: Uuid;
5467
+ rows: Array<Record<string, unknown>>;
5468
+ /** Header -> Field key. A header that already spells a key needs no entry. */
5469
+ mapping?: Record<string, string>;
5470
+ }): Promise<RecordsResult<ImportBatchResult>>;
5471
+ /**
5472
+ * Close the run and decide the columns the file had and the table did not:
5473
+ * `propose` (the ONE approvals inbox, and the only choice a non-admin has),
5474
+ * `create` (an admin adds them outright) or `ignore`.
5475
+ */
5476
+ importFinish(args: {
5477
+ import_id: Uuid;
5478
+ unmapped?: "propose" | "create" | "ignore";
5479
+ }): Promise<RecordsResult<ImportFinished>>;
5480
+ /** The refused rows, or the ones already here, WITH the source row on each. */
5481
+ importReport(args: {
5482
+ import_id: Uuid;
5483
+ state?: "refused" | "duplicate";
5484
+ limit?: number;
5485
+ offset?: number;
5486
+ }): Promise<RecordsResult<ImportReport>>;
5487
+ /** This organization's import runs, newest first. How you find yesterday's. */
5488
+ imports(args?: {
5489
+ table_id?: Uuid | null;
5490
+ limit?: number;
5491
+ }): Promise<RecordsResult<ImportRun[]>>;
5492
+ /**
5493
+ * Forget the RECEIPT for a file so the same bytes can be imported again
5494
+ * deliberately. Never touches the records that import wrote.
5495
+ */
5496
+ importForget(args: {
5497
+ import_id: Uuid;
5498
+ }): Promise<RecordsResult<boolean>>;
5499
+ /**
5500
+ * Give a table its own address. The answer carries `mail_route`: the one
5501
+ * sentence saying what has to exist in DNS before anything arrives. Show it
5502
+ * wherever the address is shown — an address that silently swallows mail is
5503
+ * the failure this whole door is against.
5504
+ */
5505
+ inboundDeclare(args: {
5506
+ table_id: Uuid;
5507
+ label?: string | null;
5508
+ }): Promise<RecordsResult<InboundDeclared>>;
5509
+ inboundAddresses(args?: {
5510
+ table_id?: Uuid | null;
5511
+ }): Promise<RecordsResult<InboundAddress[]>>;
5512
+ inboundSet(args: {
5513
+ inbound_id: Uuid;
5514
+ enabled: boolean;
5515
+ }): Promise<RecordsResult<{
5516
+ inbound_id: Uuid;
5517
+ address: string;
5518
+ enabled: boolean;
5519
+ message: string;
5520
+ }>>;
4582
5521
  /** Every portal over this organization the caller may know about, with its numbers. */
4583
5522
  portals(): Promise<RecordsResult<PortalSummary[]>>;
4584
5523
  /** ONE portal in full: what it shows, and who it was opened to. */
@@ -4803,6 +5742,115 @@ interface RecordsClient {
4803
5742
  revisions(args: {
4804
5743
  record_id: Uuid;
4805
5744
  }): Promise<RecordsResult<RecordRevision[]>>;
5745
+ /**
5746
+ * PRODUCTS row 4. One record's version list, newest first: who (a person, or
5747
+ * an agent AND the person it acted for), when, the operation in the word
5748
+ * somebody used, and every field that moved with its before, its after, the
5749
+ * Rule version that produced a derived value and its source pointer. Viewer
5750
+ * on the record — reading how something got to be the way it is is reading.
5751
+ */
5752
+ recordHistory(args: {
5753
+ record_id: Uuid;
5754
+ limit?: number;
5755
+ offset?: number;
5756
+ }): Promise<RecordsResult<RecordHistoryEntry[]>>;
5757
+ /**
5758
+ * AGT-N-9 — EVERYTHING A CHAT OPENED ON THIS RECORD MAY KNOW, IN ONE ROUND TRIP.
5759
+ *
5760
+ * The Fields with their `(record, field, value version)` triples, the relations one hop
5761
+ * out, the history, the comments and the Table's other records — assembled INSIDE the
5762
+ * database, every piece through the read door, under this person's own field-level
5763
+ * security. A Field the store masks comes back in `withheld` with the store's own
5764
+ * sentence and no value; a Field the organization keeps out of conversations comes back
5765
+ * there too, saying which of the two it is.
5766
+ */
5767
+ recordScopeContext(args: {
5768
+ record_id: Uuid;
5769
+ relations?: number;
5770
+ history?: number;
5771
+ siblings?: number;
5772
+ }): Promise<RecordsResult<RecordScopeContext>>;
5773
+ /** What is this conversation about? */
5774
+ conversationScope(args: {
5775
+ conversation_id: Uuid;
5776
+ }): Promise<RecordsResult<ConversationScope>>;
5777
+ /** Point a conversation at one record. Refused unless this person may open it. */
5778
+ conversationScopeBind(args: {
5779
+ conversation_id: Uuid;
5780
+ record_id: Uuid;
5781
+ }): Promise<RecordsResult<ConversationScope>>;
5782
+ /** This conversation is no longer about a particular record. */
5783
+ conversationScopeUnbind(args: {
5784
+ conversation_id: Uuid;
5785
+ }): Promise<RecordsResult<ConversationScope>>;
5786
+ /** The binding AND the context of a bound conversation, in one round trip. */
5787
+ conversationScopeContext(args: {
5788
+ conversation_id: Uuid;
5789
+ relations?: number;
5790
+ history?: number;
5791
+ siblings?: number;
5792
+ }): Promise<RecordsResult<ConversationScopeContext>>;
5793
+ /**
5794
+ * "Who changed the price on ANY record?" One column's history across a whole
5795
+ * Table, narrowed to the records this person may see by a predicate in the
5796
+ * same statement. A column that names no Field is refused BY NAME, never
5797
+ * answered empty.
5798
+ */
5799
+ fieldHistory(args: {
5800
+ table_id: Uuid;
5801
+ field_key: string;
5802
+ limit?: number;
5803
+ offset?: number;
5804
+ record_id?: Uuid;
5805
+ }): Promise<RecordsResult<FieldHistoryEntry[]>>;
5806
+ /**
5807
+ * WHAT A RESTORE WOULD CHANGE, BEFORE IT DOES. Editor on the record: this is
5808
+ * the first half of an act, and somebody who may not perform it is not shown
5809
+ * its preview. Pass `field_key` for one column.
5810
+ */
5811
+ restorePreview(args: {
5812
+ record_id: Uuid;
5813
+ version: number;
5814
+ field_key?: string;
5815
+ }): Promise<RecordsResult<RestorePreview>>;
5816
+ /** Put the whole record back to a version, as a NEW version. Editor. */
5817
+ restoreVersion(args: {
5818
+ record_id: Uuid;
5819
+ version: number;
5820
+ }): Promise<RecordsResult<RestoreResult>>;
5821
+ /** Put ONE column back to what it said at a version, as a NEW version (HIS-N-2). Editor. */
5822
+ valueRestore(args: {
5823
+ record_id: Uuid;
5824
+ field_key: string;
5825
+ version: number;
5826
+ }): Promise<RecordsResult<RestoreResult>>;
5827
+ /**
5828
+ * SCR-18. The record's comment thread with everybody named, plus what THIS
5829
+ * person may do in it — decided by the store, in the same call, so a screen
5830
+ * never draws a composer the write door will refuse.
5831
+ */
5832
+ commentThread(args: {
5833
+ record_id: Uuid;
5834
+ include_resolved?: boolean;
5835
+ }): Promise<RecordsResult<CommentThreadRead>>;
5836
+ /**
5837
+ * Write a comment at the `commenter` rung, optionally naming people. A
5838
+ * mention is a reference and not a regex over the body: the ids come from the
5839
+ * picker and the store refuses one who is not in the organization, or who
5840
+ * cannot open the record — because that notification would be a dead end.
5841
+ */
5842
+ commentWrite(args: {
5843
+ record_id: Uuid;
5844
+ body: string;
5845
+ field_key?: string;
5846
+ parent_comment_id?: Uuid;
5847
+ mentions?: Uuid[];
5848
+ }): Promise<RecordsResult<CommentWritten>>;
5849
+ /** Resolve (or re-open) a thread. `commenter` — resolution is not a delete. */
5850
+ commentResolve(args: {
5851
+ comment_id: Uuid;
5852
+ resolved?: boolean;
5853
+ }): Promise<RecordsResult<boolean>>;
4806
5854
  /**
4807
5855
  * Every value of one record WITH its envelope — its own version, who wrote
4808
5856
  * it, who they were acting for and when. The timeline IS the record (REC-19);
@@ -5296,4 +6344,4 @@ declare function useFieldMutation(): UseFieldMutation;
5296
6344
  */
5297
6345
  declare function useMergeField(key: string | null, state?: Record<string, unknown>): MergeFieldResolution | null;
5298
6346
 
5299
- 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 ComputeOn, type ContextPolicy, 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 FieldPatch, type FieldProposal, type FieldRule, type FieldSensitivity, type FieldSource, type FieldTypeWord, type ForbiddenEnvelopeWord, type FormSummary, type Freshness, type HiddenFieldNotice, type Home, 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 RecordDocument, type RecordRead, type RecordRevision, type RecordsActor, type RecordsConfig, type RecordsDataSource, type RecordsError, type RecordsErrorCode, type RecordsErrorSink, type RecordsFilter, RecordsProvider, type RecordsProviderProps, 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 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 UseEntityFieldMutation, type UseFieldMutation, type UseRecordMutation, type UseRecordsOptions, type UseRecordsState, 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, useEntityFieldMutation, useEntityFieldRights, useEntityFields, useEntityRecord, useEntityTable, useFieldMutation, useFields, useMergeField, useMyLevel, useMyLevels, useOptionalRecordsClient, useRecord, useRecordMutation, useRecords, useRecordsActor, useRecordsClient, useTable, useTables };
6347
+ 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, RecordsProvider, type RecordsProviderProps, 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 UseEntityFieldMutation, type UseFieldMutation, type UseRecordMutation, type UseRecordsOptions, type UseRecordsState, 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, useEntityFieldMutation, useEntityFieldRights, useEntityFields, useEntityRecord, useEntityTable, useFieldMutation, useFields, useMergeField, useMyLevel, useMyLevels, useOptionalRecordsClient, useRecord, useRecordMutation, useRecords, useRecordsActor, useRecordsClient, useTable, useTables };