scai 0.1.72 → 0.1.73
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.
|
@@ -3,7 +3,7 @@ import path from 'path';
|
|
|
3
3
|
import readline from 'readline';
|
|
4
4
|
import { queryFiles, indexFile } from '../db/fileIndex.js';
|
|
5
5
|
import { summaryModule } from '../pipeline/modules/summaryModule.js';
|
|
6
|
-
import {
|
|
6
|
+
import { styleOutput } from '../utils/summarizer.js';
|
|
7
7
|
import { detectFileType } from '../fileRules/detectFileType.js';
|
|
8
8
|
import { generateEmbedding } from '../lib/generateEmbedding.js';
|
|
9
9
|
import { sanitizeQueryForFts } from '../utils/sanitizeQuery.js';
|
|
@@ -31,7 +31,7 @@ export async function summarizeFile(filepath) {
|
|
|
31
31
|
const match = matches.find(row => path.resolve(row.path) === filePathResolved);
|
|
32
32
|
if (match?.summary) {
|
|
33
33
|
console.log(`🧠 Cached summary for ${filepath}:\n`);
|
|
34
|
-
console.log(
|
|
34
|
+
console.log(styleOutput(match.summary));
|
|
35
35
|
return;
|
|
36
36
|
}
|
|
37
37
|
try {
|
|
@@ -64,7 +64,7 @@ export async function summarizeFile(filepath) {
|
|
|
64
64
|
console.warn('⚠️ No summary generated.');
|
|
65
65
|
return;
|
|
66
66
|
}
|
|
67
|
-
console.log(
|
|
67
|
+
console.log(styleOutput(response.summary));
|
|
68
68
|
if (filePathResolved) {
|
|
69
69
|
const fileType = detectFileType(filePathResolved);
|
|
70
70
|
indexFile(filePathResolved, response.summary, fileType);
|
package/dist/utils/summarizer.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import columnify from 'columnify';
|
|
2
|
-
export function
|
|
2
|
+
export function styleOutput(summaryText) {
|
|
3
3
|
const terminalWidth = process.stdout.columns || 80;
|
|
4
4
|
// You can control wrapping here
|
|
5
5
|
const formatted = columnify([{ Summary: summaryText }], {
|