feat: dual select (provider + model) with default[provider] model default

The inline prompt now renders two <select> boxes:
  - Provider: lists every provider from the cached /config/providers
    response. Default = first provider.
  - Model: lists that provider's model keys (Object.keys of the Record).
    Default = default[providerID] (from the same response) when that
    modelID is present in the provider's models; otherwise the first
    model. Changing the provider select rebuilds the model select with
    the new provider's models and its own default[provider].

On submit the two select values are read separately and passed as
providerId / modelId to the OpenCodeRequest (no more '|' delimiter).
The /opencode-bridge/edit body shape is unchanged (providerId, modelId).

Also fix the index.ts startup console log (p.models is a Record, use
Object.values), and drop the unused _cell field on the prompt widget
(now an unused param).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
tao.chen
2026-07-23 18:13:14 +08:00
co-authored by Claude Fable 5
parent e7579d3779
commit 04f90ab5a0
4 changed files with 261 additions and 72 deletions
+1 -1
View File
@@ -62,7 +62,7 @@ const plugin: JupyterFrontEndPlugin<void> = {
'[opencode_bridge] Available OpenCode providers:'
];
for (const p of data.providers) {
const models = p.models.map(m => m.id).join(', ');
const models = Object.values(p.models).map(m => m.id).join(', ');
lines.push(` - ${p.id}: ${models || '(no models)'}`);
}
// eslint-disable-next-line no-console