@optiqcode/cli 2.6.0 → 2.7.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.
- package/dist/index.js +9 -8
- 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.
|
|
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
|
|
302
|
-
const BATCH_SIZE =
|
|
301
|
+
// Upload in batches
|
|
302
|
+
const BATCH_SIZE = 50;
|
|
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 =
|
|
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
|
|
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:
|
|
332
|
+
timeout: 300000, // 5 minutes per batch
|
|
332
333
|
});
|
|
333
334
|
if (!response.data.success) {
|
|
334
335
|
spinner.fail(chalk.red('Indexing failed'));
|
|
@@ -421,7 +422,7 @@ async function watchDirectory(targetPath, config) {
|
|
|
421
422
|
headers: {
|
|
422
423
|
'Content-Type': 'application/json',
|
|
423
424
|
},
|
|
424
|
-
timeout:
|
|
425
|
+
timeout: 300000, // 5 minutes per batch
|
|
425
426
|
});
|
|
426
427
|
if (!response.data.success) {
|
|
427
428
|
spinner.fail(chalk.red('Failed'));
|