hippo-memory 1.18.0 → 1.20.0
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/api.d.ts +15 -0
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +78 -0
- package/dist/api.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +75 -2
- package/dist/cli.js.map +1 -1
- package/dist/customer-notes.d.ts.map +1 -1
- package/dist/customer-notes.js +5 -1
- package/dist/customer-notes.js.map +1 -1
- package/dist/decisions.d.ts.map +1 -1
- package/dist/decisions.js +9 -1
- package/dist/decisions.js.map +1 -1
- package/dist/graph-extract.d.ts.map +1 -1
- package/dist/graph-extract.js +32 -12
- package/dist/graph-extract.js.map +1 -1
- package/dist/graph-view.d.ts +72 -0
- package/dist/graph-view.d.ts.map +1 -0
- package/dist/graph-view.js +310 -0
- package/dist/graph-view.js.map +1 -0
- package/dist/graph.d.ts +76 -7
- package/dist/graph.d.ts.map +1 -1
- package/dist/graph.js +220 -19
- package/dist/graph.js.map +1 -1
- package/dist/policies.d.ts.map +1 -1
- package/dist/policies.js +5 -1
- package/dist/policies.js.map +1 -1
- package/dist/project-briefs.d.ts.map +1 -1
- package/dist/project-briefs.js +6 -1
- package/dist/project-briefs.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +19 -0
- package/dist/server.js.map +1 -1
- package/dist/sleep-redact.d.ts +1 -0
- package/dist/sleep-redact.d.ts.map +1 -1
- package/dist/sleep-redact.js +6 -0
- package/dist/sleep-redact.js.map +1 -1
- package/dist/src/api.js +78 -0
- package/dist/src/api.js.map +1 -1
- package/dist/src/cli.js +75 -2
- package/dist/src/cli.js.map +1 -1
- package/dist/src/customer-notes.js +5 -1
- package/dist/src/customer-notes.js.map +1 -1
- package/dist/src/decisions.js +9 -1
- package/dist/src/decisions.js.map +1 -1
- package/dist/src/graph-extract.js +32 -12
- package/dist/src/graph-extract.js.map +1 -1
- package/dist/src/graph-view.js +310 -0
- package/dist/src/graph-view.js.map +1 -0
- package/dist/src/graph.js +220 -19
- package/dist/src/graph.js.map +1 -1
- package/dist/src/policies.js +5 -1
- package/dist/src/policies.js.map +1 -1
- package/dist/src/project-briefs.js +6 -1
- package/dist/src/project-briefs.js.map +1 -1
- package/dist/src/server.js +19 -0
- package/dist/src/server.js.map +1 -1
- package/dist/src/sleep-redact.js +6 -0
- package/dist/src/sleep-redact.js.map +1 -1
- package/dist/src/store.js +1 -0
- package/dist/src/store.js.map +1 -1
- package/dist/src/version.js +1 -1
- package/dist/store.d.ts +6 -0
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +1 -0
- package/dist/store.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/extensions/openclaw-plugin/openclaw.plugin.json +1 -1
- package/extensions/openclaw-plugin/package.json +1 -1
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* E3 graph observability + visualization — READ-ONLY over the entity/relation
|
|
3
|
+
* graph (docs/plans/2026-06-02-graph-observability.md).
|
|
4
|
+
*
|
|
5
|
+
* This module only READS the graph (`loadEntities` / `loadRelations`) and renders
|
|
6
|
+
* view-models; it issues no INSERT/UPDATE/DELETE, so `scripts/check-graph-writes.mjs`
|
|
7
|
+
* stays green. Used by the CLI (`hippo graph show` / `hippo graph view`) and the
|
|
8
|
+
* HTTP `GET /v1/graph` route, which all build the same `GraphModel`.
|
|
9
|
+
*/
|
|
10
|
+
import { loadEntities, loadEntitiesByName, loadEntitiesByIds, loadRelations, loadNeighborRelations, loadRelationsAmong, withGraphReadSnapshot, } from './graph.js';
|
|
11
|
+
/** Default bound for the CLI viewer / show so an unbounded set is never laid out. */
|
|
12
|
+
export const DEFAULT_VIEW_LIMIT = 500;
|
|
13
|
+
/**
|
|
14
|
+
* Build the view-model from the graph (reads only). With `opts.entity`, returns a
|
|
15
|
+
* focus subgraph: every entity whose name === entity, plus their 1-hop neighbours,
|
|
16
|
+
* plus the edges among that union. Dangling edges (an endpoint outside the node
|
|
17
|
+
* set) are always dropped.
|
|
18
|
+
*/
|
|
19
|
+
export function buildGraphModel(hippoRoot, tenantId, opts = {}) {
|
|
20
|
+
const limit = opts.limit ?? DEFAULT_VIEW_LIMIT;
|
|
21
|
+
// All reads run inside ONE read snapshot so a concurrent `graph extract` /
|
|
22
|
+
// sleep-drain rebuild can't make the model mix old entity ids with new relation
|
|
23
|
+
// ids (codex P2). Every load* call below is passed the snapshot connection `db`.
|
|
24
|
+
return withGraphReadSnapshot(hippoRoot, (db) => {
|
|
25
|
+
let nodeEntities;
|
|
26
|
+
let relations;
|
|
27
|
+
let truncated;
|
|
28
|
+
if (opts.entity !== undefined) {
|
|
29
|
+
// Focus subgraph. (1) Query the named entity DIRECTLY (by name, not from a
|
|
30
|
+
// globally-capped list) so it is found even on a graph larger than `limit`.
|
|
31
|
+
// (2) A name can map to MANY entities (e.g. many notes for one customer), so
|
|
32
|
+
// cap the focus matches. (3) Discover 1-hop neighbours and cap the UNION to
|
|
33
|
+
// `limit` nodes. (4) Load ALL edges AMONG the union so neighbour-to-neighbour
|
|
34
|
+
// edges that don't touch the focus are included too. (codex P2s.)
|
|
35
|
+
const focus = loadEntitiesByName(hippoRoot, tenantId, opts.entity, { limit }, db);
|
|
36
|
+
if (focus.length === 0)
|
|
37
|
+
return { nodes: [], edges: [], truncated: false };
|
|
38
|
+
const focusIds = focus.map((e) => e.id);
|
|
39
|
+
const hop = loadNeighborRelations(hippoRoot, tenantId, focusIds, { limit }, db);
|
|
40
|
+
const union = new Set(focusIds);
|
|
41
|
+
let neighboursCapped = false;
|
|
42
|
+
for (const r of hop) {
|
|
43
|
+
if (union.size >= limit) {
|
|
44
|
+
neighboursCapped = true; // node cap filled before all neighbours were added
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
union.add(r.fromEntityId);
|
|
48
|
+
union.add(r.toEntityId);
|
|
49
|
+
}
|
|
50
|
+
const unionIds = [...union].slice(0, limit);
|
|
51
|
+
nodeEntities = loadEntitiesByIds(hippoRoot, tenantId, unionIds, db);
|
|
52
|
+
// Edges AMONG the union (BOTH endpoints in the set): includes
|
|
53
|
+
// neighbour-to-neighbour edges, and the LIMIT can never drop a valid in-union
|
|
54
|
+
// edge in favour of out-of-union rows (codex P2).
|
|
55
|
+
relations = loadRelationsAmong(hippoRoot, tenantId, unionIds, { limit }, db);
|
|
56
|
+
truncated =
|
|
57
|
+
focus.length >= limit ||
|
|
58
|
+
hop.length >= limit || // neighbour scan capped -> a 1-hop neighbour may be omitted (codex P2)
|
|
59
|
+
neighboursCapped || // node cap filled before all neighbours were consumed (codex P2)
|
|
60
|
+
union.size > unionIds.length ||
|
|
61
|
+
relations.length >= limit;
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
nodeEntities = loadEntities(hippoRoot, tenantId, { limit }, db);
|
|
65
|
+
relations = loadRelations(hippoRoot, tenantId, { limit }, db);
|
|
66
|
+
truncated = nodeEntities.length >= limit || relations.length >= limit;
|
|
67
|
+
}
|
|
68
|
+
const nodeIds = new Set(nodeEntities.map((e) => e.id));
|
|
69
|
+
const nodes = nodeEntities.map((e) => ({
|
|
70
|
+
id: e.id,
|
|
71
|
+
type: e.entityType,
|
|
72
|
+
name: e.name,
|
|
73
|
+
}));
|
|
74
|
+
const edges = relations
|
|
75
|
+
.filter((r) => nodeIds.has(r.fromEntityId) && nodeIds.has(r.toEntityId))
|
|
76
|
+
.map((r) => ({ from: r.fromEntityId, to: r.toEntityId, relType: r.relType }));
|
|
77
|
+
return { nodes, edges, truncated };
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
const LAYOUT_W = 1000;
|
|
81
|
+
const LAYOUT_H = 700;
|
|
82
|
+
/**
|
|
83
|
+
* Deterministic Fruchterman-Reingold-style force layout. Seeded circular init +
|
|
84
|
+
* fixed iterations, NO `Math.random`, so the same model always yields the same
|
|
85
|
+
* positions (testable, stable output). Non-finite coordinates from a degenerate
|
|
86
|
+
* step are clamped to the viewport centre; all positions are clamped in-bounds.
|
|
87
|
+
*/
|
|
88
|
+
export function layoutGraph(model, opts = {}) {
|
|
89
|
+
const width = opts.width ?? LAYOUT_W;
|
|
90
|
+
const height = opts.height ?? LAYOUT_H;
|
|
91
|
+
const iterations = opts.iterations ?? 300;
|
|
92
|
+
const cx = width / 2;
|
|
93
|
+
const cy = height / 2;
|
|
94
|
+
const nodes = model.nodes;
|
|
95
|
+
const n = nodes.length;
|
|
96
|
+
const pos = new Map();
|
|
97
|
+
if (n === 0)
|
|
98
|
+
return pos;
|
|
99
|
+
if (n === 1) {
|
|
100
|
+
pos.set(nodes[0].id, { x: cx, y: cy });
|
|
101
|
+
return pos;
|
|
102
|
+
}
|
|
103
|
+
const radius = Math.min(width, height) * 0.4;
|
|
104
|
+
nodes.forEach((node, i) => {
|
|
105
|
+
const angle = (2 * Math.PI * i) / n;
|
|
106
|
+
pos.set(node.id, { x: cx + radius * Math.cos(angle), y: cy + radius * Math.sin(angle) });
|
|
107
|
+
});
|
|
108
|
+
const idIndex = new Map(nodes.map((node, i) => [node.id, i]));
|
|
109
|
+
const k = Math.sqrt((width * height) / n); // ideal edge length
|
|
110
|
+
for (let iter = 0; iter < iterations; iter++) {
|
|
111
|
+
const disp = nodes.map(() => ({ x: 0, y: 0 }));
|
|
112
|
+
// Repulsion between all pairs.
|
|
113
|
+
for (let i = 0; i < n; i++) {
|
|
114
|
+
const pi = pos.get(nodes[i].id);
|
|
115
|
+
for (let j = i + 1; j < n; j++) {
|
|
116
|
+
const pj = pos.get(nodes[j].id);
|
|
117
|
+
const dx = pi.x - pj.x;
|
|
118
|
+
const dy = pi.y - pj.y;
|
|
119
|
+
const dist = Math.hypot(dx, dy) || 0.01;
|
|
120
|
+
const rep = (k * k) / dist;
|
|
121
|
+
const ux = dx / dist;
|
|
122
|
+
const uy = dy / dist;
|
|
123
|
+
disp[i].x += ux * rep;
|
|
124
|
+
disp[i].y += uy * rep;
|
|
125
|
+
disp[j].x -= ux * rep;
|
|
126
|
+
disp[j].y -= uy * rep;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
// Attraction along edges.
|
|
130
|
+
for (const e of model.edges) {
|
|
131
|
+
const i = idIndex.get(e.from);
|
|
132
|
+
const j = idIndex.get(e.to);
|
|
133
|
+
if (i === undefined || j === undefined)
|
|
134
|
+
continue;
|
|
135
|
+
const pi = pos.get(e.from);
|
|
136
|
+
const pj = pos.get(e.to);
|
|
137
|
+
const dx = pi.x - pj.x;
|
|
138
|
+
const dy = pi.y - pj.y;
|
|
139
|
+
const dist = Math.hypot(dx, dy) || 0.01;
|
|
140
|
+
const att = (dist * dist) / k;
|
|
141
|
+
const ux = dx / dist;
|
|
142
|
+
const uy = dy / dist;
|
|
143
|
+
disp[i].x -= ux * att;
|
|
144
|
+
disp[i].y -= uy * att;
|
|
145
|
+
disp[j].x += ux * att;
|
|
146
|
+
disp[j].y += uy * att;
|
|
147
|
+
}
|
|
148
|
+
// Apply with cooling; clamp.
|
|
149
|
+
const temp = Math.max(1, (width / 10) * (1 - iter / iterations));
|
|
150
|
+
nodes.forEach((node, i) => {
|
|
151
|
+
const p = pos.get(node.id);
|
|
152
|
+
const dl = Math.hypot(disp[i].x, disp[i].y) || 0.01;
|
|
153
|
+
let nx = p.x + (disp[i].x / dl) * Math.min(dl, temp);
|
|
154
|
+
let ny = p.y + (disp[i].y / dl) * Math.min(dl, temp);
|
|
155
|
+
if (!Number.isFinite(nx))
|
|
156
|
+
nx = cx;
|
|
157
|
+
if (!Number.isFinite(ny))
|
|
158
|
+
ny = cy;
|
|
159
|
+
p.x = Math.max(20, Math.min(width - 20, nx));
|
|
160
|
+
p.y = Math.max(20, Math.min(height - 20, ny));
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
return pos;
|
|
164
|
+
}
|
|
165
|
+
/** HTML-escape for SVG text / title / markup content (XSS guard). */
|
|
166
|
+
export function escapeHtml(s) {
|
|
167
|
+
return s
|
|
168
|
+
.replace(/&/g, '&')
|
|
169
|
+
.replace(/</g, '<')
|
|
170
|
+
.replace(/>/g, '>')
|
|
171
|
+
.replace(/"/g, '"')
|
|
172
|
+
.replace(/'/g, ''');
|
|
173
|
+
}
|
|
174
|
+
const NODE_COLORS = {
|
|
175
|
+
decision: '#6366f1',
|
|
176
|
+
policy: '#10b981',
|
|
177
|
+
customer: '#f59e0b',
|
|
178
|
+
project: '#ec4899',
|
|
179
|
+
person: '#3b82f6',
|
|
180
|
+
system: '#64748b',
|
|
181
|
+
};
|
|
182
|
+
// Client script: pan (drag bg), zoom (wheel), click-to-highlight a node's edges +
|
|
183
|
+
// neighbours. Reads the inlined model via JSON.parse (never innerHTML), so user
|
|
184
|
+
// strings never reach an HTML sink here. No template literals / `${}` so it nests
|
|
185
|
+
// safely inside this module's own template strings.
|
|
186
|
+
const CLIENT_JS = [
|
|
187
|
+
"(function(){",
|
|
188
|
+
" var svg=document.getElementById('g');",
|
|
189
|
+
" var vb=svg.getAttribute('viewBox').split(' ').map(Number);",
|
|
190
|
+
" var view={x:vb[0],y:vb[1],w:vb[2],h:vb[3]};",
|
|
191
|
+
" function apply(){svg.setAttribute('viewBox',view.x+' '+view.y+' '+view.w+' '+view.h);}",
|
|
192
|
+
" var panning=false,sx=0,sy=0;",
|
|
193
|
+
" svg.addEventListener('mousedown',function(e){if(e.target.closest('.node'))return;panning=true;sx=e.clientX;sy=e.clientY;});",
|
|
194
|
+
" window.addEventListener('mouseup',function(){panning=false;});",
|
|
195
|
+
" window.addEventListener('mousemove',function(e){if(!panning)return;var r=svg.getBoundingClientRect();var k=view.w/r.width;view.x-=(e.clientX-sx)*k;view.y-=(e.clientY-sy)*k;sx=e.clientX;sy=e.clientY;apply();});",
|
|
196
|
+
" svg.addEventListener('wheel',function(e){e.preventDefault();var r=svg.getBoundingClientRect();var mx=view.x+(e.clientX-r.left)/r.width*view.w;var my=view.y+(e.clientY-r.top)/r.height*view.h;var f=e.deltaY<0?0.9:1.1;view.x=mx-(mx-view.x)*f;view.y=my-(my-view.y)*f;view.w*=f;view.h*=f;apply();},{passive:false});",
|
|
197
|
+
" var data={};try{data=JSON.parse(document.getElementById('graph-data').textContent);}catch(_){}",
|
|
198
|
+
" var adj={};(data.edges||[]).forEach(function(e){(adj[e.from]=adj[e.from]||[]).push(e.to);(adj[e.to]=adj[e.to]||[]).push(e.from);});",
|
|
199
|
+
" var active=null;",
|
|
200
|
+
" document.querySelectorAll('.node').forEach(function(g){g.addEventListener('click',function(ev){ev.stopPropagation();var id=g.getAttribute('data-id');if(active===id){clearHi();active=null;return;}active=id;highlight(id);});});",
|
|
201
|
+
" svg.addEventListener('click',function(){clearHi();active=null;});",
|
|
202
|
+
" function clearHi(){svg.classList.remove('focused');document.querySelectorAll('.hi').forEach(function(el){el.classList.remove('hi');});}",
|
|
203
|
+
" function highlight(id){clearHi();svg.classList.add('focused');var keep={};keep[id]=1;(adj[id]||[]).forEach(function(n){keep[n]=1;});document.querySelectorAll('.node').forEach(function(g){if(keep[g.getAttribute('data-id')])g.classList.add('hi');});document.querySelectorAll('.edge').forEach(function(l){if(l.getAttribute('data-from')===id||l.getAttribute('data-to')===id)l.classList.add('hi');});}",
|
|
204
|
+
"})();",
|
|
205
|
+
].join("\n");
|
|
206
|
+
const STYLE = [
|
|
207
|
+
"html,body{margin:0;height:100%;background:#0b1020;font-family:ui-sans-serif,system-ui,sans-serif}",
|
|
208
|
+
"#g{width:100vw;height:100vh;cursor:grab}",
|
|
209
|
+
"#g:active{cursor:grabbing}",
|
|
210
|
+
".edge{stroke:#475569;stroke-width:1}",
|
|
211
|
+
".node circle{stroke:#0b1020;stroke-width:1.5}",
|
|
212
|
+
".node text{fill:#e2e8f0;font-size:11px;pointer-events:none}",
|
|
213
|
+
".node{cursor:pointer}",
|
|
214
|
+
"#g.focused .node{opacity:.18}",
|
|
215
|
+
"#g.focused .edge{opacity:.07}",
|
|
216
|
+
"#g.focused .node.hi{opacity:1}",
|
|
217
|
+
"#g.focused .edge.hi{opacity:1;stroke:#e2e8f0}",
|
|
218
|
+
".legend{position:fixed;top:10px;left:12px;color:#94a3b8;font-size:12px;line-height:1.6}",
|
|
219
|
+
".legend b{color:#e2e8f0}",
|
|
220
|
+
].join("\n");
|
|
221
|
+
/**
|
|
222
|
+
* Render the model as a SELF-CONTAINED, dependency-free, offline interactive HTML
|
|
223
|
+
* node-link diagram. Positions are computed server-side (deterministic). User
|
|
224
|
+
* strings are escaped per sink: SVG `<text>`/`<title>` via `escapeHtml`; the model
|
|
225
|
+
* is inlined in a `<script type="application/json">` block with `<`/`>`/`&`
|
|
226
|
+
* unicode-escaped so a `</script>` inside an entity name cannot break out (the
|
|
227
|
+
* client `JSON.parse`s it back and never `innerHTML`s a user string).
|
|
228
|
+
*/
|
|
229
|
+
export function renderGraphHtml(model) {
|
|
230
|
+
const pos = layoutGraph(model);
|
|
231
|
+
const color = (t) => NODE_COLORS[t] ?? '#64748b';
|
|
232
|
+
const edgeSvg = model.edges
|
|
233
|
+
.map((e) => {
|
|
234
|
+
const a = pos.get(e.from);
|
|
235
|
+
const b = pos.get(e.to);
|
|
236
|
+
if (!a || !b)
|
|
237
|
+
return '';
|
|
238
|
+
return (`<line class="edge" data-from="${e.from}" data-to="${e.to}" ` +
|
|
239
|
+
`x1="${a.x.toFixed(1)}" y1="${a.y.toFixed(1)}" x2="${b.x.toFixed(1)}" y2="${b.y.toFixed(1)}"/>`);
|
|
240
|
+
})
|
|
241
|
+
.join('');
|
|
242
|
+
const nodeSvg = model.nodes
|
|
243
|
+
.map((node) => {
|
|
244
|
+
const p = pos.get(node.id);
|
|
245
|
+
if (!p)
|
|
246
|
+
return '';
|
|
247
|
+
const label = node.name.length > 22 ? node.name.slice(0, 21) + '…' : node.name;
|
|
248
|
+
return (`<g class="node" data-id="${node.id}" transform="translate(${p.x.toFixed(1)},${p.y.toFixed(1)})">` +
|
|
249
|
+
`<title>${escapeHtml(node.type + ': ' + node.name)}</title>` +
|
|
250
|
+
`<circle r="7" fill="${color(node.type)}"/>` +
|
|
251
|
+
`<text x="10" y="4">${escapeHtml(label)}</text>` +
|
|
252
|
+
`</g>`);
|
|
253
|
+
})
|
|
254
|
+
.join('');
|
|
255
|
+
// Safe inline JSON for the client: unicode-escape the HTML-significant chars so
|
|
256
|
+
// the content cannot terminate the <script> block; JSON.parse restores them.
|
|
257
|
+
const dataJson = JSON.stringify(model)
|
|
258
|
+
.replace(/</g, '\\u003c')
|
|
259
|
+
.replace(/>/g, '\\u003e')
|
|
260
|
+
.replace(/&/g, '\\u0026');
|
|
261
|
+
const types = [...new Set(model.nodes.map((nd) => nd.type))];
|
|
262
|
+
const legend = types
|
|
263
|
+
.map((t) => `<span style="color:${color(t)}">●</span> ${escapeHtml(t)}`)
|
|
264
|
+
.join(' ');
|
|
265
|
+
return [
|
|
266
|
+
'<!doctype html>',
|
|
267
|
+
'<html lang="en"><head><meta charset="utf-8">',
|
|
268
|
+
'<meta name="viewport" content="width=device-width, initial-scale=1">',
|
|
269
|
+
'<title>hippo graph</title>',
|
|
270
|
+
'<style>' + STYLE + '</style></head><body>',
|
|
271
|
+
`<div class="legend"><b>hippo graph</b> · ${model.nodes.length} entities · ${model.edges.length} relations` +
|
|
272
|
+
(model.truncated ? ' · <b style="color:#f59e0b">truncated</b>' : '') +
|
|
273
|
+
`<br>${legend}<br><span style="color:#64748b">drag to pan · scroll to zoom · click a node to focus</span></div>`,
|
|
274
|
+
`<svg id="g" viewBox="0 0 ${LAYOUT_W} ${LAYOUT_H}" preserveAspectRatio="xMidYMid meet">`,
|
|
275
|
+
`<g id="edges">${edgeSvg}</g><g id="nodes">${nodeSvg}</g>`,
|
|
276
|
+
'</svg>',
|
|
277
|
+
`<script type="application/json" id="graph-data">${dataJson}</script>`,
|
|
278
|
+
'<script>' + CLIENT_JS + '</script>',
|
|
279
|
+
'</body></html>',
|
|
280
|
+
].join('\n');
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Render the model as a JSON Canvas (jsoncanvas.org) document — `nodes[]` of
|
|
284
|
+
* type `text` positioned by the same deterministic layout, `edges[]` linking
|
|
285
|
+
* them by id. Opens natively in Obsidian. Pure JSON; entity names live in the
|
|
286
|
+
* `text` field (Obsidian renders/sanitizes them).
|
|
287
|
+
*/
|
|
288
|
+
export function renderGraphCanvas(model) {
|
|
289
|
+
const pos = layoutGraph(model, { width: 2400, height: 1600 });
|
|
290
|
+
const nodes = model.nodes.map((node) => {
|
|
291
|
+
const p = pos.get(node.id) ?? { x: 0, y: 0 };
|
|
292
|
+
return {
|
|
293
|
+
id: `n${node.id}`,
|
|
294
|
+
type: 'text',
|
|
295
|
+
x: Math.round(p.x),
|
|
296
|
+
y: Math.round(p.y),
|
|
297
|
+
width: 240,
|
|
298
|
+
height: 60,
|
|
299
|
+
text: `**${node.type}**\n${node.name}`,
|
|
300
|
+
};
|
|
301
|
+
});
|
|
302
|
+
const edges = model.edges.map((e, i) => ({
|
|
303
|
+
id: `e${i}`,
|
|
304
|
+
fromNode: `n${e.from}`,
|
|
305
|
+
toNode: `n${e.to}`,
|
|
306
|
+
label: e.relType,
|
|
307
|
+
}));
|
|
308
|
+
return JSON.stringify({ nodes, edges }, null, 2);
|
|
309
|
+
}
|
|
310
|
+
//# sourceMappingURL=graph-view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph-view.js","sourceRoot":"","sources":["../src/graph-view.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EACjB,aAAa,EACb,qBAAqB,EACrB,kBAAkB,EAClB,qBAAqB,GAKtB,MAAM,YAAY,CAAC;AAoBpB,qFAAqF;AACrF,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAEtC;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAC7B,SAAiB,EACjB,QAAgB,EAChB,OAA4C,EAAE;IAE9C,MAAM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AO,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AACnD,CAAC"}
|
package/dist/graph.d.ts
CHANGED
|
@@ -17,6 +17,11 @@
|
|
|
17
17
|
* enqueue-hook + E3.1 entity extraction will call. No operator surface (CLI/HTTP/SDK)
|
|
18
18
|
* until E3.2 multi-hop recall.
|
|
19
19
|
*/
|
|
20
|
+
import { openHippoDb } from './db.js';
|
|
21
|
+
/** The DB connection handle `openHippoDb` returns. Threaded (optionally) through
|
|
22
|
+
* the graph writers so `extractGraph` can run clear + all inserts in ONE
|
|
23
|
+
* transaction — see `runGraphRebuildTransaction`. */
|
|
24
|
+
export type GraphTxDb = ReturnType<typeof openHippoDb>;
|
|
20
25
|
export type EntityType = 'person' | 'project' | 'customer' | 'system' | 'policy' | 'decision';
|
|
21
26
|
export type RelationType = 'owns' | 'supersedes' | 'depends-on' | 'blocked-by' | 'references';
|
|
22
27
|
export type GraphQueueStatus = 'pending' | 'processed' | 'skipped';
|
|
@@ -72,21 +77,28 @@ export interface InsertRelationOpts {
|
|
|
72
77
|
* Insert a graph entity extracted from a consolidated memory. Throws if the source
|
|
73
78
|
* memory is missing / cross-tenant / raw (the DB trigger is the backstop).
|
|
74
79
|
*/
|
|
75
|
-
export declare function insertEntity(hippoRoot: string, tenantId: string, opts: InsertEntityOpts): Entity;
|
|
80
|
+
export declare function insertEntity(hippoRoot: string, tenantId: string, opts: InsertEntityOpts, txDb?: GraphTxDb): Entity;
|
|
76
81
|
/**
|
|
77
82
|
* Insert a graph relation between two entities, sourced from a consolidated memory.
|
|
78
83
|
* Both entities must exist in the same tenant; the source memory must be consolidated.
|
|
79
84
|
*/
|
|
80
|
-
export declare function insertRelation(hippoRoot: string, tenantId: string, opts: InsertRelationOpts): Relation;
|
|
85
|
+
export declare function insertRelation(hippoRoot: string, tenantId: string, opts: InsertRelationOpts, txDb?: GraphTxDb): Relation;
|
|
81
86
|
export declare function loadEntityById(hippoRoot: string, tenantId: string, id: number): Entity | null;
|
|
87
|
+
/** Entities with an exact `name` (read), bounded by `limit` in SQL with a
|
|
88
|
+
* deterministic order. Lets the graph-view focus query find the `--entity NAME`
|
|
89
|
+
* entity DIRECTLY (not from a globally-capped list) WITHOUT materializing every
|
|
90
|
+
* same-name row when a name maps to many entities. */
|
|
91
|
+
export declare function loadEntitiesByName(hippoRoot: string, tenantId: string, name: string, opts?: {
|
|
92
|
+
limit?: number;
|
|
93
|
+
}, txDb?: GraphTxDb): Entity[];
|
|
82
94
|
export declare function loadEntities(hippoRoot: string, tenantId: string, opts?: {
|
|
83
95
|
entityType?: EntityType;
|
|
84
96
|
limit?: number;
|
|
85
|
-
}): Entity[];
|
|
97
|
+
}, txDb?: GraphTxDb): Entity[];
|
|
86
98
|
export declare function loadRelations(hippoRoot: string, tenantId: string, opts?: {
|
|
87
99
|
fromEntityId?: number;
|
|
88
100
|
limit?: number;
|
|
89
|
-
}): Relation[];
|
|
101
|
+
}, txDb?: GraphTxDb): Relation[];
|
|
90
102
|
/**
|
|
91
103
|
* Map consolidated source memory ids -> their graph entities. The SEED step of E3.2
|
|
92
104
|
* multi-hop recall (recall result memory ids -> entities to traverse from). Tenant-
|
|
@@ -97,7 +109,7 @@ export declare function loadEntitiesByMemoryId(hippoRoot: string, tenantId: stri
|
|
|
97
109
|
* Load entities by their primary ids. Resolves the entity rows reached during the BFS
|
|
98
110
|
* (whose `memory_id` maps back to a recall result). Tenant-scoped, read-only.
|
|
99
111
|
*/
|
|
100
|
-
export declare function loadEntitiesByIds(hippoRoot: string, tenantId: string, ids: number[]): Entity[];
|
|
112
|
+
export declare function loadEntitiesByIds(hippoRoot: string, tenantId: string, ids: number[], txDb?: GraphTxDb): Entity[];
|
|
101
113
|
/**
|
|
102
114
|
* All relations touching ANY of `entityIds` in EITHER direction (from OR to) — the
|
|
103
115
|
* per-hop neighbour query for E3.2 multi-hop traversal. ONE query for the whole frontier
|
|
@@ -107,7 +119,26 @@ export declare function loadEntitiesByIds(hippoRoot: string, tenantId: string, i
|
|
|
107
119
|
*/
|
|
108
120
|
export declare function loadNeighborRelations(hippoRoot: string, tenantId: string, entityIds: number[], opts?: {
|
|
109
121
|
limit?: number;
|
|
110
|
-
}): Relation[];
|
|
122
|
+
}, txDb?: GraphTxDb): Relation[];
|
|
123
|
+
/**
|
|
124
|
+
* Relations with BOTH endpoints in `entityIds` (edges AMONG the set, not merely
|
|
125
|
+
* touching it). Read. Used by the graph-view focus subgraph so the displayed
|
|
126
|
+
* edges are exactly the intra-union edges: the `LIMIT` only caps genuinely-many
|
|
127
|
+
* intra-union edges — no out-of-union row can evict a valid in-set edge. The
|
|
128
|
+
* caller bounds `entityIds` (<= the view limit), so a single query is safe.
|
|
129
|
+
*/
|
|
130
|
+
export declare function loadRelationsAmong(hippoRoot: string, tenantId: string, entityIds: number[], opts?: {
|
|
131
|
+
limit?: number;
|
|
132
|
+
}, txDb?: GraphTxDb): Relation[];
|
|
133
|
+
/**
|
|
134
|
+
* Run `fn` inside ONE read transaction (a single WAL snapshot) so every graph read
|
|
135
|
+
* it performs — pass the supplied `txDb` to the `load*` functions — sees a consistent
|
|
136
|
+
* view, even if a `graph extract` / sleep-drain rebuild commits concurrently between
|
|
137
|
+
* reads (the rebuild clears + reinserts entities, so separate reads could otherwise
|
|
138
|
+
* mix old entity ids with new relation ids). Reads only; the connection is opened
|
|
139
|
+
* once and closed after.
|
|
140
|
+
*/
|
|
141
|
+
export declare function withGraphReadSnapshot<T>(hippoRoot: string, fn: (txDb: GraphTxDb) => T): T;
|
|
111
142
|
/**
|
|
112
143
|
* Enqueue a consolidated memory for later graph extraction. Rejects a raw / missing /
|
|
113
144
|
* cross-tenant memory (the DB trigger is the backstop). The producer hook in
|
|
@@ -133,5 +164,43 @@ export declare function markExtractionProcessed(hippoRoot: string, tenantId: str
|
|
|
133
164
|
* writer), so the E3.3 CI lint permits this `DELETE FROM entities`. Does NOT touch
|
|
134
165
|
* graph_extraction_queue (the enqueue-hook's domain).
|
|
135
166
|
*/
|
|
136
|
-
export declare function clearGraph(hippoRoot: string, tenantId: string): number;
|
|
167
|
+
export declare function clearGraph(hippoRoot: string, tenantId: string, txDb?: GraphTxDb): number;
|
|
168
|
+
/**
|
|
169
|
+
* Run a full graph rebuild for one tenant inside a single transaction. `clearGraph`
|
|
170
|
+
* + every `insertEntity`/`insertRelation` call made inside `fn` (passing the supplied
|
|
171
|
+
* `txDb`) share the one connection and its `BEGIN IMMEDIATE` write lock, so the
|
|
172
|
+
* rebuild is ATOMIC: two concurrent rebuilds serialize on the write lock (the second
|
|
173
|
+
* waits, then re-derives cleanly) instead of interleaving into duplicate rows, and a
|
|
174
|
+
* throw mid-rebuild ROLLS BACK the clear (no bricked/empty graph). The sole sanctioned
|
|
175
|
+
* place to wrap graph writes in a transaction.
|
|
176
|
+
*/
|
|
177
|
+
export declare function runGraphRebuildTransaction<T>(hippoRoot: string, tenantId: string, fn: (txDb: GraphTxDb) => T): T;
|
|
178
|
+
/**
|
|
179
|
+
* Fail-soft producer hook: mark a tenant dirty for graph re-extraction by
|
|
180
|
+
* enqueuing its consolidated mirror memory. NEVER throws into the caller — a
|
|
181
|
+
* graph-dirty signal failing must not abort a core E2 write. Graph staleness is
|
|
182
|
+
* recoverable (next sleep / manual `graph extract`); a broken `hippo decide` is
|
|
183
|
+
* not. Called POST-COMMIT from the E2 graph-source save/close mutations of
|
|
184
|
+
* decision, policy, customer_note and project_brief. A null memoryId (a
|
|
185
|
+
* forgotten mirror) is a no-op.
|
|
186
|
+
*/
|
|
187
|
+
export declare function markGraphDirty(hippoRoot: string, tenantId: string, memoryId: string | null): void;
|
|
188
|
+
/**
|
|
189
|
+
* The dirty tenants awaiting graph re-extraction, each with the MAX pending
|
|
190
|
+
* queue id at read time (a watermark). The sleep drain rebuilds each tenant's
|
|
191
|
+
* graph, then marks only items at or below the watermark processed, so items
|
|
192
|
+
* enqueued DURING the rebuild stay pending for the next sleep (no lost-update
|
|
193
|
+
* race). Host-wide read (the queue is per-tenant but sleep is cross-tenant).
|
|
194
|
+
*/
|
|
195
|
+
export declare function loadPendingExtractionTenants(hippoRoot: string): {
|
|
196
|
+
tenantId: string;
|
|
197
|
+
maxPendingId: number;
|
|
198
|
+
}[];
|
|
199
|
+
/**
|
|
200
|
+
* Mark every pending queue item for a tenant with `id <= maxId` processed, in
|
|
201
|
+
* one UPDATE. Status/processed_at only, so the consolidated-source guard trigger
|
|
202
|
+
* is not involved (same as markExtractionProcessed). Returns the count marked.
|
|
203
|
+
* The `<= maxId` watermark excludes items enqueued after the drain snapshot.
|
|
204
|
+
*/
|
|
205
|
+
export declare function markPendingProcessedUpTo(hippoRoot: string, tenantId: string, maxId: number): number;
|
|
137
206
|
//# sourceMappingURL=graph.d.ts.map
|
package/dist/graph.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../src/graph.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;
|
|
1
|
+
{"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../src/graph.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,WAAW,EAAgB,MAAM,SAAS,CAAC;AAGpD;;sDAEsD;AACtD,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAMvD,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,SAAS,GAAG,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAAC;AAC9F,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,YAAY,GAAG,YAAY,GAAG,YAAY,GAAG,YAAY,CAAC;AAC9F,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,CAAC;AACnE,mFAAmF;AACnF,MAAM,MAAM,UAAU,GAAG,WAAW,GAAG,YAAY,CAAC;AAEpD,eAAO,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