Package Exports
- @twick/workflow
- @twick/workflow/dist/index.js
- @twick/workflow/dist/index.mjs
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@twick/workflow) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@twick/workflow
Workflow builders and appliers that bridge normalized AI outputs with Twick timeline/project data.
Purpose
- Keep provider and model contracts in
@twick/ai-models - Keep schema, serialization, and core editor behavior in
@twick/timeline - Use
@twick/workflowas the integration layer that:- builds
ProjectJSONfrom normalized results - applies patches to project data
- applies patches through
TimelineEditor
- builds
Core API
import {
buildCaptionProject,
applyCaptionsToProject,
buildProjectFromTemplateSpec,
} from "@twick/workflow";
const project = buildCaptionProject({
videoUrl: "https://cdn.example.com/video.mp4",
durationSec: 12,
captions: [
{ t: "Hello world", s: 0, e: 1400 },
{ t: "This is Twick", s: 1500, e: 2900 },
],
});
const updated = applyCaptionsToProject(project, {
captions: [{ t: "New caption", s: 3000, e: 4200 }],
insertionStartSec: 3,
insertionEndSec: 5,
});
const templated = buildProjectFromTemplateSpec({
width: 720,
height: 1280,
tracks: [],
});Notes
- Legacy flows can continue to work through compatibility wrappers.
- New AI integrations should prefer
@twick/ai-models+@twick/workflow.