refactor: drop mode from frontend types; react to settings changes
This commit is contained in:
+14
-10
@@ -49,17 +49,21 @@ const plugin: JupyterFrontEndPlugin<void> = {
|
||||
|
||||
// Load settings + push into the actions module.
|
||||
if (settingRegistry) {
|
||||
void settingRegistry
|
||||
.load(plugin.id)
|
||||
.then(settings => {
|
||||
const bridge = readOpenCodeSettings(settings.composite);
|
||||
setOpenCodeRuntime({
|
||||
settings: bridge,
|
||||
serverSettings: app.serviceManager.serverSettings
|
||||
});
|
||||
console.log('opencode_bridge settings loaded:', bridge);
|
||||
void settingRegistry
|
||||
.load(plugin.id)
|
||||
.then(settings => {
|
||||
const apply = () => {
|
||||
const bridge = readOpenCodeSettings(settings.composite);
|
||||
setOpenCodeRuntime({
|
||||
settings: bridge,
|
||||
serverSettings: app.serviceManager.serverSettings
|
||||
});
|
||||
console.log('opencode_bridge settings applied:', bridge);
|
||||
};
|
||||
apply();
|
||||
settings.changed.connect(apply);
|
||||
|
||||
void callOpenCodeProviders(app.serviceManager.serverSettings)
|
||||
void callOpenCodeProviders(app.serviceManager.serverSettings)
|
||||
.then(data => {
|
||||
const lines: string[] = [
|
||||
'[opencode_bridge] Available OpenCode providers:'
|
||||
|
||||
Reference in New Issue
Block a user