@ai-matrx/associations 0.11.0 → 0.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode, ComponentType } from 'react';
3
- import { j as AssociationsNotifier, W as WindowShellPort, k as CapturePort, P as PickerOverrideMap, E as EntityDoorsPort, l as AuthorDisplayPort, m as AssociationsStore, n as CategoryMutationResult, o as CategoryDimension, p as PlatformCategory, q as CategoriesEntry, r as EntityTypeToken, s as UniversalCandidate, t as CandidateRecord, u as PlatformComment, v as CommentsEntry, w as CommentMutationResult, e as AssociationPickerProps, x as EntityDoorProps, y as EntityRefProps, z as ContentRole } from '../CommentThread-ZWiJVDpI.cjs';
4
- export { B as AssociationCaptureToolbar, A as AssociationCaptureToolbarProps, D as AssociationCard, F as AssociationCardGrid, b as AssociationCardGridProps, a as AssociationCardProps, G as AssociationEntitySelect, H as AssociationEntitySelectAdapter, I as AssociationEntitySelectItem, c as AssociationEntitySelectProps, J as AssociationList, d as AssociationListProps, K as AssociationWindow, f as AssociationWindowProps, L as AssociationWriteResult, M as AttachedItemsSheet, g as AttachedItemsSheetProps, N as CaptureAttach, O as CaptureAttachResult, Q as CaptureToolbarAction, R as CategorySelect, C as CategorySelectProps, S as CategoryTagPicker, h as CategoryTagPickerProps, T as CommentComposer, V as CommentComposerProps, X as CommentThread, i as CommentThreadProps, Y as ContainerLink, Z as ContainerResourceRow, _ as ContainerResourcesAdapter, $ as DefaultEntityIcon, a0 as PrimaryContainerEntity, a1 as PrimaryEntity, a2 as PrimaryEntityProvider, a3 as PrimaryFiledEntity, a4 as TagPickerIcon, a5 as UniversalAssociationPicker, U as UniversalAssociationPickerProps, a6 as UseAssociationEntitySelectAdapterArgs, a7 as UseAssociationsArgs, a8 as UseAssociationsReturn, a9 as UseContainerLinksArgs, aa as UseContainerLinksReturn, ab as attachedKey, ac as buildCommentTree, ad as containerLinksArgs, ae as useAssociationEntitySelectAdapter, af as useAssociations, ag as useContainerLinks, ah as useContainerLinksAdapter, ai as useEntityRelationships, aj as usePrimaryEntity } from '../CommentThread-ZWiJVDpI.cjs';
3
+ import { j as AssociationsNotifier, W as WindowShellPort, k as CapturePort, P as PickerOverrideMap, E as EntityDoorsPort, l as AuthorDisplayPort, m as AssociationsStore, n as CategoryMutationResult, o as CategoryDimension, p as PlatformCategory, q as CategoriesEntry, r as EntityTypeToken, s as UniversalCandidate, t as CandidateRecord, u as PlatformComment, v as CommentsEntry, w as CommentMutationResult, e as AssociationPickerProps, x as EntityDoorProps, y as EntityRefProps, z as ContentRole } from '../CommentThread-4DN5Fe4g.cjs';
4
+ export { B as AssociationCaptureToolbar, A as AssociationCaptureToolbarProps, D as AssociationCard, F as AssociationCardGrid, b as AssociationCardGridProps, a as AssociationCardProps, G as AssociationEntitySelect, H as AssociationEntitySelectAdapter, I as AssociationEntitySelectItem, c as AssociationEntitySelectProps, J as AssociationList, d as AssociationListProps, K as AssociationWindow, f as AssociationWindowProps, L as AssociationWriteResult, M as AttachedItemsSheet, g as AttachedItemsSheetProps, N as CaptureAttach, O as CaptureAttachResult, Q as CaptureToolbarAction, R as CategorySelect, C as CategorySelectProps, S as CategoryTagPicker, h as CategoryTagPickerProps, T as CommentComposer, V as CommentComposerProps, X as CommentThread, i as CommentThreadProps, Y as ContainerLink, Z as ContainerResourceRow, _ as ContainerResourcesAdapter, $ as DefaultEntityIcon, a0 as PrimaryContainerEntity, a1 as PrimaryEntity, a2 as PrimaryEntityProvider, a3 as PrimaryFiledEntity, a4 as TagPickerIcon, a5 as UniversalAssociationPicker, U as UniversalAssociationPickerProps, a6 as UseAssociationEntitySelectAdapterArgs, a7 as UseAssociationsArgs, a8 as UseAssociationsReturn, a9 as UseContainerLinksArgs, aa as UseContainerLinksReturn, ab as attachedKey, ac as buildCommentTree, ad as containerLinksArgs, ae as useAssociationEntitySelectAdapter, af as useAssociations, ag as useContainerLinks, ah as useContainerLinksAdapter, ai as useEntityRelationships, aj as usePrimaryEntity } from '../CommentThread-4DN5Fe4g.cjs';
5
5
 
6
6
  interface AssociationsUiPorts {
7
7
  notifier?: AssociationsNotifier;
@@ -1,7 +1,7 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode, ComponentType } from 'react';
3
- import { j as AssociationsNotifier, W as WindowShellPort, k as CapturePort, P as PickerOverrideMap, E as EntityDoorsPort, l as AuthorDisplayPort, m as AssociationsStore, n as CategoryMutationResult, o as CategoryDimension, p as PlatformCategory, q as CategoriesEntry, r as EntityTypeToken, s as UniversalCandidate, t as CandidateRecord, u as PlatformComment, v as CommentsEntry, w as CommentMutationResult, e as AssociationPickerProps, x as EntityDoorProps, y as EntityRefProps, z as ContentRole } from '../CommentThread-ZWiJVDpI.js';
4
- export { B as AssociationCaptureToolbar, A as AssociationCaptureToolbarProps, D as AssociationCard, F as AssociationCardGrid, b as AssociationCardGridProps, a as AssociationCardProps, G as AssociationEntitySelect, H as AssociationEntitySelectAdapter, I as AssociationEntitySelectItem, c as AssociationEntitySelectProps, J as AssociationList, d as AssociationListProps, K as AssociationWindow, f as AssociationWindowProps, L as AssociationWriteResult, M as AttachedItemsSheet, g as AttachedItemsSheetProps, N as CaptureAttach, O as CaptureAttachResult, Q as CaptureToolbarAction, R as CategorySelect, C as CategorySelectProps, S as CategoryTagPicker, h as CategoryTagPickerProps, T as CommentComposer, V as CommentComposerProps, X as CommentThread, i as CommentThreadProps, Y as ContainerLink, Z as ContainerResourceRow, _ as ContainerResourcesAdapter, $ as DefaultEntityIcon, a0 as PrimaryContainerEntity, a1 as PrimaryEntity, a2 as PrimaryEntityProvider, a3 as PrimaryFiledEntity, a4 as TagPickerIcon, a5 as UniversalAssociationPicker, U as UniversalAssociationPickerProps, a6 as UseAssociationEntitySelectAdapterArgs, a7 as UseAssociationsArgs, a8 as UseAssociationsReturn, a9 as UseContainerLinksArgs, aa as UseContainerLinksReturn, ab as attachedKey, ac as buildCommentTree, ad as containerLinksArgs, ae as useAssociationEntitySelectAdapter, af as useAssociations, ag as useContainerLinks, ah as useContainerLinksAdapter, ai as useEntityRelationships, aj as usePrimaryEntity } from '../CommentThread-ZWiJVDpI.js';
3
+ import { j as AssociationsNotifier, W as WindowShellPort, k as CapturePort, P as PickerOverrideMap, E as EntityDoorsPort, l as AuthorDisplayPort, m as AssociationsStore, n as CategoryMutationResult, o as CategoryDimension, p as PlatformCategory, q as CategoriesEntry, r as EntityTypeToken, s as UniversalCandidate, t as CandidateRecord, u as PlatformComment, v as CommentsEntry, w as CommentMutationResult, e as AssociationPickerProps, x as EntityDoorProps, y as EntityRefProps, z as ContentRole } from '../CommentThread-4DN5Fe4g.js';
4
+ export { B as AssociationCaptureToolbar, A as AssociationCaptureToolbarProps, D as AssociationCard, F as AssociationCardGrid, b as AssociationCardGridProps, a as AssociationCardProps, G as AssociationEntitySelect, H as AssociationEntitySelectAdapter, I as AssociationEntitySelectItem, c as AssociationEntitySelectProps, J as AssociationList, d as AssociationListProps, K as AssociationWindow, f as AssociationWindowProps, L as AssociationWriteResult, M as AttachedItemsSheet, g as AttachedItemsSheetProps, N as CaptureAttach, O as CaptureAttachResult, Q as CaptureToolbarAction, R as CategorySelect, C as CategorySelectProps, S as CategoryTagPicker, h as CategoryTagPickerProps, T as CommentComposer, V as CommentComposerProps, X as CommentThread, i as CommentThreadProps, Y as ContainerLink, Z as ContainerResourceRow, _ as ContainerResourcesAdapter, $ as DefaultEntityIcon, a0 as PrimaryContainerEntity, a1 as PrimaryEntity, a2 as PrimaryEntityProvider, a3 as PrimaryFiledEntity, a4 as TagPickerIcon, a5 as UniversalAssociationPicker, U as UniversalAssociationPickerProps, a6 as UseAssociationEntitySelectAdapterArgs, a7 as UseAssociationsArgs, a8 as UseAssociationsReturn, a9 as UseContainerLinksArgs, aa as UseContainerLinksReturn, ab as attachedKey, ac as buildCommentTree, ad as containerLinksArgs, ae as useAssociationEntitySelectAdapter, af as useAssociations, ag as useContainerLinks, ah as useContainerLinksAdapter, ai as useEntityRelationships, aj as usePrimaryEntity } from '../CommentThread-4DN5Fe4g.js';
5
5
 
6
6
  interface AssociationsUiPorts {
7
7
  notifier?: AssociationsNotifier;
@@ -687,6 +687,8 @@ var ENTITY_TYPE_TOKENS = [
687
687
  "oauth_handoff_claim",
688
688
  "opinion_clusters",
689
689
  "opinions",
690
+ "ops_check_item",
691
+ "ops_check_run",
690
692
  "ops_issue_class",
691
693
  "ops_issue_event",
692
694
  "ops_proof_check",
@@ -944,6 +946,7 @@ var ENTITY_TYPE_TOKENS = [
944
946
  "task",
945
947
  "task_user_state",
946
948
  "taxonomy_node",
949
+ "team",
947
950
  "template_context_items",
948
951
  "template_scope_types",
949
952
  "templates",
@@ -978,6 +981,7 @@ var ENTITY_TYPE_TOKENS = [
978
981
  "ui_surface_agent_role",
979
982
  "ui_surface_client_tool",
980
983
  "ui_surface_config",
984
+ "ui_surface_item_type",
981
985
  "ui_surface_value",
982
986
  "ui_surface_write_target",
983
987
  "univer_payload",
@@ -1252,8 +1256,12 @@ var ASSOCIATION_TARGET_TYPES = [
1252
1256
  // a CRM outreach list (a worked send/dial queue) — parties and resources attach into it
1253
1257
  "crm_deal",
1254
1258
  // a CRM deal (crm.deal) — people on it (role 'deal_contact'), tasks/files attach onto it
1255
- "rulebook"
1259
+ "rulebook",
1256
1260
  // a Masterwork Rulebook — its Scout interviews attach here (conversation→rulebook, role 'interview')
1261
+ "research_topic",
1262
+ // a research topic — Sources are filed under it (processed_document→research_topic, the landing door's edge)
1263
+ "media_source_library"
1264
+ // a media-catalog Library — Sources are catalogued into it (processed_document→media_source_library)
1257
1265
  ];
1258
1266
  function isAssociationTargetType(value) {
1259
1267
  return typeof value === "string" && ASSOCIATION_TARGET_TYPES.includes(value);
@@ -1442,6 +1450,7 @@ function useContainerLinks(args) {
1442
1450
  error,
1443
1451
  reload,
1444
1452
  totalCount: incoming.length,
1453
+ presentTokens: [...new Set(incoming.map((link) => link.token))],
1445
1454
  countFor,
1446
1455
  attachedIdsFor,
1447
1456
  linksFor,
@@ -3327,30 +3336,52 @@ function AssociationCardGrid({
3327
3336
  const primary = usePrimaryEntity();
3328
3337
  const excluded = new Set(excludeTokens ?? []);
3329
3338
  const filing = primary?.direction === "outgoing";
3330
- const list = (tokens ?? store.registry.curatedTokens()).filter(
3339
+ const links = useContainerLinks(containerLinksArgs(primary));
3340
+ const base2 = tokens ?? store.registry.curatedTokens();
3341
+ const withPresent = filing ? [
3342
+ ...base2,
3343
+ ...links.presentTokens.filter(
3344
+ (t) => isEntityTypeToken(t) && !base2.includes(t)
3345
+ )
3346
+ ] : base2;
3347
+ const list = withPresent.filter(
3331
3348
  (token) => !excluded.has(token) && (!filing || isAssociationTargetType(token))
3332
3349
  );
3333
- return /* @__PURE__ */ jsx11("div", { className: cn7("space-y-5", className), children: CONTENT_ROLES.map((role) => {
3334
- const inRole = list.filter(
3335
- (token) => store.registry.getEntityInfo(token).contentRole === role.id
3336
- );
3337
- if (inRole.length === 0) return null;
3338
- return /* @__PURE__ */ jsxs9("section", { children: [
3339
- /* @__PURE__ */ jsxs9("div", { className: "mb-2.5 flex items-baseline gap-3 pl-1.5", children: [
3340
- /* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-2", children: [
3341
- /* @__PURE__ */ jsx11(
3342
- "span",
3343
- {
3344
- className: cn7("h-2.5 w-2.5 rounded-full", role.accentBar)
3345
- }
3346
- ),
3347
- /* @__PURE__ */ jsx11("h3", { className: "text-sm font-semibold text-foreground", children: role.title })
3350
+ const roleIds = new Set(CONTENT_ROLES.map((r) => r.id));
3351
+ const roleless = filing ? list.filter((token) => {
3352
+ const role = store.registry.getEntityInfo(token).contentRole;
3353
+ return !role || !roleIds.has(role);
3354
+ }) : [];
3355
+ return /* @__PURE__ */ jsxs9("div", { className: cn7("space-y-5", className), children: [
3356
+ CONTENT_ROLES.map((role) => {
3357
+ const inRole = list.filter(
3358
+ (token) => store.registry.getEntityInfo(token).contentRole === role.id
3359
+ );
3360
+ if (inRole.length === 0) return null;
3361
+ return /* @__PURE__ */ jsxs9("section", { children: [
3362
+ /* @__PURE__ */ jsxs9("div", { className: "mb-2.5 flex items-baseline gap-3 pl-1.5", children: [
3363
+ /* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-2", children: [
3364
+ /* @__PURE__ */ jsx11(
3365
+ "span",
3366
+ {
3367
+ className: cn7("h-2.5 w-2.5 rounded-full", role.accentBar)
3368
+ }
3369
+ ),
3370
+ /* @__PURE__ */ jsx11("h3", { className: "text-sm font-semibold text-foreground", children: role.title })
3371
+ ] }),
3372
+ /* @__PURE__ */ jsx11("p", { className: "hidden text-xs text-muted-foreground sm:block", children: role.tagline })
3348
3373
  ] }),
3349
- /* @__PURE__ */ jsx11("p", { className: "hidden text-xs text-muted-foreground sm:block", children: role.tagline })
3374
+ /* @__PURE__ */ jsx11("div", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3", children: inRole.map((token) => /* @__PURE__ */ jsx11(AssociationCard, { token }, token)) })
3375
+ ] }, role.id);
3376
+ }),
3377
+ roleless.length > 0 && /* @__PURE__ */ jsxs9("section", { children: [
3378
+ /* @__PURE__ */ jsxs9("div", { className: "mb-2.5 flex items-baseline gap-3 pl-1.5", children: [
3379
+ /* @__PURE__ */ jsx11("h3", { className: "text-sm font-semibold text-foreground", children: "Filed under" }),
3380
+ /* @__PURE__ */ jsx11("p", { className: "hidden text-xs text-muted-foreground sm:block", children: "Libraries, topics and other places this is kept." })
3350
3381
  ] }),
3351
- /* @__PURE__ */ jsx11("div", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3", children: inRole.map((token) => /* @__PURE__ */ jsx11(AssociationCard, { token }, token)) })
3352
- ] }, role.id);
3353
- }) });
3382
+ /* @__PURE__ */ jsx11("div", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3", children: roleless.map((token) => /* @__PURE__ */ jsx11(AssociationCard, { token }, token)) })
3383
+ ] })
3384
+ ] });
3354
3385
  }
3355
3386
 
3356
3387
  // src/react/components/AssociationList.tsx