@vosjs/studio-core 0.46.0 → 0.48.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -4,6 +4,8 @@ import { Segment, KeyframeTrack } from '@vosjs/timeline';
4
4
  export { Segment } from '@vosjs/timeline';
5
5
  import { TimelineEdit } from '@vosjs/shared/timelineEdits';
6
6
  import { LaneAdapter } from '@vosjs/editor';
7
+ import { FilmSummary } from '@vosjs/shared/music';
8
+ export { FilmSummary } from '@vosjs/shared/music';
7
9
 
8
10
  /**
9
11
  * Zoom/pan camera styles — named strategy
@@ -402,12 +404,26 @@ interface RecordingMeta {
402
404
  pageUrl?: string;
403
405
  pageTitle?: string;
404
406
  /**
405
- * What the frame contains. Absent = 'tab' (back-compat). Non-tab surfaces use
406
- * CursorEvent.sx/sy + the geometry rects below to map cursor → capture px
407
- * (see normalizeCaptureSpace); tab-only studio features (browser-bar mock,
408
- * letterbox notice) are gated off for them.
407
+ * The application an `'app'` take recorded, where a page take says
408
+ * `pageUrl`: its name as the OS shows it, and its bundle id or executable
409
+ * name. Never a window title, which carries document and account names.
409
410
  */
410
- captureSurface?: 'tab' | 'window' | 'monitor';
411
+ app?: {
412
+ name: string;
413
+ id?: string;
414
+ };
415
+ /**
416
+ * What the frame contains. Absent = 'tab' (back-compat). `'window'` and
417
+ * `'monitor'` are a BROWSER's display captures: they use CursorEvent.sx/sy +
418
+ * the geometry rects below to map cursor → capture px (see
419
+ * normalizeCaptureSpace), and tab-only studio features (browser-bar mock,
420
+ * letterbox notice) are gated off for them. `'app'` is one application's
421
+ * window recorded by a desktop producer: the frame IS the window, the cursor
422
+ * is already in the frame's own space (`width × height` are the window's
423
+ * points, `captureWidth × captureHeight` its pixels), and the footage
424
+ * carries the window's own title bar, so no bar is drawn over it.
425
+ */
426
+ captureSurface?: 'tab' | 'window' | 'monitor' | 'app';
411
427
  /**
412
428
  * Target-tab browser-window bounds at record start, screen-coord CSS px
413
429
  * (window.screenX/Y + outerWidth/Height). Anchor for 'window' captures.
@@ -461,10 +477,12 @@ interface RecordingMeta {
461
477
  * track from automation (exact coords, fresh rects, coverage 1 by
462
478
  * construction) and encode WebM; `ingest` is someone else's recording
463
479
  * brought in as a take (`vos ingest`, or a file dropped on the studio),
464
- * whose cursor track, if any, came from a trace beside it; absent means
480
+ * whose cursor track, if any, came from a trace beside it; `desktop` is a
481
+ * capture helper recording an application's window, its cursor either
482
+ * sampled from the real pointer or synthesized from a script; absent means
465
483
  * the extension.
466
484
  */
467
- producer?: 'extension' | 'cli' | 'ingest';
485
+ producer?: 'extension' | 'cli' | 'ingest' | 'desktop';
468
486
  /**
469
487
  * The step timeline: when each actions.json step ran, in SOURCE
470
488
  * seconds. This is what makes a cut re-anchorable across re-records — a
@@ -3703,6 +3721,8 @@ interface DigestTakeFacts {
3703
3721
  producer: string;
3704
3722
  pageUrl: string | null;
3705
3723
  pageTitle: string | null;
3724
+ /** The recorded application's name, on an `'app'` take. */
3725
+ app: string | null;
3706
3726
  hasMic: boolean;
3707
3727
  hasSystemAudio: boolean;
3708
3728
  hasCursor: boolean;
@@ -6021,4 +6041,41 @@ declare function rejectSpan(rejected: RejectedSpan[] | undefined, lane: Rejected
6021
6041
  anchor?: StepAnchor;
6022
6042
  }, note?: string): RejectedSpan;
6023
6043
 
6024
- export { ASPECT_RATIOS, AUDIO_PLAN_STEP, type AnchorKind, type AnchorMiss, type AnchorResolution, type Anim, type AnimKind, type AnimSide, type AnimStep, type AppliedTemplate, type ApplyTemplateOptions, type AspectRatioOption, type AudioClip, type AudioLoudness, type AudioPlanPoint, type AudioPlanTrack, BACKGROUND_Z, BASE_FRAME_STYLE, type Backdrop, type BackgroundMedia, type BakeResult, type BakedText3dAsset, type BakedText3dMaterial, type BrowserBarStyle, type BuildDigestInput, CALLOUT_DEFAULT_BODY_PX, CALLOUT_SHAPES, CALLOUT_TYPE_RATIO, CAMERA_CENTRE_RAMP, CAMERA_COVER_MIN, CAMERA_FAR, CAMERA_NEAR, CAM_CHAIN_GAP, CAM_EASE, CAM_PAN, CAM_PAN_EASE, CAM_RAMP_IN, CAM_RAMP_OUT, CAM_SIZE_MAX, CAM_SIZE_MIN, CAM_SPAN_MIN, CAPTURE_COVERAGE_MIN, CARD_EDGE_OVERDRAW, CARD_ENTER_KINDS, CARD_EXIT_KINDS, CARD_FADE_SECONDS, CARD_FOV, CARD_Z, CHANGE_FLOOR, CHANGE_GRID, CHANGE_LEAD, CHANGE_OFFSETS, CHANNEL_SPECS_HASH, CHANNEL_SPECS_VERIFIED, CLICK_FX_INTENSITY, CLICK_FX_PRE, CLICK_HIGHLIGHT_FADE, CLICK_HOLD_MS, CLICK_PAIR_MAX, CLICK_PULSE_DUR, CLICK_RECT_MAX_FRAC, CLICK_RIPPLE_DUR, CLICK_SYNTH_RELEASE, CLUSTER_FILL, CROP_MAX_PX, CROP_MIN_FRAC, CROP_MIN_PX, CROP_PAD, CURSOR_IDLE_EPS_FRAC, CURSOR_IDLE_FADE_IN, CURSOR_IDLE_FADE_OUT, CURSOR_IDLE_HOLD, CURSOR_OFF_FADE, type CalloutBox, type CalloutClipOptions, type CalloutLook, type CalloutRegister, type CalloutShape, type CalloutWords, type CamBubbleRect, type CamPoseSpan, type CamStyle, type CameraModel, type CaptureNormalization, type CardLayout, type ChangeSample, type ChangeWitness, type ChangedRegion, type ClickFxStyle, type ClipGain, type ClipGainBasis, type CopiedLayout, type CopyLayoutOptions, type CopyStyleOptions, type CursorEvent, type CursorFadeKey, type CursorIdleOptions, type CursorOff, type CursorStyle, type CursorTrack, DARK_GROUND, DEFAULT_BROWSER_BAR, DEFAULT_CAM_POSE, DEFAULT_CAM_STYLE, DEFAULT_CLICK_FX, DEFAULT_CURSOR_STYLE, DEFAULT_DUCK, DEFAULT_FRAME_STYLE, DEFAULT_SPEED_PARAMS, DEFAULT_TILT_POSE, DEFAULT_ZOOM_LEVEL, DEFAULT_ZOOM_STYLE, DESIGN_FRAME_WIDTH, DESTINATIONS, DIGEST_CROP_MAX, DIGEST_FULL_MAX, DIGEST_VERSION, DOC_FEATURES, DOC_SCHEMA_VERSION, DRAG_FIT_LEVEL, DRAG_MIN_S, DRAG_MIN_TRAVEL_FRAC, type Destination, type Digest, type DigestImageRef, type DigestPlan, type DigestTakeFacts, type DocFeature, type DocSegment, type Drag, type DuckOptions, ELAPSED_PLACEHOLDER, END_CARD_FROM, END_CARD_RECEDE, END_CARD_SECONDS, ENTRANCE_SECONDS, EXPORT_RESOLUTION_OPTIONS, EXPORT_SHORT_EDGE, type EndCard, type EnvelopePoint, type ExportResolution, type ExtractClickOptions, FOLLOW_RECENTER, FOLLOW_SAFE_RATIO, FOOTAGE_FRAME_STYLE, FRAME_BORDER_COLOR_DEFAULT, FRAME_BORDER_DEFAULT, FRAME_BORDER_WIDTH_DEFAULT, FREEZE_DEFAULT_SECONDS, FREEZE_SECONDS_MAX, FREEZE_SECONDS_MIN, type FocusBounds, type FollowEvent, type FollowOptions, type FrameEntrance, type FrameGeometry, type FrameStyle, type FreezeExtent, type FreezeSpan, HOLD_DRIFT_MAX, HOUSE_GRADIENT, HOUSE_REGISTER, HTML_LAYER_FOREIGN_FIELDS, HTML_LAYER_MAX_BYTES, HTML_LAYER_SVG_CODE, HTML_LAYER_WARN_BYTES, HTML_STARTERS, type HtmlLayerFace, type HtmlLayerInlineFace, type HtmlLayerPayload, type HtmlLayerProblem, type HtmlLayerProblemCode, type HtmlLayerSource, type HtmlOverlayClip, type HtmlOverlayFont, type HtmlStarter, IDLE_KINDS, type IdleKind, type IngestOptions, LAYER_CARD_SHADOW, LAYOUT_FRAME_FIELDS, LOOK_KINDS, type LayerCard, type LayoutParts, type Look, type LookBrand, type LookKind, type LookPlacement, type LowerProgramOptions, type LoweredAudioClip, type LoweredClick, type LoweredComposition, type LoweredZoomSpan, type LumaGrid, MEDIA_ENTER_KINDS, MEDIA_EXIT_KINDS, MEDIA_FRAME_KEYS, MEDIA_KEY_PREFIX, MINIMAL_BAR_THEMES, MOTION_DELTA, MOTION_EASE, type Media, type MediaFrame, type MediaFrameKey, type MediaOverlayClip, type MediaSegment, type MicRms, type MinimalBarTheme, type Moment, type MomentKind, type MomentsOptions, type MotionKey, type MotionPose, type MotionPose3D, type MusicBedInput, NORMALIZE_MAX_LIFT_DB, NORMALIZE_MAX_LUFS, NORMALIZE_MIN_LUFS, NORMALIZE_PEAK_CEILING_DB, type NormRect, OBJECT_DEFAULT_SCALE, OVERLAY_FONT_FACES, OVERLAY_LINE_HEIGHT, OVERLAY_MEDIA_DEFAULT_RADIUS, OVERLAY_MEDIA_DEFAULT_WIDTH, OVERLAY_MIN_DURATION, OVERLAY_SCALE_MAX, OVERLAY_SIZE_MAX, OVERLAY_SIZE_MIN, OVERLAY_TRANSITION_DUR, OVERLAY_Z, type ObjectAnimation, type ObjectAsset, type ObjectClip, type ObjectPrimitiveShape, type OutputExtent, type OverlayAnchor, type OverlayClip, type OverlayFontFace, type OverlayKind, type OverlayPin, type OverlayPresetStyle, type OverlayRect, type OverlayTransform, type OverlayTransition, PIN_GAP, PIN_MARGIN, PLATE_GROUND, PLAYBACK_ACTIVITY, PRIMARY_MEDIA, PROGRAM_RETIME, PUMP_REST, type PeerStepSpan, type PeerTrack, type PinCandidate, type PinCarry, type PinMark, type PinPlacement, type PinPlacementInput, type PinReferent, type PinSide, type PinSideResolved, type PlanOptions, type PlanTiltOptions, type PlaneSize, type ProgramAnchorDoc, type ProgramTweenEdit, type ProjectDoc, type PxRect, REJECT_OVERLAP, REPLAY_EPS, REST_TILT_ID, RETIRED_ZOOM_STYLES, type RecordingArtifact, type RecordingMeta, type RecordingNotice, type RecordingOutput, type RecordingPageMedia, type RecordingSkip, type Rect, type RejectedLane, type RejectedSpan, type ReplayedSpan, type ResolvedOverlayBox, type ResolvedOverlayStyle, type Rgb, SCENE_MOTION, SCENE_QUIET, SEGMENT_ENTER_KINDS, SEGMENT_EXIT_KINDS, SPEED_RATE_MAX, SPEED_RATE_MIN, SPEED_SPAN_MIN, STAGE_CLIP_PREFIX, STILL_DEFAULT, STUDIO_ENTRY_ID, STYLE_FIELDS, type SegmentExtent, type SmoothOptions, type SmoothPoint, type SpeedParams, type SpeedSpan, type StepAnchor, type StepSpan, type StudioAudioPlan, type StudioDoc, type StudioEntry, type StyleField, type StyledText, TEXT3D_DEPTH_DEFAULT, TEXT3D_DEPTH_MAX, TEXT3D_DEPTH_MIN, TEXT_ENTER_KINDS, TEXT_EXIT_KINDS, TEXT_PRESETS, TILT_AUTO_DEAD_ZONE, TILT_AUTO_MIN, TILT_CHAIN_GAP, TILT_DEG_MAX, TILT_EASE, TILT_INTENSITY_MAX, TILT_PAN, TILT_PAN_EASE, TILT_RAMP_IN, TILT_RAMP_OUT, TILT_SPAN_MIN, TILT_UI_DEG_MAX, TRANSITION_SECONDS, TRANSITION_SECONDS_MAX, TRANSITION_SECONDS_MIN, TRANSITION_SPEED_MULT, type TemplateAnchor, type Text3dMaterial, type TextFxDirection, type TextFxKind, type TextFxSpec, type TextFxUnit, type TextOverlayBox, type TextOverlayClip, type TextOverlayPreset, type TextOverlayStroke, type TiltPersonality, type TiltSpan, type TiltStyleName, type TraceFileKind, type TraceOptions, type TraceResult, type TranscriptSegment, type Transition, type TransitionKind, type TransitionMove, type TransitionOut, type TransitionSpeed, type UsedFeature, WINDOW_FOCUS_MIN, ZOOM_CHAIN_GAP, ZOOM_EASE, ZOOM_LEVELS, ZOOM_LEVEL_MAX, ZOOM_LEVEL_MIN, ZOOM_PAN, ZOOM_PAN_EASE, ZOOM_RAMP_IN, ZOOM_RAMP_IN_OVERLAP, ZOOM_RAMP_OUT, ZOOM_SPAN_MIN, ZOOM_STYLES, ZOOM_STYLE_OPTIONS, type ZipEntry, type ZoomScreen, type ZoomSpan, type ZoomStyleName, type ZoomStyleParams, type ZoomView, type ZoomWindow, ambientDrift, anchorKindOf, anchorSourceDuration, anchoredClip, animStep, applyLook, applyTemplate, aspectRatioValue, audioLane, backdropMedia, bakeDocFeatures, boldWeightFor, buildDigest, calloutBox, calloutClip, calloutGroundOf, calloutLook, calloutSource, camBubbleRect, camBubbleRectAt, camLane, camMoveLane, camRectFromPose, camRestPose, camTrackFromDoc, cameraCentring, cameraModel, cameraRestWindows, cameraRests, cameraSpanExtents, cardEnter, cardExit, cardFields, cardInset, cardPointToScreen, cardPoseTrack, changedRegion, clampCamFrac, clampCamSize, clampFocus, clampFreezeSeconds, clampSpeedRate, clampTiltDeg, clampZoomLevel, clipEnvelope, clipGain, clipLength, clipsFrom, compareVersions, computeCardLayout, computeMicRms, computePeaks, copyLayout, copyStyle, cropBox, cssFamilies, cssWeights, cursorFromCsv, cursorFromPlaywrightTrace, cursorFromRecords, cursorFromTrace, cursorIdleFade, cursorOffAlpha, deltaE, deriveViewportCrop, destinationById, destinationsForChannel, docCardLayout, docFeatures, docFreezes, docMediaList, docOutputDuration, docRestTime, docStillTime, docToCropSpace, docToFullSpace, docTransitions, docZoomTrack, dragsFromTrack, dropTemplate, duckCurve, effectiveSegments, elapsedFor, endCardClips, enterKey, enterOf, entranceAt, entranceEnd, entranceSeconds, envelopeAt, envelopeValueAt, exitKey, exitOf, exitSeconds, expandEndCard, expectedFrameSize, exportSizeFor, extractClicks, featuresNewerThan, findStep, focusBounds, focusForViewportCentre, followFocusEvents, formatElapsed, frameGeometry, freezeLane, freezeOutputExtents, hasElapsed, hasReplay, hexToRgb, hexToRgbTriplet, houseLook, htmlLayerBleed, htmlLayerBleedFor, htmlLayerFaces, htmlLayerKey, htmlLayerLabel, htmlLayerPayload, htmlLayerPictureBox, htmlLayerProblems, htmlLayerSvg, htmlLayerText, htmlLayerUnhostedFamilies, htmlLayerWidth, htmlStarterClip, idleGaps, idleKey, isKeyedOverlay, isLookKind, isLoweredRecording, isMusicBed, isPlayback, isProgramDoc, isRecordingDoc, isRejected, isStageClip, isUnitStep, lastLayerEnd, layerMedia, layerStart, layoutOf, levelForFocusFraction, liveZoomStyleName, longestOutputExtent, lookFromBrand, lookKindForGround, loudnessMatches, lowerProgramDoc, lowerStudioDoc, lowerToComposition, marksEmphasis, mediaAtOutput, mediaDuration, mediaFrame, mediaKey, mediaRef, mediaRefId, mediaSource, micLane, migrateHostedDoc, migrateMotion, migrateText, migrateTextClip, migrateZoomStyle, momentOutputs, momentsFromDoc, motionTrack, musicBedClip, nextMediaId, normalizeCaptureSpace, objectMotionBase, objectMotionPoseAt, objectsLane, outputDurationOf, outputEnd, outputRangeToSource, overlapFraction, overlayFaceFor, overlayFontFaces, overlayFontString, overlayFxSpec, overlayHit, overlayLines, overlayMotionBase, overlayMotionPoseAt, overlayPinPoseAt, overlayPlainText, overlayRect, overlaysLane, ownFreezes, pageDisplayUrl, parseCssColour, parsePoseId, pickChange, pickStyle, pinBox, pinCandidates, pinPlacement, pinRectOnScreen, pinReferent, pinReferentAt, placeFreezes, planAutoSpeed, planAutoTilt, planAutoZoom, planForDigest, planeSizeAtDepth, platformBarKind, playwrightTraceEntry, programDuration, programStillTime, projectFromArtifact, pumpFreeChainGap, ratedSegments, recommendedExportResolution, refillAudioBeds, rejectSpan, relativeLuminance, removeSourceRange, removeSpeedInRange, replayFlags, replayedSeconds, resolveAnchor, resolveExportSize, resolveOverlayAnchors, resolveOverlayBox, resolveOverlayStyle, resolvePins, resolveText3dAsset, resolveZoomStyle, restLeanOf, restSpansThroughTransitions, rgbToHex, sameMedia, sceneChanges, scrollRuns, segmentOutputExtents, outputLen as segmentOutputLen, segmentStarts, setSpeedInRange, slideSide, smoothCursor, snapRunWeight, sourceMomentToOutput, spanOutputExtent, spanOutputExtents, speedLane, stepElapsedMs, stepMomentToOutput, studioAudioPlan, studioEntry, studioLayerData, styledTextOf, textRunsOf, tiltLane, tiltTrackFromDoc, traceKindOf, transitionMult, transitionSeconds, unionFitLevel, unionRect, videoLane, voiceKey, wellFormedXml, withBackdrop, withFreezes, withHolds, withoutRejected, wrapProgramLength, zipEntries, zipEntryBytes, zoomCoversRect, zoomLane, zoomSpanForRange, zoomTrackFromDoc, zoomView, zoomViewport, zoomWindow };
6044
+ /**
6045
+ * A film as the music ranking reads it: its output length, the
6046
+ * instants a beat should land on, the moment the music should open up,
6047
+ * whether a voice plays. Built from the document here, where the document
6048
+ * is known, and handed to `@vosjs/shared/music`'s `rankBeds`, which never
6049
+ * reads one; the CLI's `vos music pick` and the studio's Sound panel read
6050
+ * the same summary, so one rule says what a cut is.
6051
+ *
6052
+ * A recording's cuts are its layers' starts (a caption landed on a step,
6053
+ * a callout), its segment boundaries (a join, a page change, a freeze) and
6054
+ * the page changes the recorder marked; its payoff is the last step the
6055
+ * script marks `"zoom": true`, else the last cut. A program's cuts are its
6056
+ * scene labels (`tl.addLabel`), its payoff the last scene. Pure.
6057
+ */
6058
+
6059
+ interface FilmSummaryOptions {
6060
+ /** Stable identity: the vos id, else the take directory's name. */
6061
+ seed: string;
6062
+ /** The payoff, output seconds, when the person said it (`--at`). */
6063
+ payoff?: number;
6064
+ /** Override what the document says about a voice. */
6065
+ voice?: boolean;
6066
+ mood?: string;
6067
+ words?: string;
6068
+ like?: string[];
6069
+ fadeIn?: boolean;
6070
+ }
6071
+ /** The scene labels a program declares, output seconds, in order. */
6072
+ declare function programSceneTimes(config: Record<string, unknown>): number[];
6073
+ /**
6074
+ * The film summary of a document. `seed` is the caller's (a vos id when
6075
+ * the take is on vos.so, else its directory's name).
6076
+ */
6077
+ declare function filmSummaryOf(doc: StudioDoc, opts: FilmSummaryOptions): FilmSummary;
6078
+ /** The library slugs a document's audio clips play, for a project's `like`. */
6079
+ declare function musicSlugsOfDoc(doc: Pick<StudioDoc, 'audio'>): string[];
6080
+
6081
+ export { ASPECT_RATIOS, AUDIO_PLAN_STEP, type AnchorKind, type AnchorMiss, type AnchorResolution, type Anim, type AnimKind, type AnimSide, type AnimStep, type AppliedTemplate, type ApplyTemplateOptions, type AspectRatioOption, type AudioClip, type AudioLoudness, type AudioPlanPoint, type AudioPlanTrack, BACKGROUND_Z, BASE_FRAME_STYLE, type Backdrop, type BackgroundMedia, type BakeResult, type BakedText3dAsset, type BakedText3dMaterial, type BrowserBarStyle, type BuildDigestInput, CALLOUT_DEFAULT_BODY_PX, CALLOUT_SHAPES, CALLOUT_TYPE_RATIO, CAMERA_CENTRE_RAMP, CAMERA_COVER_MIN, CAMERA_FAR, CAMERA_NEAR, CAM_CHAIN_GAP, CAM_EASE, CAM_PAN, CAM_PAN_EASE, CAM_RAMP_IN, CAM_RAMP_OUT, CAM_SIZE_MAX, CAM_SIZE_MIN, CAM_SPAN_MIN, CAPTURE_COVERAGE_MIN, CARD_EDGE_OVERDRAW, CARD_ENTER_KINDS, CARD_EXIT_KINDS, CARD_FADE_SECONDS, CARD_FOV, CARD_Z, CHANGE_FLOOR, CHANGE_GRID, CHANGE_LEAD, CHANGE_OFFSETS, CHANNEL_SPECS_HASH, CHANNEL_SPECS_VERIFIED, CLICK_FX_INTENSITY, CLICK_FX_PRE, CLICK_HIGHLIGHT_FADE, CLICK_HOLD_MS, CLICK_PAIR_MAX, CLICK_PULSE_DUR, CLICK_RECT_MAX_FRAC, CLICK_RIPPLE_DUR, CLICK_SYNTH_RELEASE, CLUSTER_FILL, CROP_MAX_PX, CROP_MIN_FRAC, CROP_MIN_PX, CROP_PAD, CURSOR_IDLE_EPS_FRAC, CURSOR_IDLE_FADE_IN, CURSOR_IDLE_FADE_OUT, CURSOR_IDLE_HOLD, CURSOR_OFF_FADE, type CalloutBox, type CalloutClipOptions, type CalloutLook, type CalloutRegister, type CalloutShape, type CalloutWords, type CamBubbleRect, type CamPoseSpan, type CamStyle, type CameraModel, type CaptureNormalization, type CardLayout, type ChangeSample, type ChangeWitness, type ChangedRegion, type ClickFxStyle, type ClipGain, type ClipGainBasis, type CopiedLayout, type CopyLayoutOptions, type CopyStyleOptions, type CursorEvent, type CursorFadeKey, type CursorIdleOptions, type CursorOff, type CursorStyle, type CursorTrack, DARK_GROUND, DEFAULT_BROWSER_BAR, DEFAULT_CAM_POSE, DEFAULT_CAM_STYLE, DEFAULT_CLICK_FX, DEFAULT_CURSOR_STYLE, DEFAULT_DUCK, DEFAULT_FRAME_STYLE, DEFAULT_SPEED_PARAMS, DEFAULT_TILT_POSE, DEFAULT_ZOOM_LEVEL, DEFAULT_ZOOM_STYLE, DESIGN_FRAME_WIDTH, DESTINATIONS, DIGEST_CROP_MAX, DIGEST_FULL_MAX, DIGEST_VERSION, DOC_FEATURES, DOC_SCHEMA_VERSION, DRAG_FIT_LEVEL, DRAG_MIN_S, DRAG_MIN_TRAVEL_FRAC, type Destination, type Digest, type DigestImageRef, type DigestPlan, type DigestTakeFacts, type DocFeature, type DocSegment, type Drag, type DuckOptions, ELAPSED_PLACEHOLDER, END_CARD_FROM, END_CARD_RECEDE, END_CARD_SECONDS, ENTRANCE_SECONDS, EXPORT_RESOLUTION_OPTIONS, EXPORT_SHORT_EDGE, type EndCard, type EnvelopePoint, type ExportResolution, type ExtractClickOptions, FOLLOW_RECENTER, FOLLOW_SAFE_RATIO, FOOTAGE_FRAME_STYLE, FRAME_BORDER_COLOR_DEFAULT, FRAME_BORDER_DEFAULT, FRAME_BORDER_WIDTH_DEFAULT, FREEZE_DEFAULT_SECONDS, FREEZE_SECONDS_MAX, FREEZE_SECONDS_MIN, type FilmSummaryOptions, type FocusBounds, type FollowEvent, type FollowOptions, type FrameEntrance, type FrameGeometry, type FrameStyle, type FreezeExtent, type FreezeSpan, HOLD_DRIFT_MAX, HOUSE_GRADIENT, HOUSE_REGISTER, HTML_LAYER_FOREIGN_FIELDS, HTML_LAYER_MAX_BYTES, HTML_LAYER_SVG_CODE, HTML_LAYER_WARN_BYTES, HTML_STARTERS, type HtmlLayerFace, type HtmlLayerInlineFace, type HtmlLayerPayload, type HtmlLayerProblem, type HtmlLayerProblemCode, type HtmlLayerSource, type HtmlOverlayClip, type HtmlOverlayFont, type HtmlStarter, IDLE_KINDS, type IdleKind, type IngestOptions, LAYER_CARD_SHADOW, LAYOUT_FRAME_FIELDS, LOOK_KINDS, type LayerCard, type LayoutParts, type Look, type LookBrand, type LookKind, type LookPlacement, type LowerProgramOptions, type LoweredAudioClip, type LoweredClick, type LoweredComposition, type LoweredZoomSpan, type LumaGrid, MEDIA_ENTER_KINDS, MEDIA_EXIT_KINDS, MEDIA_FRAME_KEYS, MEDIA_KEY_PREFIX, MINIMAL_BAR_THEMES, MOTION_DELTA, MOTION_EASE, type Media, type MediaFrame, type MediaFrameKey, type MediaOverlayClip, type MediaSegment, type MicRms, type MinimalBarTheme, type Moment, type MomentKind, type MomentsOptions, type MotionKey, type MotionPose, type MotionPose3D, type MusicBedInput, NORMALIZE_MAX_LIFT_DB, NORMALIZE_MAX_LUFS, NORMALIZE_MIN_LUFS, NORMALIZE_PEAK_CEILING_DB, type NormRect, OBJECT_DEFAULT_SCALE, OVERLAY_FONT_FACES, OVERLAY_LINE_HEIGHT, OVERLAY_MEDIA_DEFAULT_RADIUS, OVERLAY_MEDIA_DEFAULT_WIDTH, OVERLAY_MIN_DURATION, OVERLAY_SCALE_MAX, OVERLAY_SIZE_MAX, OVERLAY_SIZE_MIN, OVERLAY_TRANSITION_DUR, OVERLAY_Z, type ObjectAnimation, type ObjectAsset, type ObjectClip, type ObjectPrimitiveShape, type OutputExtent, type OverlayAnchor, type OverlayClip, type OverlayFontFace, type OverlayKind, type OverlayPin, type OverlayPresetStyle, type OverlayRect, type OverlayTransform, type OverlayTransition, PIN_GAP, PIN_MARGIN, PLATE_GROUND, PLAYBACK_ACTIVITY, PRIMARY_MEDIA, PROGRAM_RETIME, PUMP_REST, type PeerStepSpan, type PeerTrack, type PinCandidate, type PinCarry, type PinMark, type PinPlacement, type PinPlacementInput, type PinReferent, type PinSide, type PinSideResolved, type PlanOptions, type PlanTiltOptions, type PlaneSize, type ProgramAnchorDoc, type ProgramTweenEdit, type ProjectDoc, type PxRect, REJECT_OVERLAP, REPLAY_EPS, REST_TILT_ID, RETIRED_ZOOM_STYLES, type RecordingArtifact, type RecordingMeta, type RecordingNotice, type RecordingOutput, type RecordingPageMedia, type RecordingSkip, type Rect, type RejectedLane, type RejectedSpan, type ReplayedSpan, type ResolvedOverlayBox, type ResolvedOverlayStyle, type Rgb, SCENE_MOTION, SCENE_QUIET, SEGMENT_ENTER_KINDS, SEGMENT_EXIT_KINDS, SPEED_RATE_MAX, SPEED_RATE_MIN, SPEED_SPAN_MIN, STAGE_CLIP_PREFIX, STILL_DEFAULT, STUDIO_ENTRY_ID, STYLE_FIELDS, type SegmentExtent, type SmoothOptions, type SmoothPoint, type SpeedParams, type SpeedSpan, type StepAnchor, type StepSpan, type StudioAudioPlan, type StudioDoc, type StudioEntry, type StyleField, type StyledText, TEXT3D_DEPTH_DEFAULT, TEXT3D_DEPTH_MAX, TEXT3D_DEPTH_MIN, TEXT_ENTER_KINDS, TEXT_EXIT_KINDS, TEXT_PRESETS, TILT_AUTO_DEAD_ZONE, TILT_AUTO_MIN, TILT_CHAIN_GAP, TILT_DEG_MAX, TILT_EASE, TILT_INTENSITY_MAX, TILT_PAN, TILT_PAN_EASE, TILT_RAMP_IN, TILT_RAMP_OUT, TILT_SPAN_MIN, TILT_UI_DEG_MAX, TRANSITION_SECONDS, TRANSITION_SECONDS_MAX, TRANSITION_SECONDS_MIN, TRANSITION_SPEED_MULT, type TemplateAnchor, type Text3dMaterial, type TextFxDirection, type TextFxKind, type TextFxSpec, type TextFxUnit, type TextOverlayBox, type TextOverlayClip, type TextOverlayPreset, type TextOverlayStroke, type TiltPersonality, type TiltSpan, type TiltStyleName, type TraceFileKind, type TraceOptions, type TraceResult, type TranscriptSegment, type Transition, type TransitionKind, type TransitionMove, type TransitionOut, type TransitionSpeed, type UsedFeature, WINDOW_FOCUS_MIN, ZOOM_CHAIN_GAP, ZOOM_EASE, ZOOM_LEVELS, ZOOM_LEVEL_MAX, ZOOM_LEVEL_MIN, ZOOM_PAN, ZOOM_PAN_EASE, ZOOM_RAMP_IN, ZOOM_RAMP_IN_OVERLAP, ZOOM_RAMP_OUT, ZOOM_SPAN_MIN, ZOOM_STYLES, ZOOM_STYLE_OPTIONS, type ZipEntry, type ZoomScreen, type ZoomSpan, type ZoomStyleName, type ZoomStyleParams, type ZoomView, type ZoomWindow, ambientDrift, anchorKindOf, anchorSourceDuration, anchoredClip, animStep, applyLook, applyTemplate, aspectRatioValue, audioLane, backdropMedia, bakeDocFeatures, boldWeightFor, buildDigest, calloutBox, calloutClip, calloutGroundOf, calloutLook, calloutSource, camBubbleRect, camBubbleRectAt, camLane, camMoveLane, camRectFromPose, camRestPose, camTrackFromDoc, cameraCentring, cameraModel, cameraRestWindows, cameraRests, cameraSpanExtents, cardEnter, cardExit, cardFields, cardInset, cardPointToScreen, cardPoseTrack, changedRegion, clampCamFrac, clampCamSize, clampFocus, clampFreezeSeconds, clampSpeedRate, clampTiltDeg, clampZoomLevel, clipEnvelope, clipGain, clipLength, clipsFrom, compareVersions, computeCardLayout, computeMicRms, computePeaks, copyLayout, copyStyle, cropBox, cssFamilies, cssWeights, cursorFromCsv, cursorFromPlaywrightTrace, cursorFromRecords, cursorFromTrace, cursorIdleFade, cursorOffAlpha, deltaE, deriveViewportCrop, destinationById, destinationsForChannel, docCardLayout, docFeatures, docFreezes, docMediaList, docOutputDuration, docRestTime, docStillTime, docToCropSpace, docToFullSpace, docTransitions, docZoomTrack, dragsFromTrack, dropTemplate, duckCurve, effectiveSegments, elapsedFor, endCardClips, enterKey, enterOf, entranceAt, entranceEnd, entranceSeconds, envelopeAt, envelopeValueAt, exitKey, exitOf, exitSeconds, expandEndCard, expectedFrameSize, exportSizeFor, extractClicks, featuresNewerThan, filmSummaryOf, findStep, focusBounds, focusForViewportCentre, followFocusEvents, formatElapsed, frameGeometry, freezeLane, freezeOutputExtents, hasElapsed, hasReplay, hexToRgb, hexToRgbTriplet, houseLook, htmlLayerBleed, htmlLayerBleedFor, htmlLayerFaces, htmlLayerKey, htmlLayerLabel, htmlLayerPayload, htmlLayerPictureBox, htmlLayerProblems, htmlLayerSvg, htmlLayerText, htmlLayerUnhostedFamilies, htmlLayerWidth, htmlStarterClip, idleGaps, idleKey, isKeyedOverlay, isLookKind, isLoweredRecording, isMusicBed, isPlayback, isProgramDoc, isRecordingDoc, isRejected, isStageClip, isUnitStep, lastLayerEnd, layerMedia, layerStart, layoutOf, levelForFocusFraction, liveZoomStyleName, longestOutputExtent, lookFromBrand, lookKindForGround, loudnessMatches, lowerProgramDoc, lowerStudioDoc, lowerToComposition, marksEmphasis, mediaAtOutput, mediaDuration, mediaFrame, mediaKey, mediaRef, mediaRefId, mediaSource, micLane, migrateHostedDoc, migrateMotion, migrateText, migrateTextClip, migrateZoomStyle, momentOutputs, momentsFromDoc, motionTrack, musicBedClip, musicSlugsOfDoc, nextMediaId, normalizeCaptureSpace, objectMotionBase, objectMotionPoseAt, objectsLane, outputDurationOf, outputEnd, outputRangeToSource, overlapFraction, overlayFaceFor, overlayFontFaces, overlayFontString, overlayFxSpec, overlayHit, overlayLines, overlayMotionBase, overlayMotionPoseAt, overlayPinPoseAt, overlayPlainText, overlayRect, overlaysLane, ownFreezes, pageDisplayUrl, parseCssColour, parsePoseId, pickChange, pickStyle, pinBox, pinCandidates, pinPlacement, pinRectOnScreen, pinReferent, pinReferentAt, placeFreezes, planAutoSpeed, planAutoTilt, planAutoZoom, planForDigest, planeSizeAtDepth, platformBarKind, playwrightTraceEntry, programDuration, programSceneTimes, programStillTime, projectFromArtifact, pumpFreeChainGap, ratedSegments, recommendedExportResolution, refillAudioBeds, rejectSpan, relativeLuminance, removeSourceRange, removeSpeedInRange, replayFlags, replayedSeconds, resolveAnchor, resolveExportSize, resolveOverlayAnchors, resolveOverlayBox, resolveOverlayStyle, resolvePins, resolveText3dAsset, resolveZoomStyle, restLeanOf, restSpansThroughTransitions, rgbToHex, sameMedia, sceneChanges, scrollRuns, segmentOutputExtents, outputLen as segmentOutputLen, segmentStarts, setSpeedInRange, slideSide, smoothCursor, snapRunWeight, sourceMomentToOutput, spanOutputExtent, spanOutputExtents, speedLane, stepElapsedMs, stepMomentToOutput, studioAudioPlan, studioEntry, studioLayerData, styledTextOf, textRunsOf, tiltLane, tiltTrackFromDoc, traceKindOf, transitionMult, transitionSeconds, unionFitLevel, unionRect, videoLane, voiceKey, wellFormedXml, withBackdrop, withFreezes, withHolds, withoutRejected, wrapProgramLength, zipEntries, zipEntryBytes, zoomCoversRect, zoomLane, zoomSpanForRange, zoomTrackFromDoc, zoomView, zoomViewport, zoomWindow };
package/dist/index.js CHANGED
@@ -506,7 +506,8 @@ function deriveViewportCrop(cursor, meta) {
506
506
  }
507
507
  function normalizeCaptureSpace(cursor, meta) {
508
508
  const surface = meta.captureSurface ?? "tab";
509
- if (surface === "tab") return { cursor, meta, coverage: 1 };
509
+ if (surface === "tab" || surface === "app")
510
+ return { cursor, meta, coverage: 1 };
510
511
  const anchor = surface === "window" ? meta.windowRect : meta.screenRect;
511
512
  const capW = meta.captureWidth ?? 0;
512
513
  const capH = meta.captureHeight ?? 0;
@@ -620,11 +621,12 @@ function projectFromArtifact(artifact, videoUrl, opts = {}) {
620
621
  const norm = normalizeCaptureSpace(artifact.cursor, artifact.meta);
621
622
  const { cursor, meta } = norm;
622
623
  const unfocused = surface === "window" && (artifact.meta.windowFocusedFrac ?? 1) < WINDOW_FOCUS_MIN;
623
- const coverage = surface === "monitor" || artifact.meta.windowMovedDuringTake || unfocused ? 0 : norm.coverage;
624
+ const movedAnchor = surface !== "app" && artifact.meta.windowMovedDuringTake === true;
625
+ const coverage = surface === "monitor" || movedAnchor || unfocused ? 0 : norm.coverage;
624
626
  if (artifact.cursor.length > 0 && coverage < CAPTURE_COVERAGE_MIN) {
625
627
  console.warn(
626
628
  "[studio] dropping cursor track \u2014",
627
- surface === "monitor" ? "entire-screen takes have no cursor effects (untrackable outside browser pages)" : artifact.meta.windowMovedDuringTake ? "window moved/resized during the take" : unfocused ? `browser window focused only ${Math.round((artifact.meta.windowFocusedFrac ?? 0) * 100)}% of the take \u2014 a different window was likely shared` : `coverage ${norm.coverage.toFixed(2)} (wrong surface shared, or unusable capture geometry)`
629
+ surface === "monitor" ? "entire-screen takes have no cursor effects (untrackable outside browser pages)" : movedAnchor ? "window moved/resized during the take" : unfocused ? `browser window focused only ${Math.round((artifact.meta.windowFocusedFrac ?? 0) * 100)}% of the take \u2014 a different window was likely shared` : `coverage ${norm.coverage.toFixed(2)} (wrong surface shared, or unusable capture geometry)`
628
630
  );
629
631
  }
630
632
  const doc = {
@@ -10774,6 +10776,7 @@ function buildDigest(input) {
10774
10776
  producer: meta.producer ?? "extension",
10775
10777
  pageUrl: meta.pageUrl ?? null,
10776
10778
  pageTitle: meta.pageTitle ?? null,
10779
+ app: meta.app?.name ?? null,
10777
10780
  hasMic: Boolean(doc.source.micKey) || meta.hasMic === true,
10778
10781
  hasSystemAudio: meta.hasAudio === true,
10779
10782
  hasCursor: doc.source.cursor.length > 0,
@@ -12815,6 +12818,116 @@ function rejectSpan(rejected, lane, span, note) {
12815
12818
  if (note) entry.note = note;
12816
12819
  return entry;
12817
12820
  }
12821
+
12822
+ // src/filmSummary.ts
12823
+ var CUT_MERGE = 0.25;
12824
+ var r32 = (v) => Math.round(v * 1e3) / 1e3;
12825
+ var isMusicOrEffect = (key) => /\/music\/[^/?#]+\.mp3(?:[?#]|$)/.test(key) || /\/audio-sfx\//.test(key);
12826
+ function programSceneTimes(config) {
12827
+ const code = JSON.stringify(config);
12828
+ const times = /* @__PURE__ */ new Set();
12829
+ for (const m of code.matchAll(
12830
+ /addLabel\(\s*(?:\\"|['`])[^'`"\\]*(?:\\"|['`])\s*,\s*([\d.]+)/g
12831
+ )) {
12832
+ const t = Number(m[1]);
12833
+ if (Number.isFinite(t) && t > 0) times.add(r32(t));
12834
+ }
12835
+ return [...times].sort((a, b) => a - b);
12836
+ }
12837
+ function markedSteps(source) {
12838
+ const steps = source.script?.steps;
12839
+ if (!Array.isArray(steps)) return [];
12840
+ const out = [];
12841
+ steps.forEach((s, i) => {
12842
+ if (!s || typeof s !== "object") return;
12843
+ const step = s;
12844
+ if (step.zoom === true) out.push(typeof step.id === "string" ? step.id : i);
12845
+ });
12846
+ return out;
12847
+ }
12848
+ function tidy(cuts, duration) {
12849
+ const sorted = cuts.filter((t) => Number.isFinite(t) && t > CUT_MERGE && t < duration - 0.05).map(r32).sort((a, b) => a - b);
12850
+ const out = [];
12851
+ for (const t of sorted) {
12852
+ if (!out.length || t - out[out.length - 1] > CUT_MERGE) out.push(t);
12853
+ }
12854
+ return out;
12855
+ }
12856
+ function filmSummaryOf(doc, opts) {
12857
+ const duration = r32(docOutputDuration(doc));
12858
+ const cuts = [];
12859
+ let payoff = opts.payoff;
12860
+ let voice = opts.voice ?? false;
12861
+ if (isRecordingDoc(doc)) {
12862
+ const rated = ratedSegments(doc);
12863
+ let t = 0;
12864
+ for (const s of rated) {
12865
+ const rate = s.rate && s.rate > 0 ? s.rate : 1;
12866
+ t += (s.out - s.in) / rate;
12867
+ cuts.push(t);
12868
+ }
12869
+ for (const clip of doc.overlays ?? []) {
12870
+ const start = layerStart(clip, doc, rated);
12871
+ if (start !== null) cuts.push(start);
12872
+ }
12873
+ let lastMarked = null;
12874
+ for (const { id, source } of docMediaList(doc)) {
12875
+ for (const step of source.meta.steps ?? []) {
12876
+ if (step.navigated && typeof step.tEnd === "number") {
12877
+ const out = sourceMomentToOutput(rated, step.tEnd, id || void 0);
12878
+ if (out !== null) cuts.push(out);
12879
+ }
12880
+ }
12881
+ for (const step of markedSteps(source)) {
12882
+ const r = resolveAnchor(
12883
+ doc,
12884
+ { step, ...id ? { media: id } : {} },
12885
+ rated
12886
+ );
12887
+ if (r.start !== null) {
12888
+ cuts.push(r.start);
12889
+ if (lastMarked === null || r.start > lastMarked) lastMarked = r.start;
12890
+ }
12891
+ }
12892
+ }
12893
+ if (payoff === void 0 && lastMarked !== null) payoff = lastMarked;
12894
+ if (opts.voice === void 0) {
12895
+ voice = voiceKey(doc) !== null || (doc.audio ?? []).some((a) => !isMusicOrEffect(a.key));
12896
+ }
12897
+ } else {
12898
+ const scenes = programSceneTimes(doc.program.config);
12899
+ cuts.push(...scenes);
12900
+ if (payoff === void 0 && scenes.length)
12901
+ payoff = scenes[scenes.length - 1];
12902
+ if (opts.voice === void 0) {
12903
+ voice = (doc.audio ?? []).some((a) => !isMusicOrEffect(a.key));
12904
+ }
12905
+ }
12906
+ const tidied = tidy(cuts, duration);
12907
+ if (payoff === void 0 && tidied.length) payoff = tidied[tidied.length - 1];
12908
+ if (payoff !== void 0 && !(payoff > 0 && payoff < duration)) {
12909
+ payoff = void 0;
12910
+ }
12911
+ return {
12912
+ duration,
12913
+ ...payoff !== void 0 ? { payoff: r32(payoff) } : {},
12914
+ cuts: tidied,
12915
+ voice,
12916
+ ...opts.mood ? { mood: opts.mood } : {},
12917
+ ...opts.words ? { words: opts.words } : {},
12918
+ seed: opts.seed,
12919
+ ...opts.like?.length ? { like: opts.like } : {},
12920
+ ...opts.fadeIn ? { fadeIn: true } : {}
12921
+ };
12922
+ }
12923
+ function musicSlugsOfDoc(doc) {
12924
+ const out = /* @__PURE__ */ new Set();
12925
+ for (const a of doc.audio ?? []) {
12926
+ const m = /\/music\/([a-z0-9][a-z0-9-]*)\.mp3(?:[?#]|$)/.exec(a.key);
12927
+ if (m) out.add(m[1]);
12928
+ }
12929
+ return [...out].sort();
12930
+ }
12818
12931
  export {
12819
12932
  ASPECT_RATIOS,
12820
12933
  AUDIO_PLAN_STEP,
@@ -13109,6 +13222,7 @@ export {
13109
13222
  exportSizeFor,
13110
13223
  extractClicks,
13111
13224
  featuresNewerThan,
13225
+ filmSummaryOf,
13112
13226
  findStep,
13113
13227
  focusBounds,
13114
13228
  focusForViewportCentre,
@@ -13181,6 +13295,7 @@ export {
13181
13295
  momentsFromDoc,
13182
13296
  motionTrack,
13183
13297
  musicBedClip,
13298
+ musicSlugsOfDoc,
13184
13299
  nextMediaId,
13185
13300
  normalizeCaptureSpace,
13186
13301
  normalizeRuns,
@@ -13226,6 +13341,7 @@ export {
13226
13341
  platformBarKind,
13227
13342
  playwrightTraceEntry,
13228
13343
  programDuration,
13344
+ programSceneTimes,
13229
13345
  programStillTime,
13230
13346
  projectFromArtifact,
13231
13347
  pumpFreeChainGap,