sa2kit 3.4.0 → 3.7.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.
Files changed (157) hide show
  1. package/dist/business/index.d.mts +2 -7
  2. package/dist/business/index.d.ts +2 -7
  3. package/dist/business/index.js +1761 -8045
  4. package/dist/business/index.js.map +1 -1
  5. package/dist/business/index.mjs +1169 -7452
  6. package/dist/business/index.mjs.map +1 -1
  7. package/dist/business/portfolio/index.d.mts +1 -2
  8. package/dist/business/portfolio/index.d.ts +1 -2
  9. package/dist/{chunk-KVYHCGRY.js → chunk-7Z3XR2Y4.js} +552 -263
  10. package/dist/chunk-7Z3XR2Y4.js.map +1 -0
  11. package/dist/chunk-XPY45Y75.js +1143 -0
  12. package/dist/chunk-XPY45Y75.js.map +1 -0
  13. package/dist/{chunk-YIRPPMCN.mjs → chunk-XSTMLLJV.mjs} +474 -198
  14. package/dist/chunk-XSTMLLJV.mjs.map +1 -0
  15. package/dist/chunk-ZJLS5JU5.mjs +1090 -0
  16. package/dist/chunk-ZJLS5JU5.mjs.map +1 -0
  17. package/dist/common/aiApi/client/index.d.mts +71 -0
  18. package/dist/common/aiApi/client/index.d.ts +71 -0
  19. package/dist/common/aiApi/client/index.js +165 -0
  20. package/dist/common/aiApi/client/index.js.map +1 -0
  21. package/dist/common/aiApi/client/index.mjs +151 -0
  22. package/dist/common/aiApi/client/index.mjs.map +1 -0
  23. package/dist/common/aiApi/index.d.mts +184 -0
  24. package/dist/common/aiApi/index.d.ts +184 -0
  25. package/dist/common/aiApi/index.js +217 -0
  26. package/dist/common/aiApi/index.mjs +4 -0
  27. package/dist/common/aiApi/server/index.d.mts +3 -0
  28. package/dist/common/aiApi/server/index.d.ts +3 -0
  29. package/dist/common/aiApi/server/index.js +217 -0
  30. package/dist/common/aiApi/server/index.mjs +4 -0
  31. package/dist/common/components/index.js +176 -177
  32. package/dist/common/components/index.mjs +1 -2
  33. package/dist/common/index.js +2 -3
  34. package/dist/common/index.mjs +1 -2
  35. package/dist/{index-BSmd4ikf.d.ts → index-B4wDXFL0.d.mts} +39 -2
  36. package/dist/{index-r2-zE3iC.d.mts → index-B4wDXFL0.d.ts} +39 -2
  37. package/dist/{index-DLLPTprx.d.mts → index-B9vXYzok.d.mts} +48 -13
  38. package/dist/{index-VFDbZxVM.d.ts → index-BZ0MhRau.d.ts} +48 -13
  39. package/dist/index.d.mts +703 -181
  40. package/dist/index.d.ts +703 -181
  41. package/dist/index.js +2921 -7257
  42. package/dist/index.js.map +1 -1
  43. package/dist/index.mjs +2161 -6538
  44. package/dist/index.mjs.map +1 -1
  45. package/dist/types-CiqMQ-uu.d.mts +166 -0
  46. package/dist/types-CiqMQ-uu.d.ts +166 -0
  47. package/package.json +15 -60
  48. package/dist/CollisionBalls-DgKtscU2.d.mts +0 -41
  49. package/dist/CollisionBalls-DgKtscU2.d.ts +0 -41
  50. package/dist/business/calendar/index.d.mts +0 -6
  51. package/dist/business/calendar/index.d.ts +0 -6
  52. package/dist/business/calendar/index.js +0 -7433
  53. package/dist/business/calendar/index.js.map +0 -1
  54. package/dist/business/calendar/index.mjs +0 -7257
  55. package/dist/business/calendar/index.mjs.map +0 -1
  56. package/dist/business/calendar/routes/index.d.mts +0 -191
  57. package/dist/business/calendar/routes/index.d.ts +0 -191
  58. package/dist/business/calendar/routes/index.js +0 -844
  59. package/dist/business/calendar/routes/index.js.map +0 -1
  60. package/dist/business/calendar/routes/index.mjs +0 -826
  61. package/dist/business/calendar/routes/index.mjs.map +0 -1
  62. package/dist/chunk-3R6JHA6D.js +0 -120
  63. package/dist/chunk-3R6JHA6D.js.map +0 -1
  64. package/dist/chunk-4PJM4752.js +0 -4
  65. package/dist/chunk-4PJM4752.js.map +0 -1
  66. package/dist/chunk-7PMT4L4I.js +0 -324
  67. package/dist/chunk-7PMT4L4I.js.map +0 -1
  68. package/dist/chunk-FY2X3LYR.mjs +0 -3
  69. package/dist/chunk-FY2X3LYR.mjs.map +0 -1
  70. package/dist/chunk-GS4SAW25.mjs +0 -116
  71. package/dist/chunk-GS4SAW25.mjs.map +0 -1
  72. package/dist/chunk-HL4H2HF6.js +0 -279
  73. package/dist/chunk-HL4H2HF6.js.map +0 -1
  74. package/dist/chunk-IJIQUMAK.mjs +0 -272
  75. package/dist/chunk-IJIQUMAK.mjs.map +0 -1
  76. package/dist/chunk-KVYHCGRY.js.map +0 -1
  77. package/dist/chunk-MMDSZIXD.mjs +0 -286
  78. package/dist/chunk-MMDSZIXD.mjs.map +0 -1
  79. package/dist/chunk-N2O3OX5Y.mjs +0 -243
  80. package/dist/chunk-N2O3OX5Y.mjs.map +0 -1
  81. package/dist/chunk-RRQ2X26Z.js +0 -106
  82. package/dist/chunk-RRQ2X26Z.js.map +0 -1
  83. package/dist/chunk-RVNQI6BI.js +0 -249
  84. package/dist/chunk-RVNQI6BI.js.map +0 -1
  85. package/dist/chunk-UJUWDF7M.mjs +0 -336
  86. package/dist/chunk-UJUWDF7M.mjs.map +0 -1
  87. package/dist/chunk-VCKXK6V5.js +0 -345
  88. package/dist/chunk-VCKXK6V5.js.map +0 -1
  89. package/dist/chunk-VIEXDTNF.mjs +0 -100
  90. package/dist/chunk-VIEXDTNF.mjs.map +0 -1
  91. package/dist/chunk-YIRPPMCN.mjs.map +0 -1
  92. package/dist/common/ai/llm/core/index.d.mts +0 -70
  93. package/dist/common/ai/llm/core/index.d.ts +0 -70
  94. package/dist/common/ai/llm/core/index.js +0 -54
  95. package/dist/common/ai/llm/core/index.mjs +0 -5
  96. package/dist/common/ai/llm/electron/index.d.mts +0 -6
  97. package/dist/common/ai/llm/electron/index.d.ts +0 -6
  98. package/dist/common/ai/llm/electron/index.js +0 -67
  99. package/dist/common/ai/llm/electron/index.mjs +0 -10
  100. package/dist/common/ai/llm/index.d.mts +0 -3
  101. package/dist/common/ai/llm/index.d.ts +0 -3
  102. package/dist/common/ai/llm/index.js +0 -54
  103. package/dist/common/ai/llm/index.js.map +0 -1
  104. package/dist/common/ai/llm/index.mjs +0 -5
  105. package/dist/common/ai/llm/index.mjs.map +0 -1
  106. package/dist/common/ai/llm/miniapp/index.d.mts +0 -6
  107. package/dist/common/ai/llm/miniapp/index.d.ts +0 -6
  108. package/dist/common/ai/llm/miniapp/index.js +0 -59
  109. package/dist/common/ai/llm/miniapp/index.js.map +0 -1
  110. package/dist/common/ai/llm/miniapp/index.mjs +0 -6
  111. package/dist/common/ai/llm/miniapp/index.mjs.map +0 -1
  112. package/dist/common/ai/llm/rn/index.d.mts +0 -6
  113. package/dist/common/ai/llm/rn/index.d.ts +0 -6
  114. package/dist/common/ai/llm/rn/index.js +0 -59
  115. package/dist/common/ai/llm/rn/index.js.map +0 -1
  116. package/dist/common/ai/llm/rn/index.mjs +0 -6
  117. package/dist/common/ai/llm/rn/index.mjs.map +0 -1
  118. package/dist/common/ai/llm/ui/electron/index.d.mts +0 -5
  119. package/dist/common/ai/llm/ui/electron/index.d.ts +0 -5
  120. package/dist/common/ai/llm/ui/electron/index.js +0 -22
  121. package/dist/common/ai/llm/ui/electron/index.js.map +0 -1
  122. package/dist/common/ai/llm/ui/electron/index.mjs +0 -9
  123. package/dist/common/ai/llm/ui/electron/index.mjs.map +0 -1
  124. package/dist/common/ai/llm/ui/miniapp/index.d.mts +0 -9
  125. package/dist/common/ai/llm/ui/miniapp/index.d.ts +0 -9
  126. package/dist/common/ai/llm/ui/miniapp/index.js +0 -14
  127. package/dist/common/ai/llm/ui/miniapp/index.js.map +0 -1
  128. package/dist/common/ai/llm/ui/miniapp/index.mjs +0 -5
  129. package/dist/common/ai/llm/ui/miniapp/index.mjs.map +0 -1
  130. package/dist/common/ai/llm/ui/rn/index.d.mts +0 -9
  131. package/dist/common/ai/llm/ui/rn/index.d.ts +0 -9
  132. package/dist/common/ai/llm/ui/rn/index.js +0 -14
  133. package/dist/common/ai/llm/ui/rn/index.js.map +0 -1
  134. package/dist/common/ai/llm/ui/rn/index.mjs +0 -5
  135. package/dist/common/ai/llm/ui/rn/index.mjs.map +0 -1
  136. package/dist/common/ai/llm/ui/web/index.d.mts +0 -15
  137. package/dist/common/ai/llm/ui/web/index.d.ts +0 -15
  138. package/dist/common/ai/llm/ui/web/index.js +0 -21
  139. package/dist/common/ai/llm/ui/web/index.js.map +0 -1
  140. package/dist/common/ai/llm/ui/web/index.mjs +0 -8
  141. package/dist/common/ai/llm/ui/web/index.mjs.map +0 -1
  142. package/dist/common/ai/llm/web/index.d.mts +0 -6
  143. package/dist/common/ai/llm/web/index.d.ts +0 -6
  144. package/dist/common/ai/llm/web/index.js +0 -66
  145. package/dist/common/ai/llm/web/index.js.map +0 -1
  146. package/dist/common/ai/llm/web/index.mjs +0 -9
  147. package/dist/common/ai/llm/web/index.mjs.map +0 -1
  148. package/dist/index-BMgdH5dL.d.mts +0 -1716
  149. package/dist/index-IXMAeTtN.d.ts +0 -1716
  150. package/dist/types-B2rs_jq1.d.mts +0 -38
  151. package/dist/types-DgACCUpT.d.ts +0 -122
  152. package/dist/types-DwS2Eg0q.d.ts +0 -38
  153. package/dist/types-LU_BGSzk.d.mts +0 -122
  154. /package/dist/common/{ai/llm/core → aiApi}/index.js.map +0 -0
  155. /package/dist/common/{ai/llm/core → aiApi}/index.mjs.map +0 -0
  156. /package/dist/common/{ai/llm/electron → aiApi/server}/index.js.map +0 -0
  157. /package/dist/common/{ai/llm/electron → aiApi/server}/index.mjs.map +0 -0
@@ -0,0 +1,166 @@
1
+ /** 音频处理策略:native=chat 内嵌音频,stt=先转写再 chat,auto=按模型能力自动选择(失败时 STT 回退) */
2
+ type AudioStrategy = 'native' | 'stt' | 'auto';
3
+ /** 连接配置(调用方可显式传入,或与 env 合并) */
4
+ interface AiConnectionSettings {
5
+ apiKey: string;
6
+ baseUrl: string;
7
+ model?: string;
8
+ textModel?: string;
9
+ visionModel?: string;
10
+ audioModel?: string;
11
+ audioStrategy?: AudioStrategy;
12
+ timeoutMs?: number;
13
+ maxImageBytes?: number;
14
+ maxAudioBytes?: number;
15
+ }
16
+ /** 客户端/请求可携带的 AI 连接配置(字段均可选,用于覆盖环境变量) */
17
+ type AiClientSettings = Partial<AiConnectionSettings>;
18
+ /** 解析后的完整连接配置 */
19
+ interface AiConnectionConfig extends AiConnectionSettings {
20
+ textModel: string;
21
+ visionModel: string;
22
+ audioModel: string;
23
+ audioStrategy: AudioStrategy;
24
+ timeoutMs: number;
25
+ maxImageBytes: number;
26
+ maxAudioBytes: number;
27
+ }
28
+ /** 统一 AI 任务请求 */
29
+ interface AiApiRunRequest<TInput = unknown> {
30
+ taskId: string;
31
+ input: TInput;
32
+ options?: AiTaskRunOptions;
33
+ clientSettings?: AiClientSettings;
34
+ }
35
+ interface AiTaskRunOptions {
36
+ model?: string;
37
+ temperature?: number;
38
+ maxTokens?: number;
39
+ }
40
+ /** 统一 AI 任务响应 */
41
+ interface AiApiResponse<TData = unknown> {
42
+ success: boolean;
43
+ taskId: string;
44
+ data?: TData;
45
+ error?: AiApiErrorBody;
46
+ meta?: AiApiResponseMeta;
47
+ }
48
+ interface AiApiErrorBody {
49
+ code: AiApiErrorCode;
50
+ message: string;
51
+ details?: unknown;
52
+ }
53
+ type AiApiErrorCode = 'UNAUTHORIZED' | 'INVALID_INPUT' | 'TASK_NOT_FOUND' | 'AI_CONFIG_MISSING' | 'AI_REQUEST_FAILED' | 'AI_PARSE_FAILED' | 'PAYLOAD_TOO_LARGE' | 'UNSUPPORTED_MEDIA';
54
+ interface AiApiResponseMeta {
55
+ model: string;
56
+ latencyMs: number;
57
+ provider?: string;
58
+ confidence?: number;
59
+ rawSummary?: string;
60
+ }
61
+ /** 多模态图片输入(base64) */
62
+ interface AiImageInput {
63
+ base64: string;
64
+ mimeType: string;
65
+ }
66
+ /** 多模态音频输入(base64) */
67
+ interface AiAudioInput {
68
+ base64: string;
69
+ mimeType: string;
70
+ }
71
+ type AiMediaKind = 'image' | 'audio';
72
+ interface AiImageMediaInput extends AiImageInput {
73
+ kind: 'image';
74
+ }
75
+ interface AiAudioMediaInput extends AiAudioInput {
76
+ kind: 'audio';
77
+ }
78
+ type AiMediaInput = AiImageMediaInput | AiAudioMediaInput;
79
+ /** 通用文本补全任务输入 */
80
+ interface TextCompletionInput {
81
+ systemPrompt?: string;
82
+ userPrompt: string;
83
+ model?: string;
84
+ temperature?: number;
85
+ maxTokens?: number;
86
+ /** 显式连接配置,优先级高于 clientSettings / 环境变量 */
87
+ connection?: AiClientSettings;
88
+ }
89
+ /** 通用文本补全任务输出 */
90
+ interface TextCompletionOutput {
91
+ content: string;
92
+ rawText: string;
93
+ }
94
+ /** 通用结构化多模态任务输入 */
95
+ interface StructuredMultimodalInput {
96
+ systemPrompt: string;
97
+ userPrompt: string;
98
+ media?: AiMediaInput[];
99
+ jsonSchemaHint?: string;
100
+ model?: string;
101
+ temperature?: number;
102
+ maxTokens?: number;
103
+ audioStrategy?: AudioStrategy;
104
+ connection?: AiClientSettings;
105
+ }
106
+ /** 通用结构化多模态任务输出 */
107
+ interface StructuredMultimodalOutput {
108
+ json: Record<string, unknown>;
109
+ rawText: string;
110
+ }
111
+ declare const CORE_LLM_COMPLETION_TASK_ID = "core.llmCompletion";
112
+ declare const CORE_STRUCTURED_MULTIMODAL_TASK_ID = "core.structuredMultimodal";
113
+ declare const CORE_CONNECTIVITY_TEST_TASK_ID = "core.connectivityTest";
114
+ interface ConnectivityTestOutput {
115
+ ok: boolean;
116
+ reply: string;
117
+ }
118
+ interface AiModelsListRequest {
119
+ clientSettings?: AiClientSettings;
120
+ }
121
+ interface AiModelsListResponse {
122
+ success: boolean;
123
+ models: string[];
124
+ visionModels: string[];
125
+ suggestedVisionModel?: string;
126
+ error?: {
127
+ code: string;
128
+ message: string;
129
+ };
130
+ }
131
+ interface AiTaskContext {
132
+ requestId?: string;
133
+ userId?: string | number;
134
+ clientSettings?: AiClientSettings;
135
+ }
136
+ interface AiTaskDefinition<TInput = unknown, TOutput = unknown> {
137
+ id: string;
138
+ description?: string;
139
+ validateInput: (input: unknown) => TInput;
140
+ execute: (input: TInput, ctx: AiTaskContext) => Promise<{
141
+ data: TOutput;
142
+ meta?: Partial<AiApiResponseMeta>;
143
+ }>;
144
+ }
145
+ interface MultimodalChatParams {
146
+ systemPrompt: string;
147
+ userPrompt: string;
148
+ media?: AiMediaInput[];
149
+ model?: string;
150
+ temperature?: number;
151
+ maxTokens?: number;
152
+ jsonMode?: boolean;
153
+ audioStrategy?: AudioStrategy;
154
+ connection?: AiClientSettings;
155
+ }
156
+ interface MultimodalChatResult {
157
+ content: string;
158
+ model: string;
159
+ raw: unknown;
160
+ /** auto/native/stt 实际采用的音频处理方式 */
161
+ audioHandling?: 'none' | 'native' | 'stt';
162
+ /** STT 或 native 失败回退时的转写文本 */
163
+ transcriptions?: string[];
164
+ }
165
+
166
+ export { type AiClientSettings as A, type ConnectivityTestOutput as C, type MultimodalChatParams as M, type StructuredMultimodalInput as S, type TextCompletionInput as T, type AiApiResponse as a, type AiModelsListResponse as b, type AudioStrategy as c, type AiConnectionConfig as d, type MultimodalChatResult as e, type AiImageInput as f, type AiAudioInput as g, type AiMediaInput as h, type AiTaskDefinition as i, type AiTaskContext as j, type TextCompletionOutput as k, type StructuredMultimodalOutput as l, type AiConnectionSettings as m, type AiApiRunRequest as n, type AiTaskRunOptions as o, type AiApiErrorBody as p, type AiApiErrorCode as q, type AiApiResponseMeta as r, type AiMediaKind as s, type AiImageMediaInput as t, type AiAudioMediaInput as u, CORE_LLM_COMPLETION_TASK_ID as v, CORE_STRUCTURED_MULTIMODAL_TASK_ID as w, CORE_CONNECTIVITY_TEST_TASK_ID as x, type AiModelsListRequest as y };
@@ -0,0 +1,166 @@
1
+ /** 音频处理策略:native=chat 内嵌音频,stt=先转写再 chat,auto=按模型能力自动选择(失败时 STT 回退) */
2
+ type AudioStrategy = 'native' | 'stt' | 'auto';
3
+ /** 连接配置(调用方可显式传入,或与 env 合并) */
4
+ interface AiConnectionSettings {
5
+ apiKey: string;
6
+ baseUrl: string;
7
+ model?: string;
8
+ textModel?: string;
9
+ visionModel?: string;
10
+ audioModel?: string;
11
+ audioStrategy?: AudioStrategy;
12
+ timeoutMs?: number;
13
+ maxImageBytes?: number;
14
+ maxAudioBytes?: number;
15
+ }
16
+ /** 客户端/请求可携带的 AI 连接配置(字段均可选,用于覆盖环境变量) */
17
+ type AiClientSettings = Partial<AiConnectionSettings>;
18
+ /** 解析后的完整连接配置 */
19
+ interface AiConnectionConfig extends AiConnectionSettings {
20
+ textModel: string;
21
+ visionModel: string;
22
+ audioModel: string;
23
+ audioStrategy: AudioStrategy;
24
+ timeoutMs: number;
25
+ maxImageBytes: number;
26
+ maxAudioBytes: number;
27
+ }
28
+ /** 统一 AI 任务请求 */
29
+ interface AiApiRunRequest<TInput = unknown> {
30
+ taskId: string;
31
+ input: TInput;
32
+ options?: AiTaskRunOptions;
33
+ clientSettings?: AiClientSettings;
34
+ }
35
+ interface AiTaskRunOptions {
36
+ model?: string;
37
+ temperature?: number;
38
+ maxTokens?: number;
39
+ }
40
+ /** 统一 AI 任务响应 */
41
+ interface AiApiResponse<TData = unknown> {
42
+ success: boolean;
43
+ taskId: string;
44
+ data?: TData;
45
+ error?: AiApiErrorBody;
46
+ meta?: AiApiResponseMeta;
47
+ }
48
+ interface AiApiErrorBody {
49
+ code: AiApiErrorCode;
50
+ message: string;
51
+ details?: unknown;
52
+ }
53
+ type AiApiErrorCode = 'UNAUTHORIZED' | 'INVALID_INPUT' | 'TASK_NOT_FOUND' | 'AI_CONFIG_MISSING' | 'AI_REQUEST_FAILED' | 'AI_PARSE_FAILED' | 'PAYLOAD_TOO_LARGE' | 'UNSUPPORTED_MEDIA';
54
+ interface AiApiResponseMeta {
55
+ model: string;
56
+ latencyMs: number;
57
+ provider?: string;
58
+ confidence?: number;
59
+ rawSummary?: string;
60
+ }
61
+ /** 多模态图片输入(base64) */
62
+ interface AiImageInput {
63
+ base64: string;
64
+ mimeType: string;
65
+ }
66
+ /** 多模态音频输入(base64) */
67
+ interface AiAudioInput {
68
+ base64: string;
69
+ mimeType: string;
70
+ }
71
+ type AiMediaKind = 'image' | 'audio';
72
+ interface AiImageMediaInput extends AiImageInput {
73
+ kind: 'image';
74
+ }
75
+ interface AiAudioMediaInput extends AiAudioInput {
76
+ kind: 'audio';
77
+ }
78
+ type AiMediaInput = AiImageMediaInput | AiAudioMediaInput;
79
+ /** 通用文本补全任务输入 */
80
+ interface TextCompletionInput {
81
+ systemPrompt?: string;
82
+ userPrompt: string;
83
+ model?: string;
84
+ temperature?: number;
85
+ maxTokens?: number;
86
+ /** 显式连接配置,优先级高于 clientSettings / 环境变量 */
87
+ connection?: AiClientSettings;
88
+ }
89
+ /** 通用文本补全任务输出 */
90
+ interface TextCompletionOutput {
91
+ content: string;
92
+ rawText: string;
93
+ }
94
+ /** 通用结构化多模态任务输入 */
95
+ interface StructuredMultimodalInput {
96
+ systemPrompt: string;
97
+ userPrompt: string;
98
+ media?: AiMediaInput[];
99
+ jsonSchemaHint?: string;
100
+ model?: string;
101
+ temperature?: number;
102
+ maxTokens?: number;
103
+ audioStrategy?: AudioStrategy;
104
+ connection?: AiClientSettings;
105
+ }
106
+ /** 通用结构化多模态任务输出 */
107
+ interface StructuredMultimodalOutput {
108
+ json: Record<string, unknown>;
109
+ rawText: string;
110
+ }
111
+ declare const CORE_LLM_COMPLETION_TASK_ID = "core.llmCompletion";
112
+ declare const CORE_STRUCTURED_MULTIMODAL_TASK_ID = "core.structuredMultimodal";
113
+ declare const CORE_CONNECTIVITY_TEST_TASK_ID = "core.connectivityTest";
114
+ interface ConnectivityTestOutput {
115
+ ok: boolean;
116
+ reply: string;
117
+ }
118
+ interface AiModelsListRequest {
119
+ clientSettings?: AiClientSettings;
120
+ }
121
+ interface AiModelsListResponse {
122
+ success: boolean;
123
+ models: string[];
124
+ visionModels: string[];
125
+ suggestedVisionModel?: string;
126
+ error?: {
127
+ code: string;
128
+ message: string;
129
+ };
130
+ }
131
+ interface AiTaskContext {
132
+ requestId?: string;
133
+ userId?: string | number;
134
+ clientSettings?: AiClientSettings;
135
+ }
136
+ interface AiTaskDefinition<TInput = unknown, TOutput = unknown> {
137
+ id: string;
138
+ description?: string;
139
+ validateInput: (input: unknown) => TInput;
140
+ execute: (input: TInput, ctx: AiTaskContext) => Promise<{
141
+ data: TOutput;
142
+ meta?: Partial<AiApiResponseMeta>;
143
+ }>;
144
+ }
145
+ interface MultimodalChatParams {
146
+ systemPrompt: string;
147
+ userPrompt: string;
148
+ media?: AiMediaInput[];
149
+ model?: string;
150
+ temperature?: number;
151
+ maxTokens?: number;
152
+ jsonMode?: boolean;
153
+ audioStrategy?: AudioStrategy;
154
+ connection?: AiClientSettings;
155
+ }
156
+ interface MultimodalChatResult {
157
+ content: string;
158
+ model: string;
159
+ raw: unknown;
160
+ /** auto/native/stt 实际采用的音频处理方式 */
161
+ audioHandling?: 'none' | 'native' | 'stt';
162
+ /** STT 或 native 失败回退时的转写文本 */
163
+ transcriptions?: string[];
164
+ }
165
+
166
+ export { type AiClientSettings as A, type ConnectivityTestOutput as C, type MultimodalChatParams as M, type StructuredMultimodalInput as S, type TextCompletionInput as T, type AiApiResponse as a, type AiModelsListResponse as b, type AudioStrategy as c, type AiConnectionConfig as d, type MultimodalChatResult as e, type AiImageInput as f, type AiAudioInput as g, type AiMediaInput as h, type AiTaskDefinition as i, type AiTaskContext as j, type TextCompletionOutput as k, type StructuredMultimodalOutput as l, type AiConnectionSettings as m, type AiApiRunRequest as n, type AiTaskRunOptions as o, type AiApiErrorBody as p, type AiApiErrorCode as q, type AiApiResponseMeta as r, type AiMediaKind as s, type AiImageMediaInput as t, type AiAudioMediaInput as u, CORE_LLM_COMPLETION_TASK_ID as v, CORE_STRUCTURED_MULTIMODAL_TASK_ID as w, CORE_CONNECTIVITY_TEST_TASK_ID as x, type AiModelsListRequest as y };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sa2kit",
3
- "version": "3.4.0",
3
+ "version": "3.7.0",
4
4
  "description": "SA2Kit 2.0 — common API 稳定;business 实验田模块逐步迁出 profile-v1",
5
5
  "keywords": [
6
6
  "react",
@@ -163,16 +163,6 @@
163
163
  "import": "./dist/business/audioDetection/index.mjs",
164
164
  "require": "./dist/business/audioDetection/index.js"
165
165
  },
166
- "./business/calendar": {
167
- "types": "./dist/business/calendar/index.d.ts",
168
- "import": "./dist/business/calendar/index.mjs",
169
- "require": "./dist/business/calendar/index.js"
170
- },
171
- "./business/calendar/routes": {
172
- "types": "./dist/business/calendar/routes/index.d.ts",
173
- "import": "./dist/business/calendar/routes/index.mjs",
174
- "require": "./dist/business/calendar/routes/index.js"
175
- },
176
166
  "./business/festivalCard": {
177
167
  "types": "./dist/business/festivalCard/index.d.ts",
178
168
  "import": "./dist/business/festivalCard/index.mjs",
@@ -288,55 +278,20 @@
288
278
  "import": "./dist/business/vocaloidBooth/web/index.mjs",
289
279
  "require": "./dist/business/vocaloidBooth/web/index.js"
290
280
  },
291
- "./common/ai/llm/core": {
292
- "types": "./dist/common/ai/llm/core/index.d.ts",
293
- "import": "./dist/common/ai/llm/core/index.mjs",
294
- "require": "./dist/common/ai/llm/core/index.js"
295
- },
296
- "./common/ai/llm/electron": {
297
- "types": "./dist/common/ai/llm/electron/index.d.ts",
298
- "import": "./dist/common/ai/llm/electron/index.mjs",
299
- "require": "./dist/common/ai/llm/electron/index.js"
300
- },
301
- "./common/ai/llm": {
302
- "types": "./dist/common/ai/llm/index.d.ts",
303
- "import": "./dist/common/ai/llm/index.mjs",
304
- "require": "./dist/common/ai/llm/index.js"
305
- },
306
- "./common/ai/llm/miniapp": {
307
- "types": "./dist/common/ai/llm/miniapp/index.d.ts",
308
- "import": "./dist/common/ai/llm/miniapp/index.mjs",
309
- "require": "./dist/common/ai/llm/miniapp/index.js"
310
- },
311
- "./common/ai/llm/rn": {
312
- "types": "./dist/common/ai/llm/rn/index.d.ts",
313
- "import": "./dist/common/ai/llm/rn/index.mjs",
314
- "require": "./dist/common/ai/llm/rn/index.js"
315
- },
316
- "./common/ai/llm/ui/electron": {
317
- "types": "./dist/common/ai/llm/ui/electron/index.d.ts",
318
- "import": "./dist/common/ai/llm/ui/electron/index.mjs",
319
- "require": "./dist/common/ai/llm/ui/electron/index.js"
320
- },
321
- "./common/ai/llm/ui/miniapp": {
322
- "types": "./dist/common/ai/llm/ui/miniapp/index.d.ts",
323
- "import": "./dist/common/ai/llm/ui/miniapp/index.mjs",
324
- "require": "./dist/common/ai/llm/ui/miniapp/index.js"
325
- },
326
- "./common/ai/llm/ui/rn": {
327
- "types": "./dist/common/ai/llm/ui/rn/index.d.ts",
328
- "import": "./dist/common/ai/llm/ui/rn/index.mjs",
329
- "require": "./dist/common/ai/llm/ui/rn/index.js"
330
- },
331
- "./common/ai/llm/ui/web": {
332
- "types": "./dist/common/ai/llm/ui/web/index.d.ts",
333
- "import": "./dist/common/ai/llm/ui/web/index.mjs",
334
- "require": "./dist/common/ai/llm/ui/web/index.js"
335
- },
336
- "./common/ai/llm/web": {
337
- "types": "./dist/common/ai/llm/web/index.d.ts",
338
- "import": "./dist/common/ai/llm/web/index.mjs",
339
- "require": "./dist/common/ai/llm/web/index.js"
281
+ "./common/aiApi/client": {
282
+ "types": "./dist/common/aiApi/client/index.d.ts",
283
+ "import": "./dist/common/aiApi/client/index.mjs",
284
+ "require": "./dist/common/aiApi/client/index.js"
285
+ },
286
+ "./common/aiApi": {
287
+ "types": "./dist/common/aiApi/index.d.ts",
288
+ "import": "./dist/common/aiApi/index.mjs",
289
+ "require": "./dist/common/aiApi/index.js"
290
+ },
291
+ "./common/aiApi/server": {
292
+ "types": "./dist/common/aiApi/server/index.d.ts",
293
+ "import": "./dist/common/aiApi/server/index.mjs",
294
+ "require": "./dist/common/aiApi/server/index.js"
340
295
  },
341
296
  "./common/analytics/server": {
342
297
  "types": "./dist/common/analytics/server/index.d.ts",
@@ -1,41 +0,0 @@
1
- import React__default from 'react';
2
-
3
- interface TimelineItem {
4
- date: string;
5
- title: string;
6
- description: string;
7
- }
8
- interface TimelineConfig {
9
- items: TimelineItem[];
10
- }
11
- interface TimelineProps {
12
- items?: TimelineItem[];
13
- }
14
- declare const Timeline: React__default.FC<TimelineProps>;
15
-
16
- interface Ball {
17
- x: number;
18
- y: number;
19
- vx: number;
20
- vy: number;
21
- radius: number;
22
- color: string;
23
- text?: string;
24
- isDragging?: boolean;
25
- }
26
- interface CollisionBallsConfig {
27
- balls: {
28
- id: string;
29
- label: string;
30
- color: string;
31
- size: number;
32
- }[];
33
- width: number;
34
- height: number;
35
- }
36
- interface CollisionBallsProps {
37
- collisionBallsConfig: CollisionBallsConfig;
38
- }
39
- declare const CollisionBalls: React__default.FC<CollisionBallsProps>;
40
-
41
- export { type Ball as B, type CollisionBallsConfig as C, type TimelineConfig as T, type TimelineItem as a, CollisionBalls as b, Timeline as c };
@@ -1,41 +0,0 @@
1
- import React__default from 'react';
2
-
3
- interface TimelineItem {
4
- date: string;
5
- title: string;
6
- description: string;
7
- }
8
- interface TimelineConfig {
9
- items: TimelineItem[];
10
- }
11
- interface TimelineProps {
12
- items?: TimelineItem[];
13
- }
14
- declare const Timeline: React__default.FC<TimelineProps>;
15
-
16
- interface Ball {
17
- x: number;
18
- y: number;
19
- vx: number;
20
- vy: number;
21
- radius: number;
22
- color: string;
23
- text?: string;
24
- isDragging?: boolean;
25
- }
26
- interface CollisionBallsConfig {
27
- balls: {
28
- id: string;
29
- label: string;
30
- color: string;
31
- size: number;
32
- }[];
33
- width: number;
34
- height: number;
35
- }
36
- interface CollisionBallsProps {
37
- collisionBallsConfig: CollisionBallsConfig;
38
- }
39
- declare const CollisionBalls: React__default.FC<CollisionBallsProps>;
40
-
41
- export { type Ball as B, type CollisionBallsConfig as C, type TimelineConfig as T, type TimelineItem as a, CollisionBalls as b, Timeline as c };
@@ -1,6 +0,0 @@
1
- export { D as AlertDialog, A as AlertDialogAction, c as AlertDialogCancel, d as AlertDialogContent, e as AlertDialogDescription, f as AlertDialogFooter, g as AlertDialogHeader, h as AlertDialogOverlay, j as AlertDialogPortal, k as AlertDialogTitle, l as AlertDialogTrigger, b9 as ApiResponse, m as Avatar, n as AvatarFallback, o as AvatarImage, B as BackButton, p as BackButtonProps, q as Badge, r as BadgeProps, bR as BaseEventData, s as Button, t as ButtonProps, aT as CALENDAR_MODULE_NAME, aS as CALENDAR_MODULE_VERSION, bi as CalendarActions, bm as CalendarCell, bo as CalendarConfig, bq as CalendarDbService, aU as CalendarEvent, bE as CalendarExportService, bG as CalendarImportService, ct as CalendarPage, bp as CalendarService, bh as CalendarState, bc as CalendarViewProps, a_ as CalendarViewType, C as Card, u as CardContent, v as CardDescription, w as CardFooter, x as CardHeader, y as CardTitle, z as ConfirmModal, E as ConfirmModalProps, b5 as CreateEventRequest, bl as DateRange, b7 as DeleteEventRequest, D as Dialog, F as DialogClose, H as DialogContent, I as DialogContentProps, e as DialogDescription, f as DialogFooter, g as DialogHeader, h as DialogOverlay, j as DialogPortal, k as DialogTitle, l as DialogTrigger, bD as DragState, J as DropdownMenu, K as DropdownMenuCheckboxItem, L as DropdownMenuContent, M as DropdownMenuGroup, N as DropdownMenuItem, O as DropdownMenuLabel, P as DropdownMenuPortal, Q as DropdownMenuRadioGroup, R as DropdownMenuRadioItem, S as DropdownMenuSeparator, T as DropdownMenuShortcut, U as DropdownMenuSub, V as DropdownMenuSubContent, W as DropdownMenuSubTrigger, X as DropdownMenuTrigger, bd as EventCardProps, a$ as EventColor, bV as EventData, cu as EventDetailPage, b1 as EventFormData, be as EventFormProps, bw as EventListConfig, bt as EventListDisplayMode, bv as EventListFilter, bx as EventListProps, bu as EventListSort, bf as EventModalProps, b0 as EventPriority, bb as EventResponse, br as EventSortField, bP as EventType, bX as EventTypeService, ba as EventsResponse, bF as ExportOptions, Y as FilterButtonGroup, Z as FilterButtonGroupProps, _ as FilterOption, bW as GeneratedEvent, $ as GenericOrderManager, a0 as GenericOrderManagerProps, b8 as GetEventsRequest, a1 as Grid, a as GridColumns, b as GridGap, G as GridItem, a2 as GridProps, a3 as ImageMappingItem, a4 as ImageMappingPanel, a5 as ImageMappingPanelProps, a6 as ImageMappingValue, bH as ImportOptions, bI as ImportResult, a7 as Input, a8 as Label, a9 as LocalImageMappingPanel, aa as LocalImageMappingPanelProps, bg as MiniCalendarProps, ab as Modal, ac as ModalProps, bT as MultiDayEventData, ad as OrderManagerOperations, ae as OrderableItem, af as Popover, ag as PopoverAnchor, ah as PopoverContent, ai as PopoverTrigger, aj as Progress, ak as ProgressProps, b2 as RecurrenceFormData, bQ as RecurrencePattern, aV as RecurrenceRule, bK as RecurrenceRuleType, bJ as RecurrenceService, aX as RecurrenceType, bU as RecurringEventData, bL as RecurringEventInstance, aW as Reminder, b4 as ReminderApiData, bN as ReminderConfig, b3 as ReminderFormData, bM as ReminderService, aZ as ReminderStatus, aY as ReminderType, bO as ScheduledReminder, al as ScrollArea, am as ScrollBar, an as SearchBox, ao as SearchResultHint, ap as SearchResultHintProps, aq as Select, ar as SelectContent, as as SelectGroup, at as SelectItem, au as SelectLabel, av as SelectScrollDownButton, aw as SelectScrollUpButton, ax as SelectSeparator, ay as SelectTrigger, az as SelectValue, aA as Separator, aB as SeparatorProps, D as Sheet, F as SheetClose, aC as SheetContent, aD as SheetDescription, aE as SheetFooter, aF as SheetHeader, h as SheetOverlay, j as SheetPortal, aG as SheetTitle, l as SheetTrigger, bS as SingleEventData, bs as SortDirection, aH as Tabs, aI as TabsContent, aJ as TabsList, aK as TabsTrigger, aL as Textarea, bn as TimeSlot, aM as Tooltip, aN as TooltipContent, aO as TooltipProvider, aP as TooltipTrigger, b6 as UpdateEventRequest, bj as UseCalendarReturn, bA as UseEnhancedEventsReturn, bC as UseEventDragReturn, bk as UseEventsReturn, cb as addDays, cd as addMonths, cc as addWeeks, ce as addYears, aQ as badgeVariants, aR as buttonVariants, cp as cloneDate, bY as formatDate, b_ as formatDateTime, bZ as formatTime, ch as generateTimeSlots, c5 as getDayEnd, c4 as getDayStart, cj as getDaysDifference, c1 as getMonthEnd, cl as getMonthName, c0 as getMonthStart, cf as getMonthViewDates, cn as getRelativeTime, c3 as getWeekEnd, c2 as getWeekStart, cg as getWeekViewDates, cm as getWeekdayName, cr as isDragSupported, cq as isMobileDevice, c6 as isSameDay, c8 as isSameMonth, c7 as isSameWeek, c9 as isToday, co as isValidDate, ca as isWeekend, ck as isWorkingHour, ci as parseDate, b$ as toLocalISOString, cs as useDeviceType, bz as useEnhancedEvents, bB as useEventDrag, by as useEvents } from '../../index-BMgdH5dL.mjs';
2
- export { B as Ball, b as CollisionBalls, C as CollisionBallsConfig, c as Timeline, T as TimelineConfig, a as TimelineItem } from '../../CollisionBalls-DgKtscU2.mjs';
3
- import 'class-variance-authority/types';
4
- import 'react';
5
- import 'class-variance-authority';
6
- import '@dnd-kit/core';
@@ -1,6 +0,0 @@
1
- export { D as AlertDialog, A as AlertDialogAction, c as AlertDialogCancel, d as AlertDialogContent, e as AlertDialogDescription, f as AlertDialogFooter, g as AlertDialogHeader, h as AlertDialogOverlay, j as AlertDialogPortal, k as AlertDialogTitle, l as AlertDialogTrigger, b9 as ApiResponse, m as Avatar, n as AvatarFallback, o as AvatarImage, B as BackButton, p as BackButtonProps, q as Badge, r as BadgeProps, bR as BaseEventData, s as Button, t as ButtonProps, aT as CALENDAR_MODULE_NAME, aS as CALENDAR_MODULE_VERSION, bi as CalendarActions, bm as CalendarCell, bo as CalendarConfig, bq as CalendarDbService, aU as CalendarEvent, bE as CalendarExportService, bG as CalendarImportService, ct as CalendarPage, bp as CalendarService, bh as CalendarState, bc as CalendarViewProps, a_ as CalendarViewType, C as Card, u as CardContent, v as CardDescription, w as CardFooter, x as CardHeader, y as CardTitle, z as ConfirmModal, E as ConfirmModalProps, b5 as CreateEventRequest, bl as DateRange, b7 as DeleteEventRequest, D as Dialog, F as DialogClose, H as DialogContent, I as DialogContentProps, e as DialogDescription, f as DialogFooter, g as DialogHeader, h as DialogOverlay, j as DialogPortal, k as DialogTitle, l as DialogTrigger, bD as DragState, J as DropdownMenu, K as DropdownMenuCheckboxItem, L as DropdownMenuContent, M as DropdownMenuGroup, N as DropdownMenuItem, O as DropdownMenuLabel, P as DropdownMenuPortal, Q as DropdownMenuRadioGroup, R as DropdownMenuRadioItem, S as DropdownMenuSeparator, T as DropdownMenuShortcut, U as DropdownMenuSub, V as DropdownMenuSubContent, W as DropdownMenuSubTrigger, X as DropdownMenuTrigger, bd as EventCardProps, a$ as EventColor, bV as EventData, cu as EventDetailPage, b1 as EventFormData, be as EventFormProps, bw as EventListConfig, bt as EventListDisplayMode, bv as EventListFilter, bx as EventListProps, bu as EventListSort, bf as EventModalProps, b0 as EventPriority, bb as EventResponse, br as EventSortField, bP as EventType, bX as EventTypeService, ba as EventsResponse, bF as ExportOptions, Y as FilterButtonGroup, Z as FilterButtonGroupProps, _ as FilterOption, bW as GeneratedEvent, $ as GenericOrderManager, a0 as GenericOrderManagerProps, b8 as GetEventsRequest, a1 as Grid, a as GridColumns, b as GridGap, G as GridItem, a2 as GridProps, a3 as ImageMappingItem, a4 as ImageMappingPanel, a5 as ImageMappingPanelProps, a6 as ImageMappingValue, bH as ImportOptions, bI as ImportResult, a7 as Input, a8 as Label, a9 as LocalImageMappingPanel, aa as LocalImageMappingPanelProps, bg as MiniCalendarProps, ab as Modal, ac as ModalProps, bT as MultiDayEventData, ad as OrderManagerOperations, ae as OrderableItem, af as Popover, ag as PopoverAnchor, ah as PopoverContent, ai as PopoverTrigger, aj as Progress, ak as ProgressProps, b2 as RecurrenceFormData, bQ as RecurrencePattern, aV as RecurrenceRule, bK as RecurrenceRuleType, bJ as RecurrenceService, aX as RecurrenceType, bU as RecurringEventData, bL as RecurringEventInstance, aW as Reminder, b4 as ReminderApiData, bN as ReminderConfig, b3 as ReminderFormData, bM as ReminderService, aZ as ReminderStatus, aY as ReminderType, bO as ScheduledReminder, al as ScrollArea, am as ScrollBar, an as SearchBox, ao as SearchResultHint, ap as SearchResultHintProps, aq as Select, ar as SelectContent, as as SelectGroup, at as SelectItem, au as SelectLabel, av as SelectScrollDownButton, aw as SelectScrollUpButton, ax as SelectSeparator, ay as SelectTrigger, az as SelectValue, aA as Separator, aB as SeparatorProps, D as Sheet, F as SheetClose, aC as SheetContent, aD as SheetDescription, aE as SheetFooter, aF as SheetHeader, h as SheetOverlay, j as SheetPortal, aG as SheetTitle, l as SheetTrigger, bS as SingleEventData, bs as SortDirection, aH as Tabs, aI as TabsContent, aJ as TabsList, aK as TabsTrigger, aL as Textarea, bn as TimeSlot, aM as Tooltip, aN as TooltipContent, aO as TooltipProvider, aP as TooltipTrigger, b6 as UpdateEventRequest, bj as UseCalendarReturn, bA as UseEnhancedEventsReturn, bC as UseEventDragReturn, bk as UseEventsReturn, cb as addDays, cd as addMonths, cc as addWeeks, ce as addYears, aQ as badgeVariants, aR as buttonVariants, cp as cloneDate, bY as formatDate, b_ as formatDateTime, bZ as formatTime, ch as generateTimeSlots, c5 as getDayEnd, c4 as getDayStart, cj as getDaysDifference, c1 as getMonthEnd, cl as getMonthName, c0 as getMonthStart, cf as getMonthViewDates, cn as getRelativeTime, c3 as getWeekEnd, c2 as getWeekStart, cg as getWeekViewDates, cm as getWeekdayName, cr as isDragSupported, cq as isMobileDevice, c6 as isSameDay, c8 as isSameMonth, c7 as isSameWeek, c9 as isToday, co as isValidDate, ca as isWeekend, ck as isWorkingHour, ci as parseDate, b$ as toLocalISOString, cs as useDeviceType, bz as useEnhancedEvents, bB as useEventDrag, by as useEvents } from '../../index-IXMAeTtN.js';
2
- export { B as Ball, b as CollisionBalls, C as CollisionBallsConfig, c as Timeline, T as TimelineConfig, a as TimelineItem } from '../../CollisionBalls-DgKtscU2.js';
3
- import 'class-variance-authority/types';
4
- import 'react';
5
- import 'class-variance-authority';
6
- import '@dnd-kit/core';