@grepai/cli 0.7.0 → 0.7.2

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.
Files changed (3) hide show
  1. package/index.js +480 -138
  2. package/index.js.map +8 -7
  3. package/package.json +2 -2
package/index.js CHANGED
@@ -13895,7 +13895,7 @@ var require_libsql = __commonJS((exports, module2) => {
13895
13895
  return err2;
13896
13896
  }
13897
13897
 
13898
- class Database5 {
13898
+ class Database6 {
13899
13899
  constructor(path4, opts) {
13900
13900
  const encryptionCipher = opts?.encryptionCipher ?? "aes256cbc";
13901
13901
  if (opts && opts.syncUrl) {
@@ -14121,7 +14121,7 @@ var require_libsql = __commonJS((exports, module2) => {
14121
14121
  return this;
14122
14122
  }
14123
14123
  }
14124
- module2.exports = Database5;
14124
+ module2.exports = Database6;
14125
14125
  module2.exports.SqliteError = SqliteError2;
14126
14126
  });
14127
14127
 
@@ -14140,7 +14140,7 @@ var require_promise_limit = __commonJS((exports, module2) => {
14140
14140
  var job = jobs.shift();
14141
14141
  semaphore.queue = jobs.length;
14142
14142
  if (job) {
14143
- run10(job.fn).then(job.resolve).catch(job.reject);
14143
+ run11(job.fn).then(job.resolve).catch(job.reject);
14144
14144
  }
14145
14145
  }
14146
14146
  function queue(fn) {
@@ -14149,7 +14149,7 @@ var require_promise_limit = __commonJS((exports, module2) => {
14149
14149
  semaphore.queue = jobs.length;
14150
14150
  });
14151
14151
  }
14152
- function run10(fn) {
14152
+ function run11(fn) {
14153
14153
  outstanding++;
14154
14154
  try {
14155
14155
  return Promise.resolve(fn()).then(function(result) {
@@ -14168,7 +14168,7 @@ var require_promise_limit = __commonJS((exports, module2) => {
14168
14168
  if (outstanding >= count4) {
14169
14169
  return queue(fn);
14170
14170
  } else {
14171
- return run10(fn);
14171
+ return run11(fn);
14172
14172
  }
14173
14173
  };
14174
14174
  return semaphore;
@@ -101786,7 +101786,6 @@ function mergeWithinBudgetOrFlush(current, next, config3) {
101786
101786
 
101787
101787
  // ../core/src/internal/services/codebase-scanner-agentfs.ts
101788
101788
  import { globSync } from "fs";
101789
- import { connect as connect2 } from "@tursodatabase/sync";
101790
101789
 
101791
101790
  // ../../node_modules/.bun/@tursodatabase+database-common@0.4.4/node_modules/@tursodatabase/database-common/dist/bind.js
101792
101791
  function bindParams(stmt, params) {
@@ -102273,7 +102272,191 @@ class Statement {
102273
102272
  }
102274
102273
  }
102275
102274
 
102276
- // ../../node_modules/.bun/@tursodatabase+database@0.4.4/node_modules/@tursodatabase/database/index.js
102275
+ // ../../node_modules/.bun/@tursodatabase+sync-common@0.4.4/node_modules/@tursodatabase/sync-common/dist/run.js
102276
+ function trackPromise(p3) {
102277
+ let status2 = { promise: null, finished: false };
102278
+ status2.promise = p3.finally(() => status2.finished = true);
102279
+ return status2;
102280
+ }
102281
+ function timeoutMs(ms) {
102282
+ return new Promise((resolve4) => setTimeout(resolve4, ms));
102283
+ }
102284
+ function normalizeUrl(url3) {
102285
+ return url3.replace(/^libsql:\/\//, "https://");
102286
+ }
102287
+ async function process3(opts, io, request) {
102288
+ const requestType = request.request();
102289
+ const completion = request.completion();
102290
+ if (requestType.type == "Http") {
102291
+ let url3 = requestType.url;
102292
+ if (typeof opts.url == "function") {
102293
+ url3 = opts.url();
102294
+ } else {
102295
+ url3 = opts.url;
102296
+ }
102297
+ if (url3 == null) {
102298
+ completion.poison(`url is empty - sync is paused`);
102299
+ return;
102300
+ }
102301
+ url3 = normalizeUrl(url3);
102302
+ try {
102303
+ let headers = typeof opts.headers === "function" ? await opts.headers() : opts.headers;
102304
+ if (requestType.headers != null && requestType.headers.length > 0) {
102305
+ headers = { ...headers };
102306
+ for (let header of requestType.headers) {
102307
+ headers[header[0]] = header[1];
102308
+ }
102309
+ }
102310
+ const response = await fetch(`${url3}${requestType.path}`, {
102311
+ method: requestType.method,
102312
+ headers,
102313
+ body: requestType.body != null ? new Uint8Array(requestType.body) : null
102314
+ });
102315
+ completion.status(response.status);
102316
+ const reader = response.body.getReader();
102317
+ while (true) {
102318
+ const { done: done9, value: value6 } = await reader.read();
102319
+ if (done9) {
102320
+ completion.done();
102321
+ break;
102322
+ }
102323
+ completion.pushBuffer(value6);
102324
+ }
102325
+ } catch (error51) {
102326
+ completion.poison(`fetch error: ${error51}`);
102327
+ }
102328
+ } else if (requestType.type == "FullRead") {
102329
+ try {
102330
+ const metadata2 = await io.read(requestType.path);
102331
+ if (metadata2 != null) {
102332
+ completion.pushBuffer(metadata2);
102333
+ }
102334
+ completion.done();
102335
+ } catch (error51) {
102336
+ completion.poison(`metadata read error: ${error51}`);
102337
+ }
102338
+ } else if (requestType.type == "FullWrite") {
102339
+ try {
102340
+ await io.write(requestType.path, requestType.content);
102341
+ completion.done();
102342
+ } catch (error51) {
102343
+ completion.poison(`metadata write error: ${error51}`);
102344
+ }
102345
+ } else if (requestType.type == "Transform") {
102346
+ if (opts.transform == null) {
102347
+ completion.poison("transform is not set");
102348
+ return;
102349
+ }
102350
+ const results = [];
102351
+ for (const mutation of requestType.mutations) {
102352
+ const result = opts.transform(mutation);
102353
+ if (result == null) {
102354
+ results.push({ type: "Keep" });
102355
+ } else if (result.operation == "skip") {
102356
+ results.push({ type: "Skip" });
102357
+ } else if (result.operation == "rewrite") {
102358
+ results.push({ type: "Rewrite", stmt: result.stmt });
102359
+ } else {
102360
+ completion.poison("unexpected transform operation");
102361
+ return;
102362
+ }
102363
+ }
102364
+ completion.pushTransform(results);
102365
+ completion.done();
102366
+ }
102367
+ }
102368
+ function runner(opts, io, engine) {
102369
+ let tasks = [];
102370
+ return {
102371
+ async wait() {
102372
+ for (let request = engine.protocolIo();request != null; request = engine.protocolIo()) {
102373
+ tasks.push(trackPromise(process3(opts, io, request)));
102374
+ }
102375
+ const tasksRace = tasks.length == 0 ? Promise.resolve() : Promise.race([timeoutMs(opts.preemptionMs), ...tasks.map((t) => t.promise)]);
102376
+ await Promise.all([engine.ioLoopAsync(), tasksRace]);
102377
+ tasks = tasks.filter((t) => !t.finished);
102378
+ engine.protocolIoStep();
102379
+ }
102380
+ };
102381
+ }
102382
+ async function run10(runner2, generator) {
102383
+ while (true) {
102384
+ const { type: type2, ...rest } = await generator.resumeAsync(null);
102385
+ if (type2 == "Done") {
102386
+ return null;
102387
+ }
102388
+ if (type2 == "SyncEngineStats") {
102389
+ return rest;
102390
+ }
102391
+ if (type2 == "SyncEngineChanges") {
102392
+ return rest.changes;
102393
+ }
102394
+ await runner2.wait();
102395
+ }
102396
+ }
102397
+
102398
+ class SyncEngineGuards {
102399
+ waitLock;
102400
+ pushLock;
102401
+ pullLock;
102402
+ checkpointLock;
102403
+ constructor() {
102404
+ this.waitLock = new AsyncLock;
102405
+ this.pushLock = new AsyncLock;
102406
+ this.pullLock = new AsyncLock;
102407
+ this.checkpointLock = new AsyncLock;
102408
+ }
102409
+ async wait(f) {
102410
+ try {
102411
+ await this.waitLock.acquire();
102412
+ return await f();
102413
+ } finally {
102414
+ this.waitLock.release();
102415
+ }
102416
+ }
102417
+ async push(f) {
102418
+ try {
102419
+ await this.pushLock.acquire();
102420
+ await this.pullLock.acquire();
102421
+ await this.checkpointLock.acquire();
102422
+ return await f();
102423
+ } finally {
102424
+ this.pushLock.release();
102425
+ this.pullLock.release();
102426
+ this.checkpointLock.release();
102427
+ }
102428
+ }
102429
+ async apply(f) {
102430
+ try {
102431
+ await this.waitLock.acquire();
102432
+ await this.pushLock.acquire();
102433
+ await this.pullLock.acquire();
102434
+ await this.checkpointLock.acquire();
102435
+ return await f();
102436
+ } finally {
102437
+ this.waitLock.release();
102438
+ this.pushLock.release();
102439
+ this.pullLock.release();
102440
+ this.checkpointLock.release();
102441
+ }
102442
+ }
102443
+ async checkpoint(f) {
102444
+ try {
102445
+ await this.waitLock.acquire();
102446
+ await this.pushLock.acquire();
102447
+ await this.pullLock.acquire();
102448
+ await this.checkpointLock.acquire();
102449
+ return await f();
102450
+ } finally {
102451
+ this.waitLock.release();
102452
+ this.pushLock.release();
102453
+ this.pullLock.release();
102454
+ this.checkpointLock.release();
102455
+ }
102456
+ }
102457
+ }
102458
+
102459
+ // ../../node_modules/.bun/@tursodatabase+sync@0.4.4/node_modules/@tursodatabase/sync/index.js
102277
102460
  import { createRequire } from "module";
102278
102461
  var require2 = createRequire(import.meta.url);
102279
102462
  var __dirname2 = new URL(".", import.meta.url).pathname;
@@ -102337,15 +102520,15 @@ function requireNative() {
102337
102520
  } else if (process.platform === "android") {
102338
102521
  if (process.arch === "arm64") {
102339
102522
  try {
102340
- return require2("./turso.android-arm64.node");
102523
+ return require2("./sync.android-arm64.node");
102341
102524
  } catch (e) {
102342
102525
  loadErrors.push(e);
102343
102526
  }
102344
102527
  try {
102345
- const binding = require2("@tursodatabase/database-android-arm64");
102346
- const bindingPackageVersion = require2("@tursodatabase/database-android-arm64/package.json").version;
102347
- if (bindingPackageVersion !== "0.3.0-pre.4" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
102348
- throw new Error(`Native binding package version mismatch, expected 0.3.0-pre.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
102528
+ const binding = require2("@tursodatabase/sync-android-arm64");
102529
+ const bindingPackageVersion = require2("@tursodatabase/sync-android-arm64/package.json").version;
102530
+ if (bindingPackageVersion !== "0.4.0-pre.18" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
102531
+ throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
102349
102532
  }
102350
102533
  return binding;
102351
102534
  } catch (e) {
@@ -102353,15 +102536,15 @@ function requireNative() {
102353
102536
  }
102354
102537
  } else if (process.arch === "arm") {
102355
102538
  try {
102356
- return require2("./turso.android-arm-eabi.node");
102539
+ return require2("./sync.android-arm-eabi.node");
102357
102540
  } catch (e) {
102358
102541
  loadErrors.push(e);
102359
102542
  }
102360
102543
  try {
102361
- const binding = require2("@tursodatabase/database-android-arm-eabi");
102362
- const bindingPackageVersion = require2("@tursodatabase/database-android-arm-eabi/package.json").version;
102363
- if (bindingPackageVersion !== "0.3.0-pre.4" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
102364
- throw new Error(`Native binding package version mismatch, expected 0.3.0-pre.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
102544
+ const binding = require2("@tursodatabase/sync-android-arm-eabi");
102545
+ const bindingPackageVersion = require2("@tursodatabase/sync-android-arm-eabi/package.json").version;
102546
+ if (bindingPackageVersion !== "0.4.0-pre.18" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
102547
+ throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
102365
102548
  }
102366
102549
  return binding;
102367
102550
  } catch (e) {
@@ -102373,15 +102556,15 @@ function requireNative() {
102373
102556
  } else if (process.platform === "win32") {
102374
102557
  if (process.arch === "x64") {
102375
102558
  try {
102376
- return require2("./turso.win32-x64-msvc.node");
102559
+ return require2("./sync.win32-x64-msvc.node");
102377
102560
  } catch (e) {
102378
102561
  loadErrors.push(e);
102379
102562
  }
102380
102563
  try {
102381
- const binding = require2("@tursodatabase/database-win32-x64-msvc");
102382
- const bindingPackageVersion = require2("@tursodatabase/database-win32-x64-msvc/package.json").version;
102383
- if (bindingPackageVersion !== "0.3.0-pre.4" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
102384
- throw new Error(`Native binding package version mismatch, expected 0.3.0-pre.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
102564
+ const binding = require2("@tursodatabase/sync-win32-x64-msvc");
102565
+ const bindingPackageVersion = require2("@tursodatabase/sync-win32-x64-msvc/package.json").version;
102566
+ if (bindingPackageVersion !== "0.4.0-pre.18" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
102567
+ throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
102385
102568
  }
102386
102569
  return binding;
102387
102570
  } catch (e) {
@@ -102389,15 +102572,15 @@ function requireNative() {
102389
102572
  }
102390
102573
  } else if (process.arch === "ia32") {
102391
102574
  try {
102392
- return require2("./turso.win32-ia32-msvc.node");
102575
+ return require2("./sync.win32-ia32-msvc.node");
102393
102576
  } catch (e) {
102394
102577
  loadErrors.push(e);
102395
102578
  }
102396
102579
  try {
102397
- const binding = require2("@tursodatabase/database-win32-ia32-msvc");
102398
- const bindingPackageVersion = require2("@tursodatabase/database-win32-ia32-msvc/package.json").version;
102399
- if (bindingPackageVersion !== "0.3.0-pre.4" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
102400
- throw new Error(`Native binding package version mismatch, expected 0.3.0-pre.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
102580
+ const binding = require2("@tursodatabase/sync-win32-ia32-msvc");
102581
+ const bindingPackageVersion = require2("@tursodatabase/sync-win32-ia32-msvc/package.json").version;
102582
+ if (bindingPackageVersion !== "0.4.0-pre.18" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
102583
+ throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
102401
102584
  }
102402
102585
  return binding;
102403
102586
  } catch (e) {
@@ -102405,15 +102588,15 @@ function requireNative() {
102405
102588
  }
102406
102589
  } else if (process.arch === "arm64") {
102407
102590
  try {
102408
- return require2("./turso.win32-arm64-msvc.node");
102591
+ return require2("./sync.win32-arm64-msvc.node");
102409
102592
  } catch (e) {
102410
102593
  loadErrors.push(e);
102411
102594
  }
102412
102595
  try {
102413
- const binding = require2("@tursodatabase/database-win32-arm64-msvc");
102414
- const bindingPackageVersion = require2("@tursodatabase/database-win32-arm64-msvc/package.json").version;
102415
- if (bindingPackageVersion !== "0.3.0-pre.4" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
102416
- throw new Error(`Native binding package version mismatch, expected 0.3.0-pre.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
102596
+ const binding = require2("@tursodatabase/sync-win32-arm64-msvc");
102597
+ const bindingPackageVersion = require2("@tursodatabase/sync-win32-arm64-msvc/package.json").version;
102598
+ if (bindingPackageVersion !== "0.4.0-pre.18" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
102599
+ throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
102417
102600
  }
102418
102601
  return binding;
102419
102602
  } catch (e) {
@@ -102424,15 +102607,15 @@ function requireNative() {
102424
102607
  }
102425
102608
  } else if (process.platform === "darwin") {
102426
102609
  try {
102427
- return require2("./turso.darwin-universal.node");
102610
+ return require2("./sync.darwin-universal.node");
102428
102611
  } catch (e) {
102429
102612
  loadErrors.push(e);
102430
102613
  }
102431
102614
  try {
102432
- const binding = require2("@tursodatabase/database-darwin-universal");
102433
- const bindingPackageVersion = require2("@tursodatabase/database-darwin-universal/package.json").version;
102434
- if (bindingPackageVersion !== "0.3.0-pre.4" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
102435
- throw new Error(`Native binding package version mismatch, expected 0.3.0-pre.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
102615
+ const binding = require2("@tursodatabase/sync-darwin-universal");
102616
+ const bindingPackageVersion = require2("@tursodatabase/sync-darwin-universal/package.json").version;
102617
+ if (bindingPackageVersion !== "0.4.0-pre.18" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
102618
+ throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
102436
102619
  }
102437
102620
  return binding;
102438
102621
  } catch (e) {
@@ -102440,15 +102623,15 @@ function requireNative() {
102440
102623
  }
102441
102624
  if (process.arch === "x64") {
102442
102625
  try {
102443
- return require2("./turso.darwin-x64.node");
102626
+ return require2("./sync.darwin-x64.node");
102444
102627
  } catch (e) {
102445
102628
  loadErrors.push(e);
102446
102629
  }
102447
102630
  try {
102448
- const binding = require2("@tursodatabase/database-darwin-x64");
102449
- const bindingPackageVersion = require2("@tursodatabase/database-darwin-x64/package.json").version;
102450
- if (bindingPackageVersion !== "0.3.0-pre.4" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
102451
- throw new Error(`Native binding package version mismatch, expected 0.3.0-pre.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
102631
+ const binding = require2("@tursodatabase/sync-darwin-x64");
102632
+ const bindingPackageVersion = require2("@tursodatabase/sync-darwin-x64/package.json").version;
102633
+ if (bindingPackageVersion !== "0.4.0-pre.18" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
102634
+ throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
102452
102635
  }
102453
102636
  return binding;
102454
102637
  } catch (e) {
@@ -102456,15 +102639,15 @@ function requireNative() {
102456
102639
  }
102457
102640
  } else if (process.arch === "arm64") {
102458
102641
  try {
102459
- return require2("./turso.darwin-arm64.node");
102642
+ return require2("./sync.darwin-arm64.node");
102460
102643
  } catch (e) {
102461
102644
  loadErrors.push(e);
102462
102645
  }
102463
102646
  try {
102464
- const binding = require2("@tursodatabase/database-darwin-arm64");
102465
- const bindingPackageVersion = require2("@tursodatabase/database-darwin-arm64/package.json").version;
102466
- if (bindingPackageVersion !== "0.3.0-pre.4" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
102467
- throw new Error(`Native binding package version mismatch, expected 0.3.0-pre.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
102647
+ const binding = require2("@tursodatabase/sync-darwin-arm64");
102648
+ const bindingPackageVersion = require2("@tursodatabase/sync-darwin-arm64/package.json").version;
102649
+ if (bindingPackageVersion !== "0.4.0-pre.18" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
102650
+ throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
102468
102651
  }
102469
102652
  return binding;
102470
102653
  } catch (e) {
@@ -102476,15 +102659,15 @@ function requireNative() {
102476
102659
  } else if (process.platform === "freebsd") {
102477
102660
  if (process.arch === "x64") {
102478
102661
  try {
102479
- return require2("./turso.freebsd-x64.node");
102662
+ return require2("./sync.freebsd-x64.node");
102480
102663
  } catch (e) {
102481
102664
  loadErrors.push(e);
102482
102665
  }
102483
102666
  try {
102484
- const binding = require2("@tursodatabase/database-freebsd-x64");
102485
- const bindingPackageVersion = require2("@tursodatabase/database-freebsd-x64/package.json").version;
102486
- if (bindingPackageVersion !== "0.3.0-pre.4" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
102487
- throw new Error(`Native binding package version mismatch, expected 0.3.0-pre.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
102667
+ const binding = require2("@tursodatabase/sync-freebsd-x64");
102668
+ const bindingPackageVersion = require2("@tursodatabase/sync-freebsd-x64/package.json").version;
102669
+ if (bindingPackageVersion !== "0.4.0-pre.18" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
102670
+ throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
102488
102671
  }
102489
102672
  return binding;
102490
102673
  } catch (e) {
@@ -102492,15 +102675,15 @@ function requireNative() {
102492
102675
  }
102493
102676
  } else if (process.arch === "arm64") {
102494
102677
  try {
102495
- return require2("./turso.freebsd-arm64.node");
102678
+ return require2("./sync.freebsd-arm64.node");
102496
102679
  } catch (e) {
102497
102680
  loadErrors.push(e);
102498
102681
  }
102499
102682
  try {
102500
- const binding = require2("@tursodatabase/database-freebsd-arm64");
102501
- const bindingPackageVersion = require2("@tursodatabase/database-freebsd-arm64/package.json").version;
102502
- if (bindingPackageVersion !== "0.3.0-pre.4" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
102503
- throw new Error(`Native binding package version mismatch, expected 0.3.0-pre.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
102683
+ const binding = require2("@tursodatabase/sync-freebsd-arm64");
102684
+ const bindingPackageVersion = require2("@tursodatabase/sync-freebsd-arm64/package.json").version;
102685
+ if (bindingPackageVersion !== "0.4.0-pre.18" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
102686
+ throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
102504
102687
  }
102505
102688
  return binding;
102506
102689
  } catch (e) {
@@ -102513,15 +102696,15 @@ function requireNative() {
102513
102696
  if (process.arch === "x64") {
102514
102697
  if (isMusl()) {
102515
102698
  try {
102516
- return require2("./turso.linux-x64-musl.node");
102699
+ return require2("./sync.linux-x64-musl.node");
102517
102700
  } catch (e) {
102518
102701
  loadErrors.push(e);
102519
102702
  }
102520
102703
  try {
102521
- const binding = require2("@tursodatabase/database-linux-x64-musl");
102522
- const bindingPackageVersion = require2("@tursodatabase/database-linux-x64-musl/package.json").version;
102523
- if (bindingPackageVersion !== "0.3.0-pre.4" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
102524
- throw new Error(`Native binding package version mismatch, expected 0.3.0-pre.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
102704
+ const binding = require2("@tursodatabase/sync-linux-x64-musl");
102705
+ const bindingPackageVersion = require2("@tursodatabase/sync-linux-x64-musl/package.json").version;
102706
+ if (bindingPackageVersion !== "0.4.0-pre.18" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
102707
+ throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
102525
102708
  }
102526
102709
  return binding;
102527
102710
  } catch (e) {
@@ -102529,15 +102712,15 @@ function requireNative() {
102529
102712
  }
102530
102713
  } else {
102531
102714
  try {
102532
- return require2("./turso.linux-x64-gnu.node");
102715
+ return require2("./sync.linux-x64-gnu.node");
102533
102716
  } catch (e) {
102534
102717
  loadErrors.push(e);
102535
102718
  }
102536
102719
  try {
102537
- const binding = require2("@tursodatabase/database-linux-x64-gnu");
102538
- const bindingPackageVersion = require2("@tursodatabase/database-linux-x64-gnu/package.json").version;
102539
- if (bindingPackageVersion !== "0.3.0-pre.4" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
102540
- throw new Error(`Native binding package version mismatch, expected 0.3.0-pre.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
102720
+ const binding = require2("@tursodatabase/sync-linux-x64-gnu");
102721
+ const bindingPackageVersion = require2("@tursodatabase/sync-linux-x64-gnu/package.json").version;
102722
+ if (bindingPackageVersion !== "0.4.0-pre.18" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
102723
+ throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
102541
102724
  }
102542
102725
  return binding;
102543
102726
  } catch (e) {
@@ -102547,15 +102730,15 @@ function requireNative() {
102547
102730
  } else if (process.arch === "arm64") {
102548
102731
  if (isMusl()) {
102549
102732
  try {
102550
- return require2("./turso.linux-arm64-musl.node");
102733
+ return require2("./sync.linux-arm64-musl.node");
102551
102734
  } catch (e) {
102552
102735
  loadErrors.push(e);
102553
102736
  }
102554
102737
  try {
102555
- const binding = require2("@tursodatabase/database-linux-arm64-musl");
102556
- const bindingPackageVersion = require2("@tursodatabase/database-linux-arm64-musl/package.json").version;
102557
- if (bindingPackageVersion !== "0.3.0-pre.4" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
102558
- throw new Error(`Native binding package version mismatch, expected 0.3.0-pre.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
102738
+ const binding = require2("@tursodatabase/sync-linux-arm64-musl");
102739
+ const bindingPackageVersion = require2("@tursodatabase/sync-linux-arm64-musl/package.json").version;
102740
+ if (bindingPackageVersion !== "0.4.0-pre.18" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
102741
+ throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
102559
102742
  }
102560
102743
  return binding;
102561
102744
  } catch (e) {
@@ -102563,15 +102746,15 @@ function requireNative() {
102563
102746
  }
102564
102747
  } else {
102565
102748
  try {
102566
- return require2("./turso.linux-arm64-gnu.node");
102749
+ return require2("./sync.linux-arm64-gnu.node");
102567
102750
  } catch (e) {
102568
102751
  loadErrors.push(e);
102569
102752
  }
102570
102753
  try {
102571
- const binding = require2("@tursodatabase/database-linux-arm64-gnu");
102572
- const bindingPackageVersion = require2("@tursodatabase/database-linux-arm64-gnu/package.json").version;
102573
- if (bindingPackageVersion !== "0.3.0-pre.4" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
102574
- throw new Error(`Native binding package version mismatch, expected 0.3.0-pre.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
102754
+ const binding = require2("@tursodatabase/sync-linux-arm64-gnu");
102755
+ const bindingPackageVersion = require2("@tursodatabase/sync-linux-arm64-gnu/package.json").version;
102756
+ if (bindingPackageVersion !== "0.4.0-pre.18" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
102757
+ throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
102575
102758
  }
102576
102759
  return binding;
102577
102760
  } catch (e) {
@@ -102581,15 +102764,15 @@ function requireNative() {
102581
102764
  } else if (process.arch === "arm") {
102582
102765
  if (isMusl()) {
102583
102766
  try {
102584
- return require2("./turso.linux-arm-musleabihf.node");
102767
+ return require2("./sync.linux-arm-musleabihf.node");
102585
102768
  } catch (e) {
102586
102769
  loadErrors.push(e);
102587
102770
  }
102588
102771
  try {
102589
- const binding = require2("@tursodatabase/database-linux-arm-musleabihf");
102590
- const bindingPackageVersion = require2("@tursodatabase/database-linux-arm-musleabihf/package.json").version;
102591
- if (bindingPackageVersion !== "0.3.0-pre.4" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
102592
- throw new Error(`Native binding package version mismatch, expected 0.3.0-pre.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
102772
+ const binding = require2("@tursodatabase/sync-linux-arm-musleabihf");
102773
+ const bindingPackageVersion = require2("@tursodatabase/sync-linux-arm-musleabihf/package.json").version;
102774
+ if (bindingPackageVersion !== "0.4.0-pre.18" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
102775
+ throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
102593
102776
  }
102594
102777
  return binding;
102595
102778
  } catch (e) {
@@ -102597,15 +102780,15 @@ function requireNative() {
102597
102780
  }
102598
102781
  } else {
102599
102782
  try {
102600
- return require2("./turso.linux-arm-gnueabihf.node");
102783
+ return require2("./sync.linux-arm-gnueabihf.node");
102601
102784
  } catch (e) {
102602
102785
  loadErrors.push(e);
102603
102786
  }
102604
102787
  try {
102605
- const binding = require2("@tursodatabase/database-linux-arm-gnueabihf");
102606
- const bindingPackageVersion = require2("@tursodatabase/database-linux-arm-gnueabihf/package.json").version;
102607
- if (bindingPackageVersion !== "0.3.0-pre.4" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
102608
- throw new Error(`Native binding package version mismatch, expected 0.3.0-pre.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
102788
+ const binding = require2("@tursodatabase/sync-linux-arm-gnueabihf");
102789
+ const bindingPackageVersion = require2("@tursodatabase/sync-linux-arm-gnueabihf/package.json").version;
102790
+ if (bindingPackageVersion !== "0.4.0-pre.18" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
102791
+ throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
102609
102792
  }
102610
102793
  return binding;
102611
102794
  } catch (e) {
@@ -102615,15 +102798,15 @@ function requireNative() {
102615
102798
  } else if (process.arch === "riscv64") {
102616
102799
  if (isMusl()) {
102617
102800
  try {
102618
- return require2("./turso.linux-riscv64-musl.node");
102801
+ return require2("./sync.linux-riscv64-musl.node");
102619
102802
  } catch (e) {
102620
102803
  loadErrors.push(e);
102621
102804
  }
102622
102805
  try {
102623
- const binding = require2("@tursodatabase/database-linux-riscv64-musl");
102624
- const bindingPackageVersion = require2("@tursodatabase/database-linux-riscv64-musl/package.json").version;
102625
- if (bindingPackageVersion !== "0.3.0-pre.4" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
102626
- throw new Error(`Native binding package version mismatch, expected 0.3.0-pre.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
102806
+ const binding = require2("@tursodatabase/sync-linux-riscv64-musl");
102807
+ const bindingPackageVersion = require2("@tursodatabase/sync-linux-riscv64-musl/package.json").version;
102808
+ if (bindingPackageVersion !== "0.4.0-pre.18" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
102809
+ throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
102627
102810
  }
102628
102811
  return binding;
102629
102812
  } catch (e) {
@@ -102631,15 +102814,15 @@ function requireNative() {
102631
102814
  }
102632
102815
  } else {
102633
102816
  try {
102634
- return require2("./turso.linux-riscv64-gnu.node");
102817
+ return require2("./sync.linux-riscv64-gnu.node");
102635
102818
  } catch (e) {
102636
102819
  loadErrors.push(e);
102637
102820
  }
102638
102821
  try {
102639
- const binding = require2("@tursodatabase/database-linux-riscv64-gnu");
102640
- const bindingPackageVersion = require2("@tursodatabase/database-linux-riscv64-gnu/package.json").version;
102641
- if (bindingPackageVersion !== "0.3.0-pre.4" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
102642
- throw new Error(`Native binding package version mismatch, expected 0.3.0-pre.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
102822
+ const binding = require2("@tursodatabase/sync-linux-riscv64-gnu");
102823
+ const bindingPackageVersion = require2("@tursodatabase/sync-linux-riscv64-gnu/package.json").version;
102824
+ if (bindingPackageVersion !== "0.4.0-pre.18" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
102825
+ throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
102643
102826
  }
102644
102827
  return binding;
102645
102828
  } catch (e) {
@@ -102648,15 +102831,15 @@ function requireNative() {
102648
102831
  }
102649
102832
  } else if (process.arch === "ppc64") {
102650
102833
  try {
102651
- return require2("./turso.linux-ppc64-gnu.node");
102834
+ return require2("./sync.linux-ppc64-gnu.node");
102652
102835
  } catch (e) {
102653
102836
  loadErrors.push(e);
102654
102837
  }
102655
102838
  try {
102656
- const binding = require2("@tursodatabase/database-linux-ppc64-gnu");
102657
- const bindingPackageVersion = require2("@tursodatabase/database-linux-ppc64-gnu/package.json").version;
102658
- if (bindingPackageVersion !== "0.3.0-pre.4" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
102659
- throw new Error(`Native binding package version mismatch, expected 0.3.0-pre.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
102839
+ const binding = require2("@tursodatabase/sync-linux-ppc64-gnu");
102840
+ const bindingPackageVersion = require2("@tursodatabase/sync-linux-ppc64-gnu/package.json").version;
102841
+ if (bindingPackageVersion !== "0.4.0-pre.18" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
102842
+ throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
102660
102843
  }
102661
102844
  return binding;
102662
102845
  } catch (e) {
@@ -102664,15 +102847,15 @@ function requireNative() {
102664
102847
  }
102665
102848
  } else if (process.arch === "s390x") {
102666
102849
  try {
102667
- return require2("./turso.linux-s390x-gnu.node");
102850
+ return require2("./sync.linux-s390x-gnu.node");
102668
102851
  } catch (e) {
102669
102852
  loadErrors.push(e);
102670
102853
  }
102671
102854
  try {
102672
- const binding = require2("@tursodatabase/database-linux-s390x-gnu");
102673
- const bindingPackageVersion = require2("@tursodatabase/database-linux-s390x-gnu/package.json").version;
102674
- if (bindingPackageVersion !== "0.3.0-pre.4" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
102675
- throw new Error(`Native binding package version mismatch, expected 0.3.0-pre.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
102855
+ const binding = require2("@tursodatabase/sync-linux-s390x-gnu");
102856
+ const bindingPackageVersion = require2("@tursodatabase/sync-linux-s390x-gnu/package.json").version;
102857
+ if (bindingPackageVersion !== "0.4.0-pre.18" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
102858
+ throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
102676
102859
  }
102677
102860
  return binding;
102678
102861
  } catch (e) {
@@ -102684,15 +102867,15 @@ function requireNative() {
102684
102867
  } else if (process.platform === "openharmony") {
102685
102868
  if (process.arch === "arm64") {
102686
102869
  try {
102687
- return require2("./turso.openharmony-arm64.node");
102870
+ return require2("./sync.openharmony-arm64.node");
102688
102871
  } catch (e) {
102689
102872
  loadErrors.push(e);
102690
102873
  }
102691
102874
  try {
102692
- const binding = require2("@tursodatabase/database-openharmony-arm64");
102693
- const bindingPackageVersion = require2("@tursodatabase/database-openharmony-arm64/package.json").version;
102694
- if (bindingPackageVersion !== "0.3.0-pre.4" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
102695
- throw new Error(`Native binding package version mismatch, expected 0.3.0-pre.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
102875
+ const binding = require2("@tursodatabase/sync-openharmony-arm64");
102876
+ const bindingPackageVersion = require2("@tursodatabase/sync-openharmony-arm64/package.json").version;
102877
+ if (bindingPackageVersion !== "0.4.0-pre.18" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
102878
+ throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
102696
102879
  }
102697
102880
  return binding;
102698
102881
  } catch (e) {
@@ -102700,15 +102883,15 @@ function requireNative() {
102700
102883
  }
102701
102884
  } else if (process.arch === "x64") {
102702
102885
  try {
102703
- return require2("./turso.openharmony-x64.node");
102886
+ return require2("./sync.openharmony-x64.node");
102704
102887
  } catch (e) {
102705
102888
  loadErrors.push(e);
102706
102889
  }
102707
102890
  try {
102708
- const binding = require2("@tursodatabase/database-openharmony-x64");
102709
- const bindingPackageVersion = require2("@tursodatabase/database-openharmony-x64/package.json").version;
102710
- if (bindingPackageVersion !== "0.3.0-pre.4" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
102711
- throw new Error(`Native binding package version mismatch, expected 0.3.0-pre.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
102891
+ const binding = require2("@tursodatabase/sync-openharmony-x64");
102892
+ const bindingPackageVersion = require2("@tursodatabase/sync-openharmony-x64/package.json").version;
102893
+ if (bindingPackageVersion !== "0.4.0-pre.18" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
102894
+ throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
102712
102895
  }
102713
102896
  return binding;
102714
102897
  } catch (e) {
@@ -102716,15 +102899,15 @@ function requireNative() {
102716
102899
  }
102717
102900
  } else if (process.arch === "arm") {
102718
102901
  try {
102719
- return require2("./turso.openharmony-arm.node");
102902
+ return require2("./sync.openharmony-arm.node");
102720
102903
  } catch (e) {
102721
102904
  loadErrors.push(e);
102722
102905
  }
102723
102906
  try {
102724
- const binding = require2("@tursodatabase/database-openharmony-arm");
102725
- const bindingPackageVersion = require2("@tursodatabase/database-openharmony-arm/package.json").version;
102726
- if (bindingPackageVersion !== "0.3.0-pre.4" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
102727
- throw new Error(`Native binding package version mismatch, expected 0.3.0-pre.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
102907
+ const binding = require2("@tursodatabase/sync-openharmony-arm");
102908
+ const bindingPackageVersion = require2("@tursodatabase/sync-openharmony-arm/package.json").version;
102909
+ if (bindingPackageVersion !== "0.4.0-pre.18" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
102910
+ throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
102728
102911
  }
102729
102912
  return binding;
102730
102913
  } catch (e) {
@@ -102740,7 +102923,7 @@ function requireNative() {
102740
102923
  nativeBinding = requireNative();
102741
102924
  if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
102742
102925
  try {
102743
- nativeBinding = require2("./turso.wasi.cjs");
102926
+ nativeBinding = require2("./sync.wasi.cjs");
102744
102927
  } catch (err2) {
102745
102928
  if (process.env.NAPI_RS_FORCE_WASI) {
102746
102929
  loadErrors.push(err2);
@@ -102748,7 +102931,7 @@ if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
102748
102931
  }
102749
102932
  if (!nativeBinding) {
102750
102933
  try {
102751
- nativeBinding = require2("@tursodatabase/database-wasm32-wasi");
102934
+ nativeBinding = require2("@tursodatabase/sync-wasm32-wasi");
102752
102935
  } catch (err2) {
102753
102936
  if (process.env.NAPI_RS_FORCE_WASI) {
102754
102937
  loadErrors.push(err2);
@@ -102762,16 +102945,175 @@ if (!nativeBinding) {
102762
102945
  }
102763
102946
  throw new Error(`Failed to load native binding`);
102764
102947
  }
102765
- var { BatchExecutor, Database: Database3, Statement: Statement3 } = nativeBinding;
102948
+ var { BatchExecutor, Database: Database3, Statement: Statement3, GeneratorHolder, JsDataCompletion, JsProtocolIo, JsProtocolRequestBytes, SyncEngine, SyncEngineChanges, DatabaseChangeTypeJs, SyncEngineProtocolVersion } = nativeBinding;
102949
+
102950
+ // ../../node_modules/.bun/@tursodatabase+sync@0.4.4/node_modules/@tursodatabase/sync/dist/promise.js
102951
+ import { promises as promises2 } from "fs";
102952
+ var NodeIO = {
102953
+ async read(path4) {
102954
+ try {
102955
+ return await promises2.readFile(path4);
102956
+ } catch (error51) {
102957
+ if (error51.code === "ENOENT") {
102958
+ return null;
102959
+ }
102960
+ throw error51;
102961
+ }
102962
+ },
102963
+ async write(path4, data) {
102964
+ const unix = Math.floor(Date.now() / 1000);
102965
+ const nonce = Math.floor(Math.random() * 1e9);
102966
+ const tmp2 = `${path4}.tmp.${unix}.${nonce}`;
102967
+ await promises2.writeFile(tmp2, new Uint8Array(data));
102968
+ try {
102969
+ await promises2.rename(tmp2, path4);
102970
+ } catch (err2) {
102971
+ await promises2.unlink(tmp2);
102972
+ throw err2;
102973
+ }
102974
+ }
102975
+ };
102976
+ function memoryIO2() {
102977
+ let values3 = new Map;
102978
+ return {
102979
+ async read(path4) {
102980
+ return values3.get(path4);
102981
+ },
102982
+ async write(path4, data) {
102983
+ values3.set(path4, data);
102984
+ }
102985
+ };
102986
+ }
102766
102987
 
102767
- // ../../node_modules/.bun/@tursodatabase+database@0.4.4/node_modules/@tursodatabase/database/dist/promise.js
102768
102988
  class Database4 extends Database {
102769
- constructor(path4, opts = {}) {
102770
- super(new Database3(path4, opts));
102989
+ #engine;
102990
+ #guards;
102991
+ #runner;
102992
+ constructor(opts) {
102993
+ if (opts.url == null) {
102994
+ super(new Database3(opts.path, { tracing: opts.tracing }));
102995
+ this.#engine = null;
102996
+ return;
102997
+ }
102998
+ let partialSyncOpts = undefined;
102999
+ if (opts.partialSyncExperimental != null) {
103000
+ switch (opts.partialSyncExperimental.bootstrapStrategy.kind) {
103001
+ case "prefix":
103002
+ partialSyncOpts = {
103003
+ bootstrapStrategy: { type: "Prefix", length: opts.partialSyncExperimental.bootstrapStrategy.length },
103004
+ segmentSize: opts.partialSyncExperimental.segmentSize,
103005
+ prefetch: opts.partialSyncExperimental.prefetch
103006
+ };
103007
+ break;
103008
+ case "query":
103009
+ partialSyncOpts = {
103010
+ bootstrapStrategy: { type: "Query", query: opts.partialSyncExperimental.bootstrapStrategy.query },
103011
+ segmentSize: opts.partialSyncExperimental.segmentSize,
103012
+ prefetch: opts.partialSyncExperimental.prefetch
103013
+ };
103014
+ break;
103015
+ }
103016
+ }
103017
+ const engine = new SyncEngine({
103018
+ path: opts.path,
103019
+ clientName: opts.clientName,
103020
+ useTransform: opts.transform != null,
103021
+ protocolVersion: "v1",
103022
+ longPollTimeoutMs: opts.longPollTimeoutMs,
103023
+ tracing: opts.tracing,
103024
+ bootstrapIfEmpty: typeof opts.url != "function" || opts.url() != null,
103025
+ remoteEncryption: opts.remoteEncryption?.cipher,
103026
+ partialSyncOpts
103027
+ });
103028
+ let headers;
103029
+ if (typeof opts.authToken == "function") {
103030
+ const authToken = opts.authToken;
103031
+ headers = async () => ({
103032
+ ...opts.authToken != null && { Authorization: `Bearer ${await authToken()}` },
103033
+ ...opts.remoteEncryption != null && {
103034
+ "x-turso-encryption-key": opts.remoteEncryption.key,
103035
+ "x-turso-encryption-cipher": opts.remoteEncryption.cipher
103036
+ }
103037
+ });
103038
+ } else {
103039
+ const authToken = opts.authToken;
103040
+ headers = {
103041
+ ...opts.authToken != null && { Authorization: `Bearer ${authToken}` },
103042
+ ...opts.remoteEncryption != null && {
103043
+ "x-turso-encryption-key": opts.remoteEncryption.key,
103044
+ "x-turso-encryption-cipher": opts.remoteEncryption.cipher
103045
+ }
103046
+ };
103047
+ }
103048
+ const runOpts = {
103049
+ url: opts.url,
103050
+ headers,
103051
+ preemptionMs: 1,
103052
+ transform: opts.transform
103053
+ };
103054
+ const db = engine.db();
103055
+ const memory = db.memory;
103056
+ const io = memory ? memoryIO2() : NodeIO;
103057
+ const run11 = runner(runOpts, io, engine);
103058
+ super(engine.db(), () => run11.wait());
103059
+ this.#runner = run11;
103060
+ this.#engine = engine;
103061
+ this.#guards = new SyncEngineGuards;
103062
+ }
103063
+ async connect() {
103064
+ if (this.connected) {
103065
+ return;
103066
+ } else if (this.#engine == null) {
103067
+ await super.connect();
103068
+ } else {
103069
+ await run10(this.#runner, this.#engine.connect());
103070
+ }
103071
+ this.connected = true;
103072
+ }
103073
+ async pull() {
103074
+ if (this.#engine == null) {
103075
+ throw new Error("sync is disabled as database was opened without sync support");
103076
+ }
103077
+ const changes2 = await this.#guards.wait(async () => await run10(this.#runner, this.#engine.wait()));
103078
+ if (changes2.empty()) {
103079
+ return false;
103080
+ }
103081
+ await this.#guards.apply(async () => await run10(this.#runner, this.#engine.apply(changes2)));
103082
+ return true;
103083
+ }
103084
+ async push() {
103085
+ if (this.#engine == null) {
103086
+ throw new Error("sync is disabled as database was opened without sync support");
103087
+ }
103088
+ await this.#guards.push(async () => await run10(this.#runner, this.#engine.push()));
103089
+ }
103090
+ async checkpoint() {
103091
+ if (this.#engine == null) {
103092
+ throw new Error("sync is disabled as database was opened without sync support");
103093
+ }
103094
+ await this.#guards.checkpoint(async () => await run10(this.#runner, this.#engine.checkpoint()));
103095
+ }
103096
+ async stats() {
103097
+ if (this.#engine == null) {
103098
+ throw new Error("sync is disabled as database was opened without sync support");
103099
+ }
103100
+ return await run10(this.#runner, this.#engine.stats());
103101
+ }
103102
+ async close() {
103103
+ await super.close();
103104
+ if (this.#engine != null) {
103105
+ this.#engine.close();
103106
+ }
102771
103107
  }
102772
103108
  }
103109
+ async function connect2(opts) {
103110
+ const db = new Database4(opts);
103111
+ await db.connect();
103112
+ return db;
103113
+ }
102773
103114
 
102774
103115
  // ../../node_modules/.bun/agentfs-sdk@0.6.2/node_modules/agentfs-sdk/dist/index_node.js
103116
+ import { Database as Database5 } from "@tursodatabase/database";
102775
103117
  import { existsSync, mkdirSync } from "fs";
102776
103118
 
102777
103119
  // ../../node_modules/.bun/agentfs-sdk@0.6.2/node_modules/agentfs-sdk/dist/agentfs.js
@@ -104123,7 +104465,7 @@ class AgentFS2 extends AgentFSCore {
104123
104465
  }
104124
104466
  dbPath = `${dir2}/${id2}.db`;
104125
104467
  }
104126
- const db = new Database4(dbPath);
104468
+ const db = new Database5(dbPath);
104127
104469
  await db.connect();
104128
104470
  return await this.openWith(db);
104129
104471
  }
@@ -104237,7 +104579,7 @@ var CodebaseScannerAgentFs = scoped3(CodebaseScanner, gen2(function* () {
104237
104579
  yield* forEach5(entries2, (entry) => gen2(function* () {
104238
104580
  const normalizedPath = path5 === "/" ? "" : path5.replace(/\/$/, "");
104239
104581
  const normalizedEntry = entry.replace(/^\//, "");
104240
- const fullPath = normalizedPath + normalizedEntry;
104582
+ const fullPath = normalizedPath + "/" + normalizedEntry;
104241
104583
  const stats = yield* useAgentFs((a) => a.fs.stat(fullPath));
104242
104584
  if (stats.isDirectory()) {
104243
104585
  const subFiles = yield* readDirRecursiveAgentFs(fullPath);
@@ -109515,7 +109857,7 @@ var layer20 = (config3) => scopedContext2(map16(make78(config3), (client) => mak
109515
109857
  // ../../node_modules/.bun/@effect+sql-libsql@0.39.0+d00fac6ed6378613/node_modules/@effect/sql-libsql/dist/esm/LibsqlMigrator.js
109516
109858
  var exports_LibsqlMigrator = {};
109517
109859
  __export(exports_LibsqlMigrator, {
109518
- run: () => run10,
109860
+ run: () => run11,
109519
109861
  make: () => make73,
109520
109862
  layer: () => layer21,
109521
109863
  fromRecord: () => fromRecord,
@@ -109534,8 +109876,8 @@ var fromFileSystem = (directory5) => FileSystem.pipe(flatMap10((FS) => FS.readDi
109534
109876
  })).sort(([a], [b]) => a - b)));
109535
109877
 
109536
109878
  // ../../node_modules/.bun/@effect+sql-libsql@0.39.0+d00fac6ed6378613/node_modules/@effect/sql-libsql/dist/esm/LibsqlMigrator.js
109537
- var run10 = /* @__PURE__ */ make73({});
109538
- var layer21 = (options7) => effectDiscard(run10(options7));
109879
+ var run11 = /* @__PURE__ */ make73({});
109880
+ var layer21 = (options7) => effectDiscard(run11(options7));
109539
109881
  // ../../node_modules/.bun/@effect+sql-pg@0.50.1+d00fac6ed6378613/node_modules/@effect/sql-pg/dist/esm/PgClient.js
109540
109882
  var exports_PgClient = {};
109541
109883
  __export(exports_PgClient, {
@@ -109889,7 +110231,7 @@ var PgJson = /* @__PURE__ */ custom4("PgJson");
109889
110231
  // ../../node_modules/.bun/@effect+sql-pg@0.50.1+d00fac6ed6378613/node_modules/@effect/sql-pg/dist/esm/PgMigrator.js
109890
110232
  var exports_PgMigrator = {};
109891
110233
  __export(exports_PgMigrator, {
109892
- run: () => run11,
110234
+ run: () => run12,
109893
110235
  make: () => make73,
109894
110236
  layer: () => layer23,
109895
110237
  fromRecord: () => fromRecord,
@@ -109898,7 +110240,7 @@ __export(exports_PgMigrator, {
109898
110240
  fromBabelGlob: () => fromBabelGlob,
109899
110241
  MigrationError: () => MigrationError
109900
110242
  });
109901
- var run11 = /* @__PURE__ */ make73({
110243
+ var run12 = /* @__PURE__ */ make73({
109902
110244
  dumpSchema(path4, table2) {
109903
110245
  const pgDump = (args3) => gen2(function* () {
109904
110246
  const sql = yield* PgClient;
@@ -109940,7 +110282,7 @@ var run11 = /* @__PURE__ */ make73({
109940
110282
  return pgDumpFile(path4);
109941
110283
  }
109942
110284
  });
109943
- var layer23 = (options7) => effectDiscard(run11(options7));
110285
+ var layer23 = (options7) => effectDiscard(run12(options7));
109944
110286
  // ../core/src/internal/services/sql.ts
109945
110287
  var Migrations2 = (config3) => exports_Migrator.fromRecord({
109946
110288
  "0001_create_documents_table": gen2(function* () {
@@ -112134,11 +112476,11 @@ var program = gen2(function* () {
112134
112476
  const command = exports_Command.make("grepai").pipe(exports_Command.withSubcommands([indexCommand, searchCommand]));
112135
112477
  const cli = exports_Command.run(command, {
112136
112478
  name: "GREP AI",
112137
- version: "v0.7.0"
112479
+ version: "v0.7.2"
112138
112480
  });
112139
112481
  yield* cli(process.argv);
112140
112482
  });
112141
112483
  program.pipe(provide2(mergeAll5(GrepAi.Default).pipe(provideMerge2(Clack.Default), provideMerge2(exports_BunContext.layer))), exports_BunRuntime.runMain);
112142
112484
 
112143
- //# debugId=039C99EDE759421464756E2164756E21
112485
+ //# debugId=7BD0B0EB6FAF885664756E2164756E21
112144
112486
  //# sourceMappingURL=index.js.map