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
10 changes: 9 additions & 1 deletion packages/vscode-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@
"title": "Toggle device appearance (light/dark mode)",
"category": "Radon IDE",
"enablement": "RNIDE.extensionIsActive && RNIDE.panelIsOpen"
},
},
{
"command": "RNIDE.removeLicense",
"title": "Remove license",
Expand Down Expand Up @@ -546,6 +546,13 @@
"default": true,
"scope": "window",
"description": "Enables the Radon AI functionality in the extension."
},
"RadonIDE.radonAI.enableChatParticipant": {
"type": "boolean",
"default": false,
"scope": "window",
"markdownDescription": "**[deprecated]** Enables `@radon` AI chat participant.",
"description": "[deprecated] Enables `@radon` AI chat participant."
}
}
}
Expand Down Expand Up @@ -1182,6 +1189,7 @@
},
"chatParticipants": [
{
"when": "RNIDE.chatParticipantEnabled",
"id": "chat.radon-ai",
"fullName": "Radon AI",
"name": "radon",
Expand Down
17 changes: 17 additions & 0 deletions packages/vscode-extension/src/ai/mcp/RadonMcpController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ function setGlobalEnableAI(isAIEnabled: boolean) {
commands.executeCommand("setContext", "RNIDE.AIEnabled", isAIEnabled);
}

function setGlobalEnableChat(isChatEnabled: boolean) {
commands.executeCommand("setContext", "RNIDE.chatParticipantEnabled", isChatEnabled);
}

/**
The `vscode.lm.registerTool` API with image support only available in VSCode version 1.105+.
Said API is not implemented on Cursor, Windsurf or Antigravity (it is a stub on these editors).
Expand Down Expand Up @@ -99,6 +103,12 @@ export function isAiEnabledInSettings() {
return workspace.getConfiguration("RadonIDE").get<boolean>("radonAI.enabledBoolean") ?? true;
}

export function isChatEnabledInSettings() {
return (
workspace.getConfiguration("RadonIDE").get<boolean>("radonAI.enableChatParticipant") ?? false
);
}

async function radonAIAvailabilityStatus() {
const token = await getLicenseToken();
if (!token) {
Expand Down Expand Up @@ -135,6 +145,10 @@ class RadonMcpController implements Disposable {
) {
this.radonAvailabilityStatus = options.radonAvailabilityStatus;

setGlobalEnableChat(isChatEnabledInSettings());

// Registering `@radon` chat regardless of `isChatEnabledInSettings`,
// as visibility of the chat participant is toggled within `package.json`.
registerRadonChat(context, options);

const useStaticRegistering = shouldUseDirectRegistering();
Expand Down Expand Up @@ -178,6 +192,9 @@ class RadonMcpController implements Disposable {
// `setGlobalEnableAI` sets availability of both static and local server tools.
setGlobalEnableAI(radonAiEnabled);

// `setGlobalEnableChat` sets availability of `@radon` chat participant
setGlobalEnableChat(isChatEnabledInSettings());

if (!shouldUseDirectRegistering()) {
if (radonAiEnabled) {
this.enableServer();
Expand Down
Loading