Skip to content

Commit f5e85a7

Browse files
committed
More type cleanup
1 parent 67243d1 commit f5e85a7

File tree

6 files changed

+322
-415
lines changed

6 files changed

+322
-415
lines changed

src/core/Cline.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@ import pWaitFor from "p-wait-for"
1111
import getFolderSize from "get-folder-size"
1212
import { serializeError } from "serialize-error"
1313
import * as vscode from "vscode"
14-
import { isPathOutsideWorkspace } from "../utils/pathUtils"
1514

16-
import { TokenUsage } from "../exports/roo-code"
15+
import { TokenUsage } from "../schemas"
1716
import { ApiHandler, buildApiHandler } from "../api"
1817
import { ApiStream } from "../api/transform/stream"
1918
import { DIFF_VIEW_URI_SCHEME, DiffViewProvider } from "../integrations/editor/DiffViewProvider"
@@ -65,6 +64,7 @@ import { defaultModeSlug, getModeBySlug, getFullModeDetails } from "../shared/mo
6564
import { EXPERIMENT_IDS, experiments as Experiments, ExperimentId } from "../shared/experiments"
6665
import { calculateApiCostAnthropic } from "../utils/cost"
6766
import { fileExistsAtPath } from "../utils/fs"
67+
import { isPathOutsideWorkspace } from "../utils/pathUtils"
6868
import { arePathsEqual, getReadablePath } from "../utils/path"
6969
import { parseMentions } from "./mentions"
7070
import { RooIgnoreController } from "./ignore/RooIgnoreController"

src/exports/roo-code.d.ts

Lines changed: 5 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
1-
import * as vscode from "vscode"
2-
31
import { EventEmitter } from "events"
42

5-
import type { ProviderSettings, GlobalSettings } from "./types"
3+
import * as vscode from "vscode"
64

7-
export type RooCodeSettings = GlobalSettings & ProviderSettings
5+
import type { ProviderSettings, GlobalSettings, ClineMessage, TokenUsage } from "./types"
86

9-
export interface TokenUsage {
10-
totalTokensIn: number
11-
totalTokensOut: number
12-
totalCacheWrites?: number
13-
totalCacheReads?: number
14-
totalCost: number
15-
contextTokens: number
16-
}
7+
type RooCodeSettings = GlobalSettings & ProviderSettings
8+
9+
export type { RooCodeSettings, ProviderSettings, GlobalSettings, ClineMessage, TokenUsage }
1710

1811
export interface RooCodeEvents {
1912
message: [{ taskId: string; action: "created" | "updated"; message: ClineMessage }]
@@ -101,62 +94,3 @@ export interface RooCodeAPI extends EventEmitter<RooCodeEvents> {
10194
*/
10295
log(message: string): void
10396
}
104-
105-
export type ClineAsk =
106-
| "followup"
107-
| "command"
108-
| "command_output"
109-
| "completion_result"
110-
| "tool"
111-
| "api_req_failed"
112-
| "resume_task"
113-
| "resume_completed_task"
114-
| "mistake_limit_reached"
115-
| "browser_action_launch"
116-
| "use_mcp_server"
117-
| "finishTask"
118-
119-
export type ClineSay =
120-
| "task"
121-
| "error"
122-
| "api_req_started"
123-
| "api_req_finished"
124-
| "api_req_retried"
125-
| "api_req_retry_delayed"
126-
| "api_req_deleted"
127-
| "text"
128-
| "reasoning"
129-
| "completion_result"
130-
| "user_feedback"
131-
| "user_feedback_diff"
132-
| "command_output"
133-
| "tool"
134-
| "shell_integration_warning"
135-
| "browser_action"
136-
| "browser_action_result"
137-
| "command"
138-
| "mcp_server_request_started"
139-
| "mcp_server_response"
140-
| "new_task_started"
141-
| "new_task"
142-
| "checkpoint_saved"
143-
| "rooignore_error"
144-
145-
export type ToolProgressStatus = {
146-
icon?: string
147-
text?: string
148-
}
149-
150-
export interface ClineMessage {
151-
ts: number
152-
type: "ask" | "say"
153-
ask?: ClineAsk
154-
say?: ClineSay
155-
text?: string
156-
images?: string[]
157-
partial?: boolean
158-
reasoning?: string
159-
conversationHistoryIndex?: number
160-
checkpoint?: Record<string, unknown>
161-
progressStatus?: ToolProgressStatus
162-
}

0 commit comments

Comments
 (0)