feat(run): migrate non-interactive prompts to V2 feat(run): route mini prompts through V2 fix(run): use current session contracts fix(run): fix V2 prompt turns feat(cli): add mini subcommand feat(run): use settled execution events fix(run): handle remote prompt file attachments feat(run): send prompt files as attachments feat(run): use current APIs for run state fix(run): adopt app-node runtime deps feat(run): track subagent sessions feat(run): move catalogs and default model onto current APIs
25 lines
749 B
TypeScript
25 lines
749 B
TypeScript
import { Catalog } from "@opencode-ai/core/catalog"
|
|
import { Effect } from "effect"
|
|
import { HttpApiBuilder } from "effect/unstable/httpapi"
|
|
import { Api } from "../api"
|
|
import { response } from "../location"
|
|
|
|
export const ModelHandler = HttpApiBuilder.group(Api, "server.model", (handlers) =>
|
|
Effect.gen(function* () {
|
|
return handlers
|
|
.handle(
|
|
"model.list",
|
|
Effect.fn(function* () {
|
|
const catalog = yield* Catalog.Service
|
|
return yield* response(catalog.model.available())
|
|
}),
|
|
)
|
|
.handle(
|
|
"model.default",
|
|
Effect.fn(function* () {
|
|
const catalog = yield* Catalog.Service
|
|
return yield* response(catalog.model.default())
|
|
}),
|
|
)
|
|
}),
|
|
)
|