From 48681ce0bbc2a36eedede7e7767457e36295844f Mon Sep 17 00:00:00 2001 From: Acbox Date: Wed, 11 Feb 2026 14:27:53 +0800 Subject: [PATCH] feat: add hey-api sdk generate --- mise.toml | 6 + openapi-ts.config.ts | 20 + package.json | 4 +- packages/sdk/README.md | 1 + packages/sdk/package.json | 13 + packages/sdk/src/@pinia/colada.gen.ts | 1818 +++++++ packages/sdk/src/client.gen.ts | 16 + packages/sdk/src/client/client.gen.ts | 288 + packages/sdk/src/client/index.ts | 25 + packages/sdk/src/client/types.gen.ts | 213 + packages/sdk/src/client/utils.gen.ts | 316 ++ packages/sdk/src/core/auth.gen.ts | 41 + packages/sdk/src/core/bodySerializer.gen.ts | 84 + packages/sdk/src/core/params.gen.ts | 169 + packages/sdk/src/core/pathSerializer.gen.ts | 171 + .../sdk/src/core/queryKeySerializer.gen.ts | 117 + packages/sdk/src/core/serverSentEvents.gen.ts | 243 + packages/sdk/src/core/types.gen.ts | 104 + packages/sdk/src/core/utils.gen.ts | 140 + packages/sdk/src/index.ts | 4 + packages/sdk/src/sdk.gen.ts | 1075 ++++ packages/sdk/src/types.gen.ts | 4838 +++++++++++++++++ packages/web/mise.toml | 16 +- packages/web/package.json | 1 + pnpm-lock.yaml | 278 +- 25 files changed, 9975 insertions(+), 26 deletions(-) create mode 100644 openapi-ts.config.ts create mode 100644 packages/sdk/README.md create mode 100644 packages/sdk/package.json create mode 100644 packages/sdk/src/@pinia/colada.gen.ts create mode 100644 packages/sdk/src/client.gen.ts create mode 100644 packages/sdk/src/client/client.gen.ts create mode 100644 packages/sdk/src/client/index.ts create mode 100644 packages/sdk/src/client/types.gen.ts create mode 100644 packages/sdk/src/client/utils.gen.ts create mode 100644 packages/sdk/src/core/auth.gen.ts create mode 100644 packages/sdk/src/core/bodySerializer.gen.ts create mode 100644 packages/sdk/src/core/params.gen.ts create mode 100644 packages/sdk/src/core/pathSerializer.gen.ts create mode 100644 packages/sdk/src/core/queryKeySerializer.gen.ts create mode 100644 packages/sdk/src/core/serverSentEvents.gen.ts create mode 100644 packages/sdk/src/core/types.gen.ts create mode 100644 packages/sdk/src/core/utils.gen.ts create mode 100644 packages/sdk/src/index.ts create mode 100644 packages/sdk/src/sdk.gen.ts create mode 100644 packages/sdk/src/types.gen.ts diff --git a/mise.toml b/mise.toml index 5d94ffcb..94b86c6f 100644 --- a/mise.toml +++ b/mise.toml @@ -46,6 +46,11 @@ run = "scripts/containerd-install.sh" description = "Generate Swagger documentation" run = "cd internal/handlers && go generate" +[tasks.sdk-generate] +description = "Generate SDK code" +run = "pnpm run generate-sdk" +depends = ["//:swagger-generate"] + [tasks.sqlc-generate] description = "Generate SQL code" run = "sqlc generate" @@ -88,6 +93,7 @@ run = "scripts/compile-mcp.sh" description = "Start development environment" depends = [ "//:swagger-generate", + "//:sdk-generate", "//agent:dev", "//cmd/agent:start", "//packages/web:dev", diff --git a/openapi-ts.config.ts b/openapi-ts.config.ts new file mode 100644 index 00000000..2f674795 --- /dev/null +++ b/openapi-ts.config.ts @@ -0,0 +1,20 @@ +import { defineConfig } from '@hey-api/openapi-ts'; + +export default defineConfig({ + input: './docs/swagger.json', + output: 'packages/sdk/src', + plugins: [ + '@hey-api/typescript', + { + name: '@hey-api/transformers', + dates: true, + bigInt: true, + }, + { + name: '@hey-api/sdk', + transformer: true + }, + '@hey-api/client-fetch', + '@pinia/colada', + ] +}); \ No newline at end of file diff --git a/package.json b/package.json index 52c506a0..bb2a4ca4 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "agent:dev": "pnpm --filter @memoh/agent-gateway dev", "agent:build": "pnpm --filter @memoh/agent-gateway build", "agent:start": "pnpm --filter @memoh/agent-gateway start", + "generate-sdk": "openapi-ts", "lint": "eslint .", "lint:fix": "eslint . --fix", "test": "vitest" @@ -20,6 +21,7 @@ "author": "", "license": "ISC", "devDependencies": { + "@hey-api/openapi-ts": "0.92.3", "@types/node": "^25.0.3", "eslint": "^9.39.2", "eslint-plugin-vue": "^10.6.2", @@ -38,5 +40,5 @@ "@algolia/client-search" ] } - } + } } diff --git a/packages/sdk/README.md b/packages/sdk/README.md new file mode 100644 index 00000000..3230f848 --- /dev/null +++ b/packages/sdk/README.md @@ -0,0 +1 @@ +# @memoh/sdk diff --git a/packages/sdk/package.json b/packages/sdk/package.json new file mode 100644 index 00000000..e7a617bf --- /dev/null +++ b/packages/sdk/package.json @@ -0,0 +1,13 @@ +{ + "name": "@memoh/sdk", + "version": "1.0.0", + "description": "", + "exports": { + ".": "./src/index.ts" + }, + "main": "index.js", + "scripts": { + + }, + "packageManager": "pnpm@10.27.0" +} diff --git a/packages/sdk/src/@pinia/colada.gen.ts b/packages/sdk/src/@pinia/colada.gen.ts new file mode 100644 index 00000000..c5d89102 --- /dev/null +++ b/packages/sdk/src/@pinia/colada.gen.ts @@ -0,0 +1,1818 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type _JSONValue, defineQueryOptions, type UseMutationOptions } from '@pinia/colada'; + +import { serializeQueryKeyValue } from '../client'; +import { client } from '../client.gen'; +import { deleteBotsByBotIdContainer, deleteBotsByBotIdContainerFs, deleteBotsByBotIdContainerSkills, deleteBotsByBotIdHistory, deleteBotsByBotIdHistoryById, deleteBotsByBotIdMcpById, deleteBotsByBotIdMemoryMemories, deleteBotsByBotIdMemoryMemoriesByMemoryId, deleteBotsByBotIdScheduleById, deleteBotsByBotIdSettings, deleteBotsByBotIdSubagentsById, deleteBotsById, deleteBotsByIdMembersByUserId, deleteModelsById, deleteModelsModelByModelId, deleteProvidersById, getBots, getBotsByBotIdContainer, getBotsByBotIdContainerFs, getBotsByBotIdContainerFsFile, getBotsByBotIdContainerFsStat, getBotsByBotIdContainerFsUsage, getBotsByBotIdContainerSkills, getBotsByBotIdContainerSnapshots, getBotsByBotIdHistory, getBotsByBotIdHistoryById, getBotsByBotIdMcp, getBotsByBotIdMcpById, getBotsByBotIdMemoryMemories, getBotsByBotIdMemoryMemoriesByMemoryId, getBotsByBotIdSchedule, getBotsByBotIdScheduleById, getBotsByBotIdSettings, getBotsByBotIdSubagents, getBotsByBotIdSubagentsById, getBotsByBotIdSubagentsByIdContext, getBotsByBotIdSubagentsByIdSkills, getBotsById, getBotsByIdChannelByPlatform, getBotsByIdMembers, getChannels, getChannelsByPlatform, getModels, getModelsById, getModelsCount, getModelsModelByModelId, getProviders, getProvidersById, getProvidersByIdModels, getProvidersCount, getProvidersNameByName, getUsers, getUsersById, getUsersMe, getUsersMeChannelsByPlatform, type Options, postAuthLogin, postBots, postBotsByBotIdChat, postBotsByBotIdChatStream, postBotsByBotIdContainer, postBotsByBotIdContainerFsDir, postBotsByBotIdContainerFsFile, postBotsByBotIdContainerFsMcp, postBotsByBotIdContainerFsUpload, postBotsByBotIdContainerSkills, postBotsByBotIdContainerSnapshots, postBotsByBotIdContainerStart, postBotsByBotIdContainerStop, postBotsByBotIdHistory, postBotsByBotIdMcp, postBotsByBotIdMcpStdio, postBotsByBotIdMcpStdioBySessionId, postBotsByBotIdMemoryAdd, postBotsByBotIdMemoryEmbed, postBotsByBotIdMemorySearch, postBotsByBotIdMemoryUpdate, postBotsByBotIdSchedule, postBotsByBotIdSettings, postBotsByBotIdSubagents, postBotsByBotIdSubagentsByIdSkills, postBotsByIdChannelByPlatformSend, postBotsByIdChannelByPlatformSendSession, postEmbeddings, postModels, postModelsEnable, postProviders, postUsers, putBotsByBotIdMcpById, putBotsByBotIdScheduleById, putBotsByBotIdSettings, putBotsByBotIdSubagentsById, putBotsByBotIdSubagentsByIdContext, putBotsByBotIdSubagentsByIdSkills, putBotsById, putBotsByIdChannelByPlatform, putBotsByIdMembers, putBotsByIdOwner, putModelsById, putModelsModelByModelId, putProvidersById, putUsersById, putUsersByIdPassword, putUsersMe, putUsersMeChannelsByPlatform, putUsersMePassword } from '../sdk.gen'; +import type { DeleteBotsByBotIdContainerData, DeleteBotsByBotIdContainerError, DeleteBotsByBotIdContainerFsData, DeleteBotsByBotIdContainerFsError, DeleteBotsByBotIdContainerFsResponse, DeleteBotsByBotIdContainerSkillsData, DeleteBotsByBotIdContainerSkillsError, DeleteBotsByBotIdContainerSkillsResponse, DeleteBotsByBotIdHistoryByIdData, DeleteBotsByBotIdHistoryByIdError, DeleteBotsByBotIdHistoryData, DeleteBotsByBotIdHistoryError, DeleteBotsByBotIdMcpByIdData, DeleteBotsByBotIdMcpByIdError, DeleteBotsByBotIdMemoryMemoriesByMemoryIdData, DeleteBotsByBotIdMemoryMemoriesByMemoryIdError, DeleteBotsByBotIdMemoryMemoriesByMemoryIdResponse, DeleteBotsByBotIdMemoryMemoriesData, DeleteBotsByBotIdMemoryMemoriesError, DeleteBotsByBotIdMemoryMemoriesResponse, DeleteBotsByBotIdScheduleByIdData, DeleteBotsByBotIdScheduleByIdError, DeleteBotsByBotIdSettingsData, DeleteBotsByBotIdSettingsError, DeleteBotsByBotIdSubagentsByIdData, DeleteBotsByBotIdSubagentsByIdError, DeleteBotsByIdData, DeleteBotsByIdError, DeleteBotsByIdMembersByUserIdData, DeleteBotsByIdMembersByUserIdError, DeleteModelsByIdData, DeleteModelsByIdError, DeleteModelsModelByModelIdData, DeleteModelsModelByModelIdError, DeleteProvidersByIdData, DeleteProvidersByIdError, GetBotsByBotIdContainerData, GetBotsByBotIdContainerFsData, GetBotsByBotIdContainerFsFileData, GetBotsByBotIdContainerFsStatData, GetBotsByBotIdContainerFsUsageData, GetBotsByBotIdContainerSkillsData, GetBotsByBotIdContainerSnapshotsData, GetBotsByBotIdHistoryByIdData, GetBotsByBotIdHistoryData, GetBotsByBotIdMcpByIdData, GetBotsByBotIdMcpData, GetBotsByBotIdMemoryMemoriesByMemoryIdData, GetBotsByBotIdMemoryMemoriesData, GetBotsByBotIdScheduleByIdData, GetBotsByBotIdScheduleData, GetBotsByBotIdSettingsData, GetBotsByBotIdSubagentsByIdContextData, GetBotsByBotIdSubagentsByIdData, GetBotsByBotIdSubagentsByIdSkillsData, GetBotsByBotIdSubagentsData, GetBotsByIdChannelByPlatformData, GetBotsByIdData, GetBotsByIdMembersData, GetBotsData, GetChannelsByPlatformData, GetChannelsData, GetModelsByIdData, GetModelsCountData, GetModelsData, GetModelsModelByModelIdData, GetProvidersByIdData, GetProvidersByIdModelsData, GetProvidersCountData, GetProvidersData, GetProvidersNameByNameData, GetUsersByIdData, GetUsersData, GetUsersMeChannelsByPlatformData, GetUsersMeData, PostAuthLoginData, PostAuthLoginError, PostAuthLoginResponse, PostBotsByBotIdChatData, PostBotsByBotIdChatError, PostBotsByBotIdChatResponse, PostBotsByBotIdChatStreamData, PostBotsByBotIdChatStreamError, PostBotsByBotIdChatStreamResponse, PostBotsByBotIdContainerData, PostBotsByBotIdContainerError, PostBotsByBotIdContainerFsDirData, PostBotsByBotIdContainerFsDirError, PostBotsByBotIdContainerFsDirResponse, PostBotsByBotIdContainerFsFileData, PostBotsByBotIdContainerFsFileError, PostBotsByBotIdContainerFsFileResponse, PostBotsByBotIdContainerFsMcpData, PostBotsByBotIdContainerFsMcpError, PostBotsByBotIdContainerFsMcpResponse, PostBotsByBotIdContainerFsUploadData, PostBotsByBotIdContainerFsUploadError, PostBotsByBotIdContainerFsUploadResponse, PostBotsByBotIdContainerResponse, PostBotsByBotIdContainerSkillsData, PostBotsByBotIdContainerSkillsError, PostBotsByBotIdContainerSkillsResponse, PostBotsByBotIdContainerSnapshotsData, PostBotsByBotIdContainerSnapshotsError, PostBotsByBotIdContainerSnapshotsResponse, PostBotsByBotIdContainerStartData, PostBotsByBotIdContainerStartError, PostBotsByBotIdContainerStartResponse, PostBotsByBotIdContainerStopData, PostBotsByBotIdContainerStopError, PostBotsByBotIdContainerStopResponse, PostBotsByBotIdHistoryData, PostBotsByBotIdHistoryError, PostBotsByBotIdHistoryResponse, PostBotsByBotIdMcpData, PostBotsByBotIdMcpError, PostBotsByBotIdMcpResponse, PostBotsByBotIdMcpStdioBySessionIdData, PostBotsByBotIdMcpStdioBySessionIdError, PostBotsByBotIdMcpStdioBySessionIdResponse, PostBotsByBotIdMcpStdioData, PostBotsByBotIdMcpStdioError, PostBotsByBotIdMcpStdioResponse, PostBotsByBotIdMemoryAddData, PostBotsByBotIdMemoryAddError, PostBotsByBotIdMemoryAddResponse, PostBotsByBotIdMemoryEmbedData, PostBotsByBotIdMemoryEmbedError, PostBotsByBotIdMemoryEmbedResponse, PostBotsByBotIdMemorySearchData, PostBotsByBotIdMemorySearchError, PostBotsByBotIdMemorySearchResponse, PostBotsByBotIdMemoryUpdateData, PostBotsByBotIdMemoryUpdateError, PostBotsByBotIdMemoryUpdateResponse, PostBotsByBotIdScheduleData, PostBotsByBotIdScheduleError, PostBotsByBotIdScheduleResponse, PostBotsByBotIdSettingsData, PostBotsByBotIdSettingsError, PostBotsByBotIdSettingsResponse, PostBotsByBotIdSubagentsByIdSkillsData, PostBotsByBotIdSubagentsByIdSkillsError, PostBotsByBotIdSubagentsByIdSkillsResponse, PostBotsByBotIdSubagentsData, PostBotsByBotIdSubagentsError, PostBotsByBotIdSubagentsResponse, PostBotsByIdChannelByPlatformSendData, PostBotsByIdChannelByPlatformSendError, PostBotsByIdChannelByPlatformSendResponse, PostBotsByIdChannelByPlatformSendSessionData, PostBotsByIdChannelByPlatformSendSessionError, PostBotsByIdChannelByPlatformSendSessionResponse, PostBotsData, PostBotsError, PostBotsResponse, PostEmbeddingsData, PostEmbeddingsError, PostEmbeddingsResponse, PostModelsData, PostModelsEnableData, PostModelsEnableError, PostModelsEnableResponse, PostModelsError, PostModelsResponse, PostProvidersData, PostProvidersError, PostProvidersResponse, PostUsersData, PostUsersError, PostUsersResponse, PutBotsByBotIdMcpByIdData, PutBotsByBotIdMcpByIdError, PutBotsByBotIdMcpByIdResponse, PutBotsByBotIdScheduleByIdData, PutBotsByBotIdScheduleByIdError, PutBotsByBotIdScheduleByIdResponse, PutBotsByBotIdSettingsData, PutBotsByBotIdSettingsError, PutBotsByBotIdSettingsResponse, PutBotsByBotIdSubagentsByIdContextData, PutBotsByBotIdSubagentsByIdContextError, PutBotsByBotIdSubagentsByIdContextResponse, PutBotsByBotIdSubagentsByIdData, PutBotsByBotIdSubagentsByIdError, PutBotsByBotIdSubagentsByIdResponse, PutBotsByBotIdSubagentsByIdSkillsData, PutBotsByBotIdSubagentsByIdSkillsError, PutBotsByBotIdSubagentsByIdSkillsResponse, PutBotsByIdChannelByPlatformData, PutBotsByIdChannelByPlatformError, PutBotsByIdChannelByPlatformResponse, PutBotsByIdData, PutBotsByIdError, PutBotsByIdMembersData, PutBotsByIdMembersError, PutBotsByIdMembersResponse, PutBotsByIdOwnerData, PutBotsByIdOwnerError, PutBotsByIdOwnerResponse, PutBotsByIdResponse, PutModelsByIdData, PutModelsByIdError, PutModelsByIdResponse, PutModelsModelByModelIdData, PutModelsModelByModelIdError, PutModelsModelByModelIdResponse, PutProvidersByIdData, PutProvidersByIdError, PutProvidersByIdResponse, PutUsersByIdData, PutUsersByIdError, PutUsersByIdPasswordData, PutUsersByIdPasswordError, PutUsersByIdResponse, PutUsersMeChannelsByPlatformData, PutUsersMeChannelsByPlatformError, PutUsersMeChannelsByPlatformResponse, PutUsersMeData, PutUsersMeError, PutUsersMePasswordData, PutUsersMePasswordError, PutUsersMeResponse } from '../types.gen'; + +/** + * Login + * + * Validate user credentials and issue a JWT + */ +export const postAuthLoginMutation = (options?: Partial>): UseMutationOptions, PostAuthLoginError> => ({ + mutation: async (vars) => { + const { data } = await postAuthLogin({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +export type QueryKey = [ + Pick & { + _id: string; + baseUrl?: _JSONValue; + body?: _JSONValue; + query?: _JSONValue; + tags?: _JSONValue; + } +]; + +const createQueryKey = (id: string, options?: TOptions, tags?: ReadonlyArray): [ + QueryKey[0] +] => { + const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; + if (tags) { + params.tags = tags as unknown as _JSONValue; + } + if (options?.body !== undefined) { + const normalizedBody = serializeQueryKeyValue(options.body); + if (normalizedBody !== undefined) { + params.body = normalizedBody; + } + } + if (options?.path) { + params.path = options.path; + } + if (options?.query !== undefined) { + const normalizedQuery = serializeQueryKeyValue(options.query); + if (normalizedQuery !== undefined) { + params.query = normalizedQuery; + } + } + return [params]; +}; + +export const getBotsQueryKey = (options?: Options) => createQueryKey('getBots', options); + +/** + * List bots + * + * List bots accessible to current user (admin can specify owner_id) + */ +export const getBotsQuery = defineQueryOptions((options?: Options) => ({ + key: getBotsQueryKey(options), + query: async (context) => { + const { data } = await getBots({ + ...options, + ...context, + throwOnError: true + }); + return data; + } +})); + +/** + * Create bot user + * + * Create a bot user owned by current user (or admin-specified owner) + */ +export const postBotsMutation = (options?: Partial>): UseMutationOptions, PostBotsError> => ({ + mutation: async (vars) => { + const { data } = await postBots({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +/** + * Chat with AI + * + * Send a chat message and get a response. The system will automatically select an appropriate chat model from the database. + */ +export const postBotsByBotIdChatMutation = (options?: Partial>): UseMutationOptions, PostBotsByBotIdChatError> => ({ + mutation: async (vars) => { + const { data } = await postBotsByBotIdChat({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +/** + * Stream chat with AI + * + * Send a chat message and get a streaming response. The system will automatically select an appropriate chat model from the database. + */ +export const postBotsByBotIdChatStreamMutation = (options?: Partial>): UseMutationOptions, PostBotsByBotIdChatStreamError> => ({ + mutation: async (vars) => { + const { data } = await postBotsByBotIdChatStream({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +/** + * Delete MCP container for bot + */ +export const deleteBotsByBotIdContainerMutation = (options?: Partial>): UseMutationOptions, DeleteBotsByBotIdContainerError> => ({ + mutation: async (vars) => { + const { data } = await deleteBotsByBotIdContainer({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +export const getBotsByBotIdContainerQueryKey = (options: Options) => createQueryKey('getBotsByBotIdContainer', options); + +/** + * Get container info for bot + */ +export const getBotsByBotIdContainerQuery = defineQueryOptions((options: Options) => ({ + key: getBotsByBotIdContainerQueryKey(options), + query: async (context) => { + const { data } = await getBotsByBotIdContainer({ + ...options, + ...context, + throwOnError: true + }); + return data; + } +})); + +/** + * Create and start MCP container for bot + */ +export const postBotsByBotIdContainerMutation = (options?: Partial>): UseMutationOptions, PostBotsByBotIdContainerError> => ({ + mutation: async (vars) => { + const { data } = await postBotsByBotIdContainer({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +/** + * Delete a file or directory + */ +export const deleteBotsByBotIdContainerFsMutation = (options?: Partial>): UseMutationOptions, DeleteBotsByBotIdContainerFsError> => ({ + mutation: async (vars) => { + const { data } = await deleteBotsByBotIdContainerFs({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +export const getBotsByBotIdContainerFsQueryKey = (options: Options) => createQueryKey('getBotsByBotIdContainerFs', options); + +/** + * List files for a bot + * + * List entries under a relative path + */ +export const getBotsByBotIdContainerFsQuery = defineQueryOptions((options: Options) => ({ + key: getBotsByBotIdContainerFsQueryKey(options), + query: async (context) => { + const { data } = await getBotsByBotIdContainerFs({ + ...options, + ...context, + throwOnError: true + }); + return data; + } +})); + +/** + * MCP filesystem tools (JSON-RPC) + * + * Forwards MCP JSON-RPC requests to the MCP server inside the container. + * Required: + * - container task is running + * - container has data mount (default /data) bound to /users/ + * - container image contains the "mcp" binary + * Auth: Bearer JWT is used to determine user_id (sub or user_id). + * Paths must be relative (no leading slash) and must not contain "..". + * + * Example: tools/list + * {"jsonrpc":"2.0","id":1,"method":"tools/list"} + * + * Example: tools/call (fs.read) + * {"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"fs.read","arguments":{"path":"notes.txt"}}} + */ +export const postBotsByBotIdContainerFsMcpMutation = (options?: Partial>): UseMutationOptions, PostBotsByBotIdContainerFsMcpError> => ({ + mutation: async (vars) => { + const { data } = await postBotsByBotIdContainerFsMcp({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +/** + * Create a directory + */ +export const postBotsByBotIdContainerFsDirMutation = (options?: Partial>): UseMutationOptions, PostBotsByBotIdContainerFsDirError> => ({ + mutation: async (vars) => { + const { data } = await postBotsByBotIdContainerFsDir({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +export const getBotsByBotIdContainerFsFileQueryKey = (options: Options) => createQueryKey('getBotsByBotIdContainerFsFile', options); + +/** + * Read file content + */ +export const getBotsByBotIdContainerFsFileQuery = defineQueryOptions((options: Options) => ({ + key: getBotsByBotIdContainerFsFileQueryKey(options), + query: async (context) => { + const { data } = await getBotsByBotIdContainerFsFile({ + ...options, + ...context, + throwOnError: true + }); + return data; + } +})); + +/** + * Create or overwrite a file + */ +export const postBotsByBotIdContainerFsFileMutation = (options?: Partial>): UseMutationOptions, PostBotsByBotIdContainerFsFileError> => ({ + mutation: async (vars) => { + const { data } = await postBotsByBotIdContainerFsFile({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +export const getBotsByBotIdContainerFsStatQueryKey = (options: Options) => createQueryKey('getBotsByBotIdContainerFsStat', options); + +/** + * Get file or directory metadata + */ +export const getBotsByBotIdContainerFsStatQuery = defineQueryOptions((options: Options) => ({ + key: getBotsByBotIdContainerFsStatQueryKey(options), + query: async (context) => { + const { data } = await getBotsByBotIdContainerFsStat({ + ...options, + ...context, + throwOnError: true + }); + return data; + } +})); + +/** + * Upload a file + */ +export const postBotsByBotIdContainerFsUploadMutation = (options?: Partial>): UseMutationOptions, PostBotsByBotIdContainerFsUploadError> => ({ + mutation: async (vars) => { + const { data } = await postBotsByBotIdContainerFsUpload({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +export const getBotsByBotIdContainerFsUsageQueryKey = (options: Options) => createQueryKey('getBotsByBotIdContainerFsUsage', options); + +/** + * Get usage under a path + */ +export const getBotsByBotIdContainerFsUsageQuery = defineQueryOptions((options: Options) => ({ + key: getBotsByBotIdContainerFsUsageQueryKey(options), + query: async (context) => { + const { data } = await getBotsByBotIdContainerFsUsage({ + ...options, + ...context, + throwOnError: true + }); + return data; + } +})); + +/** + * Delete skills from data directory + */ +export const deleteBotsByBotIdContainerSkillsMutation = (options?: Partial>): UseMutationOptions, DeleteBotsByBotIdContainerSkillsError> => ({ + mutation: async (vars) => { + const { data } = await deleteBotsByBotIdContainerSkills({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +export const getBotsByBotIdContainerSkillsQueryKey = (options: Options) => createQueryKey('getBotsByBotIdContainerSkills', options); + +/** + * List skills from data directory + */ +export const getBotsByBotIdContainerSkillsQuery = defineQueryOptions((options: Options) => ({ + key: getBotsByBotIdContainerSkillsQueryKey(options), + query: async (context) => { + const { data } = await getBotsByBotIdContainerSkills({ + ...options, + ...context, + throwOnError: true + }); + return data; + } +})); + +/** + * Upload skills into data directory + */ +export const postBotsByBotIdContainerSkillsMutation = (options?: Partial>): UseMutationOptions, PostBotsByBotIdContainerSkillsError> => ({ + mutation: async (vars) => { + const { data } = await postBotsByBotIdContainerSkills({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +export const getBotsByBotIdContainerSnapshotsQueryKey = (options: Options) => createQueryKey('getBotsByBotIdContainerSnapshots', options); + +/** + * List snapshots + */ +export const getBotsByBotIdContainerSnapshotsQuery = defineQueryOptions((options: Options) => ({ + key: getBotsByBotIdContainerSnapshotsQueryKey(options), + query: async (context) => { + const { data } = await getBotsByBotIdContainerSnapshots({ + ...options, + ...context, + throwOnError: true + }); + return data; + } +})); + +/** + * Create container snapshot for bot + */ +export const postBotsByBotIdContainerSnapshotsMutation = (options?: Partial>): UseMutationOptions, PostBotsByBotIdContainerSnapshotsError> => ({ + mutation: async (vars) => { + const { data } = await postBotsByBotIdContainerSnapshots({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +/** + * Start container task for bot + */ +export const postBotsByBotIdContainerStartMutation = (options?: Partial>): UseMutationOptions, PostBotsByBotIdContainerStartError> => ({ + mutation: async (vars) => { + const { data } = await postBotsByBotIdContainerStart({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +/** + * Stop container task for bot + */ +export const postBotsByBotIdContainerStopMutation = (options?: Partial>): UseMutationOptions, PostBotsByBotIdContainerStopError> => ({ + mutation: async (vars) => { + const { data } = await postBotsByBotIdContainerStop({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +/** + * Delete all history records + * + * Delete all history records for current user + */ +export const deleteBotsByBotIdHistoryMutation = (options?: Partial>): UseMutationOptions, DeleteBotsByBotIdHistoryError> => ({ + mutation: async (vars) => { + const { data } = await deleteBotsByBotIdHistory({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +export const getBotsByBotIdHistoryQueryKey = (options?: Options) => createQueryKey('getBotsByBotIdHistory', options); + +/** + * List history records + * + * List history records for current user + */ +export const getBotsByBotIdHistoryQuery = defineQueryOptions((options?: Options) => ({ + key: getBotsByBotIdHistoryQueryKey(options), + query: async (context) => { + const { data } = await getBotsByBotIdHistory({ + ...options, + ...context, + throwOnError: true + }); + return data; + } +})); + +/** + * Create history record + * + * Create a history record for current user + */ +export const postBotsByBotIdHistoryMutation = (options?: Partial>): UseMutationOptions, PostBotsByBotIdHistoryError> => ({ + mutation: async (vars) => { + const { data } = await postBotsByBotIdHistory({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +/** + * Delete history record + * + * Delete a history record by ID (must belong to current user) + */ +export const deleteBotsByBotIdHistoryByIdMutation = (options?: Partial>): UseMutationOptions, DeleteBotsByBotIdHistoryByIdError> => ({ + mutation: async (vars) => { + const { data } = await deleteBotsByBotIdHistoryById({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +export const getBotsByBotIdHistoryByIdQueryKey = (options: Options) => createQueryKey('getBotsByBotIdHistoryById', options); + +/** + * Get history record + * + * Get a history record by ID (must belong to current user) + */ +export const getBotsByBotIdHistoryByIdQuery = defineQueryOptions((options: Options) => ({ + key: getBotsByBotIdHistoryByIdQueryKey(options), + query: async (context) => { + const { data } = await getBotsByBotIdHistoryById({ + ...options, + ...context, + throwOnError: true + }); + return data; + } +})); + +export const getBotsByBotIdMcpQueryKey = (options?: Options) => createQueryKey('getBotsByBotIdMcp', options); + +/** + * List MCP connections + * + * List MCP connections for a bot + */ +export const getBotsByBotIdMcpQuery = defineQueryOptions((options?: Options) => ({ + key: getBotsByBotIdMcpQueryKey(options), + query: async (context) => { + const { data } = await getBotsByBotIdMcp({ + ...options, + ...context, + throwOnError: true + }); + return data; + } +})); + +/** + * Create MCP connection + * + * Create a MCP connection for a bot + */ +export const postBotsByBotIdMcpMutation = (options?: Partial>): UseMutationOptions, PostBotsByBotIdMcpError> => ({ + mutation: async (vars) => { + const { data } = await postBotsByBotIdMcp({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +/** + * Create MCP stdio proxy + * + * Start a stdio MCP process in the bot container and expose it as MCP HTTP endpoint. + */ +export const postBotsByBotIdMcpStdioMutation = (options?: Partial>): UseMutationOptions, PostBotsByBotIdMcpStdioError> => ({ + mutation: async (vars) => { + const { data } = await postBotsByBotIdMcpStdio({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +/** + * MCP stdio proxy (JSON-RPC) + * + * Proxies MCP JSON-RPC requests to a stdio MCP process in the container. + */ +export const postBotsByBotIdMcpStdioBySessionIdMutation = (options?: Partial>): UseMutationOptions, PostBotsByBotIdMcpStdioBySessionIdError> => ({ + mutation: async (vars) => { + const { data } = await postBotsByBotIdMcpStdioBySessionId({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +/** + * Delete MCP connection + * + * Delete a MCP connection by ID + */ +export const deleteBotsByBotIdMcpByIdMutation = (options?: Partial>): UseMutationOptions, DeleteBotsByBotIdMcpByIdError> => ({ + mutation: async (vars) => { + const { data } = await deleteBotsByBotIdMcpById({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +export const getBotsByBotIdMcpByIdQueryKey = (options: Options) => createQueryKey('getBotsByBotIdMcpById', options); + +/** + * Get MCP connection + * + * Get a MCP connection by ID + */ +export const getBotsByBotIdMcpByIdQuery = defineQueryOptions((options: Options) => ({ + key: getBotsByBotIdMcpByIdQueryKey(options), + query: async (context) => { + const { data } = await getBotsByBotIdMcpById({ + ...options, + ...context, + throwOnError: true + }); + return data; + } +})); + +/** + * Update MCP connection + * + * Update a MCP connection by ID + */ +export const putBotsByBotIdMcpByIdMutation = (options?: Partial>): UseMutationOptions, PutBotsByBotIdMcpByIdError> => ({ + mutation: async (vars) => { + const { data } = await putBotsByBotIdMcpById({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +/** + * Add memory + * + * Add memory for a user via memory. Auth: Bearer JWT determines user_id (sub or user_id). + */ +export const postBotsByBotIdMemoryAddMutation = (options?: Partial>): UseMutationOptions, PostBotsByBotIdMemoryAddError> => ({ + mutation: async (vars) => { + const { data } = await postBotsByBotIdMemoryAdd({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +/** + * Embed and upsert memory + * + * Embed text or multimodal input and upsert into memory store. Auth: Bearer JWT determines user_id (sub or user_id). + */ +export const postBotsByBotIdMemoryEmbedMutation = (options?: Partial>): UseMutationOptions, PostBotsByBotIdMemoryEmbedError> => ({ + mutation: async (vars) => { + const { data } = await postBotsByBotIdMemoryEmbed({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +/** + * Delete memories + * + * Delete all memories for a user via memory. Auth: Bearer JWT determines user_id (sub or user_id). + */ +export const deleteBotsByBotIdMemoryMemoriesMutation = (options?: Partial>): UseMutationOptions, DeleteBotsByBotIdMemoryMemoriesError> => ({ + mutation: async (vars) => { + const { data } = await deleteBotsByBotIdMemoryMemories({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +export const getBotsByBotIdMemoryMemoriesQueryKey = (options?: Options) => createQueryKey('getBotsByBotIdMemoryMemories', options); + +/** + * List memories + * + * List memories for a user via memory. Auth: Bearer JWT determines user_id (sub or user_id). + */ +export const getBotsByBotIdMemoryMemoriesQuery = defineQueryOptions((options?: Options) => ({ + key: getBotsByBotIdMemoryMemoriesQueryKey(options), + query: async (context) => { + const { data } = await getBotsByBotIdMemoryMemories({ + ...options, + ...context, + throwOnError: true + }); + return data; + } +})); + +/** + * Delete memory + * + * Delete a memory by ID via memory. Auth: Bearer JWT determines user_id (sub or user_id). + */ +export const deleteBotsByBotIdMemoryMemoriesByMemoryIdMutation = (options?: Partial>): UseMutationOptions, DeleteBotsByBotIdMemoryMemoriesByMemoryIdError> => ({ + mutation: async (vars) => { + const { data } = await deleteBotsByBotIdMemoryMemoriesByMemoryId({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +export const getBotsByBotIdMemoryMemoriesByMemoryIdQueryKey = (options: Options) => createQueryKey('getBotsByBotIdMemoryMemoriesByMemoryId', options); + +/** + * Get memory + * + * Get a memory by ID via memory. Auth: Bearer JWT determines user_id (sub or user_id). + */ +export const getBotsByBotIdMemoryMemoriesByMemoryIdQuery = defineQueryOptions((options: Options) => ({ + key: getBotsByBotIdMemoryMemoriesByMemoryIdQueryKey(options), + query: async (context) => { + const { data } = await getBotsByBotIdMemoryMemoriesByMemoryId({ + ...options, + ...context, + throwOnError: true + }); + return data; + } +})); + +/** + * Search memories + * + * Search memories for a user via memory. Auth: Bearer JWT determines user_id (sub or user_id). + */ +export const postBotsByBotIdMemorySearchMutation = (options?: Partial>): UseMutationOptions, PostBotsByBotIdMemorySearchError> => ({ + mutation: async (vars) => { + const { data } = await postBotsByBotIdMemorySearch({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +/** + * Update memory + * + * Update a memory by ID via memory. Auth: Bearer JWT determines user_id (sub or user_id). + */ +export const postBotsByBotIdMemoryUpdateMutation = (options?: Partial>): UseMutationOptions, PostBotsByBotIdMemoryUpdateError> => ({ + mutation: async (vars) => { + const { data } = await postBotsByBotIdMemoryUpdate({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +export const getBotsByBotIdScheduleQueryKey = (options?: Options) => createQueryKey('getBotsByBotIdSchedule', options); + +/** + * List schedules + * + * List schedules for current user + */ +export const getBotsByBotIdScheduleQuery = defineQueryOptions((options?: Options) => ({ + key: getBotsByBotIdScheduleQueryKey(options), + query: async (context) => { + const { data } = await getBotsByBotIdSchedule({ + ...options, + ...context, + throwOnError: true + }); + return data; + } +})); + +/** + * Create schedule + * + * Create a schedule for current user + */ +export const postBotsByBotIdScheduleMutation = (options?: Partial>): UseMutationOptions, PostBotsByBotIdScheduleError> => ({ + mutation: async (vars) => { + const { data } = await postBotsByBotIdSchedule({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +/** + * Delete schedule + * + * Delete a schedule by ID + */ +export const deleteBotsByBotIdScheduleByIdMutation = (options?: Partial>): UseMutationOptions, DeleteBotsByBotIdScheduleByIdError> => ({ + mutation: async (vars) => { + const { data } = await deleteBotsByBotIdScheduleById({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +export const getBotsByBotIdScheduleByIdQueryKey = (options: Options) => createQueryKey('getBotsByBotIdScheduleById', options); + +/** + * Get schedule + * + * Get a schedule by ID + */ +export const getBotsByBotIdScheduleByIdQuery = defineQueryOptions((options: Options) => ({ + key: getBotsByBotIdScheduleByIdQueryKey(options), + query: async (context) => { + const { data } = await getBotsByBotIdScheduleById({ + ...options, + ...context, + throwOnError: true + }); + return data; + } +})); + +/** + * Update schedule + * + * Update a schedule by ID + */ +export const putBotsByBotIdScheduleByIdMutation = (options?: Partial>): UseMutationOptions, PutBotsByBotIdScheduleByIdError> => ({ + mutation: async (vars) => { + const { data } = await putBotsByBotIdScheduleById({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +/** + * Delete user settings + * + * Remove agent settings for current user + */ +export const deleteBotsByBotIdSettingsMutation = (options?: Partial>): UseMutationOptions, DeleteBotsByBotIdSettingsError> => ({ + mutation: async (vars) => { + const { data } = await deleteBotsByBotIdSettings({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +export const getBotsByBotIdSettingsQueryKey = (options?: Options) => createQueryKey('getBotsByBotIdSettings', options); + +/** + * Get user settings + * + * Get agent settings for current user + */ +export const getBotsByBotIdSettingsQuery = defineQueryOptions((options?: Options) => ({ + key: getBotsByBotIdSettingsQueryKey(options), + query: async (context) => { + const { data } = await getBotsByBotIdSettings({ + ...options, + ...context, + throwOnError: true + }); + return data; + } +})); + +/** + * Update user settings + * + * Update or create agent settings for current user + */ +export const postBotsByBotIdSettingsMutation = (options?: Partial>): UseMutationOptions, PostBotsByBotIdSettingsError> => ({ + mutation: async (vars) => { + const { data } = await postBotsByBotIdSettings({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +/** + * Update user settings + * + * Update or create agent settings for current user + */ +export const putBotsByBotIdSettingsMutation = (options?: Partial>): UseMutationOptions, PutBotsByBotIdSettingsError> => ({ + mutation: async (vars) => { + const { data } = await putBotsByBotIdSettings({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +export const getBotsByBotIdSubagentsQueryKey = (options?: Options) => createQueryKey('getBotsByBotIdSubagents', options); + +/** + * List subagents + * + * List subagents for current user + */ +export const getBotsByBotIdSubagentsQuery = defineQueryOptions((options?: Options) => ({ + key: getBotsByBotIdSubagentsQueryKey(options), + query: async (context) => { + const { data } = await getBotsByBotIdSubagents({ + ...options, + ...context, + throwOnError: true + }); + return data; + } +})); + +/** + * Create subagent + * + * Create a subagent for current user + */ +export const postBotsByBotIdSubagentsMutation = (options?: Partial>): UseMutationOptions, PostBotsByBotIdSubagentsError> => ({ + mutation: async (vars) => { + const { data } = await postBotsByBotIdSubagents({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +/** + * Delete subagent + * + * Delete a subagent by ID + */ +export const deleteBotsByBotIdSubagentsByIdMutation = (options?: Partial>): UseMutationOptions, DeleteBotsByBotIdSubagentsByIdError> => ({ + mutation: async (vars) => { + const { data } = await deleteBotsByBotIdSubagentsById({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +export const getBotsByBotIdSubagentsByIdQueryKey = (options: Options) => createQueryKey('getBotsByBotIdSubagentsById', options); + +/** + * Get subagent + * + * Get a subagent by ID + */ +export const getBotsByBotIdSubagentsByIdQuery = defineQueryOptions((options: Options) => ({ + key: getBotsByBotIdSubagentsByIdQueryKey(options), + query: async (context) => { + const { data } = await getBotsByBotIdSubagentsById({ + ...options, + ...context, + throwOnError: true + }); + return data; + } +})); + +/** + * Update subagent + * + * Update a subagent by ID + */ +export const putBotsByBotIdSubagentsByIdMutation = (options?: Partial>): UseMutationOptions, PutBotsByBotIdSubagentsByIdError> => ({ + mutation: async (vars) => { + const { data } = await putBotsByBotIdSubagentsById({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +export const getBotsByBotIdSubagentsByIdContextQueryKey = (options: Options) => createQueryKey('getBotsByBotIdSubagentsByIdContext', options); + +/** + * Get subagent context + * + * Get a subagent's message context + */ +export const getBotsByBotIdSubagentsByIdContextQuery = defineQueryOptions((options: Options) => ({ + key: getBotsByBotIdSubagentsByIdContextQueryKey(options), + query: async (context) => { + const { data } = await getBotsByBotIdSubagentsByIdContext({ + ...options, + ...context, + throwOnError: true + }); + return data; + } +})); + +/** + * Update subagent context + * + * Update a subagent's message context + */ +export const putBotsByBotIdSubagentsByIdContextMutation = (options?: Partial>): UseMutationOptions, PutBotsByBotIdSubagentsByIdContextError> => ({ + mutation: async (vars) => { + const { data } = await putBotsByBotIdSubagentsByIdContext({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +export const getBotsByBotIdSubagentsByIdSkillsQueryKey = (options: Options) => createQueryKey('getBotsByBotIdSubagentsByIdSkills', options); + +/** + * Get subagent skills + * + * Get a subagent's skills + */ +export const getBotsByBotIdSubagentsByIdSkillsQuery = defineQueryOptions((options: Options) => ({ + key: getBotsByBotIdSubagentsByIdSkillsQueryKey(options), + query: async (context) => { + const { data } = await getBotsByBotIdSubagentsByIdSkills({ + ...options, + ...context, + throwOnError: true + }); + return data; + } +})); + +/** + * Add subagent skills + * + * Add skills to a subagent + */ +export const postBotsByBotIdSubagentsByIdSkillsMutation = (options?: Partial>): UseMutationOptions, PostBotsByBotIdSubagentsByIdSkillsError> => ({ + mutation: async (vars) => { + const { data } = await postBotsByBotIdSubagentsByIdSkills({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +/** + * Update subagent skills + * + * Replace a subagent's skills + */ +export const putBotsByBotIdSubagentsByIdSkillsMutation = (options?: Partial>): UseMutationOptions, PutBotsByBotIdSubagentsByIdSkillsError> => ({ + mutation: async (vars) => { + const { data } = await putBotsByBotIdSubagentsByIdSkills({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +/** + * Delete bot + * + * Delete a bot user (owner/admin only) + */ +export const deleteBotsByIdMutation = (options?: Partial>): UseMutationOptions, DeleteBotsByIdError> => ({ + mutation: async (vars) => { + const { data } = await deleteBotsById({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +export const getBotsByIdQueryKey = (options: Options) => createQueryKey('getBotsById', options); + +/** + * Get bot details + * + * Get a bot by ID (owner/admin only) + */ +export const getBotsByIdQuery = defineQueryOptions((options: Options) => ({ + key: getBotsByIdQueryKey(options), + query: async (context) => { + const { data } = await getBotsById({ + ...options, + ...context, + throwOnError: true + }); + return data; + } +})); + +/** + * Update bot details + * + * Update bot profile (owner/admin only) + */ +export const putBotsByIdMutation = (options?: Partial>): UseMutationOptions, PutBotsByIdError> => ({ + mutation: async (vars) => { + const { data } = await putBotsById({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +export const getBotsByIdChannelByPlatformQueryKey = (options: Options) => createQueryKey('getBotsByIdChannelByPlatform', options); + +/** + * Get bot channel config + * + * Get bot channel configuration + */ +export const getBotsByIdChannelByPlatformQuery = defineQueryOptions((options: Options) => ({ + key: getBotsByIdChannelByPlatformQueryKey(options), + query: async (context) => { + const { data } = await getBotsByIdChannelByPlatform({ + ...options, + ...context, + throwOnError: true + }); + return data; + } +})); + +/** + * Update bot channel config + * + * Update bot channel configuration + */ +export const putBotsByIdChannelByPlatformMutation = (options?: Partial>): UseMutationOptions, PutBotsByIdChannelByPlatformError> => ({ + mutation: async (vars) => { + const { data } = await putBotsByIdChannelByPlatform({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +/** + * Send message via bot channel + * + * Send a message using bot channel configuration + */ +export const postBotsByIdChannelByPlatformSendMutation = (options?: Partial>): UseMutationOptions, PostBotsByIdChannelByPlatformSendError> => ({ + mutation: async (vars) => { + const { data } = await postBotsByIdChannelByPlatformSend({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +/** + * Send message via bot channel session token + * + * Send a message using a session-scoped token (reply only) + */ +export const postBotsByIdChannelByPlatformSendSessionMutation = (options?: Partial>): UseMutationOptions, PostBotsByIdChannelByPlatformSendSessionError> => ({ + mutation: async (vars) => { + const { data } = await postBotsByIdChannelByPlatformSendSession({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +export const getBotsByIdMembersQueryKey = (options: Options) => createQueryKey('getBotsByIdMembers', options); + +/** + * List bot members + * + * List members for a bot + */ +export const getBotsByIdMembersQuery = defineQueryOptions((options: Options) => ({ + key: getBotsByIdMembersQueryKey(options), + query: async (context) => { + const { data } = await getBotsByIdMembers({ + ...options, + ...context, + throwOnError: true + }); + return data; + } +})); + +/** + * Upsert bot member + * + * Add or update bot member role + */ +export const putBotsByIdMembersMutation = (options?: Partial>): UseMutationOptions, PutBotsByIdMembersError> => ({ + mutation: async (vars) => { + const { data } = await putBotsByIdMembers({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +/** + * Delete bot member + * + * Remove a member from a bot + */ +export const deleteBotsByIdMembersByUserIdMutation = (options?: Partial>): UseMutationOptions, DeleteBotsByIdMembersByUserIdError> => ({ + mutation: async (vars) => { + const { data } = await deleteBotsByIdMembersByUserId({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +/** + * Transfer bot owner (admin only) + * + * Transfer bot ownership to another human user + */ +export const putBotsByIdOwnerMutation = (options?: Partial>): UseMutationOptions, PutBotsByIdOwnerError> => ({ + mutation: async (vars) => { + const { data } = await putBotsByIdOwner({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +export const getChannelsQueryKey = (options?: Options) => createQueryKey('getChannels', options); + +/** + * List channel capabilities and schemas + * + * List channel meta information including capabilities and schemas + */ +export const getChannelsQuery = defineQueryOptions((options?: Options) => ({ + key: getChannelsQueryKey(options), + query: async (context) => { + const { data } = await getChannels({ + ...options, + ...context, + throwOnError: true + }); + return data; + } +})); + +export const getChannelsByPlatformQueryKey = (options: Options) => createQueryKey('getChannelsByPlatform', options); + +/** + * Get channel capabilities and schemas + * + * Get channel meta information including capabilities and schemas + */ +export const getChannelsByPlatformQuery = defineQueryOptions((options: Options) => ({ + key: getChannelsByPlatformQueryKey(options), + query: async (context) => { + const { data } = await getChannelsByPlatform({ + ...options, + ...context, + throwOnError: true + }); + return data; + } +})); + +/** + * Create embeddings + * + * Create text or multimodal embeddings + */ +export const postEmbeddingsMutation = (options?: Partial>): UseMutationOptions, PostEmbeddingsError> => ({ + mutation: async (vars) => { + const { data } = await postEmbeddings({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +export const getModelsQueryKey = (options?: Options) => createQueryKey('getModels', options); + +/** + * List all models + * + * Get a list of all configured models, optionally filtered by type or client type + */ +export const getModelsQuery = defineQueryOptions((options?: Options) => ({ + key: getModelsQueryKey(options), + query: async (context) => { + const { data } = await getModels({ + ...options, + ...context, + throwOnError: true + }); + return data; + } +})); + +/** + * Create a new model + * + * Create a new model configuration + */ +export const postModelsMutation = (options?: Partial>): UseMutationOptions, PostModelsError> => ({ + mutation: async (vars) => { + const { data } = await postModels({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +export const getModelsCountQueryKey = (options?: Options) => createQueryKey('getModelsCount', options); + +/** + * Get model count + * + * Get the total count of models, optionally filtered by type + */ +export const getModelsCountQuery = defineQueryOptions((options?: Options) => ({ + key: getModelsCountQueryKey(options), + query: async (context) => { + const { data } = await getModelsCount({ + ...options, + ...context, + throwOnError: true + }); + return data; + } +})); + +/** + * Enable model for chat/memory/embedding + * + * Update the current user's settings to use the selected model + */ +export const postModelsEnableMutation = (options?: Partial>): UseMutationOptions, PostModelsEnableError> => ({ + mutation: async (vars) => { + const { data } = await postModelsEnable({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +/** + * Delete model by model ID + * + * Delete a model configuration by its model_id field (e.g., gpt-4) + */ +export const deleteModelsModelByModelIdMutation = (options?: Partial>): UseMutationOptions, DeleteModelsModelByModelIdError> => ({ + mutation: async (vars) => { + const { data } = await deleteModelsModelByModelId({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +export const getModelsModelByModelIdQueryKey = (options: Options) => createQueryKey('getModelsModelByModelId', options); + +/** + * Get model by model ID + * + * Get a model configuration by its model_id field (e.g., gpt-4) + */ +export const getModelsModelByModelIdQuery = defineQueryOptions((options: Options) => ({ + key: getModelsModelByModelIdQueryKey(options), + query: async (context) => { + const { data } = await getModelsModelByModelId({ + ...options, + ...context, + throwOnError: true + }); + return data; + } +})); + +/** + * Update model by model ID + * + * Update a model configuration by its model_id field (e.g., gpt-4) + */ +export const putModelsModelByModelIdMutation = (options?: Partial>): UseMutationOptions, PutModelsModelByModelIdError> => ({ + mutation: async (vars) => { + const { data } = await putModelsModelByModelId({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +/** + * Delete model by internal ID + * + * Delete a model configuration by its internal UUID + */ +export const deleteModelsByIdMutation = (options?: Partial>): UseMutationOptions, DeleteModelsByIdError> => ({ + mutation: async (vars) => { + const { data } = await deleteModelsById({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +export const getModelsByIdQueryKey = (options: Options) => createQueryKey('getModelsById', options); + +/** + * Get model by internal ID + * + * Get a model configuration by its internal UUID + */ +export const getModelsByIdQuery = defineQueryOptions((options: Options) => ({ + key: getModelsByIdQueryKey(options), + query: async (context) => { + const { data } = await getModelsById({ + ...options, + ...context, + throwOnError: true + }); + return data; + } +})); + +/** + * Update model by internal ID + * + * Update a model configuration by its internal UUID + */ +export const putModelsByIdMutation = (options?: Partial>): UseMutationOptions, PutModelsByIdError> => ({ + mutation: async (vars) => { + const { data } = await putModelsById({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +export const getProvidersQueryKey = (options?: Options) => createQueryKey('getProviders', options); + +/** + * List all LLM providers + * + * Get a list of all configured LLM providers, optionally filtered by client type + */ +export const getProvidersQuery = defineQueryOptions((options?: Options) => ({ + key: getProvidersQueryKey(options), + query: async (context) => { + const { data } = await getProviders({ + ...options, + ...context, + throwOnError: true + }); + return data; + } +})); + +/** + * Create a new LLM provider + * + * Create a new LLM provider configuration + */ +export const postProvidersMutation = (options?: Partial>): UseMutationOptions, PostProvidersError> => ({ + mutation: async (vars) => { + const { data } = await postProviders({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +export const getProvidersCountQueryKey = (options?: Options) => createQueryKey('getProvidersCount', options); + +/** + * Count providers + * + * Get the total count of providers, optionally filtered by client type + */ +export const getProvidersCountQuery = defineQueryOptions((options?: Options) => ({ + key: getProvidersCountQueryKey(options), + query: async (context) => { + const { data } = await getProvidersCount({ + ...options, + ...context, + throwOnError: true + }); + return data; + } +})); + +export const getProvidersNameByNameQueryKey = (options: Options) => createQueryKey('getProvidersNameByName', options); + +/** + * Get provider by name + * + * Get a provider configuration by its name + */ +export const getProvidersNameByNameQuery = defineQueryOptions((options: Options) => ({ + key: getProvidersNameByNameQueryKey(options), + query: async (context) => { + const { data } = await getProvidersNameByName({ + ...options, + ...context, + throwOnError: true + }); + return data; + } +})); + +/** + * Delete provider + * + * Delete a provider configuration + */ +export const deleteProvidersByIdMutation = (options?: Partial>): UseMutationOptions, DeleteProvidersByIdError> => ({ + mutation: async (vars) => { + const { data } = await deleteProvidersById({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +export const getProvidersByIdQueryKey = (options: Options) => createQueryKey('getProvidersById', options); + +/** + * Get provider by ID + * + * Get a provider configuration by its ID + */ +export const getProvidersByIdQuery = defineQueryOptions((options: Options) => ({ + key: getProvidersByIdQueryKey(options), + query: async (context) => { + const { data } = await getProvidersById({ + ...options, + ...context, + throwOnError: true + }); + return data; + } +})); + +/** + * Update provider + * + * Update an existing provider configuration + */ +export const putProvidersByIdMutation = (options?: Partial>): UseMutationOptions, PutProvidersByIdError> => ({ + mutation: async (vars) => { + const { data } = await putProvidersById({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +export const getProvidersByIdModelsQueryKey = (options: Options) => createQueryKey('getProvidersByIdModels', options); + +/** + * List provider models + * + * Get models for a provider by id, optionally filtered by type + */ +export const getProvidersByIdModelsQuery = defineQueryOptions((options: Options) => ({ + key: getProvidersByIdModelsQueryKey(options), + query: async (context) => { + const { data } = await getProvidersByIdModels({ + ...options, + ...context, + throwOnError: true + }); + return data; + } +})); + +export const getUsersQueryKey = (options?: Options) => createQueryKey('getUsers', options); + +/** + * List users (admin only) + * + * List users + */ +export const getUsersQuery = defineQueryOptions((options?: Options) => ({ + key: getUsersQueryKey(options), + query: async (context) => { + const { data } = await getUsers({ + ...options, + ...context, + throwOnError: true + }); + return data; + } +})); + +/** + * Create human user (admin only) + * + * Create a new human user account + */ +export const postUsersMutation = (options?: Partial>): UseMutationOptions, PostUsersError> => ({ + mutation: async (vars) => { + const { data } = await postUsers({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +export const getUsersMeQueryKey = (options?: Options) => createQueryKey('getUsersMe', options); + +/** + * Get current user + * + * Get current user profile + */ +export const getUsersMeQuery = defineQueryOptions((options?: Options) => ({ + key: getUsersMeQueryKey(options), + query: async (context) => { + const { data } = await getUsersMe({ + ...options, + ...context, + throwOnError: true + }); + return data; + } +})); + +/** + * Update current user profile + * + * Update current user display name or avatar + */ +export const putUsersMeMutation = (options?: Partial>): UseMutationOptions, PutUsersMeError> => ({ + mutation: async (vars) => { + const { data } = await putUsersMe({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +export const getUsersMeChannelsByPlatformQueryKey = (options: Options) => createQueryKey('getUsersMeChannelsByPlatform', options); + +/** + * Get channel user config + * + * Get channel binding configuration for current user + */ +export const getUsersMeChannelsByPlatformQuery = defineQueryOptions((options: Options) => ({ + key: getUsersMeChannelsByPlatformQueryKey(options), + query: async (context) => { + const { data } = await getUsersMeChannelsByPlatform({ + ...options, + ...context, + throwOnError: true + }); + return data; + } +})); + +/** + * Update channel user config + * + * Update channel binding configuration for current user + */ +export const putUsersMeChannelsByPlatformMutation = (options?: Partial>): UseMutationOptions, PutUsersMeChannelsByPlatformError> => ({ + mutation: async (vars) => { + const { data } = await putUsersMeChannelsByPlatform({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +/** + * Update current user password + * + * Update current user password with current password check + */ +export const putUsersMePasswordMutation = (options?: Partial>): UseMutationOptions, PutUsersMePasswordError> => ({ + mutation: async (vars) => { + const { data } = await putUsersMePassword({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +export const getUsersByIdQueryKey = (options: Options) => createQueryKey('getUsersById', options); + +/** + * Get user by ID + * + * Get user details (self or admin only) + */ +export const getUsersByIdQuery = defineQueryOptions((options: Options) => ({ + key: getUsersByIdQueryKey(options), + query: async (context) => { + const { data } = await getUsersById({ + ...options, + ...context, + throwOnError: true + }); + return data; + } +})); + +/** + * Update user (admin only) + * + * Update user profile and status + */ +export const putUsersByIdMutation = (options?: Partial>): UseMutationOptions, PutUsersByIdError> => ({ + mutation: async (vars) => { + const { data } = await putUsersById({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); + +/** + * Reset user password (admin only) + * + * Reset a user password + */ +export const putUsersByIdPasswordMutation = (options?: Partial>): UseMutationOptions, PutUsersByIdPasswordError> => ({ + mutation: async (vars) => { + const { data } = await putUsersByIdPassword({ + ...options, + ...vars, + throwOnError: true + }); + return data; + } +}); diff --git a/packages/sdk/src/client.gen.ts b/packages/sdk/src/client.gen.ts new file mode 100644 index 00000000..cab3c701 --- /dev/null +++ b/packages/sdk/src/client.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type ClientOptions, type Config, createClient, createConfig } from './client'; +import type { ClientOptions as ClientOptions2 } from './types.gen'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig()); diff --git a/packages/sdk/src/client/client.gen.ts b/packages/sdk/src/client/client.gen.ts new file mode 100644 index 00000000..d2e55a14 --- /dev/null +++ b/packages/sdk/src/client/client.gen.ts @@ -0,0 +1,288 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { createSseClient } from '../core/serverSentEvents.gen'; +import type { HttpMethod } from '../core/types.gen'; +import { getValidRequestBody } from '../core/utils.gen'; +import type { Client, Config, RequestOptions, ResolvedRequestOptions } from './types.gen'; +import { + buildUrl, + createConfig, + createInterceptors, + getParseAs, + mergeConfigs, + mergeHeaders, + setAuthParams, +} from './utils.gen'; + +type ReqInit = Omit & { + body?: any; + headers: ReturnType; +}; + +export const createClient = (config: Config = {}): Client => { + let _config = mergeConfigs(createConfig(), config); + + const getConfig = (): Config => ({ ..._config }); + + const setConfig = (config: Config): Config => { + _config = mergeConfigs(_config, config); + return getConfig(); + }; + + const interceptors = createInterceptors(); + + const beforeRequest = async (options: RequestOptions) => { + const opts = { + ..._config, + ...options, + fetch: options.fetch ?? _config.fetch ?? globalThis.fetch, + headers: mergeHeaders(_config.headers, options.headers), + serializedBody: undefined, + }; + + if (opts.security) { + await setAuthParams({ + ...opts, + security: opts.security, + }); + } + + if (opts.requestValidator) { + await opts.requestValidator(opts); + } + + 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.body === undefined || opts.serializedBody === '') { + opts.headers.delete('Content-Type'); + } + + const url = buildUrl(opts); + + return { opts, url }; + }; + + const request: Client['request'] = async (options) => { + // @ts-expect-error + const { opts, url } = await beforeRequest(options); + const requestInit: ReqInit = { + redirect: 'follow', + ...opts, + body: getValidRequestBody(opts), + }; + + let request = new Request(url, requestInit); + + for (const fn of interceptors.request.fns) { + if (fn) { + request = await fn(request, opts); + } + } + + // fetch must be assigned here, otherwise it would throw the error: + // TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation + const _fetch = opts.fetch!; + let response: Response; + + try { + response = await _fetch(request); + } catch (error) { + // Handle fetch exceptions (AbortError, network errors, etc.) + let finalError = error; + + for (const fn of interceptors.error.fns) { + if (fn) { + finalError = (await fn(error, undefined as any, request, opts)) as unknown; + } + } + + finalError = finalError || ({} as unknown); + + if (opts.throwOnError) { + throw finalError; + } + + // Return error response + return opts.responseStyle === 'data' + ? undefined + : { + error: finalError, + request, + response: undefined as any, + }; + } + + for (const fn of interceptors.response.fns) { + if (fn) { + response = await fn(response, request, opts); + } + } + + const result = { + request, + response, + }; + + 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: emptyData, + ...result, + }; + } + + let data: any; + switch (parseAs) { + case 'arrayBuffer': + case 'blob': + case 'formData': + case 'text': + data = await response[parseAs](); + break; + case 'json': { + // Some servers return 200 with no Content-Length and empty body. + // response.json() would throw; read as text and parse if non-empty. + const text = await response.text(); + data = text ? JSON.parse(text) : {}; + break; + } + case 'stream': + return opts.responseStyle === 'data' + ? response.body + : { + data: response.body, + ...result, + }; + } + + if (parseAs === 'json') { + if (opts.responseValidator) { + await opts.responseValidator(data); + } + + if (opts.responseTransformer) { + data = await opts.responseTransformer(data); + } + } + + return opts.responseStyle === 'data' + ? data + : { + data, + ...result, + }; + } + + const textError = await response.text(); + let jsonError: unknown; + + try { + jsonError = JSON.parse(textError); + } catch { + // noop + } + + const error = jsonError ?? textError; + let finalError = error; + + for (const fn of interceptors.error.fns) { + if (fn) { + finalError = (await fn(error, response, request, opts)) as string; + } + } + + finalError = finalError || ({} as string); + + if (opts.throwOnError) { + throw finalError; + } + + // TODO: we probably want to return error and improve types + return opts.responseStyle === 'data' + ? undefined + : { + error: finalError, + ...result, + }; + }; + + const makeMethodFn = (method: Uppercase) => (options: RequestOptions) => + request({ ...options, method }); + + const makeSseFn = (method: Uppercase) => 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, + 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; + }, + serializedBody: getValidRequestBody(opts) as BodyInit | null | undefined, + url, + }); + }; + + return { + buildUrl, + connect: makeMethodFn('CONNECT'), + delete: makeMethodFn('DELETE'), + get: makeMethodFn('GET'), + getConfig, + head: makeMethodFn('HEAD'), + interceptors, + options: makeMethodFn('OPTIONS'), + patch: makeMethodFn('PATCH'), + post: makeMethodFn('POST'), + put: makeMethodFn('PUT'), + request, + setConfig, + 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; +}; diff --git a/packages/sdk/src/client/index.ts b/packages/sdk/src/client/index.ts new file mode 100644 index 00000000..b295edec --- /dev/null +++ b/packages/sdk/src/client/index.ts @@ -0,0 +1,25 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type { Auth } from '../core/auth.gen'; +export type { QuerySerializerOptions } from '../core/bodySerializer.gen'; +export { + formDataBodySerializer, + jsonBodySerializer, + urlSearchParamsBodySerializer, +} from '../core/bodySerializer.gen'; +export { buildClientParams } from '../core/params.gen'; +export { serializeQueryKeyValue } from '../core/queryKeySerializer.gen'; +export { createClient } from './client.gen'; +export type { + Client, + ClientOptions, + Config, + CreateClientConfig, + Options, + RequestOptions, + RequestResult, + ResolvedRequestOptions, + ResponseStyle, + TDataShape, +} from './types.gen'; +export { createConfig, mergeHeaders } from './utils.gen'; diff --git a/packages/sdk/src/client/types.gen.ts b/packages/sdk/src/client/types.gen.ts new file mode 100644 index 00000000..cb6d0d54 --- /dev/null +++ b/packages/sdk/src/client/types.gen.ts @@ -0,0 +1,213 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Auth } from '../core/auth.gen'; +import type { + ServerSentEventsOptions, + ServerSentEventsResult, +} from '../core/serverSentEvents.gen'; +import type { Client as CoreClient, Config as CoreConfig } from '../core/types.gen'; +import type { Middleware } from './utils.gen'; + +export type ResponseStyle = 'data' | 'fields'; + +export interface Config + extends Omit, CoreConfig { + /** + * Base URL for all requests made by this client. + */ + baseUrl?: T['baseUrl']; + /** + * Fetch API implementation. You can use this option to provide a custom + * fetch instance. + * + * @default globalThis.fetch + */ + fetch?: typeof fetch; + /** + * Please don't use the Fetch client for Next.js applications. The `next` + * options won't have any effect. + * + * Install {@link https://www.npmjs.com/package/@hey-api/client-next `@hey-api/client-next`} instead. + */ + next?: never; + /** + * Return the response data parsed in a specified format. By default, `auto` + * will infer the appropriate method from the `Content-Type` response header. + * You can override this behavior with any of the {@link Body} methods. + * Select `stream` if you don't want to parse response data at all. + * + * @default 'auto' + */ + parseAs?: 'arrayBuffer' | 'auto' | 'blob' | 'formData' | 'json' | 'stream' | 'text'; + /** + * Should we return only data or multiple fields (data, error, response, etc.)? + * + * @default 'fields' + */ + responseStyle?: ResponseStyle; + /** + * Throw an error instead of returning it in the response? + * + * @default false + */ + throwOnError?: T['throwOnError']; +} + +export interface RequestOptions< + TData = unknown, + TResponseStyle extends ResponseStyle = 'fields', + ThrowOnError extends boolean = boolean, + Url extends string = string, +> + extends + Config<{ + responseStyle: TResponseStyle; + throwOnError: ThrowOnError; + }>, + Pick< + ServerSentEventsOptions, + | 'onSseError' + | 'onSseEvent' + | 'sseDefaultRetryDelay' + | 'sseMaxRetryAttempts' + | 'sseMaxRetryDelay' + > { + /** + * Any body that you want to add to your request. + * + * {@link https://developer.mozilla.org/docs/Web/API/fetch#body} + */ + body?: unknown; + path?: Record; + query?: Record; + /** + * Security mechanism(s) to use for the request. + */ + security?: ReadonlyArray; + url: Url; +} + +export interface ResolvedRequestOptions< + TResponseStyle extends ResponseStyle = 'fields', + ThrowOnError extends boolean = boolean, + Url extends string = string, +> extends RequestOptions { + serializedBody?: string; +} + +export type RequestResult< + TData = unknown, + TError = unknown, + ThrowOnError extends boolean = boolean, + TResponseStyle extends ResponseStyle = 'fields', +> = ThrowOnError extends true + ? Promise< + TResponseStyle extends 'data' + ? TData extends Record + ? TData[keyof TData] + : TData + : { + data: TData extends Record ? TData[keyof TData] : TData; + request: Request; + response: Response; + } + > + : Promise< + TResponseStyle extends 'data' + ? (TData extends Record ? TData[keyof TData] : TData) | undefined + : ( + | { + data: TData extends Record ? TData[keyof TData] : TData; + error: undefined; + } + | { + data: undefined; + error: TError extends Record ? TError[keyof TError] : TError; + } + ) & { + request: Request; + response: Response; + } + >; + +export interface ClientOptions { + baseUrl?: string; + responseStyle?: ResponseStyle; + throwOnError?: boolean; +} + +type MethodFn = < + TData = unknown, + TError = unknown, + ThrowOnError extends boolean = false, + TResponseStyle extends ResponseStyle = 'fields', +>( + options: Omit, 'method'>, +) => RequestResult; + +type SseFn = < + TData = unknown, + TError = unknown, + ThrowOnError extends boolean = false, + TResponseStyle extends ResponseStyle = 'fields', +>( + options: Omit, 'method'>, +) => Promise>; + +type RequestFn = < + TData = unknown, + TError = unknown, + ThrowOnError extends boolean = false, + TResponseStyle extends ResponseStyle = 'fields', +>( + options: Omit, 'method'> & + Pick>, 'method'>, +) => RequestResult; + +type BuildUrlFn = < + TData extends { + body?: unknown; + path?: Record; + query?: Record; + url: string; + }, +>( + options: TData & Options, +) => string; + +export type Client = CoreClient & { + interceptors: Middleware; +}; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = ( + override?: Config, +) => Config & T>; + +export interface TDataShape { + body?: unknown; + headers?: unknown; + path?: unknown; + query?: unknown; + url: string; +} + +type OmitKeys = Pick>; + +export type Options< + TData extends TDataShape = TDataShape, + ThrowOnError extends boolean = boolean, + TResponse = unknown, + TResponseStyle extends ResponseStyle = 'fields', +> = OmitKeys< + RequestOptions, + 'body' | 'path' | 'query' | 'url' +> & + ([TData] extends [never] ? unknown : Omit); diff --git a/packages/sdk/src/client/utils.gen.ts b/packages/sdk/src/client/utils.gen.ts new file mode 100644 index 00000000..b4bd2435 --- /dev/null +++ b/packages/sdk/src/client/utils.gen.ts @@ -0,0 +1,316 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { getAuthToken } from '../core/auth.gen'; +import type { QuerySerializerOptions } from '../core/bodySerializer.gen'; +import { jsonBodySerializer } from '../core/bodySerializer.gen'; +import { + serializeArrayParam, + serializeObjectParam, + serializePrimitiveParam, +} from '../core/pathSerializer.gen'; +import { getUrl } from '../core/utils.gen'; +import type { Client, ClientOptions, Config, RequestOptions } from './types.gen'; + +export const createQuerySerializer = ({ + parameters = {}, + ...args +}: QuerySerializerOptions = {}) => { + const querySerializer = (queryParams: T) => { + const search: string[] = []; + if (queryParams && typeof queryParams === 'object') { + for (const name in queryParams) { + const value = queryParams[name]; + + if (value === undefined || value === null) { + continue; + } + + const options = parameters[name] || args; + + if (Array.isArray(value)) { + const serializedArray = serializeArrayParam({ + allowReserved: options.allowReserved, + explode: true, + name, + style: 'form', + value, + ...options.array, + }); + if (serializedArray) search.push(serializedArray); + } else if (typeof value === 'object') { + const serializedObject = serializeObjectParam({ + allowReserved: options.allowReserved, + explode: true, + name, + style: 'deepObject', + value: value as Record, + ...options.object, + }); + if (serializedObject) search.push(serializedObject); + } else { + const serializedPrimitive = serializePrimitiveParam({ + allowReserved: options.allowReserved, + name, + value: value as string, + }); + if (serializedPrimitive) search.push(serializedPrimitive); + } + } + } + return search.join('&'); + }; + return querySerializer; +}; + +/** + * Infers parseAs value from provided Content-Type header. + */ +export const getParseAs = (contentType: string | null): Exclude => { + if (!contentType) { + // If no Content-Type header is provided, the best we can do is return the raw response body, + // which is effectively the same as the 'stream' option. + return 'stream'; + } + + const cleanContent = contentType.split(';')[0]?.trim(); + + if (!cleanContent) { + return; + } + + if (cleanContent.startsWith('application/json') || cleanContent.endsWith('+json')) { + return 'json'; + } + + if (cleanContent === 'multipart/form-data') { + return 'formData'; + } + + if ( + ['application/', 'audio/', 'image/', 'video/'].some((type) => cleanContent.startsWith(type)) + ) { + return 'blob'; + } + + if (cleanContent.startsWith('text/')) { + return 'text'; + } + + return; +}; + +const checkForExistence = ( + options: Pick & { + headers: Headers; + }, + name?: string, +): boolean => { + if (!name) { + return false; + } + if ( + options.headers.has(name) || + options.query?.[name] || + options.headers.get('Cookie')?.includes(`${name}=`) + ) { + return true; + } + return false; +}; + +export const setAuthParams = async ({ + security, + ...options +}: Pick, 'security'> & + Pick & { + headers: Headers; + }) => { + for (const auth of security) { + if (checkForExistence(options, auth.name)) { + continue; + } + + const token = await getAuthToken(auth, options.auth); + + if (!token) { + continue; + } + + const name = auth.name ?? 'Authorization'; + + switch (auth.in) { + case 'query': + if (!options.query) { + options.query = {}; + } + options.query[name] = token; + break; + case 'cookie': + options.headers.append('Cookie', `${name}=${token}`); + break; + case 'header': + default: + options.headers.set(name, token); + break; + } + } +}; + +export const buildUrl: Client['buildUrl'] = (options) => + getUrl({ + baseUrl: options.baseUrl as string, + path: options.path, + query: options.query, + querySerializer: + typeof options.querySerializer === 'function' + ? options.querySerializer + : createQuerySerializer(options.querySerializer), + url: options.url, + }); + +export const mergeConfigs = (a: Config, b: Config): Config => { + const config = { ...a, ...b }; + if (config.baseUrl?.endsWith('/')) { + config.baseUrl = config.baseUrl.substring(0, config.baseUrl.length - 1); + } + config.headers = mergeHeaders(a.headers, b.headers); + 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['headers'] | undefined> +): Headers => { + const mergedHeaders = new Headers(); + for (const header of headers) { + if (!header) { + continue; + } + + const iterator = header instanceof Headers ? headersEntries(header) : Object.entries(header); + + for (const [key, value] of iterator) { + if (value === null) { + mergedHeaders.delete(key); + } else if (Array.isArray(value)) { + for (const v of value) { + mergedHeaders.append(key, v as string); + } + } 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), + ); + } + } + } + return mergedHeaders; +}; + +type ErrInterceptor = ( + error: Err, + response: Res, + request: Req, + options: Options, +) => Err | Promise; + +type ReqInterceptor = (request: Req, options: Options) => Req | Promise; + +type ResInterceptor = ( + response: Res, + request: Req, + options: Options, +) => Res | Promise; + +class Interceptors { + fns: Array = []; + + clear(): void { + this.fns = []; + } + + eject(id: number | Interceptor): void { + const index = this.getInterceptorIndex(id); + if (this.fns[index]) { + this.fns[index] = null; + } + } + + exists(id: number | Interceptor): boolean { + const index = this.getInterceptorIndex(id); + return Boolean(this.fns[index]); + } + + getInterceptorIndex(id: number | Interceptor): number { + if (typeof id === 'number') { + return this.fns[id] ? id : -1; + } + return this.fns.indexOf(id); + } + + update(id: number | Interceptor, fn: Interceptor): number | Interceptor | false { + const index = this.getInterceptorIndex(id); + if (this.fns[index]) { + this.fns[index] = fn; + return id; + } + return false; + } + + use(fn: Interceptor): number { + this.fns.push(fn); + return this.fns.length - 1; + } +} + +export interface Middleware { + error: Interceptors>; + request: Interceptors>; + response: Interceptors>; +} + +export const createInterceptors = (): Middleware< + Req, + Res, + Err, + Options +> => ({ + error: new Interceptors>(), + request: new Interceptors>(), + response: new Interceptors>(), +}); + +const defaultQuerySerializer = createQuerySerializer({ + allowReserved: false, + array: { + explode: true, + style: 'form', + }, + object: { + explode: true, + style: 'deepObject', + }, +}); + +const defaultHeaders = { + 'Content-Type': 'application/json', +}; + +export const createConfig = ( + override: Config & T> = {}, +): Config & T> => ({ + ...jsonBodySerializer, + headers: defaultHeaders, + parseAs: 'auto', + querySerializer: defaultQuerySerializer, + ...override, +}); diff --git a/packages/sdk/src/core/auth.gen.ts b/packages/sdk/src/core/auth.gen.ts new file mode 100644 index 00000000..3ebf9947 --- /dev/null +++ b/packages/sdk/src/core/auth.gen.ts @@ -0,0 +1,41 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type AuthToken = string | undefined; + +export interface Auth { + /** + * Which part of the request do we use to send the auth? + * + * @default 'header' + */ + in?: 'header' | 'query' | 'cookie'; + /** + * Header or query parameter name. + * + * @default 'Authorization' + */ + name?: string; + scheme?: 'basic' | 'bearer'; + type: 'apiKey' | 'http'; +} + +export const getAuthToken = async ( + auth: Auth, + callback: ((auth: Auth) => Promise | AuthToken) | AuthToken, +): Promise => { + const token = typeof callback === 'function' ? await callback(auth) : callback; + + if (!token) { + return; + } + + if (auth.scheme === 'bearer') { + return `Bearer ${token}`; + } + + if (auth.scheme === 'basic') { + return `Basic ${btoa(token)}`; + } + + return token; +}; diff --git a/packages/sdk/src/core/bodySerializer.gen.ts b/packages/sdk/src/core/bodySerializer.gen.ts new file mode 100644 index 00000000..8ad92c9f --- /dev/null +++ b/packages/sdk/src/core/bodySerializer.gen.ts @@ -0,0 +1,84 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ArrayStyle, ObjectStyle, SerializerOptions } from './pathSerializer.gen'; + +export type QuerySerializer = (query: Record) => string; + +export type BodySerializer = (body: any) => any; + +type QuerySerializerOptionsObject = { + allowReserved?: boolean; + array?: Partial>; + object?: Partial>; +}; + +export type QuerySerializerOptions = QuerySerializerOptionsObject & { + /** + * Per-parameter serialization overrides. When provided, these settings + * override the global array/object settings for specific parameter names. + */ + parameters?: Record; +}; + +const serializeFormDataPair = (data: FormData, key: string, value: unknown): void => { + if (typeof value === 'string' || value instanceof Blob) { + data.append(key, value); + } else if (value instanceof Date) { + data.append(key, value.toISOString()); + } else { + data.append(key, JSON.stringify(value)); + } +}; + +const serializeUrlSearchParamsPair = (data: URLSearchParams, key: string, value: unknown): void => { + if (typeof value === 'string') { + data.append(key, value); + } else { + data.append(key, JSON.stringify(value)); + } +}; + +export const formDataBodySerializer = { + bodySerializer: | Array>>( + body: T, + ): FormData => { + const data = new FormData(); + + Object.entries(body).forEach(([key, value]) => { + if (value === undefined || value === null) { + return; + } + if (Array.isArray(value)) { + value.forEach((v) => serializeFormDataPair(data, key, v)); + } else { + serializeFormDataPair(data, key, value); + } + }); + + return data; + }, +}; + +export const jsonBodySerializer = { + bodySerializer: (body: T): string => + JSON.stringify(body, (_key, value) => (typeof value === 'bigint' ? value.toString() : value)), +}; + +export const urlSearchParamsBodySerializer = { + bodySerializer: | Array>>(body: T): string => { + const data = new URLSearchParams(); + + Object.entries(body).forEach(([key, value]) => { + if (value === undefined || value === null) { + return; + } + if (Array.isArray(value)) { + value.forEach((v) => serializeUrlSearchParamsPair(data, key, v)); + } else { + serializeUrlSearchParamsPair(data, key, value); + } + }); + + return data.toString(); + }, +}; diff --git a/packages/sdk/src/core/params.gen.ts b/packages/sdk/src/core/params.gen.ts new file mode 100644 index 00000000..6099cab1 --- /dev/null +++ b/packages/sdk/src/core/params.gen.ts @@ -0,0 +1,169 @@ +// This file is auto-generated by @hey-api/openapi-ts + +type Slot = 'body' | 'headers' | 'path' | 'query'; + +export type Field = + | { + in: Exclude; + /** + * Field name. This is the name we want the user to see and use. + */ + key: string; + /** + * Field mapped name. This is the name we want to use in the request. + * If omitted, we use the same value as `key`. + */ + map?: string; + } + | { + in: Extract; + /** + * Key isn't required for bodies. + */ + key?: string; + map?: string; + } + | { + /** + * Field name. This is the name we want the user to see and use. + */ + key: string; + /** + * Field mapped name. This is the name we want to use in the request. + * If `in` is omitted, `map` aliases `key` to the transport layer. + */ + map: Slot; + }; + +export interface Fields { + allowExtra?: Partial>; + args?: ReadonlyArray; +} + +export type FieldsConfig = ReadonlyArray; + +const extraPrefixesMap: Record = { + $body_: 'body', + $headers_: 'headers', + $path_: 'path', + $query_: 'query', +}; +const extraPrefixes = Object.entries(extraPrefixesMap); + +type KeyMap = Map< + string, + | { + in: Slot; + map?: string; + } + | { + in?: never; + map: Slot; + } +>; + +const buildKeyMap = (fields: FieldsConfig, map?: KeyMap): KeyMap => { + if (!map) { + map = new Map(); + } + + for (const config of fields) { + if ('in' in config) { + if (config.key) { + map.set(config.key, { + in: config.in, + map: config.map, + }); + } + } else if ('key' in config) { + map.set(config.key, { + map: config.map, + }); + } else if (config.args) { + buildKeyMap(config.args, map); + } + } + + return map; +}; + +interface Params { + body: unknown; + headers: Record; + path: Record; + query: Record; +} + +const stripEmptySlots = (params: Params) => { + for (const [slot, value] of Object.entries(params)) { + if (value && typeof value === 'object' && !Object.keys(value).length) { + delete params[slot as Slot]; + } + } +}; + +export const buildClientParams = (args: ReadonlyArray, fields: FieldsConfig) => { + const params: Params = { + body: {}, + headers: {}, + path: {}, + query: {}, + }; + + const map = buildKeyMap(fields); + + let config: FieldsConfig[number] | undefined; + + for (const [index, arg] of args.entries()) { + if (fields[index]) { + config = fields[index]; + } + + if (!config) { + continue; + } + + if ('in' in config) { + if (config.key) { + const field = map.get(config.key)!; + const name = field.map || config.key; + if (field.in) { + (params[field.in] as Record)[name] = arg; + } + } else { + params.body = arg; + } + } else { + for (const [key, value] of Object.entries(arg ?? {})) { + const field = map.get(key); + + if (field) { + if (field.in) { + const name = field.map || key; + (params[field.in] as Record)[name] = value; + } else { + params[field.map] = value; + } + } else { + const extra = extraPrefixes.find(([prefix]) => key.startsWith(prefix)); + + if (extra) { + const [prefix, slot] = extra; + (params[slot] as Record)[key.slice(prefix.length)] = value; + } else if ('allowExtra' in config && config.allowExtra) { + for (const [slot, allowed] of Object.entries(config.allowExtra)) { + if (allowed) { + (params[slot as Slot] as Record)[key] = value; + break; + } + } + } + } + } + } + } + + stripEmptySlots(params); + + return params; +}; diff --git a/packages/sdk/src/core/pathSerializer.gen.ts b/packages/sdk/src/core/pathSerializer.gen.ts new file mode 100644 index 00000000..994b2848 --- /dev/null +++ b/packages/sdk/src/core/pathSerializer.gen.ts @@ -0,0 +1,171 @@ +// This file is auto-generated by @hey-api/openapi-ts + +interface SerializeOptions extends SerializePrimitiveOptions, SerializerOptions {} + +interface SerializePrimitiveOptions { + allowReserved?: boolean; + name: string; +} + +export interface SerializerOptions { + /** + * @default true + */ + explode: boolean; + style: T; +} + +export type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited'; +export type ArraySeparatorStyle = ArrayStyle | MatrixStyle; +type MatrixStyle = 'label' | 'matrix' | 'simple'; +export type ObjectStyle = 'form' | 'deepObject'; +type ObjectSeparatorStyle = ObjectStyle | MatrixStyle; + +interface SerializePrimitiveParam extends SerializePrimitiveOptions { + value: string; +} + +export const separatorArrayExplode = (style: ArraySeparatorStyle) => { + switch (style) { + case 'label': + return '.'; + case 'matrix': + return ';'; + case 'simple': + return ','; + default: + return '&'; + } +}; + +export const separatorArrayNoExplode = (style: ArraySeparatorStyle) => { + switch (style) { + case 'form': + return ','; + case 'pipeDelimited': + return '|'; + case 'spaceDelimited': + return '%20'; + default: + return ','; + } +}; + +export const separatorObjectExplode = (style: ObjectSeparatorStyle) => { + switch (style) { + case 'label': + return '.'; + case 'matrix': + return ';'; + case 'simple': + return ','; + default: + return '&'; + } +}; + +export const serializeArrayParam = ({ + allowReserved, + explode, + name, + style, + value, +}: SerializeOptions & { + value: unknown[]; +}) => { + if (!explode) { + const joinedValues = ( + allowReserved ? value : value.map((v) => encodeURIComponent(v as string)) + ).join(separatorArrayNoExplode(style)); + switch (style) { + case 'label': + return `.${joinedValues}`; + case 'matrix': + return `;${name}=${joinedValues}`; + case 'simple': + return joinedValues; + default: + return `${name}=${joinedValues}`; + } + } + + const separator = separatorArrayExplode(style); + const joinedValues = value + .map((v) => { + if (style === 'label' || style === 'simple') { + return allowReserved ? v : encodeURIComponent(v as string); + } + + return serializePrimitiveParam({ + allowReserved, + name, + value: v as string, + }); + }) + .join(separator); + return style === 'label' || style === 'matrix' ? separator + joinedValues : joinedValues; +}; + +export const serializePrimitiveParam = ({ + allowReserved, + name, + value, +}: SerializePrimitiveParam) => { + if (value === undefined || value === null) { + return ''; + } + + if (typeof value === 'object') { + throw new Error( + 'Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.', + ); + } + + return `${name}=${allowReserved ? value : encodeURIComponent(value)}`; +}; + +export const serializeObjectParam = ({ + allowReserved, + explode, + name, + style, + value, + valueOnly, +}: SerializeOptions & { + value: Record | Date; + valueOnly?: boolean; +}) => { + if (value instanceof Date) { + return valueOnly ? value.toISOString() : `${name}=${value.toISOString()}`; + } + + if (style !== 'deepObject' && !explode) { + let values: string[] = []; + Object.entries(value).forEach(([key, v]) => { + values = [...values, key, allowReserved ? (v as string) : encodeURIComponent(v as string)]; + }); + const joinedValues = values.join(','); + switch (style) { + case 'form': + return `${name}=${joinedValues}`; + case 'label': + return `.${joinedValues}`; + case 'matrix': + return `;${name}=${joinedValues}`; + default: + return joinedValues; + } + } + + const separator = separatorObjectExplode(style); + const joinedValues = Object.entries(value) + .map(([key, v]) => + serializePrimitiveParam({ + allowReserved, + name: style === 'deepObject' ? `${name}[${key}]` : key, + value: v as string, + }), + ) + .join(separator); + return style === 'label' || style === 'matrix' ? separator + joinedValues : joinedValues; +}; diff --git a/packages/sdk/src/core/queryKeySerializer.gen.ts b/packages/sdk/src/core/queryKeySerializer.gen.ts new file mode 100644 index 00000000..5000df60 --- /dev/null +++ b/packages/sdk/src/core/queryKeySerializer.gen.ts @@ -0,0 +1,117 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * JSON-friendly union that mirrors what Pinia Colada can hash. + */ +export type JsonValue = + | null + | string + | number + | boolean + | JsonValue[] + | { [key: string]: JsonValue }; + +/** + * Replacer that converts non-JSON values (bigint, Date, etc.) to safe substitutes. + */ +export const queryKeyJsonReplacer = (_key: string, value: unknown) => { + if (value === undefined || typeof value === 'function' || typeof value === 'symbol') { + return undefined; + } + if (typeof value === 'bigint') { + return value.toString(); + } + if (value instanceof Date) { + return value.toISOString(); + } + return value; +}; + +/** + * Safely stringifies a value and parses it back into a JsonValue. + */ +export const stringifyToJsonValue = (input: unknown): JsonValue | undefined => { + try { + const json = JSON.stringify(input, queryKeyJsonReplacer); + if (json === undefined) { + return undefined; + } + return JSON.parse(json) as JsonValue; + } catch { + return undefined; + } +}; + +/** + * Detects plain objects (including objects with a null prototype). + */ +const isPlainObject = (value: unknown): value is Record => { + if (value === null || typeof value !== 'object') { + return false; + } + const prototype = Object.getPrototypeOf(value as object); + return prototype === Object.prototype || prototype === null; +}; + +/** + * Turns URLSearchParams into a sorted JSON object for deterministic keys. + */ +const serializeSearchParams = (params: URLSearchParams): JsonValue => { + const entries = Array.from(params.entries()).sort(([a], [b]) => a.localeCompare(b)); + const result: Record = {}; + + for (const [key, value] of entries) { + const existing = result[key]; + if (existing === undefined) { + result[key] = value; + continue; + } + + if (Array.isArray(existing)) { + (existing as string[]).push(value); + } else { + result[key] = [existing, value]; + } + } + + return result; +}; + +/** + * Normalizes any accepted value into a JSON-friendly shape for query keys. + */ +export const serializeQueryKeyValue = (value: unknown): JsonValue | undefined => { + if (value === null) { + return null; + } + + if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') { + return value; + } + + if (value === undefined || typeof value === 'function' || typeof value === 'symbol') { + return undefined; + } + + if (typeof value === 'bigint') { + return value.toString(); + } + + if (value instanceof Date) { + return value.toISOString(); + } + + if (Array.isArray(value)) { + return stringifyToJsonValue(value); + } + + if (typeof URLSearchParams !== 'undefined' && value instanceof URLSearchParams) { + return serializeSearchParams(value); + } + + if (isPlainObject(value)) { + return stringifyToJsonValue(value); + } + + return undefined; +}; diff --git a/packages/sdk/src/core/serverSentEvents.gen.ts b/packages/sdk/src/core/serverSentEvents.gen.ts new file mode 100644 index 00000000..6aa6cf02 --- /dev/null +++ b/packages/sdk/src/core/serverSentEvents.gen.ts @@ -0,0 +1,243 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Config } from './types.gen'; + +export type ServerSentEventsOptions = Omit & + Pick & { + /** + * 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; + /** + * Callback invoked when a network or parsing error occurs during streaming. + * + * This option applies only if the endpoint returns a stream of events. + * + * @param error The error that occurred. + */ + onSseError?: (error: unknown) => void; + /** + * Callback invoked when an event is streamed from the server. + * + * This option applies only if the endpoint returns a stream of events. + * + * @param event Event streamed from the server. + * @returns Nothing (void). + */ + onSseEvent?: (event: StreamEvent) => void; + serializedBody?: RequestInit['body']; + /** + * Default retry delay in milliseconds. + * + * This option applies only if the endpoint returns a stream of events. + * + * @default 3000 + */ + sseDefaultRetryDelay?: number; + /** + * Maximum number of retry attempts before giving up. + */ + sseMaxRetryAttempts?: number; + /** + * Maximum retry delay in milliseconds. + * + * Applies only when exponential backoff is used. + * + * This option applies only if the endpoint returns a stream of events. + * + * @default 30000 + */ + sseMaxRetryDelay?: number; + /** + * Optional sleep function for retry backoff. + * + * Defaults to using `setTimeout`. + */ + sseSleepFn?: (ms: number) => Promise; + url: string; + }; + +export interface StreamEvent { + data: TData; + event?: string; + id?: string; + retry?: number; +} + +export type ServerSentEventsResult = { + stream: AsyncGenerator< + TData extends Record ? TData[keyof TData] : TData, + TReturn, + TNext + >; +}; + +export const createSseClient = ({ + onRequest, + onSseError, + onSseEvent, + responseTransformer, + responseValidator, + sseDefaultRetryDelay, + sseMaxRetryAttempts, + sseMaxRetryDelay, + sseSleepFn, + url, + ...options +}: ServerSentEventsOptions): ServerSentEventsResult => { + let lastEventId: string | undefined; + + const sleep = sseSleepFn ?? ((ms: number) => new Promise((resolve) => setTimeout(resolve, ms))); + + const createStream = async function* () { + let retryDelay: number = sseDefaultRetryDelay ?? 3000; + let attempt = 0; + const signal = options.signal ?? new AbortController().signal; + + while (true) { + if (signal.aborted) break; + + attempt++; + + const headers = + options.headers instanceof Headers + ? options.headers + : new Headers(options.headers as Record | undefined); + + if (lastEventId !== undefined) { + headers.set('Last-Event-ID', lastEventId); + } + + try { + 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}`); + + if (!response.body) throw new Error('No body in SSE response'); + + const reader = response.body.pipeThrough(new TextDecoderStream()).getReader(); + + let buffer = ''; + + const abortHandler = () => { + try { + reader.cancel(); + } catch { + // noop + } + }; + + signal.addEventListener('abort', abortHandler); + + try { + while (true) { + const { done, value } = await reader.read(); + if (done) break; + buffer += value; + // Normalize line endings: CRLF -> LF, then CR -> LF + buffer = buffer.replace(/\r\n/g, '\n').replace(/\r/g, '\n'); + + const chunks = buffer.split('\n\n'); + buffer = chunks.pop() ?? ''; + + for (const chunk of chunks) { + const lines = chunk.split('\n'); + const dataLines: Array = []; + let eventName: string | undefined; + + for (const line of lines) { + if (line.startsWith('data:')) { + dataLines.push(line.replace(/^data:\s*/, '')); + } else if (line.startsWith('event:')) { + eventName = line.replace(/^event:\s*/, ''); + } else if (line.startsWith('id:')) { + lastEventId = line.replace(/^id:\s*/, ''); + } else if (line.startsWith('retry:')) { + const parsed = Number.parseInt(line.replace(/^retry:\s*/, ''), 10); + if (!Number.isNaN(parsed)) { + retryDelay = parsed; + } + } + } + + let data: unknown; + let parsedJson = false; + + if (dataLines.length) { + const rawData = dataLines.join('\n'); + try { + data = JSON.parse(rawData); + parsedJson = true; + } catch { + data = rawData; + } + } + + if (parsedJson) { + if (responseValidator) { + await responseValidator(data); + } + + if (responseTransformer) { + data = await responseTransformer(data); + } + } + + onSseEvent?.({ + data, + event: eventName, + id: lastEventId, + retry: retryDelay, + }); + + if (dataLines.length) { + yield data as any; + } + } + } + } finally { + signal.removeEventListener('abort', abortHandler); + reader.releaseLock(); + } + + break; // exit loop on normal completion + } catch (error) { + // connection failed or aborted; retry after delay + onSseError?.(error); + + if (sseMaxRetryAttempts !== undefined && attempt >= sseMaxRetryAttempts) { + break; // stop after firing error + } + + // exponential backoff: double retry each attempt, cap at 30s + const backoff = Math.min(retryDelay * 2 ** (attempt - 1), sseMaxRetryDelay ?? 30000); + await sleep(backoff); + } + } + }; + + const stream = createStream(); + + return { stream }; +}; diff --git a/packages/sdk/src/core/types.gen.ts b/packages/sdk/src/core/types.gen.ts new file mode 100644 index 00000000..97463257 --- /dev/null +++ b/packages/sdk/src/core/types.gen.ts @@ -0,0 +1,104 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Auth, AuthToken } from './auth.gen'; +import type { BodySerializer, QuerySerializer, QuerySerializerOptions } from './bodySerializer.gen'; + +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; + getConfig: () => Config; + request: RequestFn; + setConfig: (config: Config) => Config; +} & { + [K in HttpMethod]: MethodFn; +} & ([SseFn] extends [never] ? { sse?: never } : { sse: { [K in HttpMethod]: SseFn } }); + +export interface Config { + /** + * Auth token or a function returning auth token. The resolved value will be + * added to the request payload as defined by its `security` array. + */ + auth?: ((auth: Auth) => Promise | AuthToken) | AuthToken; + /** + * A function for serializing request body parameter. By default, + * {@link JSON.stringify()} will be used. + */ + bodySerializer?: BodySerializer | null; + /** + * An object containing any HTTP headers that you want to pre-populate your + * `Headers` object with. + * + * {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more} + */ + headers?: + | RequestInit['headers'] + | Record< + string, + string | number | boolean | (string | number | boolean)[] | null | undefined | unknown + >; + /** + * The request method. + * + * {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more} + */ + method?: Uppercase; + /** + * A function for serializing request query parameters. By default, arrays + * will be exploded in form style, objects will be exploded in deepObject + * style, and reserved characters are percent-encoded. + * + * This method will have no effect if the native `paramsSerializer()` Axios + * API function is used. + * + * {@link https://swagger.io/docs/specification/serialization/#query View examples} + */ + querySerializer?: QuerySerializer | QuerySerializerOptions; + /** + * A function validating request data. This is useful if you want to ensure + * the request conforms to the desired shape, so it can be safely sent to + * the server. + */ + requestValidator?: (data: unknown) => Promise; + /** + * A function transforming response data before it's returned. This is useful + * for post-processing data, e.g. converting ISO strings into Date objects. + */ + responseTransformer?: (data: unknown) => Promise; + /** + * A function validating response data. This is useful if you want to ensure + * the response conforms to the desired shape, so it can be safely passed to + * the transformers and returned to the user. + */ + responseValidator?: (data: unknown) => Promise; +} + +type IsExactlyNeverOrNeverUndefined = [T] extends [never] + ? true + : [T] extends [never | undefined] + ? [undefined] extends [T] + ? false + : true + : false; + +export type OmitNever> = { + [K in keyof T as IsExactlyNeverOrNeverUndefined extends true ? never : K]: T[K]; +}; diff --git a/packages/sdk/src/core/utils.gen.ts b/packages/sdk/src/core/utils.gen.ts new file mode 100644 index 00000000..e7ddbe35 --- /dev/null +++ b/packages/sdk/src/core/utils.gen.ts @@ -0,0 +1,140 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { BodySerializer, QuerySerializer } from './bodySerializer.gen'; +import { + type ArraySeparatorStyle, + serializeArrayParam, + serializeObjectParam, + serializePrimitiveParam, +} from './pathSerializer.gen'; + +export interface PathSerializer { + path: Record; + url: string; +} + +export const PATH_PARAM_RE = /\{[^{}]+\}/g; + +export const defaultPathSerializer = ({ path, url: _url }: PathSerializer) => { + let url = _url; + const matches = _url.match(PATH_PARAM_RE); + if (matches) { + for (const match of matches) { + let explode = false; + let name = match.substring(1, match.length - 1); + let style: ArraySeparatorStyle = 'simple'; + + if (name.endsWith('*')) { + explode = true; + name = name.substring(0, name.length - 1); + } + + if (name.startsWith('.')) { + name = name.substring(1); + style = 'label'; + } else if (name.startsWith(';')) { + name = name.substring(1); + style = 'matrix'; + } + + const value = path[name]; + + if (value === undefined || value === null) { + continue; + } + + if (Array.isArray(value)) { + url = url.replace(match, serializeArrayParam({ explode, name, style, value })); + continue; + } + + if (typeof value === 'object') { + url = url.replace( + match, + serializeObjectParam({ + explode, + name, + style, + value: value as Record, + valueOnly: true, + }), + ); + continue; + } + + if (style === 'matrix') { + url = url.replace( + match, + `;${serializePrimitiveParam({ + name, + value: value as string, + })}`, + ); + continue; + } + + const replaceValue = encodeURIComponent( + style === 'label' ? `.${value as string}` : (value as string), + ); + url = url.replace(match, replaceValue); + } + } + return url; +}; + +export const getUrl = ({ + baseUrl, + path, + query, + querySerializer, + url: _url, +}: { + baseUrl?: string; + path?: Record; + query?: Record; + querySerializer: QuerySerializer; + url: string; +}) => { + const pathUrl = _url.startsWith('/') ? _url : `/${_url}`; + let url = (baseUrl ?? '') + pathUrl; + if (path) { + url = defaultPathSerializer({ path, url }); + } + let search = query ? querySerializer(query) : ''; + if (search.startsWith('?')) { + search = search.substring(1); + } + if (search) { + url += `?${search}`; + } + 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; +} diff --git a/packages/sdk/src/index.ts b/packages/sdk/src/index.ts new file mode 100644 index 00000000..904fad11 --- /dev/null +++ b/packages/sdk/src/index.ts @@ -0,0 +1,4 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export { deleteBotsByBotIdContainer, deleteBotsByBotIdContainerFs, deleteBotsByBotIdContainerSkills, deleteBotsByBotIdHistory, deleteBotsByBotIdHistoryById, deleteBotsByBotIdMcpById, deleteBotsByBotIdMemoryMemories, deleteBotsByBotIdMemoryMemoriesByMemoryId, deleteBotsByBotIdScheduleById, deleteBotsByBotIdSettings, deleteBotsByBotIdSubagentsById, deleteBotsById, deleteBotsByIdMembersByUserId, deleteModelsById, deleteModelsModelByModelId, deleteProvidersById, getBots, getBotsByBotIdContainer, getBotsByBotIdContainerFs, getBotsByBotIdContainerFsFile, getBotsByBotIdContainerFsStat, getBotsByBotIdContainerFsUsage, getBotsByBotIdContainerSkills, getBotsByBotIdContainerSnapshots, getBotsByBotIdHistory, getBotsByBotIdHistoryById, getBotsByBotIdMcp, getBotsByBotIdMcpById, getBotsByBotIdMemoryMemories, getBotsByBotIdMemoryMemoriesByMemoryId, getBotsByBotIdSchedule, getBotsByBotIdScheduleById, getBotsByBotIdSettings, getBotsByBotIdSubagents, getBotsByBotIdSubagentsById, getBotsByBotIdSubagentsByIdContext, getBotsByBotIdSubagentsByIdSkills, getBotsById, getBotsByIdChannelByPlatform, getBotsByIdMembers, getChannels, getChannelsByPlatform, getModels, getModelsById, getModelsCount, getModelsModelByModelId, getProviders, getProvidersById, getProvidersByIdModels, getProvidersCount, getProvidersNameByName, getUsers, getUsersById, getUsersMe, getUsersMeChannelsByPlatform, type Options, postAuthLogin, postBots, postBotsByBotIdChat, postBotsByBotIdChatStream, postBotsByBotIdContainer, postBotsByBotIdContainerFsDir, postBotsByBotIdContainerFsFile, postBotsByBotIdContainerFsMcp, postBotsByBotIdContainerFsUpload, postBotsByBotIdContainerSkills, postBotsByBotIdContainerSnapshots, postBotsByBotIdContainerStart, postBotsByBotIdContainerStop, postBotsByBotIdHistory, postBotsByBotIdMcp, postBotsByBotIdMcpStdio, postBotsByBotIdMcpStdioBySessionId, postBotsByBotIdMemoryAdd, postBotsByBotIdMemoryEmbed, postBotsByBotIdMemorySearch, postBotsByBotIdMemoryUpdate, postBotsByBotIdSchedule, postBotsByBotIdSettings, postBotsByBotIdSubagents, postBotsByBotIdSubagentsByIdSkills, postBotsByIdChannelByPlatformSend, postBotsByIdChannelByPlatformSendSession, postEmbeddings, postModels, postModelsEnable, postProviders, postUsers, putBotsByBotIdMcpById, putBotsByBotIdScheduleById, putBotsByBotIdSettings, putBotsByBotIdSubagentsById, putBotsByBotIdSubagentsByIdContext, putBotsByBotIdSubagentsByIdSkills, putBotsById, putBotsByIdChannelByPlatform, putBotsByIdMembers, putBotsByIdOwner, putModelsById, putModelsModelByModelId, putProvidersById, putUsersById, putUsersByIdPassword, putUsersMe, putUsersMeChannelsByPlatform, putUsersMePassword } from './sdk.gen'; +export type { BotsBot, BotsBotMember, BotsCreateBotRequest, BotsListBotsResponse, BotsListMembersResponse, BotsTransferBotRequest, BotsUpdateBotRequest, BotsUpsertMemberRequest, ChannelAction, ChannelAttachment, ChannelAttachmentType, ChannelChannelCapabilities, ChannelChannelConfig, ChannelChannelUserBinding, ChannelConfigSchema, ChannelFieldSchema, ChannelFieldType, ChannelMessage, ChannelMessageFormat, ChannelMessagePart, ChannelMessagePartType, ChannelMessageTextStyle, ChannelReplyRef, ChannelSendRequest, ChannelTargetHint, ChannelTargetSpec, ChannelThreadRef, ChannelUpsertConfigRequest, ChannelUpsertUserConfigRequest, ChatChatRequest, ChatChatResponse, ChatModelMessage, ChatToolCall, ChatToolCallFunction, ClientOptions, DeleteBotsByBotIdContainerData, DeleteBotsByBotIdContainerError, DeleteBotsByBotIdContainerErrors, DeleteBotsByBotIdContainerFsData, DeleteBotsByBotIdContainerFsError, DeleteBotsByBotIdContainerFsErrors, DeleteBotsByBotIdContainerFsResponse, DeleteBotsByBotIdContainerFsResponses, DeleteBotsByBotIdContainerResponses, DeleteBotsByBotIdContainerSkillsData, DeleteBotsByBotIdContainerSkillsError, DeleteBotsByBotIdContainerSkillsErrors, DeleteBotsByBotIdContainerSkillsResponse, DeleteBotsByBotIdContainerSkillsResponses, DeleteBotsByBotIdHistoryByIdData, DeleteBotsByBotIdHistoryByIdError, DeleteBotsByBotIdHistoryByIdErrors, DeleteBotsByBotIdHistoryByIdResponses, DeleteBotsByBotIdHistoryData, DeleteBotsByBotIdHistoryError, DeleteBotsByBotIdHistoryErrors, DeleteBotsByBotIdHistoryResponses, DeleteBotsByBotIdMcpByIdData, DeleteBotsByBotIdMcpByIdError, DeleteBotsByBotIdMcpByIdErrors, DeleteBotsByBotIdMcpByIdResponses, DeleteBotsByBotIdMemoryMemoriesByMemoryIdData, DeleteBotsByBotIdMemoryMemoriesByMemoryIdError, DeleteBotsByBotIdMemoryMemoriesByMemoryIdErrors, DeleteBotsByBotIdMemoryMemoriesByMemoryIdResponse, DeleteBotsByBotIdMemoryMemoriesByMemoryIdResponses, DeleteBotsByBotIdMemoryMemoriesData, DeleteBotsByBotIdMemoryMemoriesError, DeleteBotsByBotIdMemoryMemoriesErrors, DeleteBotsByBotIdMemoryMemoriesResponse, DeleteBotsByBotIdMemoryMemoriesResponses, DeleteBotsByBotIdScheduleByIdData, DeleteBotsByBotIdScheduleByIdError, DeleteBotsByBotIdScheduleByIdErrors, DeleteBotsByBotIdScheduleByIdResponses, DeleteBotsByBotIdSettingsData, DeleteBotsByBotIdSettingsError, DeleteBotsByBotIdSettingsErrors, DeleteBotsByBotIdSettingsResponses, DeleteBotsByBotIdSubagentsByIdData, DeleteBotsByBotIdSubagentsByIdError, DeleteBotsByBotIdSubagentsByIdErrors, DeleteBotsByBotIdSubagentsByIdResponses, DeleteBotsByIdData, DeleteBotsByIdError, DeleteBotsByIdErrors, DeleteBotsByIdMembersByUserIdData, DeleteBotsByIdMembersByUserIdError, DeleteBotsByIdMembersByUserIdErrors, DeleteBotsByIdMembersByUserIdResponses, DeleteBotsByIdResponses, DeleteModelsByIdData, DeleteModelsByIdError, DeleteModelsByIdErrors, DeleteModelsByIdResponses, DeleteModelsModelByModelIdData, DeleteModelsModelByModelIdError, DeleteModelsModelByModelIdErrors, DeleteModelsModelByModelIdResponses, DeleteProvidersByIdData, DeleteProvidersByIdError, DeleteProvidersByIdErrors, DeleteProvidersByIdResponses, GetBotsByBotIdContainerData, GetBotsByBotIdContainerError, GetBotsByBotIdContainerErrors, GetBotsByBotIdContainerFsData, GetBotsByBotIdContainerFsError, GetBotsByBotIdContainerFsErrors, GetBotsByBotIdContainerFsFileData, GetBotsByBotIdContainerFsFileError, GetBotsByBotIdContainerFsFileErrors, GetBotsByBotIdContainerFsFileResponse, GetBotsByBotIdContainerFsFileResponses, GetBotsByBotIdContainerFsResponse, GetBotsByBotIdContainerFsResponses, GetBotsByBotIdContainerFsStatData, GetBotsByBotIdContainerFsStatError, GetBotsByBotIdContainerFsStatErrors, GetBotsByBotIdContainerFsStatResponse, GetBotsByBotIdContainerFsStatResponses, GetBotsByBotIdContainerFsUsageData, GetBotsByBotIdContainerFsUsageError, GetBotsByBotIdContainerFsUsageErrors, GetBotsByBotIdContainerFsUsageResponse, GetBotsByBotIdContainerFsUsageResponses, GetBotsByBotIdContainerResponse, GetBotsByBotIdContainerResponses, GetBotsByBotIdContainerSkillsData, GetBotsByBotIdContainerSkillsError, GetBotsByBotIdContainerSkillsErrors, GetBotsByBotIdContainerSkillsResponse, GetBotsByBotIdContainerSkillsResponses, GetBotsByBotIdContainerSnapshotsData, GetBotsByBotIdContainerSnapshotsResponse, GetBotsByBotIdContainerSnapshotsResponses, GetBotsByBotIdHistoryByIdData, GetBotsByBotIdHistoryByIdError, GetBotsByBotIdHistoryByIdErrors, GetBotsByBotIdHistoryByIdResponse, GetBotsByBotIdHistoryByIdResponses, GetBotsByBotIdHistoryData, GetBotsByBotIdHistoryError, GetBotsByBotIdHistoryErrors, GetBotsByBotIdHistoryResponse, GetBotsByBotIdHistoryResponses, GetBotsByBotIdMcpByIdData, GetBotsByBotIdMcpByIdError, GetBotsByBotIdMcpByIdErrors, GetBotsByBotIdMcpByIdResponse, GetBotsByBotIdMcpByIdResponses, GetBotsByBotIdMcpData, GetBotsByBotIdMcpError, GetBotsByBotIdMcpErrors, GetBotsByBotIdMcpResponse, GetBotsByBotIdMcpResponses, GetBotsByBotIdMemoryMemoriesByMemoryIdData, GetBotsByBotIdMemoryMemoriesByMemoryIdError, GetBotsByBotIdMemoryMemoriesByMemoryIdErrors, GetBotsByBotIdMemoryMemoriesByMemoryIdResponse, GetBotsByBotIdMemoryMemoriesByMemoryIdResponses, GetBotsByBotIdMemoryMemoriesData, GetBotsByBotIdMemoryMemoriesError, GetBotsByBotIdMemoryMemoriesErrors, GetBotsByBotIdMemoryMemoriesResponse, GetBotsByBotIdMemoryMemoriesResponses, GetBotsByBotIdScheduleByIdData, GetBotsByBotIdScheduleByIdError, GetBotsByBotIdScheduleByIdErrors, GetBotsByBotIdScheduleByIdResponse, GetBotsByBotIdScheduleByIdResponses, GetBotsByBotIdScheduleData, GetBotsByBotIdScheduleError, GetBotsByBotIdScheduleErrors, GetBotsByBotIdScheduleResponse, GetBotsByBotIdScheduleResponses, GetBotsByBotIdSettingsData, GetBotsByBotIdSettingsError, GetBotsByBotIdSettingsErrors, GetBotsByBotIdSettingsResponse, GetBotsByBotIdSettingsResponses, GetBotsByBotIdSubagentsByIdContextData, GetBotsByBotIdSubagentsByIdContextError, GetBotsByBotIdSubagentsByIdContextErrors, GetBotsByBotIdSubagentsByIdContextResponse, GetBotsByBotIdSubagentsByIdContextResponses, GetBotsByBotIdSubagentsByIdData, GetBotsByBotIdSubagentsByIdError, GetBotsByBotIdSubagentsByIdErrors, GetBotsByBotIdSubagentsByIdResponse, GetBotsByBotIdSubagentsByIdResponses, GetBotsByBotIdSubagentsByIdSkillsData, GetBotsByBotIdSubagentsByIdSkillsError, GetBotsByBotIdSubagentsByIdSkillsErrors, GetBotsByBotIdSubagentsByIdSkillsResponse, GetBotsByBotIdSubagentsByIdSkillsResponses, GetBotsByBotIdSubagentsData, GetBotsByBotIdSubagentsError, GetBotsByBotIdSubagentsErrors, GetBotsByBotIdSubagentsResponse, GetBotsByBotIdSubagentsResponses, GetBotsByIdChannelByPlatformData, GetBotsByIdChannelByPlatformError, GetBotsByIdChannelByPlatformErrors, GetBotsByIdChannelByPlatformResponse, GetBotsByIdChannelByPlatformResponses, GetBotsByIdData, GetBotsByIdError, GetBotsByIdErrors, GetBotsByIdMembersData, GetBotsByIdMembersError, GetBotsByIdMembersErrors, GetBotsByIdMembersResponse, GetBotsByIdMembersResponses, GetBotsByIdResponse, GetBotsByIdResponses, GetBotsData, GetBotsError, GetBotsErrors, GetBotsResponse, GetBotsResponses, GetChannelsByPlatformData, GetChannelsByPlatformError, GetChannelsByPlatformErrors, GetChannelsByPlatformResponse, GetChannelsByPlatformResponses, GetChannelsData, GetChannelsError, GetChannelsErrors, GetChannelsResponse, GetChannelsResponses, GetModelsByIdData, GetModelsByIdError, GetModelsByIdErrors, GetModelsByIdResponse, GetModelsByIdResponses, GetModelsCountData, GetModelsCountError, GetModelsCountErrors, GetModelsCountResponse, GetModelsCountResponses, GetModelsData, GetModelsError, GetModelsErrors, GetModelsModelByModelIdData, GetModelsModelByModelIdError, GetModelsModelByModelIdErrors, GetModelsModelByModelIdResponse, GetModelsModelByModelIdResponses, GetModelsResponse, GetModelsResponses, GetProvidersByIdData, GetProvidersByIdError, GetProvidersByIdErrors, GetProvidersByIdModelsData, GetProvidersByIdModelsError, GetProvidersByIdModelsErrors, GetProvidersByIdModelsResponse, GetProvidersByIdModelsResponses, GetProvidersByIdResponse, GetProvidersByIdResponses, GetProvidersCountData, GetProvidersCountError, GetProvidersCountErrors, GetProvidersCountResponse, GetProvidersCountResponses, GetProvidersData, GetProvidersError, GetProvidersErrors, GetProvidersNameByNameData, GetProvidersNameByNameError, GetProvidersNameByNameErrors, GetProvidersNameByNameResponse, GetProvidersNameByNameResponses, GetProvidersResponse, GetProvidersResponses, GetUsersByIdData, GetUsersByIdError, GetUsersByIdErrors, GetUsersByIdResponse, GetUsersByIdResponses, GetUsersData, GetUsersError, GetUsersErrors, GetUsersMeChannelsByPlatformData, GetUsersMeChannelsByPlatformError, GetUsersMeChannelsByPlatformErrors, GetUsersMeChannelsByPlatformResponse, GetUsersMeChannelsByPlatformResponses, GetUsersMeData, GetUsersMeError, GetUsersMeErrors, GetUsersMeResponse, GetUsersMeResponses, GetUsersResponse, GetUsersResponses, GithubComMemohaiMemohInternalMcpConnection, HandlersChannelMeta, HandlersCreateContainerRequest, HandlersCreateContainerResponse, HandlersCreateSnapshotRequest, HandlersCreateSnapshotResponse, HandlersEmbeddingsInput, HandlersEmbeddingsRequest, HandlersEmbeddingsResponse, HandlersEmbeddingsUsage, HandlersEnableModelRequest, HandlersErrorResponse, HandlersFsDeleteResponse, HandlersFsListResponse, HandlersFsMkdirRequest, HandlersFsReadResponse, HandlersFsRestEntry, HandlersFsStatResponse, HandlersFsUsageResponse, HandlersFsWriteRequest, HandlersFsWriteResponse, HandlersGetContainerResponse, HandlersListSnapshotsResponse, HandlersLoginRequest, HandlersLoginResponse, HandlersMcpStdioRequest, HandlersMcpStdioResponse, HandlersMemoryAddPayload, HandlersMemoryDeleteAllPayload, HandlersMemoryEmbedUpsertPayload, HandlersMemorySearchPayload, HandlersSkillItem, HandlersSkillsDeleteRequest, HandlersSkillsOpResponse, HandlersSkillsResponse, HandlersSkillsUpsertRequest, HandlersSnapshotInfo, HistoryCreateRequest, HistoryListResponse, HistoryRecord, McpListResponse, McpUpsertRequest, MemoryDeleteResponse, MemoryEmbedInput, MemoryEmbedUpsertResponse, MemoryMemoryItem, MemoryMessage, MemorySearchResponse, MemoryUpdateRequest, ModelsAddRequest, ModelsAddResponse, ModelsCountResponse, ModelsGetResponse, ModelsModelType, ModelsUpdateRequest, PostAuthLoginData, PostAuthLoginError, PostAuthLoginErrors, PostAuthLoginResponse, PostAuthLoginResponses, PostBotsByBotIdChatData, PostBotsByBotIdChatError, PostBotsByBotIdChatErrors, PostBotsByBotIdChatResponse, PostBotsByBotIdChatResponses, PostBotsByBotIdChatStreamData, PostBotsByBotIdChatStreamError, PostBotsByBotIdChatStreamErrors, PostBotsByBotIdChatStreamResponse, PostBotsByBotIdChatStreamResponses, PostBotsByBotIdContainerData, PostBotsByBotIdContainerError, PostBotsByBotIdContainerErrors, PostBotsByBotIdContainerFsDirData, PostBotsByBotIdContainerFsDirError, PostBotsByBotIdContainerFsDirErrors, PostBotsByBotIdContainerFsDirResponse, PostBotsByBotIdContainerFsDirResponses, PostBotsByBotIdContainerFsFileData, PostBotsByBotIdContainerFsFileError, PostBotsByBotIdContainerFsFileErrors, PostBotsByBotIdContainerFsFileResponse, PostBotsByBotIdContainerFsFileResponses, PostBotsByBotIdContainerFsMcpData, PostBotsByBotIdContainerFsMcpError, PostBotsByBotIdContainerFsMcpErrors, PostBotsByBotIdContainerFsMcpResponse, PostBotsByBotIdContainerFsMcpResponses, PostBotsByBotIdContainerFsUploadData, PostBotsByBotIdContainerFsUploadError, PostBotsByBotIdContainerFsUploadErrors, PostBotsByBotIdContainerFsUploadResponse, PostBotsByBotIdContainerFsUploadResponses, PostBotsByBotIdContainerResponse, PostBotsByBotIdContainerResponses, PostBotsByBotIdContainerSkillsData, PostBotsByBotIdContainerSkillsError, PostBotsByBotIdContainerSkillsErrors, PostBotsByBotIdContainerSkillsResponse, PostBotsByBotIdContainerSkillsResponses, PostBotsByBotIdContainerSnapshotsData, PostBotsByBotIdContainerSnapshotsError, PostBotsByBotIdContainerSnapshotsErrors, PostBotsByBotIdContainerSnapshotsResponse, PostBotsByBotIdContainerSnapshotsResponses, PostBotsByBotIdContainerStartData, PostBotsByBotIdContainerStartError, PostBotsByBotIdContainerStartErrors, PostBotsByBotIdContainerStartResponse, PostBotsByBotIdContainerStartResponses, PostBotsByBotIdContainerStopData, PostBotsByBotIdContainerStopError, PostBotsByBotIdContainerStopErrors, PostBotsByBotIdContainerStopResponse, PostBotsByBotIdContainerStopResponses, PostBotsByBotIdHistoryData, PostBotsByBotIdHistoryError, PostBotsByBotIdHistoryErrors, PostBotsByBotIdHistoryResponse, PostBotsByBotIdHistoryResponses, PostBotsByBotIdMcpData, PostBotsByBotIdMcpError, PostBotsByBotIdMcpErrors, PostBotsByBotIdMcpResponse, PostBotsByBotIdMcpResponses, PostBotsByBotIdMcpStdioBySessionIdData, PostBotsByBotIdMcpStdioBySessionIdError, PostBotsByBotIdMcpStdioBySessionIdErrors, PostBotsByBotIdMcpStdioBySessionIdResponse, PostBotsByBotIdMcpStdioBySessionIdResponses, PostBotsByBotIdMcpStdioData, PostBotsByBotIdMcpStdioError, PostBotsByBotIdMcpStdioErrors, PostBotsByBotIdMcpStdioResponse, PostBotsByBotIdMcpStdioResponses, PostBotsByBotIdMemoryAddData, PostBotsByBotIdMemoryAddError, PostBotsByBotIdMemoryAddErrors, PostBotsByBotIdMemoryAddResponse, PostBotsByBotIdMemoryAddResponses, PostBotsByBotIdMemoryEmbedData, PostBotsByBotIdMemoryEmbedError, PostBotsByBotIdMemoryEmbedErrors, PostBotsByBotIdMemoryEmbedResponse, PostBotsByBotIdMemoryEmbedResponses, PostBotsByBotIdMemorySearchData, PostBotsByBotIdMemorySearchError, PostBotsByBotIdMemorySearchErrors, PostBotsByBotIdMemorySearchResponse, PostBotsByBotIdMemorySearchResponses, PostBotsByBotIdMemoryUpdateData, PostBotsByBotIdMemoryUpdateError, PostBotsByBotIdMemoryUpdateErrors, PostBotsByBotIdMemoryUpdateResponse, PostBotsByBotIdMemoryUpdateResponses, PostBotsByBotIdScheduleData, PostBotsByBotIdScheduleError, PostBotsByBotIdScheduleErrors, PostBotsByBotIdScheduleResponse, PostBotsByBotIdScheduleResponses, PostBotsByBotIdSettingsData, PostBotsByBotIdSettingsError, PostBotsByBotIdSettingsErrors, PostBotsByBotIdSettingsResponse, PostBotsByBotIdSettingsResponses, PostBotsByBotIdSubagentsByIdSkillsData, PostBotsByBotIdSubagentsByIdSkillsError, PostBotsByBotIdSubagentsByIdSkillsErrors, PostBotsByBotIdSubagentsByIdSkillsResponse, PostBotsByBotIdSubagentsByIdSkillsResponses, PostBotsByBotIdSubagentsData, PostBotsByBotIdSubagentsError, PostBotsByBotIdSubagentsErrors, PostBotsByBotIdSubagentsResponse, PostBotsByBotIdSubagentsResponses, PostBotsByIdChannelByPlatformSendData, PostBotsByIdChannelByPlatformSendError, PostBotsByIdChannelByPlatformSendErrors, PostBotsByIdChannelByPlatformSendResponse, PostBotsByIdChannelByPlatformSendResponses, PostBotsByIdChannelByPlatformSendSessionData, PostBotsByIdChannelByPlatformSendSessionError, PostBotsByIdChannelByPlatformSendSessionErrors, PostBotsByIdChannelByPlatformSendSessionResponse, PostBotsByIdChannelByPlatformSendSessionResponses, PostBotsData, PostBotsError, PostBotsErrors, PostBotsResponse, PostBotsResponses, PostEmbeddingsData, PostEmbeddingsError, PostEmbeddingsErrors, PostEmbeddingsResponse, PostEmbeddingsResponses, PostModelsData, PostModelsEnableData, PostModelsEnableError, PostModelsEnableErrors, PostModelsEnableResponse, PostModelsEnableResponses, PostModelsError, PostModelsErrors, PostModelsResponse, PostModelsResponses, PostProvidersData, PostProvidersError, PostProvidersErrors, PostProvidersResponse, PostProvidersResponses, PostUsersData, PostUsersError, PostUsersErrors, PostUsersResponse, PostUsersResponses, ProvidersClientType, ProvidersCountResponse, ProvidersCreateRequest, ProvidersGetResponse, ProvidersUpdateRequest, PutBotsByBotIdMcpByIdData, PutBotsByBotIdMcpByIdError, PutBotsByBotIdMcpByIdErrors, PutBotsByBotIdMcpByIdResponse, PutBotsByBotIdMcpByIdResponses, PutBotsByBotIdScheduleByIdData, PutBotsByBotIdScheduleByIdError, PutBotsByBotIdScheduleByIdErrors, PutBotsByBotIdScheduleByIdResponse, PutBotsByBotIdScheduleByIdResponses, PutBotsByBotIdSettingsData, PutBotsByBotIdSettingsError, PutBotsByBotIdSettingsErrors, PutBotsByBotIdSettingsResponse, PutBotsByBotIdSettingsResponses, PutBotsByBotIdSubagentsByIdContextData, PutBotsByBotIdSubagentsByIdContextError, PutBotsByBotIdSubagentsByIdContextErrors, PutBotsByBotIdSubagentsByIdContextResponse, PutBotsByBotIdSubagentsByIdContextResponses, PutBotsByBotIdSubagentsByIdData, PutBotsByBotIdSubagentsByIdError, PutBotsByBotIdSubagentsByIdErrors, PutBotsByBotIdSubagentsByIdResponse, PutBotsByBotIdSubagentsByIdResponses, PutBotsByBotIdSubagentsByIdSkillsData, PutBotsByBotIdSubagentsByIdSkillsError, PutBotsByBotIdSubagentsByIdSkillsErrors, PutBotsByBotIdSubagentsByIdSkillsResponse, PutBotsByBotIdSubagentsByIdSkillsResponses, PutBotsByIdChannelByPlatformData, PutBotsByIdChannelByPlatformError, PutBotsByIdChannelByPlatformErrors, PutBotsByIdChannelByPlatformResponse, PutBotsByIdChannelByPlatformResponses, PutBotsByIdData, PutBotsByIdError, PutBotsByIdErrors, PutBotsByIdMembersData, PutBotsByIdMembersError, PutBotsByIdMembersErrors, PutBotsByIdMembersResponse, PutBotsByIdMembersResponses, PutBotsByIdOwnerData, PutBotsByIdOwnerError, PutBotsByIdOwnerErrors, PutBotsByIdOwnerResponse, PutBotsByIdOwnerResponses, PutBotsByIdResponse, PutBotsByIdResponses, PutModelsByIdData, PutModelsByIdError, PutModelsByIdErrors, PutModelsByIdResponse, PutModelsByIdResponses, PutModelsModelByModelIdData, PutModelsModelByModelIdError, PutModelsModelByModelIdErrors, PutModelsModelByModelIdResponse, PutModelsModelByModelIdResponses, PutProvidersByIdData, PutProvidersByIdError, PutProvidersByIdErrors, PutProvidersByIdResponse, PutProvidersByIdResponses, PutUsersByIdData, PutUsersByIdError, PutUsersByIdErrors, PutUsersByIdPasswordData, PutUsersByIdPasswordError, PutUsersByIdPasswordErrors, PutUsersByIdPasswordResponses, PutUsersByIdResponse, PutUsersByIdResponses, PutUsersMeChannelsByPlatformData, PutUsersMeChannelsByPlatformError, PutUsersMeChannelsByPlatformErrors, PutUsersMeChannelsByPlatformResponse, PutUsersMeChannelsByPlatformResponses, PutUsersMeData, PutUsersMeError, PutUsersMeErrors, PutUsersMePasswordData, PutUsersMePasswordError, PutUsersMePasswordErrors, PutUsersMePasswordResponses, PutUsersMeResponse, PutUsersMeResponses, ScheduleCreateRequest, ScheduleListResponse, ScheduleNullableInt, ScheduleSchedule, ScheduleUpdateRequest, SettingsSettings, SettingsUpsertRequest, SubagentAddSkillsRequest, SubagentContextResponse, SubagentCreateRequest, SubagentListResponse, SubagentSkillsResponse, SubagentSubagent, SubagentUpdateContextRequest, SubagentUpdateRequest, SubagentUpdateSkillsRequest, UsersCreateUserRequest, UsersListUsersResponse, UsersResetPasswordRequest, UsersUpdatePasswordRequest, UsersUpdateProfileRequest, UsersUpdateUserRequest, UsersUser } from './types.gen'; diff --git a/packages/sdk/src/sdk.gen.ts b/packages/sdk/src/sdk.gen.ts new file mode 100644 index 00000000..47aa6e21 --- /dev/null +++ b/packages/sdk/src/sdk.gen.ts @@ -0,0 +1,1075 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Client, Options as Options2, TDataShape } from './client'; +import { client } from './client.gen'; +import type { DeleteBotsByBotIdContainerData, DeleteBotsByBotIdContainerErrors, DeleteBotsByBotIdContainerFsData, DeleteBotsByBotIdContainerFsErrors, DeleteBotsByBotIdContainerFsResponses, DeleteBotsByBotIdContainerResponses, DeleteBotsByBotIdContainerSkillsData, DeleteBotsByBotIdContainerSkillsErrors, DeleteBotsByBotIdContainerSkillsResponses, DeleteBotsByBotIdHistoryByIdData, DeleteBotsByBotIdHistoryByIdErrors, DeleteBotsByBotIdHistoryByIdResponses, DeleteBotsByBotIdHistoryData, DeleteBotsByBotIdHistoryErrors, DeleteBotsByBotIdHistoryResponses, DeleteBotsByBotIdMcpByIdData, DeleteBotsByBotIdMcpByIdErrors, DeleteBotsByBotIdMcpByIdResponses, DeleteBotsByBotIdMemoryMemoriesByMemoryIdData, DeleteBotsByBotIdMemoryMemoriesByMemoryIdErrors, DeleteBotsByBotIdMemoryMemoriesByMemoryIdResponses, DeleteBotsByBotIdMemoryMemoriesData, DeleteBotsByBotIdMemoryMemoriesErrors, DeleteBotsByBotIdMemoryMemoriesResponses, DeleteBotsByBotIdScheduleByIdData, DeleteBotsByBotIdScheduleByIdErrors, DeleteBotsByBotIdScheduleByIdResponses, DeleteBotsByBotIdSettingsData, DeleteBotsByBotIdSettingsErrors, DeleteBotsByBotIdSettingsResponses, DeleteBotsByBotIdSubagentsByIdData, DeleteBotsByBotIdSubagentsByIdErrors, DeleteBotsByBotIdSubagentsByIdResponses, DeleteBotsByIdData, DeleteBotsByIdErrors, DeleteBotsByIdMembersByUserIdData, DeleteBotsByIdMembersByUserIdErrors, DeleteBotsByIdMembersByUserIdResponses, DeleteBotsByIdResponses, DeleteModelsByIdData, DeleteModelsByIdErrors, DeleteModelsByIdResponses, DeleteModelsModelByModelIdData, DeleteModelsModelByModelIdErrors, DeleteModelsModelByModelIdResponses, DeleteProvidersByIdData, DeleteProvidersByIdErrors, DeleteProvidersByIdResponses, GetBotsByBotIdContainerData, GetBotsByBotIdContainerErrors, GetBotsByBotIdContainerFsData, GetBotsByBotIdContainerFsErrors, GetBotsByBotIdContainerFsFileData, GetBotsByBotIdContainerFsFileErrors, GetBotsByBotIdContainerFsFileResponses, GetBotsByBotIdContainerFsResponses, GetBotsByBotIdContainerFsStatData, GetBotsByBotIdContainerFsStatErrors, GetBotsByBotIdContainerFsStatResponses, GetBotsByBotIdContainerFsUsageData, GetBotsByBotIdContainerFsUsageErrors, GetBotsByBotIdContainerFsUsageResponses, GetBotsByBotIdContainerResponses, GetBotsByBotIdContainerSkillsData, GetBotsByBotIdContainerSkillsErrors, GetBotsByBotIdContainerSkillsResponses, GetBotsByBotIdContainerSnapshotsData, GetBotsByBotIdContainerSnapshotsResponses, GetBotsByBotIdHistoryByIdData, GetBotsByBotIdHistoryByIdErrors, GetBotsByBotIdHistoryByIdResponses, GetBotsByBotIdHistoryData, GetBotsByBotIdHistoryErrors, GetBotsByBotIdHistoryResponses, GetBotsByBotIdMcpByIdData, GetBotsByBotIdMcpByIdErrors, GetBotsByBotIdMcpByIdResponses, GetBotsByBotIdMcpData, GetBotsByBotIdMcpErrors, GetBotsByBotIdMcpResponses, GetBotsByBotIdMemoryMemoriesByMemoryIdData, GetBotsByBotIdMemoryMemoriesByMemoryIdErrors, GetBotsByBotIdMemoryMemoriesByMemoryIdResponses, GetBotsByBotIdMemoryMemoriesData, GetBotsByBotIdMemoryMemoriesErrors, GetBotsByBotIdMemoryMemoriesResponses, GetBotsByBotIdScheduleByIdData, GetBotsByBotIdScheduleByIdErrors, GetBotsByBotIdScheduleByIdResponses, GetBotsByBotIdScheduleData, GetBotsByBotIdScheduleErrors, GetBotsByBotIdScheduleResponses, GetBotsByBotIdSettingsData, GetBotsByBotIdSettingsErrors, GetBotsByBotIdSettingsResponses, GetBotsByBotIdSubagentsByIdContextData, GetBotsByBotIdSubagentsByIdContextErrors, GetBotsByBotIdSubagentsByIdContextResponses, GetBotsByBotIdSubagentsByIdData, GetBotsByBotIdSubagentsByIdErrors, GetBotsByBotIdSubagentsByIdResponses, GetBotsByBotIdSubagentsByIdSkillsData, GetBotsByBotIdSubagentsByIdSkillsErrors, GetBotsByBotIdSubagentsByIdSkillsResponses, GetBotsByBotIdSubagentsData, GetBotsByBotIdSubagentsErrors, GetBotsByBotIdSubagentsResponses, GetBotsByIdChannelByPlatformData, GetBotsByIdChannelByPlatformErrors, GetBotsByIdChannelByPlatformResponses, GetBotsByIdData, GetBotsByIdErrors, GetBotsByIdMembersData, GetBotsByIdMembersErrors, GetBotsByIdMembersResponses, GetBotsByIdResponses, GetBotsData, GetBotsErrors, GetBotsResponses, GetChannelsByPlatformData, GetChannelsByPlatformErrors, GetChannelsByPlatformResponses, GetChannelsData, GetChannelsErrors, GetChannelsResponses, GetModelsByIdData, GetModelsByIdErrors, GetModelsByIdResponses, GetModelsCountData, GetModelsCountErrors, GetModelsCountResponses, GetModelsData, GetModelsErrors, GetModelsModelByModelIdData, GetModelsModelByModelIdErrors, GetModelsModelByModelIdResponses, GetModelsResponses, GetProvidersByIdData, GetProvidersByIdErrors, GetProvidersByIdModelsData, GetProvidersByIdModelsErrors, GetProvidersByIdModelsResponses, GetProvidersByIdResponses, GetProvidersCountData, GetProvidersCountErrors, GetProvidersCountResponses, GetProvidersData, GetProvidersErrors, GetProvidersNameByNameData, GetProvidersNameByNameErrors, GetProvidersNameByNameResponses, GetProvidersResponses, GetUsersByIdData, GetUsersByIdErrors, GetUsersByIdResponses, GetUsersData, GetUsersErrors, GetUsersMeChannelsByPlatformData, GetUsersMeChannelsByPlatformErrors, GetUsersMeChannelsByPlatformResponses, GetUsersMeData, GetUsersMeErrors, GetUsersMeResponses, GetUsersResponses, PostAuthLoginData, PostAuthLoginErrors, PostAuthLoginResponses, PostBotsByBotIdChatData, PostBotsByBotIdChatErrors, PostBotsByBotIdChatResponses, PostBotsByBotIdChatStreamData, PostBotsByBotIdChatStreamErrors, PostBotsByBotIdChatStreamResponses, PostBotsByBotIdContainerData, PostBotsByBotIdContainerErrors, PostBotsByBotIdContainerFsDirData, PostBotsByBotIdContainerFsDirErrors, PostBotsByBotIdContainerFsDirResponses, PostBotsByBotIdContainerFsFileData, PostBotsByBotIdContainerFsFileErrors, PostBotsByBotIdContainerFsFileResponses, PostBotsByBotIdContainerFsMcpData, PostBotsByBotIdContainerFsMcpErrors, PostBotsByBotIdContainerFsMcpResponses, PostBotsByBotIdContainerFsUploadData, PostBotsByBotIdContainerFsUploadErrors, PostBotsByBotIdContainerFsUploadResponses, PostBotsByBotIdContainerResponses, PostBotsByBotIdContainerSkillsData, PostBotsByBotIdContainerSkillsErrors, PostBotsByBotIdContainerSkillsResponses, PostBotsByBotIdContainerSnapshotsData, PostBotsByBotIdContainerSnapshotsErrors, PostBotsByBotIdContainerSnapshotsResponses, PostBotsByBotIdContainerStartData, PostBotsByBotIdContainerStartErrors, PostBotsByBotIdContainerStartResponses, PostBotsByBotIdContainerStopData, PostBotsByBotIdContainerStopErrors, PostBotsByBotIdContainerStopResponses, PostBotsByBotIdHistoryData, PostBotsByBotIdHistoryErrors, PostBotsByBotIdHistoryResponses, PostBotsByBotIdMcpData, PostBotsByBotIdMcpErrors, PostBotsByBotIdMcpResponses, PostBotsByBotIdMcpStdioBySessionIdData, PostBotsByBotIdMcpStdioBySessionIdErrors, PostBotsByBotIdMcpStdioBySessionIdResponses, PostBotsByBotIdMcpStdioData, PostBotsByBotIdMcpStdioErrors, PostBotsByBotIdMcpStdioResponses, PostBotsByBotIdMemoryAddData, PostBotsByBotIdMemoryAddErrors, PostBotsByBotIdMemoryAddResponses, PostBotsByBotIdMemoryEmbedData, PostBotsByBotIdMemoryEmbedErrors, PostBotsByBotIdMemoryEmbedResponses, PostBotsByBotIdMemorySearchData, PostBotsByBotIdMemorySearchErrors, PostBotsByBotIdMemorySearchResponses, PostBotsByBotIdMemoryUpdateData, PostBotsByBotIdMemoryUpdateErrors, PostBotsByBotIdMemoryUpdateResponses, PostBotsByBotIdScheduleData, PostBotsByBotIdScheduleErrors, PostBotsByBotIdScheduleResponses, PostBotsByBotIdSettingsData, PostBotsByBotIdSettingsErrors, PostBotsByBotIdSettingsResponses, PostBotsByBotIdSubagentsByIdSkillsData, PostBotsByBotIdSubagentsByIdSkillsErrors, PostBotsByBotIdSubagentsByIdSkillsResponses, PostBotsByBotIdSubagentsData, PostBotsByBotIdSubagentsErrors, PostBotsByBotIdSubagentsResponses, PostBotsByIdChannelByPlatformSendData, PostBotsByIdChannelByPlatformSendErrors, PostBotsByIdChannelByPlatformSendResponses, PostBotsByIdChannelByPlatformSendSessionData, PostBotsByIdChannelByPlatformSendSessionErrors, PostBotsByIdChannelByPlatformSendSessionResponses, PostBotsData, PostBotsErrors, PostBotsResponses, PostEmbeddingsData, PostEmbeddingsErrors, PostEmbeddingsResponses, PostModelsData, PostModelsEnableData, PostModelsEnableErrors, PostModelsEnableResponses, PostModelsErrors, PostModelsResponses, PostProvidersData, PostProvidersErrors, PostProvidersResponses, PostUsersData, PostUsersErrors, PostUsersResponses, PutBotsByBotIdMcpByIdData, PutBotsByBotIdMcpByIdErrors, PutBotsByBotIdMcpByIdResponses, PutBotsByBotIdScheduleByIdData, PutBotsByBotIdScheduleByIdErrors, PutBotsByBotIdScheduleByIdResponses, PutBotsByBotIdSettingsData, PutBotsByBotIdSettingsErrors, PutBotsByBotIdSettingsResponses, PutBotsByBotIdSubagentsByIdContextData, PutBotsByBotIdSubagentsByIdContextErrors, PutBotsByBotIdSubagentsByIdContextResponses, PutBotsByBotIdSubagentsByIdData, PutBotsByBotIdSubagentsByIdErrors, PutBotsByBotIdSubagentsByIdResponses, PutBotsByBotIdSubagentsByIdSkillsData, PutBotsByBotIdSubagentsByIdSkillsErrors, PutBotsByBotIdSubagentsByIdSkillsResponses, PutBotsByIdChannelByPlatformData, PutBotsByIdChannelByPlatformErrors, PutBotsByIdChannelByPlatformResponses, PutBotsByIdData, PutBotsByIdErrors, PutBotsByIdMembersData, PutBotsByIdMembersErrors, PutBotsByIdMembersResponses, PutBotsByIdOwnerData, PutBotsByIdOwnerErrors, PutBotsByIdOwnerResponses, PutBotsByIdResponses, PutModelsByIdData, PutModelsByIdErrors, PutModelsByIdResponses, PutModelsModelByModelIdData, PutModelsModelByModelIdErrors, PutModelsModelByModelIdResponses, PutProvidersByIdData, PutProvidersByIdErrors, PutProvidersByIdResponses, PutUsersByIdData, PutUsersByIdErrors, PutUsersByIdPasswordData, PutUsersByIdPasswordErrors, PutUsersByIdPasswordResponses, PutUsersByIdResponses, PutUsersMeChannelsByPlatformData, PutUsersMeChannelsByPlatformErrors, PutUsersMeChannelsByPlatformResponses, PutUsersMeData, PutUsersMeErrors, PutUsersMePasswordData, PutUsersMePasswordErrors, PutUsersMePasswordResponses, PutUsersMeResponses } from './types.gen'; + +export type Options = Options2 & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +/** + * Login + * + * Validate user credentials and issue a JWT + */ +export const postAuthLogin = (options: Options) => (options.client ?? client).post({ + url: '/auth/login', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * List bots + * + * List bots accessible to current user (admin can specify owner_id) + */ +export const getBots = (options?: Options) => (options?.client ?? client).get({ url: '/bots', ...options }); + +/** + * Create bot user + * + * Create a bot user owned by current user (or admin-specified owner) + */ +export const postBots = (options: Options) => (options.client ?? client).post({ + url: '/bots', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * Chat with AI + * + * Send a chat message and get a response. The system will automatically select an appropriate chat model from the database. + */ +export const postBotsByBotIdChat = (options: Options) => (options.client ?? client).post({ + url: '/bots/{bot_id}/chat', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * Stream chat with AI + * + * Send a chat message and get a streaming response. The system will automatically select an appropriate chat model from the database. + */ +export const postBotsByBotIdChatStream = (options: Options) => (options.client ?? client).sse.post({ + url: '/bots/{bot_id}/chat/stream', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * Delete MCP container for bot + */ +export const deleteBotsByBotIdContainer = (options: Options) => (options.client ?? client).delete({ url: '/bots/{bot_id}/container', ...options }); + +/** + * Get container info for bot + */ +export const getBotsByBotIdContainer = (options: Options) => (options.client ?? client).get({ url: '/bots/{bot_id}/container', ...options }); + +/** + * Create and start MCP container for bot + */ +export const postBotsByBotIdContainer = (options: Options) => (options.client ?? client).post({ + url: '/bots/{bot_id}/container', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * Delete a file or directory + */ +export const deleteBotsByBotIdContainerFs = (options: Options) => (options.client ?? client).delete({ url: '/bots/{bot_id}/container/fs', ...options }); + +/** + * List files for a bot + * + * List entries under a relative path + */ +export const getBotsByBotIdContainerFs = (options: Options) => (options.client ?? client).get({ url: '/bots/{bot_id}/container/fs', ...options }); + +/** + * MCP filesystem tools (JSON-RPC) + * + * Forwards MCP JSON-RPC requests to the MCP server inside the container. + * Required: + * - container task is running + * - container has data mount (default /data) bound to /users/ + * - container image contains the "mcp" binary + * Auth: Bearer JWT is used to determine user_id (sub or user_id). + * Paths must be relative (no leading slash) and must not contain "..". + * + * Example: tools/list + * {"jsonrpc":"2.0","id":1,"method":"tools/list"} + * + * Example: tools/call (fs.read) + * {"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"fs.read","arguments":{"path":"notes.txt"}}} + */ +export const postBotsByBotIdContainerFsMcp = (options: Options) => (options.client ?? client).post({ + url: '/bots/{bot_id}/container/fs-mcp', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * Create a directory + */ +export const postBotsByBotIdContainerFsDir = (options: Options) => (options.client ?? client).post({ + url: '/bots/{bot_id}/container/fs/dir', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * Read file content + */ +export const getBotsByBotIdContainerFsFile = (options: Options) => (options.client ?? client).get({ url: '/bots/{bot_id}/container/fs/file', ...options }); + +/** + * Create or overwrite a file + */ +export const postBotsByBotIdContainerFsFile = (options: Options) => (options.client ?? client).post({ + url: '/bots/{bot_id}/container/fs/file', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * Get file or directory metadata + */ +export const getBotsByBotIdContainerFsStat = (options: Options) => (options.client ?? client).get({ url: '/bots/{bot_id}/container/fs/stat', ...options }); + +/** + * Upload a file + */ +export const postBotsByBotIdContainerFsUpload = (options: Options) => (options.client ?? client).post({ url: '/bots/{bot_id}/container/fs/upload', ...options }); + +/** + * Get usage under a path + */ +export const getBotsByBotIdContainerFsUsage = (options: Options) => (options.client ?? client).get({ url: '/bots/{bot_id}/container/fs/usage', ...options }); + +/** + * Delete skills from data directory + */ +export const deleteBotsByBotIdContainerSkills = (options: Options) => (options.client ?? client).delete({ + url: '/bots/{bot_id}/container/skills', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * List skills from data directory + */ +export const getBotsByBotIdContainerSkills = (options: Options) => (options.client ?? client).get({ url: '/bots/{bot_id}/container/skills', ...options }); + +/** + * Upload skills into data directory + */ +export const postBotsByBotIdContainerSkills = (options: Options) => (options.client ?? client).post({ + url: '/bots/{bot_id}/container/skills', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * List snapshots + */ +export const getBotsByBotIdContainerSnapshots = (options: Options) => (options.client ?? client).get({ url: '/bots/{bot_id}/container/snapshots', ...options }); + +/** + * Create container snapshot for bot + */ +export const postBotsByBotIdContainerSnapshots = (options: Options) => (options.client ?? client).post({ + url: '/bots/{bot_id}/container/snapshots', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * Start container task for bot + */ +export const postBotsByBotIdContainerStart = (options: Options) => (options.client ?? client).post({ url: '/bots/{bot_id}/container/start', ...options }); + +/** + * Stop container task for bot + */ +export const postBotsByBotIdContainerStop = (options: Options) => (options.client ?? client).post({ url: '/bots/{bot_id}/container/stop', ...options }); + +/** + * Delete all history records + * + * Delete all history records for current user + */ +export const deleteBotsByBotIdHistory = (options?: Options) => (options?.client ?? client).delete({ url: '/bots/{bot_id}/history', ...options }); + +/** + * List history records + * + * List history records for current user + */ +export const getBotsByBotIdHistory = (options?: Options) => (options?.client ?? client).get({ url: '/bots/{bot_id}/history', ...options }); + +/** + * Create history record + * + * Create a history record for current user + */ +export const postBotsByBotIdHistory = (options: Options) => (options.client ?? client).post({ + url: '/bots/{bot_id}/history', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * Delete history record + * + * Delete a history record by ID (must belong to current user) + */ +export const deleteBotsByBotIdHistoryById = (options: Options) => (options.client ?? client).delete({ url: '/bots/{bot_id}/history/{id}', ...options }); + +/** + * Get history record + * + * Get a history record by ID (must belong to current user) + */ +export const getBotsByBotIdHistoryById = (options: Options) => (options.client ?? client).get({ url: '/bots/{bot_id}/history/{id}', ...options }); + +/** + * List MCP connections + * + * List MCP connections for a bot + */ +export const getBotsByBotIdMcp = (options?: Options) => (options?.client ?? client).get({ url: '/bots/{bot_id}/mcp', ...options }); + +/** + * Create MCP connection + * + * Create a MCP connection for a bot + */ +export const postBotsByBotIdMcp = (options: Options) => (options.client ?? client).post({ + url: '/bots/{bot_id}/mcp', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * Create MCP stdio proxy + * + * Start a stdio MCP process in the bot container and expose it as MCP HTTP endpoint. + */ +export const postBotsByBotIdMcpStdio = (options: Options) => (options.client ?? client).post({ + url: '/bots/{bot_id}/mcp-stdio', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * MCP stdio proxy (JSON-RPC) + * + * Proxies MCP JSON-RPC requests to a stdio MCP process in the container. + */ +export const postBotsByBotIdMcpStdioBySessionId = (options: Options) => (options.client ?? client).post({ + url: '/bots/{bot_id}/mcp-stdio/{session_id}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * Delete MCP connection + * + * Delete a MCP connection by ID + */ +export const deleteBotsByBotIdMcpById = (options: Options) => (options.client ?? client).delete({ url: '/bots/{bot_id}/mcp/{id}', ...options }); + +/** + * Get MCP connection + * + * Get a MCP connection by ID + */ +export const getBotsByBotIdMcpById = (options: Options) => (options.client ?? client).get({ url: '/bots/{bot_id}/mcp/{id}', ...options }); + +/** + * Update MCP connection + * + * Update a MCP connection by ID + */ +export const putBotsByBotIdMcpById = (options: Options) => (options.client ?? client).put({ + url: '/bots/{bot_id}/mcp/{id}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * Add memory + * + * Add memory for a user via memory. Auth: Bearer JWT determines user_id (sub or user_id). + */ +export const postBotsByBotIdMemoryAdd = (options: Options) => (options.client ?? client).post({ + url: '/bots/{bot_id}/memory/add', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * Embed and upsert memory + * + * Embed text or multimodal input and upsert into memory store. Auth: Bearer JWT determines user_id (sub or user_id). + */ +export const postBotsByBotIdMemoryEmbed = (options: Options) => (options.client ?? client).post({ + url: '/bots/{bot_id}/memory/embed', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * Delete memories + * + * Delete all memories for a user via memory. Auth: Bearer JWT determines user_id (sub or user_id). + */ +export const deleteBotsByBotIdMemoryMemories = (options: Options) => (options.client ?? client).delete({ + url: '/bots/{bot_id}/memory/memories', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * List memories + * + * List memories for a user via memory. Auth: Bearer JWT determines user_id (sub or user_id). + */ +export const getBotsByBotIdMemoryMemories = (options?: Options) => (options?.client ?? client).get({ url: '/bots/{bot_id}/memory/memories', ...options }); + +/** + * Delete memory + * + * Delete a memory by ID via memory. Auth: Bearer JWT determines user_id (sub or user_id). + */ +export const deleteBotsByBotIdMemoryMemoriesByMemoryId = (options: Options) => (options.client ?? client).delete({ url: '/bots/{bot_id}/memory/memories/{memoryId}', ...options }); + +/** + * Get memory + * + * Get a memory by ID via memory. Auth: Bearer JWT determines user_id (sub or user_id). + */ +export const getBotsByBotIdMemoryMemoriesByMemoryId = (options: Options) => (options.client ?? client).get({ url: '/bots/{bot_id}/memory/memories/{memoryId}', ...options }); + +/** + * Search memories + * + * Search memories for a user via memory. Auth: Bearer JWT determines user_id (sub or user_id). + */ +export const postBotsByBotIdMemorySearch = (options: Options) => (options.client ?? client).post({ + url: '/bots/{bot_id}/memory/search', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * Update memory + * + * Update a memory by ID via memory. Auth: Bearer JWT determines user_id (sub or user_id). + */ +export const postBotsByBotIdMemoryUpdate = (options: Options) => (options.client ?? client).post({ + url: '/bots/{bot_id}/memory/update', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * List schedules + * + * List schedules for current user + */ +export const getBotsByBotIdSchedule = (options?: Options) => (options?.client ?? client).get({ url: '/bots/{bot_id}/schedule', ...options }); + +/** + * Create schedule + * + * Create a schedule for current user + */ +export const postBotsByBotIdSchedule = (options: Options) => (options.client ?? client).post({ + url: '/bots/{bot_id}/schedule', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * Delete schedule + * + * Delete a schedule by ID + */ +export const deleteBotsByBotIdScheduleById = (options: Options) => (options.client ?? client).delete({ url: '/bots/{bot_id}/schedule/{id}', ...options }); + +/** + * Get schedule + * + * Get a schedule by ID + */ +export const getBotsByBotIdScheduleById = (options: Options) => (options.client ?? client).get({ url: '/bots/{bot_id}/schedule/{id}', ...options }); + +/** + * Update schedule + * + * Update a schedule by ID + */ +export const putBotsByBotIdScheduleById = (options: Options) => (options.client ?? client).put({ + url: '/bots/{bot_id}/schedule/{id}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * Delete user settings + * + * Remove agent settings for current user + */ +export const deleteBotsByBotIdSettings = (options?: Options) => (options?.client ?? client).delete({ url: '/bots/{bot_id}/settings', ...options }); + +/** + * Get user settings + * + * Get agent settings for current user + */ +export const getBotsByBotIdSettings = (options?: Options) => (options?.client ?? client).get({ url: '/bots/{bot_id}/settings', ...options }); + +/** + * Update user settings + * + * Update or create agent settings for current user + */ +export const postBotsByBotIdSettings = (options: Options) => (options.client ?? client).post({ + url: '/bots/{bot_id}/settings', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * Update user settings + * + * Update or create agent settings for current user + */ +export const putBotsByBotIdSettings = (options: Options) => (options.client ?? client).put({ + url: '/bots/{bot_id}/settings', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * List subagents + * + * List subagents for current user + */ +export const getBotsByBotIdSubagents = (options?: Options) => (options?.client ?? client).get({ url: '/bots/{bot_id}/subagents', ...options }); + +/** + * Create subagent + * + * Create a subagent for current user + */ +export const postBotsByBotIdSubagents = (options: Options) => (options.client ?? client).post({ + url: '/bots/{bot_id}/subagents', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * Delete subagent + * + * Delete a subagent by ID + */ +export const deleteBotsByBotIdSubagentsById = (options: Options) => (options.client ?? client).delete({ url: '/bots/{bot_id}/subagents/{id}', ...options }); + +/** + * Get subagent + * + * Get a subagent by ID + */ +export const getBotsByBotIdSubagentsById = (options: Options) => (options.client ?? client).get({ url: '/bots/{bot_id}/subagents/{id}', ...options }); + +/** + * Update subagent + * + * Update a subagent by ID + */ +export const putBotsByBotIdSubagentsById = (options: Options) => (options.client ?? client).put({ + url: '/bots/{bot_id}/subagents/{id}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * Get subagent context + * + * Get a subagent's message context + */ +export const getBotsByBotIdSubagentsByIdContext = (options: Options) => (options.client ?? client).get({ url: '/bots/{bot_id}/subagents/{id}/context', ...options }); + +/** + * Update subagent context + * + * Update a subagent's message context + */ +export const putBotsByBotIdSubagentsByIdContext = (options: Options) => (options.client ?? client).put({ + url: '/bots/{bot_id}/subagents/{id}/context', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * Get subagent skills + * + * Get a subagent's skills + */ +export const getBotsByBotIdSubagentsByIdSkills = (options: Options) => (options.client ?? client).get({ url: '/bots/{bot_id}/subagents/{id}/skills', ...options }); + +/** + * Add subagent skills + * + * Add skills to a subagent + */ +export const postBotsByBotIdSubagentsByIdSkills = (options: Options) => (options.client ?? client).post({ + url: '/bots/{bot_id}/subagents/{id}/skills', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * Update subagent skills + * + * Replace a subagent's skills + */ +export const putBotsByBotIdSubagentsByIdSkills = (options: Options) => (options.client ?? client).put({ + url: '/bots/{bot_id}/subagents/{id}/skills', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * Delete bot + * + * Delete a bot user (owner/admin only) + */ +export const deleteBotsById = (options: Options) => (options.client ?? client).delete({ url: '/bots/{id}', ...options }); + +/** + * Get bot details + * + * Get a bot by ID (owner/admin only) + */ +export const getBotsById = (options: Options) => (options.client ?? client).get({ url: '/bots/{id}', ...options }); + +/** + * Update bot details + * + * Update bot profile (owner/admin only) + */ +export const putBotsById = (options: Options) => (options.client ?? client).put({ + url: '/bots/{id}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * Get bot channel config + * + * Get bot channel configuration + */ +export const getBotsByIdChannelByPlatform = (options: Options) => (options.client ?? client).get({ url: '/bots/{id}/channel/{platform}', ...options }); + +/** + * Update bot channel config + * + * Update bot channel configuration + */ +export const putBotsByIdChannelByPlatform = (options: Options) => (options.client ?? client).put({ + url: '/bots/{id}/channel/{platform}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * Send message via bot channel + * + * Send a message using bot channel configuration + */ +export const postBotsByIdChannelByPlatformSend = (options: Options) => (options.client ?? client).post({ + url: '/bots/{id}/channel/{platform}/send', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * Send message via bot channel session token + * + * Send a message using a session-scoped token (reply only) + */ +export const postBotsByIdChannelByPlatformSendSession = (options: Options) => (options.client ?? client).post({ + url: '/bots/{id}/channel/{platform}/send_session', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * List bot members + * + * List members for a bot + */ +export const getBotsByIdMembers = (options: Options) => (options.client ?? client).get({ url: '/bots/{id}/members', ...options }); + +/** + * Upsert bot member + * + * Add or update bot member role + */ +export const putBotsByIdMembers = (options: Options) => (options.client ?? client).put({ + url: '/bots/{id}/members', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * Delete bot member + * + * Remove a member from a bot + */ +export const deleteBotsByIdMembersByUserId = (options: Options) => (options.client ?? client).delete({ url: '/bots/{id}/members/{user_id}', ...options }); + +/** + * Transfer bot owner (admin only) + * + * Transfer bot ownership to another human user + */ +export const putBotsByIdOwner = (options: Options) => (options.client ?? client).put({ + url: '/bots/{id}/owner', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * List channel capabilities and schemas + * + * List channel meta information including capabilities and schemas + */ +export const getChannels = (options?: Options) => (options?.client ?? client).get({ url: '/channels', ...options }); + +/** + * Get channel capabilities and schemas + * + * Get channel meta information including capabilities and schemas + */ +export const getChannelsByPlatform = (options: Options) => (options.client ?? client).get({ url: '/channels/{platform}', ...options }); + +/** + * Create embeddings + * + * Create text or multimodal embeddings + */ +export const postEmbeddings = (options: Options) => (options.client ?? client).post({ + url: '/embeddings', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * List all models + * + * Get a list of all configured models, optionally filtered by type or client type + */ +export const getModels = (options?: Options) => (options?.client ?? client).get({ url: '/models', ...options }); + +/** + * Create a new model + * + * Create a new model configuration + */ +export const postModels = (options: Options) => (options.client ?? client).post({ + url: '/models', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * Get model count + * + * Get the total count of models, optionally filtered by type + */ +export const getModelsCount = (options?: Options) => (options?.client ?? client).get({ url: '/models/count', ...options }); + +/** + * Enable model for chat/memory/embedding + * + * Update the current user's settings to use the selected model + */ +export const postModelsEnable = (options: Options) => (options.client ?? client).post({ + url: '/models/enable', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * Delete model by model ID + * + * Delete a model configuration by its model_id field (e.g., gpt-4) + */ +export const deleteModelsModelByModelId = (options: Options) => (options.client ?? client).delete({ url: '/models/model/{modelId}', ...options }); + +/** + * Get model by model ID + * + * Get a model configuration by its model_id field (e.g., gpt-4) + */ +export const getModelsModelByModelId = (options: Options) => (options.client ?? client).get({ url: '/models/model/{modelId}', ...options }); + +/** + * Update model by model ID + * + * Update a model configuration by its model_id field (e.g., gpt-4) + */ +export const putModelsModelByModelId = (options: Options) => (options.client ?? client).put({ + url: '/models/model/{modelId}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * Delete model by internal ID + * + * Delete a model configuration by its internal UUID + */ +export const deleteModelsById = (options: Options) => (options.client ?? client).delete({ url: '/models/{id}', ...options }); + +/** + * Get model by internal ID + * + * Get a model configuration by its internal UUID + */ +export const getModelsById = (options: Options) => (options.client ?? client).get({ url: '/models/{id}', ...options }); + +/** + * Update model by internal ID + * + * Update a model configuration by its internal UUID + */ +export const putModelsById = (options: Options) => (options.client ?? client).put({ + url: '/models/{id}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * List all LLM providers + * + * Get a list of all configured LLM providers, optionally filtered by client type + */ +export const getProviders = (options?: Options) => (options?.client ?? client).get({ url: '/providers', ...options }); + +/** + * Create a new LLM provider + * + * Create a new LLM provider configuration + */ +export const postProviders = (options: Options) => (options.client ?? client).post({ + url: '/providers', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * Count providers + * + * Get the total count of providers, optionally filtered by client type + */ +export const getProvidersCount = (options?: Options) => (options?.client ?? client).get({ url: '/providers/count', ...options }); + +/** + * Get provider by name + * + * Get a provider configuration by its name + */ +export const getProvidersNameByName = (options: Options) => (options.client ?? client).get({ url: '/providers/name/{name}', ...options }); + +/** + * Delete provider + * + * Delete a provider configuration + */ +export const deleteProvidersById = (options: Options) => (options.client ?? client).delete({ url: '/providers/{id}', ...options }); + +/** + * Get provider by ID + * + * Get a provider configuration by its ID + */ +export const getProvidersById = (options: Options) => (options.client ?? client).get({ url: '/providers/{id}', ...options }); + +/** + * Update provider + * + * Update an existing provider configuration + */ +export const putProvidersById = (options: Options) => (options.client ?? client).put({ + url: '/providers/{id}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * List provider models + * + * Get models for a provider by id, optionally filtered by type + */ +export const getProvidersByIdModels = (options: Options) => (options.client ?? client).get({ url: '/providers/{id}/models', ...options }); + +/** + * List users (admin only) + * + * List users + */ +export const getUsers = (options?: Options) => (options?.client ?? client).get({ url: '/users', ...options }); + +/** + * Create human user (admin only) + * + * Create a new human user account + */ +export const postUsers = (options: Options) => (options.client ?? client).post({ + url: '/users', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * Get current user + * + * Get current user profile + */ +export const getUsersMe = (options?: Options) => (options?.client ?? client).get({ url: '/users/me', ...options }); + +/** + * Update current user profile + * + * Update current user display name or avatar + */ +export const putUsersMe = (options: Options) => (options.client ?? client).put({ + url: '/users/me', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * Get channel user config + * + * Get channel binding configuration for current user + */ +export const getUsersMeChannelsByPlatform = (options: Options) => (options.client ?? client).get({ url: '/users/me/channels/{platform}', ...options }); + +/** + * Update channel user config + * + * Update channel binding configuration for current user + */ +export const putUsersMeChannelsByPlatform = (options: Options) => (options.client ?? client).put({ + url: '/users/me/channels/{platform}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * Update current user password + * + * Update current user password with current password check + */ +export const putUsersMePassword = (options: Options) => (options.client ?? client).put({ + url: '/users/me/password', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * Get user by ID + * + * Get user details (self or admin only) + */ +export const getUsersById = (options: Options) => (options.client ?? client).get({ url: '/users/{id}', ...options }); + +/** + * Update user (admin only) + * + * Update user profile and status + */ +export const putUsersById = (options: Options) => (options.client ?? client).put({ + url: '/users/{id}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * Reset user password (admin only) + * + * Reset a user password + */ +export const putUsersByIdPassword = (options: Options) => (options.client ?? client).put({ + url: '/users/{id}/password', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); diff --git a/packages/sdk/src/types.gen.ts b/packages/sdk/src/types.gen.ts new file mode 100644 index 00000000..c659ca2d --- /dev/null +++ b/packages/sdk/src/types.gen.ts @@ -0,0 +1,4838 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type ClientOptions = { + baseUrl: string; +}; + +export type BotsBot = { + avatar_url?: string; + created_at?: string; + display_name?: string; + id?: string; + is_active?: boolean; + metadata?: { + [key: string]: unknown; + }; + owner_user_id?: string; + type?: string; + updated_at?: string; +}; + +export type BotsBotMember = { + bot_id?: string; + created_at?: string; + role?: string; + user_id?: string; +}; + +export type BotsCreateBotRequest = { + avatar_url?: string; + display_name?: string; + is_active?: boolean; + metadata?: { + [key: string]: unknown; + }; + type?: string; +}; + +export type BotsListBotsResponse = { + items?: Array; +}; + +export type BotsListMembersResponse = { + items?: Array; +}; + +export type BotsTransferBotRequest = { + owner_user_id?: string; +}; + +export type BotsUpdateBotRequest = { + avatar_url?: string; + display_name?: string; + is_active?: boolean; + metadata?: { + [key: string]: unknown; + }; +}; + +export type BotsUpsertMemberRequest = { + role?: string; + user_id?: string; +}; + +export type ChannelAction = { + label?: string; + type?: string; + url?: string; + value?: string; +}; + +export type ChannelAttachment = { + caption?: string; + duration_ms?: number; + height?: number; + metadata?: { + [key: string]: unknown; + }; + mime?: string; + name?: string; + size?: number; + thumbnail_url?: string; + type?: ChannelAttachmentType; + url?: string; + width?: number; +}; + +export type ChannelAttachmentType = 'image' | 'audio' | 'video' | 'voice' | 'file' | 'gif'; + +export type ChannelChannelCapabilities = { + attachments?: boolean; + block_streaming?: boolean; + buttons?: boolean; + chat_types?: Array; + edit?: boolean; + markdown?: boolean; + media?: boolean; + native_commands?: boolean; + polls?: boolean; + reactions?: boolean; + reply?: boolean; + rich_text?: boolean; + streaming?: boolean; + text?: boolean; + threads?: boolean; + unsend?: boolean; +}; + +export type ChannelChannelConfig = { + botID?: string; + channelType?: string; + createdAt?: string; + credentials?: { + [key: string]: unknown; + }; + externalIdentity?: string; + id?: string; + routing?: { + [key: string]: unknown; + }; + selfIdentity?: { + [key: string]: unknown; + }; + status?: string; + updatedAt?: string; + verifiedAt?: string; +}; + +export type ChannelChannelUserBinding = { + channelType?: string; + config?: { + [key: string]: unknown; + }; + createdAt?: string; + id?: string; + updatedAt?: string; + userID?: string; +}; + +export type ChannelConfigSchema = { + fields?: { + [key: string]: ChannelFieldSchema; + }; + version?: number; +}; + +export type ChannelFieldSchema = { + description?: string; + enum?: Array; + example?: unknown; + required?: boolean; + title?: string; + type?: ChannelFieldType; +}; + +export type ChannelFieldType = 'string' | 'secret' | 'bool' | 'number' | 'enum'; + +export type ChannelMessage = { + actions?: Array; + attachments?: Array; + format?: ChannelMessageFormat; + id?: string; + metadata?: { + [key: string]: unknown; + }; + parts?: Array; + reply?: ChannelReplyRef; + text?: string; + thread?: ChannelThreadRef; +}; + +export type ChannelMessageFormat = 'plain' | 'markdown' | 'rich'; + +export type ChannelMessagePart = { + emoji?: string; + language?: string; + metadata?: { + [key: string]: unknown; + }; + styles?: Array; + text?: string; + type?: ChannelMessagePartType; + url?: string; + user_id?: string; +}; + +export type ChannelMessagePartType = 'text' | 'link' | 'code_block' | 'mention' | 'emoji'; + +export type ChannelMessageTextStyle = 'bold' | 'italic' | 'strikethrough' | 'code'; + +export type ChannelReplyRef = { + message_id?: string; + target?: string; +}; + +export type ChannelSendRequest = { + message?: ChannelMessage; + target?: string; + user_id?: string; +}; + +export type ChannelTargetHint = { + example?: string; + label?: string; +}; + +export type ChannelTargetSpec = { + format?: string; + hints?: Array; +}; + +export type ChannelThreadRef = { + id?: string; +}; + +export type ChannelUpsertConfigRequest = { + credentials?: { + [key: string]: unknown; + }; + external_identity?: string; + routing?: { + [key: string]: unknown; + }; + self_identity?: { + [key: string]: unknown; + }; + status?: string; + verified_at?: string; +}; + +export type ChannelUpsertUserConfigRequest = { + config?: { + [key: string]: unknown; + }; +}; + +export type ChatChatRequest = { + allowed_actions?: Array; + channels?: Array; + current_channel?: string; + language?: string; + max_context_load_time?: number; + messages?: Array; + model?: string; + provider?: string; + query?: string; + skills?: Array; +}; + +export type ChatChatResponse = { + messages?: Array; + model?: string; + provider?: string; + skills?: Array; +}; + +export type ChatModelMessage = { + content?: Array; + name?: string; + role?: string; + tool_call_id?: string; + tool_calls?: Array; +}; + +export type ChatToolCall = { + function?: ChatToolCallFunction; + id?: string; + type?: string; +}; + +export type ChatToolCallFunction = { + arguments?: string; + name?: string; +}; + +export type GithubComMemohaiMemohInternalMcpConnection = { + active?: boolean; + bot_id?: string; + config?: { + [key: string]: unknown; + }; + created_at?: string; + id?: string; + name?: string; + type?: string; + updated_at?: string; +}; + +export type HandlersChannelMeta = { + capabilities?: ChannelChannelCapabilities; + config_schema?: ChannelConfigSchema; + configless?: boolean; + display_name?: string; + target_spec?: ChannelTargetSpec; + type?: string; + user_config_schema?: ChannelConfigSchema; +}; + +export type HandlersCreateContainerRequest = { + image?: string; + snapshotter?: string; +}; + +export type HandlersCreateContainerResponse = { + container_id?: string; + image?: string; + snapshotter?: string; + started?: boolean; +}; + +export type HandlersCreateSnapshotRequest = { + snapshot_name?: string; +}; + +export type HandlersCreateSnapshotResponse = { + container_id?: string; + snapshot_name?: string; + snapshotter?: string; +}; + +export type HandlersEmbeddingsInput = { + image_url?: string; + text?: string; + video_url?: string; +}; + +export type HandlersEmbeddingsRequest = { + dimensions?: number; + input?: HandlersEmbeddingsInput; + model?: string; + provider?: string; + type?: string; +}; + +export type HandlersEmbeddingsResponse = { + dimensions?: number; + embedding?: Array; + message?: string; + model?: string; + provider?: string; + type?: string; + usage?: HandlersEmbeddingsUsage; +}; + +export type HandlersEmbeddingsUsage = { + image_tokens?: number; + input_tokens?: number; + video_tokens?: number; +}; + +export type HandlersEnableModelRequest = { + as?: string; + model_id?: string; +}; + +export type HandlersErrorResponse = { + message?: string; +}; + +export type HandlersFsDeleteResponse = { + ok?: boolean; +}; + +export type HandlersFsListResponse = { + entries?: Array; + path?: string; +}; + +export type HandlersFsMkdirRequest = { + parents?: boolean; + path?: string; +}; + +export type HandlersFsReadResponse = { + content?: string; + mod_time?: string; + mode?: number; + path?: string; + size?: number; +}; + +export type HandlersFsRestEntry = { + is_dir?: boolean; + mod_time?: string; + mode?: number; + path?: string; + size?: number; +}; + +export type HandlersFsStatResponse = { + is_dir?: boolean; + mod_time?: string; + mode?: number; + path?: string; + size?: number; +}; + +export type HandlersFsUsageResponse = { + dir_count?: number; + file_count?: number; + path?: string; + total_bytes?: number; +}; + +export type HandlersFsWriteRequest = { + content?: string; + overwrite?: boolean; + path?: string; +}; + +export type HandlersFsWriteResponse = { + ok?: boolean; +}; + +export type HandlersGetContainerResponse = { + container_id?: string; + container_path?: string; + created_at?: string; + host_path?: string; + image?: string; + namespace?: string; + status?: string; + task_running?: boolean; + updated_at?: string; +}; + +export type HandlersListSnapshotsResponse = { + snapshots?: Array; + snapshotter?: string; +}; + +export type HandlersLoginRequest = { + password?: string; + username?: string; +}; + +export type HandlersLoginResponse = { + access_token?: string; + display_name?: string; + expires_at?: string; + role?: string; + token_type?: string; + user_id?: string; + username?: string; +}; + +export type HandlersMcpStdioRequest = { + args?: Array; + command?: string; + cwd?: string; + env?: { + [key: string]: string; + }; + name?: string; +}; + +export type HandlersMcpStdioResponse = { + session_id?: string; + tools?: Array; + url?: string; +}; + +export type HandlersSkillItem = { + content?: string; + description?: string; + metadata?: { + [key: string]: unknown; + }; + name?: string; +}; + +export type HandlersSkillsDeleteRequest = { + names?: Array; +}; + +export type HandlersSkillsResponse = { + skills?: Array; +}; + +export type HandlersSkillsUpsertRequest = { + skills?: Array; +}; + +export type HandlersSnapshotInfo = { + created_at?: string; + kind?: string; + labels?: { + [key: string]: string; + }; + name?: string; + parent?: string; + snapshotter?: string; + updated_at?: string; +}; + +export type HandlersMemoryAddPayload = { + embedding_enabled?: boolean; + filters?: { + [key: string]: unknown; + }; + infer?: boolean; + message?: string; + messages?: Array; + metadata?: { + [key: string]: unknown; + }; + run_id?: string; +}; + +export type HandlersMemoryDeleteAllPayload = { + run_id?: string; +}; + +export type HandlersMemoryEmbedUpsertPayload = { + filters?: { + [key: string]: unknown; + }; + input?: MemoryEmbedInput; + metadata?: { + [key: string]: unknown; + }; + model?: string; + provider?: string; + run_id?: string; + source?: string; + type?: string; +}; + +export type HandlersMemorySearchPayload = { + embedding_enabled?: boolean; + filters?: { + [key: string]: unknown; + }; + limit?: number; + query?: string; + run_id?: string; + sources?: Array; +}; + +export type HandlersSkillsOpResponse = { + ok?: boolean; +}; + +export type HistoryCreateRequest = { + messages?: Array<{ + [key: string]: unknown; + }>; + metadata?: { + [key: string]: unknown; + }; + skills?: Array; +}; + +export type HistoryListResponse = { + items?: Array; +}; + +export type HistoryRecord = { + bot_id?: string; + id?: string; + messages?: Array<{ + [key: string]: unknown; + }>; + metadata?: { + [key: string]: unknown; + }; + session_id?: string; + skills?: Array; + timestamp?: string; +}; + +export type McpListResponse = { + items?: Array; +}; + +export type McpUpsertRequest = { + active?: boolean; + config?: { + [key: string]: unknown; + }; + name?: string; + type?: string; +}; + +export type MemoryDeleteResponse = { + message?: string; +}; + +export type MemoryEmbedInput = { + image_url?: string; + text?: string; + video_url?: string; +}; + +export type MemoryEmbedUpsertResponse = { + dimensions?: number; + item?: MemoryMemoryItem; + model?: string; + provider?: string; +}; + +export type MemoryMemoryItem = { + agentId?: string; + botId?: string; + createdAt?: string; + hash?: string; + id?: string; + memory?: string; + metadata?: { + [key: string]: unknown; + }; + runId?: string; + score?: number; + sessionId?: string; + updatedAt?: string; +}; + +export type MemoryMessage = { + content?: string; + role?: string; +}; + +export type MemorySearchResponse = { + relations?: Array; + results?: Array; +}; + +export type MemoryUpdateRequest = { + embedding_enabled?: boolean; + memory?: string; + memory_id?: string; +}; + +export type ModelsAddRequest = { + dimensions?: number; + input?: Array; + is_multimodal?: boolean; + llm_provider_id?: string; + model_id?: string; + name?: string; + type?: ModelsModelType; +}; + +export type ModelsAddResponse = { + id?: string; + model_id?: string; +}; + +export type ModelsCountResponse = { + count?: number; +}; + +export type ModelsGetResponse = { + dimensions?: number; + input?: Array; + is_multimodal?: boolean; + llm_provider_id?: string; + model_id?: string; + name?: string; + type?: ModelsModelType; +}; + +export type ModelsModelType = 'chat' | 'embedding'; + +export type ModelsUpdateRequest = { + dimensions?: number; + input?: Array; + is_multimodal?: boolean; + llm_provider_id?: string; + model_id?: string; + name?: string; + type?: ModelsModelType; +}; + +export type ProvidersClientType = 'openai' | 'openai-compat' | 'anthropic' | 'google' | 'ollama'; + +export type ProvidersCountResponse = { + count?: number; +}; + +export type ProvidersCreateRequest = { + api_key?: string; + base_url: string; + client_type: ProvidersClientType; + metadata?: { + [key: string]: unknown; + }; + name: string; +}; + +export type ProvidersGetResponse = { + /** + * masked in response + */ + api_key?: string; + base_url?: string; + client_type?: string; + created_at?: string; + id?: string; + metadata?: { + [key: string]: unknown; + }; + name?: string; + updated_at?: string; +}; + +export type ProvidersUpdateRequest = { + api_key?: string; + base_url?: string; + client_type?: ProvidersClientType; + metadata?: { + [key: string]: unknown; + }; + name?: string; +}; + +export type ScheduleCreateRequest = { + command?: string; + description?: string; + enabled?: boolean; + max_calls?: ScheduleNullableInt; + name?: string; + pattern?: string; +}; + +export type ScheduleListResponse = { + items?: Array; +}; + +export type ScheduleNullableInt = { + set?: boolean; + value?: number; +}; + +export type ScheduleSchedule = { + bot_id?: string; + command?: string; + created_at?: string; + current_calls?: number; + description?: string; + enabled?: boolean; + id?: string; + max_calls?: number; + name?: string; + pattern?: string; + updated_at?: string; +}; + +export type ScheduleUpdateRequest = { + command?: string; + description?: string; + enabled?: boolean; + max_calls?: ScheduleNullableInt; + name?: string; + pattern?: string; +}; + +export type SettingsSettings = { + allow_guest?: boolean; + chat_model_id?: string; + embedding_model_id?: string; + language?: string; + max_context_load_time?: number; + memory_model_id?: string; +}; + +export type SettingsUpsertRequest = { + allow_guest?: boolean; + chat_model_id?: string; + embedding_model_id?: string; + language?: string; + max_context_load_time?: number; + memory_model_id?: string; +}; + +export type SubagentAddSkillsRequest = { + skills?: Array; +}; + +export type SubagentContextResponse = { + messages?: Array<{ + [key: string]: unknown; + }>; +}; + +export type SubagentCreateRequest = { + description?: string; + messages?: Array<{ + [key: string]: unknown; + }>; + metadata?: { + [key: string]: unknown; + }; + name?: string; + skills?: Array; +}; + +export type SubagentListResponse = { + items?: Array; +}; + +export type SubagentSkillsResponse = { + skills?: Array; +}; + +export type SubagentSubagent = { + bot_id?: string; + created_at?: string; + deleted?: boolean; + deleted_at?: string; + description?: string; + id?: string; + messages?: Array<{ + [key: string]: unknown; + }>; + metadata?: { + [key: string]: unknown; + }; + name?: string; + skills?: Array; + updated_at?: string; +}; + +export type SubagentUpdateContextRequest = { + messages?: Array<{ + [key: string]: unknown; + }>; +}; + +export type SubagentUpdateRequest = { + description?: string; + metadata?: { + [key: string]: unknown; + }; + name?: string; +}; + +export type SubagentUpdateSkillsRequest = { + skills?: Array; +}; + +export type UsersCreateUserRequest = { + avatar_url?: string; + display_name?: string; + email?: string; + is_active?: boolean; + password?: string; + role?: string; + username?: string; +}; + +export type UsersListUsersResponse = { + items?: Array; +}; + +export type UsersResetPasswordRequest = { + new_password?: string; +}; + +export type UsersUpdatePasswordRequest = { + current_password?: string; + new_password?: string; +}; + +export type UsersUpdateProfileRequest = { + avatar_url?: string; + display_name?: string; +}; + +export type UsersUpdateUserRequest = { + avatar_url?: string; + display_name?: string; + is_active?: boolean; + role?: string; +}; + +export type UsersUser = { + avatar_url?: string; + created_at?: string; + display_name?: string; + email?: string; + id?: string; + is_active?: boolean; + last_login_at?: string; + role?: string; + updated_at?: string; + username?: string; +}; + +export type PostAuthLoginData = { + /** + * Login request + */ + body: HandlersLoginRequest; + path?: never; + query?: never; + url: '/auth/login'; +}; + +export type PostAuthLoginErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Unauthorized + */ + 401: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type PostAuthLoginError = PostAuthLoginErrors[keyof PostAuthLoginErrors]; + +export type PostAuthLoginResponses = { + /** + * OK + */ + 200: HandlersLoginResponse; +}; + +export type PostAuthLoginResponse = PostAuthLoginResponses[keyof PostAuthLoginResponses]; + +export type GetBotsData = { + body?: never; + path?: never; + query?: { + /** + * Owner user ID (admin only) + */ + owner_id?: string; + }; + url: '/bots'; +}; + +export type GetBotsErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Forbidden + */ + 403: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type GetBotsError = GetBotsErrors[keyof GetBotsErrors]; + +export type GetBotsResponses = { + /** + * OK + */ + 200: BotsListBotsResponse; +}; + +export type GetBotsResponse = GetBotsResponses[keyof GetBotsResponses]; + +export type PostBotsData = { + /** + * Bot payload + */ + body: BotsCreateBotRequest; + path?: never; + query?: never; + url: '/bots'; +}; + +export type PostBotsErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Forbidden + */ + 403: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type PostBotsError = PostBotsErrors[keyof PostBotsErrors]; + +export type PostBotsResponses = { + /** + * Created + */ + 201: BotsBot; +}; + +export type PostBotsResponse = PostBotsResponses[keyof PostBotsResponses]; + +export type PostBotsByBotIdChatData = { + /** + * Chat request + */ + body: ChatChatRequest; + path?: never; + query?: never; + url: '/bots/{bot_id}/chat'; +}; + +export type PostBotsByBotIdChatErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type PostBotsByBotIdChatError = PostBotsByBotIdChatErrors[keyof PostBotsByBotIdChatErrors]; + +export type PostBotsByBotIdChatResponses = { + /** + * OK + */ + 200: ChatChatResponse; +}; + +export type PostBotsByBotIdChatResponse = PostBotsByBotIdChatResponses[keyof PostBotsByBotIdChatResponses]; + +export type PostBotsByBotIdChatStreamData = { + /** + * Chat request + */ + body: ChatChatRequest; + path?: never; + query?: never; + url: '/bots/{bot_id}/chat/stream'; +}; + +export type PostBotsByBotIdChatStreamErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type PostBotsByBotIdChatStreamError = PostBotsByBotIdChatStreamErrors[keyof PostBotsByBotIdChatStreamErrors]; + +export type PostBotsByBotIdChatStreamResponses = { + /** + * OK + */ + 200: string; +}; + +export type PostBotsByBotIdChatStreamResponse = PostBotsByBotIdChatStreamResponses[keyof PostBotsByBotIdChatStreamResponses]; + +export type DeleteBotsByBotIdContainerData = { + body?: never; + path: { + /** + * Bot ID + */ + bot_id: string; + }; + query?: never; + url: '/bots/{bot_id}/container'; +}; + +export type DeleteBotsByBotIdContainerErrors = { + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type DeleteBotsByBotIdContainerError = DeleteBotsByBotIdContainerErrors[keyof DeleteBotsByBotIdContainerErrors]; + +export type DeleteBotsByBotIdContainerResponses = { + /** + * No Content + */ + 204: unknown; +}; + +export type GetBotsByBotIdContainerData = { + body?: never; + path: { + /** + * Bot ID + */ + bot_id: string; + }; + query?: never; + url: '/bots/{bot_id}/container'; +}; + +export type GetBotsByBotIdContainerErrors = { + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type GetBotsByBotIdContainerError = GetBotsByBotIdContainerErrors[keyof GetBotsByBotIdContainerErrors]; + +export type GetBotsByBotIdContainerResponses = { + /** + * OK + */ + 200: HandlersGetContainerResponse; +}; + +export type GetBotsByBotIdContainerResponse = GetBotsByBotIdContainerResponses[keyof GetBotsByBotIdContainerResponses]; + +export type PostBotsByBotIdContainerData = { + /** + * Create container payload + */ + body: HandlersCreateContainerRequest; + path: { + /** + * Bot ID + */ + bot_id: string; + }; + query?: never; + url: '/bots/{bot_id}/container'; +}; + +export type PostBotsByBotIdContainerErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type PostBotsByBotIdContainerError = PostBotsByBotIdContainerErrors[keyof PostBotsByBotIdContainerErrors]; + +export type PostBotsByBotIdContainerResponses = { + /** + * OK + */ + 200: HandlersCreateContainerResponse; +}; + +export type PostBotsByBotIdContainerResponse = PostBotsByBotIdContainerResponses[keyof PostBotsByBotIdContainerResponses]; + +export type DeleteBotsByBotIdContainerFsData = { + body?: never; + path: { + /** + * Bot ID + */ + bot_id: string; + }; + query: { + /** + * Relative path + */ + path: string; + /** + * Recursive delete for directories + */ + recursive?: boolean; + }; + url: '/bots/{bot_id}/container/fs'; +}; + +export type DeleteBotsByBotIdContainerFsErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type DeleteBotsByBotIdContainerFsError = DeleteBotsByBotIdContainerFsErrors[keyof DeleteBotsByBotIdContainerFsErrors]; + +export type DeleteBotsByBotIdContainerFsResponses = { + /** + * OK + */ + 200: HandlersFsDeleteResponse; +}; + +export type DeleteBotsByBotIdContainerFsResponse = DeleteBotsByBotIdContainerFsResponses[keyof DeleteBotsByBotIdContainerFsResponses]; + +export type GetBotsByBotIdContainerFsData = { + body?: never; + path: { + /** + * Bot ID + */ + bot_id: string; + }; + query?: { + /** + * Relative directory path + */ + path?: string; + /** + * Recursive listing + */ + recursive?: boolean; + }; + url: '/bots/{bot_id}/container/fs'; +}; + +export type GetBotsByBotIdContainerFsErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type GetBotsByBotIdContainerFsError = GetBotsByBotIdContainerFsErrors[keyof GetBotsByBotIdContainerFsErrors]; + +export type GetBotsByBotIdContainerFsResponses = { + /** + * OK + */ + 200: HandlersFsListResponse; +}; + +export type GetBotsByBotIdContainerFsResponse = GetBotsByBotIdContainerFsResponses[keyof GetBotsByBotIdContainerFsResponses]; + +export type PostBotsByBotIdContainerFsMcpData = { + /** + * JSON-RPC request + */ + body: { + [key: string]: unknown; + }; + headers: { + /** + * Bearer + */ + Authorization: string; + }; + path: { + /** + * Bot ID + */ + bot_id: string; + }; + query?: never; + url: '/bots/{bot_id}/container/fs-mcp'; +}; + +export type PostBotsByBotIdContainerFsMcpErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type PostBotsByBotIdContainerFsMcpError = PostBotsByBotIdContainerFsMcpErrors[keyof PostBotsByBotIdContainerFsMcpErrors]; + +export type PostBotsByBotIdContainerFsMcpResponses = { + /** + * JSON-RPC response: {jsonrpc,id,result|error} + */ + 200: { + [key: string]: unknown; + }; +}; + +export type PostBotsByBotIdContainerFsMcpResponse = PostBotsByBotIdContainerFsMcpResponses[keyof PostBotsByBotIdContainerFsMcpResponses]; + +export type PostBotsByBotIdContainerFsDirData = { + /** + * Directory payload + */ + body: HandlersFsMkdirRequest; + path: { + /** + * Bot ID + */ + bot_id: string; + }; + query?: never; + url: '/bots/{bot_id}/container/fs/dir'; +}; + +export type PostBotsByBotIdContainerFsDirErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type PostBotsByBotIdContainerFsDirError = PostBotsByBotIdContainerFsDirErrors[keyof PostBotsByBotIdContainerFsDirErrors]; + +export type PostBotsByBotIdContainerFsDirResponses = { + /** + * OK + */ + 200: HandlersFsWriteResponse; +}; + +export type PostBotsByBotIdContainerFsDirResponse = PostBotsByBotIdContainerFsDirResponses[keyof PostBotsByBotIdContainerFsDirResponses]; + +export type GetBotsByBotIdContainerFsFileData = { + body?: never; + path: { + /** + * Bot ID + */ + bot_id: string; + }; + query: { + /** + * Relative file path + */ + path: string; + }; + url: '/bots/{bot_id}/container/fs/file'; +}; + +export type GetBotsByBotIdContainerFsFileErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type GetBotsByBotIdContainerFsFileError = GetBotsByBotIdContainerFsFileErrors[keyof GetBotsByBotIdContainerFsFileErrors]; + +export type GetBotsByBotIdContainerFsFileResponses = { + /** + * OK + */ + 200: HandlersFsReadResponse; +}; + +export type GetBotsByBotIdContainerFsFileResponse = GetBotsByBotIdContainerFsFileResponses[keyof GetBotsByBotIdContainerFsFileResponses]; + +export type PostBotsByBotIdContainerFsFileData = { + /** + * File write payload + */ + body: HandlersFsWriteRequest; + path: { + /** + * Bot ID + */ + bot_id: string; + }; + query?: never; + url: '/bots/{bot_id}/container/fs/file'; +}; + +export type PostBotsByBotIdContainerFsFileErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Conflict + */ + 409: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type PostBotsByBotIdContainerFsFileError = PostBotsByBotIdContainerFsFileErrors[keyof PostBotsByBotIdContainerFsFileErrors]; + +export type PostBotsByBotIdContainerFsFileResponses = { + /** + * OK + */ + 200: HandlersFsWriteResponse; +}; + +export type PostBotsByBotIdContainerFsFileResponse = PostBotsByBotIdContainerFsFileResponses[keyof PostBotsByBotIdContainerFsFileResponses]; + +export type GetBotsByBotIdContainerFsStatData = { + body?: never; + path: { + /** + * Bot ID + */ + bot_id: string; + }; + query: { + /** + * Relative path + */ + path: string; + }; + url: '/bots/{bot_id}/container/fs/stat'; +}; + +export type GetBotsByBotIdContainerFsStatErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type GetBotsByBotIdContainerFsStatError = GetBotsByBotIdContainerFsStatErrors[keyof GetBotsByBotIdContainerFsStatErrors]; + +export type GetBotsByBotIdContainerFsStatResponses = { + /** + * OK + */ + 200: HandlersFsStatResponse; +}; + +export type GetBotsByBotIdContainerFsStatResponse = GetBotsByBotIdContainerFsStatResponses[keyof GetBotsByBotIdContainerFsStatResponses]; + +export type PostBotsByBotIdContainerFsUploadData = { + body?: never; + path: { + /** + * Bot ID + */ + bot_id: string; + }; + query?: { + /** + * Relative file path or directory + */ + path?: string; + }; + url: '/bots/{bot_id}/container/fs/upload'; +}; + +export type PostBotsByBotIdContainerFsUploadErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type PostBotsByBotIdContainerFsUploadError = PostBotsByBotIdContainerFsUploadErrors[keyof PostBotsByBotIdContainerFsUploadErrors]; + +export type PostBotsByBotIdContainerFsUploadResponses = { + /** + * OK + */ + 200: HandlersFsWriteResponse; +}; + +export type PostBotsByBotIdContainerFsUploadResponse = PostBotsByBotIdContainerFsUploadResponses[keyof PostBotsByBotIdContainerFsUploadResponses]; + +export type GetBotsByBotIdContainerFsUsageData = { + body?: never; + path: { + /** + * Bot ID + */ + bot_id: string; + }; + query?: { + /** + * Relative directory path + */ + path?: string; + }; + url: '/bots/{bot_id}/container/fs/usage'; +}; + +export type GetBotsByBotIdContainerFsUsageErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type GetBotsByBotIdContainerFsUsageError = GetBotsByBotIdContainerFsUsageErrors[keyof GetBotsByBotIdContainerFsUsageErrors]; + +export type GetBotsByBotIdContainerFsUsageResponses = { + /** + * OK + */ + 200: HandlersFsUsageResponse; +}; + +export type GetBotsByBotIdContainerFsUsageResponse = GetBotsByBotIdContainerFsUsageResponses[keyof GetBotsByBotIdContainerFsUsageResponses]; + +export type DeleteBotsByBotIdContainerSkillsData = { + /** + * Delete skills payload + */ + body: HandlersSkillsDeleteRequest; + path: { + /** + * Bot ID + */ + bot_id: string; + }; + query?: never; + url: '/bots/{bot_id}/container/skills'; +}; + +export type DeleteBotsByBotIdContainerSkillsErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type DeleteBotsByBotIdContainerSkillsError = DeleteBotsByBotIdContainerSkillsErrors[keyof DeleteBotsByBotIdContainerSkillsErrors]; + +export type DeleteBotsByBotIdContainerSkillsResponses = { + /** + * OK + */ + 200: HandlersSkillsOpResponse; +}; + +export type DeleteBotsByBotIdContainerSkillsResponse = DeleteBotsByBotIdContainerSkillsResponses[keyof DeleteBotsByBotIdContainerSkillsResponses]; + +export type GetBotsByBotIdContainerSkillsData = { + body?: never; + path: { + /** + * Bot ID + */ + bot_id: string; + }; + query?: never; + url: '/bots/{bot_id}/container/skills'; +}; + +export type GetBotsByBotIdContainerSkillsErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type GetBotsByBotIdContainerSkillsError = GetBotsByBotIdContainerSkillsErrors[keyof GetBotsByBotIdContainerSkillsErrors]; + +export type GetBotsByBotIdContainerSkillsResponses = { + /** + * OK + */ + 200: HandlersSkillsResponse; +}; + +export type GetBotsByBotIdContainerSkillsResponse = GetBotsByBotIdContainerSkillsResponses[keyof GetBotsByBotIdContainerSkillsResponses]; + +export type PostBotsByBotIdContainerSkillsData = { + /** + * Skills payload + */ + body: HandlersSkillsUpsertRequest; + path: { + /** + * Bot ID + */ + bot_id: string; + }; + query?: never; + url: '/bots/{bot_id}/container/skills'; +}; + +export type PostBotsByBotIdContainerSkillsErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type PostBotsByBotIdContainerSkillsError = PostBotsByBotIdContainerSkillsErrors[keyof PostBotsByBotIdContainerSkillsErrors]; + +export type PostBotsByBotIdContainerSkillsResponses = { + /** + * OK + */ + 200: HandlersSkillsOpResponse; +}; + +export type PostBotsByBotIdContainerSkillsResponse = PostBotsByBotIdContainerSkillsResponses[keyof PostBotsByBotIdContainerSkillsResponses]; + +export type GetBotsByBotIdContainerSnapshotsData = { + body?: never; + path: { + /** + * Bot ID + */ + bot_id: string; + }; + query?: { + /** + * Snapshotter name + */ + snapshotter?: string; + }; + url: '/bots/{bot_id}/container/snapshots'; +}; + +export type GetBotsByBotIdContainerSnapshotsResponses = { + /** + * OK + */ + 200: HandlersListSnapshotsResponse; +}; + +export type GetBotsByBotIdContainerSnapshotsResponse = GetBotsByBotIdContainerSnapshotsResponses[keyof GetBotsByBotIdContainerSnapshotsResponses]; + +export type PostBotsByBotIdContainerSnapshotsData = { + /** + * Create snapshot payload + */ + body: HandlersCreateSnapshotRequest; + path: { + /** + * Bot ID + */ + bot_id: string; + }; + query?: never; + url: '/bots/{bot_id}/container/snapshots'; +}; + +export type PostBotsByBotIdContainerSnapshotsErrors = { + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type PostBotsByBotIdContainerSnapshotsError = PostBotsByBotIdContainerSnapshotsErrors[keyof PostBotsByBotIdContainerSnapshotsErrors]; + +export type PostBotsByBotIdContainerSnapshotsResponses = { + /** + * OK + */ + 200: HandlersCreateSnapshotResponse; +}; + +export type PostBotsByBotIdContainerSnapshotsResponse = PostBotsByBotIdContainerSnapshotsResponses[keyof PostBotsByBotIdContainerSnapshotsResponses]; + +export type PostBotsByBotIdContainerStartData = { + body?: never; + path: { + /** + * Bot ID + */ + bot_id: string; + }; + query?: never; + url: '/bots/{bot_id}/container/start'; +}; + +export type PostBotsByBotIdContainerStartErrors = { + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type PostBotsByBotIdContainerStartError = PostBotsByBotIdContainerStartErrors[keyof PostBotsByBotIdContainerStartErrors]; + +export type PostBotsByBotIdContainerStartResponses = { + /** + * OK + */ + 200: { + [key: string]: unknown; + }; +}; + +export type PostBotsByBotIdContainerStartResponse = PostBotsByBotIdContainerStartResponses[keyof PostBotsByBotIdContainerStartResponses]; + +export type PostBotsByBotIdContainerStopData = { + body?: never; + path: { + /** + * Bot ID + */ + bot_id: string; + }; + query?: never; + url: '/bots/{bot_id}/container/stop'; +}; + +export type PostBotsByBotIdContainerStopErrors = { + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type PostBotsByBotIdContainerStopError = PostBotsByBotIdContainerStopErrors[keyof PostBotsByBotIdContainerStopErrors]; + +export type PostBotsByBotIdContainerStopResponses = { + /** + * OK + */ + 200: { + [key: string]: unknown; + }; +}; + +export type PostBotsByBotIdContainerStopResponse = PostBotsByBotIdContainerStopResponses[keyof PostBotsByBotIdContainerStopResponses]; + +export type DeleteBotsByBotIdHistoryData = { + body?: never; + path?: never; + query?: never; + url: '/bots/{bot_id}/history'; +}; + +export type DeleteBotsByBotIdHistoryErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type DeleteBotsByBotIdHistoryError = DeleteBotsByBotIdHistoryErrors[keyof DeleteBotsByBotIdHistoryErrors]; + +export type DeleteBotsByBotIdHistoryResponses = { + /** + * No Content + */ + 204: unknown; +}; + +export type GetBotsByBotIdHistoryData = { + body?: never; + path?: never; + query?: { + /** + * Limit + */ + limit?: number; + }; + url: '/bots/{bot_id}/history'; +}; + +export type GetBotsByBotIdHistoryErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type GetBotsByBotIdHistoryError = GetBotsByBotIdHistoryErrors[keyof GetBotsByBotIdHistoryErrors]; + +export type GetBotsByBotIdHistoryResponses = { + /** + * OK + */ + 200: HistoryListResponse; +}; + +export type GetBotsByBotIdHistoryResponse = GetBotsByBotIdHistoryResponses[keyof GetBotsByBotIdHistoryResponses]; + +export type PostBotsByBotIdHistoryData = { + /** + * History payload + */ + body: HistoryCreateRequest; + path?: never; + query?: never; + url: '/bots/{bot_id}/history'; +}; + +export type PostBotsByBotIdHistoryErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type PostBotsByBotIdHistoryError = PostBotsByBotIdHistoryErrors[keyof PostBotsByBotIdHistoryErrors]; + +export type PostBotsByBotIdHistoryResponses = { + /** + * Created + */ + 201: HistoryRecord; +}; + +export type PostBotsByBotIdHistoryResponse = PostBotsByBotIdHistoryResponses[keyof PostBotsByBotIdHistoryResponses]; + +export type DeleteBotsByBotIdHistoryByIdData = { + body?: never; + path: { + /** + * History ID + */ + id: string; + }; + query?: never; + url: '/bots/{bot_id}/history/{id}'; +}; + +export type DeleteBotsByBotIdHistoryByIdErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Forbidden + */ + 403: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type DeleteBotsByBotIdHistoryByIdError = DeleteBotsByBotIdHistoryByIdErrors[keyof DeleteBotsByBotIdHistoryByIdErrors]; + +export type DeleteBotsByBotIdHistoryByIdResponses = { + /** + * No Content + */ + 204: unknown; +}; + +export type GetBotsByBotIdHistoryByIdData = { + body?: never; + path: { + /** + * History ID + */ + id: string; + }; + query?: never; + url: '/bots/{bot_id}/history/{id}'; +}; + +export type GetBotsByBotIdHistoryByIdErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type GetBotsByBotIdHistoryByIdError = GetBotsByBotIdHistoryByIdErrors[keyof GetBotsByBotIdHistoryByIdErrors]; + +export type GetBotsByBotIdHistoryByIdResponses = { + /** + * OK + */ + 200: HistoryRecord; +}; + +export type GetBotsByBotIdHistoryByIdResponse = GetBotsByBotIdHistoryByIdResponses[keyof GetBotsByBotIdHistoryByIdResponses]; + +export type GetBotsByBotIdMcpData = { + body?: never; + path?: never; + query?: never; + url: '/bots/{bot_id}/mcp'; +}; + +export type GetBotsByBotIdMcpErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Forbidden + */ + 403: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type GetBotsByBotIdMcpError = GetBotsByBotIdMcpErrors[keyof GetBotsByBotIdMcpErrors]; + +export type GetBotsByBotIdMcpResponses = { + /** + * OK + */ + 200: McpListResponse; +}; + +export type GetBotsByBotIdMcpResponse = GetBotsByBotIdMcpResponses[keyof GetBotsByBotIdMcpResponses]; + +export type PostBotsByBotIdMcpData = { + /** + * MCP payload + */ + body: McpUpsertRequest; + path?: never; + query?: never; + url: '/bots/{bot_id}/mcp'; +}; + +export type PostBotsByBotIdMcpErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Forbidden + */ + 403: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type PostBotsByBotIdMcpError = PostBotsByBotIdMcpErrors[keyof PostBotsByBotIdMcpErrors]; + +export type PostBotsByBotIdMcpResponses = { + /** + * Created + */ + 201: GithubComMemohaiMemohInternalMcpConnection; +}; + +export type PostBotsByBotIdMcpResponse = PostBotsByBotIdMcpResponses[keyof PostBotsByBotIdMcpResponses]; + +export type PostBotsByBotIdMcpStdioData = { + /** + * Stdio MCP payload + */ + body: HandlersMcpStdioRequest; + path: { + /** + * Bot ID + */ + bot_id: string; + }; + query?: never; + url: '/bots/{bot_id}/mcp-stdio'; +}; + +export type PostBotsByBotIdMcpStdioErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type PostBotsByBotIdMcpStdioError = PostBotsByBotIdMcpStdioErrors[keyof PostBotsByBotIdMcpStdioErrors]; + +export type PostBotsByBotIdMcpStdioResponses = { + /** + * OK + */ + 200: HandlersMcpStdioResponse; +}; + +export type PostBotsByBotIdMcpStdioResponse = PostBotsByBotIdMcpStdioResponses[keyof PostBotsByBotIdMcpStdioResponses]; + +export type PostBotsByBotIdMcpStdioBySessionIdData = { + /** + * JSON-RPC request + */ + body: { + [key: string]: unknown; + }; + path: { + /** + * Bot ID + */ + bot_id: string; + /** + * Session ID + */ + session_id: string; + }; + query?: never; + url: '/bots/{bot_id}/mcp-stdio/{session_id}'; +}; + +export type PostBotsByBotIdMcpStdioBySessionIdErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type PostBotsByBotIdMcpStdioBySessionIdError = PostBotsByBotIdMcpStdioBySessionIdErrors[keyof PostBotsByBotIdMcpStdioBySessionIdErrors]; + +export type PostBotsByBotIdMcpStdioBySessionIdResponses = { + /** + * JSON-RPC response: {jsonrpc,id,result|error} + */ + 200: { + [key: string]: unknown; + }; +}; + +export type PostBotsByBotIdMcpStdioBySessionIdResponse = PostBotsByBotIdMcpStdioBySessionIdResponses[keyof PostBotsByBotIdMcpStdioBySessionIdResponses]; + +export type DeleteBotsByBotIdMcpByIdData = { + body?: never; + path: { + /** + * MCP ID + */ + id: string; + }; + query?: never; + url: '/bots/{bot_id}/mcp/{id}'; +}; + +export type DeleteBotsByBotIdMcpByIdErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Forbidden + */ + 403: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type DeleteBotsByBotIdMcpByIdError = DeleteBotsByBotIdMcpByIdErrors[keyof DeleteBotsByBotIdMcpByIdErrors]; + +export type DeleteBotsByBotIdMcpByIdResponses = { + /** + * No Content + */ + 204: unknown; +}; + +export type GetBotsByBotIdMcpByIdData = { + body?: never; + path: { + /** + * MCP ID + */ + id: string; + }; + query?: never; + url: '/bots/{bot_id}/mcp/{id}'; +}; + +export type GetBotsByBotIdMcpByIdErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Forbidden + */ + 403: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type GetBotsByBotIdMcpByIdError = GetBotsByBotIdMcpByIdErrors[keyof GetBotsByBotIdMcpByIdErrors]; + +export type GetBotsByBotIdMcpByIdResponses = { + /** + * OK + */ + 200: GithubComMemohaiMemohInternalMcpConnection; +}; + +export type GetBotsByBotIdMcpByIdResponse = GetBotsByBotIdMcpByIdResponses[keyof GetBotsByBotIdMcpByIdResponses]; + +export type PutBotsByBotIdMcpByIdData = { + /** + * MCP payload + */ + body: McpUpsertRequest; + path: { + /** + * MCP ID + */ + id: string; + }; + query?: never; + url: '/bots/{bot_id}/mcp/{id}'; +}; + +export type PutBotsByBotIdMcpByIdErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Forbidden + */ + 403: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type PutBotsByBotIdMcpByIdError = PutBotsByBotIdMcpByIdErrors[keyof PutBotsByBotIdMcpByIdErrors]; + +export type PutBotsByBotIdMcpByIdResponses = { + /** + * OK + */ + 200: GithubComMemohaiMemohInternalMcpConnection; +}; + +export type PutBotsByBotIdMcpByIdResponse = PutBotsByBotIdMcpByIdResponses[keyof PutBotsByBotIdMcpByIdResponses]; + +export type PostBotsByBotIdMemoryAddData = { + /** + * Add request + */ + body: HandlersMemoryAddPayload; + path?: never; + query?: never; + url: '/bots/{bot_id}/memory/add'; +}; + +export type PostBotsByBotIdMemoryAddErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type PostBotsByBotIdMemoryAddError = PostBotsByBotIdMemoryAddErrors[keyof PostBotsByBotIdMemoryAddErrors]; + +export type PostBotsByBotIdMemoryAddResponses = { + /** + * OK + */ + 200: MemorySearchResponse; +}; + +export type PostBotsByBotIdMemoryAddResponse = PostBotsByBotIdMemoryAddResponses[keyof PostBotsByBotIdMemoryAddResponses]; + +export type PostBotsByBotIdMemoryEmbedData = { + /** + * Embed upsert request + */ + body: HandlersMemoryEmbedUpsertPayload; + path?: never; + query?: never; + url: '/bots/{bot_id}/memory/embed'; +}; + +export type PostBotsByBotIdMemoryEmbedErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type PostBotsByBotIdMemoryEmbedError = PostBotsByBotIdMemoryEmbedErrors[keyof PostBotsByBotIdMemoryEmbedErrors]; + +export type PostBotsByBotIdMemoryEmbedResponses = { + /** + * OK + */ + 200: MemoryEmbedUpsertResponse; +}; + +export type PostBotsByBotIdMemoryEmbedResponse = PostBotsByBotIdMemoryEmbedResponses[keyof PostBotsByBotIdMemoryEmbedResponses]; + +export type DeleteBotsByBotIdMemoryMemoriesData = { + /** + * Delete all request + */ + body: HandlersMemoryDeleteAllPayload; + path?: never; + query?: never; + url: '/bots/{bot_id}/memory/memories'; +}; + +export type DeleteBotsByBotIdMemoryMemoriesErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type DeleteBotsByBotIdMemoryMemoriesError = DeleteBotsByBotIdMemoryMemoriesErrors[keyof DeleteBotsByBotIdMemoryMemoriesErrors]; + +export type DeleteBotsByBotIdMemoryMemoriesResponses = { + /** + * OK + */ + 200: MemoryDeleteResponse; +}; + +export type DeleteBotsByBotIdMemoryMemoriesResponse = DeleteBotsByBotIdMemoryMemoriesResponses[keyof DeleteBotsByBotIdMemoryMemoriesResponses]; + +export type GetBotsByBotIdMemoryMemoriesData = { + body?: never; + path?: never; + query?: { + /** + * Run ID + */ + run_id?: string; + /** + * Limit + */ + limit?: number; + }; + url: '/bots/{bot_id}/memory/memories'; +}; + +export type GetBotsByBotIdMemoryMemoriesErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type GetBotsByBotIdMemoryMemoriesError = GetBotsByBotIdMemoryMemoriesErrors[keyof GetBotsByBotIdMemoryMemoriesErrors]; + +export type GetBotsByBotIdMemoryMemoriesResponses = { + /** + * OK + */ + 200: MemorySearchResponse; +}; + +export type GetBotsByBotIdMemoryMemoriesResponse = GetBotsByBotIdMemoryMemoriesResponses[keyof GetBotsByBotIdMemoryMemoriesResponses]; + +export type DeleteBotsByBotIdMemoryMemoriesByMemoryIdData = { + body?: never; + path: { + /** + * Memory ID + */ + memoryId: string; + }; + query?: never; + url: '/bots/{bot_id}/memory/memories/{memoryId}'; +}; + +export type DeleteBotsByBotIdMemoryMemoriesByMemoryIdErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type DeleteBotsByBotIdMemoryMemoriesByMemoryIdError = DeleteBotsByBotIdMemoryMemoriesByMemoryIdErrors[keyof DeleteBotsByBotIdMemoryMemoriesByMemoryIdErrors]; + +export type DeleteBotsByBotIdMemoryMemoriesByMemoryIdResponses = { + /** + * OK + */ + 200: MemoryDeleteResponse; +}; + +export type DeleteBotsByBotIdMemoryMemoriesByMemoryIdResponse = DeleteBotsByBotIdMemoryMemoriesByMemoryIdResponses[keyof DeleteBotsByBotIdMemoryMemoriesByMemoryIdResponses]; + +export type GetBotsByBotIdMemoryMemoriesByMemoryIdData = { + body?: never; + path: { + /** + * Memory ID + */ + memoryId: string; + }; + query?: never; + url: '/bots/{bot_id}/memory/memories/{memoryId}'; +}; + +export type GetBotsByBotIdMemoryMemoriesByMemoryIdErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type GetBotsByBotIdMemoryMemoriesByMemoryIdError = GetBotsByBotIdMemoryMemoriesByMemoryIdErrors[keyof GetBotsByBotIdMemoryMemoriesByMemoryIdErrors]; + +export type GetBotsByBotIdMemoryMemoriesByMemoryIdResponses = { + /** + * OK + */ + 200: MemoryMemoryItem; +}; + +export type GetBotsByBotIdMemoryMemoriesByMemoryIdResponse = GetBotsByBotIdMemoryMemoriesByMemoryIdResponses[keyof GetBotsByBotIdMemoryMemoriesByMemoryIdResponses]; + +export type PostBotsByBotIdMemorySearchData = { + /** + * Search request + */ + body: HandlersMemorySearchPayload; + path?: never; + query?: never; + url: '/bots/{bot_id}/memory/search'; +}; + +export type PostBotsByBotIdMemorySearchErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type PostBotsByBotIdMemorySearchError = PostBotsByBotIdMemorySearchErrors[keyof PostBotsByBotIdMemorySearchErrors]; + +export type PostBotsByBotIdMemorySearchResponses = { + /** + * OK + */ + 200: MemorySearchResponse; +}; + +export type PostBotsByBotIdMemorySearchResponse = PostBotsByBotIdMemorySearchResponses[keyof PostBotsByBotIdMemorySearchResponses]; + +export type PostBotsByBotIdMemoryUpdateData = { + /** + * Update request + */ + body: MemoryUpdateRequest; + path?: never; + query?: never; + url: '/bots/{bot_id}/memory/update'; +}; + +export type PostBotsByBotIdMemoryUpdateErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type PostBotsByBotIdMemoryUpdateError = PostBotsByBotIdMemoryUpdateErrors[keyof PostBotsByBotIdMemoryUpdateErrors]; + +export type PostBotsByBotIdMemoryUpdateResponses = { + /** + * OK + */ + 200: MemoryMemoryItem; +}; + +export type PostBotsByBotIdMemoryUpdateResponse = PostBotsByBotIdMemoryUpdateResponses[keyof PostBotsByBotIdMemoryUpdateResponses]; + +export type GetBotsByBotIdScheduleData = { + body?: never; + path?: never; + query?: never; + url: '/bots/{bot_id}/schedule'; +}; + +export type GetBotsByBotIdScheduleErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type GetBotsByBotIdScheduleError = GetBotsByBotIdScheduleErrors[keyof GetBotsByBotIdScheduleErrors]; + +export type GetBotsByBotIdScheduleResponses = { + /** + * OK + */ + 200: ScheduleListResponse; +}; + +export type GetBotsByBotIdScheduleResponse = GetBotsByBotIdScheduleResponses[keyof GetBotsByBotIdScheduleResponses]; + +export type PostBotsByBotIdScheduleData = { + /** + * Schedule payload + */ + body: ScheduleCreateRequest; + path?: never; + query?: never; + url: '/bots/{bot_id}/schedule'; +}; + +export type PostBotsByBotIdScheduleErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type PostBotsByBotIdScheduleError = PostBotsByBotIdScheduleErrors[keyof PostBotsByBotIdScheduleErrors]; + +export type PostBotsByBotIdScheduleResponses = { + /** + * Created + */ + 201: ScheduleSchedule; +}; + +export type PostBotsByBotIdScheduleResponse = PostBotsByBotIdScheduleResponses[keyof PostBotsByBotIdScheduleResponses]; + +export type DeleteBotsByBotIdScheduleByIdData = { + body?: never; + path: { + /** + * Schedule ID + */ + id: string; + }; + query?: never; + url: '/bots/{bot_id}/schedule/{id}'; +}; + +export type DeleteBotsByBotIdScheduleByIdErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type DeleteBotsByBotIdScheduleByIdError = DeleteBotsByBotIdScheduleByIdErrors[keyof DeleteBotsByBotIdScheduleByIdErrors]; + +export type DeleteBotsByBotIdScheduleByIdResponses = { + /** + * No Content + */ + 204: unknown; +}; + +export type GetBotsByBotIdScheduleByIdData = { + body?: never; + path: { + /** + * Schedule ID + */ + id: string; + }; + query?: never; + url: '/bots/{bot_id}/schedule/{id}'; +}; + +export type GetBotsByBotIdScheduleByIdErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type GetBotsByBotIdScheduleByIdError = GetBotsByBotIdScheduleByIdErrors[keyof GetBotsByBotIdScheduleByIdErrors]; + +export type GetBotsByBotIdScheduleByIdResponses = { + /** + * OK + */ + 200: ScheduleSchedule; +}; + +export type GetBotsByBotIdScheduleByIdResponse = GetBotsByBotIdScheduleByIdResponses[keyof GetBotsByBotIdScheduleByIdResponses]; + +export type PutBotsByBotIdScheduleByIdData = { + /** + * Schedule payload + */ + body: ScheduleUpdateRequest; + path: { + /** + * Schedule ID + */ + id: string; + }; + query?: never; + url: '/bots/{bot_id}/schedule/{id}'; +}; + +export type PutBotsByBotIdScheduleByIdErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type PutBotsByBotIdScheduleByIdError = PutBotsByBotIdScheduleByIdErrors[keyof PutBotsByBotIdScheduleByIdErrors]; + +export type PutBotsByBotIdScheduleByIdResponses = { + /** + * OK + */ + 200: ScheduleSchedule; +}; + +export type PutBotsByBotIdScheduleByIdResponse = PutBotsByBotIdScheduleByIdResponses[keyof PutBotsByBotIdScheduleByIdResponses]; + +export type DeleteBotsByBotIdSettingsData = { + body?: never; + path?: never; + query?: never; + url: '/bots/{bot_id}/settings'; +}; + +export type DeleteBotsByBotIdSettingsErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type DeleteBotsByBotIdSettingsError = DeleteBotsByBotIdSettingsErrors[keyof DeleteBotsByBotIdSettingsErrors]; + +export type DeleteBotsByBotIdSettingsResponses = { + /** + * No Content + */ + 204: unknown; +}; + +export type GetBotsByBotIdSettingsData = { + body?: never; + path?: never; + query?: never; + url: '/bots/{bot_id}/settings'; +}; + +export type GetBotsByBotIdSettingsErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type GetBotsByBotIdSettingsError = GetBotsByBotIdSettingsErrors[keyof GetBotsByBotIdSettingsErrors]; + +export type GetBotsByBotIdSettingsResponses = { + /** + * OK + */ + 200: SettingsSettings; +}; + +export type GetBotsByBotIdSettingsResponse = GetBotsByBotIdSettingsResponses[keyof GetBotsByBotIdSettingsResponses]; + +export type PostBotsByBotIdSettingsData = { + /** + * Settings payload + */ + body: SettingsUpsertRequest; + path?: never; + query?: never; + url: '/bots/{bot_id}/settings'; +}; + +export type PostBotsByBotIdSettingsErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type PostBotsByBotIdSettingsError = PostBotsByBotIdSettingsErrors[keyof PostBotsByBotIdSettingsErrors]; + +export type PostBotsByBotIdSettingsResponses = { + /** + * OK + */ + 200: SettingsSettings; +}; + +export type PostBotsByBotIdSettingsResponse = PostBotsByBotIdSettingsResponses[keyof PostBotsByBotIdSettingsResponses]; + +export type PutBotsByBotIdSettingsData = { + /** + * Settings payload + */ + body: SettingsUpsertRequest; + path?: never; + query?: never; + url: '/bots/{bot_id}/settings'; +}; + +export type PutBotsByBotIdSettingsErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type PutBotsByBotIdSettingsError = PutBotsByBotIdSettingsErrors[keyof PutBotsByBotIdSettingsErrors]; + +export type PutBotsByBotIdSettingsResponses = { + /** + * OK + */ + 200: SettingsSettings; +}; + +export type PutBotsByBotIdSettingsResponse = PutBotsByBotIdSettingsResponses[keyof PutBotsByBotIdSettingsResponses]; + +export type GetBotsByBotIdSubagentsData = { + body?: never; + path?: never; + query?: never; + url: '/bots/{bot_id}/subagents'; +}; + +export type GetBotsByBotIdSubagentsErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type GetBotsByBotIdSubagentsError = GetBotsByBotIdSubagentsErrors[keyof GetBotsByBotIdSubagentsErrors]; + +export type GetBotsByBotIdSubagentsResponses = { + /** + * OK + */ + 200: SubagentListResponse; +}; + +export type GetBotsByBotIdSubagentsResponse = GetBotsByBotIdSubagentsResponses[keyof GetBotsByBotIdSubagentsResponses]; + +export type PostBotsByBotIdSubagentsData = { + /** + * Subagent payload + */ + body: SubagentCreateRequest; + path?: never; + query?: never; + url: '/bots/{bot_id}/subagents'; +}; + +export type PostBotsByBotIdSubagentsErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type PostBotsByBotIdSubagentsError = PostBotsByBotIdSubagentsErrors[keyof PostBotsByBotIdSubagentsErrors]; + +export type PostBotsByBotIdSubagentsResponses = { + /** + * Created + */ + 201: SubagentSubagent; +}; + +export type PostBotsByBotIdSubagentsResponse = PostBotsByBotIdSubagentsResponses[keyof PostBotsByBotIdSubagentsResponses]; + +export type DeleteBotsByBotIdSubagentsByIdData = { + body?: never; + path: { + /** + * Subagent ID + */ + id: string; + }; + query?: never; + url: '/bots/{bot_id}/subagents/{id}'; +}; + +export type DeleteBotsByBotIdSubagentsByIdErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type DeleteBotsByBotIdSubagentsByIdError = DeleteBotsByBotIdSubagentsByIdErrors[keyof DeleteBotsByBotIdSubagentsByIdErrors]; + +export type DeleteBotsByBotIdSubagentsByIdResponses = { + /** + * No Content + */ + 204: unknown; +}; + +export type GetBotsByBotIdSubagentsByIdData = { + body?: never; + path: { + /** + * Subagent ID + */ + id: string; + }; + query?: never; + url: '/bots/{bot_id}/subagents/{id}'; +}; + +export type GetBotsByBotIdSubagentsByIdErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type GetBotsByBotIdSubagentsByIdError = GetBotsByBotIdSubagentsByIdErrors[keyof GetBotsByBotIdSubagentsByIdErrors]; + +export type GetBotsByBotIdSubagentsByIdResponses = { + /** + * OK + */ + 200: SubagentSubagent; +}; + +export type GetBotsByBotIdSubagentsByIdResponse = GetBotsByBotIdSubagentsByIdResponses[keyof GetBotsByBotIdSubagentsByIdResponses]; + +export type PutBotsByBotIdSubagentsByIdData = { + /** + * Subagent payload + */ + body: SubagentUpdateRequest; + path: { + /** + * Subagent ID + */ + id: string; + }; + query?: never; + url: '/bots/{bot_id}/subagents/{id}'; +}; + +export type PutBotsByBotIdSubagentsByIdErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type PutBotsByBotIdSubagentsByIdError = PutBotsByBotIdSubagentsByIdErrors[keyof PutBotsByBotIdSubagentsByIdErrors]; + +export type PutBotsByBotIdSubagentsByIdResponses = { + /** + * OK + */ + 200: SubagentSubagent; +}; + +export type PutBotsByBotIdSubagentsByIdResponse = PutBotsByBotIdSubagentsByIdResponses[keyof PutBotsByBotIdSubagentsByIdResponses]; + +export type GetBotsByBotIdSubagentsByIdContextData = { + body?: never; + path: { + /** + * Subagent ID + */ + id: string; + }; + query?: never; + url: '/bots/{bot_id}/subagents/{id}/context'; +}; + +export type GetBotsByBotIdSubagentsByIdContextErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type GetBotsByBotIdSubagentsByIdContextError = GetBotsByBotIdSubagentsByIdContextErrors[keyof GetBotsByBotIdSubagentsByIdContextErrors]; + +export type GetBotsByBotIdSubagentsByIdContextResponses = { + /** + * OK + */ + 200: SubagentContextResponse; +}; + +export type GetBotsByBotIdSubagentsByIdContextResponse = GetBotsByBotIdSubagentsByIdContextResponses[keyof GetBotsByBotIdSubagentsByIdContextResponses]; + +export type PutBotsByBotIdSubagentsByIdContextData = { + /** + * Context payload + */ + body: SubagentUpdateContextRequest; + path: { + /** + * Subagent ID + */ + id: string; + }; + query?: never; + url: '/bots/{bot_id}/subagents/{id}/context'; +}; + +export type PutBotsByBotIdSubagentsByIdContextErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type PutBotsByBotIdSubagentsByIdContextError = PutBotsByBotIdSubagentsByIdContextErrors[keyof PutBotsByBotIdSubagentsByIdContextErrors]; + +export type PutBotsByBotIdSubagentsByIdContextResponses = { + /** + * OK + */ + 200: SubagentContextResponse; +}; + +export type PutBotsByBotIdSubagentsByIdContextResponse = PutBotsByBotIdSubagentsByIdContextResponses[keyof PutBotsByBotIdSubagentsByIdContextResponses]; + +export type GetBotsByBotIdSubagentsByIdSkillsData = { + body?: never; + path: { + /** + * Subagent ID + */ + id: string; + }; + query?: never; + url: '/bots/{bot_id}/subagents/{id}/skills'; +}; + +export type GetBotsByBotIdSubagentsByIdSkillsErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type GetBotsByBotIdSubagentsByIdSkillsError = GetBotsByBotIdSubagentsByIdSkillsErrors[keyof GetBotsByBotIdSubagentsByIdSkillsErrors]; + +export type GetBotsByBotIdSubagentsByIdSkillsResponses = { + /** + * OK + */ + 200: SubagentSkillsResponse; +}; + +export type GetBotsByBotIdSubagentsByIdSkillsResponse = GetBotsByBotIdSubagentsByIdSkillsResponses[keyof GetBotsByBotIdSubagentsByIdSkillsResponses]; + +export type PostBotsByBotIdSubagentsByIdSkillsData = { + /** + * Skills payload + */ + body: SubagentAddSkillsRequest; + path: { + /** + * Subagent ID + */ + id: string; + }; + query?: never; + url: '/bots/{bot_id}/subagents/{id}/skills'; +}; + +export type PostBotsByBotIdSubagentsByIdSkillsErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type PostBotsByBotIdSubagentsByIdSkillsError = PostBotsByBotIdSubagentsByIdSkillsErrors[keyof PostBotsByBotIdSubagentsByIdSkillsErrors]; + +export type PostBotsByBotIdSubagentsByIdSkillsResponses = { + /** + * OK + */ + 200: SubagentSkillsResponse; +}; + +export type PostBotsByBotIdSubagentsByIdSkillsResponse = PostBotsByBotIdSubagentsByIdSkillsResponses[keyof PostBotsByBotIdSubagentsByIdSkillsResponses]; + +export type PutBotsByBotIdSubagentsByIdSkillsData = { + /** + * Skills payload + */ + body: SubagentUpdateSkillsRequest; + path: { + /** + * Subagent ID + */ + id: string; + }; + query?: never; + url: '/bots/{bot_id}/subagents/{id}/skills'; +}; + +export type PutBotsByBotIdSubagentsByIdSkillsErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type PutBotsByBotIdSubagentsByIdSkillsError = PutBotsByBotIdSubagentsByIdSkillsErrors[keyof PutBotsByBotIdSubagentsByIdSkillsErrors]; + +export type PutBotsByBotIdSubagentsByIdSkillsResponses = { + /** + * OK + */ + 200: SubagentSkillsResponse; +}; + +export type PutBotsByBotIdSubagentsByIdSkillsResponse = PutBotsByBotIdSubagentsByIdSkillsResponses[keyof PutBotsByBotIdSubagentsByIdSkillsResponses]; + +export type DeleteBotsByIdData = { + body?: never; + path: { + /** + * Bot ID + */ + id: string; + }; + query?: never; + url: '/bots/{id}'; +}; + +export type DeleteBotsByIdErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Forbidden + */ + 403: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type DeleteBotsByIdError = DeleteBotsByIdErrors[keyof DeleteBotsByIdErrors]; + +export type DeleteBotsByIdResponses = { + /** + * No Content + */ + 204: unknown; +}; + +export type GetBotsByIdData = { + body?: never; + path: { + /** + * Bot ID + */ + id: string; + }; + query?: never; + url: '/bots/{id}'; +}; + +export type GetBotsByIdErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Forbidden + */ + 403: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type GetBotsByIdError = GetBotsByIdErrors[keyof GetBotsByIdErrors]; + +export type GetBotsByIdResponses = { + /** + * OK + */ + 200: BotsBot; +}; + +export type GetBotsByIdResponse = GetBotsByIdResponses[keyof GetBotsByIdResponses]; + +export type PutBotsByIdData = { + /** + * Bot update payload + */ + body: BotsUpdateBotRequest; + path: { + /** + * Bot ID + */ + id: string; + }; + query?: never; + url: '/bots/{id}'; +}; + +export type PutBotsByIdErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Forbidden + */ + 403: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type PutBotsByIdError = PutBotsByIdErrors[keyof PutBotsByIdErrors]; + +export type PutBotsByIdResponses = { + /** + * OK + */ + 200: BotsBot; +}; + +export type PutBotsByIdResponse = PutBotsByIdResponses[keyof PutBotsByIdResponses]; + +export type GetBotsByIdChannelByPlatformData = { + body?: never; + path: { + /** + * Bot ID + */ + id: string; + /** + * Channel platform + */ + platform: string; + }; + query?: never; + url: '/bots/{id}/channel/{platform}'; +}; + +export type GetBotsByIdChannelByPlatformErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Forbidden + */ + 403: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type GetBotsByIdChannelByPlatformError = GetBotsByIdChannelByPlatformErrors[keyof GetBotsByIdChannelByPlatformErrors]; + +export type GetBotsByIdChannelByPlatformResponses = { + /** + * OK + */ + 200: ChannelChannelConfig; +}; + +export type GetBotsByIdChannelByPlatformResponse = GetBotsByIdChannelByPlatformResponses[keyof GetBotsByIdChannelByPlatformResponses]; + +export type PutBotsByIdChannelByPlatformData = { + /** + * Channel config payload + */ + body: ChannelUpsertConfigRequest; + path: { + /** + * Bot ID + */ + id: string; + /** + * Channel platform + */ + platform: string; + }; + query?: never; + url: '/bots/{id}/channel/{platform}'; +}; + +export type PutBotsByIdChannelByPlatformErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Forbidden + */ + 403: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type PutBotsByIdChannelByPlatformError = PutBotsByIdChannelByPlatformErrors[keyof PutBotsByIdChannelByPlatformErrors]; + +export type PutBotsByIdChannelByPlatformResponses = { + /** + * OK + */ + 200: ChannelChannelConfig; +}; + +export type PutBotsByIdChannelByPlatformResponse = PutBotsByIdChannelByPlatformResponses[keyof PutBotsByIdChannelByPlatformResponses]; + +export type PostBotsByIdChannelByPlatformSendData = { + /** + * Send payload + */ + body: ChannelSendRequest; + path: { + /** + * Bot ID + */ + id: string; + /** + * Channel platform + */ + platform: string; + }; + query?: never; + url: '/bots/{id}/channel/{platform}/send'; +}; + +export type PostBotsByIdChannelByPlatformSendErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Forbidden + */ + 403: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type PostBotsByIdChannelByPlatformSendError = PostBotsByIdChannelByPlatformSendErrors[keyof PostBotsByIdChannelByPlatformSendErrors]; + +export type PostBotsByIdChannelByPlatformSendResponses = { + /** + * OK + */ + 200: { + [key: string]: string; + }; +}; + +export type PostBotsByIdChannelByPlatformSendResponse = PostBotsByIdChannelByPlatformSendResponses[keyof PostBotsByIdChannelByPlatformSendResponses]; + +export type PostBotsByIdChannelByPlatformSendSessionData = { + /** + * Send payload + */ + body: ChannelSendRequest; + path: { + /** + * Bot ID + */ + id: string; + /** + * Channel platform + */ + platform: string; + }; + query?: never; + url: '/bots/{id}/channel/{platform}/send_session'; +}; + +export type PostBotsByIdChannelByPlatformSendSessionErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Unauthorized + */ + 401: HandlersErrorResponse; + /** + * Forbidden + */ + 403: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type PostBotsByIdChannelByPlatformSendSessionError = PostBotsByIdChannelByPlatformSendSessionErrors[keyof PostBotsByIdChannelByPlatformSendSessionErrors]; + +export type PostBotsByIdChannelByPlatformSendSessionResponses = { + /** + * OK + */ + 200: { + [key: string]: string; + }; +}; + +export type PostBotsByIdChannelByPlatformSendSessionResponse = PostBotsByIdChannelByPlatformSendSessionResponses[keyof PostBotsByIdChannelByPlatformSendSessionResponses]; + +export type GetBotsByIdMembersData = { + body?: never; + path: { + /** + * Bot ID + */ + id: string; + }; + query?: never; + url: '/bots/{id}/members'; +}; + +export type GetBotsByIdMembersErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Forbidden + */ + 403: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type GetBotsByIdMembersError = GetBotsByIdMembersErrors[keyof GetBotsByIdMembersErrors]; + +export type GetBotsByIdMembersResponses = { + /** + * OK + */ + 200: BotsListMembersResponse; +}; + +export type GetBotsByIdMembersResponse = GetBotsByIdMembersResponses[keyof GetBotsByIdMembersResponses]; + +export type PutBotsByIdMembersData = { + /** + * Member payload + */ + body: BotsUpsertMemberRequest; + path: { + /** + * Bot ID + */ + id: string; + }; + query?: never; + url: '/bots/{id}/members'; +}; + +export type PutBotsByIdMembersErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Forbidden + */ + 403: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type PutBotsByIdMembersError = PutBotsByIdMembersErrors[keyof PutBotsByIdMembersErrors]; + +export type PutBotsByIdMembersResponses = { + /** + * OK + */ + 200: BotsBotMember; +}; + +export type PutBotsByIdMembersResponse = PutBotsByIdMembersResponses[keyof PutBotsByIdMembersResponses]; + +export type DeleteBotsByIdMembersByUserIdData = { + body?: never; + path: { + /** + * Bot ID + */ + id: string; + /** + * User ID + */ + user_id: string; + }; + query?: never; + url: '/bots/{id}/members/{user_id}'; +}; + +export type DeleteBotsByIdMembersByUserIdErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Forbidden + */ + 403: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type DeleteBotsByIdMembersByUserIdError = DeleteBotsByIdMembersByUserIdErrors[keyof DeleteBotsByIdMembersByUserIdErrors]; + +export type DeleteBotsByIdMembersByUserIdResponses = { + /** + * No Content + */ + 204: unknown; +}; + +export type PutBotsByIdOwnerData = { + /** + * Transfer payload + */ + body: BotsTransferBotRequest; + path: { + /** + * Bot ID + */ + id: string; + }; + query?: never; + url: '/bots/{id}/owner'; +}; + +export type PutBotsByIdOwnerErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Forbidden + */ + 403: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type PutBotsByIdOwnerError = PutBotsByIdOwnerErrors[keyof PutBotsByIdOwnerErrors]; + +export type PutBotsByIdOwnerResponses = { + /** + * OK + */ + 200: BotsBot; +}; + +export type PutBotsByIdOwnerResponse = PutBotsByIdOwnerResponses[keyof PutBotsByIdOwnerResponses]; + +export type GetChannelsData = { + body?: never; + path?: never; + query?: never; + url: '/channels'; +}; + +export type GetChannelsErrors = { + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type GetChannelsError = GetChannelsErrors[keyof GetChannelsErrors]; + +export type GetChannelsResponses = { + /** + * OK + */ + 200: Array; +}; + +export type GetChannelsResponse = GetChannelsResponses[keyof GetChannelsResponses]; + +export type GetChannelsByPlatformData = { + body?: never; + path: { + /** + * Channel platform + */ + platform: string; + }; + query?: never; + url: '/channels/{platform}'; +}; + +export type GetChannelsByPlatformErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; +}; + +export type GetChannelsByPlatformError = GetChannelsByPlatformErrors[keyof GetChannelsByPlatformErrors]; + +export type GetChannelsByPlatformResponses = { + /** + * OK + */ + 200: HandlersChannelMeta; +}; + +export type GetChannelsByPlatformResponse = GetChannelsByPlatformResponses[keyof GetChannelsByPlatformResponses]; + +export type PostEmbeddingsData = { + /** + * Embeddings request + */ + body: HandlersEmbeddingsRequest; + path?: never; + query?: never; + url: '/embeddings'; +}; + +export type PostEmbeddingsErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; + /** + * Not Implemented + */ + 501: HandlersEmbeddingsResponse; +}; + +export type PostEmbeddingsError = PostEmbeddingsErrors[keyof PostEmbeddingsErrors]; + +export type PostEmbeddingsResponses = { + /** + * OK + */ + 200: HandlersEmbeddingsResponse; +}; + +export type PostEmbeddingsResponse = PostEmbeddingsResponses[keyof PostEmbeddingsResponses]; + +export type GetModelsData = { + body?: never; + path?: never; + query?: { + /** + * Model type (chat, embedding) + */ + type?: string; + /** + * Client type (openai, anthropic, google) + */ + client_type?: string; + }; + url: '/models'; +}; + +export type GetModelsErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type GetModelsError = GetModelsErrors[keyof GetModelsErrors]; + +export type GetModelsResponses = { + /** + * OK + */ + 200: Array; +}; + +export type GetModelsResponse = GetModelsResponses[keyof GetModelsResponses]; + +export type PostModelsData = { + /** + * Model configuration + */ + body: ModelsAddRequest; + path?: never; + query?: never; + url: '/models'; +}; + +export type PostModelsErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type PostModelsError = PostModelsErrors[keyof PostModelsErrors]; + +export type PostModelsResponses = { + /** + * Created + */ + 201: ModelsAddResponse; +}; + +export type PostModelsResponse = PostModelsResponses[keyof PostModelsResponses]; + +export type GetModelsCountData = { + body?: never; + path?: never; + query?: { + /** + * Model type (chat, embedding) + */ + type?: string; + }; + url: '/models/count'; +}; + +export type GetModelsCountErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type GetModelsCountError = GetModelsCountErrors[keyof GetModelsCountErrors]; + +export type GetModelsCountResponses = { + /** + * OK + */ + 200: ModelsCountResponse; +}; + +export type GetModelsCountResponse = GetModelsCountResponses[keyof GetModelsCountResponses]; + +export type PostModelsEnableData = { + /** + * Enable model payload + */ + body: HandlersEnableModelRequest; + path?: never; + query?: never; + url: '/models/enable'; +}; + +export type PostModelsEnableErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type PostModelsEnableError = PostModelsEnableErrors[keyof PostModelsEnableErrors]; + +export type PostModelsEnableResponses = { + /** + * OK + */ + 200: SettingsSettings; +}; + +export type PostModelsEnableResponse = PostModelsEnableResponses[keyof PostModelsEnableResponses]; + +export type DeleteModelsModelByModelIdData = { + body?: never; + path: { + /** + * Model ID (e.g., gpt-4) + */ + modelId: string; + }; + query?: never; + url: '/models/model/{modelId}'; +}; + +export type DeleteModelsModelByModelIdErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type DeleteModelsModelByModelIdError = DeleteModelsModelByModelIdErrors[keyof DeleteModelsModelByModelIdErrors]; + +export type DeleteModelsModelByModelIdResponses = { + /** + * No Content + */ + 204: unknown; +}; + +export type GetModelsModelByModelIdData = { + body?: never; + path: { + /** + * Model ID (e.g., gpt-4) + */ + modelId: string; + }; + query?: never; + url: '/models/model/{modelId}'; +}; + +export type GetModelsModelByModelIdErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type GetModelsModelByModelIdError = GetModelsModelByModelIdErrors[keyof GetModelsModelByModelIdErrors]; + +export type GetModelsModelByModelIdResponses = { + /** + * OK + */ + 200: ModelsGetResponse; +}; + +export type GetModelsModelByModelIdResponse = GetModelsModelByModelIdResponses[keyof GetModelsModelByModelIdResponses]; + +export type PutModelsModelByModelIdData = { + /** + * Updated model configuration + */ + body: ModelsUpdateRequest; + path: { + /** + * Model ID (e.g., gpt-4) + */ + modelId: string; + }; + query?: never; + url: '/models/model/{modelId}'; +}; + +export type PutModelsModelByModelIdErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type PutModelsModelByModelIdError = PutModelsModelByModelIdErrors[keyof PutModelsModelByModelIdErrors]; + +export type PutModelsModelByModelIdResponses = { + /** + * OK + */ + 200: ModelsGetResponse; +}; + +export type PutModelsModelByModelIdResponse = PutModelsModelByModelIdResponses[keyof PutModelsModelByModelIdResponses]; + +export type DeleteModelsByIdData = { + body?: never; + path: { + /** + * Model internal ID (UUID) + */ + id: string; + }; + query?: never; + url: '/models/{id}'; +}; + +export type DeleteModelsByIdErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type DeleteModelsByIdError = DeleteModelsByIdErrors[keyof DeleteModelsByIdErrors]; + +export type DeleteModelsByIdResponses = { + /** + * No Content + */ + 204: unknown; +}; + +export type GetModelsByIdData = { + body?: never; + path: { + /** + * Model internal ID (UUID) + */ + id: string; + }; + query?: never; + url: '/models/{id}'; +}; + +export type GetModelsByIdErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type GetModelsByIdError = GetModelsByIdErrors[keyof GetModelsByIdErrors]; + +export type GetModelsByIdResponses = { + /** + * OK + */ + 200: ModelsGetResponse; +}; + +export type GetModelsByIdResponse = GetModelsByIdResponses[keyof GetModelsByIdResponses]; + +export type PutModelsByIdData = { + /** + * Updated model configuration + */ + body: ModelsUpdateRequest; + path: { + /** + * Model internal ID (UUID) + */ + id: string; + }; + query?: never; + url: '/models/{id}'; +}; + +export type PutModelsByIdErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type PutModelsByIdError = PutModelsByIdErrors[keyof PutModelsByIdErrors]; + +export type PutModelsByIdResponses = { + /** + * OK + */ + 200: ModelsGetResponse; +}; + +export type PutModelsByIdResponse = PutModelsByIdResponses[keyof PutModelsByIdResponses]; + +export type GetProvidersData = { + body?: never; + path?: never; + query?: { + /** + * Client type filter (openai, anthropic, google, ollama) + */ + client_type?: string; + }; + url: '/providers'; +}; + +export type GetProvidersErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type GetProvidersError = GetProvidersErrors[keyof GetProvidersErrors]; + +export type GetProvidersResponses = { + /** + * OK + */ + 200: Array; +}; + +export type GetProvidersResponse = GetProvidersResponses[keyof GetProvidersResponses]; + +export type PostProvidersData = { + /** + * Provider configuration + */ + body: ProvidersCreateRequest; + path?: never; + query?: never; + url: '/providers'; +}; + +export type PostProvidersErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type PostProvidersError = PostProvidersErrors[keyof PostProvidersErrors]; + +export type PostProvidersResponses = { + /** + * Created + */ + 201: ProvidersGetResponse; +}; + +export type PostProvidersResponse = PostProvidersResponses[keyof PostProvidersResponses]; + +export type GetProvidersCountData = { + body?: never; + path?: never; + query?: { + /** + * Client type filter (openai, anthropic, google, ollama) + */ + client_type?: string; + }; + url: '/providers/count'; +}; + +export type GetProvidersCountErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type GetProvidersCountError = GetProvidersCountErrors[keyof GetProvidersCountErrors]; + +export type GetProvidersCountResponses = { + /** + * OK + */ + 200: ProvidersCountResponse; +}; + +export type GetProvidersCountResponse = GetProvidersCountResponses[keyof GetProvidersCountResponses]; + +export type GetProvidersNameByNameData = { + body?: never; + path: { + /** + * Provider name + */ + name: string; + }; + query?: never; + url: '/providers/name/{name}'; +}; + +export type GetProvidersNameByNameErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type GetProvidersNameByNameError = GetProvidersNameByNameErrors[keyof GetProvidersNameByNameErrors]; + +export type GetProvidersNameByNameResponses = { + /** + * OK + */ + 200: ProvidersGetResponse; +}; + +export type GetProvidersNameByNameResponse = GetProvidersNameByNameResponses[keyof GetProvidersNameByNameResponses]; + +export type DeleteProvidersByIdData = { + body?: never; + path: { + /** + * Provider ID (UUID) + */ + id: string; + }; + query?: never; + url: '/providers/{id}'; +}; + +export type DeleteProvidersByIdErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type DeleteProvidersByIdError = DeleteProvidersByIdErrors[keyof DeleteProvidersByIdErrors]; + +export type DeleteProvidersByIdResponses = { + /** + * No Content + */ + 204: unknown; +}; + +export type GetProvidersByIdData = { + body?: never; + path: { + /** + * Provider ID (UUID) + */ + id: string; + }; + query?: never; + url: '/providers/{id}'; +}; + +export type GetProvidersByIdErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type GetProvidersByIdError = GetProvidersByIdErrors[keyof GetProvidersByIdErrors]; + +export type GetProvidersByIdResponses = { + /** + * OK + */ + 200: ProvidersGetResponse; +}; + +export type GetProvidersByIdResponse = GetProvidersByIdResponses[keyof GetProvidersByIdResponses]; + +export type PutProvidersByIdData = { + /** + * Updated provider configuration + */ + body: ProvidersUpdateRequest; + path: { + /** + * Provider ID (UUID) + */ + id: string; + }; + query?: never; + url: '/providers/{id}'; +}; + +export type PutProvidersByIdErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type PutProvidersByIdError = PutProvidersByIdErrors[keyof PutProvidersByIdErrors]; + +export type PutProvidersByIdResponses = { + /** + * OK + */ + 200: ProvidersGetResponse; +}; + +export type PutProvidersByIdResponse = PutProvidersByIdResponses[keyof PutProvidersByIdResponses]; + +export type GetProvidersByIdModelsData = { + body?: never; + path: { + /** + * Provider ID (UUID) + */ + id: string; + }; + query?: { + /** + * Model type (chat, embedding) + */ + type?: string; + }; + url: '/providers/{id}/models'; +}; + +export type GetProvidersByIdModelsErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type GetProvidersByIdModelsError = GetProvidersByIdModelsErrors[keyof GetProvidersByIdModelsErrors]; + +export type GetProvidersByIdModelsResponses = { + /** + * OK + */ + 200: Array; +}; + +export type GetProvidersByIdModelsResponse = GetProvidersByIdModelsResponses[keyof GetProvidersByIdModelsResponses]; + +export type GetUsersData = { + body?: never; + path?: never; + query?: never; + url: '/users'; +}; + +export type GetUsersErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Forbidden + */ + 403: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type GetUsersError = GetUsersErrors[keyof GetUsersErrors]; + +export type GetUsersResponses = { + /** + * OK + */ + 200: UsersListUsersResponse; +}; + +export type GetUsersResponse = GetUsersResponses[keyof GetUsersResponses]; + +export type PostUsersData = { + /** + * User payload + */ + body: UsersCreateUserRequest; + path?: never; + query?: never; + url: '/users'; +}; + +export type PostUsersErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Forbidden + */ + 403: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type PostUsersError = PostUsersErrors[keyof PostUsersErrors]; + +export type PostUsersResponses = { + /** + * Created + */ + 201: UsersUser; +}; + +export type PostUsersResponse = PostUsersResponses[keyof PostUsersResponses]; + +export type GetUsersMeData = { + body?: never; + path?: never; + query?: never; + url: '/users/me'; +}; + +export type GetUsersMeErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type GetUsersMeError = GetUsersMeErrors[keyof GetUsersMeErrors]; + +export type GetUsersMeResponses = { + /** + * OK + */ + 200: UsersUser; +}; + +export type GetUsersMeResponse = GetUsersMeResponses[keyof GetUsersMeResponses]; + +export type PutUsersMeData = { + /** + * Profile payload + */ + body: UsersUpdateProfileRequest; + path?: never; + query?: never; + url: '/users/me'; +}; + +export type PutUsersMeErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type PutUsersMeError = PutUsersMeErrors[keyof PutUsersMeErrors]; + +export type PutUsersMeResponses = { + /** + * OK + */ + 200: UsersUser; +}; + +export type PutUsersMeResponse = PutUsersMeResponses[keyof PutUsersMeResponses]; + +export type GetUsersMeChannelsByPlatformData = { + body?: never; + path: { + /** + * Channel platform + */ + platform: string; + }; + query?: never; + url: '/users/me/channels/{platform}'; +}; + +export type GetUsersMeChannelsByPlatformErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type GetUsersMeChannelsByPlatformError = GetUsersMeChannelsByPlatformErrors[keyof GetUsersMeChannelsByPlatformErrors]; + +export type GetUsersMeChannelsByPlatformResponses = { + /** + * OK + */ + 200: ChannelChannelUserBinding; +}; + +export type GetUsersMeChannelsByPlatformResponse = GetUsersMeChannelsByPlatformResponses[keyof GetUsersMeChannelsByPlatformResponses]; + +export type PutUsersMeChannelsByPlatformData = { + /** + * Channel user config payload + */ + body: ChannelUpsertUserConfigRequest; + path: { + /** + * Channel platform + */ + platform: string; + }; + query?: never; + url: '/users/me/channels/{platform}'; +}; + +export type PutUsersMeChannelsByPlatformErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type PutUsersMeChannelsByPlatformError = PutUsersMeChannelsByPlatformErrors[keyof PutUsersMeChannelsByPlatformErrors]; + +export type PutUsersMeChannelsByPlatformResponses = { + /** + * OK + */ + 200: ChannelChannelUserBinding; +}; + +export type PutUsersMeChannelsByPlatformResponse = PutUsersMeChannelsByPlatformResponses[keyof PutUsersMeChannelsByPlatformResponses]; + +export type PutUsersMePasswordData = { + /** + * Password payload + */ + body: UsersUpdatePasswordRequest; + path?: never; + query?: never; + url: '/users/me/password'; +}; + +export type PutUsersMePasswordErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type PutUsersMePasswordError = PutUsersMePasswordErrors[keyof PutUsersMePasswordErrors]; + +export type PutUsersMePasswordResponses = { + /** + * No Content + */ + 204: unknown; +}; + +export type GetUsersByIdData = { + body?: never; + path: { + /** + * User ID + */ + id: string; + }; + query?: never; + url: '/users/{id}'; +}; + +export type GetUsersByIdErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Forbidden + */ + 403: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type GetUsersByIdError = GetUsersByIdErrors[keyof GetUsersByIdErrors]; + +export type GetUsersByIdResponses = { + /** + * OK + */ + 200: UsersUser; +}; + +export type GetUsersByIdResponse = GetUsersByIdResponses[keyof GetUsersByIdResponses]; + +export type PutUsersByIdData = { + /** + * User update payload + */ + body: UsersUpdateUserRequest; + path: { + /** + * User ID + */ + id: string; + }; + query?: never; + url: '/users/{id}'; +}; + +export type PutUsersByIdErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Forbidden + */ + 403: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type PutUsersByIdError = PutUsersByIdErrors[keyof PutUsersByIdErrors]; + +export type PutUsersByIdResponses = { + /** + * OK + */ + 200: UsersUser; +}; + +export type PutUsersByIdResponse = PutUsersByIdResponses[keyof PutUsersByIdResponses]; + +export type PutUsersByIdPasswordData = { + /** + * Password payload + */ + body: UsersResetPasswordRequest; + path: { + /** + * User ID + */ + id: string; + }; + query?: never; + url: '/users/{id}/password'; +}; + +export type PutUsersByIdPasswordErrors = { + /** + * Bad Request + */ + 400: HandlersErrorResponse; + /** + * Forbidden + */ + 403: HandlersErrorResponse; + /** + * Not Found + */ + 404: HandlersErrorResponse; + /** + * Internal Server Error + */ + 500: HandlersErrorResponse; +}; + +export type PutUsersByIdPasswordError = PutUsersByIdPasswordErrors[keyof PutUsersByIdPasswordErrors]; + +export type PutUsersByIdPasswordResponses = { + /** + * No Content + */ + 204: unknown; +}; diff --git a/packages/web/mise.toml b/packages/web/mise.toml index 82fe917e..78461797 100644 --- a/packages/web/mise.toml +++ b/packages/web/mise.toml @@ -2,13 +2,23 @@ alias = "dev" description = "Start web development server" run = "pnpm dev" -depends = ["//:pnpm-install"] +depends = [ + "//:pnpm-install", + "//:sdk-generate", +] [tasks.build] description = "Build web" run = "pnpm build" -depends = ["//:pnpm-install"] +depends = [ + "//:pnpm-install", + "//:sdk-generate", +] [tasks.start] description = "Start web" -run = "pnpm start" \ No newline at end of file +run = "pnpm start" +depends = [ + "//:pnpm-install", + "//:sdk-generate", +] \ No newline at end of file diff --git a/packages/web/package.json b/packages/web/package.json index 1e4c1b13..3fe77d4a 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -11,6 +11,7 @@ "dependencies": { "@memoh/shared": "workspace:*", "@memoh/ui": "workspace:*", + "@memoh/sdk": "workspace:*", "@pinia/colada": "^0.21.1", "@tailwindcss/vite": "^4.1.18", "@tanstack/vue-table": "^8.21.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7fb565fd..188f729d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15,6 +15,9 @@ importers: specifier: ^0.31.8 version: 0.31.8 devDependencies: + '@hey-api/openapi-ts': + specifier: 0.92.3 + version: 0.92.3(typescript@5.9.3) '@types/node': specifier: ^25.0.3 version: 25.0.3 @@ -144,6 +147,8 @@ importers: specifier: latest version: 1.3.8 + packages/sdk: {} + packages/shared: {} packages/ui: @@ -251,12 +256,9 @@ importers: '@fortawesome/vue-fontawesome': specifier: ^3.1.1 version: 3.1.3(@fortawesome/fontawesome-svg-core@7.1.0)(vue@3.5.26(typescript@5.9.3)) - '@jamescoyle/vue-icon': - specifier: ^0.1.2 - version: 0.1.2 - '@mdi/js': - specifier: ^7.4.47 - version: 7.4.47 + '@memoh/sdk': + specifier: workspace:* + version: link:../sdk '@memoh/shared': specifier: workspace:* version: link:../shared @@ -278,9 +280,6 @@ importers: '@vueuse/core': specifier: ^14.1.0 version: 14.1.0(vue@3.5.26(typescript@5.9.3)) - axios: - specifier: ^1.13.2 - version: 1.13.4 dotenv: specifier: ^17.2.3 version: 17.2.3 @@ -1405,6 +1404,34 @@ packages: '@fortawesome/fontawesome-svg-core': ~1 || ~6 || ~7 vue: '>= 3.0.0 < 4' + '@hey-api/codegen-core@0.7.0': + resolution: {integrity: sha512-HglL4B4QwpzocE+c8qDU6XK8zMf8W8Pcv0RpFDYxHuYALWLTnpDUuEsglC7NQ4vC1maoXsBpMbmwpco0N4QviA==} + engines: {node: '>=20.19.0'} + peerDependencies: + typescript: '>=5.5.3' + + '@hey-api/json-schema-ref-parser@1.2.4': + resolution: {integrity: sha512-uuOaZ6tStUgRJFUqnX3Xdbs792++ezxOLI5NMxuikVklpbFWk2wcvIZbeX+qTWDv6kiS1Ik2EVKQgeQFWHML4A==} + engines: {node: '>= 16'} + + '@hey-api/openapi-ts@0.92.3': + resolution: {integrity: sha512-D+2ySL+PXvp1iZtS+1gTEeGChwjHT3d/a6o9IwAaNdGJVsI1lPqESZx7vxqjoUtE/DruovGZC2/jPc/kA5IQPg==} + engines: {node: '>=20.19.0'} + hasBin: true + peerDependencies: + typescript: '>=5.5.3' + + '@hey-api/shared@0.1.2': + resolution: {integrity: sha512-dcldulfNI1xiXl/zhdXKDlNX2bvY0TOBWRRyFXNtcfPddMEFcrlXGmi/wk6LN4fPyDO8lM7FAM9aEpkEdUo92A==} + engines: {node: '>=20.19.0'} + peerDependencies: + typescript: '>=5.5.3' + + '@hey-api/types@0.1.3': + resolution: {integrity: sha512-mZaiPOWH761yD4GjDQvtjS2ZYLu5o5pI1TVSvV/u7cmbybv51/FVtinFBeaE1kFQCKZ8OQpn2ezjLBJrKsGATw==} + peerDependencies: + typescript: '>=5.5.3' + '@hono/node-server@1.19.9': resolution: {integrity: sha512-vHL6w3ecZsky+8P5MD+eFfaGTyCeOHUIFYMGpQGbrBTSmNNoxv0if69rEZ5giu36weC5saFuznL411gRX7bJDw==} engines: {node: '>=18.14.1'} @@ -1596,9 +1623,6 @@ packages: resolution: {integrity: sha512-ZT55BDLV0yv0RBm2czMiZ+SqCGO7AvmOM3G/w2xhVPH+te0aKgFjmBvGlL1dH+ql2tgGO3MVrbb3jCKyvpgnxA==} engines: {node: 20 || >=22} - '@jamescoyle/vue-icon@0.1.2': - resolution: {integrity: sha512-KFrImXx5TKIi6iQXlnyLEBl4rNosNKbTeRnr70ucTdUaciVmd9qK9d/pZAaKt1Ob/8xNnX2GMp8LisyHdKtEgw==} - '@jridgewell/gen-mapping@0.3.13': resolution: {integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==} @@ -1615,8 +1639,8 @@ packages: '@jridgewell/trace-mapping@0.3.31': resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==} - '@mdi/js@7.4.47': - resolution: {integrity: sha512-KPnNOtm5i2pMabqZxpUz7iQf+mfrYZyKCZ8QNz85czgEt7cuHcGorWfdzUMWYA0SD+a6Hn4FmJ+YhzzzjkTZrQ==} + '@jsdevtools/ono@7.1.3': + resolution: {integrity: sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==} '@mermaid-js/parser@0.6.3': resolution: {integrity: sha512-lnjOhe7zyHjc+If7yT4zoedx2vo4sHaTmtkl1+or8BRTnCtDmcTpAjpzDSfCZrshM5bCoz0GyidzadJAH1xobA==} @@ -2489,6 +2513,10 @@ packages: alien-signals@3.1.2: resolution: {integrity: sha512-d9dYqZTS90WLiU0I5c6DHj/HcKkF8ZyGN3G5x8wSbslulz70KOxaqCT0hQCo9KOyhVqzqGojvNdJXoTumZOtcw==} + ansi-colors@4.1.3: + resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==} + engines: {node: '>=6'} + ansi-regex@5.0.1: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} engines: {node: '>=8'} @@ -2578,6 +2606,14 @@ packages: resolution: {integrity: sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==} engines: {node: '>= 0.8'} + c12@3.3.3: + resolution: {integrity: sha512-750hTRvgBy5kcMNPdh95Qo+XUBeGo8C7nsKSmedDmaQI+E0r82DwHeM6vBewDe4rGFbnxoa4V9pw+sPh5+Iz8Q==} + peerDependencies: + magicast: '*' + peerDependenciesMeta: + magicast: + optional: true + call-bind-apply-helpers@1.0.2: resolution: {integrity: sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==} engines: {node: '>= 0.4'} @@ -2625,6 +2661,16 @@ packages: chevrotain@11.0.3: resolution: {integrity: sha512-ci2iJH6LeIkvP9eJW6gpueU8cnZhv85ELY8w8WiFtNjMHA5ad6pQLaJo9mEly/9qUyCpvqX8/POVUTf18/HFdw==} + chokidar@5.0.0: + resolution: {integrity: sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw==} + engines: {node: '>= 20.19.0'} + + citty@0.1.6: + resolution: {integrity: sha512-tskPPKEs8D2KPafUypv2gxwJP8h/OaJmC82QQGGDQcHvXX43xF2VDACcJVmZ0EuSxkpO9Kc4MlrA3q0+FG58AQ==} + + citty@0.2.0: + resolution: {integrity: sha512-8csy5IBFI2ex2hTVpaHN2j+LNE199AgiI7y4dMintrr8i0lQiFn+0AWMZrWdHKIgMOer65f8IThysYhoReqjWA==} + class-variance-authority@0.7.1: resolution: {integrity: sha512-Ka+9Trutv7G8M6WT6SeiRWz792K5qEqIGEGzXKhAE6xOWAY6pPH8U+9IY3oCMv6kqTmLsv7Xh/2w2RigkePMsg==} @@ -2651,6 +2697,10 @@ packages: color-name@1.1.4: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + color-support@1.1.3: + resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} + hasBin: true + combined-stream@1.0.8: resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} engines: {node: '>= 0.8'} @@ -2662,6 +2712,10 @@ packages: resolution: {integrity: sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==} engines: {node: '>=18'} + commander@14.0.3: + resolution: {integrity: sha512-H+y0Jo/T1RZ9qPP4Eh1pkcQcLRglraJaSLoyOtHxu6AapkjWVCy2Sit1QQ4x3Dng8qDlSsZEet7g5Pq06MvTgw==} + engines: {node: '>=20'} + commander@7.2.0: resolution: {integrity: sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==} engines: {node: '>= 10'} @@ -2682,6 +2736,10 @@ packages: confbox@0.2.2: resolution: {integrity: sha512-1NB+BKqhtNipMsov4xI/NnhCKp9XG9NamYp5PVm9klAT0fsrNPjaFICsCFhNhwZJKNh7zB/3q8qXz0E9oaMNtQ==} + consola@3.4.2: + resolution: {integrity: sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==} + engines: {node: ^14.18.0 || >=16.10.0} + content-disposition@1.0.1: resolution: {integrity: sha512-oIXISMynqSqm241k6kcQ5UwttDILMK4BiurCfGEREw6+X9jkkpEe5T9FZaApyLGGOnFuyMWZpdolTXMtvEJ08Q==} engines: {node: '>=18'} @@ -2951,6 +3009,9 @@ packages: resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==} engines: {node: '>=6'} + destr@2.0.5: + resolution: {integrity: sha512-ugFTXCtDZunbzasqBxrK93Ik/DRYsO6S/fedkWEMKqt04xZ4csmnmwGDBAb07QWNaGMAmnTIemsYZCksjATwsA==} + detect-libc@2.1.2: resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==} engines: {node: '>=8'} @@ -3294,6 +3355,10 @@ packages: get-tsconfig@4.13.0: resolution: {integrity: sha512-1VKTZJCwBrvbd+Wn3AOgQP/2Av+TfTCOlE4AcRJE72W1ksZXbAx8PPBR9RzgTeSPzlPMHrbANMH3LbltH73wxQ==} + giget@2.0.0: + resolution: {integrity: sha512-L5bGsVkxJbJgdnwyuheIunkGatUF/zssUoxxjACCseZYAVbaqdh9Tsmmlkl8vYan09H7sbvKt4pS8GqKLBrEzA==} + hasBin: true + glob-parent@6.0.2: resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} engines: {node: '>=10.13.0'} @@ -3435,6 +3500,10 @@ packages: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} + is-in-ssh@1.0.0: + resolution: {integrity: sha512-jYa6Q9rH90kR1vKB6NM7qqd1mge3Fx4Dhw5TVlK1MUBqhEOuCagrEHMevNuCcbECmXZ0ThXkRm+Ymr51HwEPAw==} + engines: {node: '>=20'} + is-inside-container@1.0.0: resolution: {integrity: sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==} engines: {node: '>=14.16'} @@ -3661,6 +3730,9 @@ packages: lodash@4.17.21: resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} + lodash@4.17.23: + resolution: {integrity: sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w==} + log-symbols@6.0.0: resolution: {integrity: sha512-i24m8rpwhmPIS4zscNzK6MSEhk0DUWa/8iYQWxhffV8jkI4Phvs3F+quL5xvS0gdQR0FyTCMMH33Y78dDTzzIw==} engines: {node: '>=18'} @@ -3872,6 +3944,9 @@ packages: engines: {node: '>=10.5.0'} deprecated: Use your platform's native DOMException instead + node-fetch-native@1.6.7: + resolution: {integrity: sha512-g9yhqoedzIUm0nTnTqAQvueMPVOuIY16bqgAJJC8XOOubYFNwz6IER9qs0Gq2Xd0+CecCKFjtdDTMA4u4xG06Q==} + node-fetch@3.3.2: resolution: {integrity: sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} @@ -3891,6 +3966,11 @@ packages: nth-check@2.1.1: resolution: {integrity: sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==} + nypm@0.6.5: + resolution: {integrity: sha512-K6AJy1GMVyfyMXRVB88700BJqNUkByijGJM8kEHpLdcAt+vSQAVfkWWHYzuRXHSY6xA2sNc5RjTj0p9rE2izVQ==} + engines: {node: '>=18'} + hasBin: true + object-assign@4.1.1: resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} engines: {node: '>=0.10.0'} @@ -3929,6 +4009,10 @@ packages: resolution: {integrity: sha512-YgBpdJHPyQ2UE5x+hlSXcnejzAvD0b22U2OuAP+8OnlJT+PjWPxtgmGqKKc+RgTM63U9gN0YzrYc71R2WT/hTA==} engines: {node: '>=18'} + open@11.0.0: + resolution: {integrity: sha512-smsWv2LzFjP03xmvFoJ331ss6h+jixfA4UUV/Bsiyuu4YJPfN+FIQGOIiv4w9/+MoHkfkJ22UIaQWRVFRfH6Vw==} + engines: {node: '>=20'} + openapi-types@12.1.3: resolution: {integrity: sha512-N4YtSYJqghVu4iek2ZUvcN/0aqH1kRDuNqzcycDxhOUpg7GdvLa2F3DgS6yBNhInhv2r/6I0Flkn7CqL8+nIcw==} @@ -4053,6 +4137,10 @@ packages: resolution: {integrity: sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==} engines: {node: ^10 || ^12 || >=14} + powershell-utils@0.1.0: + resolution: {integrity: sha512-dM0jVuXJPsDN6DvRpea484tCUaMiXWjuCn++HGTqUWzGDjv5tZkEZldAJ/UMlqRYGFrD/etByo4/xOuC/snX2A==} + engines: {node: '>=20'} + preact@10.28.2: resolution: {integrity: sha512-lbteaWGzGHdlIuiJ0l2Jq454m6kcpI1zNje6d8MlGAFlYvP2GO4ibnat7P74Esfz4sPTdM6UxtTwh/d3pwM9JA==} @@ -4093,10 +4181,17 @@ packages: resolution: {integrity: sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA==} engines: {node: '>= 0.10'} + rc9@2.1.2: + resolution: {integrity: sha512-btXCnMmRIBINM2LDZoEmOogIZU7Qe7zn4BpomSKZ/ykbLObuBdvG+mFq11DL6fjH1DRwHhrlgtYWG96bJiC7Cg==} + read-package-json-fast@4.0.0: resolution: {integrity: sha512-qpt8EwugBWDw2cgE2W+/3oxC+KTez2uSVR8JU9Q36TXPAGCaozfQUs59v4j4GFpWTaw0i6hAZSvOmu1J0uOEUg==} engines: {node: ^18.17.0 || >=20.5.0} + readdirp@5.0.0: + resolution: {integrity: sha512-9u/XQ1pvrQtYyMpZe7DXKv2p5CNvyVwzUB6uhLAnQwHMSgKMBR62lc7AHljaeteeHXn11XTAaLLUVZYVZyuRBQ==} + engines: {node: '>= 20.19.0'} + regex-recursion@6.0.2: resolution: {integrity: sha512-0YCaSCq2VRIebiaUviZNs0cBz1kg5kVS2UKUfNIx8YVs1cN3AV7NTctO5FOKBA+UT2BPJIWZauYHPqJODG50cg==} @@ -4871,6 +4966,10 @@ packages: resolution: {integrity: sha512-h3Fbisa2nKGPxCpm89Hk33lBLsnaGBvctQopaBSOW/uIs6FTe1ATyAnKFJrzVs9vpGdsTe73WF3V4lIsk4Gacw==} engines: {node: '>=18'} + wsl-utils@0.3.1: + resolution: {integrity: sha512-g/eziiSUNBSsdDJtCLB8bdYEUMj4jR7AGeUo96p/3dTafgjHhpF4RiCFPiRILwjQoDXx5MqkBr4fwWtR3Ky4Wg==} + engines: {node: '>=20'} + xml-name-validator@4.0.0: resolution: {integrity: sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==} engines: {node: '>=12'} @@ -5766,6 +5865,53 @@ snapshots: '@fortawesome/fontawesome-svg-core': 7.1.0 vue: 3.5.26(typescript@5.9.3) + '@hey-api/codegen-core@0.7.0(typescript@5.9.3)': + dependencies: + '@hey-api/types': 0.1.3(typescript@5.9.3) + ansi-colors: 4.1.3 + c12: 3.3.3 + color-support: 1.1.3 + typescript: 5.9.3 + transitivePeerDependencies: + - magicast + + '@hey-api/json-schema-ref-parser@1.2.4': + dependencies: + '@jsdevtools/ono': 7.1.3 + '@types/json-schema': 7.0.15 + js-yaml: 4.1.1 + lodash: 4.17.23 + + '@hey-api/openapi-ts@0.92.3(typescript@5.9.3)': + dependencies: + '@hey-api/codegen-core': 0.7.0(typescript@5.9.3) + '@hey-api/json-schema-ref-parser': 1.2.4 + '@hey-api/shared': 0.1.2(typescript@5.9.3) + '@hey-api/types': 0.1.3(typescript@5.9.3) + ansi-colors: 4.1.3 + color-support: 1.1.3 + commander: 14.0.3 + typescript: 5.9.3 + transitivePeerDependencies: + - magicast + + '@hey-api/shared@0.1.2(typescript@5.9.3)': + dependencies: + '@hey-api/codegen-core': 0.7.0(typescript@5.9.3) + '@hey-api/json-schema-ref-parser': 1.2.4 + '@hey-api/types': 0.1.3(typescript@5.9.3) + ansi-colors: 4.1.3 + cross-spawn: 7.0.6 + open: 11.0.0 + semver: 7.7.3 + typescript: 5.9.3 + transitivePeerDependencies: + - magicast + + '@hey-api/types@0.1.3(typescript@5.9.3)': + dependencies: + typescript: 5.9.3 + '@hono/node-server@1.19.9(hono@4.11.4)': dependencies: hono: 4.11.4 @@ -5944,8 +6090,6 @@ snapshots: dependencies: '@isaacs/balanced-match': 4.0.1 - '@jamescoyle/vue-icon@0.1.2': {} - '@jridgewell/gen-mapping@0.3.13': dependencies: '@jridgewell/sourcemap-codec': 1.5.5 @@ -5965,7 +6109,7 @@ snapshots: '@jridgewell/resolve-uri': 3.1.2 '@jridgewell/sourcemap-codec': 1.5.5 - '@mdi/js@7.4.47': {} + '@jsdevtools/ono@7.1.3': {} '@mermaid-js/parser@0.6.3': dependencies: @@ -6959,6 +7103,8 @@ snapshots: alien-signals@3.1.2: {} + ansi-colors@4.1.3: {} + ansi-regex@5.0.1: {} ansi-regex@6.2.2: {} @@ -6985,7 +7131,8 @@ snapshots: astral-regex@2.0.0: {} - asynckit@0.4.0: {} + asynckit@0.4.0: + optional: true axios@1.13.4: dependencies: @@ -6994,6 +7141,7 @@ snapshots: proxy-from-env: 1.1.0 transitivePeerDependencies: - debug + optional: true balanced-match@1.0.2: {} @@ -7050,6 +7198,21 @@ snapshots: bytes@3.1.2: {} + c12@3.3.3: + dependencies: + chokidar: 5.0.0 + confbox: 0.2.2 + defu: 6.1.4 + dotenv: 17.2.3 + exsolve: 1.0.8 + giget: 2.0.0 + jiti: 2.6.1 + ohash: 2.0.11 + pathe: 2.0.3 + perfect-debounce: 2.0.0 + pkg-types: 2.3.0 + rc9: 2.1.2 + call-bind-apply-helpers@1.0.2: dependencies: es-errors: 1.3.0 @@ -7095,6 +7258,16 @@ snapshots: '@chevrotain/utils': 11.0.3 lodash-es: 4.17.21 + chokidar@5.0.0: + dependencies: + readdirp: 5.0.0 + + citty@0.1.6: + dependencies: + consola: 3.4.2 + + citty@0.2.0: {} + class-variance-authority@0.7.1: dependencies: clsx: 2.1.1 @@ -7115,14 +7288,19 @@ snapshots: color-name@1.1.4: {} + color-support@1.1.3: {} + combined-stream@1.0.8: dependencies: delayed-stream: 1.0.0 + optional: true comma-separated-tokens@2.0.3: {} commander@12.1.0: {} + commander@14.0.3: {} + commander@7.2.0: {} commander@8.3.0: {} @@ -7135,6 +7313,8 @@ snapshots: confbox@0.2.2: {} + consola@3.4.2: {} + content-disposition@1.0.1: {} content-type@1.0.5: {} @@ -7402,12 +7582,15 @@ snapshots: dependencies: robust-predicates: 3.0.2 - delayed-stream@1.0.0: {} + delayed-stream@1.0.0: + optional: true depd@2.0.0: {} dequal@2.0.3: {} + destr@2.0.5: {} + detect-libc@2.1.2: {} devlop@1.1.0: @@ -7491,6 +7674,7 @@ snapshots: get-intrinsic: 1.3.0 has-tostringtag: 1.0.2 hasown: 2.0.2 + optional: true esbuild-register@3.6.0(esbuild@0.25.12): dependencies: @@ -7813,7 +7997,8 @@ snapshots: dependencies: tabbable: 6.4.0 - follow-redirects@1.15.11: {} + follow-redirects@1.15.11: + optional: true form-data@4.0.5: dependencies: @@ -7822,6 +8007,7 @@ snapshots: es-set-tostringtag: 2.1.0 hasown: 2.0.2 mime-types: 2.1.35 + optional: true formdata-polyfill@4.0.10: dependencies: @@ -7868,6 +8054,15 @@ snapshots: dependencies: resolve-pkg-maps: 1.0.0 + giget@2.0.0: + dependencies: + citty: 0.1.6 + consola: 3.4.2 + defu: 6.1.4 + node-fetch-native: 1.6.7 + nypm: 0.6.5 + pathe: 2.0.3 + glob-parent@6.0.2: dependencies: is-glob: 4.0.3 @@ -7887,6 +8082,7 @@ snapshots: has-tostringtag@1.0.2: dependencies: has-symbols: 1.1.0 + optional: true hasown@2.0.2: dependencies: @@ -8001,6 +8197,8 @@ snapshots: dependencies: is-extglob: 2.1.1 + is-in-ssh@1.0.0: {} + is-inside-container@1.0.0: dependencies: is-docker: 3.0.0 @@ -8191,6 +8389,8 @@ snapshots: lodash@4.17.21: {} + lodash@4.17.23: {} + log-symbols@6.0.0: dependencies: chalk: 5.6.2 @@ -8319,13 +8519,15 @@ snapshots: micromark-util-types@2.0.2: {} - mime-db@1.52.0: {} + mime-db@1.52.0: + optional: true mime-db@1.54.0: {} mime-types@2.1.35: dependencies: mime-db: 1.52.0 + optional: true mime-types@3.0.2: dependencies: @@ -8378,6 +8580,8 @@ snapshots: node-domexception@1.0.0: {} + node-fetch-native@1.6.7: {} + node-fetch@3.3.2: dependencies: data-uri-to-buffer: 4.0.1 @@ -8403,6 +8607,12 @@ snapshots: dependencies: boolbase: 1.0.0 + nypm@0.6.5: + dependencies: + citty: 0.2.0 + pathe: 2.0.3 + tinyexec: 1.0.2 + object-assign@4.1.1: {} object-inspect@1.13.4: {} @@ -8444,6 +8654,15 @@ snapshots: is-inside-container: 1.0.0 wsl-utils: 0.1.0 + open@11.0.0: + dependencies: + default-browser: 5.4.0 + define-lazy-prop: 3.0.0 + is-in-ssh: 1.0.0 + is-inside-container: 1.0.0 + powershell-utils: 0.1.0 + wsl-utils: 0.3.1 + openapi-types@12.1.3: {} optionator@0.9.4: @@ -8560,6 +8779,8 @@ snapshots: picocolors: 1.1.1 source-map-js: 1.2.1 + powershell-utils@0.1.0: {} + preact@10.28.2: {} prelude-ls@1.2.1: {} @@ -8571,7 +8792,8 @@ snapshots: forwarded: 0.2.0 ipaddr.js: 1.9.1 - proxy-from-env@1.1.0: {} + proxy-from-env@1.1.0: + optional: true punycode.js@2.3.1: {} @@ -8592,11 +8814,18 @@ snapshots: iconv-lite: 0.7.2 unpipe: 1.0.0 + rc9@2.1.2: + dependencies: + defu: 6.1.4 + destr: 2.0.5 + read-package-json-fast@4.0.0: dependencies: json-parse-even-better-errors: 4.0.0 npm-normalize-package-bin: 4.0.0 + readdirp@5.0.0: {} + regex-recursion@6.0.2: dependencies: regex-utilities: 2.3.0 @@ -9412,6 +9641,11 @@ snapshots: dependencies: is-wsl: 3.1.0 + wsl-utils@0.3.1: + dependencies: + is-wsl: 3.1.0 + powershell-utils: 0.1.0 + xml-name-validator@4.0.0: {} xml-name-validator@5.0.0: {}