chore: reorg files

This commit is contained in:
2026-10-10 15:00:15 +02:00
parent c853cca9cf
commit ced43fbb11
28 changed files with 35 additions and 32 deletions
+16
View File
@@ -0,0 +1,16 @@
import type { Plugin } from "@opencode/plugin";
import type { ModelInfo } from "@opencode/client";
export function modelKey(providerID: string, modelID: string) {
return `${providerID}\0${modelID}`;
}
export async function discover(context: Plugin.Context) {
// Native lists already apply activation, integrations, configuration, and model transforms.
const { data } = await context.model.list();
const models = new Map<string, ModelInfo>();
for (const model of data) {
if (model.enabled) models.set(modelKey(model.providerID, model.id), model);
}
return models;
}