|
@@ -11,15 +11,17 @@ try {
|
|
|
console.warn("Failed to load environment variables:", e)
|
|
console.warn("Failed to load environment variables:", e)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-import { ClineProvider } from "./core/webview/ClineProvider"
|
|
|
|
|
-import { createClineAPI } from "./exports"
|
|
|
|
|
import "./utils/path" // Necessary to have access to String.prototype.toPosix.
|
|
import "./utils/path" // Necessary to have access to String.prototype.toPosix.
|
|
|
|
|
+
|
|
|
|
|
+import { createClineAPI } from "./exports"
|
|
|
|
|
+import { ClineProvider } from "./core/webview/ClineProvider"
|
|
|
import { CodeActionProvider } from "./core/CodeActionProvider"
|
|
import { CodeActionProvider } from "./core/CodeActionProvider"
|
|
|
import { DIFF_VIEW_URI_SCHEME } from "./integrations/editor/DiffViewProvider"
|
|
import { DIFF_VIEW_URI_SCHEME } from "./integrations/editor/DiffViewProvider"
|
|
|
-import { handleUri, registerCommands, registerCodeActions } from "./activate"
|
|
|
|
|
import { McpServerManager } from "./services/mcp/McpServerManager"
|
|
import { McpServerManager } from "./services/mcp/McpServerManager"
|
|
|
import { telemetryService } from "./services/telemetry/TelemetryService"
|
|
import { telemetryService } from "./services/telemetry/TelemetryService"
|
|
|
|
|
|
|
|
|
|
+import { handleUri, registerCommands, registerCodeActions } from "./activate"
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* Built using https://github.com/microsoft/vscode-webview-ui-toolkit
|
|
* Built using https://github.com/microsoft/vscode-webview-ui-toolkit
|
|
|
*
|
|
*
|
|
@@ -31,18 +33,6 @@ import { telemetryService } from "./services/telemetry/TelemetryService"
|
|
|
let outputChannel: vscode.OutputChannel
|
|
let outputChannel: vscode.OutputChannel
|
|
|
let extensionContext: vscode.ExtensionContext
|
|
let extensionContext: vscode.ExtensionContext
|
|
|
|
|
|
|
|
-// Callback mapping of human relay response
|
|
|
|
|
-const humanRelayCallbacks = new Map<string, (response: string | undefined) => void>()
|
|
|
|
|
-
|
|
|
|
|
-/**
|
|
|
|
|
- * Register a callback function for human relay response
|
|
|
|
|
- * @param requestId
|
|
|
|
|
- * @param callback
|
|
|
|
|
- */
|
|
|
|
|
-export function registerHumanRelayCallback(requestId: string, callback: (response: string | undefined) => void): void {
|
|
|
|
|
- humanRelayCallbacks.set(requestId, callback)
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
// This method is called when your extension is activated.
|
|
// This method is called when your extension is activated.
|
|
|
// Your extension is activated the very first time the command is executed.
|
|
// Your extension is activated the very first time the command is executed.
|
|
|
export function activate(context: vscode.ExtensionContext) {
|
|
export function activate(context: vscode.ExtensionContext) {
|
|
@@ -72,40 +62,6 @@ export function activate(context: vscode.ExtensionContext) {
|
|
|
|
|
|
|
|
registerCommands({ context, outputChannel, provider: sidebarProvider })
|
|
registerCommands({ context, outputChannel, provider: sidebarProvider })
|
|
|
|
|
|
|
|
- // Register human relay callback registration command
|
|
|
|
|
- context.subscriptions.push(
|
|
|
|
|
- vscode.commands.registerCommand(
|
|
|
|
|
- "roo-cline.registerHumanRelayCallback",
|
|
|
|
|
- (requestId: string, callback: (response: string | undefined) => void) => {
|
|
|
|
|
- registerHumanRelayCallback(requestId, callback)
|
|
|
|
|
- },
|
|
|
|
|
- ),
|
|
|
|
|
- )
|
|
|
|
|
-
|
|
|
|
|
- // Register human relay response processing command
|
|
|
|
|
- context.subscriptions.push(
|
|
|
|
|
- vscode.commands.registerCommand(
|
|
|
|
|
- "roo-cline.handleHumanRelayResponse",
|
|
|
|
|
- (response: { requestId: string; text?: string; cancelled?: boolean }) => {
|
|
|
|
|
- const callback = humanRelayCallbacks.get(response.requestId)
|
|
|
|
|
- if (callback) {
|
|
|
|
|
- if (response.cancelled) {
|
|
|
|
|
- callback(undefined)
|
|
|
|
|
- } else {
|
|
|
|
|
- callback(response.text)
|
|
|
|
|
- }
|
|
|
|
|
- humanRelayCallbacks.delete(response.requestId)
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- ),
|
|
|
|
|
- )
|
|
|
|
|
-
|
|
|
|
|
- context.subscriptions.push(
|
|
|
|
|
- vscode.commands.registerCommand("roo-cline.unregisterHumanRelayCallback", (requestId: string) => {
|
|
|
|
|
- humanRelayCallbacks.delete(requestId)
|
|
|
|
|
- }),
|
|
|
|
|
- )
|
|
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* We use the text document content provider API to show the left side for diff
|
|
* We use the text document content provider API to show the left side for diff
|
|
|
* view by creating a virtual document for the original content. This makes it
|
|
* view by creating a virtual document for the original content. This makes it
|