From 5e808c1d190f5badb878cb0f85ce3c3a45218c3a Mon Sep 17 00:00:00 2001 From: cte Date: Wed, 19 Mar 2025 23:44:12 -0700 Subject: [PATCH] Link to roo-code.d.ts --- benchmark/packages/runner/src/roo-code.d.ts | 260 -------------------- benchmark/packages/runner/src/run.ts | 2 +- benchmark/packages/runner/src/utils.ts | 2 +- benchmark/packages/runner/tsconfig.json | 2 +- 4 files changed, 3 insertions(+), 263 deletions(-) delete mode 100644 benchmark/packages/runner/src/roo-code.d.ts diff --git a/benchmark/packages/runner/src/roo-code.d.ts b/benchmark/packages/runner/src/roo-code.d.ts deleted file mode 100644 index 8134d775fe..0000000000 --- a/benchmark/packages/runner/src/roo-code.d.ts +++ /dev/null @@ -1,260 +0,0 @@ -import { EventEmitter } from "events" - -export interface TokenUsage { - totalTokensIn: number - totalTokensOut: number - totalCacheWrites?: number - totalCacheReads?: number - totalCost: number - contextTokens: number -} - -export interface RooCodeEvents { - message: [{ taskId: string; action: "created" | "updated"; message: ClineMessage }] - taskStarted: [taskId: string] - taskPaused: [taskId: string] - taskUnpaused: [taskId: string] - taskAskResponded: [taskId: string] - taskAborted: [taskId: string] - taskSpawned: [taskId: string, childTaskId: string] - taskCompleted: [taskId: string, usage: TokenUsage] - taskTokenUsageUpdated: [taskId: string, usage: TokenUsage] -} - -export interface RooCodeAPI extends EventEmitter { - /** - * Starts a new task with an optional initial message and images. - * @param task Optional initial task message. - * @param images Optional array of image data URIs (e.g., "data:image/webp;base64,..."). - * @returns The ID of the new task. - */ - startNewTask(task?: string, images?: string[]): Promise - - /** - * Returns the current task stack. - * @returns An array of task IDs. - */ - getCurrentTaskStack(): string[] - - /** - * Clears the current task. - */ - clearCurrentTask(lastMessage?: string): Promise - - /** - * Cancels the current task. - */ - cancelCurrentTask(): Promise - - /** - * Sends a message to the current task. - * @param message Optional message to send. - * @param images Optional array of image data URIs (e.g., "data:image/webp;base64,..."). - */ - sendMessage(message?: string, images?: string[]): Promise - - /** - * Simulates pressing the primary button in the chat interface. - */ - pressPrimaryButton(): Promise - - /** - * Simulates pressing the secondary button in the chat interface. - */ - pressSecondaryButton(): Promise - - /** - * Sets the configuration for the current task. - * @param values An object containing key-value pairs to set. - */ - setConfiguration(values: Partial): Promise - - /** - * Returns true if the API is ready to use. - */ - isReady(): boolean - - /** - * Returns the messages for a given task. - * @param taskId The ID of the task. - * @returns An array of ClineMessage objects. - */ - getMessages(taskId: string): ClineMessage[] - - /** - * Returns the token usage for a given task. - * @param taskId The ID of the task. - * @returns A TokenUsage object. - */ - getTokenUsage(taskId: string): TokenUsage - - /** - * Logs a message to the output channel. - * @param message The message to log. - */ - log(message: string): void -} - -export type ClineAsk = - | "followup" - | "command" - | "command_output" - | "completion_result" - | "tool" - | "api_req_failed" - | "resume_task" - | "resume_completed_task" - | "mistake_limit_reached" - | "browser_action_launch" - | "use_mcp_server" - | "finishTask" - -export type ClineSay = - | "task" - | "error" - | "api_req_started" - | "api_req_finished" - | "api_req_retried" - | "api_req_retry_delayed" - | "api_req_deleted" - | "text" - | "reasoning" - | "completion_result" - | "user_feedback" - | "user_feedback_diff" - | "command_output" - | "tool" - | "shell_integration_warning" - | "browser_action" - | "browser_action_result" - | "command" - | "mcp_server_request_started" - | "mcp_server_response" - | "new_task_started" - | "new_task" - | "checkpoint_saved" - | "rooignore_error" - -export interface ClineMessage { - ts: number - type: "ask" | "say" - ask?: ClineAsk - say?: ClineSay - text?: string - images?: string[] - partial?: boolean - reasoning?: string - conversationHistoryIndex?: number - checkpoint?: Record - progressStatus?: ToolProgressStatus -} - -export type SecretKey = - | "apiKey" - | "glamaApiKey" - | "openRouterApiKey" - | "awsAccessKey" - | "awsSecretKey" - | "awsSessionToken" - | "openAiApiKey" - | "geminiApiKey" - | "openAiNativeApiKey" - | "deepSeekApiKey" - | "mistralApiKey" - | "unboundApiKey" - | "requestyApiKey" - -export type GlobalStateKey = - | "apiProvider" - | "apiModelId" - | "glamaModelId" - | "glamaModelInfo" - | "awsRegion" - | "awsUseCrossRegionInference" - | "awsProfile" - | "awsUseProfile" - | "awsCustomArn" - | "vertexKeyFile" - | "vertexJsonCredentials" - | "vertexProjectId" - | "vertexRegion" - | "lastShownAnnouncementId" - | "customInstructions" - | "alwaysAllowReadOnly" - | "alwaysAllowWrite" - | "alwaysAllowExecute" - | "alwaysAllowBrowser" - | "alwaysAllowMcp" - | "alwaysAllowModeSwitch" - | "alwaysAllowSubtasks" - | "taskHistory" - | "openAiBaseUrl" - | "openAiModelId" - | "openAiCustomModelInfo" - | "openAiUseAzure" - | "ollamaModelId" - | "ollamaBaseUrl" - | "lmStudioModelId" - | "lmStudioBaseUrl" - | "anthropicBaseUrl" - | "modelMaxThinkingTokens" - | "azureApiVersion" - | "openAiStreamingEnabled" - | "openRouterModelId" - | "openRouterModelInfo" - | "openRouterBaseUrl" - | "openRouterSpecificProvider" - | "openRouterUseMiddleOutTransform" - | "googleGeminiBaseUrl" - | "allowedCommands" - | "ttsEnabled" - | "ttsSpeed" - | "soundEnabled" - | "soundVolume" - | "diffEnabled" - | "enableCheckpoints" - | "checkpointStorage" - | "browserViewportSize" - | "screenshotQuality" - | "remoteBrowserHost" - | "fuzzyMatchThreshold" - | "writeDelayMs" - | "terminalOutputLineLimit" - | "terminalShellIntegrationTimeout" - | "mcpEnabled" - | "enableMcpServerCreation" - | "alwaysApproveResubmit" - | "requestDelaySeconds" - | "rateLimitSeconds" - | "currentApiConfigName" - | "listApiConfigMeta" - | "vsCodeLmModelSelector" - | "mode" - | "modeApiConfigs" - | "customModePrompts" - | "customSupportPrompts" - | "enhancementApiConfigId" - | "experiments" // Map of experiment IDs to their enabled state - | "autoApprovalEnabled" - | "enableCustomModeCreation" // Enable the ability for Roo to create custom modes - | "customModes" // Array of custom modes - | "unboundModelId" - | "requestyModelId" - | "requestyModelInfo" - | "unboundModelInfo" - | "modelTemperature" - | "modelMaxTokens" - | "mistralCodestralUrl" - | "maxOpenTabsContext" - | "maxWorkspaceFiles" - | "browserToolEnabled" - | "lmStudioSpeculativeDecodingEnabled" - | "lmStudioDraftModelId" - | "telemetrySetting" - | "showRooIgnoredFiles" - | "remoteBrowserEnabled" - | "language" - -export type ConfigurationKey = GlobalStateKey | SecretKey - -export type ConfigurationValues = Record diff --git a/benchmark/packages/runner/src/run.ts b/benchmark/packages/runner/src/run.ts index 25d5816149..1c9b1e9e1b 100644 --- a/benchmark/packages/runner/src/run.ts +++ b/benchmark/packages/runner/src/run.ts @@ -3,7 +3,7 @@ import * as path from "path" import * as vscode from "vscode" -import { RooCodeAPI, TokenUsage } from "./roo-code" +import { RooCodeAPI, TokenUsage } from "../../../../src/exports/roo-code" import { waitUntilReady, waitUntilCompleted, sleep } from "./utils" diff --git a/benchmark/packages/runner/src/utils.ts b/benchmark/packages/runner/src/utils.ts index f8bcfc84f0..96642bda0a 100644 --- a/benchmark/packages/runner/src/utils.ts +++ b/benchmark/packages/runner/src/utils.ts @@ -1,6 +1,6 @@ import * as vscode from "vscode" -import { RooCodeAPI, TokenUsage } from "./roo-code" +import { RooCodeAPI, TokenUsage } from "../../../../src/exports/roo-code" type WaitForOptions = { timeout?: number diff --git a/benchmark/packages/runner/tsconfig.json b/benchmark/packages/runner/tsconfig.json index d11199c83c..1cba37f505 100644 --- a/benchmark/packages/runner/tsconfig.json +++ b/benchmark/packages/runner/tsconfig.json @@ -11,5 +11,5 @@ "useUnknownInCatchVariables": false, "outDir": "dist" }, - "include": ["src"] + "include": ["src", "../../../../src/exports/roo-code.d.ts"] }