@ai-matrx/associations 0.10.7 → 0.11.1

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.
package/dist/index.d.cts CHANGED
@@ -1,7 +1,19 @@
1
1
  import { ElementType, ComponentType, ReactNode } from 'react';
2
2
 
3
- declare const ASSOCIATION_TARGET_TYPES: readonly ["organization", "scope", "scope_type", "project", "task", "context_item", "thread", "war_room", "category", "conversation", "fc_set", "fc_card", "study_media", "assessment", "note", "file", "quiz_session", "agent", "agent_term_list", "research_tag", "skill", "surface", "plan_entity", "plan_node", "web_site", "seo_topic", "seo_keyword", "web_page", "web_screenshot", "party", "crm_outreach_list", "crm_deal", "rulebook"];
3
+ declare const ASSOCIATION_TARGET_TYPES: readonly ["organization", "scope", "scope_type", "project", "task", "context_item", "thread", "war_room", "category", "conversation", "fc_set", "fc_card", "study_media", "assessment", "note", "file", "quiz_session", "agent", "agent_term_list", "research_tag", "skill", "surface", "plan_entity", "plan_node", "web_site", "seo_topic", "seo_keyword", "web_page", "web_screenshot", "party", "crm_outreach_list", "crm_deal", "rulebook", "research_topic", "media_source_library"];
4
4
  type AssociationTargetType = (typeof ASSOCIATION_TARGET_TYPES)[number];
5
+ /** Runtime guard: is this token one of the deliberate container (target) types? */
6
+ declare function isAssociationTargetType(value: unknown): value is AssociationTargetType;
7
+ /**
8
+ * Which edges a primary entity's association surfaces read and write.
9
+ * - `incoming` (default) — the primary is a CONTAINER: it lists what is
10
+ * attached INTO it (`resource → primary`) and "+" attaches resources to it.
11
+ * - `outgoing` — the primary is FILED UNDER things (a Source under a project,
12
+ * a research topic, a Library): it lists its own `primary → container`
13
+ * edges and "+" files it under a container. Only container (target) types
14
+ * can be filed under.
15
+ */
16
+ type AssociationDirection = "incoming" | "outgoing";
5
17
  interface AssociationEdge {
6
18
  id: string;
7
19
  direction: "outgoing" | "incoming";
@@ -16767,6 +16779,11 @@ interface AssociationPickerProps {
16767
16779
  ok: boolean;
16768
16780
  error?: string;
16769
16781
  }>;
16782
+ /**
16783
+ * Filed-under mode: the primary is being FILED UNDER the picked items
16784
+ * (`primary → item`), so the header says "File … under" not "Attach to".
16785
+ */
16786
+ filing?: boolean;
16770
16787
  }
16771
16788
  /** Per-token picker override map — absent tokens use the generic picker sheet. */
16772
16789
  type PickerOverrideMap = Partial<Record<EntityTypeToken, ComponentType<AssociationPickerProps>>>;
@@ -16848,4 +16865,4 @@ interface AssociationsConfig {
16848
16865
  authorDisplay?: AuthorDisplayPort;
16849
16866
  }
16850
16867
 
16851
- export { ASSOCIATION_TARGET_TYPES, type AssociationEdge, type AssociationPickerProps, type AssociationSourceEdge, type AssociationTargetEdge, type AssociationTargetType, type AssociationsConfig, type AssociationsDataSource, type AssociationsEntry, type AssociationsIdentity, type AssociationsNotifier, type AssociationsRpcError, type AssociationsRpcErrorCode, type AssociationsRpcResult, type AuthorDisplayInput, type AuthorDisplayPort, type CapturePickOpts, type CapturePort, type CaptureUploadOpts, type CaptureUploadResult, type CategoriesEntry, type CategoryDimension, type CommentAuthor, type CommentsEntry, type ComponentEntityToken, DEMANDED_RPC_NAMES, type DemandedRpcArgs, type DemandedRpcName, type DemandedRpcReturns, type DemandedRpcSignatures, ENTITY_TYPE_METADATA, ENTITY_TYPE_TOKENS, type EntityDoorProps, type EntityDoorsPort, type EntityOverlayEntry, type EntityOverlayMap, type EntityRefProps, type EntityTypeMeta, type EntityTypeToken, type ErrorSink, type ListedEntityToken, type ModuleEntityToken, type PgError, type PickerOverrideMap, type PlatformCategory, type PlatformComment, REFERENCE_CATEGORY_DISPLAY, type ReferencePickableEntityToken, SCHEMA_DISPLAY, type ScopeableEntityToken, type UserEntityState, type UserStateKind, type WindowShellPort, isAssociationsRpcErr, isEntityTypeToken };
16868
+ export { ASSOCIATION_TARGET_TYPES, type AssociationDirection, type AssociationEdge, type AssociationPickerProps, type AssociationSourceEdge, type AssociationTargetEdge, type AssociationTargetType, type AssociationsConfig, type AssociationsDataSource, type AssociationsEntry, type AssociationsIdentity, type AssociationsNotifier, type AssociationsRpcError, type AssociationsRpcErrorCode, type AssociationsRpcResult, type AuthorDisplayInput, type AuthorDisplayPort, type CapturePickOpts, type CapturePort, type CaptureUploadOpts, type CaptureUploadResult, type CategoriesEntry, type CategoryDimension, type CommentAuthor, type CommentsEntry, type ComponentEntityToken, DEMANDED_RPC_NAMES, type DemandedRpcArgs, type DemandedRpcName, type DemandedRpcReturns, type DemandedRpcSignatures, ENTITY_TYPE_METADATA, ENTITY_TYPE_TOKENS, type EntityDoorProps, type EntityDoorsPort, type EntityOverlayEntry, type EntityOverlayMap, type EntityRefProps, type EntityTypeMeta, type EntityTypeToken, type ErrorSink, type ListedEntityToken, type ModuleEntityToken, type PgError, type PickerOverrideMap, type PlatformCategory, type PlatformComment, REFERENCE_CATEGORY_DISPLAY, type ReferencePickableEntityToken, SCHEMA_DISPLAY, type ScopeableEntityToken, type UserEntityState, type UserStateKind, type WindowShellPort, isAssociationTargetType, isAssociationsRpcErr, isEntityTypeToken };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,19 @@
1
1
  import { ElementType, ComponentType, ReactNode } from 'react';
2
2
 
3
- declare const ASSOCIATION_TARGET_TYPES: readonly ["organization", "scope", "scope_type", "project", "task", "context_item", "thread", "war_room", "category", "conversation", "fc_set", "fc_card", "study_media", "assessment", "note", "file", "quiz_session", "agent", "agent_term_list", "research_tag", "skill", "surface", "plan_entity", "plan_node", "web_site", "seo_topic", "seo_keyword", "web_page", "web_screenshot", "party", "crm_outreach_list", "crm_deal", "rulebook"];
3
+ declare const ASSOCIATION_TARGET_TYPES: readonly ["organization", "scope", "scope_type", "project", "task", "context_item", "thread", "war_room", "category", "conversation", "fc_set", "fc_card", "study_media", "assessment", "note", "file", "quiz_session", "agent", "agent_term_list", "research_tag", "skill", "surface", "plan_entity", "plan_node", "web_site", "seo_topic", "seo_keyword", "web_page", "web_screenshot", "party", "crm_outreach_list", "crm_deal", "rulebook", "research_topic", "media_source_library"];
4
4
  type AssociationTargetType = (typeof ASSOCIATION_TARGET_TYPES)[number];
5
+ /** Runtime guard: is this token one of the deliberate container (target) types? */
6
+ declare function isAssociationTargetType(value: unknown): value is AssociationTargetType;
7
+ /**
8
+ * Which edges a primary entity's association surfaces read and write.
9
+ * - `incoming` (default) — the primary is a CONTAINER: it lists what is
10
+ * attached INTO it (`resource → primary`) and "+" attaches resources to it.
11
+ * - `outgoing` — the primary is FILED UNDER things (a Source under a project,
12
+ * a research topic, a Library): it lists its own `primary → container`
13
+ * edges and "+" files it under a container. Only container (target) types
14
+ * can be filed under.
15
+ */
16
+ type AssociationDirection = "incoming" | "outgoing";
5
17
  interface AssociationEdge {
6
18
  id: string;
7
19
  direction: "outgoing" | "incoming";
@@ -16767,6 +16779,11 @@ interface AssociationPickerProps {
16767
16779
  ok: boolean;
16768
16780
  error?: string;
16769
16781
  }>;
16782
+ /**
16783
+ * Filed-under mode: the primary is being FILED UNDER the picked items
16784
+ * (`primary → item`), so the header says "File … under" not "Attach to".
16785
+ */
16786
+ filing?: boolean;
16770
16787
  }
16771
16788
  /** Per-token picker override map — absent tokens use the generic picker sheet. */
16772
16789
  type PickerOverrideMap = Partial<Record<EntityTypeToken, ComponentType<AssociationPickerProps>>>;
@@ -16848,4 +16865,4 @@ interface AssociationsConfig {
16848
16865
  authorDisplay?: AuthorDisplayPort;
16849
16866
  }
16850
16867
 
16851
- export { ASSOCIATION_TARGET_TYPES, type AssociationEdge, type AssociationPickerProps, type AssociationSourceEdge, type AssociationTargetEdge, type AssociationTargetType, type AssociationsConfig, type AssociationsDataSource, type AssociationsEntry, type AssociationsIdentity, type AssociationsNotifier, type AssociationsRpcError, type AssociationsRpcErrorCode, type AssociationsRpcResult, type AuthorDisplayInput, type AuthorDisplayPort, type CapturePickOpts, type CapturePort, type CaptureUploadOpts, type CaptureUploadResult, type CategoriesEntry, type CategoryDimension, type CommentAuthor, type CommentsEntry, type ComponentEntityToken, DEMANDED_RPC_NAMES, type DemandedRpcArgs, type DemandedRpcName, type DemandedRpcReturns, type DemandedRpcSignatures, ENTITY_TYPE_METADATA, ENTITY_TYPE_TOKENS, type EntityDoorProps, type EntityDoorsPort, type EntityOverlayEntry, type EntityOverlayMap, type EntityRefProps, type EntityTypeMeta, type EntityTypeToken, type ErrorSink, type ListedEntityToken, type ModuleEntityToken, type PgError, type PickerOverrideMap, type PlatformCategory, type PlatformComment, REFERENCE_CATEGORY_DISPLAY, type ReferencePickableEntityToken, SCHEMA_DISPLAY, type ScopeableEntityToken, type UserEntityState, type UserStateKind, type WindowShellPort, isAssociationsRpcErr, isEntityTypeToken };
16868
+ export { ASSOCIATION_TARGET_TYPES, type AssociationDirection, type AssociationEdge, type AssociationPickerProps, type AssociationSourceEdge, type AssociationTargetEdge, type AssociationTargetType, type AssociationsConfig, type AssociationsDataSource, type AssociationsEntry, type AssociationsIdentity, type AssociationsNotifier, type AssociationsRpcError, type AssociationsRpcErrorCode, type AssociationsRpcResult, type AuthorDisplayInput, type AuthorDisplayPort, type CapturePickOpts, type CapturePort, type CaptureUploadOpts, type CaptureUploadResult, type CategoriesEntry, type CategoryDimension, type CommentAuthor, type CommentsEntry, type ComponentEntityToken, DEMANDED_RPC_NAMES, type DemandedRpcArgs, type DemandedRpcName, type DemandedRpcReturns, type DemandedRpcSignatures, ENTITY_TYPE_METADATA, ENTITY_TYPE_TOKENS, type EntityDoorProps, type EntityDoorsPort, type EntityOverlayEntry, type EntityOverlayMap, type EntityRefProps, type EntityTypeMeta, type EntityTypeToken, type ErrorSink, type ListedEntityToken, type ModuleEntityToken, type PgError, type PickerOverrideMap, type PlatformCategory, type PlatformComment, REFERENCE_CATEGORY_DISPLAY, type ReferencePickableEntityToken, SCHEMA_DISPLAY, type ScopeableEntityToken, type UserEntityState, type UserStateKind, type WindowShellPort, isAssociationTargetType, isAssociationsRpcErr, isEntityTypeToken };
package/dist/index.js CHANGED
@@ -2104,9 +2104,16 @@ var ASSOCIATION_TARGET_TYPES = [
2104
2104
  // a CRM outreach list (a worked send/dial queue) — parties and resources attach into it
2105
2105
  "crm_deal",
2106
2106
  // a CRM deal (crm.deal) — people on it (role 'deal_contact'), tasks/files attach onto it
2107
- "rulebook"
2107
+ "rulebook",
2108
2108
  // a Masterwork Rulebook — its Scout interviews attach here (conversation→rulebook, role 'interview')
2109
+ "research_topic",
2110
+ // a research topic — Sources are filed under it (processed_document→research_topic, the landing door's edge)
2111
+ "media_source_library"
2112
+ // a media-catalog Library — Sources are catalogued into it (processed_document→media_source_library)
2109
2113
  ];
2114
+ function isAssociationTargetType(value) {
2115
+ return typeof value === "string" && ASSOCIATION_TARGET_TYPES.includes(value);
2116
+ }
2110
2117
 
2111
2118
  // src/results.ts
2112
2119
  function isAssociationsRpcErr(r) {
@@ -2152,6 +2159,7 @@ export {
2152
2159
  ENTITY_TYPE_TOKENS,
2153
2160
  REFERENCE_CATEGORY_DISPLAY,
2154
2161
  SCHEMA_DISPLAY,
2162
+ isAssociationTargetType,
2155
2163
  isAssociationsRpcErr,
2156
2164
  isEntityTypeToken
2157
2165
  };