MCPcopy Create free account
hub / github.com/echoVic/blade-code / constructor

Method constructor

src/agent/ContextComponent.ts:47–73  ·  view source on GitHub ↗
(id: string = 'context', config: ContextComponentConfig = {})

Source from the content-addressed store, hash-verified

45 private isReady = false;
46
47 constructor(id: string = 'context', config: ContextComponentConfig = {}) {
48 super(id);
49 this.config = {
50 debug: false,
51 enabled: true,
52 storage: {
53 maxMemorySize: 1000,
54 persistentPath: './blade-context',
55 cacheSize: 100,
56 compressionEnabled: true,
57 ...config.storage,
58 },
59 defaultFilter: {
60 maxTokens: 4000,
61 maxMessages: 50,
62 timeWindow: 24 * 60 * 60 * 1000, // 24小时
63 includeTools: true,
64 includeWorkspace: true,
65 ...config.defaultFilter,
66 },
67 compressionThreshold: 6000,
68 enableVectorSearch: false,
69 ...config,
70 };
71
72 this.log('上下文组件已创建');
73 }
74
75 /**
76 * 初始化上下文组件

Callers

nothing calls this directly

Calls 1

logMethod · 0.95

Tested by

no test coverage detected