ignore: fix event type gen

This commit is contained in:
Dax Raad
2025-09-17 01:16:49 -04:00
parent ad5fc76b11
commit abd99aeb7d
19 changed files with 2156 additions and 1859 deletions

View File

@@ -1,6 +1,8 @@
// This file is auto-generated by @hey-api/openapi-ts
import { createSseClient } from "../core/serverSentEvents.gen.js"
import type { HttpMethod } from "../core/types.gen.js"
import { getValidRequestBody } from "../core/utils.gen.js"
import type { Client, Config, RequestOptions, ResolvedRequestOptions } from "./types.gen.js"
import {
buildUrl,
@@ -49,12 +51,12 @@ export const createClient = (config: Config = {}): Client => {
await opts.requestValidator(opts)
}
if (opts.body && opts.bodySerializer) {
if (opts.body !== undefined && opts.bodySerializer) {
opts.serializedBody = opts.bodySerializer(opts.body)
}
// remove Content-Type header if body is empty to avoid sending invalid requests
if (opts.serializedBody === undefined || opts.serializedBody === "") {
if (opts.body === undefined || opts.serializedBody === "") {
opts.headers.delete("Content-Type")
}
@@ -69,7 +71,7 @@ export const createClient = (config: Config = {}): Client => {
const requestInit: ReqInit = {
redirect: "follow",
...opts,
body: opts.serializedBody,
body: getValidRequestBody(opts),
}
let request = new Request(url, requestInit)
@@ -97,18 +99,36 @@ export const createClient = (config: Config = {}): Client => {
}
if (response.ok) {
const parseAs =
(opts.parseAs === "auto" ? getParseAs(response.headers.get("Content-Type")) : opts.parseAs) ?? "json"
if (response.status === 204 || response.headers.get("Content-Length") === "0") {
let emptyData: any
switch (parseAs) {
case "arrayBuffer":
case "blob":
case "text":
emptyData = await response[parseAs]()
break
case "formData":
emptyData = new FormData()
break
case "stream":
emptyData = response.body
break
case "json":
default:
emptyData = {}
break
}
return opts.responseStyle === "data"
? {}
? emptyData
: {
data: {},
data: emptyData,
...result,
}
}
const parseAs =
(opts.parseAs === "auto" ? getParseAs(response.headers.get("Content-Type")) : opts.parseAs) ?? "json"
let data: any
switch (parseAs) {
case "arrayBuffer":
@@ -178,35 +198,53 @@ export const createClient = (config: Config = {}): Client => {
}
}
const makeMethod = (method: Required<Config>["method"]) => {
const fn = (options: RequestOptions) => request({ ...options, method })
fn.sse = async (options: RequestOptions) => {
const { opts, url } = await beforeRequest(options)
return createSseClient({
...opts,
body: opts.body as BodyInit | null | undefined,
headers: opts.headers as unknown as Record<string, string>,
method,
url,
})
}
return fn
const makeMethodFn = (method: Uppercase<HttpMethod>) => (options: RequestOptions) => request({ ...options, method })
const makeSseFn = (method: Uppercase<HttpMethod>) => async (options: RequestOptions) => {
const { opts, url } = await beforeRequest(options)
return createSseClient({
...opts,
body: opts.body as BodyInit | null | undefined,
headers: opts.headers as unknown as Record<string, string>,
method,
onRequest: async (url, init) => {
let request = new Request(url, init)
for (const fn of interceptors.request._fns) {
if (fn) {
request = await fn(request, opts)
}
}
return request
},
url,
})
}
return {
buildUrl,
connect: makeMethod("CONNECT"),
delete: makeMethod("DELETE"),
get: makeMethod("GET"),
connect: makeMethodFn("CONNECT"),
delete: makeMethodFn("DELETE"),
get: makeMethodFn("GET"),
getConfig,
head: makeMethod("HEAD"),
head: makeMethodFn("HEAD"),
interceptors,
options: makeMethod("OPTIONS"),
patch: makeMethod("PATCH"),
post: makeMethod("POST"),
put: makeMethod("PUT"),
options: makeMethodFn("OPTIONS"),
patch: makeMethodFn("PATCH"),
post: makeMethodFn("POST"),
put: makeMethodFn("PUT"),
request,
setConfig,
trace: makeMethod("TRACE"),
sse: {
connect: makeSseFn("CONNECT"),
delete: makeSseFn("DELETE"),
get: makeSseFn("GET"),
head: makeSseFn("HEAD"),
options: makeSseFn("OPTIONS"),
patch: makeSseFn("PATCH"),
post: makeSseFn("POST"),
put: makeSseFn("PUT"),
trace: makeSseFn("TRACE"),
},
trace: makeMethodFn("TRACE"),
} as Client
}

View File

@@ -20,7 +20,7 @@ export interface Config<T extends ClientOptions = ClientOptions>
*
* @default globalThis.fetch
*/
fetch?: (request: Request) => ReturnType<typeof fetch>
fetch?: typeof fetch
/**
* Please don't use the Fetch client for Next.js applications. The `next`
* options won't have any effect.
@@ -128,7 +128,7 @@ export interface ClientOptions {
throwOnError?: boolean
}
type MethodFnBase = <
type MethodFn = <
TData = unknown,
TError = unknown,
ThrowOnError extends boolean = false,
@@ -137,7 +137,7 @@ type MethodFnBase = <
options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">,
) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>
type MethodFnServerSentEvents = <
type SseFn = <
TData = unknown,
TError = unknown,
ThrowOnError extends boolean = false,
@@ -146,10 +146,6 @@ type MethodFnServerSentEvents = <
options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">,
) => Promise<ServerSentEventsResult<TData, TError>>
type MethodFn = MethodFnBase & {
sse: MethodFnServerSentEvents
}
type RequestFn = <
TData = unknown,
TError = unknown,
@@ -171,7 +167,7 @@ type BuildUrlFn = <
options: Pick<TData, "url"> & Options<TData>,
) => string
export type Client = CoreClient<RequestFn, Config, MethodFn, BuildUrlFn> & {
export type Client = CoreClient<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
interceptors: Middleware<Request, Response, unknown, ResolvedRequestOptions>
}

View File

@@ -162,14 +162,22 @@ export const mergeConfigs = (a: Config, b: Config): Config => {
return config
}
const headersEntries = (headers: Headers): Array<[string, string]> => {
const entries: Array<[string, string]> = []
headers.forEach((value, key) => {
entries.push([key, value])
})
return entries
}
export const mergeHeaders = (...headers: Array<Required<Config>["headers"] | undefined>): Headers => {
const mergedHeaders = new Headers()
for (const header of headers) {
if (!header || typeof header !== "object") {
if (!header) {
continue
}
const iterator = header instanceof Headers ? header.entries() : Object.entries(header)
const iterator = header instanceof Headers ? headersEntries(header) : Object.entries(header)
for (const [key, value] of iterator) {
if (value === null) {

View File

@@ -4,6 +4,17 @@ import type { Config } from "./types.gen.js"
export type ServerSentEventsOptions<TData = unknown> = Omit<RequestInit, "method"> &
Pick<Config, "method" | "responseTransformer" | "responseValidator"> & {
/**
* Fetch API implementation. You can use this option to provide a custom
* fetch instance.
*
* @default globalThis.fetch
*/
fetch?: typeof fetch
/**
* Implementing clients can call request interceptors inside this hook.
*/
onRequest?: (url: string, init: RequestInit) => Promise<Request>
/**
* Callback invoked when a network or parsing error occurs during streaming.
*
@@ -21,6 +32,7 @@ export type ServerSentEventsOptions<TData = unknown> = Omit<RequestInit, "method
* @returns Nothing (void).
*/
onSseEvent?: (event: StreamEvent<TData>) => void
serializedBody?: RequestInit["body"]
/**
* Default retry delay in milliseconds.
*
@@ -64,6 +76,7 @@ export type ServerSentEventsResult<TData = unknown, TReturn = void, TNext = unkn
}
export const createSseClient = <TData = unknown>({
onRequest,
onSseError,
onSseEvent,
responseTransformer,
@@ -99,7 +112,21 @@ export const createSseClient = <TData = unknown>({
}
try {
const response = await fetch(url, { ...options, headers, signal })
const requestInit: RequestInit = {
redirect: "follow",
...options,
body: options.serializedBody,
headers,
signal,
}
let request = new Request(url, requestInit)
if (onRequest) {
request = await onRequest(url, requestInit)
}
// fetch must be assigned here, otherwise it would throw the error:
// TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation
const _fetch = options.fetch ?? globalThis.fetch
const response = await _fetch(request)
if (!response.ok) throw new Error(`SSE failed: ${response.status} ${response.statusText}`)

View File

@@ -3,24 +3,19 @@
import type { Auth, AuthToken } from "./auth.gen.js"
import type { BodySerializer, QuerySerializer, QuerySerializerOptions } from "./bodySerializer.gen.js"
export interface Client<RequestFn = never, Config = unknown, MethodFn = never, BuildUrlFn = never> {
export type HttpMethod = "connect" | "delete" | "get" | "head" | "options" | "patch" | "post" | "put" | "trace"
export type Client<RequestFn = never, Config = unknown, MethodFn = never, BuildUrlFn = never, SseFn = never> = {
/**
* Returns the final request URL.
*/
buildUrl: BuildUrlFn
connect: MethodFn
delete: MethodFn
get: MethodFn
getConfig: () => Config
head: MethodFn
options: MethodFn
patch: MethodFn
post: MethodFn
put: MethodFn
request: RequestFn
setConfig: (config: Config) => Config
trace: MethodFn
}
} & {
[K in HttpMethod]: MethodFn
} & ([SseFn] extends [never] ? { sse?: never } : { sse: { [K in HttpMethod]: SseFn } })
export interface Config {
/**
@@ -47,7 +42,7 @@ export interface Config {
*
* {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more}
*/
method?: "CONNECT" | "DELETE" | "GET" | "HEAD" | "OPTIONS" | "PATCH" | "POST" | "PUT" | "TRACE"
method?: Uppercase<HttpMethod>
/**
* A function for serializing request query parameters. By default, arrays
* will be exploded in form style, objects will be exploded in deepObject

View File

@@ -1,6 +1,6 @@
// This file is auto-generated by @hey-api/openapi-ts
import type { QuerySerializer } from "./bodySerializer.gen.js"
import type { BodySerializer, QuerySerializer } from "./bodySerializer.gen.js"
import {
type ArraySeparatorStyle,
serializeArrayParam,
@@ -107,3 +107,31 @@ export const getUrl = ({
}
return url
}
export function getValidRequestBody(options: {
body?: unknown
bodySerializer?: BodySerializer | null
serializedBody?: unknown
}) {
const hasBody = options.body !== undefined
const isSerializedBody = hasBody && options.bodySerializer
if (isSerializedBody) {
if ("serializedBody" in options) {
const hasSerializedBody = options.serializedBody !== undefined && options.serializedBody !== ""
return hasSerializedBody ? options.serializedBody : null
}
// not all clients implement a serializedBody property (i.e. client-axios)
return options.body !== "" ? options.body : null
}
// plain/text body
if (hasBody) {
return options.body
}
// no body was provided
return undefined
}

View File

@@ -6,8 +6,6 @@ import type {
ProjectListResponses,
ProjectCurrentData,
ProjectCurrentResponses,
EventSubscribeData,
EventSubscribeResponses,
ConfigGetData,
ConfigGetResponses,
ToolRegisterData,
@@ -101,6 +99,8 @@ import type {
AuthSetData,
AuthSetResponses,
AuthSetErrors,
EventSubscribeData,
EventSubscribeResponses,
} from "./types.gen.js"
import { client as _heyApiClient } from "./client.gen.js"
@@ -153,18 +153,6 @@ class Project extends _HeyApiClient {
}
}
class Event extends _HeyApiClient {
/**
* Get events
*/
public subscribe<ThrowOnError extends boolean = false>(options?: Options<EventSubscribeData, ThrowOnError>) {
return (options?.client ?? this._client).get.sse<EventSubscribeResponses, unknown, ThrowOnError>({
url: "/event",
...options,
})
}
}
class Config extends _HeyApiClient {
/**
* Get config info
@@ -671,6 +659,18 @@ class Auth extends _HeyApiClient {
}
}
class Event extends _HeyApiClient {
/**
* Get events
*/
public subscribe<ThrowOnError extends boolean = false>(options?: Options<EventSubscribeData, ThrowOnError>) {
return (options?.client ?? this._client).sse.get<EventSubscribeResponses, unknown, ThrowOnError>({
url: "/event",
...options,
})
}
}
export class OpencodeClient extends _HeyApiClient {
/**
* Respond to a permission request
@@ -688,7 +688,6 @@ export class OpencodeClient extends _HeyApiClient {
})
}
project = new Project({ client: this._client })
event = new Event({ client: this._client })
config = new Config({ client: this._client })
tool = new Tool({ client: this._client })
path = new Path({ client: this._client })
@@ -699,4 +698,5 @@ export class OpencodeClient extends _HeyApiClient {
app = new App({ client: this._client })
tui = new Tui({ client: this._client })
auth = new Auth({ client: this._client })
event = new Event({ client: this._client })
}

View File

@@ -10,440 +10,6 @@ export type Project = {
}
}
export type EventInstallationUpdated = {
type: "installation.updated"
properties: {
version: string
}
}
export type EventLspClientDiagnostics = {
type: "lsp.client.diagnostics"
properties: {
serverID: string
path: string
}
}
export type UserMessage = {
id: string
sessionID: string
role: "user"
time: {
created: number
}
}
export type ProviderAuthError = {
name: "ProviderAuthError"
data: {
providerID: string
message: string
}
}
export type UnknownError = {
name: "UnknownError"
data: {
message: string
}
}
export type MessageOutputLengthError = {
name: "MessageOutputLengthError"
data: {
[key: string]: unknown
}
}
export type MessageAbortedError = {
name: "MessageAbortedError"
data: {
message: string
}
}
export type AssistantMessage = {
id: string
sessionID: string
role: "assistant"
time: {
created: number
completed?: number
}
error?: ProviderAuthError | UnknownError | MessageOutputLengthError | MessageAbortedError
system: Array<string>
modelID: string
providerID: string
mode: string
path: {
cwd: string
root: string
}
summary?: boolean
cost: number
tokens: {
input: number
output: number
reasoning: number
cache: {
read: number
write: number
}
}
}
export type Message = UserMessage | AssistantMessage
export type EventMessageUpdated = {
type: "message.updated"
properties: {
info: Message
}
}
export type EventMessageRemoved = {
type: "message.removed"
properties: {
sessionID: string
messageID: string
}
}
export type TextPart = {
id: string
sessionID: string
messageID: string
type: "text"
text: string
synthetic?: boolean
time?: {
start: number
end?: number
}
}
export type ReasoningPart = {
id: string
sessionID: string
messageID: string
type: "reasoning"
text: string
metadata?: {
[key: string]: unknown
}
time: {
start: number
end?: number
}
}
export type FilePartSourceText = {
value: string
start: number
end: number
}
export type FileSource = {
text: FilePartSourceText
type: "file"
path: string
}
export type Range = {
start: {
line: number
character: number
}
end: {
line: number
character: number
}
}
export type SymbolSource = {
text: FilePartSourceText
type: "symbol"
path: string
range: Range
name: string
kind: number
}
export type FilePartSource = FileSource | SymbolSource
export type FilePart = {
id: string
sessionID: string
messageID: string
type: "file"
mime: string
filename?: string
url: string
source?: FilePartSource
}
export type ToolStatePending = {
status: "pending"
}
export type ToolStateRunning = {
status: "running"
input: unknown
title?: string
metadata?: {
[key: string]: unknown
}
time: {
start: number
}
}
export type ToolStateCompleted = {
status: "completed"
input: {
[key: string]: unknown
}
output: string
title: string
metadata: {
[key: string]: unknown
}
time: {
start: number
end: number
compacted?: number
}
}
export type ToolStateError = {
status: "error"
input: {
[key: string]: unknown
}
error: string
metadata?: {
[key: string]: unknown
}
time: {
start: number
end: number
}
}
export type ToolState = ToolStatePending | ToolStateRunning | ToolStateCompleted | ToolStateError
export type ToolPart = {
id: string
sessionID: string
messageID: string
type: "tool"
callID: string
tool: string
state: ToolState
}
export type StepStartPart = {
id: string
sessionID: string
messageID: string
type: "step-start"
}
export type StepFinishPart = {
id: string
sessionID: string
messageID: string
type: "step-finish"
cost: number
tokens: {
input: number
output: number
reasoning: number
cache: {
read: number
write: number
}
}
}
export type SnapshotPart = {
id: string
sessionID: string
messageID: string
type: "snapshot"
snapshot: string
}
export type PatchPart = {
id: string
sessionID: string
messageID: string
type: "patch"
hash: string
files: Array<string>
}
export type AgentPart = {
id: string
sessionID: string
messageID: string
type: "agent"
name: string
source?: {
value: string
start: number
end: number
}
}
export type Part =
| TextPart
| ReasoningPart
| FilePart
| ToolPart
| StepStartPart
| StepFinishPart
| SnapshotPart
| PatchPart
| AgentPart
export type EventMessagePartUpdated = {
type: "message.part.updated"
properties: {
part: Part
}
}
export type EventMessagePartRemoved = {
type: "message.part.removed"
properties: {
sessionID: string
messageID: string
partID: string
}
}
export type EventSessionCompacted = {
type: "session.compacted"
properties: {
sessionID: string
}
}
export type Permission = {
id: string
type: string
pattern?: string | Array<string>
sessionID: string
messageID: string
callID?: string
title: string
metadata: {
[key: string]: unknown
}
time: {
created: number
}
}
export type EventPermissionUpdated = {
type: "permission.updated"
properties: Permission
}
export type EventPermissionReplied = {
type: "permission.replied"
properties: {
sessionID: string
permissionID: string
response: string
}
}
export type EventFileEdited = {
type: "file.edited"
properties: {
file: string
}
}
export type EventSessionIdle = {
type: "session.idle"
properties: {
sessionID: string
}
}
export type Session = {
id: string
projectID: string
directory: string
parentID?: string
share?: {
url: string
}
title: string
version: string
time: {
created: number
updated: number
compacting?: number
}
revert?: {
messageID: string
partID?: string
snapshot?: string
diff?: string
}
}
export type EventSessionUpdated = {
type: "session.updated"
properties: {
info: Session
}
}
export type EventSessionDeleted = {
type: "session.deleted"
properties: {
info: Session
}
}
export type EventSessionError = {
type: "session.error"
properties: {
sessionID?: string
error?: ProviderAuthError | UnknownError | MessageOutputLengthError | MessageAbortedError
}
}
export type EventServerConnected = {
type: "server.connected"
properties: {
[key: string]: unknown
}
}
export type Event =
| EventInstallationUpdated
| EventLspClientDiagnostics
| EventMessageUpdated
| EventMessageRemoved
| EventMessagePartUpdated
| EventMessagePartRemoved
| EventSessionCompacted
| EventPermissionUpdated
| EventPermissionReplied
| EventFileEdited
| EventSessionIdle
| EventSessionUpdated
| EventSessionDeleted
| EventSessionError
| EventServerConnected
/**
* Custom keybind configurations
*/
@@ -983,6 +549,297 @@ export type Path = {
directory: string
}
export type Session = {
id: string
projectID: string
directory: string
parentID?: string
share?: {
url: string
}
title: string
version: string
time: {
created: number
updated: number
compacting?: number
}
revert?: {
messageID: string
partID?: string
snapshot?: string
diff?: string
}
}
export type UserMessage = {
id: string
sessionID: string
role: "user"
time: {
created: number
}
}
export type ProviderAuthError = {
name: "ProviderAuthError"
data: {
providerID: string
message: string
}
}
export type UnknownError = {
name: "UnknownError"
data: {
message: string
}
}
export type MessageOutputLengthError = {
name: "MessageOutputLengthError"
data: {
[key: string]: unknown
}
}
export type MessageAbortedError = {
name: "MessageAbortedError"
data: {
message: string
}
}
export type AssistantMessage = {
id: string
sessionID: string
role: "assistant"
time: {
created: number
completed?: number
}
error?: ProviderAuthError | UnknownError | MessageOutputLengthError | MessageAbortedError
system: Array<string>
modelID: string
providerID: string
mode: string
path: {
cwd: string
root: string
}
summary?: boolean
cost: number
tokens: {
input: number
output: number
reasoning: number
cache: {
read: number
write: number
}
}
}
export type Message = UserMessage | AssistantMessage
export type TextPart = {
id: string
sessionID: string
messageID: string
type: "text"
text: string
synthetic?: boolean
time?: {
start: number
end?: number
}
}
export type ReasoningPart = {
id: string
sessionID: string
messageID: string
type: "reasoning"
text: string
metadata?: {
[key: string]: unknown
}
time: {
start: number
end?: number
}
}
export type FilePartSourceText = {
value: string
start: number
end: number
}
export type FileSource = {
text: FilePartSourceText
type: "file"
path: string
}
export type Range = {
start: {
line: number
character: number
}
end: {
line: number
character: number
}
}
export type SymbolSource = {
text: FilePartSourceText
type: "symbol"
path: string
range: Range
name: string
kind: number
}
export type FilePartSource = FileSource | SymbolSource
export type FilePart = {
id: string
sessionID: string
messageID: string
type: "file"
mime: string
filename?: string
url: string
source?: FilePartSource
}
export type ToolStatePending = {
status: "pending"
}
export type ToolStateRunning = {
status: "running"
input: unknown
title?: string
metadata?: {
[key: string]: unknown
}
time: {
start: number
}
}
export type ToolStateCompleted = {
status: "completed"
input: {
[key: string]: unknown
}
output: string
title: string
metadata: {
[key: string]: unknown
}
time: {
start: number
end: number
compacted?: number
}
}
export type ToolStateError = {
status: "error"
input: {
[key: string]: unknown
}
error: string
metadata?: {
[key: string]: unknown
}
time: {
start: number
end: number
}
}
export type ToolState = ToolStatePending | ToolStateRunning | ToolStateCompleted | ToolStateError
export type ToolPart = {
id: string
sessionID: string
messageID: string
type: "tool"
callID: string
tool: string
state: ToolState
}
export type StepStartPart = {
id: string
sessionID: string
messageID: string
type: "step-start"
}
export type StepFinishPart = {
id: string
sessionID: string
messageID: string
type: "step-finish"
cost: number
tokens: {
input: number
output: number
reasoning: number
cache: {
read: number
write: number
}
}
}
export type SnapshotPart = {
id: string
sessionID: string
messageID: string
type: "snapshot"
snapshot: string
}
export type PatchPart = {
id: string
sessionID: string
messageID: string
type: "patch"
hash: string
files: Array<string>
}
export type AgentPart = {
id: string
sessionID: string
messageID: string
type: "agent"
name: string
source?: {
value: string
start: number
end: number
}
}
export type Part =
| TextPart
| ReasoningPart
| FilePart
| ToolPart
| StepStartPart
| StepFinishPart
| SnapshotPart
| PatchPart
| AgentPart
export type TextPartInput = {
id?: string
type: "text"
@@ -1151,6 +1008,166 @@ export type WellKnownAuth = {
export type Auth = OAuth | ApiAuth | WellKnownAuth
export type EventInstallationUpdated = {
type: "installation.updated"
properties: {
version: string
}
}
export type EventLspClientDiagnostics = {
type: "lsp.client.diagnostics"
properties: {
serverID: string
path: string
}
}
export type EventMessageUpdated = {
type: "message.updated"
properties: {
info: Message
}
}
export type EventMessageRemoved = {
type: "message.removed"
properties: {
sessionID: string
messageID: string
}
}
export type EventMessagePartUpdated = {
type: "message.part.updated"
properties: {
part: Part
}
}
export type EventMessagePartRemoved = {
type: "message.part.removed"
properties: {
sessionID: string
messageID: string
partID: string
}
}
export type EventSessionCompacted = {
type: "session.compacted"
properties: {
sessionID: string
}
}
export type Permission = {
id: string
type: string
pattern?: string | Array<string>
sessionID: string
messageID: string
callID?: string
title: string
metadata: {
[key: string]: unknown
}
time: {
created: number
}
}
export type EventPermissionUpdated = {
type: "permission.updated"
properties: Permission
}
export type EventPermissionReplied = {
type: "permission.replied"
properties: {
sessionID: string
permissionID: string
response: string
}
}
export type EventFileEdited = {
type: "file.edited"
properties: {
file: string
}
}
export type EventSessionIdle = {
type: "session.idle"
properties: {
sessionID: string
}
}
export type EventSessionUpdated = {
type: "session.updated"
properties: {
info: Session
}
}
export type EventSessionDeleted = {
type: "session.deleted"
properties: {
info: Session
}
}
export type EventSessionError = {
type: "session.error"
properties: {
sessionID?: string
error?: ProviderAuthError | UnknownError | MessageOutputLengthError | MessageAbortedError
}
}
export type EventServerConnected = {
type: "server.connected"
properties: {
[key: string]: unknown
}
}
export type EventFileWatcherUpdated = {
type: "file.watcher.updated"
properties: {
file: string
event: "add" | "change" | "unlink"
}
}
export type EventIdeInstalled = {
type: "ide.installed"
properties: {
ide: string
}
}
export type Event =
| EventInstallationUpdated
| EventLspClientDiagnostics
| EventMessageUpdated
| EventMessageRemoved
| EventMessagePartUpdated
| EventMessagePartRemoved
| EventSessionCompacted
| EventPermissionUpdated
| EventPermissionReplied
| EventFileEdited
| EventSessionIdle
| EventSessionUpdated
| EventSessionDeleted
| EventSessionError
| EventServerConnected
| EventFileWatcherUpdated
| EventIdeInstalled
export type ProjectListData = {
body?: never
path?: never
@@ -1187,24 +1204,6 @@ export type ProjectCurrentResponses = {
export type ProjectCurrentResponse = ProjectCurrentResponses[keyof ProjectCurrentResponses]
export type EventSubscribeData = {
body?: never
path?: never
query?: {
directory?: string
}
url: "/event"
}
export type EventSubscribeResponses = {
/**
* Event stream
*/
200: Event
}
export type EventSubscribeResponse = EventSubscribeResponses[keyof EventSubscribeResponses]
export type ConfigGetData = {
body?: never
path?: never
@@ -2210,6 +2209,24 @@ export type AuthSetResponses = {
export type AuthSetResponse = AuthSetResponses[keyof AuthSetResponses]
export type EventSubscribeData = {
body?: never
path?: never
query?: {
directory?: string
}
url: "/event"
}
export type EventSubscribeResponses = {
/**
* Event stream
*/
200: Event
}
export type EventSubscribeResponse = EventSubscribeResponses[keyof EventSubscribeResponses]
export type ClientOptions = {
baseUrl: `${string}://${string}` | (string & {})
}