2026-07-03 22:10:24 +00:00
|
|
|
import type { CommandApi } from "@opencode-ai/client/effect/api"
|
2026-07-27 00:08:55 +00:00
|
|
|
import type { CommandInfo } from "@opencode-ai/client"
|
2026-07-03 22:10:24 +00:00
|
|
|
import type { Effect } from "effect"
|
2026-07-07 23:56:47 +00:00
|
|
|
import type { Transform } from "./registration.js"
|
2026-06-21 12:05:49 +00:00
|
|
|
|
|
|
|
|
export interface CommandDraft {
|
2026-07-08 02:10:11 +00:00
|
|
|
list(): readonly CommandInfo[]
|
|
|
|
|
get(name: string): CommandInfo | undefined
|
|
|
|
|
update(name: string, update: (command: CommandInfo) => void): void
|
2026-06-21 12:05:49 +00:00
|
|
|
remove(name: string): void
|
|
|
|
|
}
|
|
|
|
|
|
2026-07-07 23:56:47 +00:00
|
|
|
export interface CommandDomain extends CommandApi<unknown> {
|
|
|
|
|
readonly transform: Transform<CommandDraft>
|
2026-07-03 22:10:24 +00:00
|
|
|
readonly reload: () => Effect.Effect<void>
|
|
|
|
|
}
|