agentdb 1.3.4 → 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.4 | 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,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.5 - 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
 
@@ -262,10 +279,30 @@ else if (typeof exports === 'object'){
262
279
  }
263
280
  }
264
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
+
265
293
  // Create AgentDB namespace with all exports
266
294
  var AgentDB = {
267
- version: '1.3.4',
295
+ version: '1.3.5',
268
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
+ },
269
306
 
270
307
  // Additional exports for compatibility
271
308
  SQLiteVectorDB: Database, // Alias for newer demos
@@ -274,6 +311,11 @@ else if (typeof exports === 'object'){
274
311
  }
275
312
  };
276
313
 
314
+ // Auto-set ready flag when sql.js loads
315
+ waitForReady(function() {
316
+ AgentDB.ready = true;
317
+ });
318
+
277
319
  // Export for different module systems
278
320
  if (typeof module !== 'undefined' && module.exports) {
279
321
  module.exports = AgentDB;
@@ -288,6 +330,6 @@ else if (typeof exports === 'object'){
288
330
  global.SQLiteVectorDB = Database;
289
331
  }
290
332
 
291
- console.log('AgentDB v1.3.4 loaded (v1.0.7 API compatible)');
333
+ console.log('AgentDB v1.3.5 loaded (v1.0.7 API compatible)');
292
334
 
293
335
  })(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.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",