@ai-matrx/associations 0.13.7 → 0.13.9

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.
@@ -52,6 +52,7 @@ __export(react_exports, {
52
52
  getContentRoleMeta: () => getContentRoleMeta,
53
53
  lazyPickerOverride: () => lazyPickerOverride,
54
54
  lazyWindowShell: () => lazyWindowShell,
55
+ linkDirection: () => linkDirection,
55
56
  useAssociationCandidates: () => useAssociationCandidates,
56
57
  useAssociationEntitySelectAdapter: () => useAssociationEntitySelectAdapter,
57
58
  useAssociationPickerBridge: () => useAssociationPickerBridge,
@@ -727,6 +728,7 @@ var ENTITY_TYPE_TOKENS = [
727
728
  "media_selection_job",
728
729
  "media_source_library",
729
730
  "meet_call_invite",
731
+ "meet_chat_message",
730
732
  "meet_invitee",
731
733
  "meet_meeting",
732
734
  "meet_note",
@@ -846,6 +848,7 @@ var ENTITY_TYPE_TOKENS = [
846
848
  "rag_ingest_run",
847
849
  "rag_library_audit_log",
848
850
  "rate_limit_buckets",
851
+ "reachability_pending",
849
852
  "recompute_queue",
850
853
  "record",
851
854
  "record_alias",
@@ -1169,6 +1172,428 @@ function isEntityTypeToken(value) {
1169
1172
  return typeof value === "string" && ENTITY_TYPE_TOKEN_SET.has(value);
1170
1173
  }
1171
1174
 
1175
+ // src/association-types.generated.ts
1176
+ var ASSOCIATION_PAIRS = /* @__PURE__ */ new Set([
1177
+ "agent>agent",
1178
+ "agent>context_item",
1179
+ "agent>organization",
1180
+ "agent>project",
1181
+ "agent>record",
1182
+ "agent>scope",
1183
+ "agent>scope_type",
1184
+ "agent>surface",
1185
+ "agent>task",
1186
+ "agent>web_page",
1187
+ "agent_shortcut>project",
1188
+ "agent_shortcut>task",
1189
+ "agent_shortcut>web_page",
1190
+ "agent_term_list>agent",
1191
+ "app>record",
1192
+ "app>scope",
1193
+ "app>web_page",
1194
+ "artifact>processed_document",
1195
+ "assessment>assessment",
1196
+ "assessment>fc_set",
1197
+ "assessment>file",
1198
+ "assessment>note",
1199
+ "assessment>record",
1200
+ "assessment>scope",
1201
+ "assessment>scope_type",
1202
+ "assessment>study_media",
1203
+ "calendar_event>conversation",
1204
+ "calendar_event>party",
1205
+ "code_file>agent",
1206
+ "code_file>code_repository",
1207
+ "code_file>data_store",
1208
+ "code_file>web_page",
1209
+ "contact_medium>web_page",
1210
+ "content_ir_kind_instance>content_ir_kind_instance",
1211
+ "content_ir_kind_instance>note",
1212
+ "content_ir_kind_instance>project",
1213
+ "content_ir_kind_instance>record",
1214
+ "content_ir_kind_instance>scope",
1215
+ "content_ir_kind_instance>scope_type",
1216
+ "content_ir_kind_instance>task",
1217
+ "content_ir_kind_instance>web_site",
1218
+ "conversation>agent",
1219
+ "conversation>custom_record",
1220
+ "conversation>document",
1221
+ "conversation>note",
1222
+ "conversation>party",
1223
+ "conversation>project",
1224
+ "conversation>record",
1225
+ "conversation>rulebook",
1226
+ "conversation>scope",
1227
+ "conversation>scope_type",
1228
+ "conversation>task",
1229
+ "conversation>thread",
1230
+ "conversation>war_room",
1231
+ "conversation>web_page",
1232
+ "credential_item>record",
1233
+ "credential_item>scope",
1234
+ "crm_deal>party",
1235
+ "crm_deal>task",
1236
+ "crm_interaction>crm_deal",
1237
+ "crm_interaction>party",
1238
+ "crm_interaction>project",
1239
+ "custom_record>custom_record",
1240
+ "custom_record>hr_candidate",
1241
+ "custom_record>hr_employee",
1242
+ "custom_record>hr_position_assignment",
1243
+ "custom_record>hr_requisition",
1244
+ "custom_record>hr_training_assignment",
1245
+ "data_store>agent",
1246
+ "data_store>project",
1247
+ "data_store>task",
1248
+ "data_store>war_room",
1249
+ "data_store>web_page",
1250
+ "dataset>agent",
1251
+ "dataset>web_page",
1252
+ "document>document",
1253
+ "document>note",
1254
+ "fc_card>document",
1255
+ "fc_card>fc_set",
1256
+ "fc_card>file",
1257
+ "fc_card>note",
1258
+ "fc_set>agent",
1259
+ "fc_set>assessment",
1260
+ "fc_set>conversation",
1261
+ "fc_set>fc_set",
1262
+ "fc_set>file",
1263
+ "fc_set>note",
1264
+ "fc_set>processed_document",
1265
+ "fc_set>record",
1266
+ "fc_set>rulebook",
1267
+ "fc_set>scope",
1268
+ "fc_set>scope_type",
1269
+ "fc_set>study_media",
1270
+ "file>agent",
1271
+ "file>agent_term_list",
1272
+ "file>conversation",
1273
+ "file>crm_deal",
1274
+ "file>data_store",
1275
+ "file>file",
1276
+ "file>hr_application",
1277
+ "file>hr_employee",
1278
+ "file>hr_employment",
1279
+ "file>hr_incident",
1280
+ "file>hr_leave_case",
1281
+ "file>party",
1282
+ "file>project",
1283
+ "file>record",
1284
+ "file>rulebook",
1285
+ "file>scope",
1286
+ "file>scope_type",
1287
+ "file>task",
1288
+ "file>thread",
1289
+ "file>war_room",
1290
+ "file>web_page",
1291
+ "file>web_screenshot",
1292
+ "folder>web_page",
1293
+ "google_document>crm_deal",
1294
+ "google_document>party",
1295
+ "google_document>project",
1296
+ "google_document>task",
1297
+ "hr_candidate>custom_record",
1298
+ "hr_candidate>party",
1299
+ "hr_course>hr_job_title",
1300
+ "hr_credential>hr_job_title",
1301
+ "hr_employee>custom_record",
1302
+ "hr_employee>record",
1303
+ "hr_employee>scope",
1304
+ "hr_employee>scope_type",
1305
+ "hr_position_assignment>custom_record",
1306
+ "hr_requisition>custom_record",
1307
+ "hr_training_assignment>custom_record",
1308
+ "integration_connection_resource>conversation",
1309
+ "library_doc>data_store",
1310
+ "media_source_library>youtube_video",
1311
+ "message>content_ir_kind_instance",
1312
+ "message>record",
1313
+ "message>task",
1314
+ "message_template>record",
1315
+ "message_template>scope",
1316
+ "message_template>web_page",
1317
+ "note>agent",
1318
+ "note>assessment",
1319
+ "note>calendar_event",
1320
+ "note>crm_deal",
1321
+ "note>data_store",
1322
+ "note>fc_set",
1323
+ "note>file",
1324
+ "note>hr_candidate",
1325
+ "note>hr_employee",
1326
+ "note>note",
1327
+ "note>party",
1328
+ "note>project",
1329
+ "note>record",
1330
+ "note>rulebook",
1331
+ "note>scope",
1332
+ "note>scope_type",
1333
+ "note>study_media",
1334
+ "note>task",
1335
+ "note>thread",
1336
+ "note>war_room",
1337
+ "note>web_page",
1338
+ "note>web_screenshot",
1339
+ "organization>seo_keyword",
1340
+ "page_extraction_job>file",
1341
+ "page_extraction_job>processed_document",
1342
+ "party>category",
1343
+ "party>data_store",
1344
+ "party>organization",
1345
+ "party>party",
1346
+ "party>project",
1347
+ "party>record",
1348
+ "party>research_source",
1349
+ "party>research_topic",
1350
+ "party>scope",
1351
+ "party>scope_type",
1352
+ "party>seo_link_gap_domain",
1353
+ "party>seo_referring_domain_profile",
1354
+ "party>seo_reputation_case",
1355
+ "party>seo_serp_opportunity",
1356
+ "party>seo_topic",
1357
+ "party>task",
1358
+ "party>transcript",
1359
+ "party>war_room",
1360
+ "party>web_brand",
1361
+ "party>web_page",
1362
+ "party>web_site",
1363
+ "pc_episode>processed_document",
1364
+ "pc_episode>rulebook",
1365
+ "pc_show>rulebook",
1366
+ "pc_studio_run>rulebook",
1367
+ "plan_entity>category",
1368
+ "plan_entity>plan_entity",
1369
+ "plan_entity>seo_topic",
1370
+ "plan_entity>web_site",
1371
+ "plan_node>agent_run",
1372
+ "plan_node>party",
1373
+ "plan_node>plan_entity",
1374
+ "plan_node>plan_node",
1375
+ "plan_node>seo_keyword",
1376
+ "plan_node>seo_map_topic",
1377
+ "plan_node>seo_topic",
1378
+ "plan_node>web_page",
1379
+ "plan_node>web_site",
1380
+ "processed_document>agent",
1381
+ "processed_document>code_repository",
1382
+ "processed_document>conversation",
1383
+ "processed_document>data_store",
1384
+ "processed_document>file",
1385
+ "processed_document>media_source_library",
1386
+ "processed_document>project",
1387
+ "processed_document>record",
1388
+ "processed_document>research_topic",
1389
+ "processed_document>scope",
1390
+ "processed_document>task",
1391
+ "processed_document>war_room",
1392
+ "processed_document>web_site",
1393
+ "project>record",
1394
+ "project>scope",
1395
+ "project>scope_type",
1396
+ "project>thread",
1397
+ "project>war_room",
1398
+ "purpose>agent",
1399
+ "purpose>mandate",
1400
+ "purpose>tool",
1401
+ "purpose>workflow",
1402
+ "quiz_session>agent",
1403
+ "quiz_session>processed_document",
1404
+ "quiz_session>web_page",
1405
+ "record>agent",
1406
+ "record>agent_shortcut",
1407
+ "record>agent_template",
1408
+ "record>ai_api",
1409
+ "record>ai_endpoint",
1410
+ "record>ai_model",
1411
+ "record>ai_provider",
1412
+ "record>ai_setting",
1413
+ "record>app",
1414
+ "record>assessment",
1415
+ "record>canvas_comment",
1416
+ "record>canvas_item",
1417
+ "record>canvas_score",
1418
+ "record>category",
1419
+ "record>code_file",
1420
+ "record>code_folder",
1421
+ "record>code_repository",
1422
+ "record>comparison_set",
1423
+ "record>contact_submission",
1424
+ "record>content_ir_kind",
1425
+ "record>content_ir_kind_instance",
1426
+ "record>context_item",
1427
+ "record>conversation",
1428
+ "record>crm_deal",
1429
+ "record>crm_outreach_list",
1430
+ "record>cx_agent_memory",
1431
+ "record>data_store",
1432
+ "record>dataset",
1433
+ "record>fc_set",
1434
+ "record>feature_doc",
1435
+ "record>flexible_data",
1436
+ "record>folder",
1437
+ "record>game_result",
1438
+ "record>heatmap_save",
1439
+ "record>hr_asset",
1440
+ "record>hr_candidate",
1441
+ "record>hr_careers_portal",
1442
+ "record>hr_checklist_template",
1443
+ "record>hr_course",
1444
+ "record>hr_crew",
1445
+ "record>hr_deduction_code",
1446
+ "record>hr_department",
1447
+ "record>hr_earning_code",
1448
+ "record>hr_employee",
1449
+ "record>hr_holiday_calendar",
1450
+ "record>hr_interview_kit",
1451
+ "record>hr_job_title",
1452
+ "record>hr_jurisdiction",
1453
+ "record>hr_jurisdiction_rule_class",
1454
+ "record>hr_leave_policy",
1455
+ "record>hr_location",
1456
+ "record>hr_pay_group",
1457
+ "record>hr_posting",
1458
+ "record>hr_record_class",
1459
+ "record>hr_requisition",
1460
+ "record>hr_schedule",
1461
+ "record>hr_schedule_template",
1462
+ "record>hr_survey",
1463
+ "record>league_membership",
1464
+ "record>learn_doc",
1465
+ "record>marketing_initiative",
1466
+ "record>message_template",
1467
+ "record>note",
1468
+ "record>note_folder",
1469
+ "record>organization",
1470
+ "record>page_extraction_job",
1471
+ "record>party",
1472
+ "record>pc_article",
1473
+ "record>pc_episode",
1474
+ "record>pc_show",
1475
+ "record>pc_studio_run",
1476
+ "record>processed_document",
1477
+ "record>project",
1478
+ "record>quiz_session",
1479
+ "record>record",
1480
+ "record>research_template",
1481
+ "record>research_topic",
1482
+ "record>rulebook",
1483
+ "record>sch_task",
1484
+ "record>scope_type",
1485
+ "record>seo_topic",
1486
+ "record>shared_canvas_item",
1487
+ "record>skill",
1488
+ "record>skill_render_definition",
1489
+ "record>structured_list",
1490
+ "record>studio_session",
1491
+ "record>study_goal",
1492
+ "record>study_media",
1493
+ "record>study_plan",
1494
+ "record>study_plan_block",
1495
+ "record>surface",
1496
+ "record>task",
1497
+ "record>thread",
1498
+ "record>tool",
1499
+ "record>tool_bundle",
1500
+ "record>transcript",
1501
+ "record>udt_document",
1502
+ "record>user_markdown_sample",
1503
+ "record>voice",
1504
+ "record>war_room",
1505
+ "record>wbx_pattern",
1506
+ "record>web_analysis_item",
1507
+ "record>web_brand",
1508
+ "record>web_provider",
1509
+ "record>web_site",
1510
+ "record>workbook",
1511
+ "record>workflow",
1512
+ "record>workflow_template",
1513
+ "record>workflow_trigger",
1514
+ "record>working_document",
1515
+ "research_source>research_keyword",
1516
+ "research_source>research_tag",
1517
+ "research_source>youtube_video",
1518
+ "research_tag>plan_node",
1519
+ "research_tag>web_page",
1520
+ "research_tag>web_site",
1521
+ "research_topic>plan_node",
1522
+ "research_topic>project",
1523
+ "research_topic>rulebook",
1524
+ "research_topic>web_page",
1525
+ "research_topic>web_site",
1526
+ "rulebook>masterwork_source",
1527
+ "sch_task>record",
1528
+ "sch_task>scope",
1529
+ "seo_keyword>project",
1530
+ "seo_keyword>web_page",
1531
+ "seo_map_topic>seo_map_facet_value",
1532
+ "seo_topical_map>web_brand",
1533
+ "shared_canvas_item>record",
1534
+ "shared_canvas_item>scope",
1535
+ "skill>web_page",
1536
+ "structured_list>web_page",
1537
+ "studio_session>agent",
1538
+ "studio_session>rulebook",
1539
+ "studio_session>thread",
1540
+ "studio_session>web_page",
1541
+ "study_media>assessment",
1542
+ "study_media>fc_set",
1543
+ "study_media>file",
1544
+ "study_media>note",
1545
+ "study_media>record",
1546
+ "study_media>scope",
1547
+ "study_media>scope_type",
1548
+ "study_media>study_media",
1549
+ "task>project",
1550
+ "task>record",
1551
+ "task>scope",
1552
+ "task>scope_type",
1553
+ "task>thread",
1554
+ "task>war_room",
1555
+ "thread>record",
1556
+ "thread>scope",
1557
+ "thread>scope_type",
1558
+ "thread>war_room",
1559
+ "tool>tool_bundle",
1560
+ "transcript>agent",
1561
+ "transcript>data_store",
1562
+ "transcript>record",
1563
+ "transcript>rulebook",
1564
+ "transcript>scope",
1565
+ "transcript>web_page",
1566
+ "udt_document>agent",
1567
+ "udt_document>rulebook",
1568
+ "udt_document>web_page",
1569
+ "war_room>record",
1570
+ "war_room>scope",
1571
+ "war_room>scope_type",
1572
+ "web_page>seo_map_facet_value",
1573
+ "web_page>seo_map_topic",
1574
+ "web_page>task",
1575
+ "web_screenshot>task",
1576
+ "web_site>agent_run",
1577
+ "web_site>seo_topical_map",
1578
+ "web_youtube_video>seo_map_topic",
1579
+ "workbook>agent",
1580
+ "workbook>web_page",
1581
+ "workflow>record",
1582
+ "workflow>scope",
1583
+ "workflow>web_page",
1584
+ "working_document>agent",
1585
+ "working_document>conversation",
1586
+ "working_document>project",
1587
+ "working_document>task",
1588
+ "working_document>war_room",
1589
+ "working_document>web_page",
1590
+ "youtube_video>transcript",
1591
+ "youtube_video>web_page"
1592
+ ]);
1593
+ function isRegisteredPair(sourceType, targetType) {
1594
+ return ASSOCIATION_PAIRS.has(`${sourceType}>${targetType}`);
1595
+ }
1596
+
1172
1597
  // src/core/titles.ts
1173
1598
  function entityTitleCacheKey(token, id) {
1174
1599
  return `${token}:${id}`;
@@ -1336,6 +1761,9 @@ function isAssociationTargetType(value) {
1336
1761
  }
1337
1762
 
1338
1763
  // src/react/hooks/useContainerLinks.ts
1764
+ function linkDirection(containerType, token) {
1765
+ return isRegisteredPair(containerType, token) && !isRegisteredPair(token, containerType) ? "from-container" : "into-container";
1766
+ }
1339
1767
  function metadataRecord(metadata) {
1340
1768
  if (metadata === null || typeof metadata !== "object" || Array.isArray(metadata)) {
1341
1769
  return metadata == null ? {} : null;
@@ -1413,7 +1841,7 @@ function useContainerLinks(args) {
1413
1841
  const conversationFileError = conversationResult?.key === conversationKey ? conversationResult.error : null;
1414
1842
  const conversationFileStatus = outgoing || containerType !== "conversation" ? "idle" : conversationResult?.key !== conversationKey ? "loading" : conversationResult.loading ? "loading" : conversationFileError ? "error" : "ready";
1415
1843
  const incomingGeneric = edges.filter(
1416
- (edge) => outgoing ? edge.direction === "outgoing" : edge.direction === "incoming" && !(containerType === "conversation" && edge.otherType === "file")
1844
+ (edge) => outgoing ? edge.direction === "outgoing" : !(containerType === "conversation" && edge.otherType === "file") && (linkDirection(containerType, edge.otherType) === "from-container" ? edge.direction === "outgoing" : edge.direction === "incoming")
1417
1845
  ).map((edge) => ({
1418
1846
  edgeId: edge.id,
1419
1847
  resourceId: edge.otherId,
@@ -1438,6 +1866,19 @@ function useContainerLinks(args) {
1438
1866
  targetId: resourceId
1439
1867
  };
1440
1868
  }
1869
+ if (linkDirection(containerType, token) === "from-container") {
1870
+ if (!isAssociationTargetType(token)) {
1871
+ return {
1872
+ error: `A ${token.replace(/_/g, " ")} is attached from this record, but it is not a type the store attaches to.`
1873
+ };
1874
+ }
1875
+ return {
1876
+ sourceType: containerType,
1877
+ sourceId: containerId,
1878
+ targetType: token,
1879
+ targetId: resourceId
1880
+ };
1881
+ }
1441
1882
  return {
1442
1883
  sourceType: token,
1443
1884
  sourceId: resourceId,
@@ -3394,55 +3835,6 @@ function AttachedItemsBody({
3394
3835
  // src/react/components/AssociationCard.tsx
3395
3836
  var import_react16 = require("react");
3396
3837
  var import_design_system7 = require("@ai-matrx/design-system");
3397
-
3398
- // src/react/contentRoles.ts
3399
- var CONTENT_ROLES = [
3400
- {
3401
- id: "utility",
3402
- title: "Utilities",
3403
- tagline: "The agents and tools that act on your knowledge.",
3404
- accentText: "text-violet-600 dark:text-violet-400",
3405
- accentBg: "bg-violet-500/10",
3406
- accentBar: "bg-violet-500"
3407
- },
3408
- {
3409
- id: "source",
3410
- title: "Sources",
3411
- tagline: "Incoming sources of truth (Knowledge In).",
3412
- accentText: "text-sky-600 dark:text-sky-400",
3413
- accentBg: "bg-sky-500/10",
3414
- accentBar: "bg-sky-500"
3415
- },
3416
- {
3417
- id: "destination",
3418
- title: "Outputs",
3419
- tagline: "Knowledge your team produces.",
3420
- accentText: "text-emerald-600 dark:text-emerald-400",
3421
- accentBg: "bg-emerald-500/10",
3422
- accentBar: "bg-emerald-500"
3423
- },
3424
- {
3425
- id: "hybrid",
3426
- title: "Sources & Outputs",
3427
- tagline: "Read from and written to.",
3428
- accentText: "text-teal-600 dark:text-teal-400",
3429
- accentBg: "bg-teal-500/10",
3430
- accentBar: "bg-gradient-to-r from-sky-500 to-emerald-500"
3431
- },
3432
- {
3433
- id: "container",
3434
- title: "Workspaces",
3435
- tagline: "How work is organized.",
3436
- accentText: "text-amber-600 dark:text-amber-400",
3437
- accentBg: "bg-amber-500/10",
3438
- accentBar: "bg-amber-500"
3439
- }
3440
- ];
3441
- function getContentRoleMeta(role) {
3442
- return CONTENT_ROLES.find((r) => r.id === role) ?? CONTENT_ROLES[2];
3443
- }
3444
-
3445
- // src/react/components/AssociationCard.tsx
3446
3838
  var import_jsx_runtime11 = require("react/jsx-runtime");
3447
3839
  function AssociationCard({
3448
3840
  token,
@@ -3454,7 +3846,6 @@ function AssociationCard({
3454
3846
  const container = containerProp ?? fromCtx;
3455
3847
  const [open, setOpen] = (0, import_react16.useState)(false);
3456
3848
  const info = store.registry.getEntityInfo(token);
3457
- const role = getContentRoleMeta(info.contentRole);
3458
3849
  const Icon = info.Icon ?? DefaultEntityIcon;
3459
3850
  const [listOpen, setListOpen] = (0, import_react16.useState)(false);
3460
3851
  const {
@@ -3488,15 +3879,6 @@ function AssociationCard({
3488
3879
  className
3489
3880
  ),
3490
3881
  children: [
3491
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3492
- "span",
3493
- {
3494
- className: (0, import_design_system7.cn)(
3495
- "absolute inset-x-0 top-0 h-0.5 opacity-60",
3496
- role.accentBar
3497
- )
3498
- }
3499
- ),
3500
3882
  /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
3501
3883
  "button",
3502
3884
  {
@@ -3509,20 +3891,10 @@ function AssociationCard({
3509
3891
  canDrillIn ? "cursor-pointer" : "cursor-default"
3510
3892
  ),
3511
3893
  children: [
3512
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3513
- "span",
3514
- {
3515
- className: (0, import_design_system7.cn)(
3516
- "flex h-9 w-9 shrink-0 items-center justify-center rounded-lg",
3517
- role.accentBg,
3518
- role.accentText
3519
- ),
3520
- children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Icon, { className: "h-4 w-4" })
3521
- }
3522
- ),
3894
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Icon, { className: "h-4 w-4" }) }),
3523
3895
  /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "min-w-0 flex-1", children: [
3524
3896
  /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "block truncate text-sm font-medium text-foreground", children: info.labelPlural }),
3525
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "block text-[11px] text-muted-foreground tabular-nums", children: loading ? /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "inline-flex items-center gap-1", children: [
3897
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "block text-xs text-muted-foreground tabular-nums", children: loading ? /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "inline-flex items-center gap-1", children: [
3526
3898
  /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SpinnerIcon, { className: "h-3 w-3 animate-spin" }),
3527
3899
  "Loading\u2026"
3528
3900
  ] }) : `${count} ${container.direction === "outgoing" ? "filed under" : "attached"}` })
@@ -3559,8 +3931,8 @@ function AssociationCard({
3559
3931
  setOpen(true);
3560
3932
  }
3561
3933
  } : {},
3562
- onDetach: (resourceId, role2) => detach(token, resourceId, role2 ?? void 0),
3563
- onSetPinned: (resourceId, pinned, role2) => setPinned(token, resourceId, pinned, role2 ?? void 0)
3934
+ onDetach: (resourceId, role) => detach(token, resourceId, role ?? void 0),
3935
+ onSetPinned: (resourceId, pinned, role) => setPinned(token, resourceId, pinned, role ?? void 0)
3564
3936
  }
3565
3937
  ),
3566
3938
  canAttach && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
@@ -3582,6 +3954,55 @@ function AssociationCard({
3582
3954
 
3583
3955
  // src/react/components/AssociationCardGrid.tsx
3584
3956
  var import_design_system8 = require("@ai-matrx/design-system");
3957
+
3958
+ // src/react/contentRoles.ts
3959
+ var CONTENT_ROLES = [
3960
+ {
3961
+ id: "utility",
3962
+ title: "Utilities",
3963
+ tagline: "The agents and tools that act on your knowledge.",
3964
+ accentText: "text-violet-600 dark:text-violet-400",
3965
+ accentBg: "bg-violet-500/10",
3966
+ accentBar: "bg-violet-500"
3967
+ },
3968
+ {
3969
+ id: "source",
3970
+ title: "Sources",
3971
+ tagline: "Incoming sources of truth (Knowledge In).",
3972
+ accentText: "text-sky-600 dark:text-sky-400",
3973
+ accentBg: "bg-sky-500/10",
3974
+ accentBar: "bg-sky-500"
3975
+ },
3976
+ {
3977
+ id: "destination",
3978
+ title: "Outputs",
3979
+ tagline: "Knowledge your team produces.",
3980
+ accentText: "text-emerald-600 dark:text-emerald-400",
3981
+ accentBg: "bg-emerald-500/10",
3982
+ accentBar: "bg-emerald-500"
3983
+ },
3984
+ {
3985
+ id: "hybrid",
3986
+ title: "Sources & Outputs",
3987
+ tagline: "Read from and written to.",
3988
+ accentText: "text-teal-600 dark:text-teal-400",
3989
+ accentBg: "bg-teal-500/10",
3990
+ accentBar: "bg-gradient-to-r from-sky-500 to-emerald-500"
3991
+ },
3992
+ {
3993
+ id: "container",
3994
+ title: "Workspaces",
3995
+ tagline: "How work is organized.",
3996
+ accentText: "text-amber-600 dark:text-amber-400",
3997
+ accentBg: "bg-amber-500/10",
3998
+ accentBar: "bg-amber-500"
3999
+ }
4000
+ ];
4001
+ function getContentRoleMeta(role) {
4002
+ return CONTENT_ROLES.find((r) => r.id === role) ?? CONTENT_ROLES[2];
4003
+ }
4004
+
4005
+ // src/react/components/AssociationCardGrid.tsx
3585
4006
  var import_jsx_runtime12 = require("react/jsx-runtime");
3586
4007
  function AssociationCardGrid({
3587
4008
  tokens,
@@ -3615,27 +4036,13 @@ function AssociationCardGrid({
3615
4036
  );
3616
4037
  if (inRole.length === 0) return null;
3617
4038
  return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("section", { children: [
3618
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "mb-2.5 flex items-baseline gap-3 pl-1.5", children: [
3619
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-center gap-2", children: [
3620
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
3621
- "span",
3622
- {
3623
- className: (0, import_design_system8.cn)("h-2.5 w-2.5 rounded-full", role.accentBar)
3624
- }
3625
- ),
3626
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("h3", { className: "text-sm font-semibold text-foreground", children: role.title })
3627
- ] }),
3628
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "hidden text-xs text-muted-foreground sm:block", children: role.tagline })
3629
- ] }),
3630
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "grid grid-cols-1 gap-2 @md:grid-cols-2 @3xl:grid-cols-3", children: inRole.map((token) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(AssociationCard, { token }, token)) })
4039
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("h3", { className: "mb-2 text-sm font-semibold text-foreground", children: role.title }),
4040
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "flex flex-wrap gap-2 [&>*]:min-w-[16rem] [&>*]:flex-1", children: inRole.map((token) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(AssociationCard, { token }, token)) })
3631
4041
  ] }, role.id);
3632
4042
  }),
3633
4043
  roleless.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("section", { children: [
3634
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "mb-2.5 flex items-baseline gap-3 pl-1.5", children: [
3635
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("h3", { className: "text-sm font-semibold text-foreground", children: "Filed under" }),
3636
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "hidden text-xs text-muted-foreground sm:block", children: "Libraries, topics and other places this is kept." })
3637
- ] }),
3638
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "grid grid-cols-1 gap-2 @md:grid-cols-2 @3xl:grid-cols-3", children: roleless.map((token) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(AssociationCard, { token }, token)) })
4044
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("h3", { className: "mb-2 text-sm font-semibold text-foreground", children: "Filed under" }),
4045
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "flex flex-wrap gap-2 [&>*]:min-w-[16rem] [&>*]:flex-1", children: roleless.map((token) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(AssociationCard, { token }, token)) })
3639
4046
  ] })
3640
4047
  ] });
3641
4048
  }