@optiqcode/cli 2.6.0 → 2.8.0

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 (2) hide show
  1. package/dist/index.js +10 -9
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -32,7 +32,7 @@ async function showBanner() {
32
32
  |_| |_|
33
33
  `));
34
34
  console.log(chalk.gray(' AI-powered code indexing & search'));
35
- console.log(chalk.gray(' v2.5.0\n'));
35
+ console.log(chalk.gray(' v2.6.0\n'));
36
36
  }
37
37
  function showHelp() {
38
38
  console.log(chalk.cyan.bold('Optiq CLI') + chalk.gray(' - AI-powered code indexing\n'));
@@ -298,20 +298,21 @@ async function indexOnce(targetPath, config) {
298
298
  }
299
299
  // Generate repository ID from path
300
300
  const repoId = generateRepoId(targetPath);
301
- // Upload in small batches to avoid gateway timeouts
302
- const BATCH_SIZE = 5;
301
+ // Upload in batches
302
+ const BATCH_SIZE = 1000;
303
303
  let totalChunks = 0;
304
304
  if (DEBUG) {
305
305
  console.log(chalk.gray(`\n[DEBUG] Sending to: ${ENGINE_URL}/api/v1/index`));
306
306
  console.log(chalk.gray(`[DEBUG] Repo ID: ${repoId}`));
307
307
  console.log(chalk.gray(`[DEBUG] Total files: ${filesArray.length}`));
308
308
  }
309
- spinner.text = 'Indexing...';
309
+ spinner.text = `Indexing ${filesArray.length} files...`;
310
+ const totalBatches = Math.ceil(filesArray.length / BATCH_SIZE);
310
311
  for (let i = 0; i < filesArray.length; i += BATCH_SIZE) {
311
312
  const batch = filesArray.slice(i, i + BATCH_SIZE);
312
313
  const batchNum = Math.floor(i / BATCH_SIZE) + 1;
313
- const totalBatches = Math.ceil(filesArray.length / BATCH_SIZE);
314
- spinner.text = `Indexing... ${batchNum}/${totalBatches}`;
314
+ const filesProcessed = Math.min(i + BATCH_SIZE, filesArray.length);
315
+ spinner.text = `Indexing... ${filesProcessed}/${filesArray.length} files (batch ${batchNum}/${totalBatches})`;
315
316
  if (DEBUG) {
316
317
  console.log(chalk.gray(`\n[DEBUG] Batch ${batchNum}: ${batch.map(f => f.path).join(', ')}`));
317
318
  }
@@ -328,7 +329,7 @@ async function indexOnce(targetPath, config) {
328
329
  headers: {
329
330
  'Content-Type': 'application/json',
330
331
  },
331
- timeout: 120000,
332
+ timeout: 300000, // 5 minutes per batch
332
333
  });
333
334
  if (!response.data.success) {
334
335
  spinner.fail(chalk.red('Indexing failed'));
@@ -402,7 +403,7 @@ async function watchDirectory(targetPath, config) {
402
403
  spinner.text = `Reading... ${Math.min(i + PARALLEL_READS, files.length)}/${files.length}`;
403
404
  }
404
405
  // Upload in small batches to avoid gateway timeouts
405
- const BATCH_SIZE = 50;
406
+ const BATCH_SIZE = 1000;
406
407
  for (let i = 0; i < filesArray.length; i += BATCH_SIZE) {
407
408
  const batch = filesArray.slice(i, i + BATCH_SIZE);
408
409
  const batchNum = Math.floor(i / BATCH_SIZE) + 1;
@@ -421,7 +422,7 @@ async function watchDirectory(targetPath, config) {
421
422
  headers: {
422
423
  'Content-Type': 'application/json',
423
424
  },
424
- timeout: 120000,
425
+ timeout: 300000, // 5 minutes per batch
425
426
  });
426
427
  if (!response.data.success) {
427
428
  spinner.fail(chalk.red('Failed'));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optiqcode/cli",
3
- "version": "2.6.0",
3
+ "version": "2.8.0",
4
4
  "description": "CLI tool for Optiq - automatic code indexing and context engine",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",