code-kg 0.1.4 → 0.1.5

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/server/ui.js CHANGED
@@ -799,12 +799,14 @@ function renderUiHtml() {
799
799
  return false;
800
800
  }
801
801
 
802
- const memoryBuffer = wasm.memory && wasm.memory.buffer ? wasm.memory.buffer : null;
802
+ let memoryBuffer = wasm.memory && wasm.memory.buffer ? wasm.memory.buffer : null;
803
803
  if (!memoryBuffer) {
804
804
  return false;
805
805
  }
806
806
 
807
- new Uint32Array(memoryBuffer, edgePtr, edgeArray.length).set(edgeArray);
807
+ if (edgeArray.length > 0) {
808
+ new Uint32Array(memoryBuffer, edgePtr, edgeArray.length).set(edgeArray);
809
+ }
808
810
  const seed = stableHash(seedText || state.view || 'codekg');
809
811
  const status = wasm.layout_graph(
810
812
  state.graphData.nodes.length,
@@ -819,6 +821,11 @@ function renderUiHtml() {
819
821
  return false;
820
822
  }
821
823
 
824
+ // Rust allocations inside layout_graph can grow memory, so always re-read the buffer.
825
+ memoryBuffer = wasm.memory && wasm.memory.buffer ? wasm.memory.buffer : null;
826
+ if (!memoryBuffer) {
827
+ return false;
828
+ }
822
829
  const positions = new Float32Array(memoryBuffer, outPtr, outCount);
823
830
  for (let index = 0; index < state.graphData.nodes.length; index += 1) {
824
831
  const node = state.graphData.nodes[index];
@@ -1 +1 @@
1
- {"version":3,"file":"ui.js","sourceRoot":"","sources":["../../src/server/ui.ts"],"names":[],"mappings":";;AAEA,oCA4jDC;AA9jDD,2DAAmE;AAEnE,SAAgB,YAAY;IAC1B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAygC3D,CAAC;AACT,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "code-kg",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Local code knowledge graph CLI with interactive visualization and deterministic analysis APIs",
5
5
  "license": "MIT",
6
6
  "keywords": [