@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.
- package/dist/actions/entity.d.ts +72 -0
- package/dist/actions/entity.d.ts.map +1 -0
- package/dist/actions/entity.js +312 -0
- package/dist/actions/entity.js.map +1 -0
- package/dist/components/relationships/RelationshipsSpatialView.d.ts +72 -0
- package/dist/components/relationships/RelationshipsSpatialView.d.ts.map +1 -0
- package/dist/components/relationships/RelationshipsSpatialView.js +120 -0
- package/dist/components/relationships/RelationshipsSpatialView.js.map +1 -0
- package/dist/components/relationships/RelationshipsView.d.ts +70 -0
- package/dist/components/relationships/RelationshipsView.d.ts.map +1 -0
- package/dist/components/relationships/RelationshipsView.js +193 -0
- package/dist/components/relationships/RelationshipsView.js.map +1 -0
- package/dist/components/relationships/relationships-view-bundle.d.ts +2 -0
- package/dist/components/relationships/relationships-view-bundle.d.ts.map +1 -0
- package/dist/components/relationships/relationships-view-bundle.js +5 -0
- package/dist/components/relationships/relationships-view-bundle.js.map +1 -0
- package/dist/db/index.d.ts +2 -0
- package/dist/db/index.d.ts.map +1 -0
- package/dist/db/index.js +2 -0
- package/dist/db/index.js.map +1 -0
- package/dist/db/schema.d.ts +240 -0
- package/dist/db/schema.d.ts.map +1 -0
- package/dist/db/schema.js +49 -0
- package/dist/db/schema.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +36 -0
- package/dist/index.js.map +1 -0
- package/dist/plugin.d.ts +23 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +33 -0
- package/dist/plugin.js.map +1 -0
- package/dist/providers/entity-graph.d.ts +20 -0
- package/dist/providers/entity-graph.d.ts.map +1 -0
- package/dist/providers/entity-graph.js +83 -0
- package/dist/providers/entity-graph.js.map +1 -0
- package/dist/register-terminal-view.d.ts +15 -0
- package/dist/register-terminal-view.d.ts.map +1 -0
- package/dist/register-terminal-view.js +21 -0
- package/dist/register-terminal-view.js.map +1 -0
- package/dist/register.d.ts +10 -0
- package/dist/register.d.ts.map +1 -0
- package/dist/register.js +5 -0
- package/dist/register.js.map +1 -0
- package/dist/types.d.ts +134 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +51 -0
- package/dist/types.js.map +1 -0
- package/dist/views/bundle.js +328 -0
- package/dist/views/bundle.js.map +1 -0
- package/package.json +8 -8
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
import { client as e } from "@elizaos/ui";
|
|
2
|
+
import { Button as t, Card as n, HStack as r, List as i, SpatialSurface as a, Text as o, VStack as s, useSpatialState as c } from "@elizaos/ui/spatial";
|
|
3
|
+
import { useCallback as l, useEffect as u, useMemo as d, useRef as f, useState as p } from "react";
|
|
4
|
+
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
5
|
+
//#region src/types.ts
|
|
6
|
+
var _ = [
|
|
7
|
+
"person",
|
|
8
|
+
"organization",
|
|
9
|
+
"place",
|
|
10
|
+
"project",
|
|
11
|
+
"concept"
|
|
12
|
+
], v = {
|
|
13
|
+
person: "People",
|
|
14
|
+
organization: "Organizations",
|
|
15
|
+
place: "Places",
|
|
16
|
+
project: "Projects",
|
|
17
|
+
concept: "Concepts"
|
|
18
|
+
}, y = {
|
|
19
|
+
state: "loading",
|
|
20
|
+
nodes: [],
|
|
21
|
+
filters: []
|
|
22
|
+
};
|
|
23
|
+
function b({ snapshot: e, onAction: t }) {
|
|
24
|
+
let r = (e) => () => t?.(e);
|
|
25
|
+
return /* @__PURE__ */ h(n, {
|
|
26
|
+
gap: 1,
|
|
27
|
+
padding: 1,
|
|
28
|
+
children: e.state === "loading" ? /* @__PURE__ */ h(o, {
|
|
29
|
+
tone: "muted",
|
|
30
|
+
align: "center",
|
|
31
|
+
style: "caption",
|
|
32
|
+
children: "Loading relationships"
|
|
33
|
+
}) : e.state === "error" ? /* @__PURE__ */ h(x, {
|
|
34
|
+
snapshot: e,
|
|
35
|
+
dispatch: r
|
|
36
|
+
}) : e.state === "empty" ? /* @__PURE__ */ h(S, { dispatch: r }) : /* @__PURE__ */ h(C, {
|
|
37
|
+
snapshot: e,
|
|
38
|
+
onAction: t
|
|
39
|
+
})
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
function x({ snapshot: e, dispatch: n }) {
|
|
43
|
+
return /* @__PURE__ */ g(m, { children: [
|
|
44
|
+
/* @__PURE__ */ h(o, {
|
|
45
|
+
bold: !0,
|
|
46
|
+
children: "Could not load relationships"
|
|
47
|
+
}),
|
|
48
|
+
/* @__PURE__ */ h(o, {
|
|
49
|
+
tone: "danger",
|
|
50
|
+
style: "caption",
|
|
51
|
+
children: e.error ?? "Could not load relationships."
|
|
52
|
+
}),
|
|
53
|
+
/* @__PURE__ */ h(r, {
|
|
54
|
+
gap: 1,
|
|
55
|
+
children: /* @__PURE__ */ h(t, {
|
|
56
|
+
agent: "retry",
|
|
57
|
+
onPress: n("retry"),
|
|
58
|
+
children: "Retry"
|
|
59
|
+
})
|
|
60
|
+
})
|
|
61
|
+
] });
|
|
62
|
+
}
|
|
63
|
+
function S({ dispatch: e }) {
|
|
64
|
+
return /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(o, {
|
|
65
|
+
bold: !0,
|
|
66
|
+
children: "None"
|
|
67
|
+
}), /* @__PURE__ */ h(r, {
|
|
68
|
+
gap: 1,
|
|
69
|
+
children: /* @__PURE__ */ h(t, {
|
|
70
|
+
agent: "add",
|
|
71
|
+
onPress: e("add"),
|
|
72
|
+
children: "Add someone"
|
|
73
|
+
})
|
|
74
|
+
})] });
|
|
75
|
+
}
|
|
76
|
+
function C({ snapshot: e, onAction: t }) {
|
|
77
|
+
let [n, r] = c(""), a = n === "" ? e.nodes : e.nodes.filter((e) => e.kind === n);
|
|
78
|
+
return /* @__PURE__ */ g(m, { children: [
|
|
79
|
+
e.filters.length > 0 ? /* @__PURE__ */ h(w, {
|
|
80
|
+
filters: e.filters,
|
|
81
|
+
active: n,
|
|
82
|
+
onSelect: r
|
|
83
|
+
}) : null,
|
|
84
|
+
/* @__PURE__ */ g(o, {
|
|
85
|
+
style: "caption",
|
|
86
|
+
tone: "muted",
|
|
87
|
+
children: [
|
|
88
|
+
"Graph (",
|
|
89
|
+
a.length,
|
|
90
|
+
")"
|
|
91
|
+
]
|
|
92
|
+
}),
|
|
93
|
+
a.length === 0 ? /* @__PURE__ */ h(o, {
|
|
94
|
+
tone: "muted",
|
|
95
|
+
style: "caption",
|
|
96
|
+
children: "None"
|
|
97
|
+
}) : /* @__PURE__ */ h(i, {
|
|
98
|
+
gap: 1,
|
|
99
|
+
children: a.map((e) => /* @__PURE__ */ h(T, {
|
|
100
|
+
node: e,
|
|
101
|
+
onAction: t
|
|
102
|
+
}, e.id))
|
|
103
|
+
})
|
|
104
|
+
] });
|
|
105
|
+
}
|
|
106
|
+
function w({ filters: e, active: n, onSelect: i }) {
|
|
107
|
+
return /* @__PURE__ */ g(r, {
|
|
108
|
+
gap: 1,
|
|
109
|
+
wrap: !0,
|
|
110
|
+
align: "center",
|
|
111
|
+
children: [/* @__PURE__ */ h(t, {
|
|
112
|
+
agent: "relationships-kind-all",
|
|
113
|
+
variant: n === "" ? "solid" : "ghost",
|
|
114
|
+
onPress: () => i(""),
|
|
115
|
+
children: "All"
|
|
116
|
+
}), e.map((e) => /* @__PURE__ */ h(t, {
|
|
117
|
+
agent: `relationships-kind-${e.kind}`,
|
|
118
|
+
variant: n === e.kind ? "solid" : "ghost",
|
|
119
|
+
onPress: () => i(n === e.kind ? "" : e.kind),
|
|
120
|
+
children: e.label
|
|
121
|
+
}, e.kind))]
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
function T({ node: e, onAction: n }) {
|
|
125
|
+
return /* @__PURE__ */ g(s, {
|
|
126
|
+
gap: 0,
|
|
127
|
+
agent: `rel-${e.id}`,
|
|
128
|
+
children: [
|
|
129
|
+
/* @__PURE__ */ g(r, {
|
|
130
|
+
gap: 1,
|
|
131
|
+
align: "center",
|
|
132
|
+
children: [
|
|
133
|
+
/* @__PURE__ */ h(s, {
|
|
134
|
+
gap: 0,
|
|
135
|
+
grow: 1,
|
|
136
|
+
children: /* @__PURE__ */ h(o, {
|
|
137
|
+
bold: !0,
|
|
138
|
+
wrap: !1,
|
|
139
|
+
children: e.name
|
|
140
|
+
})
|
|
141
|
+
}),
|
|
142
|
+
/* @__PURE__ */ h(o, {
|
|
143
|
+
style: "caption",
|
|
144
|
+
tone: "primary",
|
|
145
|
+
wrap: !1,
|
|
146
|
+
children: e.kindLabel
|
|
147
|
+
}),
|
|
148
|
+
/* @__PURE__ */ h(t, {
|
|
149
|
+
agent: `open-${e.id}`,
|
|
150
|
+
onPress: () => n?.(`open:${e.id}`),
|
|
151
|
+
children: "›"
|
|
152
|
+
})
|
|
153
|
+
]
|
|
154
|
+
}),
|
|
155
|
+
e.identityLine ? /* @__PURE__ */ h(o, {
|
|
156
|
+
style: "caption",
|
|
157
|
+
tone: "muted",
|
|
158
|
+
wrap: !1,
|
|
159
|
+
children: e.identityLine
|
|
160
|
+
}) : null,
|
|
161
|
+
e.edges.length > 0 ? e.edges.map((e) => /* @__PURE__ */ g(r, {
|
|
162
|
+
gap: 1,
|
|
163
|
+
align: "center",
|
|
164
|
+
children: [
|
|
165
|
+
/* @__PURE__ */ h(o, {
|
|
166
|
+
tone: "muted",
|
|
167
|
+
wrap: !1,
|
|
168
|
+
children: "›"
|
|
169
|
+
}),
|
|
170
|
+
/* @__PURE__ */ h(s, {
|
|
171
|
+
gap: 0,
|
|
172
|
+
grow: 1,
|
|
173
|
+
children: /* @__PURE__ */ h(o, {
|
|
174
|
+
wrap: !1,
|
|
175
|
+
children: e.toName
|
|
176
|
+
})
|
|
177
|
+
}),
|
|
178
|
+
/* @__PURE__ */ h(o, {
|
|
179
|
+
style: "caption",
|
|
180
|
+
tone: "muted",
|
|
181
|
+
wrap: !1,
|
|
182
|
+
children: e.meta
|
|
183
|
+
})
|
|
184
|
+
]
|
|
185
|
+
}, e.id)) : null
|
|
186
|
+
]
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
//#endregion
|
|
190
|
+
//#region src/components/relationships/RelationshipsView.tsx
|
|
191
|
+
async function E() {
|
|
192
|
+
let t = await fetch(`${e.getBaseUrl()}/api/lifeops/entities`);
|
|
193
|
+
if (!t.ok) throw Error(`Entities request failed (${t.status})`);
|
|
194
|
+
return await t.json();
|
|
195
|
+
}
|
|
196
|
+
async function D() {
|
|
197
|
+
let t = await fetch(`${e.getBaseUrl()}/api/lifeops/relationships`);
|
|
198
|
+
if (!t.ok) throw Error(`Relationships request failed (${t.status})`);
|
|
199
|
+
return await t.json();
|
|
200
|
+
}
|
|
201
|
+
var O = {
|
|
202
|
+
fetchEntities: E,
|
|
203
|
+
fetchRelationships: D
|
|
204
|
+
};
|
|
205
|
+
function k(e) {
|
|
206
|
+
let t = e?.cadenceDays;
|
|
207
|
+
return typeof t == "number" && Number.isFinite(t) ? t : null;
|
|
208
|
+
}
|
|
209
|
+
function A(e) {
|
|
210
|
+
return e.lastInteractionAt ?? e.lastObservedAt ?? null;
|
|
211
|
+
}
|
|
212
|
+
function j(e) {
|
|
213
|
+
let t = new Date(e);
|
|
214
|
+
return Number.isNaN(t.getTime()) ? e : t.toLocaleDateString(void 0, {
|
|
215
|
+
month: "short",
|
|
216
|
+
day: "numeric",
|
|
217
|
+
year: "numeric"
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
function M(e, t, n) {
|
|
221
|
+
let r = [e.type];
|
|
222
|
+
return t !== null && r.push(`every ${t}d`), n && r.push(`last ${j(n)}`), r.join(" · ");
|
|
223
|
+
}
|
|
224
|
+
function N(e, t) {
|
|
225
|
+
let n = k(e.metadata), r = A(e.state);
|
|
226
|
+
return {
|
|
227
|
+
id: e.relationshipId,
|
|
228
|
+
toName: t.get(e.toEntityId) ?? e.toEntityId,
|
|
229
|
+
meta: M(e, n, r)
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
function P(e) {
|
|
233
|
+
return e.map((e) => `${e.platform}:${e.handle}`).join(" · ");
|
|
234
|
+
}
|
|
235
|
+
function F(e, t) {
|
|
236
|
+
let n = new Map(e.map((e) => [e.entityId, e.preferredName])), r = /* @__PURE__ */ new Map();
|
|
237
|
+
for (let e of t) {
|
|
238
|
+
let t = N(e, n), i = r.get(e.fromEntityId);
|
|
239
|
+
i ? i.push(t) : r.set(e.fromEntityId, [t]);
|
|
240
|
+
}
|
|
241
|
+
return e.map((e) => ({
|
|
242
|
+
id: e.entityId,
|
|
243
|
+
kind: e.type,
|
|
244
|
+
kindLabel: v[e.type] ?? e.type,
|
|
245
|
+
name: e.preferredName,
|
|
246
|
+
identityLine: P(e.identities),
|
|
247
|
+
edges: r.get(e.entityId) ?? []
|
|
248
|
+
}));
|
|
249
|
+
}
|
|
250
|
+
var I = _.map((e) => ({
|
|
251
|
+
kind: e,
|
|
252
|
+
label: v[e] ?? e
|
|
253
|
+
})), L = 2e4;
|
|
254
|
+
function R() {
|
|
255
|
+
let t = e.sendChatMessage;
|
|
256
|
+
t?.("Add someone to my relationships graph — tell me who you'd like to remember.");
|
|
257
|
+
}
|
|
258
|
+
function z(t) {
|
|
259
|
+
let n = e.sendChatMessage;
|
|
260
|
+
n?.(`Tell me about ${t} in my relationships graph.`);
|
|
261
|
+
}
|
|
262
|
+
function B(e = {}) {
|
|
263
|
+
let t = e.fetchers ?? O, [n, r] = p({ kind: "loading" }), i = f(t);
|
|
264
|
+
i.current = t;
|
|
265
|
+
let o = l(() => {
|
|
266
|
+
let e = !1;
|
|
267
|
+
return r({ kind: "loading" }), Promise.all([i.current.fetchEntities(), i.current.fetchRelationships()]).then(([t, n]) => {
|
|
268
|
+
e || r({
|
|
269
|
+
kind: "ready",
|
|
270
|
+
nodes: F(t.entities, n.relationships)
|
|
271
|
+
});
|
|
272
|
+
}).catch((t) => {
|
|
273
|
+
e || r({
|
|
274
|
+
kind: "error",
|
|
275
|
+
message: t instanceof Error ? t.message : "Could not load relationships."
|
|
276
|
+
});
|
|
277
|
+
}), () => {
|
|
278
|
+
e = !0;
|
|
279
|
+
};
|
|
280
|
+
}, []);
|
|
281
|
+
return u(() => o(), [o]), u(() => {
|
|
282
|
+
let e = setInterval(() => {
|
|
283
|
+
Promise.all([i.current.fetchEntities(), i.current.fetchRelationships()]).then(([e, t]) => {
|
|
284
|
+
r((n) => n.kind === "error" ? n : {
|
|
285
|
+
kind: "ready",
|
|
286
|
+
nodes: F(e.entities, t.relationships)
|
|
287
|
+
});
|
|
288
|
+
}).catch(() => {});
|
|
289
|
+
}, L);
|
|
290
|
+
return () => clearInterval(e);
|
|
291
|
+
}, []), /* @__PURE__ */ h(a, { children: /* @__PURE__ */ h(b, {
|
|
292
|
+
snapshot: d(() => n.kind === "loading" ? {
|
|
293
|
+
...y,
|
|
294
|
+
state: "loading"
|
|
295
|
+
} : n.kind === "error" ? {
|
|
296
|
+
state: "error",
|
|
297
|
+
nodes: [],
|
|
298
|
+
filters: I,
|
|
299
|
+
error: n.message
|
|
300
|
+
} : n.nodes.length === 0 ? {
|
|
301
|
+
state: "empty",
|
|
302
|
+
nodes: [],
|
|
303
|
+
filters: I
|
|
304
|
+
} : {
|
|
305
|
+
state: "ready",
|
|
306
|
+
nodes: n.nodes,
|
|
307
|
+
filters: I
|
|
308
|
+
}, [n]),
|
|
309
|
+
onAction: l((e) => {
|
|
310
|
+
if (e === "retry") {
|
|
311
|
+
o();
|
|
312
|
+
return;
|
|
313
|
+
}
|
|
314
|
+
if (e === "add") {
|
|
315
|
+
R();
|
|
316
|
+
return;
|
|
317
|
+
}
|
|
318
|
+
if (e.startsWith("open:")) {
|
|
319
|
+
z(e.slice(5));
|
|
320
|
+
return;
|
|
321
|
+
}
|
|
322
|
+
}, [o])
|
|
323
|
+
}) });
|
|
324
|
+
}
|
|
325
|
+
//#endregion
|
|
326
|
+
export { B as RelationshipsView };
|
|
327
|
+
|
|
328
|
+
//# sourceMappingURL=bundle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundle.js","names":[],"sources":["../../src/types.ts","../../src/components/relationships/RelationshipsSpatialView.tsx","../../src/components/relationships/RelationshipsView.tsx"],"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","/**\n * RelationshipsSpatialView — the entity / relationship knowledge-graph viewer\n * authored once with the spatial vocabulary, so it renders correctly wherever it\n * is displayed:\n *\n * - GUI / XR — mounted in `<SpatialSurface>` (DOM; XR scales up).\n * - TUI — rendered to real terminal lines by the agent terminal, via\n * `registerSpatialTerminalView` (see `register-terminal-view.tsx`).\n *\n * It is purely presentational (a snapshot + an action callback in, primitives\n * out) and imports only the cross-modality primitives, so it is safe to render\n * in the Node agent process where the terminal lives (no browser/client import).\n *\n * The two graph payloads (entities + their outbound edges) are joined and\n * projected to {@link EntityNode}s in the data wrapper ({@link ./RelationshipsView.tsx});\n * this component never fetches or computes the graph — it displays the snapshot\n * and dispatches actions. The entity-kind filter is the one piece of interactive\n * state it owns locally (via {@link useSpatialState}); filtering the already-built\n * node list is presentation-only and works on every surface.\n */\n\nimport {\n Button,\n Card,\n HStack,\n List,\n Text,\n useSpatialState,\n VStack,\n} from \"@elizaos/ui/spatial\";\n\n/** A typed edge shown under its source entity, already projected for display. */\nexport interface RelationshipEdge {\n id: string;\n /** Resolved target display name (or the raw id when unresolved). */\n toName: string;\n /** Pre-formatted meta line: `type · every Nd · last <date>`. */\n meta: string;\n}\n\n/** An entity node: identity + kind + its outbound edges. */\nexport interface EntityNode {\n id: string;\n /** Raw entity kind (e.g. \"person\", \"organization\"). */\n kind: string;\n /** Human label for the kind (e.g. \"People\", \"Organizations\"). */\n kindLabel: string;\n name: string;\n /** Pre-joined identity claims line (`discord:pat#1 · x:@pat`), or empty. */\n identityLine: string;\n edges: RelationshipEdge[];\n}\n\n/** A selectable kind filter offered above the graph. */\nexport interface KindFilter {\n /** Raw kind value used to match nodes. */\n kind: string;\n /** Human label shown on the chip. */\n label: string;\n}\n\n/** Which render state the graph is in. */\nexport type RelationshipsViewState = \"loading\" | \"error\" | \"empty\" | \"ready\";\n\nexport interface RelationshipsSnapshot {\n /** The graph state machine. */\n state: RelationshipsViewState;\n /** The entity nodes (only meaningful when state === \"ready\"). */\n nodes: EntityNode[];\n /** The kind filters offered above the graph. */\n filters: KindFilter[];\n /** Error message when state === \"error\". */\n error?: string;\n}\n\nexport const EMPTY_RELATIONSHIPS: RelationshipsSnapshot = {\n state: \"loading\",\n nodes: [],\n filters: [],\n};\n\nexport interface RelationshipsSpatialViewProps {\n snapshot: RelationshipsSnapshot;\n /**\n * Dispatch by action id:\n * - `retry` — reload after an error,\n * - `add` — route an add-a-person request through chat,\n * - `open:<entityId>` — focus an entity node.\n */\n onAction?: (action: string) => void;\n}\n\nexport function RelationshipsSpatialView({\n snapshot,\n onAction,\n}: RelationshipsSpatialViewProps) {\n const dispatch = (action: string) => () => onAction?.(action);\n\n return (\n <Card gap={1} padding={1}>\n {snapshot.state === \"loading\" ? (\n <Text tone=\"muted\" align=\"center\" style=\"caption\">\n Loading relationships\n </Text>\n ) : snapshot.state === \"error\" ? (\n <RelationshipsErrorBody snapshot={snapshot} dispatch={dispatch} />\n ) : snapshot.state === \"empty\" ? (\n <RelationshipsEmptyBody dispatch={dispatch} />\n ) : (\n <RelationshipsReadyBody snapshot={snapshot} onAction={onAction} />\n )}\n </Card>\n );\n}\n\nfunction RelationshipsErrorBody({\n snapshot,\n dispatch,\n}: {\n snapshot: RelationshipsSnapshot;\n dispatch: (action: string) => () => void;\n}) {\n return (\n <>\n <Text bold>Could not load relationships</Text>\n <Text tone=\"danger\" style=\"caption\">\n {snapshot.error ?? \"Could not load relationships.\"}\n </Text>\n <HStack gap={1}>\n <Button agent=\"retry\" onPress={dispatch(\"retry\")}>\n Retry\n </Button>\n </HStack>\n </>\n );\n}\n\nfunction RelationshipsEmptyBody({\n dispatch,\n}: {\n dispatch: (action: string) => () => void;\n}) {\n return (\n <>\n <Text bold>None</Text>\n <HStack gap={1}>\n <Button agent=\"add\" onPress={dispatch(\"add\")}>\n Add someone\n </Button>\n </HStack>\n </>\n );\n}\n\nfunction RelationshipsReadyBody({\n snapshot,\n onAction,\n}: {\n snapshot: RelationshipsSnapshot;\n onAction?: (action: string) => void;\n}) {\n // The active kind filter is the one piece of interactive local state. Empty\n // string = \"all kinds\". A single selection keeps the chips and the rendered\n // cards in agreement on every surface.\n const [activeKind, setActiveKind] = useSpatialState<string>(\"\");\n\n const visible =\n activeKind === \"\"\n ? snapshot.nodes\n : snapshot.nodes.filter((node) => node.kind === activeKind);\n\n return (\n <>\n {snapshot.filters.length > 0 ? (\n <KindFilters\n filters={snapshot.filters}\n active={activeKind}\n onSelect={setActiveKind}\n />\n ) : null}\n <Text style=\"caption\" tone=\"muted\">\n Graph ({visible.length})\n </Text>\n {visible.length === 0 ? (\n <Text tone=\"muted\" style=\"caption\">\n None\n </Text>\n ) : (\n <List gap={1}>\n {visible.map((node) => (\n <EntityNodeBlock key={node.id} node={node} onAction={onAction} />\n ))}\n </List>\n )}\n </>\n );\n}\n\nfunction KindFilters({\n filters,\n active,\n onSelect,\n}: {\n filters: KindFilter[];\n active: string;\n onSelect: (kind: string) => void;\n}) {\n return (\n <HStack gap={1} wrap align=\"center\">\n <Button\n agent=\"relationships-kind-all\"\n variant={active === \"\" ? \"solid\" : \"ghost\"}\n onPress={() => onSelect(\"\")}\n >\n All\n </Button>\n {filters.map((filter) => (\n <Button\n key={filter.kind}\n agent={`relationships-kind-${filter.kind}`}\n variant={active === filter.kind ? \"solid\" : \"ghost\"}\n onPress={() => onSelect(active === filter.kind ? \"\" : filter.kind)}\n >\n {filter.label}\n </Button>\n ))}\n </HStack>\n );\n}\n\nfunction EntityNodeBlock({\n node,\n onAction,\n}: {\n node: EntityNode;\n onAction?: (action: string) => void;\n}) {\n return (\n <VStack gap={0} agent={`rel-${node.id}`}>\n <HStack gap={1} align=\"center\">\n <VStack gap={0} grow={1}>\n <Text bold wrap={false}>\n {node.name}\n </Text>\n </VStack>\n <Text style=\"caption\" tone=\"primary\" wrap={false}>\n {node.kindLabel}\n </Text>\n <Button\n agent={`open-${node.id}`}\n onPress={() => onAction?.(`open:${node.id}`)}\n >\n ›\n </Button>\n </HStack>\n {node.identityLine ? (\n <Text style=\"caption\" tone=\"muted\" wrap={false}>\n {node.identityLine}\n </Text>\n ) : null}\n {node.edges.length > 0\n ? node.edges.map((edge) => (\n <HStack key={edge.id} gap={1} align=\"center\">\n <Text tone=\"muted\" wrap={false}>\n ›\n </Text>\n <VStack gap={0} grow={1}>\n <Text wrap={false}>{edge.toName}</Text>\n </VStack>\n <Text style=\"caption\" tone=\"muted\" wrap={false}>\n {edge.meta}\n </Text>\n </HStack>\n ))\n : null}\n </VStack>\n );\n}\n","/**\n * RelationshipsView — the single GUI/XR data wrapper for the entity /\n * relationship knowledge-graph viewer.\n *\n * It owns the live graph data (the fetcher seam over the two read-only endpoints\n * the personal-assistant routes serve, the quiet background poll, and the\n * wire->display join) and renders the one presentational\n * {@link RelationshipsSpatialView} inside a {@link SpatialSurface}. Omitting the\n * `modality` prop lets `SpatialSurface` auto-detect GUI vs XR, so the SAME\n * component serves both surfaces; the TUI surface renders the same\n * `RelationshipsSpatialView` through the terminal registry (see\n * `../../register-terminal-view.tsx`).\n *\n * Data source (the runtime owns the EntityStore / RelationshipStore persistence;\n * this plugin only reads):\n * GET {base}/api/lifeops/entities -> { entities: EntityWire[] }\n * GET {base}/api/lifeops/relationships -> { relationships: RelationshipWire[] }\n *\n * The graph is read-only: the only owner actions are `add` (route an add-a-person\n * request through the assistant chat — no fabricated people), `retry` (reload\n * after an error), and `open:<id>` (focus an entity from chat). This plugin MUST\n * NOT import from @elizaos/plugin-personal-assistant; the wire DTOs below are\n * declared locally to match the JSON shape PA emits.\n */\n\nimport { client } from \"@elizaos/ui\";\nimport { SpatialSurface } from \"@elizaos/ui/spatial\";\nimport type { ReactNode } from \"react\";\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { ENTITY_KIND_FILTERS, ENTITY_KIND_LABELS } from \"../../types.ts\";\nimport {\n EMPTY_RELATIONSHIPS,\n type EntityNode,\n type KindFilter,\n type RelationshipEdge,\n type RelationshipsSnapshot,\n RelationshipsSpatialView,\n} from \"./RelationshipsSpatialView.tsx\";\n\n// ---------------------------------------------------------------------------\n// Wire DTOs — local mirror of the JSON shapes served by the PA graph routes.\n// Never import PA types here; keep this view's contract self-contained and\n// aligned by shape.\n// ---------------------------------------------------------------------------\n\ninterface EntityIdentityWire {\n platform: string;\n handle: string;\n displayName?: string;\n verified: boolean;\n confidence: number;\n}\n\ninterface EntityWire {\n entityId: string;\n type: string;\n preferredName: string;\n fullName?: string;\n identities: EntityIdentityWire[];\n}\n\ninterface EntitiesWire {\n entities: EntityWire[];\n}\n\ninterface RelationshipStateWire {\n lastObservedAt?: string;\n lastInteractionAt?: string;\n}\n\ninterface RelationshipWire {\n relationshipId: string;\n fromEntityId: string;\n toEntityId: string;\n type: string;\n metadata?: Record<string, unknown>;\n state: RelationshipStateWire;\n}\n\ninterface RelationshipsWire {\n relationships: RelationshipWire[];\n}\n\n// ---------------------------------------------------------------------------\n// Fetcher seam — default to two real GETs; tests inject offline fakes.\n// ---------------------------------------------------------------------------\n\nexport interface RelationshipsFetchers {\n fetchEntities: () => Promise<EntitiesWire>;\n fetchRelationships: () => Promise<RelationshipsWire>;\n}\n\nasync function getEntities(): Promise<EntitiesWire> {\n const response = await fetch(`${client.getBaseUrl()}/api/lifeops/entities`);\n if (!response.ok) {\n throw new Error(`Entities request failed (${response.status})`);\n }\n return (await response.json()) as EntitiesWire;\n}\n\nasync function getRelationships(): Promise<RelationshipsWire> {\n const response = await fetch(\n `${client.getBaseUrl()}/api/lifeops/relationships`,\n );\n if (!response.ok) {\n throw new Error(`Relationships request failed (${response.status})`);\n }\n return (await response.json()) as RelationshipsWire;\n}\n\nconst defaultFetchers: RelationshipsFetchers = {\n fetchEntities: getEntities,\n fetchRelationships: getRelationships,\n};\n\nexport interface RelationshipsViewProps {\n /** Owner display name. Accepted for host compatibility; not rendered. */\n ownerName?: string;\n /** Test/host injection seam. Defaults to the real graph GETs. */\n fetchers?: RelationshipsFetchers;\n}\n\n// ---------------------------------------------------------------------------\n// Wire -> display DTO mapping.\n// ---------------------------------------------------------------------------\n\n/** Read the per-edge cadence override (`metadata.cadenceDays`) when present. */\nfunction readCadenceDays(\n metadata: Record<string, unknown> | undefined,\n): number | null {\n const value = metadata?.cadenceDays;\n if (typeof value === \"number\" && Number.isFinite(value)) return value;\n return null;\n}\n\n/**\n * The last interaction on an edge is the most recent of its two timestamps;\n * `lastInteractionAt` is the canonical contact, `lastObservedAt` the fallback.\n */\nfunction readLastContact(state: RelationshipStateWire): string | null {\n return state.lastInteractionAt ?? state.lastObservedAt ?? null;\n}\n\nfunction formatDate(value: string): string {\n const date = new Date(value);\n if (Number.isNaN(date.getTime())) return value;\n return date.toLocaleDateString(undefined, {\n month: \"short\",\n day: \"numeric\",\n year: \"numeric\",\n });\n}\n\n/** Build the meta line for an edge: type · cadence · last-contact. */\nfunction edgeMeta(\n relationship: RelationshipWire,\n cadenceDays: number | null,\n lastContact: string | null,\n): string {\n const parts: string[] = [relationship.type];\n if (cadenceDays !== null) parts.push(`every ${cadenceDays}d`);\n if (lastContact) parts.push(`last ${formatDate(lastContact)}`);\n return parts.join(\" · \");\n}\n\nfunction mapEdge(\n relationship: RelationshipWire,\n nameById: ReadonlyMap<string, string>,\n): RelationshipEdge {\n const cadenceDays = readCadenceDays(relationship.metadata);\n const lastContact = readLastContact(relationship.state);\n return {\n id: relationship.relationshipId,\n toName: nameById.get(relationship.toEntityId) ?? relationship.toEntityId,\n meta: edgeMeta(relationship, cadenceDays, lastContact),\n };\n}\n\nfunction identityLine(identities: EntityIdentityWire[]): string {\n return identities\n .map((identity) => `${identity.platform}:${identity.handle}`)\n .join(\" · \");\n}\n\n/**\n * Join the entity list with their outbound edges into per-entity nodes. The\n * server returns the full graph; this is a presentation-only fold.\n */\nfunction buildNodes(\n entities: EntityWire[],\n relationships: RelationshipWire[],\n): EntityNode[] {\n const nameById = new Map<string, string>(\n entities.map((entity) => [entity.entityId, entity.preferredName]),\n );\n const edgesByFrom = new Map<string, RelationshipEdge[]>();\n for (const relationship of relationships) {\n const edge = mapEdge(relationship, nameById);\n const existing = edgesByFrom.get(relationship.fromEntityId);\n if (existing) existing.push(edge);\n else edgesByFrom.set(relationship.fromEntityId, [edge]);\n }\n return entities.map((entity) => ({\n id: entity.entityId,\n kind: entity.type,\n kindLabel: ENTITY_KIND_LABELS[entity.type] ?? entity.type,\n name: entity.preferredName,\n identityLine: identityLine(entity.identities),\n edges: edgesByFrom.get(entity.entityId) ?? [],\n }));\n}\n\nconst KIND_FILTERS: KindFilter[] = ENTITY_KIND_FILTERS.map((kind) => ({\n kind,\n label: ENTITY_KIND_LABELS[kind] ?? kind,\n}));\n\n// ---------------------------------------------------------------------------\n// Fetch-driven state machine.\n// ---------------------------------------------------------------------------\n\nconst RELATIONSHIPS_POLL_INTERVAL_MS = 20_000;\n\ntype LoadState =\n | { kind: \"loading\" }\n | { kind: \"error\"; message: string }\n | { kind: \"ready\"; nodes: EntityNode[] };\n\nfunction requestAddPerson(): void {\n // The add-a-person affordance routes through the assistant chat. `client` does\n // not type `sendChatMessage`, so read it through a narrow optional-method view\n // and call it only when present — no fabricated people, best-effort dispatch.\n const send = (client as { sendChatMessage?: (text: string) => void })\n .sendChatMessage;\n send?.(\n \"Add someone to my relationships graph — tell me who you'd like to remember.\",\n );\n}\n\nfunction requestOpenEntity(entityId: string): void {\n const send = (client as { sendChatMessage?: (text: string) => void })\n .sendChatMessage;\n send?.(`Tell me about ${entityId} in my relationships graph.`);\n}\n\nexport function RelationshipsView(\n props: RelationshipsViewProps = {},\n): ReactNode {\n const fetchers = props.fetchers ?? defaultFetchers;\n const [state, setState] = useState<LoadState>({ kind: \"loading\" });\n\n const fetchersRef = useRef(fetchers);\n fetchersRef.current = fetchers;\n\n const load = useCallback(() => {\n let cancelled = false;\n setState({ kind: \"loading\" });\n Promise.all([\n fetchersRef.current.fetchEntities(),\n fetchersRef.current.fetchRelationships(),\n ])\n .then(([entitiesWire, relationshipsWire]) => {\n if (cancelled) return;\n setState({\n kind: \"ready\",\n nodes: buildNodes(\n entitiesWire.entities,\n relationshipsWire.relationships,\n ),\n });\n })\n .catch((error: unknown) => {\n if (cancelled) return;\n setState({\n kind: \"error\",\n message:\n error instanceof Error\n ? error.message\n : \"Could not load relationships.\",\n });\n });\n return () => {\n cancelled = true;\n };\n }, []);\n\n useEffect(() => load(), [load]);\n\n // Background poll: refresh the graph on an interval without flashing the\n // loading state. Transient poll failures are ignored — the explicit Retry\n // path is what surfaces errors to the user.\n useEffect(() => {\n const id = setInterval(() => {\n Promise.all([\n fetchersRef.current.fetchEntities(),\n fetchersRef.current.fetchRelationships(),\n ])\n .then(([entitiesWire, relationshipsWire]) => {\n setState((prev) =>\n prev.kind === \"error\"\n ? prev\n : {\n kind: \"ready\",\n nodes: buildNodes(\n entitiesWire.entities,\n relationshipsWire.relationships,\n ),\n },\n );\n })\n .catch(() => {});\n }, RELATIONSHIPS_POLL_INTERVAL_MS);\n return () => clearInterval(id);\n }, []);\n\n const snapshot = useMemo<RelationshipsSnapshot>(() => {\n if (state.kind === \"loading\") {\n return { ...EMPTY_RELATIONSHIPS, state: \"loading\" };\n }\n if (state.kind === \"error\") {\n return {\n state: \"error\",\n nodes: [],\n filters: KIND_FILTERS,\n error: state.message,\n };\n }\n if (state.nodes.length === 0) {\n return { state: \"empty\", nodes: [], filters: KIND_FILTERS };\n }\n return { state: \"ready\", nodes: state.nodes, filters: KIND_FILTERS };\n }, [state]);\n\n const onAction = useCallback(\n (action: string) => {\n if (action === \"retry\") {\n load();\n return;\n }\n if (action === \"add\") {\n requestAddPerson();\n return;\n }\n if (action.startsWith(\"open:\")) {\n requestOpenEntity(action.slice(\"open:\".length));\n return;\n }\n },\n [load],\n );\n\n return (\n <SpatialSurface>\n <RelationshipsSpatialView snapshot={snapshot} onAction={onAction} />\n </SpatialSurface>\n );\n}\n\nexport default RelationshipsView;\n"],"mappings":";;;;;AAsIA,IAAa,IAAsB;CACjC;CACA;CACA;CACA;CACA;AACF,GAIa,IAA6C;CACxD,QAAQ;CACR,cAAc;CACd,OAAO;CACP,SAAS;CACT,SAAS;AACX,GC3Ea,IAA6C;CACxD,OAAO;CACP,OAAO,CAAC;CACR,SAAS,CAAC;AACZ;AAaA,SAAgB,EAAyB,EACvC,aACA,eACgC;CAChC,IAAM,KAAY,YAAyB,IAAW,CAAM;CAE5D,OACE,kBAAC,GAAD;EAAM,KAAK;EAAG,SAAS;YACpB,EAAS,UAAU,YAClB,kBAAC,GAAD;GAAM,MAAK;GAAQ,OAAM;GAAS,OAAM;aAAU;EAE5C,CAAA,IACJ,EAAS,UAAU,UACrB,kBAAC,GAAD;GAAkC;GAAoB;EAAW,CAAA,IAC/D,EAAS,UAAU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OAAO,EAAM;GAAO,SAAS;EAAa,GAClE,CAAC,CAAK,CAsB+B;EAAoB,UApB3C,GACd,MAAmB;GAClB,IAAI,MAAW,SAAS;IACtB,EAAK;IACL;GACF;GACA,IAAI,MAAW,OAAO;IACpB,EAAiB;IACjB;GACF;GACA,IAAI,EAAO,WAAW,OAAO,GAAG;IAC9B,EAAkB,EAAO,MAAM,CAAc,CAAC;IAC9C;GACF;EACF,GACA,CAAC,CAAI,CAKqD;CAAW,CAAA,EACrD,CAAA;AAEpB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elizaos/plugin-relationships",
|
|
3
|
-
"version": "2.0.3-beta.
|
|
3
|
+
"version": "2.0.3-beta.7",
|
|
4
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
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -50,15 +50,15 @@
|
|
|
50
50
|
"author": "elizaOS",
|
|
51
51
|
"license": "MIT",
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@elizaos/agent": "2.0.3-beta.
|
|
54
|
-
"@elizaos/app-core": "2.0.3-beta.
|
|
55
|
-
"@elizaos/core": "2.0.3-beta.
|
|
56
|
-
"@elizaos/shared": "2.0.3-beta.
|
|
57
|
-
"@elizaos/ui": "2.0.3-beta.
|
|
53
|
+
"@elizaos/agent": "2.0.3-beta.7",
|
|
54
|
+
"@elizaos/app-core": "2.0.3-beta.7",
|
|
55
|
+
"@elizaos/core": "2.0.3-beta.7",
|
|
56
|
+
"@elizaos/shared": "2.0.3-beta.7",
|
|
57
|
+
"@elizaos/ui": "2.0.3-beta.7",
|
|
58
58
|
"drizzle-orm": "^0.45.1"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
|
-
"@elizaos/plugin-sql": "2.0.3-beta.
|
|
61
|
+
"@elizaos/plugin-sql": "2.0.3-beta.7",
|
|
62
62
|
"react": "^19.0.0",
|
|
63
63
|
"react-dom": "^19.0.0"
|
|
64
64
|
},
|
|
@@ -108,5 +108,5 @@
|
|
|
108
108
|
"node": "Default export (Node.js)"
|
|
109
109
|
}
|
|
110
110
|
},
|
|
111
|
-
"gitHead": "
|
|
111
|
+
"gitHead": "61094f10458d11055c75b3dd0bae374e3f66bac5"
|
|
112
112
|
}
|