22 lines
931 B
TypeScript
22 lines
931 B
TypeScript
export * as ConfigAgent from "./agent"
|
|
|
|
import { Schema } from "effect"
|
|
import { Permission } from "@opencode-ai/schema/permission"
|
|
import { ConfigProvider } from "./provider"
|
|
import { ConfigModel } from "./model"
|
|
import { PositiveInt } from "../schema"
|
|
|
|
export const Color = Schema.String.check(Schema.isPattern(/^#[0-9a-fA-F]{6}$/))
|
|
|
|
export class Info extends Schema.Class<Info>("Config.Agent")({
|
|
model: ConfigModel.Selection.pipe(Schema.optional),
|
|
request: ConfigProvider.Request.pipe(Schema.optional),
|
|
system: Schema.String.pipe(Schema.optional),
|
|
description: Schema.String.pipe(Schema.optional),
|
|
mode: Schema.Literals(["subagent", "primary", "all"]).pipe(Schema.optional),
|
|
hidden: Schema.Boolean.pipe(Schema.optional),
|
|
color: Color.pipe(Schema.optional),
|
|
steps: PositiveInt.pipe(Schema.optional),
|
|
disabled: Schema.Boolean.pipe(Schema.optional),
|
|
permissions: Permission.Ruleset.pipe(Schema.optional),
|
|
}) {}
|