workerclaw 0.3.7 → 0.4.2
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/agent/agent-engine.d.ts +32 -2
- package/dist/agent/agent-engine.d.ts.map +1 -1
- package/dist/agent/agent-engine.js +188 -8
- package/dist/agent/agent-engine.js.map +1 -1
- package/dist/cli/index.js +24 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/sections/experience.d.ts +10 -0
- package/dist/cli/sections/experience.d.ts.map +1 -0
- package/dist/cli/sections/experience.js +148 -0
- package/dist/cli/sections/experience.js.map +1 -0
- package/dist/core/config.d.ts +2 -0
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js.map +1 -1
- package/dist/core/events.d.ts +19 -1
- package/dist/core/events.d.ts.map +1 -1
- package/dist/core/events.js +4 -0
- package/dist/core/events.js.map +1 -1
- package/dist/core/workerclaw.d.ts +7 -0
- package/dist/core/workerclaw.d.ts.map +1 -1
- package/dist/core/workerclaw.js +30 -0
- package/dist/core/workerclaw.js.map +1 -1
- package/dist/experience/encapsulator.d.ts +95 -0
- package/dist/experience/encapsulator.d.ts.map +1 -0
- package/dist/experience/encapsulator.js +239 -0
- package/dist/experience/encapsulator.js.map +1 -0
- package/dist/experience/hub-client.d.ts +32 -0
- package/dist/experience/hub-client.d.ts.map +1 -0
- package/dist/experience/hub-client.js +126 -0
- package/dist/experience/hub-client.js.map +1 -0
- package/dist/experience/index.d.ts +13 -0
- package/dist/experience/index.d.ts.map +1 -0
- package/dist/experience/index.js +30 -0
- package/dist/experience/index.js.map +1 -0
- package/dist/experience/local-store.d.ts +102 -0
- package/dist/experience/local-store.d.ts.map +1 -0
- package/dist/experience/local-store.js +321 -0
- package/dist/experience/local-store.js.map +1 -0
- package/dist/experience/manager.d.ts +71 -0
- package/dist/experience/manager.d.ts.map +1 -0
- package/dist/experience/manager.js +184 -0
- package/dist/experience/manager.js.map +1 -0
- package/dist/experience/search-engine.d.ts +80 -0
- package/dist/experience/search-engine.d.ts.map +1 -0
- package/dist/experience/search-engine.js +258 -0
- package/dist/experience/search-engine.js.map +1 -0
- package/dist/experience/signal-detector.d.ts +33 -0
- package/dist/experience/signal-detector.d.ts.map +1 -0
- package/dist/experience/signal-detector.js +182 -0
- package/dist/experience/signal-detector.js.map +1 -0
- package/dist/experience/types.d.ts +189 -0
- package/dist/experience/types.d.ts.map +1 -0
- package/dist/experience/types.js +7 -0
- package/dist/experience/types.js.map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/task/task-evaluator.d.ts.map +1 -1
- package/dist/task/task-evaluator.js +4 -1
- package/dist/task/task-evaluator.js.map +1 -1
- package/dist/task/task-manager.d.ts +14 -0
- package/dist/task/task-manager.d.ts.map +1 -1
- package/dist/task/task-manager.js +127 -5
- package/dist/task/task-manager.js.map +1 -1
- package/dist/types/task.d.ts +2 -0
- package/dist/types/task.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 本地经验池存储
|
|
3
|
+
*
|
|
4
|
+
* 基于 JSON 文件的轻量存储方案
|
|
5
|
+
* 存储 genes + capsules + events + reports
|
|
6
|
+
*/
|
|
7
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
8
|
+
import { join } from 'node:path';
|
|
9
|
+
import { createLogger } from '../core/logger.js';
|
|
10
|
+
// ==================== 本地经验池 ====================
|
|
11
|
+
export class LocalExperienceStore {
|
|
12
|
+
logger;
|
|
13
|
+
storePath;
|
|
14
|
+
genes = new Map();
|
|
15
|
+
capsules = new Map();
|
|
16
|
+
events = [];
|
|
17
|
+
reports = [];
|
|
18
|
+
initialized = false;
|
|
19
|
+
constructor(storagePath) {
|
|
20
|
+
this.logger = createLogger('ExperienceStore');
|
|
21
|
+
this.storePath = storagePath;
|
|
22
|
+
}
|
|
23
|
+
// ==================== 初始化 ====================
|
|
24
|
+
/**
|
|
25
|
+
* 初始化存储(加载已有数据)
|
|
26
|
+
*/
|
|
27
|
+
async init() {
|
|
28
|
+
if (this.initialized)
|
|
29
|
+
return;
|
|
30
|
+
try {
|
|
31
|
+
// 确保目录存在
|
|
32
|
+
if (!existsSync(this.storePath)) {
|
|
33
|
+
mkdirSync(this.storePath, { recursive: true });
|
|
34
|
+
}
|
|
35
|
+
// 加载数据
|
|
36
|
+
await this.loadGenes();
|
|
37
|
+
await this.loadCapsules();
|
|
38
|
+
await this.loadEvents();
|
|
39
|
+
await this.loadReports();
|
|
40
|
+
this.initialized = true;
|
|
41
|
+
this.logger.info(`本地经验池已加载`, {
|
|
42
|
+
genes: this.genes.size,
|
|
43
|
+
capsules: this.capsules.size,
|
|
44
|
+
events: this.events.length,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
catch (err) {
|
|
48
|
+
this.logger.error('本地经验池初始化失败', { error: err.message });
|
|
49
|
+
// 失败不阻塞启动,使用空经验池
|
|
50
|
+
this.initialized = true;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
// ==================== 基因操作 ====================
|
|
54
|
+
/**
|
|
55
|
+
* 保存基因
|
|
56
|
+
*/
|
|
57
|
+
async saveGene(gene) {
|
|
58
|
+
this.genes.set(gene.gene_id, gene);
|
|
59
|
+
await this.persistGenes();
|
|
60
|
+
this.logger.debug(`基因已保存 [${gene.gene_id.slice(0, 12)}...]`, {
|
|
61
|
+
category: gene.category,
|
|
62
|
+
signals: gene.signals.length,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* 获取基因
|
|
67
|
+
*/
|
|
68
|
+
getGene(geneId) {
|
|
69
|
+
return this.genes.get(geneId);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* 获取所有基因
|
|
73
|
+
*/
|
|
74
|
+
getAllGenes() {
|
|
75
|
+
return Array.from(this.genes.values());
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* 按分类获取基因
|
|
79
|
+
*/
|
|
80
|
+
getGenesByCategory(category) {
|
|
81
|
+
return Array.from(this.genes.values()).filter(g => g.category === category);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* 删除基因(同时删除关联的胶囊)
|
|
85
|
+
*/
|
|
86
|
+
async deleteGene(geneId) {
|
|
87
|
+
const gene = this.genes.get(geneId);
|
|
88
|
+
if (!gene)
|
|
89
|
+
return false;
|
|
90
|
+
// 删除关联胶囊
|
|
91
|
+
for (const [capId, cap] of this.capsules) {
|
|
92
|
+
if (cap.gene_id === geneId) {
|
|
93
|
+
this.capsules.delete(capId);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
this.genes.delete(geneId);
|
|
97
|
+
await Promise.all([this.persistGenes(), this.persistCapsules()]);
|
|
98
|
+
return true;
|
|
99
|
+
}
|
|
100
|
+
// ==================== 胶囊操作 ====================
|
|
101
|
+
/**
|
|
102
|
+
* 保存胶囊
|
|
103
|
+
*/
|
|
104
|
+
async saveCapsule(capsule) {
|
|
105
|
+
this.capsules.set(capsule.capsule_id, capsule);
|
|
106
|
+
// 同时确保关联的基因存在
|
|
107
|
+
if (!this.genes.has(capsule.gene_id) && capsule.context) {
|
|
108
|
+
// 胶囊可以独立存在(基因可能来自 Hub)
|
|
109
|
+
}
|
|
110
|
+
await this.persistCapsules();
|
|
111
|
+
this.logger.debug(`胶囊已保存 [${capsule.capsule_id.slice(0, 12)}...]`);
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* 获取胶囊
|
|
115
|
+
*/
|
|
116
|
+
getCapsule(capsuleId) {
|
|
117
|
+
return this.capsules.get(capsuleId);
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* 获取基因关联的胶囊列表
|
|
121
|
+
*/
|
|
122
|
+
getCapsulesByGene(geneId) {
|
|
123
|
+
return Array.from(this.capsules.values()).filter(c => c.gene_id === geneId);
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* 获取最佳胶囊(按置信度排序)
|
|
127
|
+
*/
|
|
128
|
+
getBestCapsule(geneId) {
|
|
129
|
+
const capsules = this.getCapsulesByGene(geneId);
|
|
130
|
+
if (capsules.length === 0)
|
|
131
|
+
return undefined;
|
|
132
|
+
return capsules.sort((a, b) => b.confidence - a.confidence)[0];
|
|
133
|
+
}
|
|
134
|
+
// ==================== 事件操作 ====================
|
|
135
|
+
/**
|
|
136
|
+
* 记录进化事件
|
|
137
|
+
*/
|
|
138
|
+
async recordEvent(event) {
|
|
139
|
+
this.events.push(event);
|
|
140
|
+
await this.persistEvents();
|
|
141
|
+
this.logger.debug(`进化事件已记录`, {
|
|
142
|
+
intent: event.intent,
|
|
143
|
+
status: event.outcome.status,
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* 获取最近的进化事件
|
|
148
|
+
*/
|
|
149
|
+
getRecentEvents(limit = 20) {
|
|
150
|
+
return this.events.slice(-limit).reverse();
|
|
151
|
+
}
|
|
152
|
+
// ==================== 报告操作 ====================
|
|
153
|
+
/**
|
|
154
|
+
* 记录验证报告(待同步到 Hub)
|
|
155
|
+
*/
|
|
156
|
+
async addReport(report) {
|
|
157
|
+
this.reports.push(report);
|
|
158
|
+
await this.persistReports();
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* 获取待同步的报告
|
|
162
|
+
*/
|
|
163
|
+
getPendingReports() {
|
|
164
|
+
return [...this.reports];
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* 清除已同步的报告
|
|
168
|
+
*/
|
|
169
|
+
async clearReports() {
|
|
170
|
+
this.reports = [];
|
|
171
|
+
await this.persistReports();
|
|
172
|
+
}
|
|
173
|
+
// ==================== 搜索 ====================
|
|
174
|
+
/**
|
|
175
|
+
* 按信号搜索(关键词匹配)
|
|
176
|
+
*/
|
|
177
|
+
searchBySignals(signals) {
|
|
178
|
+
const results = [];
|
|
179
|
+
const normalizedSignals = signals.map(s => s.toLowerCase());
|
|
180
|
+
for (const gene of this.genes.values()) {
|
|
181
|
+
// 计算匹配度
|
|
182
|
+
const matchScore = this.computeMatchScore(gene, normalizedSignals);
|
|
183
|
+
if (matchScore < 0.2)
|
|
184
|
+
continue; // 最低匹配阈值
|
|
185
|
+
// 获取最佳胶囊
|
|
186
|
+
const capsule = this.getBestCapsule(gene.gene_id);
|
|
187
|
+
if (!capsule)
|
|
188
|
+
continue;
|
|
189
|
+
results.push({
|
|
190
|
+
gene,
|
|
191
|
+
capsule,
|
|
192
|
+
matchScore,
|
|
193
|
+
source: 'local',
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
// 按匹配度排序
|
|
197
|
+
return results.sort((a, b) => b.matchScore - a.matchScore);
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* 计算基因与信号的匹配度
|
|
201
|
+
*/
|
|
202
|
+
computeMatchScore(gene, normalizedSignals) {
|
|
203
|
+
let matched = 0;
|
|
204
|
+
let total = gene.signals.length;
|
|
205
|
+
for (const geneSignal of gene.signals) {
|
|
206
|
+
const normalizedGene = geneSignal.toLowerCase();
|
|
207
|
+
for (const querySignal of normalizedSignals) {
|
|
208
|
+
if (normalizedGene.includes(querySignal) || querySignal.includes(normalizedGene)) {
|
|
209
|
+
matched++;
|
|
210
|
+
break;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
if (total === 0)
|
|
215
|
+
return 0;
|
|
216
|
+
return matched / total;
|
|
217
|
+
}
|
|
218
|
+
// ==================== 统计 ====================
|
|
219
|
+
getStats() {
|
|
220
|
+
const categories = {
|
|
221
|
+
task_fix: 0, env_fix: 0, api_compat: 0, performance: 0, security: 0,
|
|
222
|
+
};
|
|
223
|
+
for (const gene of this.genes.values()) {
|
|
224
|
+
categories[gene.category]++;
|
|
225
|
+
}
|
|
226
|
+
return {
|
|
227
|
+
genes: this.genes.size,
|
|
228
|
+
capsules: this.capsules.size,
|
|
229
|
+
events: this.events.length,
|
|
230
|
+
categories,
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
// ==================== 持久化 ====================
|
|
234
|
+
get filePaths() {
|
|
235
|
+
return {
|
|
236
|
+
genes: join(this.storePath, 'genes.json'),
|
|
237
|
+
capsules: join(this.storePath, 'capsules.json'),
|
|
238
|
+
events: join(this.storePath, 'events.json'),
|
|
239
|
+
reports: join(this.storePath, 'reports.json'),
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
async loadGenes() {
|
|
243
|
+
const { genes: filePath } = this.filePaths;
|
|
244
|
+
if (!existsSync(filePath))
|
|
245
|
+
return;
|
|
246
|
+
try {
|
|
247
|
+
const data = JSON.parse(readFileSync(filePath, 'utf-8'));
|
|
248
|
+
if (Array.isArray(data)) {
|
|
249
|
+
for (const gene of data) {
|
|
250
|
+
this.genes.set(gene.gene_id, gene);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
catch (err) {
|
|
255
|
+
this.logger.warn('基因数据加载失败,将使用空经验池', { error: err.message });
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
async loadCapsules() {
|
|
259
|
+
const { capsules: filePath } = this.filePaths;
|
|
260
|
+
if (!existsSync(filePath))
|
|
261
|
+
return;
|
|
262
|
+
try {
|
|
263
|
+
const data = JSON.parse(readFileSync(filePath, 'utf-8'));
|
|
264
|
+
if (Array.isArray(data)) {
|
|
265
|
+
for (const cap of data) {
|
|
266
|
+
this.capsules.set(cap.capsule_id, cap);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
catch (err) {
|
|
271
|
+
this.logger.warn('胶囊数据加载失败', { error: err.message });
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
async loadEvents() {
|
|
275
|
+
const { events: filePath } = this.filePaths;
|
|
276
|
+
if (!existsSync(filePath))
|
|
277
|
+
return;
|
|
278
|
+
try {
|
|
279
|
+
const data = JSON.parse(readFileSync(filePath, 'utf-8'));
|
|
280
|
+
if (Array.isArray(data)) {
|
|
281
|
+
this.events = data;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
catch (err) {
|
|
285
|
+
this.logger.warn('进化事件数据加载失败', { error: err.message });
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
async loadReports() {
|
|
289
|
+
const { reports: filePath } = this.filePaths;
|
|
290
|
+
if (!existsSync(filePath))
|
|
291
|
+
return;
|
|
292
|
+
try {
|
|
293
|
+
const data = JSON.parse(readFileSync(filePath, 'utf-8'));
|
|
294
|
+
if (Array.isArray(data)) {
|
|
295
|
+
this.reports = data;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
catch (err) {
|
|
299
|
+
this.logger.warn('报告数据加载失败', { error: err.message });
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
async persistGenes() {
|
|
303
|
+
const { genes: filePath } = this.filePaths;
|
|
304
|
+
const data = Array.from(this.genes.values());
|
|
305
|
+
writeFileSync(filePath, JSON.stringify(data, null, 2), 'utf-8');
|
|
306
|
+
}
|
|
307
|
+
async persistCapsules() {
|
|
308
|
+
const { capsules: filePath } = this.filePaths;
|
|
309
|
+
const data = Array.from(this.capsules.values());
|
|
310
|
+
writeFileSync(filePath, JSON.stringify(data, null, 2), 'utf-8');
|
|
311
|
+
}
|
|
312
|
+
async persistEvents() {
|
|
313
|
+
const { events: filePath } = this.filePaths;
|
|
314
|
+
writeFileSync(filePath, JSON.stringify(this.events, null, 2), 'utf-8');
|
|
315
|
+
}
|
|
316
|
+
async persistReports() {
|
|
317
|
+
const { reports: filePath } = this.filePaths;
|
|
318
|
+
writeFileSync(filePath, JSON.stringify(this.reports, null, 2), 'utf-8');
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
//# sourceMappingURL=local-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-store.js","sourceRoot":"","sources":["../../src/experience/local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一管理经验基因系统的所有模块
|
|
5
|
+
* 对外提供简洁 API,集成到 WorkerClaw 主流程
|
|
6
|
+
*/
|
|
7
|
+
import type { ExperienceConfig, ExperienceSearchResult, ShrimpGene, ShrimpCapsule, ShrimpEvolution, StrategyStep } from './types.js';
|
|
8
|
+
export declare class ExperienceManager {
|
|
9
|
+
private logger;
|
|
10
|
+
private config;
|
|
11
|
+
private store;
|
|
12
|
+
private signalDetector;
|
|
13
|
+
private searchEngine;
|
|
14
|
+
private encapsulator;
|
|
15
|
+
private hubClient;
|
|
16
|
+
private initialized;
|
|
17
|
+
private currentEvolution;
|
|
18
|
+
constructor(config: ExperienceConfig, botId: string, token: string);
|
|
19
|
+
/**
|
|
20
|
+
* 初始化经验系统
|
|
21
|
+
*/
|
|
22
|
+
init(): Promise<void>;
|
|
23
|
+
/**
|
|
24
|
+
* 错误发生时自动搜索经验
|
|
25
|
+
*/
|
|
26
|
+
searchOnError(errorMessage: string): Promise<ExperienceSearchResult | null>;
|
|
27
|
+
/**
|
|
28
|
+
* 手动搜索经验
|
|
29
|
+
*/
|
|
30
|
+
search(keywords: string[]): Promise<ExperienceSearchResult[]>;
|
|
31
|
+
/**
|
|
32
|
+
* 从错误消息检测信号
|
|
33
|
+
*/
|
|
34
|
+
detectSignals(errorMessage: string): import("./signal-detector.js").DetectedSignal;
|
|
35
|
+
/**
|
|
36
|
+
* 开始追踪任务进化过程
|
|
37
|
+
*/
|
|
38
|
+
startEvolution(taskId?: string, taskType?: string): void;
|
|
39
|
+
/**
|
|
40
|
+
* 记录一次尝试(方案 + 结果)
|
|
41
|
+
*/
|
|
42
|
+
recordMutation(approach: string, result: 'success' | 'failed', error?: string): void;
|
|
43
|
+
/**
|
|
44
|
+
* 完成进化追踪并封装经验
|
|
45
|
+
*/
|
|
46
|
+
completeEvolution(status: 'success' | 'failed', fixSummary: string, fixSteps: StrategyStep[], errorMessage: string, options?: {
|
|
47
|
+
diff?: string;
|
|
48
|
+
filesAffected?: number;
|
|
49
|
+
linesChanged?: number;
|
|
50
|
+
components?: string[];
|
|
51
|
+
}): Promise<{
|
|
52
|
+
gene: ShrimpGene;
|
|
53
|
+
capsule: ShrimpCapsule;
|
|
54
|
+
event: ShrimpEvolution;
|
|
55
|
+
} | null>;
|
|
56
|
+
/**
|
|
57
|
+
* 同步 Hub(发布本地新基因 + 上报验证报告)
|
|
58
|
+
*/
|
|
59
|
+
syncHub(): Promise<{
|
|
60
|
+
published: number;
|
|
61
|
+
reported: number;
|
|
62
|
+
}>;
|
|
63
|
+
getStats(): import("./local-store.js").LocalStoreStats;
|
|
64
|
+
getAllGenes(): ShrimpGene[];
|
|
65
|
+
getRecentEvents(limit?: number): ShrimpEvolution[];
|
|
66
|
+
/**
|
|
67
|
+
* 清理资源
|
|
68
|
+
*/
|
|
69
|
+
dispose(): void;
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../src/experience/manager.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,OAAO,KAAK,EACV,gBAAgB,EAAE,sBAAsB,EACxC,UAAU,EAAE,aAAa,EAAE,eAAe,EAC1C,YAAY,EACb,MAAM,YAAY,CAAC;AAIpB,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,MAAM,CAAmB;IACjC,OAAO,CAAC,KAAK,CAAuB;IACpC,OAAO,CAAC,cAAc,CAAiB;IACvC,OAAO,CAAC,YAAY,CAAyB;IAC7C,OAAO,CAAC,YAAY,CAAyB;IAC7C,OAAO,CAAC,SAAS,CAAgC;IACjD,OAAO,CAAC,WAAW,CAAS;IAG5B,OAAO,CAAC,gBAAgB,CAMR;gBAEJ,MAAM,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAoBlE;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,IAA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|
2
|
+
* 经验管理器
|
|
3
|
+
*
|
|
4
|
+
* 统一管理经验基因系统的所有模块
|
|
5
|
+
* 对外提供简洁 API,集成到 WorkerClaw 主流程
|
|
6
|
+
*/
|
|
7
|
+
import { createLogger } from '../core/logger.js';
|
|
8
|
+
import { LocalExperienceStore } from './local-store.js';
|
|
9
|
+
import { SignalDetector } from './signal-detector.js';
|
|
10
|
+
import { ExperienceSearchEngine } from './search-engine.js';
|
|
11
|
+
import { ExperienceEncapsulator } from './encapsulator.js';
|
|
12
|
+
import { ShrimpHubClient } from './hub-client.js';
|
|
13
|
+
// ==================== 经验管理器 ====================
|
|
14
|
+
export class ExperienceManager {
|
|
15
|
+
logger;
|
|
16
|
+
config;
|
|
17
|
+
store;
|
|
18
|
+
signalDetector;
|
|
19
|
+
searchEngine;
|
|
20
|
+
encapsulator;
|
|
21
|
+
hubClient = null;
|
|
22
|
+
initialized = false;
|
|
23
|
+
// 进化追踪(当前任务)
|
|
24
|
+
currentEvolution = null;
|
|
25
|
+
constructor(config, botId, token) {
|
|
26
|
+
this.logger = createLogger('Experience');
|
|
27
|
+
this.config = config;
|
|
28
|
+
// 初始化子模块
|
|
29
|
+
this.store = new LocalExperienceStore(config.storagePath);
|
|
30
|
+
this.signalDetector = new SignalDetector();
|
|
31
|
+
this.searchEngine = new ExperienceSearchEngine(this.store, config);
|
|
32
|
+
this.encapsulator = new ExperienceEncapsulator(this.store, botId);
|
|
33
|
+
// Hub 客户端
|
|
34
|
+
if (config.hub.enabled) {
|
|
35
|
+
this.hubClient = new ShrimpHubClient(config.hub.endpoint, botId, token);
|
|
36
|
+
// 将 Hub 客户端传递给搜索引擎
|
|
37
|
+
this.searchEngine.setHubClient(this.hubClient);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
// ==================== 生命周期 ====================
|
|
41
|
+
/**
|
|
42
|
+
* 初始化经验系统
|
|
43
|
+
*/
|
|
44
|
+
async init() {
|
|
45
|
+
if (this.initialized)
|
|
46
|
+
return;
|
|
47
|
+
await this.store.init();
|
|
48
|
+
this.initialized = true;
|
|
49
|
+
const stats = this.store.getStats();
|
|
50
|
+
this.logger.info(`🧬 经验系统已初始化`, {
|
|
51
|
+
genes: stats.genes,
|
|
52
|
+
capsules: stats.capsules,
|
|
53
|
+
events: stats.events,
|
|
54
|
+
hubEnabled: this.config.hub.enabled,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
// ==================== 搜索 API ====================
|
|
58
|
+
/**
|
|
59
|
+
* 错误发生时自动搜索经验
|
|
60
|
+
*/
|
|
61
|
+
async searchOnError(errorMessage) {
|
|
62
|
+
if (!this.initialized)
|
|
63
|
+
return null;
|
|
64
|
+
return this.searchEngine.searchByError(errorMessage);
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* 手动搜索经验
|
|
68
|
+
*/
|
|
69
|
+
async search(keywords) {
|
|
70
|
+
if (!this.initialized)
|
|
71
|
+
return [];
|
|
72
|
+
return this.searchEngine.searchBySignals(keywords);
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* 从错误消息检测信号
|
|
76
|
+
*/
|
|
77
|
+
detectSignals(errorMessage) {
|
|
78
|
+
return this.signalDetector.detect(errorMessage);
|
|
79
|
+
}
|
|
80
|
+
// ==================== 进化追踪 ====================
|
|
81
|
+
/**
|
|
82
|
+
* 开始追踪任务进化过程
|
|
83
|
+
*/
|
|
84
|
+
startEvolution(taskId, taskType) {
|
|
85
|
+
this.currentEvolution = {
|
|
86
|
+
taskId,
|
|
87
|
+
taskType,
|
|
88
|
+
startTime: Date.now(),
|
|
89
|
+
mutations: [],
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* 记录一次尝试(方案 + 结果)
|
|
94
|
+
*/
|
|
95
|
+
recordMutation(approach, result, error) {
|
|
96
|
+
if (!this.currentEvolution)
|
|
97
|
+
return;
|
|
98
|
+
this.currentEvolution.mutations.push({
|
|
99
|
+
approach,
|
|
100
|
+
result,
|
|
101
|
+
error,
|
|
102
|
+
duration_ms: Date.now() - this.currentEvolution.startTime,
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* 完成进化追踪并封装经验
|
|
107
|
+
*/
|
|
108
|
+
async completeEvolution(status, fixSummary, fixSteps, errorMessage, options) {
|
|
109
|
+
if (!this.config.autoEncapsulate.enabled || !this.currentEvolution) {
|
|
110
|
+
this.currentEvolution = null;
|
|
111
|
+
return null;
|
|
112
|
+
}
|
|
113
|
+
// 检测信号
|
|
114
|
+
const detected = this.signalDetector.detect(errorMessage);
|
|
115
|
+
if (!detected.shouldSearch) {
|
|
116
|
+
this.currentEvolution = null;
|
|
117
|
+
return null;
|
|
118
|
+
}
|
|
119
|
+
const process = {
|
|
120
|
+
signalDetected: detected.signals[0] || detected.patternName,
|
|
121
|
+
errorMessage,
|
|
122
|
+
taskId: this.currentEvolution.taskId,
|
|
123
|
+
taskType: this.currentEvolution.taskType,
|
|
124
|
+
initialApproach: this.currentEvolution.initialApproach || fixSummary,
|
|
125
|
+
mutations: this.currentEvolution.mutations,
|
|
126
|
+
finalStatus: status,
|
|
127
|
+
totalDurationMs: Date.now() - this.currentEvolution.startTime,
|
|
128
|
+
fixSummary,
|
|
129
|
+
fixSteps,
|
|
130
|
+
diff: options?.diff,
|
|
131
|
+
filesAffected: options?.filesAffected,
|
|
132
|
+
linesChanged: options?.linesChanged,
|
|
133
|
+
components: options?.components,
|
|
134
|
+
};
|
|
135
|
+
this.currentEvolution = null;
|
|
136
|
+
// 封装并保存
|
|
137
|
+
const result = await this.encapsulator.encapsulate(process);
|
|
138
|
+
if (!result)
|
|
139
|
+
return null;
|
|
140
|
+
// 如果 Hub 启用,自动发布
|
|
141
|
+
if (this.hubClient && this.config.hub.enabled) {
|
|
142
|
+
this.hubClient.publishGene(result.gene, result.capsule).catch(() => { });
|
|
143
|
+
}
|
|
144
|
+
return result;
|
|
145
|
+
}
|
|
146
|
+
// ==================== Hub 操作 ====================
|
|
147
|
+
/**
|
|
148
|
+
* 同步 Hub(发布本地新基因 + 上报验证报告)
|
|
149
|
+
*/
|
|
150
|
+
async syncHub() {
|
|
151
|
+
if (!this.hubClient)
|
|
152
|
+
return { published: 0, reported: 0 };
|
|
153
|
+
let published = 0;
|
|
154
|
+
let reported = 0;
|
|
155
|
+
// 上报验证报告
|
|
156
|
+
const pendingReports = this.store.getPendingReports();
|
|
157
|
+
for (const report of pendingReports) {
|
|
158
|
+
const ok = await this.hubClient.submitReport(report);
|
|
159
|
+
if (ok)
|
|
160
|
+
reported++;
|
|
161
|
+
}
|
|
162
|
+
if (reported > 0)
|
|
163
|
+
await this.store.clearReports();
|
|
164
|
+
this.logger.info(`Hub 同步完成`, { published, reported });
|
|
165
|
+
return { published, reported };
|
|
166
|
+
}
|
|
167
|
+
// ==================== 统计 ====================
|
|
168
|
+
getStats() {
|
|
169
|
+
return this.store.getStats();
|
|
170
|
+
}
|
|
171
|
+
getAllGenes() {
|
|
172
|
+
return this.store.getAllGenes();
|
|
173
|
+
}
|
|
174
|
+
getRecentEvents(limit = 10) {
|
|
175
|
+
return this.store.getRecentEvents(limit);
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* 清理资源
|
|
179
|
+
*/
|
|
180
|
+
dispose() {
|
|
181
|
+
// JSON 存储,无需特殊清理
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
//# sourceMappingURL=manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manager.js","sourceRoot":"","sources":["../../src/experience/manager.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAe,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE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AE,SAAS,EAAE,QAAQ,EAAE,CAAC,CAAC;QACtD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC;IACjC,CAAC;IAED,+CAA+C;IAE/C,QAAQ;QACN,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;IAC/B,CAAC;IAED,WAAW;QACT,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;IAClC,CAAC;IAED,eAAe,CAAC,KAAK,GAAG,EAAE;QACxB,OAAO,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC3C,CAAC;IAED;;OAEG;IACH,OAAO;QACL,iBAAiB;IACnB,CAAC;CACF"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 经验搜索引擎 (v2 - 本地+Hub联合 + TF-IDF语义搜索)
|
|
3
|
+
*
|
|
4
|
+
* 搜索策略:
|
|
5
|
+
* 1. 本地经验池:TF-IDF 关键词匹配
|
|
6
|
+
* 2. Hub 远程:如果有本地结果不足,补充搜索 Hub
|
|
7
|
+
* 3. 结果合并去重,按综合评分排序
|
|
8
|
+
*/
|
|
9
|
+
import { LocalExperienceStore } from './local-store.js';
|
|
10
|
+
import { SignalDetector } from './signal-detector.js';
|
|
11
|
+
import { ShrimpHubClient } from './hub-client.js';
|
|
12
|
+
import type { ExperienceSearchResult, ExperienceConfig } from './types.js';
|
|
13
|
+
export declare class ExperienceSearchEngine {
|
|
14
|
+
private logger;
|
|
15
|
+
private store;
|
|
16
|
+
private signalDetector;
|
|
17
|
+
private config;
|
|
18
|
+
private hubClient;
|
|
19
|
+
constructor(store: LocalExperienceStore, config: ExperienceConfig, hubClient?: ShrimpHubClient);
|
|
20
|
+
/**
|
|
21
|
+
* 设置 Hub 客户端
|
|
22
|
+
*/
|
|
23
|
+
setHubClient(client: ShrimpHubClient): void;
|
|
24
|
+
/**
|
|
25
|
+
* 错误发生时自动搜索匹配经验
|
|
26
|
+
*/
|
|
27
|
+
searchByError(errorMessage: string): Promise<ExperienceSearchResult | null>;
|
|
28
|
+
/**
|
|
29
|
+
* 按信号手动搜索
|
|
30
|
+
*/
|
|
31
|
+
searchBySignals(signals: string[]): Promise<ExperienceSearchResult[]>;
|
|
32
|
+
/**
|
|
33
|
+
* 语义搜索:基于 TF-IDF 的问题匹配
|
|
34
|
+
* 输入自然语言问题,提取关键词后搜索
|
|
35
|
+
*/
|
|
36
|
+
semanticSearch(query: string, limit?: number): Promise<ExperienceSearchResult[]>;
|
|
37
|
+
/**
|
|
38
|
+
* 联合搜索:本地 + Hub
|
|
39
|
+
*/
|
|
40
|
+
private unifiedSearch;
|
|
41
|
+
/**
|
|
42
|
+
* 本地搜索(增强版 TF-IDF 匹配)
|
|
43
|
+
*/
|
|
44
|
+
private searchLocal;
|
|
45
|
+
/**
|
|
46
|
+
* 增强 TF-IDF 匹配分数计算
|
|
47
|
+
* 除了信号匹配外,还考虑 summary、description、tags 的关键词密度
|
|
48
|
+
*/
|
|
49
|
+
private computeEnhancedScore;
|
|
50
|
+
/**
|
|
51
|
+
* Hub 搜索
|
|
52
|
+
*/
|
|
53
|
+
private searchHub;
|
|
54
|
+
/**
|
|
55
|
+
* 将 Hub 返回的 GDI + matchScore 转为统一评分
|
|
56
|
+
*/
|
|
57
|
+
private hubMatchToScore;
|
|
58
|
+
/**
|
|
59
|
+
* 合并本地和 Hub 结果(去重,本地优先)
|
|
60
|
+
*/
|
|
61
|
+
private mergeResults;
|
|
62
|
+
/**
|
|
63
|
+
* 缓存 Hub 基因到本地(异步,不阻塞)
|
|
64
|
+
*/
|
|
65
|
+
private cacheHubGene;
|
|
66
|
+
/**
|
|
67
|
+
* 从自然语言查询中提取关键词
|
|
68
|
+
* 简单实现:分词 + 过滤停用词 + 取长度>=2的词
|
|
69
|
+
*/
|
|
70
|
+
private extractKeywords;
|
|
71
|
+
/**
|
|
72
|
+
* 获取信号检测器(供封装器使用)
|
|
73
|
+
*/
|
|
74
|
+
getSignalDetector(): SignalDetector;
|
|
75
|
+
/**
|
|
76
|
+
* 获取存储实例
|
|
77
|
+
*/
|
|
78
|
+
getStore(): LocalExperienceStore;
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=search-engine.d.ts.map
|