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

Method initialize

src/context/ContextManager.ts:67–85  ·  view source on GitHub ↗

* 初始化上下文管理器

()

Source from the content-addressed store, hash-verified

65 * 初始化上下文管理器
66 */
67 async initialize(): Promise<void> {
68 if (this.initialized) return;
69
70 try {
71 await this.persistent.initialize();
72
73 // 检查存储健康状态
74 const health = await this.persistent.checkStorageHealth();
75 if (!health.isAvailable) {
76 console.warn('警告:持久化存储不可用,将仅使用内存存储');
77 }
78
79 this.initialized = true;
80 console.log('上下文管理器初始化完成');
81 } catch (error) {
82 console.error('上下文管理器初始化失败:', error);
83 throw error;
84 }
85 }
86
87 /**
88 * 创建新会话

Callers 2

exampleFunction · 0.45
initMethod · 0.45

Calls 4

checkStorageHealthMethod · 0.80
warnMethod · 0.45
logMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected