2026-05-30 04:06:08 +00:00
|
|
|
export * as ConfigAgent from "./agent"
|
|
|
|
|
|
|
|
|
|
import { Schema } from "effect"
|
2026-06-04 03:02:17 +00:00
|
|
|
import { PermissionSchema } from "../permission/schema"
|
2026-05-30 04:06:08 +00:00
|
|
|
import { ConfigProvider } from "./provider"
|
|
|
|
|
import { PositiveInt } from "../schema"
|
|
|
|
|
|
|
|
|
|
export const Color = Schema.Union([
|
|
|
|
|
Schema.String.check(Schema.isPattern(/^#[0-9a-fA-F]{6}$/)),
|
|
|
|
|
Schema.Literals(["primary", "secondary", "accent", "success", "warning", "error", "info"]),
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
export class Info extends Schema.Class<Info>("ConfigV2.Agent")({
|
|
|
|
|
model: Schema.String.pipe(Schema.optional),
|
|
|
|
|
variant: Schema.String.pipe(Schema.optional),
|
2026-06-03 17:32:58 +00:00
|
|
|
request: ConfigProvider.Request.pipe(Schema.optional),
|
2026-05-30 04:06:08 +00:00
|
|
|
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),
|
2026-06-04 03:02:17 +00:00
|
|
|
permissions: PermissionSchema.Ruleset.pipe(Schema.optional),
|
2026-05-30 04:06:08 +00:00
|
|
|
}) {}
|