Skip to content

Commit 503b68e

Browse files
committed
Update @roo-code/cloud to enable roomote control for cloud agents
1 parent f02a2bb commit 503b68e

File tree

5 files changed

+55
-33
lines changed

5 files changed

+55
-33
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,6 @@ logs
4646
.qodo/
4747
.vercel
4848
.roo/mcp.json
49+
50+
# Qdrant
51+
qdrant_storage/

pnpm-lock.yaml

Lines changed: 15 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/extension.ts

Lines changed: 35 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -94,27 +94,60 @@ export async function activate(context: vscode.ExtensionContext) {
9494

9595
const contextProxy = await ContextProxy.getInstance(context)
9696

97-
// Initialize code index managers for all workspace folders
97+
// Initialize code index managers for all workspace folders.
9898
const codeIndexManagers: CodeIndexManager[] = []
99+
99100
if (vscode.workspace.workspaceFolders) {
100101
for (const folder of vscode.workspace.workspaceFolders) {
101102
const manager = CodeIndexManager.getInstance(context, folder.uri.fsPath)
103+
102104
if (manager) {
103105
codeIndexManagers.push(manager)
106+
104107
try {
105108
await manager.initialize(contextProxy)
106109
} catch (error) {
107110
outputChannel.appendLine(
108111
`[CodeIndexManager] Error during background CodeIndexManager configuration/indexing for ${folder.uri.fsPath}: ${error.message || error}`,
109112
)
110113
}
114+
111115
context.subscriptions.push(manager)
112116
}
113117
}
114118
}
115119

120+
const postStateListener = () => ClineProvider.getVisibleInstance()?.postStateToWebview()
121+
116122
// Initialize Roo Code Cloud service.
117-
const cloudService = await CloudService.createInstance(context, cloudLogger)
123+
const cloudService = await CloudService.createInstance(context, cloudLogger, {
124+
"auth-state-changed": postStateListener,
125+
"settings-updated": postStateListener,
126+
"user-info": async ({ userInfo }) => {
127+
postStateListener()
128+
129+
if (!CloudService.instance.cloudAPI) {
130+
cloudLogger("[CloudService] CloudAPI is not initialized")
131+
return
132+
}
133+
134+
try {
135+
const config = await CloudService.instance.cloudAPI.bridgeConfig()
136+
cloudLogger(`[CloudService] bridgeConfig -> ${JSON.stringify(config)}`)
137+
138+
ExtensionBridgeService.handleRemoteControlState(
139+
userInfo,
140+
contextProxy.getValue("remoteControlEnabled"),
141+
{ ...config, provider, sessionId: vscode.env.sessionId },
142+
(message: string) => outputChannel.appendLine(message),
143+
)
144+
} catch (error) {
145+
cloudLogger(
146+
`[CloudService] Failed to fetch bridgeConfig: ${error instanceof Error ? error.message : String(error)}`,
147+
)
148+
}
149+
},
150+
})
118151

119152
try {
120153
if (cloudService.telemetryClient) {
@@ -126,29 +159,6 @@ export async function activate(context: vscode.ExtensionContext) {
126159
)
127160
}
128161

129-
const postStateListener = () => ClineProvider.getVisibleInstance()?.postStateToWebview()
130-
131-
cloudService.on("auth-state-changed", postStateListener)
132-
cloudService.on("settings-updated", postStateListener)
133-
134-
cloudService.on("user-info", async ({ userInfo }) => {
135-
postStateListener()
136-
137-
const bridgeConfig = await cloudService.cloudAPI?.bridgeConfig().catch(() => undefined)
138-
139-
if (!bridgeConfig) {
140-
outputChannel.appendLine("[CloudService] Failed to get bridge config")
141-
return
142-
}
143-
144-
ExtensionBridgeService.handleRemoteControlState(
145-
userInfo,
146-
contextProxy.getValue("remoteControlEnabled"),
147-
{ ...bridgeConfig, provider, sessionId: vscode.env.sessionId },
148-
(message: string) => outputChannel.appendLine(message),
149-
)
150-
})
151-
152162
// Add to subscriptions for proper cleanup on deactivate.
153163
context.subscriptions.push(cloudService)
154164

src/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@
429429
"@mistralai/mistralai": "^1.9.18",
430430
"@modelcontextprotocol/sdk": "^1.9.0",
431431
"@qdrant/js-client-rest": "^1.14.0",
432-
"@roo-code/cloud": "^0.22.0",
432+
"@roo-code/cloud": "^0.24.0",
433433
"@roo-code/ipc": "workspace:^",
434434
"@roo-code/telemetry": "workspace:^",
435435
"@roo-code/types": "workspace:^",
@@ -455,6 +455,7 @@
455455
"i18next": "^25.0.0",
456456
"ignore": "^7.0.3",
457457
"isbinaryfile": "^5.0.2",
458+
"jwt-decode": "^4.0.0",
458459
"lodash.debounce": "^4.0.8",
459460
"mammoth": "^1.9.1",
460461
"monaco-vscode-textmate-theme-converter": "^0.1.7",

webview-ui/src/components/chat/ChatView.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1787,8 +1787,6 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
17871787

17881788
const areButtonsVisible = showScrollToBottom || primaryButtonText || secondaryButtonText || isStreaming
17891789

1790-
console.log("ChatView - render()")
1791-
17921790
return (
17931791
<div
17941792
data-testid="chat-view"

0 commit comments

Comments
 (0)