mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-20 01:04:22 +01:00
release: v0.15.23
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/package.json",
|
||||
"name": "@opencode-ai/sdk",
|
||||
"version": "0.15.20",
|
||||
"version": "0.15.23",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"typecheck": "tsgo --noEmit",
|
||||
@@ -26,4 +26,4 @@
|
||||
"publishConfig": {
|
||||
"directory": "dist"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,12 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import type { ClientOptions } from "./types.gen.js"
|
||||
import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from "./client/index.js"
|
||||
import {
|
||||
type Config,
|
||||
type ClientOptions as DefaultClientOptions,
|
||||
createClient,
|
||||
createConfig,
|
||||
} from "./client/index.js"
|
||||
|
||||
/**
|
||||
* The `createClientConfig()` function will be called on client initialization
|
||||
|
||||
@@ -107,7 +107,9 @@ export const createClient = (config: Config = {}): Client => {
|
||||
}
|
||||
|
||||
const parseAs =
|
||||
(opts.parseAs === "auto" ? getParseAs(response.headers.get("Content-Type")) : opts.parseAs) ?? "json"
|
||||
(opts.parseAs === "auto"
|
||||
? getParseAs(response.headers.get("Content-Type"))
|
||||
: opts.parseAs) ?? "json"
|
||||
|
||||
let data: any
|
||||
switch (parseAs) {
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import type { Auth } from "../core/auth.gen.js"
|
||||
import type { ServerSentEventsOptions, ServerSentEventsResult } from "../core/serverSentEvents.gen.js"
|
||||
import type {
|
||||
ServerSentEventsOptions,
|
||||
ServerSentEventsResult,
|
||||
} from "../core/serverSentEvents.gen.js"
|
||||
import type { Client as CoreClient, Config as CoreConfig } from "../core/types.gen.js"
|
||||
import type { Middleware } from "./utils.gen.js"
|
||||
|
||||
@@ -62,7 +65,11 @@ export interface RequestOptions<
|
||||
}>,
|
||||
Pick<
|
||||
ServerSentEventsOptions<TData>,
|
||||
"onSseError" | "onSseEvent" | "sseDefaultRetryDelay" | "sseMaxRetryAttempts" | "sseMaxRetryDelay"
|
||||
| "onSseError"
|
||||
| "onSseEvent"
|
||||
| "sseDefaultRetryDelay"
|
||||
| "sseMaxRetryAttempts"
|
||||
| "sseMaxRetryDelay"
|
||||
> {
|
||||
/**
|
||||
* Any body that you want to add to your request.
|
||||
@@ -202,7 +209,10 @@ export type Options<
|
||||
ThrowOnError extends boolean = boolean,
|
||||
TResponse = unknown,
|
||||
TResponseStyle extends ResponseStyle = "fields",
|
||||
> = OmitKeys<RequestOptions<TResponse, TResponseStyle, ThrowOnError>, "body" | "path" | "query" | "url"> &
|
||||
> = OmitKeys<
|
||||
RequestOptions<TResponse, TResponseStyle, ThrowOnError>,
|
||||
"body" | "path" | "query" | "url"
|
||||
> &
|
||||
Omit<TData, "url">
|
||||
|
||||
export type OptionsLegacyParser<
|
||||
@@ -211,7 +221,8 @@ export type OptionsLegacyParser<
|
||||
TResponseStyle extends ResponseStyle = "fields",
|
||||
> = TData extends { body?: any }
|
||||
? TData extends { headers?: any }
|
||||
? OmitKeys<RequestOptions<unknown, TResponseStyle, ThrowOnError>, "body" | "headers" | "url"> & TData
|
||||
? OmitKeys<RequestOptions<unknown, TResponseStyle, ThrowOnError>, "body" | "headers" | "url"> &
|
||||
TData
|
||||
: OmitKeys<RequestOptions<unknown, TResponseStyle, ThrowOnError>, "body" | "url"> &
|
||||
TData &
|
||||
Pick<RequestOptions<unknown, TResponseStyle, ThrowOnError>, "headers">
|
||||
|
||||
@@ -3,11 +3,19 @@
|
||||
import { getAuthToken } from "../core/auth.gen.js"
|
||||
import type { QuerySerializerOptions } from "../core/bodySerializer.gen.js"
|
||||
import { jsonBodySerializer } from "../core/bodySerializer.gen.js"
|
||||
import { serializeArrayParam, serializeObjectParam, serializePrimitiveParam } from "../core/pathSerializer.gen.js"
|
||||
import {
|
||||
serializeArrayParam,
|
||||
serializeObjectParam,
|
||||
serializePrimitiveParam,
|
||||
} from "../core/pathSerializer.gen.js"
|
||||
import { getUrl } from "../core/utils.gen.js"
|
||||
import type { Client, ClientOptions, Config, RequestOptions } from "./types.gen.js"
|
||||
|
||||
export const createQuerySerializer = <T = unknown>({ allowReserved, array, object }: QuerySerializerOptions = {}) => {
|
||||
export const createQuerySerializer = <T = unknown>({
|
||||
allowReserved,
|
||||
array,
|
||||
object,
|
||||
}: QuerySerializerOptions = {}) => {
|
||||
const querySerializer = (queryParams: T) => {
|
||||
const search: string[] = []
|
||||
if (queryParams && typeof queryParams === "object") {
|
||||
@@ -77,7 +85,9 @@ export const getParseAs = (contentType: string | null): Exclude<Config["parseAs"
|
||||
return "formData"
|
||||
}
|
||||
|
||||
if (["application/", "audio/", "image/", "video/"].some((type) => cleanContent.startsWith(type))) {
|
||||
if (
|
||||
["application/", "audio/", "image/", "video/"].some((type) => cleanContent.startsWith(type))
|
||||
) {
|
||||
return "blob"
|
||||
}
|
||||
|
||||
@@ -97,7 +107,11 @@ const checkForExistence = (
|
||||
if (!name) {
|
||||
return false
|
||||
}
|
||||
if (options.headers.has(name) || options.query?.[name] || options.headers.get("Cookie")?.includes(`${name}=`)) {
|
||||
if (
|
||||
options.headers.has(name) ||
|
||||
options.query?.[name] ||
|
||||
options.headers.get("Cookie")?.includes(`${name}=`)
|
||||
) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
@@ -162,7 +176,9 @@ export const mergeConfigs = (a: Config, b: Config): Config => {
|
||||
return config
|
||||
}
|
||||
|
||||
export const mergeHeaders = (...headers: Array<Required<Config>["headers"] | undefined>): Headers => {
|
||||
export const mergeHeaders = (
|
||||
...headers: Array<Required<Config>["headers"] | undefined>
|
||||
): Headers => {
|
||||
const mergedHeaders = new Headers()
|
||||
for (const header of headers) {
|
||||
if (!header || typeof header !== "object") {
|
||||
@@ -181,7 +197,10 @@ export const mergeHeaders = (...headers: Array<Required<Config>["headers"] | und
|
||||
} else if (value !== undefined) {
|
||||
// assume object headers are meant to be JSON stringified, i.e. their
|
||||
// content value in OpenAPI specification is 'application/json'
|
||||
mergedHeaders.set(key, typeof value === "object" ? JSON.stringify(value) : (value as string))
|
||||
mergedHeaders.set(
|
||||
key,
|
||||
typeof value === "object" ? JSON.stringify(value) : (value as string),
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -197,7 +216,11 @@ type ErrInterceptor<Err, Res, Req, Options> = (
|
||||
|
||||
type ReqInterceptor<Req, Options> = (request: Req, options: Options) => Req | Promise<Req>
|
||||
|
||||
type ResInterceptor<Res, Req, Options> = (response: Res, request: Req, options: Options) => Res | Promise<Res>
|
||||
type ResInterceptor<Res, Req, Options> = (
|
||||
response: Res,
|
||||
request: Req,
|
||||
options: Options,
|
||||
) => Res | Promise<Res>
|
||||
|
||||
class Interceptors<Interceptor> {
|
||||
_fns: (Interceptor | null)[]
|
||||
|
||||
@@ -31,7 +31,9 @@ const serializeUrlSearchParamsPair = (data: URLSearchParams, key: string, value:
|
||||
}
|
||||
|
||||
export const formDataBodySerializer = {
|
||||
bodySerializer: <T extends Record<string, any> | Array<Record<string, any>>>(body: T): FormData => {
|
||||
bodySerializer: <T extends Record<string, any> | Array<Record<string, any>>>(
|
||||
body: T,
|
||||
): FormData => {
|
||||
const data = new FormData()
|
||||
|
||||
Object.entries(body).forEach(([key, value]) => {
|
||||
|
||||
@@ -74,9 +74,9 @@ export const serializeArrayParam = ({
|
||||
value: unknown[]
|
||||
}) => {
|
||||
if (!explode) {
|
||||
const joinedValues = (allowReserved ? value : value.map((v) => encodeURIComponent(v as string))).join(
|
||||
separatorArrayNoExplode(style),
|
||||
)
|
||||
const joinedValues = (
|
||||
allowReserved ? value : value.map((v) => encodeURIComponent(v as string))
|
||||
).join(separatorArrayNoExplode(style))
|
||||
switch (style) {
|
||||
case "label":
|
||||
return `.${joinedValues}`
|
||||
@@ -106,7 +106,11 @@ export const serializeArrayParam = ({
|
||||
return style === "label" || style === "matrix" ? separator + joinedValues : joinedValues
|
||||
}
|
||||
|
||||
export const serializePrimitiveParam = ({ allowReserved, name, value }: SerializePrimitiveParam) => {
|
||||
export const serializePrimitiveParam = ({
|
||||
allowReserved,
|
||||
name,
|
||||
value,
|
||||
}: SerializePrimitiveParam) => {
|
||||
if (value === undefined || value === null) {
|
||||
return ""
|
||||
}
|
||||
|
||||
@@ -60,7 +60,11 @@ export interface StreamEvent<TData = unknown> {
|
||||
}
|
||||
|
||||
export type ServerSentEventsResult<TData = unknown, TReturn = void, TNext = unknown> = {
|
||||
stream: AsyncGenerator<TData extends Record<string, unknown> ? TData[keyof TData] : TData, TReturn, TNext>
|
||||
stream: AsyncGenerator<
|
||||
TData extends Record<string, unknown> ? TData[keyof TData] : TData,
|
||||
TReturn,
|
||||
TNext
|
||||
>
|
||||
}
|
||||
|
||||
export const createSseClient = <TData = unknown>({
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import type { Auth, AuthToken } from "./auth.gen.js"
|
||||
import type { BodySerializer, QuerySerializer, QuerySerializerOptions } from "./bodySerializer.gen.js"
|
||||
import type {
|
||||
BodySerializer,
|
||||
QuerySerializer,
|
||||
QuerySerializerOptions,
|
||||
} from "./bodySerializer.gen.js"
|
||||
|
||||
export interface Client<RequestFn = never, Config = unknown, MethodFn = never, BuildUrlFn = never> {
|
||||
/**
|
||||
@@ -41,7 +45,10 @@ export interface Config {
|
||||
*/
|
||||
headers?:
|
||||
| RequestInit["headers"]
|
||||
| Record<string, string | number | boolean | (string | number | boolean)[] | null | undefined | unknown>
|
||||
| Record<
|
||||
string,
|
||||
string | number | boolean | (string | number | boolean)[] | null | undefined | unknown
|
||||
>
|
||||
/**
|
||||
* The request method.
|
||||
*
|
||||
|
||||
@@ -73,7 +73,9 @@ export const defaultPathSerializer = ({ path, url: _url }: PathSerializer) => {
|
||||
continue
|
||||
}
|
||||
|
||||
const replaceValue = encodeURIComponent(style === "label" ? `.${value as string}` : (value as string))
|
||||
const replaceValue = encodeURIComponent(
|
||||
style === "label" ? `.${value as string}` : (value as string),
|
||||
)
|
||||
url = url.replace(match, replaceValue)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,10 +133,10 @@ import type {
|
||||
} from "./types.gen.js"
|
||||
import { client as _heyApiClient } from "./client.gen.js"
|
||||
|
||||
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = ClientOptions<
|
||||
TData,
|
||||
ThrowOnError
|
||||
> & {
|
||||
export type Options<
|
||||
TData extends TDataShape = TDataShape,
|
||||
ThrowOnError extends boolean = boolean,
|
||||
> = ClientOptions<TData, ThrowOnError> & {
|
||||
/**
|
||||
* You can provide a client instance returned by `createClient()` instead of
|
||||
* individual options. This might be also useful if you want to implement a
|
||||
@@ -164,7 +164,9 @@ class Project extends _HeyApiClient {
|
||||
/**
|
||||
* List all projects
|
||||
*/
|
||||
public list<ThrowOnError extends boolean = false>(options?: Options<ProjectListData, ThrowOnError>) {
|
||||
public list<ThrowOnError extends boolean = false>(
|
||||
options?: Options<ProjectListData, ThrowOnError>,
|
||||
) {
|
||||
return (options?.client ?? this._client).get<ProjectListResponses, unknown, ThrowOnError>({
|
||||
url: "/project",
|
||||
...options,
|
||||
@@ -174,7 +176,9 @@ class Project extends _HeyApiClient {
|
||||
/**
|
||||
* Get the current project
|
||||
*/
|
||||
public current<ThrowOnError extends boolean = false>(options?: Options<ProjectCurrentData, ThrowOnError>) {
|
||||
public current<ThrowOnError extends boolean = false>(
|
||||
options?: Options<ProjectCurrentData, ThrowOnError>,
|
||||
) {
|
||||
return (options?.client ?? this._client).get<ProjectCurrentResponses, unknown, ThrowOnError>({
|
||||
url: "/project/current",
|
||||
...options,
|
||||
@@ -196,8 +200,14 @@ class Config extends _HeyApiClient {
|
||||
/**
|
||||
* Update config
|
||||
*/
|
||||
public update<ThrowOnError extends boolean = false>(options?: Options<ConfigUpdateData, ThrowOnError>) {
|
||||
return (options?.client ?? this._client).patch<ConfigUpdateResponses, ConfigUpdateErrors, ThrowOnError>({
|
||||
public update<ThrowOnError extends boolean = false>(
|
||||
options?: Options<ConfigUpdateData, ThrowOnError>,
|
||||
) {
|
||||
return (options?.client ?? this._client).patch<
|
||||
ConfigUpdateResponses,
|
||||
ConfigUpdateErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/config",
|
||||
...options,
|
||||
headers: {
|
||||
@@ -210,7 +220,9 @@ class Config extends _HeyApiClient {
|
||||
/**
|
||||
* List all providers
|
||||
*/
|
||||
public providers<ThrowOnError extends boolean = false>(options?: Options<ConfigProvidersData, ThrowOnError>) {
|
||||
public providers<ThrowOnError extends boolean = false>(
|
||||
options?: Options<ConfigProvidersData, ThrowOnError>,
|
||||
) {
|
||||
return (options?.client ?? this._client).get<ConfigProvidersResponses, unknown, ThrowOnError>({
|
||||
url: "/config/providers",
|
||||
...options,
|
||||
@@ -256,7 +268,9 @@ class Session extends _HeyApiClient {
|
||||
/**
|
||||
* List all sessions
|
||||
*/
|
||||
public list<ThrowOnError extends boolean = false>(options?: Options<SessionListData, ThrowOnError>) {
|
||||
public list<ThrowOnError extends boolean = false>(
|
||||
options?: Options<SessionListData, ThrowOnError>,
|
||||
) {
|
||||
return (options?.client ?? this._client).get<SessionListResponses, unknown, ThrowOnError>({
|
||||
url: "/session",
|
||||
...options,
|
||||
@@ -266,8 +280,14 @@ class Session extends _HeyApiClient {
|
||||
/**
|
||||
* Create a new session
|
||||
*/
|
||||
public create<ThrowOnError extends boolean = false>(options?: Options<SessionCreateData, ThrowOnError>) {
|
||||
return (options?.client ?? this._client).post<SessionCreateResponses, SessionCreateErrors, ThrowOnError>({
|
||||
public create<ThrowOnError extends boolean = false>(
|
||||
options?: Options<SessionCreateData, ThrowOnError>,
|
||||
) {
|
||||
return (options?.client ?? this._client).post<
|
||||
SessionCreateResponses,
|
||||
SessionCreateErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/session",
|
||||
...options,
|
||||
headers: {
|
||||
@@ -280,8 +300,14 @@ class Session extends _HeyApiClient {
|
||||
/**
|
||||
* Delete a session and all its data
|
||||
*/
|
||||
public delete<ThrowOnError extends boolean = false>(options: Options<SessionDeleteData, ThrowOnError>) {
|
||||
return (options.client ?? this._client).delete<SessionDeleteResponses, SessionDeleteErrors, ThrowOnError>({
|
||||
public delete<ThrowOnError extends boolean = false>(
|
||||
options: Options<SessionDeleteData, ThrowOnError>,
|
||||
) {
|
||||
return (options.client ?? this._client).delete<
|
||||
SessionDeleteResponses,
|
||||
SessionDeleteErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/session/{id}",
|
||||
...options,
|
||||
})
|
||||
@@ -291,7 +317,11 @@ class Session extends _HeyApiClient {
|
||||
* Get session
|
||||
*/
|
||||
public get<ThrowOnError extends boolean = false>(options: Options<SessionGetData, ThrowOnError>) {
|
||||
return (options.client ?? this._client).get<SessionGetResponses, SessionGetErrors, ThrowOnError>({
|
||||
return (options.client ?? this._client).get<
|
||||
SessionGetResponses,
|
||||
SessionGetErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/session/{id}",
|
||||
...options,
|
||||
})
|
||||
@@ -300,8 +330,14 @@ class Session extends _HeyApiClient {
|
||||
/**
|
||||
* Update session properties
|
||||
*/
|
||||
public update<ThrowOnError extends boolean = false>(options: Options<SessionUpdateData, ThrowOnError>) {
|
||||
return (options.client ?? this._client).patch<SessionUpdateResponses, SessionUpdateErrors, ThrowOnError>({
|
||||
public update<ThrowOnError extends boolean = false>(
|
||||
options: Options<SessionUpdateData, ThrowOnError>,
|
||||
) {
|
||||
return (options.client ?? this._client).patch<
|
||||
SessionUpdateResponses,
|
||||
SessionUpdateErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/session/{id}",
|
||||
...options,
|
||||
headers: {
|
||||
@@ -314,8 +350,14 @@ class Session extends _HeyApiClient {
|
||||
/**
|
||||
* Get a session's children
|
||||
*/
|
||||
public children<ThrowOnError extends boolean = false>(options: Options<SessionChildrenData, ThrowOnError>) {
|
||||
return (options.client ?? this._client).get<SessionChildrenResponses, SessionChildrenErrors, ThrowOnError>({
|
||||
public children<ThrowOnError extends boolean = false>(
|
||||
options: Options<SessionChildrenData, ThrowOnError>,
|
||||
) {
|
||||
return (options.client ?? this._client).get<
|
||||
SessionChildrenResponses,
|
||||
SessionChildrenErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/session/{id}/children",
|
||||
...options,
|
||||
})
|
||||
@@ -324,8 +366,14 @@ class Session extends _HeyApiClient {
|
||||
/**
|
||||
* Get the todo list for a session
|
||||
*/
|
||||
public todo<ThrowOnError extends boolean = false>(options: Options<SessionTodoData, ThrowOnError>) {
|
||||
return (options.client ?? this._client).get<SessionTodoResponses, SessionTodoErrors, ThrowOnError>({
|
||||
public todo<ThrowOnError extends boolean = false>(
|
||||
options: Options<SessionTodoData, ThrowOnError>,
|
||||
) {
|
||||
return (options.client ?? this._client).get<
|
||||
SessionTodoResponses,
|
||||
SessionTodoErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/session/{id}/todo",
|
||||
...options,
|
||||
})
|
||||
@@ -334,8 +382,14 @@ class Session extends _HeyApiClient {
|
||||
/**
|
||||
* Analyze the app and create an AGENTS.md file
|
||||
*/
|
||||
public init<ThrowOnError extends boolean = false>(options: Options<SessionInitData, ThrowOnError>) {
|
||||
return (options.client ?? this._client).post<SessionInitResponses, SessionInitErrors, ThrowOnError>({
|
||||
public init<ThrowOnError extends boolean = false>(
|
||||
options: Options<SessionInitData, ThrowOnError>,
|
||||
) {
|
||||
return (options.client ?? this._client).post<
|
||||
SessionInitResponses,
|
||||
SessionInitErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/session/{id}/init",
|
||||
...options,
|
||||
headers: {
|
||||
@@ -348,7 +402,9 @@ class Session extends _HeyApiClient {
|
||||
/**
|
||||
* Fork an existing session at a specific message
|
||||
*/
|
||||
public fork<ThrowOnError extends boolean = false>(options: Options<SessionForkData, ThrowOnError>) {
|
||||
public fork<ThrowOnError extends boolean = false>(
|
||||
options: Options<SessionForkData, ThrowOnError>,
|
||||
) {
|
||||
return (options.client ?? this._client).post<SessionForkResponses, unknown, ThrowOnError>({
|
||||
url: "/session/{id}/fork",
|
||||
...options,
|
||||
@@ -362,8 +418,14 @@ class Session extends _HeyApiClient {
|
||||
/**
|
||||
* Abort a session
|
||||
*/
|
||||
public abort<ThrowOnError extends boolean = false>(options: Options<SessionAbortData, ThrowOnError>) {
|
||||
return (options.client ?? this._client).post<SessionAbortResponses, SessionAbortErrors, ThrowOnError>({
|
||||
public abort<ThrowOnError extends boolean = false>(
|
||||
options: Options<SessionAbortData, ThrowOnError>,
|
||||
) {
|
||||
return (options.client ?? this._client).post<
|
||||
SessionAbortResponses,
|
||||
SessionAbortErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/session/{id}/abort",
|
||||
...options,
|
||||
})
|
||||
@@ -372,8 +434,14 @@ class Session extends _HeyApiClient {
|
||||
/**
|
||||
* Unshare the session
|
||||
*/
|
||||
public unshare<ThrowOnError extends boolean = false>(options: Options<SessionUnshareData, ThrowOnError>) {
|
||||
return (options.client ?? this._client).delete<SessionUnshareResponses, SessionUnshareErrors, ThrowOnError>({
|
||||
public unshare<ThrowOnError extends boolean = false>(
|
||||
options: Options<SessionUnshareData, ThrowOnError>,
|
||||
) {
|
||||
return (options.client ?? this._client).delete<
|
||||
SessionUnshareResponses,
|
||||
SessionUnshareErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/session/{id}/share",
|
||||
...options,
|
||||
})
|
||||
@@ -382,8 +450,14 @@ class Session extends _HeyApiClient {
|
||||
/**
|
||||
* Share a session
|
||||
*/
|
||||
public share<ThrowOnError extends boolean = false>(options: Options<SessionShareData, ThrowOnError>) {
|
||||
return (options.client ?? this._client).post<SessionShareResponses, SessionShareErrors, ThrowOnError>({
|
||||
public share<ThrowOnError extends boolean = false>(
|
||||
options: Options<SessionShareData, ThrowOnError>,
|
||||
) {
|
||||
return (options.client ?? this._client).post<
|
||||
SessionShareResponses,
|
||||
SessionShareErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/session/{id}/share",
|
||||
...options,
|
||||
})
|
||||
@@ -392,7 +466,9 @@ class Session extends _HeyApiClient {
|
||||
/**
|
||||
* Get the diff that resulted from this user message
|
||||
*/
|
||||
public diff<ThrowOnError extends boolean = false>(options: Options<SessionDiffData, ThrowOnError>) {
|
||||
public diff<ThrowOnError extends boolean = false>(
|
||||
options: Options<SessionDiffData, ThrowOnError>,
|
||||
) {
|
||||
return (options.client ?? this._client).get<SessionDiffResponses, unknown, ThrowOnError>({
|
||||
url: "/session/{id}/diff",
|
||||
...options,
|
||||
@@ -402,8 +478,14 @@ class Session extends _HeyApiClient {
|
||||
/**
|
||||
* Summarize the session
|
||||
*/
|
||||
public summarize<ThrowOnError extends boolean = false>(options: Options<SessionSummarizeData, ThrowOnError>) {
|
||||
return (options.client ?? this._client).post<SessionSummarizeResponses, SessionSummarizeErrors, ThrowOnError>({
|
||||
public summarize<ThrowOnError extends boolean = false>(
|
||||
options: Options<SessionSummarizeData, ThrowOnError>,
|
||||
) {
|
||||
return (options.client ?? this._client).post<
|
||||
SessionSummarizeResponses,
|
||||
SessionSummarizeErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/session/{id}/summarize",
|
||||
...options,
|
||||
headers: {
|
||||
@@ -416,8 +498,14 @@ class Session extends _HeyApiClient {
|
||||
/**
|
||||
* List messages for a session
|
||||
*/
|
||||
public messages<ThrowOnError extends boolean = false>(options: Options<SessionMessagesData, ThrowOnError>) {
|
||||
return (options.client ?? this._client).get<SessionMessagesResponses, SessionMessagesErrors, ThrowOnError>({
|
||||
public messages<ThrowOnError extends boolean = false>(
|
||||
options: Options<SessionMessagesData, ThrowOnError>,
|
||||
) {
|
||||
return (options.client ?? this._client).get<
|
||||
SessionMessagesResponses,
|
||||
SessionMessagesErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/session/{id}/message",
|
||||
...options,
|
||||
})
|
||||
@@ -426,8 +514,14 @@ class Session extends _HeyApiClient {
|
||||
/**
|
||||
* Create and send a new message to a session
|
||||
*/
|
||||
public prompt<ThrowOnError extends boolean = false>(options: Options<SessionPromptData, ThrowOnError>) {
|
||||
return (options.client ?? this._client).post<SessionPromptResponses, SessionPromptErrors, ThrowOnError>({
|
||||
public prompt<ThrowOnError extends boolean = false>(
|
||||
options: Options<SessionPromptData, ThrowOnError>,
|
||||
) {
|
||||
return (options.client ?? this._client).post<
|
||||
SessionPromptResponses,
|
||||
SessionPromptErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/session/{id}/message",
|
||||
...options,
|
||||
headers: {
|
||||
@@ -440,8 +534,14 @@ class Session extends _HeyApiClient {
|
||||
/**
|
||||
* Get a message from a session
|
||||
*/
|
||||
public message<ThrowOnError extends boolean = false>(options: Options<SessionMessageData, ThrowOnError>) {
|
||||
return (options.client ?? this._client).get<SessionMessageResponses, SessionMessageErrors, ThrowOnError>({
|
||||
public message<ThrowOnError extends boolean = false>(
|
||||
options: Options<SessionMessageData, ThrowOnError>,
|
||||
) {
|
||||
return (options.client ?? this._client).get<
|
||||
SessionMessageResponses,
|
||||
SessionMessageErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/session/{id}/message/{messageID}",
|
||||
...options,
|
||||
})
|
||||
@@ -450,8 +550,14 @@ class Session extends _HeyApiClient {
|
||||
/**
|
||||
* Send a new command to a session
|
||||
*/
|
||||
public command<ThrowOnError extends boolean = false>(options: Options<SessionCommandData, ThrowOnError>) {
|
||||
return (options.client ?? this._client).post<SessionCommandResponses, SessionCommandErrors, ThrowOnError>({
|
||||
public command<ThrowOnError extends boolean = false>(
|
||||
options: Options<SessionCommandData, ThrowOnError>,
|
||||
) {
|
||||
return (options.client ?? this._client).post<
|
||||
SessionCommandResponses,
|
||||
SessionCommandErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/session/{id}/command",
|
||||
...options,
|
||||
headers: {
|
||||
@@ -464,8 +570,14 @@ class Session extends _HeyApiClient {
|
||||
/**
|
||||
* Run a shell command
|
||||
*/
|
||||
public shell<ThrowOnError extends boolean = false>(options: Options<SessionShellData, ThrowOnError>) {
|
||||
return (options.client ?? this._client).post<SessionShellResponses, SessionShellErrors, ThrowOnError>({
|
||||
public shell<ThrowOnError extends boolean = false>(
|
||||
options: Options<SessionShellData, ThrowOnError>,
|
||||
) {
|
||||
return (options.client ?? this._client).post<
|
||||
SessionShellResponses,
|
||||
SessionShellErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/session/{id}/shell",
|
||||
...options,
|
||||
headers: {
|
||||
@@ -478,8 +590,14 @@ class Session extends _HeyApiClient {
|
||||
/**
|
||||
* Revert a message
|
||||
*/
|
||||
public revert<ThrowOnError extends boolean = false>(options: Options<SessionRevertData, ThrowOnError>) {
|
||||
return (options.client ?? this._client).post<SessionRevertResponses, SessionRevertErrors, ThrowOnError>({
|
||||
public revert<ThrowOnError extends boolean = false>(
|
||||
options: Options<SessionRevertData, ThrowOnError>,
|
||||
) {
|
||||
return (options.client ?? this._client).post<
|
||||
SessionRevertResponses,
|
||||
SessionRevertErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/session/{id}/revert",
|
||||
...options,
|
||||
headers: {
|
||||
@@ -492,8 +610,14 @@ class Session extends _HeyApiClient {
|
||||
/**
|
||||
* Restore all reverted messages
|
||||
*/
|
||||
public unrevert<ThrowOnError extends boolean = false>(options: Options<SessionUnrevertData, ThrowOnError>) {
|
||||
return (options.client ?? this._client).post<SessionUnrevertResponses, SessionUnrevertErrors, ThrowOnError>({
|
||||
public unrevert<ThrowOnError extends boolean = false>(
|
||||
options: Options<SessionUnrevertData, ThrowOnError>,
|
||||
) {
|
||||
return (options.client ?? this._client).post<
|
||||
SessionUnrevertResponses,
|
||||
SessionUnrevertErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/session/{id}/unrevert",
|
||||
...options,
|
||||
})
|
||||
@@ -504,7 +628,9 @@ class Command extends _HeyApiClient {
|
||||
/**
|
||||
* List all commands
|
||||
*/
|
||||
public list<ThrowOnError extends boolean = false>(options?: Options<CommandListData, ThrowOnError>) {
|
||||
public list<ThrowOnError extends boolean = false>(
|
||||
options?: Options<CommandListData, ThrowOnError>,
|
||||
) {
|
||||
return (options?.client ?? this._client).get<CommandListResponses, unknown, ThrowOnError>({
|
||||
url: "/command",
|
||||
...options,
|
||||
@@ -526,7 +652,9 @@ class Find extends _HeyApiClient {
|
||||
/**
|
||||
* Find files
|
||||
*/
|
||||
public files<ThrowOnError extends boolean = false>(options: Options<FindFilesData, ThrowOnError>) {
|
||||
public files<ThrowOnError extends boolean = false>(
|
||||
options: Options<FindFilesData, ThrowOnError>,
|
||||
) {
|
||||
return (options.client ?? this._client).get<FindFilesResponses, unknown, ThrowOnError>({
|
||||
url: "/find/file",
|
||||
...options,
|
||||
@@ -536,7 +664,9 @@ class Find extends _HeyApiClient {
|
||||
/**
|
||||
* Find workspace symbols
|
||||
*/
|
||||
public symbols<ThrowOnError extends boolean = false>(options: Options<FindSymbolsData, ThrowOnError>) {
|
||||
public symbols<ThrowOnError extends boolean = false>(
|
||||
options: Options<FindSymbolsData, ThrowOnError>,
|
||||
) {
|
||||
return (options.client ?? this._client).get<FindSymbolsResponses, unknown, ThrowOnError>({
|
||||
url: "/find/symbol",
|
||||
...options,
|
||||
@@ -568,7 +698,9 @@ class File extends _HeyApiClient {
|
||||
/**
|
||||
* Get file status
|
||||
*/
|
||||
public status<ThrowOnError extends boolean = false>(options?: Options<FileStatusData, ThrowOnError>) {
|
||||
public status<ThrowOnError extends boolean = false>(
|
||||
options?: Options<FileStatusData, ThrowOnError>,
|
||||
) {
|
||||
return (options?.client ?? this._client).get<FileStatusResponses, unknown, ThrowOnError>({
|
||||
url: "/file/status",
|
||||
...options,
|
||||
@@ -594,7 +726,9 @@ class App extends _HeyApiClient {
|
||||
/**
|
||||
* List all agents
|
||||
*/
|
||||
public agents<ThrowOnError extends boolean = false>(options?: Options<AppAgentsData, ThrowOnError>) {
|
||||
public agents<ThrowOnError extends boolean = false>(
|
||||
options?: Options<AppAgentsData, ThrowOnError>,
|
||||
) {
|
||||
return (options?.client ?? this._client).get<AppAgentsResponses, unknown, ThrowOnError>({
|
||||
url: "/agent",
|
||||
...options,
|
||||
@@ -606,7 +740,9 @@ class Mcp extends _HeyApiClient {
|
||||
/**
|
||||
* Get MCP server status
|
||||
*/
|
||||
public status<ThrowOnError extends boolean = false>(options?: Options<McpStatusData, ThrowOnError>) {
|
||||
public status<ThrowOnError extends boolean = false>(
|
||||
options?: Options<McpStatusData, ThrowOnError>,
|
||||
) {
|
||||
return (options?.client ?? this._client).get<McpStatusResponses, unknown, ThrowOnError>({
|
||||
url: "/mcp",
|
||||
...options,
|
||||
@@ -618,8 +754,14 @@ class Tui extends _HeyApiClient {
|
||||
/**
|
||||
* Append prompt to the TUI
|
||||
*/
|
||||
public appendPrompt<ThrowOnError extends boolean = false>(options?: Options<TuiAppendPromptData, ThrowOnError>) {
|
||||
return (options?.client ?? this._client).post<TuiAppendPromptResponses, TuiAppendPromptErrors, ThrowOnError>({
|
||||
public appendPrompt<ThrowOnError extends boolean = false>(
|
||||
options?: Options<TuiAppendPromptData, ThrowOnError>,
|
||||
) {
|
||||
return (options?.client ?? this._client).post<
|
||||
TuiAppendPromptResponses,
|
||||
TuiAppendPromptErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/tui/append-prompt",
|
||||
...options,
|
||||
headers: {
|
||||
@@ -632,7 +774,9 @@ class Tui extends _HeyApiClient {
|
||||
/**
|
||||
* Open the help dialog
|
||||
*/
|
||||
public openHelp<ThrowOnError extends boolean = false>(options?: Options<TuiOpenHelpData, ThrowOnError>) {
|
||||
public openHelp<ThrowOnError extends boolean = false>(
|
||||
options?: Options<TuiOpenHelpData, ThrowOnError>,
|
||||
) {
|
||||
return (options?.client ?? this._client).post<TuiOpenHelpResponses, unknown, ThrowOnError>({
|
||||
url: "/tui/open-help",
|
||||
...options,
|
||||
@@ -642,7 +786,9 @@ class Tui extends _HeyApiClient {
|
||||
/**
|
||||
* Open the session dialog
|
||||
*/
|
||||
public openSessions<ThrowOnError extends boolean = false>(options?: Options<TuiOpenSessionsData, ThrowOnError>) {
|
||||
public openSessions<ThrowOnError extends boolean = false>(
|
||||
options?: Options<TuiOpenSessionsData, ThrowOnError>,
|
||||
) {
|
||||
return (options?.client ?? this._client).post<TuiOpenSessionsResponses, unknown, ThrowOnError>({
|
||||
url: "/tui/open-sessions",
|
||||
...options,
|
||||
@@ -652,7 +798,9 @@ class Tui extends _HeyApiClient {
|
||||
/**
|
||||
* Open the theme dialog
|
||||
*/
|
||||
public openThemes<ThrowOnError extends boolean = false>(options?: Options<TuiOpenThemesData, ThrowOnError>) {
|
||||
public openThemes<ThrowOnError extends boolean = false>(
|
||||
options?: Options<TuiOpenThemesData, ThrowOnError>,
|
||||
) {
|
||||
return (options?.client ?? this._client).post<TuiOpenThemesResponses, unknown, ThrowOnError>({
|
||||
url: "/tui/open-themes",
|
||||
...options,
|
||||
@@ -662,7 +810,9 @@ class Tui extends _HeyApiClient {
|
||||
/**
|
||||
* Open the model dialog
|
||||
*/
|
||||
public openModels<ThrowOnError extends boolean = false>(options?: Options<TuiOpenModelsData, ThrowOnError>) {
|
||||
public openModels<ThrowOnError extends boolean = false>(
|
||||
options?: Options<TuiOpenModelsData, ThrowOnError>,
|
||||
) {
|
||||
return (options?.client ?? this._client).post<TuiOpenModelsResponses, unknown, ThrowOnError>({
|
||||
url: "/tui/open-models",
|
||||
...options,
|
||||
@@ -672,7 +822,9 @@ class Tui extends _HeyApiClient {
|
||||
/**
|
||||
* Submit the prompt
|
||||
*/
|
||||
public submitPrompt<ThrowOnError extends boolean = false>(options?: Options<TuiSubmitPromptData, ThrowOnError>) {
|
||||
public submitPrompt<ThrowOnError extends boolean = false>(
|
||||
options?: Options<TuiSubmitPromptData, ThrowOnError>,
|
||||
) {
|
||||
return (options?.client ?? this._client).post<TuiSubmitPromptResponses, unknown, ThrowOnError>({
|
||||
url: "/tui/submit-prompt",
|
||||
...options,
|
||||
@@ -682,7 +834,9 @@ class Tui extends _HeyApiClient {
|
||||
/**
|
||||
* Clear the prompt
|
||||
*/
|
||||
public clearPrompt<ThrowOnError extends boolean = false>(options?: Options<TuiClearPromptData, ThrowOnError>) {
|
||||
public clearPrompt<ThrowOnError extends boolean = false>(
|
||||
options?: Options<TuiClearPromptData, ThrowOnError>,
|
||||
) {
|
||||
return (options?.client ?? this._client).post<TuiClearPromptResponses, unknown, ThrowOnError>({
|
||||
url: "/tui/clear-prompt",
|
||||
...options,
|
||||
@@ -692,8 +846,14 @@ class Tui extends _HeyApiClient {
|
||||
/**
|
||||
* Execute a TUI command (e.g. agent_cycle)
|
||||
*/
|
||||
public executeCommand<ThrowOnError extends boolean = false>(options?: Options<TuiExecuteCommandData, ThrowOnError>) {
|
||||
return (options?.client ?? this._client).post<TuiExecuteCommandResponses, TuiExecuteCommandErrors, ThrowOnError>({
|
||||
public executeCommand<ThrowOnError extends boolean = false>(
|
||||
options?: Options<TuiExecuteCommandData, ThrowOnError>,
|
||||
) {
|
||||
return (options?.client ?? this._client).post<
|
||||
TuiExecuteCommandResponses,
|
||||
TuiExecuteCommandErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/tui/execute-command",
|
||||
...options,
|
||||
headers: {
|
||||
@@ -706,7 +866,9 @@ class Tui extends _HeyApiClient {
|
||||
/**
|
||||
* Show a toast notification in the TUI
|
||||
*/
|
||||
public showToast<ThrowOnError extends boolean = false>(options?: Options<TuiShowToastData, ThrowOnError>) {
|
||||
public showToast<ThrowOnError extends boolean = false>(
|
||||
options?: Options<TuiShowToastData, ThrowOnError>,
|
||||
) {
|
||||
return (options?.client ?? this._client).post<TuiShowToastResponses, unknown, ThrowOnError>({
|
||||
url: "/tui/show-toast",
|
||||
...options,
|
||||
@@ -738,8 +900,14 @@ 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>({
|
||||
public subscribe<ThrowOnError extends boolean = false>(
|
||||
options?: Options<EventSubscribeData, ThrowOnError>,
|
||||
) {
|
||||
return (options?.client ?? this._client).get.sse<
|
||||
EventSubscribeResponses,
|
||||
unknown,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/event",
|
||||
...options,
|
||||
})
|
||||
|
||||
@@ -505,6 +505,10 @@ export type Config = {
|
||||
}
|
||||
}>
|
||||
}
|
||||
/**
|
||||
* Number of retries for chat completions on failure
|
||||
*/
|
||||
chatMaxRetries?: number
|
||||
disable_paste_summary?: boolean
|
||||
}
|
||||
}
|
||||
@@ -658,7 +662,12 @@ export type AssistantMessage = {
|
||||
created: number
|
||||
completed?: number
|
||||
}
|
||||
error?: ProviderAuthError | UnknownError | MessageOutputLengthError | MessageAbortedError | ApiError
|
||||
error?:
|
||||
| ProviderAuthError
|
||||
| UnknownError
|
||||
| MessageOutputLengthError
|
||||
| MessageAbortedError
|
||||
| ApiError
|
||||
system: Array<string>
|
||||
parentID: string
|
||||
modelID: string
|
||||
@@ -1222,7 +1231,12 @@ export type EventSessionError = {
|
||||
type: "session.error"
|
||||
properties: {
|
||||
sessionID?: string
|
||||
error?: ProviderAuthError | UnknownError | MessageOutputLengthError | MessageAbortedError | ApiError
|
||||
error?:
|
||||
| ProviderAuthError
|
||||
| UnknownError
|
||||
| MessageOutputLengthError
|
||||
| MessageAbortedError
|
||||
| ApiError
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user