gooseworks 0.6.0-dev.62.a550dc87 → 0.6.0-dev.65.357aa08a
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/kit/core/assembly-timeline.d.ts +79 -8
- package/dist/kit/core/assembly-timeline.d.ts.map +1 -1
- package/dist/kit/core/assembly-timeline.js +228 -18
- package/dist/kit/core/assembly-timeline.js.map +1 -1
- package/dist/kit/core/eyes.d.ts +6 -0
- package/dist/kit/core/eyes.d.ts.map +1 -1
- package/dist/kit/core/eyes.js +2 -2
- package/dist/kit/core/eyes.js.map +1 -1
- package/dist/kit/core/final-measure.d.ts +138 -0
- package/dist/kit/core/final-measure.d.ts.map +1 -0
- package/dist/kit/core/final-measure.js +492 -0
- package/dist/kit/core/final-measure.js.map +1 -0
- package/dist/kit/core/run.d.ts +7 -0
- package/dist/kit/core/run.d.ts.map +1 -1
- package/dist/kit/core/run.js +99 -17
- package/dist/kit/core/run.js.map +1 -1
- package/dist/kit/core/version.d.ts +1 -0
- package/dist/kit/core/version.d.ts.map +1 -1
- package/dist/kit/core/version.js +2 -1
- package/dist/kit/core/version.js.map +1 -1
- package/dist/kit/maker/inputs.js +1 -1
- package/dist/kit/maker/make.d.ts +6 -0
- package/dist/kit/maker/make.d.ts.map +1 -1
- package/dist/kit/maker/make.js +17 -4
- package/dist/kit/maker/make.js.map +1 -1
- package/dist/kit/maker/parts/html-frames/{1.3.0 → 1.3.1}/part.json +1 -1
- package/dist/kit/maker/under.d.ts +2 -0
- package/dist/kit/maker/under.d.ts.map +1 -1
- package/dist/kit/maker/under.js +7 -1
- package/dist/kit/maker/under.js.map +1 -1
- package/dist/skills/server-entry-skills.d.ts +1 -1
- package/dist/skills/server-entry-skills.d.ts.map +1 -1
- package/dist/skills/server-entry-skills.js +6 -6
- package/dist/skills/server-entry-skills.js.map +1 -1
- package/package.json +4 -3
- package/skills/make-custom-video/SKILL.md +5 -6
- package/skills/manifest.json +2 -2
package/dist/kit/core/run.js
CHANGED
|
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.TAKE_FIT_WORDS = exports.TAKE_FIT_PARTS = exports.CEILING_WORDS = exports.RUN_CEILING_MIN_MS = exports.RUN_CEILING_MAX_MS = exports.LAYER_ORDER = void 0;
|
|
36
|
+
exports.WAITING_FOR_MEASURED_FIX = exports.WAITING_FOR_CONTENT_REVIEW = exports.WAITING_FOR_SOURCE_REVIEW = exports.TAKE_FIT_WORDS = exports.TAKE_FIT_PARTS = exports.CEILING_WORDS = exports.RUN_CEILING_MIN_MS = exports.RUN_CEILING_MAX_MS = exports.LAYER_ORDER = void 0;
|
|
37
37
|
exports.expectationOf = expectationOf;
|
|
38
38
|
exports.startLine = startLine;
|
|
39
39
|
exports.makeVideo = makeVideo;
|
|
@@ -58,6 +58,7 @@ const types_1 = require("../line/types");
|
|
|
58
58
|
const bind_1 = require("./bind");
|
|
59
59
|
const eyes_1 = require("./eyes");
|
|
60
60
|
const assembly_timeline_1 = require("./assembly-timeline");
|
|
61
|
+
const final_measure_1 = require("./final-measure");
|
|
61
62
|
const outcome_1 = require("./outcome");
|
|
62
63
|
const canonical_1 = require("./canonical");
|
|
63
64
|
const device_1 = require("./device");
|
|
@@ -140,6 +141,13 @@ const REPORTED_STOPS = new Map([
|
|
|
140
141
|
['file_unavailable', 'file_unavailable'],
|
|
141
142
|
['piece_lost', 'piece_lost'],
|
|
142
143
|
]);
|
|
144
|
+
/**
|
|
145
|
+
* The card's notes while a custom video waits on its maker's agent (plain words, at most 200
|
|
146
|
+
* characters, never a path). The run is still on: the same command resumes it.
|
|
147
|
+
*/
|
|
148
|
+
exports.WAITING_FOR_SOURCE_REVIEW = 'Waiting for the new clips to be reviewed before the edit goes on';
|
|
149
|
+
exports.WAITING_FOR_CONTENT_REVIEW = 'Waiting for the finished video’s picture and sound review before it is sent';
|
|
150
|
+
exports.WAITING_FOR_MEASURED_FIX = 'The finished video failed a sound or picture measurement and is being fixed before it is sent';
|
|
143
151
|
/** At most this many warnings go up with the video, for its delivery summary. */
|
|
144
152
|
const MAX_SENT_WARNINGS = 6;
|
|
145
153
|
/** What the final check noted without failing the video, in its own words. */
|
|
@@ -747,6 +755,19 @@ class Maker {
|
|
|
747
755
|
this.failureResumable = resumable;
|
|
748
756
|
void this.reporter.fail({ step: step.slice(0, 60), code: FAILURE_CODE.test(code) ? code : 'change_request', detail: detail.trim().slice(0, 2000), ...(fromPart === undefined ? {} : { from_part: fromPart }) });
|
|
749
757
|
}
|
|
758
|
+
/**
|
|
759
|
+
* A stop that waits on a review or a fix the agent makes: before the kit exits, the line hears a
|
|
760
|
+
* running report with a plain note, so the card says what it waits for instead of going quiet.
|
|
761
|
+
* Never throws; a report that can't be sent only costs the card its note.
|
|
762
|
+
*/
|
|
763
|
+
async reportWaiting(note) {
|
|
764
|
+
if (!this.reporter || this.reporter.refused)
|
|
765
|
+
return;
|
|
766
|
+
this.book.note = note;
|
|
767
|
+
this.reporter.resume();
|
|
768
|
+
await this.reporter.send(true).catch(() => undefined);
|
|
769
|
+
await this.reporter.flush().catch(() => undefined);
|
|
770
|
+
}
|
|
750
771
|
async saveRun() {
|
|
751
772
|
this.run.updated_at = this.now().toISOString();
|
|
752
773
|
await this.store.writeRun(this.run);
|
|
@@ -1023,15 +1044,16 @@ class Maker {
|
|
|
1023
1044
|
out.timeline = ordinary;
|
|
1024
1045
|
}
|
|
1025
1046
|
};
|
|
1047
|
+
/**
|
|
1048
|
+
* The declaration rule: a part gets the source-linked timeline only where its input schema
|
|
1049
|
+
* declares `assembly_timeline`, as a top-level input or inside an object input (its `timeline`,
|
|
1050
|
+
* `under_timeline` or any other, after following local `$ref`s). Older parts never see it.
|
|
1051
|
+
* Returns whether the part declared it, so its answer may carry the timeline back.
|
|
1052
|
+
*/
|
|
1026
1053
|
const exposeAssemblyToDeclaredSchema = (loaded, inputs) => {
|
|
1027
|
-
if (!assemblyRaw)
|
|
1028
|
-
return;
|
|
1029
1054
|
const root = loaded.manifest.inputs;
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
1033
|
-
continue;
|
|
1034
|
-
let schema = root.properties?.[key];
|
|
1055
|
+
const declares = (node) => {
|
|
1056
|
+
let schema = node;
|
|
1035
1057
|
for (let depth = 0; depth < 8 && typeof schema?.$ref === 'string' && schema.$ref.startsWith('#/'); depth++) {
|
|
1036
1058
|
let target = root;
|
|
1037
1059
|
for (const name of schema.$ref.slice(2).split('/'))
|
|
@@ -1039,9 +1061,20 @@ class Maker {
|
|
|
1039
1061
|
schema = target && typeof target === 'object' ? target : undefined;
|
|
1040
1062
|
}
|
|
1041
1063
|
const properties = schema?.properties;
|
|
1042
|
-
|
|
1064
|
+
return !!properties && Object.prototype.hasOwnProperty.call(properties, 'assembly_timeline');
|
|
1065
|
+
};
|
|
1066
|
+
let declared = declares(root);
|
|
1067
|
+
if (declared && assemblyRaw)
|
|
1068
|
+
inputs.assembly_timeline = assemblyRaw;
|
|
1069
|
+
const properties = (root.properties ?? {});
|
|
1070
|
+
for (const [key, value] of Object.entries(inputs)) {
|
|
1071
|
+
if (key === 'assembly_timeline' || !value || typeof value !== 'object' || Array.isArray(value) || (0, canonical_1.isFileRef)(value) || !declares(properties[key]))
|
|
1072
|
+
continue;
|
|
1073
|
+
declared = true;
|
|
1074
|
+
if (assemblyRaw)
|
|
1043
1075
|
inputs[key] = { ...value, assembly_timeline: assemblyRaw };
|
|
1044
1076
|
}
|
|
1077
|
+
return declared;
|
|
1045
1078
|
};
|
|
1046
1079
|
const fixes = this.run.fixes ?? [];
|
|
1047
1080
|
const fixed = (id, inputs) => {
|
|
@@ -1093,6 +1126,7 @@ class Maker {
|
|
|
1093
1126
|
await (0, save_1.writeJson)(request, { step: step.id, inputs_revision: creatorPending ? (0, canonical_1.canonicalHash)((0, canonical_1.hashView)(inputs)) : voiceInputRevision, outputs: out,
|
|
1094
1127
|
instructions: creatorPending ? 'Review the actual source clips with moving picture and audio using the existing ingredient review. Save accepted_sources and qualification under this step in source-reviews.json, then resume the same command. Do not alter the approved script, capture or budget. Failed or incomplete source reviews cannot enter assembly.' : 'Listen to every actual source and finished voice track, including word endings and joins. Save voice_reviews under this step in source-reviews.json. Each record needs source_sha256, this inputs_revision, status pass, reviewer, audio_listened true, start_s 0, end_s covering the whole source, and checks script/voice/pronunciation/performance pass. If measured alignment is missing, also supply reviewed_alignments with tag-free spoken timings. No script, voice or model change is authorized by these review records.',
|
|
1095
1128
|
review_file: sourceReviewPath });
|
|
1129
|
+
await this.reportWaiting(exports.WAITING_FOR_SOURCE_REVIEW);
|
|
1096
1130
|
throw new errors_1.KitStop(`A source candidate is saved for review at ${request}. Save its actual review in ${sourceReviewPath}, then resume this command; existing paid pieces are reused.`, 'stop', 'source_review_incomplete');
|
|
1097
1131
|
}
|
|
1098
1132
|
}
|
|
@@ -1116,13 +1150,18 @@ class Maker {
|
|
|
1116
1150
|
const loaded = this.parts.get(id);
|
|
1117
1151
|
const ref = { id: loaded.manifest.id, version: loaded.manifest.version };
|
|
1118
1152
|
const { inputs, round } = fixed(id, { video: cut, timeline, brand: this.brand, expect: expectationOf(this.style.style, this.handed.plan), ...(words ? { words } : {}) });
|
|
1119
|
-
exposeAssemblyToDeclaredSchema(loaded, inputs);
|
|
1153
|
+
const linked = exposeAssemblyToDeclaredSchema(loaded, inputs);
|
|
1120
1154
|
const out = await this.runStep({ id, ref, loaded, inputs, models: this.modelsOf(ref, loaded), fix: round }, hashes);
|
|
1121
|
-
acceptTimeline(out);
|
|
1122
1155
|
if (slot === 'check') {
|
|
1156
|
+
// The check judges the video; it never replaces its timeline or its source-linked edit.
|
|
1157
|
+
collectFiles(out);
|
|
1123
1158
|
verdict = out.verdict;
|
|
1124
1159
|
continue;
|
|
1125
1160
|
}
|
|
1161
|
+
acceptTimeline(out);
|
|
1162
|
+
if (assemblyRaw && !linked && (slot === 'sound' || slot === 'captions')) {
|
|
1163
|
+
this.deps.log.write('warn', 'a layer cannot update the source-linked timeline', { step: id, part: `${ref.id}@${ref.version}`, note: 'its changes are checked only by the final measurements' });
|
|
1164
|
+
}
|
|
1126
1165
|
const video = out.video;
|
|
1127
1166
|
if (!(0, canonical_1.isFileRef)(video) || video.media !== 'video') {
|
|
1128
1167
|
this.deps.log.write('error', 'layer made no video', { step: id });
|
|
@@ -1160,6 +1199,17 @@ class Maker {
|
|
|
1160
1199
|
const actual = await sourceProbe(file.path);
|
|
1161
1200
|
if (sourcePictures.length && !actual.has_video)
|
|
1162
1201
|
throw new errors_1.KitStop(`A picture source has no readable picture: ${source.asset_id}`, 'change_request', 'output_invalid');
|
|
1202
|
+
for (const { source: shown } of sourcePictures) {
|
|
1203
|
+
const crop = shown.crop;
|
|
1204
|
+
if (!crop)
|
|
1205
|
+
continue;
|
|
1206
|
+
if (!actual.width || !actual.height || crop.x + crop.w > actual.width || crop.y + crop.h > actual.height)
|
|
1207
|
+
throw new errors_1.KitStop(`A picture crop is outside its ${actual.width ?? '?'}×${actual.height ?? '?'} source: ${source.asset_id}`, 'change_request', 'output_invalid');
|
|
1208
|
+
// Zoom, not resolution: scaling the whole frame up is fine, cropping in past 1.5x is not.
|
|
1209
|
+
const zoom = (0, assembly_timeline_1.cropZoom)(crop, { width: actual.width, height: actual.height }, timeline);
|
|
1210
|
+
if (zoom > assembly_timeline_1.MAX_ZOOM + 1e-9)
|
|
1211
|
+
throw new errors_1.KitStop(`A picture crop zooms in ${zoom.toFixed(2)}x, over the ${assembly_timeline_1.MAX_ZOOM}x limit: ${source.asset_id}. Use a wider or sharper source.`, 'change_request', 'output_invalid');
|
|
1212
|
+
}
|
|
1163
1213
|
if (audible.some((a) => a.sha256 === source.sha256 && a.asset_id === source.asset_id) && !actual.has_audio)
|
|
1164
1214
|
throw new errors_1.KitStop(`An audio source has no readable audio: ${source.asset_id}`, 'change_request', 'output_invalid');
|
|
1165
1215
|
// A still is intentionally held; only moving/audio sources have a media clock.
|
|
@@ -1542,31 +1592,60 @@ class Maker {
|
|
|
1542
1592
|
}
|
|
1543
1593
|
const custom = this.style.style.id.startsWith('custom-');
|
|
1544
1594
|
let measuredDurationMs = null;
|
|
1595
|
+
let hasAudio = false;
|
|
1545
1596
|
if (custom) {
|
|
1546
1597
|
try {
|
|
1547
1598
|
const probe = (0, toolchain_1.kitTools)({ ffmpeg: this.tools.ffmpeg.path ?? '', ffprobe: this.tools.ffprobe.path ?? '', toolchain: this.toolchain }, this.stop.signal).probe;
|
|
1548
1599
|
const info = await probe(candidate);
|
|
1549
1600
|
measuredDurationMs = (0, assembly_timeline_1.measuredFinalDurationMs)(info.duration_s);
|
|
1601
|
+
hasAudio = info.has_audio === true;
|
|
1550
1602
|
}
|
|
1551
1603
|
catch {
|
|
1552
1604
|
// Missing measurement leaves review incomplete; the edit clock is not a fallback.
|
|
1553
1605
|
}
|
|
1554
1606
|
}
|
|
1555
|
-
|
|
1607
|
+
// Early feedback on the exact bytes (gooseworks-final-measure/1); the server measures them again and decides.
|
|
1608
|
+
let finalMeasure = null;
|
|
1609
|
+
let measureProblem = null;
|
|
1610
|
+
const measurePath = path.join(this.layout.final, 'final-measure.json');
|
|
1611
|
+
if (custom) {
|
|
1612
|
+
if (measuredDurationMs === null || !this.tools.ffmpeg.path)
|
|
1613
|
+
measureProblem = 'its length could not be read';
|
|
1614
|
+
else {
|
|
1615
|
+
try {
|
|
1616
|
+
finalMeasure = await (0, final_measure_1.measureFinal)({ ffmpeg: this.tools.ffmpeg.path, file: candidate, outputSha256: sha256, durationMs: measuredDurationMs, hasAudio, timeline: assembly.timeline, signal: this.stop.signal });
|
|
1617
|
+
}
|
|
1618
|
+
catch (error) {
|
|
1619
|
+
measureProblem = 'the video tools could not read it';
|
|
1620
|
+
this.deps.log.write('warn', 'the final could not be measured', { error: error instanceof Error ? error.message : String(error) });
|
|
1621
|
+
}
|
|
1622
|
+
}
|
|
1623
|
+
await (0, save_1.writeJson)(measurePath, finalMeasure ?? { format: final_measure_1.FINAL_MEASURE_FORMAT, output_sha256: sha256, measured_duration_ms: measuredDurationMs, checks: [], error: measureProblem });
|
|
1624
|
+
}
|
|
1625
|
+
const measureFailures = finalMeasure ? (0, final_measure_1.finalMeasureFailures)(finalMeasure) : [];
|
|
1626
|
+
const contentProblems = (0, assembly_timeline_1.finalContentReviewProblems)(contentReview, sha256, assembly, custom ? measuredDurationMs : undefined, finalMeasure);
|
|
1556
1627
|
await (0, save_1.writeJson)(path.join(this.layout.final, 'assembly-evidence.json'), { output_sha256: sha256, measured_duration_ms: measuredDurationMs, ...assembly, source_bytes_verified: assembly.status === 'complete', content_review_status: contentProblems.length ? 'incomplete' : 'approved', content_review_problems: contentProblems });
|
|
1628
|
+
if (custom && (measureProblem || measureFailures.length)) {
|
|
1629
|
+
this.run.status = 'failed';
|
|
1630
|
+
await this.saveRun();
|
|
1631
|
+
await this.reportWaiting(exports.WAITING_FOR_MEASURED_FIX);
|
|
1632
|
+
this.reporter.close();
|
|
1633
|
+
const why = measureProblem ? `The candidate at ${candidate} could not be measured (${measureProblem}), so it wasn’t sent.` : `The candidate at ${candidate} failed its measured checks, so it wasn’t sent. ${measureFailures.join(' ')}`;
|
|
1634
|
+
return { status: 'stopped', code: 'final_measure_failed', message: `${why} Fix the edit, then run the same command again; unchanged assets are reused. The measurements are in ${measurePath}.` };
|
|
1635
|
+
}
|
|
1557
1636
|
if (custom && contentProblems.length) {
|
|
1558
1637
|
await (0, save_1.writeJson)(path.join(this.layout.final, 'review-request.json'), {
|
|
1559
1638
|
candidate, output_sha256: sha256, measured_duration_ms: measuredDurationMs, timeline_revision: assembly.revision,
|
|
1560
1639
|
creative_contract_revision: assembly.timeline?.creative_contract_revision ?? null,
|
|
1561
|
-
assembly_issues: assembly.issues, content_review_problems: contentProblems,
|
|
1562
|
-
instructions: '
|
|
1640
|
+
assembly_issues: assembly.issues, content_review_problems: contentProblems, final_measure_file: measurePath,
|
|
1641
|
+
instructions: 'Review this exact candidate from start to end. Record actual observations and unresolved issues (severity P0, P1 or P2; only P2 lets it go up). Save the completed review as content-review.json beside this request, then resume the same video make command. capabilities says how you perceived it: audio is listened only when a person or an audio-capable model heard the whole final, otherwise measured; motion is watched only when the moving picture was actually watched, otherwise measured. A measured review is accepted only when the final measurements pass (final-measure.json). Never claim listened or watched that did not happen. Fields not in the template are refused.',
|
|
1563
1642
|
template: { output_sha256: sha256, timeline_revision: assembly.revision, creative_contract_revision: assembly.timeline?.creative_contract_revision ?? null,
|
|
1564
|
-
reviewer: '', verdict: 'incomplete', capabilities: {
|
|
1643
|
+
reviewer: '', verdict: 'incomplete', capabilities: { audio: 'measured', motion: 'measured' }, coverage: [], unresolved_issues: [],
|
|
1565
1644
|
dimensions: Object.fromEntries(assembly_timeline_1.CONTENT_DIMENSIONS.map((name) => [name, { status: 'incomplete', note: 'Not reviewed yet' }])) },
|
|
1566
1645
|
});
|
|
1567
1646
|
this.run.status = 'failed';
|
|
1568
|
-
this.book.note = 'The candidate needs its actual picture and audio review';
|
|
1569
1647
|
await this.saveRun();
|
|
1648
|
+
await this.reportWaiting(exports.WAITING_FOR_CONTENT_REVIEW);
|
|
1570
1649
|
this.reporter.close();
|
|
1571
1650
|
return { status: 'stopped', code: 'content_review_incomplete', message: `The candidate is saved at ${candidate}. Its picture/audio review is incomplete. Save the actual review in ${reviewPath}, then resume the same command; unchanged assets are reused.` };
|
|
1572
1651
|
}
|
|
@@ -1578,8 +1657,10 @@ class Maker {
|
|
|
1578
1657
|
try {
|
|
1579
1658
|
const noted = [...verdictWarnings(current.verdict), ...(eyes?.warnings ?? [])].slice(0, MAX_SENT_WARNINGS);
|
|
1580
1659
|
check = await this.sendUpload(sha256, data, captions_vtt, { ...this.manifestFor(current.steps),
|
|
1581
|
-
|
|
1660
|
+
// Local file paths stay on this computer; the revision never included them.
|
|
1661
|
+
...(assembly.timeline ? { assembly_timeline: (0, assembly_timeline_1.portableTimeline)(assembly.timeline) } : {}),
|
|
1582
1662
|
...(contentReview ? { content_review: contentReview } : {}),
|
|
1663
|
+
...(finalMeasure ? { final_measure: finalMeasure } : {}),
|
|
1583
1664
|
assembly_evidence: { status: assembly.status, revision: assembly.revision, output_sha256: sha256, source_bytes_verified: assembly.status === 'complete', issues: assembly.issues },
|
|
1584
1665
|
content_review_status: contentProblems.length ? 'incomplete' : 'approved',
|
|
1585
1666
|
...(noted.length ? { check_warnings: noted } : {}) });
|
|
@@ -1688,6 +1769,7 @@ class Maker {
|
|
|
1688
1769
|
final,
|
|
1689
1770
|
timeline: made.timeline,
|
|
1690
1771
|
beforeSound: made.beforeSound,
|
|
1772
|
+
custom: this.style.style.id.startsWith('custom-'),
|
|
1691
1773
|
products: products.map((p) => ({
|
|
1692
1774
|
...(typeof p?.name === 'string' ? { name: p.name } : {}),
|
|
1693
1775
|
photos: (Array.isArray(p?.images) ? p.images : []).filter((ref) => (0, canonical_1.isFileRef)(ref) && ref.media === 'image').map((ref) => ref.path),
|