@andespindola/brainlink 0.1.0-beta.34 → 0.1.0-beta.35

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/CHANGELOG.md CHANGED
@@ -26,6 +26,7 @@
26
26
  - Added compressed-space pack prefiltering (token bloom index) before `.blpk` decryption and scan.
27
27
  - Improved graph UI auto-fit and viewport recovery so loaded nodes are re-centered when zoom/pan drifts to empty canvas.
28
28
  - Added cross-platform native desktop GUI auto-open for `blink server` (macOS Swift/WebKit, Windows PowerShell WinForms, Linux Python GTK/WebKit2), with app-window/browser fallback.
29
+ - Changed Linux default UI launch to app-window/browser for lighter startup; Linux native GUI is now opt-in via `BRAINLINK_LINUX_NATIVE_GUI=1`.
29
30
 
30
31
  ## 0.1.0-beta.3
31
32
 
package/README.md CHANGED
@@ -556,8 +556,9 @@ By default, the server uses `$HOME/.brainlink/vault`. Pass `--vault ./vault` onl
556
556
  By default, `blink server` tries to open the graph in a native desktop GUI window:
557
557
  - macOS: Swift + WebKit
558
558
  - Windows: PowerShell WinForms WebBrowser
559
- - Linux: Python GTK + WebKit2 (requires `python3` + `gi` + `WebKit2`)
559
+ - Linux: optional Python GTK + WebKit2 (requires `python3` + `gi` + `WebKit2`)
560
560
 
561
+ On Linux, native GUI is disabled by default for better startup performance. Enable it with `BRAINLINK_LINUX_NATIVE_GUI=1`.
561
562
  If native GUI launch is unavailable on your system, it falls back to dedicated app-window mode and then to the default browser.
562
563
  Use `--no-open` to keep it headless.
563
564
 
@@ -850,6 +851,7 @@ blink server --vault ./vault --watch --no-open
850
851
 
851
852
  Starts the local read-only graph UI and HTTP API.
852
853
  By default, it tries to open a native desktop GUI window for the graph URL.
854
+ On Linux, native GUI is disabled by default; enable it with `BRAINLINK_LINUX_NATIVE_GUI=1`.
853
855
  If native GUI launch is unavailable, it falls back to dedicated app-window mode and then browser open.
854
856
  Use `--no-open` to skip that behavior.
855
857
 
@@ -5,6 +5,8 @@ const largeGraphEdgeRenderLimit = 16000
5
5
  const renderNodeBudget = 1800
6
6
  const minNodePixelRadius = 1.8
7
7
  const viewportPaddingPx = 280
8
+ const worldCoordinateLimit = 5_000_000
9
+ const transformCoordinateLimit = 20_000_000
8
10
  const state = {
9
11
  graph: { nodes: [], edges: [] },
10
12
  nodes: [],
@@ -133,6 +135,7 @@ const edgeWeight = edge => Number.isFinite(edge.weight) ? Math.max(1, edge.weigh
133
135
 
134
136
  const clampScale = value => Math.max(zoomRange.min, Math.min(zoomRange.max, value))
135
137
  const isFiniteNumber = value => Number.isFinite(value)
138
+ const isReasonableCoordinate = value => isFiniteNumber(value) && Math.abs(value) <= worldCoordinateLimit
136
139
 
137
140
  const graphBounds = nodes => {
138
141
  if (nodes.length === 0) return null
@@ -521,13 +524,15 @@ const hasValidTransform = () =>
521
524
  isFiniteNumber(state.transform.x) &&
522
525
  isFiniteNumber(state.transform.y) &&
523
526
  isFiniteNumber(state.transform.scale) &&
527
+ Math.abs(state.transform.x) <= transformCoordinateLimit &&
528
+ Math.abs(state.transform.y) <= transformCoordinateLimit &&
524
529
  state.transform.scale > 0
525
530
 
526
531
  const sanitizeNodePosition = node => {
527
- if (!isFiniteNumber(node.x)) node.x = 0
528
- if (!isFiniteNumber(node.y)) node.y = 0
529
- if (!isFiniteNumber(node.vx)) node.vx = 0
530
- if (!isFiniteNumber(node.vy)) node.vy = 0
532
+ if (!isReasonableCoordinate(node.x)) node.x = 0
533
+ if (!isReasonableCoordinate(node.y)) node.y = 0
534
+ if (!isFiniteNumber(node.vx) || Math.abs(node.vx) > worldCoordinateLimit) node.vx = 0
535
+ if (!isFiniteNumber(node.vy) || Math.abs(node.vy) > worldCoordinateLimit) node.vy = 0
531
536
  }
532
537
 
533
538
  const sanitizeGraphState = () => {
@@ -159,6 +159,7 @@ const commandExists = (command) => {
159
159
  return false;
160
160
  }
161
161
  };
162
+ const envFlagEnabled = (name) => process.env[name] === '1' || process.env[name] === 'true';
162
163
  const resolveSwiftExecutable = () => {
163
164
  const directSwift = '/usr/bin/swift';
164
165
  if (existsSync(directSwift)) {
@@ -265,7 +266,10 @@ const openUrlInUi = (url) => {
265
266
  if (openDisabled) {
266
267
  return { opened: false, mode: 'none' };
267
268
  }
268
- if (openGraphInNativeGui(url)) {
269
+ const currentPlatform = platform();
270
+ const nativeGuiEnabled = !envFlagEnabled('BRAINLINK_NO_NATIVE_GUI') &&
271
+ (currentPlatform !== 'linux' || envFlagEnabled('BRAINLINK_LINUX_NATIVE_GUI') || envFlagEnabled('BRAINLINK_FORCE_NATIVE_GUI'));
272
+ if (nativeGuiEnabled && openGraphInNativeGui(url)) {
269
273
  return { opened: true, mode: 'native-gui' };
270
274
  }
271
275
  if (openGraphInAppWindow(url)) {
@@ -543,8 +543,9 @@ This starts a local frontend for inspecting the knowledge graph.
543
543
  By default it tries to open the graph in a native desktop GUI window:
544
544
  - macOS: Swift + WebKit
545
545
  - Windows: PowerShell WinForms WebBrowser
546
- - Linux: Python GTK + WebKit2 (requires `python3` + `gi` + `WebKit2`)
546
+ - Linux: optional Python GTK + WebKit2 (requires `python3` + `gi` + `WebKit2`)
547
547
 
548
+ On Linux, native GUI is disabled by default for better startup performance. Enable it with `BRAINLINK_LINUX_NATIVE_GUI=1`.
548
549
  If native GUI launch is unavailable, it falls back to dedicated app-window mode and then to the default browser.
549
550
  Use `--no-open` to keep the server headless.
550
551
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@andespindola/brainlink",
3
- "version": "0.1.0-beta.34",
3
+ "version": "0.1.0-beta.35",
4
4
  "description": "Local-first knowledge memory for agents with Markdown, backlinks, indexing and context retrieval.",
5
5
  "type": "module",
6
6
  "license": "MIT",