Something went wrong. Try again.
opencode v2 mirror
Something went wrong. Try again.
TypeScript
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564// Generated by @opencode/httpapi-codegen. Do not edit.import { Effect, Stream, Schema } from "effect"import { Sse } from "effect/unstable/encoding"import { HttpClientError } from "effect/unstable/http"import { HttpApiClient } from "effect/unstable/httpapi"import { ClientApi } from "../../contract"import type { ServerInfoOutput, LocationGetInput, LocationGetOutput, LocationReloadOutput, AgentListInput, AgentListOutput, AgentGetInput, AgentGetOutput, PluginListInput, PluginListOutput, PluginCheckInput, PluginCheckOutput, PluginUpdateInput, PluginUpdateOutput, SessionListInput, SessionListOutput, SessionStatsInput, SessionStatsOutput, SessionCreateInput, SessionCreateOutput, SessionImportInput, SessionImportOutput, SessionExportInput, SessionExportOutput, SessionActiveOutput, SessionGetInput, SessionGetOutput, SessionRemoveInput, SessionRemoveOutput, SessionForkInput, SessionForkOutput, SessionSwitchAgentInput, SessionSwitchAgentOutput, SessionSwitchModelInput, SessionSwitchModelOutput, SessionUpdateInput, SessionUpdateOutput, SessionMoveInput, SessionMoveOutput, SessionPromptInput, SessionPromptOutput, SessionCommandInput, SessionCommandOutput, SessionSkillInput, SessionSkillOutput, SessionSyntheticInput, SessionSyntheticOutput, SessionShellInput, SessionShellOutput, SessionCompactInput, SessionCompactOutput, SessionWaitInput, SessionWaitOutput, SessionRevertStageInput, SessionRevertStageOutput, SessionRevertClearInput, SessionRevertClearOutput, SessionRevertCommitInput, SessionRevertCommitOutput, SessionContextInput, SessionContextOutput, SessionDiffInput, SessionDiffOutput, SessionInboxListInput, SessionInboxListOutput, SessionInboxCancelInput, SessionInboxCancelOutput, SessionInboxUpdateInput, SessionInboxUpdateOutput, SessionInstructionsEntryListInput, SessionInstructionsEntryListOutput, SessionInstructionsEntryPutInput, SessionInstructionsEntryPutOutput, SessionInstructionsEntryRemoveInput, SessionInstructionsEntryRemoveOutput, SessionGenerateInput, SessionGenerateOutput, SessionLogInput, SessionLogOutput, SessionInterruptInput, SessionInterruptOutput, SessionBackgroundInput, SessionBackgroundOutput, SessionMessageGetInput, SessionMessageGetOutput, SessionFormListInput, SessionFormListOutput, SessionFormCreateInput, SessionFormCreateOutput, SessionFormGetInput, SessionFormGetOutput, SessionFormReplyInput, SessionFormReplyOutput, SessionFormCancelInput, SessionFormCancelOutput, SessionEnvironmentInput, SessionEnvironmentOutput, SessionViewInput, SessionViewOutput, MessageListInput, MessageListOutput, ModelListInput, ModelListOutput, ModelDefaultInput, ModelDefaultOutput, GenerateTextInput, GenerateTextOutput, ProviderListInput, ProviderListOutput, ProviderGetInput, ProviderGetOutput, IntegrationListInput, IntegrationListOutput, IntegrationGetInput, IntegrationGetOutput, IntegrationWellknownAddInput, IntegrationWellknownAddOutput, IntegrationConnectKeyInput, IntegrationConnectKeyOutput, IntegrationOauthConnectInput, IntegrationOauthConnectOutput, IntegrationOauthStatusInput, IntegrationOauthStatusOutput, IntegrationOauthCompleteInput, IntegrationOauthCompleteOutput, IntegrationOauthCancelInput, IntegrationOauthCancelOutput, IntegrationCommandConnectInput, IntegrationCommandConnectOutput, IntegrationCommandStatusInput, IntegrationCommandStatusOutput, IntegrationCommandCancelInput, IntegrationCommandCancelOutput, McpListInput, McpListOutput, McpAddInput, McpAddOutput, McpRemoveInput, McpRemoveOutput, McpConnectInput, McpConnectOutput, McpDisconnectInput, McpDisconnectOutput, McpResourceCatalogInput, McpResourceCatalogOutput, CredentialUpdateInput, CredentialUpdateOutput, CredentialActivateInput, CredentialActivateOutput, CredentialRemoveInput, CredentialRemoveOutput, ProjectListOutput, ProjectUpdateInput, ProjectUpdateOutput, FormListInput, FormListOutput, PermissionRequestListInput, PermissionRequestListOutput, PermissionSavedListInput, PermissionSavedListOutput, PermissionSavedRemoveInput, PermissionSavedRemoveOutput, PermissionCreateInput, PermissionCreateOutput, PermissionListInput, PermissionListOutput, PermissionGetInput, PermissionGetOutput, PermissionReplyInput, PermissionReplyOutput, FileListInput, FileListOutput, FileFindInput, FileFindOutput, CommandListInput, CommandListOutput, SkillListInput, SkillListOutput, RpcCallInput, RpcCallOutput, EventSubscribeOutput, PtyListInput, PtyListOutput, PtyCreateInput, PtyCreateOutput, PtyGetInput, PtyGetOutput, PtyUpdateInput, PtyUpdateOutput, PtyRemoveInput, PtyRemoveOutput, PtyConnectTokenInput, PtyConnectTokenOutput, ExperimentalPersistentPtyReadInput, ExperimentalPersistentPtyReadOutput, ExperimentalPersistentPtyListInput, ExperimentalPersistentPtyListOutput, ExperimentalPersistentPtyCreateInput, ExperimentalPersistentPtyCreateOutput, ExperimentalPersistentPtyShutdownOutput, ExperimentalPersistentPtyHandoffOutput, ExperimentalPersistentPtyGetInput, ExperimentalPersistentPtyGetOutput, ExperimentalPersistentPtyUpdateInput, ExperimentalPersistentPtyUpdateOutput, ExperimentalPersistentPtySnapshotInput, ExperimentalPersistentPtySnapshotOutput, ExperimentalPersistentPtyRemoveInput, ExperimentalPersistentPtyRemoveOutput, ExperimentalPersistentPtyConnectTokenInput, ExperimentalPersistentPtyConnectTokenOutput, ShellListInput, ShellListOutput, ShellCreateInput, ShellCreateOutput, ShellGetInput, ShellGetOutput, ShellOutputInput, ShellOutputOutput, ShellRemoveInput, ShellRemoveOutput, ReferenceListInput, ReferenceListOutput, WorktreeListInput, WorktreeListOutput, WorktreeCreateInput, WorktreeCreateOutput, WorktreeRemoveInput, WorktreeRemoveOutput, WorktreeRefreshInput, WorktreeRefreshOutput, VcsGetInput, VcsGetOutput, VcsBaseInput, VcsBaseOutput, VcsStatusInput, VcsStatusOutput, VcsBranchListInput, VcsBranchListOutput, VcsDiffInput, VcsDiffOutput, DebugLocationListOutput, DebugLocationEvictInput, DebugLocationEvictOutput, MigrationV1StatusOutput, WebsearchProvidersInput, WebsearchProvidersOutput, WebsearchQueryInput, WebsearchQueryOutput, ConfigGetInput, ConfigGetOutput, ConfigShellsOutput, ConfigUpdateInput, ConfigUpdateOutput,} from "../api/api.js"import { ClientError } from "./client-error.js"
type RawClient = HttpApiClient.ForApi<typeof ClientApi>
const mapClientError = <E>(error: E) => HttpClientError.isHttpClientError(error) || Schema.isSchemaError(error) || Sse.Retry.is(error) ? new ClientError({ cause: error }) : error
const preserveEffect = <A>() => <E, R>(effect: Effect.Effect<A, E, R>) => effectconst preserveStream = <A>() => <E, R>(stream: Stream.Stream<A, E, R>) => stream
const EndpointServerInfo = (raw: RawClient["server.server"]) => () => preserveEffect<ServerInfoOutput>()(raw["server.info"]({}).pipe(Effect.mapError(mapClientError)))
const adaptGroupServer = (raw: RawClient["server.server"]) => ({ info: EndpointServerInfo(raw) })
const EndpointLocationGet = (raw: RawClient["server.location"]) => (input?: LocationGetInput) => preserveEffect<LocationGetOutput>()( raw["location.get"]({ query: { location: input?.["location"] } }).pipe(Effect.mapError(mapClientError)), )
const EndpointLocationReload = (raw: RawClient["server.location"]) => () => preserveEffect<LocationReloadOutput>()(raw["location.reload"]({}).pipe(Effect.mapError(mapClientError)))
const adaptGroupLocation = (raw: RawClient["server.location"]) => ({ get: EndpointLocationGet(raw), reload: EndpointLocationReload(raw),})
const EndpointAgentList = (raw: RawClient["server.agent"]) => (input?: AgentListInput) => preserveEffect<AgentListOutput>()( raw["agent.list"]({ query: { location: input?.["location"] } }).pipe(Effect.mapError(mapClientError)), )
const EndpointAgentGet = (raw: RawClient["server.agent"]) => (input: AgentGetInput) => preserveEffect<AgentGetOutput>()( raw["agent.get"]({ params: { agentID: input["agentID"] }, query: { location: input["location"] } }).pipe( Effect.mapError(mapClientError), ), )
const adaptGroupAgent = (raw: RawClient["server.agent"]) => ({ list: EndpointAgentList(raw), get: EndpointAgentGet(raw),})
const EndpointPluginList = (raw: RawClient["server.plugin"]) => (input?: PluginListInput) => preserveEffect<PluginListOutput>()( raw["plugin.list"]({ query: { location: input?.["location"] } }).pipe(Effect.mapError(mapClientError)), )
const EndpointPluginCheck = (raw: RawClient["server.plugin"]) => (input?: PluginCheckInput) => preserveEffect<PluginCheckOutput>()( raw["plugin.check"]({ query: { location: input?.["location"] }, payload: { target: input?.["target"] } }).pipe( Effect.mapError(mapClientError), ), )
const EndpointPluginUpdate = (raw: RawClient["server.plugin"]) => (input: PluginUpdateInput) => preserveEffect<PluginUpdateOutput>()( raw["plugin.update"]({ query: { location: input["location"] }, payload: { targets: input["targets"] } }).pipe( Effect.mapError(mapClientError), ), )
const adaptGroupPlugin = (raw: RawClient["server.plugin"]) => ({ list: EndpointPluginList(raw), check: EndpointPluginCheck(raw), update: EndpointPluginUpdate(raw),})
const EndpointSessionList = (raw: RawClient["server.session"]) => (input?: SessionListInput) => preserveEffect<SessionListOutput>()( raw["session.list"]({ query: { limit: input?.["limit"], order: input?.["order"], search: input?.["search"], parentID: input?.["parentID"], directory: input?.["directory"], project: input?.["project"], subpath: input?.["subpath"], cursor: input?.["cursor"], }, }).pipe(Effect.mapError(mapClientError)), )
const EndpointSessionStats = (raw: RawClient["server.session"]) => (input?: SessionStatsInput) => preserveEffect<SessionStatsOutput>()( raw["session.stats"]({ query: { from: input?.["from"], to: input?.["to"], project: input?.["project"], timezone: input?.["timezone"], tools: input?.["tools"], }, }).pipe( Effect.mapError(mapClientError), Effect.map((value) => value.data), ), )
const EndpointSessionCreate = (raw: RawClient["server.session"]) => (input?: SessionCreateInput) => preserveEffect<SessionCreateOutput>()( raw["session.create"]({ payload: { id: input?.["id"], title: input?.["title"], agent: input?.["agent"], model: input?.["model"], location: input?.["location"], metadata: input?.["metadata"], permissions: input?.["permissions"], }, }).pipe( Effect.mapError(mapClientError), Effect.map((value) => value.data), ), )
const EndpointSessionImport = (raw: RawClient["server.session"]) => (input: SessionImportInput) => preserveEffect<SessionImportOutput>()( raw["session.import"]({ payload: { info: input["info"], messages: input["messages"], location: input["location"] }, }).pipe( Effect.mapError(mapClientError), Effect.map((value) => value.data), ), )
const EndpointSessionExport = (raw: RawClient["server.session"]) => (input: SessionExportInput) => preserveEffect<SessionExportOutput>()( raw["session.export"]({ params: { sessionID: input["sessionID"] }, query: { sanitize: input["sanitize"] } }).pipe( Effect.mapError(mapClientError), Effect.map((value) => value.data), ), )
const EndpointSessionActive = (raw: RawClient["server.session"]) => () => preserveEffect<SessionActiveOutput>()( raw["session.active"]({}).pipe( Effect.mapError(mapClientError), Effect.map((value) => value.data), ), )
const EndpointSessionGet = (raw: RawClient["server.session"]) => (input: SessionGetInput) => preserveEffect<SessionGetOutput>()( raw["session.get"]({ params: { sessionID: input["sessionID"] } }).pipe( Effect.mapError(mapClientError), Effect.map((value) => value.data), ), )
const EndpointSessionRemove = (raw: RawClient["server.session"]) => (input: SessionRemoveInput) => preserveEffect<SessionRemoveOutput>()( raw["session.remove"]({ params: { sessionID: input["sessionID"] } }).pipe(Effect.mapError(mapClientError)), )
const EndpointSessionFork = (raw: RawClient["server.session"]) => (input: SessionForkInput) => preserveEffect<SessionForkOutput>()( raw["session.fork"]({ params: { sessionID: input["sessionID"] }, payload: { before: input["before"] } }).pipe( Effect.mapError(mapClientError), Effect.map((value) => value.data), ), )
const EndpointSessionSwitchAgent = (raw: RawClient["server.session"]) => (input: SessionSwitchAgentInput) => preserveEffect<SessionSwitchAgentOutput>()( raw["session.switchAgent"]({ params: { sessionID: input["sessionID"] }, payload: { agent: input["agent"] } }).pipe( Effect.mapError(mapClientError), ), )
const EndpointSessionSwitchModel = (raw: RawClient["server.session"]) => (input: SessionSwitchModelInput) => preserveEffect<SessionSwitchModelOutput>()( raw["session.switchModel"]({ params: { sessionID: input["sessionID"] }, payload: { model: input["model"] } }).pipe( Effect.mapError(mapClientError), ), )
const EndpointSessionUpdate = (raw: RawClient["server.session"]) => (input: SessionUpdateInput) => preserveEffect<SessionUpdateOutput>()( raw["session.update"]({ params: { sessionID: input["sessionID"] }, payload: { title: input["title"], permissions: input["permissions"] }, }).pipe(Effect.mapError(mapClientError)), )
const EndpointSessionMove = (raw: RawClient["server.session"]) => (input: SessionMoveInput) => preserveEffect<SessionMoveOutput>()( raw["session.move"]({ params: { sessionID: input["sessionID"] }, payload: { directory: input["directory"], delivery: input["delivery"] }, }).pipe(Effect.mapError(mapClientError)), )
const EndpointSessionPrompt = (raw: RawClient["server.session"]) => (input: SessionPromptInput) => preserveEffect<SessionPromptOutput>()( raw["session.prompt"]({ params: { sessionID: input["sessionID"] }, payload: { id: input["id"], text: input["text"], files: input["files"], agents: input["agents"], skills: input["skills"], metadata: input["metadata"], delivery: input["delivery"], resume: input["resume"], }, }).pipe( Effect.mapError(mapClientError), Effect.map((value) => value.data), ), )
const EndpointSessionCommand = (raw: RawClient["server.session"]) => (input: SessionCommandInput) => preserveEffect<SessionCommandOutput>()( raw["session.command"]({ params: { sessionID: input["sessionID"] }, payload: { name: input["name"], text: input["text"], files: input["files"], agents: input["agents"], skills: input["skills"], delivery: input["delivery"], }, }).pipe(Effect.mapError(mapClientError)), )
const EndpointSessionSkill = (raw: RawClient["server.session"]) => (input: SessionSkillInput) => preserveEffect<SessionSkillOutput>()( raw["session.skill"]({ params: { sessionID: input["sessionID"] }, payload: { id: input["id"], resume: input["resume"] }, }).pipe(Effect.mapError(mapClientError)), )
const EndpointSessionSynthetic = (raw: RawClient["server.session"]) => (input: SessionSyntheticInput) => preserveEffect<SessionSyntheticOutput>()( raw["session.synthetic"]({ params: { sessionID: input["sessionID"] }, payload: { id: input["id"], text: input["text"], description: input["description"], metadata: input["metadata"], delivery: input["delivery"], resume: input["resume"], }, }).pipe( Effect.mapError(mapClientError), Effect.map((value) => value.data), ), )
const EndpointSessionShell = (raw: RawClient["server.session"]) => (input: SessionShellInput) => preserveEffect<SessionShellOutput>()( raw["session.shell"]({ params: { sessionID: input["sessionID"] }, payload: { id: input["id"], command: input["command"] }, }).pipe(Effect.mapError(mapClientError)), )
const EndpointSessionCompact = (raw: RawClient["server.session"]) => (input: SessionCompactInput) => preserveEffect<SessionCompactOutput>()( raw["session.compact"]({ params: { sessionID: input["sessionID"] }, payload: { id: input["id"], delivery: input["delivery"] }, }).pipe( Effect.mapError(mapClientError), Effect.map((value) => value.data), ), )
const EndpointSessionWait = (raw: RawClient["server.session"]) => (input: SessionWaitInput) => preserveEffect<SessionWaitOutput>()( raw["session.wait"]({ params: { sessionID: input["sessionID"] } }).pipe(Effect.mapError(mapClientError)), )
const EndpointSessionRevertStage = (raw: RawClient["server.session"]) => (input: SessionRevertStageInput) => preserveEffect<SessionRevertStageOutput>()( raw["session.revert.stage"]({ params: { sessionID: input["sessionID"] }, payload: { messageID: input["messageID"], files: input["files"] }, }).pipe( Effect.mapError(mapClientError), Effect.map((value) => value.data), ), )
const EndpointSessionRevertClear = (raw: RawClient["server.session"]) => (input: SessionRevertClearInput) => preserveEffect<SessionRevertClearOutput>()( raw["session.revert.clear"]({ params: { sessionID: input["sessionID"] } }).pipe(Effect.mapError(mapClientError)), )
const EndpointSessionRevertCommit = (raw: RawClient["server.session"]) => (input: SessionRevertCommitInput) => preserveEffect<SessionRevertCommitOutput>()( raw["session.revert.commit"]({ params: { sessionID: input["sessionID"] } }).pipe(Effect.mapError(mapClientError)), )
const EndpointSessionContext = (raw: RawClient["server.session"]) => (input: SessionContextInput) => preserveEffect<SessionContextOutput>()( raw["session.context"]({ params: { sessionID: input["sessionID"] } }).pipe( Effect.mapError(mapClientError), Effect.map((value) => value.data), ), )
const EndpointSessionDiff = (raw: RawClient["server.session"]) => (input: SessionDiffInput) => preserveEffect<SessionDiffOutput>()( raw["session.diff"]({ params: { sessionID: input["sessionID"] }, query: { from: input["from"], to: input["to"], context: input["context"] }, }).pipe( Effect.mapError(mapClientError), Effect.map((value) => value.data), ), )
const EndpointSessionInboxList = (raw: RawClient["server.session"]) => (input: SessionInboxListInput) => preserveEffect<SessionInboxListOutput>()( raw["session.inbox.list"]({ params: { sessionID: input["sessionID"] } }).pipe( Effect.mapError(mapClientError), Effect.map((value) => value.data), ), )
const EndpointSessionInboxCancel = (raw: RawClient["server.session"]) => (input: SessionInboxCancelInput) => preserveEffect<SessionInboxCancelOutput>()( raw["session.inbox.cancel"]({ params: { sessionID: input["sessionID"], inboxID: input["inboxID"] } }).pipe( Effect.mapError(mapClientError), ), )
const EndpointSessionInboxUpdate = (raw: RawClient["server.session"]) => (input: SessionInboxUpdateInput) => preserveEffect<SessionInboxUpdateOutput>()( raw["session.inbox.update"]({ params: { sessionID: input["sessionID"], inboxID: input["inboxID"] }, payload: { delivery: input["delivery"] }, }).pipe(Effect.mapError(mapClientError)), )
const EndpointSessionInstructionsEntryList = (raw: RawClient["server.session"]) => (input: SessionInstructionsEntryListInput) => preserveEffect<SessionInstructionsEntryListOutput>()( raw["session.instructions.entry.list"]({ params: { sessionID: input["sessionID"] } }).pipe( Effect.mapError(mapClientError), Effect.map((value) => value.data), ), )
const EndpointSessionInstructionsEntryPut = (raw: RawClient["server.session"]) => (input: SessionInstructionsEntryPutInput) => preserveEffect<SessionInstructionsEntryPutOutput>()( raw["session.instructions.entry.put"]({ params: { sessionID: input["sessionID"], key: input["key"] }, payload: { value: input["value"] }, }).pipe(Effect.mapError(mapClientError)), )
const EndpointSessionInstructionsEntryRemove = (raw: RawClient["server.session"]) => (input: SessionInstructionsEntryRemoveInput) => preserveEffect<SessionInstructionsEntryRemoveOutput>()( raw["session.instructions.entry.remove"]({ params: { sessionID: input["sessionID"], key: input["key"] } }).pipe( Effect.mapError(mapClientError), ), )
const EndpointSessionGenerate = (raw: RawClient["server.session"]) => (input: SessionGenerateInput) => preserveEffect<SessionGenerateOutput>()( raw["session.generate"]({ params: { sessionID: input["sessionID"] }, payload: { prompt: input["prompt"] } }).pipe( Effect.mapError(mapClientError), Effect.map((value) => value.data), ), )
const EndpointSessionLog = (raw: RawClient["server.session"]) => (input: SessionLogInput) => preserveStream<SessionLogOutput>()( Stream.unwrap( raw["session.log"]({ params: { sessionID: input["sessionID"] }, query: { after: input["after"], follow: input["follow"] }, }).pipe( Effect.mapError(mapClientError), Effect.map((stream) => stream.pipe(Stream.mapError(mapClientError))), ), ), )
const EndpointSessionInterrupt = (raw: RawClient["server.session"]) => (input: SessionInterruptInput) => preserveEffect<SessionInterruptOutput>()( raw["session.interrupt"]({ params: { sessionID: input["sessionID"] }, query: { resume: input["resume"] } }).pipe( Effect.mapError(mapClientError), ), )
const EndpointSessionBackground = (raw: RawClient["server.session"]) => (input: SessionBackgroundInput) => preserveEffect<SessionBackgroundOutput>()( raw["session.background"]({ params: { sessionID: input["sessionID"] } }).pipe(Effect.mapError(mapClientError)), )
const EndpointSessionMessageGet = (raw: RawClient["server.session"]) => (input: SessionMessageGetInput) => preserveEffect<SessionMessageGetOutput>()( raw["session.message"]({ params: { sessionID: input["sessionID"], messageID: input["messageID"] } }).pipe( Effect.mapError(mapClientError), Effect.map((value) => value.data), ), )
const EndpointSessionFormList = (raw: RawClient["server.session"]) => (input: SessionFormListInput) => preserveEffect<SessionFormListOutput>()( raw["session.form.list"]({ params: { sessionID: input["sessionID"] } }).pipe( Effect.mapError(mapClientError), Effect.map((value) => value.data), ), )
const EndpointSessionFormCreate = (raw: RawClient["server.session"]) => (input: SessionFormCreateInput) => preserveEffect<SessionFormCreateOutput>()( raw["session.form.create"]({ params: { sessionID: input["sessionID"] }, payload: { id: input["id"], title: input["title"], metadata: input["metadata"], fields: input["fields"] }, }).pipe( Effect.mapError(mapClientError), Effect.map((value) => value.data), ), )
const EndpointSessionFormGet = (raw: RawClient["server.session"]) => (input: SessionFormGetInput) => preserveEffect<SessionFormGetOutput>()( raw["session.form.get"]({ params: { sessionID: input["sessionID"], formID: input["formID"] } }).pipe( Effect.mapError(mapClientError), Effect.map((value) => value.data), ), )
const EndpointSessionFormReply = (raw: RawClient["server.session"]) => (input: SessionFormReplyInput) => preserveEffect<SessionFormReplyOutput>()( raw["session.form.reply"]({ params: { sessionID: input["sessionID"], formID: input["formID"] }, payload: { answer: input["answer"] }, }).pipe(Effect.mapError(mapClientError)), )
const EndpointSessionFormCancel = (raw: RawClient["server.session"]) => (input: SessionFormCancelInput) => preserveEffect<SessionFormCancelOutput>()( raw["session.form.cancel"]({ params: { sessionID: input["sessionID"], formID: input["formID"] } }).pipe( Effect.mapError(mapClientError), ), )
const EndpointSessionEnvironment = (raw: RawClient["server.session"]) => (input: SessionEnvironmentInput) => preserveEffect<SessionEnvironmentOutput>()( raw["session.environment"]({ params: { sessionID: input["sessionID"] }, payload: { variables: input["variables"] }, }).pipe(Effect.mapError(mapClientError)), )
const EndpointSessionView = (raw: RawClient["server.session"]) => (input: SessionViewInput) => preserveEffect<SessionViewOutput>()( raw["session.view"]({ params: { sessionID: input["sessionID"] }, payload: { idle: input["idle"] } }).pipe( Effect.mapError(mapClientError), ), )
const adaptGroupSession = (raw: RawClient["server.session"]) => ({ list: EndpointSessionList(raw), stats: EndpointSessionStats(raw), create: EndpointSessionCreate(raw), import: EndpointSessionImport(raw), export: EndpointSessionExport(raw), active: EndpointSessionActive(raw), get: EndpointSessionGet(raw), remove: EndpointSessionRemove(raw), fork: EndpointSessionFork(raw), switchAgent: EndpointSessionSwitchAgent(raw), switchModel: EndpointSessionSwitchModel(raw), update: EndpointSessionUpdate(raw), move: EndpointSessionMove(raw), prompt: EndpointSessionPrompt(raw), command: EndpointSessionCommand(raw), skill: EndpointSessionSkill(raw), synthetic: EndpointSessionSynthetic(raw), shell: EndpointSessionShell(raw), compact: EndpointSessionCompact(raw), wait: EndpointSessionWait(raw), revert: { stage: EndpointSessionRevertStage(raw), clear: EndpointSessionRevertClear(raw), commit: EndpointSessionRevertCommit(raw), }, context: EndpointSessionContext(raw), diff: EndpointSessionDiff(raw), inbox: { list: EndpointSessionInboxList(raw), cancel: EndpointSessionInboxCancel(raw), update: EndpointSessionInboxUpdate(raw), }, instructions: { entry: { list: EndpointSessionInstructionsEntryList(raw), put: EndpointSessionInstructionsEntryPut(raw), remove: EndpointSessionInstructionsEntryRemove(raw), }, }, generate: EndpointSessionGenerate(raw), log: EndpointSessionLog(raw), interrupt: EndpointSessionInterrupt(raw), background: EndpointSessionBackground(raw), message: { get: EndpointSessionMessageGet(raw) }, form: { list: EndpointSessionFormList(raw), create: EndpointSessionFormCreate(raw), get: EndpointSessionFormGet(raw), reply: EndpointSessionFormReply(raw), cancel: EndpointSessionFormCancel(raw), }, environment: EndpointSessionEnvironment(raw), view: EndpointSessionView(raw),})
const EndpointMessageList = (raw: RawClient["server.message"]) => (input: MessageListInput) => preserveEffect<MessageListOutput>()( raw["session.messages"]({ params: { sessionID: input["sessionID"] }, query: { limit: input["limit"], order: input["order"], cursor: input["cursor"], type: input["type"] }, }).pipe(Effect.mapError(mapClientError)), )
const adaptGroupMessage = (raw: RawClient["server.message"]) => ({ list: EndpointMessageList(raw) })
const EndpointModelList = (raw: RawClient["server.model"]) => (input?: ModelListInput) => preserveEffect<ModelListOutput>()( raw["model.list"]({ query: { location: input?.["location"] } }).pipe(Effect.mapError(mapClientError)), )
const EndpointModelDefault = (raw: RawClient["server.model"]) => (input?: ModelDefaultInput) => preserveEffect<ModelDefaultOutput>()( raw["model.default"]({ query: { location: input?.["location"] } }).pipe(Effect.mapError(mapClientError)), )
const adaptGroupModel = (raw: RawClient["server.model"]) => ({ list: EndpointModelList(raw), default: EndpointModelDefault(raw),})
const EndpointGenerateText = (raw: RawClient["server.generate"]) => (input: GenerateTextInput) => preserveEffect<GenerateTextOutput>()( raw["generate.text"]({ payload: { prompt: input["prompt"], model: input["model"] } }).pipe( Effect.mapError(mapClientError), Effect.map((value) => value.data), ), )
const adaptGroupGenerate = (raw: RawClient["server.generate"]) => ({ text: EndpointGenerateText(raw) })
const EndpointProviderList = (raw: RawClient["server.provider"]) => (input?: ProviderListInput) => preserveEffect<ProviderListOutput>()( raw["provider.list"]({ query: { location: input?.["location"] } }).pipe(Effect.mapError(mapClientError)), )
const EndpointProviderGet = (raw: RawClient["server.provider"]) => (input: ProviderGetInput) => preserveEffect<ProviderGetOutput>()( raw["provider.get"]({ params: { providerID: input["providerID"] }, query: { location: input["location"] } }).pipe( Effect.mapError(mapClientError), ), )
const adaptGroupProvider = (raw: RawClient["server.provider"]) => ({ list: EndpointProviderList(raw), get: EndpointProviderGet(raw),})
const EndpointIntegrationList = (raw: RawClient["server.integration"]) => (input?: IntegrationListInput) => preserveEffect<IntegrationListOutput>()( raw["integration.list"]({ query: { location: input?.["location"] } }).pipe(Effect.mapError(mapClientError)), )
const EndpointIntegrationGet = (raw: RawClient["server.integration"]) => (input: IntegrationGetInput) => preserveEffect<IntegrationGetOutput>()( raw["integration.get"]({ params: { integrationID: input["integrationID"] }, query: { location: input["location"] }, }).pipe(Effect.mapError(mapClientError)), )
const EndpointIntegrationWellknownAdd = (raw: RawClient["server.integration"]) => (input: IntegrationWellknownAddInput) => preserveEffect<IntegrationWellknownAddOutput>()( raw["integration.wellknown.add"]({ query: { location: input["location"] }, payload: { url: input["url"] } }).pipe( Effect.mapError(mapClientError), ), )
const EndpointIntegrationConnectKey = (raw: RawClient["server.integration"]) => (input: IntegrationConnectKeyInput) => preserveEffect<IntegrationConnectKeyOutput>()( raw["integration.connect.key"]({ params: { integrationID: input["integrationID"] }, query: { location: input["location"] }, payload: { key: input["key"], answer: input["answer"], label: input["label"] }, }).pipe(Effect.mapError(mapClientError)), )
const EndpointIntegrationOauthConnect = (raw: RawClient["server.integration"]) => (input: IntegrationOauthConnectInput) => preserveEffect<IntegrationOauthConnectOutput>()( raw["integration.oauth.connect"]({ params: { integrationID: input["integrationID"] }, query: { location: input["location"] }, payload: { methodID: input["methodID"], answer: input["answer"], label: input["label"] }, }).pipe(Effect.mapError(mapClientError)), )
const EndpointIntegrationOauthStatus = (raw: RawClient["server.integration"]) => (input: IntegrationOauthStatusInput) => preserveEffect<IntegrationOauthStatusOutput>()( raw["integration.oauth.status"]({ params: { integrationID: input["integrationID"], attemptID: input["attemptID"] }, query: { location: input["location"] }, }).pipe(Effect.mapError(mapClientError)), )
const EndpointIntegrationOauthComplete = (raw: RawClient["server.integration"]) => (input: IntegrationOauthCompleteInput) => preserveEffect<IntegrationOauthCompleteOutput>()( raw["integration.oauth.complete"]({ params: { integrationID: input["integrationID"], attemptID: input["attemptID"] }, query: { location: input["location"] }, payload: { code: input["code"] }, }).pipe(Effect.mapError(mapClientError)), )
const EndpointIntegrationOauthCancel = (raw: RawClient["server.integration"]) => (input: IntegrationOauthCancelInput) => preserveEffect<IntegrationOauthCancelOutput>()( raw["integration.oauth.cancel"]({ params: { integrationID: input["integrationID"], attemptID: input["attemptID"] }, query: { location: input["location"] }, }).pipe(Effect.mapError(mapClientError)), )
const EndpointIntegrationCommandConnect = (raw: RawClient["server.integration"]) => (input: IntegrationCommandConnectInput) => preserveEffect<IntegrationCommandConnectOutput>()( raw["integration.command.connect"]({ params: { integrationID: input["integrationID"] }, query: { location: input["location"] }, payload: { methodID: input["methodID"], label: input["label"] }, }).pipe(Effect.mapError(mapClientError)), )
const EndpointIntegrationCommandStatus = (raw: RawClient["server.integration"]) => (input: IntegrationCommandStatusInput) => preserveEffect<IntegrationCommandStatusOutput>()( raw["integration.command.status"]({ params: { integrationID: input["integrationID"], attemptID: input["attemptID"] }, query: { location: input["location"] }, }).pipe(Effect.mapError(mapClientError)), )
const EndpointIntegrationCommandCancel = (raw: RawClient["server.integration"]) => (input: IntegrationCommandCancelInput) => preserveEffect<IntegrationCommandCancelOutput>()( raw["integration.command.cancel"]({ params: { integrationID: input["integrationID"], attemptID: input["attemptID"] }, query: { location: input["location"] }, }).pipe(Effect.mapError(mapClientError)), )
const adaptGroupIntegration = (raw: RawClient["server.integration"]) => ({ list: EndpointIntegrationList(raw), get: EndpointIntegrationGet(raw), wellknown: { add: EndpointIntegrationWellknownAdd(raw) }, connect: { key: EndpointIntegrationConnectKey(raw) }, oauth: { connect: EndpointIntegrationOauthConnect(raw), status: EndpointIntegrationOauthStatus(raw), complete: EndpointIntegrationOauthComplete(raw), cancel: EndpointIntegrationOauthCancel(raw), }, command: { connect: EndpointIntegrationCommandConnect(raw), status: EndpointIntegrationCommandStatus(raw), cancel: EndpointIntegrationCommandCancel(raw), },})
const EndpointMcpList = (raw: RawClient["server.mcp"]) => (input?: McpListInput) => preserveEffect<McpListOutput>()( raw["mcp.list"]({ query: { location: input?.["location"] } }).pipe(Effect.mapError(mapClientError)), )
const EndpointMcpAdd = (raw: RawClient["server.mcp"]) => (input: McpAddInput) => preserveEffect<McpAddOutput>()( raw["mcp.add"]({ params: { server: input["server"] }, query: { location: input["location"] }, payload: { config: input["config"] }, }).pipe(Effect.mapError(mapClientError)), )
const EndpointMcpRemove = (raw: RawClient["server.mcp"]) => (input: McpRemoveInput) => preserveEffect<McpRemoveOutput>()( raw["mcp.remove"]({ params: { server: input["server"] }, query: { location: input["location"] } }).pipe( Effect.mapError(mapClientError), ), )
const EndpointMcpConnect = (raw: RawClient["server.mcp"]) => (input: McpConnectInput) => preserveEffect<McpConnectOutput>()( raw["mcp.connect"]({ params: { server: input["server"] }, query: { location: input["location"] } }).pipe( Effect.mapError(mapClientError), ), )
const EndpointMcpDisconnect = (raw: RawClient["server.mcp"]) => (input: McpDisconnectInput) => preserveEffect<McpDisconnectOutput>()( raw["mcp.disconnect"]({ params: { server: input["server"] }, query: { location: input["location"] } }).pipe( Effect.mapError(mapClientError), ), )
const EndpointMcpResourceCatalog = (raw: RawClient["server.mcp"]) => (input?: McpResourceCatalogInput) => preserveEffect<McpResourceCatalogOutput>()( raw["mcp.resource.catalog"]({ query: { location: input?.["location"] } }).pipe(Effect.mapError(mapClientError)), )
const adaptGroupMcp = (raw: RawClient["server.mcp"]) => ({ list: EndpointMcpList(raw), add: EndpointMcpAdd(raw), remove: EndpointMcpRemove(raw), connect: EndpointMcpConnect(raw), disconnect: EndpointMcpDisconnect(raw), resource: { catalog: EndpointMcpResourceCatalog(raw) },})
const EndpointCredentialUpdate = (raw: RawClient["server.credential"]) => (input: CredentialUpdateInput) => preserveEffect<CredentialUpdateOutput>()( raw["credential.update"]({ params: { credentialID: input["credentialID"] }, payload: { label: input["label"] }, }).pipe(Effect.mapError(mapClientError)), )
const EndpointCredentialActivate = (raw: RawClient["server.credential"]) => (input: CredentialActivateInput) => preserveEffect<CredentialActivateOutput>()( raw["credential.activate"]({ params: { credentialID: input["credentialID"] } }).pipe( Effect.mapError(mapClientError), ), )
const EndpointCredentialRemove = (raw: RawClient["server.credential"]) => (input: CredentialRemoveInput) => preserveEffect<CredentialRemoveOutput>()( raw["credential.remove"]({ params: { credentialID: input["credentialID"] } }).pipe(Effect.mapError(mapClientError)), )
const adaptGroupCredential = (raw: RawClient["server.credential"]) => ({ update: EndpointCredentialUpdate(raw), activate: EndpointCredentialActivate(raw), remove: EndpointCredentialRemove(raw),})
const EndpointProjectList = (raw: RawClient["server.project"]) => () => preserveEffect<ProjectListOutput>()(raw["project.list"]({}).pipe(Effect.mapError(mapClientError)))
const EndpointProjectUpdate = (raw: RawClient["server.project"]) => (input: ProjectUpdateInput) => preserveEffect<ProjectUpdateOutput>()( raw["project.update"]({ params: { projectID: input["projectID"] }, payload: { canonical: input["canonical"], name: input["name"], icon: input["icon"], commands: input["commands"] }, }).pipe(Effect.mapError(mapClientError)), )
const adaptGroupProject = (raw: RawClient["server.project"]) => ({ list: EndpointProjectList(raw), update: EndpointProjectUpdate(raw),})
const EndpointFormList = (raw: RawClient["server.form"]) => (input?: FormListInput) => preserveEffect<FormListOutput>()( raw["form.list"]({ query: { location: input?.["location"] } }).pipe(Effect.mapError(mapClientError)), )
const adaptGroupForm = (raw: RawClient["server.form"]) => ({ list: EndpointFormList(raw) })
const EndpointPermissionRequestList = (raw: RawClient["server.permission"]) => (input?: PermissionRequestListInput) => preserveEffect<PermissionRequestListOutput>()( raw["permission.request.list"]({ query: { location: input?.["location"] } }).pipe(Effect.mapError(mapClientError)), )
const EndpointPermissionSavedList = (raw: RawClient["server.permission"]) => (input?: PermissionSavedListInput) => preserveEffect<PermissionSavedListOutput>()( raw["permission.saved.list"]({ query: { projectID: input?.["projectID"] } }).pipe( Effect.mapError(mapClientError), Effect.map((value) => value.data), ), )
const EndpointPermissionSavedRemove = (raw: RawClient["server.permission"]) => (input: PermissionSavedRemoveInput) => preserveEffect<PermissionSavedRemoveOutput>()( raw["permission.saved.remove"]({ params: { id: input["id"] } }).pipe(Effect.mapError(mapClientError)), )
const EndpointPermissionCreate = (raw: RawClient["server.permission"]) => (input: PermissionCreateInput) => preserveEffect<PermissionCreateOutput>()( raw["session.permission.create"]({ params: { sessionID: input["sessionID"] }, payload: { id: input["id"], action: input["action"], resources: input["resources"], save: input["save"], metadata: input["metadata"], source: input["source"], agent: input["agent"], }, }).pipe( Effect.mapError(mapClientError), Effect.map((value) => value.data), ), )
const EndpointPermissionList = (raw: RawClient["server.permission"]) => (input: PermissionListInput) => preserveEffect<PermissionListOutput>()( raw["session.permission.list"]({ params: { sessionID: input["sessionID"] } }).pipe( Effect.mapError(mapClientError), Effect.map((value) => value.data), ), )
const EndpointPermissionGet = (raw: RawClient["server.permission"]) => (input: PermissionGetInput) => preserveEffect<PermissionGetOutput>()( raw["session.permission.get"]({ params: { sessionID: input["sessionID"], requestID: input["requestID"] } }).pipe( Effect.mapError(mapClientError), Effect.map((value) => value.data), ), )
const EndpointPermissionReply = (raw: RawClient["server.permission"]) => (input: PermissionReplyInput) => preserveEffect<PermissionReplyOutput>()( raw["session.permission.reply"]({ params: { sessionID: input["sessionID"], requestID: input["requestID"] }, payload: { decision: input["decision"], message: input["message"] }, }).pipe(Effect.mapError(mapClientError)), )
const adaptGroupPermission = (raw: RawClient["server.permission"]) => ({ request: { list: EndpointPermissionRequestList(raw) }, saved: { list: EndpointPermissionSavedList(raw), remove: EndpointPermissionSavedRemove(raw) }, create: EndpointPermissionCreate(raw), list: EndpointPermissionList(raw), get: EndpointPermissionGet(raw), reply: EndpointPermissionReply(raw),})
const EndpointFileList = (raw: RawClient["server.fs"]) => (input?: FileListInput) => preserveEffect<FileListOutput>()( raw["fs.list"]({ query: { location: input?.["location"], path: input?.["path"] } }).pipe( Effect.mapError(mapClientError), ), )
const EndpointFileFind = (raw: RawClient["server.fs"]) => (input: FileFindInput) => preserveEffect<FileFindOutput>()( raw["fs.find"]({ query: { location: input["location"], query: input["query"], type: input["type"], limit: input["limit"] }, }).pipe(Effect.mapError(mapClientError)), )
const adaptGroupFile = (raw: RawClient["server.fs"]) => ({ list: EndpointFileList(raw), find: EndpointFileFind(raw) })
const EndpointCommandList = (raw: RawClient["server.command"]) => (input?: CommandListInput) => preserveEffect<CommandListOutput>()( raw["command.list"]({ query: { location: input?.["location"] } }).pipe(Effect.mapError(mapClientError)), )
const adaptGroupCommand = (raw: RawClient["server.command"]) => ({ list: EndpointCommandList(raw) })
const EndpointSkillList = (raw: RawClient["server.skill"]) => (input?: SkillListInput) => preserveEffect<SkillListOutput>()( raw["skill.list"]({ query: { location: input?.["location"] } }).pipe(Effect.mapError(mapClientError)), )
const adaptGroupSkill = (raw: RawClient["server.skill"]) => ({ list: EndpointSkillList(raw) })
const EndpointRpcCall = (raw: RawClient["server.rpc"]) => (input: RpcCallInput) => preserveEffect<RpcCallOutput>()( raw["rpc.call"]({ params: { rpcID: input["rpcID"], method: input["method"] }, query: { location: input["location"] }, payload: { input: input["input"] }, }).pipe(Effect.mapError(mapClientError)), )
const adaptGroupRpc = (raw: RawClient["server.rpc"]) => ({ call: EndpointRpcCall(raw) })
const EndpointEventSubscribe = (raw: RawClient["server.event"]) => () => preserveStream<EventSubscribeOutput>()( Stream.unwrap( raw["event.subscribe"]({}).pipe( Effect.mapError(mapClientError), Effect.map((stream) => stream.pipe(Stream.mapError(mapClientError))), ), ), )
const adaptGroupEvent = (raw: RawClient["server.event"]) => ({ subscribe: EndpointEventSubscribe(raw) })
const EndpointPtyList = (raw: RawClient["server.pty"]) => (input?: PtyListInput) => preserveEffect<PtyListOutput>()( raw["pty.list"]({ query: { location: input?.["location"] } }).pipe(Effect.mapError(mapClientError)), )
const EndpointPtyCreate = (raw: RawClient["server.pty"]) => (input?: PtyCreateInput) => preserveEffect<PtyCreateOutput>()( raw["pty.create"]({ query: { location: input?.["location"] }, payload: { command: input?.["command"], args: input?.["args"], cwd: input?.["cwd"], title: input?.["title"], env: input?.["env"], }, }).pipe(Effect.mapError(mapClientError)), )
const EndpointPtyGet = (raw: RawClient["server.pty"]) => (input: PtyGetInput) => preserveEffect<PtyGetOutput>()( raw["pty.get"]({ params: { ptyID: input["ptyID"] }, query: { location: input["location"] } }).pipe( Effect.mapError(mapClientError), ), )
const EndpointPtyUpdate = (raw: RawClient["server.pty"]) => (input: PtyUpdateInput) => preserveEffect<PtyUpdateOutput>()( raw["pty.update"]({ params: { ptyID: input["ptyID"] }, query: { location: input["location"] }, payload: { title: input["title"], size: input["size"] }, }).pipe(Effect.mapError(mapClientError)), )
const EndpointPtyRemove = (raw: RawClient["server.pty"]) => (input: PtyRemoveInput) => preserveEffect<PtyRemoveOutput>()( raw["pty.remove"]({ params: { ptyID: input["ptyID"] }, query: { location: input["location"] } }).pipe( Effect.mapError(mapClientError), ), )
const EndpointPtyConnectToken = (raw: RawClient["server.pty"]) => (input: PtyConnectTokenInput) => preserveEffect<PtyConnectTokenOutput>()( raw["pty.connectToken"]({ params: { ptyID: input["ptyID"] }, query: { location: input["location"] }, headers: { "x-opencode-ticket": input["x-opencode-ticket"] }, }).pipe(Effect.mapError(mapClientError)), )
const adaptGroupPty = (raw: RawClient["server.pty"]) => ({ list: EndpointPtyList(raw), create: EndpointPtyCreate(raw), get: EndpointPtyGet(raw), update: EndpointPtyUpdate(raw), remove: EndpointPtyRemove(raw), connect: { token: EndpointPtyConnectToken(raw) },})
const EndpointExperimentalPersistentPtyRead = (raw: RawClient["server.experimental"]) => (input: ExperimentalPersistentPtyReadInput) => preserveEffect<ExperimentalPersistentPtyReadOutput>()( raw["persistentPty.read"]({ params: { sessionID: input["sessionID"] }, query: { lines: input["lines"] } }).pipe( Effect.mapError(mapClientError), Effect.map((value) => value.data), ), )
const EndpointExperimentalPersistentPtyList = (raw: RawClient["server.experimental"]) => (input: ExperimentalPersistentPtyListInput) => preserveEffect<ExperimentalPersistentPtyListOutput>()( raw["persistentPty.list"]({ params: { sessionID: input["sessionID"] } }).pipe( Effect.mapError(mapClientError), Effect.map((value) => value.data), ), )
const EndpointExperimentalPersistentPtyCreate = (raw: RawClient["server.experimental"]) => (input: ExperimentalPersistentPtyCreateInput) => preserveEffect<ExperimentalPersistentPtyCreateOutput>()( raw["persistentPty.create"]({ params: { sessionID: input["sessionID"] }, payload: { command: input["command"], args: input["args"], cwd: input["cwd"], title: input["title"], env: input["env"], size: input["size"], }, }).pipe( Effect.mapError(mapClientError), Effect.map((value) => value.data), ), )
const EndpointExperimentalPersistentPtyShutdown = (raw: RawClient["server.experimental"]) => () => preserveEffect<ExperimentalPersistentPtyShutdownOutput>()( raw["persistentPty.shutdown"]({}).pipe(Effect.mapError(mapClientError)), )
const EndpointExperimentalPersistentPtyHandoff = (raw: RawClient["server.experimental"]) => () => preserveEffect<ExperimentalPersistentPtyHandoffOutput>()( raw["persistentPty.handoff"]({}).pipe(Effect.mapError(mapClientError)), )
const EndpointExperimentalPersistentPtyGet = (raw: RawClient["server.experimental"]) => (input: ExperimentalPersistentPtyGetInput) => preserveEffect<ExperimentalPersistentPtyGetOutput>()( raw["persistentPty.get"]({ params: { ptyID: input["ptyID"] } }).pipe( Effect.mapError(mapClientError), Effect.map((value) => value.data), ), )
const EndpointExperimentalPersistentPtyUpdate = (raw: RawClient["server.experimental"]) => (input: ExperimentalPersistentPtyUpdateInput) => preserveEffect<ExperimentalPersistentPtyUpdateOutput>()( raw["persistentPty.update"]({ params: { ptyID: input["ptyID"] }, payload: { attachmentID: input["attachmentID"], size: input["size"] }, }).pipe( Effect.mapError(mapClientError), Effect.map((value) => value.data), ), )
const EndpointExperimentalPersistentPtySnapshot = (raw: RawClient["server.experimental"]) => (input: ExperimentalPersistentPtySnapshotInput) => preserveEffect<ExperimentalPersistentPtySnapshotOutput>()( raw["persistentPty.snapshot"]({ params: { ptyID: input["ptyID"] } }).pipe( Effect.mapError(mapClientError), Effect.map((value) => value.data), ), )
const EndpointExperimentalPersistentPtyRemove = (raw: RawClient["server.experimental"]) => (input: ExperimentalPersistentPtyRemoveInput) => preserveEffect<ExperimentalPersistentPtyRemoveOutput>()( raw["persistentPty.remove"]({ params: { ptyID: input["ptyID"] } }).pipe(Effect.mapError(mapClientError)), )
const EndpointExperimentalPersistentPtyConnectToken = (raw: RawClient["server.experimental"]) => (input: ExperimentalPersistentPtyConnectTokenInput) => preserveEffect<ExperimentalPersistentPtyConnectTokenOutput>()( raw["persistentPty.connectToken"]({ params: { ptyID: input["ptyID"] }, headers: { "x-opencode-ticket": input["x-opencode-ticket"] }, }).pipe( Effect.mapError(mapClientError), Effect.map((value) => value.data), ), )
const adaptGroupExperimental = (raw: RawClient["server.experimental"]) => ({ persistentPty: { read: EndpointExperimentalPersistentPtyRead(raw), list: EndpointExperimentalPersistentPtyList(raw), create: EndpointExperimentalPersistentPtyCreate(raw), shutdown: EndpointExperimentalPersistentPtyShutdown(raw), handoff: EndpointExperimentalPersistentPtyHandoff(raw), get: EndpointExperimentalPersistentPtyGet(raw), update: EndpointExperimentalPersistentPtyUpdate(raw), snapshot: EndpointExperimentalPersistentPtySnapshot(raw), remove: EndpointExperimentalPersistentPtyRemove(raw), connectToken: EndpointExperimentalPersistentPtyConnectToken(raw), },})
const EndpointShellList = (raw: RawClient["server.shell"]) => (input?: ShellListInput) => preserveEffect<ShellListOutput>()( raw["shell.list"]({ query: { location: input?.["location"] } }).pipe(Effect.mapError(mapClientError)), )
const EndpointShellCreate = (raw: RawClient["server.shell"]) => (input: ShellCreateInput) => preserveEffect<ShellCreateOutput>()( raw["shell.create"]({ query: { location: input["location"] }, payload: { command: input["command"], cwd: input["cwd"], timeout: input["timeout"], metadata: input["metadata"] }, }).pipe(Effect.mapError(mapClientError)), )
const EndpointShellGet = (raw: RawClient["server.shell"]) => (input: ShellGetInput) => preserveEffect<ShellGetOutput>()( raw["shell.get"]({ params: { id: input["id"] }, query: { location: input["location"] } }).pipe( Effect.mapError(mapClientError), ), )
const EndpointShellOutput = (raw: RawClient["server.shell"]) => (input: ShellOutputInput) => preserveEffect<ShellOutputOutput>()( raw["shell.output"]({ params: { id: input["id"] }, query: { location: input["location"], cursor: input["cursor"], limit: input["limit"] }, }).pipe(Effect.mapError(mapClientError)), )
const EndpointShellRemove = (raw: RawClient["server.shell"]) => (input: ShellRemoveInput) => preserveEffect<ShellRemoveOutput>()( raw["shell.remove"]({ params: { id: input["id"] }, query: { location: input["location"] } }).pipe( Effect.mapError(mapClientError), ), )
const adaptGroupShell = (raw: RawClient["server.shell"]) => ({ list: EndpointShellList(raw), create: EndpointShellCreate(raw), get: EndpointShellGet(raw), output: EndpointShellOutput(raw), remove: EndpointShellRemove(raw),})
const EndpointReferenceList = (raw: RawClient["server.reference"]) => (input?: ReferenceListInput) => preserveEffect<ReferenceListOutput>()( raw["reference.list"]({ query: { location: input?.["location"] } }).pipe(Effect.mapError(mapClientError)), )
const adaptGroupReference = (raw: RawClient["server.reference"]) => ({ list: EndpointReferenceList(raw) })
const EndpointWorktreeList = (raw: RawClient["server.worktree"]) => (input: WorktreeListInput) => preserveEffect<WorktreeListOutput>()( raw["worktree.list"]({ query: { projectID: input["projectID"] } }).pipe(Effect.mapError(mapClientError)), )
const EndpointWorktreeCreate = (raw: RawClient["server.worktree"]) => (input: WorktreeCreateInput) => preserveEffect<WorktreeCreateOutput>()( raw["worktree.create"]({ payload: { projectID: input["projectID"], from: input["from"], branch: input["branch"], directory: input["directory"], name: input["name"], }, }).pipe(Effect.mapError(mapClientError)), )
const EndpointWorktreeRemove = (raw: RawClient["server.worktree"]) => (input: WorktreeRemoveInput) => preserveEffect<WorktreeRemoveOutput>()( raw["worktree.remove"]({ payload: { projectID: input["projectID"], directory: input["directory"], force: input["force"] }, }).pipe(Effect.mapError(mapClientError)), )
const EndpointWorktreeRefresh = (raw: RawClient["server.worktree"]) => (input: WorktreeRefreshInput) => preserveEffect<WorktreeRefreshOutput>()( raw["worktree.refresh"]({ payload: { projectID: input["projectID"] } }).pipe(Effect.mapError(mapClientError)), )
const adaptGroupWorktree = (raw: RawClient["server.worktree"]) => ({ list: EndpointWorktreeList(raw), create: EndpointWorktreeCreate(raw), remove: EndpointWorktreeRemove(raw), refresh: EndpointWorktreeRefresh(raw),})
const EndpointVcsGet = (raw: RawClient["server.vcs"]) => (input?: VcsGetInput) => preserveEffect<VcsGetOutput>()( raw["vcs.get"]({ query: { location: input?.["location"] } }).pipe(Effect.mapError(mapClientError)), )
const EndpointVcsBase = (raw: RawClient["server.vcs"]) => (input?: VcsBaseInput) => preserveEffect<VcsBaseOutput>()( raw["vcs.base"]({ query: { location: input?.["location"] } }).pipe(Effect.mapError(mapClientError)), )
const EndpointVcsStatus = (raw: RawClient["server.vcs"]) => (input?: VcsStatusInput) => preserveEffect<VcsStatusOutput>()( raw["vcs.status"]({ query: { location: input?.["location"] } }).pipe(Effect.mapError(mapClientError)), )
const EndpointVcsBranchList = (raw: RawClient["server.vcs"]) => (input?: VcsBranchListInput) => preserveEffect<VcsBranchListOutput>()( raw["vcs.branch.list"]({ query: { location: input?.["location"], search: input?.["search"], limit: input?.["limit"] }, }).pipe(Effect.mapError(mapClientError)), )
const EndpointVcsDiff = (raw: RawClient["server.vcs"]) => (input: VcsDiffInput) => preserveEffect<VcsDiffOutput>()( raw["vcs.diff"]({ query: { location: input["location"], mode: input["mode"], base: input["base"], context: input["context"] }, }).pipe(Effect.mapError(mapClientError)), )
const adaptGroupVcs = (raw: RawClient["server.vcs"]) => ({ get: EndpointVcsGet(raw), base: EndpointVcsBase(raw), status: EndpointVcsStatus(raw), branch: { list: EndpointVcsBranchList(raw) }, diff: EndpointVcsDiff(raw),})
const EndpointDebugLocationList = (raw: RawClient["server.debug"]) => () => preserveEffect<DebugLocationListOutput>()(raw["debug.location"]({}).pipe(Effect.mapError(mapClientError)))
const EndpointDebugLocationEvict = (raw: RawClient["server.debug"]) => (input?: DebugLocationEvictInput) => preserveEffect<DebugLocationEvictOutput>()( raw["debug.location.evict"]({ query: { location: input?.["location"] } }).pipe(Effect.mapError(mapClientError)), )
const adaptGroupDebug = (raw: RawClient["server.debug"]) => ({ location: { list: EndpointDebugLocationList(raw), evict: EndpointDebugLocationEvict(raw) },})
const EndpointMigrationV1Status = (raw: RawClient["server.migration"]) => () => preserveEffect<MigrationV1StatusOutput>()(raw["migration.v1.status"]({}).pipe(Effect.mapError(mapClientError)))
const adaptGroupMigration = (raw: RawClient["server.migration"]) => ({ v1: { status: EndpointMigrationV1Status(raw) } })
const EndpointWebsearchProviders = (raw: RawClient["server.websearch"]) => (input?: WebsearchProvidersInput) => preserveEffect<WebsearchProvidersOutput>()( raw["websearch.providers"]({ query: { location: input?.["location"] } }).pipe(Effect.mapError(mapClientError)), )
const EndpointWebsearchQuery = (raw: RawClient["server.websearch"]) => (input: WebsearchQueryInput) => preserveEffect<WebsearchQueryOutput>()( raw["websearch.query"]({ query: { location: input["location"] }, payload: { query: input["query"], providerID: input["providerID"] }, }).pipe(Effect.mapError(mapClientError)), )
const adaptGroupWebsearch = (raw: RawClient["server.websearch"]) => ({ providers: EndpointWebsearchProviders(raw), query: EndpointWebsearchQuery(raw),})
const EndpointConfigGet = (raw: RawClient["server.config"]) => (input?: ConfigGetInput) => preserveEffect<ConfigGetOutput>()( raw["config.get"]({ query: { location: input?.["location"] } }).pipe(Effect.mapError(mapClientError)), )
const EndpointConfigShells = (raw: RawClient["server.config"]) => () => preserveEffect<ConfigShellsOutput>()(raw["config.shells"]({}).pipe(Effect.mapError(mapClientError)))
const EndpointConfigUpdate = (raw: RawClient["server.config"]) => (input: ConfigUpdateInput) => preserveEffect<ConfigUpdateOutput>()( raw["config.update"]({ payload: { shell: input["shell"] } }).pipe(Effect.mapError(mapClientError)), )
const adaptGroupConfig = (raw: RawClient["server.config"]) => ({ get: EndpointConfigGet(raw), shells: EndpointConfigShells(raw), update: EndpointConfigUpdate(raw),})
const adaptClient = (raw: RawClient) => ({ server: adaptGroupServer(raw["server.server"]), location: adaptGroupLocation(raw["server.location"]), agent: adaptGroupAgent(raw["server.agent"]), plugin: adaptGroupPlugin(raw["server.plugin"]), session: adaptGroupSession(raw["server.session"]), message: adaptGroupMessage(raw["server.message"]), model: adaptGroupModel(raw["server.model"]), generate: adaptGroupGenerate(raw["server.generate"]), provider: adaptGroupProvider(raw["server.provider"]), integration: adaptGroupIntegration(raw["server.integration"]), mcp: adaptGroupMcp(raw["server.mcp"]), credential: adaptGroupCredential(raw["server.credential"]), project: adaptGroupProject(raw["server.project"]), form: adaptGroupForm(raw["server.form"]), permission: adaptGroupPermission(raw["server.permission"]), file: adaptGroupFile(raw["server.fs"]), command: adaptGroupCommand(raw["server.command"]), skill: adaptGroupSkill(raw["server.skill"]), rpc: adaptGroupRpc(raw["server.rpc"]), event: adaptGroupEvent(raw["server.event"]), pty: adaptGroupPty(raw["server.pty"]), experimental: adaptGroupExperimental(raw["server.experimental"]), shell: adaptGroupShell(raw["server.shell"]), reference: adaptGroupReference(raw["server.reference"]), worktree: adaptGroupWorktree(raw["server.worktree"]), vcs: adaptGroupVcs(raw["server.vcs"]), debug: adaptGroupDebug(raw["server.debug"]), migration: adaptGroupMigration(raw["server.migration"]), websearch: adaptGroupWebsearch(raw["server.websearch"]), config: adaptGroupConfig(raw["server.config"]),})
export const make = (options?: { readonly baseUrl?: URL | string }) => HttpApiClient.make(ClientApi, options).pipe(Effect.map(adaptClient))