@allbluecn/kernel 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -397,7 +397,7 @@ interface AnalyticsService {
397
397
  }
398
398
  //#endregion
399
399
  //#region src/pro-contract/global-search.d.ts
400
- interface SearchResult {
400
+ interface SearchResult$1 {
401
401
  id: string;
402
402
  type: 'document' | 'project' | 'story' | 'comment' | 'user' | 'tag';
403
403
  title: string;
@@ -410,13 +410,13 @@ interface SearchResult {
410
410
  interface SearchParams {
411
411
  query: string;
412
412
  workspaceId?: string | null;
413
- types?: Array<SearchResult['type']>;
413
+ types?: Array<SearchResult$1['type']>;
414
414
  limit?: number;
415
415
  offset?: number;
416
416
  }
417
417
  interface GlobalSearchService {
418
418
  search(params: SearchParams): Promise<{
419
- results: SearchResult[];
419
+ results: SearchResult$1[];
420
420
  total: number;
421
421
  }>;
422
422
  index(documentId: string, content: string, metadata: Record<string, unknown>): Promise<void>;
@@ -597,5 +597,1487 @@ interface ServerSeam {
597
597
  }
598
598
  declare function registerServerSeam(impl: ServerSeam): void;
599
599
  declare function getServerSeam(): ServerSeam;
600
+ /**
601
+ * PrismaSeam — 注入式 prisma 接入点
602
+ *
603
+ * 解决 shared → database (prisma) → shared 的循环依赖:
604
+ * shared 包声明 seam 接口,database 包启动时注册实现。
605
+ * 复用 kernel 的 ServerSeam 注入模式。
606
+ */
607
+ interface PrismaSeam {
608
+ reference: {
609
+ create: (data: unknown) => Promise<unknown>;
610
+ findMany: (where: unknown) => Promise<unknown[]>;
611
+ };
612
+ $queryRawUnsafe: <T = Record<string, unknown>>(sql: string, ...params: unknown[]) => Promise<T[]>;
613
+ }
614
+ declare function registerPrismaSeam(seam: PrismaSeam): void;
615
+ //#endregion
616
+ //#region src/contract/constants/perf.d.ts
617
+ declare const VIRTUALIZE_THRESHOLD = 250;
618
+ declare const LOAD_MORE_STEP = 200;
619
+ declare const DND_STICKY_THRESHOLD = 500;
620
+ //#endregion
621
+ //#region src/contract/modules/ai-providers/types.d.ts
622
+ type AdapterKind = 'openai' | 'anthropic' | 'gemini' | 'groq' | 'grok' | 'openrouter' | 'ollama' | 'openai-compatible';
623
+ type ProviderCategory = 'recommended' | 'popular' | 'local';
624
+ type ModelCapability = 'text' | 'vision' | 'tools' | 'reasoning' | 'audio';
625
+ interface AiModelMeta {
626
+ /** 模型 ID(传给 adapter 的 model 字符串) */
627
+ id: string;
628
+ /** 显示名 */
629
+ displayName: string;
630
+ /** 上下文窗口(tokens) */
631
+ contextWindow?: number;
632
+ /** 能力标签 */
633
+ capabilities?: ModelCapability[];
634
+ /** 是否默认勾选 */
635
+ defaultEnabled?: boolean;
636
+ /** 模型图标 slug(后台配置,@lobehub/icons PascalCase 导出名),未配置时 fallback 到服务商图标 */
637
+ iconSlug?: string;
638
+ /** 发布日期 YYYY-MM-DD */
639
+ releaseDate?: string;
640
+ /** 输入价格($/百万 tokens) */
641
+ inputPrice?: number;
642
+ /** 输出价格($/百万 tokens) */
643
+ outputPrice?: number;
644
+ /** 自定义标签(如「旗舰」「快速」),区别于 capabilities 能力标签 */
645
+ tags?: string[];
646
+ }
647
+ /** 服务商完整元数据(admin 表单 + DB 行 + 前端展示共用) */
648
+ interface AiProviderMeta {
649
+ /** 业务标识("openai" "anthropic" 等),与数据库 providerId 字段对应 */
650
+ providerId: string;
651
+ displayName: string;
652
+ brandName: string;
653
+ description: string;
654
+ category: ProviderCategory;
655
+ iconSlug: string;
656
+ brandColor: string;
657
+ /** 卡片角标文案(如「推荐」「热门」「NEW」),admin 可配,留空则不显示 */
658
+ badge?: string;
659
+ adapterKind: AdapterKind;
660
+ defaultBaseUrl?: string;
661
+ keyUrl?: string;
662
+ docsUrl?: string;
663
+ keyPlaceholder?: string;
664
+ isLocal?: boolean;
665
+ models: AiModelMeta[];
666
+ }
667
+ /** admin 表格行:DB 行 + 关联用户配置数 */
668
+ interface AiProviderRow extends AiProviderMeta {
669
+ /** DB 主键 */
670
+ id: string;
671
+ enabled: boolean;
672
+ sortOrder: number;
673
+ /** 已配置此服务商的用户数 */
674
+ configCount: number;
675
+ createdAt: string;
676
+ updatedAt: string;
677
+ }
678
+ /** 卡片角标的预设颜色(按文案匹配),admin 也可自由输入文案 */
679
+ declare const PROVIDER_BADGE_STYLES: Record<string, string>;
680
+ //#endregion
681
+ //#region src/contract/modules/ai-providers/constants.d.ts
682
+ declare const ADAPTER_KINDS: Array<{
683
+ value: AdapterKind;
684
+ label: string;
685
+ description: string;
686
+ }>;
687
+ declare const PROVIDER_CATEGORIES: Array<{
688
+ value: ProviderCategory;
689
+ label: string;
690
+ }>;
691
+ declare const ADAPTER_KIND_VALUES: AdapterKind[];
692
+ declare const PROVIDER_CATEGORY_VALUES: ProviderCategory[];
693
+ declare const MODEL_CAPABILITY_OPTIONS: Array<{
694
+ value: ModelCapability;
695
+ label: string;
696
+ }>;
697
+ /**
698
+ * 模型管理 tabs 筛选项(参考 lobehub)。
699
+ * value 对应 ModelCapability,'all' 为全部,'video' 暂预留(无对应 capability)。
700
+ */
701
+ type ModelTab = 'all' | 'text' | 'reasoning' | 'tools' | 'vision' | 'video';
702
+ declare const MODEL_TABS: Array<{
703
+ value: ModelTab;
704
+ label: string;
705
+ }>;
706
+ /**
707
+ * our providerId → @lobehub/icons PascalCase 导出名
708
+ * 未知 providerId 返回 null,调用方 fallback 到首字母
709
+ */
710
+ declare const LOBE_ICON_MAP: Record<string, string>;
711
+ //#endregion
712
+ //#region src/contract/modules/ai-providers/seed-data.d.ts
713
+ /** 10 个最受欢迎 AI 服务商的种子数据,admin 可在其基础上增删改 */
714
+ declare const SEED_AI_PROVIDERS: AiProviderMeta[];
715
+ //#endregion
716
+ //#region src/contract/modules/dependencies/index.d.ts
717
+ /** 依赖分类 */
718
+ type DependencyCategory = 'framework' | 'ui' | 'editor' | 'ai' | 'state' | 'auth' | 'tool' | 'other';
719
+ /** 优先级 */
720
+ type DependencyPriority = 'high' | 'normal' | 'low';
721
+ /** 版本状态(前端展示用,由 serverFn 计算) */
722
+ type VersionStatus = 'latest' | 'patch' | 'minor' | 'major' | 'unknown';
723
+ /** 依赖分类元信息 */
724
+ declare const DEPENDENCY_CATEGORIES: Array<{
725
+ value: DependencyCategory;
726
+ label: string;
727
+ description: string;
728
+ }>;
729
+ declare const DEPENDENCY_PRIORITIES: Array<{
730
+ value: DependencyPriority;
731
+ label: string;
732
+ }>;
733
+ /** monorepo 中某个 app 的使用情况 */
734
+ interface DependencyUsage {
735
+ /** 相对路径,如 "apps/web" */
736
+ app: string;
737
+ /** 该 app 的 package.json 中声明的版本(semver range,如 "^3.23.6") */
738
+ declaredRange: string;
739
+ }
740
+ /** DB 行 + 实时聚合数据(列表页主结构) */
741
+ interface ThirdPartyDependencyRow {
742
+ id: string;
743
+ /** npm 包名 */
744
+ name: string;
745
+ /** 展示名(默认取 name) */
746
+ displayName: string;
747
+ /** 依赖用途说明 */
748
+ description: string | null;
749
+ /** 官网 / 仓库地址 */
750
+ homepage: string | null;
751
+ /** npm 包页面地址 */
752
+ npmUrl: string;
753
+ category: DependencyCategory;
754
+ isWatched: boolean;
755
+ priority: DependencyPriority;
756
+ /** 项目中实际使用的版本信息(聚合 monorepo,来自 package.json,不缓存) */
757
+ usages: DependencyUsage[];
758
+ /** 当前使用版本(取 usages 中第一个 semver clean 值,便于表格直接展示) */
759
+ currentVersion: string | null;
760
+ /** 缓存的 npm registry latest 版本 */
761
+ latestVersion: string | null;
762
+ /** 最新版本的更新日志(GitHub Releases,markdown 原文) */
763
+ latestChangelog: string | null;
764
+ /** 最后同步时间(ISO) */
765
+ lastSyncAt: string | null;
766
+ /** 版本状态(由 currentVersion / latestVersion 比较得出) */
767
+ versionStatus: VersionStatus;
768
+ notes: string | null;
769
+ sortOrder: number;
770
+ updatedAt: string;
771
+ }
772
+ /** 编辑表单 payload */
773
+ interface UpdateDependencyInput {
774
+ displayName?: string;
775
+ description?: string | null;
776
+ homepage?: string | null;
777
+ category?: DependencyCategory;
778
+ isWatched?: boolean;
779
+ priority?: DependencyPriority;
780
+ notes?: string | null;
781
+ sortOrder?: number;
782
+ }
783
+ /** 单个包同步结果 */
784
+ interface SyncDependencyResult {
785
+ name: string;
786
+ success: boolean;
787
+ latestVersion?: string;
788
+ homepage?: string | null;
789
+ changelog?: string | null;
790
+ error?: string;
791
+ }
792
+ /**
793
+ * 预设关注列表(首次启动 seed 用)。
794
+ * 只放核心关注包;其余 monorepo 依赖在 list 时动态归入「全部依赖」分组。
795
+ * homepage 取官网或 GitHub 仓库,npmUrl 由 name 推导(不存表)。
796
+ */
797
+ interface DependencySeed {
798
+ name: string;
799
+ displayName: string;
800
+ description: string;
801
+ homepage: string;
802
+ category: DependencyCategory;
803
+ priority: DependencyPriority;
804
+ }
805
+ declare const DEFAULT_WATCHED_DEPENDENCIES: DependencySeed[];
806
+ //#endregion
807
+ //#region src/contract/infrastructure/ip-location.d.ts
808
+ declare function resolveIpLocation(ip: string | null | undefined): Promise<string>;
809
+ /**
810
+ * 从 Request 中提取客户端真实 IP
811
+ * 优先级:X-Forwarded-For > X-Real-IP > CF-Connecting-IP
812
+ */
813
+ declare function getClientIp(request: Request): string | null;
814
+ //#endregion
815
+ //#region src/contract/infrastructure/ua-parser.d.ts
816
+ /**
817
+ * User-Agent 解析工具(轻量无依赖实现)
818
+ * 从 UA 字符串提取浏览器、操作系统、设备类型
819
+ */
820
+ interface ParsedUA {
821
+ /** 浏览器名称 + 主版本号,如 "Chrome 120"、"Edge 119" */
822
+ browser: string;
823
+ /** 操作系统 + 主版本号,如 "Windows 10/11"、"macOS 14"、"iOS 17" */
824
+ os: string;
825
+ /** 设备类型:桌面 / iPhone / iPad / Android 手机 / Android 平板 */
826
+ device: string;
827
+ }
828
+ declare function parseUserAgent(ua: string | null | undefined): ParsedUA;
829
+ /**
830
+ * 将 ParsedUA 拼接为可读字符串,如 "Chrome 120 / Windows 10/11 / 桌面"
831
+ */
832
+ declare function formatParsedUA(parsed: ParsedUA): string;
833
+ //#endregion
834
+ //#region src/contract/interfaces/module.d.ts
835
+ interface EntityDef {
836
+ type: string;
837
+ table: string;
838
+ searchFields: string[];
839
+ displayFields: string[];
840
+ }
841
+ interface AICommandContext {
842
+ entityType: string;
843
+ entityIds: string[];
844
+ userInput?: string;
845
+ module: AllBlueModule;
846
+ }
847
+ interface AICommandResult {
848
+ content: string;
849
+ actions?: {
850
+ type: string;
851
+ payload: unknown;
852
+ }[];
853
+ }
854
+ type AICommandHandler = (ctx: AICommandContext) => Promise<AICommandResult>;
855
+ interface AICommandDef {
856
+ id: string;
857
+ label: string;
858
+ icon: string;
859
+ entityTypes: string[];
860
+ handler: AICommandHandler;
861
+ }
862
+ type ReferenceDisplayFn = (type: string, data: Record<string, unknown>) => {
863
+ title: string;
864
+ status?: string;
865
+ priority?: string;
866
+ url?: string;
867
+ };
868
+ interface AllBlueModule {
869
+ id: string;
870
+ name: string;
871
+ icon: string;
872
+ workspaceRoute: string;
873
+ entities: EntityDef[];
874
+ aiCommands: AICommandDef[];
875
+ referenceDisplay: ReferenceDisplayFn;
876
+ }
877
+ //#endregion
878
+ //#region src/contract/interfaces/references.d.ts
879
+ interface RefDisplay {
880
+ title: string;
881
+ status?: string;
882
+ priority?: string;
883
+ url?: string;
884
+ }
885
+ interface Reference {
886
+ id: string;
887
+ sourceModule: string;
888
+ sourceEntityId: string;
889
+ targetModule: string;
890
+ targetEntityId: string;
891
+ }
892
+ interface ResolvedRef extends Reference {
893
+ display: RefDisplay;
894
+ }
895
+ interface SearchResult {
896
+ id: string;
897
+ module: string;
898
+ type: string;
899
+ title: string;
900
+ status?: string;
901
+ url?: string;
902
+ }
903
+ //#endregion
904
+ //#region src/contract/interfaces/ai.d.ts
905
+ interface CLIAgentInfo {
906
+ id: string;
907
+ name: string;
908
+ binary: string;
909
+ version: string;
910
+ available: boolean;
911
+ }
912
+ interface AiAdapter {
913
+ detect(): Promise<CLIAgentInfo[]>;
914
+ execute(commandId: string, ctx: {
915
+ entityType: string;
916
+ entityIds: string[];
917
+ userInput?: string;
918
+ }): Promise<{
919
+ content: string;
920
+ }>;
921
+ stream(commandId: string, ctx: {
922
+ entityType: string;
923
+ entityIds: string[];
924
+ userInput?: string;
925
+ }): AsyncGenerator<string>;
926
+ getActiveAgent(): string;
927
+ switchAgent(agentId: string): void;
928
+ }
929
+ //#endregion
930
+ //#region src/contract/interfaces/transport.d.ts
931
+ interface EntityUpdateEvent {
932
+ type: string;
933
+ id: string;
934
+ fields: Record<string, unknown>;
935
+ }
936
+ interface RealtimeTransport {
937
+ subscribe(entityIds: string[], onUpdate: (event: EntityUpdateEvent) => void): () => void;
938
+ }
939
+ //#endregion
940
+ //#region src/contract/interfaces/avatar.d.ts
941
+ type AvatarPart = "face" | "eyes" | "eyebrows" | "mouth" | "nose" | "glasses" | "hair" | "accessories" | "details" | "beard";
942
+ type AvatarConfig = Record<AvatarPart, number>;
943
+ type ShapeType = "circle" | "rounded" | "square";
944
+ //#endregion
945
+ //#region src/contract/modules/billing/feature-registry.d.ts
946
+ interface FeatureMeta {
947
+ /** oss = 开源免费;paid = 付费;enterprise = 企业版专属 */
948
+ tier: 'oss' | 'paid' | 'enterprise';
949
+ /** 该功能依赖的 proModule 服务名;null = 开源代码自带(仅权益门控) */
950
+ module: 'billing' | 'hostedAi' | 'sso' | 'audit' | 'permissions' | 'license' | 'versionHistory' | 'automation' | 'templates' | 'analytics' | 'globalSearch' | 'compliance' | null;
951
+ }
952
+ declare const FeatureRegistry: {
953
+ readonly byokAi: {
954
+ readonly tier: 'oss';
955
+ readonly module: null;
956
+ };
957
+ readonly hostedAi: {
958
+ readonly tier: 'paid';
959
+ readonly module: 'hostedAi';
960
+ };
961
+ readonly multiProvider: {
962
+ readonly tier: 'paid';
963
+ readonly module: null;
964
+ };
965
+ readonly largePageSize: {
966
+ readonly tier: 'paid';
967
+ readonly module: null;
968
+ };
969
+ readonly versionHistory: {
970
+ readonly tier: 'paid';
971
+ readonly module: 'versionHistory';
972
+ };
973
+ readonly automation: {
974
+ readonly tier: 'paid';
975
+ readonly module: 'automation';
976
+ };
977
+ readonly templates: {
978
+ readonly tier: 'paid';
979
+ readonly module: 'templates';
980
+ };
981
+ readonly globalSearch: {
982
+ readonly tier: 'paid';
983
+ readonly module: 'globalSearch';
984
+ };
985
+ readonly analytics: {
986
+ readonly tier: 'enterprise';
987
+ readonly module: 'analytics';
988
+ };
989
+ readonly sso: {
990
+ readonly tier: 'enterprise';
991
+ readonly module: 'sso';
992
+ };
993
+ readonly audit: {
994
+ readonly tier: 'enterprise';
995
+ readonly module: 'audit';
996
+ };
997
+ readonly advancedPermissions: {
998
+ readonly tier: 'enterprise';
999
+ readonly module: 'permissions';
1000
+ };
1001
+ readonly compliance: {
1002
+ readonly tier: 'enterprise';
1003
+ readonly module: 'compliance';
1004
+ };
1005
+ readonly customAgents: {
1006
+ readonly tier: 'paid';
1007
+ readonly module: null;
1008
+ };
1009
+ };
1010
+ type FeatureKey = keyof typeof FeatureRegistry;
1011
+ declare const FEATURE_KEYS: FeatureKey[];
1012
+ /** OSS 部署(billing 模块缺失)的基础白名单——唯一允许「无订阅即放行」的集合 */
1013
+ declare const OSS_BASE_FEATURES: readonly FeatureKey[];
1014
+ declare function isOssFeature(key: FeatureKey): boolean;
1015
+ //#endregion
1016
+ //#region ../../../../../node_modules/zod/v3/helpers/typeAliases.d.cts
1017
+ type Primitive = string | number | symbol | bigint | boolean | null | undefined;
1018
+ //#endregion
1019
+ //#region ../../../../../node_modules/zod/v3/helpers/util.d.cts
1020
+ declare namespace util {
1021
+ type AssertEqual<T, U> = (<V>() => V extends T ? 1 : 2) extends (<V>() => V extends U ? 1 : 2) ? true : false;
1022
+ export type isAny<T> = 0 extends 1 & T ? true : false;
1023
+ export const assertEqual: <A, B>(_: AssertEqual<A, B>) => void;
1024
+ export function assertIs<T>(_arg: T): void;
1025
+ export function assertNever(_x: never): never;
1026
+ export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
1027
+ export type OmitKeys<T, K extends string> = Pick<T, Exclude<keyof T, K>>;
1028
+ export type MakePartial<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
1029
+ export type Exactly<T, X> = T & Record<Exclude<keyof X, keyof T>, never>;
1030
+ export type InexactPartial<T> = { [k in keyof T]?: T[k] | undefined; };
1031
+ export const arrayToEnum: <T extends string, U extends [T, ...T[]]>(items: U) => { [k in U[number]]: k; };
1032
+ export const getValidEnumValues: (obj: any) => any[];
1033
+ export const objectValues: (obj: any) => any[];
1034
+ export const objectKeys: ObjectConstructor["keys"];
1035
+ export const find: <T>(arr: T[], checker: (arg: T) => any) => T | undefined;
1036
+ export type identity<T> = objectUtil.identity<T>;
1037
+ export type flatten<T> = objectUtil.flatten<T>;
1038
+ export type noUndefined<T> = T extends undefined ? never : T;
1039
+ export const isInteger: NumberConstructor["isInteger"];
1040
+ export function joinValues<T extends any[]>(array: T, separator?: string): string;
1041
+ export const jsonStringifyReplacer: (_: string, value: any) => any;
1042
+ export {};
1043
+ }
1044
+ declare namespace objectUtil {
1045
+ export type MergeShapes<U, V> = keyof U & keyof V extends never ? U & V : { [k in Exclude<keyof U, keyof V>]: U[k]; } & V;
1046
+ type optionalKeys<T extends object> = { [k in keyof T]: undefined extends T[k] ? k : never; }[keyof T];
1047
+ type requiredKeys<T extends object> = { [k in keyof T]: undefined extends T[k] ? never : k; }[keyof T];
1048
+ export type addQuestionMarks<T extends object, _O = any> = { [K in requiredKeys<T>]: T[K]; } & { [K in optionalKeys<T>]?: T[K]; } & { [k in keyof T]?: unknown; };
1049
+ export type identity<T> = T;
1050
+ export type flatten<T> = identity<{ [k in keyof T]: T[k]; }>;
1051
+ export type noNeverKeys<T> = { [k in keyof T]: [T[k]] extends [never] ? never : k; }[keyof T];
1052
+ export type noNever<T> = identity<{ [k in noNeverKeys<T>]: k extends keyof T ? T[k] : never; }>;
1053
+ export const mergeShapes: <U, T>(first: U, second: T) => T & U;
1054
+ export type extendShape<A extends object, B extends object> = keyof A & keyof B extends never ? A & B : { [K in keyof A as K extends keyof B ? never : K]: A[K]; } & { [K in keyof B]: B[K]; };
1055
+ export {};
1056
+ }
1057
+ declare const ZodParsedType: {
1058
+ string: "string";
1059
+ nan: "nan";
1060
+ number: "number";
1061
+ integer: "integer";
1062
+ float: "float";
1063
+ boolean: "boolean";
1064
+ date: "date";
1065
+ bigint: "bigint";
1066
+ symbol: "symbol";
1067
+ function: "function";
1068
+ undefined: "undefined";
1069
+ null: "null";
1070
+ array: "array";
1071
+ object: "object";
1072
+ unknown: "unknown";
1073
+ promise: "promise";
1074
+ void: "void";
1075
+ never: "never";
1076
+ map: "map";
1077
+ set: "set";
1078
+ };
1079
+ type ZodParsedType = keyof typeof ZodParsedType;
1080
+ //#endregion
1081
+ //#region ../../../../../node_modules/zod/v3/ZodError.d.cts
1082
+ type allKeys<T> = T extends any ? keyof T : never;
1083
+ type typeToFlattenedError<T, U = string> = {
1084
+ formErrors: U[];
1085
+ fieldErrors: { [P in allKeys<T>]?: U[]; };
1086
+ };
1087
+ declare const ZodIssueCode: {
1088
+ invalid_type: "invalid_type";
1089
+ invalid_literal: "invalid_literal";
1090
+ custom: "custom";
1091
+ invalid_union: "invalid_union";
1092
+ invalid_union_discriminator: "invalid_union_discriminator";
1093
+ invalid_enum_value: "invalid_enum_value";
1094
+ unrecognized_keys: "unrecognized_keys";
1095
+ invalid_arguments: "invalid_arguments";
1096
+ invalid_return_type: "invalid_return_type";
1097
+ invalid_date: "invalid_date";
1098
+ invalid_string: "invalid_string";
1099
+ too_small: "too_small";
1100
+ too_big: "too_big";
1101
+ invalid_intersection_types: "invalid_intersection_types";
1102
+ not_multiple_of: "not_multiple_of";
1103
+ not_finite: "not_finite";
1104
+ };
1105
+ type ZodIssueCode = keyof typeof ZodIssueCode;
1106
+ type ZodIssueBase = {
1107
+ path: (string | number)[];
1108
+ message?: string | undefined;
1109
+ };
1110
+ interface ZodInvalidTypeIssue extends ZodIssueBase {
1111
+ code: typeof ZodIssueCode.invalid_type;
1112
+ expected: ZodParsedType;
1113
+ received: ZodParsedType;
1114
+ }
1115
+ interface ZodInvalidLiteralIssue extends ZodIssueBase {
1116
+ code: typeof ZodIssueCode.invalid_literal;
1117
+ expected: unknown;
1118
+ received: unknown;
1119
+ }
1120
+ interface ZodUnrecognizedKeysIssue extends ZodIssueBase {
1121
+ code: typeof ZodIssueCode.unrecognized_keys;
1122
+ keys: string[];
1123
+ }
1124
+ interface ZodInvalidUnionIssue extends ZodIssueBase {
1125
+ code: typeof ZodIssueCode.invalid_union;
1126
+ unionErrors: ZodError[];
1127
+ }
1128
+ interface ZodInvalidUnionDiscriminatorIssue extends ZodIssueBase {
1129
+ code: typeof ZodIssueCode.invalid_union_discriminator;
1130
+ options: Primitive[];
1131
+ }
1132
+ interface ZodInvalidEnumValueIssue extends ZodIssueBase {
1133
+ received: string | number;
1134
+ code: typeof ZodIssueCode.invalid_enum_value;
1135
+ options: (string | number)[];
1136
+ }
1137
+ interface ZodInvalidArgumentsIssue extends ZodIssueBase {
1138
+ code: typeof ZodIssueCode.invalid_arguments;
1139
+ argumentsError: ZodError;
1140
+ }
1141
+ interface ZodInvalidReturnTypeIssue extends ZodIssueBase {
1142
+ code: typeof ZodIssueCode.invalid_return_type;
1143
+ returnTypeError: ZodError;
1144
+ }
1145
+ interface ZodInvalidDateIssue extends ZodIssueBase {
1146
+ code: typeof ZodIssueCode.invalid_date;
1147
+ }
1148
+ type StringValidation = "email" | "url" | "emoji" | "uuid" | "nanoid" | "regex" | "cuid" | "cuid2" | "ulid" | "datetime" | "date" | "time" | "duration" | "ip" | "cidr" | "base64" | "jwt" | "base64url" | {
1149
+ includes: string;
1150
+ position?: number | undefined;
1151
+ } | {
1152
+ startsWith: string;
1153
+ } | {
1154
+ endsWith: string;
1155
+ };
1156
+ interface ZodInvalidStringIssue extends ZodIssueBase {
1157
+ code: typeof ZodIssueCode.invalid_string;
1158
+ validation: StringValidation;
1159
+ }
1160
+ interface ZodTooSmallIssue extends ZodIssueBase {
1161
+ code: typeof ZodIssueCode.too_small;
1162
+ minimum: number | bigint;
1163
+ inclusive: boolean;
1164
+ exact?: boolean;
1165
+ type: "array" | "string" | "number" | "set" | "date" | "bigint";
1166
+ }
1167
+ interface ZodTooBigIssue extends ZodIssueBase {
1168
+ code: typeof ZodIssueCode.too_big;
1169
+ maximum: number | bigint;
1170
+ inclusive: boolean;
1171
+ exact?: boolean;
1172
+ type: "array" | "string" | "number" | "set" | "date" | "bigint";
1173
+ }
1174
+ interface ZodInvalidIntersectionTypesIssue extends ZodIssueBase {
1175
+ code: typeof ZodIssueCode.invalid_intersection_types;
1176
+ }
1177
+ interface ZodNotMultipleOfIssue extends ZodIssueBase {
1178
+ code: typeof ZodIssueCode.not_multiple_of;
1179
+ multipleOf: number | bigint;
1180
+ }
1181
+ interface ZodNotFiniteIssue extends ZodIssueBase {
1182
+ code: typeof ZodIssueCode.not_finite;
1183
+ }
1184
+ interface ZodCustomIssue extends ZodIssueBase {
1185
+ code: typeof ZodIssueCode.custom;
1186
+ params?: {
1187
+ [k: string]: any;
1188
+ };
1189
+ }
1190
+ type ZodIssueOptionalMessage = ZodInvalidTypeIssue | ZodInvalidLiteralIssue | ZodUnrecognizedKeysIssue | ZodInvalidUnionIssue | ZodInvalidUnionDiscriminatorIssue | ZodInvalidEnumValueIssue | ZodInvalidArgumentsIssue | ZodInvalidReturnTypeIssue | ZodInvalidDateIssue | ZodInvalidStringIssue | ZodTooSmallIssue | ZodTooBigIssue | ZodInvalidIntersectionTypesIssue | ZodNotMultipleOfIssue | ZodNotFiniteIssue | ZodCustomIssue;
1191
+ type ZodIssue = ZodIssueOptionalMessage & {
1192
+ fatal?: boolean | undefined;
1193
+ message: string;
1194
+ };
1195
+ type recursiveZodFormattedError<T> = T extends [any, ...any[]] ? { [K in keyof T]?: ZodFormattedError<T[K]>; } : T extends any[] ? {
1196
+ [k: number]: ZodFormattedError<T[number]>;
1197
+ } : T extends object ? { [K in keyof T]?: ZodFormattedError<T[K]>; } : unknown;
1198
+ type ZodFormattedError<T, U = string> = {
1199
+ _errors: U[];
1200
+ } & recursiveZodFormattedError<NonNullable<T>>;
1201
+ declare class ZodError<T = any> extends Error {
1202
+ issues: ZodIssue[];
1203
+ get errors(): ZodIssue[];
1204
+ constructor(issues: ZodIssue[]);
1205
+ format(): ZodFormattedError<T>;
1206
+ format<U>(mapper: (issue: ZodIssue) => U): ZodFormattedError<T, U>;
1207
+ static create: (issues: ZodIssue[]) => ZodError<any>;
1208
+ static assert(value: unknown): asserts value is ZodError;
1209
+ toString(): string;
1210
+ get message(): string;
1211
+ get isEmpty(): boolean;
1212
+ addIssue: (sub: ZodIssue) => void;
1213
+ addIssues: (subs?: ZodIssue[]) => void;
1214
+ flatten(): typeToFlattenedError<T>;
1215
+ flatten<U>(mapper?: (issue: ZodIssue) => U): typeToFlattenedError<T, U>;
1216
+ get formErrors(): typeToFlattenedError<T, string>;
1217
+ }
1218
+ type stripPath<T extends object> = T extends any ? util.OmitKeys<T, "path"> : never;
1219
+ type IssueData = stripPath<ZodIssueOptionalMessage> & {
1220
+ path?: (string | number)[];
1221
+ fatal?: boolean | undefined;
1222
+ };
1223
+ type ErrorMapCtx = {
1224
+ defaultError: string;
1225
+ data: any;
1226
+ };
1227
+ type ZodErrorMap = (issue: ZodIssueOptionalMessage, _ctx: ErrorMapCtx) => {
1228
+ message: string;
1229
+ };
1230
+ //#endregion
1231
+ //#region ../../../../../node_modules/zod/v3/helpers/parseUtil.d.cts
1232
+ type ParseParams = {
1233
+ path: (string | number)[];
1234
+ errorMap: ZodErrorMap;
1235
+ async: boolean;
1236
+ };
1237
+ type ParsePathComponent = string | number;
1238
+ type ParsePath = ParsePathComponent[];
1239
+ interface ParseContext {
1240
+ readonly common: {
1241
+ readonly issues: ZodIssue[];
1242
+ readonly contextualErrorMap?: ZodErrorMap | undefined;
1243
+ readonly async: boolean;
1244
+ };
1245
+ readonly path: ParsePath;
1246
+ readonly schemaErrorMap?: ZodErrorMap | undefined;
1247
+ readonly parent: ParseContext | null;
1248
+ readonly data: any;
1249
+ readonly parsedType: ZodParsedType;
1250
+ }
1251
+ type ParseInput = {
1252
+ data: any;
1253
+ path: (string | number)[];
1254
+ parent: ParseContext;
1255
+ };
1256
+ declare class ParseStatus {
1257
+ value: "aborted" | "dirty" | "valid";
1258
+ dirty(): void;
1259
+ abort(): void;
1260
+ static mergeArray(status: ParseStatus, results: SyncParseReturnType<any>[]): SyncParseReturnType;
1261
+ static mergeObjectAsync(status: ParseStatus, pairs: {
1262
+ key: ParseReturnType<any>;
1263
+ value: ParseReturnType<any>;
1264
+ }[]): Promise<SyncParseReturnType<any>>;
1265
+ static mergeObjectSync(status: ParseStatus, pairs: {
1266
+ key: SyncParseReturnType<any>;
1267
+ value: SyncParseReturnType<any>;
1268
+ alwaysSet?: boolean;
1269
+ }[]): SyncParseReturnType;
1270
+ }
1271
+ type INVALID = {
1272
+ status: "aborted";
1273
+ };
1274
+ declare const INVALID: INVALID;
1275
+ type DIRTY<T> = {
1276
+ status: "dirty";
1277
+ value: T;
1278
+ };
1279
+ declare const DIRTY: <T>(value: T) => DIRTY<T>;
1280
+ type OK<T> = {
1281
+ status: "valid";
1282
+ value: T;
1283
+ };
1284
+ declare const OK: <T>(value: T) => OK<T>;
1285
+ type SyncParseReturnType<T = any> = OK<T> | DIRTY<T> | INVALID;
1286
+ type AsyncParseReturnType<T> = Promise<SyncParseReturnType<T>>;
1287
+ type ParseReturnType<T> = SyncParseReturnType<T> | AsyncParseReturnType<T>;
1288
+ //#endregion
1289
+ //#region ../../../../../node_modules/zod/v3/helpers/errorUtil.d.cts
1290
+ declare namespace errorUtil {
1291
+ type ErrMessage = string | {
1292
+ message?: string | undefined;
1293
+ };
1294
+ const errToObj: (message?: ErrMessage) => {
1295
+ message?: string | undefined;
1296
+ };
1297
+ const toString: (message?: ErrMessage) => string | undefined;
1298
+ }
1299
+ //#endregion
1300
+ //#region ../../../../../node_modules/zod/v3/standard-schema.d.cts
1301
+ /**
1302
+ * The Standard Schema interface.
1303
+ */
1304
+ type StandardSchemaV1<Input = unknown, Output = Input> = {
1305
+ /**
1306
+ * The Standard Schema properties.
1307
+ */
1308
+ readonly "~standard": StandardSchemaV1.Props<Input, Output>;
1309
+ };
1310
+ declare namespace StandardSchemaV1 {
1311
+ /**
1312
+ * The Standard Schema properties interface.
1313
+ */
1314
+ export interface Props<Input = unknown, Output = Input> {
1315
+ /**
1316
+ * The version number of the standard.
1317
+ */
1318
+ readonly version: 1;
1319
+ /**
1320
+ * The vendor name of the schema library.
1321
+ */
1322
+ readonly vendor: string;
1323
+ /**
1324
+ * Validates unknown input values.
1325
+ */
1326
+ readonly validate: (value: unknown) => Result<Output> | Promise<Result<Output>>;
1327
+ /**
1328
+ * Inferred types associated with the schema.
1329
+ */
1330
+ readonly types?: Types<Input, Output> | undefined;
1331
+ }
1332
+ /**
1333
+ * The result interface of the validate function.
1334
+ */
1335
+ export type Result<Output> = SuccessResult<Output> | FailureResult;
1336
+ /**
1337
+ * The result interface if validation succeeds.
1338
+ */
1339
+ export interface SuccessResult<Output> {
1340
+ /**
1341
+ * The typed output value.
1342
+ */
1343
+ readonly value: Output;
1344
+ /**
1345
+ * The non-existent issues.
1346
+ */
1347
+ readonly issues?: undefined;
1348
+ }
1349
+ /**
1350
+ * The result interface if validation fails.
1351
+ */
1352
+ export interface FailureResult {
1353
+ /**
1354
+ * The issues of failed validation.
1355
+ */
1356
+ readonly issues: ReadonlyArray<Issue>;
1357
+ }
1358
+ /**
1359
+ * The issue interface of the failure output.
1360
+ */
1361
+ export interface Issue {
1362
+ /**
1363
+ * The error message of the issue.
1364
+ */
1365
+ readonly message: string;
1366
+ /**
1367
+ * The path of the issue, if any.
1368
+ */
1369
+ readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
1370
+ }
1371
+ /**
1372
+ * The path segment interface of the issue.
1373
+ */
1374
+ export interface PathSegment {
1375
+ /**
1376
+ * The key representing a path segment.
1377
+ */
1378
+ readonly key: PropertyKey;
1379
+ }
1380
+ /**
1381
+ * The Standard Schema types interface.
1382
+ */
1383
+ export interface Types<Input = unknown, Output = Input> {
1384
+ /**
1385
+ * The input type of the schema.
1386
+ */
1387
+ readonly input: Input;
1388
+ /**
1389
+ * The output type of the schema.
1390
+ */
1391
+ readonly output: Output;
1392
+ }
1393
+ /**
1394
+ * Infers the input type of a Standard Schema.
1395
+ */
1396
+ export type InferInput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["input"];
1397
+ /**
1398
+ * Infers the output type of a Standard Schema.
1399
+ */
1400
+ export type InferOutput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["output"];
1401
+ export {};
1402
+ }
1403
+ //#endregion
1404
+ //#region ../../../../../node_modules/zod/v3/types.d.cts
1405
+ interface RefinementCtx {
1406
+ addIssue: (arg: IssueData) => void;
1407
+ path: (string | number)[];
1408
+ }
1409
+ type ZodTypeAny = ZodType<any, any, any>;
1410
+ type TypeOf<T extends ZodType<any, any, any>> = T["_output"];
1411
+ type input<T extends ZodType<any, any, any>> = T["_input"];
1412
+ type output<T extends ZodType<any, any, any>> = T["_output"];
1413
+ type CustomErrorParams = Partial<util.Omit<ZodCustomIssue, "code">>;
1414
+ interface ZodTypeDef {
1415
+ errorMap?: ZodErrorMap | undefined;
1416
+ description?: string | undefined;
1417
+ }
1418
+ type RawCreateParams = {
1419
+ errorMap?: ZodErrorMap | undefined;
1420
+ invalid_type_error?: string | undefined;
1421
+ required_error?: string | undefined;
1422
+ message?: string | undefined;
1423
+ description?: string | undefined;
1424
+ } | undefined;
1425
+ type SafeParseSuccess<Output> = {
1426
+ success: true;
1427
+ data: Output;
1428
+ error?: never;
1429
+ };
1430
+ type SafeParseError<Input> = {
1431
+ success: false;
1432
+ error: ZodError<Input>;
1433
+ data?: never;
1434
+ };
1435
+ type SafeParseReturnType<Input, Output> = SafeParseSuccess<Output> | SafeParseError<Input>;
1436
+ declare abstract class ZodType<Output = any, Def extends ZodTypeDef = ZodTypeDef, Input = Output> {
1437
+ readonly _type: Output;
1438
+ readonly _output: Output;
1439
+ readonly _input: Input;
1440
+ readonly _def: Def;
1441
+ get description(): string | undefined;
1442
+ "~standard": StandardSchemaV1.Props<Input, Output>;
1443
+ abstract _parse(input: ParseInput): ParseReturnType<Output>;
1444
+ _getType(input: ParseInput): string;
1445
+ _getOrReturnCtx(input: ParseInput, ctx?: ParseContext | undefined): ParseContext;
1446
+ _processInputParams(input: ParseInput): {
1447
+ status: ParseStatus;
1448
+ ctx: ParseContext;
1449
+ };
1450
+ _parseSync(input: ParseInput): SyncParseReturnType<Output>;
1451
+ _parseAsync(input: ParseInput): AsyncParseReturnType<Output>;
1452
+ parse(data: unknown, params?: util.InexactPartial<ParseParams>): Output;
1453
+ safeParse(data: unknown, params?: util.InexactPartial<ParseParams>): SafeParseReturnType<Input, Output>;
1454
+ "~validate"(data: unknown): StandardSchemaV1.Result<Output> | Promise<StandardSchemaV1.Result<Output>>;
1455
+ parseAsync(data: unknown, params?: util.InexactPartial<ParseParams>): Promise<Output>;
1456
+ safeParseAsync(data: unknown, params?: util.InexactPartial<ParseParams>): Promise<SafeParseReturnType<Input, Output>>;
1457
+ /** Alias of safeParseAsync */
1458
+ spa: (data: unknown, params?: util.InexactPartial<ParseParams>) => Promise<SafeParseReturnType<Input, Output>>;
1459
+ refine<RefinedOutput extends Output>(check: (arg: Output) => arg is RefinedOutput, message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams)): ZodEffects<this, RefinedOutput, Input>;
1460
+ refine(check: (arg: Output) => unknown | Promise<unknown>, message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams)): ZodEffects<this, Output, Input>;
1461
+ refinement<RefinedOutput extends Output>(check: (arg: Output) => arg is RefinedOutput, refinementData: IssueData | ((arg: Output, ctx: RefinementCtx) => IssueData)): ZodEffects<this, RefinedOutput, Input>;
1462
+ refinement(check: (arg: Output) => boolean, refinementData: IssueData | ((arg: Output, ctx: RefinementCtx) => IssueData)): ZodEffects<this, Output, Input>;
1463
+ _refinement(refinement: RefinementEffect<Output>["refinement"]): ZodEffects<this, Output, Input>;
1464
+ superRefine<RefinedOutput extends Output>(refinement: (arg: Output, ctx: RefinementCtx) => arg is RefinedOutput): ZodEffects<this, RefinedOutput, Input>;
1465
+ superRefine(refinement: (arg: Output, ctx: RefinementCtx) => void): ZodEffects<this, Output, Input>;
1466
+ superRefine(refinement: (arg: Output, ctx: RefinementCtx) => Promise<void>): ZodEffects<this, Output, Input>;
1467
+ constructor(def: Def);
1468
+ optional(): ZodOptional<this>;
1469
+ nullable(): ZodNullable<this>;
1470
+ nullish(): ZodOptional<ZodNullable<this>>;
1471
+ array(): ZodArray<this>;
1472
+ promise(): ZodPromise<this>;
1473
+ or<T extends ZodTypeAny>(option: T): ZodUnion<[this, T]>;
1474
+ and<T extends ZodTypeAny>(incoming: T): ZodIntersection<this, T>;
1475
+ transform<NewOut>(transform: (arg: Output, ctx: RefinementCtx) => NewOut | Promise<NewOut>): ZodEffects<this, NewOut>;
1476
+ default(def: util.noUndefined<Input>): ZodDefault<this>;
1477
+ default(def: () => util.noUndefined<Input>): ZodDefault<this>;
1478
+ brand<B extends string | number | symbol>(brand?: B): ZodBranded<this, B>;
1479
+ catch(def: Output): ZodCatch<this>;
1480
+ catch(def: (ctx: {
1481
+ error: ZodError;
1482
+ input: Input;
1483
+ }) => Output): ZodCatch<this>;
1484
+ describe(description: string): this;
1485
+ pipe<T extends ZodTypeAny>(target: T): ZodPipeline<this, T>;
1486
+ readonly(): ZodReadonly<this>;
1487
+ isOptional(): boolean;
1488
+ isNullable(): boolean;
1489
+ }
1490
+ type IpVersion = "v4" | "v6";
1491
+ type ZodStringCheck = {
1492
+ kind: "min";
1493
+ value: number;
1494
+ message?: string | undefined;
1495
+ } | {
1496
+ kind: "max";
1497
+ value: number;
1498
+ message?: string | undefined;
1499
+ } | {
1500
+ kind: "length";
1501
+ value: number;
1502
+ message?: string | undefined;
1503
+ } | {
1504
+ kind: "email";
1505
+ message?: string | undefined;
1506
+ } | {
1507
+ kind: "url";
1508
+ message?: string | undefined;
1509
+ } | {
1510
+ kind: "emoji";
1511
+ message?: string | undefined;
1512
+ } | {
1513
+ kind: "uuid";
1514
+ message?: string | undefined;
1515
+ } | {
1516
+ kind: "nanoid";
1517
+ message?: string | undefined;
1518
+ } | {
1519
+ kind: "cuid";
1520
+ message?: string | undefined;
1521
+ } | {
1522
+ kind: "includes";
1523
+ value: string;
1524
+ position?: number | undefined;
1525
+ message?: string | undefined;
1526
+ } | {
1527
+ kind: "cuid2";
1528
+ message?: string | undefined;
1529
+ } | {
1530
+ kind: "ulid";
1531
+ message?: string | undefined;
1532
+ } | {
1533
+ kind: "startsWith";
1534
+ value: string;
1535
+ message?: string | undefined;
1536
+ } | {
1537
+ kind: "endsWith";
1538
+ value: string;
1539
+ message?: string | undefined;
1540
+ } | {
1541
+ kind: "regex";
1542
+ regex: RegExp;
1543
+ message?: string | undefined;
1544
+ } | {
1545
+ kind: "trim";
1546
+ message?: string | undefined;
1547
+ } | {
1548
+ kind: "toLowerCase";
1549
+ message?: string | undefined;
1550
+ } | {
1551
+ kind: "toUpperCase";
1552
+ message?: string | undefined;
1553
+ } | {
1554
+ kind: "jwt";
1555
+ alg?: string;
1556
+ message?: string | undefined;
1557
+ } | {
1558
+ kind: "datetime";
1559
+ offset: boolean;
1560
+ local: boolean;
1561
+ precision: number | null;
1562
+ message?: string | undefined;
1563
+ } | {
1564
+ kind: "date";
1565
+ message?: string | undefined;
1566
+ } | {
1567
+ kind: "time";
1568
+ precision: number | null;
1569
+ message?: string | undefined;
1570
+ } | {
1571
+ kind: "duration";
1572
+ message?: string | undefined;
1573
+ } | {
1574
+ kind: "ip";
1575
+ version?: IpVersion | undefined;
1576
+ message?: string | undefined;
1577
+ } | {
1578
+ kind: "cidr";
1579
+ version?: IpVersion | undefined;
1580
+ message?: string | undefined;
1581
+ } | {
1582
+ kind: "base64";
1583
+ message?: string | undefined;
1584
+ } | {
1585
+ kind: "base64url";
1586
+ message?: string | undefined;
1587
+ };
1588
+ interface ZodStringDef extends ZodTypeDef {
1589
+ checks: ZodStringCheck[];
1590
+ typeName: ZodFirstPartyTypeKind.ZodString;
1591
+ coerce: boolean;
1592
+ }
1593
+ declare class ZodString extends ZodType<string, ZodStringDef, string> {
1594
+ _parse(input: ParseInput): ParseReturnType<string>;
1595
+ protected _regex(regex: RegExp, validation: StringValidation, message?: errorUtil.ErrMessage): ZodEffects<this, string, string>;
1596
+ _addCheck(check: ZodStringCheck): ZodString;
1597
+ email(message?: errorUtil.ErrMessage): ZodString;
1598
+ url(message?: errorUtil.ErrMessage): ZodString;
1599
+ emoji(message?: errorUtil.ErrMessage): ZodString;
1600
+ uuid(message?: errorUtil.ErrMessage): ZodString;
1601
+ nanoid(message?: errorUtil.ErrMessage): ZodString;
1602
+ cuid(message?: errorUtil.ErrMessage): ZodString;
1603
+ cuid2(message?: errorUtil.ErrMessage): ZodString;
1604
+ ulid(message?: errorUtil.ErrMessage): ZodString;
1605
+ base64(message?: errorUtil.ErrMessage): ZodString;
1606
+ base64url(message?: errorUtil.ErrMessage): ZodString;
1607
+ jwt(options?: {
1608
+ alg?: string;
1609
+ message?: string | undefined;
1610
+ }): ZodString;
1611
+ ip(options?: string | {
1612
+ version?: IpVersion;
1613
+ message?: string | undefined;
1614
+ }): ZodString;
1615
+ cidr(options?: string | {
1616
+ version?: IpVersion;
1617
+ message?: string | undefined;
1618
+ }): ZodString;
1619
+ datetime(options?: string | {
1620
+ message?: string | undefined;
1621
+ precision?: number | null;
1622
+ offset?: boolean;
1623
+ local?: boolean;
1624
+ }): ZodString;
1625
+ date(message?: string): ZodString;
1626
+ time(options?: string | {
1627
+ message?: string | undefined;
1628
+ precision?: number | null;
1629
+ }): ZodString;
1630
+ duration(message?: errorUtil.ErrMessage): ZodString;
1631
+ regex(regex: RegExp, message?: errorUtil.ErrMessage): ZodString;
1632
+ includes(value: string, options?: {
1633
+ message?: string;
1634
+ position?: number;
1635
+ }): ZodString;
1636
+ startsWith(value: string, message?: errorUtil.ErrMessage): ZodString;
1637
+ endsWith(value: string, message?: errorUtil.ErrMessage): ZodString;
1638
+ min(minLength: number, message?: errorUtil.ErrMessage): ZodString;
1639
+ max(maxLength: number, message?: errorUtil.ErrMessage): ZodString;
1640
+ length(len: number, message?: errorUtil.ErrMessage): ZodString;
1641
+ /**
1642
+ * Equivalent to `.min(1)`
1643
+ */
1644
+ nonempty(message?: errorUtil.ErrMessage): ZodString;
1645
+ trim(): ZodString;
1646
+ toLowerCase(): ZodString;
1647
+ toUpperCase(): ZodString;
1648
+ get isDatetime(): boolean;
1649
+ get isDate(): boolean;
1650
+ get isTime(): boolean;
1651
+ get isDuration(): boolean;
1652
+ get isEmail(): boolean;
1653
+ get isURL(): boolean;
1654
+ get isEmoji(): boolean;
1655
+ get isUUID(): boolean;
1656
+ get isNANOID(): boolean;
1657
+ get isCUID(): boolean;
1658
+ get isCUID2(): boolean;
1659
+ get isULID(): boolean;
1660
+ get isIP(): boolean;
1661
+ get isCIDR(): boolean;
1662
+ get isBase64(): boolean;
1663
+ get isBase64url(): boolean;
1664
+ get minLength(): number | null;
1665
+ get maxLength(): number | null;
1666
+ static create: (params?: RawCreateParams & {
1667
+ coerce?: true;
1668
+ }) => ZodString;
1669
+ }
1670
+ interface ZodBooleanDef extends ZodTypeDef {
1671
+ typeName: ZodFirstPartyTypeKind.ZodBoolean;
1672
+ coerce: boolean;
1673
+ }
1674
+ declare class ZodBoolean extends ZodType<boolean, ZodBooleanDef, boolean> {
1675
+ _parse(input: ParseInput): ParseReturnType<boolean>;
1676
+ static create: (params?: RawCreateParams & {
1677
+ coerce?: boolean;
1678
+ }) => ZodBoolean;
1679
+ }
1680
+ interface ZodArrayDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
1681
+ type: T;
1682
+ typeName: ZodFirstPartyTypeKind.ZodArray;
1683
+ exactLength: {
1684
+ value: number;
1685
+ message?: string | undefined;
1686
+ } | null;
1687
+ minLength: {
1688
+ value: number;
1689
+ message?: string | undefined;
1690
+ } | null;
1691
+ maxLength: {
1692
+ value: number;
1693
+ message?: string | undefined;
1694
+ } | null;
1695
+ }
1696
+ type ArrayCardinality = "many" | "atleastone";
1697
+ type arrayOutputType<T extends ZodTypeAny, Cardinality extends ArrayCardinality = "many"> = Cardinality extends "atleastone" ? [T["_output"], ...T["_output"][]] : T["_output"][];
1698
+ declare class ZodArray<T extends ZodTypeAny, Cardinality extends ArrayCardinality = "many"> extends ZodType<arrayOutputType<T, Cardinality>, ZodArrayDef<T>, Cardinality extends "atleastone" ? [T["_input"], ...T["_input"][]] : T["_input"][]> {
1699
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
1700
+ get element(): T;
1701
+ min(minLength: number, message?: errorUtil.ErrMessage): this;
1702
+ max(maxLength: number, message?: errorUtil.ErrMessage): this;
1703
+ length(len: number, message?: errorUtil.ErrMessage): this;
1704
+ nonempty(message?: errorUtil.ErrMessage): ZodArray<T, "atleastone">;
1705
+ static create: <El extends ZodTypeAny>(schema: El, params?: RawCreateParams) => ZodArray<El>;
1706
+ }
1707
+ type ZodUnionOptions = Readonly<[ZodTypeAny, ...ZodTypeAny[]]>;
1708
+ interface ZodUnionDef<T extends ZodUnionOptions = Readonly<[ZodTypeAny, ZodTypeAny, ...ZodTypeAny[]]>> extends ZodTypeDef {
1709
+ options: T;
1710
+ typeName: ZodFirstPartyTypeKind.ZodUnion;
1711
+ }
1712
+ declare class ZodUnion<T extends ZodUnionOptions> extends ZodType<T[number]["_output"], ZodUnionDef<T>, T[number]["_input"]> {
1713
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
1714
+ get options(): T;
1715
+ static create: <Options extends Readonly<[ZodTypeAny, ZodTypeAny, ...ZodTypeAny[]]>>(types: Options, params?: RawCreateParams) => ZodUnion<Options>;
1716
+ }
1717
+ interface ZodIntersectionDef<T extends ZodTypeAny = ZodTypeAny, U extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
1718
+ left: T;
1719
+ right: U;
1720
+ typeName: ZodFirstPartyTypeKind.ZodIntersection;
1721
+ }
1722
+ declare class ZodIntersection<T extends ZodTypeAny, U extends ZodTypeAny> extends ZodType<T["_output"] & U["_output"], ZodIntersectionDef<T, U>, T["_input"] & U["_input"]> {
1723
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
1724
+ static create: <TSchema extends ZodTypeAny, USchema extends ZodTypeAny>(left: TSchema, right: USchema, params?: RawCreateParams) => ZodIntersection<TSchema, USchema>;
1725
+ }
1726
+ interface ZodRecordDef<Key extends KeySchema = ZodString, Value extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
1727
+ valueType: Value;
1728
+ keyType: Key;
1729
+ typeName: ZodFirstPartyTypeKind.ZodRecord;
1730
+ }
1731
+ type KeySchema = ZodType<string | number | symbol, any, any>;
1732
+ type RecordType<K extends string | number | symbol, V> = [string] extends [K] ? Record<K, V> : [number] extends [K] ? Record<K, V> : [symbol] extends [K] ? Record<K, V> : [BRAND<string | number | symbol>] extends [K] ? Record<K, V> : Partial<Record<K, V>>;
1733
+ declare class ZodRecord<Key extends KeySchema = ZodString, Value extends ZodTypeAny = ZodTypeAny> extends ZodType<RecordType<Key["_output"], Value["_output"]>, ZodRecordDef<Key, Value>, RecordType<Key["_input"], Value["_input"]>> {
1734
+ get keySchema(): Key;
1735
+ get valueSchema(): Value;
1736
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
1737
+ get element(): Value;
1738
+ static create<Value extends ZodTypeAny>(valueType: Value, params?: RawCreateParams): ZodRecord<ZodString, Value>;
1739
+ static create<Keys extends KeySchema, Value extends ZodTypeAny>(keySchema: Keys, valueType: Value, params?: RawCreateParams): ZodRecord<Keys, Value>;
1740
+ }
1741
+ type EnumValues<T extends string = string> = readonly [T, ...T[]];
1742
+ type Values<T extends EnumValues> = { [k in T[number]]: k; };
1743
+ interface ZodEnumDef<T extends EnumValues = EnumValues> extends ZodTypeDef {
1744
+ values: T;
1745
+ typeName: ZodFirstPartyTypeKind.ZodEnum;
1746
+ }
1747
+ type Writeable<T> = { -readonly [P in keyof T]: T[P]; };
1748
+ type FilterEnum<Values, ToExclude> = Values extends [] ? [] : Values extends [infer Head, ...infer Rest] ? Head extends ToExclude ? FilterEnum<Rest, ToExclude> : [Head, ...FilterEnum<Rest, ToExclude>] : never;
1749
+ type typecast<A, T> = A extends T ? A : never;
1750
+ declare function createZodEnum<U extends string, T extends Readonly<[U, ...U[]]>>(values: T, params?: RawCreateParams): ZodEnum<Writeable<T>>;
1751
+ declare function createZodEnum<U extends string, T extends [U, ...U[]]>(values: T, params?: RawCreateParams): ZodEnum<T>;
1752
+ declare class ZodEnum<T extends [string, ...string[]]> extends ZodType<T[number], ZodEnumDef<T>, T[number]> {
1753
+ _cache: Set<T[number]> | undefined;
1754
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
1755
+ get options(): T;
1756
+ get enum(): Values<T>;
1757
+ get Values(): Values<T>;
1758
+ get Enum(): Values<T>;
1759
+ extract<ToExtract extends readonly [T[number], ...T[number][]]>(values: ToExtract, newDef?: RawCreateParams): ZodEnum<Writeable<ToExtract>>;
1760
+ exclude<ToExclude extends readonly [T[number], ...T[number][]]>(values: ToExclude, newDef?: RawCreateParams): ZodEnum<typecast<Writeable<FilterEnum<T, ToExclude[number]>>, [string, ...string[]]>>;
1761
+ static create: typeof createZodEnum;
1762
+ }
1763
+ interface ZodPromiseDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
1764
+ type: T;
1765
+ typeName: ZodFirstPartyTypeKind.ZodPromise;
1766
+ }
1767
+ declare class ZodPromise<T extends ZodTypeAny> extends ZodType<Promise<T["_output"]>, ZodPromiseDef<T>, Promise<T["_input"]>> {
1768
+ unwrap(): T;
1769
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
1770
+ static create: <Inner extends ZodTypeAny>(schema: Inner, params?: RawCreateParams) => ZodPromise<Inner>;
1771
+ }
1772
+ type RefinementEffect<T> = {
1773
+ type: "refinement";
1774
+ refinement: (arg: T, ctx: RefinementCtx) => any;
1775
+ };
1776
+ type TransformEffect<T> = {
1777
+ type: "transform";
1778
+ transform: (arg: T, ctx: RefinementCtx) => any;
1779
+ };
1780
+ type PreprocessEffect<T> = {
1781
+ type: "preprocess";
1782
+ transform: (arg: T, ctx: RefinementCtx) => any;
1783
+ };
1784
+ type Effect<T> = RefinementEffect<T> | TransformEffect<T> | PreprocessEffect<T>;
1785
+ interface ZodEffectsDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
1786
+ schema: T;
1787
+ typeName: ZodFirstPartyTypeKind.ZodEffects;
1788
+ effect: Effect<any>;
1789
+ }
1790
+ declare class ZodEffects<T extends ZodTypeAny, Output = output<T>, Input = input<T>> extends ZodType<Output, ZodEffectsDef<T>, Input> {
1791
+ innerType(): T;
1792
+ sourceType(): T;
1793
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
1794
+ static create: <I extends ZodTypeAny>(schema: I, effect: Effect<I["_output"]>, params?: RawCreateParams) => ZodEffects<I, I["_output"]>;
1795
+ static createWithPreprocess: <I extends ZodTypeAny>(preprocess: (arg: unknown, ctx: RefinementCtx) => unknown, schema: I, params?: RawCreateParams) => ZodEffects<I, I["_output"], unknown>;
1796
+ }
1797
+ interface ZodOptionalDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
1798
+ innerType: T;
1799
+ typeName: ZodFirstPartyTypeKind.ZodOptional;
1800
+ }
1801
+ declare class ZodOptional<T extends ZodTypeAny> extends ZodType<T["_output"] | undefined, ZodOptionalDef<T>, T["_input"] | undefined> {
1802
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
1803
+ unwrap(): T;
1804
+ static create: <Inner extends ZodTypeAny>(type: Inner, params?: RawCreateParams) => ZodOptional<Inner>;
1805
+ }
1806
+ interface ZodNullableDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
1807
+ innerType: T;
1808
+ typeName: ZodFirstPartyTypeKind.ZodNullable;
1809
+ }
1810
+ declare class ZodNullable<T extends ZodTypeAny> extends ZodType<T["_output"] | null, ZodNullableDef<T>, T["_input"] | null> {
1811
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
1812
+ unwrap(): T;
1813
+ static create: <Inner extends ZodTypeAny>(type: Inner, params?: RawCreateParams) => ZodNullable<Inner>;
1814
+ }
1815
+ interface ZodDefaultDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
1816
+ innerType: T;
1817
+ defaultValue: () => util.noUndefined<T["_input"]>;
1818
+ typeName: ZodFirstPartyTypeKind.ZodDefault;
1819
+ }
1820
+ declare class ZodDefault<T extends ZodTypeAny> extends ZodType<util.noUndefined<T["_output"]>, ZodDefaultDef<T>, T["_input"] | undefined> {
1821
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
1822
+ removeDefault(): T;
1823
+ static create: <Inner extends ZodTypeAny>(type: Inner, params: RawCreateParams & {
1824
+ default: Inner["_input"] | (() => util.noUndefined<Inner["_input"]>);
1825
+ }) => ZodDefault<Inner>;
1826
+ }
1827
+ interface ZodCatchDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
1828
+ innerType: T;
1829
+ catchValue: (ctx: {
1830
+ error: ZodError;
1831
+ input: unknown;
1832
+ }) => T["_input"];
1833
+ typeName: ZodFirstPartyTypeKind.ZodCatch;
1834
+ }
1835
+ declare class ZodCatch<T extends ZodTypeAny> extends ZodType<T["_output"], ZodCatchDef<T>, unknown> {
1836
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
1837
+ removeCatch(): T;
1838
+ static create: <Inner extends ZodTypeAny>(type: Inner, params: RawCreateParams & {
1839
+ catch: Inner["_output"] | (() => Inner["_output"]);
1840
+ }) => ZodCatch<Inner>;
1841
+ }
1842
+ interface ZodBrandedDef<T extends ZodTypeAny> extends ZodTypeDef {
1843
+ type: T;
1844
+ typeName: ZodFirstPartyTypeKind.ZodBranded;
1845
+ }
1846
+ declare const BRAND: unique symbol;
1847
+ type BRAND<T extends string | number | symbol> = {
1848
+ [BRAND]: { [k in T]: true; };
1849
+ };
1850
+ declare class ZodBranded<T extends ZodTypeAny, B extends string | number | symbol> extends ZodType<T["_output"] & BRAND<B>, ZodBrandedDef<T>, T["_input"]> {
1851
+ _parse(input: ParseInput): ParseReturnType<any>;
1852
+ unwrap(): T;
1853
+ }
1854
+ interface ZodPipelineDef<A extends ZodTypeAny, B extends ZodTypeAny> extends ZodTypeDef {
1855
+ in: A;
1856
+ out: B;
1857
+ typeName: ZodFirstPartyTypeKind.ZodPipeline;
1858
+ }
1859
+ declare class ZodPipeline<A extends ZodTypeAny, B extends ZodTypeAny> extends ZodType<B["_output"], ZodPipelineDef<A, B>, A["_input"]> {
1860
+ _parse(input: ParseInput): ParseReturnType<any>;
1861
+ static create<ASchema extends ZodTypeAny, BSchema extends ZodTypeAny>(a: ASchema, b: BSchema): ZodPipeline<ASchema, BSchema>;
1862
+ }
1863
+ type BuiltIn = (((...args: any[]) => any) | (new (...args: any[]) => any)) | {
1864
+ readonly [Symbol.toStringTag]: string;
1865
+ } | Date | Error | Generator | Promise<unknown> | RegExp;
1866
+ type MakeReadonly<T> = T extends Map<infer K, infer V> ? ReadonlyMap<K, V> : T extends Set<infer V> ? ReadonlySet<V> : T extends [infer Head, ...infer Tail] ? readonly [Head, ...Tail] : T extends Array<infer V> ? ReadonlyArray<V> : T extends BuiltIn ? T : Readonly<T>;
1867
+ interface ZodReadonlyDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
1868
+ innerType: T;
1869
+ typeName: ZodFirstPartyTypeKind.ZodReadonly;
1870
+ }
1871
+ declare class ZodReadonly<T extends ZodTypeAny> extends ZodType<MakeReadonly<T["_output"]>, ZodReadonlyDef<T>, MakeReadonly<T["_input"]>> {
1872
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
1873
+ static create: <Inner extends ZodTypeAny>(type: Inner, params?: RawCreateParams) => ZodReadonly<Inner>;
1874
+ unwrap(): T;
1875
+ }
1876
+ declare enum ZodFirstPartyTypeKind {
1877
+ ZodString = "ZodString",
1878
+ ZodNumber = "ZodNumber",
1879
+ ZodNaN = "ZodNaN",
1880
+ ZodBigInt = "ZodBigInt",
1881
+ ZodBoolean = "ZodBoolean",
1882
+ ZodDate = "ZodDate",
1883
+ ZodSymbol = "ZodSymbol",
1884
+ ZodUndefined = "ZodUndefined",
1885
+ ZodNull = "ZodNull",
1886
+ ZodAny = "ZodAny",
1887
+ ZodUnknown = "ZodUnknown",
1888
+ ZodNever = "ZodNever",
1889
+ ZodVoid = "ZodVoid",
1890
+ ZodArray = "ZodArray",
1891
+ ZodObject = "ZodObject",
1892
+ ZodUnion = "ZodUnion",
1893
+ ZodDiscriminatedUnion = "ZodDiscriminatedUnion",
1894
+ ZodIntersection = "ZodIntersection",
1895
+ ZodTuple = "ZodTuple",
1896
+ ZodRecord = "ZodRecord",
1897
+ ZodMap = "ZodMap",
1898
+ ZodSet = "ZodSet",
1899
+ ZodFunction = "ZodFunction",
1900
+ ZodLazy = "ZodLazy",
1901
+ ZodLiteral = "ZodLiteral",
1902
+ ZodEnum = "ZodEnum",
1903
+ ZodEffects = "ZodEffects",
1904
+ ZodNativeEnum = "ZodNativeEnum",
1905
+ ZodOptional = "ZodOptional",
1906
+ ZodNullable = "ZodNullable",
1907
+ ZodDefault = "ZodDefault",
1908
+ ZodCatch = "ZodCatch",
1909
+ ZodPromise = "ZodPromise",
1910
+ ZodBranded = "ZodBranded",
1911
+ ZodPipeline = "ZodPipeline",
1912
+ ZodReadonly = "ZodReadonly"
1913
+ }
1914
+ //#endregion
1915
+ //#region src/contract/modules/billing/plan-features-schema.d.ts
1916
+ declare const PlanFeaturesSchema: ZodRecord<ZodEnum<["advancedPermissions" | "analytics" | "audit" | "automation" | "byokAi" | "compliance" | "customAgents" | "globalSearch" | "hostedAi" | "largePageSize" | "multiProvider" | "sso" | "templates" | "versionHistory", ...("advancedPermissions" | "analytics" | "audit" | "automation" | "byokAi" | "compliance" | "customAgents" | "globalSearch" | "hostedAi" | "largePageSize" | "multiProvider" | "sso" | "templates" | "versionHistory")[]]>, ZodBoolean>;
1917
+ type PlanFeatures = TypeOf<typeof PlanFeaturesSchema>;
1918
+ //#endregion
1919
+ //#region src/contract/modules/billing/resource-registry.d.ts
1920
+ interface ResourceMeta {
1921
+ tier: 'paid' | 'enterprise';
1922
+ unit: string;
1923
+ purchasable: boolean | 'custom';
1924
+ step: number;
1925
+ /** 降购下限约束:seats 不允许降到当前活跃成员数以下 */
1926
+ floor?: 'activeMembers';
1927
+ }
1928
+ declare const ResourceRegistry: {
1929
+ readonly seats: {
1930
+ /** 成员席位池(billing 加购语义不变);访客池见 guestSeats */
1931
+ readonly tier: 'paid';
1932
+ readonly unit: 'per-seat';
1933
+ readonly purchasable: true;
1934
+ readonly step: 1;
1935
+ readonly floor: 'activeMembers';
1936
+ };
1937
+ readonly guestSeats: {
1938
+ readonly tier: 'paid';
1939
+ readonly unit: 'guest-seats';
1940
+ readonly purchasable: false;
1941
+ readonly step: 1;
1942
+ };
1943
+ readonly aiQuotaMonthly: {
1944
+ readonly tier: 'paid';
1945
+ readonly unit: 'requests/month';
1946
+ readonly purchasable: false;
1947
+ readonly step: 1;
1948
+ };
1949
+ readonly agentQuota: {
1950
+ readonly tier: 'paid';
1951
+ readonly unit: 'agents';
1952
+ readonly purchasable: false;
1953
+ readonly step: 1;
1954
+ };
1955
+ readonly skillQuota: {
1956
+ readonly tier: 'paid';
1957
+ readonly unit: 'skills';
1958
+ readonly purchasable: false;
1959
+ readonly step: 1;
1960
+ };
1961
+ readonly workspaces: {
1962
+ readonly tier: 'paid';
1963
+ readonly unit: 'workspaces';
1964
+ readonly purchasable: false;
1965
+ readonly step: 1;
1966
+ };
1967
+ };
1968
+ type ResourceKey = keyof typeof ResourceRegistry;
1969
+ declare const RESOURCE_KEYS: ResourceKey[];
1970
+ interface ResourceSnapshot {
1971
+ limit: number | 'unlimited';
1972
+ usage: number;
1973
+ }
1974
+ type ResourceSnapshots = Record<ResourceKey, ResourceSnapshot>;
1975
+ declare function isResourceDefined(key: string): key is ResourceKey;
1976
+ //#endregion
1977
+ //#region src/contract/modules/changelog/types.d.ts
1978
+ interface DeveloperLogEntry {
1979
+ id: string;
1980
+ date: string;
1981
+ year: string;
1982
+ title: string;
1983
+ desc: string;
1984
+ tags: string[];
1985
+ commitSha?: string;
1986
+ createdAt: string;
1987
+ updatedAt: string;
1988
+ }
1989
+ //#endregion
1990
+ //#region src/contract/modules/notifications/types.d.ts
1991
+ declare const NOTIFICATION_CATEGORIES: readonly ['team', 'collaboration', 'system', 'billing', 'security'];
1992
+ type NotificationCategory = (typeof NOTIFICATION_CATEGORIES)[number];
1993
+ declare const NOTIFICATION_FREQUENCIES: readonly ['realtime', 'digest-daily', 'digest-weekly', 'off'];
1994
+ type NotificationFrequency = (typeof NOTIFICATION_FREQUENCIES)[number];
1995
+ interface NotificationItem {
1996
+ id: string;
1997
+ category: NotificationCategory;
1998
+ type: string;
1999
+ title: string;
2000
+ body: string | null;
2001
+ link: string | null;
2002
+ readAt: string | null;
2003
+ createdAt: string;
2004
+ }
2005
+ interface NotificationListResult {
2006
+ items: NotificationItem[];
2007
+ total: number;
2008
+ hasMore: boolean;
2009
+ }
2010
+ /** 每类别投递频率(off = 关闭;旧版布尔值在读取时经 normalizeCategoryFrequencies 迁移) */
2011
+ type CategoryFrequencies = Record<NotificationCategory, NotificationFrequency>;
2012
+ interface NotificationPreferences {
2013
+ categories: CategoryFrequencies;
2014
+ dndEnabled: boolean;
2015
+ dndStart: string;
2016
+ dndEnd: string;
2017
+ }
2018
+ /** SSE 推送的自定义事件负载(AG-UI CUSTOM 事件的 value) */
2019
+ interface NotificationSsePayload {
2020
+ kind: 'notification';
2021
+ notification: NotificationItem;
2022
+ }
2023
+ interface UnreadSnapshotPayload {
2024
+ kind: 'unread_snapshot';
2025
+ count: number;
2026
+ }
2027
+ type NotificationSseValue = NotificationSsePayload | UnreadSnapshotPayload;
2028
+ //#endregion
2029
+ //#region src/contract/modules/notifications/index.d.ts
2030
+ declare const DEFAULT_CATEGORIES: CategoryFrequencies;
2031
+ /**
2032
+ * 归一化存储中的 categories 字段。
2033
+ * 存量数据为旧版布尔记录(true/false),读取时迁移为 frequency:
2034
+ * true → realtime,false → off;未知值回退默认 realtime。
2035
+ */
2036
+ declare function normalizeCategoryFrequencies(raw: unknown): CategoryFrequencies;
2037
+ declare function isInDndWindow(prefs: Pick<NotificationPreferences, 'dndEnabled' | 'dndStart' | 'dndEnd'>, now: string): boolean;
2038
+ //#endregion
2039
+ //#region src/contract/types/prototype.d.ts
2040
+ declare const DEVICE_SIZES: readonly ['mobile', 'tablet', 'desktop'];
2041
+ type DeviceSize = typeof DEVICE_SIZES[number];
2042
+ type DeviceType = {
2043
+ size: DeviceSize;
2044
+ label: string;
2045
+ icon: string;
2046
+ };
2047
+ type CanvasElement = {
2048
+ id: string;
2049
+ type: string;
2050
+ x: number;
2051
+ y: number;
2052
+ width: number;
2053
+ height: number;
2054
+ props: Record<string, unknown>;
2055
+ overrides?: Record<string, unknown>;
2056
+ children?: CanvasElement[];
2057
+ };
2058
+ type ComponentCategory = 'basic' | 'layout' | 'data' | 'feedback' | 'navigation' | 'media' | 'form' | 'other';
2059
+ type ComponentSource = 'builtin' | 'custom' | 'imported';
2060
+ type EditableFieldType = 'text' | 'number' | 'boolean' | 'select' | 'color' | 'image' | 'json' | 'richtext';
2061
+ type EditablePropField = {
2062
+ key: string;
2063
+ label: string;
2064
+ type: EditableFieldType;
2065
+ default?: unknown;
2066
+ options?: {
2067
+ label: string;
2068
+ value: unknown;
2069
+ }[];
2070
+ };
2071
+ type PrototypeComponentConfig = {
2072
+ type: string;
2073
+ category: ComponentCategory;
2074
+ label: string;
2075
+ icon: string;
2076
+ defaultProps: Record<string, unknown>;
2077
+ editableFields: EditablePropField[];
2078
+ source: ComponentSource;
2079
+ };
2080
+ type ResizeDirection = 'n' | 's' | 'e' | 'w' | 'ne' | 'nw' | 'se' | 'sw';
2081
+ type ResizeMode = 'strict' | 'free';
600
2082
  //#endregion
601
- export { type ActivationResult, type AiQuota, type AnalyticsQuery, type AnalyticsResult, type AnalyticsService, type AssembleInput, type AssemblyFiles, type AuditLogEntry, type AuditQuery, type AuditService, type AutomationRule, type AutomationService, type BillingService, BillingUnavailableError, type CheckoutParams, type ComplianceJobSummary, type ComplianceService, type CustomDashboard, type DocumentTemplate, type DocumentVersion, type FeatureContribution, type GlobalSearchService, type HostSession, type HostedAiChatParams, type HostedAiChatResult, HostedAiError, type HostedAiModel, type HostedAiService, type InvoiceInfo, type LicenseInfo, type LicenseIssueParams, type LicenseIssueResult, type LicenseService, type LicenseStatus, type Middleware, type PermissionLevel, type PermissionsService, type PlanInfo, type PluginContributions, type PluginDefinition, type PluginRouteContext, type PortalSessionParams, type PrismaContribution, type ProEdition, type ProFeature, type ProModule, type ProServiceMap, type ProfileDefinition, type QueryFactoryMap, type ResolveResult, type RoleDefinition, type RouteContribution, type SearchParams, type SearchResult, type SeatCheckResult, SeatsExceededError, type ServerSeam, type SettingsTabContribution, type SsoProvider, type SsoService, type SubscriptionInfo, type TemplatesService, type UiSlotContributions, type VersionHistoryService, WebhookSignatureError, definePlugin, defineProfile, dumpModules, generateAssemblyCode, generateAssemblyFiles, getServerSeam, parseProfileImports, registerServerSeam, resolveImportSpecifiers, resolvePluginOrder };
2083
+ export { ADAPTER_KINDS, ADAPTER_KIND_VALUES, type AICommandContext, type AICommandDef, type AICommandHandler, type AICommandResult, type ActivationResult, AdapterKind, type AiAdapter, AiModelMeta, AiProviderMeta, AiProviderRow, type AiQuota, type AllBlueModule, type AnalyticsQuery, type AnalyticsResult, type AnalyticsService, type AssembleInput, type AssemblyFiles, type AuditLogEntry, type AuditQuery, type AuditService, type AutomationRule, type AutomationService, type AvatarConfig, type AvatarPart, type BillingService, BillingUnavailableError, type CLIAgentInfo, type CanvasElement, CategoryFrequencies, type CheckoutParams, type ComplianceJobSummary, type ComplianceService, type ComponentCategory, type ComponentSource, type CustomDashboard, DEFAULT_CATEGORIES, DEFAULT_WATCHED_DEPENDENCIES, DEPENDENCY_CATEGORIES, DEPENDENCY_PRIORITIES, type DEVICE_SIZES, DND_STICKY_THRESHOLD, DependencyCategory, DependencyPriority, DependencySeed, DependencyUsage, type DeveloperLogEntry, type DeviceType, type DocumentTemplate, type DocumentVersion, type EditableFieldType, type EditablePropField, type EntityDef, type EntityUpdateEvent, FEATURE_KEYS, type FeatureContribution, type FeatureKey, type FeatureMeta, FeatureRegistry, type GlobalSearchService, type HostSession, type HostedAiChatParams, type HostedAiChatResult, HostedAiError, type HostedAiModel, type HostedAiService, type InvoiceInfo, LOAD_MORE_STEP, LOBE_ICON_MAP, type LicenseInfo, type LicenseIssueParams, type LicenseIssueResult, type LicenseService, type LicenseStatus, MODEL_CAPABILITY_OPTIONS, MODEL_TABS, type Middleware, ModelCapability, ModelTab, NOTIFICATION_CATEGORIES, NOTIFICATION_FREQUENCIES, NotificationCategory, NotificationFrequency, NotificationItem, NotificationListResult, NotificationPreferences, NotificationSsePayload, NotificationSseValue, OSS_BASE_FEATURES, PROVIDER_BADGE_STYLES, PROVIDER_CATEGORIES, PROVIDER_CATEGORY_VALUES, type ParsedUA, type PermissionLevel, type PermissionsService, type PlanFeatures, PlanFeaturesSchema, type PlanInfo, type PluginContributions, type PluginDefinition, type PluginRouteContext, type PortalSessionParams, type PrismaContribution, type PrismaSeam, type ProEdition, type ProFeature, type ProModule, type ProServiceMap, type ProfileDefinition, type PrototypeComponentConfig, ProviderCategory, type QueryFactoryMap, RESOURCE_KEYS, type RealtimeTransport, type RefDisplay, type Reference, type ReferenceDisplayFn, type ResizeDirection, type ResizeMode, type ResolveResult, type ResolvedRef, type ResourceKey, type ResourceMeta, ResourceRegistry, type ResourceSnapshot, type ResourceSnapshots, type RoleDefinition, type RouteContribution, SEED_AI_PROVIDERS, type SearchParams, type SearchResult, type SeatCheckResult, SeatsExceededError, type ServerSeam, type SettingsTabContribution, type ShapeType, type SsoProvider, type SsoService, type SubscriptionInfo, SyncDependencyResult, type TemplatesService, ThirdPartyDependencyRow, type UiSlotContributions, UnreadSnapshotPayload, UpdateDependencyInput, VIRTUALIZE_THRESHOLD, type VersionHistoryService, VersionStatus, WebhookSignatureError, definePlugin, defineProfile, dumpModules, formatParsedUA, generateAssemblyCode, generateAssemblyFiles, getClientIp, getServerSeam, isInDndWindow, isOssFeature, isResourceDefined, normalizeCategoryFrequencies, parseProfileImports, parseUserAgent, registerPrismaSeam, registerServerSeam, resolveImportSpecifiers, resolveIpLocation, resolvePluginOrder };