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

Method init

src/agent/ToolComponent.ts:43–69  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

41 }
42
43 public async init(): Promise<void> {
44 if (this.isInitialized) {
45 return;
46 }
47
48 try {
49 this.log('初始化工具组件...');
50
51 // 创建工具管理器
52 this.toolManager = await createToolManager(this.config, this.config.includeBuiltinTools);
53
54 // 应用过滤器
55 this.applyFilters();
56
57 // 设置事件监听
58 this.setupEventListeners();
59
60 this.isInitialized = true;
61 this.log('工具组件初始化完成', {
62 totalTools: this.toolManager.getTools().length,
63 stats: this.toolManager.getStats(),
64 });
65 } catch (error) {
66 this.error('工具组件初始化失败', error);
67 throw error;
68 }
69 }
70
71 public async destroy(): Promise<void> {
72 if (!this.isInitialized) {

Callers

nothing calls this directly

Calls 7

logMethod · 0.95
applyFiltersMethod · 0.95
setupEventListenersMethod · 0.95
errorMethod · 0.95
createToolManagerFunction · 0.85
getToolsMethod · 0.45
getStatsMethod · 0.45

Tested by

no test coverage detected