@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.
@@ -657,6 +657,7 @@ var ENTITY_TYPE_TOKENS = [
657
657
  "media_selection_job",
658
658
  "media_source_library",
659
659
  "meet_call_invite",
660
+ "meet_chat_message",
660
661
  "meet_invitee",
661
662
  "meet_meeting",
662
663
  "meet_note",
@@ -776,6 +777,7 @@ var ENTITY_TYPE_TOKENS = [
776
777
  "rag_ingest_run",
777
778
  "rag_library_audit_log",
778
779
  "rate_limit_buckets",
780
+ "reachability_pending",
779
781
  "recompute_queue",
780
782
  "record",
781
783
  "record_alias",
@@ -1099,6 +1101,428 @@ function isEntityTypeToken(value) {
1099
1101
  return typeof value === "string" && ENTITY_TYPE_TOKEN_SET.has(value);
1100
1102
  }
1101
1103
 
1104
+ // src/association-types.generated.ts
1105
+ var ASSOCIATION_PAIRS = /* @__PURE__ */ new Set([
1106
+ "agent>agent",
1107
+ "agent>context_item",
1108
+ "agent>organization",
1109
+ "agent>project",
1110
+ "agent>record",
1111
+ "agent>scope",
1112
+ "agent>scope_type",
1113
+ "agent>surface",
1114
+ "agent>task",
1115
+ "agent>web_page",
1116
+ "agent_shortcut>project",
1117
+ "agent_shortcut>task",
1118
+ "agent_shortcut>web_page",
1119
+ "agent_term_list>agent",
1120
+ "app>record",
1121
+ "app>scope",
1122
+ "app>web_page",
1123
+ "artifact>processed_document",
1124
+ "assessment>assessment",
1125
+ "assessment>fc_set",
1126
+ "assessment>file",
1127
+ "assessment>note",
1128
+ "assessment>record",
1129
+ "assessment>scope",
1130
+ "assessment>scope_type",
1131
+ "assessment>study_media",
1132
+ "calendar_event>conversation",
1133
+ "calendar_event>party",
1134
+ "code_file>agent",
1135
+ "code_file>code_repository",
1136
+ "code_file>data_store",
1137
+ "code_file>web_page",
1138
+ "contact_medium>web_page",
1139
+ "content_ir_kind_instance>content_ir_kind_instance",
1140
+ "content_ir_kind_instance>note",
1141
+ "content_ir_kind_instance>project",
1142
+ "content_ir_kind_instance>record",
1143
+ "content_ir_kind_instance>scope",
1144
+ "content_ir_kind_instance>scope_type",
1145
+ "content_ir_kind_instance>task",
1146
+ "content_ir_kind_instance>web_site",
1147
+ "conversation>agent",
1148
+ "conversation>custom_record",
1149
+ "conversation>document",
1150
+ "conversation>note",
1151
+ "conversation>party",
1152
+ "conversation>project",
1153
+ "conversation>record",
1154
+ "conversation>rulebook",
1155
+ "conversation>scope",
1156
+ "conversation>scope_type",
1157
+ "conversation>task",
1158
+ "conversation>thread",
1159
+ "conversation>war_room",
1160
+ "conversation>web_page",
1161
+ "credential_item>record",
1162
+ "credential_item>scope",
1163
+ "crm_deal>party",
1164
+ "crm_deal>task",
1165
+ "crm_interaction>crm_deal",
1166
+ "crm_interaction>party",
1167
+ "crm_interaction>project",
1168
+ "custom_record>custom_record",
1169
+ "custom_record>hr_candidate",
1170
+ "custom_record>hr_employee",
1171
+ "custom_record>hr_position_assignment",
1172
+ "custom_record>hr_requisition",
1173
+ "custom_record>hr_training_assignment",
1174
+ "data_store>agent",
1175
+ "data_store>project",
1176
+ "data_store>task",
1177
+ "data_store>war_room",
1178
+ "data_store>web_page",
1179
+ "dataset>agent",
1180
+ "dataset>web_page",
1181
+ "document>document",
1182
+ "document>note",
1183
+ "fc_card>document",
1184
+ "fc_card>fc_set",
1185
+ "fc_card>file",
1186
+ "fc_card>note",
1187
+ "fc_set>agent",
1188
+ "fc_set>assessment",
1189
+ "fc_set>conversation",
1190
+ "fc_set>fc_set",
1191
+ "fc_set>file",
1192
+ "fc_set>note",
1193
+ "fc_set>processed_document",
1194
+ "fc_set>record",
1195
+ "fc_set>rulebook",
1196
+ "fc_set>scope",
1197
+ "fc_set>scope_type",
1198
+ "fc_set>study_media",
1199
+ "file>agent",
1200
+ "file>agent_term_list",
1201
+ "file>conversation",
1202
+ "file>crm_deal",
1203
+ "file>data_store",
1204
+ "file>file",
1205
+ "file>hr_application",
1206
+ "file>hr_employee",
1207
+ "file>hr_employment",
1208
+ "file>hr_incident",
1209
+ "file>hr_leave_case",
1210
+ "file>party",
1211
+ "file>project",
1212
+ "file>record",
1213
+ "file>rulebook",
1214
+ "file>scope",
1215
+ "file>scope_type",
1216
+ "file>task",
1217
+ "file>thread",
1218
+ "file>war_room",
1219
+ "file>web_page",
1220
+ "file>web_screenshot",
1221
+ "folder>web_page",
1222
+ "google_document>crm_deal",
1223
+ "google_document>party",
1224
+ "google_document>project",
1225
+ "google_document>task",
1226
+ "hr_candidate>custom_record",
1227
+ "hr_candidate>party",
1228
+ "hr_course>hr_job_title",
1229
+ "hr_credential>hr_job_title",
1230
+ "hr_employee>custom_record",
1231
+ "hr_employee>record",
1232
+ "hr_employee>scope",
1233
+ "hr_employee>scope_type",
1234
+ "hr_position_assignment>custom_record",
1235
+ "hr_requisition>custom_record",
1236
+ "hr_training_assignment>custom_record",
1237
+ "integration_connection_resource>conversation",
1238
+ "library_doc>data_store",
1239
+ "media_source_library>youtube_video",
1240
+ "message>content_ir_kind_instance",
1241
+ "message>record",
1242
+ "message>task",
1243
+ "message_template>record",
1244
+ "message_template>scope",
1245
+ "message_template>web_page",
1246
+ "note>agent",
1247
+ "note>assessment",
1248
+ "note>calendar_event",
1249
+ "note>crm_deal",
1250
+ "note>data_store",
1251
+ "note>fc_set",
1252
+ "note>file",
1253
+ "note>hr_candidate",
1254
+ "note>hr_employee",
1255
+ "note>note",
1256
+ "note>party",
1257
+ "note>project",
1258
+ "note>record",
1259
+ "note>rulebook",
1260
+ "note>scope",
1261
+ "note>scope_type",
1262
+ "note>study_media",
1263
+ "note>task",
1264
+ "note>thread",
1265
+ "note>war_room",
1266
+ "note>web_page",
1267
+ "note>web_screenshot",
1268
+ "organization>seo_keyword",
1269
+ "page_extraction_job>file",
1270
+ "page_extraction_job>processed_document",
1271
+ "party>category",
1272
+ "party>data_store",
1273
+ "party>organization",
1274
+ "party>party",
1275
+ "party>project",
1276
+ "party>record",
1277
+ "party>research_source",
1278
+ "party>research_topic",
1279
+ "party>scope",
1280
+ "party>scope_type",
1281
+ "party>seo_link_gap_domain",
1282
+ "party>seo_referring_domain_profile",
1283
+ "party>seo_reputation_case",
1284
+ "party>seo_serp_opportunity",
1285
+ "party>seo_topic",
1286
+ "party>task",
1287
+ "party>transcript",
1288
+ "party>war_room",
1289
+ "party>web_brand",
1290
+ "party>web_page",
1291
+ "party>web_site",
1292
+ "pc_episode>processed_document",
1293
+ "pc_episode>rulebook",
1294
+ "pc_show>rulebook",
1295
+ "pc_studio_run>rulebook",
1296
+ "plan_entity>category",
1297
+ "plan_entity>plan_entity",
1298
+ "plan_entity>seo_topic",
1299
+ "plan_entity>web_site",
1300
+ "plan_node>agent_run",
1301
+ "plan_node>party",
1302
+ "plan_node>plan_entity",
1303
+ "plan_node>plan_node",
1304
+ "plan_node>seo_keyword",
1305
+ "plan_node>seo_map_topic",
1306
+ "plan_node>seo_topic",
1307
+ "plan_node>web_page",
1308
+ "plan_node>web_site",
1309
+ "processed_document>agent",
1310
+ "processed_document>code_repository",
1311
+ "processed_document>conversation",
1312
+ "processed_document>data_store",
1313
+ "processed_document>file",
1314
+ "processed_document>media_source_library",
1315
+ "processed_document>project",
1316
+ "processed_document>record",
1317
+ "processed_document>research_topic",
1318
+ "processed_document>scope",
1319
+ "processed_document>task",
1320
+ "processed_document>war_room",
1321
+ "processed_document>web_site",
1322
+ "project>record",
1323
+ "project>scope",
1324
+ "project>scope_type",
1325
+ "project>thread",
1326
+ "project>war_room",
1327
+ "purpose>agent",
1328
+ "purpose>mandate",
1329
+ "purpose>tool",
1330
+ "purpose>workflow",
1331
+ "quiz_session>agent",
1332
+ "quiz_session>processed_document",
1333
+ "quiz_session>web_page",
1334
+ "record>agent",
1335
+ "record>agent_shortcut",
1336
+ "record>agent_template",
1337
+ "record>ai_api",
1338
+ "record>ai_endpoint",
1339
+ "record>ai_model",
1340
+ "record>ai_provider",
1341
+ "record>ai_setting",
1342
+ "record>app",
1343
+ "record>assessment",
1344
+ "record>canvas_comment",
1345
+ "record>canvas_item",
1346
+ "record>canvas_score",
1347
+ "record>category",
1348
+ "record>code_file",
1349
+ "record>code_folder",
1350
+ "record>code_repository",
1351
+ "record>comparison_set",
1352
+ "record>contact_submission",
1353
+ "record>content_ir_kind",
1354
+ "record>content_ir_kind_instance",
1355
+ "record>context_item",
1356
+ "record>conversation",
1357
+ "record>crm_deal",
1358
+ "record>crm_outreach_list",
1359
+ "record>cx_agent_memory",
1360
+ "record>data_store",
1361
+ "record>dataset",
1362
+ "record>fc_set",
1363
+ "record>feature_doc",
1364
+ "record>flexible_data",
1365
+ "record>folder",
1366
+ "record>game_result",
1367
+ "record>heatmap_save",
1368
+ "record>hr_asset",
1369
+ "record>hr_candidate",
1370
+ "record>hr_careers_portal",
1371
+ "record>hr_checklist_template",
1372
+ "record>hr_course",
1373
+ "record>hr_crew",
1374
+ "record>hr_deduction_code",
1375
+ "record>hr_department",
1376
+ "record>hr_earning_code",
1377
+ "record>hr_employee",
1378
+ "record>hr_holiday_calendar",
1379
+ "record>hr_interview_kit",
1380
+ "record>hr_job_title",
1381
+ "record>hr_jurisdiction",
1382
+ "record>hr_jurisdiction_rule_class",
1383
+ "record>hr_leave_policy",
1384
+ "record>hr_location",
1385
+ "record>hr_pay_group",
1386
+ "record>hr_posting",
1387
+ "record>hr_record_class",
1388
+ "record>hr_requisition",
1389
+ "record>hr_schedule",
1390
+ "record>hr_schedule_template",
1391
+ "record>hr_survey",
1392
+ "record>league_membership",
1393
+ "record>learn_doc",
1394
+ "record>marketing_initiative",
1395
+ "record>message_template",
1396
+ "record>note",
1397
+ "record>note_folder",
1398
+ "record>organization",
1399
+ "record>page_extraction_job",
1400
+ "record>party",
1401
+ "record>pc_article",
1402
+ "record>pc_episode",
1403
+ "record>pc_show",
1404
+ "record>pc_studio_run",
1405
+ "record>processed_document",
1406
+ "record>project",
1407
+ "record>quiz_session",
1408
+ "record>record",
1409
+ "record>research_template",
1410
+ "record>research_topic",
1411
+ "record>rulebook",
1412
+ "record>sch_task",
1413
+ "record>scope_type",
1414
+ "record>seo_topic",
1415
+ "record>shared_canvas_item",
1416
+ "record>skill",
1417
+ "record>skill_render_definition",
1418
+ "record>structured_list",
1419
+ "record>studio_session",
1420
+ "record>study_goal",
1421
+ "record>study_media",
1422
+ "record>study_plan",
1423
+ "record>study_plan_block",
1424
+ "record>surface",
1425
+ "record>task",
1426
+ "record>thread",
1427
+ "record>tool",
1428
+ "record>tool_bundle",
1429
+ "record>transcript",
1430
+ "record>udt_document",
1431
+ "record>user_markdown_sample",
1432
+ "record>voice",
1433
+ "record>war_room",
1434
+ "record>wbx_pattern",
1435
+ "record>web_analysis_item",
1436
+ "record>web_brand",
1437
+ "record>web_provider",
1438
+ "record>web_site",
1439
+ "record>workbook",
1440
+ "record>workflow",
1441
+ "record>workflow_template",
1442
+ "record>workflow_trigger",
1443
+ "record>working_document",
1444
+ "research_source>research_keyword",
1445
+ "research_source>research_tag",
1446
+ "research_source>youtube_video",
1447
+ "research_tag>plan_node",
1448
+ "research_tag>web_page",
1449
+ "research_tag>web_site",
1450
+ "research_topic>plan_node",
1451
+ "research_topic>project",
1452
+ "research_topic>rulebook",
1453
+ "research_topic>web_page",
1454
+ "research_topic>web_site",
1455
+ "rulebook>masterwork_source",
1456
+ "sch_task>record",
1457
+ "sch_task>scope",
1458
+ "seo_keyword>project",
1459
+ "seo_keyword>web_page",
1460
+ "seo_map_topic>seo_map_facet_value",
1461
+ "seo_topical_map>web_brand",
1462
+ "shared_canvas_item>record",
1463
+ "shared_canvas_item>scope",
1464
+ "skill>web_page",
1465
+ "structured_list>web_page",
1466
+ "studio_session>agent",
1467
+ "studio_session>rulebook",
1468
+ "studio_session>thread",
1469
+ "studio_session>web_page",
1470
+ "study_media>assessment",
1471
+ "study_media>fc_set",
1472
+ "study_media>file",
1473
+ "study_media>note",
1474
+ "study_media>record",
1475
+ "study_media>scope",
1476
+ "study_media>scope_type",
1477
+ "study_media>study_media",
1478
+ "task>project",
1479
+ "task>record",
1480
+ "task>scope",
1481
+ "task>scope_type",
1482
+ "task>thread",
1483
+ "task>war_room",
1484
+ "thread>record",
1485
+ "thread>scope",
1486
+ "thread>scope_type",
1487
+ "thread>war_room",
1488
+ "tool>tool_bundle",
1489
+ "transcript>agent",
1490
+ "transcript>data_store",
1491
+ "transcript>record",
1492
+ "transcript>rulebook",
1493
+ "transcript>scope",
1494
+ "transcript>web_page",
1495
+ "udt_document>agent",
1496
+ "udt_document>rulebook",
1497
+ "udt_document>web_page",
1498
+ "war_room>record",
1499
+ "war_room>scope",
1500
+ "war_room>scope_type",
1501
+ "web_page>seo_map_facet_value",
1502
+ "web_page>seo_map_topic",
1503
+ "web_page>task",
1504
+ "web_screenshot>task",
1505
+ "web_site>agent_run",
1506
+ "web_site>seo_topical_map",
1507
+ "web_youtube_video>seo_map_topic",
1508
+ "workbook>agent",
1509
+ "workbook>web_page",
1510
+ "workflow>record",
1511
+ "workflow>scope",
1512
+ "workflow>web_page",
1513
+ "working_document>agent",
1514
+ "working_document>conversation",
1515
+ "working_document>project",
1516
+ "working_document>task",
1517
+ "working_document>war_room",
1518
+ "working_document>web_page",
1519
+ "youtube_video>transcript",
1520
+ "youtube_video>web_page"
1521
+ ]);
1522
+ function isRegisteredPair(sourceType, targetType) {
1523
+ return ASSOCIATION_PAIRS.has(`${sourceType}>${targetType}`);
1524
+ }
1525
+
1102
1526
  // src/core/titles.ts
1103
1527
  function entityTitleCacheKey(token, id) {
1104
1528
  return `${token}:${id}`;
@@ -1272,6 +1696,9 @@ function isAssociationTargetType(value) {
1272
1696
  }
1273
1697
 
1274
1698
  // src/react/hooks/useContainerLinks.ts
1699
+ function linkDirection(containerType, token) {
1700
+ return isRegisteredPair(containerType, token) && !isRegisteredPair(token, containerType) ? "from-container" : "into-container";
1701
+ }
1275
1702
  function metadataRecord(metadata) {
1276
1703
  if (metadata === null || typeof metadata !== "object" || Array.isArray(metadata)) {
1277
1704
  return metadata == null ? {} : null;
@@ -1349,7 +1776,7 @@ function useContainerLinks(args) {
1349
1776
  const conversationFileError = conversationResult?.key === conversationKey ? conversationResult.error : null;
1350
1777
  const conversationFileStatus = outgoing || containerType !== "conversation" ? "idle" : conversationResult?.key !== conversationKey ? "loading" : conversationResult.loading ? "loading" : conversationFileError ? "error" : "ready";
1351
1778
  const incomingGeneric = edges.filter(
1352
- (edge) => outgoing ? edge.direction === "outgoing" : edge.direction === "incoming" && !(containerType === "conversation" && edge.otherType === "file")
1779
+ (edge) => outgoing ? edge.direction === "outgoing" : !(containerType === "conversation" && edge.otherType === "file") && (linkDirection(containerType, edge.otherType) === "from-container" ? edge.direction === "outgoing" : edge.direction === "incoming")
1353
1780
  ).map((edge) => ({
1354
1781
  edgeId: edge.id,
1355
1782
  resourceId: edge.otherId,
@@ -1374,6 +1801,19 @@ function useContainerLinks(args) {
1374
1801
  targetId: resourceId
1375
1802
  };
1376
1803
  }
1804
+ if (linkDirection(containerType, token) === "from-container") {
1805
+ if (!isAssociationTargetType(token)) {
1806
+ return {
1807
+ error: `A ${token.replace(/_/g, " ")} is attached from this record, but it is not a type the store attaches to.`
1808
+ };
1809
+ }
1810
+ return {
1811
+ sourceType: containerType,
1812
+ sourceId: containerId,
1813
+ targetType: token,
1814
+ targetId: resourceId
1815
+ };
1816
+ }
1377
1817
  return {
1378
1818
  sourceType: token,
1379
1819
  sourceId: resourceId,
@@ -3336,55 +3776,6 @@ function AttachedItemsBody({
3336
3776
  // src/react/components/AssociationCard.tsx
3337
3777
  import { useState as useState10 } from "react";
3338
3778
  import { cn as cn7 } from "@ai-matrx/design-system";
3339
-
3340
- // src/react/contentRoles.ts
3341
- var CONTENT_ROLES = [
3342
- {
3343
- id: "utility",
3344
- title: "Utilities",
3345
- tagline: "The agents and tools that act on your knowledge.",
3346
- accentText: "text-violet-600 dark:text-violet-400",
3347
- accentBg: "bg-violet-500/10",
3348
- accentBar: "bg-violet-500"
3349
- },
3350
- {
3351
- id: "source",
3352
- title: "Sources",
3353
- tagline: "Incoming sources of truth (Knowledge In).",
3354
- accentText: "text-sky-600 dark:text-sky-400",
3355
- accentBg: "bg-sky-500/10",
3356
- accentBar: "bg-sky-500"
3357
- },
3358
- {
3359
- id: "destination",
3360
- title: "Outputs",
3361
- tagline: "Knowledge your team produces.",
3362
- accentText: "text-emerald-600 dark:text-emerald-400",
3363
- accentBg: "bg-emerald-500/10",
3364
- accentBar: "bg-emerald-500"
3365
- },
3366
- {
3367
- id: "hybrid",
3368
- title: "Sources & Outputs",
3369
- tagline: "Read from and written to.",
3370
- accentText: "text-teal-600 dark:text-teal-400",
3371
- accentBg: "bg-teal-500/10",
3372
- accentBar: "bg-gradient-to-r from-sky-500 to-emerald-500"
3373
- },
3374
- {
3375
- id: "container",
3376
- title: "Workspaces",
3377
- tagline: "How work is organized.",
3378
- accentText: "text-amber-600 dark:text-amber-400",
3379
- accentBg: "bg-amber-500/10",
3380
- accentBar: "bg-amber-500"
3381
- }
3382
- ];
3383
- function getContentRoleMeta(role) {
3384
- return CONTENT_ROLES.find((r) => r.id === role) ?? CONTENT_ROLES[2];
3385
- }
3386
-
3387
- // src/react/components/AssociationCard.tsx
3388
3779
  import { Fragment as Fragment3, jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
3389
3780
  function AssociationCard({
3390
3781
  token,
@@ -3396,7 +3787,6 @@ function AssociationCard({
3396
3787
  const container = containerProp ?? fromCtx;
3397
3788
  const [open, setOpen] = useState10(false);
3398
3789
  const info = store.registry.getEntityInfo(token);
3399
- const role = getContentRoleMeta(info.contentRole);
3400
3790
  const Icon = info.Icon ?? DefaultEntityIcon;
3401
3791
  const [listOpen, setListOpen] = useState10(false);
3402
3792
  const {
@@ -3430,15 +3820,6 @@ function AssociationCard({
3430
3820
  className
3431
3821
  ),
3432
3822
  children: [
3433
- /* @__PURE__ */ jsx11(
3434
- "span",
3435
- {
3436
- className: cn7(
3437
- "absolute inset-x-0 top-0 h-0.5 opacity-60",
3438
- role.accentBar
3439
- )
3440
- }
3441
- ),
3442
3823
  /* @__PURE__ */ jsxs9(
3443
3824
  "button",
3444
3825
  {
@@ -3451,20 +3832,10 @@ function AssociationCard({
3451
3832
  canDrillIn ? "cursor-pointer" : "cursor-default"
3452
3833
  ),
3453
3834
  children: [
3454
- /* @__PURE__ */ jsx11(
3455
- "span",
3456
- {
3457
- className: cn7(
3458
- "flex h-9 w-9 shrink-0 items-center justify-center rounded-lg",
3459
- role.accentBg,
3460
- role.accentText
3461
- ),
3462
- children: /* @__PURE__ */ jsx11(Icon, { className: "h-4 w-4" })
3463
- }
3464
- ),
3835
+ /* @__PURE__ */ jsx11("span", { className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground", children: /* @__PURE__ */ jsx11(Icon, { className: "h-4 w-4" }) }),
3465
3836
  /* @__PURE__ */ jsxs9("span", { className: "min-w-0 flex-1", children: [
3466
3837
  /* @__PURE__ */ jsx11("span", { className: "block truncate text-sm font-medium text-foreground", children: info.labelPlural }),
3467
- /* @__PURE__ */ jsx11("span", { className: "block text-[11px] text-muted-foreground tabular-nums", children: loading ? /* @__PURE__ */ jsxs9("span", { className: "inline-flex items-center gap-1", children: [
3838
+ /* @__PURE__ */ jsx11("span", { className: "block text-xs text-muted-foreground tabular-nums", children: loading ? /* @__PURE__ */ jsxs9("span", { className: "inline-flex items-center gap-1", children: [
3468
3839
  /* @__PURE__ */ jsx11(SpinnerIcon, { className: "h-3 w-3 animate-spin" }),
3469
3840
  "Loading\u2026"
3470
3841
  ] }) : `${count} ${container.direction === "outgoing" ? "filed under" : "attached"}` })
@@ -3501,8 +3872,8 @@ function AssociationCard({
3501
3872
  setOpen(true);
3502
3873
  }
3503
3874
  } : {},
3504
- onDetach: (resourceId, role2) => detach(token, resourceId, role2 ?? void 0),
3505
- onSetPinned: (resourceId, pinned, role2) => setPinned(token, resourceId, pinned, role2 ?? void 0)
3875
+ onDetach: (resourceId, role) => detach(token, resourceId, role ?? void 0),
3876
+ onSetPinned: (resourceId, pinned, role) => setPinned(token, resourceId, pinned, role ?? void 0)
3506
3877
  }
3507
3878
  ),
3508
3879
  canAttach && /* @__PURE__ */ jsx11(
@@ -3524,6 +3895,55 @@ function AssociationCard({
3524
3895
 
3525
3896
  // src/react/components/AssociationCardGrid.tsx
3526
3897
  import { cn as cn8 } from "@ai-matrx/design-system";
3898
+
3899
+ // src/react/contentRoles.ts
3900
+ var CONTENT_ROLES = [
3901
+ {
3902
+ id: "utility",
3903
+ title: "Utilities",
3904
+ tagline: "The agents and tools that act on your knowledge.",
3905
+ accentText: "text-violet-600 dark:text-violet-400",
3906
+ accentBg: "bg-violet-500/10",
3907
+ accentBar: "bg-violet-500"
3908
+ },
3909
+ {
3910
+ id: "source",
3911
+ title: "Sources",
3912
+ tagline: "Incoming sources of truth (Knowledge In).",
3913
+ accentText: "text-sky-600 dark:text-sky-400",
3914
+ accentBg: "bg-sky-500/10",
3915
+ accentBar: "bg-sky-500"
3916
+ },
3917
+ {
3918
+ id: "destination",
3919
+ title: "Outputs",
3920
+ tagline: "Knowledge your team produces.",
3921
+ accentText: "text-emerald-600 dark:text-emerald-400",
3922
+ accentBg: "bg-emerald-500/10",
3923
+ accentBar: "bg-emerald-500"
3924
+ },
3925
+ {
3926
+ id: "hybrid",
3927
+ title: "Sources & Outputs",
3928
+ tagline: "Read from and written to.",
3929
+ accentText: "text-teal-600 dark:text-teal-400",
3930
+ accentBg: "bg-teal-500/10",
3931
+ accentBar: "bg-gradient-to-r from-sky-500 to-emerald-500"
3932
+ },
3933
+ {
3934
+ id: "container",
3935
+ title: "Workspaces",
3936
+ tagline: "How work is organized.",
3937
+ accentText: "text-amber-600 dark:text-amber-400",
3938
+ accentBg: "bg-amber-500/10",
3939
+ accentBar: "bg-amber-500"
3940
+ }
3941
+ ];
3942
+ function getContentRoleMeta(role) {
3943
+ return CONTENT_ROLES.find((r) => r.id === role) ?? CONTENT_ROLES[2];
3944
+ }
3945
+
3946
+ // src/react/components/AssociationCardGrid.tsx
3527
3947
  import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
3528
3948
  function AssociationCardGrid({
3529
3949
  tokens,
@@ -3557,27 +3977,13 @@ function AssociationCardGrid({
3557
3977
  );
3558
3978
  if (inRole.length === 0) return null;
3559
3979
  return /* @__PURE__ */ jsxs10("section", { children: [
3560
- /* @__PURE__ */ jsxs10("div", { className: "mb-2.5 flex items-baseline gap-3 pl-1.5", children: [
3561
- /* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-2", children: [
3562
- /* @__PURE__ */ jsx12(
3563
- "span",
3564
- {
3565
- className: cn8("h-2.5 w-2.5 rounded-full", role.accentBar)
3566
- }
3567
- ),
3568
- /* @__PURE__ */ jsx12("h3", { className: "text-sm font-semibold text-foreground", children: role.title })
3569
- ] }),
3570
- /* @__PURE__ */ jsx12("p", { className: "hidden text-xs text-muted-foreground sm:block", children: role.tagline })
3571
- ] }),
3572
- /* @__PURE__ */ jsx12("div", { className: "grid grid-cols-1 gap-2 @md:grid-cols-2 @3xl:grid-cols-3", children: inRole.map((token) => /* @__PURE__ */ jsx12(AssociationCard, { token }, token)) })
3980
+ /* @__PURE__ */ jsx12("h3", { className: "mb-2 text-sm font-semibold text-foreground", children: role.title }),
3981
+ /* @__PURE__ */ jsx12("div", { className: "flex flex-wrap gap-2 [&>*]:min-w-[16rem] [&>*]:flex-1", children: inRole.map((token) => /* @__PURE__ */ jsx12(AssociationCard, { token }, token)) })
3573
3982
  ] }, role.id);
3574
3983
  }),
3575
3984
  roleless.length > 0 && /* @__PURE__ */ jsxs10("section", { children: [
3576
- /* @__PURE__ */ jsxs10("div", { className: "mb-2.5 flex items-baseline gap-3 pl-1.5", children: [
3577
- /* @__PURE__ */ jsx12("h3", { className: "text-sm font-semibold text-foreground", children: "Filed under" }),
3578
- /* @__PURE__ */ jsx12("p", { className: "hidden text-xs text-muted-foreground sm:block", children: "Libraries, topics and other places this is kept." })
3579
- ] }),
3580
- /* @__PURE__ */ jsx12("div", { className: "grid grid-cols-1 gap-2 @md:grid-cols-2 @3xl:grid-cols-3", children: roleless.map((token) => /* @__PURE__ */ jsx12(AssociationCard, { token }, token)) })
3985
+ /* @__PURE__ */ jsx12("h3", { className: "mb-2 text-sm font-semibold text-foreground", children: "Filed under" }),
3986
+ /* @__PURE__ */ jsx12("div", { className: "flex flex-wrap gap-2 [&>*]:min-w-[16rem] [&>*]:flex-1", children: roleless.map((token) => /* @__PURE__ */ jsx12(AssociationCard, { token }, token)) })
3581
3987
  ] })
3582
3988
  ] });
3583
3989
  }
@@ -5651,6 +6057,7 @@ export {
5651
6057
  getContentRoleMeta,
5652
6058
  lazyPickerOverride,
5653
6059
  lazyWindowShell,
6060
+ linkDirection,
5654
6061
  useAssociationCandidates,
5655
6062
  useAssociationEntitySelectAdapter,
5656
6063
  useAssociationPickerBridge,