@nodetool-ai/cli-timeline 0.0.0-stage → 0.8.9-beta.2
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 +12 -2
- package/dist/.nodetool-build-stamp +1 -0
- package/dist/commands/timeline-render.d.ts +75 -0
- package/dist/commands/timeline-render.d.ts.map +1 -0
- package/dist/commands/timeline-render.js +463 -0
- package/dist/commands/timeline-render.js.map +1 -0
- package/dist/commands/timeline-score.d.ts +16 -0
- package/dist/commands/timeline-score.d.ts.map +1 -0
- package/dist/commands/timeline-score.js +89 -0
- package/dist/commands/timeline-score.js.map +1 -0
- package/dist/commands/timeline-validation-output.d.ts +7 -0
- package/dist/commands/timeline-validation-output.d.ts.map +1 -0
- package/dist/commands/timeline-validation-output.js +9 -0
- package/dist/commands/timeline-validation-output.js.map +1 -0
- package/dist/commands/timeline-versions.d.ts +72 -0
- package/dist/commands/timeline-versions.d.ts.map +1 -0
- package/dist/commands/timeline-versions.js +108 -0
- package/dist/commands/timeline-versions.js.map +1 -0
- package/dist/commands/timeline.d.ts +22 -0
- package/dist/commands/timeline.d.ts.map +1 -0
- package/dist/commands/timeline.js +103 -0
- package/dist/commands/timeline.js.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/nodetool.d.ts +3 -0
- package/dist/nodetool.d.ts.map +1 -0
- package/dist/nodetool.js +4 -0
- package/dist/nodetool.js.map +1 -0
- package/dist/timeline-debug/harness.d.ts +93 -0
- package/dist/timeline-debug/harness.d.ts.map +1 -0
- package/dist/timeline-debug/harness.js +100 -0
- package/dist/timeline-debug/harness.js.map +1 -0
- package/dist/timeline-debug/index.d.ts +9 -0
- package/dist/timeline-debug/index.d.ts.map +1 -0
- package/dist/timeline-debug/index.js +9 -0
- package/dist/timeline-debug/index.js.map +1 -0
- package/dist/timeline-debug/interactions.d.ts +19 -0
- package/dist/timeline-debug/interactions.d.ts.map +1 -0
- package/dist/timeline-debug/interactions.js +17 -0
- package/dist/timeline-debug/interactions.js.map +1 -0
- package/dist/timeline-debug/target.d.ts +34 -0
- package/dist/timeline-debug/target.d.ts.map +1 -0
- package/dist/timeline-debug/target.js +109 -0
- package/dist/timeline-debug/target.js.map +1 -0
- package/package.json +63 -4
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { printCommandError } from "@nodetool-ai/pack-manager/command-errors";
|
|
2
|
+
import { numericOptionParser } from "@nodetool-ai/cli-common/numeric-options";
|
|
3
|
+
import { runTimelineRender } from "./timeline-render.js";
|
|
4
|
+
/** Evenly spaced frames a `--sheet` render samples by default. */
|
|
5
|
+
const SHEET_FRAME_COUNT = 12;
|
|
6
|
+
export function evenlySpacedFrames(totalFrames, count) {
|
|
7
|
+
if (totalFrames <= 1)
|
|
8
|
+
return [0];
|
|
9
|
+
const n = Math.min(count, totalFrames);
|
|
10
|
+
const frames = new Set();
|
|
11
|
+
for (let i = 0; i < n; i += 1) {
|
|
12
|
+
frames.add(Math.round((i * (totalFrames - 1)) / Math.max(1, n - 1)));
|
|
13
|
+
}
|
|
14
|
+
return [...frames].sort((a, b) => a - b);
|
|
15
|
+
}
|
|
16
|
+
export function registerTimelineScoreCommand(timeline, loadSequence) {
|
|
17
|
+
timeline
|
|
18
|
+
.command("score <timeline_id_or_file>")
|
|
19
|
+
.description("Score a timeline document's craft against the shipped showcase examples (kite, prism, serein, tidewater, voltra) — a deterministic, no-LLM scorecard. Takes a timeline JSON file or a timeline_sequences row id")
|
|
20
|
+
.option("--json", "Print the full TimelineCraftScoreResult as JSON")
|
|
21
|
+
.option("--min-score <n>", "Exit non-zero when the score is below this threshold", numericOptionParser("--min-score"))
|
|
22
|
+
.option("--sheet <out.png>", `Also render a GPU contact sheet of ${SHEET_FRAME_COUNT} evenly spaced frames through the same renderer 'timeline render --sheet' uses`)
|
|
23
|
+
.action(async (ref, opts) => {
|
|
24
|
+
try {
|
|
25
|
+
const { resolveTimelineTarget } = await import("../timeline-debug/target.js");
|
|
26
|
+
const { scoreTimelineCraft } = await import("@nodetool-ai/execution/timeline-debug");
|
|
27
|
+
const sequenceLoader = await loadSequence();
|
|
28
|
+
const resolved = await resolveTimelineTarget(ref, {
|
|
29
|
+
loadSequence: sequenceLoader
|
|
30
|
+
});
|
|
31
|
+
const result = await scoreTimelineCraft(resolved.raw, {
|
|
32
|
+
fps: resolved.meta.fps,
|
|
33
|
+
width: resolved.meta.width,
|
|
34
|
+
height: resolved.meta.height
|
|
35
|
+
});
|
|
36
|
+
if (opts.sheet) {
|
|
37
|
+
const fps = resolved.meta.fps && resolved.meta.fps > 0
|
|
38
|
+
? resolved.meta.fps
|
|
39
|
+
: 30;
|
|
40
|
+
const durationMs = resolved.meta.durationMs && resolved.meta.durationMs > 0
|
|
41
|
+
? resolved.meta.durationMs
|
|
42
|
+
: resolved.document.clips.reduce((end, clip) => Math.max(end, clip.startMs + clip.durationMs), 0);
|
|
43
|
+
const totalFrames = Math.max(1, Math.round((durationMs / 1000) * fps));
|
|
44
|
+
const frames = evenlySpacedFrames(totalFrames, SHEET_FRAME_COUNT);
|
|
45
|
+
await runTimelineRender(ref, { out: opts.sheet, sheet: true, frames: frames.join(",") }, sequenceLoader);
|
|
46
|
+
}
|
|
47
|
+
if (opts.json) {
|
|
48
|
+
console.log(JSON.stringify(result, null, 2));
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
console.log(renderTimelineScore(result).join("\n"));
|
|
52
|
+
}
|
|
53
|
+
const failed = opts.minScore !== undefined && result.score < opts.minScore;
|
|
54
|
+
process.exit(failed ? 1 : 0);
|
|
55
|
+
}
|
|
56
|
+
catch (e) {
|
|
57
|
+
process.exit(printCommandError(e, opts.json));
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
/** Human-readable rendering of a `TimelineCraftScoreResult`. */
|
|
62
|
+
export function renderTimelineScore(result) {
|
|
63
|
+
const lines = [];
|
|
64
|
+
const distinctCodes = Object.keys(result.showcaseWarningCodeCounts).length;
|
|
65
|
+
lines.push(`Craft score: ${result.score.toFixed(1)}/100 (raw ${result.rawScore.toFixed(1)}, -${result.penalty} for ${distinctCodes} distinct showcase warning code(s))`);
|
|
66
|
+
lines.push(`Reference band: ${result.reference.entries.map((e) => e.slug).join(", ") || "(none found)"}`);
|
|
67
|
+
lines.push("");
|
|
68
|
+
lines.push("Metric value median credit");
|
|
69
|
+
for (const metric of result.metricScores) {
|
|
70
|
+
lines.push(`${metric.metric.padEnd(30)} ${metric.value.toFixed(2).padStart(8)} ${metric.referenceMedian.toFixed(2).padStart(8)} ${metric.credit.toFixed(2).padStart(8)}`);
|
|
71
|
+
}
|
|
72
|
+
if (result.showcaseWarnings.length > 0) {
|
|
73
|
+
lines.push("");
|
|
74
|
+
lines.push("Showcase warnings (penalized once per code, all instances shown):");
|
|
75
|
+
for (const [code, count] of Object.entries(result.showcaseWarningCodeCounts)) {
|
|
76
|
+
lines.push(` - ${code} ×${count}`);
|
|
77
|
+
}
|
|
78
|
+
lines.push("");
|
|
79
|
+
for (const warning of result.showcaseWarnings) {
|
|
80
|
+
lines.push(` - [${warning.code}] ${warning.message}`);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
if (!result.validation.ok) {
|
|
84
|
+
lines.push("");
|
|
85
|
+
lines.push(`Document has ${result.validation.errors.length} validation error(s) — run 'timeline validate' for details.`);
|
|
86
|
+
}
|
|
87
|
+
return lines;
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=timeline-score.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeline-score.js","sourceRoot":"","sources":["../../src/commands/timeline-score.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBA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AM,CAAC,gBAAgB,EAAE,CAAC;YAC9C,KAAK,CAAC,IAAI,CAAC,QAAQ,OAAO,CAAC,IAAI,KAAK,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;QACzD,CAAC;IACH,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,EAAE,CAAC;QAC1B,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACf,KAAK,CAAC,IAAI,CACR,gBAAgB,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,6DAA6D,CAC7G,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Human-readable rendering of a `TimelineValidation`, shared by
|
|
3
|
+
* `timeline validate` and `timeline versions restore`.
|
|
4
|
+
*/
|
|
5
|
+
import type { TimelineValidation } from "@nodetool-ai/execution/timeline-debug";
|
|
6
|
+
export declare function renderTimelineValidation(validation: TimelineValidation): string[];
|
|
7
|
+
//# sourceMappingURL=timeline-validation-output.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeline-validation-output.d.ts","sourceRoot":"","sources":["../../src/commands/timeline-validation-output.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAEV,kBAAkB,EACnB,MAAM,uCAAuC,CAAC;AAG/C,wBAAgB,wBAAwB,CACtC,UAAU,EAAE,kBAAkB,GAC7B,MAAM,EAAE,CAQV"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { issueLocation, renderValidation } from "@nodetool-ai/cli-common/commands/validation-output";
|
|
2
|
+
export function renderTimelineValidation(validation) {
|
|
3
|
+
return renderValidation(validation, (issue) => issue.clipId != null
|
|
4
|
+
? ` [clip ${issue.clipId}]`
|
|
5
|
+
: issue.trackId != null
|
|
6
|
+
? ` [track ${issue.trackId}]`
|
|
7
|
+
: issueLocation(issue));
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=timeline-validation-output.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeline-validation-output.js","sourceRoot":"","sources":["../../src/commands/timeline-validation-output.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,oDAAoD,CAAC;AAErG,MAAM,UAAU,wBAAwB,CACtC,UAA8B;IAE9B,OAAO,gBAAgB,CAAC,UAAU,EAAE,CAAC,KAAyB,EAAE,EAAE,CAChE,KAAK,CAAC,MAAM,IAAI,IAAI;QAClB,CAAC,CAAC,UAAU,KAAK,CAAC,MAAM,GAAG;QAC3B,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,IAAI;YACrB,CAAC,CAAC,WAAW,KAAK,CAAC,OAAO,GAAG;YAC7B,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,CAC3B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `nodetool timeline versions` — the version-history half of the timeline
|
|
3
|
+
* harness. The commands themselves live in `version-commands.ts`; this file is
|
|
4
|
+
* the timeline's row shapes, database seam, columns and messages.
|
|
5
|
+
*
|
|
6
|
+
* Timeline sequences keep immutable snapshots: manual saves, autosaves the
|
|
7
|
+
* server writes at most every five minutes, and the pre-restore snapshot that
|
|
8
|
+
* makes a restore undoable. The history is read and written directly against
|
|
9
|
+
* the local database, the way `timeline validate` and `timeline debug` read a
|
|
10
|
+
* sequence row, so an agent can work without a server.
|
|
11
|
+
*/
|
|
12
|
+
import type { Command } from "commander";
|
|
13
|
+
import type { TimelineValidation } from "@nodetool-ai/execution/timeline-debug";
|
|
14
|
+
import { type JsonValue, type VersionCommandDeps, type VersionStore } from "@nodetool-ai/cli-common/commands/version-commands";
|
|
15
|
+
export { parseVersionDocument, parseVersionNumber } from "@nodetool-ai/cli-common/commands/version-commands";
|
|
16
|
+
/** A `timeline_sequences` row as these commands need it. */
|
|
17
|
+
export interface TimelineSequenceRow {
|
|
18
|
+
id: string;
|
|
19
|
+
user_id: string;
|
|
20
|
+
name?: string | null;
|
|
21
|
+
fps: number;
|
|
22
|
+
width: number;
|
|
23
|
+
height: number;
|
|
24
|
+
duration_ms: number;
|
|
25
|
+
updated_at: string;
|
|
26
|
+
document: string;
|
|
27
|
+
}
|
|
28
|
+
/** A `timeline_sequence_versions` row. */
|
|
29
|
+
export interface TimelineVersionRow {
|
|
30
|
+
id: string;
|
|
31
|
+
timeline_id: string;
|
|
32
|
+
version: number;
|
|
33
|
+
name: string | null;
|
|
34
|
+
save_type: string;
|
|
35
|
+
fps: number;
|
|
36
|
+
width: number;
|
|
37
|
+
height: number;
|
|
38
|
+
duration_ms: number;
|
|
39
|
+
created_at: string;
|
|
40
|
+
document: string;
|
|
41
|
+
}
|
|
42
|
+
export type TimelineVersionStore = VersionStore<TimelineSequenceRow, TimelineVersionRow>;
|
|
43
|
+
/** The list-item shape, matching the tRPC router's `timelineVersionListItem`. */
|
|
44
|
+
export interface TimelineVersionListItem {
|
|
45
|
+
id: string;
|
|
46
|
+
timelineId: string;
|
|
47
|
+
version: number;
|
|
48
|
+
name: string | null;
|
|
49
|
+
saveType: string;
|
|
50
|
+
fps: number;
|
|
51
|
+
width: number;
|
|
52
|
+
height: number;
|
|
53
|
+
durationMs: number;
|
|
54
|
+
createdAt: string;
|
|
55
|
+
}
|
|
56
|
+
export declare function toVersionListItem(row: TimelineVersionRow): TimelineVersionListItem;
|
|
57
|
+
/** One table row per version: what it is, when it was taken, what it renders. */
|
|
58
|
+
export declare function versionTableRows(items: TimelineVersionListItem[]): Record<string, unknown>[];
|
|
59
|
+
/** Track / clip / marker counts of whatever a version stored. */
|
|
60
|
+
export declare function documentCounts(document: JsonValue | undefined): {
|
|
61
|
+
tracks: number;
|
|
62
|
+
clips: number;
|
|
63
|
+
markers: number;
|
|
64
|
+
};
|
|
65
|
+
interface TimelineValidateMeta {
|
|
66
|
+
fps?: number;
|
|
67
|
+
width?: number;
|
|
68
|
+
height?: number;
|
|
69
|
+
}
|
|
70
|
+
export type TimelineVersionsDeps = VersionCommandDeps<TimelineSequenceRow, TimelineVersionRow, TimelineValidation, TimelineValidateMeta>;
|
|
71
|
+
export declare function registerTimelineVersionsCommands(timeline: Command, deps?: TimelineVersionsDeps): void;
|
|
72
|
+
//# sourceMappingURL=timeline-versions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeline-versions.d.ts","sourceRoot":"","sources":["../../src/commands/timeline-versions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAEhF,OAAO,EAGL,KAAK,SAAS,EACd,KAAK,kBAAkB,EAEvB,KAAK,YAAY,EAClB,MAAM,mDAAmD,CAAC;AAE3D,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,mDAAmD,CAAC;AAE7G,4DAA4D;AAC5D,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,0CAA0C;AAC1C,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM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AC9B,IAAI,CAKN"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { renderTimelineValidation } from "./timeline-validation-output.js";
|
|
2
|
+
import { countArray, registerVersionCommands } from "@nodetool-ai/cli-common/commands/version-commands";
|
|
3
|
+
export { parseVersionDocument, parseVersionNumber } from "@nodetool-ai/cli-common/commands/version-commands";
|
|
4
|
+
export function toVersionListItem(row) {
|
|
5
|
+
return {
|
|
6
|
+
id: row.id,
|
|
7
|
+
timelineId: row.timeline_id,
|
|
8
|
+
version: row.version,
|
|
9
|
+
name: row.name ?? null,
|
|
10
|
+
saveType: row.save_type,
|
|
11
|
+
fps: row.fps,
|
|
12
|
+
width: row.width,
|
|
13
|
+
height: row.height,
|
|
14
|
+
durationMs: row.duration_ms,
|
|
15
|
+
createdAt: row.created_at
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
/** One table row per version: what it is, when it was taken, what it renders. */
|
|
19
|
+
export function versionTableRows(items) {
|
|
20
|
+
return items.map(tableRow);
|
|
21
|
+
}
|
|
22
|
+
function tableRow(v) {
|
|
23
|
+
return {
|
|
24
|
+
version: v.version,
|
|
25
|
+
saveType: v.saveType,
|
|
26
|
+
name: v.name ?? "",
|
|
27
|
+
createdAt: v.createdAt,
|
|
28
|
+
fps: v.fps,
|
|
29
|
+
resolution: `${v.width}x${v.height}`
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/** Track / clip / marker counts of whatever a version stored. */
|
|
33
|
+
export function documentCounts(document) {
|
|
34
|
+
const doc = (document ?? {});
|
|
35
|
+
return {
|
|
36
|
+
tracks: countArray(doc.tracks),
|
|
37
|
+
clips: countArray(doc.clips),
|
|
38
|
+
markers: countArray(doc.markers)
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
async function defaultStore() {
|
|
42
|
+
const { initDb, TimelineSequence, TimelineSequenceVersion } = await import("@nodetool-ai/models");
|
|
43
|
+
const { getDefaultDbPath } = await import("@nodetool-ai/config");
|
|
44
|
+
initDb(getDefaultDbPath());
|
|
45
|
+
return {
|
|
46
|
+
load: async (id) => await TimelineSequence.findById(id),
|
|
47
|
+
listVersions: async (timelineId, opts) => await TimelineSequenceVersion.listForTimeline(timelineId, opts),
|
|
48
|
+
findVersion: async (timelineId, version) => await TimelineSequenceVersion.findByVersion(timelineId, version),
|
|
49
|
+
snapshot: async (seq, opts) => await TimelineSequenceVersion.snapshot(seq, opts),
|
|
50
|
+
restore: async (seq, version) => await TimelineSequence.updateFieldsIfUnchanged(seq.id, seq.updated_at, {
|
|
51
|
+
document: version.document,
|
|
52
|
+
fps: version.fps,
|
|
53
|
+
width: version.width,
|
|
54
|
+
height: version.height,
|
|
55
|
+
duration_ms: version.duration_ms
|
|
56
|
+
}),
|
|
57
|
+
deleteVersion: async (timelineId, version) => {
|
|
58
|
+
const row = await TimelineSequenceVersion.findByVersion(timelineId, version);
|
|
59
|
+
if (row)
|
|
60
|
+
await row.delete();
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
async function defaultValidate(raw, meta) {
|
|
65
|
+
const { validateTimelineSequence } = await import("@nodetool-ai/execution/timeline-debug");
|
|
66
|
+
return await validateTimelineSequence(raw, meta);
|
|
67
|
+
}
|
|
68
|
+
const spec = {
|
|
69
|
+
idArg: "timeline_id",
|
|
70
|
+
idKey: "timelineId",
|
|
71
|
+
descriptions: {
|
|
72
|
+
group: "Inspect and restore the snapshot history of a timeline sequence (manual saves, autosaves, pre-restore snapshots)",
|
|
73
|
+
list: "List a timeline's versions, newest first",
|
|
74
|
+
show: "Print one version's metadata and the document it stored",
|
|
75
|
+
create: "Snapshot the sequence as it stands now (a manual save)",
|
|
76
|
+
restore: "Restore a version onto the sequence. The pre-restore state is snapshotted first, and the restored document is validated against the current schema — a restore whose document no longer validates exits non-zero",
|
|
77
|
+
delete: "Delete one version from a timeline's history",
|
|
78
|
+
restoreJson: "Print the restore result and validation as JSON"
|
|
79
|
+
},
|
|
80
|
+
notFoundDocument: (id) => `Timeline sequence not found: ${id}`,
|
|
81
|
+
notFoundVersion: (id, version) => `Timeline version not found: ${id} v${version}`,
|
|
82
|
+
conflict: "Timeline has been modified since last load",
|
|
83
|
+
confirmDelete: (id, version) => `Delete v${version} of timeline ${id}?`,
|
|
84
|
+
deleted: (id, version) => `✅ Deleted v${version} of timeline ${id}`,
|
|
85
|
+
toItem: toVersionListItem,
|
|
86
|
+
tableRow,
|
|
87
|
+
counts: documentCounts,
|
|
88
|
+
showSummary: (counts, item) => `\n ${counts.tracks} track(s), ${counts.clips} clip(s), ${counts.markers} marker(s), ${item.durationMs}ms`,
|
|
89
|
+
restoreSummary: (id, version, counts, row) => `✅ Restored v${version} onto ${id}: ${counts.tracks} track(s), ${counts.clips} clip(s), ${row.duration_ms}ms @ ${row.fps}fps ${row.width}x${row.height}`,
|
|
90
|
+
restoreJsonExtra: (seq) => ({
|
|
91
|
+
sequence: {
|
|
92
|
+
id: seq.id,
|
|
93
|
+
fps: seq.fps,
|
|
94
|
+
width: seq.width,
|
|
95
|
+
height: seq.height,
|
|
96
|
+
durationMs: seq.duration_ms
|
|
97
|
+
}
|
|
98
|
+
}),
|
|
99
|
+
validateMeta: (row) => ({ fps: row.fps, width: row.width, height: row.height }),
|
|
100
|
+
renderValidation: renderTimelineValidation
|
|
101
|
+
};
|
|
102
|
+
export function registerTimelineVersionsCommands(timeline, deps = {}) {
|
|
103
|
+
registerVersionCommands(timeline, spec, deps, {
|
|
104
|
+
store: defaultStore,
|
|
105
|
+
validate: defaultValidate
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=timeline-versions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeline-versions.js","sourceRoot":"","sources":["../../src/commands/timeline-versions.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EACL,UAAU,EACV,uBAAuB,EAKxB,MAAM,mDAAmD,C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AU,IAAI;IAC7G,cAAc,EAAE,CAAC,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,CAC3C,eAAe,OAAO,SAAS,EAAE,KAAK,MAAM,CAAC,MAAM,cAAc,MAAM,CAAC,KAAK,aAAa,GAAG,CAAC,WAAW,QAAQ,GAAG,CAAC,GAAG,OAAO,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,MAAM,EAAE;IAC1J,gBAAgB,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QAC1B,QAAQ,EAAE;YACR,EAAE,EAAE,GAAG,CAAC,EAAE;YACV,GAAG,EAAE,GAAG,CAAC,GAAG;YACZ,KAAK,EAAE,GAAG,CAAC,KAAK;YAChB,MAAM,EAAE,GAAG,CAAC,MAAM;YAClB,UAAU,EAAE,GAAG,CAAC,WAAW;SAC5B;KACF,CAAC;IACF,YAAY,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC;IAC/E,gBAAgB,EAAE,wBAAwB;CAC3C,CAAC;AASF,MAAM,UAAU,gCAAgC,CAC9C,QAAiB,EACjB,IAAI,GAAyB,EAAE;IAE/B,uBAAuB,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE;QAC5C,KAAK,EAAE,YAAY;QACnB,QAAQ,EAAE,eAAe;KAC1B,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `nodetool timeline validate`, `debug`, `render` and `versions` — the
|
|
3
|
+
* timeline harness commands.
|
|
4
|
+
*
|
|
5
|
+
* `validate` checks a timeline document statically: tracks a clip points at,
|
|
6
|
+
* fields a round trip through the schema would strip, timings that cannot
|
|
7
|
+
* render. `debug` additionally replays a scripted `--interact` edit session
|
|
8
|
+
* against the headless `ui_timeline_*` bridge and writes a bundle. Both take a
|
|
9
|
+
* timeline JSON file or a `timeline_sequences` row id. `render`
|
|
10
|
+
* (timeline-render.ts) renders the picture through the GPU compositor.
|
|
11
|
+
* `versions` (timeline-versions.ts) reads and restores a sequence's snapshot
|
|
12
|
+
* history.
|
|
13
|
+
*
|
|
14
|
+
* Heavy dependencies (the database, the validator core, the bridge) are
|
|
15
|
+
* imported lazily inside each action, so command registration stays light and
|
|
16
|
+
* unit-testable.
|
|
17
|
+
*/
|
|
18
|
+
import type { Command } from "commander";
|
|
19
|
+
import { renderTimelineValidation } from "./timeline-validation-output.js";
|
|
20
|
+
export { renderTimelineValidation };
|
|
21
|
+
export declare function registerTimelineCommands(program: Command): void;
|
|
22
|
+
//# sourceMappingURL=timeline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeline.d.ts","sourceRoot":"","sources":["../../src/commands/timeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKzC,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAK3E,OAAO,EAAE,wBAAwB,EAAE,CAAC;AAuCpC,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA8F/D"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { printCommandError } from "@nodetool-ai/pack-manager/command-errors";
|
|
2
|
+
import { printDebugSummary } from "@nodetool-ai/cli-common/commands/debug-summary-output";
|
|
3
|
+
import { renderTimelineValidation } from "./timeline-validation-output.js";
|
|
4
|
+
import { registerTimelineRenderCommand } from "./timeline-render.js";
|
|
5
|
+
import { registerTimelineScoreCommand } from "./timeline-score.js";
|
|
6
|
+
import { registerTimelineVersionsCommands } from "./timeline-versions.js";
|
|
7
|
+
export { renderTimelineValidation };
|
|
8
|
+
/** Read a sequence row through the local database. */
|
|
9
|
+
async function sequenceLoader() {
|
|
10
|
+
const { initDb, TimelineSequence } = await import("@nodetool-ai/models");
|
|
11
|
+
const { getDefaultDbPath } = await import("@nodetool-ai/config");
|
|
12
|
+
let ready = false;
|
|
13
|
+
return async (id) => {
|
|
14
|
+
if (!ready) {
|
|
15
|
+
initDb(getDefaultDbPath());
|
|
16
|
+
ready = true;
|
|
17
|
+
}
|
|
18
|
+
const row = await TimelineSequence.findById(id);
|
|
19
|
+
return row
|
|
20
|
+
? {
|
|
21
|
+
id: row.id,
|
|
22
|
+
name: row.name,
|
|
23
|
+
fps: row.fps,
|
|
24
|
+
width: row.width,
|
|
25
|
+
height: row.height,
|
|
26
|
+
document: row.document
|
|
27
|
+
}
|
|
28
|
+
: null;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
export function registerTimelineCommands(program) {
|
|
32
|
+
const timeline = program
|
|
33
|
+
.command("timeline")
|
|
34
|
+
.description("Work with timeline sequences");
|
|
35
|
+
timeline
|
|
36
|
+
.command("validate <timeline_id_or_file>")
|
|
37
|
+
.description("Validate a timeline document without rendering it: clips on missing tracks, fields a schema round trip would strip, unrenderable timings. Takes a timeline JSON file or a timeline_sequences row id")
|
|
38
|
+
.option("--json", "Print the full TimelineValidation as JSON")
|
|
39
|
+
.option("--warnings-as-errors", "Exit non-zero when there are warnings (not just errors)")
|
|
40
|
+
.action(async (ref, opts) => {
|
|
41
|
+
try {
|
|
42
|
+
const { runTimelineValidate } = await import("../timeline-debug/index.js");
|
|
43
|
+
const { target, validation } = await runTimelineValidate(ref, {
|
|
44
|
+
loadSequence: await sequenceLoader()
|
|
45
|
+
});
|
|
46
|
+
if (opts.json) {
|
|
47
|
+
console.log(JSON.stringify({ target, validation }, null, 2));
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
console.log(renderTimelineValidation(validation).join("\n"));
|
|
51
|
+
}
|
|
52
|
+
const failed = !validation.ok ||
|
|
53
|
+
(opts.warningsAsErrors === true && validation.warnings.length > 0);
|
|
54
|
+
process.exit(failed ? 1 : 0);
|
|
55
|
+
}
|
|
56
|
+
catch (e) {
|
|
57
|
+
process.exit(printCommandError(e, opts.json));
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
timeline
|
|
61
|
+
.command("debug <timeline_id_or_file>")
|
|
62
|
+
.description("Replay a scripted edit session against a timeline headlessly and collect a debug bundle (the document, the report, every step's result)")
|
|
63
|
+
.option("--interact <json>", 'Scripted steps: [{"tool":"add_track","input":{"type":"audio"}}] — the ui_timeline_ prefix is optional')
|
|
64
|
+
.option("--out <dir>", "Bundle output directory (default: nodetool-debug/timeline-<id>-<timestamp>)")
|
|
65
|
+
.option("--json", "Print the full TimelineDebugReport as JSON to stdout")
|
|
66
|
+
.action(async (ref, opts) => {
|
|
67
|
+
try {
|
|
68
|
+
const { parseInteractionScript, runTimelineDebug } = await import("../timeline-debug/index.js");
|
|
69
|
+
const interact = opts.interact
|
|
70
|
+
? parseInteractionScript(opts.interact)
|
|
71
|
+
: undefined;
|
|
72
|
+
const debugOptions = {};
|
|
73
|
+
if (interact) {
|
|
74
|
+
debugOptions.interact = interact;
|
|
75
|
+
}
|
|
76
|
+
if (opts.out) {
|
|
77
|
+
debugOptions.outDir = opts.out;
|
|
78
|
+
}
|
|
79
|
+
const { report, bundleDir } = await runTimelineDebug(ref, debugOptions, {
|
|
80
|
+
loadSequence: await sequenceLoader(),
|
|
81
|
+
onLog: (line) => console.error(line)
|
|
82
|
+
});
|
|
83
|
+
if (opts.json) {
|
|
84
|
+
console.log(JSON.stringify(report, null, 2));
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
printDebugSummary(report, bundleDir, {
|
|
88
|
+
label: "timeline",
|
|
89
|
+
meta: `${report.meta.trackCount} track(s), ${report.meta.clipCount} clip(s), ${report.meta.durationMs}ms @ ${report.meta.fps}fps`,
|
|
90
|
+
file: "timeline.json"
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
process.exit(report.verdict.ok ? 0 : 1);
|
|
94
|
+
}
|
|
95
|
+
catch (e) {
|
|
96
|
+
process.exit(printCommandError(e, opts.json));
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
registerTimelineRenderCommand(timeline, sequenceLoader);
|
|
100
|
+
registerTimelineScoreCommand(timeline, sequenceLoader);
|
|
101
|
+
registerTimelineVersionsCommands(timeline);
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=timeline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeline.js","sourceRoot":"","sources":["../../src/commands/timeline.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,uDAAuD,CAAC;AAC1F,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,gCAAgC,EAAE,MAAM,wBAAwB,CAAC;AAE1E,OAAO,EAAE,wBAAwB,EAAE,CAAC;AAapC,sDAAsD;AACtD,KAAK,UAAU,cAAc;IAG3B,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,GAAG,MAAM,MAAM,CAAC,qBAAqB,CAAC,CAAC;IACzE,MAAM,EAAE,gBAAgB,EAAE,GAAG,MAAM,MAAM,CAAC,qBAAqB,CAAC,CAAC;IACjE,IAAI,KAAK,GAAG,KAAK,CAAC;IAClB,OAAO,KAAK,EAAE,EAAU,EAAE,EAAE;QAC1B,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,MAAM,CAAC,gBAAgB,EAAE,CAAC,CAAC;YAC3B,KAAK,GAAG,IAAI,CAAC;QACf,CAAC;QACD,MAAM,GAAG,GAAG,MAAM,gBAAgB,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QAChD,OAA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,YAAY,EACZ;gBACE,YAAY,EAAE,MAAM,cAAc,EAAE;gBACpC,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC;aACrC,CACF,CAAC;YAEF,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;gBACd,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;YAC/C,CAAC;iBAAM,CAAC;gBACN,iBAAiB,CAAC,MAAM,EAAE,SAAS,EAAE;oBACnC,KAAK,EAAE,UAAU;oBACjB,IAAI,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,cAAc,MAAM,CAAC,IAAI,CAAC,SAAS,aAAa,MAAM,CAAC,IAAI,CAAC,UAAU,QAAQ,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK;oBACjI,IAAI,EAAE,eAAe;iBACtB,CAAC,CAAC;YACL,CAAC;YACD,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC1C,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAChD,CAAC;IACH,CAAC,CAAC,CAAC;IAEL,6BAA6B,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;IACxD,4BAA4B,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;IACvD,gCAAgC,CAAC,QAAQ,CAAC,CAAC;AAC7C,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** Run the independently installed cli-timeline command group. */
|
|
2
|
+
export declare function run(argv?: readonly string[]): Promise<void>;
|
|
3
|
+
export declare const descriptor: {
|
|
4
|
+
readonly id: "cli-timeline";
|
|
5
|
+
readonly apiVersion: 1;
|
|
6
|
+
readonly requires: readonly [];
|
|
7
|
+
readonly capabilities: readonly ["cli:timeline"];
|
|
8
|
+
};
|
|
9
|
+
export declare const feature: {
|
|
10
|
+
descriptor: {
|
|
11
|
+
readonly id: "cli-timeline";
|
|
12
|
+
readonly apiVersion: 1;
|
|
13
|
+
readonly requires: readonly [];
|
|
14
|
+
readonly capabilities: readonly ["cli:timeline"];
|
|
15
|
+
};
|
|
16
|
+
run: typeof run;
|
|
17
|
+
};
|
|
18
|
+
export default feature;
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,kEAAkE;AAClE,wBAAsB,GAAG,CAAC,IAAI,GAAE,SAAS,MAAM,EAA0B,GAAG,OAAO,CAAC,IAAI,CAAC,CAKxF;AAED,eAAO,MAAM,UAAU;aAAK,EAAE,EAAE,cAAc;aAAE,UAAU,EAAE,CAAC;aAAE,QAAQ;aAAM,YAAY,YAAG,cAAc;CAAY,CAAC;AACvH,eAAO,MAAM,OAAO;;qBADY,cAAc;6BAAc,CAAC;;yCAA+B,cAAc;;;CAChE,CAAC;eAC5B,OAAO"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
import { initializeCliRuntime } from "@nodetool-ai/cli-common/runtime-env";
|
|
3
|
+
import { registerTimelineCommands } from "./commands/timeline.js";
|
|
4
|
+
/** Run the independently installed cli-timeline command group. */
|
|
5
|
+
export async function run(argv = process.argv.slice(2)) {
|
|
6
|
+
initializeCliRuntime(import.meta.url);
|
|
7
|
+
const program = new Command("nodetool");
|
|
8
|
+
registerTimelineCommands(program);
|
|
9
|
+
await program.parseAsync([...argv], { from: "user" });
|
|
10
|
+
}
|
|
11
|
+
export const descriptor = { id: "cli-timeline", apiVersion: 1, requires: [], capabilities: ["cli:timeline"] };
|
|
12
|
+
export const feature = { descriptor, run };
|
|
13
|
+
export default feature;
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAElE,kEAAkE;AAClE,MAAM,CAAC,KAAK,UAAU,GAAG,CAAC,IAAI,GAAsB,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IACvE,oBAAoB,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;IACtC,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,UAAU,CAAC,CAAC;IACxC,wBAAwB,CAAC,OAAO,CAAC,CAAC;IAClC,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;AACxD,CAAC;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,EAAE,EAAE,EAAE,cAAc,EAAE,UAAU,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,YAAY,EAAE,CAAC,cAAc,CAAC,EAAW,CAAC;AACvH,MAAM,CAAC,MAAM,OAAO,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC;AAC3C,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nodetool.d.ts","sourceRoot":"","sources":["../src/nodetool.ts"],"names":[],"mappings":""}
|
package/dist/nodetool.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nodetool.js","sourceRoot":"","sources":["../src/nodetool.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,KAAK,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The timeline debug harness: the CLI host around the shared validator.
|
|
3
|
+
*
|
|
4
|
+
* `runTimelineValidate` is the cheap pre-flight — load a document, check it,
|
|
5
|
+
* report. `runTimelineDebug` additionally replays a scripted edit session
|
|
6
|
+
* against the headless `ui_timeline_*` bridge (the one the tool-loop eval
|
|
7
|
+
* drives), validates the document the session left behind, and writes a
|
|
8
|
+
* self-contained bundle.
|
|
9
|
+
*
|
|
10
|
+
* Everything that could pull in a heavy package is injected with a lazy
|
|
11
|
+
* default: the validator core (`@nodetool-ai/execution/timeline-debug`) and the
|
|
12
|
+
* bridge factory (`@nodetool-ai/agents`). Tests supply their own and load
|
|
13
|
+
* neither.
|
|
14
|
+
*/
|
|
15
|
+
import type { TimelineDocument } from "@nodetool-ai/protocol/api-schemas/timeline.js";
|
|
16
|
+
import type { TimelineDebugReport, TimelineInteractionRecord, TimelineValidation } from "@nodetool-ai/execution/timeline-debug";
|
|
17
|
+
import type { TimelineInteractionStep } from "./interactions.js";
|
|
18
|
+
import { type ResolvedTimelineTarget, type TimelineSequenceSettings, type TimelineTargetDeps } from "./target.js";
|
|
19
|
+
/** The pieces of the shared core this host calls. */
|
|
20
|
+
export interface TimelineDebugCore {
|
|
21
|
+
validateTimelineSequence: (raw: unknown, meta?: TimelineSequenceSettings) => TimelineValidation | Promise<TimelineValidation>;
|
|
22
|
+
buildTimelineDebugReport: (input: {
|
|
23
|
+
target: TimelineDebugReport["target"];
|
|
24
|
+
document: unknown;
|
|
25
|
+
meta?: TimelineSequenceSettings;
|
|
26
|
+
interactions?: TimelineInteractionRecord[];
|
|
27
|
+
finalState?: unknown;
|
|
28
|
+
finalDocument?: unknown;
|
|
29
|
+
}) => TimelineDebugReport | Promise<TimelineDebugReport>;
|
|
30
|
+
renderTimelineReportMarkdown: (report: TimelineDebugReport) => string;
|
|
31
|
+
}
|
|
32
|
+
/** The bridge surface this host drives — one tool per `ui_timeline_*` name. */
|
|
33
|
+
export interface TimelineBridgeTool {
|
|
34
|
+
name: string;
|
|
35
|
+
/**
|
|
36
|
+
* HOLDOUT (anti-slop/no-unknown-returns): a `ui_timeline_*` tool answers in
|
|
37
|
+
* the open tool-result domain, and the bridge that implements this lives in
|
|
38
|
+
* `@nodetool-ai/agents`.
|
|
39
|
+
*/
|
|
40
|
+
execute: (args: Record<string, unknown>) => Promise<unknown>;
|
|
41
|
+
}
|
|
42
|
+
/** The bridge's snapshot, including the full document the session ended with. */
|
|
43
|
+
export interface TimelineBridgeSnapshot {
|
|
44
|
+
documentTracks?: TimelineDocument["tracks"];
|
|
45
|
+
documentClips?: TimelineDocument["clips"];
|
|
46
|
+
markers?: TimelineDocument["markers"];
|
|
47
|
+
/** The tempo the session ended on — `set_tempo`, or the first midi track. */
|
|
48
|
+
tempo?: TimelineDocument["tempo"];
|
|
49
|
+
camera2d?: TimelineDocument["camera2d"];
|
|
50
|
+
}
|
|
51
|
+
export interface TimelineBridge {
|
|
52
|
+
tools: TimelineBridgeTool[];
|
|
53
|
+
finalState: () => TimelineBridgeSnapshot;
|
|
54
|
+
}
|
|
55
|
+
export type CreateTimelineBridge = (initial: {
|
|
56
|
+
sequence: TimelineSequenceSettings & {
|
|
57
|
+
tracks: TimelineDocument["tracks"];
|
|
58
|
+
clips: TimelineDocument["clips"];
|
|
59
|
+
markers?: TimelineDocument["markers"];
|
|
60
|
+
tempo?: TimelineDocument["tempo"];
|
|
61
|
+
camera2d?: TimelineDocument["camera2d"];
|
|
62
|
+
};
|
|
63
|
+
}) => TimelineBridge;
|
|
64
|
+
export interface TimelineDebugDeps extends TimelineTargetDeps {
|
|
65
|
+
/** Defaults to `@nodetool-ai/execution/timeline-debug`. */
|
|
66
|
+
core?: TimelineDebugCore;
|
|
67
|
+
/** Defaults to `createTimelineToolBridge` from `@nodetool-ai/agents`. */
|
|
68
|
+
createBridge?: CreateTimelineBridge;
|
|
69
|
+
onLog?: (line: string) => void;
|
|
70
|
+
}
|
|
71
|
+
export interface TimelineDebugOptions {
|
|
72
|
+
interact?: TimelineInteractionStep[];
|
|
73
|
+
outDir?: string;
|
|
74
|
+
}
|
|
75
|
+
export interface TimelineValidateResult {
|
|
76
|
+
target: ResolvedTimelineTarget["target"];
|
|
77
|
+
validation: TimelineValidation;
|
|
78
|
+
}
|
|
79
|
+
export interface TimelineDebugResult {
|
|
80
|
+
report: TimelineDebugReport;
|
|
81
|
+
bundleDir: string;
|
|
82
|
+
}
|
|
83
|
+
/** Load a timeline and validate it — no bridge, no bundle. */
|
|
84
|
+
export declare function runTimelineValidate(ref: string, deps: TimelineDebugDeps): Promise<TimelineValidateResult>;
|
|
85
|
+
/**
|
|
86
|
+
* Replay `--interact` against the headless bridge and write the bundle.
|
|
87
|
+
*
|
|
88
|
+
* A failing step is recorded and the script continues: a run that stops at the
|
|
89
|
+
* first error hides every problem behind it, and the report is what the caller
|
|
90
|
+
* came for.
|
|
91
|
+
*/
|
|
92
|
+
export declare function runTimelineDebug(ref: string, options: TimelineDebugOptions, deps: TimelineDebugDeps): Promise<TimelineDebugResult>;
|
|
93
|
+
//# sourceMappingURL=harness.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"harness.d.ts","sourceRoot":"","sources":["../../src/timeline-debug/harness.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE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