agentdb 1.3.4 → 1.3.6

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.4 | MIT License | https://agentdb.ruv.io */
1
+ /*! AgentDB Browser Bundle v1.3.6 | 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,14 +193,31 @@ else if (typeof exports === 'object'){
193
193
  ;(function(global) {
194
194
  'use strict';
195
195
 
196
- // AgentDB v1.3.4 - v1.0.7 Compatible Browser Bundle
196
+ // AgentDB v1.3.6 - v1.0.7 Compatible Browser Bundle
197
+
198
+ var sqlReady = false;
199
+ var SQL = null;
200
+
201
+ // Initialize sql.js asynchronously
202
+ if (typeof initSqlJs !== 'undefined') {
203
+ initSqlJs({
204
+ locateFile: function(file) {
205
+ return 'https://cdn.jsdelivr.net/npm/sql.js@1.13.0/dist/' + file;
206
+ }
207
+ }).then(function(sql) {
208
+ SQL = sql;
209
+ sqlReady = true;
210
+ console.log('sql.js initialized');
211
+ }).catch(function(err) {
212
+ console.error('Failed to initialize sql.js:', err);
213
+ });
214
+ }
197
215
 
198
216
  // Backward compatible Database class (v1.0.7 API)
199
217
  function Database(data) {
200
218
  var db = null;
201
- var SQL = global.SQL || (typeof module !== 'undefined' && module.exports ? module.exports.SQL : null);
202
219
 
203
- if (!SQL) {
220
+ if (!sqlReady || !SQL) {
204
221
  throw new Error('sql.js not loaded. Include sql-wasm.js first.');
205
222
  }
206
223
 
@@ -248,6 +265,11 @@ else if (typeof exports === 'object'){
248
265
  db.close();
249
266
  };
250
267
 
268
+ // Async initialization support (for newer demos)
269
+ this.initializeAsync = function() {
270
+ return Promise.resolve(this);
271
+ };
272
+
251
273
  // Initialize with basic schema if new database
252
274
  if (!data) {
253
275
  this.run(`
@@ -262,10 +284,30 @@ else if (typeof exports === 'object'){
262
284
  }
263
285
  }
264
286
 
287
+ // Helper to wait for sql.js to be ready
288
+ function waitForReady(callback) {
289
+ if (sqlReady) {
290
+ callback();
291
+ } else {
292
+ setTimeout(function() {
293
+ waitForReady(callback);
294
+ }, 50);
295
+ }
296
+ }
297
+
265
298
  // Create AgentDB namespace with all exports
266
299
  var AgentDB = {
267
- version: '1.3.4',
300
+ version: '1.3.6',
268
301
  Database: Database,
302
+ ready: false,
303
+
304
+ // Wait for initialization
305
+ onReady: function(callback) {
306
+ waitForReady(function() {
307
+ AgentDB.ready = true;
308
+ callback();
309
+ });
310
+ },
269
311
 
270
312
  // Additional exports for compatibility
271
313
  SQLiteVectorDB: Database, // Alias for newer demos
@@ -274,6 +316,11 @@ else if (typeof exports === 'object'){
274
316
  }
275
317
  };
276
318
 
319
+ // Auto-set ready flag when sql.js loads
320
+ waitForReady(function() {
321
+ AgentDB.ready = true;
322
+ });
323
+
277
324
  // Export for different module systems
278
325
  if (typeof module !== 'undefined' && module.exports) {
279
326
  module.exports = AgentDB;
@@ -288,6 +335,6 @@ else if (typeof exports === 'object'){
288
335
  global.SQLiteVectorDB = Database;
289
336
  }
290
337
 
291
- console.log('AgentDB v1.3.4 loaded (v1.0.7 API compatible)');
338
+ console.log('AgentDB v1.3.6 loaded (v1.0.7 API compatible)');
292
339
 
293
340
  })(typeof window !== 'undefined' ? window : this);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentdb",
3
- "version": "1.3.4",
3
+ "version": "1.3.6",
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",