Skip to content

Open source CapCut alternative.

TypeScript

docs(site): state tool text and comments plainly

David Le70f4e49b6d52
diff --git a/site/packages/effects-kit/src/effects.ts b/site/packages/effects-kit/src/effects.ts
index 679855e5..65915b7d 100644
--- a/site/packages/effects-kit/src/effects.ts
+++ b/site/packages/effects-kit/src/effects.ts
@@ -68,8 +68,8 @@ export interface EffectOverlay extends OverlayBase {
rate?: number;
/** How a strobe's pulses land; absent = strobe. */
rhythm?: FlashRhythm;
- /** A flash that ramps across the whole element instead of popping:
- * absent = the pop (or the strobe). */
+ /** A flash that ramps evenly across the whole element; absent = the pop
+ * (or the strobe). */
fade?: FlashFade;
}
@@ -89,7 +89,7 @@ export const FLASH_RATE_MAX = 15;
export const FLASH_RHYTHMS = ["strobe", "flicker"] as const;
export type FlashRhythm = (typeof FLASH_RHYTHMS)[number];
-/** A flash that ramps instead of popping, evenly across its element and up
+/** A flash that ramps evenly across its element and up
* to the full tone at amount 1: `to` fades the picture into the tone (a fade
* to black over the end of a scene), `from` starts on the tone and clears (a
* fade up from black). It covers everything on the rows behind its own, so
@@ -408,8 +408,8 @@ export interface BurnPalette {
const BURN_PALETTE: BurnPalette = { flare: BURN_FLARE, yellow: BURN_YELLOW, orange: BURN_ORANGE, edge: BURN_EDGE, flame: BURN_FLAME };
/** The char's dark stock: the body climbs hot orange, cools through ember to
- * char black, and a thin bright light line crosses it — film burning out on
- * black rather than flaring white. */
+ * char black, and a thin bright light line crosses it — film burning out
+ * into black. */
export const CHAR_PALETTE: BurnPalette = {
flare: [240, 118, 30],
yellow: [120, 38, 12],
@@ -556,7 +556,7 @@ const LB_ICE: [number, number, number] = [130, 206, 255];
* line flows outward from it. */
const LB_AXIS = 0.46;
/** Lines dim over the last `LB_NEAR` of their approach, so a line rushing
- * past sweeps through rather than blanking the frame. */
+ * past sweeps through and the frame stays readable. */
const LB_NEAR = 0.03;
/** Shares of the element the ribbon takes to appear, a late line to light
* and a line with an `off` to go out. */
diff --git a/site/packages/effects-kit/src/gradeSpec.ts b/site/packages/effects-kit/src/gradeSpec.ts
index aaca493b..96be0bd9 100644
--- a/site/packages/effects-kit/src/gradeSpec.ts
+++ b/site/packages/effects-kit/src/gradeSpec.ts
@@ -260,7 +260,7 @@ export const IDENTITY: Record<string, Signature> = {
},
},
western: {
- process: "sun-baked dust: strongly warm, and muted by the haze rather than punchy",
+ process: "sun-baked dust: strongly warm, and muted by the haze",
holds: (m, expect) => {
expect(m.warm.m).toBeGreaterThanOrEqual(12);
expect(m.sat).toBeLessThanOrEqual(1.0);
@@ -326,7 +326,7 @@ export const IDENTITY: Record<string, Signature> = {
},
},
tungsten: {
- process: "daylight stock under 3200K tungsten light: a source warming the whole scene, so the cast reaches the shadows rather than washing only the highlights",
+ process: "daylight stock under 3200K tungsten light: a source warming the whole scene, so the cast reaches down into the shadows",
holds: (m, expect) => {
expect(m.warm.m).toBeGreaterThanOrEqual(18);
expect(m.warm.s).toBeGreaterThanOrEqual(12);
@@ -362,7 +362,7 @@ export const IDENTITY: Record<string, Signature> = {
},
},
amber: {
- process: "an amber wash laid over the grade, weighted to the highlights the way a gel reads rather than a room light",
+ process: "an amber wash laid over the grade, weighted to the highlights the way a gel reads",
holds: (m, expect) => {
expect(m.warm.m).toBeGreaterThanOrEqual(20);
expect(m.warm.h - m.warm.s).toBeGreaterThanOrEqual(30);
@@ -390,7 +390,7 @@ export const IDENTITY: Record<string, Signature> = {
},
},
sepia: {
- process: "sepia toning: the print's silver is converted to silver sulfide, so the whole frame carries one brown tone rather than a tint over surviving color",
+ process: "sepia toning: the print's silver is converted to silver sulfide, so the whole frame carries one brown tone",
holds: (m, expect) => {
expect(m.spread).toBeLessThanOrEqual(0.08);
expect(m.warm.m).toBeGreaterThanOrEqual(28);
diff --git a/site/packages/effects-kit/src/leakFilm.test.ts b/site/packages/effects-kit/src/leakFilm.test.ts
index a062e740..76ebc73b 100644
--- a/site/packages/effects-kit/src/leakFilm.test.ts
+++ b/site/packages/effects-kit/src/leakFilm.test.ts
@@ -51,7 +51,7 @@ describe("the film flash", () => {
const [r, g, b] = rgbAt(d, Math.floor(h.area!.x * S), Math.floor(h.area!.y * S));
expect(Math.min(r, g, b)).toBeGreaterThan(200);
}
- // Between the holes and down the frame: warm, not white.
+ // Between the holes and down the frame: warm.
const [r, g, b] = rgbAt(d, S / 2, Math.floor(S * 0.6));
expect(r).toBeGreaterThan(110);
expect(r - b).toBeGreaterThan(60);
diff --git a/site/scripts/tune-grade-presets.ts b/site/scripts/tune-grade-presets.ts
index 612e1753..ea8ca001 100644
--- a/site/scripts/tune-grade-presets.ts
+++ b/site/scripts/tune-grade-presets.ts
@@ -48,7 +48,7 @@ const RANGE_CASES: [SourceProfile, OutputSpace][] = [
* fitted value back over: a few percent of the bound. */
const margin = (n: number) => Math.max(Math.abs(n) * 0.03, 0.01);
-/** An expect that records how far each bound is missed instead of throwing. */
+/** An expect that records how far each bound is missed and keeps going. */
function recorder(): { expect: Expect; total: () => number } {
let miss = 0;
const expect: Expect = (v) => ({
diff --git a/site/src/cut/components/AiPanel.tools.ts b/site/src/cut/components/AiPanel.tools.ts
index 4a6b5036..831e9544 100644
--- a/site/src/cut/components/AiPanel.tools.ts
+++ b/site/src/cut/components/AiPanel.tools.ts
@@ -108,7 +108,7 @@ export const AI_PANEL_TOOLS = [
{
name: "measure_level",
description:
- "Measure how loud clips actually play — the level of each clip's audible sound over its trimmed range, in dBFS, with its current volume applied — so volumes are set from numbers, never by ear. Returns per clip: sourceDb (the media), volume, levelDb (what plays), loudestFrameDb (the loudest 20 ms frame as RMS — a sample peak sits higher, so it is no clipping margin), loudestAt / loudestAtTimeline (when the loudest single sample plays, in source and timeline seconds, to the millisecond — put a click, hit or drop on a beat with these, never by probing silence thresholds) and samplePeakDb, and for every clip except the target, volumeToMatch: the volume that lands it at the target's level; a clip whose source has no audio track comes back with noAudio instead of levels. \"Make the voiceover as loud as the clip\", \"match the levels\", \"balance the music under the speech\": call this with every clip involved and target_id = the one to match, then set_clip_volume / update_audio with volumeToMatch (for a bed under speech, a fraction of it). A shortfallDb means the volume ceiling (3) cannot reach the target; lower the target instead. A clip marked muted plays nothing until set_clip_muted / update_audio unmutes it; its level is what it would play unmuted. Each clip also reports integratedLufs (BS.1770 loudness over its range) and truePeakDbtp, both as it plays with its volume applied; a volume change of g dB moves both by g (volume × 10^(g/20)), so \"music 10 LU under the voice\" is a volume that puts the music's integratedLufs 10 below the voice's. mix: true measures the whole mix as an unmastered export hears it: integratedLufs, truePeakDbtp, loudnessRangeLu and maxShortTermLufs — check it against the export's loudness targets or a platform's spec. null means silence.",
+ "Measure how loud clips actually play — the level of each clip's audible sound over its trimmed range, in dBFS, with its current volume applied — so volumes are set from numbers. Returns per clip: sourceDb (the media), volume, levelDb (what plays), loudestFrameDb (the loudest 20 ms frame as RMS — a sample peak sits higher; read clipping margin from samplePeakDb), loudestAt / loudestAtTimeline (when the loudest single sample plays, in source and timeline seconds, to the millisecond — put a click, hit or drop on a beat with these) and samplePeakDb, and for every clip except the target, volumeToMatch: the volume that lands it at the target's level; a clip whose source has no audio track comes back with noAudio and no levels. \"Make the voiceover as loud as the clip\", \"match the levels\", \"balance the music under the speech\": call this with every clip involved and target_id = the one to match, then set_clip_volume / update_audio with volumeToMatch (for a bed under speech, a fraction of it). A shortfallDb means the volume ceiling (3) cannot reach the target; lower the target instead. A clip marked muted plays nothing until set_clip_muted / update_audio unmutes it; its level is what it would play unmuted. Each clip also reports integratedLufs (BS.1770 loudness over its range) and truePeakDbtp, both as it plays with its volume applied; a volume change of g dB moves both by g (volume × 10^(g/20)), so \"music 10 LU under the voice\" is a volume that puts the music's integratedLufs 10 below the voice's. mix: true measures the whole mix as an unmastered export hears it: integratedLufs, truePeakDbtp, loudnessRangeLu and maxShortTermLufs — check it against the export's loudness targets or a platform's spec. null means silence.",
inputSchema: obj({
ids: { type: "array", items: { type: "string" }, description: "Clip ids to measure — video clips (their own sound) and soundtrack clips alike; optional with mix" },
target_id: str("The clip whose level the others should match (default: the first id)"),
@@ -194,7 +194,7 @@ export const AI_PANEL_TOOLS = [
type: "array",
items: { type: "string" },
maxItems: URL_BATCH_MAX,
- description: `Several direct media links at once (up to ${URL_BATCH_MAX}), instead of url — a section's stock footage, say. They download two at a time and come back as results in the order given, each with its assets or its own error, so one dead link never fails the rest. A call answers within about 90s: a link still downloading then comes back pending (it lands in the project on its own — don't import it again; it shows up in media) and links it never reached come back in notStarted — call again with exactly those. Pass this rather than calling import_url once per link`,
+ description: `Several direct media links at once (up to ${URL_BATCH_MAX}), in place of url — a section's stock footage, say. They download two at a time and come back as results in the order given, each with its assets or its own error, so one dead link never fails the rest. A call answers within about 90s: a link still downloading then comes back pending (it lands in the project on its own — don't import it again; it shows up in media) and links it never reached come back in notStarted — call again with exactly those. Pass every link in one call`,
},
audio_only: bool(
"Import only the source's audio track, extracted to an audio file (default false)"
diff --git a/site/src/cut/components/EffectsPanel.tools.ts b/site/src/cut/components/EffectsPanel.tools.ts
index 47c7ea14..9a3dc61b 100644
--- a/site/src/cut/components/EffectsPanel.tools.ts
+++ b/site/src/cut/components/EffectsPanel.tools.ts
@@ -43,7 +43,7 @@ export const EFFECT_SETTING_ARGS = {
fade: {
type: "string",
enum: [...FLASH_FADE_CHOICES],
- description: `flash only: ramp evenly across the whole element instead of popping, to the full tone at amount 1 — "to" fades the picture into the tone, "from" starts on it and clears, "${FLASH_FADE_NONE}" takes the fade off again. On the front row (lane 0, rows moved down with move_row if it is taken) it fades everything behind it as one, so a fade to black over the end of a stacked page (video, scrims, text, buttons, a pointer) goes black together instead of each layer fading on its own and showing the layers through each other`,
+ description: `flash only: ramp evenly across the whole element to the full tone at amount 1 — "to" fades the picture into the tone, "from" starts on it and clears, "${FLASH_FADE_NONE}" takes the fade off again. On the front row (lane 0, rows moved down with move_row if it is taken) it fades everything behind it as one, so a fade to black over the end of a stacked page (video, scrims, text, buttons, a pointer) goes black together as one picture`,
},
};
diff --git a/site/src/cut/components/ElementsPanel.tools.ts b/site/src/cut/components/ElementsPanel.tools.ts
index aa46b884..f6527bf4 100644
--- a/site/src/cut/components/ElementsPanel.tools.ts
+++ b/site/src/cut/components/ElementsPanel.tools.ts
@@ -58,10 +58,10 @@ export const ELEMENTS_TOOLS = [
{
name: "add_sticker",
description:
- "Add a sticker overlay from a project image asset (asset ids come from `media`; sticker uploads carry origin \"sticker\"), or draw one from SVG markup you write: pass svg instead of asset_id for a vector graphic no shape covers — a UI icon (download arrow, stacked episodes, speech-bubble subtitles, skip-next), a mouse pointer, a loading-spinner arc, a badge with lettering, a logo mark, line-art doodles around a title (sparkles, starbursts, fireworks, swirls, hearts drawn as thin white strokes). The markup is drawn to a transparent PNG (1024 px on its long side, keeping the viewBox's aspect), saved as an origin-\"sticker\" asset and placed; the result carries its assetId to place it again without redrawing. Width is a frame-width fraction; height follows the source's own aspect unless h sets it.",
+ "Add a sticker overlay from a project image asset (asset ids come from `media`; sticker uploads carry origin \"sticker\"), or draw one from SVG markup you write: pass svg in place of asset_id for a vector graphic no shape covers — a UI icon (download arrow, stacked episodes, speech-bubble subtitles, skip-next), a mouse pointer, a loading-spinner arc, a badge with lettering, a logo mark, line-art doodles around a title (sparkles, starbursts, fireworks, swirls, hearts drawn as thin white strokes). The markup is drawn to a transparent PNG (1024 px on its long side, keeping the viewBox's aspect), saved as an origin-\"sticker\" asset and placed; the result carries its assetId to place it again without redrawing. Width is a frame-width fraction; height follows the source's own aspect unless h sets it.",
inputSchema: obj({
asset_id: str("Project image asset id (or pass svg)"),
- svg: str(`SVG markup for a drawn sticker, instead of asset_id: one <svg viewBox=\"…\"> element with inline shapes, paths and text, no scripts or outside files, at most ${SVG_STICKER_MAX_CHARS} characters. Fill the viewBox with the graphic — empty margin becomes clear padding in the sticker`),
+ svg: str(`SVG markup for a drawn sticker, in place of asset_id: one <svg viewBox=\"…\"> element with inline shapes, paths and text, no scripts or outside files, at most ${SVG_STICKER_MAX_CHARS} characters. Fill the viewBox with the graphic — empty margin becomes clear padding in the sticker`),
name: str("Drawn sticker only: the asset's name in Media (default \"Drawn sticker\")"),
start: num("Start time s (default: playhead)"),
end: num("End time s (default: start+3)"),
diff --git a/site/src/cut/components/Timeline.tools.ts b/site/src/cut/components/Timeline.tools.ts
index cca4f1a3..2ed319dd 100644
--- a/site/src/cut/components/Timeline.tools.ts
+++ b/site/src/cut/components/Timeline.tools.ts
@@ -354,7 +354,7 @@ export const TIMELINE_TOOLS = [
asset_id: str("Project asset that plays there instead"),
keep_mask: {
type: "boolean",
- description: "Video clips: keep the clip's mask because it cuts the layer to a region of the frame (a screen, a window) rather than covering something in the old footage",
+ description: "Video clips: keep the clip's mask when it cuts the layer to a region of the frame, such as a screen or a window",
},
},
["id", "asset_id"]
diff --git a/site/src/cut/lib/aiTools.ts b/site/src/cut/lib/aiTools.ts
index 6017f94a..92a43719 100644
--- a/site/src/cut/lib/aiTools.ts
+++ b/site/src/cut/lib/aiTools.ts
@@ -1210,8 +1210,7 @@ const toolRuns: Record<BrowserToolName, ToolRun> = {
limit: isNum(input.limit) ? input.limit : undefined,
offset: isNum(input.offset) ? input.offset : undefined,
});
- // Matches the chat can't see still exist: it says so rather than calling
- // the file missing.
+ // Matches the chat can't see still exist, and the answer says so.
const held = findMedia(
s.assets.filter((a) => !isLinkedAssetType(a.type) && hiddenFromChat(a, chatId, placed)),
{ query, type }
@@ -6910,7 +6909,7 @@ function placeAssetOnTimeline(asset: MediaAsset, input: Record<string, unknown>)
const start = isNum(input.start) ? Math.max(0, input.start) : undefined;
if (asset.type === "audio") {
// With no lane, a sound placed at a moment lands at that moment on the
- // lowest lane free there, rather than sliding down lane 0 off its mark.
+ // lowest lane free there, on its mark.
const lane =
input.lane !== undefined
? audioLaneInput(input.lane)
diff --git a/site/src/cut/lib/colorOffscreen.test.ts b/site/src/cut/lib/colorOffscreen.test.ts
index 8697cfe0..38d717e2 100644
--- a/site/src/cut/lib/colorOffscreen.test.ts
+++ b/site/src/cut/lib/colorOffscreen.test.ts
@@ -49,7 +49,7 @@ test("read_color_stats decodes an off-screen clip's frame from its file, mid-tri
expect(decoded[0]).toMatchObject({ url: "blob:one", time: 4 });
});
-test("match_color_grade grades an off-screen clip instead of asking for a seek", async () => {
+test("match_color_grade grades an off-screen clip with no seek", async () => {
const [clip] = useEditor.getState().clips;
// The clip is its own reference: nothing to change, but no seek error.
const out = (await runAiTool("match_color_grade", { clipId: clip.id, ref_clip_id: clip.id })) as { id: string };
@@ -78,7 +78,7 @@ test("match_color_grade strength takes the match part of the way", async () => {
expect(Math.abs(exposure() - full / 2)).toBeLessThanOrEqual(1);
});
-test("strength 0 says it took none of the match, not that the footage already matches", async () => {
+test("strength 0 says it took none of the match", async () => {
const clip = useEditor.getState().clips[0];
const out = (await runAiTool("match_color_grade", { clipId: clip.id, ref_clip_id: clip.id, strength: 0 })) as { note?: string };
expect(out.note).toContain("strength 0");
diff --git a/site/src/cut/lib/measureLevelPeak.test.ts b/site/src/cut/lib/measureLevelPeak.test.ts
index 9f3e4b4e..68cdc34f 100644
--- a/site/src/cut/lib/measureLevelPeak.test.ts
+++ b/site/src/cut/lib/measureLevelPeak.test.ts
@@ -3,8 +3,7 @@ import { stubModule } from "@/lib/testing/stubModule";
import type { MediaAsset } from "./types";
// measure_level says where a clip's loudest sample lands, on its own source
-// clock and on the timeline, so a click can be put on a beat to the sample
-// rather than probed for with silence thresholds 20 ms at a time.
+// clock and on the timeline, so a click can be put on a beat to the sample.
await stubModule<typeof import("./media")>("./media", import.meta.url, {
measureSourceLevel: (async () => ({
rmsDb: -20,
diff --git a/site/src/cut/lib/mediaProxy.ts b/site/src/cut/lib/mediaProxy.ts
index df117fc5..ed1932f4 100644
--- a/site/src/cut/lib/mediaProxy.ts
+++ b/site/src/cut/lib/mediaProxy.ts
@@ -77,7 +77,7 @@ const PROXY_DECODE_CODEC = "hvc1.2.4.L123.B0";
/** Whether this browser decodes the proxy a heavy video would get. A heavy
* master plays here already, only slowly, so where HEVC does not decode it
- * stays on the master rather than trading it for a file that cannot play. */
+ * stays on the master, the file that plays. */
async function proxyDecodes(): Promise<boolean> {
const decoder = (globalThis as { VideoDecoder?: { isConfigSupported?: (c: VideoDecoderConfig) => Promise<{ supported?: boolean }> } }).VideoDecoder;
if (!decoder?.isConfigSupported) return false;
diff --git a/site/src/cut/lib/posterCache.ts b/site/src/cut/lib/posterCache.ts
index 32833ceb..27798467 100644
--- a/site/src/cut/lib/posterCache.ts
+++ b/site/src/cut/lib/posterCache.ts
@@ -185,7 +185,7 @@ export function capturePosterWhenReady(
}
/** Draw a stored poster over a canvas, contained and centred so a project whose
- * aspect has changed since is letterboxed rather than stretched. `wanted` is
+ * aspect has changed since is letterboxed. `wanted` is
* asked again once the image decodes: the stage may have drawn meanwhile. */
export function paintPoster(canvas: HTMLCanvasElement, data: string, wanted?: () => boolean): Promise<void> {
return new Promise((resolve) => {
diff --git a/site/src/cut/lib/proxyNames.ts b/site/src/cut/lib/proxyNames.ts
index c6bce1e0..33aeb004 100644
--- a/site/src/cut/lib/proxyNames.ts
+++ b/site/src/cut/lib/proxyNames.ts
@@ -1,6 +1,6 @@
/**
* The light proxy: a heavy video's preview copy, built to stream at a fast
- * cut's pace rather than to grade from. It is capped in bitrate as well as
+ * cut's pace. It is capped in bitrate as well as
* height — a quality target alone gave a dense 1080p master a proxy heavier
* than itself — and it carries its own name, so a project still holding an
* older full-quality proxy for such a video asks again and gets this one.
diff --git a/site/src/cut/lib/replaceClipMask.test.ts b/site/src/cut/lib/replaceClipMask.test.ts
index 58bc34f6..df19b9fa 100644
--- a/site/src/cut/lib/replaceClipMask.test.ts
+++ b/site/src/cut/lib/replaceClipMask.test.ts
@@ -3,8 +3,7 @@ import { runAiTool } from "./aiTools";
import { useEditor } from "./store";
import type { VideoClip } from "./types";
-// A pen mask cut to a laptop's screen is a region of the frame, not cover for
-// something in the old footage: swapping in a new screen recording dropped it,
+// A pen mask cut to a laptop's screen is a region of the frame: swapping in a new screen recording dropped it,
// and the chat had to draw the four corners back on.
const screen = { kind: "pen" as const, points: [{ x: -0.5, y: -0.18 }, { x: 0.5, y: -0.18 }, { x: 0.5, y: 0.17 }, { x: -0.48, y: 0.18 }], feather: 0 };
diff --git a/site/src/cut/server/cloud/jobs.ts b/site/src/cut/server/cloud/jobs.ts
index 87ee3eff..97a9de42 100644
--- a/site/src/cut/server/cloud/jobs.ts
+++ b/site/src/cut/server/cloud/jobs.ts
@@ -988,8 +988,7 @@ export const jobsCloud = {
return Response.json({ jobId: running.id });
}
// A master ffmpeg refused lately would be refused the same way: the
- // preview stays on the master instead of costing a worker run on every
- // open. A build that failed for a passing reason retries at once.
+ // preview stays on the master, and no open costs a worker run. A build that failed for a passing reason retries at once.
const { retryAfterHours } = await getGlobalSetting("cutProxy");
const failedRows = await prisma.cutRenderJob.findMany({
where: {