Something went wrong. Try again.
opencode v2 mirror
Something went wrong. Try again.
12345678910111213141516171819202122232425262728import type { CommandApi } from "@opencode/client/effect/api"import type { PromptInput } from "@opencode/schema/prompt-input"import type { Session } from "@opencode/schema/session"import type { SessionInbox } from "@opencode/schema/session-inbox"import type { Effect } from "effect"import type { Transform } from "./registration.js"
export interface CommandInvocation { readonly sessionID: Session.ID readonly prompt: PromptInput.Prompt readonly delivery: SessionInbox.Delivery}
export interface CommandDefinition { readonly name: string readonly description?: string readonly execute: (input: CommandInvocation) => Effect.Effect<void, unknown>}
export interface CommandEditor { add(definition: CommandDefinition): void}
export interface CommandDomain extends Pick<CommandApi<unknown>, "list"> { readonly transform: Transform<CommandEditor> readonly reload: () => Effect.Effect<void>}