agentdb 1.3.8 → 1.3.9

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.
@@ -1,4 +1,4 @@
1
- /*! AgentDB Browser Bundle v1.3.8 | MIT License | https://agentdb.ruv.io */
1
+ /*! AgentDB Browser Bundle v1.3.9 | MIT License | https://agentdb.ruv.io */
2
2
  /*! Backward compatible with v1.0.7 API | Uses sql.js WASM SQLite */
3
3
 
4
4
  // We are modularizing this manually because the current modularize setting in Emscripten has some issues:
@@ -193,7 +193,7 @@ else if (typeof exports === 'object'){
193
193
  ;(function(global) {
194
194
  'use strict';
195
195
 
196
- // AgentDB v1.3.8 - v1.0.7 Compatible Browser Bundle
196
+ // AgentDB v1.3.9 - v1.0.7 Compatible Browser Bundle
197
197
 
198
198
  var sqlReady = false;
199
199
  var SQL = null;
@@ -267,7 +267,76 @@ else if (typeof exports === 'object'){
267
267
 
268
268
  // Async initialization support (for newer demos)
269
269
  this.initializeAsync = function() {
270
- return Promise.resolve(this);
270
+ var self = this;
271
+ return new Promise(function(resolve) {
272
+ // Ensure all tables are created
273
+ try {
274
+ // Core vectors table
275
+ self.run(`
276
+ CREATE TABLE IF NOT EXISTS vectors (
277
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
278
+ embedding BLOB,
279
+ metadata TEXT,
280
+ text TEXT,
281
+ created_at INTEGER DEFAULT (strftime('%s', 'now'))
282
+ )
283
+ `);
284
+
285
+ // Patterns table (for SkillLibrary)
286
+ self.run(`
287
+ CREATE TABLE IF NOT EXISTS patterns (
288
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
289
+ pattern TEXT NOT NULL,
290
+ metadata TEXT,
291
+ embedding BLOB,
292
+ created_at INTEGER DEFAULT (strftime('%s', 'now'))
293
+ )
294
+ `);
295
+
296
+ // Episodes table (for ReflexionMemory)
297
+ self.run(`
298
+ CREATE TABLE IF NOT EXISTS episodes (
299
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
300
+ trajectory TEXT NOT NULL,
301
+ self_reflection TEXT,
302
+ verdict TEXT,
303
+ metadata TEXT,
304
+ embedding BLOB,
305
+ created_at INTEGER DEFAULT (strftime('%s', 'now'))
306
+ )
307
+ `);
308
+
309
+ // Causal edges table (for CausalMemoryGraph)
310
+ self.run(`
311
+ CREATE TABLE IF NOT EXISTS causal_edges (
312
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
313
+ cause TEXT NOT NULL,
314
+ effect TEXT NOT NULL,
315
+ strength REAL DEFAULT 0.5,
316
+ metadata TEXT,
317
+ created_at INTEGER DEFAULT (strftime('%s', 'now'))
318
+ )
319
+ `);
320
+
321
+ // Skills table
322
+ self.run(`
323
+ CREATE TABLE IF NOT EXISTS skills (
324
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
325
+ skill_name TEXT NOT NULL,
326
+ code TEXT,
327
+ metadata TEXT,
328
+ embedding BLOB,
329
+ created_at INTEGER DEFAULT (strftime('%s', 'now'))
330
+ )
331
+ `);
332
+
333
+ console.log('AgentDB: All tables initialized');
334
+ resolve(self);
335
+ } catch (error) {
336
+ console.error('AgentDB initialization error:', error);
337
+ resolve(self); // Still resolve to maintain compatibility
338
+ }
339
+ });
271
340
  };
272
341
 
273
342
  // Higher-level insert method (supports both signatures)
@@ -470,7 +539,7 @@ else if (typeof exports === 'object'){
470
539
 
471
540
  // Create AgentDB namespace with all exports
472
541
  var AgentDB = {
473
- version: '1.3.8',
542
+ version: '1.3.9',
474
543
  Database: Database,
475
544
  ready: false,
476
545
 
@@ -508,6 +577,6 @@ else if (typeof exports === 'object'){
508
577
  global.SQLiteVectorDB = Database;
509
578
  }
510
579
 
511
- console.log('AgentDB v1.3.8 loaded (v1.0.7 API compatible)');
580
+ console.log('AgentDB v1.3.9 loaded (v1.0.7 API compatible)');
512
581
 
513
582
  })(typeof window !== 'undefined' ? window : this);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentdb",
3
- "version": "1.3.8",
3
+ "version": "1.3.9",
4
4
  "description": "AgentDB - Frontier Memory Features with MCP Integration: Causal reasoning, reflexion memory, skill library, and automated learning. 150x faster vector search. Full Claude Desktop support via Model Context Protocol.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -26,6 +26,10 @@
26
26
  "build:browser": "node scripts/build-browser.js",
27
27
  "dev": "tsx src/cli/agentdb-cli.ts",
28
28
  "test": "vitest",
29
+ "test:unit": "vitest --run",
30
+ "test:browser": "vitest browser-bundle-unit.test.js --run",
31
+ "test:ci": "npm run test:browser && npm run build && npm run verify:bundle",
32
+ "verify:bundle": "node scripts/verify-bundle.js",
29
33
  "cli": "node dist/cli/agentdb-cli.js"
30
34
  },
31
35
  "keywords": [