@elizaos/plugin-relationships 2.0.3-beta.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.
- package/LICENSE +21 -0
- package/README.md +96 -0
- package/assets/hero.svg +75 -0
- package/package.json +112 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Shaw Walters and elizaOS Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# @elizaos/plugin-relationships
|
|
2
|
+
|
|
3
|
+
Entity and relationship knowledge graph for Eliza agents.
|
|
4
|
+
|
|
5
|
+
Provides the `ENTITY` umbrella action (person / organization / place / project /
|
|
6
|
+
concept CRUD with identity claims, typed relationships, and merge), an
|
|
7
|
+
`ENTITY_GRAPH` context provider for the planner, and a drizzle
|
|
8
|
+
`pgSchema('app_relationships')` with `entities` and `relationships` tables.
|
|
9
|
+
|
|
10
|
+
## Status
|
|
11
|
+
|
|
12
|
+
**Scaffolded — decomposition in progress.** Action and provider handlers are
|
|
13
|
+
stubs that return a TODO marker. The real EntityStore, identity merge engine,
|
|
14
|
+
voice-observer-bridge, and RelationshipStore still live in
|
|
15
|
+
`@elizaos/plugin-personal-assistant`; they will move here in a follow-up pass.
|
|
16
|
+
|
|
17
|
+
## Migration mapping from `@elizaos/plugin-personal-assistant`
|
|
18
|
+
|
|
19
|
+
| Source under `plugins/plugin-personal-assistant/src/` | Will move to |
|
|
20
|
+
|---|---|
|
|
21
|
+
| `actions/entity.ts` (`ENTITY` action) | `plugins/plugin-relationships/src/actions/entity.ts` |
|
|
22
|
+
| `lifeops/entities/store.ts` (`EntityStore`) | `plugins/plugin-relationships/src/services/entity-store.ts` |
|
|
23
|
+
| `lifeops/entities/merge.ts` (identity merge engine) | `plugins/plugin-relationships/src/services/merge.ts` |
|
|
24
|
+
| `lifeops/entities/voice-observer-bridge.ts` | `plugins/plugin-relationships/src/services/voice-observer-bridge.ts` |
|
|
25
|
+
| `lifeops/entities/voice-observer.ts` | `plugins/plugin-relationships/src/services/voice-observer.ts` |
|
|
26
|
+
| `lifeops/entities/voice-attribution.ts` | `plugins/plugin-relationships/src/services/voice-attribution.ts` |
|
|
27
|
+
| `lifeops/entities/types.ts` (Entity, registries) | folded into `plugins/plugin-relationships/src/types.ts` |
|
|
28
|
+
| `lifeops/relationships/store.ts` (`RelationshipStore`) | `plugins/plugin-relationships/src/services/relationship-store.ts` |
|
|
29
|
+
| `lifeops/relationships/extraction.ts` | `plugins/plugin-relationships/src/services/relationship-extraction.ts` |
|
|
30
|
+
| `lifeops/relationships/types.ts` (Relationship, registries) | folded into `plugins/plugin-relationships/src/types.ts` |
|
|
31
|
+
| LifeOps `lifeops` provider — entity / relationship sections | `plugins/plugin-relationships/src/providers/entity-graph.ts` |
|
|
32
|
+
|
|
33
|
+
DB rows currently live in the LifeOps schema (`app_lifeops.life_entities`,
|
|
34
|
+
`life_entity_identities`, `life_entity_attributes`, `life_relationships`). The
|
|
35
|
+
new plugin owns the dedicated `app_relationships` schema with two minimal
|
|
36
|
+
tables; the rich identity + attribute + edge-state shapes from lifeops will
|
|
37
|
+
land in a follow-up migration.
|
|
38
|
+
|
|
39
|
+
## Plugin surface
|
|
40
|
+
|
|
41
|
+
**Action**
|
|
42
|
+
- `ENTITY` (`src/actions/entity.ts`) — umbrella op dispatch. Accepted ops:
|
|
43
|
+
`create`, `read`, `list`, `log_interaction`, `set_identity`,
|
|
44
|
+
`set_relationship`, `merge`. Contexts: `people`, `contacts`,
|
|
45
|
+
`relationships`. STUB returns a TODO marker.
|
|
46
|
+
|
|
47
|
+
**Provider**
|
|
48
|
+
- `ENTITY_GRAPH` (`src/providers/entity-graph.ts`) — injects a projection of
|
|
49
|
+
the owner's known entities and ego-network edges into the planner. STUB
|
|
50
|
+
returns an empty projection.
|
|
51
|
+
|
|
52
|
+
**Schema**
|
|
53
|
+
- `relationshipsSchema` / `entitiesTable` / `relationshipsTable`
|
|
54
|
+
(`src/db/schema.ts`) — `pgSchema("app_relationships")`. Registered via the
|
|
55
|
+
plugin object's `schema` field so the elizaOS runtime handles migrations.
|
|
56
|
+
|
|
57
|
+
## Layout
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
src/
|
|
61
|
+
index.ts Public exports + default Plugin export
|
|
62
|
+
plugin.ts Plugin object (action + provider + schema)
|
|
63
|
+
types.ts Entity / Relationship interfaces + constants
|
|
64
|
+
actions/
|
|
65
|
+
entity.ts ENTITY umbrella action (STUB)
|
|
66
|
+
providers/
|
|
67
|
+
entity-graph.ts ENTITY_GRAPH provider (STUB)
|
|
68
|
+
db/
|
|
69
|
+
schema.ts drizzle pgSchema + entities + relationships tables
|
|
70
|
+
index.ts re-export schema
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Commands
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
bun run --cwd plugins/plugin-relationships build # bun build → dist/ + tsc types
|
|
77
|
+
bun run --cwd plugins/plugin-relationships dev # hot-rebuild via build.ts
|
|
78
|
+
bun run --cwd plugins/plugin-relationships test # vitest run
|
|
79
|
+
bun run --cwd plugins/plugin-relationships typecheck # tsgo --noEmit
|
|
80
|
+
bun run --cwd plugins/plugin-relationships check # typecheck + test
|
|
81
|
+
bun run --cwd plugins/plugin-relationships clean # rm -rf dist .turbo
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Conventions / gotchas
|
|
85
|
+
|
|
86
|
+
- **`@elizaos/plugin-sql` must be loaded first.** The plugin declares this in
|
|
87
|
+
`dependencies: ["@elizaos/plugin-sql"]`; the runtime registers DB migrations
|
|
88
|
+
for `app_relationships` automatically.
|
|
89
|
+
- **`SELF_ENTITY_ID = "self"`** is the canonical id of the owner. All
|
|
90
|
+
ego-network edges originate from `self`.
|
|
91
|
+
- **`relationshipType` is open-string.** The lifeops `RelationshipTypeRegistry`
|
|
92
|
+
carries the built-in set (`follows`, `colleague_of`, `partner_of`, `manages`,
|
|
93
|
+
…) and will be ported alongside the store.
|
|
94
|
+
- **Stubs only.** Do not rely on `ENTITY` or `ENTITY_GRAPH` returning real
|
|
95
|
+
data yet — both intentionally return a TODO / empty result while the port
|
|
96
|
+
is in progress.
|
package/assets/hero.svg
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" width="1024" height="1024" role="img" aria-label="Relationships">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="bg-relationships" x1="0" y1="0" x2="1" y2="1">
|
|
4
|
+
<stop offset="0" stop-color="#241528"/>
|
|
5
|
+
<stop offset="1" stop-color="#190b19"/>
|
|
6
|
+
</linearGradient>
|
|
7
|
+
<radialGradient id="blobA-relationships" cx="0.5" cy="0.5" r="0.5">
|
|
8
|
+
<stop offset="0" stop-color="#b22fda" stop-opacity="0.55"/>
|
|
9
|
+
<stop offset="1" stop-color="#b22fda" stop-opacity="0"/>
|
|
10
|
+
</radialGradient>
|
|
11
|
+
<radialGradient id="blobB-relationships" cx="0.5" cy="0.5" r="0.5">
|
|
12
|
+
<stop offset="0" stop-color="#c3289f" stop-opacity="0.5"/>
|
|
13
|
+
<stop offset="1" stop-color="#c3289f" stop-opacity="0"/>
|
|
14
|
+
</radialGradient>
|
|
15
|
+
<radialGradient id="vig-relationships" cx="0.5" cy="0.42" r="0.75">
|
|
16
|
+
<stop offset="0" stop-color="#000000" stop-opacity="0"/>
|
|
17
|
+
<stop offset="0.72" stop-color="#000000" stop-opacity="0"/>
|
|
18
|
+
<stop offset="1" stop-color="#000000" stop-opacity="0.5"/>
|
|
19
|
+
</radialGradient>
|
|
20
|
+
<linearGradient id="label-relationships" x1="0" y1="0" x2="0" y2="1">
|
|
21
|
+
<stop offset="0" stop-color="#000000" stop-opacity="0"/>
|
|
22
|
+
<stop offset="1" stop-color="#000000" stop-opacity="0.55"/>
|
|
23
|
+
</linearGradient>
|
|
24
|
+
<filter id="soft-relationships" x="-30%" y="-30%" width="160%" height="160%">
|
|
25
|
+
<feGaussianBlur stdDeviation="46"/>
|
|
26
|
+
</filter>
|
|
27
|
+
<filter id="iglow-relationships" x="-40%" y="-40%" width="180%" height="180%">
|
|
28
|
+
<feDropShadow dx="0" dy="0" stdDeviation="14" flood-color="#c645ed" flood-opacity="0.45"/>
|
|
29
|
+
</filter>
|
|
30
|
+
</defs>
|
|
31
|
+
|
|
32
|
+
<rect width="1024" height="1024" fill="url(#bg-relationships)"/>
|
|
33
|
+
|
|
34
|
+
<g opacity="0.9">
|
|
35
|
+
<circle cx="232" cy="220" r="300" fill="url(#blobA-relationships)" filter="url(#soft-relationships)"/>
|
|
36
|
+
<circle cx="840" cy="800" r="340" fill="url(#blobB-relationships)" filter="url(#soft-relationships)"/>
|
|
37
|
+
</g>
|
|
38
|
+
|
|
39
|
+
<g stroke="#e5d7ea" stroke-width="1.4" opacity="0.06">
|
|
40
|
+
<line x1="0" y1="256" x2="1024" y2="256"/>
|
|
41
|
+
<line x1="0" y1="512" x2="1024" y2="512"/>
|
|
42
|
+
<line x1="0" y1="768" x2="1024" y2="768"/>
|
|
43
|
+
<line x1="256" y1="0" x2="256" y2="1024"/>
|
|
44
|
+
<line x1="512" y1="0" x2="512" y2="1024"/>
|
|
45
|
+
<line x1="768" y1="0" x2="768" y2="1024"/>
|
|
46
|
+
</g>
|
|
47
|
+
|
|
48
|
+
<g opacity="0.5">
|
|
49
|
+
<path d="M120 470 A 400 400 0 0 1 904 470" fill="none" stroke="#c645ed" stroke-width="3" opacity="0.35"/>
|
|
50
|
+
</g>
|
|
51
|
+
|
|
52
|
+
<g transform="translate(512 432)" filter="url(#iglow-relationships)"
|
|
53
|
+
color="#e5d7ea" stroke="#e5d7ea" stroke-width="20"
|
|
54
|
+
stroke-linecap="round" stroke-linejoin="round" fill="none">
|
|
55
|
+
<line x1="-110" y1="-96" x2="0" y2="0"/>
|
|
56
|
+
<line x1="120" y1="-110" x2="0" y2="0"/>
|
|
57
|
+
<line x1="-130" y1="86" x2="0" y2="0"/>
|
|
58
|
+
<line x1="110" y1="104" x2="0" y2="0"/>
|
|
59
|
+
<circle cx="0" cy="0" r="30" fill="currentColor" stroke-width="0"/>
|
|
60
|
+
<circle cx="0" cy="0" r="30"/>
|
|
61
|
+
<circle cx="-110" cy="-96" r="22"/>
|
|
62
|
+
<circle cx="120" cy="-110" r="22"/>
|
|
63
|
+
<circle cx="-130" cy="86" r="22"/>
|
|
64
|
+
<circle cx="110" cy="104" r="22"/>
|
|
65
|
+
</g>
|
|
66
|
+
|
|
67
|
+
<rect x="0" y="784" width="1024" height="240" fill="url(#label-relationships)"/>
|
|
68
|
+
<text x="512" y="892" text-anchor="middle"
|
|
69
|
+
font-family="system-ui, -apple-system, Segoe UI, Roboto, sans-serif"
|
|
70
|
+
font-size="76" font-weight="600" letter-spacing="0.5"
|
|
71
|
+
fill="#e5d7ea">Relationships</text>
|
|
72
|
+
<rect x="460" y="924" width="104" height="6" rx="3" fill="#c645ed"/>
|
|
73
|
+
|
|
74
|
+
<rect width="1024" height="1024" fill="url(#vig-relationships)"/>
|
|
75
|
+
</svg>
|
package/package.json
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@elizaos/plugin-relationships",
|
|
3
|
+
"version": "2.0.3-beta.2",
|
|
4
|
+
"description": "Entity and relationship knowledge graph for Eliza agents. Provides the ENTITY umbrella action (person/org/place/project/concept CRUD), EntityStore with identity merge engine, RelationshipStore for typed edges, voice-observer-bridge, and an entity-graph context provider. Backed by drizzle pgSchema('app_relationships').",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"module": "dist/index.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"sideEffects": false,
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/elizaos/eliza.git"
|
|
13
|
+
},
|
|
14
|
+
"exports": {
|
|
15
|
+
"./package.json": "./package.json",
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"eliza-source": {
|
|
19
|
+
"types": "./src/index.ts",
|
|
20
|
+
"import": "./src/index.ts",
|
|
21
|
+
"default": "./src/index.ts"
|
|
22
|
+
},
|
|
23
|
+
"import": "./dist/index.js",
|
|
24
|
+
"default": "./dist/index.js"
|
|
25
|
+
},
|
|
26
|
+
"./*.css": "./dist/*.css",
|
|
27
|
+
"./*": {
|
|
28
|
+
"types": "./dist/*.d.ts",
|
|
29
|
+
"eliza-source": {
|
|
30
|
+
"types": "./src/*.ts",
|
|
31
|
+
"import": "./src/*.ts",
|
|
32
|
+
"default": "./src/*.ts"
|
|
33
|
+
},
|
|
34
|
+
"import": "./dist/*.js",
|
|
35
|
+
"default": "./dist/*.js"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"files": [
|
|
39
|
+
"assets",
|
|
40
|
+
"dist"
|
|
41
|
+
],
|
|
42
|
+
"keywords": [
|
|
43
|
+
"eliza",
|
|
44
|
+
"plugin",
|
|
45
|
+
"relationships",
|
|
46
|
+
"entities",
|
|
47
|
+
"knowledge-graph",
|
|
48
|
+
"agent"
|
|
49
|
+
],
|
|
50
|
+
"author": "elizaOS",
|
|
51
|
+
"license": "MIT",
|
|
52
|
+
"dependencies": {
|
|
53
|
+
"@elizaos/agent": "2.0.3-beta.2",
|
|
54
|
+
"@elizaos/app-core": "2.0.3-beta.2",
|
|
55
|
+
"@elizaos/core": "2.0.3-beta.2",
|
|
56
|
+
"@elizaos/shared": "2.0.3-beta.2",
|
|
57
|
+
"@elizaos/ui": "2.0.3-beta.2",
|
|
58
|
+
"drizzle-orm": "^0.45.1"
|
|
59
|
+
},
|
|
60
|
+
"peerDependencies": {
|
|
61
|
+
"@elizaos/plugin-sql": "2.0.3-beta.2",
|
|
62
|
+
"react": "^19.0.0",
|
|
63
|
+
"react-dom": "^19.0.0"
|
|
64
|
+
},
|
|
65
|
+
"devDependencies": {
|
|
66
|
+
"@biomejs/biome": "^2.4.14",
|
|
67
|
+
"@types/node": "^25.0.3",
|
|
68
|
+
"@types/react": "^19.0.0",
|
|
69
|
+
"@types/react-dom": "^19.0.0",
|
|
70
|
+
"react": "^19.0.0",
|
|
71
|
+
"react-dom": "^19.0.0",
|
|
72
|
+
"tsup": "^8.5.1",
|
|
73
|
+
"typescript": "^6.0.3",
|
|
74
|
+
"vite": "^8.0.0",
|
|
75
|
+
"vitest": "^4.0.0"
|
|
76
|
+
},
|
|
77
|
+
"scripts": {
|
|
78
|
+
"build": "bun run build:js && bun run build:views && bun run build:types",
|
|
79
|
+
"build:js": "tsup --config ../tsup.plugin-packages.shared.ts",
|
|
80
|
+
"build:views": "bunx --bun vite build --config vite.config.views.ts",
|
|
81
|
+
"build:types": "tsc --noCheck -p tsconfig.build.json",
|
|
82
|
+
"clean": "rm -rf dist .turbo",
|
|
83
|
+
"test": "bunx vitest run --config ./vitest.config.ts",
|
|
84
|
+
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
85
|
+
"lint": "bunx @biomejs/biome check src/",
|
|
86
|
+
"lint:check": "bun run lint",
|
|
87
|
+
"check": "bun run typecheck && bun run test"
|
|
88
|
+
},
|
|
89
|
+
"publishConfig": {
|
|
90
|
+
"access": "public"
|
|
91
|
+
},
|
|
92
|
+
"elizaos": {
|
|
93
|
+
"app": {
|
|
94
|
+
"displayName": "Relationships",
|
|
95
|
+
"category": "personal"
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
"agentConfig": {
|
|
99
|
+
"pluginType": "elizaos:plugin:1.0.0",
|
|
100
|
+
"pluginParameters": {}
|
|
101
|
+
},
|
|
102
|
+
"eliza": {
|
|
103
|
+
"platforms": [
|
|
104
|
+
"node"
|
|
105
|
+
],
|
|
106
|
+
"runtime": "node",
|
|
107
|
+
"platformDetails": {
|
|
108
|
+
"node": "Default export (Node.js)"
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
"gitHead": "82fe0f44215954c2417328203f5bd6510985c1fc"
|
|
112
|
+
}
|