|
1 | | -export interface Project { |
2 | | - encodedPath: string; |
3 | | - name: string; |
4 | | - fullPath: string; |
5 | | - sessionCount: number; |
6 | | - lastActivity: string; |
7 | | -} |
8 | | - |
9 | | -export interface SessionSummary { |
10 | | - sessionId: string; |
11 | | - timestamp: string; |
12 | | - slug: string; |
13 | | - firstMessage: string; |
14 | | - model: string; |
15 | | - gitBranch: string; |
16 | | - sessionType?: "plan" | "implementation" | undefined; |
17 | | - pluginId?: string | undefined; |
18 | | -} |
19 | | - |
20 | | -export interface Session { |
21 | | - sessionId: string; |
22 | | - project: string; |
23 | | - turns: Turn[]; |
24 | | - planSessionId?: string | undefined; |
25 | | - implSessionId?: string | undefined; |
26 | | - pluginId?: string | undefined; |
27 | | -} |
28 | | - |
29 | | -export type Turn = UserTurn | AssistantTurn | SystemTurn | ParseErrorTurn; |
30 | | - |
31 | | -export interface Attachment { |
32 | | - type: "image"; |
33 | | - mediaType: string; |
34 | | -} |
35 | | - |
36 | | -export interface UserTurn { |
37 | | - kind: "user"; |
38 | | - uuid: string; |
39 | | - timestamp: string; |
40 | | - text: string; |
41 | | - command?: |
42 | | - | { |
43 | | - name: string; |
44 | | - args: string; |
45 | | - } |
46 | | - | undefined; |
47 | | - attachments?: Attachment[] | undefined; |
48 | | - bashInput?: string | undefined; |
49 | | - bashStdout?: string | undefined; |
50 | | - bashStderr?: string | undefined; |
51 | | - ideOpenedFile?: string | undefined; |
52 | | -} |
53 | | - |
54 | | -export type ContentBlock = |
55 | | - | { type: "thinking"; block: ThinkingBlock } |
56 | | - | { type: "text"; text: string } |
57 | | - | { type: "tool_call"; call: ToolCallWithResult }; |
58 | | - |
59 | | -export interface AssistantTurn { |
60 | | - kind: "assistant"; |
61 | | - uuid: string; |
62 | | - timestamp: string; |
63 | | - model: string; |
64 | | - contentBlocks: ContentBlock[]; |
65 | | - usage?: TokenUsage | undefined; |
66 | | - stopReason?: string | undefined; |
67 | | -} |
68 | | - |
69 | | -export interface TokenUsage { |
70 | | - inputTokens: number; |
71 | | - outputTokens: number; |
72 | | - cacheReadTokens?: number | undefined; |
73 | | - cacheCreationTokens?: number | undefined; |
74 | | -} |
75 | | - |
76 | | -export interface SystemTurn { |
77 | | - kind: "system"; |
78 | | - uuid: string; |
79 | | - timestamp: string; |
80 | | - text: string; |
81 | | -} |
82 | | - |
83 | | -export interface ParseErrorTurn { |
84 | | - kind: "parse_error"; |
85 | | - uuid: string; |
86 | | - timestamp: string; |
87 | | - lineNumber: number; |
88 | | - rawLine: string; |
89 | | - errorType: "json_parse" | "invalid_structure"; |
90 | | - errorDetails?: string | undefined; |
91 | | -} |
92 | | - |
93 | | -export interface ThinkingBlock { |
94 | | - text: string; |
95 | | -} |
96 | | - |
97 | | -export interface ToolCallWithResult { |
98 | | - toolUseId: string; |
99 | | - name: string; |
100 | | - input: Record<string, unknown>; |
101 | | - result: string; |
102 | | - isError: boolean; |
103 | | - resultImages?: ToolResultImage[] | undefined; |
104 | | - subAgentId?: string | undefined; |
105 | | -} |
106 | | - |
107 | | -export interface ToolResultImage { |
108 | | - mediaType: string; |
109 | | - data: string; |
110 | | -} |
111 | | - |
112 | | -export interface GlobalSessionResult extends SessionSummary { |
113 | | - encodedPath: string; |
114 | | - projectName: string; |
115 | | - pluginId?: string | undefined; |
116 | | -} |
117 | | - |
118 | | -export interface ModelTokenUsage { |
119 | | - inputTokens: number; |
120 | | - outputTokens: number; |
121 | | - cacheReadTokens: number; |
122 | | - cacheCreationTokens: number; |
123 | | -} |
124 | | - |
125 | | -export interface DashboardStats { |
126 | | - projects: number; |
127 | | - sessions: number; |
128 | | - messages: number; |
129 | | - todaySessions: number; |
130 | | - thisWeekSessions: number; |
131 | | - inputTokens: number; |
132 | | - outputTokens: number; |
133 | | - cacheReadTokens: number; |
134 | | - cacheCreationTokens: number; |
135 | | - toolCalls: number; |
136 | | - models: Record<string, ModelTokenUsage>; |
137 | | -} |
| 1 | +import type { ContentBlock } from "@cookielab.io/klovi-plugin-core"; |
| 2 | + |
| 3 | +export type { |
| 4 | + AssistantTurn, |
| 5 | + Attachment, |
| 6 | + ContentBlock, |
| 7 | + DashboardStats, |
| 8 | + GlobalSessionResult, |
| 9 | + ModelTokenUsage, |
| 10 | + ParseErrorTurn, |
| 11 | + Project, |
| 12 | + Session, |
| 13 | + SessionSummary, |
| 14 | + SystemTurn, |
| 15 | + ThinkingBlock, |
| 16 | + TokenUsage, |
| 17 | + ToolCallWithResult, |
| 18 | + ToolResultImage, |
| 19 | + Turn, |
| 20 | + UserTurn, |
| 21 | +} from "@cookielab.io/klovi-plugin-core"; |
138 | 22 |
|
139 | 23 | /** |
140 | 24 | * Groups content blocks into presentation steps. |
|
0 commit comments