@andespindola/brainlink 0.1.0-beta.88 → 0.1.0-beta.89

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
@@ -602,7 +602,7 @@ The graph UI shows:
602
602
  - WebGL node and edge acceleration when supported, falling back to Canvas 2D without changing graph behavior
603
603
  - compact macro-to-micro density progression so reset keeps the graph mass oriented and zoom-in separates local neighborhoods progressively
604
604
  - graph camera treats hub-centered navigation as structural only when the hub is dominant; diffuse stress graphs reset and zoom around the full graph mass
605
- - graph LOD progression: graphs up to 1000 notes render directly; larger graphs use a compact memory-hub-centered mesh of connected 1000-note points, zoom-in spreads only focused clusters into 250-note and 60-note subgraphs with aggregated real links, then progressively raises the focused node budget so local areas keep nearby notes and links visible
605
+ - graph LOD progression: graphs up to 1000 notes render directly; larger graphs use a compact memory-hub-centered mesh of connected 1000-note points, zoom-in spreads only focused clusters into 250-note and 60-note subgraphs with aggregated real links, keeps parent points during expansion to avoid visual jumps, then progressively raises the focused node budget so local areas keep nearby notes and links visible
606
606
 
607
607
  The server indexes before starting by default. Use `--no-index` to skip that step:
608
608
 
@@ -38,9 +38,9 @@ const meshEdgeMaxBudget = 1400
38
38
  const layeredCoreScaleThreshold = 0.55
39
39
  const dragNeighborhoodMaxAffected = 180
40
40
  const dragSettleRounds = 3
41
- const wheelZoomExponent = 0.0018
42
- const wheelZoomExponentCap = 0.09
43
- const wheelZoomModifierBoost = 1.22
41
+ const wheelZoomExponent = 0.0009
42
+ const wheelZoomExponentCap = 0.035
43
+ const wheelZoomModifierBoost = 1.08
44
44
  const state = {
45
45
  graph: { nodes: [], edges: [] },
46
46
  nodes: [],
@@ -885,6 +885,8 @@ const smoothStep = value => {
885
885
  const zoomProgress = (scale, start, end) =>
886
886
  smoothStep((scale - start) / Math.max(end - start, 0.0001))
887
887
 
888
+ const shouldReplaceParentCluster = spread => spread >= 0.96
889
+
888
890
  const expandFocusedClusters = (parentClusters, childSize, spread, viewport) => {
889
891
  const focusPoint = ecosystemFocusPoint()
890
892
  const expandedParentIds = new Set(nearestEcosystemParentIds(
@@ -937,7 +939,12 @@ const selectHierarchicalEcosystemClusters = viewport => {
937
939
  return [...hubClusters, ...visibleBaseClusters]
938
940
  }
939
941
 
940
- const remainingBaseClusters = visibleBaseClusters.filter(cluster => !midExpansion.expandedParentIds.has(cluster.id))
942
+ const midSpread = state.transform.scale <= ecosystemSubgraphScaleThreshold
943
+ ? zoomProgress(state.transform.scale, ecosystemMicroScaleThreshold, ecosystemSubgraphScaleThreshold)
944
+ : 1
945
+ const remainingBaseClusters = shouldReplaceParentCluster(midSpread)
946
+ ? visibleBaseClusters.filter(cluster => !midExpansion.expandedParentIds.has(cluster.id))
947
+ : visibleBaseClusters
941
948
  if (state.transform.scale <= ecosystemSubgraphScaleThreshold) {
942
949
  return [
943
950
  ...hubClusters,
@@ -960,10 +967,14 @@ const selectHierarchicalEcosystemClusters = viewport => {
960
967
  ]
961
968
  }
962
969
 
970
+ const microSpread = zoomProgress(state.transform.scale, ecosystemSubgraphScaleThreshold, ecosystemClusterScaleThreshold)
971
+ const visibleMidClusters = shouldReplaceParentCluster(microSpread)
972
+ ? midExpansion.childClusters.filter(cluster => !microExpansion.expandedParentIds.has(cluster.id))
973
+ : midExpansion.childClusters
963
974
  return [
964
975
  ...hubClusters,
965
976
  ...remainingBaseClusters,
966
- ...midExpansion.childClusters.filter(cluster => !microExpansion.expandedParentIds.has(cluster.id)),
977
+ ...visibleMidClusters,
967
978
  ...microExpansion.childClusters
968
979
  ]
969
980
  }
@@ -3152,11 +3163,11 @@ const bindEvents = () => {
3152
3163
  })
3153
3164
  elements.zoomIn.addEventListener('click', () => {
3154
3165
  const rect = canvas.getBoundingClientRect()
3155
- zoomAtPoint(Math.max(rect.width, 320) / 2, Math.max(rect.height, 320) / 2, 1.14, 'button')
3166
+ zoomAtPoint(Math.max(rect.width, 320) / 2, Math.max(rect.height, 320) / 2, 1.055, 'button')
3156
3167
  })
3157
3168
  elements.zoomOut.addEventListener('click', () => {
3158
3169
  const rect = canvas.getBoundingClientRect()
3159
- zoomAtPoint(Math.max(rect.width, 320) / 2, Math.max(rect.height, 320) / 2, 0.88, 'button')
3170
+ zoomAtPoint(Math.max(rect.width, 320) / 2, Math.max(rect.height, 320) / 2, 0.948, 'button')
3160
3171
  })
3161
3172
  if (elements.fit) {
3162
3173
  elements.fit.addEventListener('click', () => {
@@ -3187,7 +3198,7 @@ const bindEvents = () => {
3187
3198
  const rect = canvas.getBoundingClientRect()
3188
3199
  const cursorX = event.clientX - rect.left
3189
3200
  const cursorY = event.clientY - rect.top
3190
- zoomAtPoint(cursorX, cursorY, 1.12)
3201
+ zoomAtPoint(cursorX, cursorY, 1.055)
3191
3202
  })
3192
3203
  canvas.addEventListener('pointerdown', event => {
3193
3204
  const point = worldPoint(event)
@@ -3261,14 +3272,14 @@ const bindEvents = () => {
3261
3272
  if (event.key === '+' || event.key === '=') {
3262
3273
  event.preventDefault()
3263
3274
  const rect = canvas.getBoundingClientRect()
3264
- zoomAtPoint(Math.max(rect.width, 320) / 2, Math.max(rect.height, 320) / 2, 1.12)
3275
+ zoomAtPoint(Math.max(rect.width, 320) / 2, Math.max(rect.height, 320) / 2, 1.05)
3265
3276
  return
3266
3277
  }
3267
3278
 
3268
3279
  if (event.key === '-' || event.key === '_') {
3269
3280
  event.preventDefault()
3270
3281
  const rect = canvas.getBoundingClientRect()
3271
- zoomAtPoint(Math.max(rect.width, 320) / 2, Math.max(rect.height, 320) / 2, 0.89)
3282
+ zoomAtPoint(Math.max(rect.width, 320) / 2, Math.max(rect.height, 320) / 2, 0.952)
3272
3283
  return
3273
3284
  }
3274
3285
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@andespindola/brainlink",
3
- "version": "0.1.0-beta.88",
3
+ "version": "0.1.0-beta.89",
4
4
  "description": "Local-first knowledge memory for agents with Markdown, backlinks, indexing and context retrieval.",
5
5
  "type": "module",
6
6
  "license": "MIT",