cline--cline
34 行
668 B
TypeScript
34 行
668 B
TypeScript
export type SessionHistoryStatus =
|
|
| "running"
|
|
| "completed"
|
|
| "failed"
|
|
| "cancelled"
|
|
| "idle";
|
|
|
|
export type SessionMetadata = {
|
|
title?: string;
|
|
[key: string]: unknown;
|
|
};
|
|
|
|
export interface SessionHistoryItem {
|
|
sessionId: string;
|
|
status: SessionHistoryStatus;
|
|
provider: string;
|
|
model: string;
|
|
cwd: string;
|
|
workspaceRoot: string;
|
|
parentSessionId?: string;
|
|
isSubagent?: boolean;
|
|
prompt?: string;
|
|
startedAt: string;
|
|
endedAt?: string;
|
|
metadata?: SessionMetadata;
|
|
}
|
|
|
|
export function getSessionMetadataTitle(metadata?: SessionMetadata): string {
|
|
if (!metadata) {
|
|
return "";
|
|
}
|
|
return typeof metadata.title === "string" ? metadata.title.trim() : "";
|
|
}
|