@grepai/cli 0.7.9 → 0.8.1

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 +22 -17
  2. package/index.js.map +7 -7
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -29579,6 +29579,10 @@ var Equivalence = (self2, that) => matchWith(self2, that, {
29579
29579
  onMillis: (self3, that2) => self3 === that2,
29580
29580
  onNanos: (self3, that2) => self3 === that2
29581
29581
  });
29582
+ var times = /* @__PURE__ */ dual(2, (self2, times2) => match4(self2, {
29583
+ onMillis: (millis2) => make8(millis2 * times2),
29584
+ onNanos: (nanos2) => make8(nanos2 * BigInt(times2))
29585
+ }));
29582
29586
  var sum = /* @__PURE__ */ dual(2, (self2, that) => matchWith(self2, that, {
29583
29587
  onMillis: (self3, that2) => make8(self3 + that2),
29584
29588
  onNanos: (self3, that2) => make8(self3 + that2)
@@ -38857,7 +38861,12 @@ var checkEffect = /* @__PURE__ */ dual(2, (self2, test) => makeWithState(self2.i
38857
38861
  }
38858
38862
  return map11(test(input, out2), (cont) => cont ? [state2, out2, decision] : [state2, out2, done5]);
38859
38863
  })));
38864
+ var delayedSchedule = (schedule) => addDelay(schedule, (x) => x);
38860
38865
  var driver = (self2) => pipe(make24([none2(), self2.initial]), map11((ref) => new ScheduleDriverImpl(self2, ref)));
38866
+ var exponential2 = (baseInput, factor = 2) => {
38867
+ const base = decode(baseInput);
38868
+ return delayedSchedule(map15(forever2, (i2) => times(base, Math.pow(factor, i2))));
38869
+ };
38861
38870
  var intersect5 = /* @__PURE__ */ dual(2, (self2, that) => intersectWith(self2, that, intersect4));
38862
38871
  var intersectWith = /* @__PURE__ */ dual(3, (self2, that, f) => makeWithState([self2.initial, that.initial], (now, input, state) => pipe(zipWith2(self2.step(now, input, state[0]), that.step(now, input, state[1]), (a, b) => [a, b]), flatMap7(([[lState, out2, lDecision], [rState, out22, rDecision]]) => {
38863
38872
  if (isContinue2(lDecision) && isContinue2(rDecision)) {
@@ -43948,6 +43957,7 @@ var updateContext3 = updateContext2;
43948
43957
 
43949
43958
  // ../../node_modules/.bun/effect@3.19.15/node_modules/effect/dist/esm/Schedule.js
43950
43959
  var ScheduleTypeId2 = ScheduleTypeId;
43960
+ var exponential3 = exponential2;
43951
43961
  var passthrough3 = passthrough;
43952
43962
  var spaced2 = spaced;
43953
43963
 
@@ -105875,7 +105885,7 @@ RecordBatchStreamWriter["throughDOM"] = recordBatchWriterThroughDOMStream;
105875
105885
 
105876
105886
  // ../core/src/internal/services/lancedb.ts
105877
105887
  var CHUNK_TABLE = "chunks";
105878
- var FLUSH_INSERT_QUEUE_THRESHOLD = 100;
105888
+ var FLUSH_INSERT_QUEUE_THRESHOLD = 1000;
105879
105889
 
105880
105890
  class LanceDb extends Service()("@grepai/core/internal/services/lancedb", {
105881
105891
  scoped: gen2(function* () {
@@ -105924,7 +105934,7 @@ class LanceDb extends Service()("@grepai/core/internal/services/lancedb", {
105924
105934
  cause: "Failed to insert chunk embeddings. Could not find chunk or document."
105925
105935
  })
105926
105936
  }));
105927
- if (keys(documentInsertQueue).length >= FLUSH_INSERT_QUEUE_THRESHOLD) {
105937
+ if (insertQueue.length >= FLUSH_INSERT_QUEUE_THRESHOLD) {
105928
105938
  yield* flushInsertQueue();
105929
105939
  }
105930
105940
  });
@@ -110103,7 +110113,11 @@ var CodebaseScannerAgentFs = scoped3(CodebaseScanner, gen2(function* () {
110103
110113
  if (syncMode === "push") {
110104
110114
  const results = yield* scanFs();
110105
110115
  const { new: newFiles, modified, deleted } = results;
110106
- yield* forEach5([...newFiles, ...modified], ({ filePath, content }) => agentFs.use((a) => a.fs.writeFile(filePath, content)), { concurrency: "unbounded" });
110116
+ yield* forEach5([...newFiles, ...modified], ({ filePath, content }) => agentFs.use((a) => a.fs.writeFile(filePath, content)).pipe(retry({
110117
+ times: 10,
110118
+ schedule: exponential3("50 millis"),
110119
+ while: (cause2) => cause2.message.includes("UNIQUE constraint failed: fs_dentry")
110120
+ })), { concurrency: "unbounded" });
110107
110121
  yield* forEach5(deleted, ({ filePath }) => agentFs.use((a) => a.fs.deleteFile(filePath)), { concurrency: "unbounded" });
110108
110122
  yield* agentFs.dbPush();
110109
110123
  return results;
@@ -110498,16 +110512,7 @@ class FileIndexer extends Service()("@grepai/core/internal/services/file-indexer
110498
110512
  const embeddings = yield* forEach5(chunkBatches, (chunks3) => embedder.embedMany(map4(chunks3, ({ content: content2 }) => content2)).pipe(map16(map4((embedding, index2) => ({
110499
110513
  chunkId: chunks3[index2].id,
110500
110514
  embedding
110501
- }))), catchTags2({
110502
- VercelAiError: (cause2) => {
110503
- if (cause2.message.includes("at most 100 requests")) {
110504
- return new VercelAiError({
110505
- cause: new Error(cause2.message + " " + input.filePath)
110506
- });
110507
- }
110508
- return cause2;
110509
- }
110510
- }))).pipe(map16(flatten));
110515
+ }))))).pipe(map16(flatten));
110511
110516
  yield* pipe(documentStorage.insert({ filePath, hash: hash3 }), zipRight3(chunkStorage.insertMany(chunks2)), zipRight3(chunkStorage.insertManyEmbeddings(embeddings)));
110512
110517
  }, (effect3) => match2(db, {
110513
110518
  onNone: () => effect3,
@@ -110597,13 +110602,13 @@ class Indexer extends Service()("@grepai/core/internal/services/indexer", {
110597
110602
  filePath,
110598
110603
  fileCount: filesToClean.length
110599
110604
  }))), {
110600
- concurrency: value5(config3.storage.type).pipe(when5("turso", () => 1), when5("postgres", () => 100), when5("lancedb", () => 10), exhaustive2)
110605
+ concurrency: value5(config3.storage.type).pipe(when5("turso", () => 1), when5("postgres", () => 100), when5("lancedb", () => 50), exhaustive2)
110601
110606
  });
110602
110607
  yield* forEach5(filesToIndex, (file8) => fileIndexer.index(file8).pipe(tap2(() => onFileIndexed({
110603
110608
  filePath: file8.filePath,
110604
110609
  fileCount: filesToIndex.length
110605
110610
  }))), {
110606
- concurrency: value5(config3.storage.type).pipe(when5("turso", () => 1), when5("postgres", () => 100), when5("lancedb", () => 10), exhaustive2)
110611
+ concurrency: value5(config3.storage.type).pipe(when5("turso", () => 1), when5("postgres", () => 100), when5("lancedb", () => 50), exhaustive2)
110607
110612
  });
110608
110613
  yield* onFinished();
110609
110614
  });
@@ -118254,11 +118259,11 @@ var program = gen2(function* () {
118254
118259
  const command = exports_Command.make("grepai").pipe(exports_Command.withSubcommands(subcommands));
118255
118260
  const cli = exports_Command.run(command, {
118256
118261
  name: "GREP AI",
118257
- version: "v0.7.9"
118262
+ version: "v0.8.1"
118258
118263
  });
118259
118264
  yield* cli(process.argv);
118260
118265
  });
118261
118266
  program.pipe(provide2(ProjectScanner.Default.pipe(provideMerge2(exports_BunContext.layer))), exports_BunRuntime.runMain);
118262
118267
 
118263
- //# debugId=9D8B014BC75A7CEC64756E2164756E21
118268
+ //# debugId=C493F6813D74B44664756E2164756E21
118264
118269
  //# sourceMappingURL=index.js.map