chore: reorg files
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user