autosnippet 2.4.0 → 2.6.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/bin/cli.js +35 -0
- package/dashboard/dist/assets/{icons-B5rs8uNb.js → icons-rnn04CvH.js} +100 -85
- package/dashboard/dist/assets/index-BBKa3Dgi.js +195 -0
- package/dashboard/dist/assets/index-DLsECfzW.css +1 -0
- package/dashboard/dist/assets/{react-markdown-Bp8u1wRC.js → react-markdown-CWxUbOf4.js} +1 -1
- package/dashboard/dist/assets/{syntax-highlighter-C6bvFtpx.js → syntax-highlighter-CJ2drQQb.js} +1 -1
- package/dashboard/dist/assets/{vendor-Cky7Jynh.js → vendor-f83ah6cm.js} +13 -13
- package/dashboard/dist/index.html +6 -6
- package/lib/cli/SetupService.js +30 -4
- package/lib/core/gateway/Gateway.js +19 -4
- package/lib/external/ai/AiProvider.js +94 -10
- package/lib/external/mcp/McpServer.js +2 -1
- package/lib/external/mcp/handlers/skill.js +76 -18
- package/lib/external/mcp/tools.js +21 -0
- package/lib/http/HttpServer.js +4 -0
- package/lib/http/routes/search.js +5 -3
- package/lib/http/routes/skills.js +108 -0
- package/lib/infrastructure/audit/AuditStore.js +18 -0
- package/lib/injection/ServiceContainer.js +8 -2
- package/lib/service/chat/ChatAgent.js +281 -33
- package/lib/service/chat/ConversationStore.js +377 -0
- package/lib/service/chat/Memory.js +40 -10
- package/lib/service/chat/tools.js +104 -7
- package/lib/service/skills/EventAggregator.js +187 -0
- package/lib/service/skills/SignalCollector.js +524 -0
- package/lib/service/skills/SkillAdvisor.js +323 -0
- package/package.json +1 -1
- package/dashboard/dist/assets/index-0YzLw2ga.css +0 -1
- package/dashboard/dist/assets/index-B9py3ybr.js +0 -154
package/bin/cli.js
CHANGED
|
@@ -297,12 +297,47 @@ program
|
|
|
297
297
|
|
|
298
298
|
const { bootstrap, container } = await initContainer({ projectRoot });
|
|
299
299
|
|
|
300
|
+
// 连接 EventBus → Gateway(供 SignalCollector 监听事件)
|
|
301
|
+
try {
|
|
302
|
+
const eventBus = container.get('eventBus');
|
|
303
|
+
const gateway = container.get('gateway');
|
|
304
|
+
gateway.eventBus = eventBus;
|
|
305
|
+
} catch { /* EventBus 不可用不阻塞启动 */ }
|
|
306
|
+
|
|
300
307
|
const httpServer = new HttpServer({ port, host });
|
|
301
308
|
await httpServer.initialize();
|
|
302
309
|
await httpServer.start();
|
|
303
310
|
|
|
304
311
|
console.log(`✅ API server running at http://${host}:${port}`);
|
|
305
312
|
|
|
313
|
+
// 启动 SignalCollector 后台 AI 分析服务
|
|
314
|
+
try {
|
|
315
|
+
const { SignalCollector } = await import('../lib/service/skills/SignalCollector.js');
|
|
316
|
+
const { getRealtimeService } = await import('../lib/infrastructure/realtime/RealtimeService.js');
|
|
317
|
+
const db = container.get('database');
|
|
318
|
+
const chatAgent = container.get('chatAgent');
|
|
319
|
+
|
|
320
|
+
const signalCollector = new SignalCollector({
|
|
321
|
+
projectRoot,
|
|
322
|
+
database: db,
|
|
323
|
+
chatAgent,
|
|
324
|
+
mode: process.env.ASD_SIGNAL_MODE || 'suggest',
|
|
325
|
+
intervalMs: parseInt(process.env.ASD_SIGNAL_INTERVAL || '3600000', 10),
|
|
326
|
+
onSuggestions: (suggestions) => {
|
|
327
|
+
try {
|
|
328
|
+
const realtime = getRealtimeService();
|
|
329
|
+
realtime.broadcastEvent('skill:suggestions', { suggestions });
|
|
330
|
+
} catch { /* realtime 未就绪 */ }
|
|
331
|
+
},
|
|
332
|
+
});
|
|
333
|
+
signalCollector.start();
|
|
334
|
+
global._signalCollector = signalCollector;
|
|
335
|
+
console.log(`🧠 SignalCollector started (mode=${signalCollector.getMode()}, AI-driven)`);
|
|
336
|
+
} catch (scErr) {
|
|
337
|
+
console.warn(`⚠️ SignalCollector failed to start: ${scErr.message}`);
|
|
338
|
+
if (process.env.ASD_DEBUG === '1') console.error(scErr.stack);
|
|
339
|
+
}
|
|
340
|
+
|
|
306
341
|
// 3. 启动文件监听器(监控 // as:c // as:s // as:a 等指令)
|
|
307
342
|
try {
|
|
308
343
|
const Paths = await import('../lib/infrastructure/config/Paths.js');
|