flucto 1.26.0 → 1.27.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.
Files changed (51) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/README.md +1 -0
  3. package/dist-electron/cli/args.js +64 -1
  4. package/dist-electron/cli/args.js.map +1 -1
  5. package/dist-electron/cli/index.js +205 -39
  6. package/dist-electron/cli/index.js.map +1 -1
  7. package/dist-electron/cli/output.js +12 -0
  8. package/dist-electron/cli/output.js.map +1 -1
  9. package/dist-electron/main/analysis/agentLabelValidation.js +15 -0
  10. package/dist-electron/main/analysis/agentLabelValidation.js.map +1 -0
  11. package/dist-electron/main/analysis/avCommands.js +19 -0
  12. package/dist-electron/main/analysis/avCommands.js.map +1 -1
  13. package/dist-electron/main/analysis/cameraMotion.js +212 -0
  14. package/dist-electron/main/analysis/cameraMotion.js.map +1 -0
  15. package/dist-electron/main/analysis/contactSheet.js +106 -0
  16. package/dist-electron/main/analysis/contactSheet.js.map +1 -0
  17. package/dist-electron/main/analysis/csvWriter.js +12 -8
  18. package/dist-electron/main/analysis/csvWriter.js.map +1 -1
  19. package/dist-electron/main/analysis/dialogueAlign.js +27 -0
  20. package/dist-electron/main/analysis/dialogueAlign.js.map +1 -0
  21. package/dist-electron/main/analysis/ffmpegSignals.js +15 -4
  22. package/dist-electron/main/analysis/ffmpegSignals.js.map +1 -1
  23. package/dist-electron/main/analysis/framePlan.js +84 -0
  24. package/dist-electron/main/analysis/framePlan.js.map +1 -0
  25. package/dist-electron/main/services/agentLabelFiles.js +96 -0
  26. package/dist-electron/main/services/agentLabelFiles.js.map +1 -0
  27. package/dist-electron/main/services/agentLabeling.js +10 -0
  28. package/dist-electron/main/services/agentLabeling.js.map +1 -0
  29. package/dist-electron/main/services/agentLabelingInstructions.js +43 -0
  30. package/dist-electron/main/services/agentLabelingInstructions.js.map +1 -0
  31. package/dist-electron/main/services/agentMerge.js +284 -0
  32. package/dist-electron/main/services/agentMerge.js.map +1 -0
  33. package/dist-electron/main/services/agentPrepare.js +553 -0
  34. package/dist-electron/main/services/agentPrepare.js.map +1 -0
  35. package/dist-electron/main/services/agentStatus.js +49 -0
  36. package/dist-electron/main/services/agentStatus.js.map +1 -0
  37. package/dist-electron/main/services/analysisReport.js +194 -20
  38. package/dist-electron/main/services/analysisReport.js.map +1 -1
  39. package/dist-electron/main/services/cinematicAnalysis.js +2 -1
  40. package/dist-electron/main/services/cinematicAnalysis.js.map +1 -1
  41. package/dist-electron/main/services/timelineExports.js +254 -0
  42. package/dist-electron/main/services/timelineExports.js.map +1 -0
  43. package/dist-electron/main/transcript/captionExtractor.js +6 -2
  44. package/dist-electron/main/transcript/captionExtractor.js.map +1 -1
  45. package/dist-electron/shared/agentLabelTypes.js +8 -0
  46. package/dist-electron/shared/agentLabelTypes.js.map +1 -0
  47. package/dist-electron/shared/analysisTypes.js.map +1 -1
  48. package/package.json +1 -1
  49. package/schemas/agent-labels.v1.schema.json +375 -0
  50. package/skills/flucto-media-research/SKILL.md +3 -2
  51. package/skills/flucto-media-research/references/shot-analysis.md +96 -0
@@ -0,0 +1,284 @@
1
+ /**
2
+ * `analyze merge`: folds the agent's label batches into the measurements `analyze prepare`
3
+ * left in the job dir and writes the structured report and timeline exports.
4
+ *
5
+ * Nothing under `labels/` is rewritten here; a rejected batch, shot or beat is reported
6
+ * instead of failing the run.
7
+ */
8
+ import fs from 'node:fs';
9
+ import path from 'node:path';
10
+ import { formatTimecode } from '../../shared/analysisTypes.js';
11
+ import { FRAMES_DIR, LABELING_REQUEST_FILE, LABELS_DIR, PREPARE_STATE_FILE, listLabelFiles, readJsonFile, readLabelBatchFile, } from './agentLabelFiles.js';
12
+ import { assignAgentScenes, writeStructuredAnalysisReport } from './analysisReport.js';
13
+ import { matchTechniques, shotIdFor } from './cinematicAnalysis.js';
14
+ import { loadCraftTaxonomy } from './craftTaxonomy.js';
15
+ import { writeTimelineExports } from './timelineExports.js';
16
+ /** A beat read off a tile timecode may land a frame outside the measured cut. */
17
+ const BEAT_RANGE_TOLERANCE_S = 0.05;
18
+ const round3 = (value) => Math.round(value * 1000) / 1000;
19
+ const statMtimeMs = (filePath) => {
20
+ try {
21
+ return fs.statSync(filePath).mtimeMs;
22
+ }
23
+ catch {
24
+ return null;
25
+ }
26
+ };
27
+ /**
28
+ * Craft taxonomy anchors are whole words ("close-up", "tracking"), so the short label
29
+ * codes are expanded before the matcher compares them. Codes that are already words
30
+ * (`pan`, `static`, `low`, `dutch`, …) stay as they are.
31
+ */
32
+ const CRAFT_TERM_BY_LABEL_CODE = {
33
+ ecu: 'extreme close-up',
34
+ cu: 'close-up',
35
+ mcu: 'medium close-up',
36
+ ms: 'medium shot',
37
+ fs: 'full shot',
38
+ ws: 'wide shot',
39
+ ews: 'extreme wide shot',
40
+ topdown: 'top-down',
41
+ eye: 'eye-level',
42
+ ots: 'over-the-shoulder',
43
+ pov: 'pov',
44
+ track: 'tracking',
45
+ whip: 'whip pan',
46
+ push: 'push-in',
47
+ pull: 'pull-out',
48
+ };
49
+ const craftTermFor = (code) => code ? CRAFT_TERM_BY_LABEL_CODE[code] ?? code : undefined;
50
+ /** The subset of an agent label the taxonomy matcher and the production plan text read. */
51
+ const toSemanticLabels = (label) => {
52
+ const subjectKind = (label.characters ?? []).map((character) => character.ref.trim()).filter(Boolean).join(', ');
53
+ const candidate = {
54
+ shotSize: craftTermFor(label.shotSize),
55
+ angle: craftTermFor(label.angle),
56
+ cameraMotion: craftTermFor(label.cameraMotion),
57
+ cameraAxis: label.cameraAxis ?? undefined,
58
+ lightingType: label.lightingType ?? undefined,
59
+ palette: label.palette ?? undefined,
60
+ composition: label.composition ?? undefined,
61
+ subjectKind: subjectKind || undefined,
62
+ narrativeFunctionGuess: label.narrativeFunction ?? undefined,
63
+ transitionGuess: label.transitionIn ?? undefined,
64
+ actionPhaseSummary: label.directionNotes ?? undefined,
65
+ confidence: typeof label.confidence === 'number' && Number.isFinite(label.confidence) ? label.confidence : undefined,
66
+ };
67
+ return Object.fromEntries(Object.entries(candidate).filter(([, value]) => value !== undefined));
68
+ };
69
+ const FALLBACK_SCENE_RATIONALE = 'fallback: no agent scene proposal';
70
+ /** Timeline input with the final scene ids; shots the agent left out get a synthesized SC-U scene. */
71
+ const buildTimelineExportData = (state, observations, labels, proposals) => {
72
+ // Merge already applied the scene rule to these proposals; this only re-derives the ids.
73
+ const assignment = assignAgentScenes(observations, proposals.map((proposal) => ({ batchId: null, proposal })));
74
+ const shots = observations.map((observation) => ({
75
+ shotId: observation.shotId,
76
+ sceneId: assignment.sceneIdByShot.get(observation.shotId) ?? observation.sceneId,
77
+ startS: observation.startS,
78
+ endS: observation.endS,
79
+ label: labels.get(observation.shotId) ?? null,
80
+ dialogue: state.dialogue?.[observation.shotId] ?? [],
81
+ camera: state.camera?.[observation.shotId] ?? null,
82
+ }));
83
+ const scenes = [];
84
+ for (const sceneId of new Set(shots.map((shot) => shot.sceneId))) {
85
+ const shotIds = shots.filter((shot) => shot.sceneId === sceneId).map((shot) => shot.shotId);
86
+ const proposal = assignment.proposalBySceneId.get(sceneId);
87
+ scenes.push(proposal ? { ...proposal, shotIds } : { sceneId, shotIds, rationale: FALLBACK_SCENE_RATIONALE });
88
+ }
89
+ return { shots, scenes, segmentation: state.segmentation, videoName: path.basename(state.videoPath), dialogueSource: state.dialogueSource };
90
+ };
91
+ /**
92
+ * Merges the agent's label batches into the measured prepare state and writes the
93
+ * structured report. Invalid batches, unknown shot ids and out-of-range beats are
94
+ * reported in `labelErrors` instead of failing the run.
95
+ */
96
+ export const mergeAgentLabels = async (dir, opts, deps = {}) => {
97
+ const startedAt = new Date().toISOString();
98
+ const resolved = path.resolve(dir);
99
+ const state = readJsonFile(path.join(resolved, PREPARE_STATE_FILE));
100
+ if (!state)
101
+ throw new Error(`${resolved} has no ${PREPARE_STATE_FILE}; run analyze prepare on the source video first.`);
102
+ const request = readJsonFile(path.join(resolved, LABELING_REQUEST_FILE));
103
+ if (!request)
104
+ throw new Error(`${resolved} has no ${LABELING_REQUEST_FILE}; run analyze prepare on the source video first.`);
105
+ const labelsDir = path.join(resolved, LABELS_DIR);
106
+ const windowByShotId = new Map(state.windows.map((window) => [shotIdFor(window.index), window]));
107
+ const labelErrors = [];
108
+ const labelWarnings = [];
109
+ const labels = new Map();
110
+ const batchByShotId = new Map();
111
+ const proposedScenes = [];
112
+ const labeledBy = new Map();
113
+ const labelFiles = listLabelFiles(labelsDir, request.batches.map((batch) => batch.batchId));
114
+ for (const name of labelFiles.unexpected) {
115
+ labelWarnings.push(`${LABELS_DIR}/${name} is not a batch file of this prepare run (expected ${LABELS_DIR}/<batchId>.json); it was ignored.`);
116
+ }
117
+ const progress = (stage, shotsDone, message) => {
118
+ deps.onProgress?.({ stage, shotsTotal: state.windows.length, shotsDone, status: 'running', message });
119
+ };
120
+ progress('label', 0, `Reading ${labelFiles.byBatch.size} label batch file(s)`);
121
+ const preparedAtMs = Date.parse(state.createdAt);
122
+ // Sorted by name: B001 before B002, so a later batch wins a repeated shot.
123
+ for (const [batchName, filePath] of labelFiles.byBatch) {
124
+ // prepare never deletes labels/, so a file older than the current prepare run may describe other shots.
125
+ const writtenAtMs = statMtimeMs(filePath);
126
+ if (Number.isFinite(preparedAtMs) && writtenAtMs !== null && writtenAtMs < preparedAtMs) {
127
+ labelWarnings.push(`${batchName}: ${LABELS_DIR}/${path.basename(filePath)} is older than this prepare run (${state.createdAt}); it may label the shots of an earlier run.`);
128
+ }
129
+ const read = readLabelBatchFile(filePath);
130
+ if (!read || !read.ok) {
131
+ labelErrors.push(...(read?.errors ?? []));
132
+ continue;
133
+ }
134
+ const batch = read.batch;
135
+ labeledBy.set(`${batch.labeledBy.agent}/${batch.labeledBy.model}`, batch.labeledBy);
136
+ for (const label of batch.shots) {
137
+ const window = windowByShotId.get(label.shotId);
138
+ if (!window) {
139
+ labelErrors.push(`${batchName}: ${label.shotId} is not a shot of this prepare run; the label was ignored.`);
140
+ continue;
141
+ }
142
+ const previousBatch = batchByShotId.get(label.shotId);
143
+ if (previousBatch)
144
+ labelWarnings.push(`${batchName}: ${label.shotId} was already labeled in ${previousBatch}; the later label wins.`);
145
+ const beats = (label.beats ?? []).filter((beat) => {
146
+ const inRange = beat.t >= window.startS - BEAT_RANGE_TOLERANCE_S && beat.t <= window.endS + BEAT_RANGE_TOLERANCE_S;
147
+ if (!inRange)
148
+ labelErrors.push(`${batchName}: ${label.shotId} beat t=${beat.t} is outside ${round3(window.startS)}–${round3(window.endS)} s; the beat was dropped.`);
149
+ return inRange;
150
+ });
151
+ labels.set(label.shotId, label.beats ? { ...label, beats } : label);
152
+ batchByShotId.set(label.shotId, batchName);
153
+ }
154
+ for (const proposal of batch.scenes ?? [])
155
+ proposedScenes.push({ batchId: batchName, proposal });
156
+ }
157
+ const videoName = path.basename(state.videoPath);
158
+ const observations = state.windows.map((window) => {
159
+ const shotId = shotIdFor(window.index);
160
+ const signals = state.signals[shotId];
161
+ if (!signals)
162
+ throw new Error(`${PREPARE_STATE_FILE} has no signals for ${shotId}; re-run analyze prepare with force.`);
163
+ const label = labels.get(shotId) ?? null;
164
+ return {
165
+ videoPath: state.videoPath,
166
+ videoName,
167
+ shotId,
168
+ sceneId: '',
169
+ index: window.index,
170
+ startS: window.startS,
171
+ endS: window.endS,
172
+ durationS: Math.max(0, window.endS - window.startS),
173
+ startTimecode: formatTimecode(window.startS),
174
+ endTimecode: formatTimecode(window.endS),
175
+ cutType: window.cutType,
176
+ outgoingBoundaryCandidate: window.outgoingBoundaryCandidate ? {
177
+ timeSeconds: window.outgoingBoundaryCandidate.ptsS,
178
+ score: window.outgoingBoundaryCandidate.score,
179
+ method: window.outgoingBoundaryCandidate.method,
180
+ verification: 'estimated',
181
+ } : null,
182
+ signals,
183
+ labels: label ? toSemanticLabels(label) : {},
184
+ visionOutcome: label ? 'labeled' : 'not-requested',
185
+ frameRequestAttempted: false,
186
+ frameRequestResponseReceived: false,
187
+ frameRequestDestination: null,
188
+ matchedTechniqueIds: [],
189
+ matchedEvidence: [],
190
+ unmatchedAnchors: [],
191
+ analysisStatus: label ? 'labeled' : 'signal-only',
192
+ };
193
+ });
194
+ // One rule decides scene membership; the report and the timeline exports replay it on what it kept.
195
+ const sceneAssignment = assignAgentScenes(observations, proposedScenes);
196
+ labelErrors.push(...sceneAssignment.warnings);
197
+ const scenes = sceneAssignment.accepted;
198
+ const taxonomyRows = opts.craftDir ? loadCraftTaxonomy(opts.craftDir).rows : [];
199
+ for (const observation of observations) {
200
+ if (taxonomyRows.length === 0)
201
+ break;
202
+ const outcome = matchTechniques(observation.cutType, observation.signals, observation.labels, taxonomyRows);
203
+ observation.matchedTechniqueIds = outcome.matchedIds;
204
+ observation.matchedEvidence = outcome.matchedEvidence;
205
+ observation.unmatchedAnchors = outcome.unmatchedAnchors;
206
+ }
207
+ const labeledShots = observations.filter((observation) => observation.analysisStatus === 'labeled').length;
208
+ const signalOnlyShots = observations.length - labeledShots;
209
+ const visionSummary = {
210
+ attemptedModelCalls: 0,
211
+ modelCallLimit: 0,
212
+ labeledShots,
213
+ signalOnlyShots,
214
+ partialReasons: [
215
+ ...(signalOnlyShots > 0 ? ['unlabeled-shots'] : []),
216
+ ...(labelErrors.length > 0 ? ['label-errors'] : []),
217
+ ],
218
+ frameRequestAttempted: false,
219
+ frameRequestResponseReceived: false,
220
+ externalFrameRequestAttempted: false,
221
+ localServerFrameRequestAttempted: false,
222
+ // Flucto transmits nothing here; where the calling agent's own model runs is not observable.
223
+ externalOnwardTransmission: null,
224
+ };
225
+ // The timeline files are written first so the manifest can list them as artifacts.
226
+ progress('emit', observations.length, 'Writing the timeline exports');
227
+ const timelinePaths = writeTimelineExports(resolved, buildTimelineExportData(state, observations, labels, scenes), opts.exports);
228
+ progress('emit', observations.length, 'Writing the analysis report');
229
+ const structured = await writeStructuredAnalysisReport({
230
+ // Report-only request: merge reuses prepare's measurements, so budget and vision settings are unused.
231
+ request: {
232
+ videoPath: state.videoPath,
233
+ ...(state.sourceUrl ? { sourceUrl: state.sourceUrl } : {}),
234
+ craftDir: opts.craftDir ?? '',
235
+ outputDir: resolved,
236
+ budget: { maxFramesPerShot: 0, maxApiCalls: 0 },
237
+ vision: { enabled: false, provider: null },
238
+ sceneThreshold: 0,
239
+ },
240
+ probe: state.probe,
241
+ observations,
242
+ taxonomyRows,
243
+ segmentationMode: state.segmentation,
244
+ startedAt,
245
+ visionSummary,
246
+ // The hash recorded by prepare: the source may have moved or changed since, and rehashing a multi-GB file is wasted work.
247
+ sourceSha256: state.videoSha256,
248
+ additionalArtifacts: timelinePaths,
249
+ agent: {
250
+ labels,
251
+ scenes,
252
+ dialogue: state.dialogue ?? {},
253
+ camera: state.camera ?? {},
254
+ dialogueSource: state.dialogueSource,
255
+ labeledBy: Array.from(labeledBy.values()),
256
+ },
257
+ });
258
+ if (!opts.keepFrames)
259
+ fs.rmSync(path.join(resolved, FRAMES_DIR), { recursive: true, force: true });
260
+ return {
261
+ success: true,
262
+ videoPath: state.videoPath,
263
+ outputDir: resolved,
264
+ // Agent mode writes no legacy CSVs; only the files merge actually produced are reported.
265
+ shotlogPath: null,
266
+ techniquesPath: null,
267
+ analysisJsonPath: structured.analysisJsonPath,
268
+ manifestPath: structured.manifestPath,
269
+ toolRecommendationsPath: structured.toolRecommendationsPath,
270
+ shotCount: observations.length,
271
+ rowsIncomplete: signalOnlyShots > 0 || labelErrors.length > 0 || state.segmentation.mode !== 'full',
272
+ segmentationMode: state.segmentation,
273
+ labeledShots,
274
+ signalOnlyShots,
275
+ unknownShots: 0,
276
+ budgetExceeded: false,
277
+ visionSummary,
278
+ matchedTechniqueCount: new Set(observations.flatMap((observation) => observation.matchedTechniqueIds)).size,
279
+ labelErrors,
280
+ labelWarnings,
281
+ timelinePaths,
282
+ };
283
+ };
284
+ //# sourceMappingURL=agentMerge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agentMerge.js","sourceRoot":"","sources":["../../../src/main/services/agentMerge.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO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