Files
KimiCodeSwitch/src/types/sessions.ts
T
KimiSwitch Dev 0f421b4e44
Release / Version consistency (push) Canceled after 0s
Release / Build (macos-latest) (push) Canceled after 0s
Release / Build (ubuntu-latest) (push) Canceled after 0s
Release / Build (windows-latest) (push) Canceled after 0s
Release / Attach macOS install script (push) Canceled after 0s
feat(sessions): 一键归档 + 归档用量快照落库 — bump to v0.7.18
- archive_sessions_before:按 updatedAt 截止点批量元数据归档(1月/半月/周/指定日期)
- 归档瞬间聚合 wire.jsonl 用量按天×模型快照进 SQLite archived_sessions 表
- 统计合并:文件已删除的归档会话由快照合成 UsageRecord 注入
  get_summary/日明细,趋势/热力图/模型统计全兼容且绝不双计
- models-dev 快照同步 2026-09-14(7784 模型);pricing 测试跟随
  deepseek-v4-flash 调价(0.15/0.60)
- cargo test 129 通过(含端到端归档→删目录→统计保留用例)、tsc 零错误
2026-09-14 01:52:21 +08:00

68 lines
1.4 KiB
TypeScript

// Session management types — match Rust structs in dashboard.rs (camelCase serde)
export interface WorkspaceRow {
id: string;
name: string;
root: string | null;
createdAt: string | null;
lastOpenedAt: string | null;
activeCount: number;
archivedCount: number;
empty: boolean;
}
export interface SessionRow {
id: string;
workspaceId: string;
status: "active" | "archived" | string;
title: string | null;
workDir: string | null;
createdAt: string | null;
updatedAt: string | null;
bytes: number;
files: number;
}
export interface SessionsResult {
home: string;
archiveRoot: string;
workspaces: WorkspaceRow[];
sessions: SessionRow[];
}
export interface ActionResponse {
ok: boolean;
workspaceId: string;
sessionId: string;
status?: string | null;
path?: string | null;
deleted?: boolean | null;
}
export interface BulkArchiveResult {
archived: number;
skipped: number;
errors: string[];
}
export interface PreviewMessage {
role: string;
time: number | null;
text: string;
}
export interface PreviewResult {
workspaceId: string;
sessionId: string;
status: string;
title: string | null;
workDir: string | null;
createdAt: string | null;
updatedAt: string | null;
messageCount: number;
truncated: boolean;
messages: PreviewMessage[];
}
export type SessionStatusFilter = "active" | "archived" | "all";