@zenaigc/zenmcp 0.0.0-stage → 0.1.1
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/INSTALL.md +77 -0
- package/README.md +53 -2
- package/dist/src/acquire/download.js +152 -0
- package/dist/src/acquire/errors.js +8 -0
- package/dist/src/acquire/share.js +67 -0
- package/dist/src/acquire/social.js +98 -0
- package/dist/src/acquire/trim.js +95 -0
- package/dist/src/assets/files.js +29 -0
- package/dist/src/assets/generator.js +141 -0
- package/dist/src/assets/images.js +90 -0
- package/dist/src/assets/index.js +3 -0
- package/dist/src/assets/model-library.js +87 -0
- package/dist/src/assets/upload-cache.js +36 -0
- package/dist/src/contract/cloud-v1.js +334 -0
- package/dist/src/core/hash.js +18 -0
- package/dist/src/core/index.js +4 -0
- package/dist/src/core/job-store.js +251 -0
- package/dist/src/core/safety.js +43 -0
- package/dist/src/core/schema.js +295 -0
- package/dist/src/doctor.js +22 -0
- package/dist/src/effects/check.js +19 -0
- package/dist/src/effects/font.js +78 -0
- package/dist/src/effects/index.js +188 -0
- package/dist/src/engine/card.js +50 -0
- package/dist/src/engine/direct.js +493 -0
- package/dist/src/engine/generate.js +234 -0
- package/dist/src/engine/index.js +3 -0
- package/dist/src/engine/media.js +24 -0
- package/dist/src/engine/steps.js +444 -0
- package/dist/src/engine/storage.js +90 -0
- package/dist/src/gateway/attempt-store.js +110 -0
- package/dist/src/gateway/budget.js +39 -0
- package/dist/src/gateway/cloud-gateway.js +141 -0
- package/dist/src/gateway/config.js +10 -0
- package/dist/src/gateway/device-auth.js +53 -0
- package/dist/src/gateway/errors.js +105 -0
- package/dist/src/gateway/http.js +124 -0
- package/dist/src/gateway/index.js +8 -0
- package/dist/src/gateway/paid-runner.js +376 -0
- package/dist/src/gateway/types.js +42 -0
- package/dist/src/inspect/index.js +276 -0
- package/dist/src/inspect/media.js +43 -0
- package/dist/src/mcp/server.js +177 -0
- package/dist/src/models/wan3/index.js +173 -0
- package/dist/src/models/wan3/limits.js +25 -0
- package/dist/src/timeline/conform.js +255 -0
- package/dist/src/timeline/cuts.js +225 -0
- package/dist/src/timeline/diff.js +82 -0
- package/dist/src/timeline/errors.js +8 -0
- package/dist/src/timeline/ffmpeg.js +164 -0
- package/dist/src/timeline/index.js +6 -0
- package/dist/src/timeline/params.js +46 -0
- package/dist/src/timeline/probe.js +98 -0
- package/dist/src/timeline/types.js +1 -0
- package/dist/templates/pop-title/README.md +18 -0
- package/dist/templates/pop-title/index.html +102 -0
- package/dist/templates/pop-title/pop-title.js +97 -0
- package/dist/templates/pop-title/render.js +42 -0
- package/dist/templates/pop-title/size-1080/index.html +102 -0
- package/dist/templates/pop-title/variables.example.json +9 -0
- package/dist/templates/pop-title/vendor/FONT.md +10 -0
- package/dist/templates/pop-title/vendor/NotoSansCJKsc-Bold.otf +0 -0
- package/dist/templates/pop-title/vendor/OFL.txt +92 -0
- package/dist/templates/pop-title/vendor/gsap.min.js +11 -0
- package/package.json +35 -4
- package/skills/zenmcp/SKILL.md +27 -0
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** Literal carried only by the two persisted documents, Job and RunRecord. */
|
|
3
|
+
export const SCHEMA_VERSION = 1;
|
|
4
|
+
export const SHA256_PATTERN = /^[a-f0-9]{64}$/;
|
|
5
|
+
/** One path segment. Rejects separators and `..` so ids cannot escape a job directory. */
|
|
6
|
+
export const SAFE_ID_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/;
|
|
7
|
+
export function isSafeId(id) {
|
|
8
|
+
return SAFE_ID_PATTERN.test(id) && !id.includes("..");
|
|
9
|
+
}
|
|
10
|
+
const schemaVersion = z.literal(SCHEMA_VERSION);
|
|
11
|
+
const sha256 = z.string().regex(SHA256_PATTERN);
|
|
12
|
+
const safeId = z.string().refine(isSafeId, "id must be a single path segment");
|
|
13
|
+
const nonEmpty = z.string().min(1);
|
|
14
|
+
function strict(shape) {
|
|
15
|
+
return z.strictObject(shape);
|
|
16
|
+
}
|
|
17
|
+
export const fpsSchema = strict({
|
|
18
|
+
num: z.number().int().positive(),
|
|
19
|
+
den: z.number().int().positive(),
|
|
20
|
+
});
|
|
21
|
+
export const segmentTagsSchema = strict({
|
|
22
|
+
voice: nonEmpty,
|
|
23
|
+
space: nonEmpty,
|
|
24
|
+
product: nonEmpty,
|
|
25
|
+
effect: nonEmpty,
|
|
26
|
+
});
|
|
27
|
+
export const sourceSchema = strict({
|
|
28
|
+
sha256,
|
|
29
|
+
frames: z.number().int().positive(),
|
|
30
|
+
fps: fpsSchema,
|
|
31
|
+
width: z.number().int().positive(),
|
|
32
|
+
height: z.number().int().positive(),
|
|
33
|
+
has_audio: z.boolean(),
|
|
34
|
+
});
|
|
35
|
+
export const segmentSchema = strict({
|
|
36
|
+
id: safeId,
|
|
37
|
+
start_frame: z.number().int().nonnegative(),
|
|
38
|
+
end_frame: z.number().int().positive(),
|
|
39
|
+
tags: segmentTagsSchema,
|
|
40
|
+
description: nonEmpty.optional(),
|
|
41
|
+
}).superRefine((segment, ctx) => {
|
|
42
|
+
if (segment.end_frame <= segment.start_frame) {
|
|
43
|
+
ctx.addIssue({
|
|
44
|
+
code: "custom",
|
|
45
|
+
path: ["end_frame"],
|
|
46
|
+
message: "end_frame must be greater than start_frame",
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
export const effectSchema = strict({
|
|
51
|
+
template: nonEmpty,
|
|
52
|
+
start_cut: z.number().int().nonnegative(),
|
|
53
|
+
end_cut: z.number().int().nonnegative(),
|
|
54
|
+
slots: z.record(z.string(), z.unknown()),
|
|
55
|
+
assets: z.record(z.string(), z.unknown()),
|
|
56
|
+
style: z.record(z.string(), z.unknown()),
|
|
57
|
+
}).superRefine((effect, ctx) => {
|
|
58
|
+
if (effect.start_cut >= effect.end_cut) {
|
|
59
|
+
ctx.addIssue({
|
|
60
|
+
code: "custom",
|
|
61
|
+
path: ["end_cut"],
|
|
62
|
+
message: "end_cut must be greater than start_cut",
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
export const storyboardSchema = strict({
|
|
67
|
+
source: sourceSchema,
|
|
68
|
+
segments: z.array(segmentSchema).min(1),
|
|
69
|
+
effects: z.array(effectSchema),
|
|
70
|
+
}).superRefine((storyboard, ctx) => {
|
|
71
|
+
const { segments, source, effects } = storyboard;
|
|
72
|
+
const seen = new Set();
|
|
73
|
+
segments.forEach((segment, index) => {
|
|
74
|
+
if (seen.has(segment.id)) {
|
|
75
|
+
ctx.addIssue({
|
|
76
|
+
code: "custom",
|
|
77
|
+
path: ["segments", index, "id"],
|
|
78
|
+
message: `duplicate segment id ${segment.id}`,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
seen.add(segment.id);
|
|
82
|
+
if (index === 0 && segment.start_frame !== 0) {
|
|
83
|
+
ctx.addIssue({
|
|
84
|
+
code: "custom",
|
|
85
|
+
path: ["segments", index, "start_frame"],
|
|
86
|
+
message: "first segment must start at frame 0",
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
if (index > 0) {
|
|
90
|
+
const previous = segments[index - 1];
|
|
91
|
+
if (previous && segment.start_frame !== previous.end_frame) {
|
|
92
|
+
ctx.addIssue({
|
|
93
|
+
code: "custom",
|
|
94
|
+
path: ["segments", index, "start_frame"],
|
|
95
|
+
message: "segments must be contiguous, with no gaps or overlaps",
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
const last = segments[segments.length - 1];
|
|
101
|
+
if (last && last.end_frame !== source.frames) {
|
|
102
|
+
ctx.addIssue({
|
|
103
|
+
code: "custom",
|
|
104
|
+
path: ["segments", segments.length - 1, "end_frame"],
|
|
105
|
+
message: "last segment must end at source.frames",
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
// Effect indexes: 0 is the timeline start and segmentCount is the end.
|
|
109
|
+
// cutsOf returns only the interior boundaries, not 0 or the final frame.
|
|
110
|
+
const maxCut = segments.length;
|
|
111
|
+
effects.forEach((effect, index) => {
|
|
112
|
+
if (effect.start_cut > maxCut || effect.end_cut > maxCut) {
|
|
113
|
+
ctx.addIssue({
|
|
114
|
+
code: "custom",
|
|
115
|
+
path: ["effects", index],
|
|
116
|
+
message: `cut index must be in 0..${maxCut}`,
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
const jobRelativePath = z.string().refine((path) => {
|
|
122
|
+
if (path.length === 0 || path.startsWith("/") || path.includes("\\") || path.includes("\0")) {
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
const parts = path.split("/");
|
|
126
|
+
return parts.every((part) => part.length > 0 && part !== "." && part !== "..");
|
|
127
|
+
}, "path must be a job-relative path");
|
|
128
|
+
export const assetRoles = ["identity", "product", "scene", "motion_ref", "detail"];
|
|
129
|
+
export const assetSchema = strict({
|
|
130
|
+
id: safeId,
|
|
131
|
+
role: z.enum(assetRoles),
|
|
132
|
+
sha256,
|
|
133
|
+
path: jobRelativePath,
|
|
134
|
+
approved: z.boolean(),
|
|
135
|
+
attributes: z.string().optional(),
|
|
136
|
+
});
|
|
137
|
+
export const bindingSchema = strict({
|
|
138
|
+
segment: safeId,
|
|
139
|
+
asset: safeId,
|
|
140
|
+
purpose: nonEmpty,
|
|
141
|
+
});
|
|
142
|
+
export const requirementSubjects = [
|
|
143
|
+
"product",
|
|
144
|
+
"identity",
|
|
145
|
+
"scene",
|
|
146
|
+
"structure",
|
|
147
|
+
"text",
|
|
148
|
+
"audio",
|
|
149
|
+
];
|
|
150
|
+
export const requirementLevels = ["minimum", "detail"];
|
|
151
|
+
export const requirementSchema = strict({
|
|
152
|
+
id: safeId,
|
|
153
|
+
segment: safeId,
|
|
154
|
+
subject: z.enum(requirementSubjects),
|
|
155
|
+
attribute: nonEmpty,
|
|
156
|
+
source: nonEmpty.optional(),
|
|
157
|
+
level: z.enum(requirementLevels),
|
|
158
|
+
});
|
|
159
|
+
export const checkStatuses = [
|
|
160
|
+
"pass",
|
|
161
|
+
"fail",
|
|
162
|
+
"suspect",
|
|
163
|
+
"not_applicable",
|
|
164
|
+
"unsupported",
|
|
165
|
+
"error",
|
|
166
|
+
];
|
|
167
|
+
export const checkResultSchema = strict({
|
|
168
|
+
requirement: safeId.optional(),
|
|
169
|
+
segment: safeId.optional(),
|
|
170
|
+
check: nonEmpty,
|
|
171
|
+
check_version: nonEmpty,
|
|
172
|
+
status: z.enum(checkStatuses),
|
|
173
|
+
evidence: z.unknown(),
|
|
174
|
+
note: nonEmpty.optional(),
|
|
175
|
+
});
|
|
176
|
+
export const mediaSchema = strict({
|
|
177
|
+
slot: nonEmpty,
|
|
178
|
+
role: nonEmpty,
|
|
179
|
+
sha256: sha256.nullable(),
|
|
180
|
+
note: nonEmpty.optional(),
|
|
181
|
+
});
|
|
182
|
+
export const billingUnits = ["CNY", "ZEN_CREDIT"];
|
|
183
|
+
export const billingSchema = strict({
|
|
184
|
+
unit: z.enum(billingUnits),
|
|
185
|
+
quoted: z.number().nonnegative().optional(),
|
|
186
|
+
charged: z.number().nonnegative().optional(),
|
|
187
|
+
usage: z.record(z.string(), z.unknown()).optional(),
|
|
188
|
+
});
|
|
189
|
+
export const outputSchema = strict({
|
|
190
|
+
sha256,
|
|
191
|
+
frames: z.number().int().positive(),
|
|
192
|
+
fps: fpsSchema,
|
|
193
|
+
width: z.number().int().positive(),
|
|
194
|
+
height: z.number().int().positive(),
|
|
195
|
+
});
|
|
196
|
+
const timestamp = z.iso.datetime({ offset: true });
|
|
197
|
+
export const runRecordSchema = strict({
|
|
198
|
+
schema_version: schemaVersion,
|
|
199
|
+
run_id: safeId,
|
|
200
|
+
job_id: safeId,
|
|
201
|
+
parent_run: safeId.optional(),
|
|
202
|
+
changed_variable: nonEmpty.optional(),
|
|
203
|
+
hypothesis: nonEmpty.optional(),
|
|
204
|
+
spec_version: nonEmpty,
|
|
205
|
+
compiler_commit: nonEmpty.optional(),
|
|
206
|
+
model: nonEmpty,
|
|
207
|
+
channel: nonEmpty,
|
|
208
|
+
params: z.record(z.string(), z.unknown()),
|
|
209
|
+
prompt: z.string(),
|
|
210
|
+
prompt_sha256: sha256,
|
|
211
|
+
media: z.array(mediaSchema),
|
|
212
|
+
task_id: nonEmpty.optional(),
|
|
213
|
+
submitted_at: timestamp,
|
|
214
|
+
elapsed_s: z.number().nonnegative().optional(),
|
|
215
|
+
billing: billingSchema,
|
|
216
|
+
output: outputSchema.optional(),
|
|
217
|
+
checks: z.array(checkResultSchema),
|
|
218
|
+
human_verdict: nonEmpty.optional(),
|
|
219
|
+
});
|
|
220
|
+
export const jobSchema = strict({
|
|
221
|
+
schema_version: schemaVersion,
|
|
222
|
+
job_id: safeId,
|
|
223
|
+
created_at: timestamp,
|
|
224
|
+
storyboard: storyboardSchema,
|
|
225
|
+
assets: z.array(assetSchema),
|
|
226
|
+
bindings: z.array(bindingSchema),
|
|
227
|
+
requirements: z.array(requirementSchema),
|
|
228
|
+
}).superRefine((job, ctx) => {
|
|
229
|
+
const segmentIds = new Set(job.storyboard.segments.map((segment) => segment.id));
|
|
230
|
+
const assetIds = new Set();
|
|
231
|
+
job.assets.forEach((asset, index) => {
|
|
232
|
+
if (assetIds.has(asset.id)) {
|
|
233
|
+
ctx.addIssue({
|
|
234
|
+
code: "custom",
|
|
235
|
+
path: ["assets", index, "id"],
|
|
236
|
+
message: `duplicate asset id ${asset.id}`,
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
assetIds.add(asset.id);
|
|
240
|
+
});
|
|
241
|
+
const requirementIds = new Set();
|
|
242
|
+
job.requirements.forEach((requirement, index) => {
|
|
243
|
+
if (requirementIds.has(requirement.id)) {
|
|
244
|
+
ctx.addIssue({
|
|
245
|
+
code: "custom",
|
|
246
|
+
path: ["requirements", index, "id"],
|
|
247
|
+
message: `duplicate requirement id ${requirement.id}`,
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
requirementIds.add(requirement.id);
|
|
251
|
+
if (!segmentIds.has(requirement.segment)) {
|
|
252
|
+
ctx.addIssue({
|
|
253
|
+
code: "custom",
|
|
254
|
+
path: ["requirements", index, "segment"],
|
|
255
|
+
message: `unknown segment ${requirement.segment}`,
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
job.bindings.forEach((binding, index) => {
|
|
260
|
+
if (!segmentIds.has(binding.segment)) {
|
|
261
|
+
ctx.addIssue({
|
|
262
|
+
code: "custom",
|
|
263
|
+
path: ["bindings", index, "segment"],
|
|
264
|
+
message: `unknown segment ${binding.segment}`,
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
if (!assetIds.has(binding.asset)) {
|
|
268
|
+
ctx.addIssue({
|
|
269
|
+
code: "custom",
|
|
270
|
+
path: ["bindings", index, "asset"],
|
|
271
|
+
message: `unknown asset ${binding.asset}`,
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
});
|
|
276
|
+
export function parseStoryboard(value) {
|
|
277
|
+
return storyboardSchema.parse(value);
|
|
278
|
+
}
|
|
279
|
+
export function parseJob(value) {
|
|
280
|
+
return jobSchema.parse(value);
|
|
281
|
+
}
|
|
282
|
+
export function parseRunRecord(value) {
|
|
283
|
+
return runRecordSchema.parse(value);
|
|
284
|
+
}
|
|
285
|
+
/** True only for an executed pass. Every other status is not a pass. */
|
|
286
|
+
export function isPass(status) {
|
|
287
|
+
return status === "pass";
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Interior cut frames, in order. Index 0 is the timeline start and index
|
|
291
|
+
* segmentCount is the end; neither is included. Segment count is not fixed.
|
|
292
|
+
*/
|
|
293
|
+
export function cutsOf(storyboard) {
|
|
294
|
+
return storyboard.segments.slice(0, -1).map((segment) => segment.end_frame);
|
|
295
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { realpath } from 'node:fs/promises';
|
|
3
|
+
import { pathToFileURL } from 'node:url';
|
|
4
|
+
import { checkEffectsRuntime } from './effects/index.js';
|
|
5
|
+
/** Local readiness only: configuration values and server connectivity stay private. */
|
|
6
|
+
export async function checkEnvironment(env = process.env) {
|
|
7
|
+
const checks = [
|
|
8
|
+
{ name: 'Node', ok: Number(process.versions.node.split('.')[0]) >= 22 },
|
|
9
|
+
...await checkEffectsRuntime(),
|
|
10
|
+
];
|
|
11
|
+
return {
|
|
12
|
+
ok: checks.every(check => check.ok), checks,
|
|
13
|
+
config: { ZENMCP_BASE_URL: Boolean(env.ZENMCP_BASE_URL), ZENMCP_TOKEN: Boolean(env.ZENMCP_TOKEN) },
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
const entry = process.argv[1] ? await realpath(process.argv[1]).catch(() => process.argv[1]) : '';
|
|
17
|
+
if (entry && import.meta.url === pathToFileURL(entry).href) {
|
|
18
|
+
const result = await checkEnvironment();
|
|
19
|
+
console.log(JSON.stringify(result, null, 2));
|
|
20
|
+
if (!result.ok)
|
|
21
|
+
process.exitCode = 1;
|
|
22
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** CLI status alone is insufficient: overflow can have info/warning severity. */
|
|
2
|
+
export function validateCheck(stdout) {
|
|
3
|
+
let report;
|
|
4
|
+
try {
|
|
5
|
+
report = JSON.parse(stdout);
|
|
6
|
+
}
|
|
7
|
+
catch {
|
|
8
|
+
throw new Error(`hyperframes_check_invalid_json: ${stdout}`);
|
|
9
|
+
}
|
|
10
|
+
const findings = [];
|
|
11
|
+
for (const section of Object.values(report)) {
|
|
12
|
+
if (section && typeof section === 'object' && 'findings' in section && Array.isArray(section.findings)) {
|
|
13
|
+
findings.push(...section.findings.filter((f) => f.severity === 'error' || ['canvas_overflow', 'escaped_container'].includes(f.code ?? '')));
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
if (report.ok !== true || report.browserSkipped !== false || findings.length) {
|
|
17
|
+
throw new Error(`hyperframes_check_failed: ${JSON.stringify(report)}`);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/** Table offsets in the bundled OpenType font, never a system font. */
|
|
2
|
+
function tableOffset(font, tag) {
|
|
3
|
+
for (let i = 0; i < font.readUInt16BE(4); i++) {
|
|
4
|
+
const record = 12 + i * 16;
|
|
5
|
+
if (font.toString('ascii', record, record + 4) === tag)
|
|
6
|
+
return font.readUInt32BE(record + 8);
|
|
7
|
+
}
|
|
8
|
+
throw new Error(`font_${tag}_missing`);
|
|
9
|
+
}
|
|
10
|
+
function glyphLookup(font) {
|
|
11
|
+
const cmap = tableOffset(font, 'cmap');
|
|
12
|
+
const tables = [];
|
|
13
|
+
for (let i = 0; i < font.readUInt16BE(cmap + 2); i++) {
|
|
14
|
+
const record = cmap + 4 + i * 8;
|
|
15
|
+
const platform = font.readUInt16BE(record);
|
|
16
|
+
const encoding = font.readUInt16BE(record + 2);
|
|
17
|
+
if (platform === 0 || (platform === 3 && (encoding === 1 || encoding === 10))) {
|
|
18
|
+
tables.push(cmap + font.readUInt32BE(record + 4));
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return (code) => {
|
|
22
|
+
for (const offset of tables) {
|
|
23
|
+
const format = font.readUInt16BE(offset);
|
|
24
|
+
if (format === 12) {
|
|
25
|
+
for (let i = 0; i < font.readUInt32BE(offset + 12); i++) {
|
|
26
|
+
const p = offset + 16 + i * 12;
|
|
27
|
+
const start = font.readUInt32BE(p);
|
|
28
|
+
if (code >= start && code <= font.readUInt32BE(p + 4)) {
|
|
29
|
+
const glyph = font.readUInt32BE(p + 8) + code - start;
|
|
30
|
+
if (glyph)
|
|
31
|
+
return glyph;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
if (format === 4 && code <= 0xffff) {
|
|
36
|
+
const count = font.readUInt16BE(offset + 6) / 2;
|
|
37
|
+
for (let i = 0; i < count; i++) {
|
|
38
|
+
const end = font.readUInt16BE(offset + 14 + i * 2);
|
|
39
|
+
const start = font.readUInt16BE(offset + 16 + count * 2 + i * 2);
|
|
40
|
+
if (code < start || code > end)
|
|
41
|
+
continue;
|
|
42
|
+
const delta = font.readInt16BE(offset + 16 + count * 4 + i * 2);
|
|
43
|
+
const rangePos = offset + 16 + count * 6 + i * 2;
|
|
44
|
+
const range = font.readUInt16BE(rangePos);
|
|
45
|
+
if (range === 0) {
|
|
46
|
+
const glyph = (code + delta) & 0xffff;
|
|
47
|
+
if (glyph)
|
|
48
|
+
return glyph;
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
const glyph = font.readUInt16BE(rangePos + range + (code - start) * 2);
|
|
52
|
+
const mapped = (glyph + delta) & 0xffff;
|
|
53
|
+
if (glyph !== 0 && mapped !== 0)
|
|
54
|
+
return mapped;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return 0;
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
/** Read Unicode cmap entries from the bundled font. */
|
|
62
|
+
export function assertFontCoverage(font, text) {
|
|
63
|
+
const glyphId = glyphLookup(font);
|
|
64
|
+
const missing = [...new Set(Array.from(text))].filter(ch => !glyphId(ch.codePointAt(0)));
|
|
65
|
+
if (missing.length)
|
|
66
|
+
throw new Error(`missing_glyph: ${missing.map(ch => `${ch} (U+${ch.codePointAt(0).toString(16).toUpperCase()})`).join(', ')}`);
|
|
67
|
+
}
|
|
68
|
+
/** Sum advances for individually rendered glyph spans (no cross-span shaping). */
|
|
69
|
+
export function advanceWidthEm(font, text) {
|
|
70
|
+
const glyphId = glyphLookup(font);
|
|
71
|
+
const unitsPerEm = font.readUInt16BE(tableOffset(font, 'head') + 18);
|
|
72
|
+
const numberOfHMetrics = font.readUInt16BE(tableOffset(font, 'hhea') + 34);
|
|
73
|
+
const hmtx = tableOffset(font, 'hmtx');
|
|
74
|
+
return Array.from(text).reduce((sum, ch) => {
|
|
75
|
+
const metric = Math.min(glyphId(ch.codePointAt(0)), numberOfHMetrics - 1);
|
|
76
|
+
return sum + font.readUInt16BE(hmtx + metric * 4) / unitsPerEm;
|
|
77
|
+
}, 0);
|
|
78
|
+
}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { execFile } from 'node:child_process';
|
|
2
|
+
import { promisify } from 'node:util';
|
|
3
|
+
import { createRequire } from 'node:module';
|
|
4
|
+
import { dirname, join, resolve } from 'node:path';
|
|
5
|
+
import { fileURLToPath } from 'node:url';
|
|
6
|
+
import { access, copyFile, cp, mkdir, mkdtemp, readFile, rm, writeFile, rename } from 'node:fs/promises';
|
|
7
|
+
import { parseJob, cutsOf, effectSchema, sha256String } from '../core/index.js';
|
|
8
|
+
import { probe } from '../timeline/index.js';
|
|
9
|
+
import { assertFontCoverage, advanceWidthEm } from './font.js';
|
|
10
|
+
import { validateCheck } from './check.js';
|
|
11
|
+
const exec = promisify(execFile);
|
|
12
|
+
const FONT_SIZE_RATIO = 0.092;
|
|
13
|
+
const template = fileURLToPath(new URL('../../templates/pop-title/', import.meta.url));
|
|
14
|
+
const cli = join(dirname(createRequire(import.meta.url).resolve('hyperframes/package.json')), 'bin/hyperframes.mjs');
|
|
15
|
+
const SAFE_ENV_KEYS = [
|
|
16
|
+
'PATH', 'HOME', 'TMPDIR', 'TEMP', 'TMP', 'USER', 'LOGNAME', 'LANG', 'LC_ALL', 'LC_CTYPE',
|
|
17
|
+
'DISPLAY', 'XDG_CONFIG_HOME', 'XDG_CACHE_HOME', 'XDG_RUNTIME_DIR',
|
|
18
|
+
'SYSTEMROOT', 'SYSTEMDRIVE', 'WINDIR', 'LOCALAPPDATA', 'APPDATA', 'PROGRAMFILES', 'PROGRAMFILES(X86)', 'COMMONPROGRAMFILES',
|
|
19
|
+
'CHROME_PATH', 'PUPPETEER_EXECUTABLE_PATH', 'FONTCONFIG_FILE', 'FONTCONFIG_PATH',
|
|
20
|
+
];
|
|
21
|
+
/** Pass only OS/runtime locator variables to child processes; never forward ZENMCP_TOKEN or arbitrary env secrets. */
|
|
22
|
+
export function childEnv(source = process.env) {
|
|
23
|
+
const picked = {
|
|
24
|
+
HYPERFRAMES_NO_TELEMETRY: '1',
|
|
25
|
+
HYPERFRAMES_NO_UPDATE_CHECK: '1',
|
|
26
|
+
HYPERFRAMES_SKIP_SKILLS: '1',
|
|
27
|
+
HYPERFRAMES_AGENT: '1',
|
|
28
|
+
};
|
|
29
|
+
for (const key of SAFE_ENV_KEYS) {
|
|
30
|
+
if (source[key] !== undefined)
|
|
31
|
+
picked[key] = source[key];
|
|
32
|
+
}
|
|
33
|
+
return picked;
|
|
34
|
+
}
|
|
35
|
+
async function hyperframes(args, allowFailure = false) {
|
|
36
|
+
try {
|
|
37
|
+
return (await exec(process.execPath, [cli, ...args], { env: childEnv(), maxBuffer: 16 * 1024 * 1024, timeout: 180_000 })).stdout;
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
const e = error;
|
|
41
|
+
if (allowFailure && typeof e.code === 'number' && e.stdout?.trim())
|
|
42
|
+
return e.stdout;
|
|
43
|
+
throw new Error(`hyperframes_failed: ${e.message}\n${e.stdout ?? ''}\n${e.stderr ?? ''}`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
/** Doctor keeps its numeric exit verdict alongside diagnostics; crashes fail closed. */
|
|
47
|
+
async function doctorRuntime() {
|
|
48
|
+
try {
|
|
49
|
+
const { stdout } = await exec(process.execPath, [cli, 'doctor', '--json'], { env: childEnv(), maxBuffer: 16 * 1024 * 1024, timeout: 180_000 });
|
|
50
|
+
return { stdout, code: 0 };
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
const e = error;
|
|
54
|
+
if (typeof e.code === 'number' && Number.isInteger(e.code) && !e.signal && !e.killed && typeof e.stdout === 'string') {
|
|
55
|
+
return { stdout: e.stdout, code: e.code };
|
|
56
|
+
}
|
|
57
|
+
return { stdout: '', code: null };
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
const runtimeNames = ['Chrome', 'FFmpeg', 'FFprobe'];
|
|
61
|
+
/** Read only required check names; never expose doctor details or paths. */
|
|
62
|
+
export function runtimeIssues(doctorJson, exitCode = 0) {
|
|
63
|
+
try {
|
|
64
|
+
const doctor = JSON.parse(doctorJson);
|
|
65
|
+
const checks = doctor && typeof doctor === 'object' && 'checks' in doctor ? doctor.checks : undefined;
|
|
66
|
+
if (!Array.isArray(checks))
|
|
67
|
+
return [...runtimeNames];
|
|
68
|
+
const failed = runtimeNames.filter(name => {
|
|
69
|
+
const matches = checks.filter(check => check && typeof check === 'object' && check.name === name);
|
|
70
|
+
return matches.length !== 1 || matches[0].ok !== true;
|
|
71
|
+
});
|
|
72
|
+
return exitCode !== 0 && !failed.length ? [...runtimeNames] : failed;
|
|
73
|
+
}
|
|
74
|
+
catch {
|
|
75
|
+
return [...runtimeNames];
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
export async function checkEffectsRuntime() {
|
|
79
|
+
const doctor = await doctorRuntime();
|
|
80
|
+
const issues = doctor.code === null ? [...runtimeNames] : runtimeIssues(doctor.stdout, doctor.code);
|
|
81
|
+
const checks = runtimeNames.map(name => ({ name, ok: !issues.includes(name) }));
|
|
82
|
+
for (const name of ['render.js', 'vendor/NotoSansCJKsc-Bold.otf']) {
|
|
83
|
+
const ok = await access(join(template, name)).then(() => true, () => false);
|
|
84
|
+
checks.push({ name, ok });
|
|
85
|
+
}
|
|
86
|
+
return checks;
|
|
87
|
+
}
|
|
88
|
+
/** Bind one immutable Job to the frozen engine renderer interface. */
|
|
89
|
+
export class PopTitleRenderer {
|
|
90
|
+
version;
|
|
91
|
+
job;
|
|
92
|
+
constructor(job) {
|
|
93
|
+
this.job = parseJob(structuredClone(job));
|
|
94
|
+
// Engine hashes the version: include the bound timeline/canvas as well.
|
|
95
|
+
this.version = `pop-title-v2/hyperframes-0.9.16/${sha256String(JSON.stringify(this.job.storyboard))}`;
|
|
96
|
+
}
|
|
97
|
+
async checkRuntime() {
|
|
98
|
+
const failed = (await checkEffectsRuntime()).filter(check => !check.ok).map(check => check.name);
|
|
99
|
+
if (failed.length)
|
|
100
|
+
throw new Error(`effect_runtime_unavailable: ${failed.join(', ')}`);
|
|
101
|
+
}
|
|
102
|
+
async author(layers) {
|
|
103
|
+
const source = this.job.storyboard.source;
|
|
104
|
+
const cuts = [0, ...cutsOf(this.job.storyboard), source.frames];
|
|
105
|
+
const font = await readFile(join(template, 'vendor/NotoSansCJKsc-Bold.otf')).catch(() => { throw new Error('effect_font_unavailable'); });
|
|
106
|
+
return layers.map((input, effect) => {
|
|
107
|
+
const layer = effectSchema.parse(input);
|
|
108
|
+
if (layer.template !== 'pop-title')
|
|
109
|
+
throw new Error(`unsupported_effect_template: ${layer.template}`);
|
|
110
|
+
const start_frame = cuts[layer.start_cut];
|
|
111
|
+
const end_frame = cuts[layer.end_cut];
|
|
112
|
+
if (start_frame === undefined || end_frame === undefined)
|
|
113
|
+
throw new Error('effect_cut_out_of_range');
|
|
114
|
+
const lines = layer.slots.lines;
|
|
115
|
+
if (!Array.isArray(lines) || lines.length < 1 || lines.length > 2 || !lines.every(l => typeof l === 'string' && l.length > 0))
|
|
116
|
+
throw new Error('pop_title_lines: expected one or two nonempty strings');
|
|
117
|
+
if (Object.keys(layer.slots).some(k => k !== 'lines') || Object.keys(layer.assets).length || Object.keys(layer.style).some(k => !['position', 'color'].includes(k)))
|
|
118
|
+
throw new Error('unsupported_pop_title_parameter');
|
|
119
|
+
assertFontCoverage(font, lines.join(''));
|
|
120
|
+
const position = layer.style.position;
|
|
121
|
+
if (position !== undefined && (!position || typeof position !== 'object' || Array.isArray(position) || Object.keys(position).some(k => !['x', 'y'].includes(k))))
|
|
122
|
+
throw new Error('pop_title_position: expected {x, y}');
|
|
123
|
+
const x = position?.x ?? 0.5;
|
|
124
|
+
const y = position?.y ?? 0.52;
|
|
125
|
+
if (typeof x !== 'number' || typeof y !== 'number' || !Number.isFinite(x) || !Number.isFinite(y) || x < 0 || x > 1 || y < 0 || y > 1)
|
|
126
|
+
throw new Error('pop_title_position: expected fractions in 0..1');
|
|
127
|
+
const color = layer.style.color ?? '#ffffff';
|
|
128
|
+
if (typeof color !== 'string' || !/^#[\da-f]{6}$/i.test(color))
|
|
129
|
+
throw new Error('pop_title_color: expected #RRGGBB');
|
|
130
|
+
const size = Math.round(source.width * FONT_SIZE_RATIO);
|
|
131
|
+
// Chrome rounds each inline-block advance to 1/64px. Do not spend check's 2px tolerance.
|
|
132
|
+
const width = Math.max(...lines.map(line => advanceWidthEm(font, line) * size + Array.from(line).length / 64));
|
|
133
|
+
const height = lines.length * Math.ceil(size * 1.08 * 64) / 64;
|
|
134
|
+
// Bundled font Range boxes extend beyond 1.08 line boxes; calibrated at 29/99px.
|
|
135
|
+
// .224em bounds that extension, .04em is half the stroke, shadow adds .08/.1em.
|
|
136
|
+
const left = size * 0.04 + 1;
|
|
137
|
+
const right = size * 0.12 + 1;
|
|
138
|
+
const top = size * (0.224 + 0.04) + 1;
|
|
139
|
+
const bottom = size * (0.224 + 0.14) + 1;
|
|
140
|
+
if (x * source.width - width / 2 < left || (1 - x) * source.width - width / 2 < right ||
|
|
141
|
+
y * source.height - height / 2 < top || (1 - y) * source.height - height / 2 < bottom) {
|
|
142
|
+
throw new Error('pop_title_overflow');
|
|
143
|
+
}
|
|
144
|
+
return { effect, start_frame, end_frame, lines, x, y, color };
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
async validate(layers) {
|
|
148
|
+
await this.author(layers);
|
|
149
|
+
}
|
|
150
|
+
async render(base, layers, output) {
|
|
151
|
+
const authored = await this.author(layers);
|
|
152
|
+
const source = this.job.storyboard.source;
|
|
153
|
+
const facts = await probe(base);
|
|
154
|
+
if (facts.frames !== source.frames || facts.fps.num * source.fps.den !== source.fps.num * facts.fps.den)
|
|
155
|
+
throw new Error('effect_base_timeline_mismatch');
|
|
156
|
+
output = resolve(output);
|
|
157
|
+
await mkdir(dirname(output), { recursive: true });
|
|
158
|
+
const work = await mkdtemp(join(dirname(output), '.pop-title-'));
|
|
159
|
+
try {
|
|
160
|
+
await cp(join(template, 'vendor'), join(work, 'vendor'), { recursive: true });
|
|
161
|
+
await copyFile(join(template, 'render.js'), join(work, 'render.js'));
|
|
162
|
+
// Remove audio before HyperFrames sees the asset. The engine owns mixing.
|
|
163
|
+
await exec('ffmpeg', ['-v', 'error', '-y', '-i', resolve(base), '-map', '0:v:0', '-c:v', 'copy', '-an', join(work, 'base.mp4')], { env: childEnv() });
|
|
164
|
+
const fps = source.fps.num / source.fps.den;
|
|
165
|
+
const duration = source.frames / fps;
|
|
166
|
+
const config = JSON.stringify({ fps, duration, layers: authored }).replace(/</g, '\\u003c');
|
|
167
|
+
await writeFile(join(work, 'index.html'), `<!doctype html><html><head><meta charset="utf-8"><script src="vendor/gsap.min.js"></script><style>
|
|
168
|
+
@font-face{font-family:PopTitle;src:url('vendor/NotoSansCJKsc-Bold.otf');font-weight:700}
|
|
169
|
+
html,body{margin:0;background:#000}#root{position:relative;width:${source.width}px;height:${source.height}px;overflow:hidden;background:#000}
|
|
170
|
+
#base{position:absolute;inset:0;width:100%;height:100%;object-fit:contain}
|
|
171
|
+
.title{position:absolute;transform:translate(-50%,-50%);text-align:center;white-space:nowrap;font:700 ${Math.round(source.width * FONT_SIZE_RATIO)}px/1.08 PopTitle}
|
|
172
|
+
.glyph{display:inline-block;opacity:0;transform:scale(.35);-webkit-text-stroke:.08em #1a1a1a;paint-order:stroke fill;text-shadow:.08em .1em 0 rgba(0,0,0,.72)}
|
|
173
|
+
</style></head><body><div id="root" data-composition-id="pop-title" data-start="0" data-duration="${duration}" data-fps="${fps}" data-width="${source.width}" data-height="${source.height}"><video id="base" src="base.mp4" data-start="0" data-duration="${duration}" data-track-index="0" data-has-audio="false" muted playsinline></video></div><script type="application/json" id="task">${config}</script><script src="render.js"></script></body></html>`);
|
|
174
|
+
const times = [...new Set(authored.flatMap(l => [l.start_frame + (l.end_frame - l.start_frame) * 0.25, l.start_frame + (l.end_frame - l.start_frame) * 0.6]).map(f => f / fps))];
|
|
175
|
+
validateCheck(await hyperframes(['check', work, '--json', ...(times.length ? ['--at', times.join(',')] : []), '--timeout', '90000'], true));
|
|
176
|
+
const rendered = join(work, 'rendered.mp4');
|
|
177
|
+
await hyperframes(['render', work, '--fps', `${source.fps.num}/${source.fps.den}`, '--quality', 'looks', '--output', rendered]);
|
|
178
|
+
const result = await probe(rendered);
|
|
179
|
+
if (result.frames !== source.frames || result.width !== source.width || result.height !== source.height || result.has_audio || result.fps.num * source.fps.den !== source.fps.num * result.fps.den)
|
|
180
|
+
throw new Error(`effect_output_mismatch: ${JSON.stringify(result)}`);
|
|
181
|
+
await rename(rendered, output);
|
|
182
|
+
return { path: output, ranges: authored.map(({ effect, start_frame, end_frame }) => ({ effect, start_frame, end_frame })) };
|
|
183
|
+
}
|
|
184
|
+
finally {
|
|
185
|
+
await rm(work, { recursive: true, force: true });
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { redact } from '../gateway/index.js';
|
|
2
|
+
// Presentation only: never contributes to a step's output or hash.
|
|
3
|
+
// Shared terminators; dots, colons and query markers inside filenames/URLs stay in the token.
|
|
4
|
+
const TEXT_TOKEN = /[^\s\p{Pi}\p{Pf}\p{Pe}"'``"'<><>〈《,。;!?、,;!||]+/u.source;
|
|
5
|
+
const LINKS = new RegExp(String.raw `\b(?:[A-Za-z][A-Za-z0-9+.-]*:\/\/|file:)${TEXT_TOKEN}`, 'giu');
|
|
6
|
+
const PATHS = new RegExp(String.raw `(?<![\p{L}\p{N}._~-])(?:\/|~\/|[A-Za-z]:[\\/]|\\\\)${TEXT_TOKEN}|(?<![A-Za-z0-9._~-])(?:\/[A-Za-z0-9._~-]+){3,}`, 'gu');
|
|
7
|
+
// A slash followed by non-whitespace is sensitive unless A: its prefix is ASCII letter/digit/._~-, or B: its prefix is a non-ASCII letter/digit and every character until whitespace/end is non-ASCII. Unattached ~/home remains sensitive.
|
|
8
|
+
// Do not combine i and u: Unicode folding makes U+212A/U+017F match ASCII classes.
|
|
9
|
+
const SENSITIVE_TOKENS = /[a-z][a-z0-9+.-]*:\/\/|\bfile:\S|[a-z]:[\\/]|\\\\|zk_(?:live|test)_|Bearer\s/i;
|
|
10
|
+
const SENSITIVE_SLASHES = new RegExp(String.raw `(?<![\p{L}\p{N}._~-])~\/\S|(?<![A-Za-z0-9._~-])\/(?!(?<=[\p{L}\p{N}]\/)[^\s\x00-\x7F]+(?:\s|$))\S`, 'u');
|
|
11
|
+
export function containsSensitiveText(text) {
|
|
12
|
+
return SENSITIVE_TOKENS.test(text) || SENSITIVE_SLASHES.test(text);
|
|
13
|
+
}
|
|
14
|
+
const cell = (value) => redact(String(value ?? '')
|
|
15
|
+
.replace(LINKS, '[链接已隐藏]')
|
|
16
|
+
.replace(PATHS, '[路径已隐藏]'))
|
|
17
|
+
.replace(/\|/g, '|').replace(/[\r\n]+/g, ' ');
|
|
18
|
+
const filename = (path) => path.split(/[\\/]/).pop() ?? '';
|
|
19
|
+
export function planCard(input, planData, issues, planDigest) {
|
|
20
|
+
const { job, output } = input;
|
|
21
|
+
const source = job.storyboard.source;
|
|
22
|
+
const seconds = (frame) => Number((frame * source.fps.den / source.fps.num).toFixed(6));
|
|
23
|
+
const rows = job.storyboard.segments.map(segment => {
|
|
24
|
+
const products = job.bindings.filter(b => b.segment === segment.id).flatMap(b => job.assets.filter(a => a.id === b.asset && a.role === 'product'));
|
|
25
|
+
return `| ${cell(segment.id)} | ${seconds(segment.start_frame)} | ${seconds(segment.end_frame)} | ${cell(products.map(a => a.id).join('、'))} | ${cell(products.map(a => a.attributes ?? '待确认').join(';'))} |`;
|
|
26
|
+
});
|
|
27
|
+
const roles = { identity: '身份', motion_ref: '动作参考', product: '服装', scene: '场景', detail: '细节' };
|
|
28
|
+
const assets = job.assets.map(a => `| ${cell(a.id)} | ${roles[a.role]} | ${cell(a.path)} | ${a.approved ? '已批准' : '待批准'} |`);
|
|
29
|
+
const lines = [
|
|
30
|
+
'# 执行计划', '', `**目录标识:${cell(planData.catalog)}**`, '',
|
|
31
|
+
'## 结构', '', '| 段落 | 开始(秒) | 结束(秒) | 产品素材 | 已确认属性 |', '| --- | --- | --- | --- | --- |', ...rows, '',
|
|
32
|
+
'## 素材', '', '| 素材 | 角色 | 任务相对路径 | 批准状态 |', '| --- | --- | --- | --- |', ...assets, '',
|
|
33
|
+
];
|
|
34
|
+
if (job.storyboard.effects.length) {
|
|
35
|
+
lines.push('## 标题特效', '', '| 文案 | 段落范围 |', '| --- | --- |');
|
|
36
|
+
for (const layer of job.storyboard.effects)
|
|
37
|
+
lines.push(`| ${cell(Array.isArray(layer.slots.lines) ? layer.slots.lines.join(';') : layer.slots.lines)} | ${cell(job.storyboard.segments[layer.start_cut]?.id)} 至 ${cell(job.storyboard.segments[layer.end_cut - 1]?.id)} |`);
|
|
38
|
+
lines.push('');
|
|
39
|
+
}
|
|
40
|
+
lines.push('## 输出', '', `时长:${output.duration_seconds} 秒;分辨率:${output.resolution};比例:${cell(output.ratio)}。`, `参考:${cell(filename(input.reference))}。音源:${input.audio ? `用户音频(${cell(filename(input.audio))})` : source.has_audio ? `参考音频(${cell(filename(input.reference))})` : '静音'}。`, '', '## 预算', '', '| 项目 | 积分 |', '| --- | --- |');
|
|
41
|
+
for (const item of planData.lineItems)
|
|
42
|
+
lines.push(`| ${cell(item.operation)} | ${item.credits} |`);
|
|
43
|
+
lines.push('', `重试预留上限:${planData.retryReserveCredits} 积分,仅在实际重试时使用,不是已收取费用。`, `**总预算上限:${planData.totalCredits} 积分(${cell(planData.currency)})**`, '');
|
|
44
|
+
if (planDigest)
|
|
45
|
+
lines.push(`计划摘要:\`${cell(planDigest)}\``, '');
|
|
46
|
+
if (issues.length)
|
|
47
|
+
lines.push('## 编译器警告', '', ...issues.map(i => `- ${cell(i.code)}:${cell(i.message)}${i.segment ? `(${cell(i.segment)})` : ''}`), '');
|
|
48
|
+
lines.push('确认总预算才授权执行;服装和身份仍需人工验收。', '付款前如需纠正,请使用 plan_job 携带新 input,在同一目录重新规划。');
|
|
49
|
+
return lines.join('\n');
|
|
50
|
+
}
|