
Security News
Open VSX Unblocks Extension IDs Used in Malware Campaign
Open VSX has removed three extension IDs from its malicious-extension list as the legitimate publishers they impersonated move to claim the names for themselves.
@deepracticex/conversation-storage
Advanced tools
DeeChat 对话存储管理包 - 纯存储层实现
ConversationDomain (业务层)
↓ 依赖注入
conversation-storage (存储层)
↓ 持久化
SQLite 数据库
interface ConversationSession {
id: string // 会话ID
title: string // 会话标题
ai_config_name: string // 关联的AI配置名称
created_at: string // 创建时间
updated_at: string // 更新时间
message_count: number // 消息数量
}
interface ConversationMessage {
id: string // 消息ID
session_id: string // 所属会话ID
role: 'user' | 'assistant' | 'system' // 角色
content: string // 消息内容
timestamp: string // 时间戳
token_usage?: TokenUsage // Token使用情况(可选)
}
createSession(data: CreateSessionData): Promise<ConversationSession>getSession(sessionId: string): Promise<ConversationSession | null>getSessions(): Promise<ConversationSession[]>updateSession(sessionId: string, updates: Partial<SessionData>): Promise<void>deleteSession(sessionId: string): Promise<void>saveMessage(data: CreateMessageData): Promise<ConversationMessage>getMessageHistory(sessionId: string): Promise<ConversationMessage[]>deleteMessagesBySession(sessionId: string): Promise<void>updateMessageCount(sessionId: string): Promise<void>CREATE TABLE sessions (
id TEXT PRIMARY KEY,
title TEXT NOT NULL,
ai_config_name TEXT NOT NULL,
created_at TEXT NOT NULL,
updated_at TEXT NOT NULL,
message_count INTEGER DEFAULT 0
);
CREATE TABLE messages (
id TEXT PRIMARY KEY,
session_id TEXT NOT NULL,
role TEXT NOT NULL CHECK(role IN ('user', 'assistant', 'system')),
content TEXT NOT NULL,
timestamp TEXT NOT NULL,
token_usage TEXT, -- JSON格式存储
FOREIGN KEY (session_id) REFERENCES sessions(id) ON DELETE CASCADE
);
CREATE INDEX idx_messages_session_id ON messages(session_id);
CREATE INDEX idx_messages_timestamp ON messages(timestamp);
CREATE INDEX idx_sessions_updated_at ON sessions(updated_at);
export class ConversationDomain implements IDomain {
private conversationStorage: ConversationStorage
constructor(
private aiConfigDomain: AIConfigurationDomain,
conversationStorage: ConversationStorage
) {
this.conversationStorage = conversationStorage
}
async createSession(input: CreateSessionInput): Promise<ConversationSession> {
// 业务逻辑验证
const aiConfig = await this.aiConfigDomain.getUserConfiguration(input.ai_config_name)
if (!aiConfig) {
throw new Error(`AI配置 '${input.ai_config_name}' 不存在`)
}
// 调用存储层
return await this.conversationStorage.createSession({
title: input.title || `对话 ${new Date().toLocaleString()}`,
ai_config_name: input.ai_config_name
})
}
}
参照 @deepracticex/ai-config 包的设计模式:
FAQs
DeeChat 对话存储管理包 - 纯存储层实现,支持统一数据库文件的表管理模式
The npm package @deepracticex/conversation-storage receives a total of 48 weekly downloads. As such, @deepracticex/conversation-storage popularity was classified as not popular.
We found that @deepracticex/conversation-storage demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.

Security News
Open VSX has removed three extension IDs from its malicious-extension list as the legitimate publishers they impersonated move to claim the names for themselves.

Product
Socket’s PHP and Composer support is now in Beta for all customers, with PHP reachability analysis generally available.

Product
Socket is bringing experimental protection to Firefox, scanning 97,000+ extensions in Mozilla's official directory for malware and risky updates.