autosnippet 3.2.20 → 3.2.21
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/LICENSE +1 -1
- package/config/default.json +1 -1
- package/dist/lib/cli/deploy/FileManifest.js +2 -8
- package/dist/lib/external/mcp/handlers/system.js +4 -2
- package/dist/lib/infrastructure/logging/Logger.js +1 -1
- package/dist/lib/infrastructure/monitoring/ErrorTracker.js +1 -1
- package/dist/lib/injection/modules/KnowledgeModule.js +4 -5
- package/dist/lib/shared/schemas/config.js +1 -1
- package/package.json +1 -1
package/LICENSE
CHANGED
package/config/default.json
CHANGED
|
@@ -218,16 +218,10 @@ export const GITIGNORE_RULES = [
|
|
|
218
218
|
{ pattern: '!.autosnippet/config.json', negation: true },
|
|
219
219
|
// Environment (contains API keys created by `asd setup`)
|
|
220
220
|
{ pattern: '.env', comment: '环境变量(含 API Key)' },
|
|
221
|
-
// Logs
|
|
222
|
-
{ pattern: 'logs/', comment: '运行日志' },
|
|
221
|
+
// Logs(已收纳到 .autosnippet/ 下,由 .autosnippet/* 统一覆盖)
|
|
223
222
|
];
|
|
224
223
|
/** .gitignore 迁移规则 — 升级时清理旧格式 */
|
|
225
|
-
export const GITIGNORE_MIGRATIONS = [
|
|
226
|
-
// v2.4.0: ".autosnippet/" → ".autosnippet/*"
|
|
227
|
-
{ find: /^\.autosnippet\/$/m, replace: '.autosnippet/*' },
|
|
228
|
-
// Skills 已迁移到 AutoSnippet/skills/,清理旧 negation
|
|
229
|
-
{ find: /^!?\.autosnippet\/skills\/.*\n?/gm, replace: '' },
|
|
230
|
-
];
|
|
224
|
+
export const GITIGNORE_MIGRATIONS = [];
|
|
231
225
|
/** MCP Server 配置生成器 */
|
|
232
226
|
export function buildMcpServerEntry(projectRoot, ide) {
|
|
233
227
|
const base = {
|
|
@@ -23,8 +23,10 @@ export async function health(ctx) {
|
|
|
23
23
|
}
|
|
24
24
|
// 2) Database 连通性 + 知识库统计
|
|
25
25
|
try {
|
|
26
|
-
const
|
|
27
|
-
if (
|
|
26
|
+
const dbConn = ctx.container.get('database');
|
|
27
|
+
if (dbConn) {
|
|
28
|
+
// DatabaseConnection 包装器 → 解包获取原始 better-sqlite3 实例
|
|
29
|
+
const db = typeof dbConn.getDb === 'function' ? dbConn.getDb() : dbConn;
|
|
28
30
|
db.prepare('SELECT 1').get();
|
|
29
31
|
checks.database = true;
|
|
30
32
|
// 知识库统计(轻量聚合查询)
|
|
@@ -98,7 +98,7 @@ export class Logger {
|
|
|
98
98
|
static instance = null;
|
|
99
99
|
static getInstance(config = {}) {
|
|
100
100
|
if (!this.instance) {
|
|
101
|
-
const logsDir = config.file?.path || '
|
|
101
|
+
const logsDir = config.file?.path || './.autosnippet/logs';
|
|
102
102
|
// 确保日志目录存在
|
|
103
103
|
if (!fs.existsSync(logsDir)) {
|
|
104
104
|
fs.mkdirSync(logsDir, { recursive: true });
|
|
@@ -14,7 +14,7 @@ export class ErrorTracker {
|
|
|
14
14
|
reportInterval;
|
|
15
15
|
constructor(options = {}) {
|
|
16
16
|
this.config = {
|
|
17
|
-
logDirectory: options.logDirectory || path.join(process.cwd(), 'logs', 'errors'),
|
|
17
|
+
logDirectory: options.logDirectory || path.join(process.cwd(), '.autosnippet', 'logs', 'errors'),
|
|
18
18
|
maxErrorsInMemory: options.maxErrorsInMemory || 500,
|
|
19
19
|
enableFileLogging: options.enableFileLogging !== false,
|
|
20
20
|
enableConsoleLogging: options.enableConsoleLogging !== false,
|
|
@@ -18,7 +18,6 @@ import { CodeEntityGraph } from '../../service/knowledge/CodeEntityGraph.js';
|
|
|
18
18
|
import { ConfidenceRouter } from '../../service/knowledge/ConfidenceRouter.js';
|
|
19
19
|
import { KnowledgeGraphService } from '../../service/knowledge/KnowledgeGraphService.js';
|
|
20
20
|
import { KnowledgeService } from '../../service/knowledge/KnowledgeService.js';
|
|
21
|
-
import { CrossEncoderReranker } from '../../service/search/CrossEncoderReranker.js';
|
|
22
21
|
import { HybridRetriever } from '../../service/search/HybridRetriever.js';
|
|
23
22
|
import { SearchEngine } from '../../service/search/SearchEngine.js';
|
|
24
23
|
import { LanguageService } from '../../shared/LanguageService.js';
|
|
@@ -47,10 +46,10 @@ export function register(c) {
|
|
|
47
46
|
vectorStore: ct.get('vectorStore'),
|
|
48
47
|
vectorService,
|
|
49
48
|
hybridRetriever: ct.get('hybridRetriever'),
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
// CrossEncoderReranker disabled — BM25+vector dual-recall + CoarseRanker + MultiSignalRanker
|
|
50
|
+
// is sufficient for knowledge-base scale (hundreds~thousands of entries).
|
|
51
|
+
// Re-enable when document scale grows to 10k+ or external noisy sources are integrated.
|
|
52
|
+
crossEncoderReranker: null,
|
|
54
53
|
});
|
|
55
54
|
}, { aiDependent: true });
|
|
56
55
|
c.singleton('vectorStore', (ct) => {
|
|
@@ -32,7 +32,7 @@ const MonitoringConfig = z.object({
|
|
|
32
32
|
});
|
|
33
33
|
const FileLogConfig = z.object({
|
|
34
34
|
enabled: z.boolean().default(true),
|
|
35
|
-
path: z.string().default('
|
|
35
|
+
path: z.string().default('./.autosnippet/logs'),
|
|
36
36
|
});
|
|
37
37
|
const LoggingConfig = z.object({
|
|
38
38
|
level: z.enum(['debug', 'info', 'warn', 'error', 'silent']).default('info'),
|