@@ -2,7 +2,7 @@ import * as vscode from "vscode";
22import { Uri , commands , workspace } from "vscode" ;
33import { LanguageClientOptions } from "vscode-languageclient" ;
44import { LanguageClient } from "vscode-languageclient/browser" ;
5- import { registerChatParticipant } from "./chatParticipant " ;
5+ import { ChatPanel } from "./chatPanel " ;
66import { DiagramEditorProvider } from "./diagramEditorProvider" ;
77import { LibraryTreeProvider } from "./libraryTreeProvider" ;
88import { registerLLMProvider } from "./llmProvider" ;
@@ -146,10 +146,25 @@ export async function activate(context: vscode.ExtensionContext) {
146146 await client . start ( ) ;
147147 console . log ( "ModelScript language server is ready" ) ;
148148
149- // Register AI integration components
150- registerLLMProvider ( context ) ;
151- registerChatParticipant ( context ) ;
152- registerMCPTools ( context , client ) ;
149+ // Register AI integration components (proposed APIs — may not be available in web builds)
150+ try {
151+ registerLLMProvider ( context ) ;
152+ } catch {
153+ /* proposed API not available */
154+ }
155+ // Note: registerChatParticipant requires a chatParticipants manifest entry — use the custom ChatPanel instead
156+ try {
157+ registerMCPTools ( context , client ) ;
158+ } catch {
159+ /* proposed API not available */
160+ }
161+
162+ // Custom chat panel (works without VS Code Chat API / Copilot)
163+ context . subscriptions . push (
164+ vscode . commands . registerCommand ( "modelscript.openChat" , ( ) => {
165+ if ( client ) ChatPanel . createOrShow ( context . extensionUri , client ) ;
166+ } ) ,
167+ ) ;
153168
154169 // Output channel for script execution
155170 const outputChannel = vscode . window . createOutputChannel ( "ModelScript Output" ) ;
0 commit comments