agentdb 1.3.3 → 1.3.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.
@@ -1,4 +1,4 @@
1
- /*! AgentDB Browser Bundle v1.3.3 | MIT License | https://agentdb.ruv.io */
1
+ /*! AgentDB Browser Bundle v1.3.5 | 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,16 +193,31 @@ else if (typeof exports === 'object'){
193
193
  ;(function(global) {
194
194
  'use strict';
195
195
 
196
- // AgentDB v1.3.3 - v1.0.7 Compatible Browser Bundle
197
- var AgentDB = {
198
- version: '1.3.3',
196
+ // AgentDB v1.3.5 - v1.0.7 Compatible Browser Bundle
197
+
198
+ var sqlReady = false;
199
+ var SQL = null;
199
200
 
200
- // Backward compatible Database class
201
- Database: function(data) {
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
+ }
215
+
216
+ // Backward compatible Database class (v1.0.7 API)
217
+ function Database(data) {
202
218
  var db = null;
203
- var SQL = global.SQL || (typeof module !== 'undefined' && module.exports ? module.exports.SQL : null);
204
219
 
205
- if (!SQL) {
220
+ if (!sqlReady || !SQL) {
206
221
  throw new Error('sql.js not loaded. Include sql-wasm.js first.');
207
222
  }
208
223
 
@@ -262,18 +277,59 @@ else if (typeof exports === 'object'){
262
277
  )
263
278
  `);
264
279
  }
280
+ }
281
+
282
+ // Helper to wait for sql.js to be ready
283
+ function waitForReady(callback) {
284
+ if (sqlReady) {
285
+ callback();
286
+ } else {
287
+ setTimeout(function() {
288
+ waitForReady(callback);
289
+ }, 50);
290
+ }
291
+ }
292
+
293
+ // Create AgentDB namespace with all exports
294
+ var AgentDB = {
295
+ version: '1.3.5',
296
+ Database: Database,
297
+ ready: false,
298
+
299
+ // Wait for initialization
300
+ onReady: function(callback) {
301
+ waitForReady(function() {
302
+ AgentDB.ready = true;
303
+ callback();
304
+ });
305
+ },
306
+
307
+ // Additional exports for compatibility
308
+ SQLiteVectorDB: Database, // Alias for newer demos
309
+ createVectorDB: function(config) {
310
+ return new Database(config?.data);
265
311
  }
266
312
  };
267
313
 
314
+ // Auto-set ready flag when sql.js loads
315
+ waitForReady(function() {
316
+ AgentDB.ready = true;
317
+ });
318
+
268
319
  // Export for different module systems
269
320
  if (typeof module !== 'undefined' && module.exports) {
270
321
  module.exports = AgentDB;
322
+ module.exports.Database = Database;
323
+ module.exports.SQLiteVectorDB = Database;
271
324
  } else if (typeof define === 'function' && define.amd) {
272
325
  define(function() { return AgentDB; });
273
326
  } else {
274
327
  global.AgentDB = AgentDB;
328
+ // Also export directly for ES6 imports
329
+ global.Database = Database;
330
+ global.SQLiteVectorDB = Database;
275
331
  }
276
332
 
277
- console.log('AgentDB v1.3.3 loaded (v1.0.7 API compatible)');
333
+ console.log('AgentDB v1.3.5 loaded (v1.0.7 API compatible)');
278
334
 
279
335
  })(typeof window !== 'undefined' ? window : this);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentdb",
3
- "version": "1.3.3",
3
+ "version": "1.3.5",
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",