Files
Z.AI-Chat-for-Android/node_modules/@nicepkg/gpt-runner-shared/dist/common.d.ts

2184 lines
84 KiB
TypeScript

import { S as SingleChatMessage, C as ChatMessageStatus, a as ClientEventName, W as WssActionName, b as StorageGetItemReqParams, c as StorageGetItemResData, d as StorageSetItemReqParams, e as StorageSetItemResData, f as StorageRemoveItemReqParams, g as StorageRemoveItemResData, h as StorageClearReqParams, i as StorageClearResData, B as BaseResponse, M as MaybePromise, T as TreeItem, j as SingleFileConfig, U as UserConfig, H as HuggingFaceModelConfig, O as OpenaiModelConfig, A as AnthropicModelConfig, k as ChatModelType, F as FilterPattern, l as SuccessResponse, m as FailResponse, n as ChatRole, G as GetModelConfigType, o as GptFileTreeItemType, p as ServerStorageName, L as LocaleLang } from './env-config-3be2ee5d.js';
export { A as AnthropicModelConfig, a0 as AnthropicSecrets, y as AppConfig, u as BaseApiVendor, s as BaseConfig, a2 as BaseModelConfig, B as BaseResponse, a1 as BaseSecrets, t as ChangeLogConfig, C as ChatMessageStatus, a5 as ChatModel, k as ChatModelType, a3 as ChatModelTypeMap, n as ChatRole, ar as ChatStreamReqParams, a as ClientEventName, x as CommonAppConfig, aN as CreateFilePathReqParams, aO as CreateFilePathResData, z as CurrentAppConfig, _ as DeepRequired, aR as DeleteFilePathReqParams, aS as DeleteFilePathResData, E as Env, q as EnvConfig, m as FailResponse, J as FileBaseInfo, K as FileInfo, X as FileInfoTree, Q as FileInfoTreeItem, F as FilterPattern, P as FolderInfo, ae as FormCheckboxGroupConfig, aa as FormFieldBaseConfig, ab as FormInputConfig, ag as FormItemConfig, a9 as FormOption, af as FormRadioGroupConfig, ad as FormSelectConfig, ac as FormTextareaConfig, aC as GetAppConfigReqParams, aD as GetAppConfigResData, aJ as GetCommonFilesReqParams, aK as GetCommonFilesResData, aT as GetFileInfoReqParams, aU as GetFileInfoResData, aw as GetGptFileInfoReqParams, ax as GetGptFileInfoResData, au as GetGptFilesReqParams, av as GetGptFilesResData, G as GetModelConfigType, as as GetModelNamesForChooseReqParams, at as GetModelNamesForChooseResData, aA as GetProjectConfigReqParams, aB as GetProjectConfigResData, aG as GetUserConfigReqParams, aH as GetUserConfigResData, am as GptChatInfo, ak as GptFileInfo, ao as GptFileInfoTree, an as GptFileInfoTreeItem, o as GptFileTreeItemType, al as GptFolderInfo, aj as GptPathBaseInfo, H as HuggingFaceModelConfig, a6 as HuggingFaceSecrets, ay as InitGptFilesReqParams, az as InitGptFilesResData, D as LastVisitModalDateRecord, L as LocaleLang, aE as MarkAsVisitedAppConfigReqParams, aF as MarkAsVisitedAppConfigResData, r as MarkdownString, I as MarkedAsVisitedType, M as MaybePromise, v as ModelApiVendor, aq as ModelTypeVendorNameMap, w as ModelTypeVendorsMap, N as NotificationConfig, aL as OpenEditorReqParams, aM as OpenEditorResData, O as OpenaiModelConfig, a7 as OpenaiSecrets, a4 as PartialChatModelTypeMap, $ as PartialKeys, ap as ProxySecrets, Y as ReadonlyDeep, R as ReleaseConfig, aP as RenameFilePathReqParams, aQ as RenameFilePathResData, aV as SaveFileContentReqParams, aW as SaveFileContentResData, ah as SecretStorageKey, p as ServerStorageName, aI as ServerStorageValue, S as SingleChatMessage, j as SingleFileConfig, h as StorageClearReqParams, i as StorageClearResData, b as StorageGetItemReqParams, c as StorageGetItemResData, f as StorageRemoveItemReqParams, g as StorageRemoveItemResData, d as StorageSetItemReqParams, e as StorageSetItemResData, l as SuccessResponse, T as TreeItem, U as UserConfig, a8 as UserConfigForUser, Z as ValueOf, ai as VendorTag, V as VendorsConfig, W as WssActionName } from './env-config-3be2ee5d.js';
import { Socket as Socket$1 } from 'socket.io-client';
export { Socket as BrowserSocket } from 'socket.io-client';
import { Socket as Socket$2 } from 'socket.io';
export { Socket as NodeServerSocket } from 'socket.io';
import { ZodSchema, z } from 'zod';
import * as zod_to_json_schema_src_parseDef from 'zod-to-json-schema/src/parseDef';
interface SingleChat {
id: string;
name: string;
inputtingPrompt: string;
systemPrompt: string;
messages: SingleChatMessage[];
singleFilePath: string;
status: ChatMessageStatus;
createAt: number;
}
interface ClientEventData {
[ClientEventName.InitSuccess]: void;
[ClientEventName.RefreshTree]: void;
[ClientEventName.RefreshChatTree]: void;
[ClientEventName.RefreshFileTree]: void;
[ClientEventName.InsertCodes]: {
codes: string;
};
[ClientEventName.DiffCodes]: {
codes: string;
};
[ClientEventName.UpdateIdeOpeningFiles]: {
filePaths: string[];
};
[ClientEventName.UpdateIdeActiveFilePath]: {
filePath: string;
};
[ClientEventName.UpdateUserSelectedText]: {
text: string;
insertInputPrompt?: boolean;
};
[ClientEventName.OpenFileInIde]: {
filePath: string;
};
[ClientEventName.OpenFileInFileEditor]: {
fileFullPath: string;
};
[ClientEventName.GoToChatPanel]: void;
}
type EventEmitterMap = {
[K in ClientEventName]: (data: ClientEventData[K]) => any;
};
interface IWssActionNameRequestMap extends Record<WssActionName, {
reqParams?: Record<string, any>;
resData?: any;
}> {
[WssActionName.Error]: {
reqParams?: {
error: Error;
};
resData?: Error;
};
[WssActionName.StorageGetItem]: {
reqParams?: StorageGetItemReqParams;
resData?: StorageGetItemResData;
};
[WssActionName.StorageSetItem]: {
reqParams?: StorageSetItemReqParams;
resData?: StorageSetItemResData;
};
[WssActionName.StorageRemoveItem]: {
reqParams?: StorageRemoveItemReqParams;
resData?: StorageRemoveItemResData;
};
[WssActionName.StorageClear]: {
reqParams?: StorageClearReqParams;
resData?: StorageClearResData;
};
}
type WssActionNameRequestMap = {
[K in keyof IWssActionNameRequestMap]: {
__id__?: string;
reqParams?: IWssActionNameRequestMap[K]['reqParams'];
res?: BaseResponse<IWssActionNameRequestMap[K]['resData']>;
};
};
type WssEventsMap = {
[K in keyof WssActionNameRequestMap]: (message: WssActionNameRequestMap[K]) => MaybePromise<void>;
};
type Socket = Socket$1 | Socket$2;
declare function sleep(ms: number): Promise<unknown>;
/**
* Checks if an object has its own property with the specified name.
*
* @param obj - The object to check.
* @param prop - The name of the property to check for.
* @returns True if the object has its own property with the specified name, false otherwise.
*/
declare function hasOwn<T extends object, K extends keyof T>(obj: T, prop: K): boolean;
declare function formatSourceValue<T = any>(value: any): T;
declare function travelTree<T extends TreeItem<Record<string, any>>, R extends TreeItem<Record<string, any>> = TreeItem<Record<string, any>>>(tree: T[], callback: (item: T, parent?: T) => void | null | undefined | R): R[];
declare function travelTreeDeepFirst<T extends TreeItem<Record<string, any>>, R extends TreeItem<Record<string, any>> = TreeItem<Record<string, any>>>(tree: T[], callback: (item: T, parent?: T) => void | null | undefined | R): R[];
declare function tryParseJson(str: string, supportJsonc?: boolean): any;
declare function tryStringifyJson(obj: any, ignoreError?: boolean): string;
declare function debounce<T extends (...args: any[]) => any>(callback: T, wait: number): T;
declare function runOnceByKey<T extends (...args: any[]) => any>(callback: T, key: string): T;
declare function urlRemoveLocalhost(url: string | null | undefined): string;
declare function objectToQueryString(obj: Record<string, any>, prefix?: string): string;
declare function toUnixPath(path: string | undefined | null): string;
declare function getProcessCwd(): string | undefined;
declare function getErrorMsg(error: any): string;
declare function waitForCondition(conditionFn: (...args: any[]) => boolean, timeout?: number): Promise<void>;
declare function isChineseCharacter(char: string): boolean;
declare function singleFileConfigWithDefault(singleFileConfig?: Partial<SingleFileConfig>): SingleFileConfig;
declare function userConfigWithDefault(userConfig?: Partial<UserConfig>): {
model: HuggingFaceModelConfig | OpenaiModelConfig | AnthropicModelConfig | {
readonly type: ChatModelType.Openai;
readonly modelName: "gpt-3.5-turbo-16k";
readonly temperature: 0.9;
readonly maxTokens: 2000;
};
rootPath: string | undefined;
exts: string[] | readonly [".gpt.md"];
includes: string | RegExp | readonly (string | RegExp)[] | ((source: string) => boolean) | null;
excludes: string | RegExp | readonly (string | RegExp)[] | ((source: string) => boolean) | null;
respectGitIgnore: boolean;
urlConfig: {
[urlMatch: string]: {
modelNames?: string[] | undefined;
httpRequestHeader?: Record<string, string> | undefined;
};
};
};
interface ResolveSingleFileCConfigParams {
userConfig: UserConfig;
singleFileConfig: SingleFileConfig;
}
declare function resolveSingleFileConfig(params: ResolveSingleFileCConfigParams, withDefault?: boolean): SingleFileConfig;
declare function removeUserConfigUnsafeKey(userConfig: UserConfig): UserConfig;
declare const MIN_NODE_VERSION = "16.15.0";
declare const SECRET_KEY_PLACEHOLDER = "********";
declare const STREAM_DONE_FLAG = "[DONE]";
declare const GPT_RUNNER_OFFICIAL_FOLDER = ".gpt-runner";
declare const DEFAULT_API_BASE_PATH: {
[Key in ChatModelType]: string;
};
declare const DEFAULT_MODEL_NAMES_FOR_CHOOSE: {
[Key in ChatModelType]: string[];
};
declare const DEFAULT_EXCLUDE_FILES: string[];
declare const DEFAULT_EXCLUDE_FILE_EXTS: string[];
declare function createFilterByPattern(pattern: FilterPattern): (source: string) => boolean;
declare class Debug {
static instance: Debug;
private debugger;
private label;
constructor(label: string);
static getInstance(label?: string): Debug;
log(message: string, ...args: unknown[]): void;
warn(message: string, ...args: unknown[]): void;
error(message: string, ...args: unknown[]): void;
}
declare function isNumber<T extends number>(value: T | unknown): value is number;
declare function isString<T extends string>(value: T | unknown): value is string;
declare function isNotEmptyString(value: any): boolean;
declare function isBoolean<T extends boolean>(value: T | unknown): value is boolean;
declare function isFunction<T extends (...args: any[]) => any | void | never>(value: T | unknown): value is T;
declare function isObject<T extends object>(value: T | unknown): value is T;
type CompareFunction<T> = (this: T, a: any, b: any, key?: string) => boolean | undefined;
declare function isShallowEqual<T>(objA: any, objB: any, compare?: CompareFunction<T>, compareContext?: T): boolean;
declare function isDeepEqual(objA: any, objB: any, maxDepth?: number, visited?: any[], depth?: number): boolean;
declare function buildSuccessResponse<T>(options: Omit<SuccessResponse<T>, 'type'>): SuccessResponse<T>;
declare function buildFailResponse<T>(options: Omit<FailResponse<T>, 'type'>): FailResponse<T>;
declare class WssUtils {
#private;
static _instance: WssUtils | undefined;
static defaultWssUrl: string;
static get instance(): WssUtils;
constructor(wssUrl?: string);
static get isBrowser(): boolean;
static isNodeServerSocket(socket: Socket | undefined): socket is Socket$2;
static isBrowserSocket(socket: Socket | undefined): socket is Socket$1;
get wsUrl(): string;
get wss(): Socket | undefined;
connect: (params?: {
server: any;
}) => Promise<Socket | undefined>;
on: <T extends WssActionName>(eventName: T, callback: (message: WssActionNameRequestMap[T]) => MaybePromise<void>) => void;
emit: <T extends WssActionName>(eventName: T, message: WssActionNameRequestMap[T]) => void;
off: <T extends WssActionName>(eventName: T, callback: (message: WssActionNameRequestMap[T]) => MaybePromise<void>) => void;
emitAndWaitForRes: <T extends WssActionName>(eventName: T, message: WssActionNameRequestMap[T]) => Promise<WssActionNameRequestMap[T]>;
}
declare function verifyZod<T>(schema: ZodSchema<T>, value: unknown): T;
declare const userConfigJsonSchema: zod_to_json_schema_src_parseDef.JsonSchema7Type & {
$schema?: string | undefined;
definitions?: {
[key: string]: zod_to_json_schema_src_parseDef.JsonSchema7Type;
} | undefined;
};
declare const singleFileJsonSchema: zod_to_json_schema_src_parseDef.JsonSchema7Type & {
$schema?: string | undefined;
definitions?: {
[key: string]: zod_to_json_schema_src_parseDef.JsonSchema7Type;
} | undefined;
};
declare const BaseSecretsSchema: z.ZodObject<{
basePath: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
basePath?: string | undefined;
}, {
basePath?: string | undefined;
}>;
declare const BaseModelConfigSchema: z.ZodObject<{
type: z.ZodOptional<z.ZodNativeEnum<typeof ChatModelType>>;
modelName: z.ZodOptional<z.ZodString>;
secrets: z.ZodOptional<z.ZodAny>;
}, "strip", z.ZodTypeAny, {
type?: ChatModelType | undefined;
modelName?: string | undefined;
secrets?: any;
}, {
type?: ChatModelType | undefined;
modelName?: string | undefined;
secrets?: any;
}>;
declare const OpenaiSecretsSchema: z.ZodObject<{
apiKey: z.ZodOptional<z.ZodString>;
organization: z.ZodOptional<z.ZodString>;
accessToken: z.ZodOptional<z.ZodString>;
basePath: z.ZodDefault<z.ZodOptional<z.ZodString>>;
}, "strip", z.ZodTypeAny, {
basePath: string;
apiKey?: string | undefined;
organization?: string | undefined;
accessToken?: string | undefined;
}, {
apiKey?: string | undefined;
organization?: string | undefined;
accessToken?: string | undefined;
basePath?: string | undefined;
}>;
declare const OpenaiModelConfigSchema: z.ZodObject<{
modelName: z.ZodOptional<z.ZodString>;
type: z.ZodLiteral<ChatModelType.Openai>;
secrets: z.ZodOptional<z.ZodObject<{
apiKey: z.ZodOptional<z.ZodString>;
organization: z.ZodOptional<z.ZodString>;
accessToken: z.ZodOptional<z.ZodString>;
basePath: z.ZodDefault<z.ZodOptional<z.ZodString>>;
}, "strip", z.ZodTypeAny, {
basePath: string;
apiKey?: string | undefined;
organization?: string | undefined;
accessToken?: string | undefined;
}, {
apiKey?: string | undefined;
organization?: string | undefined;
accessToken?: string | undefined;
basePath?: string | undefined;
}>>;
temperature: z.ZodOptional<z.ZodNumber>;
maxTokens: z.ZodOptional<z.ZodNumber>;
topP: z.ZodOptional<z.ZodNumber>;
frequencyPenalty: z.ZodOptional<z.ZodNumber>;
presencePenalty: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
type: ChatModelType.Openai;
modelName?: string | undefined;
secrets?: {
basePath: string;
apiKey?: string | undefined;
organization?: string | undefined;
accessToken?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
frequencyPenalty?: number | undefined;
presencePenalty?: number | undefined;
}, {
type: ChatModelType.Openai;
modelName?: string | undefined;
secrets?: {
apiKey?: string | undefined;
organization?: string | undefined;
accessToken?: string | undefined;
basePath?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
frequencyPenalty?: number | undefined;
presencePenalty?: number | undefined;
}>;
declare const FilterPatternSchema: z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">, z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>, z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodString], null>, z.ZodBoolean>>, z.ZodNull, z.ZodUndefined]>;
declare const ChatModelSchema: z.ZodUnion<[z.ZodObject<{
modelName: z.ZodOptional<z.ZodString>;
type: z.ZodLiteral<ChatModelType.Anthropic>;
secrets: z.ZodOptional<z.ZodObject<{
apiKey: z.ZodOptional<z.ZodString>;
basePath: z.ZodDefault<z.ZodOptional<z.ZodString>>;
}, "strip", z.ZodTypeAny, {
basePath: string;
apiKey?: string | undefined;
}, {
apiKey?: string | undefined;
basePath?: string | undefined;
}>>;
temperature: z.ZodOptional<z.ZodNumber>;
maxTokens: z.ZodOptional<z.ZodNumber>;
topP: z.ZodOptional<z.ZodNumber>;
topK: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
type: ChatModelType.Anthropic;
modelName?: string | undefined;
secrets?: {
basePath: string;
apiKey?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
topK?: number | undefined;
}, {
type: ChatModelType.Anthropic;
modelName?: string | undefined;
secrets?: {
apiKey?: string | undefined;
basePath?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
topK?: number | undefined;
}>, z.ZodObject<{
modelName: z.ZodOptional<z.ZodString>;
type: z.ZodLiteral<ChatModelType.HuggingFace>;
secrets: z.ZodOptional<z.ZodObject<{
basePath: z.ZodOptional<z.ZodString>;
apiKey: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
basePath?: string | undefined;
apiKey?: string | undefined;
}, {
basePath?: string | undefined;
apiKey?: string | undefined;
}>>;
temperature: z.ZodOptional<z.ZodNumber>;
maxTokens: z.ZodOptional<z.ZodNumber>;
topP: z.ZodOptional<z.ZodNumber>;
topK: z.ZodOptional<z.ZodNumber>;
frequencyPenalty: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
type: ChatModelType.HuggingFace;
modelName?: string | undefined;
secrets?: {
basePath?: string | undefined;
apiKey?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
topK?: number | undefined;
frequencyPenalty?: number | undefined;
}, {
type: ChatModelType.HuggingFace;
modelName?: string | undefined;
secrets?: {
basePath?: string | undefined;
apiKey?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
topK?: number | undefined;
frequencyPenalty?: number | undefined;
}>, z.ZodObject<{
modelName: z.ZodOptional<z.ZodString>;
type: z.ZodLiteral<ChatModelType.Openai>;
secrets: z.ZodOptional<z.ZodObject<{
apiKey: z.ZodOptional<z.ZodString>;
organization: z.ZodOptional<z.ZodString>;
accessToken: z.ZodOptional<z.ZodString>;
basePath: z.ZodDefault<z.ZodOptional<z.ZodString>>;
}, "strip", z.ZodTypeAny, {
basePath: string;
apiKey?: string | undefined;
organization?: string | undefined;
accessToken?: string | undefined;
}, {
apiKey?: string | undefined;
organization?: string | undefined;
accessToken?: string | undefined;
basePath?: string | undefined;
}>>;
temperature: z.ZodOptional<z.ZodNumber>;
maxTokens: z.ZodOptional<z.ZodNumber>;
topP: z.ZodOptional<z.ZodNumber>;
frequencyPenalty: z.ZodOptional<z.ZodNumber>;
presencePenalty: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
type: ChatModelType.Openai;
modelName?: string | undefined;
secrets?: {
basePath: string;
apiKey?: string | undefined;
organization?: string | undefined;
accessToken?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
frequencyPenalty?: number | undefined;
presencePenalty?: number | undefined;
}, {
type: ChatModelType.Openai;
modelName?: string | undefined;
secrets?: {
apiKey?: string | undefined;
organization?: string | undefined;
accessToken?: string | undefined;
basePath?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
frequencyPenalty?: number | undefined;
presencePenalty?: number | undefined;
}>]>;
declare const PartialChatModelTypeMapSchema: z.ZodObject<{
anthropic: z.ZodOptional<z.ZodObject<{
modelName: z.ZodOptional<z.ZodString>;
type: z.ZodLiteral<ChatModelType.Anthropic>;
secrets: z.ZodOptional<z.ZodObject<{
apiKey: z.ZodOptional<z.ZodString>;
basePath: z.ZodDefault<z.ZodOptional<z.ZodString>>;
}, "strip", z.ZodTypeAny, {
basePath: string;
apiKey?: string | undefined;
}, {
apiKey?: string | undefined;
basePath?: string | undefined;
}>>;
temperature: z.ZodOptional<z.ZodNumber>;
maxTokens: z.ZodOptional<z.ZodNumber>;
topP: z.ZodOptional<z.ZodNumber>;
topK: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
type: ChatModelType.Anthropic;
modelName?: string | undefined;
secrets?: {
basePath: string;
apiKey?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
topK?: number | undefined;
}, {
type: ChatModelType.Anthropic;
modelName?: string | undefined;
secrets?: {
apiKey?: string | undefined;
basePath?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
topK?: number | undefined;
}>>;
huggingFace: z.ZodOptional<z.ZodObject<{
modelName: z.ZodOptional<z.ZodString>;
type: z.ZodLiteral<ChatModelType.HuggingFace>;
secrets: z.ZodOptional<z.ZodObject<{
basePath: z.ZodOptional<z.ZodString>;
apiKey: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
basePath?: string | undefined;
apiKey?: string | undefined;
}, {
basePath?: string | undefined;
apiKey?: string | undefined;
}>>;
temperature: z.ZodOptional<z.ZodNumber>;
maxTokens: z.ZodOptional<z.ZodNumber>;
topP: z.ZodOptional<z.ZodNumber>;
topK: z.ZodOptional<z.ZodNumber>;
frequencyPenalty: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
type: ChatModelType.HuggingFace;
modelName?: string | undefined;
secrets?: {
basePath?: string | undefined;
apiKey?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
topK?: number | undefined;
frequencyPenalty?: number | undefined;
}, {
type: ChatModelType.HuggingFace;
modelName?: string | undefined;
secrets?: {
basePath?: string | undefined;
apiKey?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
topK?: number | undefined;
frequencyPenalty?: number | undefined;
}>>;
openai: z.ZodOptional<z.ZodObject<{
modelName: z.ZodOptional<z.ZodString>;
type: z.ZodLiteral<ChatModelType.Openai>;
secrets: z.ZodOptional<z.ZodObject<{
apiKey: z.ZodOptional<z.ZodString>;
organization: z.ZodOptional<z.ZodString>;
accessToken: z.ZodOptional<z.ZodString>;
basePath: z.ZodDefault<z.ZodOptional<z.ZodString>>;
}, "strip", z.ZodTypeAny, {
basePath: string;
apiKey?: string | undefined;
organization?: string | undefined;
accessToken?: string | undefined;
}, {
apiKey?: string | undefined;
organization?: string | undefined;
accessToken?: string | undefined;
basePath?: string | undefined;
}>>;
temperature: z.ZodOptional<z.ZodNumber>;
maxTokens: z.ZodOptional<z.ZodNumber>;
topP: z.ZodOptional<z.ZodNumber>;
frequencyPenalty: z.ZodOptional<z.ZodNumber>;
presencePenalty: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
type: ChatModelType.Openai;
modelName?: string | undefined;
secrets?: {
basePath: string;
apiKey?: string | undefined;
organization?: string | undefined;
accessToken?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
frequencyPenalty?: number | undefined;
presencePenalty?: number | undefined;
}, {
type: ChatModelType.Openai;
modelName?: string | undefined;
secrets?: {
apiKey?: string | undefined;
organization?: string | undefined;
accessToken?: string | undefined;
basePath?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
frequencyPenalty?: number | undefined;
presencePenalty?: number | undefined;
}>>;
}, "strip", z.ZodTypeAny, {
anthropic?: {
type: ChatModelType.Anthropic;
modelName?: string | undefined;
secrets?: {
basePath: string;
apiKey?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
topK?: number | undefined;
} | undefined;
huggingFace?: {
type: ChatModelType.HuggingFace;
modelName?: string | undefined;
secrets?: {
basePath?: string | undefined;
apiKey?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
topK?: number | undefined;
frequencyPenalty?: number | undefined;
} | undefined;
openai?: {
type: ChatModelType.Openai;
modelName?: string | undefined;
secrets?: {
basePath: string;
apiKey?: string | undefined;
organization?: string | undefined;
accessToken?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
frequencyPenalty?: number | undefined;
presencePenalty?: number | undefined;
} | undefined;
}, {
anthropic?: {
type: ChatModelType.Anthropic;
modelName?: string | undefined;
secrets?: {
apiKey?: string | undefined;
basePath?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
topK?: number | undefined;
} | undefined;
huggingFace?: {
type: ChatModelType.HuggingFace;
modelName?: string | undefined;
secrets?: {
basePath?: string | undefined;
apiKey?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
topK?: number | undefined;
frequencyPenalty?: number | undefined;
} | undefined;
openai?: {
type: ChatModelType.Openai;
modelName?: string | undefined;
secrets?: {
apiKey?: string | undefined;
organization?: string | undefined;
accessToken?: string | undefined;
basePath?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
frequencyPenalty?: number | undefined;
presencePenalty?: number | undefined;
} | undefined;
}>;
declare const UserConfigSchema: z.ZodObject<{
model: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
modelName: z.ZodOptional<z.ZodString>;
type: z.ZodLiteral<ChatModelType.Anthropic>;
secrets: z.ZodOptional<z.ZodObject<{
apiKey: z.ZodOptional<z.ZodString>;
basePath: z.ZodDefault<z.ZodOptional<z.ZodString>>;
}, "strip", z.ZodTypeAny, {
basePath: string;
apiKey?: string | undefined;
}, {
apiKey?: string | undefined;
basePath?: string | undefined;
}>>;
temperature: z.ZodOptional<z.ZodNumber>;
maxTokens: z.ZodOptional<z.ZodNumber>;
topP: z.ZodOptional<z.ZodNumber>;
topK: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
type: ChatModelType.Anthropic;
modelName?: string | undefined;
secrets?: {
basePath: string;
apiKey?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
topK?: number | undefined;
}, {
type: ChatModelType.Anthropic;
modelName?: string | undefined;
secrets?: {
apiKey?: string | undefined;
basePath?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
topK?: number | undefined;
}>, z.ZodObject<{
modelName: z.ZodOptional<z.ZodString>;
type: z.ZodLiteral<ChatModelType.HuggingFace>;
secrets: z.ZodOptional<z.ZodObject<{
basePath: z.ZodOptional<z.ZodString>;
apiKey: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
basePath?: string | undefined;
apiKey?: string | undefined;
}, {
basePath?: string | undefined;
apiKey?: string | undefined;
}>>;
temperature: z.ZodOptional<z.ZodNumber>;
maxTokens: z.ZodOptional<z.ZodNumber>;
topP: z.ZodOptional<z.ZodNumber>;
topK: z.ZodOptional<z.ZodNumber>;
frequencyPenalty: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
type: ChatModelType.HuggingFace;
modelName?: string | undefined;
secrets?: {
basePath?: string | undefined;
apiKey?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
topK?: number | undefined;
frequencyPenalty?: number | undefined;
}, {
type: ChatModelType.HuggingFace;
modelName?: string | undefined;
secrets?: {
basePath?: string | undefined;
apiKey?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
topK?: number | undefined;
frequencyPenalty?: number | undefined;
}>, z.ZodObject<{
modelName: z.ZodOptional<z.ZodString>;
type: z.ZodLiteral<ChatModelType.Openai>;
secrets: z.ZodOptional<z.ZodObject<{
apiKey: z.ZodOptional<z.ZodString>;
organization: z.ZodOptional<z.ZodString>;
accessToken: z.ZodOptional<z.ZodString>;
basePath: z.ZodDefault<z.ZodOptional<z.ZodString>>;
}, "strip", z.ZodTypeAny, {
basePath: string;
apiKey?: string | undefined;
organization?: string | undefined;
accessToken?: string | undefined;
}, {
apiKey?: string | undefined;
organization?: string | undefined;
accessToken?: string | undefined;
basePath?: string | undefined;
}>>;
temperature: z.ZodOptional<z.ZodNumber>;
maxTokens: z.ZodOptional<z.ZodNumber>;
topP: z.ZodOptional<z.ZodNumber>;
frequencyPenalty: z.ZodOptional<z.ZodNumber>;
presencePenalty: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
type: ChatModelType.Openai;
modelName?: string | undefined;
secrets?: {
basePath: string;
apiKey?: string | undefined;
organization?: string | undefined;
accessToken?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
frequencyPenalty?: number | undefined;
presencePenalty?: number | undefined;
}, {
type: ChatModelType.Openai;
modelName?: string | undefined;
secrets?: {
apiKey?: string | undefined;
organization?: string | undefined;
accessToken?: string | undefined;
basePath?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
frequencyPenalty?: number | undefined;
presencePenalty?: number | undefined;
}>]>>;
rootPath: z.ZodOptional<z.ZodString>;
exts: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
includes: z.ZodDefault<z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">, z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>, z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodString], null>, z.ZodBoolean>>, z.ZodNull, z.ZodUndefined]>>>;
excludes: z.ZodDefault<z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">, z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>, z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodString], null>, z.ZodBoolean>>, z.ZodNull, z.ZodUndefined]>>>;
respectGitIgnore: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
urlConfig: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
modelNames: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
httpRequestHeader: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
}, "strip", z.ZodTypeAny, {
modelNames?: string[] | undefined;
httpRequestHeader?: Record<string, string> | undefined;
}, {
modelNames?: string[] | undefined;
httpRequestHeader?: Record<string, string> | undefined;
}>>>>;
}, "strip", z.ZodTypeAny, {
exts: string[];
includes: ((string | RegExp | (string | RegExp)[] | ((args_0: string) => boolean)) & (string | RegExp | (string | RegExp)[] | ((args_0: string) => boolean) | undefined)) | null;
excludes: ((string | RegExp | (string | RegExp)[] | ((args_0: string) => boolean)) & (string | RegExp | (string | RegExp)[] | ((args_0: string) => boolean) | undefined)) | null;
respectGitIgnore: boolean;
urlConfig: Record<string, {
modelNames?: string[] | undefined;
httpRequestHeader?: Record<string, string> | undefined;
}>;
model?: {
type: ChatModelType.Anthropic;
modelName?: string | undefined;
secrets?: {
basePath: string;
apiKey?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
topK?: number | undefined;
} | {
type: ChatModelType.HuggingFace;
modelName?: string | undefined;
secrets?: {
basePath?: string | undefined;
apiKey?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
topK?: number | undefined;
frequencyPenalty?: number | undefined;
} | {
type: ChatModelType.Openai;
modelName?: string | undefined;
secrets?: {
basePath: string;
apiKey?: string | undefined;
organization?: string | undefined;
accessToken?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
frequencyPenalty?: number | undefined;
presencePenalty?: number | undefined;
} | undefined;
rootPath?: string | undefined;
}, {
model?: {
type: ChatModelType.Anthropic;
modelName?: string | undefined;
secrets?: {
apiKey?: string | undefined;
basePath?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
topK?: number | undefined;
} | {
type: ChatModelType.HuggingFace;
modelName?: string | undefined;
secrets?: {
basePath?: string | undefined;
apiKey?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
topK?: number | undefined;
frequencyPenalty?: number | undefined;
} | {
type: ChatModelType.Openai;
modelName?: string | undefined;
secrets?: {
apiKey?: string | undefined;
organization?: string | undefined;
accessToken?: string | undefined;
basePath?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
frequencyPenalty?: number | undefined;
presencePenalty?: number | undefined;
} | undefined;
rootPath?: string | undefined;
exts?: string[] | undefined;
includes?: string | RegExp | (string | RegExp)[] | ((args_0: string) => boolean) | null | undefined;
excludes?: string | RegExp | (string | RegExp)[] | ((args_0: string) => boolean) | null | undefined;
respectGitIgnore?: boolean | undefined;
urlConfig?: Record<string, {
modelNames?: string[] | undefined;
httpRequestHeader?: Record<string, string> | undefined;
}> | undefined;
}>;
declare const UserConfigForUserSchema: z.ZodObject<Omit<{
model: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
modelName: z.ZodOptional<z.ZodString>;
type: z.ZodLiteral<ChatModelType.Anthropic>;
secrets: z.ZodOptional<z.ZodObject<{
apiKey: z.ZodOptional<z.ZodString>;
basePath: z.ZodDefault<z.ZodOptional<z.ZodString>>;
}, "strip", z.ZodTypeAny, {
basePath: string;
apiKey?: string | undefined;
}, {
apiKey?: string | undefined;
basePath?: string | undefined;
}>>;
temperature: z.ZodOptional<z.ZodNumber>;
maxTokens: z.ZodOptional<z.ZodNumber>;
topP: z.ZodOptional<z.ZodNumber>;
topK: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
type: ChatModelType.Anthropic;
modelName?: string | undefined;
secrets?: {
basePath: string;
apiKey?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
topK?: number | undefined;
}, {
type: ChatModelType.Anthropic;
modelName?: string | undefined;
secrets?: {
apiKey?: string | undefined;
basePath?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
topK?: number | undefined;
}>, z.ZodObject<{
modelName: z.ZodOptional<z.ZodString>;
type: z.ZodLiteral<ChatModelType.HuggingFace>;
secrets: z.ZodOptional<z.ZodObject<{
basePath: z.ZodOptional<z.ZodString>;
apiKey: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
basePath?: string | undefined;
apiKey?: string | undefined;
}, {
basePath?: string | undefined;
apiKey?: string | undefined;
}>>;
temperature: z.ZodOptional<z.ZodNumber>;
maxTokens: z.ZodOptional<z.ZodNumber>;
topP: z.ZodOptional<z.ZodNumber>;
topK: z.ZodOptional<z.ZodNumber>;
frequencyPenalty: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
type: ChatModelType.HuggingFace;
modelName?: string | undefined;
secrets?: {
basePath?: string | undefined;
apiKey?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
topK?: number | undefined;
frequencyPenalty?: number | undefined;
}, {
type: ChatModelType.HuggingFace;
modelName?: string | undefined;
secrets?: {
basePath?: string | undefined;
apiKey?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
topK?: number | undefined;
frequencyPenalty?: number | undefined;
}>, z.ZodObject<{
modelName: z.ZodOptional<z.ZodString>;
type: z.ZodLiteral<ChatModelType.Openai>;
secrets: z.ZodOptional<z.ZodObject<{
apiKey: z.ZodOptional<z.ZodString>;
organization: z.ZodOptional<z.ZodString>;
accessToken: z.ZodOptional<z.ZodString>;
basePath: z.ZodDefault<z.ZodOptional<z.ZodString>>;
}, "strip", z.ZodTypeAny, {
basePath: string;
apiKey?: string | undefined;
organization?: string | undefined;
accessToken?: string | undefined;
}, {
apiKey?: string | undefined;
organization?: string | undefined;
accessToken?: string | undefined;
basePath?: string | undefined;
}>>;
temperature: z.ZodOptional<z.ZodNumber>;
maxTokens: z.ZodOptional<z.ZodNumber>;
topP: z.ZodOptional<z.ZodNumber>;
frequencyPenalty: z.ZodOptional<z.ZodNumber>;
presencePenalty: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
type: ChatModelType.Openai;
modelName?: string | undefined;
secrets?: {
basePath: string;
apiKey?: string | undefined;
organization?: string | undefined;
accessToken?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
frequencyPenalty?: number | undefined;
presencePenalty?: number | undefined;
}, {
type: ChatModelType.Openai;
modelName?: string | undefined;
secrets?: {
apiKey?: string | undefined;
organization?: string | undefined;
accessToken?: string | undefined;
basePath?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
frequencyPenalty?: number | undefined;
presencePenalty?: number | undefined;
}>]>>;
rootPath: z.ZodOptional<z.ZodString>;
exts: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
includes: z.ZodDefault<z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">, z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>, z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodString], null>, z.ZodBoolean>>, z.ZodNull, z.ZodUndefined]>>>;
excludes: z.ZodDefault<z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">, z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>, z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodString], null>, z.ZodBoolean>>, z.ZodNull, z.ZodUndefined]>>>;
respectGitIgnore: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
urlConfig: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
modelNames: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
httpRequestHeader: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
}, "strip", z.ZodTypeAny, {
modelNames?: string[] | undefined;
httpRequestHeader?: Record<string, string> | undefined;
}, {
modelNames?: string[] | undefined;
httpRequestHeader?: Record<string, string> | undefined;
}>>>>;
}, "rootPath" | "exts">, "strip", z.ZodTypeAny, {
includes: ((string | RegExp | (string | RegExp)[] | ((args_0: string) => boolean)) & (string | RegExp | (string | RegExp)[] | ((args_0: string) => boolean) | undefined)) | null;
excludes: ((string | RegExp | (string | RegExp)[] | ((args_0: string) => boolean)) & (string | RegExp | (string | RegExp)[] | ((args_0: string) => boolean) | undefined)) | null;
respectGitIgnore: boolean;
urlConfig: Record<string, {
modelNames?: string[] | undefined;
httpRequestHeader?: Record<string, string> | undefined;
}>;
model?: {
type: ChatModelType.Anthropic;
modelName?: string | undefined;
secrets?: {
basePath: string;
apiKey?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
topK?: number | undefined;
} | {
type: ChatModelType.HuggingFace;
modelName?: string | undefined;
secrets?: {
basePath?: string | undefined;
apiKey?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
topK?: number | undefined;
frequencyPenalty?: number | undefined;
} | {
type: ChatModelType.Openai;
modelName?: string | undefined;
secrets?: {
basePath: string;
apiKey?: string | undefined;
organization?: string | undefined;
accessToken?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
frequencyPenalty?: number | undefined;
presencePenalty?: number | undefined;
} | undefined;
}, {
model?: {
type: ChatModelType.Anthropic;
modelName?: string | undefined;
secrets?: {
apiKey?: string | undefined;
basePath?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
topK?: number | undefined;
} | {
type: ChatModelType.HuggingFace;
modelName?: string | undefined;
secrets?: {
basePath?: string | undefined;
apiKey?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
topK?: number | undefined;
frequencyPenalty?: number | undefined;
} | {
type: ChatModelType.Openai;
modelName?: string | undefined;
secrets?: {
apiKey?: string | undefined;
organization?: string | undefined;
accessToken?: string | undefined;
basePath?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
frequencyPenalty?: number | undefined;
presencePenalty?: number | undefined;
} | undefined;
includes?: string | RegExp | (string | RegExp)[] | ((args_0: string) => boolean) | null | undefined;
excludes?: string | RegExp | (string | RegExp)[] | ((args_0: string) => boolean) | null | undefined;
respectGitIgnore?: boolean | undefined;
urlConfig?: Record<string, {
modelNames?: string[] | undefined;
httpRequestHeader?: Record<string, string> | undefined;
}> | undefined;
}>;
declare const SingleChatMessageSchema: z.ZodObject<{
name: z.ZodNativeEnum<typeof ChatRole>;
text: z.ZodString;
}, "strip", z.ZodTypeAny, {
name: ChatRole;
text: string;
}, {
name: ChatRole;
text: string;
}>;
declare const FormOptionSchema: z.ZodObject<{
label: z.ZodOptional<z.ZodString>;
value: z.ZodString;
}, "strip", z.ZodTypeAny, {
value: string;
label?: string | undefined;
}, {
value: string;
label?: string | undefined;
}>;
declare const FormFieldBaseConfigSchema: z.ZodObject<{
type: z.ZodString;
defaultValue: z.ZodOptional<z.ZodAny>;
description: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
type: string;
defaultValue?: any;
description?: string | undefined;
}, {
type: string;
defaultValue?: any;
description?: string | undefined;
}>;
declare const FormInputConfigSchema: z.ZodObject<{
defaultValue: z.ZodOptional<z.ZodAny>;
description: z.ZodOptional<z.ZodString>;
type: z.ZodLiteral<"input">;
}, "strip", z.ZodTypeAny, {
type: "input";
defaultValue?: any;
description?: string | undefined;
}, {
type: "input";
defaultValue?: any;
description?: string | undefined;
}>;
declare const FormTextareaConfigSchema: z.ZodObject<{
defaultValue: z.ZodOptional<z.ZodAny>;
description: z.ZodOptional<z.ZodString>;
type: z.ZodLiteral<"textarea">;
row: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
type: "textarea";
defaultValue?: any;
description?: string | undefined;
row?: number | undefined;
}, {
type: "textarea";
defaultValue?: any;
description?: string | undefined;
row?: number | undefined;
}>;
declare const FormSelectConfigSchema: z.ZodObject<{
defaultValue: z.ZodOptional<z.ZodAny>;
description: z.ZodOptional<z.ZodString>;
type: z.ZodLiteral<"select">;
options: z.ZodArray<z.ZodObject<{
label: z.ZodOptional<z.ZodString>;
value: z.ZodString;
}, "strip", z.ZodTypeAny, {
value: string;
label?: string | undefined;
}, {
value: string;
label?: string | undefined;
}>, "many">;
}, "strip", z.ZodTypeAny, {
type: "select";
options: {
value: string;
label?: string | undefined;
}[];
defaultValue?: any;
description?: string | undefined;
}, {
type: "select";
options: {
value: string;
label?: string | undefined;
}[];
defaultValue?: any;
description?: string | undefined;
}>;
declare const FormCheckboxGroupConfigSchema: z.ZodEffects<z.ZodObject<{
defaultValue: z.ZodOptional<z.ZodAny>;
description: z.ZodOptional<z.ZodString>;
type: z.ZodLiteral<"checkbox-group">;
options: z.ZodArray<z.ZodObject<{
label: z.ZodOptional<z.ZodString>;
value: z.ZodString;
}, "strip", z.ZodTypeAny, {
value: string;
label?: string | undefined;
}, {
value: string;
label?: string | undefined;
}>, "many">;
}, "strip", z.ZodTypeAny, {
type: "checkbox-group";
options: {
value: string;
label?: string | undefined;
}[];
defaultValue?: any;
description?: string | undefined;
}, {
type: "checkbox-group";
options: {
value: string;
label?: string | undefined;
}[];
defaultValue?: any;
description?: string | undefined;
}>, {
type: "checkbox-group";
options: {
value: string;
label?: string | undefined;
}[];
defaultValue?: any;
description?: string | undefined;
}, {
type: "checkbox-group";
options: {
value: string;
label?: string | undefined;
}[];
defaultValue?: any;
description?: string | undefined;
}>;
declare const FormRadioGroupConfigSchema: z.ZodObject<{
defaultValue: z.ZodOptional<z.ZodAny>;
description: z.ZodOptional<z.ZodString>;
type: z.ZodLiteral<"radio-group">;
options: z.ZodArray<z.ZodObject<{
label: z.ZodOptional<z.ZodString>;
value: z.ZodString;
}, "strip", z.ZodTypeAny, {
value: string;
label?: string | undefined;
}, {
value: string;
label?: string | undefined;
}>, "many">;
}, "strip", z.ZodTypeAny, {
type: "radio-group";
options: {
value: string;
label?: string | undefined;
}[];
defaultValue?: any;
description?: string | undefined;
}, {
type: "radio-group";
options: {
value: string;
label?: string | undefined;
}[];
defaultValue?: any;
description?: string | undefined;
}>;
declare const FormItemConfigSchema: z.ZodUnion<[z.ZodObject<{
defaultValue: z.ZodOptional<z.ZodAny>;
description: z.ZodOptional<z.ZodString>;
type: z.ZodLiteral<"input">;
}, "strip", z.ZodTypeAny, {
type: "input";
defaultValue?: any;
description?: string | undefined;
}, {
type: "input";
defaultValue?: any;
description?: string | undefined;
}>, z.ZodObject<{
defaultValue: z.ZodOptional<z.ZodAny>;
description: z.ZodOptional<z.ZodString>;
type: z.ZodLiteral<"textarea">;
row: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
type: "textarea";
defaultValue?: any;
description?: string | undefined;
row?: number | undefined;
}, {
type: "textarea";
defaultValue?: any;
description?: string | undefined;
row?: number | undefined;
}>, z.ZodObject<{
defaultValue: z.ZodOptional<z.ZodAny>;
description: z.ZodOptional<z.ZodString>;
type: z.ZodLiteral<"select">;
options: z.ZodArray<z.ZodObject<{
label: z.ZodOptional<z.ZodString>;
value: z.ZodString;
}, "strip", z.ZodTypeAny, {
value: string;
label?: string | undefined;
}, {
value: string;
label?: string | undefined;
}>, "many">;
}, "strip", z.ZodTypeAny, {
type: "select";
options: {
value: string;
label?: string | undefined;
}[];
defaultValue?: any;
description?: string | undefined;
}, {
type: "select";
options: {
value: string;
label?: string | undefined;
}[];
defaultValue?: any;
description?: string | undefined;
}>, z.ZodEffects<z.ZodObject<{
defaultValue: z.ZodOptional<z.ZodAny>;
description: z.ZodOptional<z.ZodString>;
type: z.ZodLiteral<"checkbox-group">;
options: z.ZodArray<z.ZodObject<{
label: z.ZodOptional<z.ZodString>;
value: z.ZodString;
}, "strip", z.ZodTypeAny, {
value: string;
label?: string | undefined;
}, {
value: string;
label?: string | undefined;
}>, "many">;
}, "strip", z.ZodTypeAny, {
type: "checkbox-group";
options: {
value: string;
label?: string | undefined;
}[];
defaultValue?: any;
description?: string | undefined;
}, {
type: "checkbox-group";
options: {
value: string;
label?: string | undefined;
}[];
defaultValue?: any;
description?: string | undefined;
}>, {
type: "checkbox-group";
options: {
value: string;
label?: string | undefined;
}[];
defaultValue?: any;
description?: string | undefined;
}, {
type: "checkbox-group";
options: {
value: string;
label?: string | undefined;
}[];
defaultValue?: any;
description?: string | undefined;
}>, z.ZodObject<{
defaultValue: z.ZodOptional<z.ZodAny>;
description: z.ZodOptional<z.ZodString>;
type: z.ZodLiteral<"radio-group">;
options: z.ZodArray<z.ZodObject<{
label: z.ZodOptional<z.ZodString>;
value: z.ZodString;
}, "strip", z.ZodTypeAny, {
value: string;
label?: string | undefined;
}, {
value: string;
label?: string | undefined;
}>, "many">;
}, "strip", z.ZodTypeAny, {
type: "radio-group";
options: {
value: string;
label?: string | undefined;
}[];
defaultValue?: any;
description?: string | undefined;
}, {
type: "radio-group";
options: {
value: string;
label?: string | undefined;
}[];
defaultValue?: any;
description?: string | undefined;
}>]>;
declare const SingleFileConfigSchema: z.ZodType<SingleFileConfig, z.ZodTypeDef, SingleFileConfig>;
interface ModelConfig<T extends ChatModelType> {
config: z.ZodType<GetModelConfigType<T, 'config'>>;
secrets: z.ZodType<GetModelConfigType<T, 'secrets'>>;
}
declare function getModelConfig<T extends ChatModelType, K extends keyof ModelConfig<T>>(modelType: T, key: K): {
readonly anthropic: {
readonly config: z.ZodObject<{
modelName: z.ZodOptional<z.ZodString>;
type: z.ZodLiteral<ChatModelType.Anthropic>;
secrets: z.ZodOptional<z.ZodObject<{
apiKey: z.ZodOptional<z.ZodString>;
basePath: z.ZodDefault<z.ZodOptional<z.ZodString>>;
}, "strip", z.ZodTypeAny, {
basePath: string;
apiKey?: string | undefined;
}, {
apiKey?: string | undefined;
basePath?: string | undefined;
}>>;
temperature: z.ZodOptional<z.ZodNumber>;
maxTokens: z.ZodOptional<z.ZodNumber>;
topP: z.ZodOptional<z.ZodNumber>;
topK: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
type: ChatModelType.Anthropic;
modelName?: string | undefined;
secrets?: {
basePath: string;
apiKey?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
topK?: number | undefined;
}, {
type: ChatModelType.Anthropic;
modelName?: string | undefined;
secrets?: {
apiKey?: string | undefined;
basePath?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
topK?: number | undefined;
}>;
readonly secrets: z.ZodObject<{
apiKey: z.ZodOptional<z.ZodString>;
basePath: z.ZodDefault<z.ZodOptional<z.ZodString>>;
}, "strip", z.ZodTypeAny, {
basePath: string;
apiKey?: string | undefined;
}, {
apiKey?: string | undefined;
basePath?: string | undefined;
}>;
};
readonly huggingFace: {
readonly config: z.ZodObject<{
modelName: z.ZodOptional<z.ZodString>;
type: z.ZodLiteral<ChatModelType.HuggingFace>;
secrets: z.ZodOptional<z.ZodObject<{
basePath: z.ZodOptional<z.ZodString>;
apiKey: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
basePath?: string | undefined;
apiKey?: string | undefined;
}, {
basePath?: string | undefined;
apiKey?: string | undefined;
}>>;
temperature: z.ZodOptional<z.ZodNumber>;
maxTokens: z.ZodOptional<z.ZodNumber>;
topP: z.ZodOptional<z.ZodNumber>;
topK: z.ZodOptional<z.ZodNumber>;
frequencyPenalty: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
type: ChatModelType.HuggingFace;
modelName?: string | undefined;
secrets?: {
basePath?: string | undefined;
apiKey?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
topK?: number | undefined;
frequencyPenalty?: number | undefined;
}, {
type: ChatModelType.HuggingFace;
modelName?: string | undefined;
secrets?: {
basePath?: string | undefined;
apiKey?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
topK?: number | undefined;
frequencyPenalty?: number | undefined;
}>;
readonly secrets: z.ZodObject<{
basePath: z.ZodOptional<z.ZodString>;
apiKey: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
basePath?: string | undefined;
apiKey?: string | undefined;
}, {
basePath?: string | undefined;
apiKey?: string | undefined;
}>;
};
readonly openai: {
readonly config: z.ZodObject<{
modelName: z.ZodOptional<z.ZodString>;
type: z.ZodLiteral<ChatModelType.Openai>;
secrets: z.ZodOptional<z.ZodObject<{
apiKey: z.ZodOptional<z.ZodString>;
organization: z.ZodOptional<z.ZodString>;
accessToken: z.ZodOptional<z.ZodString>;
basePath: z.ZodDefault<z.ZodOptional<z.ZodString>>;
}, "strip", z.ZodTypeAny, {
basePath: string;
apiKey?: string | undefined;
organization?: string | undefined;
accessToken?: string | undefined;
}, {
apiKey?: string | undefined;
organization?: string | undefined;
accessToken?: string | undefined;
basePath?: string | undefined;
}>>;
temperature: z.ZodOptional<z.ZodNumber>;
maxTokens: z.ZodOptional<z.ZodNumber>;
topP: z.ZodOptional<z.ZodNumber>;
frequencyPenalty: z.ZodOptional<z.ZodNumber>;
presencePenalty: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
type: ChatModelType.Openai;
modelName?: string | undefined;
secrets?: {
basePath: string;
apiKey?: string | undefined;
organization?: string | undefined;
accessToken?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
frequencyPenalty?: number | undefined;
presencePenalty?: number | undefined;
}, {
type: ChatModelType.Openai;
modelName?: string | undefined;
secrets?: {
apiKey?: string | undefined;
organization?: string | undefined;
accessToken?: string | undefined;
basePath?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
frequencyPenalty?: number | undefined;
presencePenalty?: number | undefined;
}>;
readonly secrets: z.ZodObject<{
apiKey: z.ZodOptional<z.ZodString>;
organization: z.ZodOptional<z.ZodString>;
accessToken: z.ZodOptional<z.ZodString>;
basePath: z.ZodDefault<z.ZodOptional<z.ZodString>>;
}, "strip", z.ZodTypeAny, {
basePath: string;
apiKey?: string | undefined;
organization?: string | undefined;
accessToken?: string | undefined;
}, {
apiKey?: string | undefined;
organization?: string | undefined;
accessToken?: string | undefined;
basePath?: string | undefined;
}>;
};
}[T][K];
declare const ChatModelTypeSchema: z.ZodNativeEnum<typeof ChatModelType>;
declare const ChatRoleSchema: z.ZodNativeEnum<typeof ChatRole>;
declare const ChatMessageStatusSchema: z.ZodNativeEnum<typeof ChatMessageStatus>;
declare const ClientEventNameSchema: z.ZodNativeEnum<typeof ClientEventName>;
declare const GptFileTreeItemTypeSchema: z.ZodNativeEnum<typeof GptFileTreeItemType>;
declare const ServerStorageNameSchema: z.ZodNativeEnum<typeof ServerStorageName>;
declare const LocaleLangSchema: z.ZodNativeEnum<typeof LocaleLang>;
declare const ChatStreamReqParamsSchema: z.ZodObject<{
messages: z.ZodArray<z.ZodObject<{
name: z.ZodNativeEnum<typeof ChatRole>;
text: z.ZodString;
}, "strip", z.ZodTypeAny, {
name: ChatRole;
text: string;
}, {
name: ChatRole;
text: string;
}>, "many">;
prompt: z.ZodString;
systemPrompt: z.ZodOptional<z.ZodString>;
appendSystemPrompt: z.ZodOptional<z.ZodString>;
systemPromptAsUserPrompt: z.ZodOptional<z.ZodBoolean>;
singleFilePath: z.ZodOptional<z.ZodString>;
singleFileConfig: z.ZodOptional<z.ZodType<SingleFileConfig, z.ZodTypeDef, SingleFileConfig>>;
overrideModelType: z.ZodOptional<z.ZodNativeEnum<typeof ChatModelType>>;
overrideModelsConfig: z.ZodOptional<z.ZodObject<{
anthropic: z.ZodOptional<z.ZodObject<{
modelName: z.ZodOptional<z.ZodString>;
type: z.ZodLiteral<ChatModelType.Anthropic>;
secrets: z.ZodOptional<z.ZodObject<{
apiKey: z.ZodOptional<z.ZodString>;
basePath: z.ZodDefault<z.ZodOptional<z.ZodString>>;
}, "strip", z.ZodTypeAny, {
basePath: string;
apiKey?: string | undefined;
}, {
apiKey?: string | undefined;
basePath?: string | undefined;
}>>;
temperature: z.ZodOptional<z.ZodNumber>;
maxTokens: z.ZodOptional<z.ZodNumber>;
topP: z.ZodOptional<z.ZodNumber>;
topK: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
type: ChatModelType.Anthropic;
modelName?: string | undefined;
secrets?: {
basePath: string;
apiKey?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
topK?: number | undefined;
}, {
type: ChatModelType.Anthropic;
modelName?: string | undefined;
secrets?: {
apiKey?: string | undefined;
basePath?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
topK?: number | undefined;
}>>;
huggingFace: z.ZodOptional<z.ZodObject<{
modelName: z.ZodOptional<z.ZodString>;
type: z.ZodLiteral<ChatModelType.HuggingFace>;
secrets: z.ZodOptional<z.ZodObject<{
basePath: z.ZodOptional<z.ZodString>;
apiKey: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
basePath?: string | undefined;
apiKey?: string | undefined;
}, {
basePath?: string | undefined;
apiKey?: string | undefined;
}>>;
temperature: z.ZodOptional<z.ZodNumber>;
maxTokens: z.ZodOptional<z.ZodNumber>;
topP: z.ZodOptional<z.ZodNumber>;
topK: z.ZodOptional<z.ZodNumber>;
frequencyPenalty: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
type: ChatModelType.HuggingFace;
modelName?: string | undefined;
secrets?: {
basePath?: string | undefined;
apiKey?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
topK?: number | undefined;
frequencyPenalty?: number | undefined;
}, {
type: ChatModelType.HuggingFace;
modelName?: string | undefined;
secrets?: {
basePath?: string | undefined;
apiKey?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
topK?: number | undefined;
frequencyPenalty?: number | undefined;
}>>;
openai: z.ZodOptional<z.ZodObject<{
modelName: z.ZodOptional<z.ZodString>;
type: z.ZodLiteral<ChatModelType.Openai>;
secrets: z.ZodOptional<z.ZodObject<{
apiKey: z.ZodOptional<z.ZodString>;
organization: z.ZodOptional<z.ZodString>;
accessToken: z.ZodOptional<z.ZodString>;
basePath: z.ZodDefault<z.ZodOptional<z.ZodString>>;
}, "strip", z.ZodTypeAny, {
basePath: string;
apiKey?: string | undefined;
organization?: string | undefined;
accessToken?: string | undefined;
}, {
apiKey?: string | undefined;
organization?: string | undefined;
accessToken?: string | undefined;
basePath?: string | undefined;
}>>;
temperature: z.ZodOptional<z.ZodNumber>;
maxTokens: z.ZodOptional<z.ZodNumber>;
topP: z.ZodOptional<z.ZodNumber>;
frequencyPenalty: z.ZodOptional<z.ZodNumber>;
presencePenalty: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
type: ChatModelType.Openai;
modelName?: string | undefined;
secrets?: {
basePath: string;
apiKey?: string | undefined;
organization?: string | undefined;
accessToken?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
frequencyPenalty?: number | undefined;
presencePenalty?: number | undefined;
}, {
type: ChatModelType.Openai;
modelName?: string | undefined;
secrets?: {
apiKey?: string | undefined;
organization?: string | undefined;
accessToken?: string | undefined;
basePath?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
frequencyPenalty?: number | undefined;
presencePenalty?: number | undefined;
}>>;
}, "strip", z.ZodTypeAny, {
anthropic?: {
type: ChatModelType.Anthropic;
modelName?: string | undefined;
secrets?: {
basePath: string;
apiKey?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
topK?: number | undefined;
} | undefined;
huggingFace?: {
type: ChatModelType.HuggingFace;
modelName?: string | undefined;
secrets?: {
basePath?: string | undefined;
apiKey?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
topK?: number | undefined;
frequencyPenalty?: number | undefined;
} | undefined;
openai?: {
type: ChatModelType.Openai;
modelName?: string | undefined;
secrets?: {
basePath: string;
apiKey?: string | undefined;
organization?: string | undefined;
accessToken?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
frequencyPenalty?: number | undefined;
presencePenalty?: number | undefined;
} | undefined;
}, {
anthropic?: {
type: ChatModelType.Anthropic;
modelName?: string | undefined;
secrets?: {
apiKey?: string | undefined;
basePath?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
topK?: number | undefined;
} | undefined;
huggingFace?: {
type: ChatModelType.HuggingFace;
modelName?: string | undefined;
secrets?: {
basePath?: string | undefined;
apiKey?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
topK?: number | undefined;
frequencyPenalty?: number | undefined;
} | undefined;
openai?: {
type: ChatModelType.Openai;
modelName?: string | undefined;
secrets?: {
apiKey?: string | undefined;
organization?: string | undefined;
accessToken?: string | undefined;
basePath?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
frequencyPenalty?: number | undefined;
presencePenalty?: number | undefined;
} | undefined;
}>>;
modelTypeVendorNameMap: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
contextFilePaths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
editingFilePath: z.ZodOptional<z.ZodString>;
rootPath: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
messages: {
name: ChatRole;
text: string;
}[];
prompt: string;
systemPrompt?: string | undefined;
appendSystemPrompt?: string | undefined;
systemPromptAsUserPrompt?: boolean | undefined;
singleFilePath?: string | undefined;
singleFileConfig?: SingleFileConfig | undefined;
overrideModelType?: ChatModelType | undefined;
overrideModelsConfig?: {
anthropic?: {
type: ChatModelType.Anthropic;
modelName?: string | undefined;
secrets?: {
basePath: string;
apiKey?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
topK?: number | undefined;
} | undefined;
huggingFace?: {
type: ChatModelType.HuggingFace;
modelName?: string | undefined;
secrets?: {
basePath?: string | undefined;
apiKey?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
topK?: number | undefined;
frequencyPenalty?: number | undefined;
} | undefined;
openai?: {
type: ChatModelType.Openai;
modelName?: string | undefined;
secrets?: {
basePath: string;
apiKey?: string | undefined;
organization?: string | undefined;
accessToken?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
frequencyPenalty?: number | undefined;
presencePenalty?: number | undefined;
} | undefined;
} | undefined;
modelTypeVendorNameMap?: Record<string, string> | undefined;
contextFilePaths?: string[] | undefined;
editingFilePath?: string | undefined;
rootPath?: string | undefined;
}, {
messages: {
name: ChatRole;
text: string;
}[];
prompt: string;
systemPrompt?: string | undefined;
appendSystemPrompt?: string | undefined;
systemPromptAsUserPrompt?: boolean | undefined;
singleFilePath?: string | undefined;
singleFileConfig?: SingleFileConfig | undefined;
overrideModelType?: ChatModelType | undefined;
overrideModelsConfig?: {
anthropic?: {
type: ChatModelType.Anthropic;
modelName?: string | undefined;
secrets?: {
apiKey?: string | undefined;
basePath?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
topK?: number | undefined;
} | undefined;
huggingFace?: {
type: ChatModelType.HuggingFace;
modelName?: string | undefined;
secrets?: {
basePath?: string | undefined;
apiKey?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
topK?: number | undefined;
frequencyPenalty?: number | undefined;
} | undefined;
openai?: {
type: ChatModelType.Openai;
modelName?: string | undefined;
secrets?: {
apiKey?: string | undefined;
organization?: string | undefined;
accessToken?: string | undefined;
basePath?: string | undefined;
} | undefined;
temperature?: number | undefined;
maxTokens?: number | undefined;
topP?: number | undefined;
frequencyPenalty?: number | undefined;
presencePenalty?: number | undefined;
} | undefined;
} | undefined;
modelTypeVendorNameMap?: Record<string, string> | undefined;
contextFilePaths?: string[] | undefined;
editingFilePath?: string | undefined;
rootPath?: string | undefined;
}>;
declare const GetModelNamesForChooseReqParamsSchema: z.ZodObject<{
rootPath: z.ZodString;
modelType: z.ZodNativeEnum<typeof ChatModelType>;
modelTypeVendorNameMap: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
}, "strip", z.ZodTypeAny, {
rootPath: string;
modelType: ChatModelType;
modelTypeVendorNameMap?: Record<string, string> | undefined;
}, {
rootPath: string;
modelType: ChatModelType;
modelTypeVendorNameMap?: Record<string, string> | undefined;
}>;
declare const GetGptFilesReqParamsSchema: z.ZodObject<{
rootPath: z.ZodString;
}, "strip", z.ZodTypeAny, {
rootPath: string;
}, {
rootPath: string;
}>;
declare const GetGptFileInfoReqParamsSchema: z.ZodObject<{
rootPath: z.ZodString;
filePath: z.ZodString;
}, "strip", z.ZodTypeAny, {
rootPath: string;
filePath: string;
}, {
rootPath: string;
filePath: string;
}>;
declare const InitGptFilesReqParamsSchema: z.ZodObject<{
rootPath: z.ZodString;
gptFilesNames: z.ZodArray<z.ZodString, "many">;
}, "strip", z.ZodTypeAny, {
rootPath: string;
gptFilesNames: string[];
}, {
rootPath: string;
gptFilesNames: string[];
}>;
declare const GetUserConfigReqParamsSchema: z.ZodObject<{
rootPath: z.ZodString;
}, "strip", z.ZodTypeAny, {
rootPath: string;
}, {
rootPath: string;
}>;
declare const StorageGetItemReqParamsSchema: z.ZodObject<{
storageName: z.ZodNativeEnum<typeof ServerStorageName>;
key: z.ZodString;
}, "strip", z.ZodTypeAny, {
key: string;
storageName: ServerStorageName;
}, {
key: string;
storageName: ServerStorageName;
}>;
declare const StorageSetItemReqParamsSchema: z.ZodObject<{
storageName: z.ZodNativeEnum<typeof ServerStorageName>;
key: z.ZodString;
value: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
}, "strip", z.ZodTypeAny, {
key: string;
storageName: ServerStorageName;
value?: Record<string, any> | null | undefined;
}, {
key: string;
storageName: ServerStorageName;
value?: Record<string, any> | null | undefined;
}>;
declare const StorageRemoveItemReqParamsSchema: z.ZodObject<{
storageName: z.ZodNativeEnum<typeof ServerStorageName>;
key: z.ZodString;
}, "strip", z.ZodTypeAny, {
key: string;
storageName: ServerStorageName;
}, {
key: string;
storageName: ServerStorageName;
}>;
declare const StorageClearReqParamsSchema: z.ZodObject<{
storageName: z.ZodNativeEnum<typeof ServerStorageName>;
}, "strip", z.ZodTypeAny, {
storageName: ServerStorageName;
}, {
storageName: ServerStorageName;
}>;
declare const GetCommonFilesReqParamsSchema: z.ZodObject<{
rootPath: z.ZodString;
excludeExts: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
rootPath: string;
excludeExts?: string[] | undefined;
}, {
rootPath: string;
excludeExts?: string[] | undefined;
}>;
declare const OpenEditorReqParamsSchema: z.ZodObject<{
rootPath: z.ZodOptional<z.ZodString>;
path: z.ZodString;
matchContent: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
path: string;
rootPath?: string | undefined;
matchContent?: string | undefined;
}, {
path: string;
rootPath?: string | undefined;
matchContent?: string | undefined;
}>;
declare const CreateFilePathReqParamsSchema: z.ZodObject<{
fileFullPath: z.ZodString;
isDir: z.ZodBoolean;
}, "strip", z.ZodTypeAny, {
fileFullPath: string;
isDir: boolean;
}, {
fileFullPath: string;
isDir: boolean;
}>;
declare const RenameFilePathReqParamsSchema: z.ZodObject<{
oldFileFullPath: z.ZodString;
newFileFullPath: z.ZodString;
}, "strip", z.ZodTypeAny, {
oldFileFullPath: string;
newFileFullPath: string;
}, {
oldFileFullPath: string;
newFileFullPath: string;
}>;
declare const DeleteFilePathReqParamsSchema: z.ZodObject<{
fileFullPath: z.ZodString;
}, "strip", z.ZodTypeAny, {
fileFullPath: string;
}, {
fileFullPath: string;
}>;
declare const GetFileInfoReqParamsSchema: z.ZodObject<{
fileFullPath: z.ZodString;
}, "strip", z.ZodTypeAny, {
fileFullPath: string;
}, {
fileFullPath: string;
}>;
declare const SaveFileContentReqParamsSchema: z.ZodObject<{
fileFullPath: z.ZodString;
content: z.ZodString;
}, "strip", z.ZodTypeAny, {
fileFullPath: string;
content: string;
}, {
fileFullPath: string;
content: string;
}>;
declare const GetAppConfigReqParamsSchema: z.ZodObject<{
langId: z.ZodOptional<z.ZodNativeEnum<typeof LocaleLang>>;
}, "strip", z.ZodTypeAny, {
langId?: LocaleLang | undefined;
}, {
langId?: LocaleLang | undefined;
}>;
declare const MarkAsVisitedAppConfigReqParamsSchema: z.ZodObject<{
types: z.ZodArray<z.ZodUnion<[z.ZodLiteral<"notificationDate">, z.ZodLiteral<"releaseDate">]>, "many">;
}, "strip", z.ZodTypeAny, {
types: ("notificationDate" | "releaseDate")[];
}, {
types: ("notificationDate" | "releaseDate")[];
}>;
export { BaseModelConfigSchema, BaseSecretsSchema, ChatMessageStatusSchema, ChatModelSchema, ChatModelTypeSchema, ChatRoleSchema, ChatStreamReqParamsSchema, ClientEventData, ClientEventNameSchema, CompareFunction, CreateFilePathReqParamsSchema, DEFAULT_API_BASE_PATH, DEFAULT_EXCLUDE_FILES, DEFAULT_EXCLUDE_FILE_EXTS, DEFAULT_MODEL_NAMES_FOR_CHOOSE, Debug, DeleteFilePathReqParamsSchema, EventEmitterMap, FilterPatternSchema, FormCheckboxGroupConfigSchema, FormFieldBaseConfigSchema, FormInputConfigSchema, FormItemConfigSchema, FormOptionSchema, FormRadioGroupConfigSchema, FormSelectConfigSchema, FormTextareaConfigSchema, GPT_RUNNER_OFFICIAL_FOLDER, GetAppConfigReqParamsSchema, GetCommonFilesReqParamsSchema, GetFileInfoReqParamsSchema, GetGptFileInfoReqParamsSchema, GetGptFilesReqParamsSchema, GetModelNamesForChooseReqParamsSchema, GetUserConfigReqParamsSchema, GptFileTreeItemTypeSchema, IWssActionNameRequestMap, InitGptFilesReqParamsSchema, LocaleLangSchema, MIN_NODE_VERSION, MarkAsVisitedAppConfigReqParamsSchema, OpenEditorReqParamsSchema, OpenaiModelConfigSchema, OpenaiSecretsSchema, PartialChatModelTypeMapSchema, RenameFilePathReqParamsSchema, ResolveSingleFileCConfigParams, SECRET_KEY_PLACEHOLDER, STREAM_DONE_FLAG, SaveFileContentReqParamsSchema, ServerStorageNameSchema, SingleChat, SingleChatMessageSchema, SingleFileConfigSchema, Socket, StorageClearReqParamsSchema, StorageGetItemReqParamsSchema, StorageRemoveItemReqParamsSchema, StorageSetItemReqParamsSchema, UserConfigForUserSchema, UserConfigSchema, WssActionNameRequestMap, WssEventsMap, WssUtils, buildFailResponse, buildSuccessResponse, createFilterByPattern, debounce, formatSourceValue, getErrorMsg, getModelConfig, getProcessCwd, hasOwn, isBoolean, isChineseCharacter, isDeepEqual, isFunction, isNotEmptyString, isNumber, isObject, isShallowEqual, isString, objectToQueryString, removeUserConfigUnsafeKey, resolveSingleFileConfig, runOnceByKey, singleFileConfigWithDefault, singleFileJsonSchema, sleep, toUnixPath, travelTree, travelTreeDeepFirst, tryParseJson, tryStringifyJson, urlRemoveLocalhost, userConfigJsonSchema, userConfigWithDefault, verifyZod, waitForCondition };