@andespindola/brainlink 0.1.0-beta.126 → 0.1.0-beta.127

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/README.md CHANGED
@@ -88,7 +88,7 @@ Legacy `.jsonl.gz` packs are upgraded to `.blpk` automatically on first search/c
88
88
  - Large graph layout API automatically uses compact payload encoding with link-coverage-aware edge selection to reduce initial client load without hiding major relationships.
89
89
  - Large-segment layout spacing now grows logarithmically to keep initial visual density consistent between medium and very large vaults (for example, ~1k vs ~50k notes).
90
90
  - Graph coordinates are visually compacted across graph sizes so reset starts from a stable fitted scene and zoom-in progressively reveals local detail.
91
- - Zoomed-out graph LOD renders hierarchy groups as normal mesh graph nodes and expands a group only after it is framed in the viewport, progressively hiding sibling groups in micro view.
91
+ - Zoomed-out graph LOD renders hierarchy groups as normal mesh graph nodes and expands a group from the focused node's current viewport position only after it is framed, progressively hiding sibling groups in micro view.
92
92
  - Graph reset fits the full graph scene instead of starting in a separate macro overview mode.
93
93
  - Graph filtering runs in a dedicated browser worker to keep the UI thread responsive during heavy datasets.
94
94
  - Edge rendering budgets adapt to zoom level to prevent frame spikes on large graph panoramas.
@@ -606,7 +606,7 @@ The graph UI shows:
606
606
  - graph rendering safeguards (batched canvas drawing across graph sizes, edge draw caps, lower redraw rate, zoom-aware interaction)
607
607
  - adaptive CPU safeguards for large graphs: idle frame pacing, throttled background physics updates and cached viewport dimensions to reduce redraw/layout overhead while preserving interaction responsiveness
608
608
  - WebGL node and edge acceleration when supported, falling back to Canvas 2D without changing graph behavior
609
- - large graph LOD keeps a recursive graph-of-graphs mesh model: zoom-out shows one projected graph level capped at 1000 group nodes, zoom-in expands the framed node into its own radial child graph capped at 1000 nodes, micro view renders only that focused subgraph with dense-node label suppression in a local frame anchored to the group node, and zoom-out restores sibling groups
609
+ - large graph LOD keeps a recursive graph-of-graphs mesh model: zoom-out shows one projected graph level capped at 1000 group nodes, zoom-in expands the framed node from its current viewport position into its own radial child graph capped at 1000 nodes, micro view renders only that focused subgraph with dense-node label suppression in a local frame anchored to the rendered group node, and zoom-out restores sibling groups
610
610
 
611
611
  The server indexes before starting by default. Use `--no-index` to skip that step:
612
612
 
@@ -1281,9 +1281,9 @@ const arrangeGraphLevelNodes = (nodes, radiusForNode = () => 1) => {
1281
1281
  return arranged
1282
1282
  }
1283
1283
 
1284
- const arrangeChildGraphNodes = (nodes, group) => {
1284
+ const arrangeChildGraphNodes = (nodes, group, origin = group) => {
1285
1285
  if (nodes.length <= 1) {
1286
- return nodes.map(node => ({ ...node, x: group.x, y: group.y }))
1286
+ return nodes.map(node => ({ ...node, x: origin.x, y: origin.y }))
1287
1287
  }
1288
1288
 
1289
1289
  const targetRadius = childGraphRenderRadius(group)
@@ -1303,7 +1303,7 @@ const arrangeChildGraphNodes = (nodes, group) => {
1303
1303
  })
1304
1304
  const goldenAngle = Math.PI * (3 - Math.sqrt(5))
1305
1305
  const arranged = centerNode
1306
- ? [{ ...centerNode, x: group.x, y: group.y }]
1306
+ ? [{ ...centerNode, x: origin.x, y: origin.y }]
1307
1307
  : []
1308
1308
 
1309
1309
  outerNodes.forEach((node, index) => {
@@ -1311,19 +1311,19 @@ const arrangeChildGraphNodes = (nodes, group) => {
1311
1311
  const angle = index * goldenAngle
1312
1312
  arranged.push({
1313
1313
  ...node,
1314
- x: group.x + Math.cos(angle) * ringRadius,
1315
- y: group.y + Math.sin(angle) * ringRadius
1314
+ x: origin.x + Math.cos(angle) * ringRadius,
1315
+ y: origin.y + Math.sin(angle) * ringRadius
1316
1316
  })
1317
1317
  })
1318
1318
 
1319
1319
  return arranged
1320
1320
  }
1321
1321
 
1322
- const interpolateNodeFromGroup = (node, group, progress) => {
1322
+ const interpolateNodeFromGroup = (node, origin, progress) => {
1323
1323
  return {
1324
1324
  ...node,
1325
- x: group.x + (node.x - group.x) * progress,
1326
- y: group.y + (node.y - group.y) * progress,
1325
+ x: origin.x + (node.x - origin.x) * progress,
1326
+ y: origin.y + (node.y - origin.y) * progress,
1327
1327
  vx: 0,
1328
1328
  vy: 0
1329
1329
  }
@@ -1472,10 +1472,11 @@ const computeHierarchyRenderVisibility = (viewport) => {
1472
1472
  const focusIds = new Set(focus.nodeIds)
1473
1473
  const rawChildNodes = state.visibleNodes.filter(node => focusIds.has(node.id))
1474
1474
  const childLimit = Math.max(90, Math.min(renderNodeBudget, Math.floor(renderNodeBudget * progress)))
1475
+ const focusRenderNode = groupNodes.find(node => node.groupId === focus.id) ?? createGroupRenderNode(focus)
1475
1476
  const childNodes = selectStableSampleNodes(
1476
- arrangeChildGraphNodes(rawChildNodes, focus),
1477
+ arrangeChildGraphNodes(rawChildNodes, focus, focusRenderNode),
1477
1478
  childLimit
1478
- ).map(node => interpolateNodeFromGroup(node, focus, progress))
1479
+ ).map(node => interpolateNodeFromGroup(node, focusRenderNode, progress))
1479
1480
  const childIds = new Set(childNodes.map(node => node.id))
1480
1481
  const childById = new Map(childNodes.map(node => [node.id, node]))
1481
1482
  const isMicroView = progress >= 0.72
@@ -607,7 +607,7 @@ Without `--vault`, the graph UI serves `$HOME/.brainlink/vault`.
607
607
 
608
608
  The frontend includes an agent selector that shows only the agent id. Selecting an agent calls the same read APIs with `agent=<agent-id>` and renders that namespace instead of merging every agent into one graph.
609
609
 
610
- Graph navigation controls include zoom in, zoom out, fit visible nodes and reset-to-fit-all nodes. Mouse wheel zoom (including `cmd+scroll` and `ctrl+scroll`) is anchored to the cursor. Keyboard shortcuts are `+` (zoom in), `-` (zoom out) and `0` (reset fit). Double-click on canvas zooms in at cursor position. Totals for notes, links and tags stay visible as floating metrics under the Brainlink title, and node details open on click in a modal (tags, outgoing links, backlinks and Markdown content). Vaults above 1000 notes also expose stable hierarchy mesh groups of up to 1000 direct nodes, with recursive parent groups when a level exceeds 1000 groups; zoom-out renders the macro level as a projected mesh graph of group nodes, zoom-in expands a group only after it is framed in the viewport, and micro view renders only the focused radial child graph with dense-node label suppression in a local frame anchored to the group node until zoom-out restores sibling groups.
610
+ Graph navigation controls include zoom in, zoom out, fit visible nodes and reset-to-fit-all nodes. Mouse wheel zoom (including `cmd+scroll` and `ctrl+scroll`) is anchored to the cursor. Keyboard shortcuts are `+` (zoom in), `-` (zoom out) and `0` (reset fit). Double-click on canvas zooms in at cursor position. Totals for notes, links and tags stay visible as floating metrics under the Brainlink title, and node details open on click in a modal (tags, outgoing links, backlinks and Markdown content). Vaults above 1000 notes also expose stable hierarchy mesh groups of up to 1000 direct nodes, with recursive parent groups when a level exceeds 1000 groups; zoom-out renders the macro level as a projected mesh graph of group nodes, zoom-in expands a group from the focused node's current viewport position only after it is framed, and micro view renders only the focused radial child graph with dense-node label suppression in a local frame anchored to the rendered group node until zoom-out restores sibling groups.
611
611
  During graph filtering, Brainlink keeps hub context nodes visible (`Memory Hub`/`MOC`/high-degree fallback) so filtered views still show relationship anchors.
612
612
 
613
613
  The command reindexes by default, then serves:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@andespindola/brainlink",
3
- "version": "0.1.0-beta.126",
3
+ "version": "0.1.0-beta.127",
4
4
  "description": "Local-first knowledge memory for agents with Markdown, backlinks, indexing and context retrieval.",
5
5
  "type": "module",
6
6
  "license": "MIT",