@vosjs/studio-core 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +67 -1
- package/dist/index.js +38 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -344,6 +344,26 @@ interface StepAnchor {
|
|
|
344
344
|
/** Seconds from that edge to the span's `in` (negative = before it). */
|
|
345
345
|
offset?: number;
|
|
346
346
|
}
|
|
347
|
+
/** The lanes whose planners propose spans, and whose proposals can be rejected. */
|
|
348
|
+
type RejectedLane = 'zoom' | 'tilt' | 'speed';
|
|
349
|
+
/**
|
|
350
|
+
* A planner proposal the human or the agent deleted, kept so no re-plan
|
|
351
|
+
* proposes it again: the lane and the SOURCE extent of the deleted `auto`
|
|
352
|
+
* span (plus its step anchor when it had one). Every auto-merge drops a
|
|
353
|
+
* fresh proposal that lands on a rejected extent of the same lane;
|
|
354
|
+
* `plan --reuse` re-times these the way it re-times a manual span.
|
|
355
|
+
*/
|
|
356
|
+
interface RejectedSpan {
|
|
357
|
+
/** `r{n}`, stable for the differ and the history. */
|
|
358
|
+
id: string;
|
|
359
|
+
lane: RejectedLane;
|
|
360
|
+
/** SOURCE seconds, the deleted span's extent. */
|
|
361
|
+
in: number;
|
|
362
|
+
out: number;
|
|
363
|
+
anchor?: StepAnchor;
|
|
364
|
+
/** Why, in the deleter's words. Optional. */
|
|
365
|
+
note?: string;
|
|
366
|
+
}
|
|
347
367
|
/** One executed actions.json step's extent in the recording. */
|
|
348
368
|
interface StepSpan {
|
|
349
369
|
/** index into actions.steps at record time. */
|
|
@@ -1225,6 +1245,12 @@ interface ProjectDoc {
|
|
|
1225
1245
|
* is off; manual tilt spans work either way.
|
|
1226
1246
|
*/
|
|
1227
1247
|
tiltStyle?: TiltStyleName;
|
|
1248
|
+
/**
|
|
1249
|
+
* Deleted planner proposals (SOURCE time, one lane each — see
|
|
1250
|
+
* RejectedSpan): a re-plan never proposes a span that lands on one. Absent
|
|
1251
|
+
* = nothing rejected; lowers byte-identically (the renderer never reads it).
|
|
1252
|
+
*/
|
|
1253
|
+
rejected?: RejectedSpan[];
|
|
1228
1254
|
/** music/SFX clips on the output timeline (see AudioClip anchoring note). */
|
|
1229
1255
|
audio: AudioClip[];
|
|
1230
1256
|
/**
|
|
@@ -2970,4 +2996,44 @@ declare function defaultBackdropMedia(): BackgroundMedia;
|
|
|
2970
2996
|
/** A frame style opening on the default backdrop (media + its ground). */
|
|
2971
2997
|
declare function withDefaultBackdrop(frame: FrameStyle): FrameStyle;
|
|
2972
2998
|
|
|
2973
|
-
|
|
2999
|
+
/**
|
|
3000
|
+
* Rejected proposals: the document's way to say "not this one".
|
|
3001
|
+
*
|
|
3002
|
+
* A planner proposal (an `auto` zoom, tilt or speed span) that the human or
|
|
3003
|
+
* the agent deleted is not data by itself: the doc records what was written,
|
|
3004
|
+
* not what was removed, so the next re-plan (a style pick, `vos plan`, a
|
|
3005
|
+
* re-record carried by `plan --reuse`) proposed it again and the deletion
|
|
3006
|
+
* had to be repeated by hand. `doc.rejected` keeps the deletion as a span
|
|
3007
|
+
* of its own — the lane and the source extent, plus the step anchor when
|
|
3008
|
+
* the span had one — and every auto-merge drops a fresh proposal that lands
|
|
3009
|
+
* on it. Manual spans never need this: a re-plan keeps them by contract.
|
|
3010
|
+
*
|
|
3011
|
+
* Matching is by extent, never by id: planner ids are positional and a
|
|
3012
|
+
* re-record moves every beat by tens of milliseconds, so a proposal is
|
|
3013
|
+
* rejected when it overlaps a rejected extent on the same lane by at least
|
|
3014
|
+
* REJECT_OVERLAP of the shorter of the two.
|
|
3015
|
+
*/
|
|
3016
|
+
|
|
3017
|
+
/** Fraction of the shorter extent two spans must share to be "the same beat". */
|
|
3018
|
+
declare const REJECT_OVERLAP = 0.5;
|
|
3019
|
+
interface Extent {
|
|
3020
|
+
in: number;
|
|
3021
|
+
out: number;
|
|
3022
|
+
}
|
|
3023
|
+
/** Shared length over the shorter length; 0 when apart or degenerate. */
|
|
3024
|
+
declare function overlapFraction(a: Extent, b: Extent): number;
|
|
3025
|
+
/** Whether a proposal on this lane lands on a rejected extent. */
|
|
3026
|
+
declare function isRejected(lane: RejectedLane, span: Extent, rejected: RejectedSpan[] | undefined): boolean;
|
|
3027
|
+
/** The proposals that survive the rejected list, in their given order. */
|
|
3028
|
+
declare function withoutRejected<T extends Extent>(lane: RejectedLane, spans: T[], rejected: RejectedSpan[] | undefined): T[];
|
|
3029
|
+
/**
|
|
3030
|
+
* The entry a deleted auto span leaves behind. Ids are `r{n}` over the
|
|
3031
|
+
* existing list so a differ and a history can name the rejection; the
|
|
3032
|
+
* anchor rides along when the span had one, so a re-record re-times the
|
|
3033
|
+
* rejection exactly the way it re-times the span it replaced.
|
|
3034
|
+
*/
|
|
3035
|
+
declare function rejectSpan(rejected: RejectedSpan[] | undefined, lane: RejectedLane, span: Extent & {
|
|
3036
|
+
anchor?: StepAnchor;
|
|
3037
|
+
}, note?: string): RejectedSpan;
|
|
3038
|
+
|
|
3039
|
+
export { ASPECT_RATIOS, AUDIO_PLAN_STEP, type AnchorKind, type AspectRatioOption, type AudioClip, type AudioPlanPoint, type AudioPlanTrack, BACKDROP_DEFAULT_ON, BACKGROUND_Z, type BackgroundMedia, type BakedText3dAsset, type BakedText3dMaterial, type BrowserBarStyle, type BuildDigestInput, 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_FOV, CARD_Z, CHANNEL_SPECS_HASH, CHANNEL_SPECS_VERIFIED, CLICK_FX_INTENSITY, CLICK_FX_PRE, CLICK_HIGHLIGHT_FADE, CLICK_PAIR_MAX, CLICK_PULSE_DUR, CLICK_RECT_MAX_FRAC, CLICK_RIPPLE_DUR, CLICK_SYNTH_RELEASE, 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, type CamBubbleRect, type CamPoseSpan, type CamStyle, type CaptureNormalization, type CardLayout, type ClickFxStyle, type CursorEvent, type CursorFadeKey, type CursorIdleOptions, type CursorStyle, type CursorTrack, DEFAULT_BACKDROP, 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, DESTINATIONS, DIGEST_CROP_MAX, DIGEST_FULL_MAX, DIGEST_VERSION, DOC_SCHEMA_VERSION, DRAG_FIT_LEVEL, type Destination, type Digest, type DigestImageRef, type DigestPlan, type DigestTakeFacts, type DuckOptions, EXPORT_RESOLUTION_OPTIONS, EXPORT_SHORT_EDGE, type EnvelopePoint, type ExportResolution, type ExtractClickOptions, FOLLOW_RECENTER, FOLLOW_SAFE_RATIO, FRAME_BORDER_COLOR_DEFAULT, FRAME_BORDER_DEFAULT, FRAME_BORDER_WIDTH_DEFAULT, type FocusBounds, type FollowEvent, type FollowOptions, type FrameGeometry, type FrameStyle, type LowerProgramOptions, type LoweredAudioClip, type LoweredClick, type LoweredComposition, type LoweredZoomSpan, MINIMAL_BAR_THEMES, MOTION_DELTA, MOTION_EASE, type MediaOverlayClip, type MicRms, type MinimalBarTheme, type Moment, type MomentKind, type MomentsOptions, type MotionKey, type MotionPose, type MotionPose3D, type MusicBedInput, 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 OverlayClip, type OverlayFontFace, type OverlayKind, type OverlayPresetStyle, type OverlayRect, type OverlayTransform, type OverlayTransition, PLAYBACK_ACTIVITY, PROGRAM_RETIME, type PlanOptions, type PlanTiltOptions, type PlaneSize, type ProgramAnchorDoc, type ProgramTweenEdit, type ProjectDoc, type PxRect, REJECT_OVERLAP, type RecordingArtifact, type RecordingMeta, type Rect, type RejectedLane, type RejectedSpan, type ResolvedOverlayBox, type ResolvedOverlayStyle, SCENE_MOTION, SCENE_QUIET, SPEED_RATE_MAX, SPEED_RATE_MIN, SPEED_SPAN_MIN, STUDIO_ENTRY_ID, STYLE_FIELDS, type SmoothOptions, type SmoothPoint, type SpeedParams, type SpeedSpan, type StepAnchor, type StepSpan, type StudioAudioPlan, type StudioDoc, type StudioEntry, type StyleField, TEXT3D_DEPTH_DEFAULT, TEXT3D_DEPTH_MAX, TEXT3D_DEPTH_MIN, 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_SPEED_MULT, 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 TranscriptSegment, type TransitionSpeed, 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 ZoomSpan, type ZoomStyleName, type ZoomStyleParams, type ZoomWindow, anchorKindOf, anchorSourceDuration, aspectRatioValue, audioLane, buildDigest, camBubbleRect, camBubbleRectAt, camLane, camMoveLane, camRectFromPose, camRestPose, camTrackFromDoc, cardPointToScreen, clampCamFrac, clampCamSize, clampFocus, clampSpeedRate, clampTiltDeg, clampZoomLevel, clipEnvelope, clipLength, computeCardLayout, computeMicRms, computePeaks, copyStyle, cropBox, cursorIdleFade, defaultBackdropMedia, deriveViewportCrop, destinationById, destinationsForChannel, docCardLayout, docOutputDuration, docToCropSpace, docToFullSpace, duckCurve, effectiveSegments, envelopeAt, envelopeValueAt, expectedFrameSize, exportSizeFor, extractClicks, focusBounds, followFocusEvents, frameGeometry, hexToRgbTriplet, idleGaps, isMusicBed, isPlayback, isProgramDoc, isRecordingDoc, isRejected, levelForFocusFraction, lowerProgramDoc, lowerStudioDoc, lowerToComposition, micLane, migrateHostedDoc, momentsFromDoc, motionTrack, musicBedClip, normalizeCaptureSpace, objectMotionBase, objectMotionPoseAt, objectsLane, outputDurationOf, outputRangeToSource, overlapFraction, overlayFaceFor, overlayFontFaces, overlayFontString, overlayHit, overlayLines, overlayMotionBase, overlayMotionPoseAt, overlayRect, overlaysLane, pageDisplayUrl, parsePoseId, pickStyle, planAutoSpeed, planAutoTilt, planAutoZoom, planForDigest, planeSizeAtDepth, platformBarKind, programDuration, projectFromArtifact, ratedSegments, recommendedExportResolution, refillAudioBeds, rejectSpan, removeSourceRange, removeSpeedInRange, resolveExportSize, resolveOverlayBox, resolveOverlayStyle, resolveText3dAsset, resolveZoomStyle, sceneChanges, scrollRuns, setSpeedInRange, smoothCursor, spanOutputExtent, speedLane, studioAudioPlan, studioEntry, studioLayerData, tiltLane, tiltTrackFromDoc, transitionMult, videoLane, voiceKey, withDefaultBackdrop, withoutRejected, wrapProgramLength, zoomCoversRect, zoomLane, zoomSpanForRange, zoomTrackFromDoc, zoomWindow };
|
package/dist/index.js
CHANGED
|
@@ -6777,6 +6777,39 @@ function duckCurve(rms, segments, durationSec2, opts = DEFAULT_DUCK) {
|
|
|
6777
6777
|
}
|
|
6778
6778
|
return points;
|
|
6779
6779
|
}
|
|
6780
|
+
|
|
6781
|
+
// src/rejected.ts
|
|
6782
|
+
var REJECT_OVERLAP = 0.5;
|
|
6783
|
+
function overlapFraction(a, b) {
|
|
6784
|
+
const shared = Math.min(a.out, b.out) - Math.max(a.in, b.in);
|
|
6785
|
+
if (shared <= 0) return 0;
|
|
6786
|
+
const shorter = Math.min(a.out - a.in, b.out - b.in);
|
|
6787
|
+
return shorter > 0 ? shared / shorter : 0;
|
|
6788
|
+
}
|
|
6789
|
+
function isRejected(lane, span, rejected) {
|
|
6790
|
+
if (!rejected?.length) return false;
|
|
6791
|
+
return rejected.some(
|
|
6792
|
+
(r) => r.lane === lane && overlapFraction(span, r) >= REJECT_OVERLAP
|
|
6793
|
+
);
|
|
6794
|
+
}
|
|
6795
|
+
function withoutRejected(lane, spans, rejected) {
|
|
6796
|
+
if (!rejected?.length) return spans;
|
|
6797
|
+
return spans.filter((s) => !isRejected(lane, s, rejected));
|
|
6798
|
+
}
|
|
6799
|
+
function rejectSpan(rejected, lane, span, note) {
|
|
6800
|
+
const taken = new Set((rejected ?? []).map((r) => r.id));
|
|
6801
|
+
let n = 0;
|
|
6802
|
+
while (taken.has(`r${n}`)) n++;
|
|
6803
|
+
const entry = {
|
|
6804
|
+
id: `r${n}`,
|
|
6805
|
+
lane,
|
|
6806
|
+
in: +span.in.toFixed(3),
|
|
6807
|
+
out: +span.out.toFixed(3)
|
|
6808
|
+
};
|
|
6809
|
+
if (span.anchor) entry.anchor = { ...span.anchor };
|
|
6810
|
+
if (note) entry.note = note;
|
|
6811
|
+
return entry;
|
|
6812
|
+
}
|
|
6780
6813
|
export {
|
|
6781
6814
|
ASPECT_RATIOS,
|
|
6782
6815
|
AUDIO_PLAN_STEP,
|
|
@@ -6855,6 +6888,7 @@ export {
|
|
|
6855
6888
|
OVERLAY_Z,
|
|
6856
6889
|
PLAYBACK_ACTIVITY,
|
|
6857
6890
|
PROGRAM_RETIME,
|
|
6891
|
+
REJECT_OVERLAP,
|
|
6858
6892
|
SCENE_MOTION,
|
|
6859
6893
|
SCENE_QUIET,
|
|
6860
6894
|
SPEED_RATE_MAX,
|
|
@@ -6944,6 +6978,7 @@ export {
|
|
|
6944
6978
|
isPlayback,
|
|
6945
6979
|
isProgramDoc,
|
|
6946
6980
|
isRecordingDoc,
|
|
6981
|
+
isRejected,
|
|
6947
6982
|
levelForFocusFraction,
|
|
6948
6983
|
lowerProgramDoc,
|
|
6949
6984
|
lowerStudioDoc,
|
|
@@ -6959,6 +6994,7 @@ export {
|
|
|
6959
6994
|
objectsLane,
|
|
6960
6995
|
outputDurationOf,
|
|
6961
6996
|
outputRangeToSource,
|
|
6997
|
+
overlapFraction,
|
|
6962
6998
|
overlayFaceFor,
|
|
6963
6999
|
overlayFontFaces,
|
|
6964
7000
|
overlayFontString,
|
|
@@ -6982,6 +7018,7 @@ export {
|
|
|
6982
7018
|
ratedSegments,
|
|
6983
7019
|
recommendedExportResolution,
|
|
6984
7020
|
refillAudioBeds,
|
|
7021
|
+
rejectSpan,
|
|
6985
7022
|
removeSourceRange,
|
|
6986
7023
|
removeSpeedInRange,
|
|
6987
7024
|
resolveExportSize,
|
|
@@ -7004,6 +7041,7 @@ export {
|
|
|
7004
7041
|
videoLane,
|
|
7005
7042
|
voiceKey,
|
|
7006
7043
|
withDefaultBackdrop,
|
|
7044
|
+
withoutRejected,
|
|
7007
7045
|
wrapProgramLength,
|
|
7008
7046
|
zoomCoversRect,
|
|
7009
7047
|
zoomLane,
|