@ai-matrx/associations 0.5.2 → 0.6.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.
@@ -1,1358 +1,7 @@
1
1
  import * as react from 'react';
2
- import { ComponentType, ReactNode, ElementType, SVGProps } from 'react';
3
-
4
- /** Per-RPC Args/Returns for every demanded function, straight from the live DB. */
5
- interface DemandedRpcSignatures {
6
- assoc_add: {
7
- Args: {
8
- p_label?: string;
9
- p_metadata?: unknown;
10
- p_org_id?: string;
11
- p_payload?: unknown;
12
- p_payload_kind?: string;
13
- p_position?: number;
14
- p_role?: string;
15
- p_source_id: string;
16
- p_source_type: string;
17
- p_target_id: string;
18
- p_target_type: string;
19
- };
20
- Returns: string;
21
- };
22
- assoc_remove: {
23
- Args: {
24
- p_role?: string;
25
- p_source_id: string;
26
- p_source_type: string;
27
- p_target_id: string;
28
- p_target_type: string;
29
- };
30
- Returns: undefined;
31
- };
32
- assoc_set_targets: {
33
- Args: {
34
- p_org_id?: string;
35
- p_role?: string;
36
- p_source_id: string;
37
- p_source_type: string;
38
- p_target_ids: string[];
39
- p_target_type: string;
40
- };
41
- Returns: undefined;
42
- };
43
- assoc_remove_for_entity: {
44
- Args: {
45
- p_id: string;
46
- p_type: string;
47
- };
48
- Returns: undefined;
49
- };
50
- assoc_for_entity: {
51
- Args: {
52
- p_id: string;
53
- p_type: string;
54
- };
55
- Returns: {
56
- created_at: string;
57
- direction: string;
58
- id: string;
59
- label: string;
60
- metadata: unknown;
61
- organization_id: string;
62
- other_id: string;
63
- other_type: string;
64
- position: number;
65
- role: string;
66
- }[];
67
- };
68
- assoc_for_targets: {
69
- Args: {
70
- p_target_ids: string[];
71
- p_target_type: string;
72
- };
73
- Returns: {
74
- created_at: string;
75
- id: string;
76
- label: string;
77
- metadata: unknown;
78
- organization_id: string;
79
- position: number;
80
- role: string;
81
- source_id: string;
82
- source_type: string;
83
- target_id: string;
84
- }[];
85
- };
86
- assoc_for_sources: {
87
- Args: {
88
- p_source_ids: string[];
89
- p_source_type: string;
90
- p_target_type?: string;
91
- };
92
- Returns: {
93
- created_at: string;
94
- id: string;
95
- label: string;
96
- metadata: unknown;
97
- organization_id: string;
98
- position: number;
99
- role: string;
100
- source_id: string;
101
- target_id: string;
102
- target_type: string;
103
- }[];
104
- };
105
- assoc_members_visible: {
106
- Args: {
107
- p_target_ids: string[];
108
- p_target_type: string;
109
- };
110
- Returns: {
111
- created_at: string;
112
- id: string;
113
- label: string;
114
- metadata: unknown;
115
- organization_id: string;
116
- position: number;
117
- role: string;
118
- source_id: string;
119
- source_type: string;
120
- target_id: string;
121
- }[];
122
- };
123
- conversation_file_add: {
124
- Args: {
125
- p_conversation_id: string;
126
- p_file_id: string;
127
- p_label?: string;
128
- p_metadata?: unknown;
129
- p_replace_metadata?: boolean;
130
- };
131
- Returns: string;
132
- };
133
- conversation_file_remove: {
134
- Args: {
135
- p_conversation_id: string;
136
- p_file_id: string;
137
- };
138
- Returns: undefined;
139
- };
140
- conversation_files: {
141
- Args: {
142
- p_conversation_id: string;
143
- };
144
- Returns: {
145
- created_at: string;
146
- file_id: string;
147
- label: string;
148
- metadata: unknown;
149
- }[];
150
- };
151
- agent_resource_add: {
152
- Args: {
153
- p_agent_id: string;
154
- p_label?: string;
155
- p_metadata?: unknown;
156
- p_source_id: string;
157
- p_source_type: string;
158
- };
159
- Returns: string;
160
- };
161
- agent_resource_remove: {
162
- Args: {
163
- p_agent_id: string;
164
- p_source_id: string;
165
- p_source_type: string;
166
- };
167
- Returns: undefined;
168
- };
169
- cat_list: {
170
- Args: {
171
- p_dimension?: string;
172
- };
173
- Returns: {
174
- color: string;
175
- dimension: string;
176
- icon: string;
177
- id: string;
178
- is_system: boolean;
179
- metadata: unknown;
180
- name: string;
181
- organization_id: string;
182
- parent_id: string;
183
- position: number;
184
- slug: string;
185
- }[];
186
- };
187
- cat_create: {
188
- Args: {
189
- p_color?: string;
190
- p_dimension: string;
191
- p_icon?: string;
192
- p_name: string;
193
- p_org_id: string;
194
- p_parent_id?: string;
195
- p_slug?: string;
196
- };
197
- Returns: string;
198
- };
199
- cat_update: {
200
- Args: {
201
- p_category_id: string;
202
- p_color?: string;
203
- p_icon?: string;
204
- p_name: string;
205
- p_position?: number;
206
- p_slug?: string;
207
- };
208
- Returns: string;
209
- };
210
- cat_reparent: {
211
- Args: {
212
- p_category_id: string;
213
- p_parent_id?: string;
214
- };
215
- Returns: string;
216
- };
217
- cat_delete: {
218
- Args: {
219
- p_category_id: string;
220
- };
221
- Returns: string;
222
- };
223
- ues_set: {
224
- Args: {
225
- p_entity_id: string;
226
- p_entity_type: string;
227
- p_is_favorite?: boolean;
228
- p_is_hidden?: boolean;
229
- p_is_pinned?: boolean;
230
- };
231
- Returns: undefined;
232
- };
233
- ues_list: {
234
- Args: {
235
- p_kind?: string;
236
- };
237
- Returns: {
238
- entity_id: string;
239
- entity_type: string;
240
- is_favorite: boolean;
241
- is_hidden: boolean;
242
- is_pinned: boolean;
243
- last_viewed_at: string;
244
- updated_at: string;
245
- }[];
246
- };
247
- ues_get_bulk: {
248
- Args: {
249
- p_entity_ids: string[];
250
- p_entity_type: string;
251
- };
252
- Returns: {
253
- entity_id: string;
254
- is_favorite: boolean;
255
- is_hidden: boolean;
256
- is_pinned: boolean;
257
- last_viewed_at: string;
258
- }[];
259
- };
260
- ues_touch: {
261
- Args: {
262
- p_entity_id: string;
263
- p_entity_type: string;
264
- };
265
- Returns: undefined;
266
- };
267
- reference_search_candidates: {
268
- Args: {
269
- p_ids?: string[];
270
- p_limit?: number;
271
- p_search?: string;
272
- p_token: string;
273
- };
274
- Returns: {
275
- id: string;
276
- title: string;
277
- }[];
278
- };
279
- cmt_list: {
280
- Args: {
281
- p_entity_id: string;
282
- p_entity_type: string;
283
- };
284
- Returns: {
285
- author_avatar_url: string;
286
- author_display_name: string;
287
- author_email: string;
288
- body: string;
289
- created_at: string;
290
- created_by: string;
291
- entity_id: string;
292
- entity_type: string;
293
- id: string;
294
- organization_id: string;
295
- parent_id: string;
296
- updated_at: string;
297
- }[];
298
- };
299
- cmt_add: {
300
- Args: {
301
- p_body: string;
302
- p_entity_id: string;
303
- p_entity_type: string;
304
- p_org_id?: string;
305
- p_parent_id?: string;
306
- };
307
- Returns: string;
308
- };
309
- cmt_edit: {
310
- Args: {
311
- p_body: string;
312
- p_id: string;
313
- };
314
- Returns: undefined;
315
- };
316
- cmt_delete: {
317
- Args: {
318
- p_id: string;
319
- };
320
- Returns: undefined;
321
- };
322
- }
323
- /** The name of any demanded RPC — the only strings the dataSource port accepts. */
324
- type DemandedRpcName = keyof DemandedRpcSignatures;
325
-
326
- /**
327
- * EVERY registered entity token (the FK-valid set). Use this for any
328
- * `source_type` / `target_type` argument so an invalid token is a COMPILE error.
329
- */
330
- type EntityTypeToken = "access_request" | "activity" | "agent" | "agent_card" | "agent_definition_version" | "agent_drift_alert" | "agent_exemplar" | "agent_mandate_note" | "agent_prompt_remediation" | "agent_run" | "agent_run_stage" | "agent_shortcut" | "agent_surface_binding" | "agent_template" | "agent_usage" | "ai_api" | "ai_endpoint" | "ai_model" | "ai_model_alias" | "ai_offering" | "ai_provider" | "ai_setting" | "app" | "app_definition_version" | "app_error" | "app_execution" | "app_instance" | "app_log" | "app_rate_limit" | "app_setting" | "app_sync_status" | "approach" | "artifact" | "assessment" | "assessment_item" | "assessment_result" | "assist" | "batch_cost_event" | "batch_provider_batch" | "batch_work_item" | "browser_account_binding" | "browser_action_event" | "browser_authenticator_window" | "browser_capture" | "browser_control_request" | "browser_handoff" | "browser_login_attempt" | "browser_login_recipe" | "browser_profile" | "browser_profile_checkpoint" | "browser_run" | "browser_site_observation" | "browser_site_policy" | "browser_stream_ticket" | "canvas_comment" | "canvas_comment_like" | "canvas_item" | "canvas_item_state" | "canvas_like" | "canvas_score" | "canvas_view" | "category" | "cmp_entry" | "cmp_feedback" | "code_file" | "code_folder" | "code_repository" | "coding_session" | "coding_session_entry" | "comment" | "commerce_asset_allocation" | "commerce_asset_grading" | "commerce_asset_identifier" | "commerce_asset_lot_event" | "commerce_asset_mandate_result" | "commerce_asset_price_factor" | "commerce_asset_reshoot_request" | "commerce_asset_review" | "commerce_asset_unknown" | "commerce_cloud_sync_connection" | "commerce_ebay_business_policy" | "commerce_ebay_category" | "commerce_ebay_category_aspect" | "commerce_ebay_category_tree" | "commerce_ebay_custom_policy" | "commerce_ebay_inventory_item" | "commerce_ebay_inventory_item_group" | "commerce_ebay_inventory_item_group_member" | "commerce_ebay_inventory_location" | "commerce_ebay_listing" | "commerce_ebay_marketplace_policy" | "commerce_ebay_media_asset" | "commerce_ebay_notification_destination" | "commerce_ebay_notification_event" | "commerce_ebay_notification_subscription" | "commerce_ebay_notification_topic" | "commerce_ebay_offer" | "commerce_ebay_order" | "commerce_ebay_order_line_item" | "commerce_ebay_shipping_fulfillment" | "commerce_ebay_store_category" | "commerce_human_correction" | "commerce_intake_artifact" | "commerce_intake_asset" | "commerce_intake_batch" | "commerce_label_batch" | "commerce_label_code" | "commerce_marketplace_account" | "commerce_marketplace_account_deletion_audit" | "commerce_marketplace_api_call" | "commerce_marketplace_rate_budget" | "commerce_marketplace_site" | "commerce_marketplace_sync_run" | "commerce_prediction_outcome" | "commerce_product" | "commerce_product_channel_ref" | "commerce_product_media" | "commerce_product_variant" | "commerce_recall_audit" | "comparison_set" | "contact_medium" | "contact_submission" | "content_ir_kind" | "content_ir_kind_component" | "content_ir_kind_component_incident" | "content_ir_kind_conformance" | "content_ir_kind_edge" | "content_ir_kind_example" | "content_ir_kind_instance" | "content_ir_kind_surface" | "context_item" | "context_item_suggestion" | "conversation" | "conversation_value" | "crm_address" | "crm_affiliation" | "crm_blocklist_entry" | "crm_contact_candidate" | "crm_deal" | "crm_deal_stage_event" | "crm_enrichment_call" | "crm_interaction" | "crm_merge_candidate" | "crm_outreach_list" | "crm_outreach_list_member" | "crm_party_merge" | "crm_registry_ingest_run" | "crm_registry_source" | "crm_saved_view" | "crm_sending_event" | "crm_sending_identity" | "crm_sending_identity_check" | "crm_sending_policy" | "custom_entity_definition" | "custom_field_definition" | "custom_field_target" | "custom_record" | "cx_agent_memory" | "cx_agent_plan" | "cx_agent_task" | "cx_code_edit" | "cx_code_message_file" | "cx_media" | "cx_observational_memory" | "cx_observational_memory_event" | "cx_pending_injection" | "cx_request" | "cx_request_snapshot" | "cx_tool_trace" | "cx_user_request" | "cx_user_todo" | "data_store" | "dataset" | "derive_run" | "dict_setting" | "dm_conversation" | "dm_message" | "dm_participant" | "domain_classification" | "esign_campaign" | "esign_campaign_member" | "esign_consent_disclosure" | "esign_envelope" | "esign_envelope_certificate" | "esign_envelope_document" | "esign_envelope_event" | "esign_envelope_external_ref" | "esign_envelope_signer" | "esign_provider" | "esign_provider_binding" | "esign_signing_key" | "fc_card" | "fc_detail" | "fc_set" | "feature_doc" | "file" | "file_analysis" | "file_entities" | "file_overrides" | "file_page_annotations" | "file_pages" | "file_version" | "flexible_data" | "folder" | "game_badge" | "game_result" | "game_room" | "global_execution" | "global_execution_checkpoint" | "global_execution_event" | "global_meter_entry" | "global_origin" | "global_request" | "growth_loop_event" | "growth_loop_run" | "growth_loop_stage_run" | "guided_checklist_run" | "heatmap_save" | "hindsight_enrollment" | "hindsight_finding" | "hindsight_regression_case" | "hindsight_replay" | "hindsight_replay_step" | "hindsight_review" | "hr_access_audit" | "hr_access_role" | "hr_accommodation_request" | "hr_ai_evidence" | "hr_alert_routing_rule" | "hr_application" | "hr_approval_authority" | "hr_approval_delegation" | "hr_asset" | "hr_asset_assignment" | "hr_attendance_exception" | "hr_auto_close_rule" | "hr_availability" | "hr_background_check" | "hr_benefits_event" | "hr_calculation_snapshot" | "hr_candidate" | "hr_candidate_conversion" | "hr_candidate_message" | "hr_careers_portal" | "hr_checklist_item" | "hr_checklist_run" | "hr_checklist_template" | "hr_checklist_template_item" | "hr_compensation" | "hr_corrective_action" | "hr_course" | "hr_course_version" | "hr_credential" | "hr_crew" | "hr_deduction_code" | "hr_department" | "hr_derived_grant" | "hr_disposition_event" | "hr_earning_code" | "hr_eeo_response" | "hr_emergency_contact" | "hr_employee" | "hr_employee_private" | "hr_employer_profile" | "hr_employment" | "hr_employment_pin" | "hr_engagement" | "hr_establishment" | "hr_external_identity" | "hr_field_policy" | "hr_holiday" | "hr_holiday_calendar" | "hr_i9" | "hr_i9_document" | "hr_incident" | "hr_incident_party" | "hr_interview" | "hr_interview_kit" | "hr_job_title" | "hr_jurisdiction" | "hr_jurisdiction_rule" | "hr_jurisdiction_rule_class" | "hr_jurisdiction_rule_org_decision" | "hr_jurisdiction_rule_test" | "hr_kiosk_device" | "hr_kiosk_session" | "hr_labor_target" | "hr_leave_case" | "hr_leave_enrollment" | "hr_leave_ledger" | "hr_leave_policy" | "hr_leave_request" | "hr_legal_hold" | "hr_legal_hold_item" | "hr_location" | "hr_new_hire_report" | "hr_offer" | "hr_opening" | "hr_overtime_alert" | "hr_overtime_alert_rule" | "hr_overtime_preapproval" | "hr_pay_group" | "hr_pay_period" | "hr_pay_period_employment" | "hr_payroll_export" | "hr_payroll_export_line" | "hr_position_assignment" | "hr_posting" | "hr_posting_publication" | "hr_provider_binding" | "hr_provider_event" | "hr_provisioning_result" | "hr_punch" | "hr_recalculation_batch" | "hr_record_class" | "hr_records_request" | "hr_reference_check" | "hr_reporting_line" | "hr_requisition" | "hr_restricted_note" | "hr_retention_rule" | "hr_role_assignment" | "hr_schedule" | "hr_schedule_change" | "hr_schedule_guidance" | "hr_schedule_template" | "hr_schedule_template_shift" | "hr_scorecard" | "hr_separation" | "hr_shift" | "hr_shift_claim" | "hr_staffing_requirement" | "hr_survey" | "hr_survey_invitation" | "hr_survey_question" | "hr_survey_response" | "hr_tax_registration" | "hr_tax_withholding" | "hr_time_adjustment" | "hr_training_assignment" | "hr_training_attempt" | "hr_transcript_entry" | "hr_verification_letter_request" | "hr_work_interval" | "hr_workflow_binding" | "hr_workflow_decision" | "hr_workflow_definition" | "hr_workflow_event" | "hr_workflow_failure" | "hr_workflow_flow_type" | "hr_workflow_instance" | "hr_workflow_step" | "hr_workflow_step_definition" | "hr_workweek" | "iam_api_key" | "industry_curator" | "interview_document_revision" | "interview_hole" | "interview_question" | "interview_session" | "interview_turn" | "invitation" | "invitation_code" | "invitation_request" | "item_mastery" | "judge_verdict" | "kg_alert" | "kg_suggestion_ack" | "kg_sweep_queue" | "kg_sweep_run" | "kg_sweep_state" | "kg_value_match" | "league_membership" | "learn_doc" | "library_doc" | "mandate" | "mandate_binding" | "mandate_treatment" | "marketing_initiative" | "masterwork_corpus_item" | "masterwork_run" | "membership" | "message" | "message_template" | "ner_shadow" | "note" | "note_folder" | "notification" | "notification_channel_preference" | "notification_event_override" | "notification_event_type" | "notification_preference" | "ops_issue_event" | "ops_proof_check" | "ops_proof_run" | "ops_proof_scenario" | "organization" | "output_feedback" | "page_extraction_job" | "page_extraction_page_run" | "party" | "party_contact_point" | "pc_article" | "pc_episode" | "pc_show" | "pc_studio_run" | "pc_studio_run_asset" | "pdf_redaction_audit" | "plan_cms_fill_item" | "plan_cms_fill_job" | "plan_entity" | "plan_node" | "plan_node_artifact" | "plan_node_step" | "plan_profile" | "platform_actor_session" | "platform_actor_token" | "platform_actor_token_event" | "platform_continued_access" | "platform_outcome_event" | "platform_outsider_consumer" | "platform_saved_view" | "podcast_race" | "processed_document" | "processed_document_page" | "product_capture_file" | "product_capture_item" | "product_capture_payload" | "product_capture_product" | "product_capture_question" | "project" | "provision" | "purpose" | "quiz_session" | "rag_ingest_run" | "redaction_mapping" | "research_analysis" | "research_content" | "research_context_bundle" | "research_document" | "research_keyword" | "research_media" | "research_source" | "research_synthesis" | "research_tag" | "research_template" | "research_topic" | "route_manifest_entry" | "rulebook" | "sandbox_instance" | "sch_agent_task" | "sch_run" | "sch_task" | "sch_trigger" | "scope" | "scope_association_suggestion" | "scope_item_value_suggestion" | "scope_suggestion" | "scope_type" | "seo_ai_visibility_citation" | "seo_ai_visibility_claim" | "seo_ai_visibility_panel" | "seo_ai_visibility_response" | "seo_ai_visibility_signal" | "seo_backlink" | "seo_backlink_change_event" | "seo_backlink_dimension_snapshot" | "seo_backlink_observation" | "seo_backlink_snapshot" | "seo_change_assessment" | "seo_change_event" | "seo_change_item" | "seo_change_metric" | "seo_change_set" | "seo_change_theory" | "seo_collection_run" | "seo_competitor" | "seo_competitor_observation" | "seo_competitor_opportunity" | "seo_coverage_mention" | "seo_coverage_tracker" | "seo_dimension_value_matcher" | "seo_engine_schedule" | "seo_geo_place" | "seo_gsc_dig_rule" | "seo_keyword" | "seo_keyword_class_rule" | "seo_keyword_edge" | "seo_keyword_facet" | "seo_keyword_market" | "seo_keyword_market_observation" | "seo_keyword_place" | "seo_keyword_saved_view" | "seo_keyword_topic" | "seo_landscape_brief" | "seo_link_gap_domain" | "seo_link_gap_match" | "seo_page_measurement_health" | "seo_page_performance" | "seo_provider_call" | "seo_provider_task" | "seo_rank_observation" | "seo_rank_target" | "seo_raw_payload" | "seo_referring_domain_profile" | "seo_reputation_case" | "seo_search_performance_daily" | "seo_serp_mention" | "seo_serp_opportunity" | "seo_serp_result" | "seo_serp_snapshot" | "seo_site_geo_area" | "seo_site_keyword_offering" | "seo_site_keyword_value" | "seo_site_offering_value" | "seo_site_topic_value" | "seo_site_value_combo" | "seo_site_value_worth" | "seo_site_vocabulary" | "seo_source_request" | "seo_starter_pack" | "seo_starter_pack_item" | "seo_story_angle" | "seo_topic" | "seo_web_analytics_daily" | "shared_canvas_item" | "short_link" | "skill" | "skill_render_definition" | "sms_consent" | "sms_conversation" | "sms_message" | "sms_message_media" | "sms_notification" | "sms_notification_preference" | "sms_phone_number" | "structured_list" | "studio_documents" | "studio_recording_chunks" | "studio_recording_segments" | "studio_run" | "studio_session" | "studio_session_settings" | "study_attempt" | "study_goal" | "study_media" | "study_plan" | "study_plan_block" | "study_plan_day" | "study_reminder_context" | "study_reminder_delivery" | "study_session" | "surface" | "system_context_item" | "system_error" | "system_personal_org_failure" | "system_write_failure" | "task" | "thread" | "tool" | "tool_bundle" | "tool_call" | "tool_definition_version" | "tool_test_sample" | "tool_ui" | "tool_ui_incident" | "tool_ui_version" | "transcript" | "udt_dataset_fields" | "udt_dataset_rows" | "udt_document" | "udt_structured_list_items" | "ui_surface_agent_pref" | "ui_surface_config" | "user_achievement" | "user_analysis_preference" | "user_bookmark" | "user_email_preference" | "user_feedback" | "user_form_profile" | "user_markdown_sample" | "user_memory" | "user_preference" | "user_profile" | "user_stat" | "user_surface_state" | "voice" | "war_room" | "wbx_capture" | "wbx_guidance" | "wbx_highlight" | "wbx_pattern" | "wbx_screenshot" | "wbx_seo_audit" | "wc_claim" | "wc_impairment_definition" | "wc_injury" | "wc_report" | "web_analysis_item" | "web_brand" | "web_brand_asset" | "web_brand_offering" | "web_business_fact" | "web_business_location" | "web_crawl_event" | "web_crawl_preset" | "web_crawl_schedule" | "web_crawl_session" | "web_crawl_url" | "web_discovered_item" | "web_finding" | "web_gsc_page_stat" | "web_link_edge" | "web_listing_publisher" | "web_location_listing" | "web_offering_template" | "web_page" | "web_page_content" | "web_page_evidence" | "web_page_sitemap" | "web_property" | "web_provider" | "web_result" | "web_screenshot" | "web_site" | "web_site_endpoint_rule" | "web_site_item_config" | "web_site_offering" | "web_sitemap" | "web_snapshot" | "wf_node_data_slot" | "work_item" | "workbook" | "workflow" | "workflow_card" | "workflow_checkpoint" | "workflow_comparison" | "workflow_definition_version" | "workflow_idempotency" | "workflow_job" | "workflow_node_events" | "workflow_node_outcome" | "workflow_plan" | "workflow_plan_event" | "workflow_plan_sample" | "workflow_recovery_audit" | "workflow_run" | "workflow_run_log" | "workflow_runtime_surface" | "workflow_template" | "workflow_trigger" | "workflow_trigger_fire" | "working_document" | "youtube_search" | "youtube_video";
331
-
332
- type AssociationsRpcErrorCode = "unauthorized" | "forbidden_org" | "forbidden_role" | "not_found" | "conflict_in_use" | "invalid_argument" | "version_conflict" | "quota_exceeded"
333
- /**
334
- * THE DEMANDED-SCHEMA SCREAM. A PostgREST missing-function error (PGRST202)
335
- * on any demanded RPC maps to this code: the database this client is
336
- * pointed at does not run the schema this package demands (README front
337
- * door). It always reaches the errorSink — one unambiguous scream, never a
338
- * mystery toast. Probe it at boot with `assertDemandedSchema` (/core, W2).
339
- */
340
- | "demanded_schema_violation" | "internal";
341
- interface AssociationsRpcError {
342
- code: AssociationsRpcErrorCode;
343
- message: string;
344
- hint?: string;
345
- detail?: unknown;
346
- }
347
- type AssociationsRpcResult<T> = {
348
- ok: true;
349
- data: T;
350
- } | {
351
- ok: false;
352
- error: AssociationsRpcError;
353
- };
354
- /**
355
- * The structural shape of a PostgREST failure as supabase-js resolves it: a
356
- * PLAIN OBJECT parsed from the response body — NOT an `Error` instance.
357
- * (Reading `.message` off `instanceof Error` discards the real database
358
- * message on every genuine failure; `/core`'s mapper reads these fields.)
359
- */
360
- interface PgError {
361
- code?: string | null;
362
- message: string;
363
- details?: string | null;
364
- hint?: string | null;
365
- }
366
-
367
- /**
368
- * The minimal table surface entity-row create/rename needs (a structural
369
- * subset of supabase-js's query builder). Registry-convention writes go
370
- * DIRECT to the backing table (they are RLS-gated feature rows, not
371
- * association edges — there is no RPC for them by design).
372
- */
373
- interface AssociationsTableQuery {
374
- insert(row: Record<string, unknown>): {
375
- select(columns: string): {
376
- single(): PromiseLike<{
377
- data: unknown;
378
- error: PgError | null;
379
- }>;
380
- };
381
- };
382
- update(patch: Record<string, unknown>): {
383
- eq(column: string, value: string): PromiseLike<{
384
- error: PgError | null;
385
- }>;
386
- };
387
- }
388
- /**
389
- * The data seam — a structural subset of `SupabaseClient<Database>`: any
390
- * client that can answer the demanded RPC families (README § The demanded
391
- * schema). The package IS data operations; there is no degraded mode without
392
- * one. `PromiseLike` because supabase-js returns a thenable builder, not a
393
- * `Promise`.
394
- *
395
- * `from`/`schema` are OPTIONAL (W2, additive): only the entity-row
396
- * create/rename service uses them (generic registry-convention row writes).
397
- * A dataSource without them still satisfies every RPC operation; calling
398
- * entity-row create/rename against it returns a screamed `{ok:false}`
399
- * result naming the missing capability — never a silent no-op. A real
400
- * supabase-js client satisfies both structurally.
401
- */
402
- interface AssociationsDataSource {
403
- rpc(fn: DemandedRpcName, args: Record<string, unknown>): PromiseLike<{
404
- data: unknown;
405
- error: PgError | null;
406
- }>;
407
- from?(table: string): AssociationsTableQuery;
408
- schema?(name: string): {
409
- from(table: string): AssociationsTableQuery;
410
- };
411
- }
412
- /**
413
- * The identity seam — today a store-singleton read (`requireUserId`) plus the
414
- * org resolver `CategoryTagPicker` uses for created rows. `requireUserId`
415
- * failures stay LOUD (`Not authenticated`) — never silently anonymous.
416
- */
417
- interface AssociationsIdentity {
418
- requireUserId(): string;
419
- /** Org for created rows/edges (the CategoryTagPicker create path). */
420
- ensureOrgId?(): Promise<string>;
421
- }
422
- /**
423
- * The scream seam — REQUIRED: recovery layers must scream somewhere. Every
424
- * degraded path, every `demanded_schema_violation`, every create-then-attach
425
- * partial failure reports here regardless of notifier availability.
426
- */
427
- type ErrorSink = (event: {
428
- code: string;
429
- message: string;
430
- context?: object;
431
- }) => void;
432
- /**
433
- * Per-token host overlay — the code-native values the DB registry cannot
434
- * carry (today: the 804-line ENTITY_OVERLAY literal in matrx-frontend's
435
- * entityRegistry). EVERY field optional; absence degrades per field:
436
- * convention columns, default icon, `${label}s`, no door, generic
437
- * titleColumn candidate read. A `reference_pickable` token with no title
438
- * column and no override is screamed to the errorSink, never shown broken.
439
- */
440
- interface EntityOverlayEntry {
441
- /** Icon component (host-supplied; packages never depend on an icon library). */
442
- Icon?: ElementType;
443
- /** Plural label; default `${label}s`. */
444
- labelPlural?: string;
445
- /** Owner column override; default the "created_by" convention. */
446
- ownerColumn?: string | null;
447
- /** Org column override; default the "organization_id" convention. */
448
- orgColumn?: string | null;
449
- /** Route for this token's rows; absent → no open door (label renders plain). */
450
- hrefFor?: (id: string) => string;
451
- /**
452
- * Candidate-list override for tokens whose backing table can't be read
453
- * client-side (e.g. `data_store` — rag.* is not PostgREST-exposed);
454
- * absent → the generic `reference_search_candidates` titleColumn read.
455
- */
456
- listCandidates?: (args: {
457
- search?: string;
458
- limit?: number;
459
- }) => Promise<{
460
- ok: true;
461
- data: {
462
- id: string;
463
- title: string;
464
- }[];
465
- } | {
466
- ok: false;
467
- error: string;
468
- }>;
469
- }
470
- /** The overlay registration map — bound per host, merged over the generated registry. */
471
- type EntityOverlayMap = Partial<Record<EntityTypeToken, EntityOverlayEntry>>;
472
- /**
473
- * The user-notification seam (today: `@/lib/toast` in 6 components).
474
- * Optional — /react warns once when absent. Every user-facing failure ALSO
475
- * routes to the errorSink + the component's inline error state, so the
476
- * create-then-associate loud-outcome law is satisfied structurally, not by
477
- * toast availability.
478
- */
479
- interface AssociationsNotifier {
480
- success(msg: string): void;
481
- error(msg: string, opts?: {
482
- description?: string;
483
- action?: {
484
- label: string;
485
- onClick(): void;
486
- };
487
- }): void;
488
- }
489
- /**
490
- * The draggable-window seam (today: `WindowPanel` in AssociationWindow).
491
- * Absent → the package's internal fixed overlay (non-draggable); behavior
492
- * identical, chrome plainer.
493
- */
494
- interface WindowShellPort {
495
- Window: ComponentType<{
496
- id: string;
497
- title: string;
498
- onClose(): void;
499
- children: ReactNode;
500
- }>;
501
- }
502
- /** Options for {@link CapturePort.requestUpload} (measured: uploadGuardOpeners). */
503
- interface CaptureUploadOpts {
504
- files: File[];
505
- /** Logical cloud-files folder new uploads land in (auto-created). */
506
- folderPath: string;
507
- /** Visibility stamped on uploads (host vocabulary, e.g. "personal"). */
508
- visibility?: string;
509
- }
510
- /** Honest outcome of a host upload — created-but-unlinked must be reportable. */
511
- interface CaptureUploadResult {
512
- cancelled?: boolean;
513
- uploaded: string[];
514
- aliased: {
515
- existingFileId: string;
516
- }[];
517
- failed: {
518
- name: string;
519
- error: string;
520
- }[];
521
- }
522
- /** Options for {@link CapturePort.openFilePicker} (measured: cloudFilesPickerOpeners). */
523
- interface CapturePickOpts {
524
- multi?: boolean;
525
- title?: string;
526
- description?: string;
527
- }
528
- /**
529
- * The capture-toolbar seam (today: features/files upload + pickers and
530
- * features/data-tables imports in AssociationCaptureToolbar). PER-HANDLER
531
- * optional: the toolbar renders only the chips whose handler exists; zero
532
- * handlers → the toolbar renders nothing. NEVER dead buttons.
533
- */
534
- interface CapturePort {
535
- requestUpload?(opts: CaptureUploadOpts): Promise<CaptureUploadResult>;
536
- /** Resolves with picked file ids, or null/empty on cancel. */
537
- openFilePicker?(opts: CapturePickOpts): Promise<string[] | null>;
538
- createDataTable?(opts: {
539
- name: string;
540
- }): Promise<{
541
- id: string;
542
- } | null>;
543
- }
544
- /**
545
- * Props of the generic association picker face — ALSO the contract a
546
- * per-token override component must implement (today: the hardcoded
547
- * `token === "file"` → FilePickerWindow branch in AssociationPicker becomes a
548
- * `registerPickerOverride("file", …)` host binding). Ported verbatim from the
549
- * measured component.
550
- */
551
- interface AssociationPickerProps {
552
- open: boolean;
553
- onOpenChange: (open: boolean) => void;
554
- token: EntityTypeToken;
555
- /** Container display label, for the header ("…to Titanium Marketing"). */
556
- containerLabel?: string;
557
- /** Org stamped onto rows created by the "+ New" footer. */
558
- orgId?: string | null;
559
- /** Resource ids already attached to the container. */
560
- attachedIds: Set<string>;
561
- /** Attach a resource (returns ok/err so the row can surface failures). */
562
- onAttach: (resourceId: string, title: string) => Promise<{
563
- ok: boolean;
564
- error?: string;
565
- }>;
566
- /** Detach a resource. */
567
- onDetach: (resourceId: string) => Promise<{
568
- ok: boolean;
569
- error?: string;
570
- }>;
571
- }
572
- /** Per-token picker override map — absent tokens use the generic picker sheet. */
573
- type PickerOverrideMap = Partial<Record<EntityTypeToken, ComponentType<AssociationPickerProps>>>;
574
- /**
575
- * Props the entity-doors port's `EntityRef` receives (the measured subset the
576
- * association faces pass today).
577
- */
578
- interface EntityRefProps {
579
- token: string;
580
- id: string;
581
- name?: string | null;
582
- showIcon?: boolean;
583
- openInNewTab?: boolean;
584
- alwaysShowActions?: boolean;
585
- className?: string;
586
- }
587
- /** Props the entity-doors port's `DoorControls` receives. */
588
- interface EntityDoorProps {
589
- token: string;
590
- id: string;
591
- name?: string | null;
592
- className?: string;
593
- }
594
- /** What the authorDisplay port receives — one comment's denormalized author. */
595
- interface AuthorDisplayInput {
596
- /** The auth user id (`created_by`), or null on an authorless legacy row. */
597
- userId: string | null;
598
- email: string | null;
599
- displayName: string | null;
600
- avatarUrl: string | null;
601
- }
602
- /**
603
- * The author-display seam (W6 comments UI). The package cannot resolve user
604
- * profiles itself — `cmt_list` denormalizes email/displayName/avatarUrl per
605
- * row, and a host with a richer profile store (presence, current names,
606
- * signed avatar URLs) overrides them here. Return `null` (or omit a field)
607
- * to keep the denormalized value.
608
- *
609
- * DEGRADATION (absent port): the RPC's denormalized fields render as-is;
610
- * a row with neither displayName nor email shows the package's
611
- * "Unknown user" label with the default initial avatar. Never blank, never
612
- * a crash.
613
- */
614
- type AuthorDisplayPort = (author: AuthorDisplayInput) => {
615
- displayName?: string | null;
616
- avatarUrl?: string | null;
617
- } | null;
618
- /**
619
- * The entity-doors seam (today: `EntityRef` / `EntityDoorControls` /
620
- * access-gate `UnresolvedEntityRef`). Absent → title text plus the overlay's
621
- * `hrefFor` link when present; unresolved rows render the package's plain
622
- * "unavailable" chip.
623
- */
624
- interface EntityDoorsPort {
625
- EntityRef?: ComponentType<EntityRefProps>;
626
- DoorControls?: ComponentType<EntityDoorProps>;
627
- UnresolvedRef?: ComponentType<{
628
- token: string;
629
- id: string;
630
- }>;
631
- }
632
- /**
633
- * Everything a host binds, once. `createAssociationsStore(cfg)` (/core, W2)
634
- * throws when a REQUIRED port is missing; every optional port degrades per
635
- * its own documented contract, never silently.
636
- */
637
- interface AssociationsConfig {
638
- dataSource: AssociationsDataSource;
639
- identity: AssociationsIdentity;
640
- errorSink: ErrorSink;
641
- entityOverlay?: EntityOverlayMap;
642
- notifier?: AssociationsNotifier;
643
- windowShell?: WindowShellPort;
644
- capture?: CapturePort;
645
- pickerOverrides?: PickerOverrideMap;
646
- entityDoors?: EntityDoorsPort;
647
- authorDisplay?: AuthorDisplayPort;
648
- }
649
-
650
- declare const ASSOCIATION_TARGET_TYPES: readonly ["organization", "scope", "scope_type", "project", "task", "context_item", "thread", "war_room", "category", "conversation", "fc_set", "fc_card", "study_media", "assessment", "note", "file", "quiz_session", "agent", "research_tag", "skill", "surface", "plan_entity", "plan_node", "web_site", "seo_topic", "seo_keyword", "web_page", "web_screenshot", "party", "crm_outreach_list", "crm_deal", "rulebook"];
651
- type AssociationTargetType = (typeof ASSOCIATION_TARGET_TYPES)[number];
652
- interface AssociationEdge {
653
- id: string;
654
- direction: "outgoing" | "incoming";
655
- otherType: string;
656
- otherId: string;
657
- role: string | null;
658
- label: string | null;
659
- position: number | null;
660
- metadata: unknown;
661
- orgId: string | null;
662
- createdAt: string;
663
- }
664
- interface AssociationTargetEdge {
665
- id: string;
666
- targetId: string;
667
- sourceType: string;
668
- sourceId: string;
669
- role: string | null;
670
- label: string | null;
671
- position: number | null;
672
- metadata: unknown;
673
- orgId: string | null;
674
- createdAt: string;
675
- }
676
- interface AssociationSourceEdge {
677
- id: string;
678
- sourceId: string;
679
- targetType: string;
680
- targetId: string;
681
- role: string | null;
682
- label: string | null;
683
- position: number | null;
684
- metadata: unknown;
685
- orgId: string | null;
686
- createdAt: string;
687
- }
688
- interface AssociationsEntry {
689
- status: "idle" | "loading" | "ready" | "error";
690
- edges: AssociationEdge[];
691
- fetchedAt: number | null;
692
- error: string | null;
693
- }
694
- interface UserEntityState {
695
- entityType: string;
696
- entityId: string;
697
- isFavorite: boolean;
698
- isPinned: boolean;
699
- isHidden: boolean;
700
- lastViewedAt: string | null;
701
- }
702
- /** The three boolean dimensions of per-user state, as accepted by `ues_list`. */
703
- type UserStateKind = "favorite" | "pinned" | "hidden";
704
- /**
705
- * The facet a category belongs to. Open vocabulary (new dimensions need no
706
- * migration — `dimension` is free text in the DB); hosts enumerate their
707
- * known dimensions as constants.
708
- */
709
- type CategoryDimension = string;
710
- /** One `platform.categories` row, camelCased (mirrors `cat_list`'s return). */
711
- interface PlatformCategory {
712
- id: string;
713
- /** Owning organization; system/global rows use the Matrx System org. */
714
- orgId: string | null;
715
- dimension: CategoryDimension;
716
- name: string;
717
- slug: string | null;
718
- parentId: string | null;
719
- isSystem: boolean;
720
- color: string | null;
721
- icon: string | null;
722
- position: number | null;
723
- /**
724
- * The row's jsonb metadata — category rows CARRY semantics: e.g. a
725
- * `deal_pipeline` stage stores `{outcome: "won"|"lost", probability: 0..100}`
726
- * here. Null when empty or when hydrated from an older cache entry.
727
- */
728
- metadata: Record<string, unknown> | null;
729
- }
730
- /** Cache entry for one `dimension` — mirrors `AssociationsEntry`. */
731
- interface CategoriesEntry {
732
- status: "idle" | "loading" | "ready" | "error";
733
- categories: PlatformCategory[];
734
- fetchedAt: number | null;
735
- error: string | null;
736
- }
737
-
738
- /** The author of a comment, denormalized by `cmt_list` from the auth user. */
739
- interface CommentAuthor {
740
- email: string | null;
741
- displayName: string | null;
742
- avatarUrl: string | null;
743
- }
744
- /**
745
- * One `platform.comments` row, camelCased (mirrors `cmt_list`'s return).
746
- * Threading is by `parentId`: a top-level comment has `parentId === null`;
747
- * a reply points at its parent. `cmt_list` returns rows oldest→newest so
748
- * callers can build the thread in one pass.
749
- */
750
- interface PlatformComment {
751
- id: string;
752
- orgId: string | null;
753
- entityType: string;
754
- entityId: string;
755
- parentId: string | null;
756
- body: string;
757
- createdAt: string;
758
- updatedAt: string;
759
- createdBy: string | null;
760
- author: CommentAuthor;
761
- }
762
- /**
763
- * One cached comment thread (per `${entityType}:${entityId}` endpoint) — the
764
- * same lifecycle shape as `AssociationsEntry`/`CategoriesEntry`: pending
765
- * keeps previous comments AND the visible error; `fetchedAt` is the last
766
- * successful load.
767
- */
768
- interface CommentsEntry {
769
- status: "idle" | "loading" | "ready" | "error";
770
- comments: readonly PlatformComment[];
771
- fetchedAt: number | null;
772
- error: string | null;
773
- }
774
-
775
- type ContentRole = "utility" | "source" | "destination" | "hybrid" | "container";
776
- /**
777
- * Fully-resolved entity descriptor — generated metadata + host overlay, with
778
- * safe fallbacks so an un-overlaid token still renders (derived plural, no
779
- * door, `Icon: null` → the consumer's default) even if it can't be queried
780
- * for candidates yet.
781
- */
782
- interface EntityInfo {
783
- token: EntityTypeToken;
784
- label: string;
785
- labelPlural: string;
786
- /** Postgres schema of the backing table (from the generated registry). */
787
- schema: string;
788
- /** Backing table name (from the generated registry). */
789
- table: string;
790
- /** Title column for the picker, or null when none is registered. */
791
- titleColumn: string | null;
792
- /** Ownership column to scope candidate reads to the current user. */
793
- ownerColumn: string;
794
- /** Org-scoping column. */
795
- orgColumn: string;
796
- /** Host-supplied icon component, or null (consumer renders its default). */
797
- Icon: EntityOverlayEntry["Icon"] | null;
798
- hrefFor: ((id: string) => string) | null;
799
- scopeable: boolean;
800
- category: string | null;
801
- /** Knowledge-model grouping bucket (resource surfaces group by this). */
802
- contentRole: ContentRole;
803
- /** Candidate-source override (rag-backed tokens etc.); null = generic read. */
804
- listCandidates: EntityOverlayEntry["listCandidates"] | null;
805
- /** True when a picker can list real candidates (title column OR override). */
806
- canListCandidates: boolean;
807
- }
808
- interface EntityRegistry {
809
- /** Merge more overlay entries in (host binding, W4 pickers, tests). */
810
- registerEntityOverlay(overlay: EntityOverlayMap): void;
811
- /** Resolve a KNOWN token to its full descriptor. */
812
- getEntityInfo(token: EntityTypeToken): EntityInfo;
813
- /** Safe variant for raw strings (e.g. an edge's `otherType`). */
814
- tryGetEntityInfo(token: string): EntityInfo | null;
815
- /** Resolve from a live `(schema, table)` pair, or null. */
816
- tryGetEntityInfoByTable(schema: string, table: string): EntityInfo | null;
817
- /** Resolve a raw table name only when it maps to exactly one entity. */
818
- tryGetEntityInfoByUniqueTableName(table: string): EntityInfo | null;
819
- /**
820
- * Tokens the DB classifies as knowledge resources via a valid
821
- * `content_role` AND that can list candidates. The default set for card
822
- * grids, resource sections, and attach pickers.
823
- */
824
- curatedTokens(): EntityTypeToken[];
825
- /**
826
- * Tokens offered as reference "Allowed types" — DB-driven via
827
- * `platform.entity_types.reference_pickable`. A pickable token with no
828
- * title column and no candidate override is a config defect: excluded and
829
- * screamed to the errorSink, never silently shown broken.
830
- */
831
- listableTokens(): EntityTypeToken[];
832
- }
833
-
834
- interface ConversationFileLink {
835
- fileId: string;
836
- label: string | null;
837
- metadata: unknown;
838
- createdAt: string;
839
- }
840
- interface AddAssociationArgs {
841
- sourceType: string;
842
- sourceId: string;
843
- targetType: AssociationTargetType;
844
- targetId: string;
845
- orgId?: string;
846
- label?: string;
847
- metadata?: unknown;
848
- /**
849
- * Exact file → conversation updates preserve existing metadata unless the
850
- * caller explicitly opts into replacement. Invalid for every other pair.
851
- */
852
- replaceMetadata?: boolean;
853
- role?: string;
854
- position?: number;
855
- /**
856
- * Typed edge payload (Edge Payload System). `payloadKind` must be a
857
- * registered `platform.edge_payload_kind`; the DB trigger validates
858
- * `payload` against its JSON Schema and hard-fails on any mismatch. Real
859
- * logic an edge carries goes HERE — `metadata` is for loose annotations.
860
- */
861
- payloadKind?: string;
862
- payload?: unknown;
863
- }
864
- interface AssociationsServiceApi {
865
- listForEntity(rawType: string, id: string): Promise<AssociationsRpcResult<{
866
- edges: AssociationEdge[];
867
- }>>;
868
- listConversationFiles(conversationId: string): Promise<AssociationsRpcResult<{
869
- files: ConversationFileLink[];
870
- }>>;
871
- listForTargets(rawTargetType: string, targetIds: string[]): Promise<AssociationsRpcResult<{
872
- edges: AssociationTargetEdge[];
873
- }>>;
874
- listForTargetsVisible(rawTargetType: string, targetIds: string[]): Promise<AssociationsRpcResult<{
875
- edges: AssociationTargetEdge[];
876
- }>>;
877
- listForSources(rawSourceType: string, sourceIds: string[], rawTargetType?: string): Promise<AssociationsRpcResult<{
878
- edges: AssociationSourceEdge[];
879
- }>>;
880
- add(args: AddAssociationArgs): Promise<AssociationsRpcResult<{
881
- id: string;
882
- }>>;
883
- remove(args: {
884
- sourceType: string;
885
- sourceId: string;
886
- targetType: string;
887
- targetId: string;
888
- role?: string;
889
- }): Promise<AssociationsRpcResult<null>>;
890
- setTargets(args: {
891
- sourceType: string;
892
- sourceId: string;
893
- targetType: AssociationTargetType;
894
- targetIds: string[];
895
- orgId?: string;
896
- role?: string;
897
- }): Promise<AssociationsRpcResult<null>>;
898
- addAgentResource(args: {
899
- agentId: string;
900
- sourceType: string;
901
- sourceId: string;
902
- label?: string;
903
- metadata?: unknown;
904
- }): Promise<AssociationsRpcResult<{
905
- id: string;
906
- }>>;
907
- removeAgentResource(args: {
908
- agentId: string;
909
- sourceType: string;
910
- sourceId: string;
911
- }): Promise<AssociationsRpcResult<null>>;
912
- removeForEntity(rawType: string, id: string): Promise<AssociationsRpcResult<null>>;
913
- }
914
-
915
- interface CategoriesServiceApi {
916
- list(dimension?: CategoryDimension): Promise<AssociationsRpcResult<{
917
- categories: PlatformCategory[];
918
- }>>;
919
- create(args: {
920
- dimension: CategoryDimension;
921
- name: string;
922
- orgId: string;
923
- parentId?: string | null;
924
- color?: string | null;
925
- icon?: string | null;
926
- slug?: string | null;
927
- }): Promise<AssociationsRpcResult<{
928
- id: string;
929
- }>>;
930
- update(args: {
931
- id: string;
932
- name: string;
933
- slug: string | null;
934
- color: string | null;
935
- icon: string | null;
936
- position: number | null;
937
- }): Promise<AssociationsRpcResult<{
938
- id: string;
939
- }>>;
940
- reparent(args: {
941
- id: string;
942
- parentId: string | null;
943
- }): Promise<AssociationsRpcResult<{
944
- id: string;
945
- }>>;
946
- delete(id: string): Promise<AssociationsRpcResult<{
947
- id: string;
948
- }>>;
949
- }
950
-
951
- interface FavoritesServiceApi {
952
- setState(args: {
953
- entityType: string;
954
- entityId: string;
955
- isFavorite?: boolean;
956
- isPinned?: boolean;
957
- isHidden?: boolean;
958
- }): Promise<AssociationsRpcResult<null>>;
959
- setFavorite(entityType: string, entityId: string, isFavorite: boolean): Promise<AssociationsRpcResult<null>>;
960
- setPinned(entityType: string, entityId: string, isPinned: boolean): Promise<AssociationsRpcResult<null>>;
961
- setHidden(entityType: string, entityId: string, isHidden: boolean): Promise<AssociationsRpcResult<null>>;
962
- list(kind?: UserStateKind): Promise<AssociationsRpcResult<{
963
- items: UserEntityState[];
964
- }>>;
965
- getBulk(entityType: string, entityIds: string[]): Promise<AssociationsRpcResult<{
966
- items: UserEntityState[];
967
- }>>;
968
- touch(entityType: string, entityId: string): Promise<AssociationsRpcResult<null>>;
969
- }
970
-
971
- interface CandidateRecord {
972
- id: string;
973
- title: string;
974
- }
975
- interface ListCandidatesArgs {
976
- token: EntityTypeToken;
977
- /** Scope to this owner's rows when the entity declares an owner column. */
978
- ownerId?: string | null;
979
- /** Case-insensitive title filter. */
980
- search?: string;
981
- limit?: number;
982
- }
983
- type CandidatesResult = {
984
- ok: true;
985
- data: CandidateRecord[];
986
- } | {
987
- ok: false;
988
- error: string;
989
- };
990
- interface UniversalCandidate extends CandidateRecord {
991
- token: EntityTypeToken;
992
- }
993
- interface SearchAcrossTokensArgs {
994
- /** Tokens to search. Defaults to every curated token in the registry. */
995
- tokens?: EntityTypeToken[];
996
- search: string;
997
- ownerId?: string | null;
998
- /** Cap per token — a universal search shows a few of everything. */
999
- perTokenLimit?: number;
1000
- /** Max in-flight token queries. */
1001
- concurrency?: number;
1002
- }
1003
- interface ReferenceSearchCandidatesFn {
1004
- (args: {
1005
- p_token: string;
1006
- p_search?: string;
1007
- p_limit?: number;
1008
- p_ids?: string[];
1009
- }): Promise<{
1010
- data: Array<{
1011
- id: string;
1012
- title: string | null;
1013
- }>;
1014
- error: null;
1015
- } | {
1016
- data: null;
1017
- error: {
1018
- message: string;
1019
- };
1020
- }>;
1021
- }
1022
- interface CandidatesServiceApi {
1023
- /**
1024
- * The universal candidate reader RPC (`public.reference_search_candidates`)
1025
- * — shared by candidate search here and title resolution in titles.ts.
1026
- */
1027
- callReferenceSearchCandidates: ReferenceSearchCandidatesFn;
1028
- listAssociationCandidates(args: ListCandidatesArgs): Promise<CandidatesResult>;
1029
- /**
1030
- * ONE search over EVERY listable entity type — the "attach anything from
1031
- * anywhere" primitive. Registry-driven client fan-out, capped and
1032
- * concurrency-limited. Per-token failures are screamed and skipped — one
1033
- * broken table never blanks the search.
1034
- */
1035
- searchCandidatesAcrossTokens(args: SearchAcrossTokensArgs): Promise<UniversalCandidate[]>;
1036
- }
1037
-
1038
- interface TitlesServiceApi {
1039
- /** Read the cache synchronously (for render paths after a fetch settled). */
1040
- get(token: string, id: string): string | null;
1041
- /**
1042
- * Push a known-fresh title into the cache (after a rename or a create), so
1043
- * surfaces that resolve through this service never show a stale name.
1044
- */
1045
- prime(token: string, id: string, title: string): void;
1046
- /** Display fallback when no label and no fetched title exist. */
1047
- fallback(token: string): string;
1048
- /**
1049
- * Resolve titles for `ids` of one token. Returns ONLY the resolved entries
1050
- * (cache + fresh reads); missing rows (deleted, no access) stay absent.
1051
- */
1052
- fetch(token: string, ids: string[]): Promise<Map<string, string>>;
1053
- }
1054
-
1055
- type EntityRowResult = {
1056
- ok: true;
1057
- data: {
1058
- id: string;
1059
- title: string;
1060
- };
1061
- } | {
1062
- ok: false;
1063
- error: string;
1064
- };
1065
- interface CreateEntityRowArgs {
1066
- /** The new row's human name — written to the registry `titleColumn`. */
1067
- title: string;
1068
- /** Org to stamp (skipped when the token has no org column). */
1069
- orgId?: string | null;
1070
- /** Required NOT NULL columns the registry conventions can't know about. */
1071
- extraColumns?: Record<string, unknown>;
1072
- }
1073
- interface EntityRowsServiceApi {
1074
- createEntityRow(token: EntityTypeToken, args: CreateEntityRowArgs): Promise<EntityRowResult>;
1075
- renameEntityRow(token: EntityTypeToken, id: string, title: string): Promise<{
1076
- ok: true;
1077
- } | {
1078
- ok: false;
1079
- error: string;
1080
- }>;
1081
- }
1082
-
1083
- /** A typed reference to a single row — `{ type, id }`. */
1084
- interface EntityRef {
1085
- type: EntityTypeToken;
1086
- id: string;
1087
- }
1088
- /** A container reference — the deliberate set an edge may point at. */
1089
- interface ContainerRef {
1090
- type: AssociationTargetType;
1091
- id: string;
1092
- }
1093
- /** Per-edge attributes shared by the link helpers. */
1094
- interface EdgeAttrs {
1095
- orgId?: string;
1096
- label?: string;
1097
- metadata?: unknown;
1098
- role?: string;
1099
- position?: number;
1100
- }
1101
- /** One fully-specified edge for {@link AssociationHelpersApi.linkEdges}. */
1102
- interface EdgeSpec extends EdgeAttrs {
1103
- source: EntityRef;
1104
- target: ContainerRef;
1105
- }
1106
- interface AssociationHelpersApi {
1107
- /**
1108
- * Add an arbitrary batch of edges in one call (idempotent per edge).
1109
- * Best-effort: every edge is attempted; the result is `ok` with the
1110
- * created ids only when ALL succeed, otherwise `err` whose `detail` lists
1111
- * every failure (the edges that DID succeed remain applied — re-running is
1112
- * safe via ON CONFLICT).
1113
- */
1114
- linkEdges(edges: EdgeSpec[]): Promise<AssociationsRpcResult<{
1115
- ids: string[];
1116
- }>>;
1117
- /** Attach ONE source to MANY containers in a single shot. */
1118
- linkOneToMany(args: {
1119
- source: EntityRef;
1120
- targets: ContainerRef[];
1121
- attrs?: EdgeAttrs;
1122
- }): Promise<AssociationsRpcResult<{
1123
- ids: string[];
1124
- }>>;
1125
- /** Attach MANY sources to ONE container in a single shot. */
1126
- linkManyToOne(args: {
1127
- sources: EntityRef[];
1128
- target: ContainerRef;
1129
- attrs?: EdgeAttrs;
1130
- }): Promise<AssociationsRpcResult<{
1131
- ids: string[];
1132
- }>>;
1133
- /**
1134
- * REPLACE the full set of a source's edges of one container type (adds
1135
- * missing, removes extras) in one DB transaction — the set-semantics
1136
- * one-shot. Thin, named pass-through to `assoc_set_targets`.
1137
- */
1138
- replaceTargets(args: {
1139
- source: EntityRef;
1140
- targetType: AssociationTargetType;
1141
- targetIds: string[];
1142
- orgId?: string;
1143
- role?: string;
1144
- }): Promise<AssociationsRpcResult<null>>;
1145
- /**
1146
- * Wire edges onto a JUST-CREATED entity. The caller inserts its own row
1147
- * (entity tables are feature-owned), then passes the new id here to attach
1148
- * it to any number of containers (orphan-on-partial-fail is harmless and
1149
- * re-runnable). `created` is the new entity; it becomes the edges' SOURCE.
1150
- */
1151
- linkCreated(args: {
1152
- created: EntityRef;
1153
- targets: ContainerRef[];
1154
- attrs?: EdgeAttrs;
1155
- }): Promise<AssociationsRpcResult<{
1156
- ids: string[];
1157
- }>>;
1158
- /** Remove an arbitrary batch of edges (best-effort; no-op per missing edge). */
1159
- unlinkEdges(edges: {
1160
- source: EntityRef;
1161
- target: ContainerRef;
1162
- role?: string;
1163
- }[]): Promise<AssociationsRpcResult<null>>;
1164
- }
1165
-
1166
- interface AddCommentArgs {
1167
- /** Registered entity-type token the comment hangs on (writes-strict, C18). */
1168
- entityType: string;
1169
- entityId: string;
1170
- body: string;
1171
- /** Reply target — an existing comment's id. Top-level when omitted. */
1172
- parentId?: string | null;
1173
- /** Org override; the RPC resolves task-org/personal-org when omitted. */
1174
- orgId?: string | null;
1175
- }
1176
- interface CommentsServiceApi {
1177
- listForEntity(entityType: string, entityId: string): Promise<AssociationsRpcResult<{
1178
- comments: PlatformComment[];
1179
- }>>;
1180
- add(args: AddCommentArgs): Promise<AssociationsRpcResult<{
1181
- id: string;
1182
- }>>;
1183
- edit(id: string, body: string): Promise<AssociationsRpcResult<null>>;
1184
- remove(id: string): Promise<AssociationsRpcResult<null>>;
1185
- }
1186
-
1187
- interface AssociationWriteResult {
1188
- ok: boolean;
1189
- /** Set on a successful single-edge `add`. */
1190
- id?: string;
1191
- error?: string;
1192
- }
1193
- interface CategoryMutationResult {
1194
- ok: boolean;
1195
- /** Set on a successful mutation. */
1196
- id?: string;
1197
- error?: string;
1198
- }
1199
- interface CommentMutationResult {
1200
- ok: boolean;
1201
- /** Set on a successful `addComment`. */
1202
- id?: string;
1203
- error?: string;
1204
- }
1205
- interface AssociationsStore {
1206
- /** Stable, sync read of one endpoint's entry (idle default when uncached). */
1207
- getEdges(type: string, id: string): AssociationsEntry;
1208
- /**
1209
- * Lazy load of every edge touching `${type}:${id}` (both directions).
1210
- * Deduped per key; `status === "ready"` short-circuits unless `force`.
1211
- */
1212
- load(type: string, id: string, opts?: {
1213
- force?: boolean;
1214
- }): Promise<void>;
1215
- /** External-store contract: notified whenever the key's entry changes. */
1216
- subscribe(key: string, cb: () => void): () => void;
1217
- /** Attach source → target; on success reloads BOTH endpoints. */
1218
- add(args: {
1219
- sourceType: string;
1220
- sourceId: string;
1221
- targetType: AssociationTargetType;
1222
- targetId: string;
1223
- orgId?: string;
1224
- label?: string;
1225
- role?: string;
1226
- metadata?: unknown;
1227
- replaceMetadata?: boolean;
1228
- }): Promise<AssociationWriteResult>;
1229
- /** Detach source → target; on success reloads BOTH endpoints. */
1230
- remove(args: {
1231
- sourceType: string;
1232
- sourceId: string;
1233
- targetType: string;
1234
- targetId: string;
1235
- role?: string;
1236
- }): Promise<AssociationWriteResult>;
1237
- /** Replace the source's `targetType` edge set; reloads the SOURCE. */
1238
- setTargets(args: {
1239
- sourceType: string;
1240
- sourceId: string;
1241
- targetType: AssociationTargetType;
1242
- targetIds: string[];
1243
- orgId?: string;
1244
- role?: string;
1245
- }): Promise<AssociationWriteResult>;
1246
- /** Reset one endpoint to idle and notify its subscribers. */
1247
- invalidate(type: string, id: string): void;
1248
- /** Reset every association endpoint, category facet, and comment thread. */
1249
- invalidateAll(): void;
1250
- getCategories(dimension: CategoryDimension): CategoriesEntry;
1251
- loadCategories(dimension: CategoryDimension, opts?: {
1252
- force?: boolean;
1253
- }): Promise<void>;
1254
- subscribeCategories(dimension: CategoryDimension, cb: () => void): () => void;
1255
- /** Create + echo-insert + authoritative force reload. Returns the new id. */
1256
- createCategory(args: {
1257
- dimension: CategoryDimension;
1258
- name: string;
1259
- orgId: string;
1260
- parentId?: string | null;
1261
- color?: string | null;
1262
- icon?: string | null;
1263
- slug?: string | null;
1264
- }): Promise<CategoryMutationResult>;
1265
- updateCategory(args: {
1266
- dimension: CategoryDimension;
1267
- id: string;
1268
- name: string;
1269
- slug: string | null;
1270
- color: string | null;
1271
- icon: string | null;
1272
- position: number | null;
1273
- }): Promise<CategoryMutationResult>;
1274
- reparentCategory(args: {
1275
- dimension: CategoryDimension;
1276
- id: string;
1277
- parentId: string | null;
1278
- }): Promise<CategoryMutationResult>;
1279
- deleteCategory(args: {
1280
- dimension: CategoryDimension;
1281
- id: string;
1282
- }): Promise<CategoryMutationResult>;
1283
- /** Stable, sync read of one entity's comment thread (idle when uncached). */
1284
- getComments(type: string, id: string): CommentsEntry;
1285
- /**
1286
- * Lazy load of every comment on `${type}:${id}` (oldest→newest; thread by
1287
- * `parentId`). Deduped per key; `status === "ready"` short-circuits unless
1288
- * `force`.
1289
- */
1290
- loadComments(type: string, id: string, opts?: {
1291
- force?: boolean;
1292
- }): Promise<void>;
1293
- /** External-store contract for one entity's comment thread. */
1294
- subscribeComments(key: string, cb: () => void): () => void;
1295
- /** Post a comment (or a reply); on success force-reloads the thread. */
1296
- addComment(args: {
1297
- entityType: string;
1298
- entityId: string;
1299
- body: string;
1300
- parentId?: string | null;
1301
- orgId?: string | null;
1302
- }): Promise<CommentMutationResult>;
1303
- /** Edit a comment body (author-only in the RPC); reloads the thread. */
1304
- editComment(args: {
1305
- entityType: string;
1306
- entityId: string;
1307
- id: string;
1308
- body: string;
1309
- }): Promise<CommentMutationResult>;
1310
- /** Soft-delete a comment (author/org member in the RPC); reloads the thread. */
1311
- deleteComment(args: {
1312
- entityType: string;
1313
- entityId: string;
1314
- id: string;
1315
- }): Promise<CommentMutationResult>;
1316
- /** Reset one entity's comment thread to idle and notify its subscribers. */
1317
- invalidateComments(type: string, id: string): void;
1318
- /** Batched title resolution + the session cache + prime. */
1319
- titles: TitlesServiceApi;
1320
- /** Per-user favorite/pinned/hidden state (`ues_*`). */
1321
- favorites: FavoritesServiceApi;
1322
- /** Candidate reads for the pickers. */
1323
- candidates: CandidatesServiceApi;
1324
- /** Generic registry-convention row create/rename. */
1325
- entityRows: EntityRowsServiceApi;
1326
- /** Composite link helpers over the chokepoint. */
1327
- helpers: AssociationHelpersApi;
1328
- /** The registry merge engine (generated metadata + host overlay). */
1329
- registry: EntityRegistry;
1330
- /**
1331
- * The raw chokepoint services — every RPC family, results-enveloped.
1332
- * `associations` writes here do NOT touch the cache; use the store-level
1333
- * `add`/`remove`/`setTargets` when a cached surface must stay fresh.
1334
- */
1335
- services: {
1336
- associations: AssociationsServiceApi;
1337
- categories: CategoriesServiceApi;
1338
- comments: CommentsServiceApi;
1339
- };
1340
- /** Merge more host overlay entries in (icons/routes/candidate loaders). */
1341
- registerEntityOverlay: EntityRegistry["registerEntityOverlay"];
1342
- /**
1343
- * The bound scream seam (W3, additive): /react surfaces route their loud
1344
- * recoveries here (the originals' console.error sites) without a second
1345
- * sink binding. Same function the host passed at construction.
1346
- */
1347
- errorSink: AssociationsConfig["errorSink"];
1348
- /**
1349
- * The bound identity port (W3, additive): /react hooks that FILTER by the
1350
- * current user (candidate owner scoping) read it leniently; write paths
1351
- * keep going through the services, where `requireUserId` failures stay
1352
- * loud. Same object the host passed at construction.
1353
- */
1354
- identity: AssociationsConfig["identity"];
1355
- }
2
+ import { ReactNode, ComponentType } from 'react';
3
+ import { j as AssociationsNotifier, W as WindowShellPort, k as CapturePort, P as PickerOverrideMap, E as EntityDoorsPort, l as AuthorDisplayPort, m as AssociationsStore, n as CategoryMutationResult, o as CategoryDimension, p as PlatformCategory, q as CategoriesEntry, r as EntityTypeToken, s as UniversalCandidate, t as CandidateRecord, u as PlatformComment, v as CommentsEntry, w as CommentMutationResult, e as AssociationPickerProps, x as EntityDoorProps, y as EntityRefProps, z as ContentRole } from '../CommentThread-D4kcTbog.cjs';
4
+ export { B as AssociationCaptureToolbar, A as AssociationCaptureToolbarProps, D as AssociationCard, F as AssociationCardGrid, b as AssociationCardGridProps, a as AssociationCardProps, G as AssociationEntitySelect, H as AssociationEntitySelectAdapter, I as AssociationEntitySelectItem, c as AssociationEntitySelectProps, J as AssociationList, d as AssociationListProps, K as AssociationWindow, f as AssociationWindowProps, L as AssociationWriteResult, M as AttachedItemsSheet, g as AttachedItemsSheetProps, N as CaptureAttach, O as CaptureAttachResult, Q as CaptureToolbarAction, R as CategorySelect, C as CategorySelectProps, S as CategoryTagPicker, h as CategoryTagPickerProps, T as CommentComposer, V as CommentComposerProps, X as CommentThread, i as CommentThreadProps, Y as ContainerLink, Z as ContainerResourceRow, _ as ContainerResourcesAdapter, $ as DefaultEntityIcon, a0 as PrimaryEntity, a1 as PrimaryEntityProvider, a2 as TagPickerIcon, a3 as UniversalAssociationPicker, U as UniversalAssociationPickerProps, a4 as UseAssociationEntitySelectAdapterArgs, a5 as UseAssociationsArgs, a6 as UseAssociationsReturn, a7 as UseContainerLinksArgs, a8 as UseContainerLinksReturn, a9 as attachedKey, aa as buildCommentTree, ab as useAssociationEntitySelectAdapter, ac as useAssociations, ad as useContainerLinks, ae as useContainerLinksAdapter, af as useEntityRelationships, ag as usePrimaryEntity } from '../CommentThread-D4kcTbog.cjs';
1356
5
 
1357
6
  interface AssociationsUiPorts {
1358
7
  notifier?: AssociationsNotifier;
@@ -1365,9 +14,18 @@ interface AssociationsUiPorts {
1365
14
  interface AssociationsProviderProps extends AssociationsUiPorts {
1366
15
  /** The /core store the host constructed with `createAssociationsStore`. */
1367
16
  store: AssociationsStore;
17
+ /**
18
+ * Run the demanded-schema probe once after mount (0.6.0, C22: this was
19
+ * ~30 lines of boot diagnostic every host hand-wrote). Default: ON in a
20
+ * development build, OFF everywhere else — it is a boot check, never a
21
+ * hot path, and it is side-effect free by construction (see
22
+ * `assertDemandedSchema`). Pass `false` to silence it, `true` to force it
23
+ * (a CI smoke run).
24
+ */
25
+ probeSchema?: boolean;
1368
26
  children: ReactNode;
1369
27
  }
1370
- declare function AssociationsProvider({ store, notifier, windowShell, capture, pickerOverrides, entityDoors, authorDisplay, children, }: AssociationsProviderProps): react.JSX.Element;
28
+ declare function AssociationsProvider({ store, probeSchema, notifier, windowShell, capture, pickerOverrides, entityDoors, authorDisplay, children, }: AssociationsProviderProps): react.JSX.Element;
1371
29
  /** The /core store bound by the nearest provider. Throws when unmounted. */
1372
30
  declare function useAssociationsStore(): AssociationsStore;
1373
31
  /** The UI ports the host bound (each optional, each degradable). */
@@ -1380,99 +38,6 @@ declare function useAssociationsUiPorts(): AssociationsUiPorts;
1380
38
  */
1381
39
  declare function useNotifier(): AssociationsNotifier;
1382
40
 
1383
- interface UseAssociationsArgs {
1384
- /** The entity whose relationships to read/manage (the cache endpoint). */
1385
- type: string;
1386
- id: string | null;
1387
- /** Disable the auto-load on mount. Defaults to false (auto-load). */
1388
- autoLoad?: boolean;
1389
- }
1390
-
1391
- interface UseAssociationsReturn {
1392
- /** Every edge touching this entity, both directions. */
1393
- edges: AssociationEdge[];
1394
- status: AssociationsEntry["status"];
1395
- error: string | null;
1396
- fetchedAt: number | null;
1397
- /** Attach this entity (as source) → a target. */
1398
- add: (args: {
1399
- targetType: AssociationTargetType;
1400
- targetId: string;
1401
- orgId?: string;
1402
- label?: string;
1403
- /** Typed edge role (e.g. 'theme' for a folder/tag) — omit for a role-less edge. */
1404
- role?: string;
1405
- }) => Promise<AssociationWriteResult>;
1406
- /** Detach this entity (as source) → a target. */
1407
- remove: (args: {
1408
- targetType: string;
1409
- targetId: string;
1410
- role?: string;
1411
- }) => Promise<AssociationWriteResult>;
1412
- /** Replace this entity's edges of one target type with exactly `targetIds`. */
1413
- setTargets: (args: {
1414
- targetType: AssociationTargetType;
1415
- targetIds: string[];
1416
- orgId?: string;
1417
- role?: string;
1418
- }) => Promise<AssociationWriteResult>;
1419
- /** Force a refetch of this entity's edges. */
1420
- reload: () => Promise<void>;
1421
- }
1422
- declare function useAssociations(args: UseAssociationsArgs): UseAssociationsReturn;
1423
- /**
1424
- * Convenience alias — same hook, a name that reads naturally on relationship
1425
- * surfaces ("the things this entity is related to"). Identical contract.
1426
- */
1427
- declare const useEntityRelationships: typeof useAssociations;
1428
-
1429
- interface ContainerLink {
1430
- /** The edge id (for keys / removal). */
1431
- edgeId: string;
1432
- /** The attached resource's id (the edge source). */
1433
- resourceId: string;
1434
- /** The attached resource's entity token (the edge source type). */
1435
- token: string;
1436
- /** The edge role, or null for a plain (role-less) association. */
1437
- role: string | null;
1438
- label: string | null;
1439
- /** Per-edge props from `platform.associations.metadata` (e.g. representation). */
1440
- metadata: unknown;
1441
- }
1442
- interface UseContainerLinksArgs {
1443
- /** The primary entity — always an association TARGET (container). */
1444
- containerType: AssociationTargetType;
1445
- containerId: string | null;
1446
- /** Org to stamp on new edges (for org-scoped RLS / counts). */
1447
- orgId?: string | null;
1448
- }
1449
- interface UseContainerLinksReturn {
1450
- status: ReturnType<typeof useAssociations>["status"];
1451
- error: string | null;
1452
- reload: () => Promise<void>;
1453
- /** Total attached resources across every token (all incoming edges). */
1454
- totalCount: number;
1455
- /** Live count of attached resources of `token`. */
1456
- countFor: (token: EntityTypeToken) => number;
1457
- /** Ids of resources of `token` already attached (for picker "attached" state). */
1458
- attachedIdsFor: (token: EntityTypeToken) => Set<string>;
1459
- /** Full link rows of `token` (for listing/removal). */
1460
- linksFor: (token: EntityTypeToken) => ContainerLink[];
1461
- /** Attach a resource (source) to this container (target). */
1462
- attach: (token: EntityTypeToken, resourceId: string, label?: string, metadata?: unknown, options?: {
1463
- replaceMetadata?: boolean;
1464
- /**
1465
- * Semantic edge role (`platform.associations.role`) — e.g. the
1466
- * Masterwork dump surface stamps `distillation_source`. Omitted = the
1467
- * canonical role-less edge. Detach with the SAME role to remove it.
1468
- */
1469
- role?: string;
1470
- }) => Promise<AssociationWriteResult>;
1471
- /** Detach a resource from this container. */
1472
- detach: (token: EntityTypeToken, resourceId: string, role?: string) => Promise<AssociationWriteResult>;
1473
- }
1474
- declare function useContainerLinks(args: UseContainerLinksArgs): UseContainerLinksReturn;
1475
-
1476
41
  interface EntityTitleRef {
1477
42
  token: string;
1478
43
  id: string;
@@ -1606,88 +171,6 @@ interface UseCommentsReturn {
1606
171
  }
1607
172
  declare function useComments(args: UseCommentsArgs): UseCommentsReturn;
1608
173
 
1609
- interface AssociationEntitySelectItem {
1610
- id: string;
1611
- title: string;
1612
- }
1613
- /**
1614
- * The read/write seam of the association "name dropdown". This hook is the
1615
- * default (plain associations container); surfaces with bespoke active/create
1616
- * semantics implement it themselves — same pattern as AssociationList's
1617
- * ContainerResourcesAdapter.
1618
- */
1619
- interface AssociationEntitySelectAdapter {
1620
- /** True while the association list is still hydrating. */
1621
- loading: boolean;
1622
- /** Every entity of this token associated with the container. */
1623
- items: AssociationEntitySelectItem[];
1624
- activeId: string | null;
1625
- setActive: (id: string) => void | Promise<unknown>;
1626
- /**
1627
- * Create a new entity named `title`, associate it to the container, and
1628
- * make it active. Resolves to the new id, or null on failure (the adapter
1629
- * reports its own error detail; the component toasts generically).
1630
- * Omit when creation isn't name-driven — pass `createSlot` on the component
1631
- * instead (e.g. a conversation is created by PICKING AN AGENT, not naming).
1632
- */
1633
- createAndAttach?: (title: string) => Promise<string | null>;
1634
- /** Rename the entity (its real title column). Resolves false on failure. */
1635
- rename: (id: string, title: string) => Promise<boolean>;
1636
- /** Optional: unlink an entity from the container (never deletes the row). */
1637
- detach?: (id: string) => Promise<unknown>;
1638
- }
1639
- interface UseAssociationEntitySelectAdapterArgs {
1640
- token: EntityTypeToken;
1641
- /** The container the entities are associated with (always the edge TARGET). */
1642
- container: {
1643
- type: AssociationTargetType;
1644
- id: string | null;
1645
- orgId?: string | null;
1646
- };
1647
- /** Controlled active selection; omit to default to the first attached row. */
1648
- activeId?: string | null;
1649
- onActiveChange?: (id: string) => void | Promise<unknown>;
1650
- /** NOT NULL columns the registry conventions can't know (create only). */
1651
- createColumns?: Record<string, unknown>;
1652
- }
1653
- declare function useAssociationEntitySelectAdapter(args: UseAssociationEntitySelectAdapterArgs): AssociationEntitySelectAdapter;
1654
-
1655
- /** The primary (container) entity a surface is anchored to. */
1656
- interface PrimaryEntity {
1657
- /** Container token — must be an association TARGET type. */
1658
- type: AssociationTargetType;
1659
- id: string;
1660
- /** Org to stamp on edges created here (org-scoped RLS / counts). */
1661
- orgId?: string | null;
1662
- /** Human label for headings (e.g. the org/scope name). */
1663
- label?: string;
1664
- }
1665
- declare function PrimaryEntityProvider({ value, children, }: {
1666
- value: PrimaryEntity;
1667
- children: ReactNode;
1668
- }): react.JSX.Element;
1669
- /** Read the surrounding primary entity, or null when unprovided. */
1670
- declare function usePrimaryEntity(): PrimaryEntity | null;
1671
-
1672
- interface AssociationWindowProps {
1673
- /** Controls mount — callers should also gate their JSX on this. */
1674
- open: boolean;
1675
- onClose: () => void;
1676
- /** Human-readable scope for the window id (debugging / tray labels). */
1677
- scopeId: string;
1678
- title: string;
1679
- /** Small leading icon rendered beside the title. */
1680
- icon?: ReactNode;
1681
- /**
1682
- * One-line context under the header ("Attached to Titanium Marketing").
1683
- * A node, not a string, so the container it names can carry its own door
1684
- * (THE DOOR LAW) instead of being an unreachable label.
1685
- */
1686
- subtitle?: ReactNode;
1687
- children: ReactNode;
1688
- }
1689
- declare function AssociationWindow({ open, onClose, scopeId, title, icon, subtitle, children, }: AssociationWindowProps): react.JSX.Element | null;
1690
-
1691
174
  declare function AssociationPicker(props: AssociationPickerProps): react.JSX.Element | null;
1692
175
  interface AssociationCandidateBodyProps {
1693
176
  token: EntityTypeToken;
@@ -1715,215 +198,6 @@ interface AssociationCandidateBodyProps {
1715
198
  */
1716
199
  declare function AssociationCandidateBody({ token, enabled, orgId, attachedIds, onAttach, onDetach, onClose, }: AssociationCandidateBodyProps): react.JSX.Element;
1717
200
 
1718
- interface UniversalAssociationPickerProps {
1719
- /** Tokens offered. Defaults to every listable token. */
1720
- tokens?: EntityTypeToken[];
1721
- /** Ids already attached, keyed `${token}:${id}` — rendered as attached. */
1722
- attachedKeys: Set<string>;
1723
- onAttach: (token: EntityTypeToken, resourceId: string, title: string) => Promise<{
1724
- ok: boolean;
1725
- error?: string;
1726
- }>;
1727
- onDetach: (token: EntityTypeToken, resourceId: string) => Promise<{
1728
- ok: boolean;
1729
- error?: string;
1730
- }>;
1731
- /** Owner filter for candidate reads (defaults to RLS-only). */
1732
- ownerId?: string | null;
1733
- /** Org stamped onto rows created via the per-token "+ New" footer. */
1734
- orgId?: string | null;
1735
- className?: string;
1736
- }
1737
- declare function attachedKey(token: string, id: string): string;
1738
- declare function UniversalAssociationPicker(props: UniversalAssociationPickerProps): react.JSX.Element;
1739
-
1740
- interface AttachedItemsSheetProps {
1741
- open: boolean;
1742
- onOpenChange: (open: boolean) => void;
1743
- token: EntityTypeToken;
1744
- containerLabel?: string;
1745
- /**
1746
- * The container these items are attached to. When given, the "Attached to X"
1747
- * line puts a door on X — this window can outlive the page it was opened
1748
- * from, so its container reference must be reachable.
1749
- */
1750
- container?: PrimaryEntity;
1751
- links: ContainerLink[];
1752
- /** Opens the attach picker. Omitted when the token cannot list candidates. */
1753
- onAdd?: () => void;
1754
- onDetach: (resourceId: string) => Promise<{
1755
- ok: boolean;
1756
- error?: string;
1757
- }>;
1758
- }
1759
- declare function AttachedItemsSheet(props: AttachedItemsSheetProps): react.JSX.Element | null;
1760
-
1761
- interface AssociationCardProps {
1762
- /** The secondary entity kind this card manages (e.g. "task", "file"). */
1763
- token: EntityTypeToken;
1764
- /** Override the page's primary entity. Defaults to PrimaryEntityProvider. */
1765
- container?: PrimaryEntity;
1766
- className?: string;
1767
- }
1768
- declare function AssociationCard({ token, container: containerProp, className, }: AssociationCardProps): react.JSX.Element | null;
1769
-
1770
- interface AssociationCardGridProps {
1771
- /** Tokens to show. Defaults to every registry-listable token. */
1772
- tokens?: EntityTypeToken[];
1773
- /** Registry tokens this surface cannot honestly support yet. */
1774
- excludeTokens?: EntityTypeToken[];
1775
- className?: string;
1776
- }
1777
- declare function AssociationCardGrid({ tokens, excludeTokens, className, }: AssociationCardGridProps): react.JSX.Element;
1778
-
1779
- /** One attached resource, as the list renders it. Tokens are CANONICAL. */
1780
- interface ContainerResourceRow {
1781
- /** Stable row key (edge id or `${token}:${id}`). */
1782
- key: string;
1783
- token: string;
1784
- resourceId: string;
1785
- label: string | null;
1786
- /** Exact semantic edge role; null means the canonical role-less edge. */
1787
- role?: string | null;
1788
- /** Pinned rows sort first inside their token group. */
1789
- pinned?: boolean;
1790
- /** False for inherited rows (e.g. via a thread's anchor) — no detach. */
1791
- removable: boolean;
1792
- /** Small annotation for non-removable rows ("via anchor"). */
1793
- originNote?: string | null;
1794
- /** Resolvable records that contributed an inherited row. */
1795
- originRefs?: readonly {
1796
- token: EntityTypeToken;
1797
- id: string;
1798
- label: string;
1799
- }[];
1800
- }
1801
- interface ContainerResourcesAdapter {
1802
- status: "idle" | "loading" | "ready" | "error";
1803
- error: string | null;
1804
- reload: () => void | Promise<void>;
1805
- rows: ContainerResourceRow[];
1806
- attach: (token: EntityTypeToken, resourceId: string, title?: string,
1807
- /**
1808
- * Extra edge metadata stamped at attach time (label-at-attach-time's
1809
- * sibling contract). Adapters without metadata support may ignore it.
1810
- */
1811
- opts?: {
1812
- metadata?: Record<string, unknown> | null;
1813
- }) => Promise<{
1814
- ok: boolean;
1815
- error?: string;
1816
- }>;
1817
- detach: (token: EntityTypeToken, resourceId: string, role?: string) => Promise<{
1818
- ok: boolean;
1819
- error?: string;
1820
- }>;
1821
- /**
1822
- * Optional pin capability (edge `metadata.pinned`) — pinned resources stay
1823
- * inline in agent context at every tier. Rows show a pin toggle when set.
1824
- */
1825
- setPinned?: (token: EntityTypeToken, resourceId: string, pinned: boolean) => Promise<{
1826
- ok: boolean;
1827
- error?: string;
1828
- }>;
1829
- }
1830
- /** Default adapter — wraps `useContainerLinks` (org/scope/project pages). */
1831
- declare function useContainerLinksAdapter(container: PrimaryEntity | null, tokens?: readonly EntityTypeToken[]): ContainerResourcesAdapter;
1832
- interface AssociationListProps {
1833
- /** Container override; defaults to the surrounding PrimaryEntityProvider. */
1834
- container?: PrimaryEntity;
1835
- /** Write/read override (war-room threads etc.). Default: useContainerLinks. */
1836
- adapter?: ContainerResourcesAdapter;
1837
- /** Restrict display + attach to these tokens (e.g. one dynamic tab). */
1838
- tokens?: EntityTypeToken[];
1839
- /** `full` = role sections + universal search; `compact` = flat token groups. */
1840
- variant?: "full" | "compact";
1841
- /** Extra per-token actions (e.g. war-room Upload / New document). */
1842
- renderSectionActions?: (token: EntityTypeToken) => ReactNode;
1843
- /** Open a resource. Default: registry `hrefFor` in a new tab. */
1844
- openEntity?: (token: string, id: string) => void;
1845
- /**
1846
- * Per-token row override (return null/undefined to keep the default row) —
1847
- * for rows that need richer rendering than icon+title. The override owns the
1848
- * whole row; use `ctx` for the resolved title and the busy/detach/open
1849
- * wiring.
1850
- */
1851
- renderRow?: (row: ContainerResourceRow, ctx: {
1852
- title: string;
1853
- busy: boolean;
1854
- onDetach: () => void;
1855
- onOpen: () => void;
1856
- }) => ReactNode | null | undefined;
1857
- className?: string;
1858
- }
1859
- declare function AssociationList(props: AssociationListProps): react.JSX.Element;
1860
-
1861
- type IconProps = SVGProps<SVGSVGElement>;
1862
- /**
1863
- * The default entity glyph for tokens with no host overlay icon (lucide
1864
- * `Boxes` — the original registry's DEFAULT_ICON, now a /react concern
1865
- * because /core ships `Icon: null`).
1866
- */
1867
- declare function DefaultEntityIcon(props: IconProps): react.JSX.Element;
1868
-
1869
- interface CaptureAttachResult {
1870
- ok: boolean;
1871
- /** Human error text — the toolbar screams it. Omit when the host already did. */
1872
- error?: string;
1873
- }
1874
- /**
1875
- * ONE write callback for every capture verb. Tokens are canonical
1876
- * (`file` / `udt_document`); the host maps to its own write path (an
1877
- * association edge, a thread thunk, …) and reports the outcome honestly —
1878
- * a silent no-op attach is the bug class this contract kills.
1879
- */
1880
- type CaptureAttach = (token: EntityTypeToken, resourceId: string, opts?: {
1881
- label?: string;
1882
- }) => Promise<CaptureAttachResult>;
1883
- interface AssociationCaptureToolbarProps {
1884
- attach: CaptureAttach;
1885
- /** Logical cloud-files folder new uploads land in (auto-created). */
1886
- uploadFolderPath: string;
1887
- /** Visibility stamped on uploads. Default "personal". */
1888
- uploadVisibility?: string;
1889
- /**
1890
- * Where a created-but-unlinked upload is reported to live, e.g.
1891
- * "your Files (War Room folder)". Keeps the loud-outcome copy honest.
1892
- */
1893
- uploadLocationLabel: string;
1894
- /** The retry verb named in loud-outcome copy. Default '"Add file"'. */
1895
- attachRetryLabel?: string;
1896
- /** Copy for the existing-files picker dialog. */
1897
- filePicker?: {
1898
- title?: string;
1899
- description?: string;
1900
- };
1901
- /** Which built-in actions render (each ALSO gated on its port handler). */
1902
- showActions?: {
1903
- upload?: boolean;
1904
- addFile?: boolean;
1905
- newDocument?: boolean;
1906
- };
1907
- /** Hide the button row (compact variants) — drag-and-drop stays live. */
1908
- showToolbar?: boolean;
1909
- /** Extra host-specific buttons appended after the built-ins. */
1910
- extraActions?: ReactNode;
1911
- /** Open a freshly created document via the registry door. Default true. */
1912
- openCreatedDocument?: boolean;
1913
- className?: string;
1914
- /** The body the drop target wraps (the list of attached things). */
1915
- children?: ReactNode;
1916
- }
1917
- declare function AssociationCaptureToolbar({ attach, uploadFolderPath, uploadVisibility, uploadLocationLabel, attachRetryLabel, filePicker, showActions, showToolbar, extraActions, openCreatedDocument, className, children, }: AssociationCaptureToolbarProps): react.JSX.Element;
1918
- /** The dense toolbar button (exported so hosts' extraActions match). */
1919
- declare function CaptureToolbarAction({ icon: Icon, label, onClick, disabled, spinning, }: {
1920
- icon: (props: IconProps) => ReactNode;
1921
- label: string;
1922
- onClick: () => void;
1923
- disabled?: boolean;
1924
- spinning?: boolean;
1925
- }): react.JSX.Element;
1926
-
1927
201
  interface DoorRefExtras {
1928
202
  /** Container-owned opener — wins over hrefFor when the host EntityRef is absent. */
1929
203
  onOpen?: (() => void) | undefined;
@@ -1938,131 +212,82 @@ declare function UnresolvedRef({ token, id }: {
1938
212
  token: string;
1939
213
  id: string;
1940
214
  }): react.JSX.Element;
1941
-
1942
- interface AssociationEntitySelectProps {
1943
- token: EntityTypeToken;
1944
- adapter: AssociationEntitySelectAdapter;
1945
- className?: string;
1946
- /** Label sizing/typography override (defaults to toolbar-dense text-xs). */
1947
- labelClassName?: string;
1948
- align?: "start" | "end";
1949
- showIcon?: boolean;
1950
- /** How the name enters inline edit. Default "click". */
1951
- renameActivation?: "click" | "doubleClick";
1952
- /** Shown while no entity is active yet. Defaults to the plural label. */
1953
- emptyLabel?: string;
1954
- /** Icon color accent (e.g. "text-yellow-500" for notes). */
1955
- iconClassName?: string;
1956
- /**
1957
- * Replaces the default "+ New <Entity>" name-input footer with a custom
1958
- * creator (e.g. an agent picker that starts a new chat). Function form
1959
- * receives `close` so the creator can dismiss the dropdown when done.
1960
- */
1961
- createSlot?: React.ReactNode | ((close: () => void) => React.ReactNode);
1962
- }
1963
- declare function AssociationEntitySelect({ token, adapter, className, labelClassName, align, showIcon, renameActivation, emptyLabel, iconClassName, createSlot, }: AssociationEntitySelectProps): react.JSX.Element;
1964
-
1965
- interface CategorySelectProps {
1966
- dimension: CategoryDimension;
1967
- value: string | null;
1968
- onChange: (id: string | null) => void;
1969
- placeholder: string;
1970
- allowNone?: boolean;
1971
- disabled?: boolean;
1972
- /**
1973
- * Offer "Create «what you typed»". On by default — a closed category list is
1974
- * a defect, so turning this off needs a reason a person would accept.
1975
- */
1976
- allowCreate?: boolean;
1977
- /**
1978
- * Org for an inline-created category. Defaults to the identity port's
1979
- * `ensureOrgId()`; with neither, create refuses loudly.
1980
- */
1981
- orgId?: string | null;
1982
- /** What one of these is called, for the create affordance ("stage", "folder"). */
1983
- noun?: string;
1984
- }
1985
- declare function CategorySelect({ dimension, value, onChange, placeholder, allowNone, disabled, allowCreate, orgId, noun, }: CategorySelectProps): react.JSX.Element;
1986
-
1987
- /** Structural stand-in for the host's `LucideIcon` on the `icon` prop. */
1988
- type TagPickerIcon = ComponentType<{
1989
- className?: string;
1990
- }>;
1991
- interface CategoryTagPickerProps {
1992
- /** The tagged entity's registered association type (e.g. "fc_set", "party"). */
1993
- entityType: string;
1994
- entityId: string;
1995
- /** The `platform.categories` facet the picker offers. */
1996
- dimension: CategoryDimension;
1997
- /** The typed edge role the assignment edges carry (e.g. "theme", "member"). */
1998
- edgeRole: string;
1999
- /**
2000
- * Org for the edge write and for inline-created categories. Defaults to the
2001
- * identity port's `ensureOrgId()` (create only) — pass the owning entity's
2002
- * org when it has one.
2003
- */
2004
- orgId?: string | null;
2005
- /** Trigger label while nothing is selected. */
2006
- addLabel?: string;
2007
- /** Trigger icon. */
2008
- icon?: TagPickerIcon;
2009
- /** Offer "Create <term>" for unmatched search terms. Default true. */
2010
- allowCreate?: boolean;
2011
- /**
2012
- * Force the two-level face on or off. Omit to detect it from parentId rows,
2013
- * which leaves every existing flat facet visually unchanged.
2014
- */
2015
- hierarchical?: boolean;
2016
- emptyText?: string;
2017
- }
2018
215
  /**
2019
- * Multi-select combobox: badges for the entity's current tags in `dimension`,
2020
- * a popover to toggle existing categories, optional inline create. Fully
2021
- * self-contained mount it once per entity and it reads/writes the edges.
216
+ * The door-control cluster, host-supplied or the package default. Every face
217
+ * renders doors through THIS slot never `entityDoors?.DoorControls` so
218
+ * the default reaches all of them at once.
2022
219
  */
2023
- declare function CategoryTagPicker({ entityType, entityId, dimension, edgeRole, orgId, addLabel, icon: Icon, allowCreate, hierarchical, emptyText, }: CategoryTagPickerProps): react.JSX.Element;
220
+ declare function DoorControlsSlot(props: EntityDoorProps): react.JSX.Element | null;
2024
221
 
2025
- interface CommentThreadProps {
2026
- /** Entity-type token of the commented-on entity. */
2027
- token: EntityTypeToken;
2028
- /** The entity's row id. */
222
+ interface DefaultWindowShellProps {
223
+ /** Stable id used for the accessible label association only. */
2029
224
  id: string;
2030
- /** Org override forwarded to `cmt_add` (the RPC resolves one when omitted). */
2031
- orgId?: string | null;
2032
- /** Hide the slim "Comments · n" header row. Defaults to shown. */
2033
- showHeader?: boolean;
225
+ title: string;
226
+ onClose: () => void;
227
+ /** Small leading glyph beside the title. */
228
+ icon?: ReactNode;
229
+ children: ReactNode;
2034
230
  className?: string;
2035
231
  }
2036
- interface CommentComposerProps {
2037
- /** Post the body; resolve `{ok:false}` to keep the text + show the error. */
2038
- onSubmit: (body: string) => Promise<{
2039
- ok: boolean;
2040
- error?: string;
2041
- }>;
2042
- placeholder?: string;
2043
- submitLabel?: string;
2044
- /** Initial body (the edit flow seeds the current text). */
2045
- initialValue?: string;
2046
- /** Rendered right of the submit button (the Cancel affordance). */
2047
- trailing?: ReactNode;
2048
- autoFocus?: boolean;
232
+ declare function DefaultWindowShell({ id, title, onClose, icon, children, className, }: DefaultWindowShellProps): react.ReactPortal | null;
233
+
234
+ /** What a `windowShell.Window` component receives. */
235
+ interface WindowShellComponentProps {
236
+ id: string;
237
+ title: string;
238
+ onClose(): void;
239
+ children: ReactNode;
2049
240
  }
2050
241
  /**
2051
- * The one composer every comment write goes through (new comment, reply,
2052
- * edit). Submit on the button or Cmd/Ctrl+Enter; the text survives a failed
2053
- * submit alongside the inline error (input is never lost).
242
+ * Split a host window component off the boot bundle. The returned component
243
+ * satisfies `WindowShellPort["Window"]` exactly; the chunk fetches the first
244
+ * time an association window opens.
2054
245
  */
2055
- declare function CommentComposer({ onSubmit, placeholder, submitLabel, initialValue, trailing, autoFocus, }: CommentComposerProps): react.JSX.Element;
246
+ declare function lazyWindowShell(load: () => Promise<ComponentType<WindowShellComponentProps> | {
247
+ default: ComponentType<WindowShellComponentProps>;
248
+ }>): WindowShellPort["Window"];
2056
249
  /**
2057
- * Build the parent→children index. A reply whose parent is missing from the
2058
- * list (soft-deleted parent, partial page) is promoted to top level rather
2059
- * than dropped — every visible comment stays reachable.
250
+ * Split a host per-token picker override off the boot bundle. The returned
251
+ * component satisfies the `pickerOverrides` map's value type exactly.
2060
252
  */
2061
- declare function buildCommentTree(comments: readonly PlatformComment[]): {
2062
- roots: PlatformComment[];
2063
- childrenOf: Map<string, PlatformComment[]>;
2064
- };
2065
- declare function CommentThread({ token, id, orgId, showHeader, className, }: CommentThreadProps): react.JSX.Element;
253
+ declare function lazyPickerOverride(load: () => Promise<ComponentType<AssociationPickerProps> | {
254
+ default: ComponentType<AssociationPickerProps>;
255
+ }>): ComponentType<AssociationPickerProps>;
256
+
257
+ /** One thing the host's picker produced or selected. */
258
+ interface PickerBridgeItem {
259
+ id: string;
260
+ /** Human name — used verbatim in every loud outcome. */
261
+ name: string;
262
+ }
263
+ interface AssociationPickerBridgeOptions {
264
+ /**
265
+ * Where an item that was CREATED but could not be attached now lives
266
+ * ("your Files"). Keeps the created-but-unlinked message honest instead of
267
+ * letting the item look like it vanished.
268
+ */
269
+ createdLocationLabel?: string;
270
+ /** An action offered on that message, e.g. a door to the library. */
271
+ openCreatedLocation?: {
272
+ label: string;
273
+ onClick: () => void;
274
+ };
275
+ /** Noun used in copy. Default "item". */
276
+ itemNoun?: string;
277
+ }
278
+ interface AssociationPickerBridge {
279
+ /**
280
+ * Attach a batch (the host's post-upload hand-off). Every terminal outcome
281
+ * is loud: successes are confirmed, failures name the item AND where it
282
+ * lives, and a thrown attach is captured to the errorSink.
283
+ */
284
+ attachMany(items: PickerBridgeItem[]): Promise<void>;
285
+ /** Attach-or-detach one item, screaming on refusal. */
286
+ toggle(item: PickerBridgeItem): Promise<void>;
287
+ /** True while a batch or toggle is in flight (drive the host's spinner). */
288
+ busy: boolean;
289
+ }
290
+ declare function useAssociationPickerBridge(props: Pick<AssociationPickerProps, "attachedIds" | "onAttach" | "onDetach" | "token">, options?: AssociationPickerBridgeOptions): AssociationPickerBridge;
2066
291
 
2067
292
  /**
2068
293
  * "just now" under a minute, then the largest whole unit ("5 minutes ago",
@@ -2086,4 +311,4 @@ interface ContentRoleMeta {
2086
311
  declare const CONTENT_ROLES: ContentRoleMeta[];
2087
312
  declare function getContentRoleMeta(role: ContentRole): ContentRoleMeta;
2088
313
 
2089
- export { AssociationCandidateBody, type AssociationCandidateBodyProps, AssociationCaptureToolbar, type AssociationCaptureToolbarProps, AssociationCard, AssociationCardGrid, type AssociationCardGridProps, type AssociationCardProps, AssociationEntitySelect, type AssociationEntitySelectAdapter, type AssociationEntitySelectItem, type AssociationEntitySelectProps, AssociationList, type AssociationListProps, AssociationPicker, type AssociationPickerProps, AssociationWindow, type AssociationWindowProps, type AssociationWriteResult, AssociationsProvider, type AssociationsProviderProps, type AssociationsUiPorts, AttachedItemsSheet, type AttachedItemsSheetProps, CONTENT_ROLES, type CandidateRecord, type CaptureAttach, type CaptureAttachResult, CaptureToolbarAction, type CategoryCreateResult, type CategoryMutationResult, CategorySelect, type CategorySelectProps, CategoryTagPicker, type CategoryTagPickerProps, CommentComposer, type CommentComposerProps, CommentThread, type CommentThreadProps, type ContainerLink, type ContainerResourceRow, type ContainerResourcesAdapter, type ContentRoleMeta, DefaultEntityIcon, DoorRef, type EntityTitleRef, type PrimaryEntity, PrimaryEntityProvider, type TagPickerIcon, UniversalAssociationPicker, type UniversalAssociationPickerProps, type UniversalCandidate, UnresolvedRef, type UseAssociationCandidatesArgs, type UseAssociationCandidatesReturn, type UseAssociationEntitySelectAdapterArgs, type UseAssociationsArgs, type UseAssociationsReturn, type UseCategoriesArgs, type UseCategoriesReturn, type UseCommentsArgs, type UseCommentsReturn, type UseContainerLinksArgs, type UseContainerLinksReturn, type UseEntityTitlesReturn, type UseUniversalEntitySearchArgs, type UseUniversalEntitySearchReturn, attachedKey, buildCommentTree, formatRelativeTime, getContentRoleMeta, useAssociationCandidates, useAssociationEntitySelectAdapter, useAssociations, useAssociationsStore, useAssociationsUiPorts, useCategories, useComments, useContainerLinks, useContainerLinksAdapter, useEntityRelationships, useEntityTitles, useNotifier, usePrimaryEntity, useUniversalEntitySearch };
314
+ export { AssociationCandidateBody, type AssociationCandidateBodyProps, AssociationPicker, type AssociationPickerBridge, type AssociationPickerBridgeOptions, AssociationPickerProps, AssociationsProvider, type AssociationsProviderProps, type AssociationsUiPorts, CONTENT_ROLES, CandidateRecord, type CategoryCreateResult, CategoryMutationResult, type ContentRoleMeta, DefaultWindowShell, type DefaultWindowShellProps, DoorControlsSlot, DoorRef, type EntityTitleRef, type PickerBridgeItem, UniversalCandidate, UnresolvedRef, type UseAssociationCandidatesArgs, type UseAssociationCandidatesReturn, type UseCategoriesArgs, type UseCategoriesReturn, type UseCommentsArgs, type UseCommentsReturn, type UseEntityTitlesReturn, type UseUniversalEntitySearchArgs, type UseUniversalEntitySearchReturn, type WindowShellComponentProps, formatRelativeTime, getContentRoleMeta, lazyPickerOverride, lazyWindowShell, useAssociationCandidates, useAssociationPickerBridge, useAssociationsStore, useAssociationsUiPorts, useCategories, useComments, useEntityTitles, useNotifier, useUniversalEntitySearch };