mirror of
https://github.com/hellodigua/ChatLab.git
synced 2026-05-24 07:30:52 +08:00
1b059a52cc
- Add electron/shared/types.ts as single source of truth for TokenUsage and AgentRuntimeStatus across main/preload/renderer - Refactor ChatStatusBar.vue to use shared types and i18n keys instead of hardcoded phase text mappings - Add phaseShort translations for zh-CN and en-US
23 lines
629 B
TypeScript
23 lines
629 B
TypeScript
/**
|
|
* Electron 主进程 / Preload / 渲染进程共享的 Agent 类型定义
|
|
*
|
|
* 此文件是 AgentRuntimeStatus、TokenUsage 等跨进程类型的唯一定义源。
|
|
* 所有使用方应从此处导入,避免重复定义导致类型漂移。
|
|
*/
|
|
|
|
export interface TokenUsage {
|
|
promptTokens: number
|
|
completionTokens: number
|
|
totalTokens: number
|
|
}
|
|
|
|
export interface AgentRuntimeStatus {
|
|
phase: 'preparing' | 'thinking' | 'tool_running' | 'responding' | 'completed' | 'aborted' | 'error'
|
|
round: number
|
|
toolsUsed: number
|
|
currentTool?: string
|
|
contextTokens: number
|
|
totalUsage: TokenUsage
|
|
updatedAt: number
|
|
}
|