import { makeDefaultApi } from "@opencode-ai/protocol/api" import { InvalidRequestError, SessionNotFoundError } from "@opencode-ai/protocol/errors" import { HttpApiMiddleware } from "effect/unstable/httpapi" class LocationMiddleware extends HttpApiMiddleware.Service()( "@opencode-ai/client/LocationMiddleware", ) {} class SessionLocationMiddleware extends HttpApiMiddleware.Service()( "@opencode-ai/client/SessionLocationMiddleware", { error: [InvalidRequestError, SessionNotFoundError] }, ) {} const Api = makeDefaultApi({ locationMiddleware: LocationMiddleware, sessionLocationMiddleware: SessionLocationMiddleware, }) export const SessionGroup = Api.groups["server.session"]