@cliptude/cli 0.1.42 → 0.1.44
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/README.md +2 -1
- package/cliptude_mcp/cli.py +30 -0
- package/cliptude_mcp/client.py +23 -1
- package/cliptude_mcp/server.py +80 -7
- package/cliptude_mcp/widgets/views.js +12 -3
- package/package.json +1 -1
- package/pyproject.toml +1 -1
package/README.md
CHANGED
|
@@ -58,6 +58,7 @@ cliptude script --template "Finance vector weekly" --title "Why index funds win"
|
|
|
58
58
|
cliptude voiceover --template "Finance vector weekly" --title "Why index funds win" --script-file script.txt
|
|
59
59
|
cliptude download-voiceover <job-id> --out narration.mp3
|
|
60
60
|
cliptude editor <job-id> # editor project id, revision, timeline item ids
|
|
61
|
+
cliptude edit <project-id> --ops '-' <<< '[{"op": "delete", "item_id": "anim-agent_g10"}, {"op": "retime", "item_id": "anim-agent_g11", "start_s": 109.3}]'
|
|
61
62
|
cliptude agent <project-id> --prompt "Replace this shot with real footage of a TSMC fab" --items clip-1 --tier smart --wait
|
|
62
63
|
cliptude render <project-id> --wait # new MP4 of the edited timeline
|
|
63
64
|
cliptude continue <job-id>
|
|
@@ -68,7 +69,7 @@ No template yet? `template-create` makes one without the create wizard: pick a `
|
|
|
68
69
|
|
|
69
70
|
To check the price first, `estimate` (MCP `estimate_credits`, REST `POST /api/v1/jobs/estimate`) takes the same template and prompt/script as `generate` (an upload as `--voiceover-seconds` / `--talking-head-seconds`) and returns the credits the job would need and whether the account has them. It creates and charges nothing.
|
|
70
71
|
|
|
71
|
-
To revise a finished video, `editor` opens its timeline (item ids, times, text), `agent` asks Cliptude Agent for
|
|
72
|
+
To revise a finished video, `editor` opens its timeline (item ids, times, text). `edit <project-id> --ops ops.json` applies exact edits on those ids, free and in one revision: delete, retime, trim, set opacity/volume, set a graphic's props, design or picture (an uploaded `keep` id or https link), mute a graphic's sound, add a graphic, clip or catalog sound effect, set a transition, restyle captions, set library music, its volume or remove it, set the background. `versions` and `restore` undo. `agent` asks Cliptude Agent for open-ended edits that need sourcing or generation (it charges agent credits; reference item ids with `--items`), and `render` exports a new MP4. MCP tools: `open_editor_project`, `get_editor_project`, `edit_timeline`, `list_editor_versions`, `restore_editor_version`, `run_agent`, `get_agent_run`, `cancel_agent_run`, `render_project`, `get_render`.
|
|
72
73
|
|
|
73
74
|
### Agent-planned videos
|
|
74
75
|
|
package/cliptude_mcp/cli.py
CHANGED
|
@@ -696,11 +696,27 @@ def main(argv: list[str] | None = None) -> None:
|
|
|
696
696
|
|
|
697
697
|
sub.add_parser("agent-tiers", help="List Cliptude Agent tiers")
|
|
698
698
|
|
|
699
|
+
ed = sub.add_parser("edit", help="Apply exact timeline edits (no model call, no credits)")
|
|
700
|
+
ed.add_argument("project_id")
|
|
701
|
+
ed.add_argument("--ops", required=True,
|
|
702
|
+
help="JSON file (or '-' for stdin) with a list of operations, e.g. [{\"op\": \"delete\", \"item_id\": \"...\"}]")
|
|
703
|
+
ed.add_argument("--expected-revision", type=int, default=None,
|
|
704
|
+
help="The revision the item ids were read from; a newer timeline is refused")
|
|
705
|
+
|
|
706
|
+
vs = sub.add_parser("versions", help="List saved versions of an editor project (undo points)")
|
|
707
|
+
vs.add_argument("project_id")
|
|
708
|
+
|
|
709
|
+
rv = sub.add_parser("restore", help="Restore an editor project to a saved version")
|
|
710
|
+
rv.add_argument("project_id")
|
|
711
|
+
rv.add_argument("version_id")
|
|
712
|
+
|
|
699
713
|
rn = sub.add_parser("render", help="Render an edited project to a new MP4")
|
|
700
714
|
rn.add_argument("project_id")
|
|
701
715
|
rn.add_argument("--wait", action="store_true", help="Poll until the render finishes")
|
|
702
716
|
rn.add_argument("--accept-quality-findings", action="store_true",
|
|
703
717
|
help="Agent-planned jobs: render although plan-review still lists plan quality findings")
|
|
718
|
+
rn.add_argument("--skip-frame-review", action="store_true",
|
|
719
|
+
help="Agent-planned jobs: render without having viewed every scene (only when the user says so)")
|
|
704
720
|
_add_review_args(rn)
|
|
705
721
|
|
|
706
722
|
rs = sub.add_parser("render-status", help="Get an editor render (output_url when done)")
|
|
@@ -974,9 +990,23 @@ def main(argv: list[str] | None = None) -> None:
|
|
|
974
990
|
_print(client.cancel_agent_run(args.project_id, args.run_id))
|
|
975
991
|
elif args.cmd == "agent-tiers":
|
|
976
992
|
_print(client.agent_tiers())
|
|
993
|
+
elif args.cmd == "edit":
|
|
994
|
+
raw = sys.stdin.read() if args.ops == "-" else Path(args.ops).read_text(encoding="utf-8")
|
|
995
|
+
try:
|
|
996
|
+
ops = json.loads(raw)
|
|
997
|
+
except ValueError as exc:
|
|
998
|
+
raise CliptudeApiError(f"--ops is not JSON: {exc}")
|
|
999
|
+
if isinstance(ops, dict):
|
|
1000
|
+
ops = ops.get("operations") or []
|
|
1001
|
+
_print(client.edit_timeline(args.project_id, ops, expected_revision=args.expected_revision))
|
|
1002
|
+
elif args.cmd == "versions":
|
|
1003
|
+
_print(client.list_editor_versions(args.project_id))
|
|
1004
|
+
elif args.cmd == "restore":
|
|
1005
|
+
_print(client.restore_editor_version(args.project_id, args.version_id))
|
|
977
1006
|
elif args.cmd == "render":
|
|
978
1007
|
payload = _spend_reviewed(args, lambda token: client.render_project(
|
|
979
1008
|
args.project_id, accept_quality_findings=args.accept_quality_findings, review_token=token,
|
|
1009
|
+
skip_frame_review=args.skip_frame_review,
|
|
980
1010
|
), "Render this MP4?")
|
|
981
1011
|
if args.wait:
|
|
982
1012
|
render_id = (payload.get("render") or {}).get("id")
|
package/cliptude_mcp/client.py
CHANGED
|
@@ -1205,13 +1205,35 @@ class CliptudeClient:
|
|
|
1205
1205
|
def cancel_agent_run(self, project_id: int | str, run_id: str) -> Any:
|
|
1206
1206
|
return self.request("POST", f"/api/v1/editor-projects/{_int_seg(project_id)}/agent/runs/{_uuid_seg(run_id, 'run_id')}/cancel")
|
|
1207
1207
|
|
|
1208
|
+
def edit_timeline(
|
|
1209
|
+
self, project_id: int | str, operations: list[dict[str, Any]], *, expected_revision: int | None = None,
|
|
1210
|
+
) -> Any:
|
|
1211
|
+
"""Apply exact timeline operations in one revision: no model call, no credits."""
|
|
1212
|
+
body: dict[str, Any] = {"operations": operations}
|
|
1213
|
+
if expected_revision is not None:
|
|
1214
|
+
body["expected_revision"] = int(expected_revision)
|
|
1215
|
+
return self.request("POST", f"/api/v1/editor-projects/{_int_seg(project_id)}/edits", json_body=body)
|
|
1216
|
+
|
|
1217
|
+
def list_editor_versions(self, project_id: int | str) -> Any:
|
|
1218
|
+
return self.request("GET", f"/api/v1/editor-projects/{_int_seg(project_id)}/versions")
|
|
1219
|
+
|
|
1220
|
+
def restore_editor_version(self, project_id: int | str, version_id: int | str) -> Any:
|
|
1221
|
+
return self.request(
|
|
1222
|
+
"POST",
|
|
1223
|
+
f"/api/v1/editor-projects/{_int_seg(project_id)}/versions/{_int_seg(version_id, 'version_id')}/restore",
|
|
1224
|
+
)
|
|
1225
|
+
|
|
1208
1226
|
def render_project(
|
|
1209
1227
|
self, project_id: int | str, *, accept_quality_findings: bool = False, review_token: str | None = None,
|
|
1228
|
+
skip_frame_review: bool = False,
|
|
1210
1229
|
) -> Any:
|
|
1211
1230
|
"""Render the edited timeline to a new MP4: free the first time, then 10% of the original generation.
|
|
1212
1231
|
|
|
1213
|
-
A paid export first answers with the review (HTTP 428): resend with review_token.
|
|
1232
|
+
A paid export first answers with the review (HTTP 428): resend with review_token. An agent-planned job
|
|
1233
|
+
answers 409 frames_not_viewed until view_scenes covered the timeline (skip_frame_review overrides)."""
|
|
1214
1234
|
body: dict[str, Any] = {"accept_quality_findings": True} if accept_quality_findings else {}
|
|
1235
|
+
if skip_frame_review:
|
|
1236
|
+
body["skip_frame_review"] = True
|
|
1215
1237
|
body.update(_review_job_fields(review_token, None, None))
|
|
1216
1238
|
return self.request("POST", f"/api/v1/editor-projects/{_int_seg(project_id)}/render", json_body=body or None)
|
|
1217
1239
|
|
package/cliptude_mcp/server.py
CHANGED
|
@@ -238,8 +238,11 @@ def build_server(*, with_http_auth: bool = False):
|
|
|
238
238
|
"Generate Cliptude videos from a saved template. "
|
|
239
239
|
"Call list_templates, then create_job with template_id + title plus "
|
|
240
240
|
"(no suitable template? get_template_options + list_voices, then create_template) "
|
|
241
|
-
"To revise a finished video: open_editor_project,
|
|
242
|
-
"
|
|
241
|
+
"To revise a finished video: open_editor_project, then edit_timeline for exact changes on its item ids "
|
|
242
|
+
"(delete, retime, trim, swap a graphic's design or picture, fix its words, add a graphic, clip or catalog sound, "
|
|
243
|
+
"transitions, caption style, library music, background; free, "
|
|
244
|
+
"undo with restore_editor_version) or run_agent for changes that need sourcing or generation (poll "
|
|
245
|
+
"get_agent_run), view_scenes the changed seconds, then render_project and get_render. "
|
|
243
246
|
"prompt, script, voiceover_path (uploaded audio of at least 6 minutes, transcribed; skips TTS), "
|
|
244
247
|
"or talking_head_path (presenter video of at least 6 minutes on a Talking Head template). "
|
|
245
248
|
"create_job returns immediately; poll get_job until completed or failed. "
|
|
@@ -296,7 +299,7 @@ def build_server(*, with_http_auth: bool = False):
|
|
|
296
299
|
"create_plan_job with script (prompt only when the user asks Cliptude to write it), poll get_job until "
|
|
297
300
|
"plan_ready, get_narration (numbered sentences), get_kind_catalog (compact first), write the "
|
|
298
301
|
"plan, check_plan until valid, lock_plan, continue_job, then get_plan_report. ONE REVIEW: when the first "
|
|
299
|
-
"build is ready, open_editor_project and look at EVERY frame with view_scenes (0 to the end) once: replace "
|
|
302
|
+
"build is ready, open_editor_project and look at EVERY frame with view_scenes (0 to the end) once, even when get_plan_review lists no findings (render_project refuses until you have): replace "
|
|
300
303
|
"any dead body or gore, other brands, logos, album art, footage of a game, match or show the video is not about, title cards, pictures whose place or era "
|
|
301
304
|
"contradicts the story (a search naming a place can return a namesake elsewhere), near-black frames, clips floating in black bars, broken AI pictures and any picture held over ~8 s, all in ONE free revision whose fixes carry the replacement itself (footage, pictures or photos you downloaded and uploaded with upload_plan_media, used as keep; corrected board text). A job takes one revision (a second answers 409 review_used): Cliptude renders the revised build itself; poll get_job until render.status is completed and call show_publish_kit. Never review the rebuild or ask the user to. Generic "
|
|
302
305
|
"shots of places name the story's setting (\"empty bed mud house\", not \"empty bed dark room\"). A video "
|
|
@@ -1195,7 +1198,7 @@ def build_server(*, with_http_auth: bool = False):
|
|
|
1195
1198
|
def get_plan_review(
|
|
1196
1199
|
job_id: Annotated[str, Field(min_length=8, description="Plan job UUID (status ready_for_edit)")],
|
|
1197
1200
|
) -> dict[str, Any]:
|
|
1198
|
-
"""What the built design shows, before any render: every picture/clip in order (beat, time, the sentence under it, what you asked for, what was used, a link to the file, and picked.why: why that file won, with a count of the other candidates get_plan_candidates lists for the beat) and every graphic (time on screen and the props it will be drawn with, or why it is missing), plus quality_findings: Cliptude's quality checks on the build. Fix every finding with fix_in "plan" (follow its how); fix_in "cliptude" ones are not yours. This is the job's one review: fix everything in one revision (check_plan/lock_plan + continue_job on the same job), choosing each replacement from get_plan_candidates or uploading your own, as keep; Cliptude renders the revised build itself and a second revision is refused (409 review_used). Poll get_job until render.status is completed, then show_publish_kit. If nothing needs fixing, render_project once (it refuses while plan findings remain unless accept_quality_findings is true), then show_publish_kit."""
|
|
1201
|
+
"""What the built design shows, before any render: every picture/clip in order (beat, time, the sentence under it, what you asked for, what was used, a link to the file, and picked.why: why that file won, with a count of the other candidates get_plan_candidates lists for the beat) and every graphic (time on screen and the props it will be drawn with, or why it is missing), plus quality_findings: Cliptude's quality checks on the build. Fix every finding with fix_in "plan" (follow its how); fix_in "cliptude" ones are not yours. This is the job's one review: fix everything in one revision (check_plan/lock_plan + continue_job on the same job), choosing each replacement from get_plan_candidates or uploading your own, as keep; Cliptude renders the revised build itself and a second revision is refused (409 review_used). Poll get_job until render.status is completed, then show_publish_kit. An empty quality_findings list is not a review: it only means Cliptude's own checks passed. Look at the video yourself with view_scenes (0 to the end) before deciding nothing needs fixing; render_project refuses an agent-planned job until you have (409 frames_not_viewed). If nothing needs fixing, render_project once (it also refuses while plan findings remain unless accept_quality_findings is true), then show_publish_kit."""
|
|
1199
1202
|
try:
|
|
1200
1203
|
return _untrusted(_client().get_plan_review(job_id))
|
|
1201
1204
|
except Exception as exc:
|
|
@@ -1447,6 +1450,72 @@ def build_server(*, with_http_auth: bool = False):
|
|
|
1447
1450
|
out.append(Image(data=base64.b64decode(sheet["jpeg_base64"]), format="jpeg"))
|
|
1448
1451
|
return out
|
|
1449
1452
|
|
|
1453
|
+
@mcp.tool(
|
|
1454
|
+
title="Edit timeline",
|
|
1455
|
+
annotations=ToolAnnotations(title="Edit timeline", read_only_hint=False, destructive_hint=True,
|
|
1456
|
+
idempotent_hint=False, open_world_hint=False),
|
|
1457
|
+
)
|
|
1458
|
+
def edit_timeline(
|
|
1459
|
+
project_id: Annotated[int, Field(description="Editor project id")],
|
|
1460
|
+
operations: Annotated[
|
|
1461
|
+
list[dict[str, Any]],
|
|
1462
|
+
Field(description=(
|
|
1463
|
+
"Operations applied in order, in one revision (up to 60). Each is an object with op and its fields: "
|
|
1464
|
+
"{op:'delete', item_id}; {op:'retime', item_id, start_s?, end_s?}; {op:'trim', item_id, from_s, to_s?} "
|
|
1465
|
+
"(clips and audio: which part of the source plays); {op:'set', item_id, opacity?, volume?, playbackRate?} "
|
|
1466
|
+
"(opacity and volume 0-100); {op:'set_props', item_id, props:{...}} (a graphic's fields, as in its "
|
|
1467
|
+
"catalog prop_schema); {op:'set_type', item_id, animation_type, props?} (another design, same timing); "
|
|
1468
|
+
"{op:'set_picture', item_id, keep|url} (a graphic's picture slot, or a clip's or image's file); "
|
|
1469
|
+
"{op:'mute_cues', item_id} (silence a graphic's own sound cues); {op:'add_graphic', animation_type, "
|
|
1470
|
+
"start_s, end_s, props, keep?|url?}; {op:'add_clip', keep|url, start_s, end_s, from_s?} (footage layer); "
|
|
1471
|
+
"{op:'set_transition', from_id, to_id, kind, direction?, duration_s?} (the join between two clips; "
|
|
1472
|
+
"kind 'none' removes it); {op:'set_caption_style', style:{color, activeColor, appearedColor, fontSize, "
|
|
1473
|
+
"...}, item_ids?} (every caption when item_ids is omitted; wording follows the narration); "
|
|
1474
|
+
"{op:'set_music', library_file?|keep?|url?, volume?, remove?} (library_file from get_template_options); "
|
|
1475
|
+
"{op:'set_background', keep|url}; {op:'add_sfx', sound, start_s, volume?} (sound id from "
|
|
1476
|
+
"get_kind_catalog sounds). set_props on a text item sets text, color, fontSize, fontWeight, textAlign. "
|
|
1477
|
+
"keep is a keep id from upload_plan_media / start_media_upload or from get_plan_review; url a public "
|
|
1478
|
+
"https link."
|
|
1479
|
+
)),
|
|
1480
|
+
],
|
|
1481
|
+
expected_revision: Annotated[
|
|
1482
|
+
int | None, Field(description="The revision you read the item ids from; a newer timeline answers 409")
|
|
1483
|
+
] = None,
|
|
1484
|
+
) -> dict[str, Any]:
|
|
1485
|
+
"""Change the timeline exactly as asked, on the item ids from open_editor_project or view_scenes: no model call and no credits. Use it whenever you know what to change (delete a board, move or shorten an item, swap a board for another design, fix a board's words or numbers, give a board or clip one of your uploaded files, add a board or a clip, mute a board's sound, change a transition, restyle captions, pick or remove library music or set its volume, set the background, place a sound effect from the catalog). Use run_agent only for open-ended requests that need sourcing or generation (find or generate a picture or clip, regenerate a voiceover range, generate or search new music or sound effects). Delete a full-frame board instead of setting its opacity to 0: a hidden board still covers the picture with black (refused). The narration cannot be deleted. Every call saves a version first: list_editor_versions and restore_editor_version undo it. The answer lists changed_ranges_s: view_scenes only those seconds (the rest keeps its frame review, and boards whose frame did not change keep their drawing), then render_project."""
|
|
1486
|
+
try:
|
|
1487
|
+
return _client().edit_timeline(project_id, operations, expected_revision=expected_revision)
|
|
1488
|
+
except Exception as exc:
|
|
1489
|
+
return _err(exc)
|
|
1490
|
+
|
|
1491
|
+
@mcp.tool(
|
|
1492
|
+
title="List editor versions",
|
|
1493
|
+
annotations=ToolAnnotations(title="List editor versions", read_only_hint=True, open_world_hint=False),
|
|
1494
|
+
)
|
|
1495
|
+
def list_editor_versions(
|
|
1496
|
+
project_id: Annotated[int, Field(description="Editor project id")],
|
|
1497
|
+
) -> dict[str, Any]:
|
|
1498
|
+
"""Saved versions of an editor project, newest first (id, revision, label, time): every editor save, edit_timeline call and agent edit makes one. Pass a version's id to restore_editor_version to undo back to it."""
|
|
1499
|
+
try:
|
|
1500
|
+
return _client().list_editor_versions(project_id)
|
|
1501
|
+
except Exception as exc:
|
|
1502
|
+
return _err(exc)
|
|
1503
|
+
|
|
1504
|
+
@mcp.tool(
|
|
1505
|
+
title="Restore editor version",
|
|
1506
|
+
annotations=ToolAnnotations(title="Restore editor version", read_only_hint=False, destructive_hint=True,
|
|
1507
|
+
idempotent_hint=False, open_world_hint=False),
|
|
1508
|
+
)
|
|
1509
|
+
def restore_editor_version(
|
|
1510
|
+
project_id: Annotated[int, Field(description="Editor project id")],
|
|
1511
|
+
version_id: Annotated[int, Field(description="Version id from list_editor_versions")],
|
|
1512
|
+
) -> dict[str, Any]:
|
|
1513
|
+
"""Put the timeline back to a saved version (an undo). The restore is itself saved as a version, so it can be undone too. Free; view_scenes the video again before render_project."""
|
|
1514
|
+
try:
|
|
1515
|
+
return _client().restore_editor_version(project_id, version_id)
|
|
1516
|
+
except Exception as exc:
|
|
1517
|
+
return _err(exc)
|
|
1518
|
+
|
|
1450
1519
|
@mcp.tool(
|
|
1451
1520
|
title="Run Cliptude Agent",
|
|
1452
1521
|
annotations=ToolAnnotations(title="Run Cliptude Agent", read_only_hint=False, destructive_hint=True,
|
|
@@ -1465,7 +1534,7 @@ def build_server(*, with_http_auth: bool = False):
|
|
|
1465
1534
|
Field(description=SPEND_REVIEW_TOKEN_HELP),
|
|
1466
1535
|
] = None,
|
|
1467
1536
|
) -> dict[str, Any]:
|
|
1468
|
-
"""Ask Cliptude Agent to edit the timeline (swap footage, regenerate images or voiceover ranges, music, transitions, text
|
|
1537
|
+
"""Ask Cliptude Agent to edit the timeline from a plain-English request (prefer edit_timeline when you know the exact change: it is exact and free). It can swap footage, regenerate images or voiceover ranges, music, transitions, text, delete clips or graphics. One kind of change per run: picture swaps, text edits and deletions go in separate runs. To delete a graphic, overlay, clip or sound effect, reference its item id and say "delete": the item is removed, with its own sound cues and any transition into it, and the footage under it shows. Never ask for opacity 0 to remove a full-frame board: a hidden board still covers the picture with black. The narration track cannot be deleted. Several clips can get new pictures in one run: reference them all and describe each one's picture by its item id; a clip with nothing suitable is left unchanged and named in the reply. Swapping a graphic's picture keeps the graphic and its words. To use one exact picture (a product cover, a screenshot), paste its https link in the prompt: it is downloaded and applied as is, not searched for. Charges agent credits, so the first call returns a review (status 428, detail.review: the request and what runs usually cost) and starts nothing: show it to the user, wait for their explicit OK, then call again with the same arguments and review_token. Returns a run; poll get_agent_run. Then render_project for a new MP4, after view_scenes on the changed range."""
|
|
1469
1538
|
try:
|
|
1470
1539
|
return _compact_agent_run(_client().run_agent(
|
|
1471
1540
|
project_id, prompt=prompt, tier=tier, referenced_item_ids=referenced_item_ids, chat_id=chat_id,
|
|
@@ -1518,11 +1587,15 @@ def build_server(*, with_http_auth: bool = False):
|
|
|
1518
1587
|
str | None,
|
|
1519
1588
|
Field(description=SPEND_REVIEW_TOKEN_HELP),
|
|
1520
1589
|
] = None,
|
|
1590
|
+
skip_frame_review: Annotated[
|
|
1591
|
+
bool,
|
|
1592
|
+
Field(description="Agent-planned jobs only: render although view_scenes has not covered the whole video. Set it only when the user says to ship without looking."),
|
|
1593
|
+
] = False,
|
|
1521
1594
|
) -> dict[str, Any]:
|
|
1522
|
-
"""Render the edited timeline to a new MP4. The first export of a project is free; later exports cost 10% of the original generation (export_credits_due on the project says the exact amount). A paid export first returns a review (status 428, detail.review with the credits) and renders nothing: show it to the user, wait for their explicit OK, then call again with the same arguments and review_token. Poll get_render for output_url. On an agent-planned job, a first build with quality_findings the plan can fix returns 409 quality_findings_open: fix them in the job's one revision (Cliptude then renders that build itself, so this call is not needed)."""
|
|
1595
|
+
"""Render the edited timeline to a new MP4. The first export of a project is free; later exports cost 10% of the original generation (export_credits_due on the project says the exact amount). A paid export first returns a review (status 428, detail.review with the credits) and renders nothing: show it to the user, wait for their explicit OK, then call again with the same arguments and review_token. Poll get_render for output_url. On an agent-planned job, a first build with quality_findings the plan can fix returns 409 quality_findings_open: fix them in the job's one revision (Cliptude then renders that build itself, so this call is not needed). An agent-planned job also answers 409 frames_not_viewed until you have looked at the whole video with view_scenes (0 to the end, following next_start_s): a clean get_plan_review is not a review, only Cliptude's own checks passing."""
|
|
1523
1596
|
try:
|
|
1524
1597
|
return _client().render_project(project_id, accept_quality_findings=accept_quality_findings,
|
|
1525
|
-
review_token=review_token)
|
|
1598
|
+
review_token=review_token, skip_frame_review=skip_frame_review)
|
|
1526
1599
|
except Exception as exc:
|
|
1527
1600
|
return _err(exc)
|
|
1528
1601
|
|
|
@@ -521,11 +521,19 @@ var Views = (function () {
|
|
|
521
521
|
var id = String(job.id || job.job_id || "");
|
|
522
522
|
var stage = job.stage || job.status || "";
|
|
523
523
|
var label = STATUS_LABELS[stage] || String(stage).replace(/_/g, " ");
|
|
524
|
-
|
|
524
|
+
// get_job sends progress as a fraction (0.5 while sourcing); it was drawn as 0.5% and read "1%".
|
|
525
|
+
var raw = Number(job.progress || 0);
|
|
526
|
+
var pct = Math.max(0, Math.min(100, raw <= 1 ? raw * 100 : raw));
|
|
527
|
+
// The job's own progress moves by stage (sourcing sits at one value for most of the build), so a step that
|
|
528
|
+
// counts its work ("Sourcing B-roll assets... (88/105, reused 0)") drives the bar while it runs.
|
|
529
|
+
var stepMatch = /\((\d+)\s*\/\s*(\d+)/.exec(String(job.current_step || ""));
|
|
530
|
+
var stepPct = null;
|
|
531
|
+
if (stepMatch && Number(stepMatch[2]) > 0) stepPct = Math.max(0, Math.min(100, 100 * Number(stepMatch[1]) / Number(stepMatch[2])));
|
|
525
532
|
var failed = stage === "failed" || job.status === "failed";
|
|
526
533
|
var ready = isReady(job);
|
|
527
534
|
var done = ready || failed || job.status === "completed" || stage === "plan_ready" || stage === "script_ready";
|
|
528
535
|
if (ready) pct = 100;
|
|
536
|
+
var barPct = (!ready && stepPct !== null) ? stepPct : pct;
|
|
529
537
|
|
|
530
538
|
UI.clear(container);
|
|
531
539
|
container.appendChild(h("div", { class: "head" }, [
|
|
@@ -534,11 +542,12 @@ var Views = (function () {
|
|
|
534
542
|
]));
|
|
535
543
|
if (!failed) {
|
|
536
544
|
container.appendChild(h("div", { class: "bar", role: "progressbar", "aria-valuemin": "0", "aria-valuemax": "100",
|
|
537
|
-
"aria-valuenow": String(Math.round(
|
|
545
|
+
"aria-valuenow": String(Math.round(barPct)), "aria-label": stepPct !== null && !ready ? "Progress of this step" : "Progress" },
|
|
546
|
+
[h("span", { style: { width: barPct + "%" } })]));
|
|
538
547
|
}
|
|
539
548
|
var facts = [];
|
|
540
549
|
if (!done && job.current_step) facts.push(h("span", {}, [String(job.current_step)]));
|
|
541
|
-
if (!done) facts.push(h("span", { class: "muted" }, [Math.round(pct) + "%"]));
|
|
550
|
+
if (!done) facts.push(h("span", { class: "muted" }, [stepPct !== null ? Math.round(stepPct) + "% of this step" : Math.round(pct) + "%"]));
|
|
542
551
|
if (job.estimated_minutes && !done) facts.push(h("span", { class: "muted" }, ["≈ " + job.estimated_minutes + " min"]));
|
|
543
552
|
if (job.duration) facts.push(h("span", { class: "muted" }, [job.duration + " min video"]));
|
|
544
553
|
if (id) facts.push(h("span", { class: "muted" }, ["Job " + id.slice(0, 8)]));
|
package/package.json
CHANGED
package/pyproject.toml
CHANGED