ace-tool 0.1.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/config.d.ts +21 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +100 -0
- package/dist/config.js.map +1 -0
- package/dist/index/manager.d.ts +72 -0
- package/dist/index/manager.d.ts.map +1 -0
- package/dist/index/manager.js +428 -0
- package/dist/index/manager.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +102 -0
- package/dist/index.js.map +1 -0
- package/dist/logger.d.ts +34 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +116 -0
- package/dist/logger.js.map +1 -0
- package/dist/prompts/searchContext.d.ts +22 -0
- package/dist/prompts/searchContext.d.ts.map +1 -0
- package/dist/prompts/searchContext.js +83 -0
- package/dist/prompts/searchContext.js.map +1 -0
- package/dist/tools/searchContext.d.ts +23 -0
- package/dist/tools/searchContext.d.ts.map +1 -0
- package/dist/tools/searchContext.js +49 -0
- package/dist/tools/searchContext.js.map +1 -0
- package/dist/utils/projectDetector.d.ts +32 -0
- package/dist/utils/projectDetector.d.ts.map +1 -0
- package/dist/utils/projectDetector.js +102 -0
- package/dist/utils/projectDetector.js.map +1 -0
- package/package.json +48 -0
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 配置模块 - 从命令行参数读取配置
|
|
3
|
+
*/
|
|
4
|
+
export interface Config {
|
|
5
|
+
baseUrl: string;
|
|
6
|
+
token: string;
|
|
7
|
+
batchSize: number;
|
|
8
|
+
maxLinesPerBlob: number;
|
|
9
|
+
textExtensions: Set<string>;
|
|
10
|
+
excludePatterns: string[];
|
|
11
|
+
enableLog: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* 初始化配置
|
|
15
|
+
*/
|
|
16
|
+
export declare function initConfig(): Config;
|
|
17
|
+
/**
|
|
18
|
+
* 获取配置
|
|
19
|
+
*/
|
|
20
|
+
export declare function getConfig(): Config;
|
|
21
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,MAAM;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC5B,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,SAAS,EAAE,OAAO,CAAC;CACpB;AAiED;;GAEG;AACH,wBAAgB,UAAU,IAAI,MAAM,CA6BnC;AAED;;GAEG;AACH,wBAAgB,SAAS,IAAI,MAAM,CAKlC"}
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 配置模块 - 从命令行参数读取配置
|
|
3
|
+
*/
|
|
4
|
+
// 默认支持的文本文件扩展名
|
|
5
|
+
const DEFAULT_TEXT_EXTENSIONS = new Set([
|
|
6
|
+
// 编程语言
|
|
7
|
+
'.py', '.js', '.ts', '.jsx', '.tsx',
|
|
8
|
+
'.java', '.go', '.rs', '.cpp', '.c',
|
|
9
|
+
'.h', '.hpp', '.cs', '.rb', '.php',
|
|
10
|
+
'.swift', '.kt', '.scala', '.clj',
|
|
11
|
+
// 配置和数据
|
|
12
|
+
'.md', '.txt', '.json', '.yaml', '.yml',
|
|
13
|
+
'.toml', '.xml', '.ini', '.conf',
|
|
14
|
+
// Web 相关
|
|
15
|
+
'.html', '.css', '.scss', '.sass', '.less',
|
|
16
|
+
// 脚本
|
|
17
|
+
'.sql', '.sh', '.bash', '.ps1', '.bat',
|
|
18
|
+
'.vue', '.svelte'
|
|
19
|
+
]);
|
|
20
|
+
// 默认排除模式
|
|
21
|
+
const DEFAULT_EXCLUDE_PATTERNS = [
|
|
22
|
+
// 虚拟环境
|
|
23
|
+
'.venv', 'venv', '.env', 'env', 'node_modules',
|
|
24
|
+
// 版本控制
|
|
25
|
+
'.git', '.svn', '.hg',
|
|
26
|
+
// Python 缓存
|
|
27
|
+
'__pycache__', '.pytest_cache', '.mypy_cache',
|
|
28
|
+
'.tox', '.eggs', '*.egg-info',
|
|
29
|
+
// 构建产物
|
|
30
|
+
'dist', 'build', 'target', 'out',
|
|
31
|
+
// IDE 配置
|
|
32
|
+
'.idea', '.vscode', '.vs',
|
|
33
|
+
// 系统文件
|
|
34
|
+
'.DS_Store', 'Thumbs.db',
|
|
35
|
+
// 编译文件
|
|
36
|
+
'*.pyc', '*.pyo', '*.pyd', '*.so', '*.dll',
|
|
37
|
+
// Ace-tool 目录
|
|
38
|
+
'.ace-tool'
|
|
39
|
+
];
|
|
40
|
+
let config = null;
|
|
41
|
+
/**
|
|
42
|
+
* 解析命令行参数
|
|
43
|
+
*/
|
|
44
|
+
function parseArgs() {
|
|
45
|
+
const args = process.argv.slice(2);
|
|
46
|
+
const result = {};
|
|
47
|
+
for (let i = 0; i < args.length; i++) {
|
|
48
|
+
const arg = args[i];
|
|
49
|
+
if (arg === '--base-url' && i + 1 < args.length) {
|
|
50
|
+
result.baseUrl = args[i + 1];
|
|
51
|
+
i++;
|
|
52
|
+
}
|
|
53
|
+
else if (arg === '--token' && i + 1 < args.length) {
|
|
54
|
+
result.token = args[i + 1];
|
|
55
|
+
i++;
|
|
56
|
+
}
|
|
57
|
+
else if (arg === '--enable-log') {
|
|
58
|
+
result.enableLog = true;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return result;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* 初始化配置
|
|
65
|
+
*/
|
|
66
|
+
export function initConfig() {
|
|
67
|
+
const args = parseArgs();
|
|
68
|
+
if (!args.baseUrl) {
|
|
69
|
+
throw new Error('Missing required argument: --base-url');
|
|
70
|
+
}
|
|
71
|
+
if (!args.token) {
|
|
72
|
+
throw new Error('Missing required argument: --token');
|
|
73
|
+
}
|
|
74
|
+
// 确保 baseUrl 包含协议前缀
|
|
75
|
+
let baseUrl = args.baseUrl;
|
|
76
|
+
if (!baseUrl.startsWith('http://') && !baseUrl.startsWith('https://')) {
|
|
77
|
+
baseUrl = `https://${baseUrl}`;
|
|
78
|
+
}
|
|
79
|
+
baseUrl = baseUrl.replace(/\/$/, ''); // 移除末尾斜杠
|
|
80
|
+
config = {
|
|
81
|
+
baseUrl,
|
|
82
|
+
token: args.token,
|
|
83
|
+
batchSize: 10,
|
|
84
|
+
maxLinesPerBlob: 800,
|
|
85
|
+
textExtensions: DEFAULT_TEXT_EXTENSIONS,
|
|
86
|
+
excludePatterns: DEFAULT_EXCLUDE_PATTERNS,
|
|
87
|
+
enableLog: args.enableLog || false
|
|
88
|
+
};
|
|
89
|
+
return config;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* 获取配置
|
|
93
|
+
*/
|
|
94
|
+
export function getConfig() {
|
|
95
|
+
if (!config) {
|
|
96
|
+
throw new Error('Config not initialized. Call initConfig() first.');
|
|
97
|
+
}
|
|
98
|
+
return config;
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAYH,eAAe;AACf,MAAM,uBAAuB,GAAG,IAAI,GAAG,CAAC;IACtC,OAAO;IACP,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM;IACnC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI;IACnC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM;IAClC,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM;IACjC,QAAQ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E,IAAI,CAAC,SAAS,IAAI,KAAK;KACnC,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,SAAS;IACvB,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;IACtE,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 索引管理器 - 管理文件收集、索引和搜索操作
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* 索引结果接口
|
|
6
|
+
*/
|
|
7
|
+
interface IndexResult {
|
|
8
|
+
status: string;
|
|
9
|
+
message: string;
|
|
10
|
+
stats?: {
|
|
11
|
+
total_blobs: number;
|
|
12
|
+
existing_blobs: number;
|
|
13
|
+
new_blobs: number;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 索引管理器类
|
|
18
|
+
*/
|
|
19
|
+
export declare class IndexManager {
|
|
20
|
+
private projectRoot;
|
|
21
|
+
private baseUrl;
|
|
22
|
+
private token;
|
|
23
|
+
private textExtensions;
|
|
24
|
+
private batchSize;
|
|
25
|
+
private maxLinesPerBlob;
|
|
26
|
+
private excludePatterns;
|
|
27
|
+
private indexFilePath;
|
|
28
|
+
private httpClient;
|
|
29
|
+
constructor(projectRoot: string, baseUrl: string, token: string, textExtensions: Set<string>, batchSize: number, maxLinesPerBlob?: number, excludePatterns?: string[]);
|
|
30
|
+
/**
|
|
31
|
+
* 加载 .gitignore 文件
|
|
32
|
+
*/
|
|
33
|
+
private loadGitignore;
|
|
34
|
+
/**
|
|
35
|
+
* 检查路径是否应该被排除
|
|
36
|
+
*/
|
|
37
|
+
private shouldExclude;
|
|
38
|
+
/**
|
|
39
|
+
* 简单的模式匹配
|
|
40
|
+
*/
|
|
41
|
+
private matchPattern;
|
|
42
|
+
/**
|
|
43
|
+
* 加载索引数据
|
|
44
|
+
*/
|
|
45
|
+
private loadIndex;
|
|
46
|
+
/**
|
|
47
|
+
* 保存索引数据
|
|
48
|
+
*/
|
|
49
|
+
private saveIndex;
|
|
50
|
+
/**
|
|
51
|
+
* 将文件内容分割为多个 blob
|
|
52
|
+
*/
|
|
53
|
+
private splitFileContent;
|
|
54
|
+
/**
|
|
55
|
+
* 收集所有文本文件
|
|
56
|
+
*/
|
|
57
|
+
private collectFiles;
|
|
58
|
+
/**
|
|
59
|
+
* 使用指数退避策略重试请求
|
|
60
|
+
*/
|
|
61
|
+
private retryRequest;
|
|
62
|
+
/**
|
|
63
|
+
* 对项目进行索引(支持增量索引)
|
|
64
|
+
*/
|
|
65
|
+
indexProject(): Promise<IndexResult>;
|
|
66
|
+
/**
|
|
67
|
+
* 搜索代码上下文(自动增量索引)
|
|
68
|
+
*/
|
|
69
|
+
searchContext(query: string): Promise<string>;
|
|
70
|
+
}
|
|
71
|
+
export {};
|
|
72
|
+
//# sourceMappingURL=manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../src/index/manager.ts"],"names":[],"mappings":"AAAA;;GAEG;AAqBH;;GAEG;AACH,UAAU,WAAW;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE;QACN,WAAW,EAAE,MAAM,CAAC;QACpB,cAAc,EAAE,MAAM,CAAC;QACvB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;CACH;AAqDD;;GAEG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,cAAc,CAAc;IACpC,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,eAAe,CAAS;IAChC,OAAO,CAAC,eAAe,CAAW;IAClC,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,UAAU,CAAgB;gBAGhC,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,EAC3B,SAAS,EAAE,MAAM,EACjB,eAAe,GAAE,MAAY,EAC7B,eAAe,GAAE,MAAM,EAAO;IAqBhC;;OAEG;IACH,OAAO,CAAC,aAAa;IAkBrB;;OAEG;IACH,OAAO,CAAC,aAAa;IAkCrB;;OAEG;IACH,OAAO,CAAC,YAAY;IAMpB;;OAEG;IACH,OAAO,CAAC,SAAS;IAajB;;OAEG;IACH,OAAO,CAAC,SAAS;IAUjB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IA8CxB;;OAEG;YACW,YAAY;IAiD1B;;OAEG;YACW,YAAY;IAiC1B;;OAEG;IACG,YAAY,IAAI,OAAO,CAAC,WAAW,CAAC;IAqG1C;;OAEG;IACG,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAsDpD"}
|
|
@@ -0,0 +1,428 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 索引管理器 - 管理文件收集、索引和搜索操作
|
|
3
|
+
*/
|
|
4
|
+
import crypto from 'crypto';
|
|
5
|
+
import fs from 'fs';
|
|
6
|
+
import path from 'path';
|
|
7
|
+
import axios from 'axios';
|
|
8
|
+
import iconv from 'iconv-lite';
|
|
9
|
+
import ignore from 'ignore';
|
|
10
|
+
import { logger } from '../logger.js';
|
|
11
|
+
import { getIndexFilePath } from '../utils/projectDetector.js';
|
|
12
|
+
/**
|
|
13
|
+
* 使用多种编码尝试读取文件
|
|
14
|
+
*/
|
|
15
|
+
async function readFileWithEncoding(filePath) {
|
|
16
|
+
const buffer = await fs.promises.readFile(filePath);
|
|
17
|
+
const encodings = ['utf-8', 'gbk', 'gb2312', 'latin1'];
|
|
18
|
+
for (const encoding of encodings) {
|
|
19
|
+
try {
|
|
20
|
+
const content = iconv.decode(buffer, encoding);
|
|
21
|
+
const replacementChars = (content.match(/\uFFFD/g) || []).length;
|
|
22
|
+
if (content.length > 0) {
|
|
23
|
+
if (content.length < 100) {
|
|
24
|
+
if (replacementChars > 5)
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
if (replacementChars / content.length > 0.05)
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
if (encoding !== 'utf-8') {
|
|
33
|
+
logger.debug(`Read ${filePath} with encoding: ${encoding}`);
|
|
34
|
+
}
|
|
35
|
+
return content;
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
const content = iconv.decode(buffer, 'utf-8');
|
|
42
|
+
logger.warning(`Read ${filePath} with utf-8 (some characters may be lost)`);
|
|
43
|
+
return content;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* 计算 blob 名称(SHA-256 哈希)
|
|
47
|
+
*/
|
|
48
|
+
function calculateBlobName(filePath, content) {
|
|
49
|
+
const hash = crypto.createHash('sha256');
|
|
50
|
+
hash.update(filePath, 'utf-8');
|
|
51
|
+
hash.update(content, 'utf-8');
|
|
52
|
+
return hash.digest('hex');
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* 睡眠工具函数
|
|
56
|
+
*/
|
|
57
|
+
function sleep(ms) {
|
|
58
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* 索引管理器类
|
|
62
|
+
*/
|
|
63
|
+
export class IndexManager {
|
|
64
|
+
projectRoot;
|
|
65
|
+
baseUrl;
|
|
66
|
+
token;
|
|
67
|
+
textExtensions;
|
|
68
|
+
batchSize;
|
|
69
|
+
maxLinesPerBlob;
|
|
70
|
+
excludePatterns;
|
|
71
|
+
indexFilePath;
|
|
72
|
+
httpClient;
|
|
73
|
+
constructor(projectRoot, baseUrl, token, textExtensions, batchSize, maxLinesPerBlob = 800, excludePatterns = []) {
|
|
74
|
+
this.projectRoot = projectRoot;
|
|
75
|
+
this.baseUrl = baseUrl.replace(/\/$/, '');
|
|
76
|
+
this.token = token;
|
|
77
|
+
this.textExtensions = textExtensions;
|
|
78
|
+
this.batchSize = batchSize;
|
|
79
|
+
this.maxLinesPerBlob = maxLinesPerBlob;
|
|
80
|
+
this.excludePatterns = excludePatterns;
|
|
81
|
+
this.indexFilePath = getIndexFilePath(projectRoot);
|
|
82
|
+
this.httpClient = axios.create({
|
|
83
|
+
timeout: 30000,
|
|
84
|
+
headers: {
|
|
85
|
+
Authorization: `Bearer ${this.token}`,
|
|
86
|
+
},
|
|
87
|
+
});
|
|
88
|
+
logger.info(`IndexManager initialized for project: ${projectRoot}`);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* 加载 .gitignore 文件
|
|
92
|
+
*/
|
|
93
|
+
loadGitignore() {
|
|
94
|
+
const gitignorePath = path.join(this.projectRoot, '.gitignore');
|
|
95
|
+
if (!fs.existsSync(gitignorePath)) {
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
try {
|
|
99
|
+
const content = fs.readFileSync(gitignorePath, 'utf-8');
|
|
100
|
+
const patterns = content.split('\n');
|
|
101
|
+
const ig = ignore().add(patterns);
|
|
102
|
+
logger.debug(`Loaded .gitignore with ${patterns.length} patterns`);
|
|
103
|
+
return ig;
|
|
104
|
+
}
|
|
105
|
+
catch (error) {
|
|
106
|
+
logger.warning(`Failed to load .gitignore: ${error}`);
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* 检查路径是否应该被排除
|
|
112
|
+
*/
|
|
113
|
+
shouldExclude(filePath, gitignoreSpec) {
|
|
114
|
+
try {
|
|
115
|
+
const relativePath = path.relative(this.projectRoot, filePath);
|
|
116
|
+
const pathStr = relativePath.replace(/\\/g, '/');
|
|
117
|
+
if (gitignoreSpec) {
|
|
118
|
+
const isDir = fs.statSync(filePath).isDirectory();
|
|
119
|
+
const testPath = isDir ? pathStr + '/' : pathStr;
|
|
120
|
+
if (gitignoreSpec.ignores(testPath)) {
|
|
121
|
+
return true;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
const pathParts = pathStr.split('/');
|
|
125
|
+
for (const pattern of this.excludePatterns) {
|
|
126
|
+
for (const part of pathParts) {
|
|
127
|
+
if (this.matchPattern(part, pattern)) {
|
|
128
|
+
return true;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
if (this.matchPattern(pathStr, pattern)) {
|
|
132
|
+
return true;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
return false;
|
|
136
|
+
}
|
|
137
|
+
catch {
|
|
138
|
+
return false;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* 简单的模式匹配
|
|
143
|
+
*/
|
|
144
|
+
matchPattern(str, pattern) {
|
|
145
|
+
const regexPattern = pattern.replace(/\*/g, '.*').replace(/\?/g, '.');
|
|
146
|
+
const regex = new RegExp(`^${regexPattern}$`);
|
|
147
|
+
return regex.test(str);
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* 加载索引数据
|
|
151
|
+
*/
|
|
152
|
+
loadIndex() {
|
|
153
|
+
if (!fs.existsSync(this.indexFilePath)) {
|
|
154
|
+
return [];
|
|
155
|
+
}
|
|
156
|
+
try {
|
|
157
|
+
const content = fs.readFileSync(this.indexFilePath, 'utf-8');
|
|
158
|
+
return JSON.parse(content);
|
|
159
|
+
}
|
|
160
|
+
catch (error) {
|
|
161
|
+
logger.error(`Failed to load index: ${error}`);
|
|
162
|
+
return [];
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* 保存索引数据
|
|
167
|
+
*/
|
|
168
|
+
saveIndex(blobNames) {
|
|
169
|
+
try {
|
|
170
|
+
const content = JSON.stringify(blobNames, null, 2);
|
|
171
|
+
fs.writeFileSync(this.indexFilePath, content, 'utf-8');
|
|
172
|
+
}
|
|
173
|
+
catch (error) {
|
|
174
|
+
logger.error(`Failed to save index: ${error}`);
|
|
175
|
+
throw error;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* 将文件内容分割为多个 blob
|
|
180
|
+
*/
|
|
181
|
+
splitFileContent(filePath, content) {
|
|
182
|
+
const lines = [];
|
|
183
|
+
let start = 0;
|
|
184
|
+
for (let i = 0; i < content.length; i++) {
|
|
185
|
+
if (content[i] === '\n') {
|
|
186
|
+
lines.push(content.substring(start, i + 1));
|
|
187
|
+
start = i + 1;
|
|
188
|
+
}
|
|
189
|
+
else if (content[i] === '\r') {
|
|
190
|
+
if (i + 1 < content.length && content[i + 1] === '\n') {
|
|
191
|
+
lines.push(content.substring(start, i + 2));
|
|
192
|
+
start = i + 2;
|
|
193
|
+
i++;
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
lines.push(content.substring(start, i + 1));
|
|
197
|
+
start = i + 1;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
if (start < content.length) {
|
|
202
|
+
lines.push(content.substring(start));
|
|
203
|
+
}
|
|
204
|
+
const totalLines = lines.length;
|
|
205
|
+
if (totalLines <= this.maxLinesPerBlob) {
|
|
206
|
+
return [{ path: filePath, content }];
|
|
207
|
+
}
|
|
208
|
+
const blobs = [];
|
|
209
|
+
const numChunks = Math.ceil(totalLines / this.maxLinesPerBlob);
|
|
210
|
+
for (let chunkIdx = 0; chunkIdx < numChunks; chunkIdx++) {
|
|
211
|
+
const startLine = chunkIdx * this.maxLinesPerBlob;
|
|
212
|
+
const endLine = Math.min(startLine + this.maxLinesPerBlob, totalLines);
|
|
213
|
+
const chunkLines = lines.slice(startLine, endLine);
|
|
214
|
+
const chunkContent = chunkLines.join('');
|
|
215
|
+
const chunkPath = `${filePath}#chunk${chunkIdx + 1}of${numChunks}`;
|
|
216
|
+
blobs.push({ path: chunkPath, content: chunkContent });
|
|
217
|
+
}
|
|
218
|
+
logger.info(`Split file ${filePath} (${totalLines} lines) into ${numChunks} chunks`);
|
|
219
|
+
return blobs;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* 收集所有文本文件
|
|
223
|
+
*/
|
|
224
|
+
async collectFiles() {
|
|
225
|
+
const blobs = [];
|
|
226
|
+
let excludedCount = 0;
|
|
227
|
+
const gitignoreSpec = this.loadGitignore();
|
|
228
|
+
const walkDir = async (dirPath) => {
|
|
229
|
+
const entries = await fs.promises.readdir(dirPath, { withFileTypes: true });
|
|
230
|
+
for (const entry of entries) {
|
|
231
|
+
const fullPath = path.join(dirPath, entry.name);
|
|
232
|
+
if (entry.isDirectory()) {
|
|
233
|
+
if (!this.shouldExclude(fullPath, gitignoreSpec)) {
|
|
234
|
+
await walkDir(fullPath);
|
|
235
|
+
}
|
|
236
|
+
else {
|
|
237
|
+
excludedCount++;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
else if (entry.isFile()) {
|
|
241
|
+
if (this.shouldExclude(fullPath, gitignoreSpec)) {
|
|
242
|
+
excludedCount++;
|
|
243
|
+
continue;
|
|
244
|
+
}
|
|
245
|
+
const ext = path.extname(entry.name).toLowerCase();
|
|
246
|
+
if (!this.textExtensions.has(ext)) {
|
|
247
|
+
continue;
|
|
248
|
+
}
|
|
249
|
+
try {
|
|
250
|
+
const relativePath = path.relative(this.projectRoot, fullPath);
|
|
251
|
+
if (relativePath.startsWith('..')) {
|
|
252
|
+
continue;
|
|
253
|
+
}
|
|
254
|
+
const content = await readFileWithEncoding(fullPath);
|
|
255
|
+
const fileBlobs = this.splitFileContent(relativePath, content);
|
|
256
|
+
blobs.push(...fileBlobs);
|
|
257
|
+
}
|
|
258
|
+
catch (error) {
|
|
259
|
+
logger.warning(`Failed to read file: ${fullPath} - ${error}`);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
};
|
|
264
|
+
await walkDir(this.projectRoot);
|
|
265
|
+
logger.info(`Collected ${blobs.length} blobs (excluded ${excludedCount} items)`);
|
|
266
|
+
return blobs;
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* 使用指数退避策略重试请求
|
|
270
|
+
*/
|
|
271
|
+
async retryRequest(fn, maxRetries = 3, retryDelay = 1000) {
|
|
272
|
+
let lastError;
|
|
273
|
+
for (let attempt = 0; attempt < maxRetries; attempt++) {
|
|
274
|
+
try {
|
|
275
|
+
return await fn();
|
|
276
|
+
}
|
|
277
|
+
catch (error) {
|
|
278
|
+
lastError = error instanceof Error ? error : new Error(String(error));
|
|
279
|
+
const axiosError = error;
|
|
280
|
+
const isRetryable = axiosError.code === 'ECONNREFUSED' ||
|
|
281
|
+
axiosError.code === 'ETIMEDOUT' ||
|
|
282
|
+
axiosError.code === 'ENOTFOUND' ||
|
|
283
|
+
(axiosError.response && axiosError.response.status >= 500);
|
|
284
|
+
if (!isRetryable || attempt === maxRetries - 1) {
|
|
285
|
+
logger.error(`Request failed after ${attempt + 1} attempts: ${lastError.message}`);
|
|
286
|
+
throw error;
|
|
287
|
+
}
|
|
288
|
+
const waitTime = retryDelay * Math.pow(2, attempt);
|
|
289
|
+
logger.warning(`Request failed (attempt ${attempt + 1}/${maxRetries}). Retrying in ${waitTime}ms...`);
|
|
290
|
+
await sleep(waitTime);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
throw lastError || new Error('All retries failed');
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* 对项目进行索引(支持增量索引)
|
|
297
|
+
*/
|
|
298
|
+
async indexProject() {
|
|
299
|
+
logger.info(`Indexing project: ${this.projectRoot}`);
|
|
300
|
+
try {
|
|
301
|
+
const blobs = await this.collectFiles();
|
|
302
|
+
if (blobs.length === 0) {
|
|
303
|
+
return { status: 'error', message: 'No text files found in project' };
|
|
304
|
+
}
|
|
305
|
+
// 加载已存在的索引数据
|
|
306
|
+
const existingBlobNames = new Set(this.loadIndex());
|
|
307
|
+
// 为所有收集的 blob 计算哈希值
|
|
308
|
+
const blobHashMap = new Map();
|
|
309
|
+
for (const blob of blobs) {
|
|
310
|
+
const blobHash = calculateBlobName(blob.path, blob.content);
|
|
311
|
+
blobHashMap.set(blobHash, blob);
|
|
312
|
+
}
|
|
313
|
+
// 分离已存在和新的 blob
|
|
314
|
+
const allBlobHashes = new Set(blobHashMap.keys());
|
|
315
|
+
const existingHashes = new Set([...allBlobHashes].filter((hash) => existingBlobNames.has(hash)));
|
|
316
|
+
const newHashes = [...allBlobHashes].filter((hash) => !existingBlobNames.has(hash));
|
|
317
|
+
const blobsToUpload = newHashes.map((hash) => blobHashMap.get(hash));
|
|
318
|
+
logger.info(`Incremental indexing: total=${blobs.length}, existing=${existingHashes.size}, new=${newHashes.length}`);
|
|
319
|
+
// 只上传新的 blob
|
|
320
|
+
const uploadedBlobNames = [];
|
|
321
|
+
const failedBatches = [];
|
|
322
|
+
if (blobsToUpload.length > 0) {
|
|
323
|
+
const totalBatches = Math.ceil(blobsToUpload.length / this.batchSize);
|
|
324
|
+
logger.info(`Uploading ${blobsToUpload.length} new blobs in ${totalBatches} batches`);
|
|
325
|
+
for (let batchIdx = 0; batchIdx < totalBatches; batchIdx++) {
|
|
326
|
+
const startIdx = batchIdx * this.batchSize;
|
|
327
|
+
const endIdx = Math.min(startIdx + this.batchSize, blobsToUpload.length);
|
|
328
|
+
const batchBlobs = blobsToUpload.slice(startIdx, endIdx);
|
|
329
|
+
logger.info(`Uploading batch ${batchIdx + 1}/${totalBatches} (${batchBlobs.length} blobs)`);
|
|
330
|
+
try {
|
|
331
|
+
const result = await this.retryRequest(async () => {
|
|
332
|
+
const response = await this.httpClient.post(`${this.baseUrl}/batch-upload`, {
|
|
333
|
+
blobs: batchBlobs,
|
|
334
|
+
});
|
|
335
|
+
return response.data;
|
|
336
|
+
});
|
|
337
|
+
const batchBlobNames = result.blob_names || [];
|
|
338
|
+
if (batchBlobNames.length === 0) {
|
|
339
|
+
logger.warning(`Batch ${batchIdx + 1} returned no blob names`);
|
|
340
|
+
failedBatches.push(batchIdx + 1);
|
|
341
|
+
continue;
|
|
342
|
+
}
|
|
343
|
+
uploadedBlobNames.push(...batchBlobNames);
|
|
344
|
+
logger.info(`Batch ${batchIdx + 1} uploaded successfully`);
|
|
345
|
+
}
|
|
346
|
+
catch (error) {
|
|
347
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
348
|
+
logger.error(`Batch ${batchIdx + 1} failed: ${errorMessage}`);
|
|
349
|
+
failedBatches.push(batchIdx + 1);
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
if (uploadedBlobNames.length === 0 && blobsToUpload.length > 0 && existingHashes.size === 0) {
|
|
353
|
+
return { status: 'error', message: 'All batches failed on first indexing' };
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
else {
|
|
357
|
+
logger.info('No new blobs to upload');
|
|
358
|
+
}
|
|
359
|
+
// 合并已存在和新上传的 blob 名称
|
|
360
|
+
const allBlobNames = [...existingHashes, ...uploadedBlobNames];
|
|
361
|
+
this.saveIndex(allBlobNames);
|
|
362
|
+
const message = `Indexed ${allBlobNames.length} blobs (existing: ${existingHashes.size}, new: ${uploadedBlobNames.length})`;
|
|
363
|
+
logger.info(message);
|
|
364
|
+
return {
|
|
365
|
+
status: failedBatches.length === 0 ? 'success' : 'partial_success',
|
|
366
|
+
message,
|
|
367
|
+
stats: {
|
|
368
|
+
total_blobs: allBlobNames.length,
|
|
369
|
+
existing_blobs: existingHashes.size,
|
|
370
|
+
new_blobs: uploadedBlobNames.length,
|
|
371
|
+
},
|
|
372
|
+
};
|
|
373
|
+
}
|
|
374
|
+
catch (error) {
|
|
375
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
376
|
+
logger.error(`Failed to index project: ${errorMessage}`);
|
|
377
|
+
return { status: 'error', message: errorMessage };
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
/**
|
|
381
|
+
* 搜索代码上下文(自动增量索引)
|
|
382
|
+
*/
|
|
383
|
+
async searchContext(query) {
|
|
384
|
+
logger.info(`Searching with query: ${query}`);
|
|
385
|
+
try {
|
|
386
|
+
// 自动索引
|
|
387
|
+
const indexResult = await this.indexProject();
|
|
388
|
+
if (indexResult.status === 'error') {
|
|
389
|
+
return `Error: Failed to index project. ${indexResult.message}`;
|
|
390
|
+
}
|
|
391
|
+
// 加载索引
|
|
392
|
+
const blobNames = this.loadIndex();
|
|
393
|
+
if (blobNames.length === 0) {
|
|
394
|
+
return 'Error: No blobs found after indexing.';
|
|
395
|
+
}
|
|
396
|
+
// 执行搜索
|
|
397
|
+
logger.info(`Searching with ${blobNames.length} blobs...`);
|
|
398
|
+
const payload = {
|
|
399
|
+
information_request: query,
|
|
400
|
+
blobs: {
|
|
401
|
+
checkpoint_id: null,
|
|
402
|
+
added_blobs: blobNames,
|
|
403
|
+
deleted_blobs: [],
|
|
404
|
+
},
|
|
405
|
+
dialog: [],
|
|
406
|
+
max_output_length: 0,
|
|
407
|
+
disable_codebase_retrieval: false,
|
|
408
|
+
enable_commit_retrieval: false,
|
|
409
|
+
};
|
|
410
|
+
const result = await this.retryRequest(async () => {
|
|
411
|
+
const response = await this.httpClient.post(`${this.baseUrl}/agents/codebase-retrieval`, payload, { timeout: 60000 });
|
|
412
|
+
return response.data;
|
|
413
|
+
}, 3, 2000);
|
|
414
|
+
const formattedRetrieval = result.formatted_retrieval || '';
|
|
415
|
+
if (!formattedRetrieval) {
|
|
416
|
+
return 'No relevant code context found for your query.';
|
|
417
|
+
}
|
|
418
|
+
logger.info('Search completed');
|
|
419
|
+
return formattedRetrieval;
|
|
420
|
+
}
|
|
421
|
+
catch (error) {
|
|
422
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
423
|
+
logger.error(`Search failed: ${errorMessage}`);
|
|
424
|
+
return `Error: ${errorMessage}`;
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+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