trellis 1.0.1 → 1.0.4

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
@@ -4,43 +4,6 @@ Trellis is a **semantic operating system for knowledge work** that treats your w
4
4
 
5
5
  The kernel provides a unified interface for data ingestion, querying (EQL-S, Datalog, Natural Language), and automated reasoning, all backed by an append-only operation log for full reproducibility and sync.
6
6
 
7
- ## 🎨 Interactive TUI (New!)
8
-
9
- TQL now includes a beautiful terminal user interface built with [Ratatui](https://github.com/ratatui/ratatui)!
10
-
11
- ### Interactive Mode
12
- ```bash
13
- # Build the TUI
14
- just tui-build
15
-
16
- # Launch interactive graph visualizer
17
- just tui-graph
18
-
19
- # Launch query builder
20
- just tui-query
21
-
22
- # Launch full dashboard
23
- just tui-dashboard
24
- ```
25
-
26
- ### Programmatic IPC Mode
27
- ```typescript
28
- import { TQLTUIBridge } from './src/cli/tui-bridge.js';
29
-
30
- const tui = new TQLTUIBridge();
31
- await tui.launchGraphViewer(graph); // Headless JSON-RPC mode
32
- await tui.updateNodeState('nodeId', 'running');
33
- ```
34
-
35
- **Features:**
36
- - 🎯 **Dual-mode:** Interactive terminal UI or headless IPC
37
- - 📊 **Graph Visualization:** Interactive canvas with zoom/pan
38
- - 🔍 **Query Builder:** Smart autocomplete and syntax highlighting
39
- - 📈 **Workflow Monitor:** Real-time execution tracking
40
- - 🚀 **High Performance:** 60 FPS rendering, <1ms IPC latency
41
-
42
- [📖 Quick Start →](docs/RATATUI-QUICKSTART.md) | [🔧 Integration Guide →](docs/RATATUI-INTEGRATION.md) | [✅ IPC Complete →](docs/RATATUI-IPC-COMPLETE.md)
43
-
44
7
  ## Quick Start
45
8
 
46
9
  ```bash
@@ -86,8 +49,8 @@ bun run test
86
49
  ### Programmatic Example
87
50
 
88
51
  ```typescript
89
- import { TrellisKernel } from 'q/kernel';
90
- import { SqliteKernelBackend } from 'q/kernel/sqlite';
52
+ import { TrellisKernel } from 'trellis/kernel';
53
+ import { SqliteKernelBackend } from 'trellis/kernel/sqlite';
91
54
 
92
55
  // Initialize with persistence
93
56
  const backend = new SqliteKernelBackend({ filename: 'workspace.sqlite' });
@@ -27896,7 +27896,7 @@ class DatalogEvaluator {
27896
27896
  keys.add(key);
27897
27897
  return true;
27898
27898
  }
27899
- evaluate(query) {
27899
+ evaluate(query, limit) {
27900
27900
  const startTime = performance.now();
27901
27901
  const trace = [];
27902
27902
  this.seedBaseFacts();
@@ -27917,7 +27917,7 @@ class DatalogEvaluator {
27917
27917
  }
27918
27918
  iterations++;
27919
27919
  }
27920
- const bindings = this.findBindingsOverWS(query.goals, trace);
27920
+ const bindings = this.findBindingsOverWS(query.goals, trace, limit);
27921
27921
  return {
27922
27922
  bindings,
27923
27923
  executionTime: performance.now() - startTime,
@@ -27932,7 +27932,7 @@ class DatalogEvaluator {
27932
27932
  }
27933
27933
  return total;
27934
27934
  }
27935
- findBindingsOverWS(goals, trace) {
27935
+ findBindingsOverWS(goals, trace, limit) {
27936
27936
  if (goals.length === 0) {
27937
27937
  return [{}];
27938
27938
  }
@@ -27940,22 +27940,25 @@ class DatalogEvaluator {
27940
27940
  for (const goal of goals) {
27941
27941
  const goalStartTime = performance.now();
27942
27942
  const newBindings = [];
27943
- for (const binding of bindings) {
27944
- const goalBindings = this.evaluateGoal(goal, binding);
27945
- for (const goalBinding of goalBindings) {
27946
- const merged = { ...binding, ...goalBinding };
27947
- let hasConflict = false;
27948
- for (const key in merged) {
27949
- if (binding[key] !== undefined && goalBinding[key] !== undefined && binding[key] !== goalBinding[key]) {
27950
- hasConflict = true;
27951
- break;
27943
+ outer:
27944
+ for (const binding of bindings) {
27945
+ const goalBindings = this.evaluateGoal(goal, binding);
27946
+ for (const goalBinding of goalBindings) {
27947
+ const merged = { ...binding, ...goalBinding };
27948
+ let hasConflict = false;
27949
+ for (const key in merged) {
27950
+ if (binding[key] !== undefined && goalBinding[key] !== undefined && binding[key] !== goalBinding[key]) {
27951
+ hasConflict = true;
27952
+ break;
27953
+ }
27954
+ }
27955
+ if (!hasConflict) {
27956
+ newBindings.push(merged);
27957
+ if (limit !== undefined && newBindings.length >= limit)
27958
+ break outer;
27952
27959
  }
27953
- }
27954
- if (!hasConflict) {
27955
- newBindings.push(merged);
27956
27960
  }
27957
27961
  }
27958
- }
27959
27962
  bindings = newBindings;
27960
27963
  if (trace) {
27961
27964
  trace.push({
package/dist/cli/tql.js CHANGED
@@ -18169,7 +18169,7 @@ class DatalogEvaluator {
18169
18169
  keys.add(key);
18170
18170
  return true;
18171
18171
  }
18172
- evaluate(query) {
18172
+ evaluate(query, limit) {
18173
18173
  const startTime = performance.now();
18174
18174
  const trace = [];
18175
18175
  this.seedBaseFacts();
@@ -18190,7 +18190,7 @@ class DatalogEvaluator {
18190
18190
  }
18191
18191
  iterations++;
18192
18192
  }
18193
- const bindings = this.findBindingsOverWS(query.goals, trace);
18193
+ const bindings = this.findBindingsOverWS(query.goals, trace, limit);
18194
18194
  return {
18195
18195
  bindings,
18196
18196
  executionTime: performance.now() - startTime,
@@ -18205,7 +18205,7 @@ class DatalogEvaluator {
18205
18205
  }
18206
18206
  return total;
18207
18207
  }
18208
- findBindingsOverWS(goals, trace) {
18208
+ findBindingsOverWS(goals, trace, limit) {
18209
18209
  if (goals.length === 0) {
18210
18210
  return [{}];
18211
18211
  }
@@ -18213,22 +18213,25 @@ class DatalogEvaluator {
18213
18213
  for (const goal of goals) {
18214
18214
  const goalStartTime = performance.now();
18215
18215
  const newBindings = [];
18216
- for (const binding of bindings) {
18217
- const goalBindings = this.evaluateGoal(goal, binding);
18218
- for (const goalBinding of goalBindings) {
18219
- const merged = { ...binding, ...goalBinding };
18220
- let hasConflict = false;
18221
- for (const key in merged) {
18222
- if (binding[key] !== undefined && goalBinding[key] !== undefined && binding[key] !== goalBinding[key]) {
18223
- hasConflict = true;
18224
- break;
18216
+ outer:
18217
+ for (const binding of bindings) {
18218
+ const goalBindings = this.evaluateGoal(goal, binding);
18219
+ for (const goalBinding of goalBindings) {
18220
+ const merged = { ...binding, ...goalBinding };
18221
+ let hasConflict = false;
18222
+ for (const key in merged) {
18223
+ if (binding[key] !== undefined && goalBinding[key] !== undefined && binding[key] !== goalBinding[key]) {
18224
+ hasConflict = true;
18225
+ break;
18226
+ }
18227
+ }
18228
+ if (!hasConflict) {
18229
+ newBindings.push(merged);
18230
+ if (limit !== undefined && newBindings.length >= limit)
18231
+ break outer;
18225
18232
  }
18226
- }
18227
- if (!hasConflict) {
18228
- newBindings.push(merged);
18229
18233
  }
18230
18234
  }
18231
- }
18232
18235
  bindings = newBindings;
18233
18236
  if (trace) {
18234
18237
  trace.push({
package/dist/index.js CHANGED
@@ -13245,7 +13245,7 @@ class DatalogEvaluator {
13245
13245
  keys.add(key);
13246
13246
  return true;
13247
13247
  }
13248
- evaluate(query) {
13248
+ evaluate(query, limit) {
13249
13249
  const startTime = performance.now();
13250
13250
  const trace = [];
13251
13251
  this.seedBaseFacts();
@@ -13266,7 +13266,7 @@ class DatalogEvaluator {
13266
13266
  }
13267
13267
  iterations++;
13268
13268
  }
13269
- const bindings = this.findBindingsOverWS(query.goals, trace);
13269
+ const bindings = this.findBindingsOverWS(query.goals, trace, limit);
13270
13270
  return {
13271
13271
  bindings,
13272
13272
  executionTime: performance.now() - startTime,
@@ -13281,7 +13281,7 @@ class DatalogEvaluator {
13281
13281
  }
13282
13282
  return total;
13283
13283
  }
13284
- findBindingsOverWS(goals, trace) {
13284
+ findBindingsOverWS(goals, trace, limit) {
13285
13285
  if (goals.length === 0) {
13286
13286
  return [{}];
13287
13287
  }
@@ -13289,22 +13289,25 @@ class DatalogEvaluator {
13289
13289
  for (const goal of goals) {
13290
13290
  const goalStartTime = performance.now();
13291
13291
  const newBindings = [];
13292
- for (const binding of bindings) {
13293
- const goalBindings = this.evaluateGoal(goal, binding);
13294
- for (const goalBinding of goalBindings) {
13295
- const merged = { ...binding, ...goalBinding };
13296
- let hasConflict = false;
13297
- for (const key in merged) {
13298
- if (binding[key] !== undefined && goalBinding[key] !== undefined && binding[key] !== goalBinding[key]) {
13299
- hasConflict = true;
13300
- break;
13292
+ outer:
13293
+ for (const binding of bindings) {
13294
+ const goalBindings = this.evaluateGoal(goal, binding);
13295
+ for (const goalBinding of goalBindings) {
13296
+ const merged = { ...binding, ...goalBinding };
13297
+ let hasConflict = false;
13298
+ for (const key in merged) {
13299
+ if (binding[key] !== undefined && goalBinding[key] !== undefined && binding[key] !== goalBinding[key]) {
13300
+ hasConflict = true;
13301
+ break;
13302
+ }
13303
+ }
13304
+ if (!hasConflict) {
13305
+ newBindings.push(merged);
13306
+ if (limit !== undefined && newBindings.length >= limit)
13307
+ break outer;
13301
13308
  }
13302
- }
13303
- if (!hasConflict) {
13304
- newBindings.push(merged);
13305
13309
  }
13306
13310
  }
13307
- }
13308
13311
  bindings = newBindings;
13309
13312
  if (trace) {
13310
13313
  trace.push({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trellis",
3
- "version": "1.0.1",
3
+ "version": "1.0.4",
4
4
  "description": "Graph database and query engine for Node.js — EAV-based Datalog with natural language support",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",