@lingjingai/scriptctl 0.1.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/bin.d.ts +2 -0
- package/dist/bin.js +12 -0
- package/dist/bin.js.map +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +433 -0
- package/dist/cli.js.map +1 -0
- package/dist/common.d.ts +124 -0
- package/dist/common.js +337 -0
- package/dist/common.js.map +1 -0
- package/dist/domain/direct-core.d.ts +114 -0
- package/dist/domain/direct-core.js +3040 -0
- package/dist/domain/direct-core.js.map +1 -0
- package/dist/domain/script-core.d.ts +18 -0
- package/dist/domain/script-core.js +1886 -0
- package/dist/domain/script-core.js.map +1 -0
- package/dist/help-text.d.ts +2 -0
- package/dist/help-text.js +399 -0
- package/dist/help-text.js.map +1 -0
- package/dist/infra/converters.d.ts +10 -0
- package/dist/infra/converters.js +560 -0
- package/dist/infra/converters.js.map +1 -0
- package/dist/infra/env.d.ts +2 -0
- package/dist/infra/env.js +81 -0
- package/dist/infra/env.js.map +1 -0
- package/dist/infra/providers.d.ts +25 -0
- package/dist/infra/providers.js +330 -0
- package/dist/infra/providers.js.map +1 -0
- package/dist/infra/script-output-api.d.ts +44 -0
- package/dist/infra/script-output-api.js +160 -0
- package/dist/infra/script-output-api.js.map +1 -0
- package/dist/infra/storage.d.ts +35 -0
- package/dist/infra/storage.js +91 -0
- package/dist/infra/storage.js.map +1 -0
- package/dist/output.d.ts +4 -0
- package/dist/output.js +55 -0
- package/dist/output.js.map +1 -0
- package/dist/usecases/direct.d.ts +13 -0
- package/dist/usecases/direct.js +1679 -0
- package/dist/usecases/direct.js.map +1 -0
- package/dist/usecases/doctor.d.ts +2 -0
- package/dist/usecases/doctor.js +75 -0
- package/dist/usecases/doctor.js.map +1 -0
- package/dist/usecases/script.d.ts +32 -0
- package/dist/usecases/script.js +949 -0
- package/dist/usecases/script.js.map +1 -0
- package/package.json +50 -0
package/dist/common.js
ADDED
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
import * as crypto from "node:crypto";
|
|
2
|
+
import * as fs from "node:fs";
|
|
3
|
+
import * as path from "node:path";
|
|
4
|
+
import { DEFAULT_STORE, WorkspaceLayout, } from "./infra/storage.js";
|
|
5
|
+
export const EXIT_OK = 0;
|
|
6
|
+
export const EXIT_USAGE = 64;
|
|
7
|
+
export const EXIT_INPUT = 66;
|
|
8
|
+
export const EXIT_RUNTIME = 70;
|
|
9
|
+
export const EXIT_NEEDS_AGENT = 78;
|
|
10
|
+
export const DEFAULT_PROVIDER = "anthropic";
|
|
11
|
+
export const DEFAULT_CONCURRENCY = 30;
|
|
12
|
+
export const DEFAULT_MODEL = "claude-opus-4-6";
|
|
13
|
+
export const DEFAULT_MAX_TOKENS = 32000;
|
|
14
|
+
export const DEFAULT_BATCH_MAX_TOKENS = 16000;
|
|
15
|
+
export const DEFAULT_PROVIDER_ATTEMPTS = 3;
|
|
16
|
+
export const NONSTREAMING_MAX_TOKENS = 20000;
|
|
17
|
+
export const DEFAULT_THINKING_BUDGET_TOKENS = 1024;
|
|
18
|
+
export const DEFAULT_BATCH_TARGET_LINES = 36;
|
|
19
|
+
export const DEFAULT_BATCH_MAX_CHARS = 1800;
|
|
20
|
+
export const DEFAULT_BATCH_MIN_LINES = 12;
|
|
21
|
+
export const DEFAULT_BATCH_MODE = "episode";
|
|
22
|
+
export const DIRECT_REL = path.join("draft", "scriptctl", "direct");
|
|
23
|
+
export const SCRIPT_REL = path.join("output", "script.json");
|
|
24
|
+
export const SUPPORTED_EXTS = ".txt/.md/.docx/.xlsx/.pdf/.json";
|
|
25
|
+
export const REVIEW_TARGETS = ["episode", "asset", "issue"];
|
|
26
|
+
export const DIRECT_CONTRACT_VERSION = 3;
|
|
27
|
+
export const SCRIPT_SCHEMA_VERSION = 2;
|
|
28
|
+
export const WORLDVIEW_VALUES = [
|
|
29
|
+
"上古时代",
|
|
30
|
+
"古代历史",
|
|
31
|
+
"古风架空",
|
|
32
|
+
"近代民国",
|
|
33
|
+
"现代",
|
|
34
|
+
"欧洲中世纪",
|
|
35
|
+
"赛博朋克",
|
|
36
|
+
"星际时代",
|
|
37
|
+
"西幻架空",
|
|
38
|
+
];
|
|
39
|
+
export const ROLE_TYPE_VALUES = ["主角", "配角"];
|
|
40
|
+
export const ACTION_TYPE_VALUES = new Set(["dialogue", "inner_thought", "action"]);
|
|
41
|
+
export const SCRIPT_TARGET_KINDS = new Set(["actor", "location", "prop"]);
|
|
42
|
+
export const SPEAKER_SOURCE_KINDS = new Set([
|
|
43
|
+
"actor",
|
|
44
|
+
"location",
|
|
45
|
+
"prop",
|
|
46
|
+
"system",
|
|
47
|
+
"broadcast",
|
|
48
|
+
"group",
|
|
49
|
+
"other",
|
|
50
|
+
]);
|
|
51
|
+
export const DELIVERY_VALUES = new Set(["single", "simultaneous", "overlap", "group"]);
|
|
52
|
+
export const EFFECTIVE_FROM_VALUES = new Set(["before_action", "after_action"]);
|
|
53
|
+
export const ACTOR_REUSE_SCENE_LIMIT = 1;
|
|
54
|
+
export const PROP_REUSE_SCENE_LIMIT = 1;
|
|
55
|
+
export const MARKDOWN_BATCH_PROMPT_SPEC = "Output format: a single markdown document with two top-level sections,\n" +
|
|
56
|
+
"in this exact order. Do NOT wrap the document in fenced code blocks, do\n" +
|
|
57
|
+
"NOT add prose before or after the document.\n" +
|
|
58
|
+
"\n" +
|
|
59
|
+
"# 剧本\n" +
|
|
60
|
+
"\n" +
|
|
61
|
+
"## 场景 1\n" +
|
|
62
|
+
"- 时空: <内|外> <日|夜>\n" +
|
|
63
|
+
"- 地点: <稳定主空间地点名>[【场景状态】]\n" +
|
|
64
|
+
"- 角色: <跨场景复用的具体单人角色1>, <角色2>(状态), <角色3>\n" +
|
|
65
|
+
"- 道具: <需要单独生成并保持一致的prop1>, <prop2>\n" +
|
|
66
|
+
"\n" +
|
|
67
|
+
"> [act] 动作或环境描写。\n" +
|
|
68
|
+
"> [dlg|name] 角色对白原文。\n" +
|
|
69
|
+
"> [dlg|name|emotion] 带情绪标签的对白。\n" +
|
|
70
|
+
"> [dlg|system:<发声源名>] 非人物发声源对白。\n" +
|
|
71
|
+
"> [dlg|prop:<道具名>] 道具发声对白。\n" +
|
|
72
|
+
"> [dlg|broadcast:<广播名>] 广播 / 喇叭发声对白。\n" +
|
|
73
|
+
"> [dlg|<speaker1>/<speaker2>|simultaneous] 多人同时说同一句。\n" +
|
|
74
|
+
"> [dlg|overlap] <speaker1>:<line1> / <speaker2>:<line2>\n" +
|
|
75
|
+
"> [think|name] 角色心声/内心独白。\n" +
|
|
76
|
+
"\n" +
|
|
77
|
+
"## 场景 2\n" +
|
|
78
|
+
"...\n" +
|
|
79
|
+
"\n" +
|
|
80
|
+
"# 资产\n" +
|
|
81
|
+
"\n" +
|
|
82
|
+
"## 人物\n" +
|
|
83
|
+
"- 具体单人角色名: 简短角色描述\n" +
|
|
84
|
+
"- 具体单人角色名\n" +
|
|
85
|
+
"\n" +
|
|
86
|
+
"## 场景\n" +
|
|
87
|
+
"- 地点名: 地点用途/氛围\n" +
|
|
88
|
+
"- 地点名\n" +
|
|
89
|
+
"\n" +
|
|
90
|
+
"## 道具\n" +
|
|
91
|
+
"- 道具名: 道具描述\n" +
|
|
92
|
+
"- 道具名\n" +
|
|
93
|
+
"\n" +
|
|
94
|
+
"## 发声源\n" +
|
|
95
|
+
"- <发声源名>(system): 声音描述\n" +
|
|
96
|
+
"- <广播名>(broadcast)\n" +
|
|
97
|
+
"\n" +
|
|
98
|
+
"## 人物状态\n" +
|
|
99
|
+
"- <角色名>|<状态名>: <只描述这个稳定状态的可视资产差异>\n" +
|
|
100
|
+
"\n" +
|
|
101
|
+
"## 场景状态\n" +
|
|
102
|
+
"- <地点名>|<状态名>: <只描述这个稳定状态的可视资产差异>\n" +
|
|
103
|
+
"\n" +
|
|
104
|
+
"## 道具状态\n" +
|
|
105
|
+
"- <道具名>|<状态名>: <只描述这个稳定状态的可视资产差异>\n" +
|
|
106
|
+
"\n" +
|
|
107
|
+
"Rules:\n" +
|
|
108
|
+
"- Extract every scene from Batch Source only. Do not summarize or skip scenes.\n" +
|
|
109
|
+
"- Each `> [...]` line is one action. The action body is single-line by default;\n" +
|
|
110
|
+
" if the source spans multiple lines, append continuation lines directly under\n" +
|
|
111
|
+
" the anchor (no `>` prefix, no leading `-` or `#`) — the parser joins them with newlines.\n" +
|
|
112
|
+
"- For actor dialogue/inner_thought, the speaker name in the anchor must appear\n" +
|
|
113
|
+
" in the scene's `- 角色: ...` list.\n" +
|
|
114
|
+
"- `- 角色:` and `## 人物` are only for concrete single-person character assets\n" +
|
|
115
|
+
" that may need reuse across scenes. Crowd/group labels such as 众人, 群众,\n" +
|
|
116
|
+
" 围观者, 路人们, or 大家 must stay out of actors; use `group:name` speakers\n" +
|
|
117
|
+
" or action narration instead.\n" +
|
|
118
|
+
"- For non-human speech, do not add the source to `- 角色`. Use a typed speaker\n" +
|
|
119
|
+
" anchor: `system:name`, `broadcast:name`, `prop:name`, `location:name`,\n" +
|
|
120
|
+
" `group:name`, or `other:name`. If a prop/location speaks, also list it in\n" +
|
|
121
|
+
" `- 道具:` or `- 地点:` / the asset section.\n" +
|
|
122
|
+
"- Asset names must be canonical names only. Never include bracketed or\n" +
|
|
123
|
+
" parenthesized state/role/status text in actor, location, prop, or speaker\n" +
|
|
124
|
+
" names. Put durable traits in descriptions and temporary details in actions.\n" +
|
|
125
|
+
"- For `- 地点:`, prefer the stable main space. Micro-areas such as doorways,\n" +
|
|
126
|
+
" corners, table-side, corridors, or car-front positions stay in action text\n" +
|
|
127
|
+
" unless they recur as visually distinct production assets.\n" +
|
|
128
|
+
"- For `- 道具:`, list only props that need independent visual generation and\n" +
|
|
129
|
+
" continuity: plot keys/evidence/weapons/tokens/devices, speaking props,\n" +
|
|
130
|
+
" recurring props, or props with durable states. Temporary held objects,\n" +
|
|
131
|
+
" background furniture, one-off consumables, passerby objects, and generic\n" +
|
|
132
|
+
" set dressing stay in action text only. Props that are unlikely to appear\n" +
|
|
133
|
+
" across more than 1 scene should not be promoted to props.\n" +
|
|
134
|
+
"- Do not create states from scene occurrence notes. A state exists only when it\n" +
|
|
135
|
+
" is listed in 人物状态 / 场景状态 / 道具状态. If unsure, do not list a state.\n" +
|
|
136
|
+
"- States are only persistent, reusable visual variants that need separate\n" +
|
|
137
|
+
" assets and can be inherited by later actions. Identity, age, occupation,\n" +
|
|
138
|
+
" emotion, posture, action, temporary injury/illness/dirt, transient held\n" +
|
|
139
|
+
" objects, local body/equipment details, and mixed A/B labels are not states.\n" +
|
|
140
|
+
"- A transformation action has two parts: keep the action content as the process\n" +
|
|
141
|
+
" description, and use script state-change/transition fields only when a\n" +
|
|
142
|
+
" durable later-inherited state actually changes.\n" +
|
|
143
|
+
"- If multiple speakers say the same line at the same time, emit one line:\n" +
|
|
144
|
+
" `[dlg|speaker1/speaker2|simultaneous] content`. Do not split it into two\n" +
|
|
145
|
+
" sequential dialogue lines.\n" +
|
|
146
|
+
"- If multiple speakers talk over each other with different lines, emit one line:\n" +
|
|
147
|
+
" `[dlg|overlap] speaker1:content1 / system:source:content2`. Use typed\n" +
|
|
148
|
+
" prefixes for non-human speakers inside overlap lines too.\n" +
|
|
149
|
+
"- Action content must be copied verbatim from Batch Source — do not paraphrase,\n" +
|
|
150
|
+
" translate, summarize, or add commentary.\n" +
|
|
151
|
+
"- When a single source line packs multiple semantic parts (e.g. a speaker label\n" +
|
|
152
|
+
" `Name(emotion):`, the spoken line, and a parenthetical translation/aside), put\n" +
|
|
153
|
+
" only the spoken line into the action content. The speaker name belongs after\n" +
|
|
154
|
+
" `dlg|`, the emotion belongs after `dlg|name|`. Translations/asides in\n" +
|
|
155
|
+
" parentheses must be discarded.\n" +
|
|
156
|
+
"- For action narration prefixed with ▲ △ or 【字幕/音效/特效/屏幕字/...】, the action\n" +
|
|
157
|
+
" content is the narration body without the bracket label. Spoken system,\n" +
|
|
158
|
+
" broadcast, prop, location, or group voices are dialogue, not action.\n" +
|
|
159
|
+
"- Do not invent dialogue or actions not present in Batch Source. Do not split a\n" +
|
|
160
|
+
" single coherent line into many tiny fragments.\n" +
|
|
161
|
+
"- Subtitles, sound effects, character captions, and on-screen text use `> [act]`.\n" +
|
|
162
|
+
" Never invent action kinds outside act/dlg/think.\n" +
|
|
163
|
+
"- The 资产 section lists only people/locations/props/speakers that are reusable\n" +
|
|
164
|
+
" production assets for this batch's scenes, not every noun that appears.\n" +
|
|
165
|
+
" Each item: a name, optionally followed by `: description`.\n" +
|
|
166
|
+
" An item without `:` carries no description.\n" +
|
|
167
|
+
"- Lines marked [meta] in Batch Source are read-only metadata; do not promote\n" +
|
|
168
|
+
" them to actions.\n";
|
|
169
|
+
export const METADATA_EXTRACTION_SCHEMA = {
|
|
170
|
+
type: "object",
|
|
171
|
+
required: ["confidence", "worldview", "worldview_raw", "actors", "locations", "props"],
|
|
172
|
+
additionalProperties: false,
|
|
173
|
+
properties: {
|
|
174
|
+
confidence: { type: "string", enum: ["high", "medium", "low"] },
|
|
175
|
+
worldview: { type: "string", enum: WORLDVIEW_VALUES },
|
|
176
|
+
worldview_raw: { type: "string" },
|
|
177
|
+
actors: {
|
|
178
|
+
type: "array",
|
|
179
|
+
items: {
|
|
180
|
+
type: "object",
|
|
181
|
+
required: ["actor_id", "role_type", "description"],
|
|
182
|
+
additionalProperties: false,
|
|
183
|
+
properties: {
|
|
184
|
+
actor_id: { type: "string" },
|
|
185
|
+
role_type: { type: "string", enum: ROLE_TYPE_VALUES },
|
|
186
|
+
description: { type: "string" },
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
locations: {
|
|
191
|
+
type: "array",
|
|
192
|
+
items: {
|
|
193
|
+
type: "object",
|
|
194
|
+
required: ["location_id", "description"],
|
|
195
|
+
additionalProperties: false,
|
|
196
|
+
properties: {
|
|
197
|
+
location_id: { type: "string" },
|
|
198
|
+
description: { type: "string" },
|
|
199
|
+
},
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
props: {
|
|
203
|
+
type: "array",
|
|
204
|
+
items: {
|
|
205
|
+
type: "object",
|
|
206
|
+
required: ["prop_id", "description"],
|
|
207
|
+
additionalProperties: false,
|
|
208
|
+
properties: {
|
|
209
|
+
prop_id: { type: "string" },
|
|
210
|
+
description: { type: "string" },
|
|
211
|
+
},
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
},
|
|
215
|
+
};
|
|
216
|
+
export const ASSET_CURATION_SCHEMA = {
|
|
217
|
+
type: "object",
|
|
218
|
+
required: ["locations"],
|
|
219
|
+
additionalProperties: false,
|
|
220
|
+
properties: {
|
|
221
|
+
locations: {
|
|
222
|
+
type: "array",
|
|
223
|
+
items: {
|
|
224
|
+
type: "object",
|
|
225
|
+
required: ["location_id", "decision", "target_location_id", "reason"],
|
|
226
|
+
additionalProperties: false,
|
|
227
|
+
properties: {
|
|
228
|
+
location_id: { type: "string" },
|
|
229
|
+
decision: { type: "string", enum: ["keep", "merge"] },
|
|
230
|
+
target_location_id: { type: ["string", "null"] },
|
|
231
|
+
reason: { type: "string" },
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
},
|
|
235
|
+
},
|
|
236
|
+
};
|
|
237
|
+
export const EPISODE_TITLE_EXTRACTION_SCHEMA = {
|
|
238
|
+
type: "object",
|
|
239
|
+
required: ["episode_titles"],
|
|
240
|
+
additionalProperties: false,
|
|
241
|
+
properties: {
|
|
242
|
+
episode_titles: {
|
|
243
|
+
type: "array",
|
|
244
|
+
items: {
|
|
245
|
+
type: "object",
|
|
246
|
+
required: ["episode", "title"],
|
|
247
|
+
additionalProperties: false,
|
|
248
|
+
properties: {
|
|
249
|
+
episode: { type: "integer" },
|
|
250
|
+
title: { type: "string" },
|
|
251
|
+
},
|
|
252
|
+
},
|
|
253
|
+
},
|
|
254
|
+
},
|
|
255
|
+
};
|
|
256
|
+
export class CliError extends Error {
|
|
257
|
+
title;
|
|
258
|
+
exitCode;
|
|
259
|
+
required;
|
|
260
|
+
received;
|
|
261
|
+
nextSteps;
|
|
262
|
+
op;
|
|
263
|
+
errorCode;
|
|
264
|
+
hint;
|
|
265
|
+
constructor(title, message, opts) {
|
|
266
|
+
super(message);
|
|
267
|
+
this.name = "CliError";
|
|
268
|
+
this.title = title;
|
|
269
|
+
this.exitCode = opts.exitCode;
|
|
270
|
+
this.required = opts.required ?? [];
|
|
271
|
+
this.received = opts.received ?? [];
|
|
272
|
+
this.nextSteps = opts.nextSteps ?? [];
|
|
273
|
+
this.op = opts.op;
|
|
274
|
+
this.errorCode = opts.errorCode;
|
|
275
|
+
this.hint = opts.hint;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
export function workspaceLayout(workspace) {
|
|
279
|
+
return new WorkspaceLayout(workspace);
|
|
280
|
+
}
|
|
281
|
+
export function directDir(workspace) {
|
|
282
|
+
return workspaceLayout(workspace).directDir;
|
|
283
|
+
}
|
|
284
|
+
export function scriptJsonPath(opts) {
|
|
285
|
+
const v = opts["script_path"] ?? opts["scriptPath"];
|
|
286
|
+
if (typeof v === "string" && v.length > 0)
|
|
287
|
+
return v;
|
|
288
|
+
return SCRIPT_REL;
|
|
289
|
+
}
|
|
290
|
+
export function fmtId(prefix, n) {
|
|
291
|
+
return `${prefix}_${String(n).padStart(3, "0")}`;
|
|
292
|
+
}
|
|
293
|
+
export function readJson(p) {
|
|
294
|
+
return DEFAULT_STORE.readJson(p);
|
|
295
|
+
}
|
|
296
|
+
export function writeJson(p, data) {
|
|
297
|
+
DEFAULT_STORE.writeJson(p, data);
|
|
298
|
+
}
|
|
299
|
+
export function readText(p) {
|
|
300
|
+
return DEFAULT_STORE.readText(p);
|
|
301
|
+
}
|
|
302
|
+
export function exists(p) {
|
|
303
|
+
return DEFAULT_STORE.exists(p);
|
|
304
|
+
}
|
|
305
|
+
export function writeText(p, text) {
|
|
306
|
+
DEFAULT_STORE.writeText(p, text);
|
|
307
|
+
}
|
|
308
|
+
export function deletePath(p) {
|
|
309
|
+
DEFAULT_STORE.delete(p);
|
|
310
|
+
}
|
|
311
|
+
export function deleteTree(p) {
|
|
312
|
+
DEFAULT_STORE.deleteTree(p);
|
|
313
|
+
}
|
|
314
|
+
export function copyFile(src, dst) {
|
|
315
|
+
DEFAULT_STORE.copyToPath(src, dst);
|
|
316
|
+
}
|
|
317
|
+
export function sha256Text(text) {
|
|
318
|
+
return crypto.createHash("sha256").update(text, "utf-8").digest("hex");
|
|
319
|
+
}
|
|
320
|
+
export function sha256File(p) {
|
|
321
|
+
const digest = crypto.createHash("sha256");
|
|
322
|
+
const fd = fs.openSync(p, "r");
|
|
323
|
+
try {
|
|
324
|
+
const buf = Buffer.alloc(1024 * 1024);
|
|
325
|
+
while (true) {
|
|
326
|
+
const n = fs.readSync(fd, buf, 0, buf.length, null);
|
|
327
|
+
if (n <= 0)
|
|
328
|
+
break;
|
|
329
|
+
digest.update(buf.subarray(0, n));
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
finally {
|
|
333
|
+
fs.closeSync(fd);
|
|
334
|
+
}
|
|
335
|
+
return digest.digest("hex");
|
|
336
|
+
}
|
|
337
|
+
//# sourceMappingURL=common.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EACL,aAAa,EACb,eAAe,GAEhB,MAAM,oBAAoB,CAAC;AAE5B,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,CAAC;AACzB,MAAM,CAAC,MAAM,UAAU,GAAG,EAAE,CAAC;AAC7B,MAAM,CAAC,MAAM,UAAU,GAAG,EAAE,CAAC;AAC7B,MAAM,CAAC,MAAM,YAAY,GAAG,EAAE,CAAC;AAC/B,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAEnC,M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E,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,CAAS;IAClC,MAAM,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IAC3C,MAAM,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAC/B,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;QACtC,OAAO,IAAI,EAAE,CAAC;YACZ,MAAM,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;YACpD,IAAI,CAAC,IAAI,CAAC;gBAAE,MAAM;YAClB,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACpC,CAAC;IACH,CAAC;YAAS,CAAC;QACT,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IACnB,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { CliError } from "../common.js";
|
|
2
|
+
type Dict = Record<string, unknown>;
|
|
3
|
+
export declare const _ZH_DIGITS: Record<string, number>;
|
|
4
|
+
export declare const _EP_HEADER_RE: RegExp;
|
|
5
|
+
export declare const _EP_TITLE_PREFIX_RE: RegExp;
|
|
6
|
+
export declare const _TECHNICAL_EP_TITLE_RE: RegExp;
|
|
7
|
+
export declare const BRACKET_ACTION_LABELS: Set<string>;
|
|
8
|
+
export declare function sceneContext(scene: Dict): Dict;
|
|
9
|
+
export declare function setSceneContext(scene: Dict, context: Dict): void;
|
|
10
|
+
export declare function normalizeDigits(value: string): string;
|
|
11
|
+
export declare function parseEpNumber(raw: string): number | null;
|
|
12
|
+
export declare function episodeNumberFromValue(value: unknown, defaultVal?: number | null): number | null;
|
|
13
|
+
export declare function cleanEpisodeShortTitle(rawTitle: unknown): string;
|
|
14
|
+
export declare function isTechnicalEpisodeTitle(rawTitle: unknown): boolean;
|
|
15
|
+
export declare function formatEpisodeTitle(episodeNum: number, rawTitle: unknown): string | null;
|
|
16
|
+
export declare function extractEpisodeTitleCandidate(header: string): string;
|
|
17
|
+
export declare function buildEpisodePlan(sourceText: string): Dict;
|
|
18
|
+
export declare function cleanName(name: unknown): string;
|
|
19
|
+
export declare function splitEntityState(raw: unknown): [string, string | null];
|
|
20
|
+
export declare function stateLabelError(stateName: unknown): string | null;
|
|
21
|
+
export declare function isStateLabelValid(stateName: unknown): boolean;
|
|
22
|
+
export declare function stateRejectionReason(targetKind: string, stateName: unknown): string | null;
|
|
23
|
+
export declare function isReusableState(targetKind: string, stateName: unknown): boolean;
|
|
24
|
+
export declare function splitNames(raw: string): Array<[string, string | null]>;
|
|
25
|
+
export declare function stripLocationState(location: string): [string, string | null];
|
|
26
|
+
export declare function parseSceneHeader(line: string): Dict | null;
|
|
27
|
+
export declare function lineItemsWithSpans(text: string, base: number): Array<[string, number, number]>;
|
|
28
|
+
export declare function contentSpan(line: string, lineStart: number, content: string): {
|
|
29
|
+
start: number;
|
|
30
|
+
end: number;
|
|
31
|
+
};
|
|
32
|
+
export declare function deterministicExtractEpisode(sourceText: string, episodePlan: Dict): Dict;
|
|
33
|
+
export declare function normalizeInt(value: unknown, defaultVal: number): number;
|
|
34
|
+
export declare function validateResultActionTypes(planItem: Dict, result: Dict): void;
|
|
35
|
+
export declare function validateEpisodeExtractionQuality(_sourceText: string, episodePlan: Dict, result: Dict): void;
|
|
36
|
+
export declare function isMetadataLine(line: string): boolean;
|
|
37
|
+
export declare function isSceneLine(line: string): boolean;
|
|
38
|
+
export declare function extractSourceLineAction(line: string, start: number): Dict | null;
|
|
39
|
+
export declare function sourceContentLineRecords(sourceText: string, planItem: Dict): Dict[];
|
|
40
|
+
export declare function episodesNeedingGeneratedTitles(episodePlan: Dict): Dict[];
|
|
41
|
+
export declare function deterministicEpisodeShortTitle(sourceText: string, episode: Dict): string;
|
|
42
|
+
export declare function buildEpisodeTitleContext(sourceText: string, episodePlan: Dict): Dict[];
|
|
43
|
+
export declare function episodeTitleResponseMap(payload: unknown): Map<number, string>;
|
|
44
|
+
export interface ProviderLike {
|
|
45
|
+
name?: string;
|
|
46
|
+
extractEpisode?(sourceText: string, plan: Dict): Promise<Dict> | Dict;
|
|
47
|
+
extractBatch?(sourceText: string, plan: Dict): Promise<Dict> | Dict;
|
|
48
|
+
extractMetadata?(sourceText: string, script: Dict): Promise<Dict> | Dict;
|
|
49
|
+
extractAssetCuration?(sourceText: string, script: Dict): Promise<Dict> | Dict;
|
|
50
|
+
extractEpisodeTitles?(sourceText: string, plan: Dict): Promise<Dict> | Dict;
|
|
51
|
+
}
|
|
52
|
+
export declare function enrichEpisodePlanTitles(sourceText: string, episodePlan: Dict, provider: ProviderLike): Promise<Dict>;
|
|
53
|
+
export declare function formatBatchSource(sourceText: string, batchPlan: Dict): string;
|
|
54
|
+
export declare function lineNumberAt(sourceText: string, offset: number): number;
|
|
55
|
+
export declare function batchContextFor(sourceText: string, episode: Dict, start: number): Dict;
|
|
56
|
+
export declare function makeBatch(sourceText: string, episode: Dict, batchIndex: number, part: number, lines: Array<[string, number, number]>): Dict;
|
|
57
|
+
export interface BuildBatchPlanOptions {
|
|
58
|
+
targetLines?: number;
|
|
59
|
+
maxChars?: number;
|
|
60
|
+
minLines?: number;
|
|
61
|
+
mode?: string;
|
|
62
|
+
}
|
|
63
|
+
export declare function buildBatchPlan(sourceText: string, episodePlan: Dict, opts?: BuildBatchPlanOptions): Dict;
|
|
64
|
+
export declare function validateBatchExtractionQuality(_sourceText: string, batchPlan: Dict, result: Dict): void;
|
|
65
|
+
export declare function recoverBatchFromSource(sourceText: string, batchPlan: Dict): Dict;
|
|
66
|
+
export declare function isRecoverableBatchCliError(exc: CliError): boolean;
|
|
67
|
+
export declare function isRetryableProviderError(exc: unknown): boolean;
|
|
68
|
+
export declare function providerAttempts(): number;
|
|
69
|
+
export declare function providerExtractBatch(provider: ProviderLike, sourceText: string, batch: Dict): Promise<Dict>;
|
|
70
|
+
export declare function providerExtractAssetCuration(provider: ProviderLike, sourceText: string, script: Dict): Promise<Dict>;
|
|
71
|
+
export declare function extractBatchWithRecovery(provider: ProviderLike, sourceText: string, batch: Dict): Promise<Dict>;
|
|
72
|
+
export declare function _md_push_asset(items: Dict[], rawName: string, description: string | null): void;
|
|
73
|
+
export declare function parseSpeakerRef(raw: unknown): [string, string];
|
|
74
|
+
export declare function parseSpeakerAsset(raw: unknown): [string, string];
|
|
75
|
+
export declare function inferNonActorSpeakerKind(name: string, scene?: Dict | null): string;
|
|
76
|
+
export declare function normalizeDeliveryToken(value: unknown): string;
|
|
77
|
+
export declare function contentHasSpeakerPrefix(content: string, speakerNames: Set<string>): boolean;
|
|
78
|
+
export declare function splitSpeakerRefs(raw: unknown): string[];
|
|
79
|
+
export declare function speakerRefEntry(scene: Dict, rawSpeaker: unknown, defaultKind?: string): {
|
|
80
|
+
speaker: string;
|
|
81
|
+
speaker_kind: string;
|
|
82
|
+
} | null;
|
|
83
|
+
export declare function applyDialogueSpeaker(action: Dict, scene: Dict, rawSpeaker: unknown, defaultKind?: string): void;
|
|
84
|
+
export declare function parseOverlapMarkdownLines(content: string, scene: Dict): Array<{
|
|
85
|
+
speaker: string;
|
|
86
|
+
speaker_kind: string;
|
|
87
|
+
content: string;
|
|
88
|
+
}>;
|
|
89
|
+
export declare function parseMarkdownBatch(text: string, batchPlan: Dict): Dict;
|
|
90
|
+
export declare function expandCompactEpisodeResult(result: Dict, episodePlan: Dict): Dict;
|
|
91
|
+
export declare function compactEpisodeResult(result: Dict): Dict;
|
|
92
|
+
export declare function compactBatchResult(result: Dict): Dict;
|
|
93
|
+
export declare function normalizeEpisodeResult(result: Dict, episodePlan: Dict): Dict;
|
|
94
|
+
export declare function _normalize_speaker_list(items: unknown): Dict[];
|
|
95
|
+
export declare function uniqueAdd(order: string[], value: string): void;
|
|
96
|
+
export declare function clipText(text: unknown, limit?: number): string;
|
|
97
|
+
export declare function sceneExample(scene: Dict, limit?: number): string;
|
|
98
|
+
export declare function buildMetadataContext(script: Dict): Dict;
|
|
99
|
+
export declare function deterministicExtractMetadata(script: Dict): Dict;
|
|
100
|
+
export declare function applyMetadataToScript(script: Dict, metadata: Dict): void;
|
|
101
|
+
interface AssetUsage {
|
|
102
|
+
episodes: Set<string>;
|
|
103
|
+
scenes: Set<string>;
|
|
104
|
+
}
|
|
105
|
+
export declare function sceneAssetUsage(script: Dict, refKey: string, idKey: string): Map<string, AssetUsage>;
|
|
106
|
+
export declare function buildAssetCurationContext(script: Dict): Dict;
|
|
107
|
+
export declare function locationUsageExamples(script: Dict, locationId: string): Dict[];
|
|
108
|
+
export declare function applyLocationMerges(script: Dict, replacements: Map<string, string>): void;
|
|
109
|
+
export declare function actorCurationDecisions(script: Dict): Dict[];
|
|
110
|
+
export declare function propCurationDecisions(script: Dict): Dict[];
|
|
111
|
+
export declare function normalizeAssetCuration(script: Dict, rawCuration: unknown): Dict;
|
|
112
|
+
export declare function curateScriptAssets(script: Dict, rawCuration?: unknown): Dict;
|
|
113
|
+
export declare function mergeEpisodeResults(results: Dict[], title: string): Dict;
|
|
114
|
+
export {};
|