@elizaos/plugin-relationships 2.0.3-beta.5 → 2.0.3-beta.7

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.
Files changed (51) hide show
  1. package/dist/actions/entity.d.ts +72 -0
  2. package/dist/actions/entity.d.ts.map +1 -0
  3. package/dist/actions/entity.js +312 -0
  4. package/dist/actions/entity.js.map +1 -0
  5. package/dist/components/relationships/RelationshipsSpatialView.d.ts +72 -0
  6. package/dist/components/relationships/RelationshipsSpatialView.d.ts.map +1 -0
  7. package/dist/components/relationships/RelationshipsSpatialView.js +120 -0
  8. package/dist/components/relationships/RelationshipsSpatialView.js.map +1 -0
  9. package/dist/components/relationships/RelationshipsView.d.ts +70 -0
  10. package/dist/components/relationships/RelationshipsView.d.ts.map +1 -0
  11. package/dist/components/relationships/RelationshipsView.js +193 -0
  12. package/dist/components/relationships/RelationshipsView.js.map +1 -0
  13. package/dist/components/relationships/relationships-view-bundle.d.ts +2 -0
  14. package/dist/components/relationships/relationships-view-bundle.d.ts.map +1 -0
  15. package/dist/components/relationships/relationships-view-bundle.js +5 -0
  16. package/dist/components/relationships/relationships-view-bundle.js.map +1 -0
  17. package/dist/db/index.d.ts +2 -0
  18. package/dist/db/index.d.ts.map +1 -0
  19. package/dist/db/index.js +2 -0
  20. package/dist/db/index.js.map +1 -0
  21. package/dist/db/schema.d.ts +240 -0
  22. package/dist/db/schema.d.ts.map +1 -0
  23. package/dist/db/schema.js +49 -0
  24. package/dist/db/schema.js.map +1 -0
  25. package/dist/index.d.ts +13 -0
  26. package/dist/index.d.ts.map +1 -0
  27. package/dist/index.js +36 -0
  28. package/dist/index.js.map +1 -0
  29. package/dist/plugin.d.ts +23 -0
  30. package/dist/plugin.d.ts.map +1 -0
  31. package/dist/plugin.js +33 -0
  32. package/dist/plugin.js.map +1 -0
  33. package/dist/providers/entity-graph.d.ts +20 -0
  34. package/dist/providers/entity-graph.d.ts.map +1 -0
  35. package/dist/providers/entity-graph.js +83 -0
  36. package/dist/providers/entity-graph.js.map +1 -0
  37. package/dist/register-terminal-view.d.ts +15 -0
  38. package/dist/register-terminal-view.d.ts.map +1 -0
  39. package/dist/register-terminal-view.js +21 -0
  40. package/dist/register-terminal-view.js.map +1 -0
  41. package/dist/register.d.ts +10 -0
  42. package/dist/register.d.ts.map +1 -0
  43. package/dist/register.js +5 -0
  44. package/dist/register.js.map +1 -0
  45. package/dist/types.d.ts +134 -0
  46. package/dist/types.d.ts.map +1 -0
  47. package/dist/types.js +51 -0
  48. package/dist/types.js.map +1 -0
  49. package/dist/views/bundle.js +328 -0
  50. package/dist/views/bundle.js.map +1 -0
  51. package/package.json +8 -8
package/dist/index.js ADDED
@@ -0,0 +1,36 @@
1
+ import { entityAction } from "./actions/entity.js";
2
+ import {
3
+ EMPTY_RELATIONSHIPS,
4
+ RelationshipsSpatialView
5
+ } from "./components/relationships/RelationshipsSpatialView.js";
6
+ import { RelationshipsView } from "./components/relationships/RelationshipsView.js";
7
+ import {
8
+ entitiesTable,
9
+ relationshipsSchema,
10
+ relationshipsTable
11
+ } from "./db/schema.js";
12
+ import { relationshipsPlugin } from "./plugin.js";
13
+ import { entityGraphProvider } from "./providers/entity-graph.js";
14
+ import {
15
+ registerRelationshipsTerminalView,
16
+ setRelationshipsTerminalSnapshot
17
+ } from "./register-terminal-view.js";
18
+ export * from "./types.js";
19
+ import { relationshipsPlugin as relationshipsPlugin2 } from "./plugin.js";
20
+ var index_default = relationshipsPlugin2;
21
+ import "./register.js";
22
+ export {
23
+ EMPTY_RELATIONSHIPS,
24
+ RelationshipsSpatialView,
25
+ RelationshipsView,
26
+ index_default as default,
27
+ entitiesTable,
28
+ entityAction,
29
+ entityGraphProvider,
30
+ registerRelationshipsTerminalView,
31
+ relationshipsPlugin,
32
+ relationshipsSchema,
33
+ relationshipsTable,
34
+ setRelationshipsTerminalSnapshot
35
+ };
36
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export type { EntityActionParameters } from \"./actions/entity.js\";\nexport { entityAction } from \"./actions/entity.js\";\nexport {\n EMPTY_RELATIONSHIPS,\n type EntityNode,\n type KindFilter,\n type RelationshipEdge,\n type RelationshipsSnapshot,\n RelationshipsSpatialView,\n type RelationshipsViewState,\n} from \"./components/relationships/RelationshipsSpatialView.js\";\nexport { RelationshipsView } from \"./components/relationships/RelationshipsView.js\";\nexport {\n type EntityInsert,\n type EntityRow,\n entitiesTable,\n type RelationshipInsert,\n type RelationshipRow,\n relationshipsSchema,\n relationshipsTable,\n} from \"./db/schema.js\";\nexport { relationshipsPlugin } from \"./plugin.js\";\nexport { entityGraphProvider } from \"./providers/entity-graph.js\";\nexport {\n registerRelationshipsTerminalView,\n setRelationshipsTerminalSnapshot,\n} from \"./register-terminal-view.js\";\nexport * from \"./types.js\";\n\nimport { relationshipsPlugin } from \"./plugin.js\";\n\nexport default relationshipsPlugin;\n\n// Side-effect: in a terminal host (Node agent, no DOM) this registers the\n// relationships terminal view. DOM-guarded so the terminal engine stays out of\n// browser bundles.\nimport \"./register.js\";\n"],"mappings":"AACA,SAAS,oBAAoB;AAC7B;AAAA,EACE;AAAA,EAKA;AAAA,OAEK;AACP,SAAS,yBAAyB;AAClC;AAAA,EAGE;AAAA,EAGA;AAAA,EACA;AAAA,OACK;AACP,SAAS,2BAA2B;AACpC,SAAS,2BAA2B;AACpC;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,cAAc;AAEd,SAAS,uBAAAA,4BAA2B;AAEpC,IAAO,gBAAQA;AAKf,OAAO;","names":["relationshipsPlugin"]}
@@ -0,0 +1,23 @@
1
+ import type { Plugin } from "@elizaos/core";
2
+ /**
3
+ * `@elizaos/plugin-relationships`
4
+ *
5
+ * The relationships viewer + "extras" over the runtime knowledge graph. The
6
+ * graph itself (`EntityStore` / `RelationshipStore`) is owned by the runtime:
7
+ * `@elizaos/agent`'s `KnowledgeGraphService`. This plugin consumes it via
8
+ * `resolveKnowledgeGraphService(runtime)` and adds:
9
+ * - the `KNOWLEDGE_GRAPH` graph-CRUD action,
10
+ * - the `ENTITY_GRAPH` planner-context provider,
11
+ * - the `/relationships` viewer.
12
+ *
13
+ * It does NOT register an `ENTITY` action — `@elizaos/plugin-personal-assistant`
14
+ * owns that (rich Rolodex orchestration with an LLM planner). Keeping a
15
+ * distinct action name avoids a duplicate `ENTITY` registration when both
16
+ * plugins load together.
17
+ *
18
+ * Hard-depends on `@elizaos/plugin-sql` — the runtime registers migrations
19
+ * from `schema` (this module's drizzle pgSchema('app_relationships')).
20
+ */
21
+ export declare const relationshipsPlugin: Plugin;
22
+ export default relationshipsPlugin;
23
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAM5C;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAyBjC,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
package/dist/plugin.js ADDED
@@ -0,0 +1,33 @@
1
+ import { entityAction } from "./actions/entity.js";
2
+ import * as dbSchema from "./db/index.js";
3
+ import { entityGraphProvider } from "./providers/entity-graph.js";
4
+ const relationshipsPlugin = {
5
+ name: "relationships",
6
+ description: "Relationships viewer + extras over the runtime knowledge graph. Provides the KNOWLEDGE_GRAPH graph-CRUD action (create/read/list/log_interaction/set_identity/set_relationship/merge over the runtime EntityStore/RelationshipStore), the ENTITY_GRAPH planner-context provider, the /relationships viewer, and a drizzle pgSchema('app_relationships'). The graph stores are owned by @elizaos/agent's KnowledgeGraphService; contact orchestration stays in @elizaos/plugin-personal-assistant.",
7
+ dependencies: ["@elizaos/plugin-sql"],
8
+ actions: [entityAction],
9
+ providers: [entityGraphProvider],
10
+ services: [],
11
+ schema: dbSchema,
12
+ views: [
13
+ {
14
+ id: "relationships",
15
+ label: "Relationships",
16
+ description: "Entity and relationship knowledge-graph viewer: people, organizations, identities, and the typed edges between them.",
17
+ icon: "Users",
18
+ path: "/relationships",
19
+ modalities: ["gui", "xr", "tui"],
20
+ bundlePath: "dist/views/bundle.js",
21
+ componentExport: "RelationshipsView",
22
+ tags: ["relationships", "entities", "people", "contacts", "graph"],
23
+ visibleInManager: true,
24
+ desktopTabEnabled: true
25
+ }
26
+ ]
27
+ };
28
+ var plugin_default = relationshipsPlugin;
29
+ export {
30
+ plugin_default as default,
31
+ relationshipsPlugin
32
+ };
33
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/plugin.ts"],"sourcesContent":["import type { Plugin } from \"@elizaos/core\";\n\nimport { entityAction } from \"./actions/entity.js\";\nimport * as dbSchema from \"./db/index.js\";\nimport { entityGraphProvider } from \"./providers/entity-graph.js\";\n\n/**\n * `@elizaos/plugin-relationships`\n *\n * The relationships viewer + \"extras\" over the runtime knowledge graph. The\n * graph itself (`EntityStore` / `RelationshipStore`) is owned by the runtime:\n * `@elizaos/agent`'s `KnowledgeGraphService`. This plugin consumes it via\n * `resolveKnowledgeGraphService(runtime)` and adds:\n * - the `KNOWLEDGE_GRAPH` graph-CRUD action,\n * - the `ENTITY_GRAPH` planner-context provider,\n * - the `/relationships` viewer.\n *\n * It does NOT register an `ENTITY` action — `@elizaos/plugin-personal-assistant`\n * owns that (rich Rolodex orchestration with an LLM planner). Keeping a\n * distinct action name avoids a duplicate `ENTITY` registration when both\n * plugins load together.\n *\n * Hard-depends on `@elizaos/plugin-sql` — the runtime registers migrations\n * from `schema` (this module's drizzle pgSchema('app_relationships')).\n */\nexport const relationshipsPlugin: Plugin = {\n name: \"relationships\",\n description:\n \"Relationships viewer + extras over the runtime knowledge graph. Provides the KNOWLEDGE_GRAPH graph-CRUD action (create/read/list/log_interaction/set_identity/set_relationship/merge over the runtime EntityStore/RelationshipStore), the ENTITY_GRAPH planner-context provider, the /relationships viewer, and a drizzle pgSchema('app_relationships'). The graph stores are owned by @elizaos/agent's KnowledgeGraphService; contact orchestration stays in @elizaos/plugin-personal-assistant.\",\n dependencies: [\"@elizaos/plugin-sql\"],\n actions: [entityAction],\n providers: [entityGraphProvider],\n services: [],\n schema: dbSchema,\n views: [\n {\n id: \"relationships\",\n label: \"Relationships\",\n description:\n \"Entity and relationship knowledge-graph viewer: people, organizations, identities, and the typed edges between them.\",\n icon: \"Users\",\n path: \"/relationships\",\n modalities: [\"gui\", \"xr\", \"tui\"],\n bundlePath: \"dist/views/bundle.js\",\n componentExport: \"RelationshipsView\",\n tags: [\"relationships\", \"entities\", \"people\", \"contacts\", \"graph\"],\n visibleInManager: true,\n desktopTabEnabled: true,\n },\n ],\n};\n\nexport default relationshipsPlugin;\n"],"mappings":"AAEA,SAAS,oBAAoB;AAC7B,YAAY,cAAc;AAC1B,SAAS,2BAA2B;AAqB7B,MAAM,sBAA8B;AAAA,EACzC,MAAM;AAAA,EACN,aACE;AAAA,EACF,cAAc,CAAC,qBAAqB;AAAA,EACpC,SAAS,CAAC,YAAY;AAAA,EACtB,WAAW,CAAC,mBAAmB;AAAA,EAC/B,UAAU,CAAC;AAAA,EACX,QAAQ;AAAA,EACR,OAAO;AAAA,IACL;AAAA,MACE,IAAI;AAAA,MACJ,OAAO;AAAA,MACP,aACE;AAAA,MACF,MAAM;AAAA,MACN,MAAM;AAAA,MACN,YAAY,CAAC,OAAO,MAAM,KAAK;AAAA,MAC/B,YAAY;AAAA,MACZ,iBAAiB;AAAA,MACjB,MAAM,CAAC,iBAAiB,YAAY,UAAU,YAAY,OAAO;AAAA,MACjE,kBAAkB;AAAA,MAClB,mBAAmB;AAAA,IACrB;AAAA,EACF;AACF;AAEA,IAAO,iBAAQ;","names":[]}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * `ENTITY_GRAPH` provider.
3
+ *
4
+ * Injects a compact projection of the owner's runtime knowledge graph
5
+ * (recently-updated people/organizations and the `self` ego-network edges)
6
+ * into the planner each turn, so the planner can reason about who is being
7
+ * discussed without re-querying the graph from inside an action handler.
8
+ *
9
+ * Reads the runtime-owned graph via `@elizaos/agent`'s
10
+ * {@link KnowledgeGraphService} (`getEntityStore` / `getRelationshipStore`).
11
+ * It does NOT construct DB stores itself.
12
+ *
13
+ * Distinct from the runtime `rolodex` provider (which projects the legacy
14
+ * `relationships` graph-snapshot service at position 7); this provider
15
+ * projects the new knowledge-graph stores at position -4.
16
+ */
17
+ import type { Provider } from "@elizaos/core";
18
+ export declare const entityGraphProvider: Provider;
19
+ export default entityGraphProvider;
20
+ //# sourceMappingURL=entity-graph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entity-graph.d.ts","sourceRoot":"","sources":["../../src/providers/entity-graph.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,EAGV,QAAQ,EAGT,MAAM,eAAe,CAAC;AAsBvB,eAAO,MAAM,mBAAmB,EAAE,QAuFjC,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -0,0 +1,83 @@
1
+ import { resolveKnowledgeGraphService } from "@elizaos/agent";
2
+ import { logger } from "@elizaos/core";
3
+ import { SELF_ENTITY_ID } from "@elizaos/shared";
4
+ import { RELATIONSHIPS_CONTEXTS, RELATIONSHIPS_LOG_PREFIX } from "../types.js";
5
+ const MAX_ENTITIES = 8;
6
+ const MAX_EDGES = 8;
7
+ const entityGraphProvider = {
8
+ name: "ENTITY_GRAPH",
9
+ description: "Projection of the owner's known entities and ego-network edges from the runtime knowledge graph, for planner context.",
10
+ position: -4,
11
+ contexts: [...RELATIONSHIPS_CONTEXTS],
12
+ contextGate: { anyOf: [...RELATIONSHIPS_CONTEXTS] },
13
+ get: async (runtime, _message, _state) => {
14
+ const service = resolveKnowledgeGraphService(runtime);
15
+ if (!service) {
16
+ return { text: "", data: { entities: [], relationships: [] } };
17
+ }
18
+ try {
19
+ const entityStore = service.getEntityStore();
20
+ const relationshipStore = service.getRelationshipStore();
21
+ const [entities, edges] = await Promise.all([
22
+ entityStore.list({ limit: MAX_ENTITIES }),
23
+ relationshipStore.list({
24
+ fromEntityId: SELF_ENTITY_ID,
25
+ limit: MAX_EDGES
26
+ })
27
+ ]);
28
+ const entityProjections = entities.filter((entity) => entity.entityId !== SELF_ENTITY_ID).map((entity) => ({
29
+ entityId: entity.entityId,
30
+ type: entity.type,
31
+ preferredName: entity.preferredName,
32
+ platforms: Array.from(
33
+ new Set(entity.identities.map((identity) => identity.platform))
34
+ )
35
+ }));
36
+ const edgeProjections = edges.map((edge) => ({
37
+ fromEntityId: edge.fromEntityId,
38
+ toEntityId: edge.toEntityId,
39
+ type: edge.type
40
+ }));
41
+ if (entityProjections.length === 0 && edgeProjections.length === 0) {
42
+ return { text: "", data: { entities: [], relationships: [] } };
43
+ }
44
+ const nameById = new Map(
45
+ entities.map((entity) => [entity.entityId, entity.preferredName])
46
+ );
47
+ const lines = [];
48
+ if (entityProjections.length > 0) {
49
+ lines.push("Known entities:");
50
+ for (const entity of entityProjections) {
51
+ const platforms = entity.platforms.length > 0 ? ` [${entity.platforms.join(", ")}]` : "";
52
+ lines.push(`- ${entity.preferredName} (${entity.type})${platforms}`);
53
+ }
54
+ }
55
+ if (edgeProjections.length > 0) {
56
+ lines.push("Your relationships:");
57
+ for (const edge of edgeProjections) {
58
+ const toName = nameById.get(edge.toEntityId) ?? edge.toEntityId;
59
+ lines.push(`- you -[${edge.type}]-> ${toName}`);
60
+ }
61
+ }
62
+ return {
63
+ text: lines.join("\n"),
64
+ data: {
65
+ entities: entityProjections,
66
+ relationships: edgeProjections
67
+ }
68
+ };
69
+ } catch (error) {
70
+ logger.error(
71
+ `${RELATIONSHIPS_LOG_PREFIX} ENTITY_GRAPH projection failed:`,
72
+ error instanceof Error ? error.message : String(error)
73
+ );
74
+ return { text: "", data: { entities: [], relationships: [] } };
75
+ }
76
+ }
77
+ };
78
+ var entity_graph_default = entityGraphProvider;
79
+ export {
80
+ entity_graph_default as default,
81
+ entityGraphProvider
82
+ };
83
+ //# sourceMappingURL=entity-graph.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/providers/entity-graph.ts"],"sourcesContent":["/**\n * `ENTITY_GRAPH` provider.\n *\n * Injects a compact projection of the owner's runtime knowledge graph\n * (recently-updated people/organizations and the `self` ego-network edges)\n * into the planner each turn, so the planner can reason about who is being\n * discussed without re-querying the graph from inside an action handler.\n *\n * Reads the runtime-owned graph via `@elizaos/agent`'s\n * {@link KnowledgeGraphService} (`getEntityStore` / `getRelationshipStore`).\n * It does NOT construct DB stores itself.\n *\n * Distinct from the runtime `rolodex` provider (which projects the legacy\n * `relationships` graph-snapshot service at position 7); this provider\n * projects the new knowledge-graph stores at position -4.\n */\n\nimport { resolveKnowledgeGraphService } from \"@elizaos/agent\";\nimport type {\n IAgentRuntime,\n Memory,\n Provider,\n ProviderResult,\n State,\n} from \"@elizaos/core\";\nimport { logger } from \"@elizaos/core\";\nimport { SELF_ENTITY_ID } from \"@elizaos/shared\";\n\nimport { RELATIONSHIPS_CONTEXTS, RELATIONSHIPS_LOG_PREFIX } from \"../types.js\";\n\nconst MAX_ENTITIES = 8;\nconst MAX_EDGES = 8;\n\ninterface EntityProjection {\n entityId: string;\n type: string;\n preferredName: string;\n platforms: string[];\n}\n\ninterface EdgeProjection {\n fromEntityId: string;\n toEntityId: string;\n type: string;\n}\n\nexport const entityGraphProvider: Provider = {\n name: \"ENTITY_GRAPH\",\n description:\n \"Projection of the owner's known entities and ego-network edges from the runtime knowledge graph, for planner context.\",\n position: -4,\n contexts: [...RELATIONSHIPS_CONTEXTS],\n contextGate: { anyOf: [...RELATIONSHIPS_CONTEXTS] },\n get: async (\n runtime: IAgentRuntime,\n _message: Memory,\n _state?: State,\n ): Promise<ProviderResult> => {\n const service = resolveKnowledgeGraphService(runtime);\n if (!service) {\n return { text: \"\", data: { entities: [], relationships: [] } };\n }\n\n try {\n const entityStore = service.getEntityStore();\n const relationshipStore = service.getRelationshipStore();\n\n const [entities, edges] = await Promise.all([\n entityStore.list({ limit: MAX_ENTITIES }),\n relationshipStore.list({\n fromEntityId: SELF_ENTITY_ID,\n limit: MAX_EDGES,\n }),\n ]);\n\n const entityProjections: EntityProjection[] = entities\n .filter((entity) => entity.entityId !== SELF_ENTITY_ID)\n .map((entity) => ({\n entityId: entity.entityId,\n type: entity.type,\n preferredName: entity.preferredName,\n platforms: Array.from(\n new Set(entity.identities.map((identity) => identity.platform)),\n ),\n }));\n\n const edgeProjections: EdgeProjection[] = edges.map((edge) => ({\n fromEntityId: edge.fromEntityId,\n toEntityId: edge.toEntityId,\n type: edge.type,\n }));\n\n if (entityProjections.length === 0 && edgeProjections.length === 0) {\n return { text: \"\", data: { entities: [], relationships: [] } };\n }\n\n const nameById = new Map(\n entities.map((entity) => [entity.entityId, entity.preferredName]),\n );\n const lines: string[] = [];\n if (entityProjections.length > 0) {\n lines.push(\"Known entities:\");\n for (const entity of entityProjections) {\n const platforms =\n entity.platforms.length > 0\n ? ` [${entity.platforms.join(\", \")}]`\n : \"\";\n lines.push(`- ${entity.preferredName} (${entity.type})${platforms}`);\n }\n }\n if (edgeProjections.length > 0) {\n lines.push(\"Your relationships:\");\n for (const edge of edgeProjections) {\n const toName = nameById.get(edge.toEntityId) ?? edge.toEntityId;\n lines.push(`- you -[${edge.type}]-> ${toName}`);\n }\n }\n\n return {\n text: lines.join(\"\\n\"),\n data: {\n entities: entityProjections,\n relationships: edgeProjections,\n },\n };\n } catch (error) {\n logger.error(\n `${RELATIONSHIPS_LOG_PREFIX} ENTITY_GRAPH projection failed:`,\n error instanceof Error ? error.message : String(error),\n );\n return { text: \"\", data: { entities: [], relationships: [] } };\n }\n },\n};\n\nexport default entityGraphProvider;\n"],"mappings":"AAiBA,SAAS,oCAAoC;AAQ7C,SAAS,cAAc;AACvB,SAAS,sBAAsB;AAE/B,SAAS,wBAAwB,gCAAgC;AAEjE,MAAM,eAAe;AACrB,MAAM,YAAY;AAeX,MAAM,sBAAgC;AAAA,EAC3C,MAAM;AAAA,EACN,aACE;AAAA,EACF,UAAU;AAAA,EACV,UAAU,CAAC,GAAG,sBAAsB;AAAA,EACpC,aAAa,EAAE,OAAO,CAAC,GAAG,sBAAsB,EAAE;AAAA,EAClD,KAAK,OACH,SACA,UACA,WAC4B;AAC5B,UAAM,UAAU,6BAA6B,OAAO;AACpD,QAAI,CAAC,SAAS;AACZ,aAAO,EAAE,MAAM,IAAI,MAAM,EAAE,UAAU,CAAC,GAAG,eAAe,CAAC,EAAE,EAAE;AAAA,IAC/D;AAEA,QAAI;AACF,YAAM,cAAc,QAAQ,eAAe;AAC3C,YAAM,oBAAoB,QAAQ,qBAAqB;AAEvD,YAAM,CAAC,UAAU,KAAK,IAAI,MAAM,QAAQ,IAAI;AAAA,QAC1C,YAAY,KAAK,EAAE,OAAO,aAAa,CAAC;AAAA,QACxC,kBAAkB,KAAK;AAAA,UACrB,cAAc;AAAA,UACd,OAAO;AAAA,QACT,CAAC;AAAA,MACH,CAAC;AAED,YAAM,oBAAwC,SAC3C,OAAO,CAAC,WAAW,OAAO,aAAa,cAAc,EACrD,IAAI,CAAC,YAAY;AAAA,QAChB,UAAU,OAAO;AAAA,QACjB,MAAM,OAAO;AAAA,QACb,eAAe,OAAO;AAAA,QACtB,WAAW,MAAM;AAAA,UACf,IAAI,IAAI,OAAO,WAAW,IAAI,CAAC,aAAa,SAAS,QAAQ,CAAC;AAAA,QAChE;AAAA,MACF,EAAE;AAEJ,YAAM,kBAAoC,MAAM,IAAI,CAAC,UAAU;AAAA,QAC7D,cAAc,KAAK;AAAA,QACnB,YAAY,KAAK;AAAA,QACjB,MAAM,KAAK;AAAA,MACb,EAAE;AAEF,UAAI,kBAAkB,WAAW,KAAK,gBAAgB,WAAW,GAAG;AAClE,eAAO,EAAE,MAAM,IAAI,MAAM,EAAE,UAAU,CAAC,GAAG,eAAe,CAAC,EAAE,EAAE;AAAA,MAC/D;AAEA,YAAM,WAAW,IAAI;AAAA,QACnB,SAAS,IAAI,CAAC,WAAW,CAAC,OAAO,UAAU,OAAO,aAAa,CAAC;AAAA,MAClE;AACA,YAAM,QAAkB,CAAC;AACzB,UAAI,kBAAkB,SAAS,GAAG;AAChC,cAAM,KAAK,iBAAiB;AAC5B,mBAAW,UAAU,mBAAmB;AACtC,gBAAM,YACJ,OAAO,UAAU,SAAS,IACtB,KAAK,OAAO,UAAU,KAAK,IAAI,CAAC,MAChC;AACN,gBAAM,KAAK,KAAK,OAAO,aAAa,KAAK,OAAO,IAAI,IAAI,SAAS,EAAE;AAAA,QACrE;AAAA,MACF;AACA,UAAI,gBAAgB,SAAS,GAAG;AAC9B,cAAM,KAAK,qBAAqB;AAChC,mBAAW,QAAQ,iBAAiB;AAClC,gBAAM,SAAS,SAAS,IAAI,KAAK,UAAU,KAAK,KAAK;AACrD,gBAAM,KAAK,WAAW,KAAK,IAAI,OAAO,MAAM,EAAE;AAAA,QAChD;AAAA,MACF;AAEA,aAAO;AAAA,QACL,MAAM,MAAM,KAAK,IAAI;AAAA,QACrB,MAAM;AAAA,UACJ,UAAU;AAAA,UACV,eAAe;AAAA,QACjB;AAAA,MACF;AAAA,IACF,SAAS,OAAO;AACd,aAAO;AAAA,QACL,GAAG,wBAAwB;AAAA,QAC3B,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAAA,MACvD;AACA,aAAO,EAAE,MAAM,IAAI,MAAM,EAAE,UAAU,CAAC,GAAG,eAAe,CAAC,EAAE,EAAE;AAAA,IAC/D;AAAA,EACF;AACF;AAEA,IAAO,uBAAQ;","names":[]}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Register the relationships view for terminal rendering.
3
+ *
4
+ * The agent terminal mounts plugin views by id from the `@elizaos/tui` terminal
5
+ * registry. This makes the relationships `tui` modality render for real in the
6
+ * terminal (the unified {@link RelationshipsSpatialView}) rather than only
7
+ * navigating a GUI shell. A module-level snapshot lets a host push live graph
8
+ * data; absent a push it defaults to the loading state.
9
+ */
10
+ import { type RelationshipsSnapshot } from "./components/relationships/RelationshipsSpatialView.tsx";
11
+ /** Update the snapshot the registered terminal view renders from. */
12
+ export declare function setRelationshipsTerminalSnapshot(next: RelationshipsSnapshot): void;
13
+ /** Register the relationships terminal view; returns an unregister function. */
14
+ export declare function registerRelationshipsTerminalView(): () => void;
15
+ //# sourceMappingURL=register-terminal-view.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register-terminal-view.d.ts","sourceRoot":"","sources":["../src/register-terminal-view.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EAEL,KAAK,qBAAqB,EAE3B,MAAM,yDAAyD,CAAC;AAIjE,qEAAqE;AACrE,wBAAgB,gCAAgC,CAC9C,IAAI,EAAE,qBAAqB,GAC1B,IAAI,CAEN;AAED,gFAAgF;AAChF,wBAAgB,iCAAiC,IAAI,MAAM,IAAI,CAI9D"}
@@ -0,0 +1,21 @@
1
+ import { registerSpatialTerminalView } from "@elizaos/ui/spatial/tui";
2
+ import { createElement } from "react";
3
+ import {
4
+ EMPTY_RELATIONSHIPS,
5
+ RelationshipsSpatialView
6
+ } from "./components/relationships/RelationshipsSpatialView.js";
7
+ let current = EMPTY_RELATIONSHIPS;
8
+ function setRelationshipsTerminalSnapshot(next) {
9
+ current = next;
10
+ }
11
+ function registerRelationshipsTerminalView() {
12
+ return registerSpatialTerminalView(
13
+ "relationships",
14
+ () => createElement(RelationshipsSpatialView, { snapshot: current })
15
+ );
16
+ }
17
+ export {
18
+ registerRelationshipsTerminalView,
19
+ setRelationshipsTerminalSnapshot
20
+ };
21
+ //# sourceMappingURL=register-terminal-view.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/register-terminal-view.tsx"],"sourcesContent":["/**\n * Register the relationships view for terminal rendering.\n *\n * The agent terminal mounts plugin views by id from the `@elizaos/tui` terminal\n * registry. This makes the relationships `tui` modality render for real in the\n * terminal (the unified {@link RelationshipsSpatialView}) rather than only\n * navigating a GUI shell. A module-level snapshot lets a host push live graph\n * data; absent a push it defaults to the loading state.\n */\n\nimport { registerSpatialTerminalView } from \"@elizaos/ui/spatial/tui\";\nimport { createElement } from \"react\";\nimport {\n EMPTY_RELATIONSHIPS,\n type RelationshipsSnapshot,\n RelationshipsSpatialView,\n} from \"./components/relationships/RelationshipsSpatialView.js\";\n\nlet current: RelationshipsSnapshot = EMPTY_RELATIONSHIPS;\n\n/** Update the snapshot the registered terminal view renders from. */\nexport function setRelationshipsTerminalSnapshot(\n next: RelationshipsSnapshot,\n): void {\n current = next;\n}\n\n/** Register the relationships terminal view; returns an unregister function. */\nexport function registerRelationshipsTerminalView(): () => void {\n return registerSpatialTerminalView(\"relationships\", () =>\n createElement(RelationshipsSpatialView, { snapshot: current }),\n );\n}\n"],"mappings":"AAUA,SAAS,mCAAmC;AAC5C,SAAS,qBAAqB;AAC9B;AAAA,EACE;AAAA,EAEA;AAAA,OACK;AAEP,IAAI,UAAiC;AAG9B,SAAS,iCACd,MACM;AACN,YAAU;AACZ;AAGO,SAAS,oCAAgD;AAC9D,SAAO;AAAA,IAA4B;AAAA,IAAiB,MAClD,cAAc,0BAA0B,EAAE,UAAU,QAAQ,CAAC;AAAA,EAC/D;AACF;","names":[]}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Side-effect entry point — registers the Relationships view for terminal
3
+ * rendering.
4
+ *
5
+ * In a terminal host (the Node agent, no DOM), register the relationships view
6
+ * so it renders inline in the terminal. Lazy + DOM-guarded so the terminal
7
+ * engine stays out of browser/mobile bundles. Web, iOS, desktop, and Android
8
+ * leave this a no-op (a DOM is present), so the same import is safe everywhere.
9
+ */
10
+ //# sourceMappingURL=register.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../src/register.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}
@@ -0,0 +1,5 @@
1
+ if (typeof window === "undefined") {
2
+ void import("./register-terminal-view.js").then((m) => m.registerRelationshipsTerminalView()).catch(() => {
3
+ });
4
+ }
5
+ //# sourceMappingURL=register.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/register.ts"],"sourcesContent":["/**\n * Side-effect entry point — registers the Relationships view for terminal\n * rendering.\n *\n * In a terminal host (the Node agent, no DOM), register the relationships view\n * so it renders inline in the terminal. Lazy + DOM-guarded so the terminal\n * engine stays out of browser/mobile bundles. Web, iOS, desktop, and Android\n * leave this a no-op (a DOM is present), so the same import is safe everywhere.\n */\n\nif (typeof window === \"undefined\") {\n void import(\"./register-terminal-view.js\")\n .then((m) => m.registerRelationshipsTerminalView())\n .catch(() => {\n // Terminal rendering is best-effort; never block plugin load.\n });\n}\n"],"mappings":"AAUA,IAAI,OAAO,WAAW,aAAa;AACjC,OAAK,OAAO,6BAA6B,EACtC,KAAK,CAAC,MAAM,EAAE,kCAAkC,CAAC,EACjD,MAAM,MAAM;AAAA,EAEb,CAAC;AACL;","names":[]}
@@ -0,0 +1,134 @@
1
+ /**
2
+ * Public TS types for `@elizaos/plugin-relationships`.
3
+ *
4
+ * These mirror the canonical LifeOps shapes in
5
+ * `plugins/plugin-personal-assistant/src/lifeops/entities/types.ts` and
6
+ * `plugins/plugin-personal-assistant/src/lifeops/relationships/types.ts`. The richer
7
+ * lifeops shapes (identities array, attributes map, retired status, sentiment
8
+ * trend, type registries) will be ported here in a follow-up pass; for now we
9
+ * expose the minimal Entity / Relationship surface that matches the DB schema
10
+ * in `db/schema.ts`.
11
+ */
12
+ export declare const RELATIONSHIPS_LOG_PREFIX = "[Relationships]";
13
+ export declare const RELATIONSHIPS_SERVICE_TYPE = "relationships";
14
+ /**
15
+ * Action name for the relationships graph-CRUD umbrella.
16
+ *
17
+ * NOT `ENTITY`. `@elizaos/plugin-personal-assistant` already registers an
18
+ * `ENTITY` action: a rich orchestration over the legacy Rolodex contact model
19
+ * (`LifeOpsService.listRelationships/upsertRelationship/logInteraction`) with
20
+ * an LLM planner and voice-grounded replies. That action stays in PA. This
21
+ * action is the thin "extras" surface — direct CRUD over the runtime
22
+ * {@link KNOWLEDGE_GRAPH_SERVICE} graph that powers the relationships viewer —
23
+ * so it is registered under a distinct name to avoid a duplicate `ENTITY`
24
+ * registration when both plugins load together.
25
+ */
26
+ export declare const RELATIONSHIPS_ACTION_NAME = "KNOWLEDGE_GRAPH";
27
+ export declare const RELATIONSHIPS_CONTEXTS: readonly ["people", "contacts", "relationships"];
28
+ export type RelationshipsContext = (typeof RELATIONSHIPS_CONTEXTS)[number];
29
+ /**
30
+ * Built-in entity kinds. The store accepts any string, but these are what the
31
+ * runtime understands without registration. Mirrors
32
+ * `BUILT_IN_ENTITY_TYPES` in lifeops.
33
+ */
34
+ export declare const BUILT_IN_ENTITY_KINDS: readonly ["person", "organization", "place", "project", "concept"];
35
+ export type BuiltInEntityKind = (typeof BUILT_IN_ENTITY_KINDS)[number];
36
+ /**
37
+ * Identifier of the `self` Entity — the agent's owner. All ego-network edges
38
+ * originate from `self`. Bootstrapped on first store init.
39
+ */
40
+ export declare const SELF_ENTITY_ID = "self";
41
+ /**
42
+ * Canonical entity-kind / op tuple accepted by the `ENTITY` action.
43
+ *
44
+ * Mirrors the `Subaction` union in
45
+ * `plugins/plugin-personal-assistant/src/actions/entity.ts`.
46
+ */
47
+ export declare const ENTITY_OPS: readonly ["create", "read", "list", "log_interaction", "set_identity", "set_relationship", "merge"];
48
+ export type EntityOp = (typeof ENTITY_OPS)[number];
49
+ /**
50
+ * Minimal Entity shape. The full LifeOps `Entity` (see
51
+ * `lifeops/entities/types.ts`) carries `identities[]`, `attributes`, `state`,
52
+ * `tags`, and `visibility`. Those land in a follow-up port.
53
+ */
54
+ export interface Entity {
55
+ id: string;
56
+ kind: string;
57
+ displayName: string;
58
+ attrs: Record<string, unknown>;
59
+ createdAt: Date;
60
+ updatedAt: Date;
61
+ }
62
+ /**
63
+ * Minimal Relationship shape. The full LifeOps `Relationship` (see
64
+ * `lifeops/relationships/types.ts`) carries `type`, `metadata`, `state`,
65
+ * `evidence[]`, `confidence`, `source`, and `status` (active / retired).
66
+ */
67
+ export interface Relationship {
68
+ id: string;
69
+ fromEntityId: string;
70
+ toEntityId: string;
71
+ kind: string;
72
+ attrs: Record<string, unknown>;
73
+ lastObservedAt: Date | null;
74
+ }
75
+ /**
76
+ * Filter shape for listing entities. AND-combined.
77
+ */
78
+ export interface EntityFilter {
79
+ kind?: string;
80
+ nameContains?: string;
81
+ limit?: number;
82
+ }
83
+ /**
84
+ * Filter shape for listing relationships. AND-combined.
85
+ */
86
+ export interface RelationshipFilter {
87
+ fromEntityId?: string;
88
+ toEntityId?: string;
89
+ kind?: string | string[];
90
+ limit?: number;
91
+ }
92
+ /**
93
+ * The entity-kind filter set the view offers. Mirrors
94
+ * {@link BUILT_IN_ENTITY_KINDS} with an `all` sentinel for "no filter".
95
+ */
96
+ export declare const ENTITY_KIND_FILTERS: readonly ["person", "organization", "place", "project", "concept"];
97
+ export type EntityKindFilter = (typeof ENTITY_KIND_FILTERS)[number];
98
+ /** Human labels for the built-in entity kinds shown in the view. */
99
+ export declare const ENTITY_KIND_LABELS: Record<string, string>;
100
+ /**
101
+ * A single identity claim shown under an entity (platform + handle). Flattened
102
+ * from the wire `EntityIdentity`.
103
+ */
104
+ export interface EntityIdentityItem {
105
+ platform: string;
106
+ handle: string;
107
+ verified: boolean;
108
+ }
109
+ /**
110
+ * A typed edge shown under its source entity. Flattened from the wire
111
+ * `Relationship`: the edge's type label, the resolved target display name, and
112
+ * the optional cadence / last-contact metadata the view surfaces.
113
+ */
114
+ export interface RelationshipEdgeItem {
115
+ id: string;
116
+ type: string;
117
+ /** Display name of the target entity, or the raw id when unresolved. */
118
+ toName: string;
119
+ /** Cadence in days from `metadata.cadenceDays`, when present. */
120
+ cadenceDays: number | null;
121
+ /** ISO timestamp of the last interaction/observation on this edge. */
122
+ lastContact: string | null;
123
+ }
124
+ /**
125
+ * An entity node as the view renders it: identity + kind + its outbound edges.
126
+ */
127
+ export interface EntityNodeItem {
128
+ id: string;
129
+ kind: string;
130
+ name: string;
131
+ identities: EntityIdentityItem[];
132
+ edges: RelationshipEdgeItem[];
133
+ }
134
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,eAAO,MAAM,wBAAwB,oBAAoB,CAAC;AAC1D,eAAO,MAAM,0BAA0B,kBAAkB,CAAC;AAE1D;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,yBAAyB,oBAAoB,CAAC;AAE3D,eAAO,MAAM,sBAAsB,kDAIzB,CAAC;AACX,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE3E;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,oEAMxB,CAAC;AACX,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvE;;;GAGG;AACH,eAAO,MAAM,cAAc,SAAS,CAAC;AAErC;;;;;GAKG;AACH,eAAO,MAAM,UAAU,qGAQb,CAAC;AACX,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnD;;;;GAIG;AACH,MAAM,WAAW,MAAM;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;CACjB;AAED;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,cAAc,EAAE,IAAI,GAAG,IAAI,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAYD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,oEAMtB,CAAC;AACX,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpE,oEAAoE;AACpE,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAMrD,CAAC;AAEF;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,wEAAwE;IACxE,MAAM,EAAE,MAAM,CAAC;IACf,iEAAiE;IACjE,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,sEAAsE;IACtE,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,kBAAkB,EAAE,CAAC;IACjC,KAAK,EAAE,oBAAoB,EAAE,CAAC;CAC/B"}
package/dist/types.js ADDED
@@ -0,0 +1,51 @@
1
+ const RELATIONSHIPS_LOG_PREFIX = "[Relationships]";
2
+ const RELATIONSHIPS_SERVICE_TYPE = "relationships";
3
+ const RELATIONSHIPS_ACTION_NAME = "KNOWLEDGE_GRAPH";
4
+ const RELATIONSHIPS_CONTEXTS = [
5
+ "people",
6
+ "contacts",
7
+ "relationships"
8
+ ];
9
+ const BUILT_IN_ENTITY_KINDS = [
10
+ "person",
11
+ "organization",
12
+ "place",
13
+ "project",
14
+ "concept"
15
+ ];
16
+ const SELF_ENTITY_ID = "self";
17
+ const ENTITY_OPS = [
18
+ "create",
19
+ "read",
20
+ "list",
21
+ "log_interaction",
22
+ "set_identity",
23
+ "set_relationship",
24
+ "merge"
25
+ ];
26
+ const ENTITY_KIND_FILTERS = [
27
+ "person",
28
+ "organization",
29
+ "place",
30
+ "project",
31
+ "concept"
32
+ ];
33
+ const ENTITY_KIND_LABELS = {
34
+ person: "People",
35
+ organization: "Organizations",
36
+ place: "Places",
37
+ project: "Projects",
38
+ concept: "Concepts"
39
+ };
40
+ export {
41
+ BUILT_IN_ENTITY_KINDS,
42
+ ENTITY_KIND_FILTERS,
43
+ ENTITY_KIND_LABELS,
44
+ ENTITY_OPS,
45
+ RELATIONSHIPS_ACTION_NAME,
46
+ RELATIONSHIPS_CONTEXTS,
47
+ RELATIONSHIPS_LOG_PREFIX,
48
+ RELATIONSHIPS_SERVICE_TYPE,
49
+ SELF_ENTITY_ID
50
+ };
51
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/types.ts"],"sourcesContent":["/**\n * Public TS types for `@elizaos/plugin-relationships`.\n *\n * These mirror the canonical LifeOps shapes in\n * `plugins/plugin-personal-assistant/src/lifeops/entities/types.ts` and\n * `plugins/plugin-personal-assistant/src/lifeops/relationships/types.ts`. The richer\n * lifeops shapes (identities array, attributes map, retired status, sentiment\n * trend, type registries) will be ported here in a follow-up pass; for now we\n * expose the minimal Entity / Relationship surface that matches the DB schema\n * in `db/schema.ts`.\n */\n\nexport const RELATIONSHIPS_LOG_PREFIX = \"[Relationships]\";\nexport const RELATIONSHIPS_SERVICE_TYPE = \"relationships\";\n\n/**\n * Action name for the relationships graph-CRUD umbrella.\n *\n * NOT `ENTITY`. `@elizaos/plugin-personal-assistant` already registers an\n * `ENTITY` action: a rich orchestration over the legacy Rolodex contact model\n * (`LifeOpsService.listRelationships/upsertRelationship/logInteraction`) with\n * an LLM planner and voice-grounded replies. That action stays in PA. This\n * action is the thin \"extras\" surface — direct CRUD over the runtime\n * {@link KNOWLEDGE_GRAPH_SERVICE} graph that powers the relationships viewer —\n * so it is registered under a distinct name to avoid a duplicate `ENTITY`\n * registration when both plugins load together.\n */\nexport const RELATIONSHIPS_ACTION_NAME = \"KNOWLEDGE_GRAPH\";\n\nexport const RELATIONSHIPS_CONTEXTS = [\n \"people\",\n \"contacts\",\n \"relationships\",\n] as const;\nexport type RelationshipsContext = (typeof RELATIONSHIPS_CONTEXTS)[number];\n\n/**\n * Built-in entity kinds. The store accepts any string, but these are what the\n * runtime understands without registration. Mirrors\n * `BUILT_IN_ENTITY_TYPES` in lifeops.\n */\nexport const BUILT_IN_ENTITY_KINDS = [\n \"person\",\n \"organization\",\n \"place\",\n \"project\",\n \"concept\",\n] as const;\nexport type BuiltInEntityKind = (typeof BUILT_IN_ENTITY_KINDS)[number];\n\n/**\n * Identifier of the `self` Entity — the agent's owner. All ego-network edges\n * originate from `self`. Bootstrapped on first store init.\n */\nexport const SELF_ENTITY_ID = \"self\";\n\n/**\n * Canonical entity-kind / op tuple accepted by the `ENTITY` action.\n *\n * Mirrors the `Subaction` union in\n * `plugins/plugin-personal-assistant/src/actions/entity.ts`.\n */\nexport const ENTITY_OPS = [\n \"create\",\n \"read\",\n \"list\",\n \"log_interaction\",\n \"set_identity\",\n \"set_relationship\",\n \"merge\",\n] as const;\nexport type EntityOp = (typeof ENTITY_OPS)[number];\n\n/**\n * Minimal Entity shape. The full LifeOps `Entity` (see\n * `lifeops/entities/types.ts`) carries `identities[]`, `attributes`, `state`,\n * `tags`, and `visibility`. Those land in a follow-up port.\n */\nexport interface Entity {\n id: string;\n kind: string;\n displayName: string;\n attrs: Record<string, unknown>;\n createdAt: Date;\n updatedAt: Date;\n}\n\n/**\n * Minimal Relationship shape. The full LifeOps `Relationship` (see\n * `lifeops/relationships/types.ts`) carries `type`, `metadata`, `state`,\n * `evidence[]`, `confidence`, `source`, and `status` (active / retired).\n */\nexport interface Relationship {\n id: string;\n fromEntityId: string;\n toEntityId: string;\n kind: string;\n attrs: Record<string, unknown>;\n lastObservedAt: Date | null;\n}\n\n/**\n * Filter shape for listing entities. AND-combined.\n */\nexport interface EntityFilter {\n kind?: string;\n nameContains?: string;\n limit?: number;\n}\n\n/**\n * Filter shape for listing relationships. AND-combined.\n */\nexport interface RelationshipFilter {\n fromEntityId?: string;\n toEntityId?: string;\n kind?: string | string[];\n limit?: number;\n}\n\n// ---------------------------------------------------------------------------\n// Display DTOs for the RelationshipsView.\n//\n// These are the flattened, display-only shapes the view renders after mapping\n// the wire payloads served by the PA REST routes (GET /api/lifeops/entities and\n// GET /api/lifeops/relationships). They live here — NOT imported from\n// @elizaos/plugin-personal-assistant — so the view's contract stays\n// self-contained and aligned by shape.\n// ---------------------------------------------------------------------------\n\n/**\n * The entity-kind filter set the view offers. Mirrors\n * {@link BUILT_IN_ENTITY_KINDS} with an `all` sentinel for \"no filter\".\n */\nexport const ENTITY_KIND_FILTERS = [\n \"person\",\n \"organization\",\n \"place\",\n \"project\",\n \"concept\",\n] as const;\nexport type EntityKindFilter = (typeof ENTITY_KIND_FILTERS)[number];\n\n/** Human labels for the built-in entity kinds shown in the view. */\nexport const ENTITY_KIND_LABELS: Record<string, string> = {\n person: \"People\",\n organization: \"Organizations\",\n place: \"Places\",\n project: \"Projects\",\n concept: \"Concepts\",\n};\n\n/**\n * A single identity claim shown under an entity (platform + handle). Flattened\n * from the wire `EntityIdentity`.\n */\nexport interface EntityIdentityItem {\n platform: string;\n handle: string;\n verified: boolean;\n}\n\n/**\n * A typed edge shown under its source entity. Flattened from the wire\n * `Relationship`: the edge's type label, the resolved target display name, and\n * the optional cadence / last-contact metadata the view surfaces.\n */\nexport interface RelationshipEdgeItem {\n id: string;\n type: string;\n /** Display name of the target entity, or the raw id when unresolved. */\n toName: string;\n /** Cadence in days from `metadata.cadenceDays`, when present. */\n cadenceDays: number | null;\n /** ISO timestamp of the last interaction/observation on this edge. */\n lastContact: string | null;\n}\n\n/**\n * An entity node as the view renders it: identity + kind + its outbound edges.\n */\nexport interface EntityNodeItem {\n id: string;\n kind: string;\n name: string;\n identities: EntityIdentityItem[];\n edges: RelationshipEdgeItem[];\n}\n"],"mappings":"AAYO,MAAM,2BAA2B;AACjC,MAAM,6BAA6B;AAcnC,MAAM,4BAA4B;AAElC,MAAM,yBAAyB;AAAA,EACpC;AAAA,EACA;AAAA,EACA;AACF;AAQO,MAAM,wBAAwB;AAAA,EACnC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAOO,MAAM,iBAAiB;AAQvB,MAAM,aAAa;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAgEO,MAAM,sBAAsB;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAIO,MAAM,qBAA6C;AAAA,EACxD,QAAQ;AAAA,EACR,cAAc;AAAA,EACd,OAAO;AAAA,EACP,SAAS;AAAA,EACT,SAAS;AACX;","names":[]}