@ai-matrx/records 0.6.2 → 0.7.2

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.
@@ -182,11 +182,21 @@ declare const STORE_DOORS: readonly [{
182
182
  readonly args: "p_declared text";
183
183
  readonly returns: "text";
184
184
  readonly security: "invoker";
185
+ }, {
186
+ readonly name: "agent_change_approval";
187
+ readonly args: "p_organization uuid, p_conversation uuid DEFAULT NULL::uuid, p_table uuid DEFAULT NULL::uuid";
188
+ readonly returns: "jsonb";
189
+ readonly security: "definer";
185
190
  }, {
186
191
  readonly name: "agent_context";
187
192
  readonly args: "p_organization_id uuid, p_table_id uuid, p_limit integer DEFAULT 50";
188
193
  readonly returns: "jsonb";
189
194
  readonly security: "invoker";
195
+ }, {
196
+ readonly name: "agent_table_claim";
197
+ readonly args: "p_organization uuid, p_table uuid, p_conversation uuid DEFAULT NULL::uuid";
198
+ readonly returns: "void";
199
+ readonly security: "definer";
190
200
  }, {
191
201
  readonly name: "agg_assert_key";
192
202
  readonly args: "p_key text";
@@ -272,6 +282,11 @@ declare const STORE_DOORS: readonly [{
272
282
  readonly args: "p_organization_id uuid, p_form_id uuid, p_bucket text, p_token_id uuid DEFAULT NULL::uuid";
273
283
  readonly returns: "integer";
274
284
  readonly security: "definer";
285
+ }, {
286
+ readonly name: "anon_submissions";
287
+ readonly args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid, p_state text DEFAULT NULL::text, p_limit integer DEFAULT 100, p_offset integer DEFAULT 0";
288
+ readonly returns: "TABLE(id uuid, form_id uuid, inbound_id uuid, table_id uuid, source text, state text, payload jsonb, raw_payload jsonb, client_key text, record_id uuid, remote_origin text, rejection_reason text, created_at timestamp with time zone, cleared_at timestamp with time zone)";
289
+ readonly security: "definer";
275
290
  }, {
276
291
  readonly name: "anon_token_issue";
277
292
  readonly args: "p_organization_id uuid, p_mode text, p_allowed_origins jsonb, p_form_id uuid DEFAULT NULL::uuid, p_saved_view_id uuid DEFAULT NULL::uuid, p_record_id uuid DEFAULT NULL::uuid, p_expires_at timestamp with time zone DEFAULT NULL::timestamp with time zone";
@@ -347,6 +362,16 @@ declare const STORE_DOORS: readonly [{
347
362
  readonly args: "";
348
363
  readonly returns: "name";
349
364
  readonly security: "invoker";
365
+ }, {
366
+ readonly name: "carrying_edges_in";
367
+ readonly args: "p_organization_id uuid";
368
+ readonly returns: "TABLE(container_type text, container_id uuid, item_type text, item_id uuid, conveys_max permission_level)";
369
+ readonly security: "definer";
370
+ }, {
371
+ readonly name: "carrying_edges_of";
372
+ readonly args: "p_item_type text, p_item_id uuid";
373
+ readonly returns: "TABLE(container_type text, container_id uuid, conveys_max permission_level)";
374
+ readonly security: "definer";
350
375
  }, {
351
376
  readonly name: "client_write_grants";
352
377
  readonly args: "";
@@ -392,6 +417,11 @@ declare const STORE_DOORS: readonly [{
392
417
  readonly args: "p_organization_id uuid, p_record_id uuid";
393
418
  readonly returns: "uuid[]";
394
419
  readonly security: "invoker";
420
+ }, {
421
+ readonly name: "delete_preview";
422
+ readonly args: "p_organization_id uuid, p_record_id uuid";
423
+ readonly returns: "jsonb";
424
+ readonly security: "definer";
395
425
  }, {
396
426
  readonly name: "delete_rule";
397
427
  readonly args: "p_organization_id uuid, p_record_id uuid, p_apply boolean DEFAULT true";
@@ -566,7 +596,7 @@ declare const STORE_DOORS: readonly [{
566
596
  readonly name: "field_dependants";
567
597
  readonly args: "p_organization_id uuid, p_field_id uuid";
568
598
  readonly returns: "TABLE(kind text, dependant_id uuid, label text, how text)";
569
- readonly security: "invoker";
599
+ readonly security: "definer";
570
600
  }, {
571
601
  readonly name: "field_kernel_id";
572
602
  readonly args: "";
@@ -607,6 +637,11 @@ declare const STORE_DOORS: readonly [{
607
637
  readonly args: "p_organization_id uuid, p_record_id uuid, p_field_data jsonb, p_values jsonb DEFAULT NULL::jsonb";
608
638
  readonly returns: "jsonb";
609
639
  readonly security: "invoker";
640
+ }, {
641
+ readonly name: "guard_refusals_are_complete";
642
+ readonly args: "";
643
+ readonly returns: "TABLE(guard text, said text)";
644
+ readonly security: "invoker";
610
645
  }, {
611
646
  readonly name: "has_visibility";
612
647
  readonly args: "p_user_id uuid, p_type text, p_id uuid, p_required permission_level DEFAULT 'viewer'::permission_level";
@@ -762,6 +797,11 @@ declare const STORE_DOORS: readonly [{
762
797
  readonly args: "p_organization_id uuid, p_record_id uuid";
763
798
  readonly returns: "TABLE(version integer, changed_at timestamp with time zone, changed_by uuid, summary text, operation text, changed_fields jsonb)";
764
799
  readonly security: "definer";
800
+ }, {
801
+ readonly name: "is_a_retirement";
802
+ 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";
803
+ readonly returns: "boolean";
804
+ readonly security: "invoker";
765
805
  }, {
766
806
  readonly name: "lookup_value";
767
807
  readonly args: "p_organization_id uuid, p_record_id uuid, p_field_data jsonb";
@@ -826,7 +866,7 @@ declare const STORE_DOORS: readonly [{
826
866
  readonly name: "migrate_retype";
827
867
  readonly args: "p_organization_id uuid, p_id uuid, p_to text, p_note text DEFAULT NULL::text";
828
868
  readonly returns: "jsonb";
829
- readonly security: "invoker";
869
+ readonly security: "definer";
830
870
  }, {
831
871
  readonly name: "migrate_split";
832
872
  readonly args: "p_organization_id uuid, p_record_id uuid, p_moved_keys text[], p_note text DEFAULT NULL::text";
@@ -837,6 +877,21 @@ declare const STORE_DOORS: readonly [{
837
877
  readonly args: "p_organization_id uuid, p_log_id uuid";
838
878
  readonly returns: "jsonb";
839
879
  readonly security: "definer";
880
+ }, {
881
+ readonly name: "migrations";
882
+ readonly args: "p_organization_id uuid, p_target_id uuid DEFAULT NULL::uuid, p_limit integer DEFAULT 100";
883
+ 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)";
884
+ readonly security: "definer";
885
+ }, {
886
+ readonly name: "my_level";
887
+ readonly args: "p_organization_id uuid, p_id uuid, p_type text DEFAULT 'record'::text";
888
+ readonly returns: "permission_level";
889
+ readonly security: "definer";
890
+ }, {
891
+ readonly name: "my_levels";
892
+ readonly args: "p_organization_id uuid, p_ids jsonb, p_type text DEFAULT 'record'::text";
893
+ readonly returns: "TABLE(id uuid, level permission_level)";
894
+ readonly security: "definer";
840
895
  }, {
841
896
  readonly name: "organization_kernel_id";
842
897
  readonly args: "";
@@ -1037,6 +1092,31 @@ declare const STORE_DOORS: readonly [{
1037
1092
  readonly args: "p_organization_id uuid, p_roots uuid[]";
1038
1093
  readonly returns: "TABLE(record_id uuid, depth integer, via text)";
1039
1094
  readonly security: "invoker";
1095
+ }, {
1096
+ readonly name: "reaches_directly";
1097
+ readonly args: "p_user_id uuid, p_type text, p_id uuid, p_required permission_level DEFAULT 'viewer'::permission_level";
1098
+ readonly returns: "boolean";
1099
+ readonly security: "definer";
1100
+ }, {
1101
+ readonly name: "read_door_carried_ids";
1102
+ readonly args: "p_user uuid, p_organization_id uuid, p_table_id uuid, p_required permission_level, OUT o_ids uuid[], OUT o_containers integer";
1103
+ readonly returns: "record";
1104
+ readonly security: "definer";
1105
+ }, {
1106
+ readonly name: "read_door_granted_ids";
1107
+ readonly args: "p_organization_id uuid, p_table_id uuid";
1108
+ readonly returns: "uuid[]";
1109
+ readonly security: "definer";
1110
+ }, {
1111
+ readonly name: "read_door_ladder_ceiling";
1112
+ readonly args: "";
1113
+ readonly returns: "integer";
1114
+ readonly security: "invoker";
1115
+ }, {
1116
+ readonly name: "read_door_parity";
1117
+ readonly args: "p_organization_id uuid, p_table_id uuid, p_user uuid, p_required permission_level, p_sample integer";
1118
+ readonly returns: "TABLE(record_id uuid, set_based boolean, per_row boolean, verdict text)";
1119
+ readonly security: "definer";
1040
1120
  }, {
1041
1121
  readonly name: "read_paths_outside_the_door";
1042
1122
  readonly args: "";
@@ -1062,6 +1142,11 @@ declare const STORE_DOORS: readonly [{
1062
1142
  readonly args: "p_organization_id uuid, p_record_id uuid";
1063
1143
  readonly returns: "TABLE(rule_id uuid, rule_name text, rule_version integer, applies boolean, answer jsonb)";
1064
1144
  readonly security: "invoker";
1145
+ }, {
1146
+ readonly name: "record_as_of";
1147
+ readonly args: "p_organization_id uuid, p_record_id uuid, p_at timestamp with time zone";
1148
+ readonly returns: "TABLE(state jsonb, replayed boolean)";
1149
+ readonly security: "definer";
1065
1150
  }, {
1066
1151
  readonly name: "record_card";
1067
1152
  readonly args: "p_viewer uuid, p_organization_id uuid, p_record_id uuid";
@@ -1257,6 +1342,11 @@ declare const STORE_DOORS: readonly [{
1257
1342
  readonly args: "p_organization_id uuid, p_rule_id uuid";
1258
1343
  readonly returns: "integer";
1259
1344
  readonly security: "invoker";
1345
+ }, {
1346
+ readonly name: "said";
1347
+ readonly args: "p_value text, p_when_there_is_none text";
1348
+ readonly returns: "text";
1349
+ readonly security: "invoker";
1260
1350
  }, {
1261
1351
  readonly name: "share_access";
1262
1352
  readonly args: "p_organization_id uuid, p_subject_id uuid";
@@ -1297,6 +1387,11 @@ declare const STORE_DOORS: readonly [{
1297
1387
  readonly args: "p_organization_id uuid, p_type text, p_id uuid";
1298
1388
  readonly returns: "text";
1299
1389
  readonly security: "definer";
1390
+ }, {
1391
+ readonly name: "shared_only_disagreements";
1392
+ readonly args: "p_pretend text DEFAULT NULL::text";
1393
+ 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)";
1394
+ readonly security: "invoker";
1300
1395
  }, {
1301
1396
  readonly name: "size_refusal";
1302
1397
  readonly args: "p_organization_id uuid, p_data jsonb";
@@ -1342,6 +1437,11 @@ declare const STORE_DOORS: readonly [{
1342
1437
  readonly args: "p_organization_id uuid, p_spec jsonb";
1343
1438
  readonly returns: "uuid";
1344
1439
  readonly security: "definer";
1440
+ }, {
1441
+ readonly name: "table_has_a_visible_record";
1442
+ readonly args: "p_user uuid, p_organization_id uuid, p_table_id uuid";
1443
+ readonly returns: "boolean";
1444
+ readonly security: "definer";
1345
1445
  }, {
1346
1446
  readonly name: "table_is_live";
1347
1447
  readonly args: "p_organization_id uuid, p_table_id uuid";
@@ -1376,7 +1476,7 @@ declare const STORE_DOORS: readonly [{
1376
1476
  readonly name: "table_type_field";
1377
1477
  readonly args: "p_organization_id uuid, p_table_id uuid";
1378
1478
  readonly returns: "text";
1379
- readonly security: "invoker";
1479
+ readonly security: "definer";
1380
1480
  }, {
1381
1481
  readonly name: "tables_at_home";
1382
1482
  readonly args: "p_organization_id uuid, p_home_ids uuid[]";
@@ -1431,7 +1531,7 @@ declare const STORE_DOORS: readonly [{
1431
1531
  readonly name: "value_read";
1432
1532
  readonly args: "p_organization_id uuid, p_record_id uuid, p_key text";
1433
1533
  readonly returns: "TABLE(field_key text, field_id uuid, value jsonb, value_version integer, source jsonb, absent_reason text, actor text, on_behalf_of text, written_at timestamp with time zone, alternates jsonb)";
1434
- readonly security: "invoker";
1534
+ readonly security: "definer";
1435
1535
  }, {
1436
1536
  readonly name: "value_versions";
1437
1537
  readonly args: "p_old jsonb, p_new jsonb";
@@ -1462,11 +1562,21 @@ declare const STORE_DOORS: readonly [{
1462
1562
  readonly args: "p_container_type text, p_container_id uuid";
1463
1563
  readonly returns: "integer";
1464
1564
  readonly security: "definer";
1565
+ }, {
1566
+ readonly name: "visible_predicate_sql";
1567
+ readonly args: "p_user uuid, p_organization_id uuid, p_table_id uuid, p_required permission_level DEFAULT 'viewer'::permission_level, p_alias text DEFAULT 'r'::text";
1568
+ readonly returns: "text";
1569
+ readonly security: "definer";
1465
1570
  }, {
1466
1571
  readonly name: "visible_record_ids";
1467
1572
  readonly args: "p_user_id uuid, p_required permission_level DEFAULT 'viewer'::permission_level";
1468
1573
  readonly returns: "TABLE(id uuid)";
1469
1574
  readonly security: "definer";
1575
+ }, {
1576
+ readonly name: "visible_set";
1577
+ readonly args: "p_user uuid, p_organization_id uuid, p_table_id uuid, p_required permission_level DEFAULT 'viewer'::permission_level, OUT o_all_visible boolean, OUT o_true_visibility platform.visibility[], OUT o_granted_all uuid[], OUT o_granted_visible uuid[], OUT o_carried_visible uuid[], OUT o_ladder_calls integer, OUT o_fallback boolean, OUT o_note text";
1578
+ readonly returns: "record";
1579
+ readonly security: "definer";
1470
1580
  }, {
1471
1581
  readonly name: "widget_kernel_id";
1472
1582
  readonly args: "";
@@ -1566,15 +1676,15 @@ declare const STORE_DOORS: readonly [{
1566
1676
  /** The campaign's own knobs, with the value the store resolves them to today. */
1567
1677
  declare const STORE_KNOBS: readonly [{
1568
1678
  readonly key: "accessible_entity_ids_guard";
1569
- readonly value: "false";
1679
+ readonly value: "true";
1570
1680
  readonly type: "boolean";
1571
1681
  }, {
1572
1682
  readonly key: "agent_schema_changes";
1573
- readonly value: "\"propose\"";
1683
+ readonly value: "\"ask\"";
1574
1684
  readonly type: "string";
1575
1685
  }, {
1576
1686
  readonly key: "associations_guard";
1577
- readonly value: "false";
1687
+ readonly value: "true";
1578
1688
  readonly type: "boolean";
1579
1689
  }, {
1580
1690
  readonly key: "code_paths_enabled";
@@ -1655,7 +1765,7 @@ declare const STORE_KNOBS: readonly [{
1655
1765
  }, {
1656
1766
  readonly key: "member_default_level";
1657
1767
  readonly value: "\"viewer\"";
1658
- readonly type: "string";
1768
+ readonly type: "enum";
1659
1769
  }, {
1660
1770
  readonly key: "member_default_visibility";
1661
1771
  readonly value: "\"all_records\"";
@@ -1725,22 +1835,22 @@ declare const STORE_REFUSAL_CODES: readonly [{
1725
1835
  readonly raised_by: "rule_eval";
1726
1836
  }, {
1727
1837
  readonly code: "22023";
1728
- readonly raised_by: "_value_envelope,_work_shape_guard,actor_word,agg_assert_key,agg_sql,anon_token_issue,containment_parent,doc_render_body,doc_render_write,doc_signature_write,external_history_event,external_source_declare,external_stub_upsert,external_write_through,io_import_open,io_proposal_accept,migrate_merge,query_by_coordinates,query_rollup,record_update,relation_carry,rule_eval,rule_members,share_grant,share_lane_set,table_rules,visibility_as_of,work_slot_hold";
1838
+ readonly raised_by: "_value_envelope,_work_shape_guard,actor_word,agg_assert_key,agg_sql,anon_token_issue,containment_parent,doc_render_body,doc_render_write,doc_signature_write,external_history_event,external_source_declare,external_stub_upsert,external_write_through,io_import_open,io_proposal_accept,migrate_merge,my_levels,query_by_coordinates,query_rollup,record_update,relation_carry,rule_eval,rule_members,share_grant,share_lane_set,table_rules,visibility_as_of,work_slot_hold";
1729
1839
  }, {
1730
1840
  readonly code: "23503";
1731
1841
  readonly raised_by: "_containment_guard,_record_rule_uses,anon_publish,anon_rate_take,anon_token_issue,anon_write,assert_organization_wall,delete_rule,doc_sign,doc_template_save,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_eval,rule_members,rule_run,work_take_assignment,work_template_instantiate";
1732
1842
  }, {
1733
1843
  readonly code: "23505";
1734
- readonly raised_by: "doc_sign,doc_signature_write,field_declare,home_add,io_proposal_accept,relation_carry,relation_own,share_grant,work_slot_hold";
1844
+ readonly raised_by: "_unique_rule_holds,doc_sign,doc_signature_write,field_declare,home_add,io_proposal_accept,relation_carry,relation_own,share_grant,work_slot_hold";
1735
1845
  }, {
1736
1846
  readonly code: "23514";
1737
- readonly raised_by: "_containment_guard,_dated_values_guard,_derived_fields,_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,_rule_shape_guard,_rule_topology_guard,_store_relation_edge_names_its_field,_table_shape_guard,_value_envelope,_work_shape_guard,doc_sign,doc_signature_write,doc_template_save,field_declare,field_retire,field_update,home_add,migrate_merge,relation_carry,relation_own,validate_value_envelope,validate_values,work_slots_declare,work_take_assignment,work_template_instantiate";
1847
+ readonly raised_by: "_containment_guard,_dated_values_guard,_derived_fields,_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,doc_sign,doc_signature_write,doc_template_save,field_declare,field_retire,field_update,home_add,migrate_merge,relation_carry,relation_own,validate_value_envelope,validate_values,work_slots_declare,work_take_assignment,work_template_instantiate";
1738
1848
  }, {
1739
1849
  readonly code: "40001";
1740
1850
  readonly raised_by: "has_visibility_at";
1741
1851
  }, {
1742
1852
  readonly code: "42501";
1743
- 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_organization_admin,assert_store_door,external_write_through,io_comment_resolve,io_comment_write,io_restore,migrate_purge,promote_table,query_visibility_parity,read_record,read_records,share_grant,visibility_as_of";
1853
+ 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,external_write_through,io_comment_resolve,io_comment_write,io_restore,migrate_purge,my_levels,promote_table,query_visibility_parity,read_record,read_records,share_grant,visibility_as_of";
1744
1854
  }, {
1745
1855
  readonly code: "53400";
1746
1856
  readonly raised_by: "anon_rate_take,delete_cascade_closure,promote_field";
@@ -2041,6 +2151,27 @@ interface RecordRead {
2041
2151
  }>;
2042
2152
  }
2043
2153
 
2154
+ /** `public.permission_level`, in the store's own order. */
2155
+ type PermissionLevel = "viewer" | "commenter" | "editor" | "admin";
2156
+ /** The order the store writes them in, lowest first. */
2157
+ declare const PERMISSION_LEVELS: readonly PermissionLevel[];
2158
+ /** Whether `held` is the same rung as `needed` or a higher one. Nothing held is never enough. */
2159
+ declare function atLeast(held: PermissionLevel | null | undefined, needed: PermissionLevel): boolean;
2160
+ /** A level word the store sent, or null when it sent something this package does not know. */
2161
+ declare function asPermissionLevel(word: unknown): PermissionLevel | null;
2162
+ /** The higher of two levels — what a person holds when two ways in both let them through. */
2163
+ declare function highestLevel(left: PermissionLevel | null | undefined, right: PermissionLevel | null | undefined): PermissionLevel | null;
2164
+ /**
2165
+ * What one subject's level is, as `custom.my_levels` answers it. `null` is an
2166
+ * ANSWER — "you hold nothing on this" — and never a missing row: a screen that
2167
+ * could not tell "no access" from "not asked yet" would draw one of them as the
2168
+ * other.
2169
+ */
2170
+ interface MyLevel {
2171
+ id: string;
2172
+ level: PermissionLevel | null;
2173
+ }
2174
+
2044
2175
  /**
2045
2176
  * REC-1. A Table declares its fields, exactly one Home, and the properties
2046
2177
  * `display`, `ordered`, `heavy` | `light`, `retention` and `detail`.
@@ -3537,6 +3668,19 @@ interface RecordsClient {
3537
3668
  }): Promise<RecordsResult<unknown>>;
3538
3669
  /** Is the store switched on for this organization? A product switch, never the boundary. */
3539
3670
  storeIsOpen(): Promise<RecordsResult<boolean>>;
3671
+ /**
3672
+ * WHAT THIS PERSON MAY DO TO THESE THINGS — asked once, for a whole page.
3673
+ *
3674
+ * There is no principal argument, on purpose: the door resolves the caller
3675
+ * from the session, so a person can ask about their OWN access and about
3676
+ * nobody else's. A subject they hold nothing on answers `level: null`, which
3677
+ * is an answer; the row is never omitted, because a screen that could not
3678
+ * tell "no access" from "not asked yet" would draw one of them as the other.
3679
+ */
3680
+ myLevels(args: {
3681
+ ids: Uuid[];
3682
+ subject?: "record";
3683
+ }): Promise<RecordsResult<MyLevel[]>>;
3540
3684
  }
3541
3685
 
3542
3686
  interface RecordsProviderProps {
@@ -3563,6 +3707,21 @@ interface Async<T> {
3563
3707
  declare function useTable(tableId: Uuid | null): Async<Table | null>;
3564
3708
  /** Every Table this person can see in this organization. */
3565
3709
  declare function useTables(): Async<Table[]>;
3710
+ /**
3711
+ * WHAT THIS PERSON MAY DO TO THESE THINGS — one call for a whole page.
3712
+ *
3713
+ * A screen asks this BEFORE it draws a control, which is the whole difference
3714
+ * between a product that offers what you may use and one that offers everything
3715
+ * and apologises afterwards. The ids are joined into the dependency key so a
3716
+ * page that re-renders with the same rows does not re-ask.
3717
+ *
3718
+ * `null` for a subject is an ANSWER ("you hold nothing on this"), and `loading`
3719
+ * is a third state that is neither — a caller that treated loading as "no"
3720
+ * would blink every control off on every reload.
3721
+ */
3722
+ declare function useMyLevels(ids: Uuid[]): Async<Record<string, PermissionLevel | null>>;
3723
+ /** The same question about one thing. */
3724
+ declare function useMyLevel(id: Uuid | null): Async<PermissionLevel | null>;
3566
3725
  /**
3567
3726
  * FLD-10. The Fields that APPLY — the store decides, from the record type, and
3568
3727
  * the client asks rather than filtering a list it has.
@@ -3654,4 +3813,4 @@ declare function useFieldMutation(): UseFieldMutation;
3654
3813
  */
3655
3814
  declare function useMergeField(key: string | null, state?: Record<string, unknown>): MergeFieldResolution | null;
3656
3815
 
3657
- export { ABSENCE_REASONS, ACTOR_VOCABULARY, type AbsenceReason, type Actor, type AggregateBucket, type AggregateMeasure, type AggregateOperation, type AggregateRow, type AnonTokenBinding, COMPUTE_ON, CONTEXT_POLICIES, type ComputeOn, type ContextPolicy, DELIVERIES, type Delivery, type DocRenderRow, type DocSignatureCheck, type DocSignatureRow, type DocTemplateRow, type DocToken, type DocUnresolvedToken, ENTITY_TOKENS, type EntityToken, type ExternalPrincipalCard, FIELD_SENSITIVITIES, FIELD_SOURCES, FRESHNESS, type Field, type FieldBehavior, type FieldPatch, type FieldProposal, type FieldRule, type FieldSensitivity, type FieldSource, type ForbiddenEnvelopeWord, 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 NewFieldDeclaration, ON_DELETE, OVERRIDE_POLICIES, type OnDelete, type OverridePolicy, PARITY_FIELD_TYPES, PER_VALUE_ACCESS_WORDS, type ParityFieldType, type ParityFieldTypeDescriptor, type PerValueAccessWord, type PgError, 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 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 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 WorkAssignmentField, type WorkGraph, type WorkInstantiation, type WorkSlotHold, type WorkState, type WorkTemplateNode, type WorkTemplateRelation, type WorkTurn, type WriteConflict, err, isRecordsErr, measureKey, ok, useFieldMutation, useFields, useMergeField, useRecord, useRecordMutation, useRecords, useRecordsActor, useRecordsClient, useTable, useTables };
3816
+ export { ABSENCE_REASONS, ACTOR_VOCABULARY, type AbsenceReason, type Actor, type AggregateBucket, type AggregateMeasure, type AggregateOperation, type AggregateRow, type AnonTokenBinding, COMPUTE_ON, CONTEXT_POLICIES, type ComputeOn, type ContextPolicy, DELIVERIES, type Delivery, type DocRenderRow, type DocSignatureCheck, type DocSignatureRow, type DocTemplateRow, type DocToken, type DocUnresolvedToken, ENTITY_TOKENS, type EntityToken, type ExternalPrincipalCard, FIELD_SENSITIVITIES, FIELD_SOURCES, FRESHNESS, type Field, type FieldBehavior, type FieldPatch, type FieldProposal, type FieldRule, type FieldSensitivity, type FieldSource, type ForbiddenEnvelopeWord, 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 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 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 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 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 WorkAssignmentField, type WorkGraph, type WorkInstantiation, type WorkSlotHold, type WorkState, type WorkTemplateNode, type WorkTemplateRelation, type WorkTurn, type WriteConflict, asPermissionLevel, atLeast, err, highestLevel, isRecordsErr, measureKey, ok, useFieldMutation, useFields, useMergeField, useMyLevel, useMyLevels, useRecord, useRecordMutation, useRecords, useRecordsActor, useRecordsClient, useTable, useTables };