mirror of
https://github.com/anomalyco/opencode.git
synced 2026-08-04 16:39:51 +00:00
refactor(core): clarify session events
This commit is contained in:
parent
95ad8ffe59
commit
90f741f9bf
1 changed files with 11 additions and 6 deletions
|
|
@ -1,20 +1,25 @@
|
|||
export * as PluginHooks from "./hooks"
|
||||
|
||||
import type { AISDKHooks } from "@opencode-ai/plugin/effect/aisdk"
|
||||
import type { SessionHooks, SessionHttpContext } from "@opencode-ai/plugin/effect/session"
|
||||
import type { SessionContext, SessionHttpContext } from "@opencode-ai/plugin/effect/session"
|
||||
import type { ShellHooks } from "@opencode-ai/plugin/effect/shell"
|
||||
import type { ToolHooks } from "@opencode-ai/plugin/effect/tool"
|
||||
import { Context, Effect, Layer, Scope } from "effect"
|
||||
import { makeLocationNode } from "@opencode-ai/util/effect/app-node"
|
||||
import { State } from "../state"
|
||||
|
||||
interface SessionHttpEvent extends SessionHttpContext {
|
||||
request: (input: Request) => Effect.Effect<Response, Error>
|
||||
}
|
||||
|
||||
interface SessionEvents {
|
||||
readonly context: SessionContext
|
||||
readonly http: SessionHttpEvent
|
||||
}
|
||||
|
||||
export interface Domains {
|
||||
readonly aisdk: AISDKHooks
|
||||
readonly session: SessionHooks & {
|
||||
readonly http: SessionHttpContext & {
|
||||
request: (input: Request) => Effect.Effect<Response, Error>
|
||||
}
|
||||
}
|
||||
readonly session: SessionEvents
|
||||
readonly shell: ShellHooks
|
||||
readonly tool: ToolHooks
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue