agent.ts 602 B

1234567891011121314151617
  1. import type { AgentApi } from "@opencode-ai/client/effect/api"
  2. import type { AgentV2Info } from "@opencode-ai/sdk/v2/types"
  3. import type { Effect } from "effect"
  4. import type { Transform } from "./registration.js"
  5. export interface AgentDraft {
  6. list(): readonly AgentV2Info[]
  7. get(id: string): AgentV2Info | undefined
  8. default(id: string | undefined): void
  9. update(id: string, update: (agent: AgentV2Info) => void): void
  10. remove(id: string): void
  11. }
  12. export interface AgentDomain extends AgentApi<unknown> {
  13. readonly transform: Transform<AgentDraft>
  14. readonly reload: () => Effect.Effect<void>
  15. }