Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@
"check-types:benchmark": "cd benchmark && npm run check-types",
"package": "npm-run-all -p build:webview build:esbuild check-types lint",
"pretest": "npm run compile",
"dev": "cd webview-ui && npm run dev",
"dev": "cd webview-ui && npm run dev -- --port 5174",
"test": "npm-run-all -p test:*",
"test:extension": "jest",
"test:webview": "cd webview-ui && npm run test",
Expand Down
2 changes: 2 additions & 0 deletions src/api/providers/pearai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ export class PearAiHandler extends BaseProvider implements SingleCompletionHandl
}
})
throw new Error("PearAI API key not found. Please login to PearAI.")
} else {
vscode.commands.executeCommand("pearai.checkPearAITokens", undefined)
}

this.handler = new OpenRouterHandler({
Expand Down
2 changes: 1 addition & 1 deletion src/core/webview/ClineProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ export class ClineProvider extends EventEmitter<ClineProviderEvents> implements
}

private async getHMRHtmlContent(webview: vscode.Webview): Promise<string> {
const localPort = "5173"
const localPort = "5174"
const localServerUrl = `localhost:${localPort}`

// Check if local dev server is running.
Expand Down
22 changes: 22 additions & 0 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,28 @@ export function activate(context: vscode.ExtensionContext) {
}),
)

context.subscriptions.push(
vscode.commands.registerCommand("pearai-roo-cline.updatePearAITokens", async (data) => {
console.dir("Updated PearAI tokens:")
console.dir(data)
context.secrets.store("pearaiApiKey", data.accessToken)
context.secrets.store("pearaiRefreshKey", data.refreshToken)
const provider = await ClineProvider.getInstance()
if (provider) {
// Update the API configuration to clear the PearAI key
await provider.setValues({
pearaiApiKey: data.accessToken,
})
await provider.postStateToWebview()
// Update MCP server with new token
const mcpHub = provider.getMcpHub()
if (mcpHub) {
await mcpHub.updatePearAiApiKey(data.accessToken)
}
}
}),
)

context.subscriptions.push(
vscode.commands.registerCommand("pearai-roo-cline.pearaiLogout", async () => {
console.dir("Logged out of PearAI:")
Expand Down
2 changes: 1 addition & 1 deletion src/services/mcp/McpHub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1043,7 +1043,7 @@ export class McpHub {

await fs.writeFile(settingsPath, JSON.stringify(config, null, 2))
await this.updateServerConnections(config.mcpServers)
vscode.window.showInformationMessage("PearAI API key updated successfully")
// vscode.window.showInformationMessage("PearAI API key updated successfully")
}
} catch (error) {
console.error("Failed to update PearAI API key:", error)
Expand Down
Loading