@ai-matrx/associations 0.7.2 → 0.7.4

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 +1 @@
1
- {"version":3,"sources":["../../src/react/index.ts","../../src/react/context.tsx","../../src/demanded-rpcs.generated.ts","../../src/core/assertDemandedSchema.ts","../../src/react/hooks/useAssociations.ts","../../src/results.ts","../../src/entity-types.generated.ts","../../src/core/titles.ts","../../src/core/store.ts","../../src/react/hooks/useContainerLinks.ts","../../src/react/hooks/useEntityTitles.ts","../../src/react/hooks/useCategories.ts","../../src/react/hooks/useUniversalEntitySearch.ts","../../src/react/hooks/useAssociationCandidates.ts","../../src/react/hooks/useComments.ts","../../src/react/hooks/useAssociationEntitySelect.ts","../../src/react/components/PrimaryEntityContext.tsx","../../src/react/components/AssociationWindow.tsx","../../src/react/components/DefaultWindowShell.tsx","../../src/react/icons.tsx","../../src/react/components/AssociationPicker.tsx","../../src/react/components/UniversalAssociationPicker.tsx","../../src/react/components/entityDoors.tsx","../../src/react/components/AttachedItemsSheet.tsx","../../src/react/components/AssociationCard.tsx","../../src/react/contentRoles.ts","../../src/react/components/AssociationCardGrid.tsx","../../src/react/components/AssociationList.tsx","../../src/react/components/AssociationCaptureToolbar.tsx","../../src/react/lazyPorts.tsx","../../src/react/hooks/useAssociationPickerBridge.ts","../../src/react/components/AssociationEntitySelect.tsx","../../src/react/components/CategorySelect.tsx","../../src/core/categoryHierarchy.ts","../../src/react/components/CategoryTagPicker.tsx","../../src/react/components/CommentThread.tsx","../../src/react/relativeTime.ts"],"sourcesContent":["// @ai-matrx/associations/react — the React binding (W3 hooks + W4 faces).\n//\n// THE BANNER GROUP: this entry (and only this entry) ships with a\n// `\"use client\"` directive stamped on its dist chunks — everything here\n// touches React state/effects/DOM. The types root and /core stay PURE.\n//\n// Bind once per host:\n//\n// const store = createAssociationsStore({ dataSource, identity, errorSink, … });\n// <AssociationsProvider store={store} notifier={…} windowShell={…}\n// capture={…} pickerOverrides={…} entityDoors={…}>\n//\n// The seven hooks keep the matrx-frontend originals' EXACT public\n// signatures (the W5 swap is a mechanical re-export flip + Redux-fragment\n// deletion), riding the /core store via useSyncExternalStore.\n//\n// W4 status: COMPLETE. The three faces that were gated on design-system\n// primitives (`AssociationEntitySelect`, `CategorySelect`,\n// `CategoryTagPicker`) landed with design-system 0.3.0 (the Command family,\n// the Select family, the CreatablePicker composite) — the peer floor is\n// `>=0.3.0`.\n\nexport {\n AssociationsProvider,\n useAssociationsStore,\n useAssociationsUiPorts,\n useNotifier,\n type AssociationsProviderProps,\n type AssociationsUiPorts,\n} from \"./context\";\n\n// ── hooks (W3 — signature-compatible with the matrx-frontend originals) ──\nexport {\n useAssociations,\n useEntityRelationships,\n type AssociationWriteResult,\n type UseAssociationsArgs,\n type UseAssociationsReturn,\n} from \"./hooks/useAssociations\";\nexport {\n useContainerLinks,\n type ContainerLink,\n type UseContainerLinksArgs,\n type UseContainerLinksReturn,\n} from \"./hooks/useContainerLinks\";\nexport {\n useEntityTitles,\n type EntityTitleRef,\n type UseEntityTitlesReturn,\n} from \"./hooks/useEntityTitles\";\nexport {\n useCategories,\n type CategoryCreateResult,\n type CategoryMutationResult,\n type UseCategoriesArgs,\n type UseCategoriesReturn,\n} from \"./hooks/useCategories\";\nexport {\n useUniversalEntitySearch,\n type UniversalCandidate,\n type UseUniversalEntitySearchArgs,\n type UseUniversalEntitySearchReturn,\n} from \"./hooks/useUniversalEntitySearch\";\nexport {\n useAssociationCandidates,\n type CandidateRecord,\n type UseAssociationCandidatesArgs,\n type UseAssociationCandidatesReturn,\n} from \"./hooks/useAssociationCandidates\";\nexport {\n useComments,\n type UseCommentsArgs,\n type UseCommentsReturn,\n} from \"./hooks/useComments\";\nexport {\n useAssociationEntitySelectAdapter,\n type AssociationEntitySelectAdapter,\n type AssociationEntitySelectItem,\n type UseAssociationEntitySelectAdapterArgs,\n} from \"./hooks/useAssociationEntitySelect\";\n\n// ── faces (W4) ───────────────────────────────────────────────────────────\nexport {\n PrimaryEntityProvider,\n usePrimaryEntity,\n type PrimaryEntity,\n} from \"./components/PrimaryEntityContext\";\nexport {\n AssociationWindow,\n type AssociationWindowProps,\n} from \"./components/AssociationWindow\";\nexport {\n AssociationPicker,\n AssociationCandidateBody,\n type AssociationCandidateBodyProps,\n type AssociationPickerProps,\n} from \"./components/AssociationPicker\";\nexport {\n UniversalAssociationPicker,\n attachedKey,\n type UniversalAssociationPickerProps,\n} from \"./components/UniversalAssociationPicker\";\nexport {\n AttachedItemsSheet,\n type AttachedItemsSheetProps,\n} from \"./components/AttachedItemsSheet\";\nexport {\n AssociationCard,\n type AssociationCardProps,\n} from \"./components/AssociationCard\";\nexport {\n AssociationCardGrid,\n type AssociationCardGridProps,\n} from \"./components/AssociationCardGrid\";\nexport {\n AssociationList,\n useContainerLinksAdapter,\n type AssociationListProps,\n type ContainerResourceRow,\n type ContainerResourcesAdapter,\n} from \"./components/AssociationList\";\nexport {\n AssociationCaptureToolbar,\n CaptureToolbarAction,\n type AssociationCaptureToolbarProps,\n type CaptureAttach,\n type CaptureAttachResult,\n} from \"./components/AssociationCaptureToolbar\";\nexport {\n DoorRef,\n DoorControlsSlot,\n UnresolvedRef,\n} from \"./components/entityDoors\";\nexport {\n DefaultWindowShell,\n type DefaultWindowShellProps,\n} from \"./components/DefaultWindowShell\";\nexport {\n lazyPickerOverride,\n lazyWindowShell,\n type WindowShellComponentProps,\n} from \"./lazyPorts\";\nexport {\n useAssociationPickerBridge,\n type AssociationPickerBridge,\n type AssociationPickerBridgeOptions,\n type PickerBridgeItem,\n} from \"./hooks/useAssociationPickerBridge\";\nexport {\n AssociationEntitySelect,\n type AssociationEntitySelectProps,\n} from \"./components/AssociationEntitySelect\";\nexport {\n CategorySelect,\n type CategorySelectProps,\n} from \"./components/CategorySelect\";\nexport {\n CategoryTagPicker,\n type CategoryTagPickerProps,\n type TagPickerIcon,\n} from \"./components/CategoryTagPicker\";\n\n// ── comments (W6 — the canonical comments UI, ruling C4) ─────────────────\nexport {\n CommentThread,\n CommentComposer,\n buildCommentTree,\n type CommentThreadProps,\n type CommentComposerProps,\n} from \"./components/CommentThread\";\nexport { formatRelativeTime } from \"./relativeTime\";\n\n// ── chrome shared by the faces ───────────────────────────────────────────\nexport {\n CONTENT_ROLES,\n getContentRoleMeta,\n type ContentRoleMeta,\n} from \"./contentRoles\";\nexport { DefaultEntityIcon } from \"./icons\";\n","// react/context.tsx — @ai-matrx/associations/react\n//\n// The ONE React binding point (design Decision 2): a host constructs the\n// /core store once (`createAssociationsStore(cfg)`) in its binding module and\n// mounts `<AssociationsProvider store={store} …>` at the top of the tree. The\n// UI ports (notifier / windowShell / capture / pickerOverrides / entityDoors\n// / authorDisplay) are /react concerns and bind HERE — the headless store\n// never sees them.\n//\n// Required-port failures stay loud: every hook/face reaches the store through\n// `useAssociationsStore()`, which THROWS with a precise message when no\n// provider is mounted — never a silently-empty surface.\n//\n// Notifier degradation (design Decision 2 table): when the host binds no\n// notifier, /react warns ONCE through the store's errorSink and every\n// user-facing failure still reaches the errorSink — the create-then-associate\n// loud-outcome law is satisfied structurally, not by toast availability.\n\nimport {\n createContext,\n useContext,\n useEffect,\n useRef,\n type ReactNode,\n} from \"react\";\n\nimport type {\n AssociationsNotifier,\n AuthorDisplayPort,\n CapturePort,\n EntityDoorsPort,\n PickerOverrideMap,\n WindowShellPort,\n} from \"../ports\";\nimport type { AssociationsStore } from \"../core/store\";\nimport { assertDemandedSchema } from \"../core/assertDemandedSchema\";\n\nexport interface AssociationsUiPorts {\n notifier?: AssociationsNotifier;\n windowShell?: WindowShellPort;\n capture?: CapturePort;\n pickerOverrides?: PickerOverrideMap;\n entityDoors?: EntityDoorsPort;\n authorDisplay?: AuthorDisplayPort;\n}\n\ninterface AssociationsReactBinding extends AssociationsUiPorts {\n store: AssociationsStore;\n /** ONE warn-once latch per provider instance (never module state). */\n notifierWarned: { current: boolean };\n}\n\nconst AssociationsReactContext = createContext<AssociationsReactBinding | null>(\n null,\n);\n\nexport interface AssociationsProviderProps extends AssociationsUiPorts {\n /** The /core store the host constructed with `createAssociationsStore`. */\n store: AssociationsStore;\n /**\n * Run the demanded-schema probe once after mount (0.6.0, C22: this was\n * ~30 lines of boot diagnostic every host hand-wrote). Default: ON in a\n * development build, OFF everywhere else — it is a boot check, never a\n * hot path, and it is side-effect free by construction (see\n * `assertDemandedSchema`). Pass `false` to silence it, `true` to force it\n * (a CI smoke run).\n */\n probeSchema?: boolean;\n children: ReactNode;\n}\n\n/**\n * Development detection that cannot throw in ANY loader: bundlers that\n * define `process.env.NODE_ENV` (Next, webpack, Vite's define) answer\n * honestly; one that defines nothing answers `false` and the probe simply\n * stays off — never a crash, never a production probe.\n */\nfunction isDevelopmentBuild(): boolean {\n try {\n return (\n typeof process !== \"undefined\" &&\n process.env?.[\"NODE_ENV\"] === \"development\"\n );\n } catch {\n return false;\n }\n}\n\nexport function AssociationsProvider({\n store,\n probeSchema,\n notifier,\n windowShell,\n capture,\n pickerOverrides,\n entityDoors,\n authorDisplay,\n children,\n}: AssociationsProviderProps) {\n const notifierWarned = useRef(false);\n\n // THE demanded-schema boot probe (moved in-package at 0.6.0). Every host\n // was writing this effect itself — a dynamic import, a try/catch, and a\n // hand-rolled `demanded_schema_violation` scream. It is package logic:\n // the package is the thing that DEMANDS the schema, so it is the thing\n // that says, once and loudly, when the database cannot answer it.\n const shouldProbe = probeSchema ?? isDevelopmentBuild();\n useEffect(() => {\n if (!shouldProbe) return;\n let stale = false;\n void (async () => {\n try {\n await assertDemandedSchema(store.dataSource);\n } catch (error) {\n if (stale) return;\n store.errorSink({\n code: \"demanded_schema_violation\",\n message:\n error instanceof Error\n ? error.message\n : \"assertDemandedSchema failed\",\n context: {\n remedy:\n \"Run the platform.associations schema (README § The demanded \" +\n \"schema) on the database this dataSource points at.\",\n },\n });\n }\n })();\n return () => {\n stale = true;\n };\n }, [shouldProbe, store]);\n\n return (\n <AssociationsReactContext.Provider\n value={{\n store,\n notifierWarned,\n ...(notifier !== undefined ? { notifier } : {}),\n ...(windowShell !== undefined ? { windowShell } : {}),\n ...(capture !== undefined ? { capture } : {}),\n ...(pickerOverrides !== undefined ? { pickerOverrides } : {}),\n ...(entityDoors !== undefined ? { entityDoors } : {}),\n ...(authorDisplay !== undefined ? { authorDisplay } : {}),\n }}\n >\n {children}\n </AssociationsReactContext.Provider>\n );\n}\n\nfunction requireBinding(): AssociationsReactBinding {\n const binding = useContext(AssociationsReactContext);\n if (!binding) {\n throw new Error(\n \"@ai-matrx/associations/react: no <AssociationsProvider> above this \" +\n \"component. Construct the store once with createAssociationsStore(cfg) \" +\n \"in your host binding and mount <AssociationsProvider store={store}> \" +\n \"at the top of the tree.\",\n );\n }\n return binding;\n}\n\n/** The /core store bound by the nearest provider. Throws when unmounted. */\nexport function useAssociationsStore(): AssociationsStore {\n return requireBinding().store;\n}\n\n/** The UI ports the host bound (each optional, each degradable). */\nexport function useAssociationsUiPorts(): AssociationsUiPorts {\n const { store: _store, notifierWarned: _warned, ...ports } = requireBinding();\n return ports;\n}\n\n/**\n * The notifier, degraded per contract: absent → warn once via errorSink,\n * then route every user-facing failure to the errorSink so no outcome is\n * silent. Success messages without a notifier are dropped (the surface's own\n * state change is the confirmation); failures always scream.\n */\nexport function useNotifier(): AssociationsNotifier {\n const binding = requireBinding();\n if (binding.notifier) return binding.notifier;\n const { store, notifierWarned } = binding;\n const warnOnce = () => {\n if (notifierWarned.current) return;\n notifierWarned.current = true;\n store.errorSink({\n code: \"notifier_missing\",\n message:\n \"@ai-matrx/associations/react: no notifier port bound — user-facing \" +\n \"failures are routed to the errorSink only. Bind `notifier` on \" +\n \"AssociationsProvider for toasts.\",\n });\n };\n return {\n success() {\n warnOnce();\n },\n error(msg, opts) {\n warnOnce();\n store.errorSink({\n code: \"user_facing_error\",\n message: msg,\n ...(opts?.description !== undefined\n ? { context: { description: opts.description } }\n : {}),\n });\n },\n };\n}\n","// ─────────────────────────────────────────────────────────────────────────\n// AUTOGENERATED — DO NOT EDIT BY HAND.\n//\n// The TYPED half of this package's DEMANDED SCHEMA: the 27 SECURITY\n// DEFINER RPC families every operation goes through (the client holds NO\n// grant on `platform.associations` itself). Sliced from the live-generated\n// Supabase contract of the platform DB.\n// Regenerate: pnpm gen:demanded-rpcs -- /path/to/database.types.ts\n//\n// A database that cannot answer these functions is not this package's\n// database — the runtime probe (`assertDemandedSchema`, /core) and the\n// `demanded_schema_violation` error code scream exactly that.\n//\n// NOT demanded, deliberately: the DB's legacy `assoc_link` / `assoc_list` /\n// `assoc_unlink` trio (zero client callers — flagged for server-side\n// retirement, never adopted here).\n//\n// `unknown` stands in for the host contract's `Json` (JSON-boundary rule in\n// /policies/typescript-package-standard.md).\n// ─────────────────────────────────────────────────────────────────────────\n\n/** Per-RPC Args/Returns for every demanded function, straight from the live DB. */\nexport interface DemandedRpcSignatures {\n // ── edges — writes ──\n assoc_add: {\n Args: {\n p_label?: string\n p_metadata?: unknown\n p_org_id?: string\n p_payload?: unknown\n p_payload_kind?: string\n p_position?: number\n p_role?: string\n p_source_id: string\n p_source_type: string\n p_target_id: string\n p_target_type: string\n }\n Returns: string\n };\n assoc_remove: {\n Args: {\n p_role?: string\n p_source_id: string\n p_source_type: string\n p_target_id: string\n p_target_type: string\n }\n Returns: undefined\n };\n assoc_set_targets: {\n Args: {\n p_org_id?: string\n p_role?: string\n p_source_id: string\n p_source_type: string\n p_target_ids: string[]\n p_target_type: string\n }\n Returns: undefined\n };\n assoc_remove_for_entity: {\n Args: { p_id: string; p_type: string }\n Returns: undefined\n };\n // ── edges — reads ──\n assoc_for_entity: {\n Args: { p_id: string; p_type: string }\n Returns: {\n created_at: string\n direction: string\n id: string\n label: string\n metadata: unknown\n organization_id: string\n other_id: string\n other_type: string\n position: number\n role: string\n }[]\n };\n assoc_for_targets: {\n Args: { p_target_ids: string[]; p_target_type: string }\n Returns: {\n created_at: string\n id: string\n label: string\n metadata: unknown\n organization_id: string\n position: number\n role: string\n source_id: string\n source_type: string\n target_id: string\n }[]\n };\n assoc_for_sources: {\n Args: {\n p_source_ids: string[]\n p_source_type: string\n p_target_type?: string\n }\n Returns: {\n created_at: string\n id: string\n label: string\n metadata: unknown\n organization_id: string\n position: number\n role: string\n source_id: string\n target_id: string\n target_type: string\n }[]\n };\n assoc_members_visible: {\n Args: { p_target_ids: string[]; p_target_type: string }\n Returns: {\n created_at: string\n id: string\n label: string\n metadata: unknown\n organization_id: string\n position: number\n role: string\n source_id: string\n source_type: string\n target_id: string\n }[]\n };\n // ── conversation files (stricter access-conveying pair) ──\n conversation_file_add: {\n Args: {\n p_conversation_id: string\n p_file_id: string\n p_label?: string\n p_metadata?: unknown\n p_replace_metadata?: boolean\n }\n Returns: string\n };\n conversation_file_remove: {\n Args: { p_conversation_id: string; p_file_id: string }\n Returns: undefined\n };\n conversation_files: {\n Args: { p_conversation_id: string }\n Returns: {\n created_at: string\n file_id: string\n label: string\n metadata: unknown\n }[]\n };\n // ── agent resources (editor-gated containment authoring) ──\n agent_resource_add: {\n Args: {\n p_agent_id: string\n p_label?: string\n p_metadata?: unknown\n p_source_id: string\n p_source_type: string\n }\n Returns: string\n };\n agent_resource_remove: {\n Args: { p_agent_id: string; p_source_id: string; p_source_type: string }\n Returns: undefined\n };\n // ── categories ──\n cat_list: {\n Args: { p_dimension?: string }\n Returns: {\n color: string\n dimension: string\n icon: string\n id: string\n is_system: boolean\n metadata: unknown\n name: string\n organization_id: string\n parent_id: string\n position: number\n slug: string\n }[]\n };\n cat_create: {\n Args: {\n p_color?: string\n p_dimension: string\n p_icon?: string\n p_name: string\n p_org_id: string\n p_parent_id?: string\n p_slug?: string\n }\n Returns: string\n };\n cat_update: {\n Args: {\n p_category_id: string\n p_color?: string\n p_icon?: string\n p_name: string\n p_position?: number\n p_slug?: string\n }\n Returns: string\n };\n cat_reparent: {\n Args: { p_category_id: string; p_parent_id?: string }\n Returns: string\n };\n cat_delete: { Args: { p_category_id: string }; Returns: string };\n // ── favorites / recents ──\n ues_set: {\n Args: {\n p_entity_id: string\n p_entity_type: string\n p_is_favorite?: boolean\n p_is_hidden?: boolean\n p_is_pinned?: boolean\n }\n Returns: undefined\n };\n ues_list: {\n Args: { p_kind?: string }\n Returns: {\n entity_id: string\n entity_type: string\n is_favorite: boolean\n is_hidden: boolean\n is_pinned: boolean\n last_viewed_at: string\n updated_at: string\n }[]\n };\n ues_get_bulk: {\n Args: { p_entity_ids: string[]; p_entity_type: string }\n Returns: {\n entity_id: string\n is_favorite: boolean\n is_hidden: boolean\n is_pinned: boolean\n last_viewed_at: string\n }[]\n };\n ues_touch: {\n Args: { p_entity_id: string; p_entity_type: string }\n Returns: undefined\n };\n // ── candidates ──\n reference_search_candidates: {\n Args: {\n p_ids?: string[]\n p_limit?: number\n p_search?: string\n p_token: string\n }\n Returns: {\n id: string\n title: string\n }[]\n };\n // ── comments (threaded comment on any entity, W6) ──\n cmt_list: {\n Args: { p_entity_id: string; p_entity_type: string }\n Returns: {\n author_avatar_url: string\n author_display_name: string\n author_email: string\n body: string\n created_at: string\n created_by: string\n entity_id: string\n entity_type: string\n id: string\n organization_id: string\n parent_id: string\n updated_at: string\n }[]\n };\n cmt_add: {\n Args: {\n p_body: string\n p_entity_id: string\n p_entity_type: string\n p_org_id?: string\n p_parent_id?: string\n }\n Returns: string\n };\n cmt_edit: { Args: { p_body: string; p_id: string }; Returns: undefined };\n cmt_delete: { Args: { p_id: string }; Returns: undefined };\n}\n\n/** The name of any demanded RPC — the only strings the dataSource port accepts. */\nexport type DemandedRpcName = keyof DemandedRpcSignatures;\n\n/** Every demanded RPC name, for iteration (the schema probe walks this). */\nexport const DEMANDED_RPC_NAMES: readonly DemandedRpcName[] = [\n \"assoc_add\",\n \"assoc_remove\",\n \"assoc_set_targets\",\n \"assoc_remove_for_entity\",\n \"assoc_for_entity\",\n \"assoc_for_targets\",\n \"assoc_for_sources\",\n \"assoc_members_visible\",\n \"conversation_file_add\",\n \"conversation_file_remove\",\n \"conversation_files\",\n \"agent_resource_add\",\n \"agent_resource_remove\",\n \"cat_list\",\n \"cat_create\",\n \"cat_update\",\n \"cat_reparent\",\n \"cat_delete\",\n \"ues_set\",\n \"ues_list\",\n \"ues_get_bulk\",\n \"ues_touch\",\n \"reference_search_candidates\",\n \"cmt_list\",\n \"cmt_add\",\n \"cmt_edit\",\n \"cmt_delete\",\n];\n\n/** Args type for one demanded RPC. */\nexport type DemandedRpcArgs<N extends DemandedRpcName> =\n DemandedRpcSignatures[N][\"Args\"];\n\n/** Returns type for one demanded RPC. */\nexport type DemandedRpcReturns<N extends DemandedRpcName> =\n DemandedRpcSignatures[N][\"Returns\"];\n","// core/assertDemandedSchema.ts — @ai-matrx/associations/core\n//\n// THE PROBE half of the demanded schema (design Decision 4.3): a dev/CI boot\n// check verifying every demanded RPC ANSWERS on the database the dataSource\n// points at. A function PostgREST cannot find comes back as PGRST202 — the\n// same code `mapPgError` maps to `demanded_schema_violation` at runtime —\n// and the probe throws one unambiguous scream naming every missing function.\n//\n// ZERO side effects by construction: every uuid parameter is probed with a\n// deliberately UNPARSEABLE uuid string. PostgREST resolves the function\n// FIRST (missing → PGRST202), then Postgres fails the argument cast (22P02)\n// before the function body ever executes — so no write RPC can create a row,\n// and every non-PGRST202 outcome (including 22P02, 42501, or success on the\n// cheap parameterless reads) proves the function exists. Verified against\n// the live SECURITY DEFINER bodies 2026-08-29.\n//\n// FALSIFIABLE by construction (the falsifiability rule): `selfTest: true`\n// additionally probes a fabricated function name that MUST come back\n// missing. A dataSource that answers everything (an over-permissive mock, a\n// proxy that swallows errors) fails the self-test — proving the probe CAN\n// fail before you trust its green.\n\nimport { DEMANDED_RPC_NAMES, type DemandedRpcName } from \"../demanded-rpcs.generated\";\nimport type { AssociationsDataSource } from \"../ports\";\n\n/** Unparseable-uuid sentinel: guarantees 22P02 before any function body runs. */\nconst BAD_UUID = \"__not_a_uuid__\";\n\n/** The name the self-test probes; MUST NOT exist in any schema. */\nexport const SELF_TEST_MISSING_RPC = \"assoc_probe_self_test_missing_fn\";\n\n/**\n * Per-RPC probe arguments. Every REQUIRED (non-defaulted) parameter is\n * supplied — an omitted required parameter would itself produce PGRST202 (no\n * matching signature) and fake a violation on a healthy database. Every uuid\n * gets the unparseable sentinel so nothing executes.\n */\nconst PROBE_ARGS: Record<DemandedRpcName, Record<string, unknown>> = {\n // edges — writes\n assoc_add: {\n p_source_type: \"note\",\n p_source_id: BAD_UUID,\n p_target_type: \"task\",\n p_target_id: BAD_UUID,\n },\n assoc_remove: {\n p_source_type: \"note\",\n p_source_id: BAD_UUID,\n p_target_type: \"task\",\n p_target_id: BAD_UUID,\n },\n assoc_set_targets: {\n p_source_type: \"note\",\n p_source_id: BAD_UUID,\n p_target_type: \"task\",\n p_target_ids: [BAD_UUID],\n },\n assoc_remove_for_entity: { p_type: \"note\", p_id: BAD_UUID },\n // edges — reads\n assoc_for_entity: { p_type: \"note\", p_id: BAD_UUID },\n assoc_for_targets: { p_target_type: \"task\", p_target_ids: [BAD_UUID] },\n assoc_for_sources: { p_source_type: \"note\", p_source_ids: [BAD_UUID] },\n assoc_members_visible: { p_target_type: \"task\", p_target_ids: [BAD_UUID] },\n // conversation files\n conversation_file_add: {\n p_conversation_id: BAD_UUID,\n p_file_id: BAD_UUID,\n },\n conversation_file_remove: {\n p_conversation_id: BAD_UUID,\n p_file_id: BAD_UUID,\n },\n conversation_files: { p_conversation_id: BAD_UUID },\n // agent resources\n agent_resource_add: {\n p_agent_id: BAD_UUID,\n p_source_type: \"note\",\n p_source_id: BAD_UUID,\n },\n agent_resource_remove: {\n p_agent_id: BAD_UUID,\n p_source_type: \"note\",\n p_source_id: BAD_UUID,\n },\n // categories\n cat_list: {},\n cat_create: { p_dimension: \"\", p_name: \"\", p_org_id: BAD_UUID },\n cat_update: { p_category_id: BAD_UUID, p_name: \"__probe__\" },\n cat_reparent: { p_category_id: BAD_UUID },\n cat_delete: { p_category_id: BAD_UUID },\n // favorites / recents\n ues_set: { p_entity_type: \"__probe__\", p_entity_id: BAD_UUID },\n ues_list: {},\n ues_get_bulk: { p_entity_type: \"__probe__\", p_entity_ids: [BAD_UUID] },\n ues_touch: { p_entity_type: \"__probe__\", p_entity_id: BAD_UUID },\n // candidates\n reference_search_candidates: { p_token: \"__probe__\", p_limit: 1 },\n // comments (W6) — every fn takes a uuid arg, so the unparseable sentinel\n // guarantees 22P02 before any SECURITY DEFINER body runs (no write occurs).\n cmt_list: { p_entity_type: \"__probe__\", p_entity_id: BAD_UUID },\n cmt_add: {\n p_entity_type: \"__probe__\",\n p_entity_id: BAD_UUID,\n p_body: \"__probe__\",\n },\n cmt_edit: { p_id: BAD_UUID, p_body: \"__probe__\" },\n cmt_delete: { p_id: BAD_UUID },\n};\n\nexport interface DemandedSchemaReport {\n ok: boolean;\n /** Demanded functions the database cannot answer (PGRST202). */\n missing: string[];\n /** Functions the probe could not reach (transport/unknown failure). */\n unreachable: { fn: string; error: unknown }[];\n /** Functions that answered (success or any non-PGRST202 refusal). */\n answered: string[];\n}\n\nexport interface AssertDemandedSchemaOptions {\n /**\n * Also probe a fabricated function name and REQUIRE it to come back\n * missing — proves the probe can fail (the falsifiability rule).\n */\n selfTest?: boolean;\n /** Max in-flight probe calls (default 6). */\n concurrency?: number;\n /**\n * Return the report instead of throwing on violation (for surfaces that\n * render the report). The self-test failure ALWAYS throws.\n */\n throwOnViolation?: boolean;\n}\n\nfunction isMissingFunctionError(error: unknown): boolean {\n if (!error || typeof error !== \"object\") return false;\n return (error as { code?: unknown }).code === \"PGRST202\";\n}\n\n/**\n * Probe every demanded RPC against `dataSource`. Throws an `Error` naming\n * every missing function when the database violates the demanded schema\n * (unless `throwOnViolation: false`), and ALWAYS throws when the probe\n * itself cannot be trusted (unreachable database, failed self-test).\n */\nexport async function assertDemandedSchema(\n dataSource: AssociationsDataSource,\n options: AssertDemandedSchemaOptions = {},\n): Promise<DemandedSchemaReport> {\n const { selfTest = false, concurrency = 6, throwOnViolation = true } = options;\n\n const names: string[] = [...DEMANDED_RPC_NAMES];\n if (selfTest) names.push(SELF_TEST_MISSING_RPC);\n\n const missing: string[] = [];\n const unreachable: { fn: string; error: unknown }[] = [];\n const answered: string[] = [];\n\n let cursor = 0;\n async function worker(): Promise<void> {\n while (cursor < names.length) {\n const fn = names[cursor];\n cursor += 1;\n if (!fn) continue;\n const args =\n fn === SELF_TEST_MISSING_RPC\n ? {}\n : PROBE_ARGS[fn as DemandedRpcName];\n try {\n const { error } = await dataSource.rpc(fn as DemandedRpcName, args);\n if (error == null) answered.push(fn);\n else if (isMissingFunctionError(error)) missing.push(fn);\n else answered.push(fn);\n } catch (e) {\n unreachable.push({ fn, error: e });\n }\n }\n }\n await Promise.all(\n Array.from({ length: Math.min(concurrency, names.length) }, worker),\n );\n\n if (selfTest) {\n const selfTestMissing = missing.includes(SELF_TEST_MISSING_RPC);\n // Remove the fabricated name from the real report either way.\n const idx = missing.indexOf(SELF_TEST_MISSING_RPC);\n if (idx >= 0) missing.splice(idx, 1);\n const answeredIdx = answered.indexOf(SELF_TEST_MISSING_RPC);\n if (answeredIdx >= 0) answered.splice(answeredIdx, 1);\n if (!selfTestMissing) {\n throw new Error(\n \"assertDemandedSchema self-test FAILED: the fabricated function \" +\n `\"${SELF_TEST_MISSING_RPC}\" did not come back as missing (PGRST202). ` +\n \"This probe cannot currently fail, so its green result proves \" +\n \"nothing — the dataSource is swallowing or faking errors.\",\n );\n }\n }\n\n if (unreachable.length > 0) {\n throw new Error(\n \"assertDemandedSchema could not complete: \" +\n `${unreachable.length} probe call(s) failed to reach the database ` +\n `(${unreachable.map((u) => u.fn).join(\", \")}). This is NOT a schema ` +\n \"verdict — fix connectivity and re-run.\",\n );\n }\n\n const ok = missing.length === 0;\n const report: DemandedSchemaReport = { ok, missing, unreachable, answered };\n\n if (!ok && throwOnViolation) {\n throw new Error(\n \"DEMANDED SCHEMA VIOLATION: the database this dataSource points at \" +\n `cannot answer ${missing.length} demanded @ai-matrx/associations ` +\n `function(s): ${missing.join(\", \")}. This package demands the AI ` +\n \"Matrx platform schema (README § The demanded schema); a database \" +\n \"without it is not this package's database.\",\n );\n }\n return report;\n}\n","// react/hooks/useAssociations.ts — @ai-matrx/associations/react\n//\n// Public hook for the unified association edge (`platform.associations`) — the\n// canonical attach/detach primitive any UI consumes to read and mutate an\n// entity's relationships (in BOTH directions) to any other entity.\n//\n// Ported SIGNATURE-BYTE-COMPATIBLE from matrx-frontend\n// `features/scopes/hooks/useAssociations.ts` (W3, 2026-08-29): same args,\n// same return shape, same lazy auto-load semantics. The seam inverted: the\n// Redux selector/thunk cache becomes the package store ridden via\n// `useSyncExternalStore` (design Decision 3) — adoption is a re-export flip\n// plus DELETION of the slice fragments, with call sites unchanged.\n//\n// This is what components reach for; they should never touch the store's raw\n// chokepoint services directly.\n\nimport { useEffect, useRef, useSyncExternalStore } from \"react\";\n\nimport type {\n AssociationEdge,\n AssociationsEntry,\n AssociationTargetType,\n} from \"../../edges\";\nimport {\n associationsKey,\n type AssociationWriteResult,\n} from \"../../core/store\";\nimport { useAssociationsStore } from \"../context\";\n\nexport interface UseAssociationsArgs {\n /** The entity whose relationships to read/manage (the cache endpoint). */\n type: string;\n id: string | null;\n /** Disable the auto-load on mount. Defaults to false (auto-load). */\n autoLoad?: boolean;\n}\n\n// Single declaration lives in the store; re-export so consumers can keep\n// importing it from the hook (doctrine forbids the duplicate definition).\nexport type { AssociationWriteResult };\n\nexport interface UseAssociationsReturn {\n /** Every edge touching this entity, both directions. */\n edges: AssociationEdge[];\n status: AssociationsEntry[\"status\"];\n error: string | null;\n fetchedAt: number | null;\n /** Attach this entity (as source) → a target. */\n add: (args: {\n targetType: AssociationTargetType;\n targetId: string;\n orgId?: string;\n label?: string;\n /** Typed edge role (e.g. 'theme' for a folder/tag) — omit for a role-less edge. */\n role?: string;\n }) => Promise<AssociationWriteResult>;\n /** Detach this entity (as source) → a target. */\n remove: (args: {\n targetType: string;\n targetId: string;\n role?: string;\n }) => Promise<AssociationWriteResult>;\n /** Replace this entity's edges of one target type with exactly `targetIds`. */\n setTargets: (args: {\n targetType: AssociationTargetType;\n targetIds: string[];\n orgId?: string;\n role?: string;\n }) => Promise<AssociationWriteResult>;\n /** Force a refetch of this entity's edges. */\n reload: () => Promise<void>;\n}\n\nconst noopSubscribe = () => () => {};\n\nexport function useAssociations(\n args: UseAssociationsArgs,\n): UseAssociationsReturn {\n const { type, id, autoLoad = true } = args;\n const store = useAssociationsStore();\n\n const key = type && id ? associationsKey(type, id) : null;\n const entry = useSyncExternalStore(\n key ? (cb) => store.subscribe(key, cb) : noopSubscribe,\n () => store.getEdges(type, id ?? \"\"),\n () => store.getEdges(type, id ?? \"\"),\n );\n\n const loadedKey = useRef<string | null>(null);\n useEffect(() => {\n if (!autoLoad || !type || !id) return;\n const k = associationsKey(type, id);\n if (loadedKey.current === k) return;\n loadedKey.current = k;\n void store.load(type, id);\n }, [autoLoad, store, type, id]);\n\n return {\n edges: entry.edges,\n status: entry.status,\n error: entry.error,\n fetchedAt: entry.fetchedAt,\n add: async ({ targetType, targetId, orgId, label, role }) => {\n if (!id) return { ok: false, error: \"Missing entity id\" };\n return store.add({\n sourceType: type,\n sourceId: id,\n targetType,\n targetId,\n ...(orgId !== undefined ? { orgId } : {}),\n ...(label !== undefined ? { label } : {}),\n ...(role !== undefined ? { role } : {}),\n });\n },\n remove: async ({ targetType, targetId, role }) => {\n if (!id) return { ok: false, error: \"Missing entity id\" };\n return store.remove({\n sourceType: type,\n sourceId: id,\n targetType,\n targetId,\n ...(role !== undefined ? { role } : {}),\n });\n },\n setTargets: async ({ targetType, targetIds, orgId, role }) => {\n if (!id) return { ok: false, error: \"Missing entity id\" };\n return store.setTargets({\n sourceType: type,\n sourceId: id,\n targetType,\n targetIds,\n ...(orgId !== undefined ? { orgId } : {}),\n ...(role !== undefined ? { role } : {}),\n });\n },\n reload: async () => {\n if (!type || !id) return;\n await store.load(type, id, { force: true });\n },\n };\n}\n\n/**\n * Convenience alias — same hook, a name that reads naturally on relationship\n * surfaces (\"the things this entity is related to\"). Identical contract.\n */\nexport const useEntityRelationships = useAssociations;\n","// src/results.ts — @ai-matrx/associations\n//\n// The typed never-throw result envelope every service method in this package\n// returns — ported from matrx-frontend `features/scopes/types.ts`\n// (`ScopesRpcError*`, associations extraction W1, 2026-08-29) and renamed to\n// the package vocabulary. The runtime builders/mappers (`ok`/`err`/\n// `mapPgError` — the loud PG-error funnel) arrive with `/core` in W2; the\n// TYPES live at the root so ports and consumers can speak them with zero\n// runtime dependency.\n\nexport type AssociationsRpcErrorCode =\n | \"unauthorized\"\n | \"forbidden_org\"\n | \"forbidden_role\"\n | \"not_found\"\n | \"conflict_in_use\"\n | \"invalid_argument\"\n | \"version_conflict\"\n | \"quota_exceeded\"\n /**\n * THE DEMANDED-SCHEMA SCREAM. A PostgREST missing-function error (PGRST202)\n * on any demanded RPC maps to this code: the database this client is\n * pointed at does not run the schema this package demands (README front\n * door). It always reaches the errorSink — one unambiguous scream, never a\n * mystery toast. Probe it at boot with `assertDemandedSchema` (/core, W2).\n */\n | \"demanded_schema_violation\"\n | \"internal\";\n\nexport interface AssociationsRpcError {\n code: AssociationsRpcErrorCode;\n message: string;\n hint?: string;\n detail?: unknown;\n}\n\nexport type AssociationsRpcResult<T> =\n | { ok: true; data: T }\n | { ok: false; error: AssociationsRpcError };\n\n/**\n * Type-guard narrowing helper for {@link AssociationsRpcResult}. Hosts running\n * with `strictNullChecks: false` lose TypeScript's default control-flow\n * narrowing for boolean discriminants (`if (!res.ok)` reverts to the wide\n * union) — this guard keeps both branches typed everywhere.\n */\nexport function isAssociationsRpcErr<T>(\n r: AssociationsRpcResult<T>,\n): r is { ok: false; error: AssociationsRpcError } {\n return r.ok === false;\n}\n\n/**\n * The structural shape of a PostgREST failure as supabase-js resolves it: a\n * PLAIN OBJECT parsed from the response body — NOT an `Error` instance.\n * (Reading `.message` off `instanceof Error` discards the real database\n * message on every genuine failure; `/core`'s mapper reads these fields.)\n */\nexport interface PgError {\n code?: string | null;\n message: string;\n details?: string | null;\n hint?: string | null;\n}\n","// ─────────────────────────────────────────────────────────────────────────\n// AUTOGENERATED — DO NOT EDIT BY HAND.\n//\n// Source of truth: `platform.entity_types` (Supabase project brsgrqvjdzwihsvnfqkf).\n// Regenerate: pnpm gen:entity-types (in @ai-matrx/associations)\n// Verify drift: pnpm check:entity-types\n//\n// 657 active entity tokens. A token here is FK-valid for\n// `platform.associations.source_type` / `target_type` and any other column\n// referencing `platform.entity_types.token`. Add/retire tokens in the DB via a\n// migration, then regenerate and ship a PATCH release — NEVER hand-edit this\n// file (the next generate overwrites it) and NEVER widen a callsite to a raw\n// string to dodge a token that isn't here yet (writes are STRICT against the\n// installed vocabulary; upgrade the package instead).\n// ─────────────────────────────────────────────────────────────────────────\n\n/** Metadata mirrored from one `platform.entity_types` row. */\nexport interface EntityTypeMeta {\n readonly token: EntityTypeToken;\n /** Postgres schema the backing table lives in. */\n readonly schema: string;\n /** Backing table name. */\n readonly table: string;\n /** Human label from the registry. */\n readonly label: string;\n readonly baseTier: number;\n /** A child/detail row (not a standalone first-class entity). */\n readonly isComponent: boolean;\n readonly isModule: boolean;\n readonly isListed: boolean;\n /** Whether the registry marks this type scopeable by default. */\n readonly scopeable: boolean;\n readonly category: string | null;\n /** Offered as an allowed type for reference context items. */\n readonly referencePickable: boolean;\n /** Human title column for generic candidate pickers (null = not generically listable). */\n readonly titleColumn: string | null;\n /** Knowledge-model bucket: utility | source | destination | hybrid | container. */\n readonly contentRole: string | null;\n /** Admin-assigned chooser bucket (platform.reference_categories.slug); null = bucket by schema. */\n readonly referenceCategory: string | null;\n}\n\n/**\n * EVERY registered entity token (the FK-valid set). Use this for any\n * `source_type` / `target_type` argument so an invalid token is a COMPILE error.\n */\nexport type EntityTypeToken =\n | \"access_request\"\n | \"activity\"\n | \"agent\"\n | \"agent_card\"\n | \"agent_definition_version\"\n | \"agent_drift_alert\"\n | \"agent_exemplar\"\n | \"agent_mandate_note\"\n | \"agent_prompt_remediation\"\n | \"agent_run\"\n | \"agent_run_stage\"\n | \"agent_shortcut\"\n | \"agent_surface_binding\"\n | \"agent_template\"\n | \"agent_usage\"\n | \"ai_api\"\n | \"ai_endpoint\"\n | \"ai_model\"\n | \"ai_model_alias\"\n | \"ai_offering\"\n | \"ai_provider\"\n | \"ai_setting\"\n | \"app\"\n | \"app_definition_version\"\n | \"app_error\"\n | \"app_execution\"\n | \"app_instance\"\n | \"app_log\"\n | \"app_rate_limit\"\n | \"app_setting\"\n | \"app_sync_status\"\n | \"approach\"\n | \"artifact\"\n | \"assessment\"\n | \"assessment_item\"\n | \"assessment_result\"\n | \"assist\"\n | \"batch_cost_event\"\n | \"batch_provider_batch\"\n | \"batch_work_item\"\n | \"browser_account_binding\"\n | \"browser_action_event\"\n | \"browser_authenticator_window\"\n | \"browser_capture\"\n | \"browser_control_request\"\n | \"browser_handoff\"\n | \"browser_login_attempt\"\n | \"browser_login_recipe\"\n | \"browser_profile\"\n | \"browser_profile_checkpoint\"\n | \"browser_run\"\n | \"browser_site_observation\"\n | \"browser_site_policy\"\n | \"browser_stream_ticket\"\n | \"canvas_comment\"\n | \"canvas_comment_like\"\n | \"canvas_item\"\n | \"canvas_item_state\"\n | \"canvas_like\"\n | \"canvas_score\"\n | \"canvas_view\"\n | \"category\"\n | \"cmp_entry\"\n | \"cmp_feedback\"\n | \"code_file\"\n | \"code_folder\"\n | \"code_repository\"\n | \"coding_session\"\n | \"coding_session_entry\"\n | \"comment\"\n | \"commerce_asset_allocation\"\n | \"commerce_asset_grading\"\n | \"commerce_asset_identifier\"\n | \"commerce_asset_lot_event\"\n | \"commerce_asset_mandate_result\"\n | \"commerce_asset_price_factor\"\n | \"commerce_asset_reshoot_request\"\n | \"commerce_asset_review\"\n | \"commerce_asset_unknown\"\n | \"commerce_certified_printer\"\n | \"commerce_cloud_sync_connection\"\n | \"commerce_ebay_business_policy\"\n | \"commerce_ebay_category\"\n | \"commerce_ebay_category_aspect\"\n | \"commerce_ebay_category_tree\"\n | \"commerce_ebay_custom_policy\"\n | \"commerce_ebay_inventory_item\"\n | \"commerce_ebay_inventory_item_group\"\n | \"commerce_ebay_inventory_item_group_member\"\n | \"commerce_ebay_inventory_location\"\n | \"commerce_ebay_listing\"\n | \"commerce_ebay_marketplace_policy\"\n | \"commerce_ebay_media_asset\"\n | \"commerce_ebay_notification_destination\"\n | \"commerce_ebay_notification_event\"\n | \"commerce_ebay_notification_subscription\"\n | \"commerce_ebay_notification_topic\"\n | \"commerce_ebay_offer\"\n | \"commerce_ebay_order\"\n | \"commerce_ebay_order_line_item\"\n | \"commerce_ebay_shipping_fulfillment\"\n | \"commerce_ebay_store_category\"\n | \"commerce_human_correction\"\n | \"commerce_intake_artifact\"\n | \"commerce_intake_asset\"\n | \"commerce_intake_batch\"\n | \"commerce_label_batch\"\n | \"commerce_label_code\"\n | \"commerce_marketplace_account\"\n | \"commerce_marketplace_account_deletion_audit\"\n | \"commerce_marketplace_api_call\"\n | \"commerce_marketplace_rate_budget\"\n | \"commerce_marketplace_site\"\n | \"commerce_marketplace_sync_run\"\n | \"commerce_prediction_outcome\"\n | \"commerce_print_order\"\n | \"commerce_product\"\n | \"commerce_product_channel_ref\"\n | \"commerce_product_media\"\n | \"commerce_product_variant\"\n | \"commerce_recall_audit\"\n | \"comparison_set\"\n | \"contact_medium\"\n | \"contact_submission\"\n | \"content_ir_kind\"\n | \"content_ir_kind_component\"\n | \"content_ir_kind_component_incident\"\n | \"content_ir_kind_conformance\"\n | \"content_ir_kind_edge\"\n | \"content_ir_kind_example\"\n | \"content_ir_kind_instance\"\n | \"content_ir_kind_surface\"\n | \"context_item\"\n | \"context_item_suggestion\"\n | \"conversation\"\n | \"conversation_value\"\n | \"crm_address\"\n | \"crm_affiliation\"\n | \"crm_blocklist_entry\"\n | \"crm_contact_candidate\"\n | \"crm_deal\"\n | \"crm_deal_stage_event\"\n | \"crm_enrichment_call\"\n | \"crm_interaction\"\n | \"crm_merge_candidate\"\n | \"crm_outreach_list\"\n | \"crm_outreach_list_member\"\n | \"crm_party_merge\"\n | \"crm_registry_ingest_run\"\n | \"crm_registry_source\"\n | \"crm_saved_view\"\n | \"crm_sending_event\"\n | \"crm_sending_identity\"\n | \"crm_sending_identity_check\"\n | \"crm_sending_policy\"\n | \"custom_entity_definition\"\n | \"custom_field_definition\"\n | \"custom_field_target\"\n | \"custom_record\"\n | \"cx_agent_memory\"\n | \"cx_agent_plan\"\n | \"cx_agent_task\"\n | \"cx_code_edit\"\n | \"cx_code_message_file\"\n | \"cx_media\"\n | \"cx_observational_memory\"\n | \"cx_observational_memory_event\"\n | \"cx_pending_injection\"\n | \"cx_request\"\n | \"cx_request_snapshot\"\n | \"cx_tool_trace\"\n | \"cx_user_request\"\n | \"cx_user_todo\"\n | \"data_store\"\n | \"dataset\"\n | \"derive_run\"\n | \"dict_setting\"\n | \"dm_conversation\"\n | \"dm_message\"\n | \"dm_participant\"\n | \"domain_classification\"\n | \"esign_campaign\"\n | \"esign_campaign_member\"\n | \"esign_consent_disclosure\"\n | \"esign_envelope\"\n | \"esign_envelope_certificate\"\n | \"esign_envelope_document\"\n | \"esign_envelope_event\"\n | \"esign_envelope_external_ref\"\n | \"esign_envelope_signer\"\n | \"esign_provider\"\n | \"esign_provider_binding\"\n | \"esign_signing_key\"\n | \"fc_card\"\n | \"fc_detail\"\n | \"fc_set\"\n | \"feature_doc\"\n | \"file\"\n | \"file_analysis\"\n | \"file_entities\"\n | \"file_overrides\"\n | \"file_page_annotations\"\n | \"file_pages\"\n | \"file_version\"\n | \"flexible_data\"\n | \"folder\"\n | \"game_badge\"\n | \"game_result\"\n | \"game_room\"\n | \"global_execution\"\n | \"global_execution_checkpoint\"\n | \"global_execution_event\"\n | \"global_meter_entry\"\n | \"global_origin\"\n | \"global_request\"\n | \"growth_loop_event\"\n | \"growth_loop_run\"\n | \"growth_loop_stage_run\"\n | \"guided_checklist_run\"\n | \"heatmap_save\"\n | \"hindsight_enrollment\"\n | \"hindsight_finding\"\n | \"hindsight_regression_case\"\n | \"hindsight_replay\"\n | \"hindsight_replay_step\"\n | \"hindsight_review\"\n | \"hr_access_audit\"\n | \"hr_access_role\"\n | \"hr_accommodation_request\"\n | \"hr_ai_evidence\"\n | \"hr_alert_routing_rule\"\n | \"hr_application\"\n | \"hr_approval_authority\"\n | \"hr_approval_delegation\"\n | \"hr_asset\"\n | \"hr_asset_assignment\"\n | \"hr_attendance_exception\"\n | \"hr_auto_close_rule\"\n | \"hr_availability\"\n | \"hr_background_check\"\n | \"hr_benefits_event\"\n | \"hr_calculation_snapshot\"\n | \"hr_candidate\"\n | \"hr_candidate_conversion\"\n | \"hr_candidate_message\"\n | \"hr_careers_portal\"\n | \"hr_checklist_item\"\n | \"hr_checklist_run\"\n | \"hr_checklist_template\"\n | \"hr_checklist_template_item\"\n | \"hr_compensation\"\n | \"hr_corrective_action\"\n | \"hr_course\"\n | \"hr_course_version\"\n | \"hr_credential\"\n | \"hr_crew\"\n | \"hr_deduction_code\"\n | \"hr_department\"\n | \"hr_derived_grant\"\n | \"hr_disposition_event\"\n | \"hr_earning_code\"\n | \"hr_eeo_response\"\n | \"hr_emergency_contact\"\n | \"hr_employee\"\n | \"hr_employee_private\"\n | \"hr_employer_profile\"\n | \"hr_employment\"\n | \"hr_employment_pin\"\n | \"hr_engagement\"\n | \"hr_establishment\"\n | \"hr_external_identity\"\n | \"hr_field_policy\"\n | \"hr_holiday\"\n | \"hr_holiday_calendar\"\n | \"hr_i9\"\n | \"hr_i9_document\"\n | \"hr_incident\"\n | \"hr_incident_party\"\n | \"hr_interview\"\n | \"hr_interview_kit\"\n | \"hr_job_title\"\n | \"hr_jurisdiction\"\n | \"hr_jurisdiction_rule\"\n | \"hr_jurisdiction_rule_class\"\n | \"hr_jurisdiction_rule_org_decision\"\n | \"hr_jurisdiction_rule_test\"\n | \"hr_kiosk_device\"\n | \"hr_kiosk_session\"\n | \"hr_labor_target\"\n | \"hr_leave_case\"\n | \"hr_leave_enrollment\"\n | \"hr_leave_ledger\"\n | \"hr_leave_policy\"\n | \"hr_leave_request\"\n | \"hr_legal_hold\"\n | \"hr_legal_hold_item\"\n | \"hr_location\"\n | \"hr_new_hire_report\"\n | \"hr_offer\"\n | \"hr_opening\"\n | \"hr_overtime_alert\"\n | \"hr_overtime_alert_rule\"\n | \"hr_overtime_preapproval\"\n | \"hr_pay_group\"\n | \"hr_pay_period\"\n | \"hr_pay_period_employment\"\n | \"hr_payroll_export\"\n | \"hr_payroll_export_line\"\n | \"hr_position_assignment\"\n | \"hr_posting\"\n | \"hr_posting_publication\"\n | \"hr_provider_binding\"\n | \"hr_provider_event\"\n | \"hr_provisioning_result\"\n | \"hr_punch\"\n | \"hr_recalculation_batch\"\n | \"hr_record_class\"\n | \"hr_records_request\"\n | \"hr_reference_check\"\n | \"hr_reporting_line\"\n | \"hr_requisition\"\n | \"hr_restricted_note\"\n | \"hr_retention_rule\"\n | \"hr_role_assignment\"\n | \"hr_schedule\"\n | \"hr_schedule_change\"\n | \"hr_schedule_guidance\"\n | \"hr_schedule_template\"\n | \"hr_schedule_template_shift\"\n | \"hr_scorecard\"\n | \"hr_separation\"\n | \"hr_shift\"\n | \"hr_shift_claim\"\n | \"hr_staffing_requirement\"\n | \"hr_survey\"\n | \"hr_survey_invitation\"\n | \"hr_survey_question\"\n | \"hr_survey_response\"\n | \"hr_tax_registration\"\n | \"hr_tax_withholding\"\n | \"hr_time_adjustment\"\n | \"hr_training_assignment\"\n | \"hr_training_attempt\"\n | \"hr_transcript_entry\"\n | \"hr_verification_letter_request\"\n | \"hr_work_interval\"\n | \"hr_workflow_binding\"\n | \"hr_workflow_decision\"\n | \"hr_workflow_definition\"\n | \"hr_workflow_event\"\n | \"hr_workflow_failure\"\n | \"hr_workflow_flow_type\"\n | \"hr_workflow_instance\"\n | \"hr_workflow_step\"\n | \"hr_workflow_step_definition\"\n | \"hr_workweek\"\n | \"iam_api_key\"\n | \"industry_curator\"\n | \"interview_document_revision\"\n | \"interview_hole\"\n | \"interview_question\"\n | \"interview_session\"\n | \"interview_turn\"\n | \"invitation\"\n | \"invitation_code\"\n | \"invitation_request\"\n | \"item_mastery\"\n | \"judge_verdict\"\n | \"kg_alert\"\n | \"kg_suggestion_ack\"\n | \"kg_sweep_queue\"\n | \"kg_sweep_run\"\n | \"kg_sweep_state\"\n | \"kg_value_match\"\n | \"league_membership\"\n | \"learn_doc\"\n | \"library_doc\"\n | \"mandate\"\n | \"mandate_binding\"\n | \"mandate_treatment\"\n | \"marketing_initiative\"\n | \"masterwork_corpus_item\"\n | \"masterwork_run\"\n | \"membership\"\n | \"message\"\n | \"message_template\"\n | \"ner_shadow\"\n | \"note\"\n | \"note_folder\"\n | \"notification\"\n | \"notification_channel_preference\"\n | \"notification_event_override\"\n | \"notification_event_type\"\n | \"notification_preference\"\n | \"ops_issue_event\"\n | \"ops_proof_check\"\n | \"ops_proof_run\"\n | \"ops_proof_scenario\"\n | \"organization\"\n | \"output_feedback\"\n | \"page_extraction_job\"\n | \"page_extraction_page_run\"\n | \"party\"\n | \"party_contact_point\"\n | \"pc_article\"\n | \"pc_episode\"\n | \"pc_show\"\n | \"pc_studio_run\"\n | \"pc_studio_run_asset\"\n | \"pdf_redaction_audit\"\n | \"plan_cms_fill_item\"\n | \"plan_cms_fill_job\"\n | \"plan_entity\"\n | \"plan_node\"\n | \"plan_node_artifact\"\n | \"plan_node_step\"\n | \"plan_profile\"\n | \"platform_actor_session\"\n | \"platform_actor_token\"\n | \"platform_actor_token_event\"\n | \"platform_continued_access\"\n | \"platform_outcome_event\"\n | \"platform_outsider_consumer\"\n | \"platform_saved_view\"\n | \"podcast_race\"\n | \"processed_document\"\n | \"processed_document_page\"\n | \"product_capture_file\"\n | \"product_capture_item\"\n | \"product_capture_payload\"\n | \"product_capture_product\"\n | \"product_capture_question\"\n | \"project\"\n | \"provision\"\n | \"purpose\"\n | \"quiz_session\"\n | \"rag_ingest_run\"\n | \"redaction_mapping\"\n | \"research_analysis\"\n | \"research_content\"\n | \"research_context_bundle\"\n | \"research_document\"\n | \"research_keyword\"\n | \"research_media\"\n | \"research_source\"\n | \"research_synthesis\"\n | \"research_tag\"\n | \"research_template\"\n | \"research_topic\"\n | \"route_manifest_entry\"\n | \"rulebook\"\n | \"sandbox_instance\"\n | \"sch_agent_task\"\n | \"sch_run\"\n | \"sch_task\"\n | \"sch_trigger\"\n | \"scope\"\n | \"scope_association_suggestion\"\n | \"scope_item_value_suggestion\"\n | \"scope_suggestion\"\n | \"scope_type\"\n | \"seo_ai_visibility_citation\"\n | \"seo_ai_visibility_claim\"\n | \"seo_ai_visibility_panel\"\n | \"seo_ai_visibility_response\"\n | \"seo_ai_visibility_signal\"\n | \"seo_backlink\"\n | \"seo_backlink_change_event\"\n | \"seo_backlink_dimension_snapshot\"\n | \"seo_backlink_observation\"\n | \"seo_backlink_snapshot\"\n | \"seo_change_assessment\"\n | \"seo_change_event\"\n | \"seo_change_item\"\n | \"seo_change_metric\"\n | \"seo_change_set\"\n | \"seo_change_theory\"\n | \"seo_collection_run\"\n | \"seo_competitor\"\n | \"seo_competitor_observation\"\n | \"seo_competitor_opportunity\"\n | \"seo_coverage_mention\"\n | \"seo_coverage_tracker\"\n | \"seo_dimension_value_matcher\"\n | \"seo_engine_schedule\"\n | \"seo_geo_place\"\n | \"seo_gsc_dig_rule\"\n | \"seo_keyword\"\n | \"seo_keyword_class_rule\"\n | \"seo_keyword_edge\"\n | \"seo_keyword_facet\"\n | \"seo_keyword_market\"\n | \"seo_keyword_market_observation\"\n | \"seo_keyword_place\"\n | \"seo_keyword_saved_view\"\n | \"seo_keyword_topic\"\n | \"seo_landscape_brief\"\n | \"seo_link_gap_domain\"\n | \"seo_link_gap_match\"\n | \"seo_page_measurement_health\"\n | \"seo_page_performance\"\n | \"seo_provider_call\"\n | \"seo_provider_task\"\n | \"seo_rank_observation\"\n | \"seo_rank_target\"\n | \"seo_raw_payload\"\n | \"seo_referring_domain_profile\"\n | \"seo_reputation_case\"\n | \"seo_search_performance_daily\"\n | \"seo_serp_mention\"\n | \"seo_serp_opportunity\"\n | \"seo_serp_result\"\n | \"seo_serp_snapshot\"\n | \"seo_site_geo_area\"\n | \"seo_site_keyword_offering\"\n | \"seo_site_keyword_value\"\n | \"seo_site_offering_value\"\n | \"seo_site_topic_value\"\n | \"seo_site_value_combo\"\n | \"seo_site_value_worth\"\n | \"seo_site_vocabulary\"\n | \"seo_source_request\"\n | \"seo_starter_pack\"\n | \"seo_starter_pack_item\"\n | \"seo_story_angle\"\n | \"seo_topic\"\n | \"seo_web_analytics_daily\"\n | \"shared_canvas_item\"\n | \"short_link\"\n | \"skill\"\n | \"skill_render_definition\"\n | \"sms_consent\"\n | \"sms_conversation\"\n | \"sms_message\"\n | \"sms_message_media\"\n | \"sms_notification\"\n | \"sms_notification_preference\"\n | \"sms_phone_number\"\n | \"structured_list\"\n | \"studio_documents\"\n | \"studio_recording_chunks\"\n | \"studio_recording_segments\"\n | \"studio_run\"\n | \"studio_session\"\n | \"studio_session_settings\"\n | \"study_attempt\"\n | \"study_goal\"\n | \"study_media\"\n | \"study_plan\"\n | \"study_plan_block\"\n | \"study_plan_day\"\n | \"study_reminder_context\"\n | \"study_reminder_delivery\"\n | \"study_session\"\n | \"surface\"\n | \"system_context_item\"\n | \"system_error\"\n | \"system_personal_org_failure\"\n | \"system_write_failure\"\n | \"task\"\n | \"thread\"\n | \"tool\"\n | \"tool_bundle\"\n | \"tool_call\"\n | \"tool_definition_version\"\n | \"tool_test_sample\"\n | \"tool_ui\"\n | \"tool_ui_incident\"\n | \"tool_ui_version\"\n | \"transcript\"\n | \"udt_dataset_fields\"\n | \"udt_dataset_rows\"\n | \"udt_document\"\n | \"udt_structured_list_items\"\n | \"ui_surface_agent_pref\"\n | \"ui_surface_config\"\n | \"user_achievement\"\n | \"user_analysis_preference\"\n | \"user_bookmark\"\n | \"user_email_preference\"\n | \"user_feedback\"\n | \"user_form_profile\"\n | \"user_markdown_sample\"\n | \"user_memory\"\n | \"user_preference\"\n | \"user_profile\"\n | \"user_stat\"\n | \"user_surface_state\"\n | \"voice\"\n | \"war_room\"\n | \"wbx_capture\"\n | \"wbx_guidance\"\n | \"wbx_highlight\"\n | \"wbx_pattern\"\n | \"wbx_screenshot\"\n | \"wbx_seo_audit\"\n | \"wc_claim\"\n | \"wc_impairment_definition\"\n | \"wc_injury\"\n | \"wc_report\"\n | \"web_analysis_item\"\n | \"web_brand\"\n | \"web_brand_asset\"\n | \"web_brand_offering\"\n | \"web_business_fact\"\n | \"web_business_location\"\n | \"web_crawl_event\"\n | \"web_crawl_preset\"\n | \"web_crawl_schedule\"\n | \"web_crawl_session\"\n | \"web_crawl_url\"\n | \"web_discovered_item\"\n | \"web_finding\"\n | \"web_gsc_page_stat\"\n | \"web_link_edge\"\n | \"web_listing_publisher\"\n | \"web_location_listing\"\n | \"web_offering_template\"\n | \"web_page\"\n | \"web_page_content\"\n | \"web_page_evidence\"\n | \"web_page_sitemap\"\n | \"web_property\"\n | \"web_provider\"\n | \"web_result\"\n | \"web_screenshot\"\n | \"web_site\"\n | \"web_site_endpoint_rule\"\n | \"web_site_item_config\"\n | \"web_site_offering\"\n | \"web_sitemap\"\n | \"web_snapshot\"\n | \"wf_node_data_slot\"\n | \"work_item\"\n | \"workbook\"\n | \"workflow\"\n | \"workflow_card\"\n | \"workflow_checkpoint\"\n | \"workflow_comparison\"\n | \"workflow_definition_version\"\n | \"workflow_idempotency\"\n | \"workflow_job\"\n | \"workflow_node_events\"\n | \"workflow_node_outcome\"\n | \"workflow_plan\"\n | \"workflow_plan_event\"\n | \"workflow_plan_sample\"\n | \"workflow_recovery_audit\"\n | \"workflow_run\"\n | \"workflow_run_log\"\n | \"workflow_runtime_surface\"\n | \"workflow_template\"\n | \"workflow_trigger\"\n | \"workflow_trigger_fire\"\n | \"working_document\"\n | \"youtube_search\"\n | \"youtube_video\";\n\n/** Tokens flagged `reference_pickable` — offered in reference \"Allowed types\" choosers. */\nexport type ReferencePickableEntityToken =\n | \"agent\"\n | \"agent_shortcut\"\n | \"agent_surface_binding\"\n | \"agent_template\"\n | \"ai_api\"\n | \"ai_endpoint\"\n | \"ai_model\"\n | \"ai_provider\"\n | \"ai_setting\"\n | \"app\"\n | \"assessment\"\n | \"canvas_comment\"\n | \"canvas_item\"\n | \"canvas_score\"\n | \"category\"\n | \"code_file\"\n | \"code_folder\"\n | \"code_repository\"\n | \"comparison_set\"\n | \"contact_submission\"\n | \"content_ir_kind\"\n | \"content_ir_kind_instance\"\n | \"context_item\"\n | \"conversation\"\n | \"crm_deal\"\n | \"crm_outreach_list\"\n | \"cx_agent_memory\"\n | \"data_store\"\n | \"dataset\"\n | \"fc_set\"\n | \"feature_doc\"\n | \"file\"\n | \"flexible_data\"\n | \"folder\"\n | \"game_result\"\n | \"heatmap_save\"\n | \"hr_asset\"\n | \"hr_candidate\"\n | \"hr_careers_portal\"\n | \"hr_checklist_template\"\n | \"hr_course\"\n | \"hr_crew\"\n | \"hr_deduction_code\"\n | \"hr_department\"\n | \"hr_earning_code\"\n | \"hr_employee\"\n | \"hr_holiday_calendar\"\n | \"hr_interview_kit\"\n | \"hr_job_title\"\n | \"hr_jurisdiction\"\n | \"hr_jurisdiction_rule_class\"\n | \"hr_leave_policy\"\n | \"hr_location\"\n | \"hr_pay_group\"\n | \"hr_posting\"\n | \"hr_record_class\"\n | \"hr_requisition\"\n | \"hr_schedule\"\n | \"hr_schedule_template\"\n | \"hr_survey\"\n | \"league_membership\"\n | \"learn_doc\"\n | \"marketing_initiative\"\n | \"message_template\"\n | \"note\"\n | \"note_folder\"\n | \"organization\"\n | \"page_extraction_job\"\n | \"party\"\n | \"pc_article\"\n | \"pc_episode\"\n | \"pc_show\"\n | \"pc_studio_run\"\n | \"processed_document\"\n | \"project\"\n | \"quiz_session\"\n | \"research_template\"\n | \"research_topic\"\n | \"rulebook\"\n | \"sch_task\"\n | \"scope_type\"\n | \"seo_topic\"\n | \"shared_canvas_item\"\n | \"skill\"\n | \"skill_render_definition\"\n | \"structured_list\"\n | \"studio_session\"\n | \"study_goal\"\n | \"study_media\"\n | \"study_plan\"\n | \"study_plan_block\"\n | \"surface\"\n | \"task\"\n | \"thread\"\n | \"tool\"\n | \"tool_bundle\"\n | \"transcript\"\n | \"udt_document\"\n | \"user_markdown_sample\"\n | \"user_profile\"\n | \"voice\"\n | \"war_room\"\n | \"wbx_capture\"\n | \"wbx_pattern\"\n | \"web_analysis_item\"\n | \"web_brand\"\n | \"web_provider\"\n | \"web_site\"\n | \"workbook\"\n | \"workflow\"\n | \"workflow_plan\"\n | \"workflow_template\"\n | \"workflow_trigger\"\n | \"working_document\";\n\n/** Tokens flagged `is_component` — child/detail rows, not standalone entities. */\nexport type ComponentEntityToken =\n | \"agent_card\"\n | \"agent_definition_version\"\n | \"agent_drift_alert\"\n | \"agent_run_stage\"\n | \"agent_usage\"\n | \"app_definition_version\"\n | \"app_error\"\n | \"app_execution\"\n | \"app_rate_limit\"\n | \"artifact\"\n | \"assessment_item\"\n | \"browser_account_binding\"\n | \"browser_action_event\"\n | \"browser_capture\"\n | \"browser_control_request\"\n | \"browser_handoff\"\n | \"browser_login_attempt\"\n | \"browser_run\"\n | \"browser_site_observation\"\n | \"canvas_item_state\"\n | \"cmp_entry\"\n | \"coding_session_entry\"\n | \"commerce_asset_allocation\"\n | \"commerce_asset_grading\"\n | \"commerce_asset_identifier\"\n | \"commerce_asset_lot_event\"\n | \"commerce_asset_mandate_result\"\n | \"commerce_asset_price_factor\"\n | \"commerce_asset_reshoot_request\"\n | \"commerce_asset_review\"\n | \"commerce_asset_unknown\"\n | \"commerce_ebay_business_policy\"\n | \"commerce_ebay_custom_policy\"\n | \"commerce_ebay_inventory_item\"\n | \"commerce_ebay_inventory_item_group\"\n | \"commerce_ebay_inventory_item_group_member\"\n | \"commerce_ebay_inventory_location\"\n | \"commerce_ebay_listing\"\n | \"commerce_ebay_media_asset\"\n | \"commerce_ebay_notification_subscription\"\n | \"commerce_ebay_offer\"\n | \"commerce_ebay_order\"\n | \"commerce_ebay_order_line_item\"\n | \"commerce_ebay_shipping_fulfillment\"\n | \"commerce_ebay_store_category\"\n | \"commerce_human_correction\"\n | \"commerce_intake_artifact\"\n | \"commerce_intake_asset\"\n | \"commerce_label_code\"\n | \"commerce_marketplace_site\"\n | \"commerce_marketplace_sync_run\"\n | \"commerce_prediction_outcome\"\n | \"commerce_product_channel_ref\"\n | \"commerce_product_media\"\n | \"commerce_product_variant\"\n | \"commerce_recall_audit\"\n | \"content_ir_kind_component\"\n | \"content_ir_kind_component_incident\"\n | \"content_ir_kind_conformance\"\n | \"content_ir_kind_edge\"\n | \"content_ir_kind_example\"\n | \"content_ir_kind_surface\"\n | \"conversation_value\"\n | \"crm_address\"\n | \"crm_affiliation\"\n | \"crm_contact_candidate\"\n | \"crm_deal_stage_event\"\n | \"crm_interaction\"\n | \"crm_merge_candidate\"\n | \"crm_outreach_list_member\"\n | \"crm_party_merge\"\n | \"crm_sending_event\"\n | \"crm_sending_identity_check\"\n | \"custom_record\"\n | \"cx_agent_plan\"\n | \"cx_agent_task\"\n | \"cx_code_edit\"\n | \"cx_code_message_file\"\n | \"cx_media\"\n | \"cx_observational_memory\"\n | \"cx_observational_memory_event\"\n | \"cx_pending_injection\"\n | \"cx_request\"\n | \"cx_request_snapshot\"\n | \"cx_tool_trace\"\n | \"cx_user_todo\"\n | \"dm_message\"\n | \"dm_participant\"\n | \"esign_campaign_member\"\n | \"esign_envelope_certificate\"\n | \"esign_envelope_document\"\n | \"esign_envelope_external_ref\"\n | \"esign_envelope_signer\"\n | \"fc_detail\"\n | \"file_analysis\"\n | \"file_entities\"\n | \"file_overrides\"\n | \"file_page_annotations\"\n | \"file_pages\"\n | \"file_version\"\n | \"global_execution\"\n | \"global_execution_checkpoint\"\n | \"global_execution_event\"\n | \"global_meter_entry\"\n | \"growth_loop_event\"\n | \"growth_loop_stage_run\"\n | \"hindsight_finding\"\n | \"hindsight_replay\"\n | \"hindsight_review\"\n | \"hr_application\"\n | \"hr_asset_assignment\"\n | \"hr_attendance_exception\"\n | \"hr_availability\"\n | \"hr_benefits_event\"\n | \"hr_candidate_conversion\"\n | \"hr_candidate_message\"\n | \"hr_checklist_item\"\n | \"hr_checklist_run\"\n | \"hr_checklist_template_item\"\n | \"hr_course_version\"\n | \"hr_credential\"\n | \"hr_engagement\"\n | \"hr_establishment\"\n | \"hr_external_identity\"\n | \"hr_holiday\"\n | \"hr_i9_document\"\n | \"hr_incident_party\"\n | \"hr_interview\"\n | \"hr_jurisdiction_rule_test\"\n | \"hr_labor_target\"\n | \"hr_leave_enrollment\"\n | \"hr_leave_ledger\"\n | \"hr_leave_request\"\n | \"hr_legal_hold_item\"\n | \"hr_new_hire_report\"\n | \"hr_opening\"\n | \"hr_overtime_alert\"\n | \"hr_overtime_preapproval\"\n | \"hr_pay_period\"\n | \"hr_pay_period_employment\"\n | \"hr_payroll_export\"\n | \"hr_payroll_export_line\"\n | \"hr_position_assignment\"\n | \"hr_posting_publication\"\n | \"hr_provider_event\"\n | \"hr_provisioning_result\"\n | \"hr_punch\"\n | \"hr_reporting_line\"\n | \"hr_schedule_change\"\n | \"hr_schedule_template_shift\"\n | \"hr_scorecard\"\n | \"hr_shift\"\n | \"hr_shift_claim\"\n | \"hr_staffing_requirement\"\n | \"hr_survey_invitation\"\n | \"hr_survey_question\"\n | \"hr_survey_response\"\n | \"hr_tax_registration\"\n | \"hr_time_adjustment\"\n | \"hr_training_assignment\"\n | \"hr_training_attempt\"\n | \"hr_transcript_entry\"\n | \"hr_work_interval\"\n | \"hr_workflow_binding\"\n | \"hr_workflow_failure\"\n | \"hr_workflow_step\"\n | \"hr_workflow_step_definition\"\n | \"hr_workweek\"\n | \"interview_document_revision\"\n | \"interview_hole\"\n | \"interview_question\"\n | \"interview_turn\"\n | \"masterwork_corpus_item\"\n | \"masterwork_run\"\n | \"message\"\n | \"ops_proof_run\"\n | \"party_contact_point\"\n | \"pc_studio_run_asset\"\n | \"plan_cms_fill_item\"\n | \"plan_cms_fill_job\"\n | \"plan_node_artifact\"\n | \"plan_node_step\"\n | \"processed_document_page\"\n | \"product_capture_file\"\n | \"product_capture_payload\"\n | \"product_capture_product\"\n | \"product_capture_question\"\n | \"redaction_mapping\"\n | \"research_analysis\"\n | \"research_content\"\n | \"research_document\"\n | \"research_keyword\"\n | \"research_media\"\n | \"research_source\"\n | \"research_synthesis\"\n | \"research_tag\"\n | \"sch_agent_task\"\n | \"sch_run\"\n | \"sch_trigger\"\n | \"seo_ai_visibility_citation\"\n | \"seo_ai_visibility_claim\"\n | \"seo_ai_visibility_panel\"\n | \"seo_ai_visibility_response\"\n | \"seo_ai_visibility_signal\"\n | \"seo_backlink\"\n | \"seo_backlink_change_event\"\n | \"seo_backlink_dimension_snapshot\"\n | \"seo_backlink_observation\"\n | \"seo_backlink_snapshot\"\n | \"seo_change_assessment\"\n | \"seo_change_event\"\n | \"seo_change_item\"\n | \"seo_change_metric\"\n | \"seo_change_set\"\n | \"seo_change_theory\"\n | \"seo_competitor\"\n | \"seo_competitor_observation\"\n | \"seo_competitor_opportunity\"\n | \"seo_coverage_mention\"\n | \"seo_coverage_tracker\"\n | \"seo_dimension_value_matcher\"\n | \"seo_keyword_market_observation\"\n | \"seo_keyword_saved_view\"\n | \"seo_landscape_brief\"\n | \"seo_link_gap_domain\"\n | \"seo_link_gap_match\"\n | \"seo_page_measurement_health\"\n | \"seo_page_performance\"\n | \"seo_provider_call\"\n | \"seo_provider_task\"\n | \"seo_rank_observation\"\n | \"seo_raw_payload\"\n | \"seo_referring_domain_profile\"\n | \"seo_reputation_case\"\n | \"seo_search_performance_daily\"\n | \"seo_serp_mention\"\n | \"seo_serp_opportunity\"\n | \"seo_serp_result\"\n | \"seo_serp_snapshot\"\n | \"seo_site_geo_area\"\n | \"seo_site_keyword_offering\"\n | \"seo_site_keyword_value\"\n | \"seo_site_offering_value\"\n | \"seo_site_topic_value\"\n | \"seo_site_value_combo\"\n | \"seo_site_value_worth\"\n | \"seo_site_vocabulary\"\n | \"seo_web_analytics_daily\"\n | \"sms_message\"\n | \"sms_message_media\"\n | \"studio_documents\"\n | \"studio_recording_segments\"\n | \"studio_session_settings\"\n | \"tool_call\"\n | \"tool_definition_version\"\n | \"tool_test_sample\"\n | \"tool_ui\"\n | \"tool_ui_incident\"\n | \"tool_ui_version\"\n | \"udt_dataset_fields\"\n | \"udt_dataset_rows\"\n | \"udt_structured_list_items\"\n | \"wc_impairment_definition\"\n | \"wc_injury\"\n | \"wc_report\"\n | \"web_brand_asset\"\n | \"web_brand_offering\"\n | \"web_business_fact\"\n | \"web_business_location\"\n | \"web_crawl_event\"\n | \"web_crawl_preset\"\n | \"web_crawl_schedule\"\n | \"web_crawl_session\"\n | \"web_crawl_url\"\n | \"web_discovered_item\"\n | \"web_finding\"\n | \"web_gsc_page_stat\"\n | \"web_link_edge\"\n | \"web_location_listing\"\n | \"web_page\"\n | \"web_page_content\"\n | \"web_page_evidence\"\n | \"web_page_sitemap\"\n | \"web_property\"\n | \"web_result\"\n | \"web_screenshot\"\n | \"web_site_endpoint_rule\"\n | \"web_site_item_config\"\n | \"web_site_offering\"\n | \"web_sitemap\"\n | \"web_snapshot\"\n | \"wf_node_data_slot\"\n | \"work_item\"\n | \"workflow_card\"\n | \"workflow_checkpoint\"\n | \"workflow_definition_version\"\n | \"workflow_idempotency\"\n | \"workflow_job\"\n | \"workflow_node_events\"\n | \"workflow_node_outcome\"\n | \"workflow_plan\"\n | \"workflow_plan_event\"\n | \"workflow_plan_sample\"\n | \"workflow_recovery_audit\"\n | \"workflow_trigger_fire\";\n\n/** Tokens flagged `default_scopeable` — can carry scope tags by default. */\nexport type ScopeableEntityToken =\n | \"access_request\"\n | \"activity\"\n | \"agent\"\n | \"agent_card\"\n | \"agent_definition_version\"\n | \"agent_drift_alert\"\n | \"agent_exemplar\"\n | \"agent_mandate_note\"\n | \"agent_prompt_remediation\"\n | \"agent_run\"\n | \"agent_run_stage\"\n | \"agent_shortcut\"\n | \"agent_surface_binding\"\n | \"agent_template\"\n | \"agent_usage\"\n | \"ai_api\"\n | \"ai_endpoint\"\n | \"ai_model\"\n | \"ai_model_alias\"\n | \"ai_offering\"\n | \"ai_provider\"\n | \"ai_setting\"\n | \"app\"\n | \"app_definition_version\"\n | \"app_error\"\n | \"app_execution\"\n | \"app_instance\"\n | \"app_log\"\n | \"app_rate_limit\"\n | \"app_setting\"\n | \"app_sync_status\"\n | \"approach\"\n | \"artifact\"\n | \"assessment\"\n | \"assessment_item\"\n | \"assessment_result\"\n | \"assist\"\n | \"batch_cost_event\"\n | \"batch_provider_batch\"\n | \"batch_work_item\"\n | \"browser_account_binding\"\n | \"browser_action_event\"\n | \"browser_authenticator_window\"\n | \"browser_capture\"\n | \"browser_control_request\"\n | \"browser_handoff\"\n | \"browser_login_attempt\"\n | \"browser_login_recipe\"\n | \"browser_profile\"\n | \"browser_profile_checkpoint\"\n | \"browser_run\"\n | \"browser_site_observation\"\n | \"browser_site_policy\"\n | \"browser_stream_ticket\"\n | \"canvas_comment\"\n | \"canvas_comment_like\"\n | \"canvas_item\"\n | \"canvas_item_state\"\n | \"canvas_like\"\n | \"canvas_score\"\n | \"canvas_view\"\n | \"category\"\n | \"cmp_entry\"\n | \"cmp_feedback\"\n | \"code_file\"\n | \"code_folder\"\n | \"code_repository\"\n | \"coding_session\"\n | \"coding_session_entry\"\n | \"comment\"\n | \"commerce_asset_allocation\"\n | \"commerce_asset_grading\"\n | \"commerce_asset_identifier\"\n | \"commerce_asset_lot_event\"\n | \"commerce_asset_mandate_result\"\n | \"commerce_asset_price_factor\"\n | \"commerce_asset_reshoot_request\"\n | \"commerce_asset_review\"\n | \"commerce_asset_unknown\"\n | \"commerce_certified_printer\"\n | \"commerce_cloud_sync_connection\"\n | \"commerce_ebay_business_policy\"\n | \"commerce_ebay_category\"\n | \"commerce_ebay_category_aspect\"\n | \"commerce_ebay_category_tree\"\n | \"commerce_ebay_custom_policy\"\n | \"commerce_ebay_inventory_item\"\n | \"commerce_ebay_inventory_item_group\"\n | \"commerce_ebay_inventory_item_group_member\"\n | \"commerce_ebay_inventory_location\"\n | \"commerce_ebay_listing\"\n | \"commerce_ebay_marketplace_policy\"\n | \"commerce_ebay_media_asset\"\n | \"commerce_ebay_notification_destination\"\n | \"commerce_ebay_notification_event\"\n | \"commerce_ebay_notification_subscription\"\n | \"commerce_ebay_notification_topic\"\n | \"commerce_ebay_offer\"\n | \"commerce_ebay_order\"\n | \"commerce_ebay_order_line_item\"\n | \"commerce_ebay_shipping_fulfillment\"\n | \"commerce_ebay_store_category\"\n | \"commerce_human_correction\"\n | \"commerce_intake_artifact\"\n | \"commerce_intake_asset\"\n | \"commerce_intake_batch\"\n | \"commerce_label_batch\"\n | \"commerce_label_code\"\n | \"commerce_marketplace_account\"\n | \"commerce_marketplace_account_deletion_audit\"\n | \"commerce_marketplace_api_call\"\n | \"commerce_marketplace_rate_budget\"\n | \"commerce_marketplace_site\"\n | \"commerce_marketplace_sync_run\"\n | \"commerce_prediction_outcome\"\n | \"commerce_print_order\"\n | \"commerce_product\"\n | \"commerce_product_channel_ref\"\n | \"commerce_product_media\"\n | \"commerce_product_variant\"\n | \"commerce_recall_audit\"\n | \"comparison_set\"\n | \"contact_medium\"\n | \"contact_submission\"\n | \"content_ir_kind\"\n | \"content_ir_kind_component\"\n | \"content_ir_kind_component_incident\"\n | \"content_ir_kind_conformance\"\n | \"content_ir_kind_edge\"\n | \"content_ir_kind_example\"\n | \"content_ir_kind_instance\"\n | \"content_ir_kind_surface\"\n | \"context_item\"\n | \"context_item_suggestion\"\n | \"conversation\"\n | \"crm_address\"\n | \"crm_affiliation\"\n | \"crm_blocklist_entry\"\n | \"crm_contact_candidate\"\n | \"crm_deal\"\n | \"crm_deal_stage_event\"\n | \"crm_enrichment_call\"\n | \"crm_interaction\"\n | \"crm_merge_candidate\"\n | \"crm_outreach_list\"\n | \"crm_outreach_list_member\"\n | \"crm_party_merge\"\n | \"crm_registry_ingest_run\"\n | \"crm_registry_source\"\n | \"crm_saved_view\"\n | \"crm_sending_event\"\n | \"crm_sending_identity\"\n | \"crm_sending_identity_check\"\n | \"crm_sending_policy\"\n | \"custom_entity_definition\"\n | \"custom_field_definition\"\n | \"custom_field_target\"\n | \"custom_record\"\n | \"data_store\"\n | \"dataset\"\n | \"derive_run\"\n | \"dict_setting\"\n | \"dm_conversation\"\n | \"dm_message\"\n | \"dm_participant\"\n | \"domain_classification\"\n | \"esign_campaign\"\n | \"esign_campaign_member\"\n | \"esign_consent_disclosure\"\n | \"esign_envelope\"\n | \"esign_envelope_certificate\"\n | \"esign_envelope_document\"\n | \"esign_envelope_event\"\n | \"esign_envelope_external_ref\"\n | \"esign_envelope_signer\"\n | \"esign_provider\"\n | \"esign_provider_binding\"\n | \"esign_signing_key\"\n | \"fc_card\"\n | \"fc_detail\"\n | \"fc_set\"\n | \"feature_doc\"\n | \"file\"\n | \"file_analysis\"\n | \"file_entities\"\n | \"file_overrides\"\n | \"file_page_annotations\"\n | \"file_pages\"\n | \"flexible_data\"\n | \"folder\"\n | \"game_badge\"\n | \"game_result\"\n | \"game_room\"\n | \"global_execution\"\n | \"global_execution_checkpoint\"\n | \"global_execution_event\"\n | \"global_meter_entry\"\n | \"global_origin\"\n | \"global_request\"\n | \"growth_loop_event\"\n | \"growth_loop_run\"\n | \"growth_loop_stage_run\"\n | \"guided_checklist_run\"\n | \"heatmap_save\"\n | \"hindsight_enrollment\"\n | \"hindsight_finding\"\n | \"hindsight_regression_case\"\n | \"hindsight_replay\"\n | \"hindsight_replay_step\"\n | \"hindsight_review\"\n | \"hr_access_audit\"\n | \"hr_access_role\"\n | \"hr_accommodation_request\"\n | \"hr_ai_evidence\"\n | \"hr_alert_routing_rule\"\n | \"hr_application\"\n | \"hr_approval_authority\"\n | \"hr_approval_delegation\"\n | \"hr_asset\"\n | \"hr_asset_assignment\"\n | \"hr_attendance_exception\"\n | \"hr_auto_close_rule\"\n | \"hr_availability\"\n | \"hr_background_check\"\n | \"hr_benefits_event\"\n | \"hr_calculation_snapshot\"\n | \"hr_candidate\"\n | \"hr_candidate_conversion\"\n | \"hr_candidate_message\"\n | \"hr_careers_portal\"\n | \"hr_checklist_item\"\n | \"hr_checklist_run\"\n | \"hr_checklist_template\"\n | \"hr_checklist_template_item\"\n | \"hr_compensation\"\n | \"hr_corrective_action\"\n | \"hr_course\"\n | \"hr_course_version\"\n | \"hr_credential\"\n | \"hr_crew\"\n | \"hr_deduction_code\"\n | \"hr_department\"\n | \"hr_derived_grant\"\n | \"hr_disposition_event\"\n | \"hr_earning_code\"\n | \"hr_eeo_response\"\n | \"hr_emergency_contact\"\n | \"hr_employee\"\n | \"hr_employee_private\"\n | \"hr_employer_profile\"\n | \"hr_employment\"\n | \"hr_employment_pin\"\n | \"hr_engagement\"\n | \"hr_establishment\"\n | \"hr_external_identity\"\n | \"hr_field_policy\"\n | \"hr_holiday\"\n | \"hr_holiday_calendar\"\n | \"hr_i9\"\n | \"hr_i9_document\"\n | \"hr_incident\"\n | \"hr_incident_party\"\n | \"hr_interview\"\n | \"hr_interview_kit\"\n | \"hr_job_title\"\n | \"hr_jurisdiction\"\n | \"hr_jurisdiction_rule\"\n | \"hr_jurisdiction_rule_class\"\n | \"hr_jurisdiction_rule_org_decision\"\n | \"hr_jurisdiction_rule_test\"\n | \"hr_kiosk_device\"\n | \"hr_kiosk_session\"\n | \"hr_labor_target\"\n | \"hr_leave_case\"\n | \"hr_leave_enrollment\"\n | \"hr_leave_ledger\"\n | \"hr_leave_policy\"\n | \"hr_leave_request\"\n | \"hr_legal_hold\"\n | \"hr_legal_hold_item\"\n | \"hr_location\"\n | \"hr_new_hire_report\"\n | \"hr_offer\"\n | \"hr_opening\"\n | \"hr_overtime_alert\"\n | \"hr_overtime_alert_rule\"\n | \"hr_overtime_preapproval\"\n | \"hr_pay_group\"\n | \"hr_pay_period\"\n | \"hr_pay_period_employment\"\n | \"hr_payroll_export\"\n | \"hr_payroll_export_line\"\n | \"hr_position_assignment\"\n | \"hr_posting\"\n | \"hr_posting_publication\"\n | \"hr_provider_binding\"\n | \"hr_provider_event\"\n | \"hr_provisioning_result\"\n | \"hr_punch\"\n | \"hr_recalculation_batch\"\n | \"hr_record_class\"\n | \"hr_records_request\"\n | \"hr_reference_check\"\n | \"hr_reporting_line\"\n | \"hr_requisition\"\n | \"hr_restricted_note\"\n | \"hr_retention_rule\"\n | \"hr_role_assignment\"\n | \"hr_schedule\"\n | \"hr_schedule_change\"\n | \"hr_schedule_guidance\"\n | \"hr_schedule_template\"\n | \"hr_schedule_template_shift\"\n | \"hr_scorecard\"\n | \"hr_separation\"\n | \"hr_shift\"\n | \"hr_shift_claim\"\n | \"hr_staffing_requirement\"\n | \"hr_survey\"\n | \"hr_survey_invitation\"\n | \"hr_survey_question\"\n | \"hr_survey_response\"\n | \"hr_tax_registration\"\n | \"hr_tax_withholding\"\n | \"hr_time_adjustment\"\n | \"hr_training_assignment\"\n | \"hr_training_attempt\"\n | \"hr_transcript_entry\"\n | \"hr_verification_letter_request\"\n | \"hr_work_interval\"\n | \"hr_workflow_binding\"\n | \"hr_workflow_decision\"\n | \"hr_workflow_definition\"\n | \"hr_workflow_event\"\n | \"hr_workflow_failure\"\n | \"hr_workflow_flow_type\"\n | \"hr_workflow_instance\"\n | \"hr_workflow_step\"\n | \"hr_workflow_step_definition\"\n | \"hr_workweek\"\n | \"iam_api_key\"\n | \"industry_curator\"\n | \"interview_document_revision\"\n | \"interview_hole\"\n | \"interview_question\"\n | \"interview_session\"\n | \"interview_turn\"\n | \"invitation\"\n | \"invitation_code\"\n | \"invitation_request\"\n | \"item_mastery\"\n | \"judge_verdict\"\n | \"kg_alert\"\n | \"kg_suggestion_ack\"\n | \"kg_sweep_queue\"\n | \"kg_sweep_run\"\n | \"kg_sweep_state\"\n | \"kg_value_match\"\n | \"league_membership\"\n | \"learn_doc\"\n | \"library_doc\"\n | \"mandate\"\n | \"mandate_binding\"\n | \"mandate_treatment\"\n | \"marketing_initiative\"\n | \"masterwork_corpus_item\"\n | \"masterwork_run\"\n | \"membership\"\n | \"message\"\n | \"message_template\"\n | \"ner_shadow\"\n | \"note\"\n | \"note_folder\"\n | \"notification\"\n | \"notification_channel_preference\"\n | \"notification_event_override\"\n | \"notification_event_type\"\n | \"notification_preference\"\n | \"ops_issue_event\"\n | \"ops_proof_check\"\n | \"ops_proof_run\"\n | \"ops_proof_scenario\"\n | \"organization\"\n | \"output_feedback\"\n | \"page_extraction_job\"\n | \"page_extraction_page_run\"\n | \"party\"\n | \"party_contact_point\"\n | \"pc_article\"\n | \"pc_episode\"\n | \"pc_show\"\n | \"pc_studio_run\"\n | \"pc_studio_run_asset\"\n | \"pdf_redaction_audit\"\n | \"plan_cms_fill_item\"\n | \"plan_cms_fill_job\"\n | \"plan_entity\"\n | \"plan_node\"\n | \"plan_node_artifact\"\n | \"plan_node_step\"\n | \"plan_profile\"\n | \"platform_actor_session\"\n | \"platform_actor_token\"\n | \"platform_actor_token_event\"\n | \"platform_continued_access\"\n | \"platform_outcome_event\"\n | \"platform_outsider_consumer\"\n | \"platform_saved_view\"\n | \"podcast_race\"\n | \"processed_document\"\n | \"processed_document_page\"\n | \"product_capture_file\"\n | \"product_capture_item\"\n | \"product_capture_payload\"\n | \"product_capture_product\"\n | \"product_capture_question\"\n | \"project\"\n | \"provision\"\n | \"purpose\"\n | \"quiz_session\"\n | \"rag_ingest_run\"\n | \"redaction_mapping\"\n | \"research_analysis\"\n | \"research_content\"\n | \"research_context_bundle\"\n | \"research_document\"\n | \"research_keyword\"\n | \"research_media\"\n | \"research_source\"\n | \"research_synthesis\"\n | \"research_tag\"\n | \"research_template\"\n | \"research_topic\"\n | \"route_manifest_entry\"\n | \"rulebook\"\n | \"sandbox_instance\"\n | \"sch_agent_task\"\n | \"sch_run\"\n | \"sch_task\"\n | \"sch_trigger\"\n | \"scope\"\n | \"scope_association_suggestion\"\n | \"scope_item_value_suggestion\"\n | \"scope_suggestion\"\n | \"scope_type\"\n | \"seo_ai_visibility_citation\"\n | \"seo_ai_visibility_claim\"\n | \"seo_ai_visibility_panel\"\n | \"seo_ai_visibility_response\"\n | \"seo_ai_visibility_signal\"\n | \"seo_backlink\"\n | \"seo_backlink_change_event\"\n | \"seo_backlink_dimension_snapshot\"\n | \"seo_backlink_observation\"\n | \"seo_backlink_snapshot\"\n | \"seo_change_assessment\"\n | \"seo_change_event\"\n | \"seo_change_item\"\n | \"seo_change_metric\"\n | \"seo_change_set\"\n | \"seo_change_theory\"\n | \"seo_collection_run\"\n | \"seo_competitor\"\n | \"seo_competitor_observation\"\n | \"seo_competitor_opportunity\"\n | \"seo_coverage_mention\"\n | \"seo_coverage_tracker\"\n | \"seo_dimension_value_matcher\"\n | \"seo_engine_schedule\"\n | \"seo_geo_place\"\n | \"seo_gsc_dig_rule\"\n | \"seo_keyword\"\n | \"seo_keyword_class_rule\"\n | \"seo_keyword_edge\"\n | \"seo_keyword_facet\"\n | \"seo_keyword_market\"\n | \"seo_keyword_market_observation\"\n | \"seo_keyword_place\"\n | \"seo_keyword_saved_view\"\n | \"seo_keyword_topic\"\n | \"seo_landscape_brief\"\n | \"seo_link_gap_domain\"\n | \"seo_link_gap_match\"\n | \"seo_page_measurement_health\"\n | \"seo_page_performance\"\n | \"seo_provider_call\"\n | \"seo_provider_task\"\n | \"seo_rank_observation\"\n | \"seo_rank_target\"\n | \"seo_raw_payload\"\n | \"seo_referring_domain_profile\"\n | \"seo_reputation_case\"\n | \"seo_search_performance_daily\"\n | \"seo_serp_mention\"\n | \"seo_serp_opportunity\"\n | \"seo_serp_result\"\n | \"seo_serp_snapshot\"\n | \"seo_site_geo_area\"\n | \"seo_site_keyword_offering\"\n | \"seo_site_keyword_value\"\n | \"seo_site_offering_value\"\n | \"seo_site_topic_value\"\n | \"seo_site_value_combo\"\n | \"seo_site_value_worth\"\n | \"seo_site_vocabulary\"\n | \"seo_source_request\"\n | \"seo_starter_pack\"\n | \"seo_starter_pack_item\"\n | \"seo_story_angle\"\n | \"seo_topic\"\n | \"seo_web_analytics_daily\"\n | \"shared_canvas_item\"\n | \"short_link\"\n | \"skill\"\n | \"skill_render_definition\"\n | \"sms_consent\"\n | \"sms_conversation\"\n | \"sms_message\"\n | \"sms_message_media\"\n | \"sms_notification\"\n | \"sms_notification_preference\"\n | \"sms_phone_number\"\n | \"structured_list\"\n | \"studio_documents\"\n | \"studio_recording_chunks\"\n | \"studio_recording_segments\"\n | \"studio_run\"\n | \"studio_session\"\n | \"studio_session_settings\"\n | \"study_attempt\"\n | \"study_goal\"\n | \"study_media\"\n | \"study_plan\"\n | \"study_plan_block\"\n | \"study_plan_day\"\n | \"study_reminder_context\"\n | \"study_reminder_delivery\"\n | \"study_session\"\n | \"surface\"\n | \"system_context_item\"\n | \"system_error\"\n | \"system_personal_org_failure\"\n | \"system_write_failure\"\n | \"task\"\n | \"thread\"\n | \"tool\"\n | \"tool_bundle\"\n | \"tool_call\"\n | \"tool_definition_version\"\n | \"tool_test_sample\"\n | \"tool_ui\"\n | \"tool_ui_incident\"\n | \"tool_ui_version\"\n | \"transcript\"\n | \"udt_dataset_fields\"\n | \"udt_dataset_rows\"\n | \"udt_document\"\n | \"udt_structured_list_items\"\n | \"ui_surface_agent_pref\"\n | \"ui_surface_config\"\n | \"user_achievement\"\n | \"user_analysis_preference\"\n | \"user_bookmark\"\n | \"user_email_preference\"\n | \"user_feedback\"\n | \"user_form_profile\"\n | \"user_markdown_sample\"\n | \"user_memory\"\n | \"user_preference\"\n | \"user_profile\"\n | \"user_stat\"\n | \"user_surface_state\"\n | \"voice\"\n | \"war_room\"\n | \"wbx_capture\"\n | \"wbx_guidance\"\n | \"wbx_highlight\"\n | \"wbx_pattern\"\n | \"wbx_screenshot\"\n | \"wbx_seo_audit\"\n | \"wc_claim\"\n | \"wc_impairment_definition\"\n | \"wc_injury\"\n | \"wc_report\"\n | \"web_analysis_item\"\n | \"web_brand\"\n | \"web_brand_asset\"\n | \"web_brand_offering\"\n | \"web_business_fact\"\n | \"web_business_location\"\n | \"web_crawl_event\"\n | \"web_crawl_preset\"\n | \"web_crawl_schedule\"\n | \"web_crawl_session\"\n | \"web_crawl_url\"\n | \"web_discovered_item\"\n | \"web_finding\"\n | \"web_gsc_page_stat\"\n | \"web_link_edge\"\n | \"web_listing_publisher\"\n | \"web_location_listing\"\n | \"web_offering_template\"\n | \"web_page\"\n | \"web_page_content\"\n | \"web_page_evidence\"\n | \"web_page_sitemap\"\n | \"web_property\"\n | \"web_provider\"\n | \"web_result\"\n | \"web_screenshot\"\n | \"web_site\"\n | \"web_site_endpoint_rule\"\n | \"web_site_item_config\"\n | \"web_site_offering\"\n | \"web_sitemap\"\n | \"web_snapshot\"\n | \"wf_node_data_slot\"\n | \"work_item\"\n | \"workbook\"\n | \"workflow\"\n | \"workflow_card\"\n | \"workflow_checkpoint\"\n | \"workflow_comparison\"\n | \"workflow_definition_version\"\n | \"workflow_idempotency\"\n | \"workflow_job\"\n | \"workflow_node_events\"\n | \"workflow_node_outcome\"\n | \"workflow_recovery_audit\"\n | \"workflow_run\"\n | \"workflow_run_log\"\n | \"workflow_runtime_surface\"\n | \"workflow_template\"\n | \"workflow_trigger\"\n | \"workflow_trigger_fire\"\n | \"youtube_search\"\n | \"youtube_video\";\n\n/** Tokens flagged `is_listed` — surfaced in list/nav UIs. */\nexport type ListedEntityToken =\n | \"agent\"\n | \"agent_exemplar\"\n | \"ai_model\"\n | \"ai_model_alias\"\n | \"ai_provider\"\n | \"ai_setting\"\n | \"assist\"\n | \"browser_login_recipe\"\n | \"browser_profile\"\n | \"browser_site_policy\"\n | \"commerce_certified_printer\"\n | \"commerce_cloud_sync_connection\"\n | \"commerce_intake_batch\"\n | \"commerce_label_batch\"\n | \"commerce_marketplace_account\"\n | \"commerce_print_order\"\n | \"commerce_product\"\n | \"content_ir_kind\"\n | \"content_ir_kind_instance\"\n | \"crm_blocklist_entry\"\n | \"crm_deal\"\n | \"crm_outreach_list\"\n | \"crm_registry_source\"\n | \"crm_saved_view\"\n | \"crm_sending_identity\"\n | \"custom_entity_definition\"\n | \"custom_field_definition\"\n | \"custom_field_target\"\n | \"dataset\"\n | \"esign_campaign\"\n | \"esign_consent_disclosure\"\n | \"esign_envelope\"\n | \"esign_provider_binding\"\n | \"growth_loop_run\"\n | \"hindsight_regression_case\"\n | \"hindsight_replay_step\"\n | \"hr_asset\"\n | \"hr_candidate\"\n | \"hr_careers_portal\"\n | \"hr_checklist_template\"\n | \"hr_course\"\n | \"hr_crew\"\n | \"hr_deduction_code\"\n | \"hr_department\"\n | \"hr_earning_code\"\n | \"hr_employee\"\n | \"hr_holiday_calendar\"\n | \"hr_interview_kit\"\n | \"hr_job_title\"\n | \"hr_leave_policy\"\n | \"hr_location\"\n | \"hr_pay_group\"\n | \"hr_posting\"\n | \"hr_provider_binding\"\n | \"hr_requisition\"\n | \"hr_schedule\"\n | \"hr_schedule_guidance\"\n | \"hr_schedule_template\"\n | \"hr_survey\"\n | \"hr_workflow_definition\"\n | \"hr_workflow_flow_type\"\n | \"hr_workflow_instance\"\n | \"iam_api_key\"\n | \"interview_session\"\n | \"learn_doc\"\n | \"mandate\"\n | \"mandate_binding\"\n | \"marketing_initiative\"\n | \"ops_proof_check\"\n | \"ops_proof_scenario\"\n | \"party\"\n | \"plan_entity\"\n | \"plan_node\"\n | \"platform_outcome_event\"\n | \"platform_saved_view\"\n | \"purpose\"\n | \"research_context_bundle\"\n | \"rulebook\"\n | \"seo_dimension_value_matcher\"\n | \"seo_geo_place\"\n | \"seo_keyword_saved_view\"\n | \"seo_site_value_combo\"\n | \"seo_site_value_worth\"\n | \"seo_starter_pack\"\n | \"structured_list\"\n | \"surface\"\n | \"system_context_item\"\n | \"workbook\"\n | \"workflow_runtime_surface\";\n\n/** Tokens flagged `is_module`. */\nexport type ModuleEntityToken =\n | \"agent\"\n | \"conversation\"\n | \"file\"\n | \"folder\"\n | \"note\"\n | \"project\"\n | \"task\"\n | \"transcript\";\n\n/** Full registry metadata, keyed by token. */\nexport const ENTITY_TYPE_METADATA = {\n \"access_request\": { token: \"access_request\", schema: \"iam\", table: \"access_requests\", label: \"Access Request\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: \"System\", referencePickable: false, titleColumn: null, contentRole: \"utility\", referenceCategory: null },\n \"activity\": { token: \"activity\", schema: \"platform\", table: \"activity_log\", label: \"Activity Log Entry\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"agent\": { token: \"agent\", schema: \"agent\", table: \"definition\", label: \"Agent\", baseTier: 1, isComponent: false, isModule: true, isListed: true, scopeable: true, category: \"Agents\", referencePickable: true, titleColumn: \"name\", contentRole: \"utility\", referenceCategory: null },\n \"agent_card\": { token: \"agent_card\", schema: \"agent\", table: \"card\", label: \"Agent Card\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"agent_definition_version\": { token: \"agent_definition_version\", schema: \"agent\", table: \"definition_version\", label: \"Agent Definition Version\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"Agents\", referencePickable: false, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"agent_drift_alert\": { token: \"agent_drift_alert\", schema: \"agent\", table: \"drift_alert\", label: \"Agent Drift Alert\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"Agents\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"agent_exemplar\": { token: \"agent_exemplar\", schema: \"agent\", table: \"exemplar\", label: \"Agent Test Case\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"agent_mandate_note\": { token: \"agent_mandate_note\", schema: \"agent\", table: \"mandate_note\", label: \"Mandate Note\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"agent_prompt_remediation\": { token: \"agent_prompt_remediation\", schema: \"agent\", table: \"prompt_remediation\", label: \"Agent Prompt Remediation\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"agent_run\": { token: \"agent_run\", schema: \"chat\", table: \"agent_run\", label: \"Agent Run\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"agent_run_stage\": { token: \"agent_run_stage\", schema: \"chat\", table: \"agent_run_stage\", label: \"Agent Run Stage\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"agent_shortcut\": { token: \"agent_shortcut\", schema: \"agent\", table: \"shortcut\", label: \"Agent Shortcut\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: \"Agents\", referencePickable: true, titleColumn: \"label\", contentRole: \"utility\", referenceCategory: null },\n \"agent_surface_binding\": { token: \"agent_surface_binding\", schema: \"platform\", table: \"associations\", label: \"Agent Surface Binding\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: \"Agents\", referencePickable: true, titleColumn: \"label\", contentRole: null, referenceCategory: null },\n \"agent_template\": { token: \"agent_template\", schema: \"agent\", table: \"template\", label: \"Agent Template\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: \"Agents\", referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"agent_usage\": { token: \"agent_usage\", schema: \"agent\", table: \"usage\", label: \"Agent Usage\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"Agents\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"ai_api\": { token: \"ai_api\", schema: \"ai\", table: \"api\", label: \"AI API\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"ai_endpoint\": { token: \"ai_endpoint\", schema: \"ai\", table: \"endpoint\", label: \"AI Endpoint\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"display_name\", contentRole: null, referenceCategory: null },\n \"ai_model\": { token: \"ai_model\", schema: \"ai\", table: \"model_definition\", label: \"AI Model\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"ai_model_alias\": { token: \"ai_model_alias\", schema: \"ai\", table: \"model_alias\", label: \"AI Model Alias\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"ai_offering\": { token: \"ai_offering\", schema: \"ai\", table: \"offering\", label: \"AI Offering\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"ai_provider\": { token: \"ai_provider\", schema: \"ai\", table: \"provider\", label: \"AI Provider\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"ai_setting\": { token: \"ai_setting\", schema: \"ai\", table: \"setting\", label: \"AI Setting\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"key\", contentRole: null, referenceCategory: null },\n \"app\": { token: \"app\", schema: \"app\", table: \"definition\", label: \"App\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: \"Apps\", referencePickable: true, titleColumn: \"name\", contentRole: \"utility\", referenceCategory: null },\n \"app_definition_version\": { token: \"app_definition_version\", schema: \"app\", table: \"definition_version\", label: \"App Definition Version\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"Apps\", referencePickable: false, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"app_error\": { token: \"app_error\", schema: \"app\", table: \"error\", label: \"App Error\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"Apps\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"app_execution\": { token: \"app_execution\", schema: \"app\", table: \"execution\", label: \"App Execution\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"Apps\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"app_instance\": { token: \"app_instance\", schema: \"public\", table: \"app_instances\", label: \"App Instance\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"app_log\": { token: \"app_log\", schema: \"ops\", table: \"app_log\", label: \"App Log\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"app_rate_limit\": { token: \"app_rate_limit\", schema: \"app\", table: \"rate_limit\", label: \"App Rate Limit\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"Apps\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"app_setting\": { token: \"app_setting\", schema: \"public\", table: \"app_settings\", label: \"App Setting\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"app_sync_status\": { token: \"app_sync_status\", schema: \"public\", table: \"app_sync_status\", label: \"App Sync Status\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"approach\": { token: \"approach\", schema: \"platform\", table: \"approach\", label: \"Approach\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"artifact\": { token: \"artifact\", schema: \"chat\", table: \"artifact\", label: \"Artifact\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"assessment\": { token: \"assessment\", schema: \"education\", table: \"assessment\", label: \"Assessment\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"assessment_item\": { token: \"assessment_item\", schema: \"education\", table: \"assessment_item\", label: \"Assessment Item\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"assessment_result\": { token: \"assessment_result\", schema: \"education\", table: \"assessment_result\", label: \"Assessment Result\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"assist\": { token: \"assist\", schema: \"platform\", table: \"assists\", label: \"Assist\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: \"platform\", referencePickable: false, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"batch_cost_event\": { token: \"batch_cost_event\", schema: \"batch\", table: \"cost_event\", label: \"Batch Cost Event\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"batch_provider_batch\": { token: \"batch_provider_batch\", schema: \"batch\", table: \"provider_batch\", label: \"Provider Batch\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"batch_work_item\": { token: \"batch_work_item\", schema: \"batch\", table: \"work_item\", label: \"Batch Work Item\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"browser_account_binding\": { token: \"browser_account_binding\", schema: \"browser\", table: \"account_binding\", label: \"Browser Account Binding\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"browser_action_event\": { token: \"browser_action_event\", schema: \"browser\", table: \"action_event\", label: \"Browser Action Event\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"browser_authenticator_window\": { token: \"browser_authenticator_window\", schema: \"browser\", table: \"authenticator_window\", label: \"Browser Authenticator Window\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"browser_capture\": { token: \"browser_capture\", schema: \"browser\", table: \"capture\", label: \"Browser Capture\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"browser_control_request\": { token: \"browser_control_request\", schema: \"browser\", table: \"control_request\", label: \"Browser Control Request\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"browser_handoff\": { token: \"browser_handoff\", schema: \"browser\", table: \"handoff\", label: \"Browser Handoff\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"browser_login_attempt\": { token: \"browser_login_attempt\", schema: \"browser\", table: \"login_attempt\", label: \"Browser Login Attempt\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"browser_login_recipe\": { token: \"browser_login_recipe\", schema: \"browser\", table: \"login_recipe\", label: \"Browser Login Recipe\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"browser_profile\": { token: \"browser_profile\", schema: \"browser\", table: \"profile\", label: \"Cloud Browser Profile\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"browser_profile_checkpoint\": { token: \"browser_profile_checkpoint\", schema: \"browser\", table: \"profile_checkpoint\", label: \"Browser Profile Checkpoint\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"browser_run\": { token: \"browser_run\", schema: \"browser\", table: \"run\", label: \"Cloud Browser Run\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"browser_site_observation\": { token: \"browser_site_observation\", schema: \"browser\", table: \"site_observation\", label: \"Browser Site Observation\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"browser_site_policy\": { token: \"browser_site_policy\", schema: \"browser\", table: \"site_policy\", label: \"Browser Site Policy\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"browser_stream_ticket\": { token: \"browser_stream_ticket\", schema: \"browser\", table: \"stream_ticket\", label: \"Browser Stream Ticket\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"canvas_comment\": { token: \"canvas_comment\", schema: \"canvas\", table: \"canvas_comments\", label: \"Canvas Comment\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"display_name\", contentRole: null, referenceCategory: null },\n \"canvas_comment_like\": { token: \"canvas_comment_like\", schema: \"canvas\", table: \"canvas_comment_likes\", label: \"Canvas Comment Like\", baseTier: 3, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"canvas_item\": { token: \"canvas_item\", schema: \"canvas\", table: \"canvas_items\", label: \"Canvas Item\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"canvas_item_state\": { token: \"canvas_item_state\", schema: \"canvas\", table: \"canvas_item_state\", label: \"Canvas Item State\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"canvas_like\": { token: \"canvas_like\", schema: \"canvas\", table: \"canvas_likes\", label: \"Canvas Like\", baseTier: 3, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"canvas_score\": { token: \"canvas_score\", schema: \"canvas\", table: \"canvas_scores\", label: \"Canvas Score\", baseTier: 3, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"display_name\", contentRole: null, referenceCategory: null },\n \"canvas_view\": { token: \"canvas_view\", schema: \"canvas\", table: \"canvas_views\", label: \"Canvas View\", baseTier: 3, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"category\": { token: \"category\", schema: \"platform\", table: \"categories\", label: \"Category\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"cmp_entry\": { token: \"cmp_entry\", schema: \"agent\", table: \"cmp_comparison_entries\", label: \"Comparison Entry\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"cmp_feedback\": { token: \"cmp_feedback\", schema: \"agent\", table: \"cmp_response_feedback\", label: \"Comparison Response Feedback\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"code_file\": { token: \"code_file\", schema: \"code\", table: \"code_files\", label: \"Code File\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: \"source\", referenceCategory: null },\n \"code_folder\": { token: \"code_folder\", schema: \"code\", table: \"code_file_folders\", label: \"Code Folder\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: \"container\", referenceCategory: null },\n \"code_repository\": { token: \"code_repository\", schema: \"code\", table: \"code_repositories\", label: \"Code Repository\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: \"container\", referenceCategory: null },\n \"coding_session\": { token: \"coding_session\", schema: \"chat\", table: \"coding_session\", label: \"Coding Session\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"coding_session_entry\": { token: \"coding_session_entry\", schema: \"chat\", table: \"coding_session_entry\", label: \"Coding Session Entry\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"comment\": { token: \"comment\", schema: \"platform\", table: \"comments\", label: \"Comment\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_asset_allocation\": { token: \"commerce_asset_allocation\", schema: \"commerce\", table: \"asset_allocation\", label: \"Asset Allocation\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_asset_grading\": { token: \"commerce_asset_grading\", schema: \"commerce\", table: \"asset_grading\", label: \"Asset Grading\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_asset_identifier\": { token: \"commerce_asset_identifier\", schema: \"commerce\", table: \"asset_identifier\", label: \"Asset Identifier\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_asset_lot_event\": { token: \"commerce_asset_lot_event\", schema: \"commerce\", table: \"asset_lot_event\", label: \"Asset Lot Event\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_asset_mandate_result\": { token: \"commerce_asset_mandate_result\", schema: \"commerce\", table: \"asset_mandate_result\", label: \"Asset Mandate Result\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_asset_price_factor\": { token: \"commerce_asset_price_factor\", schema: \"commerce\", table: \"asset_price_factor\", label: \"Asset Price Factor\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_asset_reshoot_request\": { token: \"commerce_asset_reshoot_request\", schema: \"commerce\", table: \"asset_reshoot_request\", label: \"Asset Reshoot Request\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_asset_review\": { token: \"commerce_asset_review\", schema: \"commerce\", table: \"asset_review\", label: \"Asset Review\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_asset_unknown\": { token: \"commerce_asset_unknown\", schema: \"commerce\", table: \"asset_unknown\", label: \"Asset Unknown\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_certified_printer\": { token: \"commerce_certified_printer\", schema: \"commerce\", table: \"certified_printer\", label: \"Certified Printer\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_cloud_sync_connection\": { token: \"commerce_cloud_sync_connection\", schema: \"commerce\", table: \"cloud_sync_connection\", label: \"Cloud Sync Connection\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_ebay_business_policy\": { token: \"commerce_ebay_business_policy\", schema: \"commerce\", table: \"ebay_business_policy\", label: \"eBay Business Policy\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_ebay_category\": { token: \"commerce_ebay_category\", schema: \"commerce\", table: \"ebay_category\", label: \"eBay Category\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_ebay_category_aspect\": { token: \"commerce_ebay_category_aspect\", schema: \"commerce\", table: \"ebay_category_aspect\", label: \"eBay Category Aspect\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_ebay_category_tree\": { token: \"commerce_ebay_category_tree\", schema: \"commerce\", table: \"ebay_category_tree\", label: \"eBay Category Tree\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_ebay_custom_policy\": { token: \"commerce_ebay_custom_policy\", schema: \"commerce\", table: \"ebay_custom_policy\", label: \"eBay Custom Policy\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_ebay_inventory_item\": { token: \"commerce_ebay_inventory_item\", schema: \"commerce\", table: \"ebay_inventory_item\", label: \"eBay Inventory Item\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_ebay_inventory_item_group\": { token: \"commerce_ebay_inventory_item_group\", schema: \"commerce\", table: \"ebay_inventory_item_group\", label: \"eBay Inventory Item Group\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_ebay_inventory_item_group_member\": { token: \"commerce_ebay_inventory_item_group_member\", schema: \"commerce\", table: \"ebay_inventory_item_group_member\", label: \"eBay Inventory Item Group Member\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_ebay_inventory_location\": { token: \"commerce_ebay_inventory_location\", schema: \"commerce\", table: \"ebay_inventory_location\", label: \"eBay Inventory Location\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_ebay_listing\": { token: \"commerce_ebay_listing\", schema: \"commerce\", table: \"ebay_listing\", label: \"eBay Listing\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_ebay_marketplace_policy\": { token: \"commerce_ebay_marketplace_policy\", schema: \"commerce\", table: \"ebay_marketplace_policy\", label: \"eBay Marketplace Policy\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_ebay_media_asset\": { token: \"commerce_ebay_media_asset\", schema: \"commerce\", table: \"ebay_media_asset\", label: \"eBay Media Asset\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_ebay_notification_destination\": { token: \"commerce_ebay_notification_destination\", schema: \"commerce\", table: \"ebay_notification_destination\", label: \"eBay Notification Destination\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_ebay_notification_event\": { token: \"commerce_ebay_notification_event\", schema: \"commerce\", table: \"ebay_notification_event\", label: \"eBay Notification Event\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_ebay_notification_subscription\": { token: \"commerce_ebay_notification_subscription\", schema: \"commerce\", table: \"ebay_notification_subscription\", label: \"eBay Notification Subscription\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_ebay_notification_topic\": { token: \"commerce_ebay_notification_topic\", schema: \"commerce\", table: \"ebay_notification_topic\", label: \"eBay Notification Topic\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_ebay_offer\": { token: \"commerce_ebay_offer\", schema: \"commerce\", table: \"ebay_offer\", label: \"eBay Offer\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_ebay_order\": { token: \"commerce_ebay_order\", schema: \"commerce\", table: \"ebay_order\", label: \"eBay Order\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_ebay_order_line_item\": { token: \"commerce_ebay_order_line_item\", schema: \"commerce\", table: \"ebay_order_line_item\", label: \"eBay Order Line Item\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_ebay_shipping_fulfillment\": { token: \"commerce_ebay_shipping_fulfillment\", schema: \"commerce\", table: \"ebay_shipping_fulfillment\", label: \"eBay Shipping Fulfillment\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_ebay_store_category\": { token: \"commerce_ebay_store_category\", schema: \"commerce\", table: \"ebay_store_category\", label: \"eBay Store Category\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_human_correction\": { token: \"commerce_human_correction\", schema: \"commerce\", table: \"human_correction\", label: \"Human Correction\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_intake_artifact\": { token: \"commerce_intake_artifact\", schema: \"commerce\", table: \"intake_artifact\", label: \"Intake Artifact\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_intake_asset\": { token: \"commerce_intake_asset\", schema: \"commerce\", table: \"intake_asset\", label: \"Intake Asset\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_intake_batch\": { token: \"commerce_intake_batch\", schema: \"commerce\", table: \"intake_batch\", label: \"Intake Batch\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_label_batch\": { token: \"commerce_label_batch\", schema: \"commerce\", table: \"label_batch\", label: \"Label Batch\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_label_code\": { token: \"commerce_label_code\", schema: \"commerce\", table: \"label_code\", label: \"Label Code\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_marketplace_account\": { token: \"commerce_marketplace_account\", schema: \"commerce\", table: \"marketplace_account\", label: \"Marketplace Account\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_marketplace_account_deletion_audit\": { token: \"commerce_marketplace_account_deletion_audit\", schema: \"commerce\", table: \"marketplace_account_deletion_audit\", label: \"Marketplace Account Deletion Audit\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_marketplace_api_call\": { token: \"commerce_marketplace_api_call\", schema: \"commerce\", table: \"marketplace_api_call\", label: \"Marketplace API Call\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_marketplace_rate_budget\": { token: \"commerce_marketplace_rate_budget\", schema: \"commerce\", table: \"marketplace_rate_budget\", label: \"Marketplace Rate Budget\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_marketplace_site\": { token: \"commerce_marketplace_site\", schema: \"commerce\", table: \"marketplace_site\", label: \"Marketplace Site\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_marketplace_sync_run\": { token: \"commerce_marketplace_sync_run\", schema: \"commerce\", table: \"marketplace_sync_run\", label: \"Marketplace Sync Run\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_prediction_outcome\": { token: \"commerce_prediction_outcome\", schema: \"commerce\", table: \"prediction_outcome\", label: \"Prediction Outcome\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_print_order\": { token: \"commerce_print_order\", schema: \"commerce\", table: \"print_order\", label: \"Print Order\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_product\": { token: \"commerce_product\", schema: \"commerce\", table: \"product\", label: \"Product\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_product_channel_ref\": { token: \"commerce_product_channel_ref\", schema: \"commerce\", table: \"product_channel_ref\", label: \"Product Channel Reference\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_product_media\": { token: \"commerce_product_media\", schema: \"commerce\", table: \"product_media\", label: \"Product Media\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_product_variant\": { token: \"commerce_product_variant\", schema: \"commerce\", table: \"product_variant\", label: \"Product Variant\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_recall_audit\": { token: \"commerce_recall_audit\", schema: \"commerce\", table: \"recall_audit\", label: \"Recall Audit\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"comparison_set\": { token: \"comparison_set\", schema: \"agent\", table: \"cmp_comparison_sets\", label: \"Comparison Set\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"contact_medium\": { token: \"contact_medium\", schema: \"crm\", table: \"contact_medium\", label: \"Contact Medium\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"display_value\", contentRole: \"utility\", referenceCategory: null },\n \"contact_submission\": { token: \"contact_submission\", schema: \"communication\", table: \"contact_submissions\", label: \"Contact Submission\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"content_ir_kind\": { token: \"content_ir_kind\", schema: \"content_ir\", table: \"kind_definition\", label: \"Content-IR Kind\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"label\", contentRole: null, referenceCategory: null },\n \"content_ir_kind_component\": { token: \"content_ir_kind_component\", schema: \"content_ir\", table: \"kind_component\", label: \"Kind Component\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"content_ir_kind_component_incident\": { token: \"content_ir_kind_component_incident\", schema: \"content_ir\", table: \"kind_component_incident\", label: \"Kind Component Incident\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"content_ir_kind_conformance\": { token: \"content_ir_kind_conformance\", schema: \"content_ir\", table: \"kind_conformance\", label: \"Shape Conformance\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"content_ir_kind_edge\": { token: \"content_ir_kind_edge\", schema: \"content_ir\", table: \"kind_edge\", label: \"Content-IR Kind Edge\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"content_ir_kind_example\": { token: \"content_ir_kind_example\", schema: \"content_ir\", table: \"kind_example\", label: \"Kind Example\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"label\", contentRole: null, referenceCategory: null },\n \"content_ir_kind_instance\": { token: \"content_ir_kind_instance\", schema: \"content_ir\", table: \"kind_instance\", label: \"Saved Result\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"content_ir_kind_surface\": { token: \"content_ir_kind_surface\", schema: \"content_ir\", table: \"kind_surface\", label: \"Kind Surface\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"context_item\": { token: \"context_item\", schema: \"context\", table: \"context_items\", label: \"Context Item\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"display_name\", contentRole: null, referenceCategory: null },\n \"context_item_suggestion\": { token: \"context_item_suggestion\", schema: \"rag\", table: \"context_item_suggestions\", label: \"Context Item Suggestion\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"conversation\": { token: \"conversation\", schema: \"chat\", table: \"conversation\", label: \"Conversation\", baseTier: 1, isComponent: false, isModule: true, isListed: false, scopeable: true, category: \"Outputs\", referencePickable: true, titleColumn: \"title\", contentRole: \"destination\", referenceCategory: null },\n \"conversation_value\": { token: \"conversation_value\", schema: \"chat\", table: \"conversation_value\", label: \"Conversation Value\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: false, category: null, referencePickable: false, titleColumn: \"key\", contentRole: null, referenceCategory: null },\n \"crm_address\": { token: \"crm_address\", schema: \"crm\", table: \"address\", label: \"Address\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"label\", contentRole: null, referenceCategory: null },\n \"crm_affiliation\": { token: \"crm_affiliation\", schema: \"crm\", table: \"affiliation\", label: \"Affiliation\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"crm_blocklist_entry\": { token: \"crm_blocklist_entry\", schema: \"crm\", table: \"blocklist_entry\", label: \"Blocklist Entry\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"crm_contact_candidate\": { token: \"crm_contact_candidate\", schema: \"crm\", table: \"contact_candidate\", label: \"Contact Candidate\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"crm_deal\": { token: \"crm_deal\", schema: \"crm\", table: \"deal\", label: \"Deal\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: \"source\", referenceCategory: null },\n \"crm_deal_stage_event\": { token: \"crm_deal_stage_event\", schema: \"crm\", table: \"deal_stage_event\", label: \"Deal Stage Event\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"crm_enrichment_call\": { token: \"crm_enrichment_call\", schema: \"crm\", table: \"enrichment_call\", label: \"Enrichment Call\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"crm_interaction\": { token: \"crm_interaction\", schema: \"crm\", table: \"interaction\", label: \"Interaction\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"subject\", contentRole: null, referenceCategory: null },\n \"crm_merge_candidate\": { token: \"crm_merge_candidate\", schema: \"crm\", table: \"merge_candidate\", label: \"Merge Candidate\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"crm_outreach_list\": { token: \"crm_outreach_list\", schema: \"crm\", table: \"outreach_list\", label: \"Outreach List\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: \"container\", referenceCategory: null },\n \"crm_outreach_list_member\": { token: \"crm_outreach_list_member\", schema: \"crm\", table: \"outreach_list_member\", label: \"Outreach List Member\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"crm_party_merge\": { token: \"crm_party_merge\", schema: \"crm\", table: \"party_merge\", label: \"Party Merge\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"crm_registry_ingest_run\": { token: \"crm_registry_ingest_run\", schema: \"crm\", table: \"registry_ingest_run\", label: \"Registry Ingest Run\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"crm_registry_source\": { token: \"crm_registry_source\", schema: \"crm\", table: \"registry_source\", label: \"Registry Source\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"crm_saved_view\": { token: \"crm_saved_view\", schema: \"crm\", table: \"saved_view\", label: \"Smart View\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"crm_sending_event\": { token: \"crm_sending_event\", schema: \"crm\", table: \"sending_event\", label: \"Sending Event\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"subject\", contentRole: null, referenceCategory: null },\n \"crm_sending_identity\": { token: \"crm_sending_identity\", schema: \"crm\", table: \"sending_identity\", label: \"Sending Identity\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"crm_sending_identity_check\": { token: \"crm_sending_identity_check\", schema: \"crm\", table: \"sending_identity_check\", label: \"Sending Check\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"check_kind\", contentRole: null, referenceCategory: null },\n \"crm_sending_policy\": { token: \"crm_sending_policy\", schema: \"crm\", table: \"sending_policy\", label: \"Sending Policy\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"custom_entity_definition\": { token: \"custom_entity_definition\", schema: \"platform\", table: \"custom_entity_definition\", label: \"Custom Object\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"custom_field_definition\": { token: \"custom_field_definition\", schema: \"platform\", table: \"custom_field_definition\", label: \"Custom Field\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"custom_field_target\": { token: \"custom_field_target\", schema: \"platform\", table: \"custom_field_target\", label: \"Custom Field Target\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"custom_record\": { token: \"custom_record\", schema: \"platform\", table: \"custom_record\", label: \"Custom Record\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"cx_agent_memory\": { token: \"cx_agent_memory\", schema: \"chat\", table: \"agent_memory\", label: \"Agent Memory\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: false, category: \"Conversations\", referencePickable: true, titleColumn: \"key\", contentRole: null, referenceCategory: null },\n \"cx_agent_plan\": { token: \"cx_agent_plan\", schema: \"chat\", table: \"agent_plan\", label: \"Agent Plan\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: false, category: \"Conversations\", referencePickable: false, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"cx_agent_task\": { token: \"cx_agent_task\", schema: \"chat\", table: \"agent_task\", label: \"Agent Task\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: false, category: \"Conversations\", referencePickable: false, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"cx_code_edit\": { token: \"cx_code_edit\", schema: \"chat\", table: \"code_edit\", label: \"Code Edit\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: false, category: \"Conversations\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"cx_code_message_file\": { token: \"cx_code_message_file\", schema: \"chat\", table: \"code_message_file\", label: \"Code Message File\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: false, category: \"Conversations\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"cx_media\": { token: \"cx_media\", schema: \"chat\", table: \"media\", label: \"Media\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: false, category: \"Conversations\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"cx_observational_memory\": { token: \"cx_observational_memory\", schema: \"chat\", table: \"observational_memory\", label: \"Observational Memory\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: false, category: \"Conversations\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"cx_observational_memory_event\": { token: \"cx_observational_memory_event\", schema: \"chat\", table: \"observational_memory_event\", label: \"Observational Memory Event\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: false, category: \"Conversations\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"cx_pending_injection\": { token: \"cx_pending_injection\", schema: \"chat\", table: \"pending_injection\", label: \"Pending Injection\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: false, category: \"Conversations\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"cx_request\": { token: \"cx_request\", schema: \"chat\", table: \"request\", label: \"Conversation Request\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: false, category: \"Conversations\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"cx_request_snapshot\": { token: \"cx_request_snapshot\", schema: \"chat\", table: \"request_snapshot\", label: \"Request Snapshot\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: false, category: \"Conversations\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"cx_tool_trace\": { token: \"cx_tool_trace\", schema: \"chat\", table: \"tool_trace\", label: \"Tool Trace\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: false, category: \"Conversations\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"cx_user_request\": { token: \"cx_user_request\", schema: \"chat\", table: \"user_request\", label: \"User Request\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: false, category: \"Conversations\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"cx_user_todo\": { token: \"cx_user_todo\", schema: \"chat\", table: \"user_todo\", label: \"User Todo\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: false, category: \"Conversations\", referencePickable: false, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"data_store\": { token: \"data_store\", schema: \"rag\", table: \"data_stores\", label: \"Data Store\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: \"source\", referenceCategory: null },\n \"dataset\": { token: \"dataset\", schema: \"workbench\", table: \"udt_datasets\", label: \"Dataset\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"description\", contentRole: \"hybrid\", referenceCategory: null },\n \"derive_run\": { token: \"derive_run\", schema: \"docproc\", table: \"derive_runs\", label: \"Derive Run\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"dict_setting\": { token: \"dict_setting\", schema: \"dictionary\", table: \"dict_settings\", label: \"Dict Setting\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"dm_conversation\": { token: \"dm_conversation\", schema: \"communication\", table: \"dm_conversations\", label: \"Direct Conversation\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"dm_message\": { token: \"dm_message\", schema: \"communication\", table: \"dm_messages\", label: \"Direct Message\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"dm_participant\": { token: \"dm_participant\", schema: \"communication\", table: \"dm_conversation_participants\", label: \"DM Conversation Participant\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"domain_classification\": { token: \"domain_classification\", schema: \"platform\", table: \"domain_classification\", label: \"Domain Classification\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"esign_campaign\": { token: \"esign_campaign\", schema: \"esign\", table: \"campaign\", label: \"Signature campaign\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"esign_campaign_member\": { token: \"esign_campaign_member\", schema: \"esign\", table: \"campaign_member\", label: \"Campaign member\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"esign_consent_disclosure\": { token: \"esign_consent_disclosure\", schema: \"esign\", table: \"consent_disclosure\", label: \"E-sign consent disclosure\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"esign_envelope\": { token: \"esign_envelope\", schema: \"esign\", table: \"envelope\", label: \"Signature envelope\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"esign_envelope_certificate\": { token: \"esign_envelope_certificate\", schema: \"esign\", table: \"envelope_certificate\", label: \"Completion certificate\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"esign_envelope_document\": { token: \"esign_envelope_document\", schema: \"esign\", table: \"envelope_document\", label: \"Envelope document\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"esign_envelope_event\": { token: \"esign_envelope_event\", schema: \"esign\", table: \"envelope_event\", label: \"Envelope event\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"esign_envelope_external_ref\": { token: \"esign_envelope_external_ref\", schema: \"esign\", table: \"envelope_external_ref\", label: \"Envelope external reference\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"esign_envelope_signer\": { token: \"esign_envelope_signer\", schema: \"esign\", table: \"envelope_signer\", label: \"Envelope signer\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"esign_provider\": { token: \"esign_provider\", schema: \"esign\", table: \"provider\", label: \"E-sign provider\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"esign_provider_binding\": { token: \"esign_provider_binding\", schema: \"esign\", table: \"provider_binding\", label: \"E-sign provider binding\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"esign_signing_key\": { token: \"esign_signing_key\", schema: \"esign\", table: \"signing_key\", label: \"E-sign certificate signing key\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"fc_card\": { token: \"fc_card\", schema: \"education\", table: \"fc_card\", label: \"Flashcard\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"fc_detail\": { token: \"fc_detail\", schema: \"education\", table: \"fc_detail\", label: \"Flashcard Detail\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"fc_set\": { token: \"fc_set\", schema: \"education\", table: \"fc_set\", label: \"Flashcard Set\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"feature_doc\": { token: \"feature_doc\", schema: \"admin\", table: \"feature_docs\", label: \"Feature Doc\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: \"documentation\", referencePickable: true, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"file\": { token: \"file\", schema: \"files\", table: \"files\", label: \"File\", baseTier: 1, isComponent: false, isModule: true, isListed: false, scopeable: true, category: \"Sources\", referencePickable: true, titleColumn: \"file_name\", contentRole: \"source\", referenceCategory: null },\n \"file_analysis\": { token: \"file_analysis\", schema: \"files\", table: \"analysis\", label: \"File Analysis\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"file_entities\": { token: \"file_entities\", schema: \"files\", table: \"entities\", label: \"Extracted Term\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"label\", contentRole: null, referenceCategory: null },\n \"file_overrides\": { token: \"file_overrides\", schema: \"files\", table: \"overrides\", label: \"File Override\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"file_page_annotations\": { token: \"file_page_annotations\", schema: \"files\", table: \"page_annotations\", label: \"Page Annotation\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"label\", contentRole: null, referenceCategory: null },\n \"file_pages\": { token: \"file_pages\", schema: \"files\", table: \"pages\", label: \"File Page\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"file_version\": { token: \"file_version\", schema: \"files\", table: \"file_versions\", label: \"File Version\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: false, category: \"Sources\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"flexible_data\": { token: \"flexible_data\", schema: \"platform\", table: \"flexible_data\", label: \"Flexible Data\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"label\", contentRole: null, referenceCategory: null },\n \"folder\": { token: \"folder\", schema: \"files\", table: \"folders\", label: \"Folder\", baseTier: 1, isComponent: false, isModule: true, isListed: false, scopeable: true, category: \"Sources\", referencePickable: true, titleColumn: \"folder_name\", contentRole: \"source\", referenceCategory: null },\n \"game_badge\": { token: \"game_badge\", schema: \"education\", table: \"game_badge\", label: \"Game Badge\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"game_result\": { token: \"game_result\", schema: \"education\", table: \"game_result\", label: \"Game Result\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"display_name\", contentRole: null, referenceCategory: null },\n \"game_room\": { token: \"game_room\", schema: \"education\", table: \"game_room\", label: \"Game Room\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"global_execution\": { token: \"global_execution\", schema: \"runtime\", table: \"global_execution\", label: \"Runtime Execution\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"global_execution_checkpoint\": { token: \"global_execution_checkpoint\", schema: \"runtime\", table: \"global_execution_checkpoint\", label: \"Runtime Checkpoint\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"global_execution_event\": { token: \"global_execution_event\", schema: \"runtime\", table: \"global_execution_event\", label: \"Runtime Event\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"global_meter_entry\": { token: \"global_meter_entry\", schema: \"runtime\", table: \"global_meter_entry\", label: \"Runtime Meter Entry\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"label\", contentRole: null, referenceCategory: null },\n \"global_origin\": { token: \"global_origin\", schema: \"runtime\", table: \"global_origin\", label: \"Runtime Origin\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"global_request\": { token: \"global_request\", schema: \"runtime\", table: \"global_request\", label: \"Runtime Request\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"growth_loop_event\": { token: \"growth_loop_event\", schema: \"growth\", table: \"loop_event\", label: \"Growth Loop Event\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"growth_loop_run\": { token: \"growth_loop_run\", schema: \"growth\", table: \"loop_run\", label: \"Growth Loop Run\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: \"label\", contentRole: null, referenceCategory: null },\n \"growth_loop_stage_run\": { token: \"growth_loop_stage_run\", schema: \"growth\", table: \"loop_stage_run\", label: \"Growth Loop Stage Run\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"guided_checklist_run\": { token: \"guided_checklist_run\", schema: \"platform\", table: \"guided_checklist_run\", label: \"Guided Checklist Run\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"heatmap_save\": { token: \"heatmap_save\", schema: \"workbench\", table: \"heatmap_saves\", label: \"Heatmap Save\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"hindsight_enrollment\": { token: \"hindsight_enrollment\", schema: \"hindsight\", table: \"enrollment\", label: \"Hindsight Enrollment\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"display_name\", contentRole: null, referenceCategory: null },\n \"hindsight_finding\": { token: \"hindsight_finding\", schema: \"hindsight\", table: \"finding\", label: \"Hindsight Finding\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hindsight_regression_case\": { token: \"hindsight_regression_case\", schema: \"hindsight\", table: \"regression_case\", label: \"Regression Case\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hindsight_replay\": { token: \"hindsight_replay\", schema: \"hindsight\", table: \"replay\", label: \"Hindsight Replay\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hindsight_replay_step\": { token: \"hindsight_replay_step\", schema: \"hindsight\", table: \"replay_step\", label: \"Wire Replay Step\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hindsight_review\": { token: \"hindsight_review\", schema: \"hindsight\", table: \"review\", label: \"Hindsight Review\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_access_audit\": { token: \"hr_access_audit\", schema: \"hr\", table: \"access_audit\", label: \"Access audit\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_access_role\": { token: \"hr_access_role\", schema: \"hr\", table: \"access_role\", label: \"HR access role\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"label\", contentRole: null, referenceCategory: null },\n \"hr_accommodation_request\": { token: \"hr_accommodation_request\", schema: \"hr\", table: \"accommodation_request\", label: \"Accommodation request\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_ai_evidence\": { token: \"hr_ai_evidence\", schema: \"hr\", table: \"ai_evidence\", label: \"AI evidence\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_alert_routing_rule\": { token: \"hr_alert_routing_rule\", schema: \"hr\", table: \"alert_routing_rule\", label: \"Alert routing rule\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"hr_application\": { token: \"hr_application\", schema: \"hr\", table: \"application\", label: \"Application\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_approval_authority\": { token: \"hr_approval_authority\", schema: \"hr\", table: \"approval_authority\", label: \"Approval authority\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_approval_delegation\": { token: \"hr_approval_delegation\", schema: \"hr\", table: \"approval_delegation\", label: \"Approval delegation\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_asset\": { token: \"hr_asset\", schema: \"hr\", table: \"asset\", label: \"Asset\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"hr_asset_assignment\": { token: \"hr_asset_assignment\", schema: \"hr\", table: \"asset_assignment\", label: \"Asset assignment\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_attendance_exception\": { token: \"hr_attendance_exception\", schema: \"hr\", table: \"attendance_exception\", label: \"Attendance exception\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_auto_close_rule\": { token: \"hr_auto_close_rule\", schema: \"hr\", table: \"auto_close_rule\", label: \"Auto-close rule\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"hr_availability\": { token: \"hr_availability\", schema: \"hr\", table: \"availability\", label: \"Availability\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_background_check\": { token: \"hr_background_check\", schema: \"hr\", table: \"background_check\", label: \"Background check\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_benefits_event\": { token: \"hr_benefits_event\", schema: \"hr\", table: \"benefits_event\", label: \"Benefits event\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_calculation_snapshot\": { token: \"hr_calculation_snapshot\", schema: \"hr\", table: \"calculation_snapshot\", label: \"Calculation snapshot\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_candidate\": { token: \"hr_candidate\", schema: \"hr\", table: \"candidate\", label: \"Candidate\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"preferred_name\", contentRole: null, referenceCategory: null },\n \"hr_candidate_conversion\": { token: \"hr_candidate_conversion\", schema: \"hr\", table: \"candidate_conversion\", label: \"Candidate conversion\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_candidate_message\": { token: \"hr_candidate_message\", schema: \"hr\", table: \"candidate_message\", label: \"Candidate message\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_careers_portal\": { token: \"hr_careers_portal\", schema: \"hr\", table: \"careers_portal\", label: \"Careers portal\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"display_name\", contentRole: null, referenceCategory: null },\n \"hr_checklist_item\": { token: \"hr_checklist_item\", schema: \"hr\", table: \"checklist_item\", label: \"Checklist item\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_checklist_run\": { token: \"hr_checklist_run\", schema: \"hr\", table: \"checklist_run\", label: \"Checklist run\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_checklist_template\": { token: \"hr_checklist_template\", schema: \"hr\", table: \"checklist_template\", label: \"Checklist template\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"hr_checklist_template_item\": { token: \"hr_checklist_template_item\", schema: \"hr\", table: \"checklist_template_item\", label: \"Checklist template item\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_compensation\": { token: \"hr_compensation\", schema: \"hr\", table: \"compensation\", label: \"Compensation record\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_corrective_action\": { token: \"hr_corrective_action\", schema: \"hr\", table: \"corrective_action\", label: \"Corrective action\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_course\": { token: \"hr_course\", schema: \"hr\", table: \"course\", label: \"Course\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"hr_course_version\": { token: \"hr_course_version\", schema: \"hr\", table: \"course_version\", label: \"Course version\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_credential\": { token: \"hr_credential\", schema: \"hr\", table: \"credential\", label: \"Credential\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_crew\": { token: \"hr_crew\", schema: \"hr\", table: \"crew\", label: \"Crew\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"hr_deduction_code\": { token: \"hr_deduction_code\", schema: \"hr\", table: \"deduction_code\", label: \"Deduction code\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"hr_department\": { token: \"hr_department\", schema: \"hr\", table: \"department\", label: \"Department\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"hr_derived_grant\": { token: \"hr_derived_grant\", schema: \"hr\", table: \"derived_grant\", label: \"Derived grant\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_disposition_event\": { token: \"hr_disposition_event\", schema: \"hr\", table: \"disposition_event\", label: \"Disposition event\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_earning_code\": { token: \"hr_earning_code\", schema: \"hr\", table: \"earning_code\", label: \"Earning code\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"hr_eeo_response\": { token: \"hr_eeo_response\", schema: \"hr\", table: \"eeo_response\", label: \"EEO self-identification response\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_emergency_contact\": { token: \"hr_emergency_contact\", schema: \"hr\", table: \"emergency_contact\", label: \"Emergency contact\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_employee\": { token: \"hr_employee\", schema: \"hr\", table: \"employee\", label: \"Employee\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"display_name\", contentRole: \"container\", referenceCategory: null },\n \"hr_employee_private\": { token: \"hr_employee_private\", schema: \"hr\", table: \"employee_private\", label: \"Employee private record\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_employer_profile\": { token: \"hr_employer_profile\", schema: \"hr\", table: \"employer_profile\", label: \"Employer profile\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"legal_name\", contentRole: null, referenceCategory: null },\n \"hr_employment\": { token: \"hr_employment\", schema: \"hr\", table: \"employment\", label: \"Employment spell\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_employment_pin\": { token: \"hr_employment_pin\", schema: \"hr\", table: \"employment_pin\", label: \"Employment PIN\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_engagement\": { token: \"hr_engagement\", schema: \"hr\", table: \"engagement\", label: \"Engagement\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_establishment\": { token: \"hr_establishment\", schema: \"hr\", table: \"establishment\", label: \"Establishment\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"hr_external_identity\": { token: \"hr_external_identity\", schema: \"hr\", table: \"external_identity\", label: \"External identity\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_field_policy\": { token: \"hr_field_policy\", schema: \"hr\", table: \"field_policy\", label: \"Self-service field policy\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_holiday\": { token: \"hr_holiday\", schema: \"hr\", table: \"holiday\", label: \"Holiday\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"hr_holiday_calendar\": { token: \"hr_holiday_calendar\", schema: \"hr\", table: \"holiday_calendar\", label: \"Holiday calendar\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"hr_i9\": { token: \"hr_i9\", schema: \"hr\", table: \"i9\", label: \"Form I-9\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_i9_document\": { token: \"hr_i9_document\", schema: \"hr\", table: \"i9_document\", label: \"I-9 document\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_incident\": { token: \"hr_incident\", schema: \"hr\", table: \"incident\", label: \"Incident\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_incident_party\": { token: \"hr_incident_party\", schema: \"hr\", table: \"incident_party\", label: \"Incident party\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_interview\": { token: \"hr_interview\", schema: \"hr\", table: \"interview\", label: \"Interview\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_interview_kit\": { token: \"hr_interview_kit\", schema: \"hr\", table: \"interview_kit\", label: \"Interview kit\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"hr_job_title\": { token: \"hr_job_title\", schema: \"hr\", table: \"job_title\", label: \"Job title\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"hr_jurisdiction\": { token: \"hr_jurisdiction\", schema: \"hr\", table: \"jurisdiction\", label: \"Jurisdiction\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"hr_jurisdiction_rule\": { token: \"hr_jurisdiction_rule\", schema: \"hr\", table: \"jurisdiction_rule\", label: \"Jurisdiction rule\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_jurisdiction_rule_class\": { token: \"hr_jurisdiction_rule_class\", schema: \"hr\", table: \"jurisdiction_rule_class\", label: \"Jurisdiction rule class\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"label\", contentRole: null, referenceCategory: null },\n \"hr_jurisdiction_rule_org_decision\": { token: \"hr_jurisdiction_rule_org_decision\", schema: \"hr\", table: \"jurisdiction_rule_org_decision\", label: \"Jurisdiction rule org decision\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_jurisdiction_rule_test\": { token: \"hr_jurisdiction_rule_test\", schema: \"hr\", table: \"jurisdiction_rule_test\", label: \"Jurisdiction rule fixture\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"hr_kiosk_device\": { token: \"hr_kiosk_device\", schema: \"hr\", table: \"kiosk_device\", label: \"Kiosk device\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_kiosk_session\": { token: \"hr_kiosk_session\", schema: \"hr\", table: \"kiosk_session\", label: \"Kiosk session\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_labor_target\": { token: \"hr_labor_target\", schema: \"hr\", table: \"labor_target\", label: \"Labor target\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_leave_case\": { token: \"hr_leave_case\", schema: \"hr\", table: \"leave_case\", label: \"Leave case\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_leave_enrollment\": { token: \"hr_leave_enrollment\", schema: \"hr\", table: \"leave_enrollment\", label: \"Leave enrollment\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_leave_ledger\": { token: \"hr_leave_ledger\", schema: \"hr\", table: \"leave_ledger\", label: \"Leave ledger entry\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_leave_policy\": { token: \"hr_leave_policy\", schema: \"hr\", table: \"leave_policy\", label: \"Leave policy\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"hr_leave_request\": { token: \"hr_leave_request\", schema: \"hr\", table: \"leave_request\", label: \"Leave request\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_legal_hold\": { token: \"hr_legal_hold\", schema: \"hr\", table: \"legal_hold\", label: \"Legal hold\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"matter_name\", contentRole: null, referenceCategory: null },\n \"hr_legal_hold_item\": { token: \"hr_legal_hold_item\", schema: \"hr\", table: \"legal_hold_item\", label: \"Legal hold item\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_location\": { token: \"hr_location\", schema: \"hr\", table: \"location\", label: \"Location\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"hr_new_hire_report\": { token: \"hr_new_hire_report\", schema: \"hr\", table: \"new_hire_report\", label: \"New hire report\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_offer\": { token: \"hr_offer\", schema: \"hr\", table: \"offer\", label: \"Offer\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_opening\": { token: \"hr_opening\", schema: \"hr\", table: \"opening\", label: \"Opening\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_overtime_alert\": { token: \"hr_overtime_alert\", schema: \"hr\", table: \"overtime_alert\", label: \"Overtime alert\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_overtime_alert_rule\": { token: \"hr_overtime_alert_rule\", schema: \"hr\", table: \"overtime_alert_rule\", label: \"Overtime alert rule\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"hr_overtime_preapproval\": { token: \"hr_overtime_preapproval\", schema: \"hr\", table: \"overtime_preapproval\", label: \"Overtime pre-approval\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_pay_group\": { token: \"hr_pay_group\", schema: \"hr\", table: \"pay_group\", label: \"Pay group\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"hr_pay_period\": { token: \"hr_pay_period\", schema: \"hr\", table: \"pay_period\", label: \"Pay period\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_pay_period_employment\": { token: \"hr_pay_period_employment\", schema: \"hr\", table: \"pay_period_employment\", label: \"Pay period timesheet\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_payroll_export\": { token: \"hr_payroll_export\", schema: \"hr\", table: \"payroll_export\", label: \"Payroll export\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_payroll_export_line\": { token: \"hr_payroll_export_line\", schema: \"hr\", table: \"payroll_export_line\", label: \"Payroll export line\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_position_assignment\": { token: \"hr_position_assignment\", schema: \"hr\", table: \"position_assignment\", label: \"Position assignment\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_posting\": { token: \"hr_posting\", schema: \"hr\", table: \"posting\", label: \"Job posting\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"hr_posting_publication\": { token: \"hr_posting_publication\", schema: \"hr\", table: \"posting_publication\", label: \"Posting publication\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_provider_binding\": { token: \"hr_provider_binding\", schema: \"hr\", table: \"provider_binding\", label: \"Provider binding\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_provider_event\": { token: \"hr_provider_event\", schema: \"hr\", table: \"provider_event\", label: \"Provider seam event\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_provisioning_result\": { token: \"hr_provisioning_result\", schema: \"hr\", table: \"provisioning_result\", label: \"Provisioning result\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_punch\": { token: \"hr_punch\", schema: \"hr\", table: \"punch\", label: \"Punch\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_recalculation_batch\": { token: \"hr_recalculation_batch\", schema: \"hr\", table: \"recalculation_batch\", label: \"Recalculation batch\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_record_class\": { token: \"hr_record_class\", schema: \"hr\", table: \"record_class\", label: \"Record class\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"label\", contentRole: null, referenceCategory: null },\n \"hr_records_request\": { token: \"hr_records_request\", schema: \"hr\", table: \"records_request\", label: \"Records request\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_reference_check\": { token: \"hr_reference_check\", schema: \"hr\", table: \"reference_check\", label: \"Reference check\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_reporting_line\": { token: \"hr_reporting_line\", schema: \"hr\", table: \"reporting_line\", label: \"Reporting line\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_requisition\": { token: \"hr_requisition\", schema: \"hr\", table: \"requisition\", label: \"Requisition\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"requisition_number\", contentRole: null, referenceCategory: null },\n \"hr_restricted_note\": { token: \"hr_restricted_note\", schema: \"hr\", table: \"restricted_note\", label: \"Restricted note\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_retention_rule\": { token: \"hr_retention_rule\", schema: \"hr\", table: \"retention_rule\", label: \"Retention rule\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_role_assignment\": { token: \"hr_role_assignment\", schema: \"hr\", table: \"role_assignment\", label: \"HR role assignment\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_schedule\": { token: \"hr_schedule\", schema: \"hr\", table: \"schedule\", label: \"Schedule\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"hr_schedule_change\": { token: \"hr_schedule_change\", schema: \"hr\", table: \"schedule_change\", label: \"Schedule change\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_schedule_guidance\": { token: \"hr_schedule_guidance\", schema: \"hr\", table: \"schedule_guidance\", label: \"Schedule guidance\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"hr_schedule_template\": { token: \"hr_schedule_template\", schema: \"hr\", table: \"schedule_template\", label: \"Schedule template\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"hr_schedule_template_shift\": { token: \"hr_schedule_template_shift\", schema: \"hr\", table: \"schedule_template_shift\", label: \"Schedule template shift\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_scorecard\": { token: \"hr_scorecard\", schema: \"hr\", table: \"scorecard\", label: \"Scorecard\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_separation\": { token: \"hr_separation\", schema: \"hr\", table: \"separation\", label: \"Separation\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_shift\": { token: \"hr_shift\", schema: \"hr\", table: \"shift\", label: \"Shift\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_shift_claim\": { token: \"hr_shift_claim\", schema: \"hr\", table: \"shift_claim\", label: \"Shift claim\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_staffing_requirement\": { token: \"hr_staffing_requirement\", schema: \"hr\", table: \"staffing_requirement\", label: \"Staffing requirement\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_survey\": { token: \"hr_survey\", schema: \"hr\", table: \"survey\", label: \"Survey\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"hr_survey_invitation\": { token: \"hr_survey_invitation\", schema: \"hr\", table: \"survey_invitation\", label: \"Survey invitation\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_survey_question\": { token: \"hr_survey_question\", schema: \"hr\", table: \"survey_question\", label: \"Survey question\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_survey_response\": { token: \"hr_survey_response\", schema: \"hr\", table: \"survey_response\", label: \"Survey response\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_tax_registration\": { token: \"hr_tax_registration\", schema: \"hr\", table: \"tax_registration\", label: \"Tax registration\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_tax_withholding\": { token: \"hr_tax_withholding\", schema: \"hr\", table: \"tax_withholding\", label: \"Tax withholding certificate\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_time_adjustment\": { token: \"hr_time_adjustment\", schema: \"hr\", table: \"time_adjustment\", label: \"Time adjustment\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_training_assignment\": { token: \"hr_training_assignment\", schema: \"hr\", table: \"training_assignment\", label: \"Training assignment\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_training_attempt\": { token: \"hr_training_attempt\", schema: \"hr\", table: \"training_attempt\", label: \"Training attempt\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_transcript_entry\": { token: \"hr_transcript_entry\", schema: \"hr\", table: \"transcript_entry\", label: \"Transcript entry\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_verification_letter_request\": { token: \"hr_verification_letter_request\", schema: \"hr\", table: \"verification_letter_request\", label: \"Verification letter request\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_work_interval\": { token: \"hr_work_interval\", schema: \"hr\", table: \"work_interval\", label: \"Work interval\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_workflow_binding\": { token: \"hr_workflow_binding\", schema: \"hr\", table: \"workflow_binding\", label: \"HR Workflow Binding\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_workflow_decision\": { token: \"hr_workflow_decision\", schema: \"hr\", table: \"workflow_decision\", label: \"HR Workflow Decision\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_workflow_definition\": { token: \"hr_workflow_definition\", schema: \"hr\", table: \"workflow_definition\", label: \"HR Workflow Definition\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_workflow_event\": { token: \"hr_workflow_event\", schema: \"hr\", table: \"workflow_event\", label: \"HR Workflow Event\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_workflow_failure\": { token: \"hr_workflow_failure\", schema: \"hr\", table: \"workflow_failure\", label: \"HR Workflow Failure\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_workflow_flow_type\": { token: \"hr_workflow_flow_type\", schema: \"hr\", table: \"workflow_flow_type\", label: \"HR Workflow Flow Type\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_workflow_instance\": { token: \"hr_workflow_instance\", schema: \"hr\", table: \"workflow_instance\", label: \"HR Workflow Instance\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_workflow_step\": { token: \"hr_workflow_step\", schema: \"hr\", table: \"workflow_step\", label: \"HR Workflow Step\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_workflow_step_definition\": { token: \"hr_workflow_step_definition\", schema: \"hr\", table: \"workflow_step_definition\", label: \"HR Workflow Step Definition\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_workweek\": { token: \"hr_workweek\", schema: \"hr\", table: \"workweek\", label: \"Workweek\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"iam_api_key\": { token: \"iam_api_key\", schema: \"iam\", table: \"api_keys\", label: \"API Key\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"industry_curator\": { token: \"industry_curator\", schema: \"iam\", table: \"industry_curators\", label: \"Industry Curator\", baseTier: 2, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"interview_document_revision\": { token: \"interview_document_revision\", schema: \"interview\", table: \"document_revision\", label: \"Interview Document Revision\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"interview_hole\": { token: \"interview_hole\", schema: \"interview\", table: \"hole\", label: \"Interview Adversary Hole\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"interview_question\": { token: \"interview_question\", schema: \"interview\", table: \"question\", label: \"Interview Open Question\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"interview_session\": { token: \"interview_session\", schema: \"interview\", table: \"session\", label: \"Vision Interview Session\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"interview_turn\": { token: \"interview_turn\", schema: \"interview\", table: \"turn\", label: \"Interview Turn\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"invitation\": { token: \"invitation\", schema: \"iam\", table: \"invitations\", label: \"Invitation\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"invitation_code\": { token: \"invitation_code\", schema: \"users\", table: \"invitation_codes\", label: \"Invitation Code\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"invitation_request\": { token: \"invitation_request\", schema: \"users\", table: \"invitation_requests\", label: \"Invitation Request\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"item_mastery\": { token: \"item_mastery\", schema: \"education\", table: \"item_mastery\", label: \"Item Mastery\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"judge_verdict\": { token: \"judge_verdict\", schema: \"platform\", table: \"judge_verdict\", label: \"Judge Verdict\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"kg_alert\": { token: \"kg_alert\", schema: \"rag\", table: \"kg_alerts\", label: \"KG Alert\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"kg_suggestion_ack\": { token: \"kg_suggestion_ack\", schema: \"rag\", table: \"kg_suggestion_ack\", label: \"KG Suggestion Ack\", baseTier: 3, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"kg_sweep_queue\": { token: \"kg_sweep_queue\", schema: \"rag\", table: \"kg_sweep_queue\", label: \"KG Sweep Queue\", baseTier: 3, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"kg_sweep_run\": { token: \"kg_sweep_run\", schema: \"rag\", table: \"kg_sweep_run\", label: \"KG Sweep Run\", baseTier: 3, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"kg_sweep_state\": { token: \"kg_sweep_state\", schema: \"rag\", table: \"kg_sweep_state\", label: \"KG Sweep State\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"kg_value_match\": { token: \"kg_value_match\", schema: \"rag\", table: \"kg_value_matches\", label: \"KG Value Match\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"league_membership\": { token: \"league_membership\", schema: \"education\", table: \"league_membership\", label: \"League Membership\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"display_name\", contentRole: null, referenceCategory: null },\n \"learn_doc\": { token: \"learn_doc\", schema: \"education\", table: \"learn_doc\", label: \"Study Guide\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"library_doc\": { token: \"library_doc\", schema: \"rag\", table: \"library_docs\", label: \"Library Document\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"mandate\": { token: \"mandate\", schema: \"mandate\", table: \"definition\", label: \"Mandate Definition (new)\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"mandate_binding\": { token: \"mandate_binding\", schema: \"mandate\", table: \"binding\", label: \"Mandate Binding (new)\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"mandate_treatment\": { token: \"mandate_treatment\", schema: \"mandate\", table: \"treatment\", label: \"Mandate Treatment (new)\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"marketing_initiative\": { token: \"marketing_initiative\", schema: \"marketing\", table: \"initiative\", label: \"Initiative\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: \"container\", referenceCategory: null },\n \"masterwork_corpus_item\": { token: \"masterwork_corpus_item\", schema: \"platform\", table: \"masterwork_corpus_item\", label: \"Masterwork Corpus Piece\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"masterwork_run\": { token: \"masterwork_run\", schema: \"platform\", table: \"masterwork_run\", label: \"Masterwork Run\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"Masterwork\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"membership\": { token: \"membership\", schema: \"iam\", table: \"memberships\", label: \"Membership\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"message\": { token: \"message\", schema: \"chat\", table: \"message\", label: \"Message\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"message_template\": { token: \"message_template\", schema: \"agent\", table: \"message_template\", label: \"Message Template\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"label\", contentRole: \"utility\", referenceCategory: null },\n \"ner_shadow\": { token: \"ner_shadow\", schema: \"rag\", table: \"ner_canonicalizer_shadow\", label: \"NER Shadow\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"note\": { token: \"note\", schema: \"workbench\", table: \"notes\", label: \"Note\", baseTier: 1, isComponent: false, isModule: true, isListed: false, scopeable: true, category: \"Sources & Outputs\", referencePickable: true, titleColumn: \"label\", contentRole: \"hybrid\", referenceCategory: null },\n \"note_folder\": { token: \"note_folder\", schema: \"workbench\", table: \"note_folders\", label: \"Note Folder\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"notification\": { token: \"notification\", schema: \"communication\", table: \"notification\", label: \"Notification\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"notification_channel_preference\": { token: \"notification_channel_preference\", schema: \"communication\", table: \"notification_channel_preference\", label: \"Notification Channel Preference\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"notification_event_override\": { token: \"notification_event_override\", schema: \"communication\", table: \"notification_event_override\", label: \"Notification Event Override\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"notification_event_type\": { token: \"notification_event_type\", schema: \"communication\", table: \"notification_event_type\", label: \"Notification Event Type\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"notification_preference\": { token: \"notification_preference\", schema: \"communication\", table: \"notification_preference\", label: \"Notification Preference\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"ops_issue_event\": { token: \"ops_issue_event\", schema: \"ops\", table: \"ops_issue_event\", label: \"Ops Issue Event\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"ops_proof_check\": { token: \"ops_proof_check\", schema: \"ops\", table: \"proof_check\", label: \"Proof Check\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"ops_proof_run\": { token: \"ops_proof_run\", schema: \"ops\", table: \"proof_run\", label: \"Proof Run\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"ops_proof_scenario\": { token: \"ops_proof_scenario\", schema: \"ops\", table: \"proof_scenario\", label: \"Proof Scenario\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"organization\": { token: \"organization\", schema: \"iam\", table: \"organizations\", label: \"Organization\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: \"container\", referenceCategory: null },\n \"output_feedback\": { token: \"output_feedback\", schema: \"platform\", table: \"output_feedback\", label: \"Output Feedback\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"page_extraction_job\": { token: \"page_extraction_job\", schema: \"docproc\", table: \"page_extraction_jobs\", label: \"Extraction Dataset\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"page_extraction_page_run\": { token: \"page_extraction_page_run\", schema: \"docproc\", table: \"page_extraction_page_runs\", label: \"Page Extraction Page Run\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"party\": { token: \"party\", schema: \"crm\", table: \"party\", label: \"Entity\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"display_name\", contentRole: \"source\", referenceCategory: null },\n \"party_contact_point\": { token: \"party_contact_point\", schema: \"crm\", table: \"party_contact_point\", label: \"Contact Point\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"label\", contentRole: null, referenceCategory: null },\n \"pc_article\": { token: \"pc_article\", schema: \"podcast\", table: \"pc_articles\", label: \"Podcast Article\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"pc_episode\": { token: \"pc_episode\", schema: \"podcast\", table: \"pc_episodes\", label: \"Podcast Episode\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"pc_show\": { token: \"pc_show\", schema: \"podcast\", table: \"pc_shows\", label: \"Podcast Show\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"pc_studio_run\": { token: \"pc_studio_run\", schema: \"podcast\", table: \"pc_studio_runs\", label: \"Podcast Studio Run\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"pc_studio_run_asset\": { token: \"pc_studio_run_asset\", schema: \"podcast\", table: \"pc_studio_run_assets\", label: \"Podcast Studio Run Asset\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"pdf_redaction_audit\": { token: \"pdf_redaction_audit\", schema: \"pdf\", table: \"pdf_redaction_audits\", label: \"PDF Redaction Audit\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"plan_cms_fill_item\": { token: \"plan_cms_fill_item\", schema: \"plan\", table: \"cms_fill_item\", label: \"CMS Fill Item\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"plan_cms_fill_job\": { token: \"plan_cms_fill_job\", schema: \"plan\", table: \"cms_fill_job\", label: \"CMS Fill Job\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"plan_entity\": { token: \"plan_entity\", schema: \"plan\", table: \"entity\", label: \"Plan Entity\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: \"label\", contentRole: null, referenceCategory: null },\n \"plan_node\": { token: \"plan_node\", schema: \"plan\", table: \"node\", label: \"Plan Node\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: \"label\", contentRole: null, referenceCategory: null },\n \"plan_node_artifact\": { token: \"plan_node_artifact\", schema: \"plan\", table: \"node_artifact\", label: \"Plan Node Artifact\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"plan_node_step\": { token: \"plan_node_step\", schema: \"plan\", table: \"node_step\", label: \"Plan Node Step\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"plan_profile\": { token: \"plan_profile\", schema: \"plan\", table: \"profile\", label: \"Plan Vertical Profile\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"vertical\", contentRole: null, referenceCategory: null },\n \"platform_actor_session\": { token: \"platform_actor_session\", schema: \"platform\", table: \"actor_session\", label: \"Actor session\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"platform_actor_token\": { token: \"platform_actor_token\", schema: \"platform\", table: \"actor_token\", label: \"Actor token\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"platform_actor_token_event\": { token: \"platform_actor_token_event\", schema: \"platform\", table: \"actor_token_event\", label: \"Actor token event\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"platform_continued_access\": { token: \"platform_continued_access\", schema: \"platform\", table: \"continued_access\", label: \"Continued Access\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"platform_outcome_event\": { token: \"platform_outcome_event\", schema: \"platform\", table: \"outcome_event\", label: \"Outcome Event\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"platform_outsider_consumer\": { token: \"platform_outsider_consumer\", schema: \"platform\", table: \"outsider_consumer\", label: \"Outsider consumer\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"platform_saved_view\": { token: \"platform_saved_view\", schema: \"platform\", table: \"saved_view\", label: \"Saved view\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"podcast_race\": { token: \"podcast_race\", schema: \"podcast\", table: \"pc_race\", label: \"Podcast Race Episode\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"processed_document\": { token: \"processed_document\", schema: \"docproc\", table: \"processed_documents\", label: \"Processed document\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: \"source\", referenceCategory: null },\n \"processed_document_page\": { token: \"processed_document_page\", schema: \"docproc\", table: \"processed_document_pages\", label: \"Processed document page\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"product_capture_file\": { token: \"product_capture_file\", schema: \"workbench\", table: \"product_capture_file\", label: \"Product Capture File\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"product_capture_item\": { token: \"product_capture_item\", schema: \"workbench\", table: \"product_capture_item\", label: \"Product Capture Item\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"product_capture_payload\": { token: \"product_capture_payload\", schema: \"workbench\", table: \"product_capture_payload\", label: \"Product Capture Payload\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"product_capture_product\": { token: \"product_capture_product\", schema: \"workbench\", table: \"product_capture_product\", label: \"Product Capture Product\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"product_capture_question\": { token: \"product_capture_question\", schema: \"workbench\", table: \"product_capture_question\", label: \"Product Capture Question\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"project\": { token: \"project\", schema: \"workspace\", table: \"projects\", label: \"Project\", baseTier: 1, isComponent: false, isModule: true, isListed: false, scopeable: true, category: \"Workspaces\", referencePickable: true, titleColumn: \"name\", contentRole: \"container\", referenceCategory: null },\n \"provision\": { token: \"provision\", schema: \"mandate\", table: \"provision\", label: \"Mandate Provision (new)\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"purpose\": { token: \"purpose\", schema: \"platform\", table: \"purpose\", label: \"Purpose\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"quiz_session\": { token: \"quiz_session\", schema: \"education\", table: \"quiz_sessions\", label: \"Quiz Session\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"title\", contentRole: \"destination\", referenceCategory: null },\n \"rag_ingest_run\": { token: \"rag_ingest_run\", schema: \"rag\", table: \"ingest_run\", label: \"Ingest Run\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"redaction_mapping\": { token: \"redaction_mapping\", schema: \"pdf\", table: \"redaction_mapping\", label: \"Redaction Mapping\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"research_analysis\": { token: \"research_analysis\", schema: \"research\", table: \"rs_analysis\", label: \"Research Analysis\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"research_content\": { token: \"research_content\", schema: \"research\", table: \"rs_content\", label: \"Research Content\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"research_context_bundle\": { token: \"research_context_bundle\", schema: \"research\", table: \"rs_context_bundle\", label: \"Research Context Bundle\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: \"research\", referencePickable: false, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"research_document\": { token: \"research_document\", schema: \"research\", table: \"rs_document\", label: \"Research Document\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"research_keyword\": { token: \"research_keyword\", schema: \"research\", table: \"rs_keyword\", label: \"Research Keyword\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"research_media\": { token: \"research_media\", schema: \"research\", table: \"rs_media\", label: \"Research Media\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"research_source\": { token: \"research_source\", schema: \"research\", table: \"rs_source\", label: \"Research Source\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"research_synthesis\": { token: \"research_synthesis\", schema: \"research\", table: \"rs_synthesis\", label: \"Research Synthesis\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"research_tag\": { token: \"research_tag\", schema: \"research\", table: \"rs_tag\", label: \"Research Tag\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"research_template\": { token: \"research_template\", schema: \"research\", table: \"rs_template\", label: \"Research Template\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"research_topic\": { token: \"research_topic\", schema: \"research\", table: \"rs_topic\", label: \"Research Topic\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"route_manifest_entry\": { token: \"route_manifest_entry\", schema: \"platform\", table: \"route_manifest\", label: \"Route Manifest Entry\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"rulebook\": { token: \"rulebook\", schema: \"platform\", table: \"rulebook\", label: \"Rulebook\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: \"Knowledge\", referencePickable: true, titleColumn: \"name\", contentRole: \"source\", referenceCategory: null },\n \"sandbox_instance\": { token: \"sandbox_instance\", schema: \"public\", table: \"sandbox_instances\", label: \"Sandbox Instance\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"sch_agent_task\": { token: \"sch_agent_task\", schema: \"scheduler\", table: \"sch_agent_task\", label: \"Agent Task Config\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"sch_run\": { token: \"sch_run\", schema: \"scheduler\", table: \"sch_run\", label: \"Task Run\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"sch_task\": { token: \"sch_task\", schema: \"scheduler\", table: \"sch_task\", label: \"Scheduled Task\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"sch_trigger\": { token: \"sch_trigger\", schema: \"scheduler\", table: \"sch_trigger\", label: \"Task Trigger\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"scope\": { token: \"scope\", schema: \"context\", table: \"scopes\", label: \"Scope\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"name\", contentRole: \"container\", referenceCategory: null },\n \"scope_association_suggestion\": { token: \"scope_association_suggestion\", schema: \"rag\", table: \"scope_association_suggestions\", label: \"Scope Association Suggestion\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"scope_item_value_suggestion\": { token: \"scope_item_value_suggestion\", schema: \"rag\", table: \"scope_item_value_suggestions\", label: \"Scope Item Value Suggestion\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"scope_suggestion\": { token: \"scope_suggestion\", schema: \"rag\", table: \"scope_suggestions\", label: \"Scope Suggestion\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"scope_type\": { token: \"scope_type\", schema: \"context\", table: \"scope_types\", label: \"Scope Type\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"slug\", contentRole: \"container\", referenceCategory: null },\n \"seo_ai_visibility_citation\": { token: \"seo_ai_visibility_citation\", schema: \"seo\", table: \"ai_visibility_citation\", label: \"AI Visibility Citation\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_ai_visibility_claim\": { token: \"seo_ai_visibility_claim\", schema: \"seo\", table: \"ai_visibility_claim\", label: \"AI Visibility Claim\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_ai_visibility_panel\": { token: \"seo_ai_visibility_panel\", schema: \"seo\", table: \"ai_visibility_panel\", label: \"AI Visibility Panel\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_ai_visibility_response\": { token: \"seo_ai_visibility_response\", schema: \"seo\", table: \"ai_visibility_response\", label: \"AI Visibility Response\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_ai_visibility_signal\": { token: \"seo_ai_visibility_signal\", schema: \"seo\", table: \"ai_visibility_signal\", label: \"AI Visibility Signal\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_backlink\": { token: \"seo_backlink\", schema: \"seo\", table: \"backlink\", label: \"SEO Backlink\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_backlink_change_event\": { token: \"seo_backlink_change_event\", schema: \"seo\", table: \"backlink_change_event\", label: \"Backlink Change Event\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_backlink_dimension_snapshot\": { token: \"seo_backlink_dimension_snapshot\", schema: \"seo\", table: \"backlink_dimension_snapshot\", label: \"Backlink Dimension Snapshot\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_backlink_observation\": { token: \"seo_backlink_observation\", schema: \"seo\", table: \"backlink_observation\", label: \"Backlink Observation\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_backlink_snapshot\": { token: \"seo_backlink_snapshot\", schema: \"seo\", table: \"backlink_snapshot\", label: \"Backlink Snapshot\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_change_assessment\": { token: \"seo_change_assessment\", schema: \"seo\", table: \"change_assessment\", label: \"SEO Change Assessment\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_change_event\": { token: \"seo_change_event\", schema: \"seo\", table: \"change_event\", label: \"SEO Change Event\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_change_item\": { token: \"seo_change_item\", schema: \"seo\", table: \"change_item\", label: \"SEO Change Item\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_change_metric\": { token: \"seo_change_metric\", schema: \"seo\", table: \"change_metric\", label: \"SEO Change Metric\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_change_set\": { token: \"seo_change_set\", schema: \"seo\", table: \"change_set\", label: \"SEO Change\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"seo\", referencePickable: false, titleColumn: \"title\", contentRole: \"source\", referenceCategory: null },\n \"seo_change_theory\": { token: \"seo_change_theory\", schema: \"seo\", table: \"change_theory\", label: \"SEO Change Theory\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_collection_run\": { token: \"seo_collection_run\", schema: \"seo\", table: \"collection_run\", label: \"SEO Collection Run\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: \"seo\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_competitor\": { token: \"seo_competitor\", schema: \"seo\", table: \"competitor\", label: \"SEO Competitor\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_competitor_observation\": { token: \"seo_competitor_observation\", schema: \"seo\", table: \"competitor_observation\", label: \"Competitor Observation\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_competitor_opportunity\": { token: \"seo_competitor_opportunity\", schema: \"seo\", table: \"competitor_opportunity\", label: \"Competitor Opportunity\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_coverage_mention\": { token: \"seo_coverage_mention\", schema: \"seo\", table: \"coverage_mention\", label: \"Coverage Mention\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_coverage_tracker\": { token: \"seo_coverage_tracker\", schema: \"seo\", table: \"coverage_tracker\", label: \"Coverage Tracker\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_dimension_value_matcher\": { token: \"seo_dimension_value_matcher\", schema: \"seo\", table: \"dimension_value_matcher\", label: \"Dimension Value Matcher\", baseTier: 1, isComponent: true, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_engine_schedule\": { token: \"seo_engine_schedule\", schema: \"seo\", table: \"engine_schedule\", label: \"SEO Engine Schedule\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_geo_place\": { token: \"seo_geo_place\", schema: \"seo\", table: \"geo_place\", label: \"Geo Place\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_gsc_dig_rule\": { token: \"seo_gsc_dig_rule\", schema: \"seo\", table: \"gsc_dig_rule\", label: \"GSC Dig Rule\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_keyword\": { token: \"seo_keyword\", schema: \"seo\", table: \"keyword\", label: \"SEO Keyword\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: \"seo\", referencePickable: false, titleColumn: \"phrase\", contentRole: null, referenceCategory: null },\n \"seo_keyword_class_rule\": { token: \"seo_keyword_class_rule\", schema: \"seo\", table: \"keyword_class_rule\", label: \"Keyword Class Rule\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_keyword_edge\": { token: \"seo_keyword_edge\", schema: \"seo\", table: \"keyword_edge\", label: \"Keyword Edge\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: \"seo\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_keyword_facet\": { token: \"seo_keyword_facet\", schema: \"seo\", table: \"keyword_facet\", label: \"Keyword Facet\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_keyword_market\": { token: \"seo_keyword_market\", schema: \"seo\", table: \"keyword_market\", label: \"Keyword Market Data\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: \"seo\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_keyword_market_observation\": { token: \"seo_keyword_market_observation\", schema: \"seo\", table: \"keyword_market_observation\", label: \"Keyword Market Observation\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_keyword_place\": { token: \"seo_keyword_place\", schema: \"seo\", table: \"keyword_place\", label: \"Keyword Place\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_keyword_saved_view\": { token: \"seo_keyword_saved_view\", schema: \"seo\", table: \"keyword_saved_view\", label: \"Keyword Saved View\", baseTier: 1, isComponent: true, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_keyword_topic\": { token: \"seo_keyword_topic\", schema: \"seo\", table: \"keyword_topic\", label: \"Keyword Topic Assignment\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: \"seo\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_landscape_brief\": { token: \"seo_landscape_brief\", schema: \"seo\", table: \"landscape_brief\", label: \"Competitive Landscape Brief\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_link_gap_domain\": { token: \"seo_link_gap_domain\", schema: \"seo\", table: \"link_gap_domain\", label: \"Link Gap Domain\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_link_gap_match\": { token: \"seo_link_gap_match\", schema: \"seo\", table: \"link_gap_match\", label: \"Link Gap Match\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_page_measurement_health\": { token: \"seo_page_measurement_health\", schema: \"seo\", table: \"page_measurement_health\", label: \"Page Measurement Health\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_page_performance\": { token: \"seo_page_performance\", schema: \"seo\", table: \"page_performance\", label: \"Page Performance\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_provider_call\": { token: \"seo_provider_call\", schema: \"seo\", table: \"provider_call\", label: \"SEO Provider Call\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_provider_task\": { token: \"seo_provider_task\", schema: \"seo\", table: \"provider_task\", label: \"SEO Provider Task\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_rank_observation\": { token: \"seo_rank_observation\", schema: \"seo\", table: \"rank_observation\", label: \"Rank Observation\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_rank_target\": { token: \"seo_rank_target\", schema: \"seo\", table: \"rank_target\", label: \"SEO Rank Target\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: \"seo\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_raw_payload\": { token: \"seo_raw_payload\", schema: \"seo\", table: \"raw_payload\", label: \"SEO Raw Payload\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_referring_domain_profile\": { token: \"seo_referring_domain_profile\", schema: \"seo\", table: \"referring_domain_profile\", label: \"Referring Domain Profile\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_reputation_case\": { token: \"seo_reputation_case\", schema: \"seo\", table: \"reputation_case\", label: \"Reputation Case\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_search_performance_daily\": { token: \"seo_search_performance_daily\", schema: \"seo\", table: \"search_performance_daily\", label: \"Search Performance Daily\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_serp_mention\": { token: \"seo_serp_mention\", schema: \"seo\", table: \"serp_mention\", label: \"SERP Prospect Mention\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_serp_opportunity\": { token: \"seo_serp_opportunity\", schema: \"seo\", table: \"serp_opportunity\", label: \"SERP Prospect Opportunity\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_serp_result\": { token: \"seo_serp_result\", schema: \"seo\", table: \"serp_result\", label: \"SERP Result\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_serp_snapshot\": { token: \"seo_serp_snapshot\", schema: \"seo\", table: \"serp_snapshot\", label: \"SERP Snapshot\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_site_geo_area\": { token: \"seo_site_geo_area\", schema: \"seo\", table: \"site_geo_area\", label: \"Site Geo Area\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_site_keyword_offering\": { token: \"seo_site_keyword_offering\", schema: \"seo\", table: \"site_keyword_offering\", label: \"Site Keyword Offering\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_site_keyword_value\": { token: \"seo_site_keyword_value\", schema: \"seo\", table: \"site_keyword_value\", label: \"Site Keyword Value\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"seo\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_site_offering_value\": { token: \"seo_site_offering_value\", schema: \"seo\", table: \"site_offering_value\", label: \"Site Offering Value\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_site_topic_value\": { token: \"seo_site_topic_value\", schema: \"seo\", table: \"site_topic_value\", label: \"Site Topic Value\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"seo\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_site_value_combo\": { token: \"seo_site_value_combo\", schema: \"seo\", table: \"site_value_combo\", label: \"Site Value Combination\", baseTier: 1, isComponent: true, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_site_value_worth\": { token: \"seo_site_value_worth\", schema: \"seo\", table: \"site_value_worth\", label: \"Site Value Worth\", baseTier: 1, isComponent: true, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_site_vocabulary\": { token: \"seo_site_vocabulary\", schema: \"seo\", table: \"site_vocabulary\", label: \"Site Vocabulary\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_source_request\": { token: \"seo_source_request\", schema: \"seo\", table: \"source_request\", label: \"SEO Source Request\", baseTier: 2, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_starter_pack\": { token: \"seo_starter_pack\", schema: \"seo\", table: \"starter_pack\", label: \"SEO Industry Starter Pack\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_starter_pack_item\": { token: \"seo_starter_pack_item\", schema: \"seo\", table: \"starter_pack_item\", label: \"SEO Starter Pack Item\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_story_angle\": { token: \"seo_story_angle\", schema: \"seo\", table: \"story_angle\", label: \"SEO Story Angle\", baseTier: 2, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_topic\": { token: \"seo_topic\", schema: \"seo\", table: \"topic\", label: \"SEO Topic\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: \"seo\", referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"seo_web_analytics_daily\": { token: \"seo_web_analytics_daily\", schema: \"seo\", table: \"web_analytics_daily\", label: \"Web Analytics Daily\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"shared_canvas_item\": { token: \"shared_canvas_item\", schema: \"canvas\", table: \"shared_canvas_items\", label: \"Shared Canvas Item\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"short_link\": { token: \"short_link\", schema: \"platform\", table: \"short_links\", label: \"Short Link\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"skill\": { token: \"skill\", schema: \"skill\", table: \"definition\", label: \"Skill\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: \"Skills\", referencePickable: true, titleColumn: \"label\", contentRole: \"utility\", referenceCategory: null },\n \"skill_render_definition\": { token: \"skill_render_definition\", schema: \"skill\", table: \"render_definition\", label: \"Skill Render Definition\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: \"Skills\", referencePickable: true, titleColumn: \"label\", contentRole: null, referenceCategory: null },\n \"sms_consent\": { token: \"sms_consent\", schema: \"communication\", table: \"sms_consent\", label: \"SMS Consent\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"sms_conversation\": { token: \"sms_conversation\", schema: \"communication\", table: \"sms_conversations\", label: \"SMS Conversation\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"sms_message\": { token: \"sms_message\", schema: \"communication\", table: \"sms_messages\", label: \"SMS Message\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"sms_message_media\": { token: \"sms_message_media\", schema: \"communication\", table: \"sms_media\", label: \"SMS Media\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"file_name\", contentRole: null, referenceCategory: null },\n \"sms_notification\": { token: \"sms_notification\", schema: \"communication\", table: \"sms_notifications\", label: \"SMS Notification\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"sms_notification_preference\": { token: \"sms_notification_preference\", schema: \"communication\", table: \"sms_notification_preferences\", label: \"SMS Notification Preference\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"sms_phone_number\": { token: \"sms_phone_number\", schema: \"communication\", table: \"sms_phone_numbers\", label: \"SMS Phone Number\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"structured_list\": { token: \"structured_list\", schema: \"workbench\", table: \"udt_structured_lists\", label: \"Structured List\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"list_name\", contentRole: \"hybrid\", referenceCategory: null },\n \"studio_documents\": { token: \"studio_documents\", schema: \"transcripts\", table: \"studio_documents\", label: \"Studio Document\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"studio_recording_chunks\": { token: \"studio_recording_chunks\", schema: \"transcripts\", table: \"studio_recording_chunks\", label: \"Studio Recording Chunk\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"studio_recording_segments\": { token: \"studio_recording_segments\", schema: \"transcripts\", table: \"studio_recording_segments\", label: \"Studio Recording Segment\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"studio_run\": { token: \"studio_run\", schema: \"transcripts\", table: \"studio_runs\", label: \"Studio Run\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"studio_session\": { token: \"studio_session\", schema: \"transcripts\", table: \"studio_sessions\", label: \"Audio Session\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"title\", contentRole: \"source\", referenceCategory: null },\n \"studio_session_settings\": { token: \"studio_session_settings\", schema: \"transcripts\", table: \"studio_session_settings\", label: \"Studio Session Settings\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"study_attempt\": { token: \"study_attempt\", schema: \"education\", table: \"study_attempt\", label: \"Study Attempt\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"study_goal\": { token: \"study_goal\", schema: \"education\", table: \"study_goal\", label: \"Study Goal\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"study_media\": { token: \"study_media\", schema: \"education\", table: \"study_media\", label: \"Study Media\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"study_plan\": { token: \"study_plan\", schema: \"education\", table: \"study_plan\", label: \"Study Plan\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"study_plan_block\": { token: \"study_plan_block\", schema: \"education\", table: \"study_plan_block\", label: \"Study Plan Block\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"label\", contentRole: null, referenceCategory: null },\n \"study_plan_day\": { token: \"study_plan_day\", schema: \"education\", table: \"study_plan_day\", label: \"Study Plan Day\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"study_reminder_context\": { token: \"study_reminder_context\", schema: \"education\", table: \"study_reminder_context\", label: \"Study Reminder Context\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"study_reminder_delivery\": { token: \"study_reminder_delivery\", schema: \"education\", table: \"study_reminder_delivery\", label: \"Study Reminder Delivery\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"study_session\": { token: \"study_session\", schema: \"education\", table: \"study_session\", label: \"Study Session\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"surface\": { token: \"surface\", schema: \"ui\", table: \"ui_surface\", label: \"UI Surface\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"system_context_item\": { token: \"system_context_item\", schema: \"context\", table: \"system_context_item\", label: \"System Context Item\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"system_error\": { token: \"system_error\", schema: \"ops\", table: \"system_error\", label: \"System Error\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"system_personal_org_failure\": { token: \"system_personal_org_failure\", schema: \"iam\", table: \"system_personal_org_failures\", label: \"System Personal Org Failure\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"system_write_failure\": { token: \"system_write_failure\", schema: \"ops\", table: \"system_write_failure\", label: \"System Write Failure\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"task\": { token: \"task\", schema: \"workspace\", table: \"tasks\", label: \"Task\", baseTier: 1, isComponent: false, isModule: true, isListed: false, scopeable: true, category: \"Workspaces\", referencePickable: true, titleColumn: \"title\", contentRole: \"container\", referenceCategory: null },\n \"thread\": { token: \"thread\", schema: \"workspace\", table: \"threads\", label: \"Thread\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"tool\": { token: \"tool\", schema: \"tool\", table: \"definition\", label: \"Tool\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: \"Tools\", referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"tool_bundle\": { token: \"tool_bundle\", schema: \"tool\", table: \"bundle\", label: \"Tool Bundle\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: \"Tools\", referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"tool_call\": { token: \"tool_call\", schema: \"chat\", table: \"tool_call\", label: \"Tool Call\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"tool_definition_version\": { token: \"tool_definition_version\", schema: \"tool\", table: \"definition_version\", label: \"Tool Definition Version\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"Tools\", referencePickable: false, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"tool_test_sample\": { token: \"tool_test_sample\", schema: \"tool\", table: \"test_sample\", label: \"Tool Test Sample\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"Tools\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"tool_ui\": { token: \"tool_ui\", schema: \"tool\", table: \"ui\", label: \"Tool UI\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"Tools\", referencePickable: false, titleColumn: \"display_name\", contentRole: null, referenceCategory: null },\n \"tool_ui_incident\": { token: \"tool_ui_incident\", schema: \"tool\", table: \"ui_incident\", label: \"Tool UI Incident\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"Tools\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"tool_ui_version\": { token: \"tool_ui_version\", schema: \"tool\", table: \"ui_version\", label: \"Tool UI Version\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"Tools\", referencePickable: false, titleColumn: \"display_name\", contentRole: null, referenceCategory: null },\n \"transcript\": { token: \"transcript\", schema: \"transcripts\", table: \"transcripts\", label: \"Transcript\", baseTier: 1, isComponent: false, isModule: true, isListed: false, scopeable: true, category: \"Sources\", referencePickable: true, titleColumn: \"title\", contentRole: \"source\", referenceCategory: null },\n \"udt_dataset_fields\": { token: \"udt_dataset_fields\", schema: \"workbench\", table: \"udt_dataset_fields\", label: \"Dataset Field\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"display_name\", contentRole: null, referenceCategory: null },\n \"udt_dataset_rows\": { token: \"udt_dataset_rows\", schema: \"workbench\", table: \"udt_dataset_rows\", label: \"Dataset Row\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"udt_document\": { token: \"udt_document\", schema: \"workbench\", table: \"udt_documents\", label: \"Document\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"document_name\", contentRole: \"hybrid\", referenceCategory: null },\n \"udt_structured_list_items\": { token: \"udt_structured_list_items\", schema: \"workbench\", table: \"udt_structured_list_items\", label: \"Structured List Item\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"label\", contentRole: null, referenceCategory: null },\n \"ui_surface_agent_pref\": { token: \"ui_surface_agent_pref\", schema: \"ui\", table: \"ui_surface_agent_pref\", label: \"UI Surface Agent Pref\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"ui_surface_config\": { token: \"ui_surface_config\", schema: \"ui\", table: \"ui_surface_config\", label: \"UI Surface Config\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"user_achievement\": { token: \"user_achievement\", schema: \"users\", table: \"user_achievements\", label: \"User Achievement\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"user_analysis_preference\": { token: \"user_analysis_preference\", schema: \"users\", table: \"user_analysis_preferences\", label: \"User Analysis Preference\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"user_bookmark\": { token: \"user_bookmark\", schema: \"users\", table: \"user_bookmarks\", label: \"User Bookmark\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"user_email_preference\": { token: \"user_email_preference\", schema: \"users\", table: \"user_email_preferences\", label: \"User Email Preference\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"user_feedback\": { token: \"user_feedback\", schema: \"users\", table: \"user_feedback\", label: \"User Feedback\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"user_form_profile\": { token: \"user_form_profile\", schema: \"users\", table: \"user_form_profile\", label: \"User Form Profile\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"user_markdown_sample\": { token: \"user_markdown_sample\", schema: \"users\", table: \"user_markdown_samples\", label: \"User Markdown Sample\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"user_memory\": { token: \"user_memory\", schema: \"users\", table: \"user_memory\", label: \"User Memory\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"user_preference\": { token: \"user_preference\", schema: \"users\", table: \"user_preferences\", label: \"User Preference\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"user_profile\": { token: \"user_profile\", schema: \"users\", table: \"profiles\", label: \"User Profile\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"display_name\", contentRole: null, referenceCategory: null },\n \"user_stat\": { token: \"user_stat\", schema: \"users\", table: \"user_stats\", label: \"User Stats\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"user_surface_state\": { token: \"user_surface_state\", schema: \"users\", table: \"user_surface_state\", label: \"User Surface State\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"voice\": { token: \"voice\", schema: \"ai\", table: \"voices\", label: \"Voice\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"war_room\": { token: \"war_room\", schema: \"workspace\", table: \"war_rooms\", label: \"War Room\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"wbx_capture\": { token: \"wbx_capture\", schema: \"extend\", table: \"wbx_capture\", label: \"Extension Web Capture\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"wbx_guidance\": { token: \"wbx_guidance\", schema: \"extend\", table: \"wbx_guidance\", label: \"Extension Guidance\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"wbx_highlight\": { token: \"wbx_highlight\", schema: \"extend\", table: \"wbx_highlight\", label: \"Extension Highlight\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"wbx_pattern\": { token: \"wbx_pattern\", schema: \"extend\", table: \"wbx_pattern\", label: \"Extension Scrape Pattern\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"wbx_screenshot\": { token: \"wbx_screenshot\", schema: \"extend\", table: \"wbx_screenshot\", label: \"Extension Screenshot\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"wbx_seo_audit\": { token: \"wbx_seo_audit\", schema: \"extend\", table: \"wbx_seo_audit\", label: \"Extension SEO Audit\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"wc_claim\": { token: \"wc_claim\", schema: \"legal\", table: \"wc_claim\", label: \"WC Claim\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"wc_impairment_definition\": { token: \"wc_impairment_definition\", schema: \"legal\", table: \"wc_impairment_definition\", label: \"WC Impairment Definition\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"wc_injury\": { token: \"wc_injury\", schema: \"legal\", table: \"wc_injury\", label: \"WC Injury\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"wc_report\": { token: \"wc_report\", schema: \"legal\", table: \"wc_report\", label: \"WC Report\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"web_analysis_item\": { token: \"web_analysis_item\", schema: \"web\", table: \"analysis_item\", label: \"Analysis Item\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"label\", contentRole: null, referenceCategory: null },\n \"web_brand\": { token: \"web_brand\", schema: \"web\", table: \"brand\", label: \"Brand\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"web_brand_asset\": { token: \"web_brand_asset\", schema: \"web\", table: \"brand_asset\", label: \"Brand Asset\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"web_brand_offering\": { token: \"web_brand_offering\", schema: \"web\", table: \"brand_offering\", label: \"Brand Offering\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"web_business_fact\": { token: \"web_business_fact\", schema: \"web\", table: \"business_fact\", label: \"Business Fact\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"label\", contentRole: null, referenceCategory: null },\n \"web_business_location\": { token: \"web_business_location\", schema: \"web\", table: \"business_location\", label: \"Business Location\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"web_crawl_event\": { token: \"web_crawl_event\", schema: \"web\", table: \"crawl_event\", label: \"Web Crawl Event\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"web_crawl_preset\": { token: \"web_crawl_preset\", schema: \"web\", table: \"crawl_preset\", label: \"Web Crawl Preset\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"web_crawl_schedule\": { token: \"web_crawl_schedule\", schema: \"web\", table: \"crawl_schedule\", label: \"Web Crawl Schedule\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"web_crawl_session\": { token: \"web_crawl_session\", schema: \"web\", table: \"crawl_session\", label: \"Crawl Session\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"web_crawl_url\": { token: \"web_crawl_url\", schema: \"web\", table: \"crawl_url\", label: \"Web Crawl URL\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"web_discovered_item\": { token: \"web_discovered_item\", schema: \"web\", table: \"discovered_item\", label: \"Discovered Item\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"web_finding\": { token: \"web_finding\", schema: \"web\", table: \"finding\", label: \"Finding\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"web_gsc_page_stat\": { token: \"web_gsc_page_stat\", schema: \"web\", table: \"gsc_page_stat\", label: \"GSC Page Stat\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"web_link_edge\": { token: \"web_link_edge\", schema: \"web\", table: \"link_edge\", label: \"Link Edge\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"web_listing_publisher\": { token: \"web_listing_publisher\", schema: \"web\", table: \"listing_publisher\", label: \"Listing Publisher\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"web_location_listing\": { token: \"web_location_listing\", schema: \"web\", table: \"location_listing\", label: \"Location Listing\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"web_offering_template\": { token: \"web_offering_template\", schema: \"web\", table: \"offering_template\", label: \"Offering Template\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"web_page\": { token: \"web_page\", schema: \"web\", table: \"page\", label: \"Canonical Page\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"url\", contentRole: \"source\", referenceCategory: null },\n \"web_page_content\": { token: \"web_page_content\", schema: \"web\", table: \"page_content\", label: \"Page Draft Content\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"web_page_evidence\": { token: \"web_page_evidence\", schema: \"web\", table: \"page_evidence\", label: \"Web Page Evidence\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"web_page_sitemap\": { token: \"web_page_sitemap\", schema: \"web\", table: \"page_sitemap\", label: \"Page Sitemap Membership\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"web_property\": { token: \"web_property\", schema: \"web\", table: \"property\", label: \"Brand Property\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"display_name\", contentRole: null, referenceCategory: null },\n \"web_provider\": { token: \"web_provider\", schema: \"web\", table: \"provider\", label: \"Provider\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"label\", contentRole: null, referenceCategory: null },\n \"web_result\": { token: \"web_result\", schema: \"web\", table: \"analysis_result\", label: \"Analysis Result\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"web_screenshot\": { token: \"web_screenshot\", schema: \"web\", table: \"screenshot\", label: \"Screenshot\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"web_site\": { token: \"web_site\", schema: \"web\", table: \"site\", label: \"Site\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"web_site_endpoint_rule\": { token: \"web_site_endpoint_rule\", schema: \"web\", table: \"site_endpoint_rule\", label: \"Site Endpoint Rule\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"path_prefix\", contentRole: null, referenceCategory: null },\n \"web_site_item_config\": { token: \"web_site_item_config\", schema: \"web\", table: \"site_item_config\", label: \"Site Item Config\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"web_site_offering\": { token: \"web_site_offering\", schema: \"web\", table: \"site_offering\", label: \"Site Offering\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"web_sitemap\": { token: \"web_sitemap\", schema: \"web\", table: \"sitemap\", label: \"Sitemap\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"url\", contentRole: null, referenceCategory: null },\n \"web_snapshot\": { token: \"web_snapshot\", schema: \"web\", table: \"snapshot\", label: \"Snapshot\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"wf_node_data_slot\": { token: \"wf_node_data_slot\", schema: \"workflow\", table: \"node_data_slot\", label: \"Workflow Node Data Slot\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"work_item\": { token: \"work_item\", schema: \"runtime\", table: \"work_item\", label: \"Runtime Work Item\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"workbook\": { token: \"workbook\", schema: \"workbench\", table: \"udt_workbooks\", label: \"Workbook\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"description\", contentRole: \"hybrid\", referenceCategory: null },\n \"workflow\": { token: \"workflow\", schema: \"workflow\", table: \"definition\", label: \"Workflow\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: \"utility\", referenceCategory: null },\n \"workflow_card\": { token: \"workflow_card\", schema: \"workflow\", table: \"card\", label: \"Workflow Card\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"workflow_checkpoint\": { token: \"workflow_checkpoint\", schema: \"workflow\", table: \"checkpoint\", label: \"Workflow Checkpoint\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"workflow_comparison\": { token: \"workflow_comparison\", schema: \"workflow\", table: \"comparison\", label: \"Workflow Comparison\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"workflow_definition_version\": { token: \"workflow_definition_version\", schema: \"workflow\", table: \"definition_version\", label: \"Workflow Definition Version\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"workflow_idempotency\": { token: \"workflow_idempotency\", schema: \"workflow\", table: \"idempotency\", label: \"Workflow Idempotency\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"workflow_job\": { token: \"workflow_job\", schema: \"workflow\", table: \"job\", label: \"Workflow Job\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"workflow_node_events\": { token: \"workflow_node_events\", schema: \"workflow\", table: \"node_events\", label: \"Workflow Node Events\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"workflow_node_outcome\": { token: \"workflow_node_outcome\", schema: \"workflow\", table: \"node_outcome\", label: \"Workflow Node Outcome\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"workflow_plan\": { token: \"workflow_plan\", schema: \"workflow\", table: \"plan\", label: \"Workflow Plan\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: false, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"workflow_plan_event\": { token: \"workflow_plan_event\", schema: \"workflow\", table: \"plan_event\", label: \"Workflow Plan Event\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: false, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"workflow_plan_sample\": { token: \"workflow_plan_sample\", schema: \"workflow\", table: \"plan_sample\", label: \"Workflow Plan Sample\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: false, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"workflow_recovery_audit\": { token: \"workflow_recovery_audit\", schema: \"workflow\", table: \"recovery_audit\", label: \"Workflow Recovery Audit\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"workflow_run\": { token: \"workflow_run\", schema: \"workflow\", table: \"run\", label: \"Workflow Run\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"workflow_run_log\": { token: \"workflow_run_log\", schema: \"workflow\", table: \"run_log\", label: \"Workflow Run Log\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"workflow_runtime_surface\": { token: \"workflow_runtime_surface\", schema: \"workflow\", table: \"runtime_surface\", label: \"Run Surface\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"workflow_template\": { token: \"workflow_template\", schema: \"workflow\", table: \"template\", label: \"Workflow Template\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"workflow_trigger\": { token: \"workflow_trigger\", schema: \"workflow\", table: \"trigger\", label: \"Workflow Trigger\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"workflow_trigger_fire\": { token: \"workflow_trigger_fire\", schema: \"workflow\", table: \"trigger_fire\", label: \"Workflow Trigger Fire\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"working_document\": { token: \"working_document\", schema: \"workbench\", table: \"working_documents\", label: \"Working Documents\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: false, category: \"Conversations\", referencePickable: true, titleColumn: \"title\", contentRole: \"destination\", referenceCategory: null },\n \"youtube_search\": { token: \"youtube_search\", schema: \"research\", table: \"youtube_search\", label: \"YouTube Search\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"youtube_video\": { token: \"youtube_video\", schema: \"research\", table: \"youtube_video\", label: \"YouTube Video\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"title\", contentRole: \"source\", referenceCategory: null },\n} as const satisfies Record<EntityTypeToken, EntityTypeMeta>;\n\n/** Every token, sorted — the iteration/validation source. */\nexport const ENTITY_TYPE_TOKENS: readonly EntityTypeToken[] = [\n \"access_request\",\n \"activity\",\n \"agent\",\n \"agent_card\",\n \"agent_definition_version\",\n \"agent_drift_alert\",\n \"agent_exemplar\",\n \"agent_mandate_note\",\n \"agent_prompt_remediation\",\n \"agent_run\",\n \"agent_run_stage\",\n \"agent_shortcut\",\n \"agent_surface_binding\",\n \"agent_template\",\n \"agent_usage\",\n \"ai_api\",\n \"ai_endpoint\",\n \"ai_model\",\n \"ai_model_alias\",\n \"ai_offering\",\n \"ai_provider\",\n \"ai_setting\",\n \"app\",\n \"app_definition_version\",\n \"app_error\",\n \"app_execution\",\n \"app_instance\",\n \"app_log\",\n \"app_rate_limit\",\n \"app_setting\",\n \"app_sync_status\",\n \"approach\",\n \"artifact\",\n \"assessment\",\n \"assessment_item\",\n \"assessment_result\",\n \"assist\",\n \"batch_cost_event\",\n \"batch_provider_batch\",\n \"batch_work_item\",\n \"browser_account_binding\",\n \"browser_action_event\",\n \"browser_authenticator_window\",\n \"browser_capture\",\n \"browser_control_request\",\n \"browser_handoff\",\n \"browser_login_attempt\",\n \"browser_login_recipe\",\n \"browser_profile\",\n \"browser_profile_checkpoint\",\n \"browser_run\",\n \"browser_site_observation\",\n \"browser_site_policy\",\n \"browser_stream_ticket\",\n \"canvas_comment\",\n \"canvas_comment_like\",\n \"canvas_item\",\n \"canvas_item_state\",\n \"canvas_like\",\n \"canvas_score\",\n \"canvas_view\",\n \"category\",\n \"cmp_entry\",\n \"cmp_feedback\",\n \"code_file\",\n \"code_folder\",\n \"code_repository\",\n \"coding_session\",\n \"coding_session_entry\",\n \"comment\",\n \"commerce_asset_allocation\",\n \"commerce_asset_grading\",\n \"commerce_asset_identifier\",\n \"commerce_asset_lot_event\",\n \"commerce_asset_mandate_result\",\n \"commerce_asset_price_factor\",\n \"commerce_asset_reshoot_request\",\n \"commerce_asset_review\",\n \"commerce_asset_unknown\",\n \"commerce_certified_printer\",\n \"commerce_cloud_sync_connection\",\n \"commerce_ebay_business_policy\",\n \"commerce_ebay_category\",\n \"commerce_ebay_category_aspect\",\n \"commerce_ebay_category_tree\",\n \"commerce_ebay_custom_policy\",\n \"commerce_ebay_inventory_item\",\n \"commerce_ebay_inventory_item_group\",\n \"commerce_ebay_inventory_item_group_member\",\n \"commerce_ebay_inventory_location\",\n \"commerce_ebay_listing\",\n \"commerce_ebay_marketplace_policy\",\n \"commerce_ebay_media_asset\",\n \"commerce_ebay_notification_destination\",\n \"commerce_ebay_notification_event\",\n \"commerce_ebay_notification_subscription\",\n \"commerce_ebay_notification_topic\",\n \"commerce_ebay_offer\",\n \"commerce_ebay_order\",\n \"commerce_ebay_order_line_item\",\n \"commerce_ebay_shipping_fulfillment\",\n \"commerce_ebay_store_category\",\n \"commerce_human_correction\",\n \"commerce_intake_artifact\",\n \"commerce_intake_asset\",\n \"commerce_intake_batch\",\n \"commerce_label_batch\",\n \"commerce_label_code\",\n \"commerce_marketplace_account\",\n \"commerce_marketplace_account_deletion_audit\",\n \"commerce_marketplace_api_call\",\n \"commerce_marketplace_rate_budget\",\n \"commerce_marketplace_site\",\n \"commerce_marketplace_sync_run\",\n \"commerce_prediction_outcome\",\n \"commerce_print_order\",\n \"commerce_product\",\n \"commerce_product_channel_ref\",\n \"commerce_product_media\",\n \"commerce_product_variant\",\n \"commerce_recall_audit\",\n \"comparison_set\",\n \"contact_medium\",\n \"contact_submission\",\n \"content_ir_kind\",\n \"content_ir_kind_component\",\n \"content_ir_kind_component_incident\",\n \"content_ir_kind_conformance\",\n \"content_ir_kind_edge\",\n \"content_ir_kind_example\",\n \"content_ir_kind_instance\",\n \"content_ir_kind_surface\",\n \"context_item\",\n \"context_item_suggestion\",\n \"conversation\",\n \"conversation_value\",\n \"crm_address\",\n \"crm_affiliation\",\n \"crm_blocklist_entry\",\n \"crm_contact_candidate\",\n \"crm_deal\",\n \"crm_deal_stage_event\",\n \"crm_enrichment_call\",\n \"crm_interaction\",\n \"crm_merge_candidate\",\n \"crm_outreach_list\",\n \"crm_outreach_list_member\",\n \"crm_party_merge\",\n \"crm_registry_ingest_run\",\n \"crm_registry_source\",\n \"crm_saved_view\",\n \"crm_sending_event\",\n \"crm_sending_identity\",\n \"crm_sending_identity_check\",\n \"crm_sending_policy\",\n \"custom_entity_definition\",\n \"custom_field_definition\",\n \"custom_field_target\",\n \"custom_record\",\n \"cx_agent_memory\",\n \"cx_agent_plan\",\n \"cx_agent_task\",\n \"cx_code_edit\",\n \"cx_code_message_file\",\n \"cx_media\",\n \"cx_observational_memory\",\n \"cx_observational_memory_event\",\n \"cx_pending_injection\",\n \"cx_request\",\n \"cx_request_snapshot\",\n \"cx_tool_trace\",\n \"cx_user_request\",\n \"cx_user_todo\",\n \"data_store\",\n \"dataset\",\n \"derive_run\",\n \"dict_setting\",\n \"dm_conversation\",\n \"dm_message\",\n \"dm_participant\",\n \"domain_classification\",\n \"esign_campaign\",\n \"esign_campaign_member\",\n \"esign_consent_disclosure\",\n \"esign_envelope\",\n \"esign_envelope_certificate\",\n \"esign_envelope_document\",\n \"esign_envelope_event\",\n \"esign_envelope_external_ref\",\n \"esign_envelope_signer\",\n \"esign_provider\",\n \"esign_provider_binding\",\n \"esign_signing_key\",\n \"fc_card\",\n \"fc_detail\",\n \"fc_set\",\n \"feature_doc\",\n \"file\",\n \"file_analysis\",\n \"file_entities\",\n \"file_overrides\",\n \"file_page_annotations\",\n \"file_pages\",\n \"file_version\",\n \"flexible_data\",\n \"folder\",\n \"game_badge\",\n \"game_result\",\n \"game_room\",\n \"global_execution\",\n \"global_execution_checkpoint\",\n \"global_execution_event\",\n \"global_meter_entry\",\n \"global_origin\",\n \"global_request\",\n \"growth_loop_event\",\n \"growth_loop_run\",\n \"growth_loop_stage_run\",\n \"guided_checklist_run\",\n \"heatmap_save\",\n \"hindsight_enrollment\",\n \"hindsight_finding\",\n \"hindsight_regression_case\",\n \"hindsight_replay\",\n \"hindsight_replay_step\",\n \"hindsight_review\",\n \"hr_access_audit\",\n \"hr_access_role\",\n \"hr_accommodation_request\",\n \"hr_ai_evidence\",\n \"hr_alert_routing_rule\",\n \"hr_application\",\n \"hr_approval_authority\",\n \"hr_approval_delegation\",\n \"hr_asset\",\n \"hr_asset_assignment\",\n \"hr_attendance_exception\",\n \"hr_auto_close_rule\",\n \"hr_availability\",\n \"hr_background_check\",\n \"hr_benefits_event\",\n \"hr_calculation_snapshot\",\n \"hr_candidate\",\n \"hr_candidate_conversion\",\n \"hr_candidate_message\",\n \"hr_careers_portal\",\n \"hr_checklist_item\",\n \"hr_checklist_run\",\n \"hr_checklist_template\",\n \"hr_checklist_template_item\",\n \"hr_compensation\",\n \"hr_corrective_action\",\n \"hr_course\",\n \"hr_course_version\",\n \"hr_credential\",\n \"hr_crew\",\n \"hr_deduction_code\",\n \"hr_department\",\n \"hr_derived_grant\",\n \"hr_disposition_event\",\n \"hr_earning_code\",\n \"hr_eeo_response\",\n \"hr_emergency_contact\",\n \"hr_employee\",\n \"hr_employee_private\",\n \"hr_employer_profile\",\n \"hr_employment\",\n \"hr_employment_pin\",\n \"hr_engagement\",\n \"hr_establishment\",\n \"hr_external_identity\",\n \"hr_field_policy\",\n \"hr_holiday\",\n \"hr_holiday_calendar\",\n \"hr_i9\",\n \"hr_i9_document\",\n \"hr_incident\",\n \"hr_incident_party\",\n \"hr_interview\",\n \"hr_interview_kit\",\n \"hr_job_title\",\n \"hr_jurisdiction\",\n \"hr_jurisdiction_rule\",\n \"hr_jurisdiction_rule_class\",\n \"hr_jurisdiction_rule_org_decision\",\n \"hr_jurisdiction_rule_test\",\n \"hr_kiosk_device\",\n \"hr_kiosk_session\",\n \"hr_labor_target\",\n \"hr_leave_case\",\n \"hr_leave_enrollment\",\n \"hr_leave_ledger\",\n \"hr_leave_policy\",\n \"hr_leave_request\",\n \"hr_legal_hold\",\n \"hr_legal_hold_item\",\n \"hr_location\",\n \"hr_new_hire_report\",\n \"hr_offer\",\n \"hr_opening\",\n \"hr_overtime_alert\",\n \"hr_overtime_alert_rule\",\n \"hr_overtime_preapproval\",\n \"hr_pay_group\",\n \"hr_pay_period\",\n \"hr_pay_period_employment\",\n \"hr_payroll_export\",\n \"hr_payroll_export_line\",\n \"hr_position_assignment\",\n \"hr_posting\",\n \"hr_posting_publication\",\n \"hr_provider_binding\",\n \"hr_provider_event\",\n \"hr_provisioning_result\",\n \"hr_punch\",\n \"hr_recalculation_batch\",\n \"hr_record_class\",\n \"hr_records_request\",\n \"hr_reference_check\",\n \"hr_reporting_line\",\n \"hr_requisition\",\n \"hr_restricted_note\",\n \"hr_retention_rule\",\n \"hr_role_assignment\",\n \"hr_schedule\",\n \"hr_schedule_change\",\n \"hr_schedule_guidance\",\n \"hr_schedule_template\",\n \"hr_schedule_template_shift\",\n \"hr_scorecard\",\n \"hr_separation\",\n \"hr_shift\",\n \"hr_shift_claim\",\n \"hr_staffing_requirement\",\n \"hr_survey\",\n \"hr_survey_invitation\",\n \"hr_survey_question\",\n \"hr_survey_response\",\n \"hr_tax_registration\",\n \"hr_tax_withholding\",\n \"hr_time_adjustment\",\n \"hr_training_assignment\",\n \"hr_training_attempt\",\n \"hr_transcript_entry\",\n \"hr_verification_letter_request\",\n \"hr_work_interval\",\n \"hr_workflow_binding\",\n \"hr_workflow_decision\",\n \"hr_workflow_definition\",\n \"hr_workflow_event\",\n \"hr_workflow_failure\",\n \"hr_workflow_flow_type\",\n \"hr_workflow_instance\",\n \"hr_workflow_step\",\n \"hr_workflow_step_definition\",\n \"hr_workweek\",\n \"iam_api_key\",\n \"industry_curator\",\n \"interview_document_revision\",\n \"interview_hole\",\n \"interview_question\",\n \"interview_session\",\n \"interview_turn\",\n \"invitation\",\n \"invitation_code\",\n \"invitation_request\",\n \"item_mastery\",\n \"judge_verdict\",\n \"kg_alert\",\n \"kg_suggestion_ack\",\n \"kg_sweep_queue\",\n \"kg_sweep_run\",\n \"kg_sweep_state\",\n \"kg_value_match\",\n \"league_membership\",\n \"learn_doc\",\n \"library_doc\",\n \"mandate\",\n \"mandate_binding\",\n \"mandate_treatment\",\n \"marketing_initiative\",\n \"masterwork_corpus_item\",\n \"masterwork_run\",\n \"membership\",\n \"message\",\n \"message_template\",\n \"ner_shadow\",\n \"note\",\n \"note_folder\",\n \"notification\",\n \"notification_channel_preference\",\n \"notification_event_override\",\n \"notification_event_type\",\n \"notification_preference\",\n \"ops_issue_event\",\n \"ops_proof_check\",\n \"ops_proof_run\",\n \"ops_proof_scenario\",\n \"organization\",\n \"output_feedback\",\n \"page_extraction_job\",\n \"page_extraction_page_run\",\n \"party\",\n \"party_contact_point\",\n \"pc_article\",\n \"pc_episode\",\n \"pc_show\",\n \"pc_studio_run\",\n \"pc_studio_run_asset\",\n \"pdf_redaction_audit\",\n \"plan_cms_fill_item\",\n \"plan_cms_fill_job\",\n \"plan_entity\",\n \"plan_node\",\n \"plan_node_artifact\",\n \"plan_node_step\",\n \"plan_profile\",\n \"platform_actor_session\",\n \"platform_actor_token\",\n \"platform_actor_token_event\",\n \"platform_continued_access\",\n \"platform_outcome_event\",\n \"platform_outsider_consumer\",\n \"platform_saved_view\",\n \"podcast_race\",\n \"processed_document\",\n \"processed_document_page\",\n \"product_capture_file\",\n \"product_capture_item\",\n \"product_capture_payload\",\n \"product_capture_product\",\n \"product_capture_question\",\n \"project\",\n \"provision\",\n \"purpose\",\n \"quiz_session\",\n \"rag_ingest_run\",\n \"redaction_mapping\",\n \"research_analysis\",\n \"research_content\",\n \"research_context_bundle\",\n \"research_document\",\n \"research_keyword\",\n \"research_media\",\n \"research_source\",\n \"research_synthesis\",\n \"research_tag\",\n \"research_template\",\n \"research_topic\",\n \"route_manifest_entry\",\n \"rulebook\",\n \"sandbox_instance\",\n \"sch_agent_task\",\n \"sch_run\",\n \"sch_task\",\n \"sch_trigger\",\n \"scope\",\n \"scope_association_suggestion\",\n \"scope_item_value_suggestion\",\n \"scope_suggestion\",\n \"scope_type\",\n \"seo_ai_visibility_citation\",\n \"seo_ai_visibility_claim\",\n \"seo_ai_visibility_panel\",\n \"seo_ai_visibility_response\",\n \"seo_ai_visibility_signal\",\n \"seo_backlink\",\n \"seo_backlink_change_event\",\n \"seo_backlink_dimension_snapshot\",\n \"seo_backlink_observation\",\n \"seo_backlink_snapshot\",\n \"seo_change_assessment\",\n \"seo_change_event\",\n \"seo_change_item\",\n \"seo_change_metric\",\n \"seo_change_set\",\n \"seo_change_theory\",\n \"seo_collection_run\",\n \"seo_competitor\",\n \"seo_competitor_observation\",\n \"seo_competitor_opportunity\",\n \"seo_coverage_mention\",\n \"seo_coverage_tracker\",\n \"seo_dimension_value_matcher\",\n \"seo_engine_schedule\",\n \"seo_geo_place\",\n \"seo_gsc_dig_rule\",\n \"seo_keyword\",\n \"seo_keyword_class_rule\",\n \"seo_keyword_edge\",\n \"seo_keyword_facet\",\n \"seo_keyword_market\",\n \"seo_keyword_market_observation\",\n \"seo_keyword_place\",\n \"seo_keyword_saved_view\",\n \"seo_keyword_topic\",\n \"seo_landscape_brief\",\n \"seo_link_gap_domain\",\n \"seo_link_gap_match\",\n \"seo_page_measurement_health\",\n \"seo_page_performance\",\n \"seo_provider_call\",\n \"seo_provider_task\",\n \"seo_rank_observation\",\n \"seo_rank_target\",\n \"seo_raw_payload\",\n \"seo_referring_domain_profile\",\n \"seo_reputation_case\",\n \"seo_search_performance_daily\",\n \"seo_serp_mention\",\n \"seo_serp_opportunity\",\n \"seo_serp_result\",\n \"seo_serp_snapshot\",\n \"seo_site_geo_area\",\n \"seo_site_keyword_offering\",\n \"seo_site_keyword_value\",\n \"seo_site_offering_value\",\n \"seo_site_topic_value\",\n \"seo_site_value_combo\",\n \"seo_site_value_worth\",\n \"seo_site_vocabulary\",\n \"seo_source_request\",\n \"seo_starter_pack\",\n \"seo_starter_pack_item\",\n \"seo_story_angle\",\n \"seo_topic\",\n \"seo_web_analytics_daily\",\n \"shared_canvas_item\",\n \"short_link\",\n \"skill\",\n \"skill_render_definition\",\n \"sms_consent\",\n \"sms_conversation\",\n \"sms_message\",\n \"sms_message_media\",\n \"sms_notification\",\n \"sms_notification_preference\",\n \"sms_phone_number\",\n \"structured_list\",\n \"studio_documents\",\n \"studio_recording_chunks\",\n \"studio_recording_segments\",\n \"studio_run\",\n \"studio_session\",\n \"studio_session_settings\",\n \"study_attempt\",\n \"study_goal\",\n \"study_media\",\n \"study_plan\",\n \"study_plan_block\",\n \"study_plan_day\",\n \"study_reminder_context\",\n \"study_reminder_delivery\",\n \"study_session\",\n \"surface\",\n \"system_context_item\",\n \"system_error\",\n \"system_personal_org_failure\",\n \"system_write_failure\",\n \"task\",\n \"thread\",\n \"tool\",\n \"tool_bundle\",\n \"tool_call\",\n \"tool_definition_version\",\n \"tool_test_sample\",\n \"tool_ui\",\n \"tool_ui_incident\",\n \"tool_ui_version\",\n \"transcript\",\n \"udt_dataset_fields\",\n \"udt_dataset_rows\",\n \"udt_document\",\n \"udt_structured_list_items\",\n \"ui_surface_agent_pref\",\n \"ui_surface_config\",\n \"user_achievement\",\n \"user_analysis_preference\",\n \"user_bookmark\",\n \"user_email_preference\",\n \"user_feedback\",\n \"user_form_profile\",\n \"user_markdown_sample\",\n \"user_memory\",\n \"user_preference\",\n \"user_profile\",\n \"user_stat\",\n \"user_surface_state\",\n \"voice\",\n \"war_room\",\n \"wbx_capture\",\n \"wbx_guidance\",\n \"wbx_highlight\",\n \"wbx_pattern\",\n \"wbx_screenshot\",\n \"wbx_seo_audit\",\n \"wc_claim\",\n \"wc_impairment_definition\",\n \"wc_injury\",\n \"wc_report\",\n \"web_analysis_item\",\n \"web_brand\",\n \"web_brand_asset\",\n \"web_brand_offering\",\n \"web_business_fact\",\n \"web_business_location\",\n \"web_crawl_event\",\n \"web_crawl_preset\",\n \"web_crawl_schedule\",\n \"web_crawl_session\",\n \"web_crawl_url\",\n \"web_discovered_item\",\n \"web_finding\",\n \"web_gsc_page_stat\",\n \"web_link_edge\",\n \"web_listing_publisher\",\n \"web_location_listing\",\n \"web_offering_template\",\n \"web_page\",\n \"web_page_content\",\n \"web_page_evidence\",\n \"web_page_sitemap\",\n \"web_property\",\n \"web_provider\",\n \"web_result\",\n \"web_screenshot\",\n \"web_site\",\n \"web_site_endpoint_rule\",\n \"web_site_item_config\",\n \"web_site_offering\",\n \"web_sitemap\",\n \"web_snapshot\",\n \"wf_node_data_slot\",\n \"work_item\",\n \"workbook\",\n \"workflow\",\n \"workflow_card\",\n \"workflow_checkpoint\",\n \"workflow_comparison\",\n \"workflow_definition_version\",\n \"workflow_idempotency\",\n \"workflow_job\",\n \"workflow_node_events\",\n \"workflow_node_outcome\",\n \"workflow_plan\",\n \"workflow_plan_event\",\n \"workflow_plan_sample\",\n \"workflow_recovery_audit\",\n \"workflow_run\",\n \"workflow_run_log\",\n \"workflow_runtime_surface\",\n \"workflow_template\",\n \"workflow_trigger\",\n \"workflow_trigger_fire\",\n \"working_document\",\n \"youtube_search\",\n \"youtube_video\",\n];\n\n/**\n * Pretty display metadata for DB schemas, mirrored from `platform.schemas`\n * (admin-writable via `admin_upsert_schema`). Tier-1 buckets for reference\n * type choosers and admin surfaces.\n */\nexport const SCHEMA_DISPLAY: Record<\n string,\n { readonly label: string; readonly sortOrder: number; readonly isActive: boolean }\n> = {\n \"public\": { label: \"General\", sortOrder: 10, isActive: true },\n \"agent\": { label: \"Agents\", sortOrder: 20, isActive: true },\n \"app\": { label: \"Apps\", sortOrder: 25, isActive: true },\n \"skill\": { label: \"Skills\", sortOrder: 30, isActive: true },\n \"workflow\": { label: \"Workflows\", sortOrder: 35, isActive: true },\n \"chat\": { label: \"Chat\", sortOrder: 40, isActive: true },\n \"files\": { label: \"Files\", sortOrder: 45, isActive: true },\n \"code\": { label: \"Code\", sortOrder: 50, isActive: true },\n \"workbench\": { label: \"Workbench\", sortOrder: 55, isActive: true },\n \"workspace\": { label: \"Workspace\", sortOrder: 60, isActive: true },\n \"transcripts\": { label: \"Transcripts\", sortOrder: 65, isActive: true },\n \"podcast\": { label: \"Podcasts\", sortOrder: 70, isActive: true },\n \"education\": { label: \"Education\", sortOrder: 75, isActive: true },\n \"research\": { label: \"Research\", sortOrder: 80, isActive: true },\n \"rag\": { label: \"Knowledge\", sortOrder: 85, isActive: true },\n \"crm\": { label: \"CRM\", sortOrder: 87, isActive: true },\n \"plan\": { label: \"Content Planning\", sortOrder: 88, isActive: true },\n \"web\": { label: \"Marketing & Web\", sortOrder: 90, isActive: true },\n \"scraper\": { label: \"Web Scraper\", sortOrder: 95, isActive: true },\n \"docproc\": { label: \"Document Processing\", sortOrder: 100, isActive: true },\n \"pdf\": { label: \"PDF\", sortOrder: 105, isActive: true },\n \"canvas\": { label: \"Canvas\", sortOrder: 110, isActive: true },\n \"content_ir\": { label: \"Structured Content\", sortOrder: 115, isActive: true },\n \"context\": { label: \"Context\", sortOrder: 120, isActive: true },\n \"communication\": { label: \"Communication\", sortOrder: 125, isActive: true },\n \"legal\": { label: \"Legal\", sortOrder: 130, isActive: true },\n \"scheduler\": { label: \"Scheduling\", sortOrder: 135, isActive: true },\n \"ai\": { label: \"AI Models\", sortOrder: 140, isActive: true },\n \"tool\": { label: \"Tools\", sortOrder: 145, isActive: true },\n \"extend\": { label: \"Browser Extension\", sortOrder: 150, isActive: true },\n \"users\": { label: \"Users\", sortOrder: 155, isActive: true },\n \"user\": { label: \"User Data\", sortOrder: 160, isActive: true },\n \"iam\": { label: \"Access & Identity\", sortOrder: 165, isActive: true },\n \"platform\": { label: \"Platform\", sortOrder: 170, isActive: true },\n \"reg\": { label: \"Registry\", sortOrder: 175, isActive: true },\n \"runtime\": { label: \"Runtime\", sortOrder: 180, isActive: true },\n \"ui\": { label: \"UI\", sortOrder: 185, isActive: true },\n \"admin\": { label: \"Admin\", sortOrder: 190, isActive: true },\n \"graveyard\": { label: \"Graveyard\", sortOrder: 900, isActive: false },\n};\n\n/**\n * Admin-defined reference chooser buckets, mirrored from\n * `platform.reference_categories` (`admin_upsert_reference_category`).\n * An entity type's `referenceCategory` points here; unassigned types\n * bucket by schema via `SCHEMA_DISPLAY`.\n */\nexport const REFERENCE_CATEGORY_DISPLAY: Record<\n string,\n { readonly label: string; readonly sortOrder: number; readonly isActive: boolean }\n> = {\n\n};\n\nconst ENTITY_TYPE_TOKEN_SET: ReadonlySet<string> = new Set(ENTITY_TYPE_TOKENS);\n\n/** Runtime guard: is `value` a registered entity token? Narrows to the union. */\nexport function isEntityTypeToken(value: unknown): value is EntityTypeToken {\n return typeof value === \"string\" && ENTITY_TYPE_TOKEN_SET.has(value);\n}\n","// core/titles.ts — @ai-matrx/associations/core\n//\n// Batched entity-title resolution — the \"UUIDs never render\" primitive.\n// Ported behavior-verbatim from matrx-frontend\n// `features/scopes/service/entityTitles.ts` (associations extraction W2,\n// 2026-08-29). One structural inversion: the MODULE-level session Map (banned\n// by the packaging standard — dual-loaded graphs silently split module\n// state) becomes STORE-INSTANCE state — the cache lives on the titles\n// service the store constructs once, so there is nothing to split and no\n// globalThis slot is needed.\n//\n// Association edges SHOULD carry a `label` stamped at attach time; this\n// service covers the rest (legacy unlabeled edges, rows renamed since\n// attach). Given a token + ids, it resolves titles through the\n// registry-driven candidate RPC and memoizes per store lifetime. Tokens\n// without a title column (or unregistered tokens) resolve to nothing —\n// callers fall back to `Untitled <label>` via `fallback`.\n\nimport type { CoreDeps } from \"./deps\";\nimport type { CandidatesServiceApi } from \"./candidates\";\n\nconst CHUNK = 200;\n\nexport function entityTitleCacheKey(token: string, id: string): string {\n return `${token}:${id}`;\n}\n\nexport interface TitlesServiceApi {\n /** Read the cache synchronously (for render paths after a fetch settled). */\n get(token: string, id: string): string | null;\n /**\n * Push a known-fresh title into the cache (after a rename or a create), so\n * surfaces that resolve through this service never show a stale name.\n */\n prime(token: string, id: string, title: string): void;\n /** Display fallback when no label and no fetched title exist. */\n fallback(token: string): string;\n /**\n * Resolve titles for `ids` of one token. Returns ONLY the resolved entries\n * (cache + fresh reads); missing rows (deleted, no access) stay absent.\n */\n fetch(token: string, ids: string[]): Promise<Map<string, string>>;\n}\n\nexport function createTitlesService(\n deps: CoreDeps,\n candidates: CandidatesServiceApi,\n): TitlesServiceApi {\n const { registry, errorSink } = deps;\n\n /** `${token}:${id}` → resolved title. Store-lifetime; titles change rarely. */\n const titleCache = new Map<string, string>();\n\n return {\n get(token, id) {\n return titleCache.get(entityTitleCacheKey(token, id)) ?? null;\n },\n\n prime(token, id, title) {\n const trimmed = title.trim();\n if (trimmed) titleCache.set(entityTitleCacheKey(token, id), trimmed);\n },\n\n fallback(token) {\n const info = registry.tryGetEntityInfo(token);\n return `Untitled ${info?.label ?? token}`;\n },\n\n async fetch(token, ids) {\n const out = new Map<string, string>();\n if (ids.length === 0) return out;\n\n const info = registry.tryGetEntityInfo(token);\n const missing: string[] = [];\n for (const id of ids) {\n const cached = titleCache.get(entityTitleCacheKey(token, id));\n if (cached !== undefined) out.set(id, cached);\n else missing.push(id);\n }\n if (missing.length === 0 || !info?.titleColumn) return out;\n\n for (let index = 0; index < missing.length; index += CHUNK) {\n const chunk = missing.slice(index, index + CHUNK);\n const { data, error } = await candidates.callReferenceSearchCandidates({\n p_token: token,\n p_ids: chunk,\n p_limit: chunk.length,\n });\n if (error) {\n errorSink({\n code: \"title_rpc_failed\",\n message: `[fetchEntityTitles] candidate RPC failed for \"${token}\": ${error.message}`,\n context: {\n token,\n chunkStart: index,\n chunkSize: chunk.length,\n detail: error,\n },\n });\n continue;\n }\n for (const row of data) {\n const title = row.title?.trim();\n if (!title) continue;\n titleCache.set(entityTitleCacheKey(token, row.id), title);\n out.set(row.id, title);\n }\n }\n return out;\n },\n };\n}\n","// core/store.ts — @ai-matrx/associations/core\n//\n// THE package-owned, store-agnostic cache (design Decision 3) — the one\n// runtime object a host constructs (`createAssociationsStore(cfg)`),\n// replacing matrx-frontend's ~530 lines of Redux fragments\n// (`scopesTree.associationsByKey` + `categoriesByDimension` + the\n// association/category thunks + selectors) with a subscribable store the\n// /react hooks (W3) ride via `useSyncExternalStore`. Behavior ported\n// verbatim from `features/scopes/redux/thunks/{associations,categories}.ts`\n// + the matching `scopesSlice` reducers + selectors (2026-08-29):\n//\n// • lazy `load` with per-key IN-FLIGHT DEDUP (the thunks' Map) and\n// `status === \"ready\"` short-circuit unless `force`;\n// • pending keeps previous edges AND the visible error (consumers use\n// status to disable/spin the same retry control);\n// • add/remove reload BOTH endpoints on success (a write touches TWO\n// endpoints — the source and the target each see the edge);\n// • setTargets reloads the SOURCE only (the only endpoint with a\n// deterministic post-state);\n// • createCategory does the optimistic ECHO-INSERT then force-reloads to\n// pick up server-derived fields authoritatively;\n// • `getEdges`/`getCategories` return a STABLE idle default (never a fresh\n// object per read — the useSyncExternalStore contract).\n//\n// THE NEVER-TOUCHES-CONTEXT INVARIANT, now structural: the thunks' law\n// \"NEVER dispatch appContextSlice actions\" (a durable association is NOT the\n// user's active working context) is carried over as architecture — this\n// package has no import path to any host store, and a write notifies ONLY\n// the association subscribers of the endpoints it touched (proven by test).\n//\n// Invalidation is owned here (subscribe/notify + `invalidate`). It does NOT\n// depend on `@ai-matrx/kit` — but the shape is deliberately bridgeable: a\n// host binding may register `store.invalidate` under kit `/invalidation`\n// names so ubiquitous modules can invalidate association caches with zero\n// import edge into this package's chunk.\n//\n// NO module-level mutable state anywhere in /core: every cache lives on the\n// store instance the host constructs, so the dual-bundle split-registry\n// failure the packaging standard's globalThis-slot rule exists for cannot\n// occur (there is no module state to split).\n\nimport type {\n AssociationsEntry,\n AssociationTargetType,\n CategoriesEntry,\n CategoryDimension,\n PlatformCategory,\n} from \"../edges\";\nimport type { CommentsEntry } from \"../comments\";\nimport { isAssociationsRpcErr } from \"../results\";\nimport type {\n AssociationsConfig,\n AssociationsDataSource,\n ErrorSink,\n} from \"../ports\";\nimport { createDefaultErrorSink } from \"./defaultErrorSink\";\nimport type { CoreDeps } from \"./deps\";\nimport { createAssociationGuards } from \"./guards\";\nimport { createRpcResultHelpers } from \"./rpcResult\";\nimport { createEntityRegistry, type EntityRegistry } from \"./registry\";\nimport {\n createAssociationsService,\n type AssociationsServiceApi,\n} from \"./associationsService\";\nimport {\n createCategoriesService,\n type CategoriesServiceApi,\n} from \"./categoriesService\";\nimport {\n createFavoritesService,\n type FavoritesServiceApi,\n} from \"./favoritesService\";\nimport { createCandidatesService, type CandidatesServiceApi } from \"./candidates\";\nimport { createTitlesService, type TitlesServiceApi } from \"./titles\";\nimport {\n createEntityRowsService,\n type EntityRowsServiceApi,\n} from \"./entityRows\";\nimport {\n createAssociationHelpers,\n type AssociationHelpersApi,\n} from \"./helpers\";\nimport {\n createCommentsService,\n type CommentsServiceApi,\n} from \"./commentsService\";\n\n/** Cache key for one association endpoint. */\nexport function associationsKey(type: string, id: string): string {\n return `${type}:${id}`;\n}\n\nexport interface AssociationWriteResult {\n ok: boolean;\n /** Set on a successful single-edge `add`. */\n id?: string;\n error?: string;\n}\n\nexport interface CategoryMutationResult {\n ok: boolean;\n /** Set on a successful mutation. */\n id?: string;\n error?: string;\n}\n\nconst IDLE_ASSOCIATIONS: AssociationsEntry = Object.freeze({\n status: \"idle\",\n edges: Object.freeze([]) as unknown as AssociationsEntry[\"edges\"],\n fetchedAt: null,\n error: null,\n});\n\nconst IDLE_CATEGORIES: CategoriesEntry = Object.freeze({\n status: \"idle\",\n categories: Object.freeze([]) as unknown as CategoriesEntry[\"categories\"],\n fetchedAt: null,\n error: null,\n});\n\nconst IDLE_COMMENTS: CommentsEntry = Object.freeze({\n status: \"idle\",\n comments: Object.freeze([]) as unknown as CommentsEntry[\"comments\"],\n fetchedAt: null,\n error: null,\n});\n\nexport interface CommentMutationResult {\n ok: boolean;\n /** Set on a successful `addComment`. */\n id?: string;\n error?: string;\n}\n\nexport interface AssociationsStore {\n // ── the cache (association endpoints) ────────────────────────────────\n /** Stable, sync read of one endpoint's entry (idle default when uncached). */\n getEdges(type: string, id: string): AssociationsEntry;\n /**\n * Lazy load of every edge touching `${type}:${id}` (both directions).\n * Deduped per key; `status === \"ready\"` short-circuits unless `force`.\n */\n load(type: string, id: string, opts?: { force?: boolean }): Promise<void>;\n /** External-store contract: notified whenever the key's entry changes. */\n subscribe(key: string, cb: () => void): () => void;\n /** Attach source → target; on success reloads BOTH endpoints. */\n add(args: {\n sourceType: string;\n sourceId: string;\n targetType: AssociationTargetType;\n targetId: string;\n orgId?: string;\n label?: string;\n role?: string;\n metadata?: unknown;\n replaceMetadata?: boolean;\n }): Promise<AssociationWriteResult>;\n /** Detach source → target; on success reloads BOTH endpoints. */\n remove(args: {\n sourceType: string;\n sourceId: string;\n targetType: string;\n targetId: string;\n role?: string;\n }): Promise<AssociationWriteResult>;\n /** Replace the source's `targetType` edge set; reloads the SOURCE. */\n setTargets(args: {\n sourceType: string;\n sourceId: string;\n targetType: AssociationTargetType;\n targetIds: string[];\n orgId?: string;\n role?: string;\n }): Promise<AssociationWriteResult>;\n /** Reset one endpoint to idle and notify its subscribers. */\n invalidate(type: string, id: string): void;\n /** Reset every association endpoint, category facet, and comment thread. */\n invalidateAll(): void;\n\n // ── the cache (category facets) ──────────────────────────────────────\n getCategories(dimension: CategoryDimension): CategoriesEntry;\n loadCategories(\n dimension: CategoryDimension,\n opts?: { force?: boolean },\n ): Promise<void>;\n subscribeCategories(dimension: CategoryDimension, cb: () => void): () => void;\n /** Create + echo-insert + authoritative force reload. Returns the new id. */\n createCategory(args: {\n dimension: CategoryDimension;\n name: string;\n orgId: string;\n parentId?: string | null;\n color?: string | null;\n icon?: string | null;\n slug?: string | null;\n }): Promise<CategoryMutationResult>;\n updateCategory(args: {\n dimension: CategoryDimension;\n id: string;\n name: string;\n slug: string | null;\n color: string | null;\n icon: string | null;\n position: number | null;\n }): Promise<CategoryMutationResult>;\n reparentCategory(args: {\n dimension: CategoryDimension;\n id: string;\n parentId: string | null;\n }): Promise<CategoryMutationResult>;\n deleteCategory(args: {\n dimension: CategoryDimension;\n id: string;\n }): Promise<CategoryMutationResult>;\n\n // ── the cache (comment threads, W6) ──────────────────────────────────\n /** Stable, sync read of one entity's comment thread (idle when uncached). */\n getComments(type: string, id: string): CommentsEntry;\n /**\n * Lazy load of every comment on `${type}:${id}` (oldest→newest; thread by\n * `parentId`). Deduped per key; `status === \"ready\"` short-circuits unless\n * `force`.\n */\n loadComments(\n type: string,\n id: string,\n opts?: { force?: boolean },\n ): Promise<void>;\n /** External-store contract for one entity's comment thread. */\n subscribeComments(key: string, cb: () => void): () => void;\n /** Post a comment (or a reply); on success force-reloads the thread. */\n addComment(args: {\n entityType: string;\n entityId: string;\n body: string;\n parentId?: string | null;\n orgId?: string | null;\n }): Promise<CommentMutationResult>;\n /** Edit a comment body (author-only in the RPC); reloads the thread. */\n editComment(args: {\n entityType: string;\n entityId: string;\n id: string;\n body: string;\n }): Promise<CommentMutationResult>;\n /** Soft-delete a comment (author/org member in the RPC); reloads the thread. */\n deleteComment(args: {\n entityType: string;\n entityId: string;\n id: string;\n }): Promise<CommentMutationResult>;\n /** Reset one entity's comment thread to idle and notify its subscribers. */\n invalidateComments(type: string, id: string): void;\n\n // ── the seams under the cache ────────────────────────────────────────\n /** Batched title resolution + the session cache + prime. */\n titles: TitlesServiceApi;\n /** Per-user favorite/pinned/hidden state (`ues_*`). */\n favorites: FavoritesServiceApi;\n /** Candidate reads for the pickers. */\n candidates: CandidatesServiceApi;\n /** Generic registry-convention row create/rename. */\n entityRows: EntityRowsServiceApi;\n /** Composite link helpers over the chokepoint. */\n helpers: AssociationHelpersApi;\n /** The registry merge engine (generated metadata + host overlay). */\n registry: EntityRegistry;\n /**\n * The raw chokepoint services — every RPC family, results-enveloped.\n * `associations` writes here do NOT touch the cache; use the store-level\n * `add`/`remove`/`setTargets` when a cached surface must stay fresh.\n */\n services: {\n associations: AssociationsServiceApi;\n categories: CategoriesServiceApi;\n comments: CommentsServiceApi;\n };\n /** Merge more host overlay entries in (icons/routes/candidate loaders). */\n registerEntityOverlay: EntityRegistry[\"registerEntityOverlay\"];\n /**\n * The bound scream seam (W3, additive): /react surfaces route their loud\n * recoveries here (the originals' console.error sites) without a second\n * sink binding. Same function the host passed at construction.\n */\n errorSink: ErrorSink;\n /**\n * The bound data seam (0.6.0, additive): the provider's demanded-schema\n * boot probe reads it so hosts stop re-exporting their dataSource just to\n * run a check the package owns.\n */\n dataSource: AssociationsDataSource;\n /**\n * The bound identity port (W3, additive): /react hooks that FILTER by the\n * current user (candidate owner scoping) read it leniently; write paths\n * keep going through the services, where `requireUserId` failures stay\n * loud. Same object the host passed at construction.\n */\n identity: AssociationsConfig[\"identity\"];\n}\n\n/**\n * Build the one store a host binds. The REQUIRED ports (dataSource /\n * identity — true app identity, C23) throw at construction when absent.\n * Every other port has a SHIPPED DEFAULT (errorSink since 0.6.0) or a\n * documented degradation; nothing is ever silently missing.\n */\nexport function createAssociationsStore(\n config: AssociationsConfig,\n): AssociationsStore {\n if (!config || typeof config.dataSource?.rpc !== \"function\") {\n throw new Error(\n \"@ai-matrx/associations: the REQUIRED dataSource port is missing \" +\n \"(need an object with rpc(fn, args) — a supabase-js client \" +\n \"satisfies it structurally). The package IS data operations; there \" +\n \"is no degraded mode without one.\",\n );\n }\n if (typeof config.identity?.requireUserId !== \"function\") {\n throw new Error(\n \"@ai-matrx/associations: the REQUIRED identity port is missing \" +\n \"(need requireUserId(): string that THROWS when unauthenticated). \" +\n \"Identity never comes from a store import.\",\n );\n }\n // `errorSink` stopped being required in 0.6.0 (C23): the package ships the\n // obvious sink instead of refusing to construct. The default is LOUD about\n // being the default — see createDefaultErrorSink.\n const errorSink: ErrorSink =\n typeof config.errorSink === \"function\"\n ? config.errorSink\n : createDefaultErrorSink();\n const registry = createEntityRegistry(errorSink, config.entityOverlay);\n const deps: CoreDeps = {\n dataSource: config.dataSource,\n identity: config.identity,\n errorSink,\n guards: createAssociationGuards(errorSink),\n rpc: createRpcResultHelpers(errorSink),\n registry,\n };\n\n const associations = createAssociationsService(deps);\n const categories = createCategoriesService(deps);\n const favorites = createFavoritesService(deps);\n const candidates = createCandidatesService(deps);\n const titles = createTitlesService(deps, candidates);\n const entityRows = createEntityRowsService(deps, titles);\n const helpers = createAssociationHelpers(associations);\n const comments = createCommentsService(deps);\n\n // ── instance state (never module state) ────────────────────────────────\n const assocByKey = new Map<string, AssociationsEntry>();\n const assocSubs = new Map<string, Set<() => void>>();\n const assocInFlight = new Map<string, Promise<void>>();\n const catByDim = new Map<string, CategoriesEntry>();\n const catSubs = new Map<string, Set<() => void>>();\n const catInFlight = new Map<string, Promise<void>>();\n const cmtByKey = new Map<string, CommentsEntry>();\n const cmtSubs = new Map<string, Set<() => void>>();\n const cmtInFlight = new Map<string, Promise<void>>();\n\n function notifyAssoc(key: string): void {\n const subs = assocSubs.get(key);\n if (subs) for (const cb of [...subs]) cb();\n }\n function notifyCat(dimension: string): void {\n const subs = catSubs.get(dimension);\n if (subs) for (const cb of [...subs]) cb();\n }\n function setAssoc(key: string, entry: AssociationsEntry): void {\n assocByKey.set(key, entry);\n notifyAssoc(key);\n }\n function setCat(dimension: string, entry: CategoriesEntry): void {\n catByDim.set(dimension, entry);\n notifyCat(dimension);\n }\n function notifyCmt(key: string): void {\n const subs = cmtSubs.get(key);\n if (subs) for (const cb of [...subs]) cb();\n }\n function setCmt(key: string, entry: CommentsEntry): void {\n cmtByKey.set(key, entry);\n notifyCmt(key);\n }\n\n // ── association cache ops (verbatim thunk/reducer behavior) ────────────\n async function load(\n type: string,\n id: string,\n opts: { force?: boolean } = {},\n ): Promise<void> {\n const force = opts.force ?? false;\n if (!type || !id) return;\n const key = associationsKey(type, id);\n const entry = assocByKey.get(key);\n\n if (!force && entry?.status === \"ready\") return;\n const pending = assocInFlight.get(key);\n if (!force && entry?.status === \"loading\" && pending) return pending;\n\n const prev = assocByKey.get(key);\n setAssoc(key, {\n status: \"loading\",\n edges: prev?.edges ?? [],\n fetchedAt: prev?.fetchedAt ?? null,\n // Retain the visible failure while a retry is pending — consumers use\n // status to disable/spin the same retry control.\n error: prev?.error ?? null,\n });\n\n const promise = (async () => {\n try {\n const res = await associations.listForEntity(type, id);\n if (isAssociationsRpcErr(res)) {\n const before = assocByKey.get(key);\n setAssoc(key, {\n status: \"error\",\n edges: before?.edges ?? [],\n fetchedAt: before?.fetchedAt ?? null,\n error: res.error.message,\n });\n } else {\n setAssoc(key, {\n status: \"ready\",\n edges: res.data.edges,\n fetchedAt: Date.now(),\n error: null,\n });\n }\n } finally {\n assocInFlight.delete(key);\n }\n })();\n\n assocInFlight.set(key, promise);\n return promise;\n }\n\n /** Reload both endpoints of an edge so each side's cache is fresh. */\n async function reloadBoth(\n sourceType: string,\n sourceId: string,\n targetType: string,\n targetId: string,\n ): Promise<void> {\n await Promise.all([\n load(sourceType, sourceId, { force: true }),\n load(targetType, targetId, { force: true }),\n ]);\n }\n\n // ── category cache ops (verbatim thunk/reducer behavior) ───────────────\n async function loadCategories(\n dimension: CategoryDimension,\n opts: { force?: boolean } = {},\n ): Promise<void> {\n const force = opts.force ?? false;\n if (!dimension) return;\n const entry = catByDim.get(dimension);\n\n if (!force && entry?.status === \"ready\") return;\n const pending = catInFlight.get(dimension);\n if (!force && entry?.status === \"loading\" && pending) return pending;\n\n const prev = catByDim.get(dimension);\n setCat(dimension, {\n status: \"loading\",\n categories: prev?.categories ?? [],\n fetchedAt: prev?.fetchedAt ?? null,\n error: null,\n });\n\n const promise = (async () => {\n try {\n const res = await categories.list(dimension);\n if (isAssociationsRpcErr(res)) {\n const before = catByDim.get(dimension);\n setCat(dimension, {\n status: \"error\",\n categories: before?.categories ?? [],\n fetchedAt: before?.fetchedAt ?? null,\n error: res.error.message,\n });\n } else {\n setCat(dimension, {\n status: \"ready\",\n categories: res.data.categories,\n fetchedAt: Date.now(),\n error: null,\n });\n }\n } finally {\n catInFlight.delete(dimension);\n }\n })();\n\n catInFlight.set(dimension, promise);\n return promise;\n }\n\n // ── comment-thread cache ops (W6; same lifecycle as associations) ──────\n async function loadComments(\n type: string,\n id: string,\n opts: { force?: boolean } = {},\n ): Promise<void> {\n const force = opts.force ?? false;\n if (!type || !id) return;\n const key = associationsKey(type, id);\n const entry = cmtByKey.get(key);\n\n if (!force && entry?.status === \"ready\") return;\n const pending = cmtInFlight.get(key);\n if (!force && entry?.status === \"loading\" && pending) return pending;\n\n const prev = cmtByKey.get(key);\n setCmt(key, {\n status: \"loading\",\n comments: prev?.comments ?? [],\n fetchedAt: prev?.fetchedAt ?? null,\n // Retain the visible failure while a retry is pending (same contract\n // as the association cache).\n error: prev?.error ?? null,\n });\n\n const promise = (async () => {\n try {\n const res = await comments.listForEntity(type, id);\n if (isAssociationsRpcErr(res)) {\n const before = cmtByKey.get(key);\n setCmt(key, {\n status: \"error\",\n comments: before?.comments ?? [],\n fetchedAt: before?.fetchedAt ?? null,\n error: res.error.message,\n });\n } else {\n setCmt(key, {\n status: \"ready\",\n comments: res.data.comments,\n fetchedAt: Date.now(),\n error: null,\n });\n }\n } finally {\n cmtInFlight.delete(key);\n }\n })();\n\n cmtInFlight.set(key, promise);\n return promise;\n }\n\n return {\n // ── associations ─────────────────────────────────────────────────────\n getEdges(type, id) {\n if (!type || !id) return IDLE_ASSOCIATIONS;\n return assocByKey.get(associationsKey(type, id)) ?? IDLE_ASSOCIATIONS;\n },\n\n load,\n\n subscribe(key, cb) {\n let subs = assocSubs.get(key);\n if (!subs) {\n subs = new Set();\n assocSubs.set(key, subs);\n }\n subs.add(cb);\n return () => {\n subs.delete(cb);\n if (subs.size === 0) assocSubs.delete(key);\n };\n },\n\n async add(args) {\n const res = await associations.add(args);\n if (isAssociationsRpcErr(res)) {\n return { ok: false, error: res.error.message };\n }\n await reloadBoth(\n args.sourceType,\n args.sourceId,\n args.targetType,\n args.targetId,\n );\n return { ok: true, id: res.data.id };\n },\n\n async remove(args) {\n const res = await associations.remove(args);\n if (isAssociationsRpcErr(res)) {\n return { ok: false, error: res.error.message };\n }\n await reloadBoth(\n args.sourceType,\n args.sourceId,\n args.targetType,\n args.targetId,\n );\n return { ok: true };\n },\n\n /**\n * Reloads the SOURCE endpoint only — the one endpoint with a\n * deterministic post-state; each affected target reload would need the\n * full before/after diff, so callers displaying a specific target\n * refresh it via `load(..., { force: true })`.\n */\n async setTargets(args) {\n const res = await associations.setTargets(args);\n if (isAssociationsRpcErr(res)) {\n return { ok: false, error: res.error.message };\n }\n await load(args.sourceType, args.sourceId, { force: true });\n return { ok: true };\n },\n\n invalidate(type, id) {\n const key = associationsKey(type, id);\n if (assocByKey.delete(key)) notifyAssoc(key);\n },\n\n invalidateAll() {\n const assocKeys = [...assocByKey.keys()];\n assocByKey.clear();\n for (const key of assocKeys) notifyAssoc(key);\n const dims = [...catByDim.keys()];\n catByDim.clear();\n for (const dim of dims) notifyCat(dim);\n const cmtKeys = [...cmtByKey.keys()];\n cmtByKey.clear();\n for (const key of cmtKeys) notifyCmt(key);\n },\n\n // ── categories ───────────────────────────────────────────────────────\n getCategories(dimension) {\n if (!dimension) return IDLE_CATEGORIES;\n return catByDim.get(dimension) ?? IDLE_CATEGORIES;\n },\n\n loadCategories,\n\n subscribeCategories(dimension, cb) {\n let subs = catSubs.get(dimension);\n if (!subs) {\n subs = new Set();\n catSubs.set(dimension, subs);\n }\n subs.add(cb);\n return () => {\n subs.delete(cb);\n if (subs.size === 0) catSubs.delete(dimension);\n };\n },\n\n async createCategory(args) {\n const res = await categories.create(args);\n if (isAssociationsRpcErr(res)) {\n return { ok: false, error: res.error.message };\n }\n // Optimistic echo so the new id shows immediately, then force-reload\n // to pick up server-derived fields (slug, position) authoritatively.\n const optimistic: PlatformCategory = {\n id: res.data.id,\n orgId: args.orgId,\n dimension: args.dimension,\n name: args.name,\n slug: args.slug ?? null,\n parentId: args.parentId ?? null,\n isSystem: false,\n color: args.color ?? null,\n icon: args.icon ?? null,\n metadata: null,\n position: null,\n };\n const prev = catByDim.get(args.dimension);\n const existing = prev?.categories ?? [];\n if (!existing.some((c) => c.id === optimistic.id)) {\n setCat(args.dimension, {\n status: \"ready\",\n categories: [...existing, optimistic],\n fetchedAt: prev?.fetchedAt ?? Date.now(),\n error: null,\n });\n }\n await loadCategories(args.dimension, { force: true });\n return { ok: true, id: res.data.id };\n },\n\n async updateCategory(args) {\n const res = await categories.update(args);\n if (isAssociationsRpcErr(res)) {\n return { ok: false, error: res.error.message };\n }\n await loadCategories(args.dimension, { force: true });\n return { ok: true, id: res.data.id };\n },\n\n async reparentCategory(args) {\n const res = await categories.reparent(args);\n if (isAssociationsRpcErr(res)) {\n return { ok: false, error: res.error.message };\n }\n await loadCategories(args.dimension, { force: true });\n return { ok: true, id: res.data.id };\n },\n\n async deleteCategory(args) {\n const res = await categories.delete(args.id);\n if (isAssociationsRpcErr(res)) {\n return { ok: false, error: res.error.message };\n }\n await loadCategories(args.dimension, { force: true });\n return { ok: true, id: res.data.id };\n },\n\n // ── comments (W6) ────────────────────────────────────────────────────\n getComments(type, id) {\n if (!type || !id) return IDLE_COMMENTS;\n return cmtByKey.get(associationsKey(type, id)) ?? IDLE_COMMENTS;\n },\n\n loadComments,\n\n subscribeComments(key, cb) {\n let subs = cmtSubs.get(key);\n if (!subs) {\n subs = new Set();\n cmtSubs.set(key, subs);\n }\n subs.add(cb);\n return () => {\n subs.delete(cb);\n if (subs.size === 0) cmtSubs.delete(key);\n };\n },\n\n async addComment(args) {\n const res = await comments.add(args);\n if (isAssociationsRpcErr(res)) {\n return { ok: false, error: res.error.message };\n }\n await loadComments(args.entityType, args.entityId, { force: true });\n return { ok: true, id: res.data.id };\n },\n\n async editComment(args) {\n const res = await comments.edit(args.id, args.body);\n if (isAssociationsRpcErr(res)) {\n return { ok: false, error: res.error.message };\n }\n await loadComments(args.entityType, args.entityId, { force: true });\n return { ok: true, id: args.id };\n },\n\n async deleteComment(args) {\n const res = await comments.remove(args.id);\n if (isAssociationsRpcErr(res)) {\n return { ok: false, error: res.error.message };\n }\n await loadComments(args.entityType, args.entityId, { force: true });\n return { ok: true, id: args.id };\n },\n\n invalidateComments(type, id) {\n const key = associationsKey(type, id);\n if (cmtByKey.delete(key)) notifyCmt(key);\n },\n\n // ── seams ────────────────────────────────────────────────────────────\n titles,\n favorites,\n candidates,\n entityRows,\n helpers,\n registry,\n services: { associations, categories, comments },\n registerEntityOverlay: registry.registerEntityOverlay,\n errorSink,\n dataSource: config.dataSource,\n identity: config.identity,\n };\n}\n","// react/hooks/useContainerLinks.ts — @ai-matrx/associations/react\n//\n// The READ + WRITE hook for a CONTAINER's associations, from the container's\n// point of view (\"what is attached to this org / scope / project?\").\n//\n// Direction (canonical, consistent with scope-tagging): the resource is the\n// edge SOURCE and the container is the edge TARGET — `task → organization`,\n// `file → scope`. So a container's attached resources are its INCOMING edges.\n//\n// It normally reads through `useAssociations({ type: containerType,\n// id: containerId })` (shared store cache). Conversation file attachments use\n// the viewer-aware `conversation_files` RPC instead: the generic association\n// reader is org-filtered and would omit files for an explicitly shared\n// cross-org conversation. Writes still use the one association chokepoint.\n//\n// Ported signature-byte-compatible from matrx-frontend\n// `features/scopes/hooks/useContainerLinks.ts` (W3, 2026-08-29): thunk\n// dispatches → store writes; `associationsService` singleton → the store's\n// chokepoint service; the host `Json` type → `unknown` at the package\n// boundary (packaging standard's JSON rule).\n\nimport {\n useCallback,\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n} from \"react\";\n\nimport type { AssociationEdge, AssociationTargetType } from \"../../edges\";\nimport type { EntityTypeToken } from \"../../entity-types.generated\";\nimport { isAssociationsRpcErr } from \"../../results\";\nimport type { AssociationWriteResult } from \"../../core/store\";\nimport { useAssociationsStore } from \"../context\";\nimport { useAssociations } from \"./useAssociations\";\n\nexport interface ContainerLink {\n /** The edge id (for keys / removal). */\n edgeId: string;\n /** The attached resource's id (the edge source). */\n resourceId: string;\n /** The attached resource's entity token (the edge source type). */\n token: string;\n /** The edge role, or null for a plain (role-less) association. */\n role: string | null;\n label: string | null;\n /** Per-edge props from `platform.associations.metadata` (e.g. representation). */\n metadata: unknown;\n}\n\nexport interface UseContainerLinksArgs {\n /** The primary entity — always an association TARGET (container). */\n containerType: AssociationTargetType;\n containerId: string | null;\n /** Org to stamp on new edges (for org-scoped RLS / counts). */\n orgId?: string | null;\n}\n\nexport interface UseContainerLinksReturn {\n status: ReturnType<typeof useAssociations>[\"status\"];\n error: string | null;\n reload: () => Promise<void>;\n /** Total attached resources across every token (all incoming edges). */\n totalCount: number;\n /** Live count of attached resources of `token`. */\n countFor: (token: EntityTypeToken) => number;\n /** Ids of resources of `token` already attached (for picker \"attached\" state). */\n attachedIdsFor: (token: EntityTypeToken) => Set<string>;\n /** Full link rows of `token` (for listing/removal). */\n linksFor: (token: EntityTypeToken) => ContainerLink[];\n /** Attach a resource (source) to this container (target). */\n attach: (\n token: EntityTypeToken,\n resourceId: string,\n label?: string,\n metadata?: unknown,\n options?: {\n replaceMetadata?: boolean;\n /**\n * Semantic edge role (`platform.associations.role`) — e.g. the\n * Masterwork dump surface stamps `distillation_source`. Omitted = the\n * canonical role-less edge. Detach with the SAME role to remove it.\n */\n role?: string;\n },\n ) => Promise<AssociationWriteResult>;\n /** Detach a resource from this container. */\n detach: (\n token: EntityTypeToken,\n resourceId: string,\n role?: string,\n ) => Promise<AssociationWriteResult>;\n /**\n * Toggle the edge's agent-context pin while preserving every other metadata\n * field and the exact semantic role.\n */\n setPinned: (\n token: EntityTypeToken,\n resourceId: string,\n pinned: boolean,\n role?: string,\n ) => Promise<AssociationWriteResult>;\n}\n\nfunction metadataRecord(metadata: unknown): Record<string, unknown> | null {\n if (\n metadata === null ||\n typeof metadata !== \"object\" ||\n Array.isArray(metadata)\n ) {\n return metadata == null ? {} : null;\n }\n return Object.fromEntries(Object.entries(metadata));\n}\n\nexport function useContainerLinks(\n args: UseContainerLinksArgs,\n): UseContainerLinksReturn {\n const { containerType, containerId, orgId } = args;\n const store = useAssociationsStore();\n\n const {\n edges,\n status: genericStatus,\n error: genericError,\n reload: reloadGeneric,\n } = useAssociations({\n type: containerType,\n id: containerId,\n });\n\n const conversationKey =\n containerType === \"conversation\" && containerId\n ? `conversation:${containerId}`\n : null;\n const activeConversationKey = useRef<string | null>(conversationKey);\n const conversationGeneration = useRef(0);\n const [conversationResult, setConversationResult] = useState<{\n key: string;\n files: ContainerLink[];\n error: string | null;\n loading: boolean;\n } | null>(null);\n\n useLayoutEffect(() => {\n activeConversationKey.current = conversationKey;\n conversationGeneration.current += 1;\n }, [conversationKey]);\n\n const loadConversationFiles = useCallback(async (): Promise<void> => {\n const key = conversationKey;\n if (!key || !containerId) return;\n // A mutation from the previous conversation may settle after navigation.\n // It must not clear or overwrite the current conversation's inventory.\n if (activeConversationKey.current !== key) return;\n const generation = ++conversationGeneration.current;\n setConversationResult((current) => ({\n key,\n files: current?.key === key ? current.files : [],\n // Keep the visible failure context while retrying so the same control\n // can disable itself and show progress instead of disappearing.\n error: current?.key === key ? current.error : null,\n loading: true,\n }));\n const result =\n await store.services.associations.listConversationFiles(containerId);\n if (\n generation !== conversationGeneration.current ||\n activeConversationKey.current !== key\n ) {\n return;\n }\n if (isAssociationsRpcErr(result)) {\n setConversationResult((current) => ({\n key,\n files: current?.key === key ? current.files : [],\n error: result.error.message,\n loading: false,\n }));\n return;\n }\n setConversationResult({\n key,\n files: result.data.files.map((file) => ({\n edgeId: `conversation-file:${file.fileId}`,\n resourceId: file.fileId,\n token: \"file\",\n role: null,\n label: file.label,\n metadata: file.metadata,\n })),\n error: null,\n loading: false,\n });\n }, [containerId, conversationKey, store]);\n\n useEffect(() => {\n const timeout = setTimeout(() => {\n void loadConversationFiles();\n }, 0);\n return () => clearTimeout(timeout);\n }, [loadConversationFiles]);\n\n const conversationFiles =\n conversationResult?.key === conversationKey ? conversationResult.files : [];\n const conversationFileError =\n conversationResult?.key === conversationKey\n ? conversationResult.error\n : null;\n const conversationFileStatus =\n containerType !== \"conversation\"\n ? \"idle\"\n : conversationResult?.key !== conversationKey\n ? \"loading\"\n : conversationResult.loading\n ? \"loading\"\n : conversationFileError\n ? \"error\"\n : \"ready\";\n\n // A container's attached resources are the edges pointing AT it (incoming).\n // Suppress the generic conversation-file copy because its org-filtered read\n // is intentionally replaced by the viewer-aware dedicated result above.\n const incomingGeneric: ContainerLink[] = edges\n .filter(\n (edge: AssociationEdge) =>\n edge.direction === \"incoming\" &&\n !(containerType === \"conversation\" && edge.otherType === \"file\"),\n )\n .map((edge) => ({\n edgeId: edge.id,\n resourceId: edge.otherId,\n token: edge.otherType,\n role: edge.role ?? null,\n label: edge.label ?? null,\n metadata: edge.metadata ?? {},\n }));\n const incoming =\n containerType === \"conversation\"\n ? [...incomingGeneric, ...conversationFiles]\n : incomingGeneric;\n\n const linksFor = (token: EntityTypeToken): ContainerLink[] =>\n incoming.filter((link) => link.token === token);\n\n const countFor = (token: EntityTypeToken): number =>\n incoming.reduce((n, link) => (link.token === token ? n + 1 : n), 0);\n\n const attachedIdsFor = (token: EntityTypeToken): Set<string> => {\n const set = new Set<string>();\n for (const link of incoming) {\n if (link.token === token) set.add(link.resourceId);\n }\n return set;\n };\n\n const attach = async (\n token: EntityTypeToken,\n resourceId: string,\n label?: string,\n metadata?: unknown,\n options?: { replaceMetadata?: boolean; role?: string },\n ): Promise<AssociationWriteResult> => {\n if (!containerId) return { ok: false, error: \"Missing container id\" };\n const result = await store.add({\n sourceType: token,\n sourceId: resourceId,\n targetType: containerType,\n targetId: containerId,\n ...(orgId != null ? { orgId } : {}),\n ...(label !== undefined ? { label } : {}),\n ...(metadata !== undefined ? { metadata } : {}),\n ...(options?.role !== undefined ? { role: options.role } : {}),\n ...(options?.replaceMetadata !== undefined\n ? { replaceMetadata: options.replaceMetadata }\n : {}),\n });\n if (result.ok && containerType === \"conversation\" && token === \"file\") {\n await loadConversationFiles();\n }\n return result;\n };\n\n const detach = async (\n token: EntityTypeToken,\n resourceId: string,\n role?: string,\n ): Promise<AssociationWriteResult> => {\n if (!containerId) return { ok: false, error: \"Missing container id\" };\n const result = await store.remove({\n sourceType: token,\n sourceId: resourceId,\n targetType: containerType,\n targetId: containerId,\n ...(role !== undefined ? { role } : {}),\n });\n if (result.ok && containerType === \"conversation\" && token === \"file\") {\n await loadConversationFiles();\n }\n return result;\n };\n\n const setPinned = async (\n token: EntityTypeToken,\n resourceId: string,\n pinned: boolean,\n role?: string,\n ): Promise<AssociationWriteResult> => {\n if (!containerId) return { ok: false, error: \"Missing container id\" };\n const exactRole = role ?? null;\n const link = incoming.find(\n (candidate) =>\n candidate.token === token &&\n candidate.resourceId === resourceId &&\n candidate.role === exactRole,\n );\n if (!link) return { ok: false, error: \"Association edge not found\" };\n const currentMetadata = metadataRecord(link.metadata);\n if (!currentMetadata) {\n return {\n ok: false,\n error: \"Association metadata is not an object and cannot be updated safely\",\n };\n }\n return store.add({\n sourceType: token,\n sourceId: resourceId,\n targetType: containerType,\n targetId: containerId,\n ...(orgId != null ? { orgId } : {}),\n ...(link.label != null ? { label: link.label } : {}),\n ...(role !== undefined ? { role } : {}),\n metadata: { ...currentMetadata, pinned },\n });\n };\n\n const reload = async (): Promise<void> => {\n await Promise.all([\n reloadGeneric(),\n containerType === \"conversation\"\n ? loadConversationFiles()\n : Promise.resolve(),\n ]);\n };\n\n const status = !containerId\n ? genericStatus\n : conversationFileStatus === \"error\"\n ? \"error\"\n : containerType === \"conversation\" &&\n (conversationFileStatus === \"idle\" ||\n conversationFileStatus === \"loading\")\n ? \"loading\"\n : genericStatus;\n const error = conversationFileError ?? genericError;\n\n return {\n status,\n error,\n reload,\n totalCount: incoming.length,\n countFor,\n attachedIdsFor,\n linksFor,\n attach,\n detach,\n setPinned,\n };\n}\n","// react/hooks/useEntityTitles.ts — @ai-matrx/associations/react\n//\n// React binding for the entity-title resolver. Give it the (token, id, label)\n// rows a surface is about to render; it returns a resolver that ALWAYS yields\n// a human title — edge label first, fetched title second, `Untitled <type>`\n// last. Fetches are batched per token and memoized in the store's title\n// cache, so re-renders and sibling surfaces are free.\n//\n// `isUnresolved` is the LOUD half: the resolver deliberately omits ids the\n// viewer cannot read (deleted row, or no access), and \"Untitled Note\" for a\n// record that is actually gone reads as a healthy row. A surface that can tell\n// the difference must say so — never render an edge as fine when its target\n// could not be resolved.\n//\n// Ported signature-byte-compatible from matrx-frontend\n// `features/scopes/hooks/useEntityTitles.ts` (W3, 2026-08-29): the module\n// entityTitles service → the store's titles service; registry module →\n// `store.registry`; console.error → the errorSink.\n\nimport { useEffect, useState } from \"react\";\n\nimport { entityTitleCacheKey } from \"../../core/titles\";\nimport { useAssociationsStore } from \"../context\";\n\nexport interface EntityTitleRef {\n token: string;\n id: string;\n /** The edge label (or any already-known title) — wins when present. */\n label?: string | null;\n}\n\nexport interface UseEntityTitlesReturn {\n /** Resolve the display title for one ref (never a UUID). */\n titleFor: (ref: EntityTitleRef) => string;\n /**\n * True when this ref's target could NOT be resolved after a settled fetch —\n * the row is gone or the viewer has no access, and `titleFor` is returning a\n * generic fallback. Surfaces MUST render this loudly (and offer the detach).\n * Always false for tokens with no registered title column (nothing to\n * resolve there — silence is correct, not a failure).\n */\n isUnresolved: (ref: EntityTitleRef) => boolean;\n /** True while any needed titles are still being fetched. */\n loading: boolean;\n}\n\nexport function useEntityTitles(refs: EntityTitleRef[]): UseEntityTitlesReturn {\n const store = useAssociationsStore();\n const [resolved, setResolved] = useState<Record<string, string>>({});\n // Keys we have already asked the resolver for and it has answered. A key that\n // is attempted but absent from `resolved`/cache is genuinely unreachable.\n const [attempted, setAttempted] = useState<Record<string, true>>({});\n const [loading, setLoading] = useState(false);\n\n // The refs that need a fetch.\n //\n // 🚨 A STAMPED LABEL DOES NOT EXEMPT A REF FROM THE READ. That exemption is\n // what made the whole unresolved-target warning inert: a labeled ref was\n // never fetched, so its key never entered `attempted`, so `isUnresolved`\n // below could only ever return false. Verifying that a target still exists\n // IS a live read; the label only decides what we DISPLAY (see `titleFor`).\n //\n // Tokens with no registered title column are still skipped: the resolver was\n // never going to answer for them, and `isUnresolved` returns false for that\n // case by design, so a call would be pure waste.\n // Already-attempted keys are excluded too. A target that does NOT exist never\n // enters the cache, so without this the first fetch resolves the live ones,\n // `needed` shrinks to just the missing ones, the key changes, and they get\n // asked for a second time before settling. One round is enough to prove\n // absence.\n const needed = refs.filter(\n (r) =>\n store.registry.tryGetEntityInfo(r.token)?.titleColumn != null &&\n store.titles.get(r.token, r.id) == null &&\n !attempted[entityTitleCacheKey(r.token, r.id)],\n );\n // Stable dependency for the effect — the set of unresolved keys.\n const neededKey = needed\n .map((r) => entityTitleCacheKey(r.token, r.id))\n .sort()\n .join(\"|\");\n\n useEffect(() => {\n if (!neededKey) return;\n let cancelled = false;\n setLoading(true);\n\n const byToken = new Map<string, string[]>();\n for (const key of neededKey.split(\"|\")) {\n const sep = key.indexOf(\":\");\n const token = key.slice(0, sep);\n const id = key.slice(sep + 1);\n const list = byToken.get(token) ?? [];\n list.push(id);\n byToken.set(token, list);\n }\n\n void Promise.all(\n [...byToken.entries()].map(async ([token, ids]) => {\n const titles = await store.titles.fetch(token, ids);\n return [token, titles] as const;\n }),\n )\n .then((results) => {\n if (cancelled) return;\n setResolved((prev) => {\n const next = { ...prev };\n for (const [token, titles] of results) {\n for (const [id, title] of titles) {\n next[entityTitleCacheKey(token, id)] = title;\n }\n }\n return next;\n });\n })\n .catch((err: unknown) => {\n // A FAILED lookup must still mark the refs attempted, or `loading`\n // sticks on forever and `isUnresolved` stays false — the surface would\n // then show fallback titles with working-looking doors and never admit\n // it couldn't read them. Loud recovery: this is a real failure.\n if (cancelled) return;\n store.errorSink({\n code: \"title_resolution_failed\",\n message: \"Failed to resolve entity titles\",\n context: { detail: err },\n });\n })\n .finally(() => {\n if (cancelled) return;\n setAttempted((prev) => {\n const next = { ...prev };\n for (const key of neededKey.split(\"|\")) next[key] = true;\n return next;\n });\n setLoading(false);\n });\n\n return () => {\n cancelled = true;\n };\n }, [neededKey, store]);\n\n const titleFor = (ref: EntityTitleRef): string => {\n if (ref.label && ref.label.trim()) return ref.label;\n const key = entityTitleCacheKey(ref.token, ref.id);\n return (\n resolved[key] ??\n store.titles.get(ref.token, ref.id) ??\n store.titles.fallback(ref.token)\n );\n };\n\n const isUnresolved = (ref: EntityTitleRef): boolean => {\n // No title column registered → the resolver was never going to answer, so\n // the edge's stamped label is the ONLY source and its absence proves\n // nothing. (`data_store` is the live case: `rag` isn't PostgREST-exposed,\n // which is exactly why those edges must stamp a label at attach time.)\n if (!store.registry.tryGetEntityInfo(ref.token)?.titleColumn) return false;\n\n const key = entityTitleCacheKey(ref.token, ref.id);\n if (resolved[key] || store.titles.get(ref.token, ref.id)) return false;\n\n // A stamped label does NOT clear this. It is a snapshot from attach time,\n // so a deleted or now-inaccessible target still carries a plausible name —\n // and treating that as proof of existence is how a dead reference renders\n // as a normal row with working-looking doors. The live read is the truth;\n // the label is only what we show while saying the target is unreachable.\n return attempted[key] === true;\n };\n\n return { titleFor, isUnresolved, loading };\n}\n","// react/hooks/useCategories.ts — @ai-matrx/associations/react\n//\n// Public hook for the canonical faceted taxonomy (`platform.categories`) — the\n// one primitive any UI consumes to read and manage categories for a facet\n// (`dimension`). The sibling of `useAssociations`: that hook owns an entity's\n// assignment EDGES, this hook owns the category NOUNS for a dimension.\n//\n// Ported signature-byte-compatible from matrx-frontend\n// `features/scopes/hooks/useCategories.ts` (W3, 2026-08-29): the Redux\n// selector/thunk cache becomes the package store's category facets ridden via\n// `useSyncExternalStore`. ASSIGNING a category to an entity is a separate\n// concern — use `useAssociations(...).add({ targetType: 'category' })`.\n\nimport { useEffect, useRef, useSyncExternalStore } from \"react\";\n\nimport type {\n CategoriesEntry,\n CategoryDimension,\n PlatformCategory,\n} from \"../../edges\";\nimport type { CategoryMutationResult } from \"../../core/store\";\nimport { useAssociationsStore } from \"../context\";\n\n/** Same shape as a mutation result; the create carries the new id. */\nexport type CategoryCreateResult = CategoryMutationResult;\nexport type { CategoryMutationResult };\n\nexport interface UseCategoriesArgs {\n /** The facet to read/manage (`agent-shortcut`, `skill`, `industry`, …). */\n dimension: CategoryDimension | null;\n /** Disable the auto-load on mount. Defaults to false (auto-load). */\n autoLoad?: boolean;\n}\n\nexport interface UseCategoriesReturn {\n /** Every category visible to the caller in this facet (system + their orgs). */\n categories: PlatformCategory[];\n status: CategoriesEntry[\"status\"];\n error: string | null;\n fetchedAt: number | null;\n /** Create an org category in this facet. Returns the new id on success. */\n create: (args: {\n name: string;\n orgId: string;\n parentId?: string | null;\n color?: string | null;\n icon?: string | null;\n slug?: string | null;\n }) => Promise<CategoryCreateResult>;\n /** Replace one category's editable scalar fields. */\n update: (args: {\n id: string;\n name: string;\n slug: string | null;\n color: string | null;\n icon: string | null;\n position: number | null;\n }) => Promise<CategoryMutationResult>;\n /** Move a category to the root or directly under a root category. */\n reparent: (\n id: string,\n parentId: string | null,\n ) => Promise<CategoryMutationResult>;\n /** Soft-delete a leaf category. */\n remove: (id: string) => Promise<CategoryMutationResult>;\n /** Force a refetch of this facet's categories. */\n reload: () => Promise<void>;\n}\n\nconst noopSubscribe = () => () => {};\n\nexport function useCategories(args: UseCategoriesArgs): UseCategoriesReturn {\n const { dimension, autoLoad = true } = args;\n const store = useAssociationsStore();\n\n const entry = useSyncExternalStore(\n dimension\n ? (cb) => store.subscribeCategories(dimension, cb)\n : noopSubscribe,\n () => store.getCategories(dimension ?? \"\"),\n () => store.getCategories(dimension ?? \"\"),\n );\n\n const loadedKey = useRef<string | null>(null);\n useEffect(() => {\n if (!autoLoad || !dimension) return;\n if (loadedKey.current === dimension) return;\n loadedKey.current = dimension;\n void store.loadCategories(dimension);\n }, [autoLoad, store, dimension]);\n\n return {\n categories: entry.categories,\n status: entry.status,\n error: entry.error,\n fetchedAt: entry.fetchedAt,\n create: async ({ name, orgId, parentId, color, icon, slug }) => {\n if (!dimension) return { ok: false, error: \"Missing dimension\" };\n return store.createCategory({\n dimension,\n name,\n orgId,\n ...(parentId !== undefined ? { parentId } : {}),\n ...(color !== undefined ? { color } : {}),\n ...(icon !== undefined ? { icon } : {}),\n ...(slug !== undefined ? { slug } : {}),\n });\n },\n update: async ({ id, name, slug, color, icon, position }) => {\n if (!dimension) return { ok: false, error: \"Missing dimension\" };\n return store.updateCategory({\n dimension,\n id,\n name,\n slug,\n color,\n icon,\n position,\n });\n },\n reparent: async (id, parentId) => {\n if (!dimension) return { ok: false, error: \"Missing dimension\" };\n return store.reparentCategory({ dimension, id, parentId });\n },\n remove: async (id) => {\n if (!dimension) return { ok: false, error: \"Missing dimension\" };\n return store.deleteCategory({ dimension, id });\n },\n reload: async () => {\n if (!dimension) return;\n await store.loadCategories(dimension, { force: true });\n },\n };\n}\n","// react/hooks/useUniversalEntitySearch.ts — @ai-matrx/associations/react\n//\n// ONE search box over EVERY listable entity type — the hook behind the\n// universal association picker. Debounced, stale-guarded, registry-driven\n// (new tokens join with zero code here).\n//\n// Empty query → RECENTS: the caller's `platform.user_entity_state` rows\n// (`ues_list`, one RPC) sorted by last-viewed, filtered to the searched\n// tokens, titles resolved through the store's title service.\n//\n// Ported signature-byte-compatible from matrx-frontend\n// `features/scopes/hooks/useUniversalEntitySearch.ts` (W3, 2026-08-29):\n// module services → the store's candidates/favorites/titles services;\n// registry module → `store.registry`.\n\nimport { useEffect, useRef, useState } from \"react\";\n\nimport {\n isEntityTypeToken,\n type EntityTypeToken,\n} from \"../../entity-types.generated\";\nimport type { UniversalCandidate } from \"../../core/candidates\";\nimport type { AssociationsStore } from \"../../core/store\";\nimport { useAssociationsStore } from \"../context\";\n\nconst DEBOUNCE_MS = 250;\nconst RECENTS_LIMIT = 12;\n\nexport type { UniversalCandidate };\n\nexport interface UseUniversalEntitySearchArgs {\n query: string;\n /** Restrict to these tokens; defaults to every listable token. */\n tokens?: EntityTypeToken[];\n /** Owner filter for the per-token candidate reads. */\n ownerId?: string | null;\n enabled?: boolean;\n perTokenLimit?: number;\n /**\n * What an empty query loads. Universal attach surfaces default to recents;\n * constrained value pickers use candidates so opening the picker immediately\n * shows the records that are available to select.\n */\n emptyQueryMode?: \"recents\" | \"candidates\";\n}\n\nexport interface UseUniversalEntitySearchReturn {\n results: UniversalCandidate[];\n /** True while the current query's sweep is in flight. */\n loading: boolean;\n /** True when `results` are recents (empty query), not search hits. */\n isRecents: boolean;\n}\n\nexport function useUniversalEntitySearch(\n args: UseUniversalEntitySearchArgs,\n): UseUniversalEntitySearchReturn {\n const {\n query,\n tokens,\n ownerId,\n enabled = true,\n perTokenLimit = 5,\n emptyQueryMode = \"recents\",\n } = args;\n const store = useAssociationsStore();\n const [results, setResults] = useState<UniversalCandidate[]>([]);\n const [loading, setLoading] = useState(false);\n const [isRecents, setIsRecents] = useState(true);\n const runRef = useRef(0);\n const tokensKey = (tokens ?? []).join(\",\");\n\n useEffect(() => {\n if (!enabled) return;\n const run = ++runRef.current;\n const trimmed = query.trim();\n\n const timer = setTimeout(async () => {\n if (runRef.current !== run) return;\n setLoading(true);\n const activeTokens = tokensKey\n ? (tokensKey.split(\",\") as EntityTypeToken[])\n : store.registry.listableTokens();\n\n let next: UniversalCandidate[] = [];\n if (trimmed || emptyQueryMode === \"candidates\") {\n next = await store.candidates.searchCandidatesAcrossTokens({\n tokens: activeTokens,\n search: trimmed,\n ownerId: ownerId ?? null,\n perTokenLimit,\n });\n } else {\n next = await loadRecents(store, activeTokens);\n }\n if (runRef.current !== run) return; // stale response — drop\n setResults(next);\n setIsRecents(!trimmed && emptyQueryMode === \"recents\");\n setLoading(false);\n }, DEBOUNCE_MS);\n\n return () => clearTimeout(timer);\n }, [query, tokensKey, ownerId, enabled, perTokenLimit, emptyQueryMode, store]);\n\n return { results, loading, isRecents };\n}\n\n/** Recently-touched entities of the searched tokens, titles resolved. */\nasync function loadRecents(\n store: AssociationsStore,\n tokens: EntityTypeToken[],\n): Promise<UniversalCandidate[]> {\n const res = await store.favorites.list();\n if (!res.ok) return [];\n const tokenSet = new Set<string>(tokens);\n const rows = res.data.items\n .filter(\n (i) =>\n tokenSet.has(i.entityType) &&\n isEntityTypeToken(i.entityType) &&\n i.lastViewedAt,\n )\n .sort((a, b) => (b.lastViewedAt ?? \"\").localeCompare(a.lastViewedAt ?? \"\"))\n .slice(0, RECENTS_LIMIT);\n if (rows.length === 0) return [];\n\n // Resolve titles per token (batched, cached).\n const byToken = new Map<string, string[]>();\n for (const r of rows) {\n const list = byToken.get(r.entityType) ?? [];\n list.push(r.entityId);\n byToken.set(r.entityType, list);\n }\n const titles = new Map<string, Map<string, string>>();\n await Promise.all(\n [...byToken.entries()].map(async ([token, ids]) => {\n titles.set(token, await store.titles.fetch(token, ids));\n }),\n );\n\n const out: UniversalCandidate[] = [];\n for (const r of rows) {\n const title = titles.get(r.entityType)?.get(r.entityId);\n if (!title) continue; // deleted / inaccessible / no title column\n out.push({\n token: r.entityType as EntityTypeToken,\n id: r.entityId,\n title,\n });\n }\n return out;\n}\n","// react/hooks/useAssociationCandidates.ts — @ai-matrx/associations/react\n//\n// State wrapper around the store's candidate reader — the picker's data\n// source. One-shot fetch on mount/param-change; re-runs on `reload()` or\n// search change. All querying logic lives in the /core service; this just\n// owns loading/error state.\n//\n// Ported signature-byte-compatible from matrx-frontend\n// `features/scopes/hooks/useAssociationCandidates.ts` (W3, 2026-08-29). One\n// seam inverted: the Redux `selectUserId` read becomes the identity port —\n// read leniently here (null when unauthenticated) because `ownerId` is a\n// candidate-read FILTER, not an auth gate; the RPC enforces visibility\n// regardless.\n\nimport { useEffect, useState } from \"react\";\n\nimport type { EntityTypeToken } from \"../../entity-types.generated\";\nimport type { CandidateRecord } from \"../../core/candidates\";\nimport { useAssociationsStore } from \"../context\";\n\nexport type { CandidateRecord };\n\nexport interface UseAssociationCandidatesArgs {\n token: EntityTypeToken;\n /** Skip fetching (e.g. while the picker is closed). Defaults to true. */\n enabled?: boolean;\n search?: string;\n limit?: number;\n}\n\nexport interface UseAssociationCandidatesReturn {\n candidates: CandidateRecord[];\n loading: boolean;\n error: string | null;\n reload: () => void;\n}\n\nexport function useAssociationCandidates(\n args: UseAssociationCandidatesArgs,\n): UseAssociationCandidatesReturn {\n const { token, enabled = true, search, limit } = args;\n const store = useAssociationsStore();\n const userId = currentUserIdOrNull(store);\n const [candidates, setCandidates] = useState<CandidateRecord[]>([]);\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<string | null>(null);\n const [tick, setTick] = useState(0);\n\n useEffect(() => {\n if (!enabled) return undefined;\n let cancelled = false;\n void (async () => {\n setLoading(true);\n setError(null);\n const res = await store.candidates.listAssociationCandidates({\n token,\n ownerId: userId,\n ...(search !== undefined ? { search } : {}),\n ...(limit !== undefined ? { limit } : {}),\n });\n if (cancelled) return;\n if (res.ok) {\n setCandidates(res.data);\n } else {\n setError(res.error);\n setCandidates([]);\n }\n setLoading(false);\n })();\n return () => {\n cancelled = true;\n };\n }, [token, enabled, userId, search, limit, tick, store]);\n\n return {\n candidates,\n loading,\n error,\n reload: () => setTick((t) => t + 1),\n };\n}\n\n/**\n * Lenient identity read for candidate-list filtering: `requireUserId` throws\n * when unauthenticated (its contract), but an anonymous candidate read is a\n * legitimate empty state (RLS answers), so the filter degrades to null\n * rather than crashing the picker. Write paths keep the loud contract.\n */\nfunction currentUserIdOrNull(store: {\n identity: { requireUserId(): string };\n}): string | null {\n try {\n return store.identity.requireUserId();\n } catch {\n return null;\n }\n}\n","// react/hooks/useComments.ts — @ai-matrx/associations/react\n//\n// Public hook for the unified comments primitive (`platform.comments`, W6) —\n// the one thread of comments on any entity (`token` + `id`), ridden off the\n// /core store's comment-thread cache via `useSyncExternalStore` (the same\n// lifecycle as `useAssociations`). All comments come back flat,\n// oldest→newest; build the tree from each row's `parentId` (the\n// `CommentThread` face does exactly that).\n//\n// Identity: writes go through the services, where `requireUserId` failures\n// stay LOUD; `currentUserId` is the LENIENT read the UI uses to gate\n// edit/delete-own affordances (unauthenticated → null → no own-comment\n// affordances, never a crash).\n\nimport { useEffect, useRef, useSyncExternalStore } from \"react\";\n\nimport type { CommentsEntry, PlatformComment } from \"../../comments\";\nimport { associationsKey, type CommentMutationResult } from \"../../core/store\";\nimport { useAssociationsStore } from \"../context\";\n\nexport interface UseCommentsArgs {\n /** Entity-type token of the commented-on entity (writes-strict, C18). */\n token: string;\n /** The entity's row id; null renders the idle entry and loads nothing. */\n id: string | null;\n /** Disable the auto-load on mount. Defaults to false (auto-load). */\n autoLoad?: boolean;\n}\n\nexport interface UseCommentsReturn {\n /** Every comment on the entity, flat, oldest→newest (thread by parentId). */\n comments: readonly PlatformComment[];\n status: CommentsEntry[\"status\"];\n error: string | null;\n fetchedAt: number | null;\n /** Post a comment; pass `parentId` to reply. Reloads the thread. */\n add(\n body: string,\n opts?: { parentId?: string | null; orgId?: string | null },\n ): Promise<CommentMutationResult>;\n /** Edit a comment body (author-only in the RPC). Reloads the thread. */\n edit(commentId: string, body: string): Promise<CommentMutationResult>;\n /** Soft-delete a comment (author/org member in the RPC). Reloads. */\n remove(commentId: string): Promise<CommentMutationResult>;\n /** Force a refetch of the thread. */\n reload(): Promise<void>;\n /** Lenient identity read for edit/delete-own gating; null when signed out. */\n currentUserId: string | null;\n}\n\nconst noopSubscribe = () => () => {};\n\nexport function useComments(args: UseCommentsArgs): UseCommentsReturn {\n const { token, id, autoLoad = true } = args;\n const store = useAssociationsStore();\n const key = token && id ? associationsKey(token, id) : null;\n\n const entry = useSyncExternalStore(\n key ? (cb) => store.subscribeComments(key, cb) : noopSubscribe,\n () => store.getComments(token, id ?? \"\"),\n () => store.getComments(token, id ?? \"\"),\n );\n\n const loadedKey = useRef<string | null>(null);\n useEffect(() => {\n if (!autoLoad || !key || !id) return;\n if (loadedKey.current === key) return;\n loadedKey.current = key;\n void store.loadComments(token, id);\n }, [autoLoad, store, key, token, id]);\n\n let currentUserId: string | null = null;\n try {\n currentUserId = store.identity.requireUserId();\n } catch {\n currentUserId = null;\n }\n\n return {\n comments: entry.comments,\n status: entry.status,\n error: entry.error,\n fetchedAt: entry.fetchedAt,\n add: async (body, opts) => {\n if (!id) return { ok: false, error: \"Missing entity id\" };\n return store.addComment({\n entityType: token,\n entityId: id,\n body,\n ...(opts?.parentId !== undefined ? { parentId: opts.parentId } : {}),\n ...(opts?.orgId !== undefined ? { orgId: opts.orgId } : {}),\n });\n },\n edit: async (commentId, body) => {\n if (!id) return { ok: false, error: \"Missing entity id\" };\n return store.editComment({\n entityType: token,\n entityId: id,\n id: commentId,\n body,\n });\n },\n remove: async (commentId) => {\n if (!id) return { ok: false, error: \"Missing entity id\" };\n return store.deleteComment({\n entityType: token,\n entityId: id,\n id: commentId,\n });\n },\n reload: async () => {\n if (!id) return;\n await store.loadComments(token, id, { force: true });\n },\n currentUserId,\n };\n}\n","// react/hooks/useAssociationEntitySelect.ts — @ai-matrx/associations/react\n//\n// Default AssociationEntitySelectAdapter for a plain platform.associations\n// container: items from the container's incoming edges of one token (titles\n// via the edge label / entity-title resolver), create via the generic\n// registry-driven row insert + attach, rename via the generic titleColumn\n// update, detach via the container-links hook.\n//\n// \"Active\" has no meaning on a bare association edge, so the caller owns it\n// (controlled `activeId` + `onActiveChange`); when uncontrolled it falls back\n// to the first attached entity. Surfaces with their OWN active semantics\n// (war-room's is_active edge metadata) implement the adapter themselves\n// instead of using this hook.\n//\n// Ported signature-byte-compatible from matrx-frontend\n// `features/scopes/hooks/useAssociationEntitySelect.ts` (W3, 2026-08-29):\n// `@/lib/toast` → the notifier port (warn-once degradation), console.error →\n// the errorSink, entityRows service module → the store's entityRows service.\n//\n// The `AssociationEntitySelectAdapter` CONTRACT lives here with the hook: it\n// is the read/write seam of the `AssociationEntitySelect` face (W4 — the\n// face itself is gated on a design-system Command/combobox primitive; the\n// adapter contract and this default implementation are not).\n\nimport { useState } from \"react\";\n\nimport type { AssociationTargetType } from \"../../edges\";\nimport type { EntityTypeToken } from \"../../entity-types.generated\";\nimport { useAssociationsStore, useNotifier } from \"../context\";\nimport { useContainerLinks } from \"./useContainerLinks\";\nimport { useEntityTitles } from \"./useEntityTitles\";\n\nexport interface AssociationEntitySelectItem {\n id: string;\n title: string;\n}\n\n/**\n * The read/write seam of the association \"name dropdown\". This hook is the\n * default (plain associations container); surfaces with bespoke active/create\n * semantics implement it themselves — same pattern as AssociationList's\n * ContainerResourcesAdapter.\n */\nexport interface AssociationEntitySelectAdapter {\n /** True while the association list is still hydrating. */\n loading: boolean;\n /** Every entity of this token associated with the container. */\n items: AssociationEntitySelectItem[];\n activeId: string | null;\n setActive: (id: string) => void | Promise<unknown>;\n /**\n * Create a new entity named `title`, associate it to the container, and\n * make it active. Resolves to the new id, or null on failure (the adapter\n * reports its own error detail; the component toasts generically).\n * Omit when creation isn't name-driven — pass `createSlot` on the component\n * instead (e.g. a conversation is created by PICKING AN AGENT, not naming).\n */\n createAndAttach?: (title: string) => Promise<string | null>;\n /** Rename the entity (its real title column). Resolves false on failure. */\n rename: (id: string, title: string) => Promise<boolean>;\n /** Optional: unlink an entity from the container (never deletes the row). */\n detach?: (id: string) => Promise<unknown>;\n}\n\nexport interface UseAssociationEntitySelectAdapterArgs {\n token: EntityTypeToken;\n /** The container the entities are associated with (always the edge TARGET). */\n container: {\n type: AssociationTargetType;\n id: string | null;\n orgId?: string | null;\n };\n /** Controlled active selection; omit to default to the first attached row. */\n activeId?: string | null;\n onActiveChange?: (id: string) => void | Promise<unknown>;\n /** NOT NULL columns the registry conventions can't know (create only). */\n createColumns?: Record<string, unknown>;\n}\n\nexport function useAssociationEntitySelectAdapter(\n args: UseAssociationEntitySelectAdapterArgs,\n): AssociationEntitySelectAdapter {\n const { token, container, activeId, onActiveChange, createColumns } = args;\n const store = useAssociationsStore();\n const notifier = useNotifier();\n const links = useContainerLinks({\n containerType: container.type,\n containerId: container.id,\n orgId: container.orgId ?? null,\n });\n const rows = links.linksFor(token);\n const { titleFor } = useEntityTitles(\n rows.map((r) => ({ token, id: r.resourceId, label: r.label })),\n );\n // Rename/create wins over the (attach-time) edge label until a refetch.\n const [titleOverrides, setTitleOverrides] = useState<Record<string, string>>(\n {},\n );\n // Uncontrolled fallback selection (used only when the caller passes no\n // activeId — a bare edge has no active flag to persist).\n const [localActiveId, setLocalActiveId] = useState<string | null>(null);\n\n const items = rows.map((r) => ({\n id: r.resourceId,\n title:\n titleOverrides[r.resourceId] ??\n titleFor({ token, id: r.resourceId, label: r.label }),\n }));\n\n const controlled = activeId !== undefined;\n const resolvedActive = controlled ? activeId : localActiveId;\n const effectiveActive =\n resolvedActive && items.some((i) => i.id === resolvedActive)\n ? resolvedActive\n : (items[0]?.id ?? null);\n\n const setActive = (id: string) => {\n if (!controlled) setLocalActiveId(id);\n return onActiveChange?.(id);\n };\n\n return {\n loading: links.status === \"loading\" || links.status === \"idle\",\n items,\n activeId: effectiveActive,\n setActive,\n createAndAttach: async (title) => {\n // CREATE first (durable row), ASSOCIATE second (idempotent edge).\n const created = await store.entityRows.createEntityRow(token, {\n title,\n orgId: container.orgId ?? null,\n ...(createColumns !== undefined ? { extraColumns: createColumns } : {}),\n });\n // Create-failure surfaces via the component's generic toast (null\n // return); entityRows already screams the DB detail to the sink.\n if (!created.ok) return null;\n let attached = await links.attach(token, created.data.id, title);\n if (!attached.ok) {\n // The row EXISTS — retry the idempotent edge once, then say exactly\n // what happened. A created-but-unlinked item must never look like a\n // failed create (the row would silently \"disappear\").\n attached = await links.attach(token, created.data.id, title);\n }\n if (!attached.ok) {\n store.errorSink({\n code: \"created_but_attach_failed\",\n message:\n \"[useAssociationEntitySelectAdapter] created but attach failed\",\n context: {\n token,\n id: created.data.id,\n error: attached.error,\n },\n });\n notifier.error(\n `Created \"${title}\" but couldn't link it here — it exists in your library`,\n );\n return null;\n }\n setTitleOverrides((prev) => ({ ...prev, [created.data.id]: title }));\n await setActive(created.data.id);\n return created.data.id;\n },\n rename: async (id, title) => {\n const res = await store.entityRows.renameEntityRow(token, id, title);\n if (res.ok) setTitleOverrides((prev) => ({ ...prev, [id]: title.trim() }));\n return res.ok;\n },\n detach: (id) => links.detach(token, id),\n };\n}\n","// react/components/PrimaryEntityContext.tsx — @ai-matrx/associations/react\n//\n// The page-context bridge for association cards. A page that owns a container\n// entity (an org page, a scope page, a project page) wraps its content once:\n//\n// <PrimaryEntityProvider value={{ type: \"organization\", id: orgId, orgId }}>\n// <AssociationCard token=\"task\" />\n// <AssociationCard token=\"file\" />\n// </PrimaryEntityProvider>\n//\n// and every <AssociationCard> inside resolves its primary entity automatically —\n// no prop drilling. A card may still override with an explicit `container` prop.\n//\n// Ported verbatim from matrx-frontend\n// `features/scopes/components/associations/PrimaryEntityContext.tsx` (W4,\n// 2026-08-29).\n\nimport { createContext, useContext, type ReactNode } from \"react\";\n\nimport type { AssociationTargetType } from \"../../edges\";\n\n/** The primary (container) entity a surface is anchored to. */\nexport interface PrimaryEntity {\n /** Container token — must be an association TARGET type. */\n type: AssociationTargetType;\n id: string;\n /** Org to stamp on edges created here (org-scoped RLS / counts). */\n orgId?: string | null;\n /** Human label for headings (e.g. the org/scope name). */\n label?: string;\n}\n\nconst PrimaryEntityCtx = createContext<PrimaryEntity | null>(null);\n\nexport function PrimaryEntityProvider({\n value,\n children,\n}: {\n value: PrimaryEntity;\n children: ReactNode;\n}) {\n return (\n <PrimaryEntityCtx.Provider value={value}>\n {children}\n </PrimaryEntityCtx.Provider>\n );\n}\n\n/** Read the surrounding primary entity, or null when unprovided. */\nexport function usePrimaryEntity(): PrimaryEntity | null {\n return useContext(PrimaryEntityCtx);\n}\n","// react/components/AssociationWindow.tsx — @ai-matrx/associations/react\n//\n// The non-blocking shell for association surfaces. Ported from matrx-frontend\n// `features/scopes/components/associations/AssociationWindow.tsx` (W4,\n// 2026-08-29) with the measured seam inverted: the `WindowPanel` import\n// becomes the OPTIONAL `windowShell` port.\n//\n// • windowShell absent → `DefaultWindowShell`, the package's OWN real\n// window (0.6.0, C23): draggable, resizable, maximizable, viewport-\n// clamped, portalled, non-modal, mobile bottom-card. NOT a degradation —\n// the shipped default. A host needs no window system to get one.\n// • windowShell bound → the host's window renders the surface instead\n// (matrx-frontend binds `WindowPanel` for tray docking + workspace\n// persistence, which are app identity the package cannot own).\n\nimport { useId, type ReactNode } from \"react\";\n\nimport { useAssociationsUiPorts } from \"../context\";\nimport { DefaultWindowShell } from \"./DefaultWindowShell\";\n\nexport interface AssociationWindowProps {\n /** Controls mount — callers should also gate their JSX on this. */\n open: boolean;\n onClose: () => void;\n /** Human-readable scope for the window id (debugging / tray labels). */\n scopeId: string;\n title: string;\n /** Small leading icon rendered beside the title. */\n icon?: ReactNode;\n /**\n * One-line context under the header (\"Attached to Titanium Marketing\").\n * A node, not a string, so the container it names can carry its own door\n * (THE DOOR LAW) instead of being an unreachable label.\n */\n subtitle?: ReactNode;\n children: ReactNode;\n}\n\nexport function AssociationWindow({\n open,\n onClose,\n scopeId,\n title,\n icon,\n subtitle,\n children,\n}: AssociationWindowProps) {\n // Unique per mounted instance — two shells sharing an id fight over one\n // host window-registry entry and the first unmount kills drag for the\n // survivor.\n const instanceId = useId();\n const { windowShell } = useAssociationsUiPorts();\n\n if (!open) return null;\n\n const body = (\n <div className=\"flex h-full min-h-0 flex-col gap-2 p-3\">\n {/* A <div>, not a <p>: `subtitle` is a node and may carry an entity ref\n whose peek renders block content. */}\n {subtitle ? (\n <div className=\"shrink-0 text-xs text-muted-foreground\">{subtitle}</div>\n ) : null}\n {children}\n </div>\n );\n\n const windowId = `association:${scopeId}:${instanceId}`;\n\n if (windowShell) {\n const HostWindow = windowShell.Window;\n return (\n <HostWindow id={windowId} title={title} onClose={onClose}>\n {body}\n </HostWindow>\n );\n }\n\n return (\n <DefaultWindowShell\n id={windowId}\n title={title}\n onClose={onClose}\n {...(icon !== undefined ? { icon } : {})}\n >\n {body}\n </DefaultWindowShell>\n );\n}\n\nexport default AssociationWindow;\n","// react/components/DefaultWindowShell.tsx — @ai-matrx/associations/react\n//\n// THE package's shipped default for the `windowShell` port (C23: every port\n// ships a working default; hosts override, they never have to fill).\n//\n// Before 0.6.0 the absent-port path was a DEGRADATION — a fixed, centred,\n// non-draggable card. That failed THE ALL-INCLUSIVE LAW: a host that wants a\n// real window had to build one. This IS a real window:\n//\n// • drag by the header (pointer events — mouse, pen and touch alike),\n// • resize from the bottom-right grip, honouring min sizes,\n// • maximize / restore toggle,\n// • clamped to the viewport on drag, on resize, and on window resize —\n// a window can never be dragged somewhere it cannot be dragged back from,\n// • NON-MODAL: no backdrop, the page behind stays fully interactive\n// (the pre-extraction AssociationWindow contract),\n// • Escape closes; the panel takes focus on mount and is labelled for\n// screen readers (`role=\"dialog\"` + `aria-label`),\n// • portalled to <body> so a transformed ancestor cannot clip it (the\n// classic `position: fixed` trap),\n// • under 640px it presents as a full-width bottom card — drag/resize are\n// pointless on a phone and the grip is hidden rather than left inert.\n//\n// What it deliberately does NOT do: dock to a tray, persist across reloads,\n// or take part in an app-wide window manager. Those are app identity — a\n// host with a window manager (matrx-frontend's `WindowPanel`) binds the\n// `windowShell` port and this shell steps aside.\n\nimport {\n useCallback,\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n type CSSProperties,\n type PointerEvent as ReactPointerEvent,\n type ReactNode,\n} from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { cn } from \"@ai-matrx/design-system\";\n\nimport { GripResizeIcon, MaximizeIcon, RestoreIcon, XIcon } from \"../icons\";\n\nconst DEFAULT_WIDTH = 440;\nconst DEFAULT_HEIGHT = 580;\nconst MIN_WIDTH = 330;\nconst MIN_HEIGHT = 380;\nconst MOBILE_MAX_WIDTH = 640;\n/** Never let the whole header slide off-screen — keep a grab strip visible. */\nconst EDGE_KEEP = 48;\n\ninterface Rect {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\nexport interface DefaultWindowShellProps {\n /** Stable id — used for the accessible label association only. */\n id: string;\n title: string;\n onClose: () => void;\n /** Small leading glyph beside the title. */\n icon?: ReactNode;\n children: ReactNode;\n className?: string;\n}\n\nfunction viewport(): { width: number; height: number } {\n if (typeof window === \"undefined\") {\n return { width: DEFAULT_WIDTH, height: DEFAULT_HEIGHT };\n }\n return { width: window.innerWidth, height: window.innerHeight };\n}\n\nfunction clamp(rect: Rect): Rect {\n const { width: vw, height: vh } = viewport();\n const width = Math.min(Math.max(rect.width, MIN_WIDTH), Math.max(vw, MIN_WIDTH));\n const height = Math.min(\n Math.max(rect.height, MIN_HEIGHT),\n Math.max(vh, MIN_HEIGHT),\n );\n return {\n width,\n height,\n x: Math.min(Math.max(rect.x, EDGE_KEEP - width), Math.max(vw - EDGE_KEEP, 0)),\n y: Math.min(Math.max(rect.y, 0), Math.max(vh - EDGE_KEEP, 0)),\n };\n}\n\nfunction centred(): Rect {\n const { width: vw, height: vh } = viewport();\n const width = Math.min(DEFAULT_WIDTH, Math.max(vw - 32, MIN_WIDTH));\n const height = Math.min(DEFAULT_HEIGHT, Math.max(vh - 32, MIN_HEIGHT));\n return clamp({\n width,\n height,\n x: Math.round((vw - width) / 2),\n y: Math.round((vh - height) / 2),\n });\n}\n\nexport function DefaultWindowShell({\n id,\n title,\n onClose,\n icon,\n children,\n className,\n}: DefaultWindowShellProps) {\n const panelRef = useRef<HTMLDivElement | null>(null);\n const [mounted, setMounted] = useState(false);\n const [isMobile, setIsMobile] = useState(false);\n const [rect, setRect] = useState<Rect>(() => centred());\n const [maximized, setMaximized] = useState(false);\n // The gesture in flight: which handle grabbed, and the pointer/rect origin.\n const gesture = useRef<{\n mode: \"move\" | \"resize\";\n pointerId: number;\n startX: number;\n startY: number;\n origin: Rect;\n } | null>(null);\n\n // SSR safety: the portal target only exists in the browser. Rendering\n // nothing on the server is correct — this shell is opened by a user\n // gesture, so it is never part of first paint.\n useLayoutEffect(() => {\n setMounted(true);\n setIsMobile(window.innerWidth < MOBILE_MAX_WIDTH);\n setRect(centred());\n }, []);\n\n // Viewport changes (rotate, resize, keyboard) re-clamp — a window must\n // never end up unreachable because the viewport shrank under it.\n useEffect(() => {\n if (!mounted) return;\n const onResize = () => {\n setIsMobile(window.innerWidth < MOBILE_MAX_WIDTH);\n setRect((current) => clamp(current));\n };\n window.addEventListener(\"resize\", onResize);\n return () => window.removeEventListener(\"resize\", onResize);\n }, [mounted]);\n\n useEffect(() => {\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.key === \"Escape\") onClose();\n };\n window.addEventListener(\"keydown\", onKeyDown);\n return () => window.removeEventListener(\"keydown\", onKeyDown);\n }, [onClose]);\n\n useEffect(() => {\n panelRef.current?.focus({ preventScroll: true });\n }, [mounted]);\n\n const beginGesture = useCallback(\n (mode: \"move\" | \"resize\") => (event: ReactPointerEvent<HTMLElement>) => {\n if (isMobile || maximized || event.button !== 0) return;\n event.preventDefault();\n event.currentTarget.setPointerCapture(event.pointerId);\n gesture.current = {\n mode,\n pointerId: event.pointerId,\n startX: event.clientX,\n startY: event.clientY,\n origin: rect,\n };\n },\n [isMobile, maximized, rect],\n );\n\n const onPointerMove = useCallback((event: ReactPointerEvent<HTMLElement>) => {\n const active = gesture.current;\n if (!active || active.pointerId !== event.pointerId) return;\n const dx = event.clientX - active.startX;\n const dy = event.clientY - active.startY;\n setRect(\n clamp(\n active.mode === \"move\"\n ? { ...active.origin, x: active.origin.x + dx, y: active.origin.y + dy }\n : {\n ...active.origin,\n width: active.origin.width + dx,\n height: active.origin.height + dy,\n },\n ),\n );\n }, []);\n\n const endGesture = useCallback((event: ReactPointerEvent<HTMLElement>) => {\n const active = gesture.current;\n if (!active || active.pointerId !== event.pointerId) return;\n gesture.current = null;\n if (event.currentTarget.hasPointerCapture(event.pointerId)) {\n event.currentTarget.releasePointerCapture(event.pointerId);\n }\n }, []);\n\n if (!mounted || typeof document === \"undefined\") return null;\n\n const labelId = `assoc-window-title:${id}`;\n const style: CSSProperties = isMobile\n ? {}\n : maximized\n ? { inset: \"1rem\", width: \"auto\", height: \"auto\" }\n : {\n left: rect.x,\n top: rect.y,\n width: rect.width,\n height: rect.height,\n };\n\n return createPortal(\n <div\n ref={panelRef}\n role=\"dialog\"\n aria-labelledby={labelId}\n tabIndex={-1}\n style={style}\n className={cn(\n // Non-modal by design: no backdrop element exists, so the page\n // behind keeps every click. `pointer-events-auto` re-asserts our\n // own subtree in case a Radix surface left <body> inert.\n \"pointer-events-auto fixed z-50 flex flex-col overflow-hidden border border-border bg-card text-card-foreground shadow-xl outline-none\",\n isMobile\n ? \"inset-x-0 bottom-0 max-h-[85dvh] rounded-t-xl\"\n : \"rounded-xl\",\n className,\n )}\n >\n <header\n onPointerDown={beginGesture(\"move\")}\n onPointerMove={onPointerMove}\n onPointerUp={endGesture}\n onPointerCancel={endGesture}\n onDoubleClick={() => {\n if (!isMobile) setMaximized((v) => !v);\n }}\n className={cn(\n \"flex shrink-0 items-center justify-between gap-2 border-b border-border px-3 py-2 select-none\",\n isMobile ? \"\" : \"cursor-move touch-none\",\n )}\n >\n <span\n id={labelId}\n className=\"flex min-w-0 items-center gap-1.5 text-sm font-medium text-foreground\"\n >\n {icon}\n <span className=\"truncate\">{title}</span>\n </span>\n <span className=\"flex shrink-0 items-center gap-0.5\">\n {isMobile ? null : (\n <button\n type=\"button\"\n onPointerDown={(event) => event.stopPropagation()}\n onClick={() => setMaximized((v) => !v)}\n aria-label={maximized ? \"Restore window\" : \"Maximize window\"}\n className=\"flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground\"\n >\n {maximized ? (\n <RestoreIcon className=\"h-3.5 w-3.5\" />\n ) : (\n <MaximizeIcon className=\"h-3.5 w-3.5\" />\n )}\n </button>\n )}\n <button\n type=\"button\"\n onPointerDown={(event) => event.stopPropagation()}\n onClick={onClose}\n aria-label=\"Close\"\n className=\"flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground\"\n >\n <XIcon className=\"h-3.5 w-3.5\" />\n </button>\n </span>\n </header>\n\n <div className=\"min-h-0 flex-1 overflow-hidden\">{children}</div>\n\n {isMobile || maximized ? null : (\n <button\n type=\"button\"\n aria-label=\"Resize window\"\n onPointerDown={beginGesture(\"resize\")}\n onPointerMove={onPointerMove}\n onPointerUp={endGesture}\n onPointerCancel={endGesture}\n className=\"absolute bottom-0 right-0 flex h-4 w-4 cursor-nwse-resize touch-none items-center justify-center text-muted-foreground/60 hover:text-foreground\"\n >\n <GripResizeIcon className=\"h-3 w-3\" />\n </button>\n )}\n </div>,\n document.body,\n );\n}\n\nexport default DefaultWindowShell;\n","// react/icons.tsx — @ai-matrx/associations/react\n//\n// The package's OWN inlined SVG glyphs (packaging standard, C19: no icon\n// library dependency, ever — a package ships its own SVGs, adapted from\n// Lucide-style sources; the tap-target precedent). Same 24×24 stroke\n// geometry the host's lucide icons use, so a host-supplied overlay Icon and\n// a package glyph render identically side by side.\n//\n// Entity icons themselves are HOST values (the entity-overlay port);\n// `DefaultEntityIcon` is the package fallback for un-overlaid tokens\n// (lucide `Boxes` geometry — the original registry's DEFAULT_ICON).\n\nimport type { SVGProps } from \"react\";\n\nexport type IconProps = SVGProps<SVGSVGElement>;\n\nfunction base(props: IconProps) {\n return {\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n stroke: \"currentColor\",\n strokeWidth: 2,\n strokeLinecap: \"round\" as const,\n strokeLinejoin: \"round\" as const,\n \"aria-hidden\": true,\n ...props,\n };\n}\n\n/** Spinner glyph (lucide `Loader2`/`LoaderCircle`). Pair with `animate-spin`. */\nexport function SpinnerIcon(props: IconProps) {\n return (\n <svg {...base(props)}>\n <path d=\"M21 12a9 9 0 1 1-6.219-8.56\" />\n </svg>\n );\n}\n\nexport function PlusIcon(props: IconProps) {\n return (\n <svg {...base(props)}>\n <path d=\"M5 12h14\" />\n <path d=\"M12 5v14\" />\n </svg>\n );\n}\n\nexport function XIcon(props: IconProps) {\n return (\n <svg {...base(props)}>\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n );\n}\n\nexport function CheckIcon(props: IconProps) {\n return (\n <svg {...base(props)}>\n <path d=\"M20 6 9 17l-5-5\" />\n </svg>\n );\n}\n\nexport function SearchIcon(props: IconProps) {\n return (\n <svg {...base(props)}>\n <circle cx=\"11\" cy=\"11\" r=\"8\" />\n <path d=\"m21 21-4.3-4.3\" />\n </svg>\n );\n}\n\nexport function Link2Icon(props: IconProps) {\n return (\n <svg {...base(props)}>\n <path d=\"M9 17H7A5 5 0 0 1 7 7h2\" />\n <path d=\"M15 7h2a5 5 0 1 1 0 10h-2\" />\n <line x1=\"8\" x2=\"16\" y1=\"12\" y2=\"12\" />\n </svg>\n );\n}\n\nexport function RefreshIcon(props: IconProps) {\n return (\n <svg {...base(props)}>\n <path d=\"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8\" />\n <path d=\"M21 3v5h-5\" />\n <path d=\"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16\" />\n <path d=\"M8 16H3v5\" />\n </svg>\n );\n}\n\nexport function PinIcon(props: IconProps) {\n return (\n <svg {...base(props)}>\n <path d=\"M12 17v5\" />\n <path d=\"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z\" />\n </svg>\n );\n}\n\nexport function UploadIcon(props: IconProps) {\n return (\n <svg {...base(props)}>\n <path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\" />\n <polyline points=\"17 8 12 3 7 8\" />\n <line x1=\"12\" x2=\"12\" y1=\"3\" y2=\"15\" />\n </svg>\n );\n}\n\nexport function FolderOpenIcon(props: IconProps) {\n return (\n <svg {...base(props)}>\n <path d=\"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2\" />\n </svg>\n );\n}\n\nexport function FileTextIcon(props: IconProps) {\n return (\n <svg {...base(props)}>\n <path d=\"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z\" />\n <path d=\"M14 2v4a2 2 0 0 0 2 2h4\" />\n <path d=\"M10 9H8\" />\n <path d=\"M16 13H8\" />\n <path d=\"M16 17H8\" />\n </svg>\n );\n}\n\nexport function ExternalLinkIcon(props: IconProps) {\n return (\n <svg {...base(props)}>\n <path d=\"M15 3h6v6\" />\n <path d=\"M10 14 21 3\" />\n <path d=\"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\" />\n </svg>\n );\n}\n\nexport function ChevronDownIcon(props: IconProps) {\n return (\n <svg {...base(props)}>\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n );\n}\n\nexport function ChevronsUpDownIcon(props: IconProps) {\n return (\n <svg {...base(props)}>\n <path d=\"m7 15 5 5 5-5\" />\n <path d=\"m7 9 5-5 5 5\" />\n </svg>\n );\n}\n\nexport function CornerDownRightIcon(props: IconProps) {\n return (\n <svg {...base(props)}>\n <polyline points=\"15 10 20 15 15 20\" />\n <path d=\"M4 4v7a4 4 0 0 0 4 4h12\" />\n </svg>\n );\n}\n\nexport function TagIcon(props: IconProps) {\n return (\n <svg {...base(props)}>\n <path d=\"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z\" />\n <circle cx=\"7.5\" cy=\"7.5\" r=\".5\" fill=\"currentColor\" />\n </svg>\n );\n}\n\n/**\n * The default entity glyph for tokens with no host overlay icon (lucide\n * `Boxes` — the original registry's DEFAULT_ICON, now a /react concern\n * because /core ships `Icon: null`).\n */\nexport function DefaultEntityIcon(props: IconProps) {\n return (\n <svg {...base(props)}>\n <path d=\"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z\" />\n <path d=\"m7 16.5-4.74-2.85\" />\n <path d=\"m7 16.5 5-3\" />\n <path d=\"M7 16.5v5.17\" />\n <path d=\"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z\" />\n <path d=\"m17 16.5-5-3\" />\n <path d=\"m17 16.5 4.74-2.85\" />\n <path d=\"M17 16.5v5.17\" />\n <path d=\"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z\" />\n <path d=\"M12 8 7.26 5.15\" />\n <path d=\"m12 8 4.74-2.85\" />\n <path d=\"M12 13.5V8\" />\n </svg>\n );\n}\n\n/** Maximize glyph (lucide `Maximize2`) — the default window's expand toggle. */\nexport function MaximizeIcon(props: IconProps) {\n return (\n <svg {...base(props)}>\n <path d=\"M15 3h6v6\" />\n <path d=\"M9 21H3v-6\" />\n <path d=\"M21 3l-7 7\" />\n <path d=\"M3 21l7-7\" />\n </svg>\n );\n}\n\n/** Restore glyph (lucide `Minimize2`) — the default window's collapse toggle. */\nexport function RestoreIcon(props: IconProps) {\n return (\n <svg {...base(props)}>\n <path d=\"M4 14h6v6\" />\n <path d=\"M20 10h-6V4\" />\n <path d=\"M14 10l7-7\" />\n <path d=\"M3 21l7-7\" />\n </svg>\n );\n}\n\n/** Resize-grip glyph — the default window's bottom-right resize handle. */\nexport function GripResizeIcon(props: IconProps) {\n return (\n <svg {...base(props)}>\n <path d=\"M21 15 15 21\" />\n <path d=\"M21 20 20 21\" />\n </svg>\n );\n}\n","// react/components/AssociationPicker.tsx — @ai-matrx/associations/react\n//\n// The token-driven \"pick a record to associate\" surface, through the ONE\n// AssociationWindow shell. Two jobs, both ALWAYS available (the\n// create-then-associate contract):\n// 1. Associate existing — the registry-driven candidate list.\n// 2. Add new + associate — the \"+ New <Entity>\" footer creates the row\n// first (durable, via the store's entityRows service), writes the edge\n// second, and every terminal outcome is loud.\n//\n// Ported from matrx-frontend\n// `features/scopes/components/associations/AssociationPicker.tsx` (W4,\n// 2026-08-29) with the measured seams inverted:\n// • the hardcoded `token === \"file\"` → FilePickerWindow branch becomes the\n// per-token `pickerOverrides` port: a host registers its canonical picker\n// component per token (matrx-frontend registers FilePickerWindow for\n// \"file\" in its binding); with no override the generic candidate list\n// serves the token (design Decision 2 degradation);\n// • `@/lib/toast` → the notifier port (warn-once degradation);\n// • host `next/dynamic` lazy-loading of the window shell is a HOST concern\n// (the shell itself now arrives via the windowShell port).\n\nimport { useState, type ReactNode } from \"react\";\nimport { cn, Input } from \"@ai-matrx/design-system\";\n\nimport type { EntityTypeToken } from \"../../entity-types.generated\";\nimport type { AssociationPickerProps } from \"../../ports\";\nimport { useAssociationsStore, useAssociationsUiPorts, useNotifier } from \"../context\";\nimport { useAssociationCandidates } from \"../hooks/useAssociationCandidates\";\nimport {\n CheckIcon,\n DefaultEntityIcon,\n PlusIcon,\n SearchIcon,\n SpinnerIcon,\n XIcon,\n} from \"../icons\";\nimport { AssociationWindow } from \"./AssociationWindow\";\n\nexport type { AssociationPickerProps };\n\nexport function AssociationPicker(props: AssociationPickerProps) {\n const store = useAssociationsStore();\n const { pickerOverrides } = useAssociationsUiPorts();\n const info = store.registry.getEntityInfo(props.token);\n const Icon = info.Icon ?? DefaultEntityIcon;\n\n // A host-registered per-token picker (e.g. the canonical file browser)\n // replaces the generic surface entirely — same props contract.\n const Override = pickerOverrides?.[props.token];\n if (Override) return <Override {...props} />;\n\n const title = `Add ${info.labelPlural}`;\n const subtitle = props.containerLabel\n ? `Attach to ${props.containerLabel}`\n : \"Click an item to attach or detach it\";\n\n // Gated on `open` so host window chunks only load on first use.\n if (!props.open) return null;\n return (\n <AssociationWindow\n open={props.open}\n onClose={() => props.onOpenChange(false)}\n scopeId={`picker:${props.token}`}\n title={title}\n icon={<Icon className=\"size-3.5 text-primary\" />}\n subtitle={subtitle}\n >\n <AssociationCandidateBody\n token={props.token}\n enabled={props.open}\n orgId={props.orgId}\n attachedIds={props.attachedIds}\n onAttach={props.onAttach}\n onDetach={props.onDetach}\n onClose={() => props.onOpenChange(false)}\n />\n </AssociationWindow>\n );\n}\n\nexport interface AssociationCandidateBodyProps {\n token: EntityTypeToken;\n /** Load candidates only while true (mirror of the surface's `open`). */\n enabled: boolean;\n /** Org stamped onto rows created by the \"+ New\" footer. */\n orgId?: string | null | undefined;\n attachedIds: Set<string>;\n onAttach: (\n resourceId: string,\n title: string,\n ) => Promise<{ ok: boolean; error?: string }>;\n onDetach: (resourceId: string) => Promise<{ ok: boolean; error?: string }>;\n /** Wired to a per-token browse surface's back affordance. */\n onClose?: () => void;\n}\n\n/**\n * The attach/detach body for ONE token — reused by the picker sheet and by\n * `UniversalAssociationPicker`'s per-token browse mode. Tokens with a\n * host-registered picker override are routed at the PICKER level (windowed\n * override component); this body is always the generic registry-driven list.\n */\nexport function AssociationCandidateBody({\n token,\n enabled,\n orgId,\n attachedIds,\n onAttach,\n onDetach,\n onClose,\n}: AssociationCandidateBodyProps) {\n void onClose;\n return (\n <EntityCandidateList\n token={token}\n enabled={enabled}\n orgId={orgId}\n attachedIds={attachedIds}\n onAttach={onAttach}\n onDetach={onDetach}\n />\n );\n}\n\nfunction EntityCandidateList({\n token,\n enabled,\n orgId,\n attachedIds,\n onAttach,\n onDetach,\n}: {\n token: EntityTypeToken;\n enabled: boolean;\n orgId?: string | null | undefined;\n attachedIds: Set<string>;\n onAttach: (\n resourceId: string,\n title: string,\n ) => Promise<{ ok: boolean; error?: string }>;\n onDetach: (resourceId: string) => Promise<{ ok: boolean; error?: string }>;\n}) {\n const store = useAssociationsStore();\n const notifier = useNotifier();\n const [search, setSearch] = useState(\"\");\n const [busyId, setBusyId] = useState<string | null>(null);\n const info = store.registry.getEntityInfo(token);\n const Icon = info.Icon ?? DefaultEntityIcon;\n const { candidates, loading, error, reload } = useAssociationCandidates({\n token,\n enabled,\n ...(search.trim() ? { search: search.trim() } : {}),\n });\n\n // Creatable = the generic registry write path works: a title column and no\n // bespoke candidate source (a `listCandidates` override signals the table\n // is not PostgREST-writable, e.g. rag data stores).\n const canCreate = info.titleColumn !== null && info.listCandidates === null;\n\n const toggle = async (id: string, title: string) => {\n if (busyId) return;\n setBusyId(id);\n try {\n const attached = attachedIds.has(id);\n const res = attached ? await onDetach(id) : await onAttach(id, title);\n // The container cache reload (in the store write) flips `attachedIds`\n // for us. A silent no-op attach is the bug class this scream kills.\n if (!res.ok) {\n notifier.error(\n `Couldn't ${attached ? \"detach\" : \"attach\"} \"${title}\"` +\n (res.error ? `: ${res.error}` : \"\"),\n );\n }\n } finally {\n setBusyId(null);\n }\n };\n\n return (\n <>\n <div className=\"relative mb-2\">\n <SearchIcon className=\"absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground\" />\n <Input\n value={search}\n onChange={(e) => setSearch(e.target.value)}\n placeholder={`Search ${info.labelPlural.toLowerCase()}…`}\n className=\"h-11 pl-8 text-base md:h-9\"\n style={{ fontSize: 16 }}\n />\n </div>\n\n <div className=\"flex-1 min-h-0 overflow-y-auto -mx-1 px-1\">\n {loading && candidates.length === 0 ? (\n <ListMessage>\n <SpinnerIcon className=\"h-4 w-4 animate-spin\" />\n Loading…\n </ListMessage>\n ) : error ? (\n <div className=\"rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-[12px] text-destructive\">\n <p className=\"font-medium\">Couldn’t load items</p>\n <p className=\"opacity-80\">{error}</p>\n <button\n type=\"button\"\n onClick={reload}\n className=\"mt-1 underline hover:no-underline\"\n >\n Retry\n </button>\n </div>\n ) : candidates.length === 0 ? (\n <ListMessage>\n {canCreate\n ? `Nothing to attach yet — create a new ${info.label.toLowerCase()} below.`\n : \"Nothing to attach.\"}\n </ListMessage>\n ) : (\n <ul className=\"space-y-0.5\">\n {candidates.map((c) => {\n const attached = attachedIds.has(c.id);\n const busy = busyId === c.id;\n return (\n <li key={c.id}>\n <button\n type=\"button\"\n disabled={busy}\n onClick={() => toggle(c.id, c.title)}\n className={cn(\n \"group flex min-h-11 w-full items-center gap-2 rounded-md px-2.5 py-2 text-left text-sm transition-colors md:min-h-0\",\n \"hover:bg-accent disabled:opacity-50\",\n attached && \"bg-accent/40\",\n )}\n >\n <Icon className=\"h-4 w-4 shrink-0 text-muted-foreground\" />\n <span className=\"flex-1 min-w-0 truncate text-foreground\">\n {c.title}\n </span>\n <span\n className={cn(\n \"flex h-5 w-5 items-center justify-center rounded-full shrink-0\",\n attached\n ? \"bg-primary text-primary-foreground\"\n : \"border border-border text-muted-foreground group-hover:border-primary/60\",\n )}\n >\n {busy ? (\n <SpinnerIcon className=\"h-3 w-3 animate-spin\" />\n ) : attached ? (\n <CheckIcon className=\"h-3 w-3\" />\n ) : (\n <PlusIcon className=\"h-3 w-3\" />\n )}\n </span>\n </button>\n </li>\n );\n })}\n </ul>\n )}\n </div>\n\n {canCreate && (\n <CreateAndAttachFooter\n token={token}\n orgId={orgId}\n seed={search.trim()}\n onAttach={onAttach}\n onCreated={reload}\n />\n )}\n </>\n );\n}\n\n/**\n * The \"+ New <Entity>\" footer — the create-then-associate contract: create the\n * durable row FIRST (the store's entityRows service), write the idempotent\n * edge SECOND (retry once), and every terminal outcome is loud. A\n * created-but-unlinked row is reported WITH its location, never silently\n * orphaned.\n */\nfunction CreateAndAttachFooter({\n token,\n orgId,\n seed,\n onAttach,\n onCreated,\n}: {\n token: EntityTypeToken;\n orgId?: string | null | undefined;\n /** Current search text — doubles as the new row's default name. */\n seed: string;\n onAttach: (resourceId: string, title: string) => Promise<{ ok: boolean }>;\n onCreated: () => void;\n}) {\n const store = useAssociationsStore();\n const notifier = useNotifier();\n const info = store.registry.getEntityInfo(token);\n const [editing, setEditing] = useState(false);\n const [name, setName] = useState(\"\");\n const [busy, setBusy] = useState(false);\n\n const submit = async () => {\n const title = name.trim();\n if (!title || busy) return;\n setBusy(true);\n try {\n const created = await store.entityRows.createEntityRow(token, {\n title,\n orgId: orgId ?? null,\n });\n if (!created.ok) {\n notifier.error(\n `Couldn't create ${info.label.toLowerCase()}: ${created.error}`,\n );\n return;\n }\n let attached = await onAttach(created.data.id, created.data.title);\n if (!attached.ok) {\n // The edge write is idempotent — one retry is safe.\n attached = await onAttach(created.data.id, created.data.title);\n }\n if (attached.ok) {\n notifier.success(`\"${title}\" created and attached`);\n } else {\n notifier.error(\n `Created \"${title}\" but couldn't attach it — it's saved in your ` +\n `${info.labelPlural.toLowerCase()}; pick it from the list to retry.`,\n );\n }\n setEditing(false);\n setName(\"\");\n onCreated();\n } finally {\n setBusy(false);\n }\n };\n\n if (!editing) {\n return (\n <button\n type=\"button\"\n onClick={() => {\n setName(seed);\n setEditing(true);\n }}\n className=\"mt-2 flex min-h-11 w-full shrink-0 items-center justify-center gap-1.5 rounded-md border border-dashed border-border px-3 py-2 text-sm text-muted-foreground transition-colors hover:border-primary/60 hover:text-foreground md:min-h-0\"\n >\n <PlusIcon className=\"h-4 w-4\" />\n New {info.label}\n {seed ? (\n <span className=\"max-w-40 truncate text-muted-foreground/70\">\n “{seed}”\n </span>\n ) : null}\n </button>\n );\n }\n\n return (\n <div className=\"mt-2 flex shrink-0 items-center gap-1.5\">\n <Input\n autoFocus\n value={name}\n onChange={(e) => setName(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === \"Enter\") void submit();\n if (e.key === \"Escape\") {\n setEditing(false);\n setName(\"\");\n }\n }}\n placeholder={`New ${info.label.toLowerCase()} name…`}\n disabled={busy}\n className=\"h-11 flex-1 text-base md:h-8\"\n style={{ fontSize: 16 }}\n />\n <button\n type=\"button\"\n disabled={busy || !name.trim()}\n onClick={() => void submit()}\n className=\"flex h-11 items-center gap-1 rounded-md bg-primary px-2.5 text-sm font-medium text-primary-foreground transition-opacity disabled:opacity-50 md:h-8\"\n >\n {busy ? <SpinnerIcon className=\"h-3.5 w-3.5 animate-spin\" /> : \"Create\"}\n </button>\n <button\n type=\"button\"\n disabled={busy}\n onClick={() => {\n setEditing(false);\n setName(\"\");\n }}\n title=\"Cancel\"\n className=\"flex h-11 w-11 items-center justify-center rounded-md border border-border text-muted-foreground transition-colors hover:text-foreground disabled:opacity-50 md:h-8 md:w-8\"\n >\n <XIcon className=\"h-4 w-4\" />\n </button>\n </div>\n );\n}\n\nfunction ListMessage({ children }: { children: ReactNode }) {\n return (\n <div className=\"flex items-center justify-center gap-2 py-8 text-[13px] text-muted-foreground\">\n {children}\n </div>\n );\n}\n","// react/components/UniversalAssociationPicker.tsx — @ai-matrx/associations/react\n//\n// ONE search box over EVERY listable entity type — \"attach anything from\n// anywhere\". Type a name and results from all tokens stream in, grouped with\n// registry icons; click to attach/detach. An optional token chip rail narrows\n// to per-token browsing.\n//\n// Ported from matrx-frontend\n// `features/scopes/components/associations/UniversalAssociationPicker.tsx`\n// (W4, 2026-08-29) with the seams inverted:\n// • `EntityDoorControls` → the `DoorControlsSlot` (host port when bound,\n// otherwise the package's shipped hrefFor anchor — 0.6.0, C23) (absent →\n// the row renders without doors — title + toggle only, per the design's\n// degradation table);\n// • `@/lib/toast` → the notifier port;\n// • the file-token browse special case → the pickerOverrides port: a token\n// with a registered override opens that override (windowed) instead of an\n// inline generic list, preserving \"file enumeration only happens through\n// the canonical picker\".\n//\n// THE DOOR LAW, picker flavour: every candidate carries its doors as SIBLINGS\n// of the attach/detach toggle (an <a> inside a <button> is invalid DOM).\n\nimport { useState } from \"react\";\nimport { cn, Input } from \"@ai-matrx/design-system\";\n\nimport type { EntityTypeToken } from \"../../entity-types.generated\";\nimport type { UniversalCandidate } from \"../../core/candidates\";\nimport { useAssociationsStore, useAssociationsUiPorts, useNotifier } from \"../context\";\nimport { useUniversalEntitySearch } from \"../hooks/useUniversalEntitySearch\";\nimport {\n CheckIcon,\n DefaultEntityIcon,\n PlusIcon,\n SearchIcon,\n SpinnerIcon,\n} from \"../icons\";\nimport { AssociationCandidateBody } from \"./AssociationPicker\";\nimport { DoorControlsSlot } from \"./entityDoors\";\n\nexport interface UniversalAssociationPickerProps {\n /** Tokens offered. Defaults to every listable token. */\n tokens?: EntityTypeToken[];\n /** Ids already attached, keyed `${token}:${id}` — rendered as attached. */\n attachedKeys: Set<string>;\n onAttach: (\n token: EntityTypeToken,\n resourceId: string,\n title: string,\n ) => Promise<{ ok: boolean; error?: string }>;\n onDetach: (\n token: EntityTypeToken,\n resourceId: string,\n ) => Promise<{ ok: boolean; error?: string }>;\n /** Owner filter for candidate reads (defaults to RLS-only). */\n ownerId?: string | null;\n /** Org stamped onto rows created via the per-token \"+ New\" footer. */\n orgId?: string | null;\n className?: string;\n}\n\nexport function attachedKey(token: string, id: string): string {\n return `${token}:${id}`;\n}\n\nexport function UniversalAssociationPicker(\n props: UniversalAssociationPickerProps,\n) {\n const { attachedKeys, onAttach, onDetach, ownerId, orgId, className } = props;\n const store = useAssociationsStore();\n const { pickerOverrides } = useAssociationsUiPorts();\n const notifier = useNotifier();\n const tokens = props.tokens ?? store.registry.listableTokens();\n const [query, setQuery] = useState(\"\");\n const [browseToken, setBrowseToken] = useState<EntityTypeToken | null>(null);\n const [busyKey, setBusyKey] = useState<string | null>(null);\n\n const { results, loading, isRecents } = useUniversalEntitySearch({\n query,\n tokens,\n ownerId: ownerId ?? null,\n enabled: browseToken === null,\n });\n\n\n const toggle = async (c: UniversalCandidate) => {\n const key = attachedKey(c.token, c.id);\n if (busyKey) return;\n setBusyKey(key);\n try {\n const attached = attachedKeys.has(key);\n const res = attached\n ? await onDetach(c.token, c.id)\n : await onAttach(c.token, c.id, c.title);\n // A silent no-op attach is the bug class this scream kills.\n if (!res.ok) {\n notifier.error(\n `Couldn't ${attached ? \"detach\" : \"attach\"} \"${c.title}\"` +\n (res.error ? `: ${res.error}` : \"\"),\n );\n }\n } finally {\n setBusyKey(null);\n }\n };\n\n // Group hits by token for section headers (registry icon + plural).\n const groups = new Map<EntityTypeToken, UniversalCandidate[]>();\n for (const r of results) {\n const list = groups.get(r.token) ?? [];\n list.push(r);\n groups.set(r.token, list);\n }\n\n const BrowseOverride = browseToken ? pickerOverrides?.[browseToken] : undefined;\n\n return (\n <div className={cn(\"flex min-h-0 flex-1 flex-col gap-2\", className)}>\n {/* ── search ──────────────────────────────────────────────────── */}\n <div className=\"relative\">\n <SearchIcon className=\"absolute left-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground\" />\n <Input\n value={query}\n onChange={(e) => {\n setQuery(e.target.value);\n if (browseToken) setBrowseToken(null);\n }}\n placeholder=\"Search everything…\"\n className=\"pl-8 text-base\"\n style={{ fontSize: 16 }}\n />\n {loading && browseToken === null && (\n <SpinnerIcon className=\"absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 animate-spin text-muted-foreground\" />\n )}\n </div>\n\n {/* ── token chip rail (narrow to per-token browse) ─────────────── */}\n <div className=\"flex flex-wrap gap-1\">\n {tokens.map((t) => {\n const info = store.registry.getEntityInfo(t);\n const ChipIcon = info.Icon ?? DefaultEntityIcon;\n const active = browseToken === t;\n return (\n <button\n key={t}\n type=\"button\"\n onClick={() => setBrowseToken(active ? null : t)}\n className={cn(\n \"inline-flex items-center gap-1 rounded-md border px-1.5 py-0.5 text-[11px] transition-colors\",\n active\n ? \"border-primary/50 bg-primary/10 text-foreground\"\n : \"border-border text-muted-foreground hover:text-foreground hover:bg-accent\",\n )}\n >\n <ChipIcon className=\"h-3 w-3\" />\n {info.labelPlural}\n </button>\n );\n })}\n </div>\n\n {/* ── results ──────────────────────────────────────────────────── */}\n {browseToken && BrowseOverride ? (\n // The token's canonical host picker (e.g. the stored-files browser)\n // owns per-token browsing when registered — never a plain list twin.\n <BrowseOverride\n open\n onOpenChange={(open) => {\n if (!open) setBrowseToken(null);\n }}\n token={browseToken}\n orgId={orgId ?? null}\n attachedIds={\n new Set(\n [...attachedKeys]\n .filter((k) => k.startsWith(`${browseToken}:`))\n .map((k) => k.slice(browseToken.length + 1)),\n )\n }\n onAttach={(id, title) => onAttach(browseToken, id, title)}\n onDetach={(id) => onDetach(browseToken, id)}\n />\n ) : browseToken ? (\n <div className=\"flex min-h-0 flex-1 flex-col\">\n <AssociationCandidateBody\n token={browseToken}\n enabled\n orgId={orgId}\n onClose={() => setBrowseToken(null)}\n attachedIds={\n new Set(\n [...attachedKeys]\n .filter((k) => k.startsWith(`${browseToken}:`))\n .map((k) => k.slice(browseToken.length + 1)),\n )\n }\n onAttach={(id, title) => onAttach(browseToken, id, title)}\n onDetach={(id) => onDetach(browseToken, id)}\n />\n </div>\n ) : (\n <div className=\"-mx-1 min-h-0 flex-1 overflow-y-auto px-1\">\n {results.length === 0 ? (\n <p className=\"py-6 text-center text-[12px] text-muted-foreground\">\n {loading\n ? \"Searching…\"\n : query.trim()\n ? \"No matches — narrow with a type chip to browse.\"\n : \"No recent items. Type to search, or pick a type to browse.\"}\n </p>\n ) : (\n <div className=\"space-y-2\">\n {isRecents && (\n <p className=\"px-1 text-[10px] font-medium uppercase tracking-wider text-muted-foreground/60\">\n Recent\n </p>\n )}\n {[...groups.entries()].map(([token, items]) => {\n const info = store.registry.getEntityInfo(token);\n const GroupIcon = info.Icon ?? DefaultEntityIcon;\n return (\n <div key={token} className=\"space-y-0.5\">\n <p className=\"flex items-center gap-1 px-1 text-[10px] font-medium uppercase tracking-wider text-muted-foreground/70\">\n <GroupIcon className=\"h-3 w-3\" />\n {info.labelPlural}\n </p>\n <ul className=\"space-y-0.5\">\n {items.map((c) => {\n const key = attachedKey(c.token, c.id);\n const attached = attachedKeys.has(key);\n const busy = busyKey === key;\n return (\n <li\n key={key}\n className={cn(\n \"group/entity-ref group flex items-center gap-1 rounded-md pr-1.5 transition-colors\",\n \"hover:bg-accent\",\n attached && \"bg-accent/40\",\n )}\n >\n <button\n type=\"button\"\n disabled={busy}\n onClick={() => toggle(c)}\n title={\n attached\n ? `Detach \"${c.title}\"`\n : `Attach \"${c.title}\"`\n }\n className={cn(\n \"flex min-w-0 flex-1 items-center gap-2 rounded-md px-2.5 py-1.5 text-left text-sm\",\n \"disabled:opacity-50\",\n )}\n >\n <span className=\"min-w-0 flex-1 truncate text-foreground\">\n {c.title}\n </span>\n <span\n className={cn(\n \"flex h-5 w-5 shrink-0 items-center justify-center rounded-full\",\n attached\n ? \"bg-primary text-primary-foreground\"\n : \"border border-border text-muted-foreground group-hover:border-primary/60\",\n )}\n >\n {busy ? (\n <SpinnerIcon className=\"h-3 w-3 animate-spin\" />\n ) : attached ? (\n <CheckIcon className=\"h-3 w-3\" />\n ) : (\n <PlusIcon className=\"h-3 w-3\" />\n )}\n </span>\n </button>\n {/* Sibling of the toggle, never a child — an\n anchor inside a button is invalid DOM. */}\n <DoorControlsSlot\n token={c.token}\n id={c.id}\n name={c.title}\n />\n </li>\n );\n })}\n </ul>\n </div>\n );\n })}\n </div>\n )}\n </div>\n )}\n </div>\n );\n}\n\nexport default UniversalAssociationPicker;\n","// react/components/entityDoors.tsx — @ai-matrx/associations/react\n//\n// The entity-doors seam, resolved with its documented degradations (design\n// Decision 2 table):\n//\n// • `EntityRef` bound → the host's full door primitive (open / new tab /\n// peek) renders the name;\n// • absent → title text, wrapped in the overlay's `hrefFor` link when the\n// registry has one (real `target=\"_blank\"` anchor — middle-click works),\n// plain text otherwise (a link-styled title can never no-op);\n// • `UnresolvedRef` bound → the host's access-gate chip for a target the\n// viewer cannot read; absent → the package's plain \"unavailable\" chip;\n// • `DoorControls` bound → the host's open/new-tab/peek control cluster;\n// absent → the package's SHIPPED default (0.6.0, C23): a real, keyboard\n// reachable, labelled `target=\"_blank\"` anchor built from the registry\n// overlay's `hrefFor`. A token with no registered route renders nothing —\n// honest absence, never a control that goes nowhere.\n\nimport type { ComponentType } from \"react\";\nimport { cn } from \"@ai-matrx/design-system\";\n\nimport type { EntityDoorProps, EntityRefProps } from \"../../ports\";\nimport { useAssociationsStore, useAssociationsUiPorts } from \"../context\";\nimport { ExternalLinkIcon } from \"../icons\";\n\nexport interface DoorRefExtras {\n /** Container-owned opener — wins over hrefFor when the host EntityRef is absent. */\n onOpen?: (() => void) | undefined;\n}\n\n/**\n * Render an entity's NAME with its doors, degrading per the port table.\n * The host `EntityRef` receives the measured prop subset when bound.\n */\nexport function DoorRef(props: EntityRefProps & DoorRefExtras) {\n const { onOpen, ...refProps } = props;\n const { entityDoors } = useAssociationsUiPorts();\n const store = useAssociationsStore();\n\n const HostRef: ComponentType<EntityRefProps> | undefined =\n entityDoors?.EntityRef;\n if (HostRef) return <HostRef {...refProps} />;\n\n const name = refProps.name ?? null;\n const href =\n store.registry.tryGetEntityInfo(refProps.token)?.hrefFor?.(refProps.id) ??\n null;\n\n if (onOpen) {\n return (\n <button\n type=\"button\"\n onClick={onOpen}\n className={cn(\n \"min-w-0 truncate text-left underline-offset-2 hover:underline\",\n refProps.className,\n )}\n >\n {name}\n </button>\n );\n }\n if (href) {\n return (\n <a\n href={href}\n target={refProps.openInNewTab === false ? undefined : \"_blank\"}\n rel=\"noopener noreferrer\"\n className={cn(\n \"inline-flex min-w-0 items-center gap-1 truncate underline-offset-2 hover:underline\",\n refProps.className,\n )}\n >\n <span className=\"min-w-0 truncate\">{name}</span>\n <ExternalLinkIcon className=\"h-3 w-3 shrink-0 opacity-0 transition-opacity group-hover:opacity-60\" />\n </a>\n );\n }\n return (\n <span className={cn(\"min-w-0 truncate\", refProps.className)}>{name}</span>\n );\n}\n\n/** The unresolved-target chip, host-supplied or the package's plain one. */\nexport function UnresolvedRef({ token, id }: { token: string; id: string }) {\n const { entityDoors } = useAssociationsUiPorts();\n const HostUnresolved = entityDoors?.UnresolvedRef;\n if (HostUnresolved) return <HostUnresolved token={token} id={id} />;\n return (\n <span\n className=\"inline-flex items-center rounded border border-border/60 bg-muted/40 px-1.5 py-0.5 text-[11px] text-muted-foreground\"\n title={`This ${token} could not be read — it may be deleted or not shared with you.`}\n >\n Unavailable\n </span>\n );\n}\n\n/**\n * The door-control cluster, host-supplied or the package default. Every face\n * renders doors through THIS slot — never `entityDoors?.DoorControls` — so\n * the default reaches all of them at once.\n */\nexport function DoorControlsSlot(props: EntityDoorProps) {\n const { entityDoors } = useAssociationsUiPorts();\n const store = useAssociationsStore();\n\n const HostControls = entityDoors?.DoorControls;\n if (HostControls) return <HostControls {...props} />;\n\n const href =\n store.registry.tryGetEntityInfo(props.token)?.hrefFor?.(props.id) ?? null;\n // No route registered for this token: there IS no door, so we render\n // none. A visible control that cannot open anything is the dead-end bug.\n if (!href) return null;\n\n const label = props.name ? `Open ${props.name}` : `Open this ${props.token}`;\n return (\n <a\n href={href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n aria-label={label}\n title={label}\n className={cn(\n \"inline-flex h-5 w-5 shrink-0 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-accent hover:text-foreground\",\n props.className,\n )}\n >\n <ExternalLinkIcon className=\"h-3 w-3\" />\n </a>\n );\n}\n","// react/components/AttachedItemsSheet.tsx — @ai-matrx/associations/react\n//\n// \"What is actually attached here?\" — the drill-in behind every\n// AssociationCard count. Titles are resolved LIVE through the store's title\n// service rather than read off the association edge's stored label: the edge\n// label is a snapshot from attach time and goes stale the moment the target\n// is renamed (and many existing edges have no label at all). Ids the viewer\n// cannot read are omitted by the RPC, so they resolve through the entityDoors\n// port's `UnresolvedRef` (host access gate) — or the package's plain\n// \"unavailable\" chip when the port is absent.\n//\n// Ported from matrx-frontend\n// `features/scopes/components/associations/AttachedItemsSheet.tsx` (W4,\n// 2026-08-29) with the seams inverted: `EntityRef`/access-gate → entityDoors\n// port, `@/lib/toast` → notifier port, `fetchEntityTitles` → the store's\n// titles service, WindowPanel → the AssociationWindow shell (windowShell\n// port with fixed-overlay fallback).\n\nimport { useEffect, useState } from \"react\";\nimport { cn } from \"@ai-matrx/design-system\";\n\nimport type { EntityTypeToken } from \"../../entity-types.generated\";\nimport { useAssociationsStore, useNotifier } from \"../context\";\nimport type { ContainerLink } from \"../hooks/useContainerLinks\";\nimport {\n DefaultEntityIcon,\n PinIcon,\n PlusIcon,\n SpinnerIcon,\n XIcon,\n} from \"../icons\";\nimport { AssociationWindow } from \"./AssociationWindow\";\nimport { DoorRef, UnresolvedRef } from \"./entityDoors\";\nimport type { PrimaryEntity } from \"./PrimaryEntityContext\";\n\nfunction metadataIsPinned(metadata: unknown): boolean {\n return (\n metadata !== null &&\n typeof metadata === \"object\" &&\n !Array.isArray(metadata) &&\n Reflect.get(metadata, \"pinned\") === true\n );\n}\n\nexport interface AttachedItemsSheetProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n token: EntityTypeToken;\n containerLabel?: string;\n /**\n * The container these items are attached to. When given, the \"Attached to X\"\n * line puts a door on X — this window can outlive the page it was opened\n * from, so its container reference must be reachable.\n */\n container?: PrimaryEntity;\n links: ContainerLink[];\n /** Opens the attach picker. Omitted when the token cannot list candidates. */\n onAdd?: () => void;\n onDetach: (\n resourceId: string,\n role?: string | null,\n ) => Promise<{ ok: boolean; error?: string }>;\n /** Toggle metadata.pinned on this exact role-qualified edge. */\n onSetPinned?: (\n resourceId: string,\n pinned: boolean,\n role?: string | null,\n ) => Promise<{ ok: boolean; error?: string }>;\n}\n\nexport function AttachedItemsSheet(props: AttachedItemsSheetProps) {\n const store = useAssociationsStore();\n const info = store.registry.getEntityInfo(props.token);\n const Icon = info.Icon ?? DefaultEntityIcon;\n\n const title = info.labelPlural;\n const containerName = props.container?.label ?? props.containerLabel;\n const subtitle = props.container ? (\n <span className=\"inline-flex min-w-0 max-w-full items-center gap-1\">\n Attached to\n <DoorRef\n token={props.container.type}\n id={props.container.id}\n name={containerName ?? null}\n alwaysShowActions\n />\n </span>\n ) : props.containerLabel ? (\n `Attached to ${props.containerLabel}`\n ) : (\n \"Attached items\"\n );\n\n // Gated on `open` so host window chunks only load on first use.\n if (!props.open) return null;\n return (\n <AssociationWindow\n open={props.open}\n onClose={() => props.onOpenChange(false)}\n scopeId={`attached:${props.token}`}\n title={title}\n icon={<Icon className=\"size-3.5 text-primary\" />}\n subtitle={subtitle}\n >\n <AttachedItemsBody\n token={props.token}\n enabled={props.open}\n links={props.links}\n {...(props.onAdd ? { onAdd: props.onAdd } : {})}\n onDetach={props.onDetach}\n {...(props.onSetPinned ? { onSetPinned: props.onSetPinned } : {})}\n />\n </AssociationWindow>\n );\n}\n\nfunction AttachedItemsBody({\n token,\n enabled,\n links,\n onAdd,\n onDetach,\n onSetPinned,\n}: {\n token: EntityTypeToken;\n enabled: boolean;\n links: ContainerLink[];\n onAdd?: () => void;\n onDetach: (\n resourceId: string,\n role?: string | null,\n ) => Promise<{ ok: boolean; error?: string }>;\n onSetPinned?: (\n resourceId: string,\n pinned: boolean,\n role?: string | null,\n ) => Promise<{ ok: boolean; error?: string }>;\n}) {\n const store = useAssociationsStore();\n const notifier = useNotifier();\n const info = store.registry.getEntityInfo(token);\n const Icon = info.Icon ?? DefaultEntityIcon;\n const [titles, setTitles] = useState<Map<string, string | null> | null>(null);\n const [titleError, setTitleError] = useState<string | null>(null);\n const [busyId, setBusyId] = useState<string | null>(null);\n\n const idKey = links\n .map((l) => l.resourceId)\n .sort()\n .join(\",\");\n\n useEffect(() => {\n if (!enabled) return;\n const ids = idKey ? idKey.split(\",\") : [];\n if (ids.length === 0) {\n setTitles(new Map());\n return;\n }\n let cancelled = false;\n void (async () => {\n try {\n const resolved = await store.titles.fetch(token, ids);\n if (!cancelled) {\n setTitles(resolved);\n setTitleError(null);\n }\n } catch (cause) {\n if (cancelled) return;\n // Loud, not silent: falling back to stored edge labels is a degraded\n // mode and the user should know the names may be stale.\n store.errorSink({\n code: \"title_resolution_failed\",\n message: \"[AttachedItemsSheet] title resolution failed\",\n context: { token, detail: cause },\n });\n setTitles(new Map());\n setTitleError(\n cause instanceof Error ? cause.message : \"Could not resolve names\",\n );\n }\n })();\n return () => {\n cancelled = true;\n };\n }, [token, idKey, enabled, store]);\n\n const detach = async (link: ContainerLink) => {\n const resourceId = link.resourceId;\n if (busyId) return;\n setBusyId(resourceId);\n try {\n const res = await onDetach(resourceId, link.role);\n // A silent no-op detach reads as \"removed\" — scream instead.\n if (!res.ok) {\n notifier.error(`Couldn't detach${res.error ? `: ${res.error}` : \"\"}`);\n }\n } finally {\n setBusyId(null);\n }\n };\n\n const setPinned = async (link: ContainerLink, pinned: boolean) => {\n if (!onSetPinned || busyId) return;\n setBusyId(link.resourceId);\n try {\n const res = await onSetPinned(link.resourceId, pinned, link.role);\n if (!res.ok) {\n notifier.error(\n `Couldn't ${pinned ? \"pin\" : \"unpin\"}${res.error ? `: ${res.error}` : \"\"}`,\n );\n }\n } finally {\n setBusyId(null);\n }\n };\n\n return (\n <>\n {titleError ? (\n <div className=\"mb-2 rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-[12px] text-destructive\">\n Showing names recorded at attach time — they may be out of date.{\" \"}\n {titleError}\n </div>\n ) : null}\n\n <div className=\"flex-1 min-h-0 overflow-y-auto -mx-1 px-1\">\n {links.length === 0 ? (\n <div className=\"flex items-center justify-center py-8 text-[13px] text-muted-foreground\">\n Nothing attached yet.\n </div>\n ) : titles === null ? (\n <div className=\"flex items-center justify-center gap-2 py-8 text-[13px] text-muted-foreground\">\n <SpinnerIcon className=\"h-4 w-4 animate-spin\" />\n Loading…\n </div>\n ) : (\n <ul className=\"space-y-0.5\">\n {links.map((link) => {\n const resolved = titles.get(link.resourceId);\n const missing = !titles.has(link.resourceId);\n const name =\n resolved ?? link.label ?? (missing ? null : \"Untitled\");\n const busy = busyId === link.resourceId;\n const pinned = metadataIsPinned(link.metadata);\n\n return (\n <li\n key={link.edgeId}\n className=\"group/entity-ref group flex items-center gap-2 rounded-md px-2.5 py-2 text-sm transition-colors hover:bg-accent\"\n >\n <Icon className=\"h-4 w-4 shrink-0 text-muted-foreground\" />\n <span className=\"flex-1 min-w-0 truncate\">\n {name === null ? (\n // The X beside the row stays the one-click detach.\n <UnresolvedRef token={token} id={link.resourceId} />\n ) : (\n <DoorRef\n token={token}\n id={link.resourceId}\n name={name}\n showIcon={false}\n className=\"text-foreground\"\n />\n )}\n </span>\n {onSetPinned ? (\n <button\n type=\"button\"\n disabled={busy}\n onClick={() => void setPinned(link, !pinned)}\n title={\n pinned\n ? \"Unpin (stops staying in agent context)\"\n : \"Pin — always in agent context\"\n }\n aria-label={pinned ? \"Unpin\" : \"Pin\"}\n className={cn(\n \"flex h-6 w-6 shrink-0 items-center justify-center rounded-md transition-colors hover:bg-accent hover:text-foreground disabled:opacity-50\",\n pinned ? \"text-primary\" : \"text-muted-foreground\",\n )}\n >\n <PinIcon\n className={cn(\n \"h-3.5 w-3.5\",\n pinned && \"fill-primary/20\",\n )}\n />\n </button>\n ) : null}\n <button\n type=\"button\"\n disabled={busy}\n onClick={() => void detach(link)}\n title=\"Detach\"\n className={cn(\n \"flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors\",\n \"hover:bg-destructive/10 hover:text-destructive disabled:opacity-50\",\n )}\n >\n {busy ? (\n <SpinnerIcon className=\"h-3.5 w-3.5 animate-spin\" />\n ) : (\n <XIcon className=\"h-3.5 w-3.5\" />\n )}\n </button>\n </li>\n );\n })}\n </ul>\n )}\n </div>\n\n {onAdd ? (\n <button\n type=\"button\"\n onClick={onAdd}\n className=\"mt-2 flex w-full items-center justify-center gap-1.5 rounded-md border border-border px-3 py-2 text-sm text-muted-foreground transition-colors hover:border-primary/60 hover:text-foreground\"\n >\n <PlusIcon className=\"h-4 w-4\" />\n Attach {info.labelPlural.toLowerCase()}\n </button>\n ) : null}\n </>\n );\n}\n\nexport default AttachedItemsSheet;\n","// react/components/AssociationCard.tsx — @ai-matrx/associations/react\n//\n// THE canonical, reusable association card. Drop it on any surface that has a\n// PrimaryEntityProvider (or pass `container` explicitly) and hand it a single\n// secondary-entity TOKEN:\n//\n// <AssociationCard token=\"task\" />\n//\n// It resolves the icon + label from the entity registry (nothing hardcoded),\n// shows a LIVE count of how many of that entity are attached to the primary\n// (container) entity, and a plus button that opens the picker. ALL logic\n// lives in hooks/services — this is pure presentation wiring over\n// `useContainerLinks` + `AssociationPicker`.\n//\n// Ported verbatim from matrx-frontend\n// `features/scopes/components/associations/AssociationCard.tsx` (W4,\n// 2026-08-29); registry module → the store registry, lucide → package\n// glyphs, the missing-container console.error → the errorSink.\n\nimport { useState } from \"react\";\nimport { cn } from \"@ai-matrx/design-system\";\n\nimport type { EntityTypeToken } from \"../../entity-types.generated\";\nimport { useAssociationsStore } from \"../context\";\nimport { useContainerLinks } from \"../hooks/useContainerLinks\";\nimport { getContentRoleMeta } from \"../contentRoles\";\nimport { DefaultEntityIcon, PlusIcon, SpinnerIcon } from \"../icons\";\nimport { AssociationPicker } from \"./AssociationPicker\";\nimport { AttachedItemsSheet } from \"./AttachedItemsSheet\";\nimport { usePrimaryEntity, type PrimaryEntity } from \"./PrimaryEntityContext\";\n\nexport interface AssociationCardProps {\n /** The secondary entity kind this card manages (e.g. \"task\", \"file\"). */\n token: EntityTypeToken;\n /** Override the page's primary entity. Defaults to PrimaryEntityProvider. */\n container?: PrimaryEntity;\n className?: string;\n}\n\nexport function AssociationCard({\n token,\n container: containerProp,\n className,\n}: AssociationCardProps) {\n const store = useAssociationsStore();\n const fromCtx = usePrimaryEntity();\n const container = containerProp ?? fromCtx;\n const [open, setOpen] = useState(false);\n\n const info = store.registry.getEntityInfo(token);\n const role = getContentRoleMeta(info.contentRole);\n const Icon = info.Icon ?? DefaultEntityIcon;\n\n const [listOpen, setListOpen] = useState(false);\n\n const {\n status,\n countFor,\n attachedIdsFor,\n linksFor,\n attach,\n detach,\n setPinned,\n } =\n useContainerLinks({\n containerType: container?.type ?? \"organization\",\n containerId: container?.id ?? null,\n orgId: container?.orgId ?? null,\n });\n\n // No container in scope → render nothing rather than guess.\n if (!container) {\n store.errorSink({\n code: \"association_card_no_container\",\n message:\n `[AssociationCard] no primary entity for token \"${token}\" — wrap in ` +\n `<PrimaryEntityProvider> or pass a container prop`,\n context: { token },\n });\n return null;\n }\n\n const count = countFor(token);\n const loading = status === \"loading\" || status === \"idle\";\n const canAttach = info.canListCandidates;\n\n // The count is only useful if you can find out WHICH ones. The card body\n // drills into the attached list; the \"+\" stays a direct shortcut to attach.\n const canDrillIn = count > 0;\n\n return (\n <>\n <div\n className={cn(\n \"group relative flex items-center gap-3 overflow-hidden rounded-xl border border-border bg-card transition-all hover:border-primary/30 hover:bg-accent/40\",\n className,\n )}\n >\n {/* role accent bar — same categorical language as the resource tiles */}\n <span\n className={cn(\n \"absolute inset-x-0 top-0 h-0.5 opacity-60\",\n role.accentBar,\n )}\n />\n\n <button\n type=\"button\"\n disabled={!canDrillIn}\n onClick={() => setListOpen(true)}\n title={\n canDrillIn\n ? `View the ${info.labelPlural.toLowerCase()} attached to ${container.label ?? \"this\"}`\n : undefined\n }\n className={cn(\n \"flex min-w-0 flex-1 items-center gap-3 px-3 py-2.5 text-left\",\n canDrillIn ? \"cursor-pointer\" : \"cursor-default\",\n )}\n >\n <span\n className={cn(\n \"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg\",\n role.accentBg,\n role.accentText,\n )}\n >\n <Icon className=\"h-4 w-4\" />\n </span>\n\n <span className=\"min-w-0 flex-1\">\n <span className=\"block truncate text-sm font-medium text-foreground\">\n {info.labelPlural}\n </span>\n <span className=\"block text-[11px] text-muted-foreground tabular-nums\">\n {loading ? (\n <span className=\"inline-flex items-center gap-1\">\n <SpinnerIcon className=\"h-3 w-3 animate-spin\" />\n Loading…\n </span>\n ) : (\n `${count} attached`\n )}\n </span>\n </span>\n </button>\n\n {canAttach && (\n <button\n type=\"button\"\n onClick={() => setOpen(true)}\n aria-label={`Attach ${info.labelPlural.toLowerCase()}`}\n title={`Attach ${info.labelPlural.toLowerCase()}`}\n className=\"mr-2 flex h-11 w-11 shrink-0 items-center justify-center rounded-md border border-border text-muted-foreground transition-colors hover:border-primary/60 hover:text-foreground lg:mr-3 lg:h-7 lg:w-7\"\n >\n <PlusIcon className=\"h-4 w-4\" />\n </button>\n )}\n </div>\n\n {/* Mount while open (not while canDrillIn) — detaching the last item\n must leave the surface up showing \"Nothing attached yet\", never\n yank the window out from under the user. */}\n {listOpen && (\n <AttachedItemsSheet\n open={listOpen}\n onOpenChange={setListOpen}\n token={token}\n {...(container.label !== undefined\n ? { containerLabel: container.label }\n : {})}\n container={container}\n links={linksFor(token)}\n {...(canAttach\n ? {\n onAdd: () => {\n setListOpen(false);\n setOpen(true);\n },\n }\n : {})}\n onDetach={(resourceId, role) =>\n detach(token, resourceId, role ?? undefined)\n }\n onSetPinned={(resourceId, pinned, role) =>\n setPinned(token, resourceId, pinned, role ?? undefined)\n }\n />\n )}\n\n {canAttach && (\n <AssociationPicker\n open={open}\n onOpenChange={setOpen}\n token={token}\n {...(container.label !== undefined\n ? { containerLabel: container.label }\n : {})}\n orgId={container.orgId ?? null}\n attachedIds={attachedIdsFor(token)}\n onAttach={(resourceId, title) => attach(token, resourceId, title)}\n onDetach={(resourceId) => detach(token, resourceId)}\n />\n )}\n </>\n );\n}\n\nexport default AssociationCard;\n","// react/contentRoles.ts — @ai-matrx/associations/react\n//\n// Display metadata for the content-role buckets — ported verbatim from\n// matrx-frontend `features/scopes/registry/entityRegistry.ts` (W4,\n// 2026-08-29). The ROLE ids and the per-entity classification live in /core\n// (`platform.entity_types.content_role` is the only authority); titles,\n// taglines, and the categorical accent classes are chrome, so they live in\n// /react. ONE visual language for \"what kind of thing is this\" across every\n// association surface.\n\nimport type { ContentRole } from \"../core/registry\";\n\nexport interface ContentRoleMeta {\n id: ContentRole;\n /** Section heading. */\n title: string;\n /** One-line \"what is this bucket\". */\n tagline: string;\n /** Categorical accent classes (tint only — surfaces stay semantic). */\n accentText: string;\n accentBg: string;\n accentBar: string;\n}\n\n/** Ordered for display: capability, data-in, data-out, both, structure. */\nexport const CONTENT_ROLES: ContentRoleMeta[] = [\n {\n id: \"utility\",\n title: \"Utilities\",\n tagline: \"The agents and tools that act on your knowledge.\",\n accentText: \"text-violet-600 dark:text-violet-400\",\n accentBg: \"bg-violet-500/10\",\n accentBar: \"bg-violet-500\",\n },\n {\n id: \"source\",\n title: \"Sources\",\n tagline: \"Incoming sources of truth (Knowledge In).\",\n accentText: \"text-sky-600 dark:text-sky-400\",\n accentBg: \"bg-sky-500/10\",\n accentBar: \"bg-sky-500\",\n },\n {\n id: \"destination\",\n title: \"Outputs\",\n tagline: \"Knowledge your team produces.\",\n accentText: \"text-emerald-600 dark:text-emerald-400\",\n accentBg: \"bg-emerald-500/10\",\n accentBar: \"bg-emerald-500\",\n },\n {\n id: \"hybrid\",\n title: \"Sources & Outputs\",\n tagline: \"Read from and written to.\",\n accentText: \"text-teal-600 dark:text-teal-400\",\n accentBg: \"bg-teal-500/10\",\n accentBar: \"bg-gradient-to-r from-sky-500 to-emerald-500\",\n },\n {\n id: \"container\",\n title: \"Workspaces\",\n tagline: \"How work is organized.\",\n accentText: \"text-amber-600 dark:text-amber-400\",\n accentBg: \"bg-amber-500/10\",\n accentBar: \"bg-amber-500\",\n },\n];\n\nexport function getContentRoleMeta(role: ContentRole): ContentRoleMeta {\n return (\n CONTENT_ROLES.find((r) => r.id === role) ?? (CONTENT_ROLES[2] as ContentRoleMeta)\n );\n}\n","// react/components/AssociationCardGrid.tsx — @ai-matrx/associations/react\n//\n// THE canonical \"everything attached to this container\" surface. Drop it under\n// a PrimaryEntityProvider and it renders one AssociationCard per cardable\n// entity token — fully registry-driven, ZERO per-page hardcoding:\n//\n// <PrimaryEntityProvider value={{ type: \"organization\", id, orgId, label }}>\n// <AssociationCardGrid />\n// </PrimaryEntityProvider>\n//\n// By default it lists EVERY token the registry can list candidates for (the\n// `curatedTokens()` set), GROUPED BY CONTENT ROLE with the same categorical\n// accent colors every association surface uses. Every card shares ONE\n// association fetch for the container (the store cache dedupes), so the whole\n// grid is a single round-trip.\n//\n// Ported verbatim from matrx-frontend\n// `features/scopes/components/associations/AssociationCardGrid.tsx` (W4,\n// 2026-08-29); registry module → the store registry.\n\nimport { cn } from \"@ai-matrx/design-system\";\n\nimport type { EntityTypeToken } from \"../../entity-types.generated\";\nimport { useAssociationsStore } from \"../context\";\nimport { CONTENT_ROLES } from \"../contentRoles\";\nimport { AssociationCard } from \"./AssociationCard\";\n\nexport interface AssociationCardGridProps {\n /** Tokens to show. Defaults to every registry-listable token. */\n tokens?: EntityTypeToken[];\n /** Registry tokens this surface cannot honestly support yet. */\n excludeTokens?: EntityTypeToken[];\n className?: string;\n}\n\nexport function AssociationCardGrid({\n tokens,\n excludeTokens,\n className,\n}: AssociationCardGridProps) {\n const store = useAssociationsStore();\n const excluded = new Set(excludeTokens ?? []);\n const list = (tokens ?? store.registry.curatedTokens()).filter(\n (token) => !excluded.has(token),\n );\n\n return (\n <div className={cn(\"space-y-5\", className)}>\n {CONTENT_ROLES.map((role) => {\n const inRole = list.filter(\n (token) => store.registry.getEntityInfo(token).contentRole === role.id,\n );\n if (inRole.length === 0) return null;\n\n return (\n <section key={role.id}>\n <div className=\"mb-2.5 flex items-baseline gap-3 pl-1.5\">\n <div className=\"flex items-center gap-2\">\n <span\n className={cn(\"h-2.5 w-2.5 rounded-full\", role.accentBar)}\n />\n <h3 className=\"text-sm font-semibold text-foreground\">\n {role.title}\n </h3>\n </div>\n <p className=\"hidden text-xs text-muted-foreground sm:block\">\n {role.tagline}\n </p>\n </div>\n\n <div className=\"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3\">\n {inRole.map((token) => (\n <AssociationCard key={token} token={token} />\n ))}\n </div>\n </section>\n );\n })}\n </div>\n );\n}\n\nexport default AssociationCardGrid;\n","// react/components/AssociationList.tsx — @ai-matrx/associations/react\n//\n// THE row-mode face of the container-contents system — the sibling of\n// `AssociationCardGrid` (count cards). Drop it under a `PrimaryEntityProvider`\n// (or pass `container`) and it renders EVERYTHING attached to the container as\n// grouped rows — content-role sections → token groups → title rows with open +\n// detach — plus a universal search-attach header and a per-token \"+\" picker.\n//\n// Fully registry-driven and ADAPTER-PLUGGABLE: reads/writes default to\n// `useContainerLinks` (org/scope/project pages), but a container with its own\n// write semantics (war-room threads: single-active demotion, position, host\n// bucket) supplies a `ContainerResourcesAdapter` and the UI stays identical.\n//\n// Titles are never UUIDs: edge label → batched title fetch → \"Untitled <type>\".\n//\n// Ported from matrx-frontend\n// `features/scopes/components/associations/AssociationList.tsx` (W4,\n// 2026-08-29) with the seams inverted: `EntityRef` → the entityDoors port\n// (degrading to hrefFor anchor / plain text), registry module → the store\n// registry, host Skeleton → design-system Skeleton, lucide → package glyphs.\n\nimport { useState, type ReactNode } from \"react\";\nimport { cn, Skeleton } from \"@ai-matrx/design-system\";\n\nimport type { EntityTypeToken } from \"../../entity-types.generated\";\nimport type { ContentRole, EntityInfo } from \"../../core/registry\";\nimport { useAssociationsStore, useNotifier } from \"../context\";\nimport { useContainerLinks } from \"../hooks/useContainerLinks\";\nimport { useEntityTitles } from \"../hooks/useEntityTitles\";\nimport { CONTENT_ROLES, getContentRoleMeta } from \"../contentRoles\";\nimport {\n Link2Icon,\n PinIcon,\n PlusIcon,\n RefreshIcon,\n SpinnerIcon,\n XIcon,\n} from \"../icons\";\nimport { AssociationPicker } from \"./AssociationPicker\";\nimport { DoorRef } from \"./entityDoors\";\nimport {\n UniversalAssociationPicker,\n attachedKey,\n} from \"./UniversalAssociationPicker\";\nimport { usePrimaryEntity, type PrimaryEntity } from \"./PrimaryEntityContext\";\n\n// ─── Adapter contract ────────────────────────────────────────────────────────\n\n/** One attached resource, as the list renders it. Tokens are CANONICAL. */\nexport interface ContainerResourceRow {\n /** Stable row key (edge id or `${token}:${id}`). */\n key: string;\n token: string;\n resourceId: string;\n label: string | null;\n /** Exact semantic edge role; null means the canonical role-less edge. */\n role?: string | null;\n /** Pinned rows sort first inside their token group. */\n pinned?: boolean;\n /** False for inherited rows (e.g. via a thread's anchor) — no detach. */\n removable: boolean;\n /** Small annotation for non-removable rows (\"via anchor\"). */\n originNote?: string | null;\n /** Resolvable records that contributed an inherited row. */\n originRefs?: readonly {\n token: EntityTypeToken;\n id: string;\n label: string;\n }[];\n}\n\nexport interface ContainerResourcesAdapter {\n status: \"idle\" | \"loading\" | \"ready\" | \"error\";\n error: string | null;\n reload: () => void | Promise<void>;\n rows: ContainerResourceRow[];\n attach: (\n token: EntityTypeToken,\n resourceId: string,\n title?: string,\n /**\n * Extra edge metadata stamped at attach time (label-at-attach-time's\n * sibling contract). Adapters without metadata support may ignore it.\n */\n opts?: { metadata?: Record<string, unknown> | null },\n ) => Promise<{ ok: boolean; error?: string }>;\n detach: (\n token: EntityTypeToken,\n resourceId: string,\n role?: string,\n ) => Promise<{ ok: boolean; error?: string }>;\n /**\n * Optional pin capability (edge `metadata.pinned`) — pinned resources stay\n * inline in agent context at every tier. Rows show a pin toggle when set.\n */\n setPinned?: (\n token: EntityTypeToken,\n resourceId: string,\n pinned: boolean,\n role?: string,\n ) => Promise<{ ok: boolean; error?: string }>;\n}\n\nfunction metadataIsPinned(metadata: unknown): boolean {\n return (\n metadata !== null &&\n typeof metadata === \"object\" &&\n !Array.isArray(metadata) &&\n Reflect.get(metadata, \"pinned\") === true\n );\n}\n\n/** Default adapter — wraps `useContainerLinks` (org/scope/project pages). */\nexport function useContainerLinksAdapter(\n container: PrimaryEntity | null,\n tokens?: readonly EntityTypeToken[],\n): ContainerResourcesAdapter {\n const store = useAssociationsStore();\n const links = useContainerLinks({\n containerType: container?.type ?? \"organization\",\n containerId: container?.id ?? null,\n orgId: container?.orgId ?? null,\n });\n const rows: ContainerResourceRow[] = container\n ? (tokens ?? store.registry.curatedTokens()).flatMap((token) =>\n links.linksFor(token).map((l) => ({\n key: l.edgeId,\n token: l.token,\n resourceId: l.resourceId,\n label: l.label,\n role: l.role,\n pinned: metadataIsPinned(l.metadata),\n removable: true,\n })),\n )\n : [];\n return {\n status: links.status,\n error: links.error,\n reload: links.reload,\n rows,\n attach: async (token, id, title) => links.attach(token, id, title),\n detach: async (token, id, role) => links.detach(token, id, role),\n setPinned: async (token, id, pinned, role) =>\n links.setPinned(token, id, pinned, role),\n };\n}\n\n// ─── Component ───────────────────────────────────────────────────────────────\n\nexport interface AssociationListProps {\n /** Container override; defaults to the surrounding PrimaryEntityProvider. */\n container?: PrimaryEntity;\n /** Write/read override (war-room threads etc.). Default: useContainerLinks. */\n adapter?: ContainerResourcesAdapter;\n /** Restrict display + attach to these tokens (e.g. one dynamic tab). */\n tokens?: EntityTypeToken[];\n /** `full` = role sections + universal search; `compact` = flat token groups. */\n variant?: \"full\" | \"compact\";\n /** Extra per-token actions (e.g. war-room Upload / New document). */\n renderSectionActions?: (token: EntityTypeToken) => ReactNode;\n /** Open a resource. Default: registry `hrefFor` in a new tab. */\n openEntity?: (token: string, id: string) => void;\n /**\n * Per-token row override (return null/undefined to keep the default row) —\n * for rows that need richer rendering than icon+title. The override owns the\n * whole row; use `ctx` for the resolved title and the busy/detach/open\n * wiring.\n */\n renderRow?: (\n row: ContainerResourceRow,\n ctx: {\n title: string;\n busy: boolean;\n onDetach: () => void;\n onOpen: () => void;\n },\n ) => ReactNode | null | undefined;\n className?: string;\n}\n\nexport function AssociationList(props: AssociationListProps) {\n const store = useAssociationsStore();\n const notifier = useNotifier();\n const ctxEntity = usePrimaryEntity();\n const container = props.container ?? ctxEntity ?? null;\n const defaultAdapter = useContainerLinksAdapter(\n props.adapter ? null : container,\n props.tokens,\n );\n const adapter = props.adapter ?? defaultAdapter;\n const variant = props.variant ?? \"full\";\n const tokenFilter = props.tokens ?? null;\n\n const [pickerToken, setPickerToken] = useState<EntityTypeToken | null>(null);\n const [showUniversal, setShowUniversal] = useState(false);\n const [removingKeys, setRemovingKeys] = useState<Set<string>>(new Set());\n const [pinningKeys, setPinningKeys] = useState<Set<string>>(new Set());\n\n const rows = tokenFilter\n ? adapter.rows.filter((r) => (tokenFilter as string[]).includes(r.token))\n : adapter.rows;\n const visibleRows = rows.filter((r) => !removingKeys.has(r.key));\n\n const { titleFor } = useEntityTitles(\n visibleRows.map((r) => ({\n token: r.token,\n id: r.resourceId,\n label: r.label,\n })),\n );\n\n const attachedKeys = new Set(\n rows.map((r) => attachedKey(r.token, r.resourceId)),\n );\n\n const handleDetach = async (row: ContainerResourceRow) => {\n setRemovingKeys((prev) => new Set(prev).add(row.key));\n const info = store.registry.tryGetEntityInfo(row.token);\n const res = info\n ? await adapter.detach(info.token, row.resourceId, row.role ?? undefined)\n : { ok: false };\n setRemovingKeys((prev) => {\n const next = new Set(prev);\n next.delete(row.key);\n return next;\n });\n return res;\n };\n\n const handlePin = async (row: ContainerResourceRow, pinned: boolean) => {\n if (!adapter.setPinned) return;\n const info = store.registry.tryGetEntityInfo(row.token);\n if (!info) return;\n setPinningKeys((prev) => new Set(prev).add(row.key));\n try {\n const res = await adapter.setPinned(\n info.token,\n row.resourceId,\n pinned,\n row.role ?? undefined,\n );\n if (!res.ok) {\n notifier.error(\n `Couldn't ${pinned ? \"pin\" : \"unpin\"} resource${res.error ? `: ${res.error}` : \"\"}`,\n );\n }\n } finally {\n setPinningKeys((prev) => {\n const next = new Set(prev);\n next.delete(row.key);\n return next;\n });\n }\n };\n\n const openRow = (row: ContainerResourceRow) => {\n if (props.openEntity) {\n props.openEntity(row.token, row.resourceId);\n return;\n }\n const info = store.registry.tryGetEntityInfo(row.token);\n const href = info?.hrefFor?.(row.resourceId);\n if (href && typeof window !== \"undefined\") {\n window.open(href, \"_blank\", \"noopener,noreferrer\");\n }\n };\n\n // role → token → rows, in registry role order.\n const grouped = groupRows(store, visibleRows);\n const isLoading = adapter.status === \"loading\" || adapter.status === \"idle\";\n const attachableTokens = tokenFilter ?? store.registry.listableTokens();\n\n return (\n <div className={cn(\"flex flex-col gap-2 text-foreground\", props.className)}>\n {/* ── header: count + universal attach ─────────────────────────── */}\n <div className=\"flex items-center justify-between gap-2 px-1\">\n <h3 className=\"flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wide text-muted-foreground\">\n <Link2Icon className=\"h-3.5 w-3.5\" />\n Resources\n {visibleRows.length > 0 && (\n <span className=\"rounded bg-muted px-1 text-[10px] font-medium text-muted-foreground\">\n {visibleRows.length}\n </span>\n )}\n </h3>\n <div className=\"flex items-center gap-1.5\">\n <button\n type=\"button\"\n onClick={() => setShowUniversal((v) => !v)}\n className={cn(\n \"inline-flex items-center gap-1 rounded-md border border-border px-1.5 py-0.5 text-[11px] transition-colors\",\n showUniversal\n ? \"bg-accent text-foreground\"\n : \"text-muted-foreground hover:bg-accent hover:text-foreground\",\n )}\n >\n <PlusIcon className=\"h-3 w-3\" />\n Add\n </button>\n <button\n type=\"button\"\n onClick={() => void adapter.reload()}\n title=\"Refresh\"\n className=\"text-muted-foreground/60 transition-colors hover:text-foreground\"\n >\n <RefreshIcon\n className={cn(\n \"h-3 w-3\",\n adapter.status === \"loading\" && \"animate-spin\",\n )}\n />\n </button>\n </div>\n </div>\n\n {/* ── universal search-attach ──────────────────────────────────── */}\n {showUniversal && (\n <div className=\"rounded-md border border-border/60 bg-muted/30 p-2 max-h-80 flex flex-col\">\n <UniversalAssociationPicker\n tokens={attachableTokens}\n orgId={container?.orgId ?? null}\n attachedKeys={attachedKeys}\n onAttach={(token, id, title) => adapter.attach(token, id, title)}\n onDetach={(token, id) => adapter.detach(token, id)}\n />\n </div>\n )}\n\n {/* ── error / loading / empty ──────────────────────────────────── */}\n {adapter.status === \"error\" && (\n <div className=\"flex items-center justify-between gap-2 rounded-md border border-destructive/40 bg-destructive/10 px-2.5 py-2\">\n <span className=\"truncate text-[11px] text-destructive\">\n {adapter.error || \"Failed to load resources\"}\n </span>\n <button\n type=\"button\"\n onClick={() => void adapter.reload()}\n className=\"text-[11px] font-medium text-destructive underline hover:no-underline\"\n >\n Retry\n </button>\n </div>\n )}\n {adapter.status !== \"error\" && isLoading && visibleRows.length === 0 && (\n <div className=\"space-y-1.5 px-1\">\n <Skeleton className=\"h-3 w-20\" />\n <Skeleton className=\"h-7 w-full rounded-md\" />\n <Skeleton className=\"h-7 w-3/4 rounded-md\" />\n </div>\n )}\n {adapter.status === \"ready\" && visibleRows.length === 0 && (\n <p className=\"px-1 py-1 text-[11px] text-muted-foreground\">\n Nothing attached yet — use Add to link anything.\n </p>\n )}\n\n {/* ── grouped rows ─────────────────────────────────────────────── */}\n {visibleRows.length > 0 && (\n <div className=\"space-y-2.5\">\n {grouped.map(({ role, tokens: tokenGroups }) => {\n const roleMeta = getContentRoleMeta(role);\n return (\n <div key={role} className=\"space-y-1.5\">\n {variant === \"full\" && (\n <div className=\"flex items-center gap-1.5 px-1\">\n <span\n className={cn(\n \"h-3 w-0.5 rounded-full\",\n roleMeta.accentBar,\n )}\n />\n <p\n className={cn(\n \"text-[10px] font-semibold uppercase tracking-wider\",\n roleMeta.accentText,\n )}\n >\n {roleMeta.title}\n </p>\n </div>\n )}\n {tokenGroups.map(({ info, token, rows: tokenRows }) => {\n const TokenIcon = info?.Icon ?? null;\n return (\n <div key={token} className=\"space-y-0.5\">\n <div className=\"flex items-center justify-between gap-1 px-1\">\n <p className=\"flex items-center gap-1 text-[10px] font-medium text-muted-foreground/80\">\n {TokenIcon ? <TokenIcon className=\"h-3 w-3\" /> : null}\n {info?.labelPlural ?? titleize(token)}\n <span className=\"text-muted-foreground/50\">\n {tokenRows.length}\n </span>\n </p>\n <div className=\"flex items-center gap-1\">\n {props.renderSectionActions && info\n ? props.renderSectionActions(info.token)\n : null}\n {info?.canListCandidates && (\n <button\n type=\"button\"\n onClick={() => setPickerToken(info.token)}\n title={`Add ${info.labelPlural}`}\n className=\"rounded p-0.5 text-muted-foreground/60 transition-colors hover:bg-accent hover:text-foreground\"\n >\n <PlusIcon className=\"h-3 w-3\" />\n </button>\n )}\n </div>\n </div>\n <ul className=\"space-y-0.5\">\n {tokenRows.map((row) => {\n const busy = removingKeys.has(row.key);\n const custom = props.renderRow?.(row, {\n title: titleFor({\n token: row.token,\n id: row.resourceId,\n label: row.label,\n }),\n busy,\n onDetach: () => void handleDetach(row),\n onOpen: () => openRow(row),\n });\n if (custom != null) {\n return <li key={row.key}>{custom}</li>;\n }\n return (\n <li key={row.key}>\n <div\n className={cn(\n \"group flex items-center gap-2 rounded-md px-2 py-1.5 text-sm transition-colors hover:bg-accent\",\n busy && \"opacity-50\",\n )}\n >\n {/* THE DOOR LAW via the doors seam: the\n container's `openEntity` wins when it has\n one; otherwise the host EntityRef (or the\n degraded hrefFor anchor) carries the\n new-tab door. A row with neither renders\n as plain text, so a link-styled title can\n never no-op. */}\n <DoorRef\n token={row.token}\n id={row.resourceId}\n name={titleFor({\n token: row.token,\n id: row.resourceId,\n label: row.label,\n })}\n showIcon={Boolean(TokenIcon)}\n onOpen={\n props.openEntity\n ? () => openRow(row)\n : undefined\n }\n openInNewTab={!props.openEntity}\n className=\"min-w-0 flex-1 text-foreground\"\n />\n {row.originRefs && row.originRefs.length > 0 ? (\n <span className=\"flex shrink-0 items-center gap-1 text-[10px] text-muted-foreground/60\">\n via\n {row.originRefs.map((origin) => (\n <DoorRef\n key={`${origin.token}:${origin.id}`}\n token={origin.token}\n id={origin.id}\n name={origin.label}\n showIcon={false}\n openInNewTab\n className=\"max-w-24 text-[10px] text-muted-foreground underline-offset-2\"\n />\n ))}\n </span>\n ) : row.originNote ? (\n <span className=\"shrink-0 text-[10px] text-muted-foreground/60\">\n {row.originNote}\n </span>\n ) : null}\n {adapter.setPinned && info && row.removable && (\n <button\n type=\"button\"\n disabled={pinningKeys.has(row.key)}\n onClick={() =>\n void handlePin(row, !(row.pinned ?? false))\n }\n title={\n row.pinned\n ? \"Unpin (stops staying in agent context)\"\n : \"Pin — always in agent context\"\n }\n aria-label={row.pinned ? \"Unpin\" : \"Pin\"}\n className={cn(\n \"shrink-0 rounded p-0.5 transition-colors hover:!text-foreground\",\n row.pinned\n ? \"text-primary\"\n : \"text-muted-foreground/0 group-hover:text-muted-foreground\",\n )}\n >\n {pinningKeys.has(row.key) ? (\n <SpinnerIcon className=\"h-3 w-3 animate-spin\" />\n ) : (\n <PinIcon\n className={cn(\n \"h-3 w-3\",\n row.pinned && \"fill-primary/20\",\n )}\n />\n )}\n </button>\n )}\n {row.removable && (\n <button\n type=\"button\"\n disabled={busy}\n onClick={() => void handleDetach(row)}\n title=\"Detach\"\n aria-label=\"Detach\"\n className=\"shrink-0 rounded p-0.5 text-muted-foreground/0 transition-colors group-hover:text-muted-foreground hover:!text-destructive disabled:opacity-50\"\n >\n {busy ? (\n <SpinnerIcon className=\"h-3 w-3 animate-spin\" />\n ) : (\n <XIcon className=\"h-3 w-3\" />\n )}\n </button>\n )}\n </div>\n </li>\n );\n })}\n </ul>\n </div>\n );\n })}\n </div>\n );\n })}\n </div>\n )}\n\n {/* ── per-token picker sheet ───────────────────────────────────── */}\n {pickerToken && (\n <AssociationPicker\n open\n onOpenChange={(open) => {\n if (!open) setPickerToken(null);\n }}\n token={pickerToken}\n {...(container?.label !== undefined\n ? { containerLabel: container.label }\n : {})}\n orgId={container?.orgId ?? null}\n attachedIds={\n new Set(\n rows\n .filter((r) => r.token === pickerToken)\n .map((r) => r.resourceId),\n )\n }\n onAttach={(id, title) => adapter.attach(pickerToken, id, title)}\n onDetach={(id) => adapter.detach(pickerToken, id)}\n />\n )}\n </div>\n );\n}\n\n// ─── helpers ─────────────────────────────────────────────────────────────────\n\ninterface TokenGroup {\n token: string;\n info: EntityInfo | null;\n rows: ContainerResourceRow[];\n}\ninterface RoleGroup {\n role: ContentRole;\n tokens: TokenGroup[];\n}\n\n/** role → token → rows; pinned rows first inside a token group. */\nfunction groupRows(\n store: { registry: { tryGetEntityInfo(token: string): EntityInfo | null } },\n rows: ContainerResourceRow[],\n): RoleGroup[] {\n const byToken = new Map<string, ContainerResourceRow[]>();\n for (const r of rows) {\n const list = byToken.get(r.token) ?? [];\n list.push(r);\n byToken.set(r.token, list);\n }\n const roleBuckets = new Map<ContentRole, TokenGroup[]>();\n for (const [token, tokenRows] of byToken) {\n const info = store.registry.tryGetEntityInfo(token);\n const role: ContentRole = info?.contentRole ?? \"destination\";\n tokenRows.sort(\n (a, b) => Number(b.pinned ?? false) - Number(a.pinned ?? false),\n );\n const groups = roleBuckets.get(role) ?? [];\n groups.push({ token, info, rows: tokenRows });\n roleBuckets.set(role, groups);\n }\n const out: RoleGroup[] = [];\n for (const meta of CONTENT_ROLES) {\n const tokens = roleBuckets.get(meta.id);\n if (tokens && tokens.length > 0) {\n tokens.sort((a, b) =>\n (a.info?.labelPlural ?? a.token).localeCompare(\n b.info?.labelPlural ?? b.token,\n ),\n );\n out.push({ role: meta.id, tokens });\n }\n }\n return out;\n}\n\nfunction titleize(token: string): string {\n return token\n .split(\"_\")\n .map((w) => (w ? (w[0] as string).toUpperCase() + w.slice(1) : w))\n .join(\" \");\n}\n\nexport default AssociationList;\n","// react/components/AssociationCaptureToolbar.tsx — @ai-matrx/associations/react\n//\n// THE shared capture toolbar for any container's association surface — the\n// upload / add-existing / create toolbar plus whole-body drag-and-drop.\n// Callback-pure and registry-driven: the host supplies ONE `attach` callback\n// (canonical tokens only — `file`, `udt_document`) and this component owns\n// the gesture end-to-end under the CREATE-then-ASSOCIATE contract: the\n// durable row is created FIRST through the host capture handlers, the edge\n// is written SECOND via the host's callback, and EVERY terminal outcome is\n// loud — a created-but-unlinked item is reported WITH its location, never\n// silently orphaned.\n//\n// Ported from matrx-frontend\n// `features/scopes/components/associations/AssociationCaptureToolbar.tsx`\n// (W4, 2026-08-29) with the measured seams inverted onto the CAPTURE port\n// (design Decision 2, per-handler optional — NEVER dead buttons):\n//\n// • `requestUpload` (files feature) → `capture.requestUpload` — the Upload\n// chip and body drag-and-drop render when it is bound, OR when the host\n// bound only the one-file primitive `capture.uploadFile`: since 0.6.0\n// (C23) the package ships the ENTIRE upload flow over that primitive\n// (batching, per-file outcomes, the loud created-but-unattached report),\n// so a host never has to build an upload pipeline to get one;\n// • `openFilePicker` (cloud-files pickers) → `capture.openFilePicker` —\n// the \"Add file\" chip renders only when bound;\n// • `createDocument` (data-tables) → `capture.createDataTable` — the\n// \"New document\" chip renders only when bound; the name is collected by\n// an INLINE input row (the original's TextInputDialog is host chrome);\n// the created document opens through the registry's `hrefFor` overlay\n// when one is registered for `udt_document`;\n// • the original's \"Add document\" picker (a host CommandDialog over\n// `listAccessibleDocuments`) has NO capture handler by design — hosts\n// append it via `extraActions`;\n// • `@/lib/toast` → the notifier port; console.error → the errorSink.\n//\n// Zero bound handlers → the toolbar renders only `children` (drag-and-drop\n// disabled too — a drop with no upload path must not swallow files).\n\nimport { useRef, useState, type DragEvent, type ReactNode } from \"react\";\nimport { Button, cn, Input } from \"@ai-matrx/design-system\";\n\nimport { useAssociationsStore, useAssociationsUiPorts, useNotifier } from \"../context\";\nimport type { EntityTypeToken } from \"../../entity-types.generated\";\nimport type { CaptureUploadOpts, CaptureUploadResult } from \"../../ports\";\nimport {\n FileTextIcon,\n FolderOpenIcon,\n PlusIcon,\n SpinnerIcon,\n UploadIcon,\n type IconProps,\n} from \"../icons\";\n\nexport interface CaptureAttachResult {\n ok: boolean;\n /** Human error text — the toolbar screams it. Omit when the host already did. */\n error?: string;\n}\n\n/**\n * ONE write callback for every capture verb. Tokens are canonical\n * (`file` / `udt_document`); the host maps to its own write path (an\n * association edge, a thread thunk, …) and reports the outcome honestly —\n * a silent no-op attach is the bug class this contract kills.\n */\nexport type CaptureAttach = (\n token: EntityTypeToken,\n resourceId: string,\n opts?: { label?: string },\n) => Promise<CaptureAttachResult>;\n\nexport interface AssociationCaptureToolbarProps {\n attach: CaptureAttach;\n /** Logical cloud-files folder new uploads land in (auto-created). */\n uploadFolderPath: string;\n /** Visibility stamped on uploads. Default \"personal\". */\n uploadVisibility?: string;\n /**\n * Where a created-but-unlinked upload is reported to live, e.g.\n * \"your Files (War Room folder)\". Keeps the loud-outcome copy honest.\n */\n uploadLocationLabel: string;\n /** The retry verb named in loud-outcome copy. Default '\"Add file\"'. */\n attachRetryLabel?: string;\n /** Copy for the existing-files picker dialog. */\n filePicker?: { title?: string; description?: string };\n /** Which built-in actions render (each ALSO gated on its port handler). */\n showActions?: {\n upload?: boolean;\n addFile?: boolean;\n newDocument?: boolean;\n };\n /** Hide the button row (compact variants) — drag-and-drop stays live. */\n showToolbar?: boolean;\n /** Extra host-specific buttons appended after the built-ins. */\n extraActions?: ReactNode;\n /** Open a freshly created document via the registry door. Default true. */\n openCreatedDocument?: boolean;\n className?: string;\n /** The body the drop target wraps (the list of attached things). */\n children?: ReactNode;\n}\n\nexport function AssociationCaptureToolbar({\n attach,\n uploadFolderPath,\n uploadVisibility = \"personal\",\n uploadLocationLabel,\n attachRetryLabel = '\"Add file\"',\n filePicker,\n showActions,\n showToolbar = true,\n extraActions,\n openCreatedDocument = true,\n className,\n children,\n}: AssociationCaptureToolbarProps) {\n const store = useAssociationsStore();\n const { capture } = useAssociationsUiPorts();\n const notifier = useNotifier();\n const fileInputRef = useRef<HTMLInputElement | null>(null);\n const [isUploading, setIsUploading] = useState(false);\n const [isDragOver, setIsDragOver] = useState(false);\n const [isPicking, setIsPicking] = useState(false);\n const [namingDoc, setNamingDoc] = useState(false);\n const [docName, setDocName] = useState(\"\");\n const [creatingDoc, setCreatingDoc] = useState(false);\n\n // The upload path: the host's full pipeline when bound, otherwise the\n // PACKAGE-SHIPPED flow over the one-file `uploadFile` primitive (C23).\n // Identical `CaptureUploadResult` shape either way, so every loud-outcome\n // branch below is written once.\n const hostRequestUpload = capture?.requestUpload;\n const hostUploadFile = capture?.uploadFile;\n const requestUploadPath: ((opts: CaptureUploadOpts) => Promise<CaptureUploadResult>) | undefined =\n hostRequestUpload\n ? (opts) => hostRequestUpload(opts)\n : hostUploadFile\n ? async (opts) => {\n const uploaded: string[] = [];\n const failed: { name: string; error: string }[] = [];\n for (const file of opts.files) {\n try {\n const result = await hostUploadFile(file, {\n folderPath: opts.folderPath,\n ...(opts.visibility !== undefined\n ? { visibility: opts.visibility }\n : {}),\n });\n if (result.ok) uploaded.push(result.id);\n else failed.push({ name: file.name, error: result.error });\n } catch (err: unknown) {\n failed.push({\n name: file.name,\n error:\n err instanceof Error && err.message\n ? err.message\n : \"Upload failed\",\n });\n }\n }\n return { uploaded, aliased: [], failed };\n }\n : undefined;\n\n // Per-handler optional (the design's degradation): a chip renders only\n // when its capture handler exists AND the host didn't hide it.\n const actions = {\n upload: (showActions?.upload ?? true) && Boolean(requestUploadPath),\n addFile: (showActions?.addFile ?? true) && Boolean(capture?.openFilePicker),\n newDocument:\n (showActions?.newDocument ?? true) && Boolean(capture?.createDataTable),\n };\n const canDrop = Boolean(requestUploadPath);\n\n // ── Files: upload from disk → attach each returned file id ───────────────\n //\n // CREATE-then-ASSOCIATE: the file row is created FIRST (durable — it lives\n // in the user's library under `uploadFolderPath` no matter what), the edge\n // is written SECOND, and EVERY terminal outcome is loud. A\n // created-but-unattached file is reported with its location — it must never\n // look like it \"just disappeared\".\n const uploadAndAttach = async (files: File[]) => {\n const requestUpload = requestUploadPath;\n if (files.length === 0 || !requestUpload) return;\n setIsUploading(true);\n // Watchdog: if the upload pipeline never settles (hung dialog promise,\n // dead transport), SAY so — a stuck-silent gesture is the bug class.\n const watchdog = setTimeout(() => {\n store.errorSink({\n code: \"capture_upload_unresponsive\",\n message:\n \"[AssociationCaptureToolbar] upload pipeline unresponsive >60s\",\n context: { files: files.map((f) => f.name) },\n });\n notifier.error(\n \"The upload isn't responding — it may be stalled. Check your connection and retry.\",\n );\n }, 60_000);\n try {\n const result = await requestUpload({\n files,\n folderPath: uploadFolderPath,\n visibility: uploadVisibility,\n });\n if (result.cancelled) {\n notifier.success(\"Upload cancelled — nothing was attached\");\n return;\n }\n const aliasedIds = result.aliased.map((a) => a.existingFileId);\n const ids = [...result.uploaded, ...aliasedIds];\n let attached = 0;\n const unattached: string[] = [];\n let firstAttachError: string | null = null;\n for (const id of ids) {\n const res = await attach(\"file\", id);\n if (res.ok) {\n attached += 1;\n } else {\n unattached.push(id);\n if (!firstAttachError && res.error) firstAttachError = res.error;\n }\n }\n if (attached > 0) {\n notifier.success(\n attached === 1 ? \"Attached 1 file\" : `Attached ${attached} files`,\n );\n }\n if (unattached.length > 0) {\n // The upload SUCCEEDED — the file exists in the library. Say so, and\n // say where, instead of letting it vanish.\n notifier.error(\n `Uploaded ${unattached.length === 1 ? \"1 file\" : `${unattached.length} files`} to ${uploadLocationLabel} but couldn't attach ${unattached.length === 1 ? \"it\" : \"them\"} here — use ${attachRetryLabel} to retry` +\n (firstAttachError ? ` (${firstAttachError})` : \"\"),\n );\n }\n if (result.failed.length > 0) {\n const first = result.failed[0];\n notifier.error(\n result.failed.length === 1 && first\n ? `Failed to upload ${first.name}: ${first.error}`\n : `Failed to upload ${result.failed.length} files`,\n );\n }\n if (ids.length === 0 && result.failed.length === 0) {\n // Guard-host edge case (everything skipped in the duplicate dialog\n // with no alias chosen) — never end a user gesture in silence.\n notifier.error(\"Nothing was uploaded or attached\");\n }\n } catch (err) {\n store.errorSink({\n code: \"capture_upload_failed\",\n message: \"[AssociationCaptureToolbar] upload flow failed\",\n context: { detail: err },\n });\n notifier.error(\n err instanceof Error && err.message\n ? `Upload failed: ${err.message}`\n : \"Upload failed unexpectedly\",\n );\n } finally {\n clearTimeout(watchdog);\n setIsUploading(false);\n }\n };\n\n const handleFilesSelected = (e: React.ChangeEvent<HTMLInputElement>) => {\n const files = e.target.files ? Array.from(e.target.files) : [];\n e.target.value = \"\";\n void uploadAndAttach(files);\n };\n\n // Drop a file anywhere on the body → upload + attach. Without this the most\n // natural gesture had NO handler — the browser navigated to the file with\n // zero feedback: the \"file just disappeared\" bug class. (Gated on the\n // upload handler existing: a drop zone with no upload path is a dead end.)\n const handleDrop = (e: DragEvent) => {\n if (!canDrop) return;\n e.preventDefault();\n e.stopPropagation();\n setIsDragOver(false);\n const files = Array.from(e.dataTransfer?.files ?? []);\n if (files.length === 0) return;\n void uploadAndAttach(files);\n };\n\n // ── Files: pick existing cloud files ──────────────────────────────────────\n const handlePickExisting = async () => {\n const openFilePicker = capture?.openFilePicker;\n if (isPicking || !openFilePicker) return;\n setIsPicking(true);\n try {\n const ids = await openFilePicker({\n multi: true,\n title: filePicker?.title ?? \"Attach files\",\n description:\n filePicker?.description ??\n \"Pick existing files from your cloud storage.\",\n });\n if (!ids || ids.length === 0) return;\n let attached = 0;\n let firstAttachError: string | null = null;\n for (const id of ids) {\n const res = await attach(\"file\", id);\n if (res.ok) attached += 1;\n else if (!firstAttachError && res.error) firstAttachError = res.error;\n }\n if (attached > 0) {\n notifier.success(\n attached === 1 ? \"Attached 1 file\" : `Attached ${attached} files`,\n );\n }\n if (attached < ids.length && firstAttachError) {\n // Hosts whose attach path screams its own failures return no `error`;\n // everyone else gets the loud outcome here.\n notifier.error(`Couldn't attach: ${firstAttachError}`);\n }\n } catch (err) {\n store.errorSink({\n code: \"capture_pick_failed\",\n message: \"[AssociationCaptureToolbar] attach-existing flow failed\",\n context: { detail: err },\n });\n notifier.error(\"Couldn't attach the selected files\");\n } finally {\n setIsPicking(false);\n }\n };\n\n // ── Documents ─────────────────────────────────────────────────────────────\n const handleCreateDoc = async () => {\n const createDataTable = capture?.createDataTable;\n const name = docName.trim();\n if (!name || creatingDoc || !createDataTable) return;\n setCreatingDoc(true);\n try {\n const doc = await createDataTable({ name });\n if (!doc) {\n notifier.error(\"Couldn't create the document\");\n return;\n }\n const res = await attach(\"udt_document\", doc.id, { label: name });\n setNamingDoc(false);\n setDocName(\"\");\n if (res.ok) {\n notifier.success(\"Document created\");\n if (openCreatedDocument && typeof window !== \"undefined\") {\n const href = store.registry\n .tryGetEntityInfo(\"udt_document\")\n ?.hrefFor?.(doc.id);\n if (href) window.open(href, \"_blank\", \"noopener,noreferrer\");\n }\n } else {\n // Created but not linked — the document exists; never let it vanish.\n notifier.error(\n `Created \"${name}\" but couldn't attach it here — it's saved in your documents; retry from its library`,\n );\n }\n } catch (err) {\n store.errorSink({\n code: \"capture_create_document_failed\",\n message: \"[AssociationCaptureToolbar] create-document flow failed\",\n context: { detail: err },\n });\n notifier.error(\"Couldn't create the document\");\n } finally {\n setCreatingDoc(false);\n }\n };\n\n const anyBuiltIn = actions.upload || actions.addFile || actions.newDocument;\n\n return (\n <div\n className={cn(\n \"relative flex h-full min-h-0 flex-col\",\n isDragOver && \"ring-2 ring-inset ring-primary/50\",\n className,\n )}\n onDragOver={(e) => {\n if (!canDrop) return;\n if (!e.dataTransfer?.types.includes(\"Files\")) return;\n e.preventDefault();\n e.stopPropagation();\n setIsDragOver(true);\n }}\n onDragLeave={(e) => {\n if (e.currentTarget.contains(e.relatedTarget as Node)) return;\n setIsDragOver(false);\n }}\n onDrop={handleDrop}\n >\n {isDragOver ? (\n <div className=\"pointer-events-none absolute inset-0 z-10 grid place-items-center bg-background/70\">\n <span className=\"flex items-center gap-2 rounded-md border border-primary/40 bg-card px-3 py-1.5 text-xs font-medium text-foreground\">\n <UploadIcon className=\"size-3.5 text-primary\" />\n Drop to upload &amp; attach\n </span>\n </div>\n ) : null}\n <input\n ref={fileInputRef}\n type=\"file\"\n multiple\n className=\"sr-only\"\n onChange={handleFilesSelected}\n />\n\n {/* ── capture toolbar ────────────────────────────────────────────── */}\n {showToolbar && (anyBuiltIn || extraActions) ? (\n <div className=\"flex flex-wrap items-center gap-0.5 border-b border-border/60 px-1.5 py-1\">\n {namingDoc ? (\n <div className=\"flex flex-1 items-center gap-1.5 py-0.5\">\n <Input\n autoFocus\n value={docName}\n disabled={creatingDoc}\n placeholder=\"Document name…\"\n onChange={(e) => setDocName(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === \"Enter\") void handleCreateDoc();\n if (e.key === \"Escape\") {\n setNamingDoc(false);\n setDocName(\"\");\n }\n }}\n className=\"h-7 flex-1 text-base md:text-xs\"\n style={{ fontSize: 16 }}\n />\n <button\n type=\"button\"\n disabled={creatingDoc || !docName.trim()}\n onClick={() => void handleCreateDoc()}\n className=\"flex h-7 items-center rounded-md bg-primary px-2 text-[11px] font-medium text-primary-foreground disabled:opacity-50\"\n >\n {creatingDoc ? (\n <SpinnerIcon className=\"size-3.5 animate-spin\" />\n ) : (\n \"Create\"\n )}\n </button>\n <button\n type=\"button\"\n disabled={creatingDoc}\n onClick={() => {\n setNamingDoc(false);\n setDocName(\"\");\n }}\n className=\"flex h-7 items-center rounded-md border border-border px-2 text-[11px] text-muted-foreground hover:text-foreground disabled:opacity-50\"\n >\n Cancel\n </button>\n </div>\n ) : (\n <>\n {actions.upload ? (\n <CaptureToolbarAction\n icon={isUploading ? SpinnerIcon : UploadIcon}\n spinning={isUploading}\n label=\"Upload\"\n onClick={() => !isUploading && fileInputRef.current?.click()}\n disabled={isPicking || isUploading}\n />\n ) : null}\n {actions.addFile ? (\n <CaptureToolbarAction\n icon={isPicking ? SpinnerIcon : FolderOpenIcon}\n spinning={isPicking}\n label=\"Add file\"\n onClick={() => void handlePickExisting()}\n disabled={isPicking || isUploading}\n />\n ) : null}\n {(actions.upload || actions.addFile) && actions.newDocument ? (\n <span className=\"mx-1 h-4 w-px bg-border\" />\n ) : null}\n {actions.newDocument ? (\n <CaptureToolbarAction\n icon={creatingDoc ? SpinnerIcon : PlusIcon}\n spinning={creatingDoc}\n label=\"New document\"\n onClick={() => setNamingDoc(true)}\n disabled={creatingDoc}\n />\n ) : null}\n {extraActions}\n </>\n )}\n </div>\n ) : null}\n\n {children}\n </div>\n );\n}\n\n// ── toolbar chrome ──────────────────────────────────────────────────────────\n\n/** The dense toolbar button (exported so hosts' extraActions match). */\nexport function CaptureToolbarAction({\n icon: Icon,\n label,\n onClick,\n disabled,\n spinning,\n}: {\n icon: (props: IconProps) => ReactNode;\n label: string;\n onClick: () => void;\n disabled?: boolean;\n spinning?: boolean;\n}) {\n return (\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"ghost\"\n onClick={onClick}\n disabled={disabled}\n className=\"h-7 gap-1 px-2 text-[11px] text-muted-foreground hover:text-foreground\"\n >\n <Icon className={cn(\"size-3.5\", spinning && \"animate-spin\")} />\n {label}\n </Button>\n );\n}\n\n/** The document-file glyph, exported for host extraActions parity. */\nexport { FileTextIcon as CaptureDocumentIcon };\n","// react/lazyPorts.tsx — @ai-matrx/associations/react\n//\n// THE package-owned bundle-split seam (0.6.0, C23 § framework differences).\n//\n// Before this module every host hand-wrote the same `next/dynamic({ssr:false})`\n// glue to keep a heavy port binding (a window manager, a canonical file\n// browser) out of its boot bundle — mechanical seam code, rebuilt per app,\n// each one a chance to get `ssr`, the `loading` fallback or the `.then(m =>\n// m.X)` unwrap wrong. The split is a PACKAGE concern; these two helpers own\n// it once, for every framework we ship on.\n//\n// They are deliberately framework-AGNOSTIC — `React.lazy` + `Suspense`, no\n// `next/dynamic`, no `next` peer dependency. `ssr: false` is not needed and\n// never was: both ports are only ever RENDERED after a user gesture opens a\n// window, so the loader fires client-side and the module never enters a\n// server render. Next.js, Vite, the Tauri shell and Jest all handle it the\n// same way, and the consumer's own bundler creates the real chunk.\n//\n// Usage in a host binding (the whole of it):\n//\n// windowShell: {\n// Window: lazyWindowShell(() =>\n// import(\"./hostWindows\").then((m) => m.AssociationsWindowShellImpl)),\n// },\n// pickerOverrides: {\n// file: lazyPickerOverride(() =>\n// import(\"./hostPickers\").then((m) => m.FileAssociationPickerImpl)),\n// },\n\nimport { Suspense, lazy, type ComponentType, type ReactNode } from \"react\";\n\nimport type { AssociationPickerProps, WindowShellPort } from \"../ports\";\n\n/** What a `windowShell.Window` component receives. */\nexport interface WindowShellComponentProps {\n id: string;\n title: string;\n onClose(): void;\n children: ReactNode;\n}\n\n/**\n * Wrap `React.lazy` so the loader may resolve EITHER a bare component or a\n * `{ default }` module — hosts reach for `.then(m => m.Named)` reflexively\n * and both spellings must work, not one of them silently.\n */\nfunction lazyComponent<P>(\n load: () => Promise<ComponentType<P> | { default: ComponentType<P> }>,\n): ComponentType<P> {\n return lazy(async () => {\n const loaded = await load();\n return typeof loaded === \"function\" ? { default: loaded } : loaded;\n });\n}\n\n/**\n * Split a host window component off the boot bundle. The returned component\n * satisfies `WindowShellPort[\"Window\"]` exactly; the chunk fetches the first\n * time an association window opens.\n */\nexport function lazyWindowShell(\n load: () => Promise<\n | ComponentType<WindowShellComponentProps>\n | { default: ComponentType<WindowShellComponentProps> }\n >,\n): WindowShellPort[\"Window\"] {\n const Loaded = lazyComponent<WindowShellComponentProps>(load);\n return function LazyWindowShell(props: WindowShellComponentProps) {\n // `null` while the chunk arrives: a window opens on a click and the\n // chunk lands in a frame or two — a skeleton window would flash worse\n // than nothing. Failure is NOT silent: a rejected chunk throws into the\n // host's error boundary rather than leaving a dead surface.\n return (\n <Suspense fallback={null}>\n <Loaded {...props} />\n </Suspense>\n );\n };\n}\n\n/**\n * Split a host per-token picker override off the boot bundle. The returned\n * component satisfies the `pickerOverrides` map's value type exactly.\n */\nexport function lazyPickerOverride(\n load: () => Promise<\n | ComponentType<AssociationPickerProps>\n | { default: ComponentType<AssociationPickerProps> }\n >,\n): ComponentType<AssociationPickerProps> {\n const Loaded = lazyComponent<AssociationPickerProps>(load);\n return function LazyPickerOverride(props: AssociationPickerProps) {\n // Gated on `open` as well as Suspense: an override registered for a\n // token must not fetch its chunk until that picker is actually opened.\n if (!props.open) return null;\n return (\n <Suspense fallback={null}>\n <Loaded {...props} />\n </Suspense>\n );\n };\n}\n","// react/hooks/useAssociationPickerBridge.ts — @ai-matrx/associations/react\n//\n// THE loud-outcome engine for a per-token picker OVERRIDE (0.6.0, C22).\n//\n// A host that registers its own canonical browser for a token (matrx-frontend\n// registers its file picker for `file`) still owes the package's contract:\n// every attach/detach reports honestly, a partial batch says exactly what\n// landed and what did not, and an attach the RPC refuses can never look like\n// an inert click (the QA F1 bug class, feedback 35d311a9). That is package\n// logic — failure semantics, retry copy, sink routing — and until 0.6.0 every\n// override re-implemented it by hand in host code. It lives here now: an\n// override binds this hook and writes only the two lines that call it.\n//\n// const bridge = useAssociationPickerBridge(props, {\n// createdLocationLabel: \"your Files\",\n// openCreatedLocation: { label: \"Open Files\", onClick: () => … },\n// });\n// <HostPicker onUpload={(f) => bridge.attachMany(f.map(toItem))}\n// onPick={(s) => bridge.toggle(toItem(s))} />\n\nimport { useCallback, useState } from \"react\";\n\nimport type { AssociationPickerProps } from \"../../ports\";\nimport { useAssociationsStore, useNotifier } from \"../context\";\n\n/** One thing the host's picker produced or selected. */\nexport interface PickerBridgeItem {\n id: string;\n /** Human name — used verbatim in every loud outcome. */\n name: string;\n}\n\nexport interface AssociationPickerBridgeOptions {\n /**\n * Where an item that was CREATED but could not be attached now lives\n * (\"your Files\"). Keeps the created-but-unlinked message honest instead of\n * letting the item look like it vanished.\n */\n createdLocationLabel?: string;\n /** An action offered on that message, e.g. a door to the library. */\n openCreatedLocation?: { label: string; onClick: () => void };\n /** Noun used in copy. Default \"item\". */\n itemNoun?: string;\n}\n\nexport interface AssociationPickerBridge {\n /**\n * Attach a batch (the host's post-upload hand-off). Every terminal outcome\n * is loud: successes are confirmed, failures name the item AND where it\n * lives, and a thrown attach is captured to the errorSink.\n */\n attachMany(items: PickerBridgeItem[]): Promise<void>;\n /** Attach-or-detach one item, screaming on refusal. */\n toggle(item: PickerBridgeItem): Promise<void>;\n /** True while a batch or toggle is in flight (drive the host's spinner). */\n busy: boolean;\n}\n\nexport function useAssociationPickerBridge(\n props: Pick<\n AssociationPickerProps,\n \"attachedIds\" | \"onAttach\" | \"onDetach\" | \"token\"\n >,\n options: AssociationPickerBridgeOptions = {},\n): AssociationPickerBridge {\n const store = useAssociationsStore();\n const notifier = useNotifier();\n const [busy, setBusy] = useState(false);\n\n const { attachedIds, onAttach, onDetach, token } = props;\n const {\n createdLocationLabel,\n openCreatedLocation,\n itemNoun = \"item\",\n } = options;\n\n const attachMany = useCallback(\n async (items: PickerBridgeItem[]) => {\n if (items.length === 0) return;\n setBusy(true);\n const failed: { name: string; error?: string | undefined }[] = [];\n try {\n for (const item of items) {\n try {\n const result = await onAttach(item.id, item.name);\n if (!result.ok) {\n failed.push({ name: item.name, error: result.error });\n }\n } catch (error: unknown) {\n store.errorSink({\n code: \"picker_attach_threw\",\n message: `[associations] attaching ${itemNoun} \"${item.name}\" threw`,\n context: { token, id: item.id, detail: error },\n });\n failed.push({\n name: item.name,\n error: error instanceof Error ? error.message : undefined,\n });\n }\n }\n const attached = items.length - failed.length;\n if (attached > 0) {\n notifier.success(\n attached === 1\n ? `Attached 1 ${itemNoun}`\n : `Attached ${attached} ${itemNoun}s`,\n );\n }\n if (failed.length > 0) {\n const first = failed[0];\n const detail = first?.error ? ` (${first.error})` : \"\";\n notifier.error(\n failed.length === 1\n ? `Couldn't attach \"${first?.name ?? itemNoun}\"${detail}`\n : `Couldn't attach ${failed.length} ${itemNoun}s${detail}`,\n {\n ...(createdLocationLabel\n ? {\n description: `The ${failed.length === 1 ? itemNoun + \" is\" : itemNoun + \"s are\"} safe in ${createdLocationLabel}. You can retry the association here.`,\n }\n : {}),\n ...(openCreatedLocation ? { action: openCreatedLocation } : {}),\n },\n );\n store.errorSink({\n code: \"picker_attach_partial\",\n message: `[associations] ${failed.length} of ${items.length} ${itemNoun}s were not attached`,\n context: { token, failed },\n });\n }\n } finally {\n setBusy(false);\n }\n },\n [\n createdLocationLabel,\n itemNoun,\n notifier,\n onAttach,\n openCreatedLocation,\n store,\n token,\n ],\n );\n\n const toggle = useCallback(\n async (item: PickerBridgeItem) => {\n setBusy(true);\n try {\n const detaching = attachedIds.has(item.id);\n const result = detaching\n ? await onDetach(item.id)\n : await onAttach(item.id, item.name);\n if (!result.ok) {\n const verb = detaching ? \"detach\" : \"attach\";\n notifier.error(\n `Couldn't ${verb} \"${item.name}\"` +\n (result.error ? `: ${result.error}` : \"\"),\n );\n store.errorSink({\n code: detaching ? \"picker_detach_failed\" : \"picker_attach_failed\",\n message: `[associations] ${verb} refused for \"${item.name}\"`,\n context: { token, id: item.id, error: result.error },\n });\n }\n } catch (error: unknown) {\n store.errorSink({\n code: \"picker_toggle_threw\",\n message: `[associations] toggling ${itemNoun} \"${item.name}\" threw`,\n context: { token, id: item.id, detail: error },\n });\n notifier.error(`Couldn't update \"${item.name}\"`);\n } finally {\n setBusy(false);\n }\n },\n [attachedIds, itemNoun, notifier, onAttach, onDetach, store, token],\n );\n\n return { attachMany, toggle, busy };\n}\n","// react/components/AssociationEntitySelect.tsx — @ai-matrx/associations/react\n//\n// The canonical \"name dropdown\" for one kind of associated entity on a\n// container — ONE compact control that handles every aspect of the name:\n//\n// 1. DISPLAY — the active entity's real name (registry icon beside it)\n// 2. RENAME — click (or double-click) the name to edit it inline\n// 3. SWITCH — a chevron opens the full list of associated entities,\n// searchable, with the active one checked\n// 4. ADD NEW — the list ends with \"+ New <Entity>\"; the user types a name\n// and the new entity is created, associated to the container,\n// and made active\n// 5. REMOVE — non-active rows offer an unlink X (when the adapter\n// supports detach)\n//\n// The dropdown is ALWAYS available — even with a single (or zero) entities —\n// so \"add another\" is never hidden. Registry-driven (icon/labels from the\n// store's registry merge engine), Redux-free, and adapter-driven: pass the\n// default `useAssociationEntitySelectAdapter` for plain platform.associations\n// containers, or a bespoke adapter when the surface has its own lifecycle\n// (e.g. war-room threads with is_active edge metadata).\n//\n// Ported VERBATIM from matrx-frontend\n// `features/scopes/components/associations/AssociationEntitySelect.tsx`\n// (W4 completion, 2026-08-29 — the face was gated on design-system 0.3.0's\n// Command family). Seams inverted:\n// • `getEntityInfo` → `store.registry.getEntityInfo` (host overlay merged;\n// `Icon: null` → the package `DefaultEntityIcon`);\n// • `@/lib/toast` → the notifier port (warn-once degradation);\n// • `EntityDoorControls` → the `DoorControlsSlot` (host port when bound,\n// otherwise the package's shipped hrefFor anchor — 0.6.0, C23) (absent →\n// the name renders without doors, per the design's degradation table);\n// • lucide glyphs → the package's inlined SVGs (C19);\n// • Popover/Command/EditableLabel → `@ai-matrx/design-system` (>=0.3.0).\n//\n// THE DOOR LAW: the name this control shows is a real record, so it carries its\n// doors — but the name itself CANNOT be a link (clicking it starts an inline\n// rename), so the door controls ride beside it as a sibling: peek, plus a\n// new tab. Same-tab open is withheld on purpose — this control lives in a\n// toolbar above live work (a war-room tile, a notes pane), and navigating away\n// would throw that work away to answer \"what is this thing?\". Every row in the\n// switcher gets the same doors.\n\nimport { useState } from \"react\";\nimport {\n cn,\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n EditableLabel,\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from \"@ai-matrx/design-system\";\n\nimport type { EntityTypeToken } from \"../../entity-types.generated\";\nimport { useAssociationsStore, useAssociationsUiPorts, useNotifier } from \"../context\";\nimport type { AssociationEntitySelectAdapter } from \"../hooks/useAssociationEntitySelect\";\nimport { DoorControlsSlot } from \"./entityDoors\";\nimport {\n CheckIcon,\n ChevronDownIcon,\n DefaultEntityIcon,\n PlusIcon,\n SpinnerIcon,\n XIcon,\n} from \"../icons\";\n\nexport interface AssociationEntitySelectProps {\n token: EntityTypeToken;\n adapter: AssociationEntitySelectAdapter;\n className?: string;\n /** Label sizing/typography override (defaults to toolbar-dense text-xs). */\n labelClassName?: string;\n align?: \"start\" | \"end\";\n showIcon?: boolean;\n /** How the name enters inline edit. Default \"click\". */\n renameActivation?: \"click\" | \"doubleClick\";\n /** Shown while no entity is active yet. Defaults to the plural label. */\n emptyLabel?: string;\n /** Icon color accent (e.g. \"text-yellow-500\" for notes). */\n iconClassName?: string;\n /**\n * Replaces the default \"+ New <Entity>\" name-input footer with a custom\n * creator (e.g. an agent picker that starts a new chat). Function form\n * receives `close` so the creator can dismiss the dropdown when done.\n */\n createSlot?: React.ReactNode | ((close: () => void) => React.ReactNode);\n}\n\nexport function AssociationEntitySelect({\n token,\n adapter,\n className,\n labelClassName,\n align = \"end\",\n showIcon = true,\n renameActivation = \"click\",\n emptyLabel,\n iconClassName,\n createSlot,\n}: AssociationEntitySelectProps) {\n const store = useAssociationsStore();\n const notifier = useNotifier();\n const info = store.registry.getEntityInfo(token);\n const InfoIcon = info.Icon ?? DefaultEntityIcon;\n const { items, activeId } = adapter;\n const active = items.find((i) => i.id === activeId) ?? null;\n const activeIndex = active ? items.indexOf(active) : -1;\n\n const [open, setOpen] = useState(false);\n const [query, setQuery] = useState(\"\");\n const [creating, setCreating] = useState(false);\n const [draftName, setDraftName] = useState(\"\");\n const [busy, setBusy] = useState(false);\n\n const entityLabel = info.label.toLowerCase();\n const close = () => {\n setOpen(false);\n setQuery(\"\");\n setCreating(false);\n setDraftName(\"\");\n };\n\n const create = async (title: string) => {\n const name = title.trim();\n if (!name || busy || !adapter.createAndAttach) return;\n setBusy(true);\n const id = await adapter.createAndAttach(name);\n setBusy(false);\n if (id) close();\n else notifier.error(`Couldn't create the ${entityLabel}`);\n };\n\n return (\n <div\n className={cn(\n \"group/entity-ref flex min-w-0 items-center gap-0.5\",\n className,\n )}\n >\n {showIcon ? (\n <InfoIcon\n className={cn(\n \"size-3.5 shrink-0\",\n iconClassName ?? \"text-muted-foreground\",\n )}\n aria-hidden\n />\n ) : null}\n\n {active ? (\n <EditableLabel\n value={active.title}\n onCommit={async (next) => {\n const ok = await adapter.rename(active.id, next);\n if (!ok) {\n notifier.error(`Couldn't rename the ${entityLabel}`);\n throw new Error(\"rename failed\");\n }\n }}\n commitMode=\"await\"\n activation={renameActivation}\n ariaLabel={info.label}\n className={cn(\"max-w-[14rem]\", labelClassName)}\n displayClassName=\"text-xs font-medium text-foreground\"\n inputClassName=\"text-xs font-medium\"\n />\n ) : null}\n\n {active ? (\n <DoorControlsSlot token={token} id={active.id} name={active.title} />\n ) : null}\n\n {!active ? (\n <span\n className={cn(\n \"truncate px-1 text-xs font-medium text-muted-foreground\",\n labelClassName,\n )}\n >\n {adapter.loading ? \"…\" : (emptyLabel ?? info.labelPlural)}\n </span>\n ) : null}\n\n <Popover\n open={open}\n onOpenChange={(next) => (next ? setOpen(true) : close())}\n >\n <PopoverTrigger asChild>\n <button\n type=\"button\"\n className=\"inline-flex h-6 shrink-0 items-center gap-0.5 rounded-md px-1 text-[10px] font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-foreground\"\n title={`Switch or add ${info.labelPlural.toLowerCase()}`}\n aria-label={`Switch or add ${info.labelPlural.toLowerCase()}`}\n >\n {items.length > 1 ? (\n <span className=\"tabular-nums\">\n {activeIndex >= 0 ? activeIndex + 1 : \"—\"}/{items.length}\n </span>\n ) : null}\n <ChevronDownIcon className=\"size-3 opacity-60\" />\n </button>\n </PopoverTrigger>\n <PopoverContent className=\"w-60 p-0\" align={align}>\n <Command>\n {items.length > 5 ? (\n <CommandInput\n value={query}\n onValueChange={setQuery}\n placeholder={`Search ${info.labelPlural.toLowerCase()}…`}\n />\n ) : null}\n <CommandList>\n <CommandEmpty>No match.</CommandEmpty>\n {items.length > 0 ? (\n <CommandGroup>\n {items.map((item) => (\n <CommandItem\n key={item.id}\n value={`${item.title} ${item.id}`}\n onSelect={() => {\n if (item.id !== activeId)\n void adapter.setActive(item.id);\n close();\n }}\n className=\"group/entity-ref group gap-2\"\n >\n <CheckIcon\n className={cn(\n \"size-3.5 shrink-0\",\n item.id === activeId ? \"opacity-100\" : \"opacity-0\",\n )}\n />\n <span className=\"min-w-0 flex-1 truncate\">\n {item.title}\n </span>\n {/* Doors, as siblings of the row's select handler.\n `onPointerDown` is swallowed for the same reason the\n unlink button below swallows it: cmdk would otherwise\n take focus and select the row out from under the\n control. */}\n <span\n className=\"inline-flex shrink-0 items-center\"\n onPointerDown={(e) => {\n e.preventDefault();\n e.stopPropagation();\n }}\n >\n <DoorControlsSlot\n token={token}\n id={item.id}\n name={item.title}\n />\n </span>\n {adapter.detach && item.id !== activeId ? (\n <button\n type=\"button\"\n onPointerDown={(e) => {\n e.preventDefault();\n e.stopPropagation();\n }}\n onClick={(e) => {\n e.stopPropagation();\n void adapter.detach?.(item.id);\n }}\n className=\"grid size-5 shrink-0 place-items-center rounded text-muted-foreground opacity-0 transition-opacity hover:bg-accent hover:text-destructive group-hover:opacity-100\"\n title={`Remove this ${entityLabel} from here (does not delete it)`}\n aria-label={`Remove ${item.title}`}\n >\n <XIcon className=\"size-3\" />\n </button>\n ) : null}\n </CommandItem>\n ))}\n </CommandGroup>\n ) : null}\n </CommandList>\n\n {/* Create footer — outside CommandList so search never hides it. */}\n {createSlot !== undefined ? (\n <div className=\"border-t border-border p-1\">\n {typeof createSlot === \"function\"\n ? createSlot(close)\n : createSlot}\n </div>\n ) : null}\n {createSlot === undefined && adapter.createAndAttach ? (\n <div className=\"border-t border-border p-1\">\n {creating ? (\n <div className=\"flex items-center gap-1 px-1 py-0.5\">\n <input\n autoFocus\n type=\"text\"\n value={draftName}\n disabled={busy}\n placeholder={`New ${entityLabel} name…`}\n onChange={(e) => setDraftName(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === \"Enter\") {\n e.preventDefault();\n void create(draftName);\n } else if (e.key === \"Escape\") {\n e.preventDefault();\n e.stopPropagation();\n setCreating(false);\n setDraftName(\"\");\n }\n }}\n className=\"h-6 w-full min-w-0 rounded-sm bg-transparent px-1 text-base outline-none focus:bg-background focus:ring-1 focus:ring-ring md:text-xs\"\n aria-label={`New ${entityLabel} name`}\n />\n <button\n type=\"button\"\n disabled={busy || !draftName.trim()}\n onClick={() => void create(draftName)}\n className=\"inline-flex h-6 shrink-0 items-center rounded-md px-1.5 text-[10px] font-medium text-primary transition-colors hover:bg-accent disabled:opacity-50\"\n >\n {busy ? (\n <SpinnerIcon className=\"size-3 animate-spin\" />\n ) : (\n \"Create\"\n )}\n </button>\n </div>\n ) : (\n <button\n type=\"button\"\n disabled={busy}\n onClick={() => {\n // A typed search that matched nothing doubles as the new\n // name — one click instead of retyping it.\n if (query.trim()) void create(query);\n else setCreating(true);\n }}\n className=\"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground\"\n >\n {busy ? (\n <SpinnerIcon className=\"size-3.5 animate-spin\" />\n ) : (\n <PlusIcon className=\"size-3.5\" />\n )}\n {query.trim()\n ? `Create \"${query.trim()}\"`\n : `New ${info.label}`}\n </button>\n )}\n </div>\n ) : null}\n </Command>\n </PopoverContent>\n </Popover>\n </div>\n );\n}\n","// react/components/CategorySelect.tsx — @ai-matrx/associations/react\n//\n// THE single-value picker over one `platform.categories` dimension. ONE\n// component for every category anywhere in the app: pass the `dimension` and it\n// renders that facet's categories, hierarchy and all. There is no per-feature\n// copy and there must never be one — the rules do not change between features.\n//\n// Value is the category ID (the FK the consuming table stores), display is the\n// category name. Reads and writes go through the canonical `useCategories`\n// hook (`cat_list` / `cat_create`), never a bespoke query.\n//\n// 🚨 IT TAKES NEW INPUT (P23). Type a name that does not exist and it offers to\n// create it, then selects it — because the moment someone wants to teach the\n// system a category they did not have is the moment worth the most, and a\n// picker that says \"choose from these\" instead is how the platform loses its\n// best users. Its multi-select sibling `CategoryTagPicker` has always done\n// this; the two were inconsistent for no reason, and now are not.\n//\n// Creating requires an explicit organization — a new category belongs to that\n// organization, never to a resolver default or the system set (those are\n// platform-governed; `isSystem` rows are read-only here by design).\n//\n// Ported VERBATIM from matrx-frontend\n// `features/scopes/components/CategorySelect.tsx` (W4 completion, 2026-08-29 —\n// the face was gated on design-system 0.3.0's CreatablePicker + Select).\n// Seams inverted:\n// • the Redux active-organization read (`selectOrganizationId`) → the\n// identity port's optional `ensureOrgId()` (the design's seam-table home\n// for org resolution): `orgId` prop wins; otherwise `ensureOrgId()` is\n// asked; with neither, create refuses LOUDLY (notifier + errorSink) —\n// never a row stamped with a guessed org;\n// • `@/lib/toast` → the notifier port (warn-once degradation);\n// • `useCategories`/`buildCategoryHierarchy` → the package's own;\n// • the lucide `CornerDownRight` → the package's inlined SVG (C19);\n// • CreatablePicker/Select → `@ai-matrx/design-system` (>=0.3.0).\n\nimport { useState } from \"react\";\nimport {\n CreatablePicker,\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"@ai-matrx/design-system\";\n\nimport type { CategoryDimension } from \"../../edges\";\nimport { buildCategoryHierarchy } from \"../../core/categoryHierarchy\";\nimport { useAssociationsStore, useNotifier } from \"../context\";\nimport { useCategories } from \"../hooks/useCategories\";\nimport { CornerDownRightIcon } from \"../icons\";\n\nconst NONE = \"__none__\";\nconst ROOT_PARENT = \"__root__\";\n\n/** \"category\" → \"categories\", \"stage\" → \"stages\". Copy a person reads. */\nfunction plural(noun: string): string {\n return /[^aeiou]y$/i.test(noun) ? `${noun.slice(0, -1)}ies` : `${noun}s`;\n}\n\nexport interface CategorySelectProps {\n dimension: CategoryDimension;\n value: string | null;\n onChange: (id: string | null) => void;\n placeholder: string;\n allowNone?: boolean;\n disabled?: boolean;\n /**\n * Offer \"Create «what you typed»\". On by default — a closed category list is\n * a defect, so turning this off needs a reason a person would accept.\n */\n allowCreate?: boolean;\n /**\n * Org for an inline-created category. Defaults to the identity port's\n * `ensureOrgId()`; with neither, create refuses loudly.\n */\n orgId?: string | null;\n /** What one of these is called, for the create affordance (\"stage\", \"folder\"). */\n noun?: string;\n}\n\nexport function CategorySelect({\n dimension,\n value,\n onChange,\n placeholder,\n allowNone = true,\n disabled,\n allowCreate = true,\n orgId,\n noun = \"category\",\n}: CategorySelectProps) {\n const store = useAssociationsStore();\n const notifier = useNotifier();\n const {\n categories,\n status,\n error,\n create: createCategory,\n reload,\n } = useCategories({ dimension });\n const hierarchy = buildCategoryHierarchy(categories);\n const [createParentId, setCreateParentId] = useState<string>(ROOT_PARENT);\n\n const options = [\n ...(allowNone\n ? [{ value: NONE, label: \"None\", keywords: \"none clear empty\" }]\n : []),\n ...(hierarchy.hasHierarchy\n ? hierarchy.items.map(({ category, depth, parent }) => ({\n value: category.id,\n label: category.name,\n // The type-ahead matches the parent's name too, so someone who knows\n // the branch but not the leaf still finds it.\n keywords: parent ? parent.name : \"\",\n render:\n depth === 0 ? (\n <span className=\"font-medium\">{category.name}</span>\n ) : (\n <span className=\"flex items-center gap-1.5 pl-3 text-muted-foreground\">\n <CornerDownRightIcon className=\"h-3.5 w-3.5 shrink-0\" />\n <span className=\"text-foreground\">{category.name}</span>\n </span>\n ),\n }))\n : categories.map((category) => ({\n value: category.id,\n label: category.name,\n }))),\n ];\n\n const selected = value\n ? (hierarchy.items.find((item) => item.category.id === value)?.displayName ??\n categories.find((category) => category.id === value)?.name ??\n null)\n : null;\n\n const create = async (typed: string): Promise<string | null> => {\n const name = typed.trim();\n if (!name) return null;\n // Typing a name that already exists selects it rather than making a twin.\n const existing = categories.find(\n (category) => category.name.toLowerCase() === name.toLowerCase(),\n );\n if (existing) return existing.id;\n\n let resolvedOrgId = orgId ?? null;\n if (!resolvedOrgId && store.identity.ensureOrgId) {\n try {\n resolvedOrgId = await store.identity.ensureOrgId();\n } catch (e) {\n store.errorSink({\n code: \"ensure_org_failed\",\n message: \"[CategorySelect] identity.ensureOrgId threw\",\n context: { error: e instanceof Error ? e.message : String(e) },\n });\n }\n }\n if (!resolvedOrgId) {\n notifier.error(`Select an organization before creating a ${noun}.`);\n return null;\n }\n const parentId =\n hierarchy.hasHierarchy && createParentId !== ROOT_PARENT\n ? createParentId\n : null;\n const result = await createCategory({ name, orgId: resolvedOrgId, parentId });\n if (!result.ok || !result.id) {\n notifier.error(`Couldn't create that ${noun}`, {\n ...(result.error != null ? { description: result.error } : {}),\n });\n return null;\n }\n await reload();\n setCreateParentId(ROOT_PARENT);\n const under = parentId\n ? categories.find((category) => category.id === parentId)?.name\n : null;\n notifier.success(\n `“${name}” is now one of your ${plural(noun)}${\n under\n ? ` — it sits under ${under}, and every screen that offers ${plural(noun)} offers it.`\n : ` — every screen that offers ${plural(noun)} offers it from now on.`\n }`,\n );\n return result.id;\n };\n\n return (\n <div>\n <CreatablePicker\n value={value ?? (allowNone ? NONE : null)}\n onSelect={(next) => onChange(next === NONE ? null : next)}\n options={options}\n placeholder={placeholder}\n searchPlaceholder={\n allowCreate ? `Search or add a ${noun}…` : `Search ${plural(noun)}…`\n }\n noun={noun}\n ariaLabel={placeholder}\n // The old control was h-8/text-sm; keeping it means none of the twelve\n // consuming forms shift when they pick this up.\n className=\"text-sm\"\n {...(disabled !== undefined ? { disabled } : {})}\n loading={status === \"loading\"}\n emptyLabel={`No ${noun} matches that.`}\n {...(allowCreate ? { onCreate: create } : {})}\n {...(allowCreate && hierarchy.hasHierarchy\n ? {\n createExtra: (\n <Select value={createParentId} onValueChange={setCreateParentId}>\n <SelectTrigger\n className=\"h-7 text-xs\"\n aria-label={`Put the new ${noun} under`}\n >\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value={ROOT_PARENT} className=\"text-xs\">\n Top level\n </SelectItem>\n {hierarchy.items\n .filter((item) => item.depth === 0)\n .map((item) => (\n <SelectItem\n key={item.category.id}\n value={item.category.id}\n className=\"text-xs\"\n >\n Under {item.category.name}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n ),\n }\n : {})}\n />\n {selected === null && value !== null ? (\n // A stored id whose row this reader cannot see is not \"nothing chosen\":\n // saying so beats a blank box that looks like an unsaved field.\n <p className=\"mt-1 text-xs text-muted-foreground\">\n This {noun} is no longer available to you.\n </p>\n ) : null}\n {error ? <p className=\"mt-1 text-xs text-destructive\">{error}</p> : null}\n </div>\n );\n}\n","// core/categoryHierarchy.ts — @ai-matrx/associations/core\n//\n// The canonical two-level display order for one category facet — ported\n// VERBATIM from matrx-frontend `features/scopes/utils/categoryHierarchy.ts`\n// (W4 completion, 2026-08-29). Pure data → data, React-free, so it lives in\n// /core beside the category service; the `CategorySelect` /\n// `CategoryTagPicker` faces are its measured consumers.\n\nimport type { PlatformCategory } from \"../edges\";\n\nexport interface CategoryHierarchyItem {\n category: PlatformCategory;\n depth: 0 | 1;\n parent: PlatformCategory | null;\n displayName: string;\n}\n\nexport interface CategoryHierarchy {\n items: CategoryHierarchyItem[];\n roots: PlatformCategory[];\n hasHierarchy: boolean;\n}\n\n/**\n * Turns the RPC's ordered flat rows into the canonical two-level display order.\n * Flat facets retain their exact input order. Invalid/orphaned rows remain\n * visible at the root; the database guard prevents new ones from being made.\n */\nexport function buildCategoryHierarchy(\n categories: PlatformCategory[],\n): CategoryHierarchy {\n const byId = new Map(categories.map((category) => [category.id, category]));\n const hasHierarchy = categories.some(\n (category) => category.parentId !== null && byId.has(category.parentId),\n );\n\n if (!hasHierarchy) {\n return {\n items: categories.map((category) => ({\n category,\n depth: 0,\n parent: null,\n displayName: category.name,\n })),\n roots: categories.filter((category) => category.parentId === null),\n hasHierarchy: false,\n };\n }\n\n const roots = categories.filter(\n (category) => category.parentId === null || !byId.has(category.parentId),\n );\n const childrenByParent = new Map<string, PlatformCategory[]>();\n for (const category of categories) {\n if (!category.parentId || !byId.has(category.parentId)) continue;\n const children = childrenByParent.get(category.parentId) ?? [];\n children.push(category);\n childrenByParent.set(category.parentId, children);\n }\n\n const items: CategoryHierarchyItem[] = [];\n const seen = new Set<string>();\n for (const root of roots) {\n items.push({\n category: root,\n depth: 0,\n parent: null,\n displayName: root.name,\n });\n seen.add(root.id);\n\n for (const child of childrenByParent.get(root.id) ?? []) {\n items.push({\n category: child,\n depth: 1,\n parent: root,\n displayName: `${root.name} / ${child.name}`,\n });\n seen.add(child.id);\n }\n }\n\n // Loud database guards make this fallback unreachable for valid data, but a\n // picker must never hide an identity merely because older data is malformed.\n for (const category of categories) {\n if (seen.has(category.id)) continue;\n items.push({\n category,\n depth: 0,\n parent: null,\n displayName: category.name,\n });\n }\n\n return {\n items,\n roots: categories.filter((category) => category.parentId === null),\n hasHierarchy: true,\n };\n}\n","// react/components/CategoryTagPicker.tsx — @ai-matrx/associations/react\n//\n// THE multi-select picker that tags an entity with `platform.categories` rows\n// through the canonical association edge (`entity → category`, one typed edge\n// role per use). The generic form of the flashcards FolderTagPicker — that\n// component is a thin wrapper over this one, and CRM party roles consume\n// it directly. Never fork a per-feature tag picker.\n//\n// Reads/writes go through the canonical `useCategories` (category nouns) +\n// `useAssociations` (assignment edges) hooks — never a bespoke table or a\n// direct service call.\n//\n// EDGE SEMANTICS: `setTargets` replaces ALL of this entity's category edges\n// carrying `edgeRole`. To keep edges from OTHER dimensions that share the same\n// role intact, the toggle set starts from every current category edge with\n// this role (not just this dimension's) — same contract FolderTagPicker\n// established. Prefer a distinct edge role per dimension when registering\n// association pairs.\n//\n// Ported VERBATIM from matrx-frontend\n// `features/scopes/components/CategoryTagPicker.tsx` (W4 completion,\n// 2026-08-29 — the face was gated on design-system 0.3.0's Command family +\n// Select). Seams inverted:\n// • `ensureOrgId` (`@/lib/organizations/personalOrg` — the host-shaped\n// personal-org resolver) → the identity port's optional `ensureOrgId()`\n// per the design's seam table: the `orgId` prop wins; otherwise\n// `identity.ensureOrgId()` is asked; with neither, create refuses LOUDLY\n// (notifier + errorSink) — never a row stamped with a guessed org;\n// • `@/lib/toast` → the notifier port; `console.error` → the errorSink;\n// • `useCategories`/`useAssociations`/`buildCategoryHierarchy` → the\n// package's own;\n// • lucide glyphs → the package's inlined SVGs (C19); the `icon` prop's\n// `LucideIcon` type → a structural icon component type;\n// • Button/Popover/Command/Badge/Select → `@ai-matrx/design-system`\n// (>=0.3.0).\n\nimport { useState, type ComponentType } from \"react\";\nimport {\n Badge,\n Button,\n cn,\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n Popover,\n PopoverContent,\n PopoverTrigger,\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"@ai-matrx/design-system\";\n\nimport type { CategoryDimension } from \"../../edges\";\nimport { buildCategoryHierarchy } from \"../../core/categoryHierarchy\";\nimport { useAssociationsStore, useNotifier } from \"../context\";\nimport { useAssociations } from \"../hooks/useAssociations\";\nimport { useCategories } from \"../hooks/useCategories\";\nimport {\n CheckIcon,\n ChevronsUpDownIcon,\n CornerDownRightIcon,\n SpinnerIcon,\n TagIcon,\n XIcon,\n} from \"../icons\";\n\nconst ROOT_PARENT = \"__root__\";\n\n/** Structural stand-in for the host's `LucideIcon` on the `icon` prop. */\nexport type TagPickerIcon = ComponentType<{ className?: string }>;\n\nexport interface CategoryTagPickerProps {\n /** The tagged entity's registered association type (e.g. \"fc_set\", \"party\"). */\n entityType: string;\n entityId: string;\n /** The `platform.categories` facet the picker offers. */\n dimension: CategoryDimension;\n /** The typed edge role the assignment edges carry (e.g. \"theme\", \"member\"). */\n edgeRole: string;\n /**\n * Org for the edge write and for inline-created categories. Defaults to the\n * identity port's `ensureOrgId()` (create only) — pass the owning entity's\n * org when it has one.\n */\n orgId?: string | null;\n /** Trigger label while nothing is selected. */\n addLabel?: string;\n /** Trigger icon. */\n icon?: TagPickerIcon;\n /** Offer \"Create <term>\" for unmatched search terms. Default true. */\n allowCreate?: boolean;\n /**\n * Force the two-level face on or off. Omit to detect it from parentId rows,\n * which leaves every existing flat facet visually unchanged.\n */\n hierarchical?: boolean;\n emptyText?: string;\n}\n\n/**\n * Multi-select combobox: badges for the entity's current tags in `dimension`,\n * a popover to toggle existing categories, optional inline create. Fully\n * self-contained — mount it once per entity and it reads/writes the edges.\n */\nexport function CategoryTagPicker({\n entityType,\n entityId,\n dimension,\n edgeRole,\n orgId,\n addLabel = \"Add tag\",\n icon: Icon = TagIcon,\n allowCreate = true,\n hierarchical,\n emptyText = \"No categories yet.\",\n}: CategoryTagPickerProps) {\n const store = useAssociationsStore();\n const notifier = useNotifier();\n const [open, setOpen] = useState(false);\n const [creating, setCreating] = useState(false);\n // Writes replace the full role-set from a render-time snapshot of the\n // edges, so overlapping toggles would silently drop the first change.\n // One write at a time.\n const [writing, setWriting] = useState(false);\n const [search, setSearch] = useState(\"\");\n const [createParentId, setCreateParentId] = useState(ROOT_PARENT);\n const {\n categories,\n create: createCategory,\n reload: reloadCategories,\n } = useCategories({ dimension });\n const { edges, setTargets } = useAssociations({\n type: entityType,\n id: entityId,\n });\n const hierarchy = buildCategoryHierarchy(categories);\n const showHierarchy = hierarchical ?? hierarchy.hasHierarchy;\n const hierarchyById = new Map(\n hierarchy.items.map((item) => [item.category.id, item]),\n );\n\n // Every current category edge with this role — INCLUDING other dimensions'\n // (see EDGE SEMANTICS above); display intersects with this dimension.\n const selectedIds = new Set(\n edges\n .filter(\n (e) =>\n e.direction === \"outgoing\" &&\n e.otherType === \"category\" &&\n e.role === edgeRole,\n )\n .map((e) => e.otherId),\n );\n const selected = categories.filter((c) => selectedIds.has(c.id));\n\n const toggle = async (categoryId: string) => {\n if (writing) return;\n setWriting(true);\n try {\n const next = selectedIds.has(categoryId)\n ? [...selectedIds].filter((id) => id !== categoryId)\n : [...selectedIds, categoryId];\n const res = await setTargets({\n targetType: \"category\",\n targetIds: next,\n ...(orgId != null ? { orgId } : {}),\n role: edgeRole,\n });\n if (!res.ok) {\n store.errorSink({\n code: \"category_tag_set_targets_failed\",\n message: \"[CategoryTagPicker] setTargets failed\",\n context: { entityType, entityId, edgeRole, error: res.error },\n });\n notifier.error(res.error ?? \"Could not update categories\");\n }\n } finally {\n setWriting(false);\n }\n };\n\n const createAndAttach = async () => {\n const name = search.trim();\n if (!name) return;\n setCreating(true);\n try {\n let resolvedOrgId = orgId ?? null;\n if (!resolvedOrgId && store.identity.ensureOrgId) {\n try {\n resolvedOrgId = await store.identity.ensureOrgId();\n } catch (e) {\n store.errorSink({\n code: \"ensure_org_failed\",\n message: \"[CategoryTagPicker] identity.ensureOrgId threw\",\n context: { error: e instanceof Error ? e.message : String(e) },\n });\n }\n }\n if (!resolvedOrgId) {\n store.errorSink({\n code: \"ensure_org_missing\",\n message:\n \"[CategoryTagPicker] no org for the created category — pass \" +\n \"`orgId` or bind `identity.ensureOrgId` on the store config\",\n context: { entityType, entityId, dimension },\n });\n notifier.error(\n \"Could not create the category — no organization is selected\",\n );\n return;\n }\n const parentId =\n showHierarchy && createParentId !== ROOT_PARENT ? createParentId : null;\n const createRes = await createCategory({\n name,\n orgId: resolvedOrgId,\n parentId,\n });\n if (!createRes.ok || !createRes.id) {\n store.errorSink({\n code: \"category_tag_create_failed\",\n message: \"[CategoryTagPicker] create failed\",\n context: { dimension, error: createRes.error },\n });\n notifier.error(createRes.error ?? \"Could not create the category\");\n return;\n }\n await reloadCategories();\n await toggle(createRes.id);\n setSearch(\"\");\n setCreateParentId(ROOT_PARENT);\n } finally {\n setCreating(false);\n }\n };\n\n const filtered = categories.filter((c) =>\n c.name.toLowerCase().includes(search.trim().toLowerCase()),\n );\n const filteredHierarchy = hierarchy.items.filter((item) =>\n item.displayName.toLowerCase().includes(search.trim().toLowerCase()),\n );\n const exactMatch = categories.some(\n (c) => c.name.toLowerCase() === search.trim().toLowerCase(),\n );\n\n return (\n <div className=\"flex flex-wrap items-center gap-1.5\">\n {selected.map((c) => (\n <Badge\n key={c.id}\n variant=\"secondary\"\n className=\"gap-1 pr-1 text-xs font-medium\"\n >\n {showHierarchy\n ? (hierarchyById.get(c.id)?.displayName ?? c.name)\n : c.name}\n <button\n type=\"button\"\n onClick={() => void toggle(c.id)}\n className=\"ml-0.5 rounded-full p-0.5 hover:bg-muted-foreground/20\"\n aria-label={`Remove ${c.name}`}\n >\n <XIcon className=\"h-2.5 w-2.5\" />\n </button>\n </Badge>\n ))}\n\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <Button\n variant=\"outline\"\n size=\"sm\"\n className=\"h-7 gap-1 px-2 text-xs\"\n >\n <Icon className=\"h-3.5 w-3.5\" />\n {selected.length === 0 ? addLabel : \"Edit\"}\n <ChevronsUpDownIcon className=\"h-3 w-3 opacity-50\" />\n </Button>\n </PopoverTrigger>\n <PopoverContent className=\"w-56 p-0\" align=\"start\">\n <Command shouldFilter={false}>\n <CommandInput\n placeholder={allowCreate ? \"Search or create...\" : \"Search...\"}\n value={search}\n onValueChange={setSearch}\n />\n <CommandList>\n <CommandEmpty className=\"px-2 py-3 text-xs text-muted-foreground\">\n {search.trim() ? \"No match.\" : emptyText}\n </CommandEmpty>\n <CommandGroup>\n {showHierarchy\n ? filteredHierarchy.map(({ category, depth, parent }) => (\n <CommandItem\n key={category.id}\n value={category.id}\n keywords={parent ? [parent.name, category.name] : []}\n onSelect={() => void toggle(category.id)}\n className={cn(\"text-xs\", depth === 1 && \"pl-6\")}\n >\n <CheckIcon\n className={cn(\n \"mr-2 h-3.5 w-3.5\",\n selectedIds.has(category.id)\n ? \"opacity-100\"\n : \"opacity-0\",\n )}\n />\n {depth === 1 ? (\n <CornerDownRightIcon className=\"mr-1.5 h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n ) : null}\n <span className={cn(depth === 0 && \"font-medium\")}>\n {category.name}\n </span>\n </CommandItem>\n ))\n : filtered.map((c) => (\n <CommandItem\n key={c.id}\n value={c.id}\n onSelect={() => void toggle(c.id)}\n className=\"text-xs\"\n >\n <CheckIcon\n className={cn(\n \"mr-2 h-3.5 w-3.5\",\n selectedIds.has(c.id) ? \"opacity-100\" : \"opacity-0\",\n )}\n />\n {c.name}\n </CommandItem>\n ))}\n </CommandGroup>\n {allowCreate && search.trim() && !exactMatch ? (\n <CommandGroup>\n {showHierarchy ? (\n <div className=\"space-y-1.5 px-2 pb-2\">\n <p className=\"text-[11px] font-medium text-muted-foreground\">\n Place in\n </p>\n <Select\n value={createParentId}\n onValueChange={setCreateParentId}\n >\n <SelectTrigger size=\"sm\" className=\"bg-background\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value={ROOT_PARENT}>Top level</SelectItem>\n {hierarchy.roots.map((root) => (\n <SelectItem key={root.id} value={root.id}>\n {root.name}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n ) : null}\n <CommandItem\n value={`__create__${search}`}\n onSelect={() => void createAndAttach()}\n disabled={creating}\n className=\"text-xs text-primary\"\n >\n {creating ? (\n <SpinnerIcon className=\"mr-2 h-3.5 w-3.5 animate-spin\" />\n ) : (\n <Icon className=\"mr-2 h-3.5 w-3.5\" />\n )}\n Create &ldquo;{search.trim()}&rdquo;\n </CommandItem>\n </CommandGroup>\n ) : null}\n </CommandList>\n </Command>\n </PopoverContent>\n </Popover>\n </div>\n );\n}\n","// react/components/CommentThread.tsx — @ai-matrx/associations/react\n//\n// THE canonical comments UI (W6, ruling C4: built IN the package — a\n// greenfield build; no matrx-frontend components existed to port). Drop it on\n// any surface with a bound AssociationsProvider and hand it an entity:\n//\n// <CommentThread token=\"task\" id={taskId} />\n//\n// One threaded comment list over the `platform.comments` primitive\n// (`useComments` → the /core store → the four `cmt_*` demanded RPCs):\n// top-level comments oldest→newest with nested replies, a composer, per-item\n// reply, and edit/delete-own — the RPCs are the authority on who may write\n// (edit is author-only, delete is author-or-org-member); the UI only gates\n// the AFFORDANCES by the lenient identity read, so a stale gate degrades to\n// a loud server refusal, never a silent success.\n//\n// Ports and degradations:\n// • authorDisplay (optional) — host profile enrichment; absent → the\n// RPC's denormalized author fields, \"Unknown user\" + initial avatar as\n// the last resort. Never blank.\n// • entityDoors.EntityRef (optional) — author names become doors to the\n// user entity; absent → plain text names.\n// • notifier (optional) — failure toasts; absent → the provider's\n// documented warn-once + errorSink routing. Failures ALSO render inline.\n// • Chrome from @ai-matrx/design-system (peer >=0.3.0); glyphs inlined\n// (C19).\n//\n// Destructive-click law: Delete stops and names the consequence inline\n// (\"Deletes this comment (and its replies' context) for everyone.\") before\n// the destructive click exists. Composer text is NEVER lost on a failed\n// post — the body stays in the box alongside the inline error.\n\nimport { useState, type FormEvent, type ReactNode } from \"react\";\nimport { Button, Skeleton, cn } from \"@ai-matrx/design-system\";\n\nimport type { PlatformComment } from \"../../comments\";\nimport type { EntityTypeToken } from \"../../entity-types.generated\";\nimport type { AuthorDisplayPort, EntityDoorsPort } from \"../../ports\";\nimport { useAssociationsUiPorts, useNotifier } from \"../context\";\nimport { useComments, type UseCommentsReturn } from \"../hooks/useComments\";\nimport { CornerDownRightIcon, RefreshIcon, SpinnerIcon } from \"../icons\";\nimport { formatRelativeTime } from \"../relativeTime\";\n\n/** The token the author-name door opens (auth users surface as `user`). */\nconst AUTHOR_DOOR_TOKEN = \"user\";\n\nexport interface CommentThreadProps {\n /** Entity-type token of the commented-on entity. */\n token: EntityTypeToken;\n /** The entity's row id. */\n id: string;\n /** Org override forwarded to `cmt_add` (the RPC resolves one when omitted). */\n orgId?: string | null;\n /** Hide the slim \"Comments · n\" header row. Defaults to shown. */\n showHeader?: boolean;\n className?: string;\n}\n\n// ─── author chrome (authorDisplay + entityDoors degradations) ───────────────\n\ninterface ResolvedAuthor {\n name: string;\n avatarUrl: string | null;\n userId: string | null;\n}\n\nfunction resolveAuthor(\n comment: PlatformComment,\n authorDisplay: AuthorDisplayPort | undefined,\n): ResolvedAuthor {\n const base = {\n userId: comment.createdBy,\n email: comment.author.email,\n displayName: comment.author.displayName,\n avatarUrl: comment.author.avatarUrl,\n };\n const enriched = authorDisplay ? authorDisplay(base) : null;\n const name =\n enriched?.displayName ??\n base.displayName ??\n base.email ??\n \"Unknown user\";\n return {\n name,\n avatarUrl:\n enriched?.avatarUrl !== undefined && enriched?.avatarUrl !== null\n ? enriched.avatarUrl\n : base.avatarUrl,\n userId: comment.createdBy,\n };\n}\n\nfunction AuthorAvatar({ author }: { author: ResolvedAuthor }) {\n if (author.avatarUrl) {\n return (\n <img\n src={author.avatarUrl}\n alt=\"\"\n className=\"h-6 w-6 shrink-0 rounded-full object-cover\"\n />\n );\n }\n return (\n <span\n aria-hidden\n className=\"flex h-6 w-6 shrink-0 select-none items-center justify-center rounded-full bg-muted text-[11px] font-medium uppercase text-muted-foreground\"\n >\n {author.name.trim().charAt(0) || \"?\"}\n </span>\n );\n}\n\nfunction AuthorName({\n author,\n entityDoors,\n}: {\n author: ResolvedAuthor;\n entityDoors: EntityDoorsPort | undefined;\n}) {\n const DoorRef = entityDoors?.EntityRef;\n if (DoorRef && author.userId) {\n return (\n <DoorRef\n token={AUTHOR_DOOR_TOKEN}\n id={author.userId}\n name={author.name}\n showIcon={false}\n className=\"text-sm font-medium text-foreground\"\n />\n );\n }\n return (\n <span className=\"text-sm font-medium text-foreground\">{author.name}</span>\n );\n}\n\n// ─── composer ───────────────────────────────────────────────────────────────\n\nexport interface CommentComposerProps {\n /** Post the body; resolve `{ok:false}` to keep the text + show the error. */\n onSubmit: (body: string) => Promise<{ ok: boolean; error?: string }>;\n placeholder?: string;\n submitLabel?: string;\n /** Initial body (the edit flow seeds the current text). */\n initialValue?: string;\n /** Rendered right of the submit button (the Cancel affordance). */\n trailing?: ReactNode;\n autoFocus?: boolean;\n}\n\n/**\n * The one composer every comment write goes through (new comment, reply,\n * edit). Submit on the button or Cmd/Ctrl+Enter; the text survives a failed\n * submit alongside the inline error (input is never lost).\n */\nexport function CommentComposer({\n onSubmit,\n placeholder = \"Write a comment…\",\n submitLabel = \"Comment\",\n initialValue = \"\",\n trailing,\n autoFocus = false,\n}: CommentComposerProps) {\n const notifier = useNotifier();\n const [body, setBody] = useState(initialValue);\n const [submitting, setSubmitting] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n async function submit(e?: FormEvent) {\n e?.preventDefault();\n const trimmed = body.trim();\n if (!trimmed || submitting) return;\n setSubmitting(true);\n setError(null);\n const res = await onSubmit(trimmed);\n setSubmitting(false);\n if (!res.ok) {\n const msg = res.error ?? \"Could not save the comment\";\n setError(msg);\n notifier.error(msg);\n return; // the body stays — user input is never lost\n }\n setBody(\"\");\n }\n\n return (\n <form onSubmit={submit} className=\"flex flex-col gap-1.5\">\n <textarea\n value={body}\n onChange={(e) => setBody(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === \"Enter\" && (e.metaKey || e.ctrlKey)) void submit();\n }}\n placeholder={placeholder}\n rows={2}\n autoFocus={autoFocus}\n aria-label={placeholder}\n className=\"w-full resize-y rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring\"\n />\n {error && (\n <p role=\"alert\" className=\"text-xs text-destructive\">\n {error}\n </p>\n )}\n <div className=\"flex items-center gap-2\">\n <Button type=\"submit\" size=\"sm\" disabled={!body.trim() || submitting}>\n {submitting && (\n <SpinnerIcon className=\"mr-1 h-3 w-3 animate-spin\" />\n )}\n {submitLabel}\n </Button>\n {trailing}\n </div>\n </form>\n );\n}\n\n// ─── one comment (recursive) ────────────────────────────────────────────────\n\ninterface CommentItemProps {\n comment: PlatformComment;\n childrenOf: Map<string, PlatformComment[]>;\n depth: number;\n thread: UseCommentsReturn;\n orgId: string | null | undefined;\n}\n\nfunction CommentItem({\n comment,\n childrenOf,\n depth,\n thread,\n orgId,\n}: CommentItemProps) {\n const { authorDisplay, entityDoors } = useAssociationsUiPorts();\n const notifier = useNotifier();\n const [replying, setReplying] = useState(false);\n const [editing, setEditing] = useState(false);\n const [confirmingDelete, setConfirmingDelete] = useState(false);\n const [deleting, setDeleting] = useState(false);\n\n const author = resolveAuthor(comment, authorDisplay);\n const isOwn =\n thread.currentUserId !== null &&\n comment.createdBy === thread.currentUserId;\n const edited = comment.updatedAt !== comment.createdAt;\n const replies = childrenOf.get(comment.id) ?? [];\n\n async function confirmDelete() {\n setDeleting(true);\n const res = await thread.remove(comment.id);\n setDeleting(false);\n setConfirmingDelete(false);\n if (!res.ok) {\n notifier.error(res.error ?? \"Could not delete the comment\");\n }\n }\n\n return (\n <div\n data-comment-id={comment.id}\n className={cn(\n \"flex flex-col gap-1\",\n depth > 0 && \"border-l border-border pl-3\",\n )}\n >\n <div className=\"flex items-center gap-2\">\n <AuthorAvatar author={author} />\n <AuthorName author={author} entityDoors={entityDoors} />\n <span\n className=\"text-xs text-muted-foreground\"\n title={comment.createdAt}\n >\n {formatRelativeTime(comment.createdAt)}\n </span>\n {edited && (\n <span\n className=\"text-xs text-muted-foreground\"\n title={comment.updatedAt}\n >\n (edited)\n </span>\n )}\n </div>\n\n {editing ? (\n <div className=\"pl-8\">\n <CommentComposer\n initialValue={comment.body}\n submitLabel=\"Save\"\n placeholder=\"Edit your comment…\"\n autoFocus\n onSubmit={async (body) => {\n const res = await thread.edit(comment.id, body);\n if (res.ok) setEditing(false);\n return res;\n }}\n trailing={\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"ghost\"\n onClick={() => setEditing(false)}\n >\n Cancel\n </Button>\n }\n />\n </div>\n ) : (\n <p className=\"whitespace-pre-wrap pl-8 text-sm text-foreground\">\n {comment.body}\n </p>\n )}\n\n {!editing && (\n <div className=\"flex items-center gap-1 pl-7\">\n {confirmingDelete ? (\n <>\n <span className=\"text-xs text-destructive\">\n Deletes this comment for everyone.\n </span>\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"destructive\"\n disabled={deleting}\n onClick={() => void confirmDelete()}\n >\n {deleting && (\n <SpinnerIcon className=\"mr-1 h-3 w-3 animate-spin\" />\n )}\n Delete\n </Button>\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"ghost\"\n disabled={deleting}\n onClick={() => setConfirmingDelete(false)}\n >\n Cancel\n </Button>\n </>\n ) : (\n <>\n <button\n type=\"button\"\n onClick={() => setReplying((v) => !v)}\n className=\"rounded px-1.5 py-0.5 text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground\"\n >\n Reply\n </button>\n {isOwn && (\n <>\n <button\n type=\"button\"\n onClick={() => setEditing(true)}\n className=\"rounded px-1.5 py-0.5 text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground\"\n >\n Edit\n </button>\n <button\n type=\"button\"\n onClick={() => setConfirmingDelete(true)}\n className=\"rounded px-1.5 py-0.5 text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-destructive\"\n >\n Delete\n </button>\n </>\n )}\n </>\n )}\n </div>\n )}\n\n {replying && (\n <div className=\"flex items-start gap-2 pl-8 pt-1\">\n <CornerDownRightIcon className=\"mt-2 h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n <div className=\"min-w-0 flex-1\">\n <CommentComposer\n submitLabel=\"Reply\"\n placeholder={`Reply to ${author.name}…`}\n autoFocus\n onSubmit={async (body) => {\n const res = await thread.add(body, {\n parentId: comment.id,\n orgId: orgId ?? null,\n });\n if (res.ok) setReplying(false);\n return res;\n }}\n trailing={\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"ghost\"\n onClick={() => setReplying(false)}\n >\n Cancel\n </Button>\n }\n />\n </div>\n </div>\n )}\n\n {replies.length > 0 && (\n <div className=\"flex flex-col gap-3 pl-8 pt-1\">\n {replies.map((reply) => (\n <CommentItem\n key={reply.id}\n comment={reply}\n childrenOf={childrenOf}\n depth={depth + 1}\n thread={thread}\n orgId={orgId}\n />\n ))}\n </div>\n )}\n </div>\n );\n}\n\n// ─── the thread face ────────────────────────────────────────────────────────\n\n/**\n * Build the parent→children index. A reply whose parent is missing from the\n * list (soft-deleted parent, partial page) is promoted to top level rather\n * than dropped — every visible comment stays reachable.\n */\nexport function buildCommentTree(comments: readonly PlatformComment[]): {\n roots: PlatformComment[];\n childrenOf: Map<string, PlatformComment[]>;\n} {\n const byId = new Set(comments.map((c) => c.id));\n const roots: PlatformComment[] = [];\n const childrenOf = new Map<string, PlatformComment[]>();\n for (const c of comments) {\n if (c.parentId && byId.has(c.parentId)) {\n const bucket = childrenOf.get(c.parentId);\n if (bucket) bucket.push(c);\n else childrenOf.set(c.parentId, [c]);\n } else {\n roots.push(c);\n }\n }\n return { roots, childrenOf };\n}\n\nexport function CommentThread({\n token,\n id,\n orgId,\n showHeader = true,\n className,\n}: CommentThreadProps) {\n const thread = useComments({ token, id });\n const { roots, childrenOf } = buildCommentTree(thread.comments);\n const loading =\n (thread.status === \"loading\" || thread.status === \"idle\") &&\n thread.comments.length === 0;\n\n return (\n <section className={cn(\"flex flex-col gap-3\", className)}>\n {showHeader && (\n <header className=\"flex items-center gap-2\">\n <h3 className=\"text-sm font-semibold text-foreground\">Comments</h3>\n <span className=\"text-xs text-muted-foreground tabular-nums\">\n {thread.comments.length}\n </span>\n <button\n type=\"button\"\n onClick={() => void thread.reload()}\n aria-label=\"Refresh comments\"\n title=\"Refresh comments\"\n className=\"ml-auto flex h-6 w-6 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-accent hover:text-foreground\"\n >\n {thread.status === \"loading\" ? (\n <SpinnerIcon className=\"h-3.5 w-3.5 animate-spin\" />\n ) : (\n <RefreshIcon className=\"h-3.5 w-3.5\" />\n )}\n </button>\n </header>\n )}\n\n {thread.error && (\n <div\n role=\"alert\"\n className=\"flex items-center gap-2 rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs text-destructive\"\n >\n <span className=\"min-w-0 flex-1\">{thread.error}</span>\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"outline\"\n disabled={thread.status === \"loading\"}\n onClick={() => void thread.reload()}\n >\n Retry\n </Button>\n </div>\n )}\n\n {loading ? (\n <div className=\"flex flex-col gap-3\" aria-hidden data-testid=\"comments-loading\">\n <Skeleton className=\"h-12 w-full\" />\n <Skeleton className=\"h-12 w-4/5\" />\n </div>\n ) : roots.length === 0 && !thread.error ? (\n <p className=\"text-sm text-muted-foreground\">No comments yet.</p>\n ) : (\n <div className=\"flex flex-col gap-4\">\n {roots.map((comment) => (\n <CommentItem\n key={comment.id}\n comment={comment}\n childrenOf={childrenOf}\n depth={0}\n thread={thread}\n orgId={orgId}\n />\n ))}\n </div>\n )}\n\n <CommentComposer\n onSubmit={(body) => thread.add(body, { orgId: orgId ?? null })}\n />\n </section>\n );\n}\n\nexport default CommentThread;\n","// react/relativeTime.ts — @ai-matrx/associations/react\n//\n// The one relative-timestamp formatter the comments face uses (W6). Pure and\n// dependency-free — `Intl.RelativeTimeFormat` under the hood so the host's\n// locale conventions apply without a date library.\n\nconst UNITS: { unit: Intl.RelativeTimeFormatUnit; ms: number }[] = [\n { unit: \"year\", ms: 365 * 24 * 60 * 60 * 1000 },\n { unit: \"month\", ms: 30 * 24 * 60 * 60 * 1000 },\n { unit: \"week\", ms: 7 * 24 * 60 * 60 * 1000 },\n { unit: \"day\", ms: 24 * 60 * 60 * 1000 },\n { unit: \"hour\", ms: 60 * 60 * 1000 },\n { unit: \"minute\", ms: 60 * 1000 },\n];\n\n/**\n * \"just now\" under a minute, then the largest whole unit (\"5 minutes ago\",\n * \"2 days ago\"). An unparseable timestamp returns the raw string rather than\n * \"Invalid Date\" chrome — degraded, never broken.\n */\nexport function formatRelativeTime(\n iso: string,\n now: number = Date.now(),\n): string {\n const t = Date.parse(iso);\n if (Number.isNaN(t)) return iso;\n const delta = t - now;\n const magnitude = Math.abs(delta);\n if (magnitude < 60 * 1000) return \"just now\";\n const rtf = new Intl.RelativeTimeFormat(undefined, { numeric: \"auto\" });\n for (const { unit, ms } of UNITS) {\n if (magnitude >= ms) {\n return rtf.format(Math.trunc(delta / ms), unit);\n }\n }\n return \"just now\";\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACkBA,mBAMO;;;ACoRA,IAAM,qBAAiD;AAAA,EAC5D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;;;AC9SA,IAAM,WAAW;AAGV,IAAM,wBAAwB;AAQrC,IAAM,aAA+D;AAAA;AAAA,EAEnE,WAAW;AAAA,IACT,eAAe;AAAA,IACf,aAAa;AAAA,IACb,eAAe;AAAA,IACf,aAAa;AAAA,EACf;AAAA,EACA,cAAc;AAAA,IACZ,eAAe;AAAA,IACf,aAAa;AAAA,IACb,eAAe;AAAA,IACf,aAAa;AAAA,EACf;AAAA,EACA,mBAAmB;AAAA,IACjB,eAAe;AAAA,IACf,aAAa;AAAA,IACb,eAAe;AAAA,IACf,cAAc,CAAC,QAAQ;AAAA,EACzB;AAAA,EACA,yBAAyB,EAAE,QAAQ,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A,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AA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,gBAAM,IAAI,CAAC,YACV;AAAA,MAAC;AAAA;AAAA,QAEC;AAAA,QACA;AAAA,QACA,OAAO;AAAA,QACP;AAAA,QACA;AAAA;AAAA,MALK,QAAQ;AAAA,IAMf,CACD,GACH;AAAA,IAGF;AAAA,MAAC;AAAA;AAAA,QACC,UAAU,CAAC,SAAS,OAAO,IAAI,MAAM,EAAE,OAAO,SAAS,KAAK,CAAC;AAAA;AAAA,IAC/D;AAAA,KACF;AAEJ;","names":["import_react","import_react","import_react","import_react","noopSubscribe","import_react","import_react","import_react","noopSubscribe","import_react","import_react","import_jsx_runtime","import_react","import_react","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_react","import_design_system","import_jsx_runtime","import_react","import_design_system","import_design_system","import_jsx_runtime","import_jsx_runtime","import_react","import_design_system","import_jsx_runtime","import_react","import_design_system","import_jsx_runtime","role","import_design_system","import_jsx_runtime","import_react","import_design_system","import_jsx_runtime","metadataIsPinned","import_react","import_design_system","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_react","import_design_system","import_jsx_runtime","import_react","import_design_system","import_jsx_runtime","import_react","import_design_system","import_jsx_runtime","ROOT_PARENT","import_react","import_design_system","import_jsx_runtime","base","DoorRef"]}
1
+ {"version":3,"sources":["../../src/react/index.ts","../../src/react/context.tsx","../../src/demanded-rpcs.generated.ts","../../src/core/assertDemandedSchema.ts","../../src/react/hooks/useAssociations.ts","../../src/results.ts","../../src/entity-types.generated.ts","../../src/core/titles.ts","../../src/core/store.ts","../../src/react/hooks/useContainerLinks.ts","../../src/react/hooks/useEntityTitles.ts","../../src/react/hooks/useCategories.ts","../../src/react/hooks/useUniversalEntitySearch.ts","../../src/react/hooks/useAssociationCandidates.ts","../../src/react/hooks/useComments.ts","../../src/react/hooks/useAssociationEntitySelect.ts","../../src/react/components/PrimaryEntityContext.tsx","../../src/react/components/AssociationWindow.tsx","../../src/react/components/DefaultWindowShell.tsx","../../src/react/icons.tsx","../../src/react/components/AssociationPicker.tsx","../../src/react/components/UniversalAssociationPicker.tsx","../../src/react/components/entityDoors.tsx","../../src/react/components/AttachedItemsSheet.tsx","../../src/react/components/AssociationCard.tsx","../../src/react/contentRoles.ts","../../src/react/components/AssociationCardGrid.tsx","../../src/react/components/AssociationList.tsx","../../src/react/components/AssociationCaptureToolbar.tsx","../../src/react/lazyPorts.tsx","../../src/react/hooks/useAssociationPickerBridge.ts","../../src/react/components/AssociationEntitySelect.tsx","../../src/react/components/CategorySelect.tsx","../../src/core/categoryHierarchy.ts","../../src/react/components/CategoryTagPicker.tsx","../../src/react/components/CommentThread.tsx","../../src/react/relativeTime.ts"],"sourcesContent":["// @ai-matrx/associations/react — the React binding (W3 hooks + W4 faces).\n//\n// THE BANNER GROUP: this entry (and only this entry) ships with a\n// `\"use client\"` directive stamped on its dist chunks — everything here\n// touches React state/effects/DOM. The types root and /core stay PURE.\n//\n// Bind once per host:\n//\n// const store = createAssociationsStore({ dataSource, identity, errorSink, … });\n// <AssociationsProvider store={store} notifier={…} windowShell={…}\n// capture={…} pickerOverrides={…} entityDoors={…}>\n//\n// The seven hooks keep the matrx-frontend originals' EXACT public\n// signatures (the W5 swap is a mechanical re-export flip + Redux-fragment\n// deletion), riding the /core store via useSyncExternalStore.\n//\n// W4 status: COMPLETE. The three faces that were gated on design-system\n// primitives (`AssociationEntitySelect`, `CategorySelect`,\n// `CategoryTagPicker`) landed with design-system 0.3.0 (the Command family,\n// the Select family, the CreatablePicker composite) — the peer floor is\n// `>=0.3.0`.\n\nexport {\n AssociationsProvider,\n useAssociationsStore,\n useAssociationsUiPorts,\n useNotifier,\n type AssociationsProviderProps,\n type AssociationsUiPorts,\n} from \"./context\";\n\n// ── hooks (W3 — signature-compatible with the matrx-frontend originals) ──\nexport {\n useAssociations,\n useEntityRelationships,\n type AssociationWriteResult,\n type UseAssociationsArgs,\n type UseAssociationsReturn,\n} from \"./hooks/useAssociations\";\nexport {\n useContainerLinks,\n type ContainerLink,\n type UseContainerLinksArgs,\n type UseContainerLinksReturn,\n} from \"./hooks/useContainerLinks\";\nexport {\n useEntityTitles,\n type EntityTitleRef,\n type UseEntityTitlesReturn,\n} from \"./hooks/useEntityTitles\";\nexport {\n useCategories,\n type CategoryCreateResult,\n type CategoryMutationResult,\n type UseCategoriesArgs,\n type UseCategoriesReturn,\n} from \"./hooks/useCategories\";\nexport {\n useUniversalEntitySearch,\n type UniversalCandidate,\n type UseUniversalEntitySearchArgs,\n type UseUniversalEntitySearchReturn,\n} from \"./hooks/useUniversalEntitySearch\";\nexport {\n useAssociationCandidates,\n type CandidateRecord,\n type UseAssociationCandidatesArgs,\n type UseAssociationCandidatesReturn,\n} from \"./hooks/useAssociationCandidates\";\nexport {\n useComments,\n type UseCommentsArgs,\n type UseCommentsReturn,\n} from \"./hooks/useComments\";\nexport {\n useAssociationEntitySelectAdapter,\n type AssociationEntitySelectAdapter,\n type AssociationEntitySelectItem,\n type UseAssociationEntitySelectAdapterArgs,\n} from \"./hooks/useAssociationEntitySelect\";\n\n// ── faces (W4) ───────────────────────────────────────────────────────────\nexport {\n PrimaryEntityProvider,\n usePrimaryEntity,\n type PrimaryEntity,\n} from \"./components/PrimaryEntityContext\";\nexport {\n AssociationWindow,\n type AssociationWindowProps,\n} from \"./components/AssociationWindow\";\nexport {\n AssociationPicker,\n AssociationCandidateBody,\n type AssociationCandidateBodyProps,\n type AssociationPickerProps,\n} from \"./components/AssociationPicker\";\nexport {\n UniversalAssociationPicker,\n attachedKey,\n type UniversalAssociationPickerProps,\n} from \"./components/UniversalAssociationPicker\";\nexport {\n AttachedItemsSheet,\n type AttachedItemsSheetProps,\n} from \"./components/AttachedItemsSheet\";\nexport {\n AssociationCard,\n type AssociationCardProps,\n} from \"./components/AssociationCard\";\nexport {\n AssociationCardGrid,\n type AssociationCardGridProps,\n} from \"./components/AssociationCardGrid\";\nexport {\n AssociationList,\n useContainerLinksAdapter,\n type AssociationListProps,\n type ContainerResourceRow,\n type ContainerResourcesAdapter,\n} from \"./components/AssociationList\";\nexport {\n AssociationCaptureToolbar,\n CaptureToolbarAction,\n type AssociationCaptureToolbarProps,\n type CaptureAttach,\n type CaptureAttachResult,\n} from \"./components/AssociationCaptureToolbar\";\nexport {\n DoorRef,\n DoorControlsSlot,\n UnresolvedRef,\n} from \"./components/entityDoors\";\nexport {\n DefaultWindowShell,\n type DefaultWindowShellProps,\n} from \"./components/DefaultWindowShell\";\nexport {\n lazyPickerOverride,\n lazyWindowShell,\n type WindowShellComponentProps,\n} from \"./lazyPorts\";\nexport {\n useAssociationPickerBridge,\n type AssociationPickerBridge,\n type AssociationPickerBridgeOptions,\n type PickerBridgeItem,\n} from \"./hooks/useAssociationPickerBridge\";\nexport {\n AssociationEntitySelect,\n type AssociationEntitySelectProps,\n} from \"./components/AssociationEntitySelect\";\nexport {\n CategorySelect,\n type CategorySelectProps,\n} from \"./components/CategorySelect\";\nexport {\n CategoryTagPicker,\n type CategoryTagPickerProps,\n type TagPickerIcon,\n} from \"./components/CategoryTagPicker\";\n\n// ── comments (W6 — the canonical comments UI, ruling C4) ─────────────────\nexport {\n CommentThread,\n CommentComposer,\n buildCommentTree,\n type CommentThreadProps,\n type CommentComposerProps,\n} from \"./components/CommentThread\";\nexport { formatRelativeTime } from \"./relativeTime\";\n\n// ── chrome shared by the faces ───────────────────────────────────────────\nexport {\n CONTENT_ROLES,\n getContentRoleMeta,\n type ContentRoleMeta,\n} from \"./contentRoles\";\nexport { DefaultEntityIcon } from \"./icons\";\n","// react/context.tsx — @ai-matrx/associations/react\n//\n// The ONE React binding point (design Decision 2): a host constructs the\n// /core store once (`createAssociationsStore(cfg)`) in its binding module and\n// mounts `<AssociationsProvider store={store} …>` at the top of the tree. The\n// UI ports (notifier / windowShell / capture / pickerOverrides / entityDoors\n// / authorDisplay) are /react concerns and bind HERE — the headless store\n// never sees them.\n//\n// Required-port failures stay loud: every hook/face reaches the store through\n// `useAssociationsStore()`, which THROWS with a precise message when no\n// provider is mounted — never a silently-empty surface.\n//\n// Notifier degradation (design Decision 2 table): when the host binds no\n// notifier, /react warns ONCE through the store's errorSink and every\n// user-facing failure still reaches the errorSink — the create-then-associate\n// loud-outcome law is satisfied structurally, not by toast availability.\n\nimport {\n createContext,\n useContext,\n useEffect,\n useRef,\n type ReactNode,\n} from \"react\";\n\nimport type {\n AssociationsNotifier,\n AuthorDisplayPort,\n CapturePort,\n EntityDoorsPort,\n PickerOverrideMap,\n WindowShellPort,\n} from \"../ports\";\nimport type { AssociationsStore } from \"../core/store\";\nimport { assertDemandedSchema } from \"../core/assertDemandedSchema\";\n\nexport interface AssociationsUiPorts {\n notifier?: AssociationsNotifier;\n windowShell?: WindowShellPort;\n capture?: CapturePort;\n pickerOverrides?: PickerOverrideMap;\n entityDoors?: EntityDoorsPort;\n authorDisplay?: AuthorDisplayPort;\n}\n\ninterface AssociationsReactBinding extends AssociationsUiPorts {\n store: AssociationsStore;\n /** ONE warn-once latch per provider instance (never module state). */\n notifierWarned: { current: boolean };\n}\n\nconst AssociationsReactContext = createContext<AssociationsReactBinding | null>(\n null,\n);\n\nexport interface AssociationsProviderProps extends AssociationsUiPorts {\n /** The /core store the host constructed with `createAssociationsStore`. */\n store: AssociationsStore;\n /**\n * Run the demanded-schema probe once after mount (0.6.0, C22: this was\n * ~30 lines of boot diagnostic every host hand-wrote). Default: ON in a\n * development build, OFF everywhere else — it is a boot check, never a\n * hot path, and it is side-effect free by construction (see\n * `assertDemandedSchema`). Pass `false` to silence it, `true` to force it\n * (a CI smoke run).\n */\n probeSchema?: boolean;\n children: ReactNode;\n}\n\n/**\n * Development detection that cannot throw in ANY loader: bundlers that\n * define `process.env.NODE_ENV` (Next, webpack, Vite's define) answer\n * honestly; one that defines nothing answers `false` and the probe simply\n * stays off — never a crash, never a production probe.\n */\nfunction isDevelopmentBuild(): boolean {\n try {\n return (\n typeof process !== \"undefined\" &&\n process.env?.[\"NODE_ENV\"] === \"development\"\n );\n } catch {\n return false;\n }\n}\n\nexport function AssociationsProvider({\n store,\n probeSchema,\n notifier,\n windowShell,\n capture,\n pickerOverrides,\n entityDoors,\n authorDisplay,\n children,\n}: AssociationsProviderProps) {\n const notifierWarned = useRef(false);\n\n // THE demanded-schema boot probe (moved in-package at 0.6.0). Every host\n // was writing this effect itself — a dynamic import, a try/catch, and a\n // hand-rolled `demanded_schema_violation` scream. It is package logic:\n // the package is the thing that DEMANDS the schema, so it is the thing\n // that says, once and loudly, when the database cannot answer it.\n const shouldProbe = probeSchema ?? isDevelopmentBuild();\n useEffect(() => {\n if (!shouldProbe) return;\n let stale = false;\n void (async () => {\n try {\n await assertDemandedSchema(store.dataSource);\n } catch (error) {\n if (stale) return;\n store.errorSink({\n code: \"demanded_schema_violation\",\n message:\n error instanceof Error\n ? error.message\n : \"assertDemandedSchema failed\",\n context: {\n remedy:\n \"Run the platform.associations schema (README § The demanded \" +\n \"schema) on the database this dataSource points at.\",\n },\n });\n }\n })();\n return () => {\n stale = true;\n };\n }, [shouldProbe, store]);\n\n return (\n <AssociationsReactContext.Provider\n value={{\n store,\n notifierWarned,\n ...(notifier !== undefined ? { notifier } : {}),\n ...(windowShell !== undefined ? { windowShell } : {}),\n ...(capture !== undefined ? { capture } : {}),\n ...(pickerOverrides !== undefined ? { pickerOverrides } : {}),\n ...(entityDoors !== undefined ? { entityDoors } : {}),\n ...(authorDisplay !== undefined ? { authorDisplay } : {}),\n }}\n >\n {children}\n </AssociationsReactContext.Provider>\n );\n}\n\nfunction requireBinding(): AssociationsReactBinding {\n const binding = useContext(AssociationsReactContext);\n if (!binding) {\n throw new Error(\n \"@ai-matrx/associations/react: no <AssociationsProvider> above this \" +\n \"component. Construct the store once with createAssociationsStore(cfg) \" +\n \"in your host binding and mount <AssociationsProvider store={store}> \" +\n \"at the top of the tree.\",\n );\n }\n return binding;\n}\n\n/** The /core store bound by the nearest provider. Throws when unmounted. */\nexport function useAssociationsStore(): AssociationsStore {\n return requireBinding().store;\n}\n\n/** The UI ports the host bound (each optional, each degradable). */\nexport function useAssociationsUiPorts(): AssociationsUiPorts {\n const { store: _store, notifierWarned: _warned, ...ports } = requireBinding();\n return ports;\n}\n\n/**\n * The notifier, degraded per contract: absent → warn once via errorSink,\n * then route every user-facing failure to the errorSink so no outcome is\n * silent. Success messages without a notifier are dropped (the surface's own\n * state change is the confirmation); failures always scream.\n */\nexport function useNotifier(): AssociationsNotifier {\n const binding = requireBinding();\n if (binding.notifier) return binding.notifier;\n const { store, notifierWarned } = binding;\n const warnOnce = () => {\n if (notifierWarned.current) return;\n notifierWarned.current = true;\n store.errorSink({\n code: \"notifier_missing\",\n message:\n \"@ai-matrx/associations/react: no notifier port bound — user-facing \" +\n \"failures are routed to the errorSink only. Bind `notifier` on \" +\n \"AssociationsProvider for toasts.\",\n });\n };\n return {\n success() {\n warnOnce();\n },\n error(msg, opts) {\n warnOnce();\n store.errorSink({\n code: \"user_facing_error\",\n message: msg,\n ...(opts?.description !== undefined\n ? { context: { description: opts.description } }\n : {}),\n });\n },\n };\n}\n","// ─────────────────────────────────────────────────────────────────────────\n// AUTOGENERATED — DO NOT EDIT BY HAND.\n//\n// The TYPED half of this package's DEMANDED SCHEMA: the 27 SECURITY\n// DEFINER RPC families every operation goes through (the client holds NO\n// grant on `platform.associations` itself). Sliced from the live-generated\n// Supabase contract of the platform DB.\n// Regenerate: pnpm gen:demanded-rpcs -- /path/to/database.types.ts\n//\n// A database that cannot answer these functions is not this package's\n// database — the runtime probe (`assertDemandedSchema`, /core) and the\n// `demanded_schema_violation` error code scream exactly that.\n//\n// NOT demanded, deliberately: the DB's legacy `assoc_link` / `assoc_list` /\n// `assoc_unlink` trio (zero client callers — flagged for server-side\n// retirement, never adopted here).\n//\n// `unknown` stands in for the host contract's `Json` (JSON-boundary rule in\n// /policies/typescript-package-standard.md).\n// ─────────────────────────────────────────────────────────────────────────\n\n/** Per-RPC Args/Returns for every demanded function, straight from the live DB. */\nexport interface DemandedRpcSignatures {\n // ── edges — writes ──\n assoc_add: {\n Args: {\n p_label?: string\n p_metadata?: unknown\n p_org_id?: string\n p_payload?: unknown\n p_payload_kind?: string\n p_position?: number\n p_role?: string\n p_source_id: string\n p_source_type: string\n p_target_id: string\n p_target_type: string\n }\n Returns: string\n };\n assoc_remove: {\n Args: {\n p_role?: string\n p_source_id: string\n p_source_type: string\n p_target_id: string\n p_target_type: string\n }\n Returns: undefined\n };\n assoc_set_targets: {\n Args: {\n p_org_id?: string\n p_role?: string\n p_source_id: string\n p_source_type: string\n p_target_ids: string[]\n p_target_type: string\n }\n Returns: undefined\n };\n assoc_remove_for_entity: {\n Args: { p_id: string; p_type: string }\n Returns: undefined\n };\n // ── edges — reads ──\n assoc_for_entity: {\n Args: { p_id: string; p_type: string }\n Returns: {\n created_at: string\n direction: string\n id: string\n label: string\n metadata: unknown\n organization_id: string\n other_id: string\n other_type: string\n position: number\n role: string\n }[]\n };\n assoc_for_targets: {\n Args: { p_target_ids: string[]; p_target_type: string }\n Returns: {\n created_at: string\n id: string\n label: string\n metadata: unknown\n organization_id: string\n position: number\n role: string\n source_id: string\n source_type: string\n target_id: string\n }[]\n };\n assoc_for_sources: {\n Args: {\n p_source_ids: string[]\n p_source_type: string\n p_target_type?: string\n }\n Returns: {\n created_at: string\n id: string\n label: string\n metadata: unknown\n organization_id: string\n position: number\n role: string\n source_id: string\n target_id: string\n target_type: string\n }[]\n };\n assoc_members_visible: {\n Args: { p_target_ids: string[]; p_target_type: string }\n Returns: {\n created_at: string\n id: string\n label: string\n metadata: unknown\n organization_id: string\n position: number\n role: string\n source_id: string\n source_type: string\n target_id: string\n }[]\n };\n // ── conversation files (stricter access-conveying pair) ──\n conversation_file_add: {\n Args: {\n p_conversation_id: string\n p_file_id: string\n p_label?: string\n p_metadata?: unknown\n p_replace_metadata?: boolean\n }\n Returns: string\n };\n conversation_file_remove: {\n Args: { p_conversation_id: string; p_file_id: string }\n Returns: undefined\n };\n conversation_files: {\n Args: { p_conversation_id: string }\n Returns: {\n created_at: string\n file_id: string\n label: string\n metadata: unknown\n }[]\n };\n // ── agent resources (editor-gated containment authoring) ──\n agent_resource_add: {\n Args: {\n p_agent_id: string\n p_label?: string\n p_metadata?: unknown\n p_source_id: string\n p_source_type: string\n }\n Returns: string\n };\n agent_resource_remove: {\n Args: { p_agent_id: string; p_source_id: string; p_source_type: string }\n Returns: undefined\n };\n // ── categories ──\n cat_list: {\n Args: { p_dimension?: string }\n Returns: {\n color: string\n dimension: string\n icon: string\n id: string\n is_system: boolean\n metadata: unknown\n name: string\n organization_id: string\n parent_id: string\n position: number\n slug: string\n }[]\n };\n cat_create: {\n Args: {\n p_color?: string\n p_dimension: string\n p_icon?: string\n p_name: string\n p_org_id: string\n p_parent_id?: string\n p_slug?: string\n }\n Returns: string\n };\n cat_update: {\n Args: {\n p_category_id: string\n p_color?: string\n p_icon?: string\n p_name: string\n p_position?: number\n p_slug?: string\n }\n Returns: string\n };\n cat_reparent: {\n Args: { p_category_id: string; p_parent_id?: string }\n Returns: string\n };\n cat_delete: { Args: { p_category_id: string }; Returns: string };\n // ── favorites / recents ──\n ues_set: {\n Args: {\n p_entity_id: string\n p_entity_type: string\n p_is_favorite?: boolean\n p_is_hidden?: boolean\n p_is_pinned?: boolean\n }\n Returns: undefined\n };\n ues_list: {\n Args: { p_kind?: string }\n Returns: {\n entity_id: string\n entity_type: string\n is_favorite: boolean\n is_hidden: boolean\n is_pinned: boolean\n last_viewed_at: string\n updated_at: string\n }[]\n };\n ues_get_bulk: {\n Args: { p_entity_ids: string[]; p_entity_type: string }\n Returns: {\n entity_id: string\n is_favorite: boolean\n is_hidden: boolean\n is_pinned: boolean\n last_viewed_at: string\n }[]\n };\n ues_touch: {\n Args: { p_entity_id: string; p_entity_type: string }\n Returns: undefined\n };\n // ── candidates ──\n reference_search_candidates: {\n Args: {\n p_ids?: string[]\n p_limit?: number\n p_search?: string\n p_token: string\n }\n Returns: {\n id: string\n title: string\n }[]\n };\n // ── comments (threaded comment on any entity, W6) ──\n cmt_list: {\n Args: { p_entity_id: string; p_entity_type: string }\n Returns: {\n author_avatar_url: string\n author_display_name: string\n author_email: string\n body: string\n created_at: string\n created_by: string\n entity_id: string\n entity_type: string\n id: string\n organization_id: string\n parent_id: string\n updated_at: string\n }[]\n };\n cmt_add: {\n Args: {\n p_body: string\n p_entity_id: string\n p_entity_type: string\n p_org_id?: string\n p_parent_id?: string\n }\n Returns: string\n };\n cmt_edit: { Args: { p_body: string; p_id: string }; Returns: undefined };\n cmt_delete: { Args: { p_id: string }; Returns: undefined };\n}\n\n/** The name of any demanded RPC — the only strings the dataSource port accepts. */\nexport type DemandedRpcName = keyof DemandedRpcSignatures;\n\n/** Every demanded RPC name, for iteration (the schema probe walks this). */\nexport const DEMANDED_RPC_NAMES: readonly DemandedRpcName[] = [\n \"assoc_add\",\n \"assoc_remove\",\n \"assoc_set_targets\",\n \"assoc_remove_for_entity\",\n \"assoc_for_entity\",\n \"assoc_for_targets\",\n \"assoc_for_sources\",\n \"assoc_members_visible\",\n \"conversation_file_add\",\n \"conversation_file_remove\",\n \"conversation_files\",\n \"agent_resource_add\",\n \"agent_resource_remove\",\n \"cat_list\",\n \"cat_create\",\n \"cat_update\",\n \"cat_reparent\",\n \"cat_delete\",\n \"ues_set\",\n \"ues_list\",\n \"ues_get_bulk\",\n \"ues_touch\",\n \"reference_search_candidates\",\n \"cmt_list\",\n \"cmt_add\",\n \"cmt_edit\",\n \"cmt_delete\",\n];\n\n/** Args type for one demanded RPC. */\nexport type DemandedRpcArgs<N extends DemandedRpcName> =\n DemandedRpcSignatures[N][\"Args\"];\n\n/** Returns type for one demanded RPC. */\nexport type DemandedRpcReturns<N extends DemandedRpcName> =\n DemandedRpcSignatures[N][\"Returns\"];\n","// core/assertDemandedSchema.ts — @ai-matrx/associations/core\n//\n// THE PROBE half of the demanded schema (design Decision 4.3): a dev/CI boot\n// check verifying every demanded RPC ANSWERS on the database the dataSource\n// points at. A function PostgREST cannot find comes back as PGRST202 — the\n// same code `mapPgError` maps to `demanded_schema_violation` at runtime —\n// and the probe throws one unambiguous scream naming every missing function.\n//\n// ZERO side effects by construction: every uuid parameter is probed with a\n// deliberately UNPARSEABLE uuid string. PostgREST resolves the function\n// FIRST (missing → PGRST202), then Postgres fails the argument cast (22P02)\n// before the function body ever executes — so no write RPC can create a row,\n// and every non-PGRST202 outcome (including 22P02, 42501, or success on the\n// cheap parameterless reads) proves the function exists. Verified against\n// the live SECURITY DEFINER bodies 2026-08-29.\n//\n// FALSIFIABLE by construction (the falsifiability rule): `selfTest: true`\n// additionally probes a fabricated function name that MUST come back\n// missing. A dataSource that answers everything (an over-permissive mock, a\n// proxy that swallows errors) fails the self-test — proving the probe CAN\n// fail before you trust its green.\n\nimport { DEMANDED_RPC_NAMES, type DemandedRpcName } from \"../demanded-rpcs.generated\";\nimport type { AssociationsDataSource } from \"../ports\";\n\n/** Unparseable-uuid sentinel: guarantees 22P02 before any function body runs. */\nconst BAD_UUID = \"__not_a_uuid__\";\n\n/** The name the self-test probes; MUST NOT exist in any schema. */\nexport const SELF_TEST_MISSING_RPC = \"assoc_probe_self_test_missing_fn\";\n\n/**\n * Per-RPC probe arguments. Every REQUIRED (non-defaulted) parameter is\n * supplied — an omitted required parameter would itself produce PGRST202 (no\n * matching signature) and fake a violation on a healthy database. Every uuid\n * gets the unparseable sentinel so nothing executes.\n */\nconst PROBE_ARGS: Record<DemandedRpcName, Record<string, unknown>> = {\n // edges — writes\n assoc_add: {\n p_source_type: \"note\",\n p_source_id: BAD_UUID,\n p_target_type: \"task\",\n p_target_id: BAD_UUID,\n },\n assoc_remove: {\n p_source_type: \"note\",\n p_source_id: BAD_UUID,\n p_target_type: \"task\",\n p_target_id: BAD_UUID,\n },\n assoc_set_targets: {\n p_source_type: \"note\",\n p_source_id: BAD_UUID,\n p_target_type: \"task\",\n p_target_ids: [BAD_UUID],\n },\n assoc_remove_for_entity: { p_type: \"note\", p_id: BAD_UUID },\n // edges — reads\n assoc_for_entity: { p_type: \"note\", p_id: BAD_UUID },\n assoc_for_targets: { p_target_type: \"task\", p_target_ids: [BAD_UUID] },\n assoc_for_sources: { p_source_type: \"note\", p_source_ids: [BAD_UUID] },\n assoc_members_visible: { p_target_type: \"task\", p_target_ids: [BAD_UUID] },\n // conversation files\n conversation_file_add: {\n p_conversation_id: BAD_UUID,\n p_file_id: BAD_UUID,\n },\n conversation_file_remove: {\n p_conversation_id: BAD_UUID,\n p_file_id: BAD_UUID,\n },\n conversation_files: { p_conversation_id: BAD_UUID },\n // agent resources\n agent_resource_add: {\n p_agent_id: BAD_UUID,\n p_source_type: \"note\",\n p_source_id: BAD_UUID,\n },\n agent_resource_remove: {\n p_agent_id: BAD_UUID,\n p_source_type: \"note\",\n p_source_id: BAD_UUID,\n },\n // categories\n cat_list: {},\n cat_create: { p_dimension: \"\", p_name: \"\", p_org_id: BAD_UUID },\n cat_update: { p_category_id: BAD_UUID, p_name: \"__probe__\" },\n cat_reparent: { p_category_id: BAD_UUID },\n cat_delete: { p_category_id: BAD_UUID },\n // favorites / recents\n ues_set: { p_entity_type: \"__probe__\", p_entity_id: BAD_UUID },\n ues_list: {},\n ues_get_bulk: { p_entity_type: \"__probe__\", p_entity_ids: [BAD_UUID] },\n ues_touch: { p_entity_type: \"__probe__\", p_entity_id: BAD_UUID },\n // candidates\n reference_search_candidates: { p_token: \"__probe__\", p_limit: 1 },\n // comments (W6) — every fn takes a uuid arg, so the unparseable sentinel\n // guarantees 22P02 before any SECURITY DEFINER body runs (no write occurs).\n cmt_list: { p_entity_type: \"__probe__\", p_entity_id: BAD_UUID },\n cmt_add: {\n p_entity_type: \"__probe__\",\n p_entity_id: BAD_UUID,\n p_body: \"__probe__\",\n },\n cmt_edit: { p_id: BAD_UUID, p_body: \"__probe__\" },\n cmt_delete: { p_id: BAD_UUID },\n};\n\nexport interface DemandedSchemaReport {\n ok: boolean;\n /** Demanded functions the database cannot answer (PGRST202). */\n missing: string[];\n /** Functions the probe could not reach (transport/unknown failure). */\n unreachable: { fn: string; error: unknown }[];\n /** Functions that answered (success or any non-PGRST202 refusal). */\n answered: string[];\n}\n\nexport interface AssertDemandedSchemaOptions {\n /**\n * Also probe a fabricated function name and REQUIRE it to come back\n * missing — proves the probe can fail (the falsifiability rule).\n */\n selfTest?: boolean;\n /** Max in-flight probe calls (default 6). */\n concurrency?: number;\n /**\n * Return the report instead of throwing on violation (for surfaces that\n * render the report). The self-test failure ALWAYS throws.\n */\n throwOnViolation?: boolean;\n}\n\nfunction isMissingFunctionError(error: unknown): boolean {\n if (!error || typeof error !== \"object\") return false;\n return (error as { code?: unknown }).code === \"PGRST202\";\n}\n\n/**\n * Probe every demanded RPC against `dataSource`. Throws an `Error` naming\n * every missing function when the database violates the demanded schema\n * (unless `throwOnViolation: false`), and ALWAYS throws when the probe\n * itself cannot be trusted (unreachable database, failed self-test).\n */\nexport async function assertDemandedSchema(\n dataSource: AssociationsDataSource,\n options: AssertDemandedSchemaOptions = {},\n): Promise<DemandedSchemaReport> {\n const { selfTest = false, concurrency = 6, throwOnViolation = true } = options;\n\n const names: string[] = [...DEMANDED_RPC_NAMES];\n if (selfTest) names.push(SELF_TEST_MISSING_RPC);\n\n const missing: string[] = [];\n const unreachable: { fn: string; error: unknown }[] = [];\n const answered: string[] = [];\n\n let cursor = 0;\n async function worker(): Promise<void> {\n while (cursor < names.length) {\n const fn = names[cursor];\n cursor += 1;\n if (!fn) continue;\n const args =\n fn === SELF_TEST_MISSING_RPC\n ? {}\n : PROBE_ARGS[fn as DemandedRpcName];\n try {\n const { error } = await dataSource.rpc(fn as DemandedRpcName, args);\n if (error == null) answered.push(fn);\n else if (isMissingFunctionError(error)) missing.push(fn);\n else answered.push(fn);\n } catch (e) {\n unreachable.push({ fn, error: e });\n }\n }\n }\n await Promise.all(\n Array.from({ length: Math.min(concurrency, names.length) }, worker),\n );\n\n if (selfTest) {\n const selfTestMissing = missing.includes(SELF_TEST_MISSING_RPC);\n // Remove the fabricated name from the real report either way.\n const idx = missing.indexOf(SELF_TEST_MISSING_RPC);\n if (idx >= 0) missing.splice(idx, 1);\n const answeredIdx = answered.indexOf(SELF_TEST_MISSING_RPC);\n if (answeredIdx >= 0) answered.splice(answeredIdx, 1);\n if (!selfTestMissing) {\n throw new Error(\n \"assertDemandedSchema self-test FAILED: the fabricated function \" +\n `\"${SELF_TEST_MISSING_RPC}\" did not come back as missing (PGRST202). ` +\n \"This probe cannot currently fail, so its green result proves \" +\n \"nothing — the dataSource is swallowing or faking errors.\",\n );\n }\n }\n\n if (unreachable.length > 0) {\n throw new Error(\n \"assertDemandedSchema could not complete: \" +\n `${unreachable.length} probe call(s) failed to reach the database ` +\n `(${unreachable.map((u) => u.fn).join(\", \")}). This is NOT a schema ` +\n \"verdict — fix connectivity and re-run.\",\n );\n }\n\n const ok = missing.length === 0;\n const report: DemandedSchemaReport = { ok, missing, unreachable, answered };\n\n if (!ok && throwOnViolation) {\n throw new Error(\n \"DEMANDED SCHEMA VIOLATION: the database this dataSource points at \" +\n `cannot answer ${missing.length} demanded @ai-matrx/associations ` +\n `function(s): ${missing.join(\", \")}. This package demands the AI ` +\n \"Matrx platform schema (README § The demanded schema); a database \" +\n \"without it is not this package's database.\",\n );\n }\n return report;\n}\n","// react/hooks/useAssociations.ts — @ai-matrx/associations/react\n//\n// Public hook for the unified association edge (`platform.associations`) — the\n// canonical attach/detach primitive any UI consumes to read and mutate an\n// entity's relationships (in BOTH directions) to any other entity.\n//\n// Ported SIGNATURE-BYTE-COMPATIBLE from matrx-frontend\n// `features/scopes/hooks/useAssociations.ts` (W3, 2026-08-29): same args,\n// same return shape, same lazy auto-load semantics. The seam inverted: the\n// Redux selector/thunk cache becomes the package store ridden via\n// `useSyncExternalStore` (design Decision 3) — adoption is a re-export flip\n// plus DELETION of the slice fragments, with call sites unchanged.\n//\n// This is what components reach for; they should never touch the store's raw\n// chokepoint services directly.\n\nimport { useEffect, useRef, useSyncExternalStore } from \"react\";\n\nimport type {\n AssociationEdge,\n AssociationsEntry,\n AssociationTargetType,\n} from \"../../edges\";\nimport {\n associationsKey,\n type AssociationWriteResult,\n} from \"../../core/store\";\nimport { useAssociationsStore } from \"../context\";\n\nexport interface UseAssociationsArgs {\n /** The entity whose relationships to read/manage (the cache endpoint). */\n type: string;\n id: string | null;\n /** Disable the auto-load on mount. Defaults to false (auto-load). */\n autoLoad?: boolean;\n}\n\n// Single declaration lives in the store; re-export so consumers can keep\n// importing it from the hook (doctrine forbids the duplicate definition).\nexport type { AssociationWriteResult };\n\nexport interface UseAssociationsReturn {\n /** Every edge touching this entity, both directions. */\n edges: AssociationEdge[];\n status: AssociationsEntry[\"status\"];\n error: string | null;\n fetchedAt: number | null;\n /** Attach this entity (as source) → a target. */\n add: (args: {\n targetType: AssociationTargetType;\n targetId: string;\n orgId?: string;\n label?: string;\n /** Typed edge role (e.g. 'theme' for a folder/tag) — omit for a role-less edge. */\n role?: string;\n }) => Promise<AssociationWriteResult>;\n /** Detach this entity (as source) → a target. */\n remove: (args: {\n targetType: string;\n targetId: string;\n role?: string;\n }) => Promise<AssociationWriteResult>;\n /** Replace this entity's edges of one target type with exactly `targetIds`. */\n setTargets: (args: {\n targetType: AssociationTargetType;\n targetIds: string[];\n orgId?: string;\n role?: string;\n }) => Promise<AssociationWriteResult>;\n /** Force a refetch of this entity's edges. */\n reload: () => Promise<void>;\n}\n\nconst noopSubscribe = () => () => {};\n\nexport function useAssociations(\n args: UseAssociationsArgs,\n): UseAssociationsReturn {\n const { type, id, autoLoad = true } = args;\n const store = useAssociationsStore();\n\n const key = type && id ? associationsKey(type, id) : null;\n const entry = useSyncExternalStore(\n key ? (cb) => store.subscribe(key, cb) : noopSubscribe,\n () => store.getEdges(type, id ?? \"\"),\n () => store.getEdges(type, id ?? \"\"),\n );\n\n const loadedKey = useRef<string | null>(null);\n useEffect(() => {\n if (!autoLoad || !type || !id) return;\n const k = associationsKey(type, id);\n if (loadedKey.current === k) return;\n loadedKey.current = k;\n void store.load(type, id);\n }, [autoLoad, store, type, id]);\n\n return {\n edges: entry.edges,\n status: entry.status,\n error: entry.error,\n fetchedAt: entry.fetchedAt,\n add: async ({ targetType, targetId, orgId, label, role }) => {\n if (!id) return { ok: false, error: \"Missing entity id\" };\n return store.add({\n sourceType: type,\n sourceId: id,\n targetType,\n targetId,\n ...(orgId !== undefined ? { orgId } : {}),\n ...(label !== undefined ? { label } : {}),\n ...(role !== undefined ? { role } : {}),\n });\n },\n remove: async ({ targetType, targetId, role }) => {\n if (!id) return { ok: false, error: \"Missing entity id\" };\n return store.remove({\n sourceType: type,\n sourceId: id,\n targetType,\n targetId,\n ...(role !== undefined ? { role } : {}),\n });\n },\n setTargets: async ({ targetType, targetIds, orgId, role }) => {\n if (!id) return { ok: false, error: \"Missing entity id\" };\n return store.setTargets({\n sourceType: type,\n sourceId: id,\n targetType,\n targetIds,\n ...(orgId !== undefined ? { orgId } : {}),\n ...(role !== undefined ? { role } : {}),\n });\n },\n reload: async () => {\n if (!type || !id) return;\n await store.load(type, id, { force: true });\n },\n };\n}\n\n/**\n * Convenience alias — same hook, a name that reads naturally on relationship\n * surfaces (\"the things this entity is related to\"). Identical contract.\n */\nexport const useEntityRelationships = useAssociations;\n","// src/results.ts — @ai-matrx/associations\n//\n// The typed never-throw result envelope every service method in this package\n// returns — ported from matrx-frontend `features/scopes/types.ts`\n// (`ScopesRpcError*`, associations extraction W1, 2026-08-29) and renamed to\n// the package vocabulary. The runtime builders/mappers (`ok`/`err`/\n// `mapPgError` — the loud PG-error funnel) arrive with `/core` in W2; the\n// TYPES live at the root so ports and consumers can speak them with zero\n// runtime dependency.\n\nexport type AssociationsRpcErrorCode =\n | \"unauthorized\"\n | \"forbidden_org\"\n | \"forbidden_role\"\n | \"not_found\"\n | \"conflict_in_use\"\n | \"invalid_argument\"\n | \"version_conflict\"\n | \"quota_exceeded\"\n /**\n * THE DEMANDED-SCHEMA SCREAM. A PostgREST missing-function error (PGRST202)\n * on any demanded RPC maps to this code: the database this client is\n * pointed at does not run the schema this package demands (README front\n * door). It always reaches the errorSink — one unambiguous scream, never a\n * mystery toast. Probe it at boot with `assertDemandedSchema` (/core, W2).\n */\n | \"demanded_schema_violation\"\n | \"internal\";\n\nexport interface AssociationsRpcError {\n code: AssociationsRpcErrorCode;\n message: string;\n hint?: string;\n detail?: unknown;\n}\n\nexport type AssociationsRpcResult<T> =\n | { ok: true; data: T }\n | { ok: false; error: AssociationsRpcError };\n\n/**\n * Type-guard narrowing helper for {@link AssociationsRpcResult}. Hosts running\n * with `strictNullChecks: false` lose TypeScript's default control-flow\n * narrowing for boolean discriminants (`if (!res.ok)` reverts to the wide\n * union) — this guard keeps both branches typed everywhere.\n */\nexport function isAssociationsRpcErr<T>(\n r: AssociationsRpcResult<T>,\n): r is { ok: false; error: AssociationsRpcError } {\n return r.ok === false;\n}\n\n/**\n * The structural shape of a PostgREST failure as supabase-js resolves it: a\n * PLAIN OBJECT parsed from the response body — NOT an `Error` instance.\n * (Reading `.message` off `instanceof Error` discards the real database\n * message on every genuine failure; `/core`'s mapper reads these fields.)\n */\nexport interface PgError {\n code?: string | null;\n message: string;\n details?: string | null;\n hint?: string | null;\n}\n","// ─────────────────────────────────────────────────────────────────────────\n// AUTOGENERATED — DO NOT EDIT BY HAND.\n//\n// Source of truth: `platform.entity_types` (Supabase project brsgrqvjdzwihsvnfqkf).\n// Regenerate: pnpm gen:entity-types (in @ai-matrx/associations)\n// Verify drift: pnpm check:entity-types\n//\n// 657 active entity tokens. A token here is FK-valid for\n// `platform.associations.source_type` / `target_type` and any other column\n// referencing `platform.entity_types.token`. Add/retire tokens in the DB via a\n// migration, then regenerate and ship a PATCH release — NEVER hand-edit this\n// file (the next generate overwrites it) and NEVER widen a callsite to a raw\n// string to dodge a token that isn't here yet (writes are STRICT against the\n// installed vocabulary; upgrade the package instead).\n// ─────────────────────────────────────────────────────────────────────────\n\n/** Metadata mirrored from one `platform.entity_types` row. */\nexport interface EntityTypeMeta {\n readonly token: EntityTypeToken;\n /** Postgres schema the backing table lives in. */\n readonly schema: string;\n /** Backing table name. */\n readonly table: string;\n /** Human label from the registry. */\n readonly label: string;\n readonly baseTier: number;\n /** A child/detail row (not a standalone first-class entity). */\n readonly isComponent: boolean;\n readonly isModule: boolean;\n readonly isListed: boolean;\n /** Whether the registry marks this type scopeable by default. */\n readonly scopeable: boolean;\n readonly category: string | null;\n /** Offered as an allowed type for reference context items. */\n readonly referencePickable: boolean;\n /** Human title column for generic candidate pickers (null = not generically listable). */\n readonly titleColumn: string | null;\n /** Knowledge-model bucket: utility | source | destination | hybrid | container. */\n readonly contentRole: string | null;\n /** Admin-assigned chooser bucket (platform.reference_categories.slug); null = bucket by schema. */\n readonly referenceCategory: string | null;\n}\n\n/**\n * EVERY registered entity token (the FK-valid set). Use this for any\n * `source_type` / `target_type` argument so an invalid token is a COMPILE error.\n */\nexport type EntityTypeToken =\n | \"access_request\"\n | \"activity\"\n | \"agent\"\n | \"agent_card\"\n | \"agent_definition_version\"\n | \"agent_drift_alert\"\n | \"agent_exemplar\"\n | \"agent_mandate_note\"\n | \"agent_prompt_remediation\"\n | \"agent_run\"\n | \"agent_run_stage\"\n | \"agent_shortcut\"\n | \"agent_surface_binding\"\n | \"agent_template\"\n | \"agent_usage\"\n | \"ai_api\"\n | \"ai_endpoint\"\n | \"ai_model\"\n | \"ai_model_alias\"\n | \"ai_offering\"\n | \"ai_provider\"\n | \"ai_setting\"\n | \"app\"\n | \"app_definition_version\"\n | \"app_error\"\n | \"app_execution\"\n | \"app_instance\"\n | \"app_log\"\n | \"app_rate_limit\"\n | \"app_setting\"\n | \"app_sync_status\"\n | \"approach\"\n | \"artifact\"\n | \"assessment\"\n | \"assessment_item\"\n | \"assessment_result\"\n | \"assist\"\n | \"batch_cost_event\"\n | \"batch_provider_batch\"\n | \"batch_work_item\"\n | \"browser_account_binding\"\n | \"browser_action_event\"\n | \"browser_authenticator_window\"\n | \"browser_capture\"\n | \"browser_control_request\"\n | \"browser_handoff\"\n | \"browser_login_attempt\"\n | \"browser_login_recipe\"\n | \"browser_profile\"\n | \"browser_profile_checkpoint\"\n | \"browser_run\"\n | \"browser_site_observation\"\n | \"browser_site_policy\"\n | \"browser_stream_ticket\"\n | \"canvas_comment\"\n | \"canvas_comment_like\"\n | \"canvas_item\"\n | \"canvas_item_state\"\n | \"canvas_like\"\n | \"canvas_score\"\n | \"canvas_view\"\n | \"category\"\n | \"cmp_entry\"\n | \"cmp_feedback\"\n | \"code_file\"\n | \"code_folder\"\n | \"code_repository\"\n | \"coding_session\"\n | \"coding_session_entry\"\n | \"comment\"\n | \"commerce_asset_allocation\"\n | \"commerce_asset_grading\"\n | \"commerce_asset_identifier\"\n | \"commerce_asset_lot_event\"\n | \"commerce_asset_mandate_result\"\n | \"commerce_asset_price_factor\"\n | \"commerce_asset_reshoot_request\"\n | \"commerce_asset_review\"\n | \"commerce_asset_unknown\"\n | \"commerce_certified_printer\"\n | \"commerce_cloud_sync_connection\"\n | \"commerce_ebay_business_policy\"\n | \"commerce_ebay_category\"\n | \"commerce_ebay_category_aspect\"\n | \"commerce_ebay_category_tree\"\n | \"commerce_ebay_custom_policy\"\n | \"commerce_ebay_inventory_item\"\n | \"commerce_ebay_inventory_item_group\"\n | \"commerce_ebay_inventory_item_group_member\"\n | \"commerce_ebay_inventory_location\"\n | \"commerce_ebay_listing\"\n | \"commerce_ebay_marketplace_policy\"\n | \"commerce_ebay_media_asset\"\n | \"commerce_ebay_notification_destination\"\n | \"commerce_ebay_notification_event\"\n | \"commerce_ebay_notification_subscription\"\n | \"commerce_ebay_notification_topic\"\n | \"commerce_ebay_offer\"\n | \"commerce_ebay_order\"\n | \"commerce_ebay_order_line_item\"\n | \"commerce_ebay_shipping_fulfillment\"\n | \"commerce_ebay_store_category\"\n | \"commerce_human_correction\"\n | \"commerce_intake_artifact\"\n | \"commerce_intake_asset\"\n | \"commerce_intake_batch\"\n | \"commerce_label_batch\"\n | \"commerce_label_code\"\n | \"commerce_marketplace_account\"\n | \"commerce_marketplace_account_deletion_audit\"\n | \"commerce_marketplace_api_call\"\n | \"commerce_marketplace_rate_budget\"\n | \"commerce_marketplace_site\"\n | \"commerce_marketplace_sync_run\"\n | \"commerce_prediction_outcome\"\n | \"commerce_print_order\"\n | \"commerce_product\"\n | \"commerce_product_channel_ref\"\n | \"commerce_product_media\"\n | \"commerce_product_variant\"\n | \"commerce_recall_audit\"\n | \"comparison_set\"\n | \"contact_medium\"\n | \"contact_submission\"\n | \"content_ir_kind\"\n | \"content_ir_kind_component\"\n | \"content_ir_kind_component_incident\"\n | \"content_ir_kind_conformance\"\n | \"content_ir_kind_edge\"\n | \"content_ir_kind_example\"\n | \"content_ir_kind_instance\"\n | \"content_ir_kind_surface\"\n | \"context_item\"\n | \"context_item_suggestion\"\n | \"conversation\"\n | \"conversation_value\"\n | \"crm_address\"\n | \"crm_affiliation\"\n | \"crm_blocklist_entry\"\n | \"crm_contact_candidate\"\n | \"crm_deal\"\n | \"crm_deal_stage_event\"\n | \"crm_enrichment_call\"\n | \"crm_interaction\"\n | \"crm_merge_candidate\"\n | \"crm_outreach_list\"\n | \"crm_outreach_list_member\"\n | \"crm_party_merge\"\n | \"crm_registry_ingest_run\"\n | \"crm_registry_source\"\n | \"crm_saved_view\"\n | \"crm_sending_event\"\n | \"crm_sending_identity\"\n | \"crm_sending_identity_check\"\n | \"crm_sending_policy\"\n | \"custom_entity_definition\"\n | \"custom_field_definition\"\n | \"custom_field_target\"\n | \"custom_record\"\n | \"cx_agent_memory\"\n | \"cx_agent_plan\"\n | \"cx_agent_task\"\n | \"cx_code_edit\"\n | \"cx_code_message_file\"\n | \"cx_media\"\n | \"cx_observational_memory\"\n | \"cx_observational_memory_event\"\n | \"cx_pending_injection\"\n | \"cx_request\"\n | \"cx_request_snapshot\"\n | \"cx_tool_trace\"\n | \"cx_user_request\"\n | \"cx_user_todo\"\n | \"data_store\"\n | \"dataset\"\n | \"derive_run\"\n | \"dict_setting\"\n | \"dm_conversation\"\n | \"dm_message\"\n | \"dm_participant\"\n | \"domain_classification\"\n | \"esign_campaign\"\n | \"esign_campaign_member\"\n | \"esign_consent_disclosure\"\n | \"esign_envelope\"\n | \"esign_envelope_certificate\"\n | \"esign_envelope_document\"\n | \"esign_envelope_event\"\n | \"esign_envelope_external_ref\"\n | \"esign_envelope_signer\"\n | \"esign_provider\"\n | \"esign_provider_binding\"\n | \"esign_signing_key\"\n | \"fc_card\"\n | \"fc_detail\"\n | \"fc_set\"\n | \"feature_doc\"\n | \"file\"\n | \"file_analysis\"\n | \"file_entities\"\n | \"file_overrides\"\n | \"file_page_annotations\"\n | \"file_pages\"\n | \"file_version\"\n | \"flexible_data\"\n | \"folder\"\n | \"game_badge\"\n | \"game_result\"\n | \"game_room\"\n | \"global_execution\"\n | \"global_execution_checkpoint\"\n | \"global_execution_event\"\n | \"global_meter_entry\"\n | \"global_origin\"\n | \"global_request\"\n | \"growth_loop_event\"\n | \"growth_loop_run\"\n | \"growth_loop_stage_run\"\n | \"guided_checklist_run\"\n | \"heatmap_save\"\n | \"hindsight_enrollment\"\n | \"hindsight_finding\"\n | \"hindsight_regression_case\"\n | \"hindsight_replay\"\n | \"hindsight_replay_step\"\n | \"hindsight_review\"\n | \"hr_access_audit\"\n | \"hr_access_role\"\n | \"hr_accommodation_request\"\n | \"hr_ai_evidence\"\n | \"hr_alert_routing_rule\"\n | \"hr_application\"\n | \"hr_approval_authority\"\n | \"hr_approval_delegation\"\n | \"hr_asset\"\n | \"hr_asset_assignment\"\n | \"hr_attendance_exception\"\n | \"hr_auto_close_rule\"\n | \"hr_availability\"\n | \"hr_background_check\"\n | \"hr_benefits_event\"\n | \"hr_calculation_snapshot\"\n | \"hr_candidate\"\n | \"hr_candidate_conversion\"\n | \"hr_candidate_message\"\n | \"hr_careers_portal\"\n | \"hr_checklist_item\"\n | \"hr_checklist_run\"\n | \"hr_checklist_template\"\n | \"hr_checklist_template_item\"\n | \"hr_compensation\"\n | \"hr_corrective_action\"\n | \"hr_course\"\n | \"hr_course_version\"\n | \"hr_credential\"\n | \"hr_crew\"\n | \"hr_deduction_code\"\n | \"hr_department\"\n | \"hr_derived_grant\"\n | \"hr_disposition_event\"\n | \"hr_earning_code\"\n | \"hr_eeo_response\"\n | \"hr_emergency_contact\"\n | \"hr_employee\"\n | \"hr_employee_private\"\n | \"hr_employer_profile\"\n | \"hr_employment\"\n | \"hr_employment_pin\"\n | \"hr_engagement\"\n | \"hr_establishment\"\n | \"hr_external_identity\"\n | \"hr_field_policy\"\n | \"hr_holiday\"\n | \"hr_holiday_calendar\"\n | \"hr_i9\"\n | \"hr_i9_document\"\n | \"hr_incident\"\n | \"hr_incident_party\"\n | \"hr_interview\"\n | \"hr_interview_kit\"\n | \"hr_job_title\"\n | \"hr_jurisdiction\"\n | \"hr_jurisdiction_rule\"\n | \"hr_jurisdiction_rule_class\"\n | \"hr_jurisdiction_rule_org_decision\"\n | \"hr_jurisdiction_rule_test\"\n | \"hr_kiosk_device\"\n | \"hr_kiosk_session\"\n | \"hr_labor_target\"\n | \"hr_leave_case\"\n | \"hr_leave_enrollment\"\n | \"hr_leave_ledger\"\n | \"hr_leave_policy\"\n | \"hr_leave_request\"\n | \"hr_legal_hold\"\n | \"hr_legal_hold_item\"\n | \"hr_location\"\n | \"hr_new_hire_report\"\n | \"hr_offer\"\n | \"hr_opening\"\n | \"hr_overtime_alert\"\n | \"hr_overtime_alert_rule\"\n | \"hr_overtime_preapproval\"\n | \"hr_pay_group\"\n | \"hr_pay_period\"\n | \"hr_pay_period_employment\"\n | \"hr_payroll_export\"\n | \"hr_payroll_export_line\"\n | \"hr_position_assignment\"\n | \"hr_posting\"\n | \"hr_posting_publication\"\n | \"hr_provider_binding\"\n | \"hr_provider_event\"\n | \"hr_provisioning_result\"\n | \"hr_punch\"\n | \"hr_recalculation_batch\"\n | \"hr_record_class\"\n | \"hr_records_request\"\n | \"hr_reference_check\"\n | \"hr_reporting_line\"\n | \"hr_requisition\"\n | \"hr_restricted_note\"\n | \"hr_retention_rule\"\n | \"hr_role_assignment\"\n | \"hr_schedule\"\n | \"hr_schedule_change\"\n | \"hr_schedule_guidance\"\n | \"hr_schedule_template\"\n | \"hr_schedule_template_shift\"\n | \"hr_scorecard\"\n | \"hr_separation\"\n | \"hr_shift\"\n | \"hr_shift_claim\"\n | \"hr_staffing_requirement\"\n | \"hr_survey\"\n | \"hr_survey_invitation\"\n | \"hr_survey_question\"\n | \"hr_survey_response\"\n | \"hr_tax_registration\"\n | \"hr_tax_withholding\"\n | \"hr_time_adjustment\"\n | \"hr_training_assignment\"\n | \"hr_training_attempt\"\n | \"hr_transcript_entry\"\n | \"hr_verification_letter_request\"\n | \"hr_work_interval\"\n | \"hr_workflow_binding\"\n | \"hr_workflow_decision\"\n | \"hr_workflow_definition\"\n | \"hr_workflow_event\"\n | \"hr_workflow_failure\"\n | \"hr_workflow_flow_type\"\n | \"hr_workflow_instance\"\n | \"hr_workflow_step\"\n | \"hr_workflow_step_definition\"\n | \"hr_workweek\"\n | \"iam_api_key\"\n | \"industry_curator\"\n | \"interview_document_revision\"\n | \"interview_hole\"\n | \"interview_question\"\n | \"interview_session\"\n | \"interview_turn\"\n | \"invitation\"\n | \"invitation_code\"\n | \"invitation_request\"\n | \"item_mastery\"\n | \"judge_verdict\"\n | \"kg_alert\"\n | \"kg_suggestion_ack\"\n | \"kg_sweep_queue\"\n | \"kg_sweep_run\"\n | \"kg_sweep_state\"\n | \"kg_value_match\"\n | \"league_membership\"\n | \"learn_doc\"\n | \"library_doc\"\n | \"mandate\"\n | \"mandate_binding\"\n | \"mandate_treatment\"\n | \"marketing_initiative\"\n | \"masterwork_corpus_item\"\n | \"masterwork_run\"\n | \"membership\"\n | \"message\"\n | \"message_template\"\n | \"ner_shadow\"\n | \"note\"\n | \"note_folder\"\n | \"notification\"\n | \"notification_channel_preference\"\n | \"notification_event_override\"\n | \"notification_event_type\"\n | \"notification_preference\"\n | \"ops_issue_event\"\n | \"ops_proof_check\"\n | \"ops_proof_run\"\n | \"ops_proof_scenario\"\n | \"organization\"\n | \"output_feedback\"\n | \"page_extraction_job\"\n | \"page_extraction_page_run\"\n | \"party\"\n | \"party_contact_point\"\n | \"pc_article\"\n | \"pc_episode\"\n | \"pc_show\"\n | \"pc_studio_run\"\n | \"pc_studio_run_asset\"\n | \"pdf_redaction_audit\"\n | \"plan_cms_fill_item\"\n | \"plan_cms_fill_job\"\n | \"plan_entity\"\n | \"plan_node\"\n | \"plan_node_artifact\"\n | \"plan_node_step\"\n | \"plan_profile\"\n | \"platform_actor_session\"\n | \"platform_actor_token\"\n | \"platform_actor_token_event\"\n | \"platform_continued_access\"\n | \"platform_outcome_event\"\n | \"platform_outsider_consumer\"\n | \"platform_saved_view\"\n | \"podcast_race\"\n | \"processed_document\"\n | \"processed_document_page\"\n | \"product_capture_file\"\n | \"product_capture_item\"\n | \"product_capture_payload\"\n | \"product_capture_product\"\n | \"product_capture_question\"\n | \"project\"\n | \"provision\"\n | \"purpose\"\n | \"quiz_session\"\n | \"rag_ingest_run\"\n | \"redaction_mapping\"\n | \"research_analysis\"\n | \"research_content\"\n | \"research_context_bundle\"\n | \"research_document\"\n | \"research_keyword\"\n | \"research_media\"\n | \"research_source\"\n | \"research_synthesis\"\n | \"research_tag\"\n | \"research_template\"\n | \"research_topic\"\n | \"route_manifest_entry\"\n | \"rulebook\"\n | \"sandbox_instance\"\n | \"sch_agent_task\"\n | \"sch_run\"\n | \"sch_task\"\n | \"sch_trigger\"\n | \"scope\"\n | \"scope_association_suggestion\"\n | \"scope_item_value_suggestion\"\n | \"scope_suggestion\"\n | \"scope_type\"\n | \"seo_ai_visibility_citation\"\n | \"seo_ai_visibility_claim\"\n | \"seo_ai_visibility_panel\"\n | \"seo_ai_visibility_response\"\n | \"seo_ai_visibility_signal\"\n | \"seo_backlink\"\n | \"seo_backlink_change_event\"\n | \"seo_backlink_dimension_snapshot\"\n | \"seo_backlink_observation\"\n | \"seo_backlink_snapshot\"\n | \"seo_change_assessment\"\n | \"seo_change_event\"\n | \"seo_change_item\"\n | \"seo_change_metric\"\n | \"seo_change_set\"\n | \"seo_change_theory\"\n | \"seo_collection_run\"\n | \"seo_competitor\"\n | \"seo_competitor_observation\"\n | \"seo_competitor_opportunity\"\n | \"seo_coverage_mention\"\n | \"seo_coverage_tracker\"\n | \"seo_dimension_value_matcher\"\n | \"seo_engine_schedule\"\n | \"seo_geo_place\"\n | \"seo_gsc_dig_rule\"\n | \"seo_keyword\"\n | \"seo_keyword_class_rule\"\n | \"seo_keyword_edge\"\n | \"seo_keyword_facet\"\n | \"seo_keyword_market\"\n | \"seo_keyword_market_observation\"\n | \"seo_keyword_place\"\n | \"seo_keyword_saved_view\"\n | \"seo_keyword_topic\"\n | \"seo_landscape_brief\"\n | \"seo_link_gap_domain\"\n | \"seo_link_gap_match\"\n | \"seo_page_measurement_health\"\n | \"seo_page_performance\"\n | \"seo_provider_call\"\n | \"seo_provider_task\"\n | \"seo_rank_observation\"\n | \"seo_rank_target\"\n | \"seo_raw_payload\"\n | \"seo_referring_domain_profile\"\n | \"seo_reputation_case\"\n | \"seo_search_performance_daily\"\n | \"seo_serp_mention\"\n | \"seo_serp_opportunity\"\n | \"seo_serp_result\"\n | \"seo_serp_snapshot\"\n | \"seo_site_geo_area\"\n | \"seo_site_keyword_offering\"\n | \"seo_site_keyword_value\"\n | \"seo_site_offering_value\"\n | \"seo_site_topic_value\"\n | \"seo_site_value_combo\"\n | \"seo_site_value_worth\"\n | \"seo_site_vocabulary\"\n | \"seo_source_request\"\n | \"seo_starter_pack\"\n | \"seo_starter_pack_item\"\n | \"seo_story_angle\"\n | \"seo_topic\"\n | \"seo_web_analytics_daily\"\n | \"shared_canvas_item\"\n | \"short_link\"\n | \"skill\"\n | \"skill_render_definition\"\n | \"sms_consent\"\n | \"sms_conversation\"\n | \"sms_message\"\n | \"sms_message_media\"\n | \"sms_notification\"\n | \"sms_notification_preference\"\n | \"sms_phone_number\"\n | \"structured_list\"\n | \"studio_documents\"\n | \"studio_recording_chunks\"\n | \"studio_recording_segments\"\n | \"studio_run\"\n | \"studio_session\"\n | \"studio_session_settings\"\n | \"study_attempt\"\n | \"study_goal\"\n | \"study_media\"\n | \"study_plan\"\n | \"study_plan_block\"\n | \"study_plan_day\"\n | \"study_reminder_context\"\n | \"study_reminder_delivery\"\n | \"study_session\"\n | \"surface\"\n | \"system_context_item\"\n | \"system_error\"\n | \"system_personal_org_failure\"\n | \"system_write_failure\"\n | \"task\"\n | \"thread\"\n | \"tool\"\n | \"tool_bundle\"\n | \"tool_call\"\n | \"tool_definition_version\"\n | \"tool_test_sample\"\n | \"tool_ui\"\n | \"tool_ui_incident\"\n | \"tool_ui_version\"\n | \"transcript\"\n | \"udt_dataset_fields\"\n | \"udt_dataset_rows\"\n | \"udt_document\"\n | \"udt_structured_list_items\"\n | \"ui_surface_agent_pref\"\n | \"ui_surface_config\"\n | \"user_achievement\"\n | \"user_analysis_preference\"\n | \"user_bookmark\"\n | \"user_email_preference\"\n | \"user_feedback\"\n | \"user_form_profile\"\n | \"user_markdown_sample\"\n | \"user_memory\"\n | \"user_preference\"\n | \"user_profile\"\n | \"user_stat\"\n | \"user_surface_state\"\n | \"voice\"\n | \"war_room\"\n | \"wbx_capture\"\n | \"wbx_guidance\"\n | \"wbx_highlight\"\n | \"wbx_pattern\"\n | \"wbx_screenshot\"\n | \"wbx_seo_audit\"\n | \"wc_claim\"\n | \"wc_impairment_definition\"\n | \"wc_injury\"\n | \"wc_report\"\n | \"web_analysis_item\"\n | \"web_brand\"\n | \"web_brand_asset\"\n | \"web_brand_offering\"\n | \"web_business_fact\"\n | \"web_business_location\"\n | \"web_crawl_event\"\n | \"web_crawl_preset\"\n | \"web_crawl_schedule\"\n | \"web_crawl_session\"\n | \"web_crawl_url\"\n | \"web_discovered_item\"\n | \"web_finding\"\n | \"web_gsc_page_stat\"\n | \"web_link_edge\"\n | \"web_listing_publisher\"\n | \"web_location_listing\"\n | \"web_offering_template\"\n | \"web_page\"\n | \"web_page_content\"\n | \"web_page_evidence\"\n | \"web_page_sitemap\"\n | \"web_property\"\n | \"web_provider\"\n | \"web_result\"\n | \"web_screenshot\"\n | \"web_site\"\n | \"web_site_endpoint_rule\"\n | \"web_site_item_config\"\n | \"web_site_offering\"\n | \"web_sitemap\"\n | \"web_snapshot\"\n | \"wf_node_data_slot\"\n | \"work_item\"\n | \"workbook\"\n | \"workflow\"\n | \"workflow_card\"\n | \"workflow_checkpoint\"\n | \"workflow_comparison\"\n | \"workflow_definition_version\"\n | \"workflow_idempotency\"\n | \"workflow_job\"\n | \"workflow_node_events\"\n | \"workflow_node_outcome\"\n | \"workflow_plan\"\n | \"workflow_plan_event\"\n | \"workflow_plan_sample\"\n | \"workflow_recovery_audit\"\n | \"workflow_run\"\n | \"workflow_run_log\"\n | \"workflow_runtime_surface\"\n | \"workflow_template\"\n | \"workflow_trigger\"\n | \"workflow_trigger_fire\"\n | \"working_document\"\n | \"youtube_search\"\n | \"youtube_video\";\n\n/** Tokens flagged `reference_pickable` — offered in reference \"Allowed types\" choosers. */\nexport type ReferencePickableEntityToken =\n | \"agent\"\n | \"agent_shortcut\"\n | \"agent_surface_binding\"\n | \"agent_template\"\n | \"ai_api\"\n | \"ai_endpoint\"\n | \"ai_model\"\n | \"ai_provider\"\n | \"ai_setting\"\n | \"app\"\n | \"assessment\"\n | \"canvas_comment\"\n | \"canvas_item\"\n | \"canvas_score\"\n | \"category\"\n | \"code_file\"\n | \"code_folder\"\n | \"code_repository\"\n | \"comparison_set\"\n | \"contact_submission\"\n | \"content_ir_kind\"\n | \"content_ir_kind_instance\"\n | \"context_item\"\n | \"conversation\"\n | \"crm_deal\"\n | \"crm_outreach_list\"\n | \"cx_agent_memory\"\n | \"data_store\"\n | \"dataset\"\n | \"fc_set\"\n | \"feature_doc\"\n | \"file\"\n | \"flexible_data\"\n | \"folder\"\n | \"game_result\"\n | \"heatmap_save\"\n | \"hr_asset\"\n | \"hr_candidate\"\n | \"hr_careers_portal\"\n | \"hr_checklist_template\"\n | \"hr_course\"\n | \"hr_crew\"\n | \"hr_deduction_code\"\n | \"hr_department\"\n | \"hr_earning_code\"\n | \"hr_employee\"\n | \"hr_holiday_calendar\"\n | \"hr_interview_kit\"\n | \"hr_job_title\"\n | \"hr_jurisdiction\"\n | \"hr_jurisdiction_rule_class\"\n | \"hr_leave_policy\"\n | \"hr_location\"\n | \"hr_pay_group\"\n | \"hr_posting\"\n | \"hr_record_class\"\n | \"hr_requisition\"\n | \"hr_schedule\"\n | \"hr_schedule_template\"\n | \"hr_survey\"\n | \"league_membership\"\n | \"learn_doc\"\n | \"marketing_initiative\"\n | \"message_template\"\n | \"note\"\n | \"note_folder\"\n | \"organization\"\n | \"page_extraction_job\"\n | \"party\"\n | \"pc_article\"\n | \"pc_episode\"\n | \"pc_show\"\n | \"pc_studio_run\"\n | \"processed_document\"\n | \"project\"\n | \"quiz_session\"\n | \"research_template\"\n | \"research_topic\"\n | \"rulebook\"\n | \"sch_task\"\n | \"scope_type\"\n | \"seo_topic\"\n | \"shared_canvas_item\"\n | \"skill\"\n | \"skill_render_definition\"\n | \"structured_list\"\n | \"studio_session\"\n | \"study_goal\"\n | \"study_media\"\n | \"study_plan\"\n | \"study_plan_block\"\n | \"surface\"\n | \"task\"\n | \"thread\"\n | \"tool\"\n | \"tool_bundle\"\n | \"transcript\"\n | \"udt_document\"\n | \"user_markdown_sample\"\n | \"user_profile\"\n | \"voice\"\n | \"war_room\"\n | \"wbx_capture\"\n | \"wbx_pattern\"\n | \"web_analysis_item\"\n | \"web_brand\"\n | \"web_provider\"\n | \"web_site\"\n | \"workbook\"\n | \"workflow\"\n | \"workflow_plan\"\n | \"workflow_template\"\n | \"workflow_trigger\"\n | \"working_document\";\n\n/** Tokens flagged `is_component` — child/detail rows, not standalone entities. */\nexport type ComponentEntityToken =\n | \"agent_card\"\n | \"agent_definition_version\"\n | \"agent_drift_alert\"\n | \"agent_run_stage\"\n | \"agent_usage\"\n | \"app_definition_version\"\n | \"app_error\"\n | \"app_execution\"\n | \"app_rate_limit\"\n | \"artifact\"\n | \"assessment_item\"\n | \"browser_account_binding\"\n | \"browser_action_event\"\n | \"browser_capture\"\n | \"browser_control_request\"\n | \"browser_handoff\"\n | \"browser_login_attempt\"\n | \"browser_run\"\n | \"browser_site_observation\"\n | \"canvas_item_state\"\n | \"cmp_entry\"\n | \"coding_session_entry\"\n | \"commerce_asset_allocation\"\n | \"commerce_asset_grading\"\n | \"commerce_asset_identifier\"\n | \"commerce_asset_lot_event\"\n | \"commerce_asset_mandate_result\"\n | \"commerce_asset_price_factor\"\n | \"commerce_asset_reshoot_request\"\n | \"commerce_asset_review\"\n | \"commerce_asset_unknown\"\n | \"commerce_ebay_business_policy\"\n | \"commerce_ebay_custom_policy\"\n | \"commerce_ebay_inventory_item\"\n | \"commerce_ebay_inventory_item_group\"\n | \"commerce_ebay_inventory_item_group_member\"\n | \"commerce_ebay_inventory_location\"\n | \"commerce_ebay_listing\"\n | \"commerce_ebay_media_asset\"\n | \"commerce_ebay_notification_subscription\"\n | \"commerce_ebay_offer\"\n | \"commerce_ebay_order\"\n | \"commerce_ebay_order_line_item\"\n | \"commerce_ebay_shipping_fulfillment\"\n | \"commerce_ebay_store_category\"\n | \"commerce_human_correction\"\n | \"commerce_intake_artifact\"\n | \"commerce_intake_asset\"\n | \"commerce_label_code\"\n | \"commerce_marketplace_site\"\n | \"commerce_marketplace_sync_run\"\n | \"commerce_prediction_outcome\"\n | \"commerce_product_channel_ref\"\n | \"commerce_product_media\"\n | \"commerce_product_variant\"\n | \"commerce_recall_audit\"\n | \"content_ir_kind_component\"\n | \"content_ir_kind_component_incident\"\n | \"content_ir_kind_conformance\"\n | \"content_ir_kind_edge\"\n | \"content_ir_kind_example\"\n | \"content_ir_kind_surface\"\n | \"conversation_value\"\n | \"crm_address\"\n | \"crm_affiliation\"\n | \"crm_contact_candidate\"\n | \"crm_deal_stage_event\"\n | \"crm_interaction\"\n | \"crm_merge_candidate\"\n | \"crm_outreach_list_member\"\n | \"crm_party_merge\"\n | \"crm_sending_event\"\n | \"crm_sending_identity_check\"\n | \"custom_record\"\n | \"cx_agent_plan\"\n | \"cx_agent_task\"\n | \"cx_code_edit\"\n | \"cx_code_message_file\"\n | \"cx_media\"\n | \"cx_observational_memory\"\n | \"cx_observational_memory_event\"\n | \"cx_pending_injection\"\n | \"cx_request\"\n | \"cx_request_snapshot\"\n | \"cx_tool_trace\"\n | \"cx_user_todo\"\n | \"dm_message\"\n | \"dm_participant\"\n | \"esign_campaign_member\"\n | \"esign_envelope_certificate\"\n | \"esign_envelope_document\"\n | \"esign_envelope_external_ref\"\n | \"esign_envelope_signer\"\n | \"fc_detail\"\n | \"file_analysis\"\n | \"file_entities\"\n | \"file_overrides\"\n | \"file_page_annotations\"\n | \"file_pages\"\n | \"file_version\"\n | \"global_execution\"\n | \"global_execution_checkpoint\"\n | \"global_execution_event\"\n | \"global_meter_entry\"\n | \"growth_loop_event\"\n | \"growth_loop_stage_run\"\n | \"hindsight_finding\"\n | \"hindsight_replay\"\n | \"hindsight_review\"\n | \"hr_application\"\n | \"hr_asset_assignment\"\n | \"hr_attendance_exception\"\n | \"hr_availability\"\n | \"hr_benefits_event\"\n | \"hr_candidate_conversion\"\n | \"hr_candidate_message\"\n | \"hr_checklist_item\"\n | \"hr_checklist_run\"\n | \"hr_checklist_template_item\"\n | \"hr_course_version\"\n | \"hr_credential\"\n | \"hr_engagement\"\n | \"hr_establishment\"\n | \"hr_external_identity\"\n | \"hr_holiday\"\n | \"hr_i9_document\"\n | \"hr_incident_party\"\n | \"hr_interview\"\n | \"hr_jurisdiction_rule_test\"\n | \"hr_labor_target\"\n | \"hr_leave_enrollment\"\n | \"hr_leave_ledger\"\n | \"hr_leave_request\"\n | \"hr_legal_hold_item\"\n | \"hr_new_hire_report\"\n | \"hr_opening\"\n | \"hr_overtime_alert\"\n | \"hr_overtime_preapproval\"\n | \"hr_pay_period\"\n | \"hr_pay_period_employment\"\n | \"hr_payroll_export\"\n | \"hr_payroll_export_line\"\n | \"hr_position_assignment\"\n | \"hr_posting_publication\"\n | \"hr_provider_event\"\n | \"hr_provisioning_result\"\n | \"hr_punch\"\n | \"hr_reporting_line\"\n | \"hr_schedule_change\"\n | \"hr_schedule_template_shift\"\n | \"hr_scorecard\"\n | \"hr_shift\"\n | \"hr_shift_claim\"\n | \"hr_staffing_requirement\"\n | \"hr_survey_invitation\"\n | \"hr_survey_question\"\n | \"hr_survey_response\"\n | \"hr_tax_registration\"\n | \"hr_time_adjustment\"\n | \"hr_training_assignment\"\n | \"hr_training_attempt\"\n | \"hr_transcript_entry\"\n | \"hr_work_interval\"\n | \"hr_workflow_binding\"\n | \"hr_workflow_failure\"\n | \"hr_workflow_step\"\n | \"hr_workflow_step_definition\"\n | \"hr_workweek\"\n | \"interview_document_revision\"\n | \"interview_hole\"\n | \"interview_question\"\n | \"interview_turn\"\n | \"masterwork_corpus_item\"\n | \"masterwork_run\"\n | \"message\"\n | \"ops_proof_run\"\n | \"party_contact_point\"\n | \"pc_studio_run_asset\"\n | \"plan_cms_fill_item\"\n | \"plan_cms_fill_job\"\n | \"plan_node_artifact\"\n | \"plan_node_step\"\n | \"processed_document_page\"\n | \"product_capture_file\"\n | \"product_capture_payload\"\n | \"product_capture_product\"\n | \"product_capture_question\"\n | \"redaction_mapping\"\n | \"research_analysis\"\n | \"research_content\"\n | \"research_document\"\n | \"research_keyword\"\n | \"research_media\"\n | \"research_source\"\n | \"research_synthesis\"\n | \"research_tag\"\n | \"sch_agent_task\"\n | \"sch_run\"\n | \"sch_trigger\"\n | \"seo_ai_visibility_citation\"\n | \"seo_ai_visibility_claim\"\n | \"seo_ai_visibility_panel\"\n | \"seo_ai_visibility_response\"\n | \"seo_ai_visibility_signal\"\n | \"seo_backlink\"\n | \"seo_backlink_change_event\"\n | \"seo_backlink_dimension_snapshot\"\n | \"seo_backlink_observation\"\n | \"seo_backlink_snapshot\"\n | \"seo_change_assessment\"\n | \"seo_change_event\"\n | \"seo_change_item\"\n | \"seo_change_metric\"\n | \"seo_change_set\"\n | \"seo_change_theory\"\n | \"seo_competitor\"\n | \"seo_competitor_observation\"\n | \"seo_competitor_opportunity\"\n | \"seo_coverage_mention\"\n | \"seo_coverage_tracker\"\n | \"seo_dimension_value_matcher\"\n | \"seo_keyword_market_observation\"\n | \"seo_keyword_saved_view\"\n | \"seo_landscape_brief\"\n | \"seo_link_gap_domain\"\n | \"seo_link_gap_match\"\n | \"seo_page_measurement_health\"\n | \"seo_page_performance\"\n | \"seo_provider_call\"\n | \"seo_provider_task\"\n | \"seo_rank_observation\"\n | \"seo_raw_payload\"\n | \"seo_referring_domain_profile\"\n | \"seo_reputation_case\"\n | \"seo_search_performance_daily\"\n | \"seo_serp_mention\"\n | \"seo_serp_opportunity\"\n | \"seo_serp_result\"\n | \"seo_serp_snapshot\"\n | \"seo_site_geo_area\"\n | \"seo_site_keyword_offering\"\n | \"seo_site_keyword_value\"\n | \"seo_site_offering_value\"\n | \"seo_site_topic_value\"\n | \"seo_site_value_combo\"\n | \"seo_site_value_worth\"\n | \"seo_site_vocabulary\"\n | \"seo_web_analytics_daily\"\n | \"sms_message\"\n | \"sms_message_media\"\n | \"studio_documents\"\n | \"studio_recording_segments\"\n | \"studio_session_settings\"\n | \"tool_call\"\n | \"tool_definition_version\"\n | \"tool_test_sample\"\n | \"tool_ui\"\n | \"tool_ui_incident\"\n | \"tool_ui_version\"\n | \"udt_dataset_fields\"\n | \"udt_dataset_rows\"\n | \"udt_structured_list_items\"\n | \"wc_impairment_definition\"\n | \"wc_injury\"\n | \"wc_report\"\n | \"web_brand_asset\"\n | \"web_brand_offering\"\n | \"web_business_fact\"\n | \"web_business_location\"\n | \"web_crawl_event\"\n | \"web_crawl_preset\"\n | \"web_crawl_schedule\"\n | \"web_crawl_session\"\n | \"web_crawl_url\"\n | \"web_discovered_item\"\n | \"web_finding\"\n | \"web_gsc_page_stat\"\n | \"web_link_edge\"\n | \"web_location_listing\"\n | \"web_page\"\n | \"web_page_content\"\n | \"web_page_evidence\"\n | \"web_page_sitemap\"\n | \"web_property\"\n | \"web_result\"\n | \"web_screenshot\"\n | \"web_site_endpoint_rule\"\n | \"web_site_item_config\"\n | \"web_site_offering\"\n | \"web_sitemap\"\n | \"web_snapshot\"\n | \"wf_node_data_slot\"\n | \"work_item\"\n | \"workflow_card\"\n | \"workflow_checkpoint\"\n | \"workflow_definition_version\"\n | \"workflow_idempotency\"\n | \"workflow_job\"\n | \"workflow_node_events\"\n | \"workflow_node_outcome\"\n | \"workflow_plan\"\n | \"workflow_plan_event\"\n | \"workflow_plan_sample\"\n | \"workflow_recovery_audit\"\n | \"workflow_trigger_fire\";\n\n/** Tokens flagged `default_scopeable` — can carry scope tags by default. */\nexport type ScopeableEntityToken =\n | \"access_request\"\n | \"activity\"\n | \"agent\"\n | \"agent_card\"\n | \"agent_definition_version\"\n | \"agent_drift_alert\"\n | \"agent_exemplar\"\n | \"agent_mandate_note\"\n | \"agent_prompt_remediation\"\n | \"agent_run\"\n | \"agent_run_stage\"\n | \"agent_shortcut\"\n | \"agent_surface_binding\"\n | \"agent_template\"\n | \"agent_usage\"\n | \"ai_api\"\n | \"ai_endpoint\"\n | \"ai_model\"\n | \"ai_model_alias\"\n | \"ai_offering\"\n | \"ai_provider\"\n | \"ai_setting\"\n | \"app\"\n | \"app_definition_version\"\n | \"app_error\"\n | \"app_execution\"\n | \"app_instance\"\n | \"app_log\"\n | \"app_rate_limit\"\n | \"app_setting\"\n | \"app_sync_status\"\n | \"approach\"\n | \"artifact\"\n | \"assessment\"\n | \"assessment_item\"\n | \"assessment_result\"\n | \"assist\"\n | \"batch_cost_event\"\n | \"batch_provider_batch\"\n | \"batch_work_item\"\n | \"browser_account_binding\"\n | \"browser_action_event\"\n | \"browser_authenticator_window\"\n | \"browser_capture\"\n | \"browser_control_request\"\n | \"browser_handoff\"\n | \"browser_login_attempt\"\n | \"browser_login_recipe\"\n | \"browser_profile\"\n | \"browser_profile_checkpoint\"\n | \"browser_run\"\n | \"browser_site_observation\"\n | \"browser_site_policy\"\n | \"browser_stream_ticket\"\n | \"canvas_comment\"\n | \"canvas_comment_like\"\n | \"canvas_item\"\n | \"canvas_item_state\"\n | \"canvas_like\"\n | \"canvas_score\"\n | \"canvas_view\"\n | \"category\"\n | \"cmp_entry\"\n | \"cmp_feedback\"\n | \"code_file\"\n | \"code_folder\"\n | \"code_repository\"\n | \"coding_session\"\n | \"coding_session_entry\"\n | \"comment\"\n | \"commerce_asset_allocation\"\n | \"commerce_asset_grading\"\n | \"commerce_asset_identifier\"\n | \"commerce_asset_lot_event\"\n | \"commerce_asset_mandate_result\"\n | \"commerce_asset_price_factor\"\n | \"commerce_asset_reshoot_request\"\n | \"commerce_asset_review\"\n | \"commerce_asset_unknown\"\n | \"commerce_certified_printer\"\n | \"commerce_cloud_sync_connection\"\n | \"commerce_ebay_business_policy\"\n | \"commerce_ebay_category\"\n | \"commerce_ebay_category_aspect\"\n | \"commerce_ebay_category_tree\"\n | \"commerce_ebay_custom_policy\"\n | \"commerce_ebay_inventory_item\"\n | \"commerce_ebay_inventory_item_group\"\n | \"commerce_ebay_inventory_item_group_member\"\n | \"commerce_ebay_inventory_location\"\n | \"commerce_ebay_listing\"\n | \"commerce_ebay_marketplace_policy\"\n | \"commerce_ebay_media_asset\"\n | \"commerce_ebay_notification_destination\"\n | \"commerce_ebay_notification_event\"\n | \"commerce_ebay_notification_subscription\"\n | \"commerce_ebay_notification_topic\"\n | \"commerce_ebay_offer\"\n | \"commerce_ebay_order\"\n | \"commerce_ebay_order_line_item\"\n | \"commerce_ebay_shipping_fulfillment\"\n | \"commerce_ebay_store_category\"\n | \"commerce_human_correction\"\n | \"commerce_intake_artifact\"\n | \"commerce_intake_asset\"\n | \"commerce_intake_batch\"\n | \"commerce_label_batch\"\n | \"commerce_label_code\"\n | \"commerce_marketplace_account\"\n | \"commerce_marketplace_account_deletion_audit\"\n | \"commerce_marketplace_api_call\"\n | \"commerce_marketplace_rate_budget\"\n | \"commerce_marketplace_site\"\n | \"commerce_marketplace_sync_run\"\n | \"commerce_prediction_outcome\"\n | \"commerce_print_order\"\n | \"commerce_product\"\n | \"commerce_product_channel_ref\"\n | \"commerce_product_media\"\n | \"commerce_product_variant\"\n | \"commerce_recall_audit\"\n | \"comparison_set\"\n | \"contact_medium\"\n | \"contact_submission\"\n | \"content_ir_kind\"\n | \"content_ir_kind_component\"\n | \"content_ir_kind_component_incident\"\n | \"content_ir_kind_conformance\"\n | \"content_ir_kind_edge\"\n | \"content_ir_kind_example\"\n | \"content_ir_kind_instance\"\n | \"content_ir_kind_surface\"\n | \"context_item\"\n | \"context_item_suggestion\"\n | \"conversation\"\n | \"crm_address\"\n | \"crm_affiliation\"\n | \"crm_blocklist_entry\"\n | \"crm_contact_candidate\"\n | \"crm_deal\"\n | \"crm_deal_stage_event\"\n | \"crm_enrichment_call\"\n | \"crm_interaction\"\n | \"crm_merge_candidate\"\n | \"crm_outreach_list\"\n | \"crm_outreach_list_member\"\n | \"crm_party_merge\"\n | \"crm_registry_ingest_run\"\n | \"crm_registry_source\"\n | \"crm_saved_view\"\n | \"crm_sending_event\"\n | \"crm_sending_identity\"\n | \"crm_sending_identity_check\"\n | \"crm_sending_policy\"\n | \"custom_entity_definition\"\n | \"custom_field_definition\"\n | \"custom_field_target\"\n | \"custom_record\"\n | \"data_store\"\n | \"dataset\"\n | \"derive_run\"\n | \"dict_setting\"\n | \"dm_conversation\"\n | \"dm_message\"\n | \"dm_participant\"\n | \"domain_classification\"\n | \"esign_campaign\"\n | \"esign_campaign_member\"\n | \"esign_consent_disclosure\"\n | \"esign_envelope\"\n | \"esign_envelope_certificate\"\n | \"esign_envelope_document\"\n | \"esign_envelope_event\"\n | \"esign_envelope_external_ref\"\n | \"esign_envelope_signer\"\n | \"esign_provider\"\n | \"esign_provider_binding\"\n | \"esign_signing_key\"\n | \"fc_card\"\n | \"fc_detail\"\n | \"fc_set\"\n | \"feature_doc\"\n | \"file\"\n | \"file_analysis\"\n | \"file_entities\"\n | \"file_overrides\"\n | \"file_page_annotations\"\n | \"file_pages\"\n | \"flexible_data\"\n | \"folder\"\n | \"game_badge\"\n | \"game_result\"\n | \"game_room\"\n | \"global_execution\"\n | \"global_execution_checkpoint\"\n | \"global_execution_event\"\n | \"global_meter_entry\"\n | \"global_origin\"\n | \"global_request\"\n | \"growth_loop_event\"\n | \"growth_loop_run\"\n | \"growth_loop_stage_run\"\n | \"guided_checklist_run\"\n | \"heatmap_save\"\n | \"hindsight_enrollment\"\n | \"hindsight_finding\"\n | \"hindsight_regression_case\"\n | \"hindsight_replay\"\n | \"hindsight_replay_step\"\n | \"hindsight_review\"\n | \"hr_access_audit\"\n | \"hr_access_role\"\n | \"hr_accommodation_request\"\n | \"hr_ai_evidence\"\n | \"hr_alert_routing_rule\"\n | \"hr_application\"\n | \"hr_approval_authority\"\n | \"hr_approval_delegation\"\n | \"hr_asset\"\n | \"hr_asset_assignment\"\n | \"hr_attendance_exception\"\n | \"hr_auto_close_rule\"\n | \"hr_availability\"\n | \"hr_background_check\"\n | \"hr_benefits_event\"\n | \"hr_calculation_snapshot\"\n | \"hr_candidate\"\n | \"hr_candidate_conversion\"\n | \"hr_candidate_message\"\n | \"hr_careers_portal\"\n | \"hr_checklist_item\"\n | \"hr_checklist_run\"\n | \"hr_checklist_template\"\n | \"hr_checklist_template_item\"\n | \"hr_compensation\"\n | \"hr_corrective_action\"\n | \"hr_course\"\n | \"hr_course_version\"\n | \"hr_credential\"\n | \"hr_crew\"\n | \"hr_deduction_code\"\n | \"hr_department\"\n | \"hr_derived_grant\"\n | \"hr_disposition_event\"\n | \"hr_earning_code\"\n | \"hr_eeo_response\"\n | \"hr_emergency_contact\"\n | \"hr_employee\"\n | \"hr_employee_private\"\n | \"hr_employer_profile\"\n | \"hr_employment\"\n | \"hr_employment_pin\"\n | \"hr_engagement\"\n | \"hr_establishment\"\n | \"hr_external_identity\"\n | \"hr_field_policy\"\n | \"hr_holiday\"\n | \"hr_holiday_calendar\"\n | \"hr_i9\"\n | \"hr_i9_document\"\n | \"hr_incident\"\n | \"hr_incident_party\"\n | \"hr_interview\"\n | \"hr_interview_kit\"\n | \"hr_job_title\"\n | \"hr_jurisdiction\"\n | \"hr_jurisdiction_rule\"\n | \"hr_jurisdiction_rule_class\"\n | \"hr_jurisdiction_rule_org_decision\"\n | \"hr_jurisdiction_rule_test\"\n | \"hr_kiosk_device\"\n | \"hr_kiosk_session\"\n | \"hr_labor_target\"\n | \"hr_leave_case\"\n | \"hr_leave_enrollment\"\n | \"hr_leave_ledger\"\n | \"hr_leave_policy\"\n | \"hr_leave_request\"\n | \"hr_legal_hold\"\n | \"hr_legal_hold_item\"\n | \"hr_location\"\n | \"hr_new_hire_report\"\n | \"hr_offer\"\n | \"hr_opening\"\n | \"hr_overtime_alert\"\n | \"hr_overtime_alert_rule\"\n | \"hr_overtime_preapproval\"\n | \"hr_pay_group\"\n | \"hr_pay_period\"\n | \"hr_pay_period_employment\"\n | \"hr_payroll_export\"\n | \"hr_payroll_export_line\"\n | \"hr_position_assignment\"\n | \"hr_posting\"\n | \"hr_posting_publication\"\n | \"hr_provider_binding\"\n | \"hr_provider_event\"\n | \"hr_provisioning_result\"\n | \"hr_punch\"\n | \"hr_recalculation_batch\"\n | \"hr_record_class\"\n | \"hr_records_request\"\n | \"hr_reference_check\"\n | \"hr_reporting_line\"\n | \"hr_requisition\"\n | \"hr_restricted_note\"\n | \"hr_retention_rule\"\n | \"hr_role_assignment\"\n | \"hr_schedule\"\n | \"hr_schedule_change\"\n | \"hr_schedule_guidance\"\n | \"hr_schedule_template\"\n | \"hr_schedule_template_shift\"\n | \"hr_scorecard\"\n | \"hr_separation\"\n | \"hr_shift\"\n | \"hr_shift_claim\"\n | \"hr_staffing_requirement\"\n | \"hr_survey\"\n | \"hr_survey_invitation\"\n | \"hr_survey_question\"\n | \"hr_survey_response\"\n | \"hr_tax_registration\"\n | \"hr_tax_withholding\"\n | \"hr_time_adjustment\"\n | \"hr_training_assignment\"\n | \"hr_training_attempt\"\n | \"hr_transcript_entry\"\n | \"hr_verification_letter_request\"\n | \"hr_work_interval\"\n | \"hr_workflow_binding\"\n | \"hr_workflow_decision\"\n | \"hr_workflow_definition\"\n | \"hr_workflow_event\"\n | \"hr_workflow_failure\"\n | \"hr_workflow_flow_type\"\n | \"hr_workflow_instance\"\n | \"hr_workflow_step\"\n | \"hr_workflow_step_definition\"\n | \"hr_workweek\"\n | \"iam_api_key\"\n | \"industry_curator\"\n | \"interview_document_revision\"\n | \"interview_hole\"\n | \"interview_question\"\n | \"interview_session\"\n | \"interview_turn\"\n | \"invitation\"\n | \"invitation_code\"\n | \"invitation_request\"\n | \"item_mastery\"\n | \"judge_verdict\"\n | \"kg_alert\"\n | \"kg_suggestion_ack\"\n | \"kg_sweep_queue\"\n | \"kg_sweep_run\"\n | \"kg_sweep_state\"\n | \"kg_value_match\"\n | \"league_membership\"\n | \"learn_doc\"\n | \"library_doc\"\n | \"mandate\"\n | \"mandate_binding\"\n | \"mandate_treatment\"\n | \"marketing_initiative\"\n | \"masterwork_corpus_item\"\n | \"masterwork_run\"\n | \"membership\"\n | \"message\"\n | \"message_template\"\n | \"ner_shadow\"\n | \"note\"\n | \"note_folder\"\n | \"notification\"\n | \"notification_channel_preference\"\n | \"notification_event_override\"\n | \"notification_event_type\"\n | \"notification_preference\"\n | \"ops_issue_event\"\n | \"ops_proof_check\"\n | \"ops_proof_run\"\n | \"ops_proof_scenario\"\n | \"organization\"\n | \"output_feedback\"\n | \"page_extraction_job\"\n | \"page_extraction_page_run\"\n | \"party\"\n | \"party_contact_point\"\n | \"pc_article\"\n | \"pc_episode\"\n | \"pc_show\"\n | \"pc_studio_run\"\n | \"pc_studio_run_asset\"\n | \"pdf_redaction_audit\"\n | \"plan_cms_fill_item\"\n | \"plan_cms_fill_job\"\n | \"plan_entity\"\n | \"plan_node\"\n | \"plan_node_artifact\"\n | \"plan_node_step\"\n | \"plan_profile\"\n | \"platform_actor_session\"\n | \"platform_actor_token\"\n | \"platform_actor_token_event\"\n | \"platform_continued_access\"\n | \"platform_outcome_event\"\n | \"platform_outsider_consumer\"\n | \"platform_saved_view\"\n | \"podcast_race\"\n | \"processed_document\"\n | \"processed_document_page\"\n | \"product_capture_file\"\n | \"product_capture_item\"\n | \"product_capture_payload\"\n | \"product_capture_product\"\n | \"product_capture_question\"\n | \"project\"\n | \"provision\"\n | \"purpose\"\n | \"quiz_session\"\n | \"rag_ingest_run\"\n | \"redaction_mapping\"\n | \"research_analysis\"\n | \"research_content\"\n | \"research_context_bundle\"\n | \"research_document\"\n | \"research_keyword\"\n | \"research_media\"\n | \"research_source\"\n | \"research_synthesis\"\n | \"research_tag\"\n | \"research_template\"\n | \"research_topic\"\n | \"route_manifest_entry\"\n | \"rulebook\"\n | \"sandbox_instance\"\n | \"sch_agent_task\"\n | \"sch_run\"\n | \"sch_task\"\n | \"sch_trigger\"\n | \"scope\"\n | \"scope_association_suggestion\"\n | \"scope_item_value_suggestion\"\n | \"scope_suggestion\"\n | \"scope_type\"\n | \"seo_ai_visibility_citation\"\n | \"seo_ai_visibility_claim\"\n | \"seo_ai_visibility_panel\"\n | \"seo_ai_visibility_response\"\n | \"seo_ai_visibility_signal\"\n | \"seo_backlink\"\n | \"seo_backlink_change_event\"\n | \"seo_backlink_dimension_snapshot\"\n | \"seo_backlink_observation\"\n | \"seo_backlink_snapshot\"\n | \"seo_change_assessment\"\n | \"seo_change_event\"\n | \"seo_change_item\"\n | \"seo_change_metric\"\n | \"seo_change_set\"\n | \"seo_change_theory\"\n | \"seo_collection_run\"\n | \"seo_competitor\"\n | \"seo_competitor_observation\"\n | \"seo_competitor_opportunity\"\n | \"seo_coverage_mention\"\n | \"seo_coverage_tracker\"\n | \"seo_dimension_value_matcher\"\n | \"seo_engine_schedule\"\n | \"seo_geo_place\"\n | \"seo_gsc_dig_rule\"\n | \"seo_keyword\"\n | \"seo_keyword_class_rule\"\n | \"seo_keyword_edge\"\n | \"seo_keyword_facet\"\n | \"seo_keyword_market\"\n | \"seo_keyword_market_observation\"\n | \"seo_keyword_place\"\n | \"seo_keyword_saved_view\"\n | \"seo_keyword_topic\"\n | \"seo_landscape_brief\"\n | \"seo_link_gap_domain\"\n | \"seo_link_gap_match\"\n | \"seo_page_measurement_health\"\n | \"seo_page_performance\"\n | \"seo_provider_call\"\n | \"seo_provider_task\"\n | \"seo_rank_observation\"\n | \"seo_rank_target\"\n | \"seo_raw_payload\"\n | \"seo_referring_domain_profile\"\n | \"seo_reputation_case\"\n | \"seo_search_performance_daily\"\n | \"seo_serp_mention\"\n | \"seo_serp_opportunity\"\n | \"seo_serp_result\"\n | \"seo_serp_snapshot\"\n | \"seo_site_geo_area\"\n | \"seo_site_keyword_offering\"\n | \"seo_site_keyword_value\"\n | \"seo_site_offering_value\"\n | \"seo_site_topic_value\"\n | \"seo_site_value_combo\"\n | \"seo_site_value_worth\"\n | \"seo_site_vocabulary\"\n | \"seo_source_request\"\n | \"seo_starter_pack\"\n | \"seo_starter_pack_item\"\n | \"seo_story_angle\"\n | \"seo_topic\"\n | \"seo_web_analytics_daily\"\n | \"shared_canvas_item\"\n | \"short_link\"\n | \"skill\"\n | \"skill_render_definition\"\n | \"sms_consent\"\n | \"sms_conversation\"\n | \"sms_message\"\n | \"sms_message_media\"\n | \"sms_notification\"\n | \"sms_notification_preference\"\n | \"sms_phone_number\"\n | \"structured_list\"\n | \"studio_documents\"\n | \"studio_recording_chunks\"\n | \"studio_recording_segments\"\n | \"studio_run\"\n | \"studio_session\"\n | \"studio_session_settings\"\n | \"study_attempt\"\n | \"study_goal\"\n | \"study_media\"\n | \"study_plan\"\n | \"study_plan_block\"\n | \"study_plan_day\"\n | \"study_reminder_context\"\n | \"study_reminder_delivery\"\n | \"study_session\"\n | \"surface\"\n | \"system_context_item\"\n | \"system_error\"\n | \"system_personal_org_failure\"\n | \"system_write_failure\"\n | \"task\"\n | \"thread\"\n | \"tool\"\n | \"tool_bundle\"\n | \"tool_call\"\n | \"tool_definition_version\"\n | \"tool_test_sample\"\n | \"tool_ui\"\n | \"tool_ui_incident\"\n | \"tool_ui_version\"\n | \"transcript\"\n | \"udt_dataset_fields\"\n | \"udt_dataset_rows\"\n | \"udt_document\"\n | \"udt_structured_list_items\"\n | \"ui_surface_agent_pref\"\n | \"ui_surface_config\"\n | \"user_achievement\"\n | \"user_analysis_preference\"\n | \"user_bookmark\"\n | \"user_email_preference\"\n | \"user_feedback\"\n | \"user_form_profile\"\n | \"user_markdown_sample\"\n | \"user_memory\"\n | \"user_preference\"\n | \"user_profile\"\n | \"user_stat\"\n | \"user_surface_state\"\n | \"voice\"\n | \"war_room\"\n | \"wbx_capture\"\n | \"wbx_guidance\"\n | \"wbx_highlight\"\n | \"wbx_pattern\"\n | \"wbx_screenshot\"\n | \"wbx_seo_audit\"\n | \"wc_claim\"\n | \"wc_impairment_definition\"\n | \"wc_injury\"\n | \"wc_report\"\n | \"web_analysis_item\"\n | \"web_brand\"\n | \"web_brand_asset\"\n | \"web_brand_offering\"\n | \"web_business_fact\"\n | \"web_business_location\"\n | \"web_crawl_event\"\n | \"web_crawl_preset\"\n | \"web_crawl_schedule\"\n | \"web_crawl_session\"\n | \"web_crawl_url\"\n | \"web_discovered_item\"\n | \"web_finding\"\n | \"web_gsc_page_stat\"\n | \"web_link_edge\"\n | \"web_listing_publisher\"\n | \"web_location_listing\"\n | \"web_offering_template\"\n | \"web_page\"\n | \"web_page_content\"\n | \"web_page_evidence\"\n | \"web_page_sitemap\"\n | \"web_property\"\n | \"web_provider\"\n | \"web_result\"\n | \"web_screenshot\"\n | \"web_site\"\n | \"web_site_endpoint_rule\"\n | \"web_site_item_config\"\n | \"web_site_offering\"\n | \"web_sitemap\"\n | \"web_snapshot\"\n | \"wf_node_data_slot\"\n | \"work_item\"\n | \"workbook\"\n | \"workflow\"\n | \"workflow_card\"\n | \"workflow_checkpoint\"\n | \"workflow_comparison\"\n | \"workflow_definition_version\"\n | \"workflow_idempotency\"\n | \"workflow_job\"\n | \"workflow_node_events\"\n | \"workflow_node_outcome\"\n | \"workflow_recovery_audit\"\n | \"workflow_run\"\n | \"workflow_run_log\"\n | \"workflow_runtime_surface\"\n | \"workflow_template\"\n | \"workflow_trigger\"\n | \"workflow_trigger_fire\"\n | \"youtube_search\"\n | \"youtube_video\";\n\n/** Tokens flagged `is_listed` — surfaced in list/nav UIs. */\nexport type ListedEntityToken =\n | \"agent\"\n | \"agent_exemplar\"\n | \"ai_model\"\n | \"ai_model_alias\"\n | \"ai_provider\"\n | \"ai_setting\"\n | \"assist\"\n | \"browser_login_recipe\"\n | \"browser_profile\"\n | \"browser_site_policy\"\n | \"commerce_certified_printer\"\n | \"commerce_cloud_sync_connection\"\n | \"commerce_intake_batch\"\n | \"commerce_label_batch\"\n | \"commerce_marketplace_account\"\n | \"commerce_print_order\"\n | \"commerce_product\"\n | \"content_ir_kind\"\n | \"content_ir_kind_instance\"\n | \"crm_blocklist_entry\"\n | \"crm_deal\"\n | \"crm_outreach_list\"\n | \"crm_registry_source\"\n | \"crm_saved_view\"\n | \"crm_sending_identity\"\n | \"custom_entity_definition\"\n | \"custom_field_definition\"\n | \"custom_field_target\"\n | \"dataset\"\n | \"esign_campaign\"\n | \"esign_consent_disclosure\"\n | \"esign_envelope\"\n | \"esign_provider_binding\"\n | \"growth_loop_run\"\n | \"hindsight_regression_case\"\n | \"hindsight_replay_step\"\n | \"hr_asset\"\n | \"hr_candidate\"\n | \"hr_careers_portal\"\n | \"hr_checklist_template\"\n | \"hr_course\"\n | \"hr_crew\"\n | \"hr_deduction_code\"\n | \"hr_department\"\n | \"hr_earning_code\"\n | \"hr_employee\"\n | \"hr_holiday_calendar\"\n | \"hr_interview_kit\"\n | \"hr_job_title\"\n | \"hr_leave_policy\"\n | \"hr_location\"\n | \"hr_pay_group\"\n | \"hr_posting\"\n | \"hr_provider_binding\"\n | \"hr_requisition\"\n | \"hr_schedule\"\n | \"hr_schedule_guidance\"\n | \"hr_schedule_template\"\n | \"hr_survey\"\n | \"hr_workflow_definition\"\n | \"hr_workflow_flow_type\"\n | \"hr_workflow_instance\"\n | \"iam_api_key\"\n | \"interview_session\"\n | \"learn_doc\"\n | \"mandate\"\n | \"mandate_binding\"\n | \"marketing_initiative\"\n | \"ops_proof_check\"\n | \"ops_proof_scenario\"\n | \"party\"\n | \"plan_entity\"\n | \"plan_node\"\n | \"platform_outcome_event\"\n | \"platform_saved_view\"\n | \"purpose\"\n | \"research_context_bundle\"\n | \"rulebook\"\n | \"seo_dimension_value_matcher\"\n | \"seo_geo_place\"\n | \"seo_keyword_saved_view\"\n | \"seo_site_value_combo\"\n | \"seo_site_value_worth\"\n | \"seo_starter_pack\"\n | \"structured_list\"\n | \"surface\"\n | \"system_context_item\"\n | \"workbook\"\n | \"workflow_runtime_surface\";\n\n/** Tokens flagged `is_module`. */\nexport type ModuleEntityToken =\n | \"agent\"\n | \"conversation\"\n | \"file\"\n | \"folder\"\n | \"note\"\n | \"project\"\n | \"task\"\n | \"transcript\";\n\n/** Full registry metadata, keyed by token. */\nexport const ENTITY_TYPE_METADATA = {\n \"access_request\": { token: \"access_request\", schema: \"iam\", table: \"access_requests\", label: \"Access Request\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: \"System\", referencePickable: false, titleColumn: null, contentRole: \"utility\", referenceCategory: null },\n \"activity\": { token: \"activity\", schema: \"platform\", table: \"activity_log\", label: \"Activity Log Entry\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"agent\": { token: \"agent\", schema: \"agent\", table: \"definition\", label: \"Agent\", baseTier: 1, isComponent: false, isModule: true, isListed: true, scopeable: true, category: \"Agents\", referencePickable: true, titleColumn: \"name\", contentRole: \"utility\", referenceCategory: null },\n \"agent_card\": { token: \"agent_card\", schema: \"agent\", table: \"card\", label: \"Agent Card\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"agent_definition_version\": { token: \"agent_definition_version\", schema: \"agent\", table: \"definition_version\", label: \"Agent Definition Version\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"Agents\", referencePickable: false, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"agent_drift_alert\": { token: \"agent_drift_alert\", schema: \"agent\", table: \"drift_alert\", label: \"Agent Drift Alert\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"Agents\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"agent_exemplar\": { token: \"agent_exemplar\", schema: \"agent\", table: \"exemplar\", label: \"Agent Test Case\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"agent_mandate_note\": { token: \"agent_mandate_note\", schema: \"agent\", table: \"mandate_note\", label: \"Mandate Note\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"agent_prompt_remediation\": { token: \"agent_prompt_remediation\", schema: \"agent\", table: \"prompt_remediation\", label: \"Agent Prompt Remediation\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"agent_run\": { token: \"agent_run\", schema: \"chat\", table: \"agent_run\", label: \"Agent Run\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"agent_run_stage\": { token: \"agent_run_stage\", schema: \"chat\", table: \"agent_run_stage\", label: \"Agent Run Stage\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"agent_shortcut\": { token: \"agent_shortcut\", schema: \"agent\", table: \"shortcut\", label: \"Agent Shortcut\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: \"Agents\", referencePickable: true, titleColumn: \"label\", contentRole: \"utility\", referenceCategory: null },\n \"agent_surface_binding\": { token: \"agent_surface_binding\", schema: \"platform\", table: \"associations\", label: \"Agent Surface Binding\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: \"Agents\", referencePickable: true, titleColumn: \"label\", contentRole: null, referenceCategory: null },\n \"agent_template\": { token: \"agent_template\", schema: \"agent\", table: \"template\", label: \"Agent Template\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: \"Agents\", referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"agent_usage\": { token: \"agent_usage\", schema: \"agent\", table: \"usage\", label: \"Agent Usage\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"Agents\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"ai_api\": { token: \"ai_api\", schema: \"ai\", table: \"api\", label: \"AI API\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"ai_endpoint\": { token: \"ai_endpoint\", schema: \"ai\", table: \"endpoint\", label: \"AI Endpoint\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"display_name\", contentRole: null, referenceCategory: null },\n \"ai_model\": { token: \"ai_model\", schema: \"ai\", table: \"model_definition\", label: \"AI Model\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"ai_model_alias\": { token: \"ai_model_alias\", schema: \"ai\", table: \"model_alias\", label: \"AI Model Alias\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"ai_offering\": { token: \"ai_offering\", schema: \"ai\", table: \"offering\", label: \"AI Offering\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"ai_provider\": { token: \"ai_provider\", schema: \"ai\", table: \"provider\", label: \"AI Provider\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"ai_setting\": { token: \"ai_setting\", schema: \"ai\", table: \"setting\", label: \"AI Setting\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"key\", contentRole: null, referenceCategory: null },\n \"app\": { token: \"app\", schema: \"app\", table: \"definition\", label: \"App\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: \"Apps\", referencePickable: true, titleColumn: \"name\", contentRole: \"utility\", referenceCategory: null },\n \"app_definition_version\": { token: \"app_definition_version\", schema: \"app\", table: \"definition_version\", label: \"App Definition Version\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"Apps\", referencePickable: false, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"app_error\": { token: \"app_error\", schema: \"app\", table: \"error\", label: \"App Error\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"Apps\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"app_execution\": { token: \"app_execution\", schema: \"app\", table: \"execution\", label: \"App Execution\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"Apps\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"app_instance\": { token: \"app_instance\", schema: \"public\", table: \"app_instances\", label: \"App Instance\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"app_log\": { token: \"app_log\", schema: \"ops\", table: \"app_log\", label: \"App Log\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"app_rate_limit\": { token: \"app_rate_limit\", schema: \"app\", table: \"rate_limit\", label: \"App Rate Limit\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"Apps\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"app_setting\": { token: \"app_setting\", schema: \"public\", table: \"app_settings\", label: \"App Setting\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"app_sync_status\": { token: \"app_sync_status\", schema: \"public\", table: \"app_sync_status\", label: \"App Sync Status\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"approach\": { token: \"approach\", schema: \"platform\", table: \"approach\", label: \"Approach\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"artifact\": { token: \"artifact\", schema: \"chat\", table: \"artifact\", label: \"Artifact\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"assessment\": { token: \"assessment\", schema: \"education\", table: \"assessment\", label: \"Assessment\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"assessment_item\": { token: \"assessment_item\", schema: \"education\", table: \"assessment_item\", label: \"Assessment Item\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"assessment_result\": { token: \"assessment_result\", schema: \"education\", table: \"assessment_result\", label: \"Assessment Result\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"assist\": { token: \"assist\", schema: \"platform\", table: \"assists\", label: \"Assist\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: \"platform\", referencePickable: false, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"batch_cost_event\": { token: \"batch_cost_event\", schema: \"batch\", table: \"cost_event\", label: \"Batch Cost Event\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"batch_provider_batch\": { token: \"batch_provider_batch\", schema: \"batch\", table: \"provider_batch\", label: \"Provider Batch\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"batch_work_item\": { token: \"batch_work_item\", schema: \"batch\", table: \"work_item\", label: \"Batch Work Item\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"browser_account_binding\": { token: \"browser_account_binding\", schema: \"browser\", table: \"account_binding\", label: \"Browser Account Binding\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"browser_action_event\": { token: \"browser_action_event\", schema: \"browser\", table: \"action_event\", label: \"Browser Action Event\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"browser_authenticator_window\": { token: \"browser_authenticator_window\", schema: \"browser\", table: \"authenticator_window\", label: \"Browser Authenticator Window\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"browser_capture\": { token: \"browser_capture\", schema: \"browser\", table: \"capture\", label: \"Browser Capture\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"browser_control_request\": { token: \"browser_control_request\", schema: \"browser\", table: \"control_request\", label: \"Browser Control Request\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"browser_handoff\": { token: \"browser_handoff\", schema: \"browser\", table: \"handoff\", label: \"Browser Handoff\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"browser_login_attempt\": { token: \"browser_login_attempt\", schema: \"browser\", table: \"login_attempt\", label: \"Browser Login Attempt\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"browser_login_recipe\": { token: \"browser_login_recipe\", schema: \"browser\", table: \"login_recipe\", label: \"Browser Login Recipe\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"browser_profile\": { token: \"browser_profile\", schema: \"browser\", table: \"profile\", label: \"Cloud Browser Profile\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"browser_profile_checkpoint\": { token: \"browser_profile_checkpoint\", schema: \"browser\", table: \"profile_checkpoint\", label: \"Browser Profile Checkpoint\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"browser_run\": { token: \"browser_run\", schema: \"browser\", table: \"run\", label: \"Cloud Browser Run\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"browser_site_observation\": { token: \"browser_site_observation\", schema: \"browser\", table: \"site_observation\", label: \"Browser Site Observation\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"browser_site_policy\": { token: \"browser_site_policy\", schema: \"browser\", table: \"site_policy\", label: \"Browser Site Policy\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"browser_stream_ticket\": { token: \"browser_stream_ticket\", schema: \"browser\", table: \"stream_ticket\", label: \"Browser Stream Ticket\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"canvas_comment\": { token: \"canvas_comment\", schema: \"canvas\", table: \"canvas_comments\", label: \"Canvas Comment\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"display_name\", contentRole: null, referenceCategory: null },\n \"canvas_comment_like\": { token: \"canvas_comment_like\", schema: \"canvas\", table: \"canvas_comment_likes\", label: \"Canvas Comment Like\", baseTier: 3, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"canvas_item\": { token: \"canvas_item\", schema: \"canvas\", table: \"canvas_items\", label: \"Canvas Item\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"canvas_item_state\": { token: \"canvas_item_state\", schema: \"canvas\", table: \"canvas_item_state\", label: \"Canvas Item State\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"canvas_like\": { token: \"canvas_like\", schema: \"canvas\", table: \"canvas_likes\", label: \"Canvas Like\", baseTier: 3, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"canvas_score\": { token: \"canvas_score\", schema: \"canvas\", table: \"canvas_scores\", label: \"Canvas Score\", baseTier: 3, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"display_name\", contentRole: null, referenceCategory: null },\n \"canvas_view\": { token: \"canvas_view\", schema: \"canvas\", table: \"canvas_views\", label: \"Canvas View\", baseTier: 3, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"category\": { token: \"category\", schema: \"platform\", table: \"categories\", label: \"Category\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"cmp_entry\": { token: \"cmp_entry\", schema: \"agent\", table: \"cmp_comparison_entries\", label: \"Comparison Entry\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"cmp_feedback\": { token: \"cmp_feedback\", schema: \"agent\", table: \"cmp_response_feedback\", label: \"Comparison Response Feedback\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"code_file\": { token: \"code_file\", schema: \"code\", table: \"code_files\", label: \"Code File\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: \"source\", referenceCategory: null },\n \"code_folder\": { token: \"code_folder\", schema: \"code\", table: \"code_file_folders\", label: \"Code Folder\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: \"container\", referenceCategory: null },\n \"code_repository\": { token: \"code_repository\", schema: \"code\", table: \"code_repositories\", label: \"Code Repository\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: \"container\", referenceCategory: null },\n \"coding_session\": { token: \"coding_session\", schema: \"chat\", table: \"coding_session\", label: \"Coding Session\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"coding_session_entry\": { token: \"coding_session_entry\", schema: \"chat\", table: \"coding_session_entry\", label: \"Coding Session Entry\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"comment\": { token: \"comment\", schema: \"platform\", table: \"comments\", label: \"Comment\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_asset_allocation\": { token: \"commerce_asset_allocation\", schema: \"commerce\", table: \"asset_allocation\", label: \"Asset Allocation\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_asset_grading\": { token: \"commerce_asset_grading\", schema: \"commerce\", table: \"asset_grading\", label: \"Asset Grading\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_asset_identifier\": { token: \"commerce_asset_identifier\", schema: \"commerce\", table: \"asset_identifier\", label: \"Asset Identifier\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_asset_lot_event\": { token: \"commerce_asset_lot_event\", schema: \"commerce\", table: \"asset_lot_event\", label: \"Asset Lot Event\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_asset_mandate_result\": { token: \"commerce_asset_mandate_result\", schema: \"commerce\", table: \"asset_mandate_result\", label: \"Asset Mandate Result\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_asset_price_factor\": { token: \"commerce_asset_price_factor\", schema: \"commerce\", table: \"asset_price_factor\", label: \"Asset Price Factor\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_asset_reshoot_request\": { token: \"commerce_asset_reshoot_request\", schema: \"commerce\", table: \"asset_reshoot_request\", label: \"Asset Reshoot Request\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_asset_review\": { token: \"commerce_asset_review\", schema: \"commerce\", table: \"asset_review\", label: \"Asset Review\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_asset_unknown\": { token: \"commerce_asset_unknown\", schema: \"commerce\", table: \"asset_unknown\", label: \"Asset Unknown\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_certified_printer\": { token: \"commerce_certified_printer\", schema: \"commerce\", table: \"certified_printer\", label: \"Certified Printer\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_cloud_sync_connection\": { token: \"commerce_cloud_sync_connection\", schema: \"commerce\", table: \"cloud_sync_connection\", label: \"Cloud Sync Connection\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_ebay_business_policy\": { token: \"commerce_ebay_business_policy\", schema: \"commerce\", table: \"ebay_business_policy\", label: \"eBay Business Policy\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_ebay_category\": { token: \"commerce_ebay_category\", schema: \"commerce\", table: \"ebay_category\", label: \"eBay Category\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_ebay_category_aspect\": { token: \"commerce_ebay_category_aspect\", schema: \"commerce\", table: \"ebay_category_aspect\", label: \"eBay Category Aspect\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_ebay_category_tree\": { token: \"commerce_ebay_category_tree\", schema: \"commerce\", table: \"ebay_category_tree\", label: \"eBay Category Tree\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_ebay_custom_policy\": { token: \"commerce_ebay_custom_policy\", schema: \"commerce\", table: \"ebay_custom_policy\", label: \"eBay Custom Policy\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_ebay_inventory_item\": { token: \"commerce_ebay_inventory_item\", schema: \"commerce\", table: \"ebay_inventory_item\", label: \"eBay Inventory Item\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_ebay_inventory_item_group\": { token: \"commerce_ebay_inventory_item_group\", schema: \"commerce\", table: \"ebay_inventory_item_group\", label: \"eBay Inventory Item Group\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_ebay_inventory_item_group_member\": { token: \"commerce_ebay_inventory_item_group_member\", schema: \"commerce\", table: \"ebay_inventory_item_group_member\", label: \"eBay Inventory Item Group Member\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_ebay_inventory_location\": { token: \"commerce_ebay_inventory_location\", schema: \"commerce\", table: \"ebay_inventory_location\", label: \"eBay Inventory Location\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_ebay_listing\": { token: \"commerce_ebay_listing\", schema: \"commerce\", table: \"ebay_listing\", label: \"eBay Listing\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_ebay_marketplace_policy\": { token: \"commerce_ebay_marketplace_policy\", schema: \"commerce\", table: \"ebay_marketplace_policy\", label: \"eBay Marketplace Policy\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_ebay_media_asset\": { token: \"commerce_ebay_media_asset\", schema: \"commerce\", table: \"ebay_media_asset\", label: \"eBay Media Asset\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_ebay_notification_destination\": { token: \"commerce_ebay_notification_destination\", schema: \"commerce\", table: \"ebay_notification_destination\", label: \"eBay Notification Destination\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_ebay_notification_event\": { token: \"commerce_ebay_notification_event\", schema: \"commerce\", table: \"ebay_notification_event\", label: \"eBay Notification Event\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_ebay_notification_subscription\": { token: \"commerce_ebay_notification_subscription\", schema: \"commerce\", table: \"ebay_notification_subscription\", label: \"eBay Notification Subscription\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_ebay_notification_topic\": { token: \"commerce_ebay_notification_topic\", schema: \"commerce\", table: \"ebay_notification_topic\", label: \"eBay Notification Topic\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_ebay_offer\": { token: \"commerce_ebay_offer\", schema: \"commerce\", table: \"ebay_offer\", label: \"eBay Offer\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_ebay_order\": { token: \"commerce_ebay_order\", schema: \"commerce\", table: \"ebay_order\", label: \"eBay Order\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_ebay_order_line_item\": { token: \"commerce_ebay_order_line_item\", schema: \"commerce\", table: \"ebay_order_line_item\", label: \"eBay Order Line Item\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_ebay_shipping_fulfillment\": { token: \"commerce_ebay_shipping_fulfillment\", schema: \"commerce\", table: \"ebay_shipping_fulfillment\", label: \"eBay Shipping Fulfillment\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_ebay_store_category\": { token: \"commerce_ebay_store_category\", schema: \"commerce\", table: \"ebay_store_category\", label: \"eBay Store Category\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_human_correction\": { token: \"commerce_human_correction\", schema: \"commerce\", table: \"human_correction\", label: \"Human Correction\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_intake_artifact\": { token: \"commerce_intake_artifact\", schema: \"commerce\", table: \"intake_artifact\", label: \"Intake Artifact\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_intake_asset\": { token: \"commerce_intake_asset\", schema: \"commerce\", table: \"intake_asset\", label: \"Intake Asset\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_intake_batch\": { token: \"commerce_intake_batch\", schema: \"commerce\", table: \"intake_batch\", label: \"Intake Batch\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_label_batch\": { token: \"commerce_label_batch\", schema: \"commerce\", table: \"label_batch\", label: \"Label Batch\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_label_code\": { token: \"commerce_label_code\", schema: \"commerce\", table: \"label_code\", label: \"Label Code\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_marketplace_account\": { token: \"commerce_marketplace_account\", schema: \"commerce\", table: \"marketplace_account\", label: \"Marketplace Account\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_marketplace_account_deletion_audit\": { token: \"commerce_marketplace_account_deletion_audit\", schema: \"commerce\", table: \"marketplace_account_deletion_audit\", label: \"Marketplace Account Deletion Audit\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_marketplace_api_call\": { token: \"commerce_marketplace_api_call\", schema: \"commerce\", table: \"marketplace_api_call\", label: \"Marketplace API Call\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_marketplace_rate_budget\": { token: \"commerce_marketplace_rate_budget\", schema: \"commerce\", table: \"marketplace_rate_budget\", label: \"Marketplace Rate Budget\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_marketplace_site\": { token: \"commerce_marketplace_site\", schema: \"commerce\", table: \"marketplace_site\", label: \"Marketplace Site\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_marketplace_sync_run\": { token: \"commerce_marketplace_sync_run\", schema: \"commerce\", table: \"marketplace_sync_run\", label: \"Marketplace Sync Run\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_prediction_outcome\": { token: \"commerce_prediction_outcome\", schema: \"commerce\", table: \"prediction_outcome\", label: \"Prediction Outcome\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_print_order\": { token: \"commerce_print_order\", schema: \"commerce\", table: \"print_order\", label: \"Print Order\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_product\": { token: \"commerce_product\", schema: \"commerce\", table: \"product\", label: \"Product\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_product_channel_ref\": { token: \"commerce_product_channel_ref\", schema: \"commerce\", table: \"product_channel_ref\", label: \"Product Channel Reference\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_product_media\": { token: \"commerce_product_media\", schema: \"commerce\", table: \"product_media\", label: \"Product Media\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_product_variant\": { token: \"commerce_product_variant\", schema: \"commerce\", table: \"product_variant\", label: \"Product Variant\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"commerce_recall_audit\": { token: \"commerce_recall_audit\", schema: \"commerce\", table: \"recall_audit\", label: \"Recall Audit\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"comparison_set\": { token: \"comparison_set\", schema: \"agent\", table: \"cmp_comparison_sets\", label: \"Comparison Set\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"contact_medium\": { token: \"contact_medium\", schema: \"crm\", table: \"contact_medium\", label: \"Contact Medium\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"display_value\", contentRole: \"utility\", referenceCategory: null },\n \"contact_submission\": { token: \"contact_submission\", schema: \"communication\", table: \"contact_submissions\", label: \"Contact Submission\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"content_ir_kind\": { token: \"content_ir_kind\", schema: \"content_ir\", table: \"kind_definition\", label: \"Content-IR Kind\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"label\", contentRole: null, referenceCategory: null },\n \"content_ir_kind_component\": { token: \"content_ir_kind_component\", schema: \"content_ir\", table: \"kind_component\", label: \"Kind Component\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"content_ir_kind_component_incident\": { token: \"content_ir_kind_component_incident\", schema: \"content_ir\", table: \"kind_component_incident\", label: \"Kind Component Incident\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"content_ir_kind_conformance\": { token: \"content_ir_kind_conformance\", schema: \"content_ir\", table: \"kind_conformance\", label: \"Shape Conformance\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"content_ir_kind_edge\": { token: \"content_ir_kind_edge\", schema: \"content_ir\", table: \"kind_edge\", label: \"Content-IR Kind Edge\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"content_ir_kind_example\": { token: \"content_ir_kind_example\", schema: \"content_ir\", table: \"kind_example\", label: \"Kind Example\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"label\", contentRole: null, referenceCategory: null },\n \"content_ir_kind_instance\": { token: \"content_ir_kind_instance\", schema: \"content_ir\", table: \"kind_instance\", label: \"Saved Result\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"content_ir_kind_surface\": { token: \"content_ir_kind_surface\", schema: \"content_ir\", table: \"kind_surface\", label: \"Kind Surface\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"context_item\": { token: \"context_item\", schema: \"context\", table: \"context_items\", label: \"Context Item\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"display_name\", contentRole: null, referenceCategory: null },\n \"context_item_suggestion\": { token: \"context_item_suggestion\", schema: \"rag\", table: \"context_item_suggestions\", label: \"Context Item Suggestion\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"conversation\": { token: \"conversation\", schema: \"chat\", table: \"conversation\", label: \"Conversation\", baseTier: 1, isComponent: false, isModule: true, isListed: false, scopeable: true, category: \"Outputs\", referencePickable: true, titleColumn: \"title\", contentRole: \"destination\", referenceCategory: null },\n \"conversation_value\": { token: \"conversation_value\", schema: \"chat\", table: \"conversation_value\", label: \"Conversation Value\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: false, category: null, referencePickable: false, titleColumn: \"key\", contentRole: null, referenceCategory: null },\n \"crm_address\": { token: \"crm_address\", schema: \"crm\", table: \"address\", label: \"Address\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"label\", contentRole: null, referenceCategory: null },\n \"crm_affiliation\": { token: \"crm_affiliation\", schema: \"crm\", table: \"affiliation\", label: \"Affiliation\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"crm_blocklist_entry\": { token: \"crm_blocklist_entry\", schema: \"crm\", table: \"blocklist_entry\", label: \"Blocklist Entry\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"crm_contact_candidate\": { token: \"crm_contact_candidate\", schema: \"crm\", table: \"contact_candidate\", label: \"Contact Candidate\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"crm_deal\": { token: \"crm_deal\", schema: \"crm\", table: \"deal\", label: \"Deal\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: \"source\", referenceCategory: null },\n \"crm_deal_stage_event\": { token: \"crm_deal_stage_event\", schema: \"crm\", table: \"deal_stage_event\", label: \"Deal Stage Event\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"crm_enrichment_call\": { token: \"crm_enrichment_call\", schema: \"crm\", table: \"enrichment_call\", label: \"Enrichment Call\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"crm_interaction\": { token: \"crm_interaction\", schema: \"crm\", table: \"interaction\", label: \"Interaction\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"subject\", contentRole: null, referenceCategory: null },\n \"crm_merge_candidate\": { token: \"crm_merge_candidate\", schema: \"crm\", table: \"merge_candidate\", label: \"Merge Candidate\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"crm_outreach_list\": { token: \"crm_outreach_list\", schema: \"crm\", table: \"outreach_list\", label: \"Outreach List\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: \"container\", referenceCategory: null },\n \"crm_outreach_list_member\": { token: \"crm_outreach_list_member\", schema: \"crm\", table: \"outreach_list_member\", label: \"Outreach List Member\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"crm_party_merge\": { token: \"crm_party_merge\", schema: \"crm\", table: \"party_merge\", label: \"Party Merge\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"crm_registry_ingest_run\": { token: \"crm_registry_ingest_run\", schema: \"crm\", table: \"registry_ingest_run\", label: \"Registry Ingest Run\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"crm_registry_source\": { token: \"crm_registry_source\", schema: \"crm\", table: \"registry_source\", label: \"Registry Source\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"crm_saved_view\": { token: \"crm_saved_view\", schema: \"crm\", table: \"saved_view\", label: \"Smart View\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"crm_sending_event\": { token: \"crm_sending_event\", schema: \"crm\", table: \"sending_event\", label: \"Sending Event\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"subject\", contentRole: null, referenceCategory: null },\n \"crm_sending_identity\": { token: \"crm_sending_identity\", schema: \"crm\", table: \"sending_identity\", label: \"Sending Identity\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"crm_sending_identity_check\": { token: \"crm_sending_identity_check\", schema: \"crm\", table: \"sending_identity_check\", label: \"Sending Check\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"check_kind\", contentRole: null, referenceCategory: null },\n \"crm_sending_policy\": { token: \"crm_sending_policy\", schema: \"crm\", table: \"sending_policy\", label: \"Sending Policy\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"custom_entity_definition\": { token: \"custom_entity_definition\", schema: \"platform\", table: \"custom_entity_definition\", label: \"Custom Object\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"custom_field_definition\": { token: \"custom_field_definition\", schema: \"platform\", table: \"custom_field_definition\", label: \"Custom Field\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"custom_field_target\": { token: \"custom_field_target\", schema: \"platform\", table: \"custom_field_target\", label: \"Custom Field Target\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"custom_record\": { token: \"custom_record\", schema: \"platform\", table: \"custom_record\", label: \"Custom Record\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"cx_agent_memory\": { token: \"cx_agent_memory\", schema: \"chat\", table: \"agent_memory\", label: \"Agent Memory\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: false, category: \"Conversations\", referencePickable: true, titleColumn: \"key\", contentRole: null, referenceCategory: null },\n \"cx_agent_plan\": { token: \"cx_agent_plan\", schema: \"chat\", table: \"agent_plan\", label: \"Agent Plan\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: false, category: \"Conversations\", referencePickable: false, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"cx_agent_task\": { token: \"cx_agent_task\", schema: \"chat\", table: \"agent_task\", label: \"Agent Task\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: false, category: \"Conversations\", referencePickable: false, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"cx_code_edit\": { token: \"cx_code_edit\", schema: \"chat\", table: \"code_edit\", label: \"Code Edit\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: false, category: \"Conversations\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"cx_code_message_file\": { token: \"cx_code_message_file\", schema: \"chat\", table: \"code_message_file\", label: \"Code Message File\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: false, category: \"Conversations\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"cx_media\": { token: \"cx_media\", schema: \"chat\", table: \"media\", label: \"Media\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: false, category: \"Conversations\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"cx_observational_memory\": { token: \"cx_observational_memory\", schema: \"chat\", table: \"observational_memory\", label: \"Observational Memory\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: false, category: \"Conversations\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"cx_observational_memory_event\": { token: \"cx_observational_memory_event\", schema: \"chat\", table: \"observational_memory_event\", label: \"Observational Memory Event\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: false, category: \"Conversations\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"cx_pending_injection\": { token: \"cx_pending_injection\", schema: \"chat\", table: \"pending_injection\", label: \"Pending Injection\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: false, category: \"Conversations\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"cx_request\": { token: \"cx_request\", schema: \"chat\", table: \"request\", label: \"Conversation Request\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: false, category: \"Conversations\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"cx_request_snapshot\": { token: \"cx_request_snapshot\", schema: \"chat\", table: \"request_snapshot\", label: \"Request Snapshot\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: false, category: \"Conversations\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"cx_tool_trace\": { token: \"cx_tool_trace\", schema: \"chat\", table: \"tool_trace\", label: \"Tool Trace\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: false, category: \"Conversations\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"cx_user_request\": { token: \"cx_user_request\", schema: \"chat\", table: \"user_request\", label: \"User Request\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: false, category: \"Conversations\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"cx_user_todo\": { token: \"cx_user_todo\", schema: \"chat\", table: \"user_todo\", label: \"User Todo\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: false, category: \"Conversations\", referencePickable: false, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"data_store\": { token: \"data_store\", schema: \"rag\", table: \"data_stores\", label: \"Data Store\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: \"source\", referenceCategory: null },\n \"dataset\": { token: \"dataset\", schema: \"workbench\", table: \"udt_datasets\", label: \"Dataset\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"description\", contentRole: \"hybrid\", referenceCategory: null },\n \"derive_run\": { token: \"derive_run\", schema: \"docproc\", table: \"derive_runs\", label: \"Derive Run\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"dict_setting\": { token: \"dict_setting\", schema: \"dictionary\", table: \"dict_settings\", label: \"Dict Setting\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"dm_conversation\": { token: \"dm_conversation\", schema: \"communication\", table: \"dm_conversations\", label: \"Direct Conversation\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"dm_message\": { token: \"dm_message\", schema: \"communication\", table: \"dm_messages\", label: \"Direct Message\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"dm_participant\": { token: \"dm_participant\", schema: \"communication\", table: \"dm_conversation_participants\", label: \"DM Conversation Participant\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"domain_classification\": { token: \"domain_classification\", schema: \"platform\", table: \"domain_classification\", label: \"Domain Classification\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"esign_campaign\": { token: \"esign_campaign\", schema: \"esign\", table: \"campaign\", label: \"Signature campaign\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"esign_campaign_member\": { token: \"esign_campaign_member\", schema: \"esign\", table: \"campaign_member\", label: \"Campaign member\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"esign_consent_disclosure\": { token: \"esign_consent_disclosure\", schema: \"esign\", table: \"consent_disclosure\", label: \"E-sign consent disclosure\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"esign_envelope\": { token: \"esign_envelope\", schema: \"esign\", table: \"envelope\", label: \"Signature envelope\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"esign_envelope_certificate\": { token: \"esign_envelope_certificate\", schema: \"esign\", table: \"envelope_certificate\", label: \"Completion certificate\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"esign_envelope_document\": { token: \"esign_envelope_document\", schema: \"esign\", table: \"envelope_document\", label: \"Envelope document\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"esign_envelope_event\": { token: \"esign_envelope_event\", schema: \"esign\", table: \"envelope_event\", label: \"Envelope event\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"esign_envelope_external_ref\": { token: \"esign_envelope_external_ref\", schema: \"esign\", table: \"envelope_external_ref\", label: \"Envelope external reference\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"esign_envelope_signer\": { token: \"esign_envelope_signer\", schema: \"esign\", table: \"envelope_signer\", label: \"Envelope signer\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"esign_provider\": { token: \"esign_provider\", schema: \"esign\", table: \"provider\", label: \"E-sign provider\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"esign_provider_binding\": { token: \"esign_provider_binding\", schema: \"esign\", table: \"provider_binding\", label: \"E-sign provider binding\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"esign_signing_key\": { token: \"esign_signing_key\", schema: \"esign\", table: \"signing_key\", label: \"E-sign certificate signing key\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"fc_card\": { token: \"fc_card\", schema: \"education\", table: \"fc_card\", label: \"Flashcard\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"fc_detail\": { token: \"fc_detail\", schema: \"education\", table: \"fc_detail\", label: \"Flashcard Detail\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"fc_set\": { token: \"fc_set\", schema: \"education\", table: \"fc_set\", label: \"Flashcard Set\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"feature_doc\": { token: \"feature_doc\", schema: \"admin\", table: \"feature_docs\", label: \"Feature Doc\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: \"documentation\", referencePickable: true, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"file\": { token: \"file\", schema: \"files\", table: \"files\", label: \"File\", baseTier: 1, isComponent: false, isModule: true, isListed: false, scopeable: true, category: \"Sources\", referencePickable: true, titleColumn: \"file_name\", contentRole: \"source\", referenceCategory: null },\n \"file_analysis\": { token: \"file_analysis\", schema: \"files\", table: \"analysis\", label: \"File Analysis\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"file_entities\": { token: \"file_entities\", schema: \"files\", table: \"entities\", label: \"Extracted Term\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"label\", contentRole: null, referenceCategory: null },\n \"file_overrides\": { token: \"file_overrides\", schema: \"files\", table: \"overrides\", label: \"File Override\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"file_page_annotations\": { token: \"file_page_annotations\", schema: \"files\", table: \"page_annotations\", label: \"Page Annotation\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"label\", contentRole: null, referenceCategory: null },\n \"file_pages\": { token: \"file_pages\", schema: \"files\", table: \"pages\", label: \"File Page\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"file_version\": { token: \"file_version\", schema: \"files\", table: \"file_versions\", label: \"File Version\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: false, category: \"Sources\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"flexible_data\": { token: \"flexible_data\", schema: \"platform\", table: \"flexible_data\", label: \"Flexible Data\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"label\", contentRole: null, referenceCategory: null },\n \"folder\": { token: \"folder\", schema: \"files\", table: \"folders\", label: \"Folder\", baseTier: 1, isComponent: false, isModule: true, isListed: false, scopeable: true, category: \"Sources\", referencePickable: true, titleColumn: \"folder_name\", contentRole: \"source\", referenceCategory: null },\n \"game_badge\": { token: \"game_badge\", schema: \"education\", table: \"game_badge\", label: \"Game Badge\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"game_result\": { token: \"game_result\", schema: \"education\", table: \"game_result\", label: \"Game Result\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"display_name\", contentRole: null, referenceCategory: null },\n \"game_room\": { token: \"game_room\", schema: \"education\", table: \"game_room\", label: \"Game Room\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"global_execution\": { token: \"global_execution\", schema: \"runtime\", table: \"global_execution\", label: \"Runtime Execution\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"global_execution_checkpoint\": { token: \"global_execution_checkpoint\", schema: \"runtime\", table: \"global_execution_checkpoint\", label: \"Runtime Checkpoint\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"global_execution_event\": { token: \"global_execution_event\", schema: \"runtime\", table: \"global_execution_event\", label: \"Runtime Event\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"global_meter_entry\": { token: \"global_meter_entry\", schema: \"runtime\", table: \"global_meter_entry\", label: \"Runtime Meter Entry\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"label\", contentRole: null, referenceCategory: null },\n \"global_origin\": { token: \"global_origin\", schema: \"runtime\", table: \"global_origin\", label: \"Runtime Origin\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"global_request\": { token: \"global_request\", schema: \"runtime\", table: \"global_request\", label: \"Runtime Request\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"growth_loop_event\": { token: \"growth_loop_event\", schema: \"growth\", table: \"loop_event\", label: \"Growth Loop Event\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"growth_loop_run\": { token: \"growth_loop_run\", schema: \"growth\", table: \"loop_run\", label: \"Growth Loop Run\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: \"label\", contentRole: null, referenceCategory: null },\n \"growth_loop_stage_run\": { token: \"growth_loop_stage_run\", schema: \"growth\", table: \"loop_stage_run\", label: \"Growth Loop Stage Run\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"guided_checklist_run\": { token: \"guided_checklist_run\", schema: \"platform\", table: \"guided_checklist_run\", label: \"Guided Checklist Run\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"heatmap_save\": { token: \"heatmap_save\", schema: \"workbench\", table: \"heatmap_saves\", label: \"Heatmap Save\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"hindsight_enrollment\": { token: \"hindsight_enrollment\", schema: \"hindsight\", table: \"enrollment\", label: \"Hindsight Enrollment\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"display_name\", contentRole: null, referenceCategory: null },\n \"hindsight_finding\": { token: \"hindsight_finding\", schema: \"hindsight\", table: \"finding\", label: \"Hindsight Finding\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hindsight_regression_case\": { token: \"hindsight_regression_case\", schema: \"hindsight\", table: \"regression_case\", label: \"Regression Case\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hindsight_replay\": { token: \"hindsight_replay\", schema: \"hindsight\", table: \"replay\", label: \"Hindsight Replay\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hindsight_replay_step\": { token: \"hindsight_replay_step\", schema: \"hindsight\", table: \"replay_step\", label: \"Wire Replay Step\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hindsight_review\": { token: \"hindsight_review\", schema: \"hindsight\", table: \"review\", label: \"Hindsight Review\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_access_audit\": { token: \"hr_access_audit\", schema: \"hr\", table: \"access_audit\", label: \"Access audit\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_access_role\": { token: \"hr_access_role\", schema: \"hr\", table: \"access_role\", label: \"HR access role\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"label\", contentRole: null, referenceCategory: null },\n \"hr_accommodation_request\": { token: \"hr_accommodation_request\", schema: \"hr\", table: \"accommodation_request\", label: \"Accommodation request\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_ai_evidence\": { token: \"hr_ai_evidence\", schema: \"hr\", table: \"ai_evidence\", label: \"AI evidence\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_alert_routing_rule\": { token: \"hr_alert_routing_rule\", schema: \"hr\", table: \"alert_routing_rule\", label: \"Alert routing rule\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"hr_application\": { token: \"hr_application\", schema: \"hr\", table: \"application\", label: \"Application\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_approval_authority\": { token: \"hr_approval_authority\", schema: \"hr\", table: \"approval_authority\", label: \"Approval authority\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_approval_delegation\": { token: \"hr_approval_delegation\", schema: \"hr\", table: \"approval_delegation\", label: \"Approval delegation\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_asset\": { token: \"hr_asset\", schema: \"hr\", table: \"asset\", label: \"Asset\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"hr_asset_assignment\": { token: \"hr_asset_assignment\", schema: \"hr\", table: \"asset_assignment\", label: \"Asset assignment\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_attendance_exception\": { token: \"hr_attendance_exception\", schema: \"hr\", table: \"attendance_exception\", label: \"Attendance exception\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_auto_close_rule\": { token: \"hr_auto_close_rule\", schema: \"hr\", table: \"auto_close_rule\", label: \"Auto-close rule\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"hr_availability\": { token: \"hr_availability\", schema: \"hr\", table: \"availability\", label: \"Availability\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_background_check\": { token: \"hr_background_check\", schema: \"hr\", table: \"background_check\", label: \"Background check\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_benefits_event\": { token: \"hr_benefits_event\", schema: \"hr\", table: \"benefits_event\", label: \"Benefits event\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_calculation_snapshot\": { token: \"hr_calculation_snapshot\", schema: \"hr\", table: \"calculation_snapshot\", label: \"Calculation snapshot\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_candidate\": { token: \"hr_candidate\", schema: \"hr\", table: \"candidate\", label: \"Candidate\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"preferred_name\", contentRole: null, referenceCategory: null },\n \"hr_candidate_conversion\": { token: \"hr_candidate_conversion\", schema: \"hr\", table: \"candidate_conversion\", label: \"Candidate conversion\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_candidate_message\": { token: \"hr_candidate_message\", schema: \"hr\", table: \"candidate_message\", label: \"Candidate message\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_careers_portal\": { token: \"hr_careers_portal\", schema: \"hr\", table: \"careers_portal\", label: \"Careers portal\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"display_name\", contentRole: null, referenceCategory: null },\n \"hr_checklist_item\": { token: \"hr_checklist_item\", schema: \"hr\", table: \"checklist_item\", label: \"Checklist item\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_checklist_run\": { token: \"hr_checklist_run\", schema: \"hr\", table: \"checklist_run\", label: \"Checklist run\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_checklist_template\": { token: \"hr_checklist_template\", schema: \"hr\", table: \"checklist_template\", label: \"Checklist template\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"hr_checklist_template_item\": { token: \"hr_checklist_template_item\", schema: \"hr\", table: \"checklist_template_item\", label: \"Checklist template item\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_compensation\": { token: \"hr_compensation\", schema: \"hr\", table: \"compensation\", label: \"Compensation record\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_corrective_action\": { token: \"hr_corrective_action\", schema: \"hr\", table: \"corrective_action\", label: \"Corrective action\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_course\": { token: \"hr_course\", schema: \"hr\", table: \"course\", label: \"Course\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"hr_course_version\": { token: \"hr_course_version\", schema: \"hr\", table: \"course_version\", label: \"Course version\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_credential\": { token: \"hr_credential\", schema: \"hr\", table: \"credential\", label: \"Credential\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_crew\": { token: \"hr_crew\", schema: \"hr\", table: \"crew\", label: \"Crew\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"hr_deduction_code\": { token: \"hr_deduction_code\", schema: \"hr\", table: \"deduction_code\", label: \"Deduction code\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"hr_department\": { token: \"hr_department\", schema: \"hr\", table: \"department\", label: \"Department\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"hr_derived_grant\": { token: \"hr_derived_grant\", schema: \"hr\", table: \"derived_grant\", label: \"Derived grant\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_disposition_event\": { token: \"hr_disposition_event\", schema: \"hr\", table: \"disposition_event\", label: \"Disposition event\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_earning_code\": { token: \"hr_earning_code\", schema: \"hr\", table: \"earning_code\", label: \"Earning code\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"hr_eeo_response\": { token: \"hr_eeo_response\", schema: \"hr\", table: \"eeo_response\", label: \"EEO self-identification response\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_emergency_contact\": { token: \"hr_emergency_contact\", schema: \"hr\", table: \"emergency_contact\", label: \"Emergency contact\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_employee\": { token: \"hr_employee\", schema: \"hr\", table: \"employee\", label: \"Employee\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"display_name\", contentRole: \"container\", referenceCategory: null },\n \"hr_employee_private\": { token: \"hr_employee_private\", schema: \"hr\", table: \"employee_private\", label: \"Employee private record\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_employer_profile\": { token: \"hr_employer_profile\", schema: \"hr\", table: \"employer_profile\", label: \"Employer profile\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"legal_name\", contentRole: null, referenceCategory: null },\n \"hr_employment\": { token: \"hr_employment\", schema: \"hr\", table: \"employment\", label: \"Employment spell\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_employment_pin\": { token: \"hr_employment_pin\", schema: \"hr\", table: \"employment_pin\", label: \"Employment PIN\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_engagement\": { token: \"hr_engagement\", schema: \"hr\", table: \"engagement\", label: \"Engagement\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_establishment\": { token: \"hr_establishment\", schema: \"hr\", table: \"establishment\", label: \"Establishment\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"hr_external_identity\": { token: \"hr_external_identity\", schema: \"hr\", table: \"external_identity\", label: \"External identity\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_field_policy\": { token: \"hr_field_policy\", schema: \"hr\", table: \"field_policy\", label: \"Self-service field policy\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_holiday\": { token: \"hr_holiday\", schema: \"hr\", table: \"holiday\", label: \"Holiday\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"hr_holiday_calendar\": { token: \"hr_holiday_calendar\", schema: \"hr\", table: \"holiday_calendar\", label: \"Holiday calendar\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"hr_i9\": { token: \"hr_i9\", schema: \"hr\", table: \"i9\", label: \"Form I-9\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_i9_document\": { token: \"hr_i9_document\", schema: \"hr\", table: \"i9_document\", label: \"I-9 document\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_incident\": { token: \"hr_incident\", schema: \"hr\", table: \"incident\", label: \"Incident\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_incident_party\": { token: \"hr_incident_party\", schema: \"hr\", table: \"incident_party\", label: \"Incident party\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_interview\": { token: \"hr_interview\", schema: \"hr\", table: \"interview\", label: \"Interview\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_interview_kit\": { token: \"hr_interview_kit\", schema: \"hr\", table: \"interview_kit\", label: \"Interview kit\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"hr_job_title\": { token: \"hr_job_title\", schema: \"hr\", table: \"job_title\", label: \"Job title\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"hr_jurisdiction\": { token: \"hr_jurisdiction\", schema: \"hr\", table: \"jurisdiction\", label: \"Jurisdiction\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"hr_jurisdiction_rule\": { token: \"hr_jurisdiction_rule\", schema: \"hr\", table: \"jurisdiction_rule\", label: \"Jurisdiction rule\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_jurisdiction_rule_class\": { token: \"hr_jurisdiction_rule_class\", schema: \"hr\", table: \"jurisdiction_rule_class\", label: \"Jurisdiction rule class\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"label\", contentRole: null, referenceCategory: null },\n \"hr_jurisdiction_rule_org_decision\": { token: \"hr_jurisdiction_rule_org_decision\", schema: \"hr\", table: \"jurisdiction_rule_org_decision\", label: \"Jurisdiction rule org decision\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_jurisdiction_rule_test\": { token: \"hr_jurisdiction_rule_test\", schema: \"hr\", table: \"jurisdiction_rule_test\", label: \"Jurisdiction rule fixture\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"hr_kiosk_device\": { token: \"hr_kiosk_device\", schema: \"hr\", table: \"kiosk_device\", label: \"Kiosk device\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_kiosk_session\": { token: \"hr_kiosk_session\", schema: \"hr\", table: \"kiosk_session\", label: \"Kiosk session\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_labor_target\": { token: \"hr_labor_target\", schema: \"hr\", table: \"labor_target\", label: \"Labor target\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_leave_case\": { token: \"hr_leave_case\", schema: \"hr\", table: \"leave_case\", label: \"Leave case\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_leave_enrollment\": { token: \"hr_leave_enrollment\", schema: \"hr\", table: \"leave_enrollment\", label: \"Leave enrollment\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_leave_ledger\": { token: \"hr_leave_ledger\", schema: \"hr\", table: \"leave_ledger\", label: \"Leave ledger entry\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_leave_policy\": { token: \"hr_leave_policy\", schema: \"hr\", table: \"leave_policy\", label: \"Leave policy\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"hr_leave_request\": { token: \"hr_leave_request\", schema: \"hr\", table: \"leave_request\", label: \"Leave request\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_legal_hold\": { token: \"hr_legal_hold\", schema: \"hr\", table: \"legal_hold\", label: \"Legal hold\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"matter_name\", contentRole: null, referenceCategory: null },\n \"hr_legal_hold_item\": { token: \"hr_legal_hold_item\", schema: \"hr\", table: \"legal_hold_item\", label: \"Legal hold item\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_location\": { token: \"hr_location\", schema: \"hr\", table: \"location\", label: \"Location\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"hr_new_hire_report\": { token: \"hr_new_hire_report\", schema: \"hr\", table: \"new_hire_report\", label: \"New hire report\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_offer\": { token: \"hr_offer\", schema: \"hr\", table: \"offer\", label: \"Offer\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_opening\": { token: \"hr_opening\", schema: \"hr\", table: \"opening\", label: \"Opening\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_overtime_alert\": { token: \"hr_overtime_alert\", schema: \"hr\", table: \"overtime_alert\", label: \"Overtime alert\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_overtime_alert_rule\": { token: \"hr_overtime_alert_rule\", schema: \"hr\", table: \"overtime_alert_rule\", label: \"Overtime alert rule\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"hr_overtime_preapproval\": { token: \"hr_overtime_preapproval\", schema: \"hr\", table: \"overtime_preapproval\", label: \"Overtime pre-approval\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_pay_group\": { token: \"hr_pay_group\", schema: \"hr\", table: \"pay_group\", label: \"Pay group\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"hr_pay_period\": { token: \"hr_pay_period\", schema: \"hr\", table: \"pay_period\", label: \"Pay period\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_pay_period_employment\": { token: \"hr_pay_period_employment\", schema: \"hr\", table: \"pay_period_employment\", label: \"Pay period timesheet\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_payroll_export\": { token: \"hr_payroll_export\", schema: \"hr\", table: \"payroll_export\", label: \"Payroll export\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_payroll_export_line\": { token: \"hr_payroll_export_line\", schema: \"hr\", table: \"payroll_export_line\", label: \"Payroll export line\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_position_assignment\": { token: \"hr_position_assignment\", schema: \"hr\", table: \"position_assignment\", label: \"Position assignment\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_posting\": { token: \"hr_posting\", schema: \"hr\", table: \"posting\", label: \"Job posting\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"hr_posting_publication\": { token: \"hr_posting_publication\", schema: \"hr\", table: \"posting_publication\", label: \"Posting publication\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_provider_binding\": { token: \"hr_provider_binding\", schema: \"hr\", table: \"provider_binding\", label: \"Provider binding\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_provider_event\": { token: \"hr_provider_event\", schema: \"hr\", table: \"provider_event\", label: \"Provider seam event\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_provisioning_result\": { token: \"hr_provisioning_result\", schema: \"hr\", table: \"provisioning_result\", label: \"Provisioning result\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_punch\": { token: \"hr_punch\", schema: \"hr\", table: \"punch\", label: \"Punch\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_recalculation_batch\": { token: \"hr_recalculation_batch\", schema: \"hr\", table: \"recalculation_batch\", label: \"Recalculation batch\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_record_class\": { token: \"hr_record_class\", schema: \"hr\", table: \"record_class\", label: \"Record class\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"label\", contentRole: null, referenceCategory: null },\n \"hr_records_request\": { token: \"hr_records_request\", schema: \"hr\", table: \"records_request\", label: \"Records request\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_reference_check\": { token: \"hr_reference_check\", schema: \"hr\", table: \"reference_check\", label: \"Reference check\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_reporting_line\": { token: \"hr_reporting_line\", schema: \"hr\", table: \"reporting_line\", label: \"Reporting line\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_requisition\": { token: \"hr_requisition\", schema: \"hr\", table: \"requisition\", label: \"Requisition\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"requisition_number\", contentRole: null, referenceCategory: null },\n \"hr_restricted_note\": { token: \"hr_restricted_note\", schema: \"hr\", table: \"restricted_note\", label: \"Restricted note\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_retention_rule\": { token: \"hr_retention_rule\", schema: \"hr\", table: \"retention_rule\", label: \"Retention rule\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_role_assignment\": { token: \"hr_role_assignment\", schema: \"hr\", table: \"role_assignment\", label: \"HR role assignment\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_schedule\": { token: \"hr_schedule\", schema: \"hr\", table: \"schedule\", label: \"Schedule\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"hr_schedule_change\": { token: \"hr_schedule_change\", schema: \"hr\", table: \"schedule_change\", label: \"Schedule change\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_schedule_guidance\": { token: \"hr_schedule_guidance\", schema: \"hr\", table: \"schedule_guidance\", label: \"Schedule guidance\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"hr_schedule_template\": { token: \"hr_schedule_template\", schema: \"hr\", table: \"schedule_template\", label: \"Schedule template\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"hr_schedule_template_shift\": { token: \"hr_schedule_template_shift\", schema: \"hr\", table: \"schedule_template_shift\", label: \"Schedule template shift\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_scorecard\": { token: \"hr_scorecard\", schema: \"hr\", table: \"scorecard\", label: \"Scorecard\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_separation\": { token: \"hr_separation\", schema: \"hr\", table: \"separation\", label: \"Separation\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_shift\": { token: \"hr_shift\", schema: \"hr\", table: \"shift\", label: \"Shift\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_shift_claim\": { token: \"hr_shift_claim\", schema: \"hr\", table: \"shift_claim\", label: \"Shift claim\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_staffing_requirement\": { token: \"hr_staffing_requirement\", schema: \"hr\", table: \"staffing_requirement\", label: \"Staffing requirement\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_survey\": { token: \"hr_survey\", schema: \"hr\", table: \"survey\", label: \"Survey\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"hr_survey_invitation\": { token: \"hr_survey_invitation\", schema: \"hr\", table: \"survey_invitation\", label: \"Survey invitation\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_survey_question\": { token: \"hr_survey_question\", schema: \"hr\", table: \"survey_question\", label: \"Survey question\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_survey_response\": { token: \"hr_survey_response\", schema: \"hr\", table: \"survey_response\", label: \"Survey response\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_tax_registration\": { token: \"hr_tax_registration\", schema: \"hr\", table: \"tax_registration\", label: \"Tax registration\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_tax_withholding\": { token: \"hr_tax_withholding\", schema: \"hr\", table: \"tax_withholding\", label: \"Tax withholding certificate\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_time_adjustment\": { token: \"hr_time_adjustment\", schema: \"hr\", table: \"time_adjustment\", label: \"Time adjustment\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_training_assignment\": { token: \"hr_training_assignment\", schema: \"hr\", table: \"training_assignment\", label: \"Training assignment\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_training_attempt\": { token: \"hr_training_attempt\", schema: \"hr\", table: \"training_attempt\", label: \"Training attempt\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_transcript_entry\": { token: \"hr_transcript_entry\", schema: \"hr\", table: \"transcript_entry\", label: \"Transcript entry\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_verification_letter_request\": { token: \"hr_verification_letter_request\", schema: \"hr\", table: \"verification_letter_request\", label: \"Verification letter request\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_work_interval\": { token: \"hr_work_interval\", schema: \"hr\", table: \"work_interval\", label: \"Work interval\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_workflow_binding\": { token: \"hr_workflow_binding\", schema: \"hr\", table: \"workflow_binding\", label: \"HR Workflow Binding\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_workflow_decision\": { token: \"hr_workflow_decision\", schema: \"hr\", table: \"workflow_decision\", label: \"HR Workflow Decision\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_workflow_definition\": { token: \"hr_workflow_definition\", schema: \"hr\", table: \"workflow_definition\", label: \"HR Workflow Definition\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_workflow_event\": { token: \"hr_workflow_event\", schema: \"hr\", table: \"workflow_event\", label: \"HR Workflow Event\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_workflow_failure\": { token: \"hr_workflow_failure\", schema: \"hr\", table: \"workflow_failure\", label: \"HR Workflow Failure\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_workflow_flow_type\": { token: \"hr_workflow_flow_type\", schema: \"hr\", table: \"workflow_flow_type\", label: \"HR Workflow Flow Type\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_workflow_instance\": { token: \"hr_workflow_instance\", schema: \"hr\", table: \"workflow_instance\", label: \"HR Workflow Instance\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_workflow_step\": { token: \"hr_workflow_step\", schema: \"hr\", table: \"workflow_step\", label: \"HR Workflow Step\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_workflow_step_definition\": { token: \"hr_workflow_step_definition\", schema: \"hr\", table: \"workflow_step_definition\", label: \"HR Workflow Step Definition\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"hr_workweek\": { token: \"hr_workweek\", schema: \"hr\", table: \"workweek\", label: \"Workweek\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"iam_api_key\": { token: \"iam_api_key\", schema: \"iam\", table: \"api_keys\", label: \"API Key\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"industry_curator\": { token: \"industry_curator\", schema: \"iam\", table: \"industry_curators\", label: \"Industry Curator\", baseTier: 2, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"interview_document_revision\": { token: \"interview_document_revision\", schema: \"interview\", table: \"document_revision\", label: \"Interview Document Revision\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"interview_hole\": { token: \"interview_hole\", schema: \"interview\", table: \"hole\", label: \"Interview Adversary Hole\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"interview_question\": { token: \"interview_question\", schema: \"interview\", table: \"question\", label: \"Interview Open Question\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"interview_session\": { token: \"interview_session\", schema: \"interview\", table: \"session\", label: \"Vision Interview Session\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"interview_turn\": { token: \"interview_turn\", schema: \"interview\", table: \"turn\", label: \"Interview Turn\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"invitation\": { token: \"invitation\", schema: \"iam\", table: \"invitations\", label: \"Invitation\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"invitation_code\": { token: \"invitation_code\", schema: \"users\", table: \"invitation_codes\", label: \"Invitation Code\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"invitation_request\": { token: \"invitation_request\", schema: \"users\", table: \"invitation_requests\", label: \"Invitation Request\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"item_mastery\": { token: \"item_mastery\", schema: \"education\", table: \"item_mastery\", label: \"Item Mastery\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"judge_verdict\": { token: \"judge_verdict\", schema: \"platform\", table: \"judge_verdict\", label: \"Judge Verdict\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"kg_alert\": { token: \"kg_alert\", schema: \"rag\", table: \"kg_alerts\", label: \"KG Alert\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"kg_suggestion_ack\": { token: \"kg_suggestion_ack\", schema: \"rag\", table: \"kg_suggestion_ack\", label: \"KG Suggestion Ack\", baseTier: 3, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"kg_sweep_queue\": { token: \"kg_sweep_queue\", schema: \"rag\", table: \"kg_sweep_queue\", label: \"KG Sweep Queue\", baseTier: 3, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"kg_sweep_run\": { token: \"kg_sweep_run\", schema: \"rag\", table: \"kg_sweep_run\", label: \"KG Sweep Run\", baseTier: 3, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"kg_sweep_state\": { token: \"kg_sweep_state\", schema: \"rag\", table: \"kg_sweep_state\", label: \"KG Sweep State\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"kg_value_match\": { token: \"kg_value_match\", schema: \"rag\", table: \"kg_value_matches\", label: \"KG Value Match\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"league_membership\": { token: \"league_membership\", schema: \"education\", table: \"league_membership\", label: \"League Membership\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"display_name\", contentRole: null, referenceCategory: null },\n \"learn_doc\": { token: \"learn_doc\", schema: \"education\", table: \"learn_doc\", label: \"Study Guide\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"library_doc\": { token: \"library_doc\", schema: \"rag\", table: \"library_docs\", label: \"Library Document\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"mandate\": { token: \"mandate\", schema: \"mandate\", table: \"definition\", label: \"Mandate Definition (new)\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"mandate_binding\": { token: \"mandate_binding\", schema: \"mandate\", table: \"binding\", label: \"Mandate Binding (new)\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"mandate_treatment\": { token: \"mandate_treatment\", schema: \"mandate\", table: \"treatment\", label: \"Mandate Treatment (new)\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"marketing_initiative\": { token: \"marketing_initiative\", schema: \"marketing\", table: \"initiative\", label: \"Initiative\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: \"container\", referenceCategory: null },\n \"masterwork_corpus_item\": { token: \"masterwork_corpus_item\", schema: \"platform\", table: \"masterwork_corpus_item\", label: \"Masterwork Corpus Piece\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"masterwork_run\": { token: \"masterwork_run\", schema: \"platform\", table: \"masterwork_run\", label: \"Masterwork Run\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"Masterwork\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"membership\": { token: \"membership\", schema: \"iam\", table: \"memberships\", label: \"Membership\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"message\": { token: \"message\", schema: \"chat\", table: \"message\", label: \"Message\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"message_template\": { token: \"message_template\", schema: \"agent\", table: \"message_template\", label: \"Message Template\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"label\", contentRole: \"utility\", referenceCategory: null },\n \"ner_shadow\": { token: \"ner_shadow\", schema: \"rag\", table: \"ner_canonicalizer_shadow\", label: \"NER Shadow\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"note\": { token: \"note\", schema: \"workbench\", table: \"notes\", label: \"Note\", baseTier: 1, isComponent: false, isModule: true, isListed: false, scopeable: true, category: \"Sources & Outputs\", referencePickable: true, titleColumn: \"label\", contentRole: \"hybrid\", referenceCategory: null },\n \"note_folder\": { token: \"note_folder\", schema: \"workbench\", table: \"note_folders\", label: \"Note Folder\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"notification\": { token: \"notification\", schema: \"communication\", table: \"notification\", label: \"Notification\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"notification_channel_preference\": { token: \"notification_channel_preference\", schema: \"communication\", table: \"notification_channel_preference\", label: \"Notification Channel Preference\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"notification_event_override\": { token: \"notification_event_override\", schema: \"communication\", table: \"notification_event_override\", label: \"Notification Event Override\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"notification_event_type\": { token: \"notification_event_type\", schema: \"communication\", table: \"notification_event_type\", label: \"Notification Event Type\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"notification_preference\": { token: \"notification_preference\", schema: \"communication\", table: \"notification_preference\", label: \"Notification Preference\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"ops_issue_event\": { token: \"ops_issue_event\", schema: \"ops\", table: \"ops_issue_event\", label: \"Ops Issue Event\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"ops_proof_check\": { token: \"ops_proof_check\", schema: \"ops\", table: \"proof_check\", label: \"Proof Check\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"ops_proof_run\": { token: \"ops_proof_run\", schema: \"ops\", table: \"proof_run\", label: \"Proof Run\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"ops_proof_scenario\": { token: \"ops_proof_scenario\", schema: \"ops\", table: \"proof_scenario\", label: \"Proof Scenario\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"organization\": { token: \"organization\", schema: \"iam\", table: \"organizations\", label: \"Organization\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: \"container\", referenceCategory: null },\n \"output_feedback\": { token: \"output_feedback\", schema: \"platform\", table: \"output_feedback\", label: \"Output Feedback\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"page_extraction_job\": { token: \"page_extraction_job\", schema: \"docproc\", table: \"page_extraction_jobs\", label: \"Extraction Dataset\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"page_extraction_page_run\": { token: \"page_extraction_page_run\", schema: \"docproc\", table: \"page_extraction_page_runs\", label: \"Page Extraction Page Run\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"party\": { token: \"party\", schema: \"crm\", table: \"party\", label: \"Entity\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"display_name\", contentRole: \"source\", referenceCategory: null },\n \"party_contact_point\": { token: \"party_contact_point\", schema: \"crm\", table: \"party_contact_point\", label: \"Contact Point\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"label\", contentRole: null, referenceCategory: null },\n \"pc_article\": { token: \"pc_article\", schema: \"podcast\", table: \"pc_articles\", label: \"Podcast Article\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"pc_episode\": { token: \"pc_episode\", schema: \"podcast\", table: \"pc_episodes\", label: \"Podcast Episode\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"pc_show\": { token: \"pc_show\", schema: \"podcast\", table: \"pc_shows\", label: \"Podcast Show\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"pc_studio_run\": { token: \"pc_studio_run\", schema: \"podcast\", table: \"pc_studio_runs\", label: \"Podcast Studio Run\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"pc_studio_run_asset\": { token: \"pc_studio_run_asset\", schema: \"podcast\", table: \"pc_studio_run_assets\", label: \"Podcast Studio Run Asset\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"pdf_redaction_audit\": { token: \"pdf_redaction_audit\", schema: \"pdf\", table: \"pdf_redaction_audits\", label: \"PDF Redaction Audit\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"plan_cms_fill_item\": { token: \"plan_cms_fill_item\", schema: \"plan\", table: \"cms_fill_item\", label: \"CMS Fill Item\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"plan_cms_fill_job\": { token: \"plan_cms_fill_job\", schema: \"plan\", table: \"cms_fill_job\", label: \"CMS Fill Job\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"plan_entity\": { token: \"plan_entity\", schema: \"plan\", table: \"entity\", label: \"Plan Entity\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: \"label\", contentRole: null, referenceCategory: null },\n \"plan_node\": { token: \"plan_node\", schema: \"plan\", table: \"node\", label: \"Plan Node\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: \"label\", contentRole: null, referenceCategory: null },\n \"plan_node_artifact\": { token: \"plan_node_artifact\", schema: \"plan\", table: \"node_artifact\", label: \"Plan Node Artifact\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"plan_node_step\": { token: \"plan_node_step\", schema: \"plan\", table: \"node_step\", label: \"Plan Node Step\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"plan_profile\": { token: \"plan_profile\", schema: \"plan\", table: \"profile\", label: \"Plan Vertical Profile\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"vertical\", contentRole: null, referenceCategory: null },\n \"platform_actor_session\": { token: \"platform_actor_session\", schema: \"platform\", table: \"actor_session\", label: \"Actor session\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"platform_actor_token\": { token: \"platform_actor_token\", schema: \"platform\", table: \"actor_token\", label: \"Actor token\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"platform_actor_token_event\": { token: \"platform_actor_token_event\", schema: \"platform\", table: \"actor_token_event\", label: \"Actor token event\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"platform_continued_access\": { token: \"platform_continued_access\", schema: \"platform\", table: \"continued_access\", label: \"Continued Access\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"platform_outcome_event\": { token: \"platform_outcome_event\", schema: \"platform\", table: \"outcome_event\", label: \"Outcome Event\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"platform_outsider_consumer\": { token: \"platform_outsider_consumer\", schema: \"platform\", table: \"outsider_consumer\", label: \"Outsider consumer\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"platform_saved_view\": { token: \"platform_saved_view\", schema: \"platform\", table: \"saved_view\", label: \"Saved view\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"podcast_race\": { token: \"podcast_race\", schema: \"podcast\", table: \"pc_race\", label: \"Podcast Race Episode\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"processed_document\": { token: \"processed_document\", schema: \"docproc\", table: \"processed_documents\", label: \"Processed document\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: \"source\", referenceCategory: null },\n \"processed_document_page\": { token: \"processed_document_page\", schema: \"docproc\", table: \"processed_document_pages\", label: \"Processed document page\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"product_capture_file\": { token: \"product_capture_file\", schema: \"workbench\", table: \"product_capture_file\", label: \"Product Capture File\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"product_capture_item\": { token: \"product_capture_item\", schema: \"workbench\", table: \"product_capture_item\", label: \"Product Capture Item\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"product_capture_payload\": { token: \"product_capture_payload\", schema: \"workbench\", table: \"product_capture_payload\", label: \"Product Capture Payload\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"product_capture_product\": { token: \"product_capture_product\", schema: \"workbench\", table: \"product_capture_product\", label: \"Product Capture Product\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"product_capture_question\": { token: \"product_capture_question\", schema: \"workbench\", table: \"product_capture_question\", label: \"Product Capture Question\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"project\": { token: \"project\", schema: \"workspace\", table: \"projects\", label: \"Project\", baseTier: 1, isComponent: false, isModule: true, isListed: false, scopeable: true, category: \"Workspaces\", referencePickable: true, titleColumn: \"name\", contentRole: \"container\", referenceCategory: null },\n \"provision\": { token: \"provision\", schema: \"mandate\", table: \"provision\", label: \"Mandate Provision (new)\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"purpose\": { token: \"purpose\", schema: \"platform\", table: \"purpose\", label: \"Purpose\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"quiz_session\": { token: \"quiz_session\", schema: \"education\", table: \"quiz_sessions\", label: \"Quiz Session\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"title\", contentRole: \"destination\", referenceCategory: null },\n \"rag_ingest_run\": { token: \"rag_ingest_run\", schema: \"rag\", table: \"ingest_run\", label: \"Ingest Run\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"redaction_mapping\": { token: \"redaction_mapping\", schema: \"pdf\", table: \"redaction_mapping\", label: \"Redaction Mapping\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"research_analysis\": { token: \"research_analysis\", schema: \"research\", table: \"rs_analysis\", label: \"Research Analysis\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"research_content\": { token: \"research_content\", schema: \"research\", table: \"rs_content\", label: \"Research Content\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"research_context_bundle\": { token: \"research_context_bundle\", schema: \"research\", table: \"rs_context_bundle\", label: \"Research Context Bundle\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: \"research\", referencePickable: false, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"research_document\": { token: \"research_document\", schema: \"research\", table: \"rs_document\", label: \"Research Document\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"research_keyword\": { token: \"research_keyword\", schema: \"research\", table: \"rs_keyword\", label: \"Research Keyword\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"research_media\": { token: \"research_media\", schema: \"research\", table: \"rs_media\", label: \"Research Media\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"research_source\": { token: \"research_source\", schema: \"research\", table: \"rs_source\", label: \"Research Source\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"research_synthesis\": { token: \"research_synthesis\", schema: \"research\", table: \"rs_synthesis\", label: \"Research Synthesis\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"research_tag\": { token: \"research_tag\", schema: \"research\", table: \"rs_tag\", label: \"Research Tag\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"research_template\": { token: \"research_template\", schema: \"research\", table: \"rs_template\", label: \"Research Template\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"research_topic\": { token: \"research_topic\", schema: \"research\", table: \"rs_topic\", label: \"Research Topic\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"route_manifest_entry\": { token: \"route_manifest_entry\", schema: \"platform\", table: \"route_manifest\", label: \"Route Manifest Entry\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"rulebook\": { token: \"rulebook\", schema: \"platform\", table: \"rulebook\", label: \"Rulebook\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: \"Knowledge\", referencePickable: true, titleColumn: \"name\", contentRole: \"source\", referenceCategory: null },\n \"sandbox_instance\": { token: \"sandbox_instance\", schema: \"public\", table: \"sandbox_instances\", label: \"Sandbox Instance\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"sch_agent_task\": { token: \"sch_agent_task\", schema: \"scheduler\", table: \"sch_agent_task\", label: \"Agent Task Config\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"sch_run\": { token: \"sch_run\", schema: \"scheduler\", table: \"sch_run\", label: \"Task Run\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"sch_task\": { token: \"sch_task\", schema: \"scheduler\", table: \"sch_task\", label: \"Scheduled Task\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"sch_trigger\": { token: \"sch_trigger\", schema: \"scheduler\", table: \"sch_trigger\", label: \"Task Trigger\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"scope\": { token: \"scope\", schema: \"context\", table: \"scopes\", label: \"Scope\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"name\", contentRole: \"container\", referenceCategory: null },\n \"scope_association_suggestion\": { token: \"scope_association_suggestion\", schema: \"rag\", table: \"scope_association_suggestions\", label: \"Scope Association Suggestion\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"scope_item_value_suggestion\": { token: \"scope_item_value_suggestion\", schema: \"rag\", table: \"scope_item_value_suggestions\", label: \"Scope Item Value Suggestion\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"scope_suggestion\": { token: \"scope_suggestion\", schema: \"rag\", table: \"scope_suggestions\", label: \"Scope Suggestion\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"scope_type\": { token: \"scope_type\", schema: \"context\", table: \"scope_types\", label: \"Scope Type\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"slug\", contentRole: \"container\", referenceCategory: null },\n \"seo_ai_visibility_citation\": { token: \"seo_ai_visibility_citation\", schema: \"seo\", table: \"ai_visibility_citation\", label: \"AI Visibility Citation\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_ai_visibility_claim\": { token: \"seo_ai_visibility_claim\", schema: \"seo\", table: \"ai_visibility_claim\", label: \"AI Visibility Claim\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_ai_visibility_panel\": { token: \"seo_ai_visibility_panel\", schema: \"seo\", table: \"ai_visibility_panel\", label: \"AI Visibility Panel\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_ai_visibility_response\": { token: \"seo_ai_visibility_response\", schema: \"seo\", table: \"ai_visibility_response\", label: \"AI Visibility Response\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_ai_visibility_signal\": { token: \"seo_ai_visibility_signal\", schema: \"seo\", table: \"ai_visibility_signal\", label: \"AI Visibility Signal\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_backlink\": { token: \"seo_backlink\", schema: \"seo\", table: \"backlink\", label: \"SEO Backlink\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_backlink_change_event\": { token: \"seo_backlink_change_event\", schema: \"seo\", table: \"backlink_change_event\", label: \"Backlink Change Event\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_backlink_dimension_snapshot\": { token: \"seo_backlink_dimension_snapshot\", schema: \"seo\", table: \"backlink_dimension_snapshot\", label: \"Backlink Dimension Snapshot\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_backlink_observation\": { token: \"seo_backlink_observation\", schema: \"seo\", table: \"backlink_observation\", label: \"Backlink Observation\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_backlink_snapshot\": { token: \"seo_backlink_snapshot\", schema: \"seo\", table: \"backlink_snapshot\", label: \"Backlink Snapshot\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_change_assessment\": { token: \"seo_change_assessment\", schema: \"seo\", table: \"change_assessment\", label: \"SEO Change Assessment\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_change_event\": { token: \"seo_change_event\", schema: \"seo\", table: \"change_event\", label: \"SEO Change Event\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_change_item\": { token: \"seo_change_item\", schema: \"seo\", table: \"change_item\", label: \"SEO Change Item\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_change_metric\": { token: \"seo_change_metric\", schema: \"seo\", table: \"change_metric\", label: \"SEO Change Metric\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_change_set\": { token: \"seo_change_set\", schema: \"seo\", table: \"change_set\", label: \"SEO Change\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"seo\", referencePickable: false, titleColumn: \"title\", contentRole: \"source\", referenceCategory: null },\n \"seo_change_theory\": { token: \"seo_change_theory\", schema: \"seo\", table: \"change_theory\", label: \"SEO Change Theory\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_collection_run\": { token: \"seo_collection_run\", schema: \"seo\", table: \"collection_run\", label: \"SEO Collection Run\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: \"seo\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_competitor\": { token: \"seo_competitor\", schema: \"seo\", table: \"competitor\", label: \"SEO Competitor\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_competitor_observation\": { token: \"seo_competitor_observation\", schema: \"seo\", table: \"competitor_observation\", label: \"Competitor Observation\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_competitor_opportunity\": { token: \"seo_competitor_opportunity\", schema: \"seo\", table: \"competitor_opportunity\", label: \"Competitor Opportunity\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_coverage_mention\": { token: \"seo_coverage_mention\", schema: \"seo\", table: \"coverage_mention\", label: \"Coverage Mention\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_coverage_tracker\": { token: \"seo_coverage_tracker\", schema: \"seo\", table: \"coverage_tracker\", label: \"Coverage Tracker\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_dimension_value_matcher\": { token: \"seo_dimension_value_matcher\", schema: \"seo\", table: \"dimension_value_matcher\", label: \"Dimension Value Matcher\", baseTier: 1, isComponent: true, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_engine_schedule\": { token: \"seo_engine_schedule\", schema: \"seo\", table: \"engine_schedule\", label: \"SEO Engine Schedule\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_geo_place\": { token: \"seo_geo_place\", schema: \"seo\", table: \"geo_place\", label: \"Geo Place\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_gsc_dig_rule\": { token: \"seo_gsc_dig_rule\", schema: \"seo\", table: \"gsc_dig_rule\", label: \"GSC Dig Rule\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_keyword\": { token: \"seo_keyword\", schema: \"seo\", table: \"keyword\", label: \"SEO Keyword\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: \"seo\", referencePickable: false, titleColumn: \"phrase\", contentRole: null, referenceCategory: null },\n \"seo_keyword_class_rule\": { token: \"seo_keyword_class_rule\", schema: \"seo\", table: \"keyword_class_rule\", label: \"Keyword Class Rule\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_keyword_edge\": { token: \"seo_keyword_edge\", schema: \"seo\", table: \"keyword_edge\", label: \"Keyword Edge\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: \"seo\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_keyword_facet\": { token: \"seo_keyword_facet\", schema: \"seo\", table: \"keyword_facet\", label: \"Keyword Facet\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_keyword_market\": { token: \"seo_keyword_market\", schema: \"seo\", table: \"keyword_market\", label: \"Keyword Market Data\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: \"seo\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_keyword_market_observation\": { token: \"seo_keyword_market_observation\", schema: \"seo\", table: \"keyword_market_observation\", label: \"Keyword Market Observation\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_keyword_place\": { token: \"seo_keyword_place\", schema: \"seo\", table: \"keyword_place\", label: \"Keyword Place\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_keyword_saved_view\": { token: \"seo_keyword_saved_view\", schema: \"seo\", table: \"keyword_saved_view\", label: \"Keyword Saved View\", baseTier: 1, isComponent: true, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_keyword_topic\": { token: \"seo_keyword_topic\", schema: \"seo\", table: \"keyword_topic\", label: \"Keyword Topic Assignment\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: \"seo\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_landscape_brief\": { token: \"seo_landscape_brief\", schema: \"seo\", table: \"landscape_brief\", label: \"Competitive Landscape Brief\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_link_gap_domain\": { token: \"seo_link_gap_domain\", schema: \"seo\", table: \"link_gap_domain\", label: \"Link Gap Domain\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_link_gap_match\": { token: \"seo_link_gap_match\", schema: \"seo\", table: \"link_gap_match\", label: \"Link Gap Match\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_page_measurement_health\": { token: \"seo_page_measurement_health\", schema: \"seo\", table: \"page_measurement_health\", label: \"Page Measurement Health\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_page_performance\": { token: \"seo_page_performance\", schema: \"seo\", table: \"page_performance\", label: \"Page Performance\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_provider_call\": { token: \"seo_provider_call\", schema: \"seo\", table: \"provider_call\", label: \"SEO Provider Call\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_provider_task\": { token: \"seo_provider_task\", schema: \"seo\", table: \"provider_task\", label: \"SEO Provider Task\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_rank_observation\": { token: \"seo_rank_observation\", schema: \"seo\", table: \"rank_observation\", label: \"Rank Observation\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_rank_target\": { token: \"seo_rank_target\", schema: \"seo\", table: \"rank_target\", label: \"SEO Rank Target\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: \"seo\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_raw_payload\": { token: \"seo_raw_payload\", schema: \"seo\", table: \"raw_payload\", label: \"SEO Raw Payload\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_referring_domain_profile\": { token: \"seo_referring_domain_profile\", schema: \"seo\", table: \"referring_domain_profile\", label: \"Referring Domain Profile\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_reputation_case\": { token: \"seo_reputation_case\", schema: \"seo\", table: \"reputation_case\", label: \"Reputation Case\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_search_performance_daily\": { token: \"seo_search_performance_daily\", schema: \"seo\", table: \"search_performance_daily\", label: \"Search Performance Daily\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_serp_mention\": { token: \"seo_serp_mention\", schema: \"seo\", table: \"serp_mention\", label: \"SERP Prospect Mention\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_serp_opportunity\": { token: \"seo_serp_opportunity\", schema: \"seo\", table: \"serp_opportunity\", label: \"SERP Prospect Opportunity\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_serp_result\": { token: \"seo_serp_result\", schema: \"seo\", table: \"serp_result\", label: \"SERP Result\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_serp_snapshot\": { token: \"seo_serp_snapshot\", schema: \"seo\", table: \"serp_snapshot\", label: \"SERP Snapshot\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_site_geo_area\": { token: \"seo_site_geo_area\", schema: \"seo\", table: \"site_geo_area\", label: \"Site Geo Area\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_site_keyword_offering\": { token: \"seo_site_keyword_offering\", schema: \"seo\", table: \"site_keyword_offering\", label: \"Site Keyword Offering\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_site_keyword_value\": { token: \"seo_site_keyword_value\", schema: \"seo\", table: \"site_keyword_value\", label: \"Site Keyword Value\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"seo\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_site_offering_value\": { token: \"seo_site_offering_value\", schema: \"seo\", table: \"site_offering_value\", label: \"Site Offering Value\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_site_topic_value\": { token: \"seo_site_topic_value\", schema: \"seo\", table: \"site_topic_value\", label: \"Site Topic Value\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"seo\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_site_value_combo\": { token: \"seo_site_value_combo\", schema: \"seo\", table: \"site_value_combo\", label: \"Site Value Combination\", baseTier: 1, isComponent: true, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_site_value_worth\": { token: \"seo_site_value_worth\", schema: \"seo\", table: \"site_value_worth\", label: \"Site Value Worth\", baseTier: 1, isComponent: true, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_site_vocabulary\": { token: \"seo_site_vocabulary\", schema: \"seo\", table: \"site_vocabulary\", label: \"Site Vocabulary\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_source_request\": { token: \"seo_source_request\", schema: \"seo\", table: \"source_request\", label: \"SEO Source Request\", baseTier: 2, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_starter_pack\": { token: \"seo_starter_pack\", schema: \"seo\", table: \"starter_pack\", label: \"SEO Industry Starter Pack\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_starter_pack_item\": { token: \"seo_starter_pack_item\", schema: \"seo\", table: \"starter_pack_item\", label: \"SEO Starter Pack Item\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_story_angle\": { token: \"seo_story_angle\", schema: \"seo\", table: \"story_angle\", label: \"SEO Story Angle\", baseTier: 2, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"seo_topic\": { token: \"seo_topic\", schema: \"seo\", table: \"topic\", label: \"SEO Topic\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: \"seo\", referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"seo_web_analytics_daily\": { token: \"seo_web_analytics_daily\", schema: \"seo\", table: \"web_analytics_daily\", label: \"Web Analytics Daily\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"marketing\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"shared_canvas_item\": { token: \"shared_canvas_item\", schema: \"canvas\", table: \"shared_canvas_items\", label: \"Shared Canvas Item\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"short_link\": { token: \"short_link\", schema: \"platform\", table: \"short_links\", label: \"Short Link\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"skill\": { token: \"skill\", schema: \"skill\", table: \"definition\", label: \"Skill\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: \"Skills\", referencePickable: true, titleColumn: \"label\", contentRole: \"utility\", referenceCategory: null },\n \"skill_render_definition\": { token: \"skill_render_definition\", schema: \"skill\", table: \"render_definition\", label: \"Skill Render Definition\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: \"Skills\", referencePickable: true, titleColumn: \"label\", contentRole: null, referenceCategory: null },\n \"sms_consent\": { token: \"sms_consent\", schema: \"communication\", table: \"sms_consent\", label: \"SMS Consent\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"sms_conversation\": { token: \"sms_conversation\", schema: \"communication\", table: \"sms_conversations\", label: \"SMS Conversation\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"sms_message\": { token: \"sms_message\", schema: \"communication\", table: \"sms_messages\", label: \"SMS Message\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"sms_message_media\": { token: \"sms_message_media\", schema: \"communication\", table: \"sms_media\", label: \"SMS Media\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"file_name\", contentRole: null, referenceCategory: null },\n \"sms_notification\": { token: \"sms_notification\", schema: \"communication\", table: \"sms_notifications\", label: \"SMS Notification\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"sms_notification_preference\": { token: \"sms_notification_preference\", schema: \"communication\", table: \"sms_notification_preferences\", label: \"SMS Notification Preference\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"sms_phone_number\": { token: \"sms_phone_number\", schema: \"communication\", table: \"sms_phone_numbers\", label: \"SMS Phone Number\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"structured_list\": { token: \"structured_list\", schema: \"workbench\", table: \"udt_structured_lists\", label: \"Structured List\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"list_name\", contentRole: \"hybrid\", referenceCategory: null },\n \"studio_documents\": { token: \"studio_documents\", schema: \"transcripts\", table: \"studio_documents\", label: \"Studio Document\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"studio_recording_chunks\": { token: \"studio_recording_chunks\", schema: \"transcripts\", table: \"studio_recording_chunks\", label: \"Studio Recording Chunk\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"studio_recording_segments\": { token: \"studio_recording_segments\", schema: \"transcripts\", table: \"studio_recording_segments\", label: \"Studio Recording Segment\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"studio_run\": { token: \"studio_run\", schema: \"transcripts\", table: \"studio_runs\", label: \"Studio Run\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"studio_session\": { token: \"studio_session\", schema: \"transcripts\", table: \"studio_sessions\", label: \"Audio Session\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"title\", contentRole: \"source\", referenceCategory: null },\n \"studio_session_settings\": { token: \"studio_session_settings\", schema: \"transcripts\", table: \"studio_session_settings\", label: \"Studio Session Settings\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"study_attempt\": { token: \"study_attempt\", schema: \"education\", table: \"study_attempt\", label: \"Study Attempt\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"study_goal\": { token: \"study_goal\", schema: \"education\", table: \"study_goal\", label: \"Study Goal\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"study_media\": { token: \"study_media\", schema: \"education\", table: \"study_media\", label: \"Study Media\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"study_plan\": { token: \"study_plan\", schema: \"education\", table: \"study_plan\", label: \"Study Plan\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"study_plan_block\": { token: \"study_plan_block\", schema: \"education\", table: \"study_plan_block\", label: \"Study Plan Block\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"label\", contentRole: null, referenceCategory: null },\n \"study_plan_day\": { token: \"study_plan_day\", schema: \"education\", table: \"study_plan_day\", label: \"Study Plan Day\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"study_reminder_context\": { token: \"study_reminder_context\", schema: \"education\", table: \"study_reminder_context\", label: \"Study Reminder Context\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"study_reminder_delivery\": { token: \"study_reminder_delivery\", schema: \"education\", table: \"study_reminder_delivery\", label: \"Study Reminder Delivery\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"study_session\": { token: \"study_session\", schema: \"education\", table: \"study_session\", label: \"Study Session\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"surface\": { token: \"surface\", schema: \"ui\", table: \"ui_surface\", label: \"UI Surface\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"system_context_item\": { token: \"system_context_item\", schema: \"context\", table: \"system_context_item\", label: \"System Context Item\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"system_error\": { token: \"system_error\", schema: \"ops\", table: \"system_error\", label: \"System Error\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"system_personal_org_failure\": { token: \"system_personal_org_failure\", schema: \"iam\", table: \"system_personal_org_failures\", label: \"System Personal Org Failure\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"system_write_failure\": { token: \"system_write_failure\", schema: \"ops\", table: \"system_write_failure\", label: \"System Write Failure\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"task\": { token: \"task\", schema: \"workspace\", table: \"tasks\", label: \"Task\", baseTier: 1, isComponent: false, isModule: true, isListed: false, scopeable: true, category: \"Workspaces\", referencePickable: true, titleColumn: \"title\", contentRole: \"container\", referenceCategory: null },\n \"thread\": { token: \"thread\", schema: \"workspace\", table: \"threads\", label: \"Thread\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"tool\": { token: \"tool\", schema: \"tool\", table: \"definition\", label: \"Tool\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: \"Tools\", referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"tool_bundle\": { token: \"tool_bundle\", schema: \"tool\", table: \"bundle\", label: \"Tool Bundle\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: \"Tools\", referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"tool_call\": { token: \"tool_call\", schema: \"chat\", table: \"tool_call\", label: \"Tool Call\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"tool_definition_version\": { token: \"tool_definition_version\", schema: \"tool\", table: \"definition_version\", label: \"Tool Definition Version\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"Tools\", referencePickable: false, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"tool_test_sample\": { token: \"tool_test_sample\", schema: \"tool\", table: \"test_sample\", label: \"Tool Test Sample\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"Tools\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"tool_ui\": { token: \"tool_ui\", schema: \"tool\", table: \"ui\", label: \"Tool UI\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"Tools\", referencePickable: false, titleColumn: \"display_name\", contentRole: null, referenceCategory: null },\n \"tool_ui_incident\": { token: \"tool_ui_incident\", schema: \"tool\", table: \"ui_incident\", label: \"Tool UI Incident\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"Tools\", referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"tool_ui_version\": { token: \"tool_ui_version\", schema: \"tool\", table: \"ui_version\", label: \"Tool UI Version\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: \"Tools\", referencePickable: false, titleColumn: \"display_name\", contentRole: null, referenceCategory: null },\n \"transcript\": { token: \"transcript\", schema: \"transcripts\", table: \"transcripts\", label: \"Transcript\", baseTier: 1, isComponent: false, isModule: true, isListed: false, scopeable: true, category: \"Sources\", referencePickable: true, titleColumn: \"title\", contentRole: \"source\", referenceCategory: null },\n \"udt_dataset_fields\": { token: \"udt_dataset_fields\", schema: \"workbench\", table: \"udt_dataset_fields\", label: \"Dataset Field\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"display_name\", contentRole: null, referenceCategory: null },\n \"udt_dataset_rows\": { token: \"udt_dataset_rows\", schema: \"workbench\", table: \"udt_dataset_rows\", label: \"Dataset Row\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"udt_document\": { token: \"udt_document\", schema: \"workbench\", table: \"udt_documents\", label: \"Document\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"document_name\", contentRole: \"hybrid\", referenceCategory: null },\n \"udt_structured_list_items\": { token: \"udt_structured_list_items\", schema: \"workbench\", table: \"udt_structured_list_items\", label: \"Structured List Item\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"label\", contentRole: null, referenceCategory: null },\n \"ui_surface_agent_pref\": { token: \"ui_surface_agent_pref\", schema: \"ui\", table: \"ui_surface_agent_pref\", label: \"UI Surface Agent Pref\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"ui_surface_config\": { token: \"ui_surface_config\", schema: \"ui\", table: \"ui_surface_config\", label: \"UI Surface Config\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"user_achievement\": { token: \"user_achievement\", schema: \"users\", table: \"user_achievements\", label: \"User Achievement\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"user_analysis_preference\": { token: \"user_analysis_preference\", schema: \"users\", table: \"user_analysis_preferences\", label: \"User Analysis Preference\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"user_bookmark\": { token: \"user_bookmark\", schema: \"users\", table: \"user_bookmarks\", label: \"User Bookmark\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"user_email_preference\": { token: \"user_email_preference\", schema: \"users\", table: \"user_email_preferences\", label: \"User Email Preference\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"user_feedback\": { token: \"user_feedback\", schema: \"users\", table: \"user_feedback\", label: \"User Feedback\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"user_form_profile\": { token: \"user_form_profile\", schema: \"users\", table: \"user_form_profile\", label: \"User Form Profile\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"user_markdown_sample\": { token: \"user_markdown_sample\", schema: \"users\", table: \"user_markdown_samples\", label: \"User Markdown Sample\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"user_memory\": { token: \"user_memory\", schema: \"users\", table: \"user_memory\", label: \"User Memory\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"user_preference\": { token: \"user_preference\", schema: \"users\", table: \"user_preferences\", label: \"User Preference\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"user_profile\": { token: \"user_profile\", schema: \"users\", table: \"profiles\", label: \"User Profile\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"display_name\", contentRole: null, referenceCategory: null },\n \"user_stat\": { token: \"user_stat\", schema: \"users\", table: \"user_stats\", label: \"User Stats\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"user_surface_state\": { token: \"user_surface_state\", schema: \"users\", table: \"user_surface_state\", label: \"User Surface State\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"voice\": { token: \"voice\", schema: \"ai\", table: \"voices\", label: \"Voice\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"war_room\": { token: \"war_room\", schema: \"workspace\", table: \"war_rooms\", label: \"War Room\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"wbx_capture\": { token: \"wbx_capture\", schema: \"extend\", table: \"wbx_capture\", label: \"Extension Web Capture\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"wbx_guidance\": { token: \"wbx_guidance\", schema: \"extend\", table: \"wbx_guidance\", label: \"Extension Guidance\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"wbx_highlight\": { token: \"wbx_highlight\", schema: \"extend\", table: \"wbx_highlight\", label: \"Extension Highlight\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"wbx_pattern\": { token: \"wbx_pattern\", schema: \"extend\", table: \"wbx_pattern\", label: \"Extension Scrape Pattern\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"wbx_screenshot\": { token: \"wbx_screenshot\", schema: \"extend\", table: \"wbx_screenshot\", label: \"Extension Screenshot\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"wbx_seo_audit\": { token: \"wbx_seo_audit\", schema: \"extend\", table: \"wbx_seo_audit\", label: \"Extension SEO Audit\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"wc_claim\": { token: \"wc_claim\", schema: \"legal\", table: \"wc_claim\", label: \"WC Claim\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"wc_impairment_definition\": { token: \"wc_impairment_definition\", schema: \"legal\", table: \"wc_impairment_definition\", label: \"WC Impairment Definition\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"wc_injury\": { token: \"wc_injury\", schema: \"legal\", table: \"wc_injury\", label: \"WC Injury\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"wc_report\": { token: \"wc_report\", schema: \"legal\", table: \"wc_report\", label: \"WC Report\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"web_analysis_item\": { token: \"web_analysis_item\", schema: \"web\", table: \"analysis_item\", label: \"Analysis Item\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"label\", contentRole: null, referenceCategory: null },\n \"web_brand\": { token: \"web_brand\", schema: \"web\", table: \"brand\", label: \"Brand\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"web_brand_asset\": { token: \"web_brand_asset\", schema: \"web\", table: \"brand_asset\", label: \"Brand Asset\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"title\", contentRole: null, referenceCategory: null },\n \"web_brand_offering\": { token: \"web_brand_offering\", schema: \"web\", table: \"brand_offering\", label: \"Brand Offering\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"web_business_fact\": { token: \"web_business_fact\", schema: \"web\", table: \"business_fact\", label: \"Business Fact\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"label\", contentRole: null, referenceCategory: null },\n \"web_business_location\": { token: \"web_business_location\", schema: \"web\", table: \"business_location\", label: \"Business Location\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"web_crawl_event\": { token: \"web_crawl_event\", schema: \"web\", table: \"crawl_event\", label: \"Web Crawl Event\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"web_crawl_preset\": { token: \"web_crawl_preset\", schema: \"web\", table: \"crawl_preset\", label: \"Web Crawl Preset\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"web_crawl_schedule\": { token: \"web_crawl_schedule\", schema: \"web\", table: \"crawl_schedule\", label: \"Web Crawl Schedule\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"web_crawl_session\": { token: \"web_crawl_session\", schema: \"web\", table: \"crawl_session\", label: \"Crawl Session\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"web_crawl_url\": { token: \"web_crawl_url\", schema: \"web\", table: \"crawl_url\", label: \"Web Crawl URL\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"web_discovered_item\": { token: \"web_discovered_item\", schema: \"web\", table: \"discovered_item\", label: \"Discovered Item\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"web_finding\": { token: \"web_finding\", schema: \"web\", table: \"finding\", label: \"Finding\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"web_gsc_page_stat\": { token: \"web_gsc_page_stat\", schema: \"web\", table: \"gsc_page_stat\", label: \"GSC Page Stat\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"web_link_edge\": { token: \"web_link_edge\", schema: \"web\", table: \"link_edge\", label: \"Link Edge\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"web_listing_publisher\": { token: \"web_listing_publisher\", schema: \"web\", table: \"listing_publisher\", label: \"Listing Publisher\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"web_location_listing\": { token: \"web_location_listing\", schema: \"web\", table: \"location_listing\", label: \"Location Listing\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"web_offering_template\": { token: \"web_offering_template\", schema: \"web\", table: \"offering_template\", label: \"Offering Template\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"web_page\": { token: \"web_page\", schema: \"web\", table: \"page\", label: \"Canonical Page\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"url\", contentRole: \"source\", referenceCategory: null },\n \"web_page_content\": { token: \"web_page_content\", schema: \"web\", table: \"page_content\", label: \"Page Draft Content\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"web_page_evidence\": { token: \"web_page_evidence\", schema: \"web\", table: \"page_evidence\", label: \"Web Page Evidence\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"web_page_sitemap\": { token: \"web_page_sitemap\", schema: \"web\", table: \"page_sitemap\", label: \"Page Sitemap Membership\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"web_property\": { token: \"web_property\", schema: \"web\", table: \"property\", label: \"Brand Property\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"display_name\", contentRole: null, referenceCategory: null },\n \"web_provider\": { token: \"web_provider\", schema: \"web\", table: \"provider\", label: \"Provider\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"label\", contentRole: null, referenceCategory: null },\n \"web_result\": { token: \"web_result\", schema: \"web\", table: \"analysis_result\", label: \"Analysis Result\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"web_screenshot\": { token: \"web_screenshot\", schema: \"web\", table: \"screenshot\", label: \"Screenshot\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"web_site\": { token: \"web_site\", schema: \"web\", table: \"site\", label: \"Site\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"web_site_endpoint_rule\": { token: \"web_site_endpoint_rule\", schema: \"web\", table: \"site_endpoint_rule\", label: \"Site Endpoint Rule\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"path_prefix\", contentRole: null, referenceCategory: null },\n \"web_site_item_config\": { token: \"web_site_item_config\", schema: \"web\", table: \"site_item_config\", label: \"Site Item Config\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"web_site_offering\": { token: \"web_site_offering\", schema: \"web\", table: \"site_offering\", label: \"Site Offering\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"web_sitemap\": { token: \"web_sitemap\", schema: \"web\", table: \"sitemap\", label: \"Sitemap\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"url\", contentRole: null, referenceCategory: null },\n \"web_snapshot\": { token: \"web_snapshot\", schema: \"web\", table: \"snapshot\", label: \"Snapshot\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"wf_node_data_slot\": { token: \"wf_node_data_slot\", schema: \"workflow\", table: \"node_data_slot\", label: \"Workflow Node Data Slot\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"work_item\": { token: \"work_item\", schema: \"runtime\", table: \"work_item\", label: \"Runtime Work Item\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"workbook\": { token: \"workbook\", schema: \"workbench\", table: \"udt_workbooks\", label: \"Workbook\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: true, titleColumn: \"description\", contentRole: \"hybrid\", referenceCategory: null },\n \"workflow\": { token: \"workflow\", schema: \"workflow\", table: \"definition\", label: \"Workflow\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: \"utility\", referenceCategory: null },\n \"workflow_card\": { token: \"workflow_card\", schema: \"workflow\", table: \"card\", label: \"Workflow Card\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"workflow_checkpoint\": { token: \"workflow_checkpoint\", schema: \"workflow\", table: \"checkpoint\", label: \"Workflow Checkpoint\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"workflow_comparison\": { token: \"workflow_comparison\", schema: \"workflow\", table: \"comparison\", label: \"Workflow Comparison\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"workflow_definition_version\": { token: \"workflow_definition_version\", schema: \"workflow\", table: \"definition_version\", label: \"Workflow Definition Version\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"workflow_idempotency\": { token: \"workflow_idempotency\", schema: \"workflow\", table: \"idempotency\", label: \"Workflow Idempotency\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"workflow_job\": { token: \"workflow_job\", schema: \"workflow\", table: \"job\", label: \"Workflow Job\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"workflow_node_events\": { token: \"workflow_node_events\", schema: \"workflow\", table: \"node_events\", label: \"Workflow Node Events\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"workflow_node_outcome\": { token: \"workflow_node_outcome\", schema: \"workflow\", table: \"node_outcome\", label: \"Workflow Node Outcome\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"workflow_plan\": { token: \"workflow_plan\", schema: \"workflow\", table: \"plan\", label: \"Workflow Plan\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: false, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"workflow_plan_event\": { token: \"workflow_plan_event\", schema: \"workflow\", table: \"plan_event\", label: \"Workflow Plan Event\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: false, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"workflow_plan_sample\": { token: \"workflow_plan_sample\", schema: \"workflow\", table: \"plan_sample\", label: \"Workflow Plan Sample\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: false, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"workflow_recovery_audit\": { token: \"workflow_recovery_audit\", schema: \"workflow\", table: \"recovery_audit\", label: \"Workflow Recovery Audit\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"workflow_run\": { token: \"workflow_run\", schema: \"workflow\", table: \"run\", label: \"Workflow Run\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"workflow_run_log\": { token: \"workflow_run_log\", schema: \"workflow\", table: \"run_log\", label: \"Workflow Run Log\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"workflow_runtime_surface\": { token: \"workflow_runtime_surface\", schema: \"workflow\", table: \"runtime_surface\", label: \"Run Surface\", baseTier: 1, isComponent: false, isModule: false, isListed: true, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"workflow_template\": { token: \"workflow_template\", schema: \"workflow\", table: \"template\", label: \"Workflow Template\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"workflow_trigger\": { token: \"workflow_trigger\", schema: \"workflow\", table: \"trigger\", label: \"Workflow Trigger\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: true, titleColumn: \"name\", contentRole: null, referenceCategory: null },\n \"workflow_trigger_fire\": { token: \"workflow_trigger_fire\", schema: \"workflow\", table: \"trigger_fire\", label: \"Workflow Trigger Fire\", baseTier: 1, isComponent: true, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"working_document\": { token: \"working_document\", schema: \"workbench\", table: \"working_documents\", label: \"Working Documents\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: false, category: \"Conversations\", referencePickable: true, titleColumn: \"title\", contentRole: \"destination\", referenceCategory: null },\n \"youtube_search\": { token: \"youtube_search\", schema: \"research\", table: \"youtube_search\", label: \"YouTube Search\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },\n \"youtube_video\": { token: \"youtube_video\", schema: \"research\", table: \"youtube_video\", label: \"YouTube Video\", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: \"title\", contentRole: \"source\", referenceCategory: null },\n} as const satisfies Record<EntityTypeToken, EntityTypeMeta>;\n\n/** Every token, sorted — the iteration/validation source. */\nexport const ENTITY_TYPE_TOKENS: readonly EntityTypeToken[] = [\n \"access_request\",\n \"activity\",\n \"agent\",\n \"agent_card\",\n \"agent_definition_version\",\n \"agent_drift_alert\",\n \"agent_exemplar\",\n \"agent_mandate_note\",\n \"agent_prompt_remediation\",\n \"agent_run\",\n \"agent_run_stage\",\n \"agent_shortcut\",\n \"agent_surface_binding\",\n \"agent_template\",\n \"agent_usage\",\n \"ai_api\",\n \"ai_endpoint\",\n \"ai_model\",\n \"ai_model_alias\",\n \"ai_offering\",\n \"ai_provider\",\n \"ai_setting\",\n \"app\",\n \"app_definition_version\",\n \"app_error\",\n \"app_execution\",\n \"app_instance\",\n \"app_log\",\n \"app_rate_limit\",\n \"app_setting\",\n \"app_sync_status\",\n \"approach\",\n \"artifact\",\n \"assessment\",\n \"assessment_item\",\n \"assessment_result\",\n \"assist\",\n \"batch_cost_event\",\n \"batch_provider_batch\",\n \"batch_work_item\",\n \"browser_account_binding\",\n \"browser_action_event\",\n \"browser_authenticator_window\",\n \"browser_capture\",\n \"browser_control_request\",\n \"browser_handoff\",\n \"browser_login_attempt\",\n \"browser_login_recipe\",\n \"browser_profile\",\n \"browser_profile_checkpoint\",\n \"browser_run\",\n \"browser_site_observation\",\n \"browser_site_policy\",\n \"browser_stream_ticket\",\n \"canvas_comment\",\n \"canvas_comment_like\",\n \"canvas_item\",\n \"canvas_item_state\",\n \"canvas_like\",\n \"canvas_score\",\n \"canvas_view\",\n \"category\",\n \"cmp_entry\",\n \"cmp_feedback\",\n \"code_file\",\n \"code_folder\",\n \"code_repository\",\n \"coding_session\",\n \"coding_session_entry\",\n \"comment\",\n \"commerce_asset_allocation\",\n \"commerce_asset_grading\",\n \"commerce_asset_identifier\",\n \"commerce_asset_lot_event\",\n \"commerce_asset_mandate_result\",\n \"commerce_asset_price_factor\",\n \"commerce_asset_reshoot_request\",\n \"commerce_asset_review\",\n \"commerce_asset_unknown\",\n \"commerce_certified_printer\",\n \"commerce_cloud_sync_connection\",\n \"commerce_ebay_business_policy\",\n \"commerce_ebay_category\",\n \"commerce_ebay_category_aspect\",\n \"commerce_ebay_category_tree\",\n \"commerce_ebay_custom_policy\",\n \"commerce_ebay_inventory_item\",\n \"commerce_ebay_inventory_item_group\",\n \"commerce_ebay_inventory_item_group_member\",\n \"commerce_ebay_inventory_location\",\n \"commerce_ebay_listing\",\n \"commerce_ebay_marketplace_policy\",\n \"commerce_ebay_media_asset\",\n \"commerce_ebay_notification_destination\",\n \"commerce_ebay_notification_event\",\n \"commerce_ebay_notification_subscription\",\n \"commerce_ebay_notification_topic\",\n \"commerce_ebay_offer\",\n \"commerce_ebay_order\",\n \"commerce_ebay_order_line_item\",\n \"commerce_ebay_shipping_fulfillment\",\n \"commerce_ebay_store_category\",\n \"commerce_human_correction\",\n \"commerce_intake_artifact\",\n \"commerce_intake_asset\",\n \"commerce_intake_batch\",\n \"commerce_label_batch\",\n \"commerce_label_code\",\n \"commerce_marketplace_account\",\n \"commerce_marketplace_account_deletion_audit\",\n \"commerce_marketplace_api_call\",\n \"commerce_marketplace_rate_budget\",\n \"commerce_marketplace_site\",\n \"commerce_marketplace_sync_run\",\n \"commerce_prediction_outcome\",\n \"commerce_print_order\",\n \"commerce_product\",\n \"commerce_product_channel_ref\",\n \"commerce_product_media\",\n \"commerce_product_variant\",\n \"commerce_recall_audit\",\n \"comparison_set\",\n \"contact_medium\",\n \"contact_submission\",\n \"content_ir_kind\",\n \"content_ir_kind_component\",\n \"content_ir_kind_component_incident\",\n \"content_ir_kind_conformance\",\n \"content_ir_kind_edge\",\n \"content_ir_kind_example\",\n \"content_ir_kind_instance\",\n \"content_ir_kind_surface\",\n \"context_item\",\n \"context_item_suggestion\",\n \"conversation\",\n \"conversation_value\",\n \"crm_address\",\n \"crm_affiliation\",\n \"crm_blocklist_entry\",\n \"crm_contact_candidate\",\n \"crm_deal\",\n \"crm_deal_stage_event\",\n \"crm_enrichment_call\",\n \"crm_interaction\",\n \"crm_merge_candidate\",\n \"crm_outreach_list\",\n \"crm_outreach_list_member\",\n \"crm_party_merge\",\n \"crm_registry_ingest_run\",\n \"crm_registry_source\",\n \"crm_saved_view\",\n \"crm_sending_event\",\n \"crm_sending_identity\",\n \"crm_sending_identity_check\",\n \"crm_sending_policy\",\n \"custom_entity_definition\",\n \"custom_field_definition\",\n \"custom_field_target\",\n \"custom_record\",\n \"cx_agent_memory\",\n \"cx_agent_plan\",\n \"cx_agent_task\",\n \"cx_code_edit\",\n \"cx_code_message_file\",\n \"cx_media\",\n \"cx_observational_memory\",\n \"cx_observational_memory_event\",\n \"cx_pending_injection\",\n \"cx_request\",\n \"cx_request_snapshot\",\n \"cx_tool_trace\",\n \"cx_user_request\",\n \"cx_user_todo\",\n \"data_store\",\n \"dataset\",\n \"derive_run\",\n \"dict_setting\",\n \"dm_conversation\",\n \"dm_message\",\n \"dm_participant\",\n \"domain_classification\",\n \"esign_campaign\",\n \"esign_campaign_member\",\n \"esign_consent_disclosure\",\n \"esign_envelope\",\n \"esign_envelope_certificate\",\n \"esign_envelope_document\",\n \"esign_envelope_event\",\n \"esign_envelope_external_ref\",\n \"esign_envelope_signer\",\n \"esign_provider\",\n \"esign_provider_binding\",\n \"esign_signing_key\",\n \"fc_card\",\n \"fc_detail\",\n \"fc_set\",\n \"feature_doc\",\n \"file\",\n \"file_analysis\",\n \"file_entities\",\n \"file_overrides\",\n \"file_page_annotations\",\n \"file_pages\",\n \"file_version\",\n \"flexible_data\",\n \"folder\",\n \"game_badge\",\n \"game_result\",\n \"game_room\",\n \"global_execution\",\n \"global_execution_checkpoint\",\n \"global_execution_event\",\n \"global_meter_entry\",\n \"global_origin\",\n \"global_request\",\n \"growth_loop_event\",\n \"growth_loop_run\",\n \"growth_loop_stage_run\",\n \"guided_checklist_run\",\n \"heatmap_save\",\n \"hindsight_enrollment\",\n \"hindsight_finding\",\n \"hindsight_regression_case\",\n \"hindsight_replay\",\n \"hindsight_replay_step\",\n \"hindsight_review\",\n \"hr_access_audit\",\n \"hr_access_role\",\n \"hr_accommodation_request\",\n \"hr_ai_evidence\",\n \"hr_alert_routing_rule\",\n \"hr_application\",\n \"hr_approval_authority\",\n \"hr_approval_delegation\",\n \"hr_asset\",\n \"hr_asset_assignment\",\n \"hr_attendance_exception\",\n \"hr_auto_close_rule\",\n \"hr_availability\",\n \"hr_background_check\",\n \"hr_benefits_event\",\n \"hr_calculation_snapshot\",\n \"hr_candidate\",\n \"hr_candidate_conversion\",\n \"hr_candidate_message\",\n \"hr_careers_portal\",\n \"hr_checklist_item\",\n \"hr_checklist_run\",\n \"hr_checklist_template\",\n \"hr_checklist_template_item\",\n \"hr_compensation\",\n \"hr_corrective_action\",\n \"hr_course\",\n \"hr_course_version\",\n \"hr_credential\",\n \"hr_crew\",\n \"hr_deduction_code\",\n \"hr_department\",\n \"hr_derived_grant\",\n \"hr_disposition_event\",\n \"hr_earning_code\",\n \"hr_eeo_response\",\n \"hr_emergency_contact\",\n \"hr_employee\",\n \"hr_employee_private\",\n \"hr_employer_profile\",\n \"hr_employment\",\n \"hr_employment_pin\",\n \"hr_engagement\",\n \"hr_establishment\",\n \"hr_external_identity\",\n \"hr_field_policy\",\n \"hr_holiday\",\n \"hr_holiday_calendar\",\n \"hr_i9\",\n \"hr_i9_document\",\n \"hr_incident\",\n \"hr_incident_party\",\n \"hr_interview\",\n \"hr_interview_kit\",\n \"hr_job_title\",\n \"hr_jurisdiction\",\n \"hr_jurisdiction_rule\",\n \"hr_jurisdiction_rule_class\",\n \"hr_jurisdiction_rule_org_decision\",\n \"hr_jurisdiction_rule_test\",\n \"hr_kiosk_device\",\n \"hr_kiosk_session\",\n \"hr_labor_target\",\n \"hr_leave_case\",\n \"hr_leave_enrollment\",\n \"hr_leave_ledger\",\n \"hr_leave_policy\",\n \"hr_leave_request\",\n \"hr_legal_hold\",\n \"hr_legal_hold_item\",\n \"hr_location\",\n \"hr_new_hire_report\",\n \"hr_offer\",\n \"hr_opening\",\n \"hr_overtime_alert\",\n \"hr_overtime_alert_rule\",\n \"hr_overtime_preapproval\",\n \"hr_pay_group\",\n \"hr_pay_period\",\n \"hr_pay_period_employment\",\n \"hr_payroll_export\",\n \"hr_payroll_export_line\",\n \"hr_position_assignment\",\n \"hr_posting\",\n \"hr_posting_publication\",\n \"hr_provider_binding\",\n \"hr_provider_event\",\n \"hr_provisioning_result\",\n \"hr_punch\",\n \"hr_recalculation_batch\",\n \"hr_record_class\",\n \"hr_records_request\",\n \"hr_reference_check\",\n \"hr_reporting_line\",\n \"hr_requisition\",\n \"hr_restricted_note\",\n \"hr_retention_rule\",\n \"hr_role_assignment\",\n \"hr_schedule\",\n \"hr_schedule_change\",\n \"hr_schedule_guidance\",\n \"hr_schedule_template\",\n \"hr_schedule_template_shift\",\n \"hr_scorecard\",\n \"hr_separation\",\n \"hr_shift\",\n \"hr_shift_claim\",\n \"hr_staffing_requirement\",\n \"hr_survey\",\n \"hr_survey_invitation\",\n \"hr_survey_question\",\n \"hr_survey_response\",\n \"hr_tax_registration\",\n \"hr_tax_withholding\",\n \"hr_time_adjustment\",\n \"hr_training_assignment\",\n \"hr_training_attempt\",\n \"hr_transcript_entry\",\n \"hr_verification_letter_request\",\n \"hr_work_interval\",\n \"hr_workflow_binding\",\n \"hr_workflow_decision\",\n \"hr_workflow_definition\",\n \"hr_workflow_event\",\n \"hr_workflow_failure\",\n \"hr_workflow_flow_type\",\n \"hr_workflow_instance\",\n \"hr_workflow_step\",\n \"hr_workflow_step_definition\",\n \"hr_workweek\",\n \"iam_api_key\",\n \"industry_curator\",\n \"interview_document_revision\",\n \"interview_hole\",\n \"interview_question\",\n \"interview_session\",\n \"interview_turn\",\n \"invitation\",\n \"invitation_code\",\n \"invitation_request\",\n \"item_mastery\",\n \"judge_verdict\",\n \"kg_alert\",\n \"kg_suggestion_ack\",\n \"kg_sweep_queue\",\n \"kg_sweep_run\",\n \"kg_sweep_state\",\n \"kg_value_match\",\n \"league_membership\",\n \"learn_doc\",\n \"library_doc\",\n \"mandate\",\n \"mandate_binding\",\n \"mandate_treatment\",\n \"marketing_initiative\",\n \"masterwork_corpus_item\",\n \"masterwork_run\",\n \"membership\",\n \"message\",\n \"message_template\",\n \"ner_shadow\",\n \"note\",\n \"note_folder\",\n \"notification\",\n \"notification_channel_preference\",\n \"notification_event_override\",\n \"notification_event_type\",\n \"notification_preference\",\n \"ops_issue_event\",\n \"ops_proof_check\",\n \"ops_proof_run\",\n \"ops_proof_scenario\",\n \"organization\",\n \"output_feedback\",\n \"page_extraction_job\",\n \"page_extraction_page_run\",\n \"party\",\n \"party_contact_point\",\n \"pc_article\",\n \"pc_episode\",\n \"pc_show\",\n \"pc_studio_run\",\n \"pc_studio_run_asset\",\n \"pdf_redaction_audit\",\n \"plan_cms_fill_item\",\n \"plan_cms_fill_job\",\n \"plan_entity\",\n \"plan_node\",\n \"plan_node_artifact\",\n \"plan_node_step\",\n \"plan_profile\",\n \"platform_actor_session\",\n \"platform_actor_token\",\n \"platform_actor_token_event\",\n \"platform_continued_access\",\n \"platform_outcome_event\",\n \"platform_outsider_consumer\",\n \"platform_saved_view\",\n \"podcast_race\",\n \"processed_document\",\n \"processed_document_page\",\n \"product_capture_file\",\n \"product_capture_item\",\n \"product_capture_payload\",\n \"product_capture_product\",\n \"product_capture_question\",\n \"project\",\n \"provision\",\n \"purpose\",\n \"quiz_session\",\n \"rag_ingest_run\",\n \"redaction_mapping\",\n \"research_analysis\",\n \"research_content\",\n \"research_context_bundle\",\n \"research_document\",\n \"research_keyword\",\n \"research_media\",\n \"research_source\",\n \"research_synthesis\",\n \"research_tag\",\n \"research_template\",\n \"research_topic\",\n \"route_manifest_entry\",\n \"rulebook\",\n \"sandbox_instance\",\n \"sch_agent_task\",\n \"sch_run\",\n \"sch_task\",\n \"sch_trigger\",\n \"scope\",\n \"scope_association_suggestion\",\n \"scope_item_value_suggestion\",\n \"scope_suggestion\",\n \"scope_type\",\n \"seo_ai_visibility_citation\",\n \"seo_ai_visibility_claim\",\n \"seo_ai_visibility_panel\",\n \"seo_ai_visibility_response\",\n \"seo_ai_visibility_signal\",\n \"seo_backlink\",\n \"seo_backlink_change_event\",\n \"seo_backlink_dimension_snapshot\",\n \"seo_backlink_observation\",\n \"seo_backlink_snapshot\",\n \"seo_change_assessment\",\n \"seo_change_event\",\n \"seo_change_item\",\n \"seo_change_metric\",\n \"seo_change_set\",\n \"seo_change_theory\",\n \"seo_collection_run\",\n \"seo_competitor\",\n \"seo_competitor_observation\",\n \"seo_competitor_opportunity\",\n \"seo_coverage_mention\",\n \"seo_coverage_tracker\",\n \"seo_dimension_value_matcher\",\n \"seo_engine_schedule\",\n \"seo_geo_place\",\n \"seo_gsc_dig_rule\",\n \"seo_keyword\",\n \"seo_keyword_class_rule\",\n \"seo_keyword_edge\",\n \"seo_keyword_facet\",\n \"seo_keyword_market\",\n \"seo_keyword_market_observation\",\n \"seo_keyword_place\",\n \"seo_keyword_saved_view\",\n \"seo_keyword_topic\",\n \"seo_landscape_brief\",\n \"seo_link_gap_domain\",\n \"seo_link_gap_match\",\n \"seo_page_measurement_health\",\n \"seo_page_performance\",\n \"seo_provider_call\",\n \"seo_provider_task\",\n \"seo_rank_observation\",\n \"seo_rank_target\",\n \"seo_raw_payload\",\n \"seo_referring_domain_profile\",\n \"seo_reputation_case\",\n \"seo_search_performance_daily\",\n \"seo_serp_mention\",\n \"seo_serp_opportunity\",\n \"seo_serp_result\",\n \"seo_serp_snapshot\",\n \"seo_site_geo_area\",\n \"seo_site_keyword_offering\",\n \"seo_site_keyword_value\",\n \"seo_site_offering_value\",\n \"seo_site_topic_value\",\n \"seo_site_value_combo\",\n \"seo_site_value_worth\",\n \"seo_site_vocabulary\",\n \"seo_source_request\",\n \"seo_starter_pack\",\n \"seo_starter_pack_item\",\n \"seo_story_angle\",\n \"seo_topic\",\n \"seo_web_analytics_daily\",\n \"shared_canvas_item\",\n \"short_link\",\n \"skill\",\n \"skill_render_definition\",\n \"sms_consent\",\n \"sms_conversation\",\n \"sms_message\",\n \"sms_message_media\",\n \"sms_notification\",\n \"sms_notification_preference\",\n \"sms_phone_number\",\n \"structured_list\",\n \"studio_documents\",\n \"studio_recording_chunks\",\n \"studio_recording_segments\",\n \"studio_run\",\n \"studio_session\",\n \"studio_session_settings\",\n \"study_attempt\",\n \"study_goal\",\n \"study_media\",\n \"study_plan\",\n \"study_plan_block\",\n \"study_plan_day\",\n \"study_reminder_context\",\n \"study_reminder_delivery\",\n \"study_session\",\n \"surface\",\n \"system_context_item\",\n \"system_error\",\n \"system_personal_org_failure\",\n \"system_write_failure\",\n \"task\",\n \"thread\",\n \"tool\",\n \"tool_bundle\",\n \"tool_call\",\n \"tool_definition_version\",\n \"tool_test_sample\",\n \"tool_ui\",\n \"tool_ui_incident\",\n \"tool_ui_version\",\n \"transcript\",\n \"udt_dataset_fields\",\n \"udt_dataset_rows\",\n \"udt_document\",\n \"udt_structured_list_items\",\n \"ui_surface_agent_pref\",\n \"ui_surface_config\",\n \"user_achievement\",\n \"user_analysis_preference\",\n \"user_bookmark\",\n \"user_email_preference\",\n \"user_feedback\",\n \"user_form_profile\",\n \"user_markdown_sample\",\n \"user_memory\",\n \"user_preference\",\n \"user_profile\",\n \"user_stat\",\n \"user_surface_state\",\n \"voice\",\n \"war_room\",\n \"wbx_capture\",\n \"wbx_guidance\",\n \"wbx_highlight\",\n \"wbx_pattern\",\n \"wbx_screenshot\",\n \"wbx_seo_audit\",\n \"wc_claim\",\n \"wc_impairment_definition\",\n \"wc_injury\",\n \"wc_report\",\n \"web_analysis_item\",\n \"web_brand\",\n \"web_brand_asset\",\n \"web_brand_offering\",\n \"web_business_fact\",\n \"web_business_location\",\n \"web_crawl_event\",\n \"web_crawl_preset\",\n \"web_crawl_schedule\",\n \"web_crawl_session\",\n \"web_crawl_url\",\n \"web_discovered_item\",\n \"web_finding\",\n \"web_gsc_page_stat\",\n \"web_link_edge\",\n \"web_listing_publisher\",\n \"web_location_listing\",\n \"web_offering_template\",\n \"web_page\",\n \"web_page_content\",\n \"web_page_evidence\",\n \"web_page_sitemap\",\n \"web_property\",\n \"web_provider\",\n \"web_result\",\n \"web_screenshot\",\n \"web_site\",\n \"web_site_endpoint_rule\",\n \"web_site_item_config\",\n \"web_site_offering\",\n \"web_sitemap\",\n \"web_snapshot\",\n \"wf_node_data_slot\",\n \"work_item\",\n \"workbook\",\n \"workflow\",\n \"workflow_card\",\n \"workflow_checkpoint\",\n \"workflow_comparison\",\n \"workflow_definition_version\",\n \"workflow_idempotency\",\n \"workflow_job\",\n \"workflow_node_events\",\n \"workflow_node_outcome\",\n \"workflow_plan\",\n \"workflow_plan_event\",\n \"workflow_plan_sample\",\n \"workflow_recovery_audit\",\n \"workflow_run\",\n \"workflow_run_log\",\n \"workflow_runtime_surface\",\n \"workflow_template\",\n \"workflow_trigger\",\n \"workflow_trigger_fire\",\n \"working_document\",\n \"youtube_search\",\n \"youtube_video\",\n];\n\n/**\n * Pretty display metadata for DB schemas, mirrored from `platform.schemas`\n * (admin-writable via `admin_upsert_schema`). Tier-1 buckets for reference\n * type choosers and admin surfaces.\n */\nexport const SCHEMA_DISPLAY: Record<\n string,\n { readonly label: string; readonly sortOrder: number; readonly isActive: boolean }\n> = {\n \"public\": { label: \"General\", sortOrder: 10, isActive: true },\n \"agent\": { label: \"Agents\", sortOrder: 20, isActive: true },\n \"app\": { label: \"Apps\", sortOrder: 25, isActive: true },\n \"skill\": { label: \"Skills\", sortOrder: 30, isActive: true },\n \"workflow\": { label: \"Workflows\", sortOrder: 35, isActive: true },\n \"chat\": { label: \"Chat\", sortOrder: 40, isActive: true },\n \"files\": { label: \"Files\", sortOrder: 45, isActive: true },\n \"code\": { label: \"Code\", sortOrder: 50, isActive: true },\n \"workbench\": { label: \"Workbench\", sortOrder: 55, isActive: true },\n \"workspace\": { label: \"Workspace\", sortOrder: 60, isActive: true },\n \"transcripts\": { label: \"Transcripts\", sortOrder: 65, isActive: true },\n \"podcast\": { label: \"Podcasts\", sortOrder: 70, isActive: true },\n \"education\": { label: \"Education\", sortOrder: 75, isActive: true },\n \"research\": { label: \"Research\", sortOrder: 80, isActive: true },\n \"rag\": { label: \"Knowledge\", sortOrder: 85, isActive: true },\n \"crm\": { label: \"CRM\", sortOrder: 87, isActive: true },\n \"plan\": { label: \"Content Planning\", sortOrder: 88, isActive: true },\n \"web\": { label: \"Marketing & Web\", sortOrder: 90, isActive: true },\n \"scraper\": { label: \"Web Scraper\", sortOrder: 95, isActive: true },\n \"docproc\": { label: \"Document Processing\", sortOrder: 100, isActive: true },\n \"pdf\": { label: \"PDF\", sortOrder: 105, isActive: true },\n \"canvas\": { label: \"Canvas\", sortOrder: 110, isActive: true },\n \"content_ir\": { label: \"Structured Content\", sortOrder: 115, isActive: true },\n \"context\": { label: \"Context\", sortOrder: 120, isActive: true },\n \"communication\": { label: \"Communication\", sortOrder: 125, isActive: true },\n \"legal\": { label: \"Legal\", sortOrder: 130, isActive: true },\n \"scheduler\": { label: \"Scheduling\", sortOrder: 135, isActive: true },\n \"ai\": { label: \"AI Models\", sortOrder: 140, isActive: true },\n \"tool\": { label: \"Tools\", sortOrder: 145, isActive: true },\n \"extend\": { label: \"Browser Extension\", sortOrder: 150, isActive: true },\n \"users\": { label: \"Users\", sortOrder: 155, isActive: true },\n \"user\": { label: \"User Data\", sortOrder: 160, isActive: true },\n \"iam\": { label: \"Access & Identity\", sortOrder: 165, isActive: true },\n \"platform\": { label: \"Platform\", sortOrder: 170, isActive: true },\n \"reg\": { label: \"Registry\", sortOrder: 175, isActive: true },\n \"runtime\": { label: \"Runtime\", sortOrder: 180, isActive: true },\n \"ui\": { label: \"UI\", sortOrder: 185, isActive: true },\n \"admin\": { label: \"Admin\", sortOrder: 190, isActive: true },\n \"graveyard\": { label: \"Graveyard\", sortOrder: 900, isActive: false },\n};\n\n/**\n * Admin-defined reference chooser buckets, mirrored from\n * `platform.reference_categories` (`admin_upsert_reference_category`).\n * An entity type's `referenceCategory` points here; unassigned types\n * bucket by schema via `SCHEMA_DISPLAY`.\n */\nexport const REFERENCE_CATEGORY_DISPLAY: Record<\n string,\n { readonly label: string; readonly sortOrder: number; readonly isActive: boolean }\n> = {\n\n};\n\nconst ENTITY_TYPE_TOKEN_SET: ReadonlySet<string> = new Set(ENTITY_TYPE_TOKENS);\n\n/** Runtime guard: is `value` a registered entity token? Narrows to the union. */\nexport function isEntityTypeToken(value: unknown): value is EntityTypeToken {\n return typeof value === \"string\" && ENTITY_TYPE_TOKEN_SET.has(value);\n}\n","// core/titles.ts — @ai-matrx/associations/core\n//\n// Batched entity-title resolution — the \"UUIDs never render\" primitive.\n// Ported behavior-verbatim from matrx-frontend\n// `features/scopes/service/entityTitles.ts` (associations extraction W2,\n// 2026-08-29). One structural inversion: the MODULE-level session Map (banned\n// by the packaging standard — dual-loaded graphs silently split module\n// state) becomes STORE-INSTANCE state — the cache lives on the titles\n// service the store constructs once, so there is nothing to split and no\n// globalThis slot is needed.\n//\n// Association edges SHOULD carry a `label` stamped at attach time; this\n// service covers the rest (legacy unlabeled edges, rows renamed since\n// attach). Given a token + ids, it resolves titles through the\n// registry-driven candidate RPC and memoizes per store lifetime. Tokens\n// without a title column (or unregistered tokens) resolve to nothing —\n// callers fall back to `Untitled <label>` via `fallback`.\n\nimport type { CoreDeps } from \"./deps\";\nimport type { CandidatesServiceApi } from \"./candidates\";\n\nconst CHUNK = 200;\n\nexport function entityTitleCacheKey(token: string, id: string): string {\n return `${token}:${id}`;\n}\n\nexport interface TitlesServiceApi {\n /** Read the cache synchronously (for render paths after a fetch settled). */\n get(token: string, id: string): string | null;\n /**\n * Push a known-fresh title into the cache (after a rename or a create), so\n * surfaces that resolve through this service never show a stale name.\n */\n prime(token: string, id: string, title: string): void;\n /** Display fallback when no label and no fetched title exist. */\n fallback(token: string): string;\n /**\n * Resolve titles for `ids` of one token. Returns ONLY the resolved entries\n * (cache + fresh reads); missing rows (deleted, no access) stay absent.\n */\n fetch(token: string, ids: string[]): Promise<Map<string, string>>;\n}\n\nexport function createTitlesService(\n deps: CoreDeps,\n candidates: CandidatesServiceApi,\n): TitlesServiceApi {\n const { registry, errorSink } = deps;\n\n /** `${token}:${id}` → resolved title. Store-lifetime; titles change rarely. */\n const titleCache = new Map<string, string>();\n\n return {\n get(token, id) {\n return titleCache.get(entityTitleCacheKey(token, id)) ?? null;\n },\n\n prime(token, id, title) {\n const trimmed = title.trim();\n if (trimmed) titleCache.set(entityTitleCacheKey(token, id), trimmed);\n },\n\n fallback(token) {\n const info = registry.tryGetEntityInfo(token);\n return `Untitled ${info?.label ?? token}`;\n },\n\n async fetch(token, ids) {\n const out = new Map<string, string>();\n if (ids.length === 0) return out;\n\n const info = registry.tryGetEntityInfo(token);\n const missing: string[] = [];\n for (const id of ids) {\n const cached = titleCache.get(entityTitleCacheKey(token, id));\n if (cached !== undefined) out.set(id, cached);\n else missing.push(id);\n }\n if (missing.length === 0 || !info?.titleColumn) return out;\n\n for (let index = 0; index < missing.length; index += CHUNK) {\n const chunk = missing.slice(index, index + CHUNK);\n const { data, error } = await candidates.callReferenceSearchCandidates({\n p_token: token,\n p_ids: chunk,\n p_limit: chunk.length,\n });\n if (error) {\n errorSink({\n code: \"title_rpc_failed\",\n message: `[fetchEntityTitles] candidate RPC failed for \"${token}\": ${error.message}`,\n context: {\n token,\n chunkStart: index,\n chunkSize: chunk.length,\n detail: error,\n },\n });\n continue;\n }\n for (const row of data) {\n const title = row.title?.trim();\n if (!title) continue;\n titleCache.set(entityTitleCacheKey(token, row.id), title);\n out.set(row.id, title);\n }\n }\n return out;\n },\n };\n}\n","// core/store.ts — @ai-matrx/associations/core\n//\n// THE package-owned, store-agnostic cache (design Decision 3) — the one\n// runtime object a host constructs (`createAssociationsStore(cfg)`),\n// replacing matrx-frontend's ~530 lines of Redux fragments\n// (`scopesTree.associationsByKey` + `categoriesByDimension` + the\n// association/category thunks + selectors) with a subscribable store the\n// /react hooks (W3) ride via `useSyncExternalStore`. Behavior ported\n// verbatim from `features/scopes/redux/thunks/{associations,categories}.ts`\n// + the matching `scopesSlice` reducers + selectors (2026-08-29):\n//\n// • lazy `load` with per-key IN-FLIGHT DEDUP (the thunks' Map) and\n// `status === \"ready\"` short-circuit unless `force`;\n// • pending keeps previous edges AND the visible error (consumers use\n// status to disable/spin the same retry control);\n// • add/remove reload BOTH endpoints on success (a write touches TWO\n// endpoints — the source and the target each see the edge);\n// • setTargets reloads the SOURCE only (the only endpoint with a\n// deterministic post-state);\n// • createCategory does the optimistic ECHO-INSERT then force-reloads to\n// pick up server-derived fields authoritatively;\n// • `getEdges`/`getCategories` return a STABLE idle default (never a fresh\n// object per read — the useSyncExternalStore contract).\n//\n// THE NEVER-TOUCHES-CONTEXT INVARIANT, now structural: the thunks' law\n// \"NEVER dispatch appContextSlice actions\" (a durable association is NOT the\n// user's active working context) is carried over as architecture — this\n// package has no import path to any host store, and a write notifies ONLY\n// the association subscribers of the endpoints it touched (proven by test).\n//\n// Invalidation is owned here (subscribe/notify + `invalidate`). It does NOT\n// depend on `@ai-matrx/kit` — but the shape is deliberately bridgeable: a\n// host binding may register `store.invalidate` under kit `/invalidation`\n// names so ubiquitous modules can invalidate association caches with zero\n// import edge into this package's chunk.\n//\n// NO module-level mutable state anywhere in /core: every cache lives on the\n// store instance the host constructs, so the dual-bundle split-registry\n// failure the packaging standard's globalThis-slot rule exists for cannot\n// occur (there is no module state to split).\n\nimport type {\n AssociationsEntry,\n AssociationTargetType,\n CategoriesEntry,\n CategoryDimension,\n PlatformCategory,\n} from \"../edges\";\nimport type { CommentsEntry } from \"../comments\";\nimport { isAssociationsRpcErr } from \"../results\";\nimport type {\n AssociationsConfig,\n AssociationsDataSource,\n ErrorSink,\n} from \"../ports\";\nimport { createDefaultErrorSink } from \"./defaultErrorSink\";\nimport type { CoreDeps } from \"./deps\";\nimport { createAssociationGuards } from \"./guards\";\nimport { createRpcResultHelpers } from \"./rpcResult\";\nimport { createEntityRegistry, type EntityRegistry } from \"./registry\";\nimport {\n createAssociationsService,\n type AssociationsServiceApi,\n} from \"./associationsService\";\nimport {\n createCategoriesService,\n type CategoriesServiceApi,\n} from \"./categoriesService\";\nimport {\n createFavoritesService,\n type FavoritesServiceApi,\n} from \"./favoritesService\";\nimport { createCandidatesService, type CandidatesServiceApi } from \"./candidates\";\nimport { createTitlesService, type TitlesServiceApi } from \"./titles\";\nimport {\n createEntityRowsService,\n type EntityRowsServiceApi,\n} from \"./entityRows\";\nimport {\n createAssociationHelpers,\n type AssociationHelpersApi,\n} from \"./helpers\";\nimport {\n createCommentsService,\n type CommentsServiceApi,\n} from \"./commentsService\";\n\n/** Cache key for one association endpoint. */\nexport function associationsKey(type: string, id: string): string {\n return `${type}:${id}`;\n}\n\nexport interface AssociationWriteResult {\n ok: boolean;\n /** Set on a successful single-edge `add`. */\n id?: string;\n error?: string;\n}\n\nexport interface CategoryMutationResult {\n ok: boolean;\n /** Set on a successful mutation. */\n id?: string;\n error?: string;\n}\n\nconst IDLE_ASSOCIATIONS: AssociationsEntry = Object.freeze({\n status: \"idle\",\n edges: Object.freeze([]) as unknown as AssociationsEntry[\"edges\"],\n fetchedAt: null,\n error: null,\n});\n\nconst IDLE_CATEGORIES: CategoriesEntry = Object.freeze({\n status: \"idle\",\n categories: Object.freeze([]) as unknown as CategoriesEntry[\"categories\"],\n fetchedAt: null,\n error: null,\n});\n\nconst IDLE_COMMENTS: CommentsEntry = Object.freeze({\n status: \"idle\",\n comments: Object.freeze([]) as unknown as CommentsEntry[\"comments\"],\n fetchedAt: null,\n error: null,\n});\n\nexport interface CommentMutationResult {\n ok: boolean;\n /** Set on a successful `addComment`. */\n id?: string;\n error?: string;\n}\n\nexport interface AssociationsStore {\n // ── the cache (association endpoints) ────────────────────────────────\n /** Stable, sync read of one endpoint's entry (idle default when uncached). */\n getEdges(type: string, id: string): AssociationsEntry;\n /**\n * Lazy load of every edge touching `${type}:${id}` (both directions).\n * Deduped per key; `status === \"ready\"` short-circuits unless `force`.\n */\n load(type: string, id: string, opts?: { force?: boolean }): Promise<void>;\n /** External-store contract: notified whenever the key's entry changes. */\n subscribe(key: string, cb: () => void): () => void;\n /** Attach source → target; on success reloads BOTH endpoints. */\n add(args: {\n sourceType: string;\n sourceId: string;\n targetType: AssociationTargetType;\n targetId: string;\n orgId?: string;\n label?: string;\n role?: string;\n metadata?: unknown;\n replaceMetadata?: boolean;\n }): Promise<AssociationWriteResult>;\n /** Detach source → target; on success reloads BOTH endpoints. */\n remove(args: {\n sourceType: string;\n sourceId: string;\n targetType: string;\n targetId: string;\n role?: string;\n }): Promise<AssociationWriteResult>;\n /** Replace the source's `targetType` edge set; reloads the SOURCE. */\n setTargets(args: {\n sourceType: string;\n sourceId: string;\n targetType: AssociationTargetType;\n targetIds: string[];\n orgId?: string;\n role?: string;\n }): Promise<AssociationWriteResult>;\n /** Reset one endpoint to idle and notify its subscribers. */\n invalidate(type: string, id: string): void;\n /** Reset every association endpoint, category facet, and comment thread. */\n invalidateAll(): void;\n\n // ── the cache (category facets) ──────────────────────────────────────\n getCategories(dimension: CategoryDimension): CategoriesEntry;\n loadCategories(\n dimension: CategoryDimension,\n opts?: { force?: boolean },\n ): Promise<void>;\n subscribeCategories(dimension: CategoryDimension, cb: () => void): () => void;\n /** Create + echo-insert + authoritative force reload. Returns the new id. */\n createCategory(args: {\n dimension: CategoryDimension;\n name: string;\n orgId: string;\n parentId?: string | null;\n color?: string | null;\n icon?: string | null;\n slug?: string | null;\n }): Promise<CategoryMutationResult>;\n updateCategory(args: {\n dimension: CategoryDimension;\n id: string;\n name: string;\n slug: string | null;\n color: string | null;\n icon: string | null;\n position: number | null;\n }): Promise<CategoryMutationResult>;\n reparentCategory(args: {\n dimension: CategoryDimension;\n id: string;\n parentId: string | null;\n }): Promise<CategoryMutationResult>;\n deleteCategory(args: {\n dimension: CategoryDimension;\n id: string;\n }): Promise<CategoryMutationResult>;\n\n // ── the cache (comment threads, W6) ──────────────────────────────────\n /** Stable, sync read of one entity's comment thread (idle when uncached). */\n getComments(type: string, id: string): CommentsEntry;\n /**\n * Lazy load of every comment on `${type}:${id}` (oldest→newest; thread by\n * `parentId`). Deduped per key; `status === \"ready\"` short-circuits unless\n * `force`.\n */\n loadComments(\n type: string,\n id: string,\n opts?: { force?: boolean },\n ): Promise<void>;\n /** External-store contract for one entity's comment thread. */\n subscribeComments(key: string, cb: () => void): () => void;\n /** Post a comment (or a reply); on success force-reloads the thread. */\n addComment(args: {\n entityType: string;\n entityId: string;\n body: string;\n parentId?: string | null;\n orgId?: string | null;\n }): Promise<CommentMutationResult>;\n /** Edit a comment body (author-only in the RPC); reloads the thread. */\n editComment(args: {\n entityType: string;\n entityId: string;\n id: string;\n body: string;\n }): Promise<CommentMutationResult>;\n /** Soft-delete a comment (author/org member in the RPC); reloads the thread. */\n deleteComment(args: {\n entityType: string;\n entityId: string;\n id: string;\n }): Promise<CommentMutationResult>;\n /** Reset one entity's comment thread to idle and notify its subscribers. */\n invalidateComments(type: string, id: string): void;\n\n // ── the seams under the cache ────────────────────────────────────────\n /** Batched title resolution + the session cache + prime. */\n titles: TitlesServiceApi;\n /** Per-user favorite/pinned/hidden state (`ues_*`). */\n favorites: FavoritesServiceApi;\n /** Candidate reads for the pickers. */\n candidates: CandidatesServiceApi;\n /** Generic registry-convention row create/rename. */\n entityRows: EntityRowsServiceApi;\n /** Composite link helpers over the chokepoint. */\n helpers: AssociationHelpersApi;\n /** The registry merge engine (generated metadata + host overlay). */\n registry: EntityRegistry;\n /**\n * The raw chokepoint services — every RPC family, results-enveloped.\n * `associations` writes here do NOT touch the cache; use the store-level\n * `add`/`remove`/`setTargets` when a cached surface must stay fresh.\n */\n services: {\n associations: AssociationsServiceApi;\n categories: CategoriesServiceApi;\n comments: CommentsServiceApi;\n };\n /** Merge more host overlay entries in (icons/routes/candidate loaders). */\n registerEntityOverlay: EntityRegistry[\"registerEntityOverlay\"];\n /**\n * The bound scream seam (W3, additive): /react surfaces route their loud\n * recoveries here (the originals' console.error sites) without a second\n * sink binding. Same function the host passed at construction.\n */\n errorSink: ErrorSink;\n /**\n * The bound data seam (0.6.0, additive): the provider's demanded-schema\n * boot probe reads it so hosts stop re-exporting their dataSource just to\n * run a check the package owns.\n */\n dataSource: AssociationsDataSource;\n /**\n * The bound identity port (W3, additive): /react hooks that FILTER by the\n * current user (candidate owner scoping) read it leniently; write paths\n * keep going through the services, where `requireUserId` failures stay\n * loud. Same object the host passed at construction.\n */\n identity: AssociationsConfig[\"identity\"];\n}\n\n/**\n * Build the one store a host binds. The REQUIRED ports (dataSource /\n * identity — true app identity, C23) throw at construction when absent.\n * Every other port has a SHIPPED DEFAULT (errorSink since 0.6.0) or a\n * documented degradation; nothing is ever silently missing.\n */\nexport function createAssociationsStore(\n config: AssociationsConfig,\n): AssociationsStore {\n if (!config || typeof config.dataSource?.rpc !== \"function\") {\n throw new Error(\n \"@ai-matrx/associations: the REQUIRED dataSource port is missing \" +\n \"(need an object with rpc(fn, args) — a supabase-js client \" +\n \"satisfies it structurally). The package IS data operations; there \" +\n \"is no degraded mode without one.\",\n );\n }\n if (typeof config.identity?.requireUserId !== \"function\") {\n throw new Error(\n \"@ai-matrx/associations: the REQUIRED identity port is missing \" +\n \"(need requireUserId(): string that THROWS when unauthenticated). \" +\n \"Identity never comes from a store import.\",\n );\n }\n // `errorSink` stopped being required in 0.6.0 (C23): the package ships the\n // obvious sink instead of refusing to construct. The default is LOUD about\n // being the default — see createDefaultErrorSink.\n const errorSink: ErrorSink =\n typeof config.errorSink === \"function\"\n ? config.errorSink\n : createDefaultErrorSink();\n const registry = createEntityRegistry(errorSink, config.entityOverlay);\n const deps: CoreDeps = {\n dataSource: config.dataSource,\n identity: config.identity,\n errorSink,\n guards: createAssociationGuards(errorSink),\n rpc: createRpcResultHelpers(errorSink),\n registry,\n };\n\n const associations = createAssociationsService(deps);\n const categories = createCategoriesService(deps);\n const favorites = createFavoritesService(deps);\n const candidates = createCandidatesService(deps);\n const titles = createTitlesService(deps, candidates);\n const entityRows = createEntityRowsService(deps, titles);\n const helpers = createAssociationHelpers(associations);\n const comments = createCommentsService(deps);\n\n // ── instance state (never module state) ────────────────────────────────\n const assocByKey = new Map<string, AssociationsEntry>();\n const assocSubs = new Map<string, Set<() => void>>();\n const assocInFlight = new Map<string, Promise<void>>();\n const catByDim = new Map<string, CategoriesEntry>();\n const catSubs = new Map<string, Set<() => void>>();\n const catInFlight = new Map<string, Promise<void>>();\n const cmtByKey = new Map<string, CommentsEntry>();\n const cmtSubs = new Map<string, Set<() => void>>();\n const cmtInFlight = new Map<string, Promise<void>>();\n\n function notifyAssoc(key: string): void {\n const subs = assocSubs.get(key);\n if (subs) for (const cb of [...subs]) cb();\n }\n function notifyCat(dimension: string): void {\n const subs = catSubs.get(dimension);\n if (subs) for (const cb of [...subs]) cb();\n }\n function setAssoc(key: string, entry: AssociationsEntry): void {\n assocByKey.set(key, entry);\n notifyAssoc(key);\n }\n function setCat(dimension: string, entry: CategoriesEntry): void {\n catByDim.set(dimension, entry);\n notifyCat(dimension);\n }\n function notifyCmt(key: string): void {\n const subs = cmtSubs.get(key);\n if (subs) for (const cb of [...subs]) cb();\n }\n function setCmt(key: string, entry: CommentsEntry): void {\n cmtByKey.set(key, entry);\n notifyCmt(key);\n }\n\n // ── association cache ops (verbatim thunk/reducer behavior) ────────────\n async function load(\n type: string,\n id: string,\n opts: { force?: boolean } = {},\n ): Promise<void> {\n const force = opts.force ?? false;\n if (!type || !id) return;\n const key = associationsKey(type, id);\n const entry = assocByKey.get(key);\n\n if (!force && entry?.status === \"ready\") return;\n const pending = assocInFlight.get(key);\n if (!force && entry?.status === \"loading\" && pending) return pending;\n\n const prev = assocByKey.get(key);\n setAssoc(key, {\n status: \"loading\",\n edges: prev?.edges ?? [],\n fetchedAt: prev?.fetchedAt ?? null,\n // Retain the visible failure while a retry is pending — consumers use\n // status to disable/spin the same retry control.\n error: prev?.error ?? null,\n });\n\n const promise = (async () => {\n try {\n const res = await associations.listForEntity(type, id);\n if (isAssociationsRpcErr(res)) {\n const before = assocByKey.get(key);\n setAssoc(key, {\n status: \"error\",\n edges: before?.edges ?? [],\n fetchedAt: before?.fetchedAt ?? null,\n error: res.error.message,\n });\n } else {\n setAssoc(key, {\n status: \"ready\",\n edges: res.data.edges,\n fetchedAt: Date.now(),\n error: null,\n });\n }\n } finally {\n assocInFlight.delete(key);\n }\n })();\n\n assocInFlight.set(key, promise);\n return promise;\n }\n\n /** Reload both endpoints of an edge so each side's cache is fresh. */\n async function reloadBoth(\n sourceType: string,\n sourceId: string,\n targetType: string,\n targetId: string,\n ): Promise<void> {\n await Promise.all([\n load(sourceType, sourceId, { force: true }),\n load(targetType, targetId, { force: true }),\n ]);\n }\n\n // ── category cache ops (verbatim thunk/reducer behavior) ───────────────\n async function loadCategories(\n dimension: CategoryDimension,\n opts: { force?: boolean } = {},\n ): Promise<void> {\n const force = opts.force ?? false;\n if (!dimension) return;\n const entry = catByDim.get(dimension);\n\n if (!force && entry?.status === \"ready\") return;\n const pending = catInFlight.get(dimension);\n if (!force && entry?.status === \"loading\" && pending) return pending;\n\n const prev = catByDim.get(dimension);\n setCat(dimension, {\n status: \"loading\",\n categories: prev?.categories ?? [],\n fetchedAt: prev?.fetchedAt ?? null,\n error: null,\n });\n\n const promise = (async () => {\n try {\n const res = await categories.list(dimension);\n if (isAssociationsRpcErr(res)) {\n const before = catByDim.get(dimension);\n setCat(dimension, {\n status: \"error\",\n categories: before?.categories ?? [],\n fetchedAt: before?.fetchedAt ?? null,\n error: res.error.message,\n });\n } else {\n setCat(dimension, {\n status: \"ready\",\n categories: res.data.categories,\n fetchedAt: Date.now(),\n error: null,\n });\n }\n } finally {\n catInFlight.delete(dimension);\n }\n })();\n\n catInFlight.set(dimension, promise);\n return promise;\n }\n\n // ── comment-thread cache ops (W6; same lifecycle as associations) ──────\n async function loadComments(\n type: string,\n id: string,\n opts: { force?: boolean } = {},\n ): Promise<void> {\n const force = opts.force ?? false;\n if (!type || !id) return;\n const key = associationsKey(type, id);\n const entry = cmtByKey.get(key);\n\n if (!force && entry?.status === \"ready\") return;\n const pending = cmtInFlight.get(key);\n if (!force && entry?.status === \"loading\" && pending) return pending;\n\n const prev = cmtByKey.get(key);\n setCmt(key, {\n status: \"loading\",\n comments: prev?.comments ?? [],\n fetchedAt: prev?.fetchedAt ?? null,\n // Retain the visible failure while a retry is pending (same contract\n // as the association cache).\n error: prev?.error ?? null,\n });\n\n const promise = (async () => {\n try {\n const res = await comments.listForEntity(type, id);\n if (isAssociationsRpcErr(res)) {\n const before = cmtByKey.get(key);\n setCmt(key, {\n status: \"error\",\n comments: before?.comments ?? [],\n fetchedAt: before?.fetchedAt ?? null,\n error: res.error.message,\n });\n } else {\n setCmt(key, {\n status: \"ready\",\n comments: res.data.comments,\n fetchedAt: Date.now(),\n error: null,\n });\n }\n } finally {\n cmtInFlight.delete(key);\n }\n })();\n\n cmtInFlight.set(key, promise);\n return promise;\n }\n\n return {\n // ── associations ─────────────────────────────────────────────────────\n getEdges(type, id) {\n if (!type || !id) return IDLE_ASSOCIATIONS;\n return assocByKey.get(associationsKey(type, id)) ?? IDLE_ASSOCIATIONS;\n },\n\n load,\n\n subscribe(key, cb) {\n let subs = assocSubs.get(key);\n if (!subs) {\n subs = new Set();\n assocSubs.set(key, subs);\n }\n subs.add(cb);\n return () => {\n subs.delete(cb);\n if (subs.size === 0) assocSubs.delete(key);\n };\n },\n\n async add(args) {\n const res = await associations.add(args);\n if (isAssociationsRpcErr(res)) {\n return { ok: false, error: res.error.message };\n }\n await reloadBoth(\n args.sourceType,\n args.sourceId,\n args.targetType,\n args.targetId,\n );\n return { ok: true, id: res.data.id };\n },\n\n async remove(args) {\n const res = await associations.remove(args);\n if (isAssociationsRpcErr(res)) {\n return { ok: false, error: res.error.message };\n }\n await reloadBoth(\n args.sourceType,\n args.sourceId,\n args.targetType,\n args.targetId,\n );\n return { ok: true };\n },\n\n /**\n * Reloads the SOURCE endpoint only — the one endpoint with a\n * deterministic post-state; each affected target reload would need the\n * full before/after diff, so callers displaying a specific target\n * refresh it via `load(..., { force: true })`.\n */\n async setTargets(args) {\n const res = await associations.setTargets(args);\n if (isAssociationsRpcErr(res)) {\n return { ok: false, error: res.error.message };\n }\n await load(args.sourceType, args.sourceId, { force: true });\n return { ok: true };\n },\n\n invalidate(type, id) {\n const key = associationsKey(type, id);\n if (assocByKey.delete(key)) notifyAssoc(key);\n },\n\n invalidateAll() {\n const assocKeys = [...assocByKey.keys()];\n assocByKey.clear();\n for (const key of assocKeys) notifyAssoc(key);\n const dims = [...catByDim.keys()];\n catByDim.clear();\n for (const dim of dims) notifyCat(dim);\n const cmtKeys = [...cmtByKey.keys()];\n cmtByKey.clear();\n for (const key of cmtKeys) notifyCmt(key);\n },\n\n // ── categories ───────────────────────────────────────────────────────\n getCategories(dimension) {\n if (!dimension) return IDLE_CATEGORIES;\n return catByDim.get(dimension) ?? IDLE_CATEGORIES;\n },\n\n loadCategories,\n\n subscribeCategories(dimension, cb) {\n let subs = catSubs.get(dimension);\n if (!subs) {\n subs = new Set();\n catSubs.set(dimension, subs);\n }\n subs.add(cb);\n return () => {\n subs.delete(cb);\n if (subs.size === 0) catSubs.delete(dimension);\n };\n },\n\n async createCategory(args) {\n const res = await categories.create(args);\n if (isAssociationsRpcErr(res)) {\n return { ok: false, error: res.error.message };\n }\n // Optimistic echo so the new id shows immediately, then force-reload\n // to pick up server-derived fields (slug, position) authoritatively.\n const optimistic: PlatformCategory = {\n id: res.data.id,\n orgId: args.orgId,\n dimension: args.dimension,\n name: args.name,\n slug: args.slug ?? null,\n parentId: args.parentId ?? null,\n isSystem: false,\n color: args.color ?? null,\n icon: args.icon ?? null,\n metadata: null,\n position: null,\n };\n const prev = catByDim.get(args.dimension);\n const existing = prev?.categories ?? [];\n if (!existing.some((c) => c.id === optimistic.id)) {\n setCat(args.dimension, {\n status: \"ready\",\n categories: [...existing, optimistic],\n fetchedAt: prev?.fetchedAt ?? Date.now(),\n error: null,\n });\n }\n await loadCategories(args.dimension, { force: true });\n return { ok: true, id: res.data.id };\n },\n\n async updateCategory(args) {\n const res = await categories.update(args);\n if (isAssociationsRpcErr(res)) {\n return { ok: false, error: res.error.message };\n }\n await loadCategories(args.dimension, { force: true });\n return { ok: true, id: res.data.id };\n },\n\n async reparentCategory(args) {\n const res = await categories.reparent(args);\n if (isAssociationsRpcErr(res)) {\n return { ok: false, error: res.error.message };\n }\n await loadCategories(args.dimension, { force: true });\n return { ok: true, id: res.data.id };\n },\n\n async deleteCategory(args) {\n const res = await categories.delete(args.id);\n if (isAssociationsRpcErr(res)) {\n return { ok: false, error: res.error.message };\n }\n await loadCategories(args.dimension, { force: true });\n return { ok: true, id: res.data.id };\n },\n\n // ── comments (W6) ────────────────────────────────────────────────────\n getComments(type, id) {\n if (!type || !id) return IDLE_COMMENTS;\n return cmtByKey.get(associationsKey(type, id)) ?? IDLE_COMMENTS;\n },\n\n loadComments,\n\n subscribeComments(key, cb) {\n let subs = cmtSubs.get(key);\n if (!subs) {\n subs = new Set();\n cmtSubs.set(key, subs);\n }\n subs.add(cb);\n return () => {\n subs.delete(cb);\n if (subs.size === 0) cmtSubs.delete(key);\n };\n },\n\n async addComment(args) {\n const res = await comments.add(args);\n if (isAssociationsRpcErr(res)) {\n return { ok: false, error: res.error.message };\n }\n await loadComments(args.entityType, args.entityId, { force: true });\n return { ok: true, id: res.data.id };\n },\n\n async editComment(args) {\n const res = await comments.edit(args.id, args.body);\n if (isAssociationsRpcErr(res)) {\n return { ok: false, error: res.error.message };\n }\n await loadComments(args.entityType, args.entityId, { force: true });\n return { ok: true, id: args.id };\n },\n\n async deleteComment(args) {\n const res = await comments.remove(args.id);\n if (isAssociationsRpcErr(res)) {\n return { ok: false, error: res.error.message };\n }\n await loadComments(args.entityType, args.entityId, { force: true });\n return { ok: true, id: args.id };\n },\n\n invalidateComments(type, id) {\n const key = associationsKey(type, id);\n if (cmtByKey.delete(key)) notifyCmt(key);\n },\n\n // ── seams ────────────────────────────────────────────────────────────\n titles,\n favorites,\n candidates,\n entityRows,\n helpers,\n registry,\n services: { associations, categories, comments },\n registerEntityOverlay: registry.registerEntityOverlay,\n errorSink,\n dataSource: config.dataSource,\n identity: config.identity,\n };\n}\n","// react/hooks/useContainerLinks.ts — @ai-matrx/associations/react\n//\n// The READ + WRITE hook for a CONTAINER's associations, from the container's\n// point of view (\"what is attached to this org / scope / project?\").\n//\n// Direction (canonical, consistent with scope-tagging): the resource is the\n// edge SOURCE and the container is the edge TARGET — `task → organization`,\n// `file → scope`. So a container's attached resources are its INCOMING edges.\n//\n// It normally reads through `useAssociations({ type: containerType,\n// id: containerId })` (shared store cache). Conversation file attachments use\n// the viewer-aware `conversation_files` RPC instead: the generic association\n// reader is org-filtered and would omit files for an explicitly shared\n// cross-org conversation. Writes still use the one association chokepoint.\n//\n// Ported signature-byte-compatible from matrx-frontend\n// `features/scopes/hooks/useContainerLinks.ts` (W3, 2026-08-29): thunk\n// dispatches → store writes; `associationsService` singleton → the store's\n// chokepoint service; the host `Json` type → `unknown` at the package\n// boundary (packaging standard's JSON rule).\n\nimport {\n useCallback,\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n} from \"react\";\n\nimport type { AssociationEdge, AssociationTargetType } from \"../../edges\";\nimport type { EntityTypeToken } from \"../../entity-types.generated\";\nimport { isAssociationsRpcErr } from \"../../results\";\nimport type { AssociationWriteResult } from \"../../core/store\";\nimport { useAssociationsStore } from \"../context\";\nimport { useAssociations } from \"./useAssociations\";\n\nexport interface ContainerLink {\n /** The edge id (for keys / removal). */\n edgeId: string;\n /** The attached resource's id (the edge source). */\n resourceId: string;\n /** The attached resource's entity token (the edge source type). */\n token: string;\n /** The edge role, or null for a plain (role-less) association. */\n role: string | null;\n label: string | null;\n /** Per-edge props from `platform.associations.metadata` (e.g. representation). */\n metadata: unknown;\n}\n\nexport interface UseContainerLinksArgs {\n /** The primary entity — always an association TARGET (container). */\n containerType: AssociationTargetType;\n containerId: string | null;\n /** Org to stamp on new edges (for org-scoped RLS / counts). */\n orgId?: string | null;\n}\n\nexport interface UseContainerLinksReturn {\n status: ReturnType<typeof useAssociations>[\"status\"];\n error: string | null;\n reload: () => Promise<void>;\n /** Total attached resources across every token (all incoming edges). */\n totalCount: number;\n /** Live count of attached resources of `token`. */\n countFor: (token: EntityTypeToken) => number;\n /** Ids of resources of `token` already attached (for picker \"attached\" state). */\n attachedIdsFor: (token: EntityTypeToken) => Set<string>;\n /** Full link rows of `token` (for listing/removal). */\n linksFor: (token: EntityTypeToken) => ContainerLink[];\n /** Attach a resource (source) to this container (target). */\n attach: (\n token: EntityTypeToken,\n resourceId: string,\n label?: string,\n metadata?: unknown,\n options?: {\n replaceMetadata?: boolean;\n /**\n * Semantic edge role (`platform.associations.role`) — e.g. the\n * Masterwork dump surface stamps `distillation_source`. Omitted = the\n * canonical role-less edge. Detach with the SAME role to remove it.\n */\n role?: string;\n },\n ) => Promise<AssociationWriteResult>;\n /** Detach a resource from this container. */\n detach: (\n token: EntityTypeToken,\n resourceId: string,\n role?: string,\n ) => Promise<AssociationWriteResult>;\n /**\n * Toggle the edge's agent-context pin while preserving every other metadata\n * field and the exact semantic role.\n */\n setPinned: (\n token: EntityTypeToken,\n resourceId: string,\n pinned: boolean,\n role?: string,\n ) => Promise<AssociationWriteResult>;\n}\n\nfunction metadataRecord(metadata: unknown): Record<string, unknown> | null {\n if (\n metadata === null ||\n typeof metadata !== \"object\" ||\n Array.isArray(metadata)\n ) {\n return metadata == null ? {} : null;\n }\n return Object.fromEntries(Object.entries(metadata));\n}\n\nexport function useContainerLinks(\n args: UseContainerLinksArgs,\n): UseContainerLinksReturn {\n const { containerType, containerId, orgId } = args;\n const store = useAssociationsStore();\n\n const {\n edges,\n status: genericStatus,\n error: genericError,\n reload: reloadGeneric,\n } = useAssociations({\n type: containerType,\n id: containerId,\n });\n\n const conversationKey =\n containerType === \"conversation\" && containerId\n ? `conversation:${containerId}`\n : null;\n const activeConversationKey = useRef<string | null>(conversationKey);\n const conversationGeneration = useRef(0);\n const [conversationResult, setConversationResult] = useState<{\n key: string;\n files: ContainerLink[];\n error: string | null;\n loading: boolean;\n } | null>(null);\n\n useLayoutEffect(() => {\n activeConversationKey.current = conversationKey;\n conversationGeneration.current += 1;\n }, [conversationKey]);\n\n const loadConversationFiles = useCallback(async (): Promise<void> => {\n const key = conversationKey;\n if (!key || !containerId) return;\n // A mutation from the previous conversation may settle after navigation.\n // It must not clear or overwrite the current conversation's inventory.\n if (activeConversationKey.current !== key) return;\n const generation = ++conversationGeneration.current;\n setConversationResult((current) => ({\n key,\n files: current?.key === key ? current.files : [],\n // Keep the visible failure context while retrying so the same control\n // can disable itself and show progress instead of disappearing.\n error: current?.key === key ? current.error : null,\n loading: true,\n }));\n const result =\n await store.services.associations.listConversationFiles(containerId);\n if (\n generation !== conversationGeneration.current ||\n activeConversationKey.current !== key\n ) {\n return;\n }\n if (isAssociationsRpcErr(result)) {\n setConversationResult((current) => ({\n key,\n files: current?.key === key ? current.files : [],\n error: result.error.message,\n loading: false,\n }));\n return;\n }\n setConversationResult({\n key,\n files: result.data.files.map((file) => ({\n edgeId: `conversation-file:${file.fileId}`,\n resourceId: file.fileId,\n token: \"file\",\n role: null,\n label: file.label,\n metadata: file.metadata,\n })),\n error: null,\n loading: false,\n });\n }, [containerId, conversationKey, store]);\n\n useEffect(() => {\n const timeout = setTimeout(() => {\n void loadConversationFiles();\n }, 0);\n return () => clearTimeout(timeout);\n }, [loadConversationFiles]);\n\n const conversationFiles =\n conversationResult?.key === conversationKey ? conversationResult.files : [];\n const conversationFileError =\n conversationResult?.key === conversationKey\n ? conversationResult.error\n : null;\n const conversationFileStatus =\n containerType !== \"conversation\"\n ? \"idle\"\n : conversationResult?.key !== conversationKey\n ? \"loading\"\n : conversationResult.loading\n ? \"loading\"\n : conversationFileError\n ? \"error\"\n : \"ready\";\n\n // A container's attached resources are the edges pointing AT it (incoming).\n // Suppress the generic conversation-file copy because its org-filtered read\n // is intentionally replaced by the viewer-aware dedicated result above.\n const incomingGeneric: ContainerLink[] = edges\n .filter(\n (edge: AssociationEdge) =>\n edge.direction === \"incoming\" &&\n !(containerType === \"conversation\" && edge.otherType === \"file\"),\n )\n .map((edge) => ({\n edgeId: edge.id,\n resourceId: edge.otherId,\n token: edge.otherType,\n role: edge.role ?? null,\n label: edge.label ?? null,\n metadata: edge.metadata ?? {},\n }));\n const incoming =\n containerType === \"conversation\"\n ? [...incomingGeneric, ...conversationFiles]\n : incomingGeneric;\n\n const linksFor = (token: EntityTypeToken): ContainerLink[] =>\n incoming.filter((link) => link.token === token);\n\n const countFor = (token: EntityTypeToken): number =>\n incoming.reduce((n, link) => (link.token === token ? n + 1 : n), 0);\n\n const attachedIdsFor = (token: EntityTypeToken): Set<string> => {\n const set = new Set<string>();\n for (const link of incoming) {\n if (link.token === token) set.add(link.resourceId);\n }\n return set;\n };\n\n const attach = async (\n token: EntityTypeToken,\n resourceId: string,\n label?: string,\n metadata?: unknown,\n options?: { replaceMetadata?: boolean; role?: string },\n ): Promise<AssociationWriteResult> => {\n if (!containerId) return { ok: false, error: \"Missing container id\" };\n const result = await store.add({\n sourceType: token,\n sourceId: resourceId,\n targetType: containerType,\n targetId: containerId,\n ...(orgId != null ? { orgId } : {}),\n ...(label !== undefined ? { label } : {}),\n ...(metadata !== undefined ? { metadata } : {}),\n ...(options?.role !== undefined ? { role: options.role } : {}),\n ...(options?.replaceMetadata !== undefined\n ? { replaceMetadata: options.replaceMetadata }\n : {}),\n });\n if (result.ok && containerType === \"conversation\" && token === \"file\") {\n await loadConversationFiles();\n }\n return result;\n };\n\n const detach = async (\n token: EntityTypeToken,\n resourceId: string,\n role?: string,\n ): Promise<AssociationWriteResult> => {\n if (!containerId) return { ok: false, error: \"Missing container id\" };\n const result = await store.remove({\n sourceType: token,\n sourceId: resourceId,\n targetType: containerType,\n targetId: containerId,\n ...(role !== undefined ? { role } : {}),\n });\n if (result.ok && containerType === \"conversation\" && token === \"file\") {\n await loadConversationFiles();\n }\n return result;\n };\n\n const setPinned = async (\n token: EntityTypeToken,\n resourceId: string,\n pinned: boolean,\n role?: string,\n ): Promise<AssociationWriteResult> => {\n if (!containerId) return { ok: false, error: \"Missing container id\" };\n const exactRole = role ?? null;\n const link = incoming.find(\n (candidate) =>\n candidate.token === token &&\n candidate.resourceId === resourceId &&\n candidate.role === exactRole,\n );\n if (!link) return { ok: false, error: \"Association edge not found\" };\n const currentMetadata = metadataRecord(link.metadata);\n if (!currentMetadata) {\n return {\n ok: false,\n error: \"Association metadata is not an object and cannot be updated safely\",\n };\n }\n return store.add({\n sourceType: token,\n sourceId: resourceId,\n targetType: containerType,\n targetId: containerId,\n ...(orgId != null ? { orgId } : {}),\n ...(link.label != null ? { label: link.label } : {}),\n ...(role !== undefined ? { role } : {}),\n metadata: { ...currentMetadata, pinned },\n });\n };\n\n const reload = async (): Promise<void> => {\n await Promise.all([\n reloadGeneric(),\n containerType === \"conversation\"\n ? loadConversationFiles()\n : Promise.resolve(),\n ]);\n };\n\n const status = !containerId\n ? genericStatus\n : conversationFileStatus === \"error\"\n ? \"error\"\n : containerType === \"conversation\" &&\n (conversationFileStatus === \"idle\" ||\n conversationFileStatus === \"loading\")\n ? \"loading\"\n : genericStatus;\n const error = conversationFileError ?? genericError;\n\n return {\n status,\n error,\n reload,\n totalCount: incoming.length,\n countFor,\n attachedIdsFor,\n linksFor,\n attach,\n detach,\n setPinned,\n };\n}\n","// react/hooks/useEntityTitles.ts — @ai-matrx/associations/react\n//\n// React binding for the entity-title resolver. Give it the (token, id, label)\n// rows a surface is about to render; it returns a resolver that ALWAYS yields\n// a human title — edge label first, fetched title second, `Untitled <type>`\n// last. Fetches are batched per token and memoized in the store's title\n// cache, so re-renders and sibling surfaces are free.\n//\n// `isUnresolved` is the LOUD half: the resolver deliberately omits ids the\n// viewer cannot read (deleted row, or no access), and \"Untitled Note\" for a\n// record that is actually gone reads as a healthy row. A surface that can tell\n// the difference must say so — never render an edge as fine when its target\n// could not be resolved.\n//\n// Ported signature-byte-compatible from matrx-frontend\n// `features/scopes/hooks/useEntityTitles.ts` (W3, 2026-08-29): the module\n// entityTitles service → the store's titles service; registry module →\n// `store.registry`; console.error → the errorSink.\n\nimport { useEffect, useState } from \"react\";\n\nimport { entityTitleCacheKey } from \"../../core/titles\";\nimport { useAssociationsStore } from \"../context\";\n\nexport interface EntityTitleRef {\n token: string;\n id: string;\n /** The edge label (or any already-known title) — wins when present. */\n label?: string | null;\n}\n\nexport interface UseEntityTitlesReturn {\n /** Resolve the display title for one ref (never a UUID). */\n titleFor: (ref: EntityTitleRef) => string;\n /**\n * True when this ref's target could NOT be resolved after a settled fetch —\n * the row is gone or the viewer has no access, and `titleFor` is returning a\n * generic fallback. Surfaces MUST render this loudly (and offer the detach).\n * Always false for tokens with no registered title column (nothing to\n * resolve there — silence is correct, not a failure).\n */\n isUnresolved: (ref: EntityTitleRef) => boolean;\n /** True while any needed titles are still being fetched. */\n loading: boolean;\n}\n\nexport function useEntityTitles(refs: EntityTitleRef[]): UseEntityTitlesReturn {\n const store = useAssociationsStore();\n const [resolved, setResolved] = useState<Record<string, string>>({});\n // Keys we have already asked the resolver for and it has answered. A key that\n // is attempted but absent from `resolved`/cache is genuinely unreachable.\n const [attempted, setAttempted] = useState<Record<string, true>>({});\n const [loading, setLoading] = useState(false);\n\n // The refs that need a fetch.\n //\n // 🚨 A STAMPED LABEL DOES NOT EXEMPT A REF FROM THE READ. That exemption is\n // what made the whole unresolved-target warning inert: a labeled ref was\n // never fetched, so its key never entered `attempted`, so `isUnresolved`\n // below could only ever return false. Verifying that a target still exists\n // IS a live read; the label only decides what we DISPLAY (see `titleFor`).\n //\n // Tokens with no registered title column are still skipped: the resolver was\n // never going to answer for them, and `isUnresolved` returns false for that\n // case by design, so a call would be pure waste.\n // Already-attempted keys are excluded too. A target that does NOT exist never\n // enters the cache, so without this the first fetch resolves the live ones,\n // `needed` shrinks to just the missing ones, the key changes, and they get\n // asked for a second time before settling. One round is enough to prove\n // absence.\n const needed = refs.filter(\n (r) =>\n store.registry.tryGetEntityInfo(r.token)?.titleColumn != null &&\n store.titles.get(r.token, r.id) == null &&\n !attempted[entityTitleCacheKey(r.token, r.id)],\n );\n // Stable dependency for the effect — the set of unresolved keys.\n const neededKey = needed\n .map((r) => entityTitleCacheKey(r.token, r.id))\n .sort()\n .join(\"|\");\n\n useEffect(() => {\n if (!neededKey) return;\n let cancelled = false;\n setLoading(true);\n\n const byToken = new Map<string, string[]>();\n for (const key of neededKey.split(\"|\")) {\n const sep = key.indexOf(\":\");\n const token = key.slice(0, sep);\n const id = key.slice(sep + 1);\n const list = byToken.get(token) ?? [];\n list.push(id);\n byToken.set(token, list);\n }\n\n void Promise.all(\n [...byToken.entries()].map(async ([token, ids]) => {\n const titles = await store.titles.fetch(token, ids);\n return [token, titles] as const;\n }),\n )\n .then((results) => {\n if (cancelled) return;\n setResolved((prev) => {\n const next = { ...prev };\n for (const [token, titles] of results) {\n for (const [id, title] of titles) {\n next[entityTitleCacheKey(token, id)] = title;\n }\n }\n return next;\n });\n })\n .catch((err: unknown) => {\n // A FAILED lookup must still mark the refs attempted, or `loading`\n // sticks on forever and `isUnresolved` stays false — the surface would\n // then show fallback titles with working-looking doors and never admit\n // it couldn't read them. Loud recovery: this is a real failure.\n if (cancelled) return;\n store.errorSink({\n code: \"title_resolution_failed\",\n message: \"Failed to resolve entity titles\",\n context: { detail: err },\n });\n })\n .finally(() => {\n if (cancelled) return;\n setAttempted((prev) => {\n const next = { ...prev };\n for (const key of neededKey.split(\"|\")) next[key] = true;\n return next;\n });\n setLoading(false);\n });\n\n return () => {\n cancelled = true;\n };\n }, [neededKey, store]);\n\n const titleFor = (ref: EntityTitleRef): string => {\n if (ref.label && ref.label.trim()) return ref.label;\n const key = entityTitleCacheKey(ref.token, ref.id);\n return (\n resolved[key] ??\n store.titles.get(ref.token, ref.id) ??\n store.titles.fallback(ref.token)\n );\n };\n\n const isUnresolved = (ref: EntityTitleRef): boolean => {\n // No title column registered → the resolver was never going to answer, so\n // the edge's stamped label is the ONLY source and its absence proves\n // nothing. (`data_store` is the live case: `rag` isn't PostgREST-exposed,\n // which is exactly why those edges must stamp a label at attach time.)\n if (!store.registry.tryGetEntityInfo(ref.token)?.titleColumn) return false;\n\n const key = entityTitleCacheKey(ref.token, ref.id);\n if (resolved[key] || store.titles.get(ref.token, ref.id)) return false;\n\n // A stamped label does NOT clear this. It is a snapshot from attach time,\n // so a deleted or now-inaccessible target still carries a plausible name —\n // and treating that as proof of existence is how a dead reference renders\n // as a normal row with working-looking doors. The live read is the truth;\n // the label is only what we show while saying the target is unreachable.\n return attempted[key] === true;\n };\n\n return { titleFor, isUnresolved, loading };\n}\n","// react/hooks/useCategories.ts — @ai-matrx/associations/react\n//\n// Public hook for the canonical faceted taxonomy (`platform.categories`) — the\n// one primitive any UI consumes to read and manage categories for a facet\n// (`dimension`). The sibling of `useAssociations`: that hook owns an entity's\n// assignment EDGES, this hook owns the category NOUNS for a dimension.\n//\n// Ported signature-byte-compatible from matrx-frontend\n// `features/scopes/hooks/useCategories.ts` (W3, 2026-08-29): the Redux\n// selector/thunk cache becomes the package store's category facets ridden via\n// `useSyncExternalStore`. ASSIGNING a category to an entity is a separate\n// concern — use `useAssociations(...).add({ targetType: 'category' })`.\n\nimport { useEffect, useRef, useSyncExternalStore } from \"react\";\n\nimport type {\n CategoriesEntry,\n CategoryDimension,\n PlatformCategory,\n} from \"../../edges\";\nimport type { CategoryMutationResult } from \"../../core/store\";\nimport { useAssociationsStore } from \"../context\";\n\n/** Same shape as a mutation result; the create carries the new id. */\nexport type CategoryCreateResult = CategoryMutationResult;\nexport type { CategoryMutationResult };\n\nexport interface UseCategoriesArgs {\n /** The facet to read/manage (`agent-shortcut`, `skill`, `industry`, …). */\n dimension: CategoryDimension | null;\n /** Disable the auto-load on mount. Defaults to false (auto-load). */\n autoLoad?: boolean;\n}\n\nexport interface UseCategoriesReturn {\n /** Every category visible to the caller in this facet (system + their orgs). */\n categories: PlatformCategory[];\n status: CategoriesEntry[\"status\"];\n error: string | null;\n fetchedAt: number | null;\n /** Create an org category in this facet. Returns the new id on success. */\n create: (args: {\n name: string;\n orgId: string;\n parentId?: string | null;\n color?: string | null;\n icon?: string | null;\n slug?: string | null;\n }) => Promise<CategoryCreateResult>;\n /** Replace one category's editable scalar fields. */\n update: (args: {\n id: string;\n name: string;\n slug: string | null;\n color: string | null;\n icon: string | null;\n position: number | null;\n }) => Promise<CategoryMutationResult>;\n /** Move a category to the root or directly under a root category. */\n reparent: (\n id: string,\n parentId: string | null,\n ) => Promise<CategoryMutationResult>;\n /** Soft-delete a leaf category. */\n remove: (id: string) => Promise<CategoryMutationResult>;\n /** Force a refetch of this facet's categories. */\n reload: () => Promise<void>;\n}\n\nconst noopSubscribe = () => () => {};\n\nexport function useCategories(args: UseCategoriesArgs): UseCategoriesReturn {\n const { dimension, autoLoad = true } = args;\n const store = useAssociationsStore();\n\n const entry = useSyncExternalStore(\n dimension\n ? (cb) => store.subscribeCategories(dimension, cb)\n : noopSubscribe,\n () => store.getCategories(dimension ?? \"\"),\n () => store.getCategories(dimension ?? \"\"),\n );\n\n const loadedKey = useRef<string | null>(null);\n useEffect(() => {\n if (!autoLoad || !dimension) return;\n if (loadedKey.current === dimension) return;\n loadedKey.current = dimension;\n void store.loadCategories(dimension);\n }, [autoLoad, store, dimension]);\n\n return {\n categories: entry.categories,\n status: entry.status,\n error: entry.error,\n fetchedAt: entry.fetchedAt,\n create: async ({ name, orgId, parentId, color, icon, slug }) => {\n if (!dimension) return { ok: false, error: \"Missing dimension\" };\n return store.createCategory({\n dimension,\n name,\n orgId,\n ...(parentId !== undefined ? { parentId } : {}),\n ...(color !== undefined ? { color } : {}),\n ...(icon !== undefined ? { icon } : {}),\n ...(slug !== undefined ? { slug } : {}),\n });\n },\n update: async ({ id, name, slug, color, icon, position }) => {\n if (!dimension) return { ok: false, error: \"Missing dimension\" };\n return store.updateCategory({\n dimension,\n id,\n name,\n slug,\n color,\n icon,\n position,\n });\n },\n reparent: async (id, parentId) => {\n if (!dimension) return { ok: false, error: \"Missing dimension\" };\n return store.reparentCategory({ dimension, id, parentId });\n },\n remove: async (id) => {\n if (!dimension) return { ok: false, error: \"Missing dimension\" };\n return store.deleteCategory({ dimension, id });\n },\n reload: async () => {\n if (!dimension) return;\n await store.loadCategories(dimension, { force: true });\n },\n };\n}\n","// react/hooks/useUniversalEntitySearch.ts — @ai-matrx/associations/react\n//\n// ONE search box over EVERY listable entity type — the hook behind the\n// universal association picker. Debounced, stale-guarded, registry-driven\n// (new tokens join with zero code here).\n//\n// Empty query → RECENTS: the caller's `platform.user_entity_state` rows\n// (`ues_list`, one RPC) sorted by last-viewed, filtered to the searched\n// tokens, titles resolved through the store's title service.\n//\n// Ported signature-byte-compatible from matrx-frontend\n// `features/scopes/hooks/useUniversalEntitySearch.ts` (W3, 2026-08-29):\n// module services → the store's candidates/favorites/titles services;\n// registry module → `store.registry`.\n\nimport { useEffect, useRef, useState } from \"react\";\n\nimport {\n isEntityTypeToken,\n type EntityTypeToken,\n} from \"../../entity-types.generated\";\nimport type { UniversalCandidate } from \"../../core/candidates\";\nimport type { AssociationsStore } from \"../../core/store\";\nimport { useAssociationsStore } from \"../context\";\n\nconst DEBOUNCE_MS = 250;\nconst RECENTS_LIMIT = 12;\n\nexport type { UniversalCandidate };\n\nexport interface UseUniversalEntitySearchArgs {\n query: string;\n /** Restrict to these tokens; defaults to every listable token. */\n tokens?: EntityTypeToken[];\n /** Owner filter for the per-token candidate reads. */\n ownerId?: string | null;\n enabled?: boolean;\n perTokenLimit?: number;\n /**\n * What an empty query loads. Universal attach surfaces default to recents;\n * constrained value pickers use candidates so opening the picker immediately\n * shows the records that are available to select.\n */\n emptyQueryMode?: \"recents\" | \"candidates\";\n}\n\nexport interface UseUniversalEntitySearchReturn {\n results: UniversalCandidate[];\n /** True while the current query's sweep is in flight. */\n loading: boolean;\n /** True when `results` are recents (empty query), not search hits. */\n isRecents: boolean;\n}\n\nexport function useUniversalEntitySearch(\n args: UseUniversalEntitySearchArgs,\n): UseUniversalEntitySearchReturn {\n const {\n query,\n tokens,\n ownerId,\n enabled = true,\n perTokenLimit = 5,\n emptyQueryMode = \"recents\",\n } = args;\n const store = useAssociationsStore();\n const [results, setResults] = useState<UniversalCandidate[]>([]);\n const [loading, setLoading] = useState(false);\n const [isRecents, setIsRecents] = useState(true);\n const runRef = useRef(0);\n const tokensKey = (tokens ?? []).join(\",\");\n\n useEffect(() => {\n if (!enabled) return;\n const run = ++runRef.current;\n const trimmed = query.trim();\n\n const timer = setTimeout(async () => {\n if (runRef.current !== run) return;\n setLoading(true);\n const activeTokens = tokensKey\n ? (tokensKey.split(\",\") as EntityTypeToken[])\n : store.registry.listableTokens();\n\n let next: UniversalCandidate[] = [];\n if (trimmed || emptyQueryMode === \"candidates\") {\n next = await store.candidates.searchCandidatesAcrossTokens({\n tokens: activeTokens,\n search: trimmed,\n ownerId: ownerId ?? null,\n perTokenLimit,\n });\n } else {\n next = await loadRecents(store, activeTokens);\n }\n if (runRef.current !== run) return; // stale response — drop\n setResults(next);\n setIsRecents(!trimmed && emptyQueryMode === \"recents\");\n setLoading(false);\n }, DEBOUNCE_MS);\n\n return () => clearTimeout(timer);\n }, [query, tokensKey, ownerId, enabled, perTokenLimit, emptyQueryMode, store]);\n\n return { results, loading, isRecents };\n}\n\n/**\n * Favorited and recently-touched entities of the searched tokens, titles\n * resolved. A favorite is itself an explicit user choice and must surface even\n * before another route has stamped `last_viewed_at`; otherwise favoriting a\n * never-opened entity writes successfully but the universal picker silently\n * drops it. Favorites sort ahead of ordinary recents, then by view recency.\n */\nasync function loadRecents(\n store: AssociationsStore,\n tokens: EntityTypeToken[],\n): Promise<UniversalCandidate[]> {\n const res = await store.favorites.list();\n if (!res.ok) return [];\n const tokenSet = new Set<string>(tokens);\n const rows = res.data.items\n .filter(\n (i) =>\n tokenSet.has(i.entityType) &&\n isEntityTypeToken(i.entityType) &&\n (i.isFavorite || i.lastViewedAt),\n )\n .sort((a, b) => {\n if (a.isFavorite !== b.isFavorite) return a.isFavorite ? -1 : 1;\n return (b.lastViewedAt ?? \"\").localeCompare(a.lastViewedAt ?? \"\");\n })\n .slice(0, RECENTS_LIMIT);\n if (rows.length === 0) return [];\n\n // Resolve titles per token (batched, cached).\n const byToken = new Map<string, string[]>();\n for (const r of rows) {\n const list = byToken.get(r.entityType) ?? [];\n list.push(r.entityId);\n byToken.set(r.entityType, list);\n }\n const titles = new Map<string, Map<string, string>>();\n await Promise.all(\n [...byToken.entries()].map(async ([token, ids]) => {\n titles.set(token, await store.titles.fetch(token, ids));\n }),\n );\n\n const out: UniversalCandidate[] = [];\n for (const r of rows) {\n const title = titles.get(r.entityType)?.get(r.entityId);\n if (!title) continue; // deleted / inaccessible / no title column\n out.push({\n token: r.entityType as EntityTypeToken,\n id: r.entityId,\n title,\n });\n }\n return out;\n}\n","// react/hooks/useAssociationCandidates.ts — @ai-matrx/associations/react\n//\n// State wrapper around the store's candidate reader — the picker's data\n// source. One-shot fetch on mount/param-change; re-runs on `reload()` or\n// search change. All querying logic lives in the /core service; this just\n// owns loading/error state.\n//\n// Ported signature-byte-compatible from matrx-frontend\n// `features/scopes/hooks/useAssociationCandidates.ts` (W3, 2026-08-29). One\n// seam inverted: the Redux `selectUserId` read becomes the identity port —\n// read leniently here (null when unauthenticated) because `ownerId` is a\n// candidate-read FILTER, not an auth gate; the RPC enforces visibility\n// regardless.\n\nimport { useEffect, useState } from \"react\";\n\nimport type { EntityTypeToken } from \"../../entity-types.generated\";\nimport type { CandidateRecord } from \"../../core/candidates\";\nimport { useAssociationsStore } from \"../context\";\n\nexport type { CandidateRecord };\n\nexport interface UseAssociationCandidatesArgs {\n token: EntityTypeToken;\n /** Skip fetching (e.g. while the picker is closed). Defaults to true. */\n enabled?: boolean;\n search?: string;\n limit?: number;\n}\n\nexport interface UseAssociationCandidatesReturn {\n candidates: CandidateRecord[];\n loading: boolean;\n error: string | null;\n reload: () => void;\n}\n\nexport function useAssociationCandidates(\n args: UseAssociationCandidatesArgs,\n): UseAssociationCandidatesReturn {\n const { token, enabled = true, search, limit } = args;\n const store = useAssociationsStore();\n const userId = currentUserIdOrNull(store);\n const [candidates, setCandidates] = useState<CandidateRecord[]>([]);\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<string | null>(null);\n const [tick, setTick] = useState(0);\n\n useEffect(() => {\n if (!enabled) return undefined;\n let cancelled = false;\n void (async () => {\n setLoading(true);\n setError(null);\n const res = await store.candidates.listAssociationCandidates({\n token,\n ownerId: userId,\n ...(search !== undefined ? { search } : {}),\n ...(limit !== undefined ? { limit } : {}),\n });\n if (cancelled) return;\n if (res.ok) {\n setCandidates(res.data);\n } else {\n setError(res.error);\n setCandidates([]);\n }\n setLoading(false);\n })();\n return () => {\n cancelled = true;\n };\n }, [token, enabled, userId, search, limit, tick, store]);\n\n return {\n candidates,\n loading,\n error,\n reload: () => setTick((t) => t + 1),\n };\n}\n\n/**\n * Lenient identity read for candidate-list filtering: `requireUserId` throws\n * when unauthenticated (its contract), but an anonymous candidate read is a\n * legitimate empty state (RLS answers), so the filter degrades to null\n * rather than crashing the picker. Write paths keep the loud contract.\n */\nfunction currentUserIdOrNull(store: {\n identity: { requireUserId(): string };\n}): string | null {\n try {\n return store.identity.requireUserId();\n } catch {\n return null;\n }\n}\n","// react/hooks/useComments.ts — @ai-matrx/associations/react\n//\n// Public hook for the unified comments primitive (`platform.comments`, W6) —\n// the one thread of comments on any entity (`token` + `id`), ridden off the\n// /core store's comment-thread cache via `useSyncExternalStore` (the same\n// lifecycle as `useAssociations`). All comments come back flat,\n// oldest→newest; build the tree from each row's `parentId` (the\n// `CommentThread` face does exactly that).\n//\n// Identity: writes go through the services, where `requireUserId` failures\n// stay LOUD; `currentUserId` is the LENIENT read the UI uses to gate\n// edit/delete-own affordances (unauthenticated → null → no own-comment\n// affordances, never a crash).\n\nimport { useEffect, useRef, useSyncExternalStore } from \"react\";\n\nimport type { CommentsEntry, PlatformComment } from \"../../comments\";\nimport { associationsKey, type CommentMutationResult } from \"../../core/store\";\nimport { useAssociationsStore } from \"../context\";\n\nexport interface UseCommentsArgs {\n /** Entity-type token of the commented-on entity (writes-strict, C18). */\n token: string;\n /** The entity's row id; null renders the idle entry and loads nothing. */\n id: string | null;\n /** Disable the auto-load on mount. Defaults to false (auto-load). */\n autoLoad?: boolean;\n}\n\nexport interface UseCommentsReturn {\n /** Every comment on the entity, flat, oldest→newest (thread by parentId). */\n comments: readonly PlatformComment[];\n status: CommentsEntry[\"status\"];\n error: string | null;\n fetchedAt: number | null;\n /** Post a comment; pass `parentId` to reply. Reloads the thread. */\n add(\n body: string,\n opts?: { parentId?: string | null; orgId?: string | null },\n ): Promise<CommentMutationResult>;\n /** Edit a comment body (author-only in the RPC). Reloads the thread. */\n edit(commentId: string, body: string): Promise<CommentMutationResult>;\n /** Soft-delete a comment (author/org member in the RPC). Reloads. */\n remove(commentId: string): Promise<CommentMutationResult>;\n /** Force a refetch of the thread. */\n reload(): Promise<void>;\n /** Lenient identity read for edit/delete-own gating; null when signed out. */\n currentUserId: string | null;\n}\n\nconst noopSubscribe = () => () => {};\n\nexport function useComments(args: UseCommentsArgs): UseCommentsReturn {\n const { token, id, autoLoad = true } = args;\n const store = useAssociationsStore();\n const key = token && id ? associationsKey(token, id) : null;\n\n const entry = useSyncExternalStore(\n key ? (cb) => store.subscribeComments(key, cb) : noopSubscribe,\n () => store.getComments(token, id ?? \"\"),\n () => store.getComments(token, id ?? \"\"),\n );\n\n const loadedKey = useRef<string | null>(null);\n useEffect(() => {\n if (!autoLoad || !key || !id) return;\n if (loadedKey.current === key) return;\n loadedKey.current = key;\n void store.loadComments(token, id);\n }, [autoLoad, store, key, token, id]);\n\n let currentUserId: string | null = null;\n try {\n currentUserId = store.identity.requireUserId();\n } catch {\n currentUserId = null;\n }\n\n return {\n comments: entry.comments,\n status: entry.status,\n error: entry.error,\n fetchedAt: entry.fetchedAt,\n add: async (body, opts) => {\n if (!id) return { ok: false, error: \"Missing entity id\" };\n return store.addComment({\n entityType: token,\n entityId: id,\n body,\n ...(opts?.parentId !== undefined ? { parentId: opts.parentId } : {}),\n ...(opts?.orgId !== undefined ? { orgId: opts.orgId } : {}),\n });\n },\n edit: async (commentId, body) => {\n if (!id) return { ok: false, error: \"Missing entity id\" };\n return store.editComment({\n entityType: token,\n entityId: id,\n id: commentId,\n body,\n });\n },\n remove: async (commentId) => {\n if (!id) return { ok: false, error: \"Missing entity id\" };\n return store.deleteComment({\n entityType: token,\n entityId: id,\n id: commentId,\n });\n },\n reload: async () => {\n if (!id) return;\n await store.loadComments(token, id, { force: true });\n },\n currentUserId,\n };\n}\n","// react/hooks/useAssociationEntitySelect.ts — @ai-matrx/associations/react\n//\n// Default AssociationEntitySelectAdapter for a plain platform.associations\n// container: items from the container's incoming edges of one token (titles\n// via the edge label / entity-title resolver), create via the generic\n// registry-driven row insert + attach, rename via the generic titleColumn\n// update, detach via the container-links hook.\n//\n// \"Active\" has no meaning on a bare association edge, so the caller owns it\n// (controlled `activeId` + `onActiveChange`); when uncontrolled it falls back\n// to the first attached entity. Surfaces with their OWN active semantics\n// (war-room's is_active edge metadata) implement the adapter themselves\n// instead of using this hook.\n//\n// Ported signature-byte-compatible from matrx-frontend\n// `features/scopes/hooks/useAssociationEntitySelect.ts` (W3, 2026-08-29):\n// `@/lib/toast` → the notifier port (warn-once degradation), console.error →\n// the errorSink, entityRows service module → the store's entityRows service.\n//\n// The `AssociationEntitySelectAdapter` CONTRACT lives here with the hook: it\n// is the read/write seam of the `AssociationEntitySelect` face (W4 — the\n// face itself is gated on a design-system Command/combobox primitive; the\n// adapter contract and this default implementation are not).\n\nimport { useState } from \"react\";\n\nimport type { AssociationTargetType } from \"../../edges\";\nimport type { EntityTypeToken } from \"../../entity-types.generated\";\nimport { useAssociationsStore, useNotifier } from \"../context\";\nimport { useContainerLinks } from \"./useContainerLinks\";\nimport { useEntityTitles } from \"./useEntityTitles\";\n\nexport interface AssociationEntitySelectItem {\n id: string;\n title: string;\n}\n\n/**\n * The read/write seam of the association \"name dropdown\". This hook is the\n * default (plain associations container); surfaces with bespoke active/create\n * semantics implement it themselves — same pattern as AssociationList's\n * ContainerResourcesAdapter.\n */\nexport interface AssociationEntitySelectAdapter {\n /** True while the association list is still hydrating. */\n loading: boolean;\n /** Every entity of this token associated with the container. */\n items: AssociationEntitySelectItem[];\n activeId: string | null;\n setActive: (id: string) => void | Promise<unknown>;\n /**\n * Create a new entity named `title`, associate it to the container, and\n * make it active. Resolves to the new id, or null on failure (the adapter\n * reports its own error detail; the component toasts generically).\n * Omit when creation isn't name-driven — pass `createSlot` on the component\n * instead (e.g. a conversation is created by PICKING AN AGENT, not naming).\n */\n createAndAttach?: (title: string) => Promise<string | null>;\n /** Rename the entity (its real title column). Resolves false on failure. */\n rename: (id: string, title: string) => Promise<boolean>;\n /** Optional: unlink an entity from the container (never deletes the row). */\n detach?: (id: string) => Promise<unknown>;\n}\n\nexport interface UseAssociationEntitySelectAdapterArgs {\n token: EntityTypeToken;\n /** The container the entities are associated with (always the edge TARGET). */\n container: {\n type: AssociationTargetType;\n id: string | null;\n orgId?: string | null;\n };\n /** Controlled active selection; omit to default to the first attached row. */\n activeId?: string | null;\n onActiveChange?: (id: string) => void | Promise<unknown>;\n /** NOT NULL columns the registry conventions can't know (create only). */\n createColumns?: Record<string, unknown>;\n}\n\nexport function useAssociationEntitySelectAdapter(\n args: UseAssociationEntitySelectAdapterArgs,\n): AssociationEntitySelectAdapter {\n const { token, container, activeId, onActiveChange, createColumns } = args;\n const store = useAssociationsStore();\n const notifier = useNotifier();\n const links = useContainerLinks({\n containerType: container.type,\n containerId: container.id,\n orgId: container.orgId ?? null,\n });\n const rows = links.linksFor(token);\n const { titleFor } = useEntityTitles(\n rows.map((r) => ({ token, id: r.resourceId, label: r.label })),\n );\n // Rename/create wins over the (attach-time) edge label until a refetch.\n const [titleOverrides, setTitleOverrides] = useState<Record<string, string>>(\n {},\n );\n // Uncontrolled fallback selection (used only when the caller passes no\n // activeId — a bare edge has no active flag to persist).\n const [localActiveId, setLocalActiveId] = useState<string | null>(null);\n\n const items = rows.map((r) => ({\n id: r.resourceId,\n title:\n titleOverrides[r.resourceId] ??\n titleFor({ token, id: r.resourceId, label: r.label }),\n }));\n\n const controlled = activeId !== undefined;\n const resolvedActive = controlled ? activeId : localActiveId;\n const effectiveActive =\n resolvedActive && items.some((i) => i.id === resolvedActive)\n ? resolvedActive\n : (items[0]?.id ?? null);\n\n const setActive = (id: string) => {\n if (!controlled) setLocalActiveId(id);\n return onActiveChange?.(id);\n };\n\n return {\n loading: links.status === \"loading\" || links.status === \"idle\",\n items,\n activeId: effectiveActive,\n setActive,\n createAndAttach: async (title) => {\n // CREATE first (durable row), ASSOCIATE second (idempotent edge).\n const created = await store.entityRows.createEntityRow(token, {\n title,\n orgId: container.orgId ?? null,\n ...(createColumns !== undefined ? { extraColumns: createColumns } : {}),\n });\n // Create-failure surfaces via the component's generic toast (null\n // return); entityRows already screams the DB detail to the sink.\n if (!created.ok) return null;\n let attached = await links.attach(token, created.data.id, title);\n if (!attached.ok) {\n // The row EXISTS — retry the idempotent edge once, then say exactly\n // what happened. A created-but-unlinked item must never look like a\n // failed create (the row would silently \"disappear\").\n attached = await links.attach(token, created.data.id, title);\n }\n if (!attached.ok) {\n store.errorSink({\n code: \"created_but_attach_failed\",\n message:\n \"[useAssociationEntitySelectAdapter] created but attach failed\",\n context: {\n token,\n id: created.data.id,\n error: attached.error,\n },\n });\n notifier.error(\n `Created \"${title}\" but couldn't link it here — it exists in your library`,\n );\n return null;\n }\n setTitleOverrides((prev) => ({ ...prev, [created.data.id]: title }));\n await setActive(created.data.id);\n return created.data.id;\n },\n rename: async (id, title) => {\n const res = await store.entityRows.renameEntityRow(token, id, title);\n if (res.ok) setTitleOverrides((prev) => ({ ...prev, [id]: title.trim() }));\n return res.ok;\n },\n detach: (id) => links.detach(token, id),\n };\n}\n","// react/components/PrimaryEntityContext.tsx — @ai-matrx/associations/react\n//\n// The page-context bridge for association cards. A page that owns a container\n// entity (an org page, a scope page, a project page) wraps its content once:\n//\n// <PrimaryEntityProvider value={{ type: \"organization\", id: orgId, orgId }}>\n// <AssociationCard token=\"task\" />\n// <AssociationCard token=\"file\" />\n// </PrimaryEntityProvider>\n//\n// and every <AssociationCard> inside resolves its primary entity automatically —\n// no prop drilling. A card may still override with an explicit `container` prop.\n//\n// Ported verbatim from matrx-frontend\n// `features/scopes/components/associations/PrimaryEntityContext.tsx` (W4,\n// 2026-08-29).\n\nimport { createContext, useContext, type ReactNode } from \"react\";\n\nimport type { AssociationTargetType } from \"../../edges\";\n\n/** The primary (container) entity a surface is anchored to. */\nexport interface PrimaryEntity {\n /** Container token — must be an association TARGET type. */\n type: AssociationTargetType;\n id: string;\n /** Org to stamp on edges created here (org-scoped RLS / counts). */\n orgId?: string | null;\n /** Human label for headings (e.g. the org/scope name). */\n label?: string;\n}\n\nconst PrimaryEntityCtx = createContext<PrimaryEntity | null>(null);\n\nexport function PrimaryEntityProvider({\n value,\n children,\n}: {\n value: PrimaryEntity;\n children: ReactNode;\n}) {\n return (\n <PrimaryEntityCtx.Provider value={value}>\n {children}\n </PrimaryEntityCtx.Provider>\n );\n}\n\n/** Read the surrounding primary entity, or null when unprovided. */\nexport function usePrimaryEntity(): PrimaryEntity | null {\n return useContext(PrimaryEntityCtx);\n}\n","// react/components/AssociationWindow.tsx — @ai-matrx/associations/react\n//\n// The non-blocking shell for association surfaces. Ported from matrx-frontend\n// `features/scopes/components/associations/AssociationWindow.tsx` (W4,\n// 2026-08-29) with the measured seam inverted: the `WindowPanel` import\n// becomes the OPTIONAL `windowShell` port.\n//\n// • windowShell absent → `DefaultWindowShell`, the package's OWN real\n// window (0.6.0, C23): draggable, resizable, maximizable, viewport-\n// clamped, portalled, non-modal, mobile bottom-card. NOT a degradation —\n// the shipped default. A host needs no window system to get one.\n// • windowShell bound → the host's window renders the surface instead\n// (matrx-frontend binds `WindowPanel` for tray docking + workspace\n// persistence, which are app identity the package cannot own).\n\nimport { useId, type ReactNode } from \"react\";\n\nimport { useAssociationsUiPorts } from \"../context\";\nimport { DefaultWindowShell } from \"./DefaultWindowShell\";\n\nexport interface AssociationWindowProps {\n /** Controls mount — callers should also gate their JSX on this. */\n open: boolean;\n onClose: () => void;\n /** Human-readable scope for the window id (debugging / tray labels). */\n scopeId: string;\n title: string;\n /** Small leading icon rendered beside the title. */\n icon?: ReactNode;\n /**\n * One-line context under the header (\"Attached to Titanium Marketing\").\n * A node, not a string, so the container it names can carry its own door\n * (THE DOOR LAW) instead of being an unreachable label.\n */\n subtitle?: ReactNode;\n children: ReactNode;\n}\n\nexport function AssociationWindow({\n open,\n onClose,\n scopeId,\n title,\n icon,\n subtitle,\n children,\n}: AssociationWindowProps) {\n // Unique per mounted instance — two shells sharing an id fight over one\n // host window-registry entry and the first unmount kills drag for the\n // survivor.\n const instanceId = useId();\n const { windowShell } = useAssociationsUiPorts();\n\n if (!open) return null;\n\n const body = (\n <div className=\"flex h-full min-h-0 flex-col gap-2 p-3\">\n {/* A <div>, not a <p>: `subtitle` is a node and may carry an entity ref\n whose peek renders block content. */}\n {subtitle ? (\n <div className=\"shrink-0 text-xs text-muted-foreground\">{subtitle}</div>\n ) : null}\n {children}\n </div>\n );\n\n const windowId = `association:${scopeId}:${instanceId}`;\n\n if (windowShell) {\n const HostWindow = windowShell.Window;\n return (\n <HostWindow id={windowId} title={title} onClose={onClose}>\n {body}\n </HostWindow>\n );\n }\n\n return (\n <DefaultWindowShell\n id={windowId}\n title={title}\n onClose={onClose}\n {...(icon !== undefined ? { icon } : {})}\n >\n {body}\n </DefaultWindowShell>\n );\n}\n\nexport default AssociationWindow;\n","// react/components/DefaultWindowShell.tsx — @ai-matrx/associations/react\n//\n// THE package's shipped default for the `windowShell` port (C23: every port\n// ships a working default; hosts override, they never have to fill).\n//\n// Before 0.6.0 the absent-port path was a DEGRADATION — a fixed, centred,\n// non-draggable card. That failed THE ALL-INCLUSIVE LAW: a host that wants a\n// real window had to build one. This IS a real window:\n//\n// • drag by the header (pointer events — mouse, pen and touch alike),\n// • resize from the bottom-right grip, honouring min sizes,\n// • maximize / restore toggle,\n// • clamped to the viewport on drag, on resize, and on window resize —\n// a window can never be dragged somewhere it cannot be dragged back from,\n// • NON-MODAL: no backdrop, the page behind stays fully interactive\n// (the pre-extraction AssociationWindow contract),\n// • Escape closes; the panel takes focus on mount and is labelled for\n// screen readers (`role=\"dialog\"` + `aria-label`),\n// • portalled to <body> so a transformed ancestor cannot clip it (the\n// classic `position: fixed` trap),\n// • under 640px it presents as a full-width bottom card — drag/resize are\n// pointless on a phone and the grip is hidden rather than left inert.\n//\n// What it deliberately does NOT do: dock to a tray, persist across reloads,\n// or take part in an app-wide window manager. Those are app identity — a\n// host with a window manager (matrx-frontend's `WindowPanel`) binds the\n// `windowShell` port and this shell steps aside.\n\nimport {\n useCallback,\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n type CSSProperties,\n type PointerEvent as ReactPointerEvent,\n type ReactNode,\n} from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { cn } from \"@ai-matrx/design-system\";\n\nimport { GripResizeIcon, MaximizeIcon, RestoreIcon, XIcon } from \"../icons\";\n\nconst DEFAULT_WIDTH = 440;\nconst DEFAULT_HEIGHT = 580;\nconst MIN_WIDTH = 330;\nconst MIN_HEIGHT = 380;\nconst MOBILE_MAX_WIDTH = 640;\n/** Never let the whole header slide off-screen — keep a grab strip visible. */\nconst EDGE_KEEP = 48;\n\ninterface Rect {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\nexport interface DefaultWindowShellProps {\n /** Stable id — used for the accessible label association only. */\n id: string;\n title: string;\n onClose: () => void;\n /** Small leading glyph beside the title. */\n icon?: ReactNode;\n children: ReactNode;\n className?: string;\n}\n\nfunction viewport(): { width: number; height: number } {\n if (typeof window === \"undefined\") {\n return { width: DEFAULT_WIDTH, height: DEFAULT_HEIGHT };\n }\n return { width: window.innerWidth, height: window.innerHeight };\n}\n\nfunction clamp(rect: Rect): Rect {\n const { width: vw, height: vh } = viewport();\n const width = Math.min(Math.max(rect.width, MIN_WIDTH), Math.max(vw, MIN_WIDTH));\n const height = Math.min(\n Math.max(rect.height, MIN_HEIGHT),\n Math.max(vh, MIN_HEIGHT),\n );\n return {\n width,\n height,\n x: Math.min(Math.max(rect.x, EDGE_KEEP - width), Math.max(vw - EDGE_KEEP, 0)),\n y: Math.min(Math.max(rect.y, 0), Math.max(vh - EDGE_KEEP, 0)),\n };\n}\n\nfunction centred(): Rect {\n const { width: vw, height: vh } = viewport();\n const width = Math.min(DEFAULT_WIDTH, Math.max(vw - 32, MIN_WIDTH));\n const height = Math.min(DEFAULT_HEIGHT, Math.max(vh - 32, MIN_HEIGHT));\n return clamp({\n width,\n height,\n x: Math.round((vw - width) / 2),\n y: Math.round((vh - height) / 2),\n });\n}\n\nexport function DefaultWindowShell({\n id,\n title,\n onClose,\n icon,\n children,\n className,\n}: DefaultWindowShellProps) {\n const panelRef = useRef<HTMLDivElement | null>(null);\n const [mounted, setMounted] = useState(false);\n const [isMobile, setIsMobile] = useState(false);\n const [rect, setRect] = useState<Rect>(() => centred());\n const [maximized, setMaximized] = useState(false);\n // The gesture in flight: which handle grabbed, and the pointer/rect origin.\n const gesture = useRef<{\n mode: \"move\" | \"resize\";\n pointerId: number;\n startX: number;\n startY: number;\n origin: Rect;\n } | null>(null);\n\n // SSR safety: the portal target only exists in the browser. Rendering\n // nothing on the server is correct — this shell is opened by a user\n // gesture, so it is never part of first paint.\n useLayoutEffect(() => {\n setMounted(true);\n setIsMobile(window.innerWidth < MOBILE_MAX_WIDTH);\n setRect(centred());\n }, []);\n\n // Viewport changes (rotate, resize, keyboard) re-clamp — a window must\n // never end up unreachable because the viewport shrank under it.\n useEffect(() => {\n if (!mounted) return;\n const onResize = () => {\n setIsMobile(window.innerWidth < MOBILE_MAX_WIDTH);\n setRect((current) => clamp(current));\n };\n window.addEventListener(\"resize\", onResize);\n return () => window.removeEventListener(\"resize\", onResize);\n }, [mounted]);\n\n useEffect(() => {\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.key === \"Escape\") onClose();\n };\n window.addEventListener(\"keydown\", onKeyDown);\n return () => window.removeEventListener(\"keydown\", onKeyDown);\n }, [onClose]);\n\n useEffect(() => {\n panelRef.current?.focus({ preventScroll: true });\n }, [mounted]);\n\n const beginGesture = useCallback(\n (mode: \"move\" | \"resize\") => (event: ReactPointerEvent<HTMLElement>) => {\n if (isMobile || maximized || event.button !== 0) return;\n event.preventDefault();\n event.currentTarget.setPointerCapture(event.pointerId);\n gesture.current = {\n mode,\n pointerId: event.pointerId,\n startX: event.clientX,\n startY: event.clientY,\n origin: rect,\n };\n },\n [isMobile, maximized, rect],\n );\n\n const onPointerMove = useCallback((event: ReactPointerEvent<HTMLElement>) => {\n const active = gesture.current;\n if (!active || active.pointerId !== event.pointerId) return;\n const dx = event.clientX - active.startX;\n const dy = event.clientY - active.startY;\n setRect(\n clamp(\n active.mode === \"move\"\n ? { ...active.origin, x: active.origin.x + dx, y: active.origin.y + dy }\n : {\n ...active.origin,\n width: active.origin.width + dx,\n height: active.origin.height + dy,\n },\n ),\n );\n }, []);\n\n const endGesture = useCallback((event: ReactPointerEvent<HTMLElement>) => {\n const active = gesture.current;\n if (!active || active.pointerId !== event.pointerId) return;\n gesture.current = null;\n if (event.currentTarget.hasPointerCapture(event.pointerId)) {\n event.currentTarget.releasePointerCapture(event.pointerId);\n }\n }, []);\n\n if (!mounted || typeof document === \"undefined\") return null;\n\n const labelId = `assoc-window-title:${id}`;\n const style: CSSProperties = isMobile\n ? {}\n : maximized\n ? { inset: \"1rem\", width: \"auto\", height: \"auto\" }\n : {\n left: rect.x,\n top: rect.y,\n width: rect.width,\n height: rect.height,\n };\n\n return createPortal(\n <div\n ref={panelRef}\n role=\"dialog\"\n aria-labelledby={labelId}\n tabIndex={-1}\n style={style}\n className={cn(\n // Non-modal by design: no backdrop element exists, so the page\n // behind keeps every click. `pointer-events-auto` re-asserts our\n // own subtree in case a Radix surface left <body> inert.\n \"pointer-events-auto fixed z-50 flex flex-col overflow-hidden border border-border bg-card text-card-foreground shadow-xl outline-none\",\n isMobile\n ? \"inset-x-0 bottom-0 max-h-[85dvh] rounded-t-xl\"\n : \"rounded-xl\",\n className,\n )}\n >\n <header\n onPointerDown={beginGesture(\"move\")}\n onPointerMove={onPointerMove}\n onPointerUp={endGesture}\n onPointerCancel={endGesture}\n onDoubleClick={() => {\n if (!isMobile) setMaximized((v) => !v);\n }}\n className={cn(\n \"flex shrink-0 items-center justify-between gap-2 border-b border-border px-3 py-2 select-none\",\n isMobile ? \"\" : \"cursor-move touch-none\",\n )}\n >\n <span\n id={labelId}\n className=\"flex min-w-0 items-center gap-1.5 text-sm font-medium text-foreground\"\n >\n {icon}\n <span className=\"truncate\">{title}</span>\n </span>\n <span className=\"flex shrink-0 items-center gap-0.5\">\n {isMobile ? null : (\n <button\n type=\"button\"\n onPointerDown={(event) => event.stopPropagation()}\n onClick={() => setMaximized((v) => !v)}\n aria-label={maximized ? \"Restore window\" : \"Maximize window\"}\n className=\"flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground\"\n >\n {maximized ? (\n <RestoreIcon className=\"h-3.5 w-3.5\" />\n ) : (\n <MaximizeIcon className=\"h-3.5 w-3.5\" />\n )}\n </button>\n )}\n <button\n type=\"button\"\n onPointerDown={(event) => event.stopPropagation()}\n onClick={onClose}\n aria-label=\"Close\"\n className=\"flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground\"\n >\n <XIcon className=\"h-3.5 w-3.5\" />\n </button>\n </span>\n </header>\n\n <div className=\"min-h-0 flex-1 overflow-hidden\">{children}</div>\n\n {isMobile || maximized ? null : (\n <button\n type=\"button\"\n aria-label=\"Resize window\"\n onPointerDown={beginGesture(\"resize\")}\n onPointerMove={onPointerMove}\n onPointerUp={endGesture}\n onPointerCancel={endGesture}\n className=\"absolute bottom-0 right-0 flex h-4 w-4 cursor-nwse-resize touch-none items-center justify-center text-muted-foreground/60 hover:text-foreground\"\n >\n <GripResizeIcon className=\"h-3 w-3\" />\n </button>\n )}\n </div>,\n document.body,\n );\n}\n\nexport default DefaultWindowShell;\n","// react/icons.tsx — @ai-matrx/associations/react\n//\n// The package's OWN inlined SVG glyphs (packaging standard, C19: no icon\n// library dependency, ever — a package ships its own SVGs, adapted from\n// Lucide-style sources; the tap-target precedent). Same 24×24 stroke\n// geometry the host's lucide icons use, so a host-supplied overlay Icon and\n// a package glyph render identically side by side.\n//\n// Entity icons themselves are HOST values (the entity-overlay port);\n// `DefaultEntityIcon` is the package fallback for un-overlaid tokens\n// (lucide `Boxes` geometry — the original registry's DEFAULT_ICON).\n\nimport type { SVGProps } from \"react\";\n\nexport type IconProps = SVGProps<SVGSVGElement>;\n\nfunction base(props: IconProps) {\n return {\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n stroke: \"currentColor\",\n strokeWidth: 2,\n strokeLinecap: \"round\" as const,\n strokeLinejoin: \"round\" as const,\n \"aria-hidden\": true,\n ...props,\n };\n}\n\n/** Spinner glyph (lucide `Loader2`/`LoaderCircle`). Pair with `animate-spin`. */\nexport function SpinnerIcon(props: IconProps) {\n return (\n <svg {...base(props)}>\n <path d=\"M21 12a9 9 0 1 1-6.219-8.56\" />\n </svg>\n );\n}\n\nexport function PlusIcon(props: IconProps) {\n return (\n <svg {...base(props)}>\n <path d=\"M5 12h14\" />\n <path d=\"M12 5v14\" />\n </svg>\n );\n}\n\nexport function XIcon(props: IconProps) {\n return (\n <svg {...base(props)}>\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n );\n}\n\nexport function CheckIcon(props: IconProps) {\n return (\n <svg {...base(props)}>\n <path d=\"M20 6 9 17l-5-5\" />\n </svg>\n );\n}\n\nexport function SearchIcon(props: IconProps) {\n return (\n <svg {...base(props)}>\n <circle cx=\"11\" cy=\"11\" r=\"8\" />\n <path d=\"m21 21-4.3-4.3\" />\n </svg>\n );\n}\n\nexport function Link2Icon(props: IconProps) {\n return (\n <svg {...base(props)}>\n <path d=\"M9 17H7A5 5 0 0 1 7 7h2\" />\n <path d=\"M15 7h2a5 5 0 1 1 0 10h-2\" />\n <line x1=\"8\" x2=\"16\" y1=\"12\" y2=\"12\" />\n </svg>\n );\n}\n\nexport function RefreshIcon(props: IconProps) {\n return (\n <svg {...base(props)}>\n <path d=\"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8\" />\n <path d=\"M21 3v5h-5\" />\n <path d=\"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16\" />\n <path d=\"M8 16H3v5\" />\n </svg>\n );\n}\n\nexport function PinIcon(props: IconProps) {\n return (\n <svg {...base(props)}>\n <path d=\"M12 17v5\" />\n <path d=\"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z\" />\n </svg>\n );\n}\n\nexport function UploadIcon(props: IconProps) {\n return (\n <svg {...base(props)}>\n <path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\" />\n <polyline points=\"17 8 12 3 7 8\" />\n <line x1=\"12\" x2=\"12\" y1=\"3\" y2=\"15\" />\n </svg>\n );\n}\n\nexport function FolderOpenIcon(props: IconProps) {\n return (\n <svg {...base(props)}>\n <path d=\"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2\" />\n </svg>\n );\n}\n\nexport function FileTextIcon(props: IconProps) {\n return (\n <svg {...base(props)}>\n <path d=\"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z\" />\n <path d=\"M14 2v4a2 2 0 0 0 2 2h4\" />\n <path d=\"M10 9H8\" />\n <path d=\"M16 13H8\" />\n <path d=\"M16 17H8\" />\n </svg>\n );\n}\n\nexport function ExternalLinkIcon(props: IconProps) {\n return (\n <svg {...base(props)}>\n <path d=\"M15 3h6v6\" />\n <path d=\"M10 14 21 3\" />\n <path d=\"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\" />\n </svg>\n );\n}\n\nexport function ChevronDownIcon(props: IconProps) {\n return (\n <svg {...base(props)}>\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n );\n}\n\nexport function ChevronsUpDownIcon(props: IconProps) {\n return (\n <svg {...base(props)}>\n <path d=\"m7 15 5 5 5-5\" />\n <path d=\"m7 9 5-5 5 5\" />\n </svg>\n );\n}\n\nexport function CornerDownRightIcon(props: IconProps) {\n return (\n <svg {...base(props)}>\n <polyline points=\"15 10 20 15 15 20\" />\n <path d=\"M4 4v7a4 4 0 0 0 4 4h12\" />\n </svg>\n );\n}\n\nexport function TagIcon(props: IconProps) {\n return (\n <svg {...base(props)}>\n <path d=\"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z\" />\n <circle cx=\"7.5\" cy=\"7.5\" r=\".5\" fill=\"currentColor\" />\n </svg>\n );\n}\n\n/**\n * The default entity glyph for tokens with no host overlay icon (lucide\n * `Boxes` — the original registry's DEFAULT_ICON, now a /react concern\n * because /core ships `Icon: null`).\n */\nexport function DefaultEntityIcon(props: IconProps) {\n return (\n <svg {...base(props)}>\n <path d=\"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z\" />\n <path d=\"m7 16.5-4.74-2.85\" />\n <path d=\"m7 16.5 5-3\" />\n <path d=\"M7 16.5v5.17\" />\n <path d=\"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z\" />\n <path d=\"m17 16.5-5-3\" />\n <path d=\"m17 16.5 4.74-2.85\" />\n <path d=\"M17 16.5v5.17\" />\n <path d=\"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z\" />\n <path d=\"M12 8 7.26 5.15\" />\n <path d=\"m12 8 4.74-2.85\" />\n <path d=\"M12 13.5V8\" />\n </svg>\n );\n}\n\n/** Maximize glyph (lucide `Maximize2`) — the default window's expand toggle. */\nexport function MaximizeIcon(props: IconProps) {\n return (\n <svg {...base(props)}>\n <path d=\"M15 3h6v6\" />\n <path d=\"M9 21H3v-6\" />\n <path d=\"M21 3l-7 7\" />\n <path d=\"M3 21l7-7\" />\n </svg>\n );\n}\n\n/** Restore glyph (lucide `Minimize2`) — the default window's collapse toggle. */\nexport function RestoreIcon(props: IconProps) {\n return (\n <svg {...base(props)}>\n <path d=\"M4 14h6v6\" />\n <path d=\"M20 10h-6V4\" />\n <path d=\"M14 10l7-7\" />\n <path d=\"M3 21l7-7\" />\n </svg>\n );\n}\n\n/** Resize-grip glyph — the default window's bottom-right resize handle. */\nexport function GripResizeIcon(props: IconProps) {\n return (\n <svg {...base(props)}>\n <path d=\"M21 15 15 21\" />\n <path d=\"M21 20 20 21\" />\n </svg>\n );\n}\n","// react/components/AssociationPicker.tsx — @ai-matrx/associations/react\n//\n// The token-driven \"pick a record to associate\" surface, through the ONE\n// AssociationWindow shell. Two jobs, both ALWAYS available (the\n// create-then-associate contract):\n// 1. Associate existing — the registry-driven candidate list.\n// 2. Add new + associate — the \"+ New <Entity>\" footer creates the row\n// first (durable, via the store's entityRows service), writes the edge\n// second, and every terminal outcome is loud.\n//\n// Ported from matrx-frontend\n// `features/scopes/components/associations/AssociationPicker.tsx` (W4,\n// 2026-08-29) with the measured seams inverted:\n// • the hardcoded `token === \"file\"` → FilePickerWindow branch becomes the\n// per-token `pickerOverrides` port: a host registers its canonical picker\n// component per token (matrx-frontend registers FilePickerWindow for\n// \"file\" in its binding); with no override the generic candidate list\n// serves the token (design Decision 2 degradation);\n// • `@/lib/toast` → the notifier port (warn-once degradation);\n// • host `next/dynamic` lazy-loading of the window shell is a HOST concern\n// (the shell itself now arrives via the windowShell port).\n\nimport { useState, type ReactNode } from \"react\";\nimport { cn, Input } from \"@ai-matrx/design-system\";\n\nimport type { EntityTypeToken } from \"../../entity-types.generated\";\nimport type { AssociationPickerProps } from \"../../ports\";\nimport { useAssociationsStore, useAssociationsUiPorts, useNotifier } from \"../context\";\nimport { useAssociationCandidates } from \"../hooks/useAssociationCandidates\";\nimport {\n CheckIcon,\n DefaultEntityIcon,\n PlusIcon,\n SearchIcon,\n SpinnerIcon,\n XIcon,\n} from \"../icons\";\nimport { AssociationWindow } from \"./AssociationWindow\";\n\nexport type { AssociationPickerProps };\n\nexport function AssociationPicker(props: AssociationPickerProps) {\n const store = useAssociationsStore();\n const { pickerOverrides } = useAssociationsUiPorts();\n const info = store.registry.getEntityInfo(props.token);\n const Icon = info.Icon ?? DefaultEntityIcon;\n\n // A host-registered per-token picker (e.g. the canonical file browser)\n // replaces the generic surface entirely — same props contract.\n const Override = pickerOverrides?.[props.token];\n if (Override) return <Override {...props} />;\n\n const title = `Add ${info.labelPlural}`;\n const subtitle = props.containerLabel\n ? `Attach to ${props.containerLabel}`\n : \"Click an item to attach or detach it\";\n\n // Gated on `open` so host window chunks only load on first use.\n if (!props.open) return null;\n return (\n <AssociationWindow\n open={props.open}\n onClose={() => props.onOpenChange(false)}\n scopeId={`picker:${props.token}`}\n title={title}\n icon={<Icon className=\"size-3.5 text-primary\" />}\n subtitle={subtitle}\n >\n <AssociationCandidateBody\n token={props.token}\n enabled={props.open}\n orgId={props.orgId}\n attachedIds={props.attachedIds}\n onAttach={props.onAttach}\n onDetach={props.onDetach}\n onClose={() => props.onOpenChange(false)}\n />\n </AssociationWindow>\n );\n}\n\nexport interface AssociationCandidateBodyProps {\n token: EntityTypeToken;\n /** Load candidates only while true (mirror of the surface's `open`). */\n enabled: boolean;\n /** Org stamped onto rows created by the \"+ New\" footer. */\n orgId?: string | null | undefined;\n attachedIds: Set<string>;\n onAttach: (\n resourceId: string,\n title: string,\n ) => Promise<{ ok: boolean; error?: string }>;\n onDetach: (resourceId: string) => Promise<{ ok: boolean; error?: string }>;\n /** Wired to a per-token browse surface's back affordance. */\n onClose?: () => void;\n}\n\n/**\n * The attach/detach body for ONE token — reused by the picker sheet and by\n * `UniversalAssociationPicker`'s per-token browse mode. Tokens with a\n * host-registered picker override are routed at the PICKER level (windowed\n * override component); this body is always the generic registry-driven list.\n */\nexport function AssociationCandidateBody({\n token,\n enabled,\n orgId,\n attachedIds,\n onAttach,\n onDetach,\n onClose,\n}: AssociationCandidateBodyProps) {\n void onClose;\n return (\n <EntityCandidateList\n token={token}\n enabled={enabled}\n orgId={orgId}\n attachedIds={attachedIds}\n onAttach={onAttach}\n onDetach={onDetach}\n />\n );\n}\n\nfunction EntityCandidateList({\n token,\n enabled,\n orgId,\n attachedIds,\n onAttach,\n onDetach,\n}: {\n token: EntityTypeToken;\n enabled: boolean;\n orgId?: string | null | undefined;\n attachedIds: Set<string>;\n onAttach: (\n resourceId: string,\n title: string,\n ) => Promise<{ ok: boolean; error?: string }>;\n onDetach: (resourceId: string) => Promise<{ ok: boolean; error?: string }>;\n}) {\n const store = useAssociationsStore();\n const notifier = useNotifier();\n const [search, setSearch] = useState(\"\");\n const [busyId, setBusyId] = useState<string | null>(null);\n const info = store.registry.getEntityInfo(token);\n const Icon = info.Icon ?? DefaultEntityIcon;\n const { candidates, loading, error, reload } = useAssociationCandidates({\n token,\n enabled,\n ...(search.trim() ? { search: search.trim() } : {}),\n });\n\n // Creatable = the generic registry write path works: a title column and no\n // bespoke candidate source (a `listCandidates` override signals the table\n // is not PostgREST-writable, e.g. rag data stores).\n const canCreate = info.titleColumn !== null && info.listCandidates === null;\n\n const toggle = async (id: string, title: string) => {\n if (busyId) return;\n setBusyId(id);\n try {\n const attached = attachedIds.has(id);\n const res = attached ? await onDetach(id) : await onAttach(id, title);\n // The container cache reload (in the store write) flips `attachedIds`\n // for us. A silent no-op attach is the bug class this scream kills.\n if (!res.ok) {\n notifier.error(\n `Couldn't ${attached ? \"detach\" : \"attach\"} \"${title}\"` +\n (res.error ? `: ${res.error}` : \"\"),\n );\n }\n } finally {\n setBusyId(null);\n }\n };\n\n return (\n <>\n <div className=\"relative mb-2\">\n <SearchIcon className=\"absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground\" />\n <Input\n value={search}\n onChange={(e) => setSearch(e.target.value)}\n placeholder={`Search ${info.labelPlural.toLowerCase()}…`}\n className=\"h-11 pl-8 text-base md:h-9\"\n style={{ fontSize: 16 }}\n />\n </div>\n\n <div className=\"flex-1 min-h-0 overflow-y-auto -mx-1 px-1\">\n {loading && candidates.length === 0 ? (\n <ListMessage>\n <SpinnerIcon className=\"h-4 w-4 animate-spin\" />\n Loading…\n </ListMessage>\n ) : error ? (\n <div className=\"rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-[12px] text-destructive\">\n <p className=\"font-medium\">Couldn’t load items</p>\n <p className=\"opacity-80\">{error}</p>\n <button\n type=\"button\"\n onClick={reload}\n className=\"mt-1 underline hover:no-underline\"\n >\n Retry\n </button>\n </div>\n ) : candidates.length === 0 ? (\n <ListMessage>\n {canCreate\n ? `Nothing to attach yet — create a new ${info.label.toLowerCase()} below.`\n : \"Nothing to attach.\"}\n </ListMessage>\n ) : (\n <ul className=\"space-y-0.5\">\n {candidates.map((c) => {\n const attached = attachedIds.has(c.id);\n const busy = busyId === c.id;\n return (\n <li key={c.id}>\n <button\n type=\"button\"\n disabled={busy}\n onClick={() => toggle(c.id, c.title)}\n className={cn(\n \"group flex min-h-11 w-full items-center gap-2 rounded-md px-2.5 py-2 text-left text-sm transition-colors md:min-h-0\",\n \"hover:bg-accent disabled:opacity-50\",\n attached && \"bg-accent/40\",\n )}\n >\n <Icon className=\"h-4 w-4 shrink-0 text-muted-foreground\" />\n <span className=\"flex-1 min-w-0 truncate text-foreground\">\n {c.title}\n </span>\n <span\n className={cn(\n \"flex h-5 w-5 items-center justify-center rounded-full shrink-0\",\n attached\n ? \"bg-primary text-primary-foreground\"\n : \"border border-border text-muted-foreground group-hover:border-primary/60\",\n )}\n >\n {busy ? (\n <SpinnerIcon className=\"h-3 w-3 animate-spin\" />\n ) : attached ? (\n <CheckIcon className=\"h-3 w-3\" />\n ) : (\n <PlusIcon className=\"h-3 w-3\" />\n )}\n </span>\n </button>\n </li>\n );\n })}\n </ul>\n )}\n </div>\n\n {canCreate && (\n <CreateAndAttachFooter\n token={token}\n orgId={orgId}\n seed={search.trim()}\n onAttach={onAttach}\n onCreated={reload}\n />\n )}\n </>\n );\n}\n\n/**\n * The \"+ New <Entity>\" footer — the create-then-associate contract: create the\n * durable row FIRST (the store's entityRows service), write the idempotent\n * edge SECOND (retry once), and every terminal outcome is loud. A\n * created-but-unlinked row is reported WITH its location, never silently\n * orphaned.\n */\nfunction CreateAndAttachFooter({\n token,\n orgId,\n seed,\n onAttach,\n onCreated,\n}: {\n token: EntityTypeToken;\n orgId?: string | null | undefined;\n /** Current search text — doubles as the new row's default name. */\n seed: string;\n onAttach: (resourceId: string, title: string) => Promise<{ ok: boolean }>;\n onCreated: () => void;\n}) {\n const store = useAssociationsStore();\n const notifier = useNotifier();\n const info = store.registry.getEntityInfo(token);\n const [editing, setEditing] = useState(false);\n const [name, setName] = useState(\"\");\n const [busy, setBusy] = useState(false);\n\n const submit = async () => {\n const title = name.trim();\n if (!title || busy) return;\n setBusy(true);\n try {\n const created = await store.entityRows.createEntityRow(token, {\n title,\n orgId: orgId ?? null,\n });\n if (!created.ok) {\n notifier.error(\n `Couldn't create ${info.label.toLowerCase()}: ${created.error}`,\n );\n return;\n }\n let attached = await onAttach(created.data.id, created.data.title);\n if (!attached.ok) {\n // The edge write is idempotent — one retry is safe.\n attached = await onAttach(created.data.id, created.data.title);\n }\n if (attached.ok) {\n notifier.success(`\"${title}\" created and attached`);\n } else {\n notifier.error(\n `Created \"${title}\" but couldn't attach it — it's saved in your ` +\n `${info.labelPlural.toLowerCase()}; pick it from the list to retry.`,\n );\n }\n setEditing(false);\n setName(\"\");\n onCreated();\n } finally {\n setBusy(false);\n }\n };\n\n if (!editing) {\n return (\n <button\n type=\"button\"\n onClick={() => {\n setName(seed);\n setEditing(true);\n }}\n className=\"mt-2 flex min-h-11 w-full shrink-0 items-center justify-center gap-1.5 rounded-md border border-dashed border-border px-3 py-2 text-sm text-muted-foreground transition-colors hover:border-primary/60 hover:text-foreground md:min-h-0\"\n >\n <PlusIcon className=\"h-4 w-4\" />\n New {info.label}\n {seed ? (\n <span className=\"max-w-40 truncate text-muted-foreground/70\">\n “{seed}”\n </span>\n ) : null}\n </button>\n );\n }\n\n return (\n <div className=\"mt-2 flex shrink-0 items-center gap-1.5\">\n <Input\n autoFocus\n value={name}\n onChange={(e) => setName(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === \"Enter\") void submit();\n if (e.key === \"Escape\") {\n setEditing(false);\n setName(\"\");\n }\n }}\n placeholder={`New ${info.label.toLowerCase()} name…`}\n disabled={busy}\n className=\"h-11 flex-1 text-base md:h-8\"\n style={{ fontSize: 16 }}\n />\n <button\n type=\"button\"\n disabled={busy || !name.trim()}\n onClick={() => void submit()}\n className=\"flex h-11 items-center gap-1 rounded-md bg-primary px-2.5 text-sm font-medium text-primary-foreground transition-opacity disabled:opacity-50 md:h-8\"\n >\n {busy ? <SpinnerIcon className=\"h-3.5 w-3.5 animate-spin\" /> : \"Create\"}\n </button>\n <button\n type=\"button\"\n disabled={busy}\n onClick={() => {\n setEditing(false);\n setName(\"\");\n }}\n title=\"Cancel\"\n className=\"flex h-11 w-11 items-center justify-center rounded-md border border-border text-muted-foreground transition-colors hover:text-foreground disabled:opacity-50 md:h-8 md:w-8\"\n >\n <XIcon className=\"h-4 w-4\" />\n </button>\n </div>\n );\n}\n\nfunction ListMessage({ children }: { children: ReactNode }) {\n return (\n <div className=\"flex items-center justify-center gap-2 py-8 text-[13px] text-muted-foreground\">\n {children}\n </div>\n );\n}\n","// react/components/UniversalAssociationPicker.tsx — @ai-matrx/associations/react\n//\n// ONE search box over EVERY listable entity type — \"attach anything from\n// anywhere\". Type a name and results from all tokens stream in, grouped with\n// registry icons; click to attach/detach. An optional token chip rail narrows\n// to per-token browsing.\n//\n// Ported from matrx-frontend\n// `features/scopes/components/associations/UniversalAssociationPicker.tsx`\n// (W4, 2026-08-29) with the seams inverted:\n// • `EntityDoorControls` → the `DoorControlsSlot` (host port when bound,\n// otherwise the package's shipped hrefFor anchor — 0.6.0, C23) (absent →\n// the row renders without doors — title + toggle only, per the design's\n// degradation table);\n// • `@/lib/toast` → the notifier port;\n// • the file-token browse special case → the pickerOverrides port: a token\n// with a registered override opens that override (windowed) instead of an\n// inline generic list, preserving \"file enumeration only happens through\n// the canonical picker\".\n//\n// THE DOOR LAW, picker flavour: every candidate carries its doors as SIBLINGS\n// of the attach/detach toggle (an <a> inside a <button> is invalid DOM).\n\nimport { useState } from \"react\";\nimport { cn, Input } from \"@ai-matrx/design-system\";\n\nimport type { EntityTypeToken } from \"../../entity-types.generated\";\nimport type { UniversalCandidate } from \"../../core/candidates\";\nimport { useAssociationsStore, useAssociationsUiPorts, useNotifier } from \"../context\";\nimport { useUniversalEntitySearch } from \"../hooks/useUniversalEntitySearch\";\nimport {\n CheckIcon,\n DefaultEntityIcon,\n PlusIcon,\n SearchIcon,\n SpinnerIcon,\n} from \"../icons\";\nimport { AssociationCandidateBody } from \"./AssociationPicker\";\nimport { DoorControlsSlot } from \"./entityDoors\";\n\nexport interface UniversalAssociationPickerProps {\n /** Tokens offered. Defaults to every listable token. */\n tokens?: EntityTypeToken[];\n /** Ids already attached, keyed `${token}:${id}` — rendered as attached. */\n attachedKeys: Set<string>;\n onAttach: (\n token: EntityTypeToken,\n resourceId: string,\n title: string,\n ) => Promise<{ ok: boolean; error?: string }>;\n onDetach: (\n token: EntityTypeToken,\n resourceId: string,\n ) => Promise<{ ok: boolean; error?: string }>;\n /** Owner filter for candidate reads (defaults to RLS-only). */\n ownerId?: string | null;\n /** Org stamped onto rows created via the per-token \"+ New\" footer. */\n orgId?: string | null;\n className?: string;\n}\n\nexport function attachedKey(token: string, id: string): string {\n return `${token}:${id}`;\n}\n\nexport function UniversalAssociationPicker(\n props: UniversalAssociationPickerProps,\n) {\n const { attachedKeys, onAttach, onDetach, ownerId, orgId, className } = props;\n const store = useAssociationsStore();\n const { pickerOverrides } = useAssociationsUiPorts();\n const notifier = useNotifier();\n const tokens = props.tokens ?? store.registry.listableTokens();\n const [query, setQuery] = useState(\"\");\n const [browseToken, setBrowseToken] = useState<EntityTypeToken | null>(null);\n const [busyKey, setBusyKey] = useState<string | null>(null);\n\n const { results, loading, isRecents } = useUniversalEntitySearch({\n query,\n tokens,\n ownerId: ownerId ?? null,\n enabled: browseToken === null,\n });\n\n\n const toggle = async (c: UniversalCandidate) => {\n const key = attachedKey(c.token, c.id);\n if (busyKey) return;\n setBusyKey(key);\n try {\n const attached = attachedKeys.has(key);\n const res = attached\n ? await onDetach(c.token, c.id)\n : await onAttach(c.token, c.id, c.title);\n // A silent no-op attach is the bug class this scream kills.\n if (!res.ok) {\n notifier.error(\n `Couldn't ${attached ? \"detach\" : \"attach\"} \"${c.title}\"` +\n (res.error ? `: ${res.error}` : \"\"),\n );\n }\n } finally {\n setBusyKey(null);\n }\n };\n\n // Group hits by token for section headers (registry icon + plural).\n const groups = new Map<EntityTypeToken, UniversalCandidate[]>();\n for (const r of results) {\n const list = groups.get(r.token) ?? [];\n list.push(r);\n groups.set(r.token, list);\n }\n\n const BrowseOverride = browseToken ? pickerOverrides?.[browseToken] : undefined;\n\n return (\n <div className={cn(\"flex min-h-0 flex-1 flex-col gap-2\", className)}>\n {/* ── search ──────────────────────────────────────────────────── */}\n <div className=\"relative\">\n <SearchIcon className=\"absolute left-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground\" />\n <Input\n value={query}\n onChange={(e) => {\n setQuery(e.target.value);\n if (browseToken) setBrowseToken(null);\n }}\n placeholder=\"Search everything…\"\n className=\"pl-8 text-base\"\n style={{ fontSize: 16 }}\n />\n {loading && browseToken === null && (\n <SpinnerIcon className=\"absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 animate-spin text-muted-foreground\" />\n )}\n </div>\n\n {/* ── token chip rail (narrow to per-token browse) ─────────────── */}\n <div\n role=\"group\"\n aria-label=\"Entity type filters\"\n className=\"flex shrink-0 flex-nowrap gap-1 overflow-x-auto pb-1\"\n >\n {tokens.map((t) => {\n const info = store.registry.getEntityInfo(t);\n const ChipIcon = info.Icon ?? DefaultEntityIcon;\n const active = browseToken === t;\n return (\n <button\n key={t}\n type=\"button\"\n onClick={() => setBrowseToken(active ? null : t)}\n className={cn(\n \"inline-flex shrink-0 items-center gap-1 rounded-md border px-1.5 py-0.5 text-[11px] transition-colors\",\n active\n ? \"border-primary/50 bg-primary/10 text-foreground\"\n : \"border-border text-muted-foreground hover:text-foreground hover:bg-accent\",\n )}\n >\n <ChipIcon className=\"h-3 w-3\" />\n {info.labelPlural}\n </button>\n );\n })}\n </div>\n\n {/* ── results ──────────────────────────────────────────────────── */}\n {browseToken && BrowseOverride ? (\n // The token's canonical host picker (e.g. the stored-files browser)\n // owns per-token browsing when registered — never a plain list twin.\n <BrowseOverride\n open\n onOpenChange={(open) => {\n if (!open) setBrowseToken(null);\n }}\n token={browseToken}\n orgId={orgId ?? null}\n attachedIds={\n new Set(\n [...attachedKeys]\n .filter((k) => k.startsWith(`${browseToken}:`))\n .map((k) => k.slice(browseToken.length + 1)),\n )\n }\n onAttach={(id, title) => onAttach(browseToken, id, title)}\n onDetach={(id) => onDetach(browseToken, id)}\n />\n ) : browseToken ? (\n <div className=\"flex min-h-0 flex-1 flex-col\">\n <AssociationCandidateBody\n token={browseToken}\n enabled\n orgId={orgId}\n onClose={() => setBrowseToken(null)}\n attachedIds={\n new Set(\n [...attachedKeys]\n .filter((k) => k.startsWith(`${browseToken}:`))\n .map((k) => k.slice(browseToken.length + 1)),\n )\n }\n onAttach={(id, title) => onAttach(browseToken, id, title)}\n onDetach={(id) => onDetach(browseToken, id)}\n />\n </div>\n ) : (\n <div\n role=\"region\"\n aria-label=\"Association search results\"\n className=\"-mx-1 min-h-24 flex-1 overflow-y-auto overscroll-contain px-1\"\n >\n {results.length === 0 ? (\n <p className=\"py-6 text-center text-[12px] text-muted-foreground\">\n {loading\n ? \"Searching…\"\n : query.trim()\n ? \"No matches — narrow with a type chip to browse.\"\n : \"No recent items. Type to search, or pick a type to browse.\"}\n </p>\n ) : (\n <div className=\"space-y-2\">\n {isRecents && (\n <p className=\"px-1 text-[10px] font-medium uppercase tracking-wider text-muted-foreground/60\">\n Recent\n </p>\n )}\n {[...groups.entries()].map(([token, items]) => {\n const info = store.registry.getEntityInfo(token);\n const GroupIcon = info.Icon ?? DefaultEntityIcon;\n return (\n <div key={token} className=\"space-y-0.5\">\n <p className=\"flex items-center gap-1 px-1 text-[10px] font-medium uppercase tracking-wider text-muted-foreground/70\">\n <GroupIcon className=\"h-3 w-3\" />\n {info.labelPlural}\n </p>\n <ul className=\"space-y-0.5\">\n {items.map((c) => {\n const key = attachedKey(c.token, c.id);\n const attached = attachedKeys.has(key);\n const busy = busyKey === key;\n return (\n <li\n key={key}\n className={cn(\n \"group/entity-ref group flex items-center gap-1 rounded-md pr-1.5 transition-colors\",\n \"hover:bg-accent\",\n attached && \"bg-accent/40\",\n )}\n >\n <button\n type=\"button\"\n disabled={busy}\n onClick={() => toggle(c)}\n title={\n attached\n ? `Detach \"${c.title}\"`\n : `Attach \"${c.title}\"`\n }\n className={cn(\n \"flex min-w-0 flex-1 items-center gap-2 rounded-md px-2.5 py-1.5 text-left text-sm\",\n \"disabled:opacity-50\",\n )}\n >\n <span className=\"min-w-0 flex-1 truncate text-foreground\">\n {c.title}\n </span>\n <span\n className={cn(\n \"flex h-5 w-5 shrink-0 items-center justify-center rounded-full\",\n attached\n ? \"bg-primary text-primary-foreground\"\n : \"border border-border text-muted-foreground group-hover:border-primary/60\",\n )}\n >\n {busy ? (\n <SpinnerIcon className=\"h-3 w-3 animate-spin\" />\n ) : attached ? (\n <CheckIcon className=\"h-3 w-3\" />\n ) : (\n <PlusIcon className=\"h-3 w-3\" />\n )}\n </span>\n </button>\n {/* Sibling of the toggle, never a child — an\n anchor inside a button is invalid DOM. */}\n <DoorControlsSlot\n token={c.token}\n id={c.id}\n name={c.title}\n />\n </li>\n );\n })}\n </ul>\n </div>\n );\n })}\n </div>\n )}\n </div>\n )}\n </div>\n );\n}\n\nexport default UniversalAssociationPicker;\n","// react/components/entityDoors.tsx — @ai-matrx/associations/react\n//\n// The entity-doors seam, resolved with its documented degradations (design\n// Decision 2 table):\n//\n// • `EntityRef` bound → the host's full door primitive (open / new tab /\n// peek) renders the name;\n// • absent → title text, wrapped in the overlay's `hrefFor` link when the\n// registry has one (real `target=\"_blank\"` anchor — middle-click works),\n// plain text otherwise (a link-styled title can never no-op);\n// • `UnresolvedRef` bound → the host's access-gate chip for a target the\n// viewer cannot read; absent → the package's plain \"unavailable\" chip;\n// • `DoorControls` bound → the host's open/new-tab/peek control cluster;\n// absent → the package's SHIPPED default (0.6.0, C23): a real, keyboard\n// reachable, labelled `target=\"_blank\"` anchor built from the registry\n// overlay's `hrefFor`. A token with no registered route renders nothing —\n// honest absence, never a control that goes nowhere.\n\nimport type { ComponentType } from \"react\";\nimport { cn } from \"@ai-matrx/design-system\";\n\nimport type { EntityDoorProps, EntityRefProps } from \"../../ports\";\nimport { useAssociationsStore, useAssociationsUiPorts } from \"../context\";\nimport { ExternalLinkIcon } from \"../icons\";\n\nexport interface DoorRefExtras {\n /** Container-owned opener — wins over hrefFor when the host EntityRef is absent. */\n onOpen?: (() => void) | undefined;\n}\n\n/**\n * Render an entity's NAME with its doors, degrading per the port table.\n * The host `EntityRef` receives the measured prop subset when bound.\n */\nexport function DoorRef(props: EntityRefProps & DoorRefExtras) {\n const { onOpen, ...refProps } = props;\n const { entityDoors } = useAssociationsUiPorts();\n const store = useAssociationsStore();\n\n const HostRef: ComponentType<EntityRefProps> | undefined =\n entityDoors?.EntityRef;\n if (HostRef) return <HostRef {...refProps} />;\n\n const name = refProps.name ?? null;\n const href =\n store.registry.tryGetEntityInfo(refProps.token)?.hrefFor?.(refProps.id) ??\n null;\n\n if (onOpen) {\n return (\n <button\n type=\"button\"\n onClick={onOpen}\n className={cn(\n \"min-w-0 truncate text-left underline-offset-2 hover:underline\",\n refProps.className,\n )}\n >\n {name}\n </button>\n );\n }\n if (href) {\n return (\n <a\n href={href}\n target={refProps.openInNewTab === false ? undefined : \"_blank\"}\n rel=\"noopener noreferrer\"\n className={cn(\n \"inline-flex min-w-0 items-center gap-1 truncate underline-offset-2 hover:underline\",\n refProps.className,\n )}\n >\n <span className=\"min-w-0 truncate\">{name}</span>\n <ExternalLinkIcon className=\"h-3 w-3 shrink-0 opacity-0 transition-opacity group-hover:opacity-60\" />\n </a>\n );\n }\n return (\n <span className={cn(\"min-w-0 truncate\", refProps.className)}>{name}</span>\n );\n}\n\n/** The unresolved-target chip, host-supplied or the package's plain one. */\nexport function UnresolvedRef({ token, id }: { token: string; id: string }) {\n const { entityDoors } = useAssociationsUiPorts();\n const HostUnresolved = entityDoors?.UnresolvedRef;\n if (HostUnresolved) return <HostUnresolved token={token} id={id} />;\n return (\n <span\n className=\"inline-flex items-center rounded border border-border/60 bg-muted/40 px-1.5 py-0.5 text-[11px] text-muted-foreground\"\n title={`This ${token} could not be read — it may be deleted or not shared with you.`}\n >\n Unavailable\n </span>\n );\n}\n\n/**\n * The door-control cluster, host-supplied or the package default. Every face\n * renders doors through THIS slot — never `entityDoors?.DoorControls` — so\n * the default reaches all of them at once.\n */\nexport function DoorControlsSlot(props: EntityDoorProps) {\n const { entityDoors } = useAssociationsUiPorts();\n const store = useAssociationsStore();\n\n const HostControls = entityDoors?.DoorControls;\n if (HostControls) return <HostControls {...props} />;\n\n const href =\n store.registry.tryGetEntityInfo(props.token)?.hrefFor?.(props.id) ?? null;\n // No route registered for this token: there IS no door, so we render\n // none. A visible control that cannot open anything is the dead-end bug.\n if (!href) return null;\n\n const label = props.name ? `Open ${props.name}` : `Open this ${props.token}`;\n return (\n <a\n href={href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n aria-label={label}\n title={label}\n className={cn(\n \"inline-flex h-5 w-5 shrink-0 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-accent hover:text-foreground\",\n props.className,\n )}\n >\n <ExternalLinkIcon className=\"h-3 w-3\" />\n </a>\n );\n}\n","// react/components/AttachedItemsSheet.tsx — @ai-matrx/associations/react\n//\n// \"What is actually attached here?\" — the drill-in behind every\n// AssociationCard count. Titles are resolved LIVE through the store's title\n// service rather than read off the association edge's stored label: the edge\n// label is a snapshot from attach time and goes stale the moment the target\n// is renamed (and many existing edges have no label at all). Ids the viewer\n// cannot read are omitted by the RPC, so they resolve through the entityDoors\n// port's `UnresolvedRef` (host access gate) — or the package's plain\n// \"unavailable\" chip when the port is absent.\n//\n// Ported from matrx-frontend\n// `features/scopes/components/associations/AttachedItemsSheet.tsx` (W4,\n// 2026-08-29) with the seams inverted: `EntityRef`/access-gate → entityDoors\n// port, `@/lib/toast` → notifier port, `fetchEntityTitles` → the store's\n// titles service, WindowPanel → the AssociationWindow shell (windowShell\n// port with fixed-overlay fallback).\n\nimport { useEffect, useState } from \"react\";\nimport { cn } from \"@ai-matrx/design-system\";\n\nimport type { EntityTypeToken } from \"../../entity-types.generated\";\nimport { useAssociationsStore, useNotifier } from \"../context\";\nimport type { ContainerLink } from \"../hooks/useContainerLinks\";\nimport {\n DefaultEntityIcon,\n PinIcon,\n PlusIcon,\n SpinnerIcon,\n XIcon,\n} from \"../icons\";\nimport { AssociationWindow } from \"./AssociationWindow\";\nimport { DoorRef, UnresolvedRef } from \"./entityDoors\";\nimport type { PrimaryEntity } from \"./PrimaryEntityContext\";\n\nfunction metadataIsPinned(metadata: unknown): boolean {\n return (\n metadata !== null &&\n typeof metadata === \"object\" &&\n !Array.isArray(metadata) &&\n Reflect.get(metadata, \"pinned\") === true\n );\n}\n\nexport interface AttachedItemsSheetProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n token: EntityTypeToken;\n containerLabel?: string;\n /**\n * The container these items are attached to. When given, the \"Attached to X\"\n * line puts a door on X — this window can outlive the page it was opened\n * from, so its container reference must be reachable.\n */\n container?: PrimaryEntity;\n links: ContainerLink[];\n /** Opens the attach picker. Omitted when the token cannot list candidates. */\n onAdd?: () => void;\n onDetach: (\n resourceId: string,\n role?: string | null,\n ) => Promise<{ ok: boolean; error?: string }>;\n /** Toggle metadata.pinned on this exact role-qualified edge. */\n onSetPinned?: (\n resourceId: string,\n pinned: boolean,\n role?: string | null,\n ) => Promise<{ ok: boolean; error?: string }>;\n}\n\nexport function AttachedItemsSheet(props: AttachedItemsSheetProps) {\n const store = useAssociationsStore();\n const info = store.registry.getEntityInfo(props.token);\n const Icon = info.Icon ?? DefaultEntityIcon;\n\n const title = info.labelPlural;\n const containerName = props.container?.label ?? props.containerLabel;\n const subtitle = props.container ? (\n <span className=\"inline-flex min-w-0 max-w-full items-center gap-1\">\n Attached to\n <DoorRef\n token={props.container.type}\n id={props.container.id}\n name={containerName ?? null}\n alwaysShowActions\n />\n </span>\n ) : props.containerLabel ? (\n `Attached to ${props.containerLabel}`\n ) : (\n \"Attached items\"\n );\n\n // Gated on `open` so host window chunks only load on first use.\n if (!props.open) return null;\n return (\n <AssociationWindow\n open={props.open}\n onClose={() => props.onOpenChange(false)}\n scopeId={`attached:${props.token}`}\n title={title}\n icon={<Icon className=\"size-3.5 text-primary\" />}\n subtitle={subtitle}\n >\n <AttachedItemsBody\n token={props.token}\n enabled={props.open}\n links={props.links}\n {...(props.onAdd ? { onAdd: props.onAdd } : {})}\n onDetach={props.onDetach}\n {...(props.onSetPinned ? { onSetPinned: props.onSetPinned } : {})}\n />\n </AssociationWindow>\n );\n}\n\nfunction AttachedItemsBody({\n token,\n enabled,\n links,\n onAdd,\n onDetach,\n onSetPinned,\n}: {\n token: EntityTypeToken;\n enabled: boolean;\n links: ContainerLink[];\n onAdd?: () => void;\n onDetach: (\n resourceId: string,\n role?: string | null,\n ) => Promise<{ ok: boolean; error?: string }>;\n onSetPinned?: (\n resourceId: string,\n pinned: boolean,\n role?: string | null,\n ) => Promise<{ ok: boolean; error?: string }>;\n}) {\n const store = useAssociationsStore();\n const notifier = useNotifier();\n const info = store.registry.getEntityInfo(token);\n const Icon = info.Icon ?? DefaultEntityIcon;\n const [titles, setTitles] = useState<Map<string, string | null> | null>(null);\n const [titleError, setTitleError] = useState<string | null>(null);\n const [busyId, setBusyId] = useState<string | null>(null);\n\n const idKey = links\n .map((l) => l.resourceId)\n .sort()\n .join(\",\");\n\n useEffect(() => {\n if (!enabled) return;\n const ids = idKey ? idKey.split(\",\") : [];\n if (ids.length === 0) {\n setTitles(new Map());\n return;\n }\n let cancelled = false;\n void (async () => {\n try {\n const resolved = await store.titles.fetch(token, ids);\n if (!cancelled) {\n setTitles(resolved);\n setTitleError(null);\n }\n } catch (cause) {\n if (cancelled) return;\n // Loud, not silent: falling back to stored edge labels is a degraded\n // mode and the user should know the names may be stale.\n store.errorSink({\n code: \"title_resolution_failed\",\n message: \"[AttachedItemsSheet] title resolution failed\",\n context: { token, detail: cause },\n });\n setTitles(new Map());\n setTitleError(\n cause instanceof Error ? cause.message : \"Could not resolve names\",\n );\n }\n })();\n return () => {\n cancelled = true;\n };\n }, [token, idKey, enabled, store]);\n\n const detach = async (link: ContainerLink) => {\n const resourceId = link.resourceId;\n if (busyId) return;\n setBusyId(resourceId);\n try {\n const res = await onDetach(resourceId, link.role);\n // A silent no-op detach reads as \"removed\" — scream instead.\n if (!res.ok) {\n notifier.error(`Couldn't detach${res.error ? `: ${res.error}` : \"\"}`);\n }\n } finally {\n setBusyId(null);\n }\n };\n\n const setPinned = async (link: ContainerLink, pinned: boolean) => {\n if (!onSetPinned || busyId) return;\n setBusyId(link.resourceId);\n try {\n const res = await onSetPinned(link.resourceId, pinned, link.role);\n if (!res.ok) {\n notifier.error(\n `Couldn't ${pinned ? \"pin\" : \"unpin\"}${res.error ? `: ${res.error}` : \"\"}`,\n );\n }\n } finally {\n setBusyId(null);\n }\n };\n\n return (\n <>\n {titleError ? (\n <div className=\"mb-2 rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-[12px] text-destructive\">\n Showing names recorded at attach time — they may be out of date.{\" \"}\n {titleError}\n </div>\n ) : null}\n\n <div className=\"flex-1 min-h-0 overflow-y-auto -mx-1 px-1\">\n {links.length === 0 ? (\n <div className=\"flex items-center justify-center py-8 text-[13px] text-muted-foreground\">\n Nothing attached yet.\n </div>\n ) : titles === null ? (\n <div className=\"flex items-center justify-center gap-2 py-8 text-[13px] text-muted-foreground\">\n <SpinnerIcon className=\"h-4 w-4 animate-spin\" />\n Loading…\n </div>\n ) : (\n <ul className=\"space-y-0.5\">\n {links.map((link) => {\n const resolved = titles.get(link.resourceId);\n const missing = !titles.has(link.resourceId);\n const name =\n resolved ?? link.label ?? (missing ? null : \"Untitled\");\n const busy = busyId === link.resourceId;\n const pinned = metadataIsPinned(link.metadata);\n\n return (\n <li\n key={link.edgeId}\n className=\"group/entity-ref group flex items-center gap-2 rounded-md px-2.5 py-2 text-sm transition-colors hover:bg-accent\"\n >\n <Icon className=\"h-4 w-4 shrink-0 text-muted-foreground\" />\n <span className=\"flex-1 min-w-0 truncate\">\n {name === null ? (\n // The X beside the row stays the one-click detach.\n <UnresolvedRef token={token} id={link.resourceId} />\n ) : (\n <DoorRef\n token={token}\n id={link.resourceId}\n name={name}\n showIcon={false}\n className=\"text-foreground\"\n />\n )}\n </span>\n {onSetPinned ? (\n <button\n type=\"button\"\n disabled={busy}\n onClick={() => void setPinned(link, !pinned)}\n title={\n pinned\n ? \"Unpin (stops staying in agent context)\"\n : \"Pin — always in agent context\"\n }\n aria-label={pinned ? \"Unpin\" : \"Pin\"}\n className={cn(\n \"flex h-6 w-6 shrink-0 items-center justify-center rounded-md transition-colors hover:bg-accent hover:text-foreground disabled:opacity-50\",\n pinned ? \"text-primary\" : \"text-muted-foreground\",\n )}\n >\n <PinIcon\n className={cn(\n \"h-3.5 w-3.5\",\n pinned && \"fill-primary/20\",\n )}\n />\n </button>\n ) : null}\n <button\n type=\"button\"\n disabled={busy}\n onClick={() => void detach(link)}\n title=\"Detach\"\n className={cn(\n \"flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors\",\n \"hover:bg-destructive/10 hover:text-destructive disabled:opacity-50\",\n )}\n >\n {busy ? (\n <SpinnerIcon className=\"h-3.5 w-3.5 animate-spin\" />\n ) : (\n <XIcon className=\"h-3.5 w-3.5\" />\n )}\n </button>\n </li>\n );\n })}\n </ul>\n )}\n </div>\n\n {onAdd ? (\n <button\n type=\"button\"\n onClick={onAdd}\n className=\"mt-2 flex w-full items-center justify-center gap-1.5 rounded-md border border-border px-3 py-2 text-sm text-muted-foreground transition-colors hover:border-primary/60 hover:text-foreground\"\n >\n <PlusIcon className=\"h-4 w-4\" />\n Attach {info.labelPlural.toLowerCase()}\n </button>\n ) : null}\n </>\n );\n}\n\nexport default AttachedItemsSheet;\n","// react/components/AssociationCard.tsx — @ai-matrx/associations/react\n//\n// THE canonical, reusable association card. Drop it on any surface that has a\n// PrimaryEntityProvider (or pass `container` explicitly) and hand it a single\n// secondary-entity TOKEN:\n//\n// <AssociationCard token=\"task\" />\n//\n// It resolves the icon + label from the entity registry (nothing hardcoded),\n// shows a LIVE count of how many of that entity are attached to the primary\n// (container) entity, and a plus button that opens the picker. ALL logic\n// lives in hooks/services — this is pure presentation wiring over\n// `useContainerLinks` + `AssociationPicker`.\n//\n// Ported verbatim from matrx-frontend\n// `features/scopes/components/associations/AssociationCard.tsx` (W4,\n// 2026-08-29); registry module → the store registry, lucide → package\n// glyphs, the missing-container console.error → the errorSink.\n\nimport { useState } from \"react\";\nimport { cn } from \"@ai-matrx/design-system\";\n\nimport type { EntityTypeToken } from \"../../entity-types.generated\";\nimport { useAssociationsStore } from \"../context\";\nimport { useContainerLinks } from \"../hooks/useContainerLinks\";\nimport { getContentRoleMeta } from \"../contentRoles\";\nimport { DefaultEntityIcon, PlusIcon, SpinnerIcon } from \"../icons\";\nimport { AssociationPicker } from \"./AssociationPicker\";\nimport { AttachedItemsSheet } from \"./AttachedItemsSheet\";\nimport { usePrimaryEntity, type PrimaryEntity } from \"./PrimaryEntityContext\";\n\nexport interface AssociationCardProps {\n /** The secondary entity kind this card manages (e.g. \"task\", \"file\"). */\n token: EntityTypeToken;\n /** Override the page's primary entity. Defaults to PrimaryEntityProvider. */\n container?: PrimaryEntity;\n className?: string;\n}\n\nexport function AssociationCard({\n token,\n container: containerProp,\n className,\n}: AssociationCardProps) {\n const store = useAssociationsStore();\n const fromCtx = usePrimaryEntity();\n const container = containerProp ?? fromCtx;\n const [open, setOpen] = useState(false);\n\n const info = store.registry.getEntityInfo(token);\n const role = getContentRoleMeta(info.contentRole);\n const Icon = info.Icon ?? DefaultEntityIcon;\n\n const [listOpen, setListOpen] = useState(false);\n\n const {\n status,\n countFor,\n attachedIdsFor,\n linksFor,\n attach,\n detach,\n setPinned,\n } =\n useContainerLinks({\n containerType: container?.type ?? \"organization\",\n containerId: container?.id ?? null,\n orgId: container?.orgId ?? null,\n });\n\n // No container in scope → render nothing rather than guess.\n if (!container) {\n store.errorSink({\n code: \"association_card_no_container\",\n message:\n `[AssociationCard] no primary entity for token \"${token}\" — wrap in ` +\n `<PrimaryEntityProvider> or pass a container prop`,\n context: { token },\n });\n return null;\n }\n\n const count = countFor(token);\n const loading = status === \"loading\" || status === \"idle\";\n const canAttach = info.canListCandidates;\n\n // The count is only useful if you can find out WHICH ones. The card body\n // drills into the attached list; the \"+\" stays a direct shortcut to attach.\n const canDrillIn = count > 0;\n\n return (\n <>\n <div\n className={cn(\n \"group relative flex items-center gap-3 overflow-hidden rounded-xl border border-border bg-card transition-all hover:border-primary/30 hover:bg-accent/40\",\n className,\n )}\n >\n {/* role accent bar — same categorical language as the resource tiles */}\n <span\n className={cn(\n \"absolute inset-x-0 top-0 h-0.5 opacity-60\",\n role.accentBar,\n )}\n />\n\n <button\n type=\"button\"\n disabled={!canDrillIn}\n onClick={() => setListOpen(true)}\n title={\n canDrillIn\n ? `View the ${info.labelPlural.toLowerCase()} attached to ${container.label ?? \"this\"}`\n : undefined\n }\n className={cn(\n \"flex min-w-0 flex-1 items-center gap-3 px-3 py-2.5 text-left\",\n canDrillIn ? \"cursor-pointer\" : \"cursor-default\",\n )}\n >\n <span\n className={cn(\n \"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg\",\n role.accentBg,\n role.accentText,\n )}\n >\n <Icon className=\"h-4 w-4\" />\n </span>\n\n <span className=\"min-w-0 flex-1\">\n <span className=\"block truncate text-sm font-medium text-foreground\">\n {info.labelPlural}\n </span>\n <span className=\"block text-[11px] text-muted-foreground tabular-nums\">\n {loading ? (\n <span className=\"inline-flex items-center gap-1\">\n <SpinnerIcon className=\"h-3 w-3 animate-spin\" />\n Loading…\n </span>\n ) : (\n `${count} attached`\n )}\n </span>\n </span>\n </button>\n\n {canAttach && (\n <button\n type=\"button\"\n onClick={() => setOpen(true)}\n aria-label={`Attach ${info.labelPlural.toLowerCase()}`}\n title={`Attach ${info.labelPlural.toLowerCase()}`}\n className=\"mr-2 flex h-11 w-11 shrink-0 items-center justify-center rounded-md border border-border text-muted-foreground transition-colors hover:border-primary/60 hover:text-foreground lg:mr-3 lg:h-7 lg:w-7\"\n >\n <PlusIcon className=\"h-4 w-4\" />\n </button>\n )}\n </div>\n\n {/* Mount while open (not while canDrillIn) — detaching the last item\n must leave the surface up showing \"Nothing attached yet\", never\n yank the window out from under the user. */}\n {listOpen && (\n <AttachedItemsSheet\n open={listOpen}\n onOpenChange={setListOpen}\n token={token}\n {...(container.label !== undefined\n ? { containerLabel: container.label }\n : {})}\n container={container}\n links={linksFor(token)}\n {...(canAttach\n ? {\n onAdd: () => {\n setListOpen(false);\n setOpen(true);\n },\n }\n : {})}\n onDetach={(resourceId, role) =>\n detach(token, resourceId, role ?? undefined)\n }\n onSetPinned={(resourceId, pinned, role) =>\n setPinned(token, resourceId, pinned, role ?? undefined)\n }\n />\n )}\n\n {canAttach && (\n <AssociationPicker\n open={open}\n onOpenChange={setOpen}\n token={token}\n {...(container.label !== undefined\n ? { containerLabel: container.label }\n : {})}\n orgId={container.orgId ?? null}\n attachedIds={attachedIdsFor(token)}\n onAttach={(resourceId, title) => attach(token, resourceId, title)}\n onDetach={(resourceId) => detach(token, resourceId)}\n />\n )}\n </>\n );\n}\n\nexport default AssociationCard;\n","// react/contentRoles.ts — @ai-matrx/associations/react\n//\n// Display metadata for the content-role buckets — ported verbatim from\n// matrx-frontend `features/scopes/registry/entityRegistry.ts` (W4,\n// 2026-08-29). The ROLE ids and the per-entity classification live in /core\n// (`platform.entity_types.content_role` is the only authority); titles,\n// taglines, and the categorical accent classes are chrome, so they live in\n// /react. ONE visual language for \"what kind of thing is this\" across every\n// association surface.\n\nimport type { ContentRole } from \"../core/registry\";\n\nexport interface ContentRoleMeta {\n id: ContentRole;\n /** Section heading. */\n title: string;\n /** One-line \"what is this bucket\". */\n tagline: string;\n /** Categorical accent classes (tint only — surfaces stay semantic). */\n accentText: string;\n accentBg: string;\n accentBar: string;\n}\n\n/** Ordered for display: capability, data-in, data-out, both, structure. */\nexport const CONTENT_ROLES: ContentRoleMeta[] = [\n {\n id: \"utility\",\n title: \"Utilities\",\n tagline: \"The agents and tools that act on your knowledge.\",\n accentText: \"text-violet-600 dark:text-violet-400\",\n accentBg: \"bg-violet-500/10\",\n accentBar: \"bg-violet-500\",\n },\n {\n id: \"source\",\n title: \"Sources\",\n tagline: \"Incoming sources of truth (Knowledge In).\",\n accentText: \"text-sky-600 dark:text-sky-400\",\n accentBg: \"bg-sky-500/10\",\n accentBar: \"bg-sky-500\",\n },\n {\n id: \"destination\",\n title: \"Outputs\",\n tagline: \"Knowledge your team produces.\",\n accentText: \"text-emerald-600 dark:text-emerald-400\",\n accentBg: \"bg-emerald-500/10\",\n accentBar: \"bg-emerald-500\",\n },\n {\n id: \"hybrid\",\n title: \"Sources & Outputs\",\n tagline: \"Read from and written to.\",\n accentText: \"text-teal-600 dark:text-teal-400\",\n accentBg: \"bg-teal-500/10\",\n accentBar: \"bg-gradient-to-r from-sky-500 to-emerald-500\",\n },\n {\n id: \"container\",\n title: \"Workspaces\",\n tagline: \"How work is organized.\",\n accentText: \"text-amber-600 dark:text-amber-400\",\n accentBg: \"bg-amber-500/10\",\n accentBar: \"bg-amber-500\",\n },\n];\n\nexport function getContentRoleMeta(role: ContentRole): ContentRoleMeta {\n return (\n CONTENT_ROLES.find((r) => r.id === role) ?? (CONTENT_ROLES[2] as ContentRoleMeta)\n );\n}\n","// react/components/AssociationCardGrid.tsx — @ai-matrx/associations/react\n//\n// THE canonical \"everything attached to this container\" surface. Drop it under\n// a PrimaryEntityProvider and it renders one AssociationCard per cardable\n// entity token — fully registry-driven, ZERO per-page hardcoding:\n//\n// <PrimaryEntityProvider value={{ type: \"organization\", id, orgId, label }}>\n// <AssociationCardGrid />\n// </PrimaryEntityProvider>\n//\n// By default it lists EVERY token the registry can list candidates for (the\n// `curatedTokens()` set), GROUPED BY CONTENT ROLE with the same categorical\n// accent colors every association surface uses. Every card shares ONE\n// association fetch for the container (the store cache dedupes), so the whole\n// grid is a single round-trip.\n//\n// Ported verbatim from matrx-frontend\n// `features/scopes/components/associations/AssociationCardGrid.tsx` (W4,\n// 2026-08-29); registry module → the store registry.\n\nimport { cn } from \"@ai-matrx/design-system\";\n\nimport type { EntityTypeToken } from \"../../entity-types.generated\";\nimport { useAssociationsStore } from \"../context\";\nimport { CONTENT_ROLES } from \"../contentRoles\";\nimport { AssociationCard } from \"./AssociationCard\";\n\nexport interface AssociationCardGridProps {\n /** Tokens to show. Defaults to every registry-listable token. */\n tokens?: EntityTypeToken[];\n /** Registry tokens this surface cannot honestly support yet. */\n excludeTokens?: EntityTypeToken[];\n className?: string;\n}\n\nexport function AssociationCardGrid({\n tokens,\n excludeTokens,\n className,\n}: AssociationCardGridProps) {\n const store = useAssociationsStore();\n const excluded = new Set(excludeTokens ?? []);\n const list = (tokens ?? store.registry.curatedTokens()).filter(\n (token) => !excluded.has(token),\n );\n\n return (\n <div className={cn(\"space-y-5\", className)}>\n {CONTENT_ROLES.map((role) => {\n const inRole = list.filter(\n (token) => store.registry.getEntityInfo(token).contentRole === role.id,\n );\n if (inRole.length === 0) return null;\n\n return (\n <section key={role.id}>\n <div className=\"mb-2.5 flex items-baseline gap-3 pl-1.5\">\n <div className=\"flex items-center gap-2\">\n <span\n className={cn(\"h-2.5 w-2.5 rounded-full\", role.accentBar)}\n />\n <h3 className=\"text-sm font-semibold text-foreground\">\n {role.title}\n </h3>\n </div>\n <p className=\"hidden text-xs text-muted-foreground sm:block\">\n {role.tagline}\n </p>\n </div>\n\n <div className=\"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3\">\n {inRole.map((token) => (\n <AssociationCard key={token} token={token} />\n ))}\n </div>\n </section>\n );\n })}\n </div>\n );\n}\n\nexport default AssociationCardGrid;\n","// react/components/AssociationList.tsx — @ai-matrx/associations/react\n//\n// THE row-mode face of the container-contents system — the sibling of\n// `AssociationCardGrid` (count cards). Drop it under a `PrimaryEntityProvider`\n// (or pass `container`) and it renders EVERYTHING attached to the container as\n// grouped rows — content-role sections → token groups → title rows with open +\n// detach — plus a universal search-attach header and a per-token \"+\" picker.\n//\n// Fully registry-driven and ADAPTER-PLUGGABLE: reads/writes default to\n// `useContainerLinks` (org/scope/project pages), but a container with its own\n// write semantics (war-room threads: single-active demotion, position, host\n// bucket) supplies a `ContainerResourcesAdapter` and the UI stays identical.\n//\n// Titles are never UUIDs: edge label → batched title fetch → \"Untitled <type>\".\n//\n// Ported from matrx-frontend\n// `features/scopes/components/associations/AssociationList.tsx` (W4,\n// 2026-08-29) with the seams inverted: `EntityRef` → the entityDoors port\n// (degrading to hrefFor anchor / plain text), registry module → the store\n// registry, host Skeleton → design-system Skeleton, lucide → package glyphs.\n\nimport { useState, type ReactNode } from \"react\";\nimport { cn, Skeleton } from \"@ai-matrx/design-system\";\n\nimport type { EntityTypeToken } from \"../../entity-types.generated\";\nimport type { ContentRole, EntityInfo } from \"../../core/registry\";\nimport { useAssociationsStore, useNotifier } from \"../context\";\nimport { useContainerLinks } from \"../hooks/useContainerLinks\";\nimport { useEntityTitles } from \"../hooks/useEntityTitles\";\nimport { CONTENT_ROLES, getContentRoleMeta } from \"../contentRoles\";\nimport {\n Link2Icon,\n PinIcon,\n PlusIcon,\n RefreshIcon,\n SpinnerIcon,\n XIcon,\n} from \"../icons\";\nimport { AssociationPicker } from \"./AssociationPicker\";\nimport { DoorRef } from \"./entityDoors\";\nimport {\n UniversalAssociationPicker,\n attachedKey,\n} from \"./UniversalAssociationPicker\";\nimport { usePrimaryEntity, type PrimaryEntity } from \"./PrimaryEntityContext\";\n\n// ─── Adapter contract ────────────────────────────────────────────────────────\n\n/** One attached resource, as the list renders it. Tokens are CANONICAL. */\nexport interface ContainerResourceRow {\n /** Stable row key (edge id or `${token}:${id}`). */\n key: string;\n token: string;\n resourceId: string;\n label: string | null;\n /** Exact semantic edge role; null means the canonical role-less edge. */\n role?: string | null;\n /** Pinned rows sort first inside their token group. */\n pinned?: boolean;\n /** False for inherited rows (e.g. via a thread's anchor) — no detach. */\n removable: boolean;\n /** Small annotation for non-removable rows (\"via anchor\"). */\n originNote?: string | null;\n /** Resolvable records that contributed an inherited row. */\n originRefs?: readonly {\n token: EntityTypeToken;\n id: string;\n label: string;\n }[];\n}\n\nexport interface ContainerResourcesAdapter {\n status: \"idle\" | \"loading\" | \"ready\" | \"error\";\n error: string | null;\n reload: () => void | Promise<void>;\n rows: ContainerResourceRow[];\n attach: (\n token: EntityTypeToken,\n resourceId: string,\n title?: string,\n /**\n * Extra edge metadata stamped at attach time (label-at-attach-time's\n * sibling contract). Adapters without metadata support may ignore it.\n */\n opts?: { metadata?: Record<string, unknown> | null },\n ) => Promise<{ ok: boolean; error?: string }>;\n detach: (\n token: EntityTypeToken,\n resourceId: string,\n role?: string,\n ) => Promise<{ ok: boolean; error?: string }>;\n /**\n * Optional pin capability (edge `metadata.pinned`) — pinned resources stay\n * inline in agent context at every tier. Rows show a pin toggle when set.\n */\n setPinned?: (\n token: EntityTypeToken,\n resourceId: string,\n pinned: boolean,\n role?: string,\n ) => Promise<{ ok: boolean; error?: string }>;\n}\n\nfunction metadataIsPinned(metadata: unknown): boolean {\n return (\n metadata !== null &&\n typeof metadata === \"object\" &&\n !Array.isArray(metadata) &&\n Reflect.get(metadata, \"pinned\") === true\n );\n}\n\n/** Default adapter — wraps `useContainerLinks` (org/scope/project pages). */\nexport function useContainerLinksAdapter(\n container: PrimaryEntity | null,\n tokens?: readonly EntityTypeToken[],\n): ContainerResourcesAdapter {\n const store = useAssociationsStore();\n const links = useContainerLinks({\n containerType: container?.type ?? \"organization\",\n containerId: container?.id ?? null,\n orgId: container?.orgId ?? null,\n });\n const rows: ContainerResourceRow[] = container\n ? (tokens ?? store.registry.curatedTokens()).flatMap((token) =>\n links.linksFor(token).map((l) => ({\n key: l.edgeId,\n token: l.token,\n resourceId: l.resourceId,\n label: l.label,\n role: l.role,\n pinned: metadataIsPinned(l.metadata),\n removable: true,\n })),\n )\n : [];\n return {\n status: links.status,\n error: links.error,\n reload: links.reload,\n rows,\n attach: async (token, id, title) => links.attach(token, id, title),\n detach: async (token, id, role) => links.detach(token, id, role),\n setPinned: async (token, id, pinned, role) =>\n links.setPinned(token, id, pinned, role),\n };\n}\n\n// ─── Component ───────────────────────────────────────────────────────────────\n\nexport interface AssociationListProps {\n /** Container override; defaults to the surrounding PrimaryEntityProvider. */\n container?: PrimaryEntity;\n /** Write/read override (war-room threads etc.). Default: useContainerLinks. */\n adapter?: ContainerResourcesAdapter;\n /** Restrict display + attach to these tokens (e.g. one dynamic tab). */\n tokens?: EntityTypeToken[];\n /** `full` = role sections + universal search; `compact` = flat token groups. */\n variant?: \"full\" | \"compact\";\n /** Extra per-token actions (e.g. war-room Upload / New document). */\n renderSectionActions?: (token: EntityTypeToken) => ReactNode;\n /** Open a resource. Default: registry `hrefFor` in a new tab. */\n openEntity?: (token: string, id: string) => void;\n /**\n * Per-token row override (return null/undefined to keep the default row) —\n * for rows that need richer rendering than icon+title. The override owns the\n * whole row; use `ctx` for the resolved title and the busy/detach/open\n * wiring.\n */\n renderRow?: (\n row: ContainerResourceRow,\n ctx: {\n title: string;\n busy: boolean;\n onDetach: () => void;\n onOpen: () => void;\n },\n ) => ReactNode | null | undefined;\n className?: string;\n}\n\nexport function AssociationList(props: AssociationListProps) {\n const store = useAssociationsStore();\n const notifier = useNotifier();\n const ctxEntity = usePrimaryEntity();\n const container = props.container ?? ctxEntity ?? null;\n const defaultAdapter = useContainerLinksAdapter(\n props.adapter ? null : container,\n props.tokens,\n );\n const adapter = props.adapter ?? defaultAdapter;\n const variant = props.variant ?? \"full\";\n const tokenFilter = props.tokens ?? null;\n\n const [pickerToken, setPickerToken] = useState<EntityTypeToken | null>(null);\n const [showUniversal, setShowUniversal] = useState(false);\n const [removingKeys, setRemovingKeys] = useState<Set<string>>(new Set());\n const [pinningKeys, setPinningKeys] = useState<Set<string>>(new Set());\n\n const rows = tokenFilter\n ? adapter.rows.filter((r) => (tokenFilter as string[]).includes(r.token))\n : adapter.rows;\n const visibleRows = rows.filter((r) => !removingKeys.has(r.key));\n\n const { titleFor } = useEntityTitles(\n visibleRows.map((r) => ({\n token: r.token,\n id: r.resourceId,\n label: r.label,\n })),\n );\n\n const attachedKeys = new Set(\n rows.map((r) => attachedKey(r.token, r.resourceId)),\n );\n\n const handleDetach = async (row: ContainerResourceRow) => {\n setRemovingKeys((prev) => new Set(prev).add(row.key));\n const info = store.registry.tryGetEntityInfo(row.token);\n const res = info\n ? await adapter.detach(info.token, row.resourceId, row.role ?? undefined)\n : { ok: false };\n setRemovingKeys((prev) => {\n const next = new Set(prev);\n next.delete(row.key);\n return next;\n });\n return res;\n };\n\n const handlePin = async (row: ContainerResourceRow, pinned: boolean) => {\n if (!adapter.setPinned) return;\n const info = store.registry.tryGetEntityInfo(row.token);\n if (!info) return;\n setPinningKeys((prev) => new Set(prev).add(row.key));\n try {\n const res = await adapter.setPinned(\n info.token,\n row.resourceId,\n pinned,\n row.role ?? undefined,\n );\n if (!res.ok) {\n notifier.error(\n `Couldn't ${pinned ? \"pin\" : \"unpin\"} resource${res.error ? `: ${res.error}` : \"\"}`,\n );\n }\n } finally {\n setPinningKeys((prev) => {\n const next = new Set(prev);\n next.delete(row.key);\n return next;\n });\n }\n };\n\n const openRow = (row: ContainerResourceRow) => {\n if (props.openEntity) {\n props.openEntity(row.token, row.resourceId);\n return;\n }\n const info = store.registry.tryGetEntityInfo(row.token);\n const href = info?.hrefFor?.(row.resourceId);\n if (href && typeof window !== \"undefined\") {\n window.open(href, \"_blank\", \"noopener,noreferrer\");\n }\n };\n\n // role → token → rows, in registry role order.\n const grouped = groupRows(store, visibleRows);\n const isLoading = adapter.status === \"loading\" || adapter.status === \"idle\";\n const attachableTokens = tokenFilter ?? store.registry.listableTokens();\n\n return (\n <div className={cn(\"flex flex-col gap-2 text-foreground\", props.className)}>\n {/* ── header: count + universal attach ─────────────────────────── */}\n <div className=\"flex items-center justify-between gap-2 px-1\">\n <h3 className=\"flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wide text-muted-foreground\">\n <Link2Icon className=\"h-3.5 w-3.5\" />\n Resources\n {visibleRows.length > 0 && (\n <span className=\"rounded bg-muted px-1 text-[10px] font-medium text-muted-foreground\">\n {visibleRows.length}\n </span>\n )}\n </h3>\n <div className=\"flex items-center gap-1.5\">\n <button\n type=\"button\"\n onClick={() => setShowUniversal((v) => !v)}\n className={cn(\n \"inline-flex items-center gap-1 rounded-md border border-border px-1.5 py-0.5 text-[11px] transition-colors\",\n showUniversal\n ? \"bg-accent text-foreground\"\n : \"text-muted-foreground hover:bg-accent hover:text-foreground\",\n )}\n >\n <PlusIcon className=\"h-3 w-3\" />\n Add\n </button>\n <button\n type=\"button\"\n onClick={() => void adapter.reload()}\n title=\"Refresh\"\n className=\"text-muted-foreground/60 transition-colors hover:text-foreground\"\n >\n <RefreshIcon\n className={cn(\n \"h-3 w-3\",\n adapter.status === \"loading\" && \"animate-spin\",\n )}\n />\n </button>\n </div>\n </div>\n\n {/* ── universal search-attach ──────────────────────────────────── */}\n {showUniversal && (\n <div className=\"rounded-md border border-border/60 bg-muted/30 p-2 max-h-80 flex flex-col\">\n <UniversalAssociationPicker\n tokens={attachableTokens}\n orgId={container?.orgId ?? null}\n attachedKeys={attachedKeys}\n onAttach={(token, id, title) => adapter.attach(token, id, title)}\n onDetach={(token, id) => adapter.detach(token, id)}\n />\n </div>\n )}\n\n {/* ── error / loading / empty ──────────────────────────────────── */}\n {adapter.status === \"error\" && (\n <div className=\"flex items-center justify-between gap-2 rounded-md border border-destructive/40 bg-destructive/10 px-2.5 py-2\">\n <span className=\"truncate text-[11px] text-destructive\">\n {adapter.error || \"Failed to load resources\"}\n </span>\n <button\n type=\"button\"\n onClick={() => void adapter.reload()}\n className=\"text-[11px] font-medium text-destructive underline hover:no-underline\"\n >\n Retry\n </button>\n </div>\n )}\n {adapter.status !== \"error\" && isLoading && visibleRows.length === 0 && (\n <div className=\"space-y-1.5 px-1\">\n <Skeleton className=\"h-3 w-20\" />\n <Skeleton className=\"h-7 w-full rounded-md\" />\n <Skeleton className=\"h-7 w-3/4 rounded-md\" />\n </div>\n )}\n {adapter.status === \"ready\" && visibleRows.length === 0 && (\n <p className=\"px-1 py-1 text-[11px] text-muted-foreground\">\n Nothing attached yet — use Add to link anything.\n </p>\n )}\n\n {/* ── grouped rows ─────────────────────────────────────────────── */}\n {visibleRows.length > 0 && (\n <div className=\"space-y-2.5\">\n {grouped.map(({ role, tokens: tokenGroups }) => {\n const roleMeta = getContentRoleMeta(role);\n return (\n <div key={role} className=\"space-y-1.5\">\n {variant === \"full\" && (\n <div className=\"flex items-center gap-1.5 px-1\">\n <span\n className={cn(\n \"h-3 w-0.5 rounded-full\",\n roleMeta.accentBar,\n )}\n />\n <p\n className={cn(\n \"text-[10px] font-semibold uppercase tracking-wider\",\n roleMeta.accentText,\n )}\n >\n {roleMeta.title}\n </p>\n </div>\n )}\n {tokenGroups.map(({ info, token, rows: tokenRows }) => {\n const TokenIcon = info?.Icon ?? null;\n return (\n <div key={token} className=\"space-y-0.5\">\n <div className=\"flex items-center justify-between gap-1 px-1\">\n <p className=\"flex items-center gap-1 text-[10px] font-medium text-muted-foreground/80\">\n {TokenIcon ? <TokenIcon className=\"h-3 w-3\" /> : null}\n {info?.labelPlural ?? titleize(token)}\n <span className=\"text-muted-foreground/50\">\n {tokenRows.length}\n </span>\n </p>\n <div className=\"flex items-center gap-1\">\n {props.renderSectionActions && info\n ? props.renderSectionActions(info.token)\n : null}\n {info?.canListCandidates && (\n <button\n type=\"button\"\n onClick={() => setPickerToken(info.token)}\n title={`Add ${info.labelPlural}`}\n className=\"rounded p-0.5 text-muted-foreground/60 transition-colors hover:bg-accent hover:text-foreground\"\n >\n <PlusIcon className=\"h-3 w-3\" />\n </button>\n )}\n </div>\n </div>\n <ul className=\"space-y-0.5\">\n {tokenRows.map((row) => {\n const busy = removingKeys.has(row.key);\n const custom = props.renderRow?.(row, {\n title: titleFor({\n token: row.token,\n id: row.resourceId,\n label: row.label,\n }),\n busy,\n onDetach: () => void handleDetach(row),\n onOpen: () => openRow(row),\n });\n if (custom != null) {\n return <li key={row.key}>{custom}</li>;\n }\n return (\n <li key={row.key}>\n <div\n className={cn(\n \"group flex items-center gap-2 rounded-md px-2 py-1.5 text-sm transition-colors hover:bg-accent\",\n busy && \"opacity-50\",\n )}\n >\n {/* THE DOOR LAW via the doors seam: the\n container's `openEntity` wins when it has\n one; otherwise the host EntityRef (or the\n degraded hrefFor anchor) carries the\n new-tab door. A row with neither renders\n as plain text, so a link-styled title can\n never no-op. */}\n <DoorRef\n token={row.token}\n id={row.resourceId}\n name={titleFor({\n token: row.token,\n id: row.resourceId,\n label: row.label,\n })}\n showIcon={Boolean(TokenIcon)}\n onOpen={\n props.openEntity\n ? () => openRow(row)\n : undefined\n }\n openInNewTab={!props.openEntity}\n className=\"min-w-0 flex-1 text-foreground\"\n />\n {row.originRefs && row.originRefs.length > 0 ? (\n <span className=\"flex shrink-0 items-center gap-1 text-[10px] text-muted-foreground/60\">\n via\n {row.originRefs.map((origin) => (\n <DoorRef\n key={`${origin.token}:${origin.id}`}\n token={origin.token}\n id={origin.id}\n name={origin.label}\n showIcon={false}\n openInNewTab\n className=\"max-w-24 text-[10px] text-muted-foreground underline-offset-2\"\n />\n ))}\n </span>\n ) : row.originNote ? (\n <span className=\"shrink-0 text-[10px] text-muted-foreground/60\">\n {row.originNote}\n </span>\n ) : null}\n {adapter.setPinned && info && row.removable && (\n <button\n type=\"button\"\n disabled={pinningKeys.has(row.key)}\n onClick={() =>\n void handlePin(row, !(row.pinned ?? false))\n }\n title={\n row.pinned\n ? \"Unpin (stops staying in agent context)\"\n : \"Pin — always in agent context\"\n }\n aria-label={row.pinned ? \"Unpin\" : \"Pin\"}\n className={cn(\n \"shrink-0 rounded p-0.5 transition-colors hover:!text-foreground\",\n row.pinned\n ? \"text-primary\"\n : \"text-muted-foreground/0 group-hover:text-muted-foreground\",\n )}\n >\n {pinningKeys.has(row.key) ? (\n <SpinnerIcon className=\"h-3 w-3 animate-spin\" />\n ) : (\n <PinIcon\n className={cn(\n \"h-3 w-3\",\n row.pinned && \"fill-primary/20\",\n )}\n />\n )}\n </button>\n )}\n {row.removable && (\n <button\n type=\"button\"\n disabled={busy}\n onClick={() => void handleDetach(row)}\n title=\"Detach\"\n aria-label=\"Detach\"\n className=\"shrink-0 rounded p-0.5 text-muted-foreground/0 transition-colors group-hover:text-muted-foreground hover:!text-destructive disabled:opacity-50\"\n >\n {busy ? (\n <SpinnerIcon className=\"h-3 w-3 animate-spin\" />\n ) : (\n <XIcon className=\"h-3 w-3\" />\n )}\n </button>\n )}\n </div>\n </li>\n );\n })}\n </ul>\n </div>\n );\n })}\n </div>\n );\n })}\n </div>\n )}\n\n {/* ── per-token picker sheet ───────────────────────────────────── */}\n {pickerToken && (\n <AssociationPicker\n open\n onOpenChange={(open) => {\n if (!open) setPickerToken(null);\n }}\n token={pickerToken}\n {...(container?.label !== undefined\n ? { containerLabel: container.label }\n : {})}\n orgId={container?.orgId ?? null}\n attachedIds={\n new Set(\n rows\n .filter((r) => r.token === pickerToken)\n .map((r) => r.resourceId),\n )\n }\n onAttach={(id, title) => adapter.attach(pickerToken, id, title)}\n onDetach={(id) => adapter.detach(pickerToken, id)}\n />\n )}\n </div>\n );\n}\n\n// ─── helpers ─────────────────────────────────────────────────────────────────\n\ninterface TokenGroup {\n token: string;\n info: EntityInfo | null;\n rows: ContainerResourceRow[];\n}\ninterface RoleGroup {\n role: ContentRole;\n tokens: TokenGroup[];\n}\n\n/** role → token → rows; pinned rows first inside a token group. */\nfunction groupRows(\n store: { registry: { tryGetEntityInfo(token: string): EntityInfo | null } },\n rows: ContainerResourceRow[],\n): RoleGroup[] {\n const byToken = new Map<string, ContainerResourceRow[]>();\n for (const r of rows) {\n const list = byToken.get(r.token) ?? [];\n list.push(r);\n byToken.set(r.token, list);\n }\n const roleBuckets = new Map<ContentRole, TokenGroup[]>();\n for (const [token, tokenRows] of byToken) {\n const info = store.registry.tryGetEntityInfo(token);\n const role: ContentRole = info?.contentRole ?? \"destination\";\n tokenRows.sort(\n (a, b) => Number(b.pinned ?? false) - Number(a.pinned ?? false),\n );\n const groups = roleBuckets.get(role) ?? [];\n groups.push({ token, info, rows: tokenRows });\n roleBuckets.set(role, groups);\n }\n const out: RoleGroup[] = [];\n for (const meta of CONTENT_ROLES) {\n const tokens = roleBuckets.get(meta.id);\n if (tokens && tokens.length > 0) {\n tokens.sort((a, b) =>\n (a.info?.labelPlural ?? a.token).localeCompare(\n b.info?.labelPlural ?? b.token,\n ),\n );\n out.push({ role: meta.id, tokens });\n }\n }\n return out;\n}\n\nfunction titleize(token: string): string {\n return token\n .split(\"_\")\n .map((w) => (w ? (w[0] as string).toUpperCase() + w.slice(1) : w))\n .join(\" \");\n}\n\nexport default AssociationList;\n","// react/components/AssociationCaptureToolbar.tsx — @ai-matrx/associations/react\n//\n// THE shared capture toolbar for any container's association surface — the\n// upload / add-existing / create toolbar plus whole-body drag-and-drop.\n// Callback-pure and registry-driven: the host supplies ONE `attach` callback\n// (canonical tokens only — `file`, `udt_document`) and this component owns\n// the gesture end-to-end under the CREATE-then-ASSOCIATE contract: the\n// durable row is created FIRST through the host capture handlers, the edge\n// is written SECOND via the host's callback, and EVERY terminal outcome is\n// loud — a created-but-unlinked item is reported WITH its location, never\n// silently orphaned.\n//\n// Ported from matrx-frontend\n// `features/scopes/components/associations/AssociationCaptureToolbar.tsx`\n// (W4, 2026-08-29) with the measured seams inverted onto the CAPTURE port\n// (design Decision 2, per-handler optional — NEVER dead buttons):\n//\n// • `requestUpload` (files feature) → `capture.requestUpload` — the Upload\n// chip and body drag-and-drop render when it is bound, OR when the host\n// bound only the one-file primitive `capture.uploadFile`: since 0.6.0\n// (C23) the package ships the ENTIRE upload flow over that primitive\n// (batching, per-file outcomes, the loud created-but-unattached report),\n// so a host never has to build an upload pipeline to get one;\n// • `openFilePicker` (cloud-files pickers) → `capture.openFilePicker` —\n// the \"Add file\" chip renders only when bound;\n// • `createDocument` (data-tables) → `capture.createDataTable` — the\n// \"New document\" chip renders only when bound; the name is collected by\n// an INLINE input row (the original's TextInputDialog is host chrome);\n// the created document opens through the registry's `hrefFor` overlay\n// when one is registered for `udt_document`;\n// • the original's \"Add document\" picker (a host CommandDialog over\n// `listAccessibleDocuments`) has NO capture handler by design — hosts\n// append it via `extraActions`;\n// • `@/lib/toast` → the notifier port; console.error → the errorSink.\n//\n// Zero bound handlers → the toolbar renders only `children` (drag-and-drop\n// disabled too — a drop with no upload path must not swallow files).\n\nimport { useRef, useState, type DragEvent, type ReactNode } from \"react\";\nimport { Button, cn, Input } from \"@ai-matrx/design-system\";\n\nimport { useAssociationsStore, useAssociationsUiPorts, useNotifier } from \"../context\";\nimport type { EntityTypeToken } from \"../../entity-types.generated\";\nimport type { CaptureUploadOpts, CaptureUploadResult } from \"../../ports\";\nimport {\n FileTextIcon,\n FolderOpenIcon,\n PlusIcon,\n SpinnerIcon,\n UploadIcon,\n type IconProps,\n} from \"../icons\";\n\nexport interface CaptureAttachResult {\n ok: boolean;\n /** Human error text — the toolbar screams it. Omit when the host already did. */\n error?: string;\n}\n\n/**\n * ONE write callback for every capture verb. Tokens are canonical\n * (`file` / `udt_document`); the host maps to its own write path (an\n * association edge, a thread thunk, …) and reports the outcome honestly —\n * a silent no-op attach is the bug class this contract kills.\n */\nexport type CaptureAttach = (\n token: EntityTypeToken,\n resourceId: string,\n opts?: { label?: string },\n) => Promise<CaptureAttachResult>;\n\nexport interface AssociationCaptureToolbarProps {\n attach: CaptureAttach;\n /** Logical cloud-files folder new uploads land in (auto-created). */\n uploadFolderPath: string;\n /** Visibility stamped on uploads. Default \"personal\". */\n uploadVisibility?: string;\n /**\n * Where a created-but-unlinked upload is reported to live, e.g.\n * \"your Files (War Room folder)\". Keeps the loud-outcome copy honest.\n */\n uploadLocationLabel: string;\n /** The retry verb named in loud-outcome copy. Default '\"Add file\"'. */\n attachRetryLabel?: string;\n /** Copy for the existing-files picker dialog. */\n filePicker?: { title?: string; description?: string };\n /** Which built-in actions render (each ALSO gated on its port handler). */\n showActions?: {\n upload?: boolean;\n addFile?: boolean;\n newDocument?: boolean;\n };\n /** Hide the button row (compact variants) — drag-and-drop stays live. */\n showToolbar?: boolean;\n /** Extra host-specific buttons appended after the built-ins. */\n extraActions?: ReactNode;\n /** Open a freshly created document via the registry door. Default true. */\n openCreatedDocument?: boolean;\n className?: string;\n /** The body the drop target wraps (the list of attached things). */\n children?: ReactNode;\n}\n\nexport function AssociationCaptureToolbar({\n attach,\n uploadFolderPath,\n uploadVisibility = \"personal\",\n uploadLocationLabel,\n attachRetryLabel = '\"Add file\"',\n filePicker,\n showActions,\n showToolbar = true,\n extraActions,\n openCreatedDocument = true,\n className,\n children,\n}: AssociationCaptureToolbarProps) {\n const store = useAssociationsStore();\n const { capture } = useAssociationsUiPorts();\n const notifier = useNotifier();\n const fileInputRef = useRef<HTMLInputElement | null>(null);\n const [isUploading, setIsUploading] = useState(false);\n const [isDragOver, setIsDragOver] = useState(false);\n const [isPicking, setIsPicking] = useState(false);\n const [namingDoc, setNamingDoc] = useState(false);\n const [docName, setDocName] = useState(\"\");\n const [creatingDoc, setCreatingDoc] = useState(false);\n\n // The upload path: the host's full pipeline when bound, otherwise the\n // PACKAGE-SHIPPED flow over the one-file `uploadFile` primitive (C23).\n // Identical `CaptureUploadResult` shape either way, so every loud-outcome\n // branch below is written once.\n const hostRequestUpload = capture?.requestUpload;\n const hostUploadFile = capture?.uploadFile;\n const requestUploadPath: ((opts: CaptureUploadOpts) => Promise<CaptureUploadResult>) | undefined =\n hostRequestUpload\n ? (opts) => hostRequestUpload(opts)\n : hostUploadFile\n ? async (opts) => {\n const uploaded: string[] = [];\n const failed: { name: string; error: string }[] = [];\n for (const file of opts.files) {\n try {\n const result = await hostUploadFile(file, {\n folderPath: opts.folderPath,\n ...(opts.visibility !== undefined\n ? { visibility: opts.visibility }\n : {}),\n });\n if (result.ok) uploaded.push(result.id);\n else failed.push({ name: file.name, error: result.error });\n } catch (err: unknown) {\n failed.push({\n name: file.name,\n error:\n err instanceof Error && err.message\n ? err.message\n : \"Upload failed\",\n });\n }\n }\n return { uploaded, aliased: [], failed };\n }\n : undefined;\n\n // Per-handler optional (the design's degradation): a chip renders only\n // when its capture handler exists AND the host didn't hide it.\n const actions = {\n upload: (showActions?.upload ?? true) && Boolean(requestUploadPath),\n addFile: (showActions?.addFile ?? true) && Boolean(capture?.openFilePicker),\n newDocument:\n (showActions?.newDocument ?? true) && Boolean(capture?.createDataTable),\n };\n const canDrop = Boolean(requestUploadPath);\n\n // ── Files: upload from disk → attach each returned file id ───────────────\n //\n // CREATE-then-ASSOCIATE: the file row is created FIRST (durable — it lives\n // in the user's library under `uploadFolderPath` no matter what), the edge\n // is written SECOND, and EVERY terminal outcome is loud. A\n // created-but-unattached file is reported with its location — it must never\n // look like it \"just disappeared\".\n const uploadAndAttach = async (files: File[]) => {\n const requestUpload = requestUploadPath;\n if (files.length === 0 || !requestUpload) return;\n setIsUploading(true);\n // Watchdog: if the upload pipeline never settles (hung dialog promise,\n // dead transport), SAY so — a stuck-silent gesture is the bug class.\n const watchdog = setTimeout(() => {\n store.errorSink({\n code: \"capture_upload_unresponsive\",\n message:\n \"[AssociationCaptureToolbar] upload pipeline unresponsive >60s\",\n context: { files: files.map((f) => f.name) },\n });\n notifier.error(\n \"The upload isn't responding — it may be stalled. Check your connection and retry.\",\n );\n }, 60_000);\n try {\n const result = await requestUpload({\n files,\n folderPath: uploadFolderPath,\n visibility: uploadVisibility,\n });\n if (result.cancelled) {\n notifier.success(\"Upload cancelled — nothing was attached\");\n return;\n }\n const aliasedIds = result.aliased.map((a) => a.existingFileId);\n const ids = [...result.uploaded, ...aliasedIds];\n let attached = 0;\n const unattached: string[] = [];\n let firstAttachError: string | null = null;\n for (const id of ids) {\n const res = await attach(\"file\", id);\n if (res.ok) {\n attached += 1;\n } else {\n unattached.push(id);\n if (!firstAttachError && res.error) firstAttachError = res.error;\n }\n }\n if (attached > 0) {\n notifier.success(\n attached === 1 ? \"Attached 1 file\" : `Attached ${attached} files`,\n );\n }\n if (unattached.length > 0) {\n // The upload SUCCEEDED — the file exists in the library. Say so, and\n // say where, instead of letting it vanish.\n notifier.error(\n `Uploaded ${unattached.length === 1 ? \"1 file\" : `${unattached.length} files`} to ${uploadLocationLabel} but couldn't attach ${unattached.length === 1 ? \"it\" : \"them\"} here — use ${attachRetryLabel} to retry` +\n (firstAttachError ? ` (${firstAttachError})` : \"\"),\n );\n }\n if (result.failed.length > 0) {\n const first = result.failed[0];\n notifier.error(\n result.failed.length === 1 && first\n ? `Failed to upload ${first.name}: ${first.error}`\n : `Failed to upload ${result.failed.length} files`,\n );\n }\n if (ids.length === 0 && result.failed.length === 0) {\n // Guard-host edge case (everything skipped in the duplicate dialog\n // with no alias chosen) — never end a user gesture in silence.\n notifier.error(\"Nothing was uploaded or attached\");\n }\n } catch (err) {\n store.errorSink({\n code: \"capture_upload_failed\",\n message: \"[AssociationCaptureToolbar] upload flow failed\",\n context: { detail: err },\n });\n notifier.error(\n err instanceof Error && err.message\n ? `Upload failed: ${err.message}`\n : \"Upload failed unexpectedly\",\n );\n } finally {\n clearTimeout(watchdog);\n setIsUploading(false);\n }\n };\n\n const handleFilesSelected = (e: React.ChangeEvent<HTMLInputElement>) => {\n const files = e.target.files ? Array.from(e.target.files) : [];\n e.target.value = \"\";\n void uploadAndAttach(files);\n };\n\n // Drop a file anywhere on the body → upload + attach. Without this the most\n // natural gesture had NO handler — the browser navigated to the file with\n // zero feedback: the \"file just disappeared\" bug class. (Gated on the\n // upload handler existing: a drop zone with no upload path is a dead end.)\n const handleDrop = (e: DragEvent) => {\n if (!canDrop) return;\n e.preventDefault();\n e.stopPropagation();\n setIsDragOver(false);\n const files = Array.from(e.dataTransfer?.files ?? []);\n if (files.length === 0) return;\n void uploadAndAttach(files);\n };\n\n // ── Files: pick existing cloud files ──────────────────────────────────────\n const handlePickExisting = async () => {\n const openFilePicker = capture?.openFilePicker;\n if (isPicking || !openFilePicker) return;\n setIsPicking(true);\n try {\n const ids = await openFilePicker({\n multi: true,\n title: filePicker?.title ?? \"Attach files\",\n description:\n filePicker?.description ??\n \"Pick existing files from your cloud storage.\",\n });\n if (!ids || ids.length === 0) return;\n let attached = 0;\n let firstAttachError: string | null = null;\n for (const id of ids) {\n const res = await attach(\"file\", id);\n if (res.ok) attached += 1;\n else if (!firstAttachError && res.error) firstAttachError = res.error;\n }\n if (attached > 0) {\n notifier.success(\n attached === 1 ? \"Attached 1 file\" : `Attached ${attached} files`,\n );\n }\n if (attached < ids.length && firstAttachError) {\n // Hosts whose attach path screams its own failures return no `error`;\n // everyone else gets the loud outcome here.\n notifier.error(`Couldn't attach: ${firstAttachError}`);\n }\n } catch (err) {\n store.errorSink({\n code: \"capture_pick_failed\",\n message: \"[AssociationCaptureToolbar] attach-existing flow failed\",\n context: { detail: err },\n });\n notifier.error(\"Couldn't attach the selected files\");\n } finally {\n setIsPicking(false);\n }\n };\n\n // ── Documents ─────────────────────────────────────────────────────────────\n const handleCreateDoc = async () => {\n const createDataTable = capture?.createDataTable;\n const name = docName.trim();\n if (!name || creatingDoc || !createDataTable) return;\n setCreatingDoc(true);\n try {\n const doc = await createDataTable({ name });\n if (!doc) {\n notifier.error(\"Couldn't create the document\");\n return;\n }\n const res = await attach(\"udt_document\", doc.id, { label: name });\n setNamingDoc(false);\n setDocName(\"\");\n if (res.ok) {\n notifier.success(\"Document created\");\n if (openCreatedDocument && typeof window !== \"undefined\") {\n const href = store.registry\n .tryGetEntityInfo(\"udt_document\")\n ?.hrefFor?.(doc.id);\n if (href) window.open(href, \"_blank\", \"noopener,noreferrer\");\n }\n } else {\n // Created but not linked — the document exists; never let it vanish.\n notifier.error(\n `Created \"${name}\" but couldn't attach it here — it's saved in your documents; retry from its library`,\n );\n }\n } catch (err) {\n store.errorSink({\n code: \"capture_create_document_failed\",\n message: \"[AssociationCaptureToolbar] create-document flow failed\",\n context: { detail: err },\n });\n notifier.error(\"Couldn't create the document\");\n } finally {\n setCreatingDoc(false);\n }\n };\n\n const anyBuiltIn = actions.upload || actions.addFile || actions.newDocument;\n\n return (\n <div\n className={cn(\n \"relative flex h-full min-h-0 flex-col\",\n isDragOver && \"ring-2 ring-inset ring-primary/50\",\n className,\n )}\n onDragOver={(e) => {\n if (!canDrop) return;\n if (!e.dataTransfer?.types.includes(\"Files\")) return;\n e.preventDefault();\n e.stopPropagation();\n setIsDragOver(true);\n }}\n onDragLeave={(e) => {\n if (e.currentTarget.contains(e.relatedTarget as Node)) return;\n setIsDragOver(false);\n }}\n onDrop={handleDrop}\n >\n {isDragOver ? (\n <div className=\"pointer-events-none absolute inset-0 z-10 grid place-items-center bg-background/70\">\n <span className=\"flex items-center gap-2 rounded-md border border-primary/40 bg-card px-3 py-1.5 text-xs font-medium text-foreground\">\n <UploadIcon className=\"size-3.5 text-primary\" />\n Drop to upload &amp; attach\n </span>\n </div>\n ) : null}\n <input\n ref={fileInputRef}\n type=\"file\"\n multiple\n className=\"sr-only\"\n onChange={handleFilesSelected}\n />\n\n {/* ── capture toolbar ────────────────────────────────────────────── */}\n {showToolbar && (anyBuiltIn || extraActions) ? (\n <div className=\"flex flex-wrap items-center gap-0.5 border-b border-border/60 px-1.5 py-1\">\n {namingDoc ? (\n <div className=\"flex flex-1 items-center gap-1.5 py-0.5\">\n <Input\n autoFocus\n value={docName}\n disabled={creatingDoc}\n placeholder=\"Document name…\"\n onChange={(e) => setDocName(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === \"Enter\") void handleCreateDoc();\n if (e.key === \"Escape\") {\n setNamingDoc(false);\n setDocName(\"\");\n }\n }}\n className=\"h-7 flex-1 text-base md:text-xs\"\n style={{ fontSize: 16 }}\n />\n <button\n type=\"button\"\n disabled={creatingDoc || !docName.trim()}\n onClick={() => void handleCreateDoc()}\n className=\"flex h-7 items-center rounded-md bg-primary px-2 text-[11px] font-medium text-primary-foreground disabled:opacity-50\"\n >\n {creatingDoc ? (\n <SpinnerIcon className=\"size-3.5 animate-spin\" />\n ) : (\n \"Create\"\n )}\n </button>\n <button\n type=\"button\"\n disabled={creatingDoc}\n onClick={() => {\n setNamingDoc(false);\n setDocName(\"\");\n }}\n className=\"flex h-7 items-center rounded-md border border-border px-2 text-[11px] text-muted-foreground hover:text-foreground disabled:opacity-50\"\n >\n Cancel\n </button>\n </div>\n ) : (\n <>\n {actions.upload ? (\n <CaptureToolbarAction\n icon={isUploading ? SpinnerIcon : UploadIcon}\n spinning={isUploading}\n label=\"Upload\"\n onClick={() => !isUploading && fileInputRef.current?.click()}\n disabled={isPicking || isUploading}\n />\n ) : null}\n {actions.addFile ? (\n <CaptureToolbarAction\n icon={isPicking ? SpinnerIcon : FolderOpenIcon}\n spinning={isPicking}\n label=\"Add file\"\n onClick={() => void handlePickExisting()}\n disabled={isPicking || isUploading}\n />\n ) : null}\n {(actions.upload || actions.addFile) && actions.newDocument ? (\n <span className=\"mx-1 h-4 w-px bg-border\" />\n ) : null}\n {actions.newDocument ? (\n <CaptureToolbarAction\n icon={creatingDoc ? SpinnerIcon : PlusIcon}\n spinning={creatingDoc}\n label=\"New document\"\n onClick={() => setNamingDoc(true)}\n disabled={creatingDoc}\n />\n ) : null}\n {extraActions}\n </>\n )}\n </div>\n ) : null}\n\n {children}\n </div>\n );\n}\n\n// ── toolbar chrome ──────────────────────────────────────────────────────────\n\n/** The dense toolbar button (exported so hosts' extraActions match). */\nexport function CaptureToolbarAction({\n icon: Icon,\n label,\n onClick,\n disabled,\n spinning,\n}: {\n icon: (props: IconProps) => ReactNode;\n label: string;\n onClick: () => void;\n disabled?: boolean;\n spinning?: boolean;\n}) {\n return (\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"ghost\"\n onClick={onClick}\n disabled={disabled}\n className=\"h-7 gap-1 px-2 text-[11px] text-muted-foreground hover:text-foreground\"\n >\n <Icon className={cn(\"size-3.5\", spinning && \"animate-spin\")} />\n {label}\n </Button>\n );\n}\n\n/** The document-file glyph, exported for host extraActions parity. */\nexport { FileTextIcon as CaptureDocumentIcon };\n","// react/lazyPorts.tsx — @ai-matrx/associations/react\n//\n// THE package-owned bundle-split seam (0.6.0, C23 § framework differences).\n//\n// Before this module every host hand-wrote the same `next/dynamic({ssr:false})`\n// glue to keep a heavy port binding (a window manager, a canonical file\n// browser) out of its boot bundle — mechanical seam code, rebuilt per app,\n// each one a chance to get `ssr`, the `loading` fallback or the `.then(m =>\n// m.X)` unwrap wrong. The split is a PACKAGE concern; these two helpers own\n// it once, for every framework we ship on.\n//\n// They are deliberately framework-AGNOSTIC — `React.lazy` + `Suspense`, no\n// `next/dynamic`, no `next` peer dependency. `ssr: false` is not needed and\n// never was: both ports are only ever RENDERED after a user gesture opens a\n// window, so the loader fires client-side and the module never enters a\n// server render. Next.js, Vite, the Tauri shell and Jest all handle it the\n// same way, and the consumer's own bundler creates the real chunk.\n//\n// Usage in a host binding (the whole of it):\n//\n// windowShell: {\n// Window: lazyWindowShell(() =>\n// import(\"./hostWindows\").then((m) => m.AssociationsWindowShellImpl)),\n// },\n// pickerOverrides: {\n// file: lazyPickerOverride(() =>\n// import(\"./hostPickers\").then((m) => m.FileAssociationPickerImpl)),\n// },\n\nimport { Suspense, lazy, type ComponentType, type ReactNode } from \"react\";\n\nimport type { AssociationPickerProps, WindowShellPort } from \"../ports\";\n\n/** What a `windowShell.Window` component receives. */\nexport interface WindowShellComponentProps {\n id: string;\n title: string;\n onClose(): void;\n children: ReactNode;\n}\n\n/**\n * Wrap `React.lazy` so the loader may resolve EITHER a bare component or a\n * `{ default }` module — hosts reach for `.then(m => m.Named)` reflexively\n * and both spellings must work, not one of them silently.\n */\nfunction lazyComponent<P>(\n load: () => Promise<ComponentType<P> | { default: ComponentType<P> }>,\n): ComponentType<P> {\n return lazy(async () => {\n const loaded = await load();\n return typeof loaded === \"function\" ? { default: loaded } : loaded;\n });\n}\n\n/**\n * Split a host window component off the boot bundle. The returned component\n * satisfies `WindowShellPort[\"Window\"]` exactly; the chunk fetches the first\n * time an association window opens.\n */\nexport function lazyWindowShell(\n load: () => Promise<\n | ComponentType<WindowShellComponentProps>\n | { default: ComponentType<WindowShellComponentProps> }\n >,\n): WindowShellPort[\"Window\"] {\n const Loaded = lazyComponent<WindowShellComponentProps>(load);\n return function LazyWindowShell(props: WindowShellComponentProps) {\n // `null` while the chunk arrives: a window opens on a click and the\n // chunk lands in a frame or two — a skeleton window would flash worse\n // than nothing. Failure is NOT silent: a rejected chunk throws into the\n // host's error boundary rather than leaving a dead surface.\n return (\n <Suspense fallback={null}>\n <Loaded {...props} />\n </Suspense>\n );\n };\n}\n\n/**\n * Split a host per-token picker override off the boot bundle. The returned\n * component satisfies the `pickerOverrides` map's value type exactly.\n */\nexport function lazyPickerOverride(\n load: () => Promise<\n | ComponentType<AssociationPickerProps>\n | { default: ComponentType<AssociationPickerProps> }\n >,\n): ComponentType<AssociationPickerProps> {\n const Loaded = lazyComponent<AssociationPickerProps>(load);\n return function LazyPickerOverride(props: AssociationPickerProps) {\n // Gated on `open` as well as Suspense: an override registered for a\n // token must not fetch its chunk until that picker is actually opened.\n if (!props.open) return null;\n return (\n <Suspense fallback={null}>\n <Loaded {...props} />\n </Suspense>\n );\n };\n}\n","// react/hooks/useAssociationPickerBridge.ts — @ai-matrx/associations/react\n//\n// THE loud-outcome engine for a per-token picker OVERRIDE (0.6.0, C22).\n//\n// A host that registers its own canonical browser for a token (matrx-frontend\n// registers its file picker for `file`) still owes the package's contract:\n// every attach/detach reports honestly, a partial batch says exactly what\n// landed and what did not, and an attach the RPC refuses can never look like\n// an inert click (the QA F1 bug class, feedback 35d311a9). That is package\n// logic — failure semantics, retry copy, sink routing — and until 0.6.0 every\n// override re-implemented it by hand in host code. It lives here now: an\n// override binds this hook and writes only the two lines that call it.\n//\n// const bridge = useAssociationPickerBridge(props, {\n// createdLocationLabel: \"your Files\",\n// openCreatedLocation: { label: \"Open Files\", onClick: () => … },\n// });\n// <HostPicker onUpload={(f) => bridge.attachMany(f.map(toItem))}\n// onPick={(s) => bridge.toggle(toItem(s))} />\n\nimport { useCallback, useState } from \"react\";\n\nimport type { AssociationPickerProps } from \"../../ports\";\nimport { useAssociationsStore, useNotifier } from \"../context\";\n\n/** One thing the host's picker produced or selected. */\nexport interface PickerBridgeItem {\n id: string;\n /** Human name — used verbatim in every loud outcome. */\n name: string;\n}\n\nexport interface AssociationPickerBridgeOptions {\n /**\n * Where an item that was CREATED but could not be attached now lives\n * (\"your Files\"). Keeps the created-but-unlinked message honest instead of\n * letting the item look like it vanished.\n */\n createdLocationLabel?: string;\n /** An action offered on that message, e.g. a door to the library. */\n openCreatedLocation?: { label: string; onClick: () => void };\n /** Noun used in copy. Default \"item\". */\n itemNoun?: string;\n}\n\nexport interface AssociationPickerBridge {\n /**\n * Attach a batch (the host's post-upload hand-off). Every terminal outcome\n * is loud: successes are confirmed, failures name the item AND where it\n * lives, and a thrown attach is captured to the errorSink.\n */\n attachMany(items: PickerBridgeItem[]): Promise<void>;\n /** Attach-or-detach one item, screaming on refusal. */\n toggle(item: PickerBridgeItem): Promise<void>;\n /** True while a batch or toggle is in flight (drive the host's spinner). */\n busy: boolean;\n}\n\nexport function useAssociationPickerBridge(\n props: Pick<\n AssociationPickerProps,\n \"attachedIds\" | \"onAttach\" | \"onDetach\" | \"token\"\n >,\n options: AssociationPickerBridgeOptions = {},\n): AssociationPickerBridge {\n const store = useAssociationsStore();\n const notifier = useNotifier();\n const [busy, setBusy] = useState(false);\n\n const { attachedIds, onAttach, onDetach, token } = props;\n const {\n createdLocationLabel,\n openCreatedLocation,\n itemNoun = \"item\",\n } = options;\n\n const attachMany = useCallback(\n async (items: PickerBridgeItem[]) => {\n if (items.length === 0) return;\n setBusy(true);\n const failed: { name: string; error?: string | undefined }[] = [];\n try {\n for (const item of items) {\n try {\n const result = await onAttach(item.id, item.name);\n if (!result.ok) {\n failed.push({ name: item.name, error: result.error });\n }\n } catch (error: unknown) {\n store.errorSink({\n code: \"picker_attach_threw\",\n message: `[associations] attaching ${itemNoun} \"${item.name}\" threw`,\n context: { token, id: item.id, detail: error },\n });\n failed.push({\n name: item.name,\n error: error instanceof Error ? error.message : undefined,\n });\n }\n }\n const attached = items.length - failed.length;\n if (attached > 0) {\n notifier.success(\n attached === 1\n ? `Attached 1 ${itemNoun}`\n : `Attached ${attached} ${itemNoun}s`,\n );\n }\n if (failed.length > 0) {\n const first = failed[0];\n const detail = first?.error ? ` (${first.error})` : \"\";\n notifier.error(\n failed.length === 1\n ? `Couldn't attach \"${first?.name ?? itemNoun}\"${detail}`\n : `Couldn't attach ${failed.length} ${itemNoun}s${detail}`,\n {\n ...(createdLocationLabel\n ? {\n description: `The ${failed.length === 1 ? itemNoun + \" is\" : itemNoun + \"s are\"} safe in ${createdLocationLabel}. You can retry the association here.`,\n }\n : {}),\n ...(openCreatedLocation ? { action: openCreatedLocation } : {}),\n },\n );\n store.errorSink({\n code: \"picker_attach_partial\",\n message: `[associations] ${failed.length} of ${items.length} ${itemNoun}s were not attached`,\n context: { token, failed },\n });\n }\n } finally {\n setBusy(false);\n }\n },\n [\n createdLocationLabel,\n itemNoun,\n notifier,\n onAttach,\n openCreatedLocation,\n store,\n token,\n ],\n );\n\n const toggle = useCallback(\n async (item: PickerBridgeItem) => {\n setBusy(true);\n try {\n const detaching = attachedIds.has(item.id);\n const result = detaching\n ? await onDetach(item.id)\n : await onAttach(item.id, item.name);\n if (!result.ok) {\n const verb = detaching ? \"detach\" : \"attach\";\n notifier.error(\n `Couldn't ${verb} \"${item.name}\"` +\n (result.error ? `: ${result.error}` : \"\"),\n );\n store.errorSink({\n code: detaching ? \"picker_detach_failed\" : \"picker_attach_failed\",\n message: `[associations] ${verb} refused for \"${item.name}\"`,\n context: { token, id: item.id, error: result.error },\n });\n }\n } catch (error: unknown) {\n store.errorSink({\n code: \"picker_toggle_threw\",\n message: `[associations] toggling ${itemNoun} \"${item.name}\" threw`,\n context: { token, id: item.id, detail: error },\n });\n notifier.error(`Couldn't update \"${item.name}\"`);\n } finally {\n setBusy(false);\n }\n },\n [attachedIds, itemNoun, notifier, onAttach, onDetach, store, token],\n );\n\n return { attachMany, toggle, busy };\n}\n","// react/components/AssociationEntitySelect.tsx — @ai-matrx/associations/react\n//\n// The canonical \"name dropdown\" for one kind of associated entity on a\n// container — ONE compact control that handles every aspect of the name:\n//\n// 1. DISPLAY — the active entity's real name (registry icon beside it)\n// 2. RENAME — click (or double-click) the name to edit it inline\n// 3. SWITCH — a chevron opens the full list of associated entities,\n// searchable, with the active one checked\n// 4. ADD NEW — the list ends with \"+ New <Entity>\"; the user types a name\n// and the new entity is created, associated to the container,\n// and made active\n// 5. REMOVE — non-active rows offer an unlink X (when the adapter\n// supports detach)\n//\n// The dropdown is ALWAYS available — even with a single (or zero) entities —\n// so \"add another\" is never hidden. Registry-driven (icon/labels from the\n// store's registry merge engine), Redux-free, and adapter-driven: pass the\n// default `useAssociationEntitySelectAdapter` for plain platform.associations\n// containers, or a bespoke adapter when the surface has its own lifecycle\n// (e.g. war-room threads with is_active edge metadata).\n//\n// Ported VERBATIM from matrx-frontend\n// `features/scopes/components/associations/AssociationEntitySelect.tsx`\n// (W4 completion, 2026-08-29 — the face was gated on design-system 0.3.0's\n// Command family). Seams inverted:\n// • `getEntityInfo` → `store.registry.getEntityInfo` (host overlay merged;\n// `Icon: null` → the package `DefaultEntityIcon`);\n// • `@/lib/toast` → the notifier port (warn-once degradation);\n// • `EntityDoorControls` → the `DoorControlsSlot` (host port when bound,\n// otherwise the package's shipped hrefFor anchor — 0.6.0, C23) (absent →\n// the name renders without doors, per the design's degradation table);\n// • lucide glyphs → the package's inlined SVGs (C19);\n// • Popover/Command/EditableLabel → `@ai-matrx/design-system` (>=0.3.0).\n//\n// THE DOOR LAW: the name this control shows is a real record, so it carries its\n// doors — but the name itself CANNOT be a link (clicking it starts an inline\n// rename), so the door controls ride beside it as a sibling: peek, plus a\n// new tab. Same-tab open is withheld on purpose — this control lives in a\n// toolbar above live work (a war-room tile, a notes pane), and navigating away\n// would throw that work away to answer \"what is this thing?\". Every row in the\n// switcher gets the same doors.\n\nimport { useState } from \"react\";\nimport {\n cn,\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n EditableLabel,\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from \"@ai-matrx/design-system\";\n\nimport type { EntityTypeToken } from \"../../entity-types.generated\";\nimport { useAssociationsStore, useAssociationsUiPorts, useNotifier } from \"../context\";\nimport type { AssociationEntitySelectAdapter } from \"../hooks/useAssociationEntitySelect\";\nimport { DoorControlsSlot } from \"./entityDoors\";\nimport {\n CheckIcon,\n ChevronDownIcon,\n DefaultEntityIcon,\n PlusIcon,\n SpinnerIcon,\n XIcon,\n} from \"../icons\";\n\nexport interface AssociationEntitySelectProps {\n token: EntityTypeToken;\n adapter: AssociationEntitySelectAdapter;\n className?: string;\n /** Label sizing/typography override (defaults to toolbar-dense text-xs). */\n labelClassName?: string;\n align?: \"start\" | \"end\";\n showIcon?: boolean;\n /** How the name enters inline edit. Default \"click\". */\n renameActivation?: \"click\" | \"doubleClick\";\n /** Shown while no entity is active yet. Defaults to the plural label. */\n emptyLabel?: string;\n /** Icon color accent (e.g. \"text-yellow-500\" for notes). */\n iconClassName?: string;\n /**\n * Replaces the default \"+ New <Entity>\" name-input footer with a custom\n * creator (e.g. an agent picker that starts a new chat). Function form\n * receives `close` so the creator can dismiss the dropdown when done.\n */\n createSlot?: React.ReactNode | ((close: () => void) => React.ReactNode);\n}\n\nexport function AssociationEntitySelect({\n token,\n adapter,\n className,\n labelClassName,\n align = \"end\",\n showIcon = true,\n renameActivation = \"click\",\n emptyLabel,\n iconClassName,\n createSlot,\n}: AssociationEntitySelectProps) {\n const store = useAssociationsStore();\n const notifier = useNotifier();\n const info = store.registry.getEntityInfo(token);\n const InfoIcon = info.Icon ?? DefaultEntityIcon;\n const { items, activeId } = adapter;\n const active = items.find((i) => i.id === activeId) ?? null;\n const activeIndex = active ? items.indexOf(active) : -1;\n\n const [open, setOpen] = useState(false);\n const [query, setQuery] = useState(\"\");\n const [creating, setCreating] = useState(false);\n const [draftName, setDraftName] = useState(\"\");\n const [busy, setBusy] = useState(false);\n\n const entityLabel = info.label.toLowerCase();\n const close = () => {\n setOpen(false);\n setQuery(\"\");\n setCreating(false);\n setDraftName(\"\");\n };\n\n const create = async (title: string) => {\n const name = title.trim();\n if (!name || busy || !adapter.createAndAttach) return;\n setBusy(true);\n const id = await adapter.createAndAttach(name);\n setBusy(false);\n if (id) close();\n else notifier.error(`Couldn't create the ${entityLabel}`);\n };\n\n return (\n <div\n className={cn(\n \"group/entity-ref flex min-w-0 items-center gap-0.5\",\n className,\n )}\n >\n {showIcon ? (\n <InfoIcon\n className={cn(\n \"size-3.5 shrink-0\",\n iconClassName ?? \"text-muted-foreground\",\n )}\n aria-hidden\n />\n ) : null}\n\n {active ? (\n <EditableLabel\n value={active.title}\n onCommit={async (next) => {\n const ok = await adapter.rename(active.id, next);\n if (!ok) {\n notifier.error(`Couldn't rename the ${entityLabel}`);\n throw new Error(\"rename failed\");\n }\n }}\n commitMode=\"await\"\n activation={renameActivation}\n ariaLabel={info.label}\n className={cn(\"max-w-[14rem]\", labelClassName)}\n displayClassName=\"text-xs font-medium text-foreground\"\n inputClassName=\"text-xs font-medium\"\n />\n ) : null}\n\n {active ? (\n <DoorControlsSlot token={token} id={active.id} name={active.title} />\n ) : null}\n\n {!active ? (\n <span\n className={cn(\n \"truncate px-1 text-xs font-medium text-muted-foreground\",\n labelClassName,\n )}\n >\n {adapter.loading ? \"…\" : (emptyLabel ?? info.labelPlural)}\n </span>\n ) : null}\n\n <Popover\n open={open}\n onOpenChange={(next) => (next ? setOpen(true) : close())}\n >\n <PopoverTrigger asChild>\n <button\n type=\"button\"\n className=\"inline-flex h-6 shrink-0 items-center gap-0.5 rounded-md px-1 text-[10px] font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-foreground\"\n title={`Switch or add ${info.labelPlural.toLowerCase()}`}\n aria-label={`Switch or add ${info.labelPlural.toLowerCase()}`}\n >\n {items.length > 1 ? (\n <span className=\"tabular-nums\">\n {activeIndex >= 0 ? activeIndex + 1 : \"—\"}/{items.length}\n </span>\n ) : null}\n <ChevronDownIcon className=\"size-3 opacity-60\" />\n </button>\n </PopoverTrigger>\n <PopoverContent className=\"w-60 p-0\" align={align}>\n <Command>\n {items.length > 5 ? (\n <CommandInput\n value={query}\n onValueChange={setQuery}\n placeholder={`Search ${info.labelPlural.toLowerCase()}…`}\n />\n ) : null}\n <CommandList>\n <CommandEmpty>No match.</CommandEmpty>\n {items.length > 0 ? (\n <CommandGroup>\n {items.map((item) => (\n <CommandItem\n key={item.id}\n value={`${item.title} ${item.id}`}\n onSelect={() => {\n if (item.id !== activeId)\n void adapter.setActive(item.id);\n close();\n }}\n className=\"group/entity-ref group gap-2\"\n >\n <CheckIcon\n className={cn(\n \"size-3.5 shrink-0\",\n item.id === activeId ? \"opacity-100\" : \"opacity-0\",\n )}\n />\n <span className=\"min-w-0 flex-1 truncate\">\n {item.title}\n </span>\n {/* Doors, as siblings of the row's select handler.\n `onPointerDown` is swallowed for the same reason the\n unlink button below swallows it: cmdk would otherwise\n take focus and select the row out from under the\n control. */}\n <span\n className=\"inline-flex shrink-0 items-center\"\n onPointerDown={(e) => {\n e.preventDefault();\n e.stopPropagation();\n }}\n >\n <DoorControlsSlot\n token={token}\n id={item.id}\n name={item.title}\n />\n </span>\n {adapter.detach && item.id !== activeId ? (\n <button\n type=\"button\"\n onPointerDown={(e) => {\n e.preventDefault();\n e.stopPropagation();\n }}\n onClick={(e) => {\n e.stopPropagation();\n void adapter.detach?.(item.id);\n }}\n className=\"grid size-5 shrink-0 place-items-center rounded text-muted-foreground opacity-0 transition-opacity hover:bg-accent hover:text-destructive group-hover:opacity-100\"\n title={`Remove this ${entityLabel} from here (does not delete it)`}\n aria-label={`Remove ${item.title}`}\n >\n <XIcon className=\"size-3\" />\n </button>\n ) : null}\n </CommandItem>\n ))}\n </CommandGroup>\n ) : null}\n </CommandList>\n\n {/* Create footer — outside CommandList so search never hides it. */}\n {createSlot !== undefined ? (\n <div className=\"border-t border-border p-1\">\n {typeof createSlot === \"function\"\n ? createSlot(close)\n : createSlot}\n </div>\n ) : null}\n {createSlot === undefined && adapter.createAndAttach ? (\n <div className=\"border-t border-border p-1\">\n {creating ? (\n <div className=\"flex items-center gap-1 px-1 py-0.5\">\n <input\n autoFocus\n type=\"text\"\n value={draftName}\n disabled={busy}\n placeholder={`New ${entityLabel} name…`}\n onChange={(e) => setDraftName(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === \"Enter\") {\n e.preventDefault();\n void create(draftName);\n } else if (e.key === \"Escape\") {\n e.preventDefault();\n e.stopPropagation();\n setCreating(false);\n setDraftName(\"\");\n }\n }}\n className=\"h-6 w-full min-w-0 rounded-sm bg-transparent px-1 text-base outline-none focus:bg-background focus:ring-1 focus:ring-ring md:text-xs\"\n aria-label={`New ${entityLabel} name`}\n />\n <button\n type=\"button\"\n disabled={busy || !draftName.trim()}\n onClick={() => void create(draftName)}\n className=\"inline-flex h-6 shrink-0 items-center rounded-md px-1.5 text-[10px] font-medium text-primary transition-colors hover:bg-accent disabled:opacity-50\"\n >\n {busy ? (\n <SpinnerIcon className=\"size-3 animate-spin\" />\n ) : (\n \"Create\"\n )}\n </button>\n </div>\n ) : (\n <button\n type=\"button\"\n disabled={busy}\n onClick={() => {\n // A typed search that matched nothing doubles as the new\n // name — one click instead of retyping it.\n if (query.trim()) void create(query);\n else setCreating(true);\n }}\n className=\"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground\"\n >\n {busy ? (\n <SpinnerIcon className=\"size-3.5 animate-spin\" />\n ) : (\n <PlusIcon className=\"size-3.5\" />\n )}\n {query.trim()\n ? `Create \"${query.trim()}\"`\n : `New ${info.label}`}\n </button>\n )}\n </div>\n ) : null}\n </Command>\n </PopoverContent>\n </Popover>\n </div>\n );\n}\n","// react/components/CategorySelect.tsx — @ai-matrx/associations/react\n//\n// THE single-value picker over one `platform.categories` dimension. ONE\n// component for every category anywhere in the app: pass the `dimension` and it\n// renders that facet's categories, hierarchy and all. There is no per-feature\n// copy and there must never be one — the rules do not change between features.\n//\n// Value is the category ID (the FK the consuming table stores), display is the\n// category name. Reads and writes go through the canonical `useCategories`\n// hook (`cat_list` / `cat_create`), never a bespoke query.\n//\n// 🚨 IT TAKES NEW INPUT (P23). Type a name that does not exist and it offers to\n// create it, then selects it — because the moment someone wants to teach the\n// system a category they did not have is the moment worth the most, and a\n// picker that says \"choose from these\" instead is how the platform loses its\n// best users. Its multi-select sibling `CategoryTagPicker` has always done\n// this; the two were inconsistent for no reason, and now are not.\n//\n// Creating requires an explicit organization — a new category belongs to that\n// organization, never to a resolver default or the system set (those are\n// platform-governed; `isSystem` rows are read-only here by design).\n//\n// Ported VERBATIM from matrx-frontend\n// `features/scopes/components/CategorySelect.tsx` (W4 completion, 2026-08-29 —\n// the face was gated on design-system 0.3.0's CreatablePicker + Select).\n// Seams inverted:\n// • the Redux active-organization read (`selectOrganizationId`) → the\n// identity port's optional `ensureOrgId()` (the design's seam-table home\n// for org resolution): `orgId` prop wins; otherwise `ensureOrgId()` is\n// asked; with neither, create refuses LOUDLY (notifier + errorSink) —\n// never a row stamped with a guessed org;\n// • `@/lib/toast` → the notifier port (warn-once degradation);\n// • `useCategories`/`buildCategoryHierarchy` → the package's own;\n// • the lucide `CornerDownRight` → the package's inlined SVG (C19);\n// • CreatablePicker/Select → `@ai-matrx/design-system` (>=0.3.0).\n\nimport { useState } from \"react\";\nimport {\n CreatablePicker,\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"@ai-matrx/design-system\";\n\nimport type { CategoryDimension } from \"../../edges\";\nimport { buildCategoryHierarchy } from \"../../core/categoryHierarchy\";\nimport { useAssociationsStore, useNotifier } from \"../context\";\nimport { useCategories } from \"../hooks/useCategories\";\nimport { CornerDownRightIcon } from \"../icons\";\n\nconst NONE = \"__none__\";\nconst ROOT_PARENT = \"__root__\";\n\n/** \"category\" → \"categories\", \"stage\" → \"stages\". Copy a person reads. */\nfunction plural(noun: string): string {\n return /[^aeiou]y$/i.test(noun) ? `${noun.slice(0, -1)}ies` : `${noun}s`;\n}\n\nexport interface CategorySelectProps {\n dimension: CategoryDimension;\n value: string | null;\n onChange: (id: string | null) => void;\n placeholder: string;\n allowNone?: boolean;\n disabled?: boolean;\n /**\n * Offer \"Create «what you typed»\". On by default — a closed category list is\n * a defect, so turning this off needs a reason a person would accept.\n */\n allowCreate?: boolean;\n /**\n * Org for an inline-created category. Defaults to the identity port's\n * `ensureOrgId()`; with neither, create refuses loudly.\n */\n orgId?: string | null;\n /** What one of these is called, for the create affordance (\"stage\", \"folder\"). */\n noun?: string;\n}\n\nexport function CategorySelect({\n dimension,\n value,\n onChange,\n placeholder,\n allowNone = true,\n disabled,\n allowCreate = true,\n orgId,\n noun = \"category\",\n}: CategorySelectProps) {\n const store = useAssociationsStore();\n const notifier = useNotifier();\n const {\n categories,\n status,\n error,\n create: createCategory,\n reload,\n } = useCategories({ dimension });\n const hierarchy = buildCategoryHierarchy(categories);\n const [createParentId, setCreateParentId] = useState<string>(ROOT_PARENT);\n\n const options = [\n ...(allowNone\n ? [{ value: NONE, label: \"None\", keywords: \"none clear empty\" }]\n : []),\n ...(hierarchy.hasHierarchy\n ? hierarchy.items.map(({ category, depth, parent }) => ({\n value: category.id,\n label: category.name,\n // The type-ahead matches the parent's name too, so someone who knows\n // the branch but not the leaf still finds it.\n keywords: parent ? parent.name : \"\",\n render:\n depth === 0 ? (\n <span className=\"font-medium\">{category.name}</span>\n ) : (\n <span className=\"flex items-center gap-1.5 pl-3 text-muted-foreground\">\n <CornerDownRightIcon className=\"h-3.5 w-3.5 shrink-0\" />\n <span className=\"text-foreground\">{category.name}</span>\n </span>\n ),\n }))\n : categories.map((category) => ({\n value: category.id,\n label: category.name,\n }))),\n ];\n\n const selected = value\n ? (hierarchy.items.find((item) => item.category.id === value)?.displayName ??\n categories.find((category) => category.id === value)?.name ??\n null)\n : null;\n\n const create = async (typed: string): Promise<string | null> => {\n const name = typed.trim();\n if (!name) return null;\n // Typing a name that already exists selects it rather than making a twin.\n const existing = categories.find(\n (category) => category.name.toLowerCase() === name.toLowerCase(),\n );\n if (existing) return existing.id;\n\n let resolvedOrgId = orgId ?? null;\n if (!resolvedOrgId && store.identity.ensureOrgId) {\n try {\n resolvedOrgId = await store.identity.ensureOrgId();\n } catch (e) {\n store.errorSink({\n code: \"ensure_org_failed\",\n message: \"[CategorySelect] identity.ensureOrgId threw\",\n context: { error: e instanceof Error ? e.message : String(e) },\n });\n }\n }\n if (!resolvedOrgId) {\n notifier.error(`Select an organization before creating a ${noun}.`);\n return null;\n }\n const parentId =\n hierarchy.hasHierarchy && createParentId !== ROOT_PARENT\n ? createParentId\n : null;\n const result = await createCategory({ name, orgId: resolvedOrgId, parentId });\n if (!result.ok || !result.id) {\n notifier.error(`Couldn't create that ${noun}`, {\n ...(result.error != null ? { description: result.error } : {}),\n });\n return null;\n }\n await reload();\n setCreateParentId(ROOT_PARENT);\n const under = parentId\n ? categories.find((category) => category.id === parentId)?.name\n : null;\n notifier.success(\n `“${name}” is now one of your ${plural(noun)}${\n under\n ? ` — it sits under ${under}, and every screen that offers ${plural(noun)} offers it.`\n : ` — every screen that offers ${plural(noun)} offers it from now on.`\n }`,\n );\n return result.id;\n };\n\n return (\n <div>\n <CreatablePicker\n value={value ?? (allowNone ? NONE : null)}\n onSelect={(next) => onChange(next === NONE ? null : next)}\n options={options}\n placeholder={placeholder}\n searchPlaceholder={\n allowCreate ? `Search or add a ${noun}…` : `Search ${plural(noun)}…`\n }\n noun={noun}\n ariaLabel={placeholder}\n // The old control was h-8/text-sm; keeping it means none of the twelve\n // consuming forms shift when they pick this up.\n className=\"text-sm\"\n {...(disabled !== undefined ? { disabled } : {})}\n loading={status === \"loading\"}\n emptyLabel={`No ${noun} matches that.`}\n {...(allowCreate ? { onCreate: create } : {})}\n {...(allowCreate && hierarchy.hasHierarchy\n ? {\n createExtra: (\n <Select value={createParentId} onValueChange={setCreateParentId}>\n <SelectTrigger\n className=\"h-7 text-xs\"\n aria-label={`Put the new ${noun} under`}\n >\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value={ROOT_PARENT} className=\"text-xs\">\n Top level\n </SelectItem>\n {hierarchy.items\n .filter((item) => item.depth === 0)\n .map((item) => (\n <SelectItem\n key={item.category.id}\n value={item.category.id}\n className=\"text-xs\"\n >\n Under {item.category.name}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n ),\n }\n : {})}\n />\n {selected === null && value !== null ? (\n // A stored id whose row this reader cannot see is not \"nothing chosen\":\n // saying so beats a blank box that looks like an unsaved field.\n <p className=\"mt-1 text-xs text-muted-foreground\">\n This {noun} is no longer available to you.\n </p>\n ) : null}\n {error ? <p className=\"mt-1 text-xs text-destructive\">{error}</p> : null}\n </div>\n );\n}\n","// core/categoryHierarchy.ts — @ai-matrx/associations/core\n//\n// The canonical two-level display order for one category facet — ported\n// VERBATIM from matrx-frontend `features/scopes/utils/categoryHierarchy.ts`\n// (W4 completion, 2026-08-29). Pure data → data, React-free, so it lives in\n// /core beside the category service; the `CategorySelect` /\n// `CategoryTagPicker` faces are its measured consumers.\n\nimport type { PlatformCategory } from \"../edges\";\n\nexport interface CategoryHierarchyItem {\n category: PlatformCategory;\n depth: 0 | 1;\n parent: PlatformCategory | null;\n displayName: string;\n}\n\nexport interface CategoryHierarchy {\n items: CategoryHierarchyItem[];\n roots: PlatformCategory[];\n hasHierarchy: boolean;\n}\n\n/**\n * Turns the RPC's ordered flat rows into the canonical two-level display order.\n * Flat facets retain their exact input order. Invalid/orphaned rows remain\n * visible at the root; the database guard prevents new ones from being made.\n */\nexport function buildCategoryHierarchy(\n categories: PlatformCategory[],\n): CategoryHierarchy {\n const byId = new Map(categories.map((category) => [category.id, category]));\n const hasHierarchy = categories.some(\n (category) => category.parentId !== null && byId.has(category.parentId),\n );\n\n if (!hasHierarchy) {\n return {\n items: categories.map((category) => ({\n category,\n depth: 0,\n parent: null,\n displayName: category.name,\n })),\n roots: categories.filter((category) => category.parentId === null),\n hasHierarchy: false,\n };\n }\n\n const roots = categories.filter(\n (category) => category.parentId === null || !byId.has(category.parentId),\n );\n const childrenByParent = new Map<string, PlatformCategory[]>();\n for (const category of categories) {\n if (!category.parentId || !byId.has(category.parentId)) continue;\n const children = childrenByParent.get(category.parentId) ?? [];\n children.push(category);\n childrenByParent.set(category.parentId, children);\n }\n\n const items: CategoryHierarchyItem[] = [];\n const seen = new Set<string>();\n for (const root of roots) {\n items.push({\n category: root,\n depth: 0,\n parent: null,\n displayName: root.name,\n });\n seen.add(root.id);\n\n for (const child of childrenByParent.get(root.id) ?? []) {\n items.push({\n category: child,\n depth: 1,\n parent: root,\n displayName: `${root.name} / ${child.name}`,\n });\n seen.add(child.id);\n }\n }\n\n // Loud database guards make this fallback unreachable for valid data, but a\n // picker must never hide an identity merely because older data is malformed.\n for (const category of categories) {\n if (seen.has(category.id)) continue;\n items.push({\n category,\n depth: 0,\n parent: null,\n displayName: category.name,\n });\n }\n\n return {\n items,\n roots: categories.filter((category) => category.parentId === null),\n hasHierarchy: true,\n };\n}\n","// react/components/CategoryTagPicker.tsx — @ai-matrx/associations/react\n//\n// THE multi-select picker that tags an entity with `platform.categories` rows\n// through the canonical association edge (`entity → category`, one typed edge\n// role per use). The generic form of the flashcards FolderTagPicker — that\n// component is a thin wrapper over this one, and CRM party roles consume\n// it directly. Never fork a per-feature tag picker.\n//\n// Reads/writes go through the canonical `useCategories` (category nouns) +\n// `useAssociations` (assignment edges) hooks — never a bespoke table or a\n// direct service call.\n//\n// EDGE SEMANTICS: `setTargets` replaces ALL of this entity's category edges\n// carrying `edgeRole`. To keep edges from OTHER dimensions that share the same\n// role intact, the toggle set starts from every current category edge with\n// this role (not just this dimension's) — same contract FolderTagPicker\n// established. Prefer a distinct edge role per dimension when registering\n// association pairs.\n//\n// Ported VERBATIM from matrx-frontend\n// `features/scopes/components/CategoryTagPicker.tsx` (W4 completion,\n// 2026-08-29 — the face was gated on design-system 0.3.0's Command family +\n// Select). Seams inverted:\n// • `ensureOrgId` (`@/lib/organizations/personalOrg` — the host-shaped\n// personal-org resolver) → the identity port's optional `ensureOrgId()`\n// per the design's seam table: the `orgId` prop wins; otherwise\n// `identity.ensureOrgId()` is asked; with neither, create refuses LOUDLY\n// (notifier + errorSink) — never a row stamped with a guessed org;\n// • `@/lib/toast` → the notifier port; `console.error` → the errorSink;\n// • `useCategories`/`useAssociations`/`buildCategoryHierarchy` → the\n// package's own;\n// • lucide glyphs → the package's inlined SVGs (C19); the `icon` prop's\n// `LucideIcon` type → a structural icon component type;\n// • Button/Popover/Command/Badge/Select → `@ai-matrx/design-system`\n// (>=0.3.0).\n\nimport { useState, type ComponentType } from \"react\";\nimport {\n Badge,\n Button,\n cn,\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n Popover,\n PopoverContent,\n PopoverTrigger,\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"@ai-matrx/design-system\";\n\nimport type { CategoryDimension } from \"../../edges\";\nimport { buildCategoryHierarchy } from \"../../core/categoryHierarchy\";\nimport { useAssociationsStore, useNotifier } from \"../context\";\nimport { useAssociations } from \"../hooks/useAssociations\";\nimport { useCategories } from \"../hooks/useCategories\";\nimport {\n CheckIcon,\n ChevronsUpDownIcon,\n CornerDownRightIcon,\n SpinnerIcon,\n TagIcon,\n XIcon,\n} from \"../icons\";\n\nconst ROOT_PARENT = \"__root__\";\n\n/** Structural stand-in for the host's `LucideIcon` on the `icon` prop. */\nexport type TagPickerIcon = ComponentType<{ className?: string }>;\n\nexport interface CategoryTagPickerProps {\n /** The tagged entity's registered association type (e.g. \"fc_set\", \"party\"). */\n entityType: string;\n entityId: string;\n /** The `platform.categories` facet the picker offers. */\n dimension: CategoryDimension;\n /** The typed edge role the assignment edges carry (e.g. \"theme\", \"member\"). */\n edgeRole: string;\n /**\n * Org for the edge write and for inline-created categories. Defaults to the\n * identity port's `ensureOrgId()` (create only) — pass the owning entity's\n * org when it has one.\n */\n orgId?: string | null;\n /** Trigger label while nothing is selected. */\n addLabel?: string;\n /** Trigger icon. */\n icon?: TagPickerIcon;\n /** Offer \"Create <term>\" for unmatched search terms. Default true. */\n allowCreate?: boolean;\n /**\n * Force the two-level face on or off. Omit to detect it from parentId rows,\n * which leaves every existing flat facet visually unchanged.\n */\n hierarchical?: boolean;\n emptyText?: string;\n}\n\n/**\n * Multi-select combobox: badges for the entity's current tags in `dimension`,\n * a popover to toggle existing categories, optional inline create. Fully\n * self-contained — mount it once per entity and it reads/writes the edges.\n */\nexport function CategoryTagPicker({\n entityType,\n entityId,\n dimension,\n edgeRole,\n orgId,\n addLabel = \"Add tag\",\n icon: Icon = TagIcon,\n allowCreate = true,\n hierarchical,\n emptyText = \"No categories yet.\",\n}: CategoryTagPickerProps) {\n const store = useAssociationsStore();\n const notifier = useNotifier();\n const [open, setOpen] = useState(false);\n const [creating, setCreating] = useState(false);\n // Writes replace the full role-set from a render-time snapshot of the\n // edges, so overlapping toggles would silently drop the first change.\n // One write at a time.\n const [writing, setWriting] = useState(false);\n const [search, setSearch] = useState(\"\");\n const [createParentId, setCreateParentId] = useState(ROOT_PARENT);\n const {\n categories,\n create: createCategory,\n reload: reloadCategories,\n } = useCategories({ dimension });\n const { edges, setTargets } = useAssociations({\n type: entityType,\n id: entityId,\n });\n const hierarchy = buildCategoryHierarchy(categories);\n const showHierarchy = hierarchical ?? hierarchy.hasHierarchy;\n const hierarchyById = new Map(\n hierarchy.items.map((item) => [item.category.id, item]),\n );\n\n // Every current category edge with this role — INCLUDING other dimensions'\n // (see EDGE SEMANTICS above); display intersects with this dimension.\n const selectedIds = new Set(\n edges\n .filter(\n (e) =>\n e.direction === \"outgoing\" &&\n e.otherType === \"category\" &&\n e.role === edgeRole,\n )\n .map((e) => e.otherId),\n );\n const selected = categories.filter((c) => selectedIds.has(c.id));\n\n const toggle = async (categoryId: string) => {\n if (writing) return;\n setWriting(true);\n try {\n const next = selectedIds.has(categoryId)\n ? [...selectedIds].filter((id) => id !== categoryId)\n : [...selectedIds, categoryId];\n const res = await setTargets({\n targetType: \"category\",\n targetIds: next,\n ...(orgId != null ? { orgId } : {}),\n role: edgeRole,\n });\n if (!res.ok) {\n store.errorSink({\n code: \"category_tag_set_targets_failed\",\n message: \"[CategoryTagPicker] setTargets failed\",\n context: { entityType, entityId, edgeRole, error: res.error },\n });\n notifier.error(res.error ?? \"Could not update categories\");\n }\n } finally {\n setWriting(false);\n }\n };\n\n const createAndAttach = async () => {\n const name = search.trim();\n if (!name) return;\n setCreating(true);\n try {\n let resolvedOrgId = orgId ?? null;\n if (!resolvedOrgId && store.identity.ensureOrgId) {\n try {\n resolvedOrgId = await store.identity.ensureOrgId();\n } catch (e) {\n store.errorSink({\n code: \"ensure_org_failed\",\n message: \"[CategoryTagPicker] identity.ensureOrgId threw\",\n context: { error: e instanceof Error ? e.message : String(e) },\n });\n }\n }\n if (!resolvedOrgId) {\n store.errorSink({\n code: \"ensure_org_missing\",\n message:\n \"[CategoryTagPicker] no org for the created category — pass \" +\n \"`orgId` or bind `identity.ensureOrgId` on the store config\",\n context: { entityType, entityId, dimension },\n });\n notifier.error(\n \"Could not create the category — no organization is selected\",\n );\n return;\n }\n const parentId =\n showHierarchy && createParentId !== ROOT_PARENT ? createParentId : null;\n const createRes = await createCategory({\n name,\n orgId: resolvedOrgId,\n parentId,\n });\n if (!createRes.ok || !createRes.id) {\n store.errorSink({\n code: \"category_tag_create_failed\",\n message: \"[CategoryTagPicker] create failed\",\n context: { dimension, error: createRes.error },\n });\n notifier.error(createRes.error ?? \"Could not create the category\");\n return;\n }\n await reloadCategories();\n await toggle(createRes.id);\n setSearch(\"\");\n setCreateParentId(ROOT_PARENT);\n } finally {\n setCreating(false);\n }\n };\n\n const filtered = categories.filter((c) =>\n c.name.toLowerCase().includes(search.trim().toLowerCase()),\n );\n const filteredHierarchy = hierarchy.items.filter((item) =>\n item.displayName.toLowerCase().includes(search.trim().toLowerCase()),\n );\n const exactMatch = categories.some(\n (c) => c.name.toLowerCase() === search.trim().toLowerCase(),\n );\n\n return (\n <div className=\"flex flex-wrap items-center gap-1.5\">\n {selected.map((c) => (\n <Badge\n key={c.id}\n variant=\"secondary\"\n className=\"gap-1 pr-1 text-xs font-medium\"\n >\n {showHierarchy\n ? (hierarchyById.get(c.id)?.displayName ?? c.name)\n : c.name}\n <button\n type=\"button\"\n onClick={() => void toggle(c.id)}\n className=\"ml-0.5 rounded-full p-0.5 hover:bg-muted-foreground/20\"\n aria-label={`Remove ${c.name}`}\n >\n <XIcon className=\"h-2.5 w-2.5\" />\n </button>\n </Badge>\n ))}\n\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <Button\n variant=\"outline\"\n size=\"sm\"\n className=\"h-7 gap-1 px-2 text-xs\"\n >\n <Icon className=\"h-3.5 w-3.5\" />\n {selected.length === 0 ? addLabel : \"Edit\"}\n <ChevronsUpDownIcon className=\"h-3 w-3 opacity-50\" />\n </Button>\n </PopoverTrigger>\n <PopoverContent className=\"w-56 p-0\" align=\"start\">\n <Command shouldFilter={false}>\n <CommandInput\n placeholder={allowCreate ? \"Search or create...\" : \"Search...\"}\n value={search}\n onValueChange={setSearch}\n />\n <CommandList>\n <CommandEmpty className=\"px-2 py-3 text-xs text-muted-foreground\">\n {search.trim() ? \"No match.\" : emptyText}\n </CommandEmpty>\n <CommandGroup>\n {showHierarchy\n ? filteredHierarchy.map(({ category, depth, parent }) => (\n <CommandItem\n key={category.id}\n value={category.id}\n keywords={parent ? [parent.name, category.name] : []}\n onSelect={() => void toggle(category.id)}\n className={cn(\"text-xs\", depth === 1 && \"pl-6\")}\n >\n <CheckIcon\n className={cn(\n \"mr-2 h-3.5 w-3.5\",\n selectedIds.has(category.id)\n ? \"opacity-100\"\n : \"opacity-0\",\n )}\n />\n {depth === 1 ? (\n <CornerDownRightIcon className=\"mr-1.5 h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n ) : null}\n <span className={cn(depth === 0 && \"font-medium\")}>\n {category.name}\n </span>\n </CommandItem>\n ))\n : filtered.map((c) => (\n <CommandItem\n key={c.id}\n value={c.id}\n onSelect={() => void toggle(c.id)}\n className=\"text-xs\"\n >\n <CheckIcon\n className={cn(\n \"mr-2 h-3.5 w-3.5\",\n selectedIds.has(c.id) ? \"opacity-100\" : \"opacity-0\",\n )}\n />\n {c.name}\n </CommandItem>\n ))}\n </CommandGroup>\n {allowCreate && search.trim() && !exactMatch ? (\n <CommandGroup>\n {showHierarchy ? (\n <div className=\"space-y-1.5 px-2 pb-2\">\n <p className=\"text-[11px] font-medium text-muted-foreground\">\n Place in\n </p>\n <Select\n value={createParentId}\n onValueChange={setCreateParentId}\n >\n <SelectTrigger size=\"sm\" className=\"bg-background\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value={ROOT_PARENT}>Top level</SelectItem>\n {hierarchy.roots.map((root) => (\n <SelectItem key={root.id} value={root.id}>\n {root.name}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n ) : null}\n <CommandItem\n value={`__create__${search}`}\n onSelect={() => void createAndAttach()}\n disabled={creating}\n className=\"text-xs text-primary\"\n >\n {creating ? (\n <SpinnerIcon className=\"mr-2 h-3.5 w-3.5 animate-spin\" />\n ) : (\n <Icon className=\"mr-2 h-3.5 w-3.5\" />\n )}\n Create &ldquo;{search.trim()}&rdquo;\n </CommandItem>\n </CommandGroup>\n ) : null}\n </CommandList>\n </Command>\n </PopoverContent>\n </Popover>\n </div>\n );\n}\n","// react/components/CommentThread.tsx — @ai-matrx/associations/react\n//\n// THE canonical comments UI (W6, ruling C4: built IN the package — a\n// greenfield build; no matrx-frontend components existed to port). Drop it on\n// any surface with a bound AssociationsProvider and hand it an entity:\n//\n// <CommentThread token=\"task\" id={taskId} />\n//\n// One threaded comment list over the `platform.comments` primitive\n// (`useComments` → the /core store → the four `cmt_*` demanded RPCs):\n// top-level comments oldest→newest with nested replies, a composer, per-item\n// reply, and edit/delete-own — the RPCs are the authority on who may write\n// (edit is author-only, delete is author-or-org-member); the UI only gates\n// the AFFORDANCES by the lenient identity read, so a stale gate degrades to\n// a loud server refusal, never a silent success.\n//\n// Ports and degradations:\n// • authorDisplay (optional) — host profile enrichment; absent → the\n// RPC's denormalized author fields, \"Unknown user\" + initial avatar as\n// the last resort. Never blank.\n// • entityDoors.EntityRef (optional) — author names become doors to the\n// user entity; absent → plain text names.\n// • notifier (optional) — failure toasts; absent → the provider's\n// documented warn-once + errorSink routing. Failures ALSO render inline.\n// • Chrome from @ai-matrx/design-system (peer >=0.3.0); glyphs inlined\n// (C19).\n//\n// Destructive-click law: Delete stops and names the consequence inline\n// (\"Deletes this comment (and its replies' context) for everyone.\") before\n// the destructive click exists. Composer text is NEVER lost on a failed\n// post — the body stays in the box alongside the inline error.\n\nimport { useState, type FormEvent, type ReactNode } from \"react\";\nimport { Button, Skeleton, cn } from \"@ai-matrx/design-system\";\n\nimport type { PlatformComment } from \"../../comments\";\nimport type { EntityTypeToken } from \"../../entity-types.generated\";\nimport type { AuthorDisplayPort, EntityDoorsPort } from \"../../ports\";\nimport { useAssociationsUiPorts, useNotifier } from \"../context\";\nimport { useComments, type UseCommentsReturn } from \"../hooks/useComments\";\nimport { CornerDownRightIcon, RefreshIcon, SpinnerIcon } from \"../icons\";\nimport { formatRelativeTime } from \"../relativeTime\";\n\n/** The token the author-name door opens (auth users surface as `user`). */\nconst AUTHOR_DOOR_TOKEN = \"user\";\n\nexport interface CommentThreadProps {\n /** Entity-type token of the commented-on entity. */\n token: EntityTypeToken;\n /** The entity's row id. */\n id: string;\n /** Org override forwarded to `cmt_add` (the RPC resolves one when omitted). */\n orgId?: string | null;\n /** Hide the slim \"Comments · n\" header row. Defaults to shown. */\n showHeader?: boolean;\n className?: string;\n}\n\n// ─── author chrome (authorDisplay + entityDoors degradations) ───────────────\n\ninterface ResolvedAuthor {\n name: string;\n avatarUrl: string | null;\n userId: string | null;\n}\n\nfunction resolveAuthor(\n comment: PlatformComment,\n authorDisplay: AuthorDisplayPort | undefined,\n): ResolvedAuthor {\n const base = {\n userId: comment.createdBy,\n email: comment.author.email,\n displayName: comment.author.displayName,\n avatarUrl: comment.author.avatarUrl,\n };\n const enriched = authorDisplay ? authorDisplay(base) : null;\n const name =\n enriched?.displayName ??\n base.displayName ??\n base.email ??\n \"Unknown user\";\n return {\n name,\n avatarUrl:\n enriched?.avatarUrl !== undefined && enriched?.avatarUrl !== null\n ? enriched.avatarUrl\n : base.avatarUrl,\n userId: comment.createdBy,\n };\n}\n\nfunction AuthorAvatar({ author }: { author: ResolvedAuthor }) {\n if (author.avatarUrl) {\n return (\n <img\n src={author.avatarUrl}\n alt=\"\"\n className=\"h-6 w-6 shrink-0 rounded-full object-cover\"\n />\n );\n }\n return (\n <span\n aria-hidden\n className=\"flex h-6 w-6 shrink-0 select-none items-center justify-center rounded-full bg-muted text-[11px] font-medium uppercase text-muted-foreground\"\n >\n {author.name.trim().charAt(0) || \"?\"}\n </span>\n );\n}\n\nfunction AuthorName({\n author,\n entityDoors,\n}: {\n author: ResolvedAuthor;\n entityDoors: EntityDoorsPort | undefined;\n}) {\n const DoorRef = entityDoors?.EntityRef;\n if (DoorRef && author.userId) {\n return (\n <DoorRef\n token={AUTHOR_DOOR_TOKEN}\n id={author.userId}\n name={author.name}\n showIcon={false}\n className=\"text-sm font-medium text-foreground\"\n />\n );\n }\n return (\n <span className=\"text-sm font-medium text-foreground\">{author.name}</span>\n );\n}\n\n// ─── composer ───────────────────────────────────────────────────────────────\n\nexport interface CommentComposerProps {\n /** Post the body; resolve `{ok:false}` to keep the text + show the error. */\n onSubmit: (body: string) => Promise<{ ok: boolean; error?: string }>;\n placeholder?: string;\n submitLabel?: string;\n /** Initial body (the edit flow seeds the current text). */\n initialValue?: string;\n /** Rendered right of the submit button (the Cancel affordance). */\n trailing?: ReactNode;\n autoFocus?: boolean;\n}\n\n/**\n * The one composer every comment write goes through (new comment, reply,\n * edit). Submit on the button or Cmd/Ctrl+Enter; the text survives a failed\n * submit alongside the inline error (input is never lost).\n */\nexport function CommentComposer({\n onSubmit,\n placeholder = \"Write a comment…\",\n submitLabel = \"Comment\",\n initialValue = \"\",\n trailing,\n autoFocus = false,\n}: CommentComposerProps) {\n const notifier = useNotifier();\n const [body, setBody] = useState(initialValue);\n const [submitting, setSubmitting] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n async function submit(e?: FormEvent) {\n e?.preventDefault();\n const trimmed = body.trim();\n if (!trimmed || submitting) return;\n setSubmitting(true);\n setError(null);\n const res = await onSubmit(trimmed);\n setSubmitting(false);\n if (!res.ok) {\n const msg = res.error ?? \"Could not save the comment\";\n setError(msg);\n notifier.error(msg);\n return; // the body stays — user input is never lost\n }\n setBody(\"\");\n }\n\n return (\n <form onSubmit={submit} className=\"flex flex-col gap-1.5\">\n <textarea\n value={body}\n onChange={(e) => setBody(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === \"Enter\" && (e.metaKey || e.ctrlKey)) void submit();\n }}\n placeholder={placeholder}\n rows={2}\n autoFocus={autoFocus}\n aria-label={placeholder}\n className=\"w-full resize-y rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring\"\n />\n {error && (\n <p role=\"alert\" className=\"text-xs text-destructive\">\n {error}\n </p>\n )}\n <div className=\"flex items-center gap-2\">\n <Button type=\"submit\" size=\"sm\" disabled={!body.trim() || submitting}>\n {submitting && (\n <SpinnerIcon className=\"mr-1 h-3 w-3 animate-spin\" />\n )}\n {submitLabel}\n </Button>\n {trailing}\n </div>\n </form>\n );\n}\n\n// ─── one comment (recursive) ────────────────────────────────────────────────\n\ninterface CommentItemProps {\n comment: PlatformComment;\n childrenOf: Map<string, PlatformComment[]>;\n depth: number;\n thread: UseCommentsReturn;\n orgId: string | null | undefined;\n}\n\nfunction CommentItem({\n comment,\n childrenOf,\n depth,\n thread,\n orgId,\n}: CommentItemProps) {\n const { authorDisplay, entityDoors } = useAssociationsUiPorts();\n const notifier = useNotifier();\n const [replying, setReplying] = useState(false);\n const [editing, setEditing] = useState(false);\n const [confirmingDelete, setConfirmingDelete] = useState(false);\n const [deleting, setDeleting] = useState(false);\n\n const author = resolveAuthor(comment, authorDisplay);\n const isOwn =\n thread.currentUserId !== null &&\n comment.createdBy === thread.currentUserId;\n const edited = comment.updatedAt !== comment.createdAt;\n const replies = childrenOf.get(comment.id) ?? [];\n\n async function confirmDelete() {\n setDeleting(true);\n const res = await thread.remove(comment.id);\n setDeleting(false);\n setConfirmingDelete(false);\n if (!res.ok) {\n notifier.error(res.error ?? \"Could not delete the comment\");\n }\n }\n\n return (\n <div\n data-comment-id={comment.id}\n className={cn(\n \"flex flex-col gap-1\",\n depth > 0 && \"border-l border-border pl-3\",\n )}\n >\n <div className=\"flex items-center gap-2\">\n <AuthorAvatar author={author} />\n <AuthorName author={author} entityDoors={entityDoors} />\n <span\n className=\"text-xs text-muted-foreground\"\n title={comment.createdAt}\n >\n {formatRelativeTime(comment.createdAt)}\n </span>\n {edited && (\n <span\n className=\"text-xs text-muted-foreground\"\n title={comment.updatedAt}\n >\n (edited)\n </span>\n )}\n </div>\n\n {editing ? (\n <div className=\"pl-8\">\n <CommentComposer\n initialValue={comment.body}\n submitLabel=\"Save\"\n placeholder=\"Edit your comment…\"\n autoFocus\n onSubmit={async (body) => {\n const res = await thread.edit(comment.id, body);\n if (res.ok) setEditing(false);\n return res;\n }}\n trailing={\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"ghost\"\n onClick={() => setEditing(false)}\n >\n Cancel\n </Button>\n }\n />\n </div>\n ) : (\n <p className=\"whitespace-pre-wrap pl-8 text-sm text-foreground\">\n {comment.body}\n </p>\n )}\n\n {!editing && (\n <div className=\"flex items-center gap-1 pl-7\">\n {confirmingDelete ? (\n <>\n <span className=\"text-xs text-destructive\">\n Deletes this comment for everyone.\n </span>\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"destructive\"\n disabled={deleting}\n onClick={() => void confirmDelete()}\n >\n {deleting && (\n <SpinnerIcon className=\"mr-1 h-3 w-3 animate-spin\" />\n )}\n Delete\n </Button>\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"ghost\"\n disabled={deleting}\n onClick={() => setConfirmingDelete(false)}\n >\n Cancel\n </Button>\n </>\n ) : (\n <>\n <button\n type=\"button\"\n onClick={() => setReplying((v) => !v)}\n className=\"rounded px-1.5 py-0.5 text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground\"\n >\n Reply\n </button>\n {isOwn && (\n <>\n <button\n type=\"button\"\n onClick={() => setEditing(true)}\n className=\"rounded px-1.5 py-0.5 text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground\"\n >\n Edit\n </button>\n <button\n type=\"button\"\n onClick={() => setConfirmingDelete(true)}\n className=\"rounded px-1.5 py-0.5 text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-destructive\"\n >\n Delete\n </button>\n </>\n )}\n </>\n )}\n </div>\n )}\n\n {replying && (\n <div className=\"flex items-start gap-2 pl-8 pt-1\">\n <CornerDownRightIcon className=\"mt-2 h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n <div className=\"min-w-0 flex-1\">\n <CommentComposer\n submitLabel=\"Reply\"\n placeholder={`Reply to ${author.name}…`}\n autoFocus\n onSubmit={async (body) => {\n const res = await thread.add(body, {\n parentId: comment.id,\n orgId: orgId ?? null,\n });\n if (res.ok) setReplying(false);\n return res;\n }}\n trailing={\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"ghost\"\n onClick={() => setReplying(false)}\n >\n Cancel\n </Button>\n }\n />\n </div>\n </div>\n )}\n\n {replies.length > 0 && (\n <div className=\"flex flex-col gap-3 pl-8 pt-1\">\n {replies.map((reply) => (\n <CommentItem\n key={reply.id}\n comment={reply}\n childrenOf={childrenOf}\n depth={depth + 1}\n thread={thread}\n orgId={orgId}\n />\n ))}\n </div>\n )}\n </div>\n );\n}\n\n// ─── the thread face ────────────────────────────────────────────────────────\n\n/**\n * Build the parent→children index. A reply whose parent is missing from the\n * list (soft-deleted parent, partial page) is promoted to top level rather\n * than dropped — every visible comment stays reachable.\n */\nexport function buildCommentTree(comments: readonly PlatformComment[]): {\n roots: PlatformComment[];\n childrenOf: Map<string, PlatformComment[]>;\n} {\n const byId = new Set(comments.map((c) => c.id));\n const roots: PlatformComment[] = [];\n const childrenOf = new Map<string, PlatformComment[]>();\n for (const c of comments) {\n if (c.parentId && byId.has(c.parentId)) {\n const bucket = childrenOf.get(c.parentId);\n if (bucket) bucket.push(c);\n else childrenOf.set(c.parentId, [c]);\n } else {\n roots.push(c);\n }\n }\n return { roots, childrenOf };\n}\n\nexport function CommentThread({\n token,\n id,\n orgId,\n showHeader = true,\n className,\n}: CommentThreadProps) {\n const thread = useComments({ token, id });\n const { roots, childrenOf } = buildCommentTree(thread.comments);\n const loading =\n (thread.status === \"loading\" || thread.status === \"idle\") &&\n thread.comments.length === 0;\n\n return (\n <section className={cn(\"flex flex-col gap-3\", className)}>\n {showHeader && (\n <header className=\"flex items-center gap-2\">\n <h3 className=\"text-sm font-semibold text-foreground\">Comments</h3>\n <span className=\"text-xs text-muted-foreground tabular-nums\">\n {thread.comments.length}\n </span>\n <button\n type=\"button\"\n onClick={() => void thread.reload()}\n aria-label=\"Refresh comments\"\n title=\"Refresh comments\"\n className=\"ml-auto flex h-6 w-6 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-accent hover:text-foreground\"\n >\n {thread.status === \"loading\" ? (\n <SpinnerIcon className=\"h-3.5 w-3.5 animate-spin\" />\n ) : (\n <RefreshIcon className=\"h-3.5 w-3.5\" />\n )}\n </button>\n </header>\n )}\n\n {thread.error && (\n <div\n role=\"alert\"\n className=\"flex items-center gap-2 rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs text-destructive\"\n >\n <span className=\"min-w-0 flex-1\">{thread.error}</span>\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"outline\"\n disabled={thread.status === \"loading\"}\n onClick={() => void thread.reload()}\n >\n Retry\n </Button>\n </div>\n )}\n\n {loading ? (\n <div className=\"flex flex-col gap-3\" aria-hidden data-testid=\"comments-loading\">\n <Skeleton className=\"h-12 w-full\" />\n <Skeleton className=\"h-12 w-4/5\" />\n </div>\n ) : roots.length === 0 && !thread.error ? (\n <p className=\"text-sm text-muted-foreground\">No comments yet.</p>\n ) : (\n <div className=\"flex flex-col gap-4\">\n {roots.map((comment) => (\n <CommentItem\n key={comment.id}\n comment={comment}\n childrenOf={childrenOf}\n depth={0}\n thread={thread}\n orgId={orgId}\n />\n ))}\n </div>\n )}\n\n <CommentComposer\n onSubmit={(body) => thread.add(body, { orgId: orgId ?? null })}\n />\n </section>\n );\n}\n\nexport default CommentThread;\n","// react/relativeTime.ts — @ai-matrx/associations/react\n//\n// The one relative-timestamp formatter the comments face uses (W6). Pure and\n// dependency-free — `Intl.RelativeTimeFormat` under the hood so the host's\n// locale conventions apply without a date library.\n\nconst UNITS: { unit: Intl.RelativeTimeFormatUnit; ms: number }[] = [\n { unit: \"year\", ms: 365 * 24 * 60 * 60 * 1000 },\n { unit: \"month\", ms: 30 * 24 * 60 * 60 * 1000 },\n { unit: \"week\", ms: 7 * 24 * 60 * 60 * 1000 },\n { unit: \"day\", ms: 24 * 60 * 60 * 1000 },\n { unit: \"hour\", ms: 60 * 60 * 1000 },\n { unit: \"minute\", ms: 60 * 1000 },\n];\n\n/**\n * \"just now\" under a minute, then the largest whole unit (\"5 minutes ago\",\n * \"2 days ago\"). An unparseable timestamp returns the raw string rather than\n * \"Invalid Date\" chrome — degraded, never broken.\n */\nexport function formatRelativeTime(\n iso: string,\n now: number = Date.now(),\n): string {\n const t = Date.parse(iso);\n if (Number.isNaN(t)) return iso;\n const delta = t - now;\n const magnitude = Math.abs(delta);\n if (magnitude < 60 * 1000) return \"just now\";\n const rtf = new Intl.RelativeTimeFormat(undefined, { numeric: \"auto\" });\n for (const { unit, ms } of UNITS) {\n if (magnitude >= ms) {\n return rtf.format(Math.trunc(delta / ms), unit);\n }\n }\n return \"just now\";\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA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,SAAO,EAAE,OAAO;AAClB;;;ACs7EO,IAAM,qBAAiD;AAAA,EAC5D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;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;AAAA,QAEC;AAAA,QACA;AAAA,QACA,OAAO;AAAA,QACP;AAAA,QACA;AAAA;AAAA,MALK,QAAQ;AAAA,IAMf,CACD,GACH;AAAA,IAGF;AAAA,MAAC;AAAA;AAAA,QACC,UAAU,CAAC,SAAS,OAAO,IAAI,MAAM,EAAE,OAAO,SAAS,KAAK,CAAC;AAAA;AAAA,IAC/D;AAAA,KACF;AAEJ;","names":["import_react","import_react","import_react","import_react","noopSubscribe","import_react","import_react","import_react","noopSubscribe","import_react","import_react","import_jsx_runtime","import_react","import_react","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_react","import_design_system","import_jsx_runtime","import_react","import_design_system","import_design_system","import_jsx_runtime","import_jsx_runtime","import_react","import_design_system","import_jsx_runtime","import_react","import_design_system","import_jsx_runtime","role","import_design_system","import_jsx_runtime","import_react","import_design_system","import_jsx_runtime","metadataIsPinned","import_react","import_design_system","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_react","import_design_system","import_jsx_runtime","import_react","import_design_system","import_jsx_runtime","import_react","import_design_system","import_jsx_runtime","ROOT_PARENT","import_react","import_design_system","import_jsx_runtime","base","DoorRef"]}