@weadmin/overseas-tool 0.1.22
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/README.md +452 -0
- package/dist/cli/main.js +5 -0
- package/dist/index.d.ts +1041 -0
- package/dist/index.js +4 -0
- package/dist/package.json +3 -0
- package/dist/runtime-host/main.js +5 -0
- package/package.json +52 -0
- package/workers/applier/applier.js +5 -0
- package/workers/applier/meta.json +11 -0
- package/workers/applier/package.json +3 -0
- package/workers/glossary-translator/glossary-translator.js +5 -0
- package/workers/glossary-translator/meta.json +11 -0
- package/workers/glossary-translator/package.json +3 -0
- package/workers/image-scanner/image-scanner.js +5 -0
- package/workers/image-scanner/meta.json +11 -0
- package/workers/image-scanner/package.json +3 -0
- package/workers/image-translator/image-translator.js +5 -0
- package/workers/image-translator/meta.json +11 -0
- package/workers/image-translator/package.json +3 -0
- package/workers/planner/meta.json +11 -0
- package/workers/planner/package.json +3 -0
- package/workers/planner/planner.js +5 -0
- package/workers/scan-aggregator/meta.json +11 -0
- package/workers/scan-aggregator/package.json +3 -0
- package/workers/scan-aggregator/scan-aggregator.js +5 -0
- package/workers/text-scanner/meta.json +11 -0
- package/workers/text-scanner/package.json +3 -0
- package/workers/text-scanner/text-scanner.js +5 -0
- package/workers/text-translator/meta.json +11 -0
- package/workers/text-translator/package.json +3 -0
- package/workers/text-translator/text-translator.js +5 -0
- package/workers/translation-aggregator/meta.json +11 -0
- package/workers/translation-aggregator/package.json +3 -0
- package/workers/translation-aggregator/translation-aggregator.js +5 -0
- package/workers/verifier/meta.json +11 -0
- package/workers/verifier/package.json +3 -0
- package/workers/verifier/verifier.js +5 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1041 @@
|
|
|
1
|
+
/* overseas-tool | Type declarations | Generated 2026-08-13T08:45:15.871Z */
|
|
2
|
+
import { AgentDefinition } from '@tencent-ai/agent-sdk';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
|
|
5
|
+
export type AppConfig = {
|
|
6
|
+
readonly model: string;
|
|
7
|
+
readonly translateModel: string;
|
|
8
|
+
readonly maxTurns: number;
|
|
9
|
+
readonly mcp: {
|
|
10
|
+
/** cgi 根 URL(不含 /cgi-bin 子路径) */
|
|
11
|
+
readonly url: string;
|
|
12
|
+
readonly appId: string | undefined;
|
|
13
|
+
readonly token: string | undefined;
|
|
14
|
+
/** 凭据齐全时为 true,脚本据此决定是否调用 cgi API */
|
|
15
|
+
readonly enabled: boolean;
|
|
16
|
+
};
|
|
17
|
+
readonly log: {
|
|
18
|
+
readonly level: "trace" | "debug" | "info" | "warn" | "error" | "fatal";
|
|
19
|
+
readonly pretty: boolean;
|
|
20
|
+
/** 用户是否显式设置了 OVERSEAS_LOG_LEVEL(true 表示尊重用户值,禁用静音抬级)。 */
|
|
21
|
+
readonly levelExplicit: boolean;
|
|
22
|
+
/** 解析后的"静音模式"决策:true=屏幕只显示 warn+;false=按 level 显示。 */
|
|
23
|
+
readonly quiet: boolean;
|
|
24
|
+
/** 日志文件绝对路径;undefined 表示禁用文件输出。 */
|
|
25
|
+
readonly file: string | undefined;
|
|
26
|
+
};
|
|
27
|
+
readonly translate: {
|
|
28
|
+
readonly batchSize: number;
|
|
29
|
+
readonly batchTimeoutMs: number;
|
|
30
|
+
readonly retry: number;
|
|
31
|
+
};
|
|
32
|
+
/** 编排器会话无活动超时(毫秒)。SDK/worker 有进展时自动续期。 */
|
|
33
|
+
readonly sessionTimeoutMs: number;
|
|
34
|
+
};
|
|
35
|
+
export declare function loadConfig(): AppConfig;
|
|
36
|
+
export interface McpServerSpec {
|
|
37
|
+
type: "http";
|
|
38
|
+
url: string;
|
|
39
|
+
headers?: Record<string, string>;
|
|
40
|
+
}
|
|
41
|
+
export interface CreateSessionOptions {
|
|
42
|
+
model: string;
|
|
43
|
+
cwd: string;
|
|
44
|
+
systemPrompt: string;
|
|
45
|
+
agents: Record<string, AgentDefinition>;
|
|
46
|
+
mcpServers: Record<string, McpServerSpec>;
|
|
47
|
+
allowedTools: string[];
|
|
48
|
+
maxTurns: number;
|
|
49
|
+
/** 拦截 AskUserQuestion 等工具,默认全部 allow */
|
|
50
|
+
canUseTool?: (toolName: string, input: Record<string, unknown>) => Promise<{
|
|
51
|
+
behavior: "allow";
|
|
52
|
+
updatedInput: Record<string, unknown>;
|
|
53
|
+
} | {
|
|
54
|
+
behavior: "deny";
|
|
55
|
+
message: string;
|
|
56
|
+
}>;
|
|
57
|
+
/**
|
|
58
|
+
* 会话无活动超时(毫秒)。SDK 消息或后台 worker 进度任一仍在更新都会续期;
|
|
59
|
+
* 只有超过该时长完全没有进展才中断,避免超大翻译被总墙钟时长误杀。
|
|
60
|
+
* 不设/<=0 表示不启用超时。
|
|
61
|
+
*/
|
|
62
|
+
sessionTimeoutMs?: number;
|
|
63
|
+
}
|
|
64
|
+
export interface ChatStreamHandlers {
|
|
65
|
+
onSystemReady?: (info: {
|
|
66
|
+
model: string;
|
|
67
|
+
tools?: string[];
|
|
68
|
+
mcp?: string[];
|
|
69
|
+
}) => void;
|
|
70
|
+
onToolStart?: (toolName: string) => void;
|
|
71
|
+
onTextDelta?: (text: string) => void;
|
|
72
|
+
/** Fired when a sub-agent delegation starts or finishes. */
|
|
73
|
+
onAgentDelegate?: (event: {
|
|
74
|
+
kind: "start";
|
|
75
|
+
agent: string;
|
|
76
|
+
} | {
|
|
77
|
+
kind: "done";
|
|
78
|
+
agent: string;
|
|
79
|
+
success: boolean;
|
|
80
|
+
}) => void;
|
|
81
|
+
onResult?: (result: {
|
|
82
|
+
success: boolean;
|
|
83
|
+
durationMs?: number;
|
|
84
|
+
totalCostUsd?: number;
|
|
85
|
+
numTurns?: number;
|
|
86
|
+
subtype?: string;
|
|
87
|
+
}) => void;
|
|
88
|
+
}
|
|
89
|
+
export interface AgentSession {
|
|
90
|
+
readonly sessionId: string;
|
|
91
|
+
send(prompt: string, handlers?: ChatStreamHandlers): Promise<void>;
|
|
92
|
+
interrupt(): Promise<void>;
|
|
93
|
+
close(): void;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* 一次性 query(用于翻译这种纯函数式 AI 调用),返回模型完整 text。
|
|
97
|
+
*/
|
|
98
|
+
export declare function singleQuery(opts: {
|
|
99
|
+
model: string;
|
|
100
|
+
systemPrompt: string;
|
|
101
|
+
userPrompt: string;
|
|
102
|
+
cwd: string;
|
|
103
|
+
maxTurns?: number;
|
|
104
|
+
timeoutMs: number;
|
|
105
|
+
allowedTools?: string[];
|
|
106
|
+
}): Promise<string>;
|
|
107
|
+
declare const localizationStrategySchema: z.ZodEnum<[
|
|
108
|
+
"replace",
|
|
109
|
+
"langpack",
|
|
110
|
+
"both"
|
|
111
|
+
]>;
|
|
112
|
+
export type LocalizationStrategy = z.infer<typeof localizationStrategySchema>;
|
|
113
|
+
declare const approvalModeSchema: z.ZodEnum<[
|
|
114
|
+
"manual",
|
|
115
|
+
"auto"
|
|
116
|
+
]>;
|
|
117
|
+
export type ApprovalMode = z.infer<typeof approvalModeSchema>;
|
|
118
|
+
declare const i18nConfigSchema: z.ZodObject<{
|
|
119
|
+
projectPath: z.ZodString;
|
|
120
|
+
engine: z.ZodDefault<z.ZodEnum<[
|
|
121
|
+
"cocos",
|
|
122
|
+
"unity",
|
|
123
|
+
"laya",
|
|
124
|
+
"native",
|
|
125
|
+
"unknown"
|
|
126
|
+
]>>;
|
|
127
|
+
strategy: z.ZodEnum<[
|
|
128
|
+
"replace",
|
|
129
|
+
"langpack",
|
|
130
|
+
"both"
|
|
131
|
+
]>;
|
|
132
|
+
translateImages: z.ZodDefault<z.ZodBoolean>;
|
|
133
|
+
sourceLang: z.ZodDefault<z.ZodString>;
|
|
134
|
+
targetLangs: z.ZodArray<z.ZodString, "many">;
|
|
135
|
+
createdAt: z.ZodString;
|
|
136
|
+
toolVersion: z.ZodString;
|
|
137
|
+
/**
|
|
138
|
+
* 本轮运行模式:
|
|
139
|
+
* - 'full' :全量。如果 i18n/ 已存在,CLI 会先备份并清空。这是默认值。
|
|
140
|
+
* - 'incremental' :增量。在 i18n/ 已有产物的基础上,由各 worker 脚本走 diff+merge。
|
|
141
|
+
* - 'resume' :续跑。沿用上一轮的 traceId 和配置,从上次中断的阶段继续执行。
|
|
142
|
+
*
|
|
143
|
+
* 关键边界:是否走增量是 CLI / 用户 决策;子 Agent 拿到 runMode='incremental' 后
|
|
144
|
+
* 只能透传给脚本(如 `--mode incremental`),**不允许用 Edit/Write 自己合并 JSON**。
|
|
145
|
+
* 详见 registry.ts 的红线 5.1。
|
|
146
|
+
*/
|
|
147
|
+
runMode: z.ZodDefault<z.ZodEnum<[
|
|
148
|
+
"full",
|
|
149
|
+
"incremental",
|
|
150
|
+
"resume"
|
|
151
|
+
]>>;
|
|
152
|
+
/** 阶段确认策略;缺省为 manual,保证旧配置和旧 CLI 行为不变。 */
|
|
153
|
+
approvalMode: z.ZodDefault<z.ZodEnum<[
|
|
154
|
+
"manual",
|
|
155
|
+
"auto"
|
|
156
|
+
]>>;
|
|
157
|
+
/** 已由用户明确确认的关键阶段。该字段只允许 CLI 宿主更新。 */
|
|
158
|
+
confirmedStages: z.ZodOptional<z.ZodArray<z.ZodUnion<[
|
|
159
|
+
z.ZodLiteral<2>,
|
|
160
|
+
z.ZodLiteral<3>,
|
|
161
|
+
z.ZodLiteral<4>
|
|
162
|
+
]>, "many">>;
|
|
163
|
+
/** 会话 traceId,用于链路追踪。续跑模式下沿用上一轮的 traceId。 */
|
|
164
|
+
traceId: z.ZodOptional<z.ZodString>;
|
|
165
|
+
/** 翻译阶段同时处理的目标语言数;缺省时使用 worker 默认值。 */
|
|
166
|
+
translationLangConcurrency: z.ZodOptional<z.ZodNumber>;
|
|
167
|
+
/** 整个翻译 worker 跨语言共享的 AI 请求总并发上限;缺省时使用 worker 默认值。 */
|
|
168
|
+
translationConcurrency: z.ZodOptional<z.ZodNumber>;
|
|
169
|
+
/** 是否显式允许用 ddmin 定位模型安全拒绝的最小失败集合;缺省即关闭。 */
|
|
170
|
+
enablePoisonDdmin: z.ZodOptional<z.ZodBoolean>;
|
|
171
|
+
/**
|
|
172
|
+
* 当前已完成的最高阶段编号(0~6)。
|
|
173
|
+
* 由编排器在每个阶段完成后更新,续跑时据此判断从哪个阶段继续。
|
|
174
|
+
* undefined / 不存在表示尚未开始任何阶段。
|
|
175
|
+
*/
|
|
176
|
+
currentStage: z.ZodOptional<z.ZodNumber>;
|
|
177
|
+
}, "strip", z.ZodTypeAny, {
|
|
178
|
+
projectPath: string;
|
|
179
|
+
engine: "unknown" | "cocos" | "unity" | "laya" | "native";
|
|
180
|
+
strategy: "replace" | "langpack" | "both";
|
|
181
|
+
translateImages: boolean;
|
|
182
|
+
sourceLang: string;
|
|
183
|
+
targetLangs: string[];
|
|
184
|
+
createdAt: string;
|
|
185
|
+
toolVersion: string;
|
|
186
|
+
runMode: "full" | "incremental" | "resume";
|
|
187
|
+
approvalMode: "auto" | "manual";
|
|
188
|
+
traceId?: string | undefined;
|
|
189
|
+
confirmedStages?: (2 | 3 | 4)[] | undefined;
|
|
190
|
+
translationLangConcurrency?: number | undefined;
|
|
191
|
+
translationConcurrency?: number | undefined;
|
|
192
|
+
enablePoisonDdmin?: boolean | undefined;
|
|
193
|
+
currentStage?: number | undefined;
|
|
194
|
+
}, {
|
|
195
|
+
projectPath: string;
|
|
196
|
+
strategy: "replace" | "langpack" | "both";
|
|
197
|
+
targetLangs: string[];
|
|
198
|
+
createdAt: string;
|
|
199
|
+
toolVersion: string;
|
|
200
|
+
traceId?: string | undefined;
|
|
201
|
+
engine?: "unknown" | "cocos" | "unity" | "laya" | "native" | undefined;
|
|
202
|
+
translateImages?: boolean | undefined;
|
|
203
|
+
sourceLang?: string | undefined;
|
|
204
|
+
runMode?: "full" | "incremental" | "resume" | undefined;
|
|
205
|
+
approvalMode?: "auto" | "manual" | undefined;
|
|
206
|
+
confirmedStages?: (2 | 3 | 4)[] | undefined;
|
|
207
|
+
translationLangConcurrency?: number | undefined;
|
|
208
|
+
translationConcurrency?: number | undefined;
|
|
209
|
+
enablePoisonDdmin?: boolean | undefined;
|
|
210
|
+
currentStage?: number | undefined;
|
|
211
|
+
}>;
|
|
212
|
+
export type I18nConfig = z.infer<typeof i18nConfigSchema>;
|
|
213
|
+
declare const scanReportSchema: z.ZodObject<{
|
|
214
|
+
projectPath: z.ZodString;
|
|
215
|
+
scannedAt: z.ZodString;
|
|
216
|
+
totalFiles: z.ZodNumber;
|
|
217
|
+
textEntries: z.ZodArray<z.ZodObject<{
|
|
218
|
+
key: z.ZodOptional<z.ZodString>;
|
|
219
|
+
value: z.ZodString;
|
|
220
|
+
filePath: z.ZodString;
|
|
221
|
+
line: z.ZodOptional<z.ZodNumber>;
|
|
222
|
+
column: z.ZodOptional<z.ZodNumber>;
|
|
223
|
+
type: z.ZodDefault<z.ZodEnum<[
|
|
224
|
+
"literal",
|
|
225
|
+
"template",
|
|
226
|
+
"concatenation",
|
|
227
|
+
"json",
|
|
228
|
+
"csv",
|
|
229
|
+
"xml",
|
|
230
|
+
"jsx-text",
|
|
231
|
+
"object-key"
|
|
232
|
+
]>>;
|
|
233
|
+
context: z.ZodOptional<z.ZodString>;
|
|
234
|
+
variables: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
235
|
+
originalExpression: z.ZodOptional<z.ZodString>;
|
|
236
|
+
loc: z.ZodOptional<z.ZodUnknown>;
|
|
237
|
+
range: z.ZodOptional<z.ZodUnknown>;
|
|
238
|
+
locations: z.ZodOptional<z.ZodUnknown>;
|
|
239
|
+
}, "strip", z.ZodTypeAny, {
|
|
240
|
+
type: "literal" | "template" | "concatenation" | "json" | "csv" | "xml" | "jsx-text" | "object-key";
|
|
241
|
+
value: string;
|
|
242
|
+
filePath: string;
|
|
243
|
+
key?: string | undefined;
|
|
244
|
+
line?: number | undefined;
|
|
245
|
+
column?: number | undefined;
|
|
246
|
+
context?: string | undefined;
|
|
247
|
+
variables?: string[] | undefined;
|
|
248
|
+
originalExpression?: string | undefined;
|
|
249
|
+
loc?: unknown;
|
|
250
|
+
range?: unknown;
|
|
251
|
+
locations?: unknown;
|
|
252
|
+
}, {
|
|
253
|
+
value: string;
|
|
254
|
+
filePath: string;
|
|
255
|
+
type?: "literal" | "template" | "concatenation" | "json" | "csv" | "xml" | "jsx-text" | "object-key" | undefined;
|
|
256
|
+
key?: string | undefined;
|
|
257
|
+
line?: number | undefined;
|
|
258
|
+
column?: number | undefined;
|
|
259
|
+
context?: string | undefined;
|
|
260
|
+
variables?: string[] | undefined;
|
|
261
|
+
originalExpression?: string | undefined;
|
|
262
|
+
loc?: unknown;
|
|
263
|
+
range?: unknown;
|
|
264
|
+
locations?: unknown;
|
|
265
|
+
}>, "many">;
|
|
266
|
+
totalImages: z.ZodDefault<z.ZodNumber>;
|
|
267
|
+
}, "strip", z.ZodTypeAny, {
|
|
268
|
+
projectPath: string;
|
|
269
|
+
scannedAt: string;
|
|
270
|
+
totalFiles: number;
|
|
271
|
+
textEntries: {
|
|
272
|
+
type: "literal" | "template" | "concatenation" | "json" | "csv" | "xml" | "jsx-text" | "object-key";
|
|
273
|
+
value: string;
|
|
274
|
+
filePath: string;
|
|
275
|
+
key?: string | undefined;
|
|
276
|
+
line?: number | undefined;
|
|
277
|
+
column?: number | undefined;
|
|
278
|
+
context?: string | undefined;
|
|
279
|
+
variables?: string[] | undefined;
|
|
280
|
+
originalExpression?: string | undefined;
|
|
281
|
+
loc?: unknown;
|
|
282
|
+
range?: unknown;
|
|
283
|
+
locations?: unknown;
|
|
284
|
+
}[];
|
|
285
|
+
totalImages: number;
|
|
286
|
+
}, {
|
|
287
|
+
projectPath: string;
|
|
288
|
+
scannedAt: string;
|
|
289
|
+
totalFiles: number;
|
|
290
|
+
textEntries: {
|
|
291
|
+
value: string;
|
|
292
|
+
filePath: string;
|
|
293
|
+
type?: "literal" | "template" | "concatenation" | "json" | "csv" | "xml" | "jsx-text" | "object-key" | undefined;
|
|
294
|
+
key?: string | undefined;
|
|
295
|
+
line?: number | undefined;
|
|
296
|
+
column?: number | undefined;
|
|
297
|
+
context?: string | undefined;
|
|
298
|
+
variables?: string[] | undefined;
|
|
299
|
+
originalExpression?: string | undefined;
|
|
300
|
+
loc?: unknown;
|
|
301
|
+
range?: unknown;
|
|
302
|
+
locations?: unknown;
|
|
303
|
+
}[];
|
|
304
|
+
totalImages?: number | undefined;
|
|
305
|
+
}>;
|
|
306
|
+
export type ScanReport = z.infer<typeof scanReportSchema>;
|
|
307
|
+
declare const glossarySchema: z.ZodObject<{
|
|
308
|
+
targetLang: z.ZodString;
|
|
309
|
+
entries: z.ZodArray<z.ZodObject<{
|
|
310
|
+
source: z.ZodString;
|
|
311
|
+
target: z.ZodString;
|
|
312
|
+
context: z.ZodOptional<z.ZodString>;
|
|
313
|
+
}, "strip", z.ZodTypeAny, {
|
|
314
|
+
source: string;
|
|
315
|
+
target: string;
|
|
316
|
+
context?: string | undefined;
|
|
317
|
+
}, {
|
|
318
|
+
source: string;
|
|
319
|
+
target: string;
|
|
320
|
+
context?: string | undefined;
|
|
321
|
+
}>, "many">;
|
|
322
|
+
}, "strip", z.ZodTypeAny, {
|
|
323
|
+
entries: {
|
|
324
|
+
source: string;
|
|
325
|
+
target: string;
|
|
326
|
+
context?: string | undefined;
|
|
327
|
+
}[];
|
|
328
|
+
targetLang: string;
|
|
329
|
+
}, {
|
|
330
|
+
entries: {
|
|
331
|
+
source: string;
|
|
332
|
+
target: string;
|
|
333
|
+
context?: string | undefined;
|
|
334
|
+
}[];
|
|
335
|
+
targetLang: string;
|
|
336
|
+
}>;
|
|
337
|
+
export type Glossary = z.infer<typeof glossarySchema>;
|
|
338
|
+
declare const translationEntrySchema: z.ZodObject<{
|
|
339
|
+
key: z.ZodOptional<z.ZodString>;
|
|
340
|
+
value: z.ZodString;
|
|
341
|
+
filePath: z.ZodString;
|
|
342
|
+
line: z.ZodOptional<z.ZodNumber>;
|
|
343
|
+
column: z.ZodOptional<z.ZodNumber>;
|
|
344
|
+
type: z.ZodDefault<z.ZodEnum<[
|
|
345
|
+
"literal",
|
|
346
|
+
"template",
|
|
347
|
+
"concatenation",
|
|
348
|
+
"json",
|
|
349
|
+
"csv",
|
|
350
|
+
"xml",
|
|
351
|
+
"jsx-text",
|
|
352
|
+
"object-key"
|
|
353
|
+
]>>;
|
|
354
|
+
context: z.ZodOptional<z.ZodString>;
|
|
355
|
+
variables: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
356
|
+
originalExpression: z.ZodOptional<z.ZodString>;
|
|
357
|
+
loc: z.ZodOptional<z.ZodUnknown>;
|
|
358
|
+
range: z.ZodOptional<z.ZodUnknown>;
|
|
359
|
+
locations: z.ZodOptional<z.ZodUnknown>;
|
|
360
|
+
} & {
|
|
361
|
+
source: z.ZodString;
|
|
362
|
+
target: z.ZodString;
|
|
363
|
+
status: z.ZodEnum<[
|
|
364
|
+
"translated",
|
|
365
|
+
"failed",
|
|
366
|
+
"pending",
|
|
367
|
+
"skipped"
|
|
368
|
+
]>;
|
|
369
|
+
skipReason: z.ZodOptional<z.ZodEnum<[
|
|
370
|
+
"poison-review-removed",
|
|
371
|
+
"user-ignored-anomaly",
|
|
372
|
+
"content-spam-rejected"
|
|
373
|
+
]>>;
|
|
374
|
+
contentSpamCheck: z.ZodOptional<z.ZodObject<{
|
|
375
|
+
verdict: z.ZodEnum<[
|
|
376
|
+
"passed",
|
|
377
|
+
"rejected",
|
|
378
|
+
"unavailable"
|
|
379
|
+
]>;
|
|
380
|
+
result: z.ZodOptional<z.ZodNumber>;
|
|
381
|
+
}, "strip", z.ZodTypeAny, {
|
|
382
|
+
verdict: "passed" | "rejected" | "unavailable";
|
|
383
|
+
result?: number | undefined;
|
|
384
|
+
}, {
|
|
385
|
+
verdict: "passed" | "rejected" | "unavailable";
|
|
386
|
+
result?: number | undefined;
|
|
387
|
+
}>>;
|
|
388
|
+
translatedExpression: z.ZodOptional<z.ZodString>;
|
|
389
|
+
}, "strip", z.ZodTypeAny, {
|
|
390
|
+
type: "literal" | "template" | "concatenation" | "json" | "csv" | "xml" | "jsx-text" | "object-key";
|
|
391
|
+
status: "skipped" | "translated" | "failed" | "pending";
|
|
392
|
+
value: string;
|
|
393
|
+
filePath: string;
|
|
394
|
+
source: string;
|
|
395
|
+
target: string;
|
|
396
|
+
key?: string | undefined;
|
|
397
|
+
line?: number | undefined;
|
|
398
|
+
column?: number | undefined;
|
|
399
|
+
context?: string | undefined;
|
|
400
|
+
variables?: string[] | undefined;
|
|
401
|
+
originalExpression?: string | undefined;
|
|
402
|
+
loc?: unknown;
|
|
403
|
+
range?: unknown;
|
|
404
|
+
locations?: unknown;
|
|
405
|
+
skipReason?: "poison-review-removed" | "user-ignored-anomaly" | "content-spam-rejected" | undefined;
|
|
406
|
+
contentSpamCheck?: {
|
|
407
|
+
verdict: "passed" | "rejected" | "unavailable";
|
|
408
|
+
result?: number | undefined;
|
|
409
|
+
} | undefined;
|
|
410
|
+
translatedExpression?: string | undefined;
|
|
411
|
+
}, {
|
|
412
|
+
status: "skipped" | "translated" | "failed" | "pending";
|
|
413
|
+
value: string;
|
|
414
|
+
filePath: string;
|
|
415
|
+
source: string;
|
|
416
|
+
target: string;
|
|
417
|
+
type?: "literal" | "template" | "concatenation" | "json" | "csv" | "xml" | "jsx-text" | "object-key" | undefined;
|
|
418
|
+
key?: string | undefined;
|
|
419
|
+
line?: number | undefined;
|
|
420
|
+
column?: number | undefined;
|
|
421
|
+
context?: string | undefined;
|
|
422
|
+
variables?: string[] | undefined;
|
|
423
|
+
originalExpression?: string | undefined;
|
|
424
|
+
loc?: unknown;
|
|
425
|
+
range?: unknown;
|
|
426
|
+
locations?: unknown;
|
|
427
|
+
skipReason?: "poison-review-removed" | "user-ignored-anomaly" | "content-spam-rejected" | undefined;
|
|
428
|
+
contentSpamCheck?: {
|
|
429
|
+
verdict: "passed" | "rejected" | "unavailable";
|
|
430
|
+
result?: number | undefined;
|
|
431
|
+
} | undefined;
|
|
432
|
+
translatedExpression?: string | undefined;
|
|
433
|
+
}>;
|
|
434
|
+
export type TranslationEntry = z.infer<typeof translationEntrySchema>;
|
|
435
|
+
declare const textTranslationsSchema: z.ZodObject<{
|
|
436
|
+
targetLang: z.ZodString;
|
|
437
|
+
total: z.ZodNumber;
|
|
438
|
+
sourceTotal: z.ZodOptional<z.ZodNumber>;
|
|
439
|
+
skippedNonChinese: z.ZodOptional<z.ZodNumber>;
|
|
440
|
+
translated: z.ZodNumber;
|
|
441
|
+
failed: z.ZodNumber;
|
|
442
|
+
skippedAnomalous: z.ZodOptional<z.ZodNumber>;
|
|
443
|
+
skippedContentSpam: z.ZodOptional<z.ZodNumber>;
|
|
444
|
+
anomalousBatches: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
445
|
+
batch: z.ZodString;
|
|
446
|
+
reason: z.ZodEnum<[
|
|
447
|
+
"model-refused",
|
|
448
|
+
"ai-call-failed",
|
|
449
|
+
"partial-response"
|
|
450
|
+
]>;
|
|
451
|
+
attempts: z.ZodNumber;
|
|
452
|
+
entryCount: z.ZodNumber;
|
|
453
|
+
entries: z.ZodArray<z.ZodObject<{
|
|
454
|
+
key: z.ZodString;
|
|
455
|
+
source: z.ZodString;
|
|
456
|
+
filePath: z.ZodString;
|
|
457
|
+
line: z.ZodOptional<z.ZodNumber>;
|
|
458
|
+
column: z.ZodOptional<z.ZodNumber>;
|
|
459
|
+
preview: z.ZodString;
|
|
460
|
+
contentSpamCheck: z.ZodOptional<z.ZodObject<{
|
|
461
|
+
verdict: z.ZodEnum<[
|
|
462
|
+
"passed",
|
|
463
|
+
"rejected",
|
|
464
|
+
"unavailable"
|
|
465
|
+
]>;
|
|
466
|
+
result: z.ZodOptional<z.ZodNumber>;
|
|
467
|
+
}, "strip", z.ZodTypeAny, {
|
|
468
|
+
verdict: "passed" | "rejected" | "unavailable";
|
|
469
|
+
result?: number | undefined;
|
|
470
|
+
}, {
|
|
471
|
+
verdict: "passed" | "rejected" | "unavailable";
|
|
472
|
+
result?: number | undefined;
|
|
473
|
+
}>>;
|
|
474
|
+
}, "strip", z.ZodTypeAny, {
|
|
475
|
+
key: string;
|
|
476
|
+
filePath: string;
|
|
477
|
+
source: string;
|
|
478
|
+
preview: string;
|
|
479
|
+
line?: number | undefined;
|
|
480
|
+
column?: number | undefined;
|
|
481
|
+
contentSpamCheck?: {
|
|
482
|
+
verdict: "passed" | "rejected" | "unavailable";
|
|
483
|
+
result?: number | undefined;
|
|
484
|
+
} | undefined;
|
|
485
|
+
}, {
|
|
486
|
+
key: string;
|
|
487
|
+
filePath: string;
|
|
488
|
+
source: string;
|
|
489
|
+
preview: string;
|
|
490
|
+
line?: number | undefined;
|
|
491
|
+
column?: number | undefined;
|
|
492
|
+
contentSpamCheck?: {
|
|
493
|
+
verdict: "passed" | "rejected" | "unavailable";
|
|
494
|
+
result?: number | undefined;
|
|
495
|
+
} | undefined;
|
|
496
|
+
}>, "many">;
|
|
497
|
+
ddminFinding: z.ZodOptional<z.ZodObject<{
|
|
498
|
+
algorithm: z.ZodLiteral<"ddmin">;
|
|
499
|
+
status: z.ZodEnum<[
|
|
500
|
+
"minimal-set-found",
|
|
501
|
+
"probe-budget-exhausted",
|
|
502
|
+
"probe-inconclusive"
|
|
503
|
+
]>;
|
|
504
|
+
probes: z.ZodNumber;
|
|
505
|
+
cacheHits: z.ZodNumber;
|
|
506
|
+
probeBudget: z.ZodNumber;
|
|
507
|
+
initialEntryCount: z.ZodNumber;
|
|
508
|
+
candidateEntryCount: z.ZodNumber;
|
|
509
|
+
entryKeys: z.ZodArray<z.ZodString, "many">;
|
|
510
|
+
}, "strip", z.ZodTypeAny, {
|
|
511
|
+
status: "minimal-set-found" | "probe-budget-exhausted" | "probe-inconclusive";
|
|
512
|
+
algorithm: "ddmin";
|
|
513
|
+
probes: number;
|
|
514
|
+
cacheHits: number;
|
|
515
|
+
probeBudget: number;
|
|
516
|
+
initialEntryCount: number;
|
|
517
|
+
candidateEntryCount: number;
|
|
518
|
+
entryKeys: string[];
|
|
519
|
+
}, {
|
|
520
|
+
status: "minimal-set-found" | "probe-budget-exhausted" | "probe-inconclusive";
|
|
521
|
+
algorithm: "ddmin";
|
|
522
|
+
probes: number;
|
|
523
|
+
cacheHits: number;
|
|
524
|
+
probeBudget: number;
|
|
525
|
+
initialEntryCount: number;
|
|
526
|
+
candidateEntryCount: number;
|
|
527
|
+
entryKeys: string[];
|
|
528
|
+
}>>;
|
|
529
|
+
contentSpamCheck: z.ZodOptional<z.ZodObject<{
|
|
530
|
+
status: z.ZodEnum<[
|
|
531
|
+
"completed",
|
|
532
|
+
"unavailable"
|
|
533
|
+
]>;
|
|
534
|
+
checkedCount: z.ZodNumber;
|
|
535
|
+
passedCount: z.ZodNumber;
|
|
536
|
+
rejectedCount: z.ZodNumber;
|
|
537
|
+
unavailableCount: z.ZodNumber;
|
|
538
|
+
error: z.ZodOptional<z.ZodString>;
|
|
539
|
+
}, "strip", z.ZodTypeAny, {
|
|
540
|
+
status: "unavailable" | "completed";
|
|
541
|
+
checkedCount: number;
|
|
542
|
+
passedCount: number;
|
|
543
|
+
rejectedCount: number;
|
|
544
|
+
unavailableCount: number;
|
|
545
|
+
error?: string | undefined;
|
|
546
|
+
}, {
|
|
547
|
+
status: "unavailable" | "completed";
|
|
548
|
+
checkedCount: number;
|
|
549
|
+
passedCount: number;
|
|
550
|
+
rejectedCount: number;
|
|
551
|
+
unavailableCount: number;
|
|
552
|
+
error?: string | undefined;
|
|
553
|
+
}>>;
|
|
554
|
+
}, "strip", z.ZodTypeAny, {
|
|
555
|
+
entries: {
|
|
556
|
+
key: string;
|
|
557
|
+
filePath: string;
|
|
558
|
+
source: string;
|
|
559
|
+
preview: string;
|
|
560
|
+
line?: number | undefined;
|
|
561
|
+
column?: number | undefined;
|
|
562
|
+
contentSpamCheck?: {
|
|
563
|
+
verdict: "passed" | "rejected" | "unavailable";
|
|
564
|
+
result?: number | undefined;
|
|
565
|
+
} | undefined;
|
|
566
|
+
}[];
|
|
567
|
+
reason: "model-refused" | "ai-call-failed" | "partial-response";
|
|
568
|
+
batch: string;
|
|
569
|
+
attempts: number;
|
|
570
|
+
entryCount: number;
|
|
571
|
+
contentSpamCheck?: {
|
|
572
|
+
status: "unavailable" | "completed";
|
|
573
|
+
checkedCount: number;
|
|
574
|
+
passedCount: number;
|
|
575
|
+
rejectedCount: number;
|
|
576
|
+
unavailableCount: number;
|
|
577
|
+
error?: string | undefined;
|
|
578
|
+
} | undefined;
|
|
579
|
+
ddminFinding?: {
|
|
580
|
+
status: "minimal-set-found" | "probe-budget-exhausted" | "probe-inconclusive";
|
|
581
|
+
algorithm: "ddmin";
|
|
582
|
+
probes: number;
|
|
583
|
+
cacheHits: number;
|
|
584
|
+
probeBudget: number;
|
|
585
|
+
initialEntryCount: number;
|
|
586
|
+
candidateEntryCount: number;
|
|
587
|
+
entryKeys: string[];
|
|
588
|
+
} | undefined;
|
|
589
|
+
}, {
|
|
590
|
+
entries: {
|
|
591
|
+
key: string;
|
|
592
|
+
filePath: string;
|
|
593
|
+
source: string;
|
|
594
|
+
preview: string;
|
|
595
|
+
line?: number | undefined;
|
|
596
|
+
column?: number | undefined;
|
|
597
|
+
contentSpamCheck?: {
|
|
598
|
+
verdict: "passed" | "rejected" | "unavailable";
|
|
599
|
+
result?: number | undefined;
|
|
600
|
+
} | undefined;
|
|
601
|
+
}[];
|
|
602
|
+
reason: "model-refused" | "ai-call-failed" | "partial-response";
|
|
603
|
+
batch: string;
|
|
604
|
+
attempts: number;
|
|
605
|
+
entryCount: number;
|
|
606
|
+
contentSpamCheck?: {
|
|
607
|
+
status: "unavailable" | "completed";
|
|
608
|
+
checkedCount: number;
|
|
609
|
+
passedCount: number;
|
|
610
|
+
rejectedCount: number;
|
|
611
|
+
unavailableCount: number;
|
|
612
|
+
error?: string | undefined;
|
|
613
|
+
} | undefined;
|
|
614
|
+
ddminFinding?: {
|
|
615
|
+
status: "minimal-set-found" | "probe-budget-exhausted" | "probe-inconclusive";
|
|
616
|
+
algorithm: "ddmin";
|
|
617
|
+
probes: number;
|
|
618
|
+
cacheHits: number;
|
|
619
|
+
probeBudget: number;
|
|
620
|
+
initialEntryCount: number;
|
|
621
|
+
candidateEntryCount: number;
|
|
622
|
+
entryKeys: string[];
|
|
623
|
+
} | undefined;
|
|
624
|
+
}>, "many">>;
|
|
625
|
+
entries: z.ZodArray<z.ZodObject<{
|
|
626
|
+
key: z.ZodOptional<z.ZodString>;
|
|
627
|
+
value: z.ZodString;
|
|
628
|
+
filePath: z.ZodString;
|
|
629
|
+
line: z.ZodOptional<z.ZodNumber>;
|
|
630
|
+
column: z.ZodOptional<z.ZodNumber>;
|
|
631
|
+
type: z.ZodDefault<z.ZodEnum<[
|
|
632
|
+
"literal",
|
|
633
|
+
"template",
|
|
634
|
+
"concatenation",
|
|
635
|
+
"json",
|
|
636
|
+
"csv",
|
|
637
|
+
"xml",
|
|
638
|
+
"jsx-text",
|
|
639
|
+
"object-key"
|
|
640
|
+
]>>;
|
|
641
|
+
context: z.ZodOptional<z.ZodString>;
|
|
642
|
+
variables: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
643
|
+
originalExpression: z.ZodOptional<z.ZodString>;
|
|
644
|
+
loc: z.ZodOptional<z.ZodUnknown>;
|
|
645
|
+
range: z.ZodOptional<z.ZodUnknown>;
|
|
646
|
+
locations: z.ZodOptional<z.ZodUnknown>;
|
|
647
|
+
} & {
|
|
648
|
+
source: z.ZodString;
|
|
649
|
+
target: z.ZodString;
|
|
650
|
+
status: z.ZodEnum<[
|
|
651
|
+
"translated",
|
|
652
|
+
"failed",
|
|
653
|
+
"pending",
|
|
654
|
+
"skipped"
|
|
655
|
+
]>;
|
|
656
|
+
skipReason: z.ZodOptional<z.ZodEnum<[
|
|
657
|
+
"poison-review-removed",
|
|
658
|
+
"user-ignored-anomaly",
|
|
659
|
+
"content-spam-rejected"
|
|
660
|
+
]>>;
|
|
661
|
+
contentSpamCheck: z.ZodOptional<z.ZodObject<{
|
|
662
|
+
verdict: z.ZodEnum<[
|
|
663
|
+
"passed",
|
|
664
|
+
"rejected",
|
|
665
|
+
"unavailable"
|
|
666
|
+
]>;
|
|
667
|
+
result: z.ZodOptional<z.ZodNumber>;
|
|
668
|
+
}, "strip", z.ZodTypeAny, {
|
|
669
|
+
verdict: "passed" | "rejected" | "unavailable";
|
|
670
|
+
result?: number | undefined;
|
|
671
|
+
}, {
|
|
672
|
+
verdict: "passed" | "rejected" | "unavailable";
|
|
673
|
+
result?: number | undefined;
|
|
674
|
+
}>>;
|
|
675
|
+
translatedExpression: z.ZodOptional<z.ZodString>;
|
|
676
|
+
}, "strip", z.ZodTypeAny, {
|
|
677
|
+
type: "literal" | "template" | "concatenation" | "json" | "csv" | "xml" | "jsx-text" | "object-key";
|
|
678
|
+
status: "skipped" | "translated" | "failed" | "pending";
|
|
679
|
+
value: string;
|
|
680
|
+
filePath: string;
|
|
681
|
+
source: string;
|
|
682
|
+
target: string;
|
|
683
|
+
key?: string | undefined;
|
|
684
|
+
line?: number | undefined;
|
|
685
|
+
column?: number | undefined;
|
|
686
|
+
context?: string | undefined;
|
|
687
|
+
variables?: string[] | undefined;
|
|
688
|
+
originalExpression?: string | undefined;
|
|
689
|
+
loc?: unknown;
|
|
690
|
+
range?: unknown;
|
|
691
|
+
locations?: unknown;
|
|
692
|
+
skipReason?: "poison-review-removed" | "user-ignored-anomaly" | "content-spam-rejected" | undefined;
|
|
693
|
+
contentSpamCheck?: {
|
|
694
|
+
verdict: "passed" | "rejected" | "unavailable";
|
|
695
|
+
result?: number | undefined;
|
|
696
|
+
} | undefined;
|
|
697
|
+
translatedExpression?: string | undefined;
|
|
698
|
+
}, {
|
|
699
|
+
status: "skipped" | "translated" | "failed" | "pending";
|
|
700
|
+
value: string;
|
|
701
|
+
filePath: string;
|
|
702
|
+
source: string;
|
|
703
|
+
target: string;
|
|
704
|
+
type?: "literal" | "template" | "concatenation" | "json" | "csv" | "xml" | "jsx-text" | "object-key" | undefined;
|
|
705
|
+
key?: string | undefined;
|
|
706
|
+
line?: number | undefined;
|
|
707
|
+
column?: number | undefined;
|
|
708
|
+
context?: string | undefined;
|
|
709
|
+
variables?: string[] | undefined;
|
|
710
|
+
originalExpression?: string | undefined;
|
|
711
|
+
loc?: unknown;
|
|
712
|
+
range?: unknown;
|
|
713
|
+
locations?: unknown;
|
|
714
|
+
skipReason?: "poison-review-removed" | "user-ignored-anomaly" | "content-spam-rejected" | undefined;
|
|
715
|
+
contentSpamCheck?: {
|
|
716
|
+
verdict: "passed" | "rejected" | "unavailable";
|
|
717
|
+
result?: number | undefined;
|
|
718
|
+
} | undefined;
|
|
719
|
+
translatedExpression?: string | undefined;
|
|
720
|
+
}>, "many">;
|
|
721
|
+
}, "strip", z.ZodTypeAny, {
|
|
722
|
+
entries: {
|
|
723
|
+
type: "literal" | "template" | "concatenation" | "json" | "csv" | "xml" | "jsx-text" | "object-key";
|
|
724
|
+
status: "skipped" | "translated" | "failed" | "pending";
|
|
725
|
+
value: string;
|
|
726
|
+
filePath: string;
|
|
727
|
+
source: string;
|
|
728
|
+
target: string;
|
|
729
|
+
key?: string | undefined;
|
|
730
|
+
line?: number | undefined;
|
|
731
|
+
column?: number | undefined;
|
|
732
|
+
context?: string | undefined;
|
|
733
|
+
variables?: string[] | undefined;
|
|
734
|
+
originalExpression?: string | undefined;
|
|
735
|
+
loc?: unknown;
|
|
736
|
+
range?: unknown;
|
|
737
|
+
locations?: unknown;
|
|
738
|
+
skipReason?: "poison-review-removed" | "user-ignored-anomaly" | "content-spam-rejected" | undefined;
|
|
739
|
+
contentSpamCheck?: {
|
|
740
|
+
verdict: "passed" | "rejected" | "unavailable";
|
|
741
|
+
result?: number | undefined;
|
|
742
|
+
} | undefined;
|
|
743
|
+
translatedExpression?: string | undefined;
|
|
744
|
+
}[];
|
|
745
|
+
targetLang: string;
|
|
746
|
+
translated: number;
|
|
747
|
+
failed: number;
|
|
748
|
+
total: number;
|
|
749
|
+
sourceTotal?: number | undefined;
|
|
750
|
+
skippedNonChinese?: number | undefined;
|
|
751
|
+
skippedAnomalous?: number | undefined;
|
|
752
|
+
skippedContentSpam?: number | undefined;
|
|
753
|
+
anomalousBatches?: {
|
|
754
|
+
entries: {
|
|
755
|
+
key: string;
|
|
756
|
+
filePath: string;
|
|
757
|
+
source: string;
|
|
758
|
+
preview: string;
|
|
759
|
+
line?: number | undefined;
|
|
760
|
+
column?: number | undefined;
|
|
761
|
+
contentSpamCheck?: {
|
|
762
|
+
verdict: "passed" | "rejected" | "unavailable";
|
|
763
|
+
result?: number | undefined;
|
|
764
|
+
} | undefined;
|
|
765
|
+
}[];
|
|
766
|
+
reason: "model-refused" | "ai-call-failed" | "partial-response";
|
|
767
|
+
batch: string;
|
|
768
|
+
attempts: number;
|
|
769
|
+
entryCount: number;
|
|
770
|
+
contentSpamCheck?: {
|
|
771
|
+
status: "unavailable" | "completed";
|
|
772
|
+
checkedCount: number;
|
|
773
|
+
passedCount: number;
|
|
774
|
+
rejectedCount: number;
|
|
775
|
+
unavailableCount: number;
|
|
776
|
+
error?: string | undefined;
|
|
777
|
+
} | undefined;
|
|
778
|
+
ddminFinding?: {
|
|
779
|
+
status: "minimal-set-found" | "probe-budget-exhausted" | "probe-inconclusive";
|
|
780
|
+
algorithm: "ddmin";
|
|
781
|
+
probes: number;
|
|
782
|
+
cacheHits: number;
|
|
783
|
+
probeBudget: number;
|
|
784
|
+
initialEntryCount: number;
|
|
785
|
+
candidateEntryCount: number;
|
|
786
|
+
entryKeys: string[];
|
|
787
|
+
} | undefined;
|
|
788
|
+
}[] | undefined;
|
|
789
|
+
}, {
|
|
790
|
+
entries: {
|
|
791
|
+
status: "skipped" | "translated" | "failed" | "pending";
|
|
792
|
+
value: string;
|
|
793
|
+
filePath: string;
|
|
794
|
+
source: string;
|
|
795
|
+
target: string;
|
|
796
|
+
type?: "literal" | "template" | "concatenation" | "json" | "csv" | "xml" | "jsx-text" | "object-key" | undefined;
|
|
797
|
+
key?: string | undefined;
|
|
798
|
+
line?: number | undefined;
|
|
799
|
+
column?: number | undefined;
|
|
800
|
+
context?: string | undefined;
|
|
801
|
+
variables?: string[] | undefined;
|
|
802
|
+
originalExpression?: string | undefined;
|
|
803
|
+
loc?: unknown;
|
|
804
|
+
range?: unknown;
|
|
805
|
+
locations?: unknown;
|
|
806
|
+
skipReason?: "poison-review-removed" | "user-ignored-anomaly" | "content-spam-rejected" | undefined;
|
|
807
|
+
contentSpamCheck?: {
|
|
808
|
+
verdict: "passed" | "rejected" | "unavailable";
|
|
809
|
+
result?: number | undefined;
|
|
810
|
+
} | undefined;
|
|
811
|
+
translatedExpression?: string | undefined;
|
|
812
|
+
}[];
|
|
813
|
+
targetLang: string;
|
|
814
|
+
translated: number;
|
|
815
|
+
failed: number;
|
|
816
|
+
total: number;
|
|
817
|
+
sourceTotal?: number | undefined;
|
|
818
|
+
skippedNonChinese?: number | undefined;
|
|
819
|
+
skippedAnomalous?: number | undefined;
|
|
820
|
+
skippedContentSpam?: number | undefined;
|
|
821
|
+
anomalousBatches?: {
|
|
822
|
+
entries: {
|
|
823
|
+
key: string;
|
|
824
|
+
filePath: string;
|
|
825
|
+
source: string;
|
|
826
|
+
preview: string;
|
|
827
|
+
line?: number | undefined;
|
|
828
|
+
column?: number | undefined;
|
|
829
|
+
contentSpamCheck?: {
|
|
830
|
+
verdict: "passed" | "rejected" | "unavailable";
|
|
831
|
+
result?: number | undefined;
|
|
832
|
+
} | undefined;
|
|
833
|
+
}[];
|
|
834
|
+
reason: "model-refused" | "ai-call-failed" | "partial-response";
|
|
835
|
+
batch: string;
|
|
836
|
+
attempts: number;
|
|
837
|
+
entryCount: number;
|
|
838
|
+
contentSpamCheck?: {
|
|
839
|
+
status: "unavailable" | "completed";
|
|
840
|
+
checkedCount: number;
|
|
841
|
+
passedCount: number;
|
|
842
|
+
rejectedCount: number;
|
|
843
|
+
unavailableCount: number;
|
|
844
|
+
error?: string | undefined;
|
|
845
|
+
} | undefined;
|
|
846
|
+
ddminFinding?: {
|
|
847
|
+
status: "minimal-set-found" | "probe-budget-exhausted" | "probe-inconclusive";
|
|
848
|
+
algorithm: "ddmin";
|
|
849
|
+
probes: number;
|
|
850
|
+
cacheHits: number;
|
|
851
|
+
probeBudget: number;
|
|
852
|
+
initialEntryCount: number;
|
|
853
|
+
candidateEntryCount: number;
|
|
854
|
+
entryKeys: string[];
|
|
855
|
+
} | undefined;
|
|
856
|
+
}[] | undefined;
|
|
857
|
+
}>;
|
|
858
|
+
export type TextTranslations = z.infer<typeof textTranslationsSchema>;
|
|
859
|
+
export interface OrchestratorOptions {
|
|
860
|
+
cwd: string;
|
|
861
|
+
/** 阶段确认策略,默认 manual 以保持 CLI 兼容。 */
|
|
862
|
+
approvalMode?: ApprovalMode;
|
|
863
|
+
/** 拦截 AskUserQuestion 等工具(CLI 注入终端实现) */
|
|
864
|
+
canUseTool?: CreateSessionOptions["canUseTool"];
|
|
865
|
+
}
|
|
866
|
+
export declare function startOrchestrator(opts: OrchestratorOptions): Promise<AgentSession>;
|
|
867
|
+
export declare const OVERSEAS_RUNTIME_PROTOCOL = "overseas-runtime";
|
|
868
|
+
export declare const OVERSEAS_RUNTIME_API_VERSION = 1;
|
|
869
|
+
export declare const PIPELINE_STAGES: readonly [
|
|
870
|
+
{
|
|
871
|
+
readonly id: 0;
|
|
872
|
+
readonly name: "\u914D\u7F6E";
|
|
873
|
+
readonly directory: "00-config";
|
|
874
|
+
},
|
|
875
|
+
{
|
|
876
|
+
readonly id: 1;
|
|
877
|
+
readonly name: "\u626B\u63CF";
|
|
878
|
+
readonly directory: "01-scan";
|
|
879
|
+
},
|
|
880
|
+
{
|
|
881
|
+
readonly id: 2;
|
|
882
|
+
readonly name: "\u8BA1\u5212";
|
|
883
|
+
readonly directory: "02-plan";
|
|
884
|
+
},
|
|
885
|
+
{
|
|
886
|
+
readonly id: 3;
|
|
887
|
+
readonly name: "\u672F\u8BED\u7FFB\u8BD1";
|
|
888
|
+
readonly directory: "03-glossary";
|
|
889
|
+
},
|
|
890
|
+
{
|
|
891
|
+
readonly id: 4;
|
|
892
|
+
readonly name: "\u7FFB\u8BD1";
|
|
893
|
+
readonly directory: "04-translation";
|
|
894
|
+
},
|
|
895
|
+
{
|
|
896
|
+
readonly id: 5;
|
|
897
|
+
readonly name: "\u5E94\u7528";
|
|
898
|
+
readonly directory: "05-replace";
|
|
899
|
+
},
|
|
900
|
+
{
|
|
901
|
+
readonly id: 6;
|
|
902
|
+
readonly name: "\u9A8C\u8BC1";
|
|
903
|
+
readonly directory: "06-verify";
|
|
904
|
+
}
|
|
905
|
+
];
|
|
906
|
+
export type PipelineStageId = (typeof PIPELINE_STAGES)[number]["id"];
|
|
907
|
+
export type PipelineRunMode = I18nConfig["runMode"];
|
|
908
|
+
export type PipelineRunStatus = "idle" | "preparing" | "running" | "waiting-approval" | "blocked" | "completed" | "failed" | "cancelled";
|
|
909
|
+
export type PipelineStageState = "pending" | "active" | "completed" | "blocked" | "failed";
|
|
910
|
+
export type PipelineStepState = PipelineStageState | "skipped";
|
|
911
|
+
export interface PipelineArtifact {
|
|
912
|
+
path: string;
|
|
913
|
+
label: string;
|
|
914
|
+
}
|
|
915
|
+
export interface PipelineProgress {
|
|
916
|
+
kind: "determinate" | "indeterminate";
|
|
917
|
+
value?: number;
|
|
918
|
+
current?: number;
|
|
919
|
+
total?: number;
|
|
920
|
+
label?: string;
|
|
921
|
+
}
|
|
922
|
+
export interface PipelineStepSnapshot {
|
|
923
|
+
id: string;
|
|
924
|
+
name: string;
|
|
925
|
+
state: PipelineStepState;
|
|
926
|
+
detail: string;
|
|
927
|
+
artifacts: PipelineArtifact[];
|
|
928
|
+
/** 从本步骤实际落盘产物提取的简要 Markdown,仅在产物完成后提供。 */
|
|
929
|
+
summaryMarkdown?: string;
|
|
930
|
+
progress?: PipelineProgress;
|
|
931
|
+
}
|
|
932
|
+
export interface PipelineStageSnapshot {
|
|
933
|
+
id: PipelineStageId;
|
|
934
|
+
name: string;
|
|
935
|
+
directory: string;
|
|
936
|
+
state: PipelineStageState;
|
|
937
|
+
detail: string;
|
|
938
|
+
artifacts: PipelineArtifact[];
|
|
939
|
+
/** 当前大阶段内部真实执行的 CLI 子任务,不重复顶层阶段。 */
|
|
940
|
+
steps: PipelineStepSnapshot[];
|
|
941
|
+
progress?: PipelineProgress;
|
|
942
|
+
}
|
|
943
|
+
export interface PipelineSnapshot {
|
|
944
|
+
apiVersion: number;
|
|
945
|
+
projectPath: string;
|
|
946
|
+
runId?: string;
|
|
947
|
+
status: PipelineRunStatus;
|
|
948
|
+
runMode: PipelineRunMode;
|
|
949
|
+
approvalMode: ApprovalMode;
|
|
950
|
+
currentStage?: PipelineStageId;
|
|
951
|
+
stages: PipelineStageSnapshot[];
|
|
952
|
+
updatedAt: string;
|
|
953
|
+
error?: string;
|
|
954
|
+
}
|
|
955
|
+
export interface LocalizationRunRequest {
|
|
956
|
+
projectPath: string;
|
|
957
|
+
runMode: PipelineRunMode;
|
|
958
|
+
approvalMode: ApprovalMode;
|
|
959
|
+
engine?: I18nConfig["engine"];
|
|
960
|
+
strategy?: LocalizationStrategy;
|
|
961
|
+
translateImages?: boolean;
|
|
962
|
+
targetLangs?: string[];
|
|
963
|
+
langConcurrency?: number;
|
|
964
|
+
concurrency?: number;
|
|
965
|
+
enablePoisonDdmin?: boolean;
|
|
966
|
+
}
|
|
967
|
+
export interface RuntimeEnvelope<T = unknown> {
|
|
968
|
+
protocol: typeof OVERSEAS_RUNTIME_PROTOCOL;
|
|
969
|
+
apiVersion: number;
|
|
970
|
+
seq: number;
|
|
971
|
+
kind: string;
|
|
972
|
+
runId?: string;
|
|
973
|
+
payload: T;
|
|
974
|
+
}
|
|
975
|
+
export type RuntimeHostCommand = {
|
|
976
|
+
kind: "runtime.start";
|
|
977
|
+
runId: string;
|
|
978
|
+
request: LocalizationRunRequest;
|
|
979
|
+
} | {
|
|
980
|
+
kind: "runtime.inspect";
|
|
981
|
+
requestId: string;
|
|
982
|
+
projectPath: string;
|
|
983
|
+
} | {
|
|
984
|
+
kind: "runtime.cancel";
|
|
985
|
+
runId: string;
|
|
986
|
+
} | {
|
|
987
|
+
kind: "host.response";
|
|
988
|
+
id: string;
|
|
989
|
+
value?: unknown;
|
|
990
|
+
error?: string;
|
|
991
|
+
};
|
|
992
|
+
export interface InspectOptions {
|
|
993
|
+
runId?: string;
|
|
994
|
+
status?: PipelineRunStatus;
|
|
995
|
+
error?: string;
|
|
996
|
+
}
|
|
997
|
+
export declare function inspectPipelineSnapshot(projectPath: string, opts?: InspectOptions): Promise<PipelineSnapshot>;
|
|
998
|
+
/**
|
|
999
|
+
* 统一错误类型与错误码。
|
|
1000
|
+
*
|
|
1001
|
+
* 所有抛出的异常都应继承 OverseasError,便于:
|
|
1002
|
+
* 1. 在 CLI 顶层做统一格式化输出
|
|
1003
|
+
* 2. 在日志中携带稳定的 errorCode 用于检索
|
|
1004
|
+
* 3. 单元测试断言错误码而非错误信息
|
|
1005
|
+
*/
|
|
1006
|
+
export declare const ErrorCode: {
|
|
1007
|
+
/** 配置/环境变量错误 */
|
|
1008
|
+
readonly CONFIG_INVALID: "OVS_E_CONFIG_INVALID";
|
|
1009
|
+
/** 未找到目标项目或路径错误 */
|
|
1010
|
+
readonly PROJECT_NOT_FOUND: "OVS_E_PROJECT_NOT_FOUND";
|
|
1011
|
+
/** 文件 IO 错误 */
|
|
1012
|
+
readonly IO_FAILED: "OVS_E_IO_FAILED";
|
|
1013
|
+
/** Agent SDK 调用失败 */
|
|
1014
|
+
readonly AGENT_FAILED: "OVS_E_AGENT_FAILED";
|
|
1015
|
+
/** 当前 APPID 未开通 mmgame 翻译模型权限 */
|
|
1016
|
+
readonly MODEL_ACCESS_FORBIDDEN: "OVS_E_MODEL_ACCESS_FORBIDDEN";
|
|
1017
|
+
/** AI 翻译输出无法解析 */
|
|
1018
|
+
readonly TRANSLATE_PARSE_FAILED: "OVS_E_TRANSLATE_PARSE_FAILED";
|
|
1019
|
+
/** 用户主动取消 */
|
|
1020
|
+
readonly USER_CANCELLED: "OVS_E_USER_CANCELLED";
|
|
1021
|
+
/** 状态机非法转换 */
|
|
1022
|
+
readonly ILLEGAL_STATE: "OVS_E_ILLEGAL_STATE";
|
|
1023
|
+
/** Worker 脚本未找到 */
|
|
1024
|
+
readonly WORKER_NOT_FOUND: "OVS_E_WORKER_NOT_FOUND";
|
|
1025
|
+
/** 小游戏本地化 API 调用异常 */
|
|
1026
|
+
readonly L10N_API_FAILED: "OVS_E_L10N_API_FAILED";
|
|
1027
|
+
/** 旧错误码别名:保留兼容历史日志检索 */
|
|
1028
|
+
readonly MCP_FAILED: "OVS_E_MCP_FAILED";
|
|
1029
|
+
/** 内部错误 / 不该发生 */
|
|
1030
|
+
readonly INTERNAL: "OVS_E_INTERNAL";
|
|
1031
|
+
};
|
|
1032
|
+
export type ErrorCodeValue = (typeof ErrorCode)[keyof typeof ErrorCode];
|
|
1033
|
+
export declare class OverseasError extends Error {
|
|
1034
|
+
readonly code: ErrorCodeValue;
|
|
1035
|
+
readonly details: unknown;
|
|
1036
|
+
readonly cause?: unknown;
|
|
1037
|
+
constructor(code: ErrorCodeValue, message: string, details?: unknown, cause?: unknown);
|
|
1038
|
+
toJSON(): Record<string, unknown>;
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
export {};
|