@cliptude/cli 0.1.43 → 0.1.46
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 +6 -1
- package/cliptude_mcp/apps.py +5 -0
- package/cliptude_mcp/cli.py +27 -0
- package/cliptude_mcp/client.py +61 -5
- package/cliptude_mcp/server.py +157 -6
- package/cliptude_mcp/widgets/views.js +23 -0
- 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,11 @@ 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`.
|
|
73
|
+
|
|
74
|
+
To answer a copyright claim or credit Creative Commons footage, MCP `get_video_sources` lists where every visual in a finished video came from (times on screen, provider, author, license, link) plus the description credits, and `find_media_source` finds every video that used a link, YouTube channel or author.
|
|
75
|
+
|
|
76
|
+
Brand kits and media: `list_brand_kits` lists the user's brand kits (one per channel: logo, colours, fonts; one is the default); `create_template` and `update_template` take `brand_kit_id` and `show_logo` (the logo is off by default). `list_media` lists the user's own images, clips and audio (their media library, shared with the editor's uploads), with a `url` to use in a plan or `edit_timeline`.
|
|
72
77
|
|
|
73
78
|
### Agent-planned videos
|
|
74
79
|
|
package/cliptude_mcp/apps.py
CHANGED
|
@@ -444,4 +444,9 @@ def publish_kit_payload(data: Any, job_id: str) -> dict[str, Any]:
|
|
|
444
444
|
"tags": meta.get("tags") or [],
|
|
445
445
|
"downloads": meta.get("downloads") or {},
|
|
446
446
|
},
|
|
447
|
+
"sources": {
|
|
448
|
+
"items": meta.get("sources") or [],
|
|
449
|
+
"complete": meta.get("sources_complete", True),
|
|
450
|
+
"credits_text": meta.get("credits_text") or "",
|
|
451
|
+
},
|
|
447
452
|
}
|
package/cliptude_mcp/cli.py
CHANGED
|
@@ -696,6 +696,20 @@ 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")
|
|
@@ -976,6 +990,19 @@ def main(argv: list[str] | None = None) -> None:
|
|
|
976
990
|
_print(client.cancel_agent_run(args.project_id, args.run_id))
|
|
977
991
|
elif args.cmd == "agent-tiers":
|
|
978
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))
|
|
979
1006
|
elif args.cmd == "render":
|
|
980
1007
|
payload = _spend_reviewed(args, lambda token: client.render_project(
|
|
981
1008
|
args.project_id, accept_quality_findings=args.accept_quality_findings, review_token=token,
|
package/cliptude_mcp/client.py
CHANGED
|
@@ -475,11 +475,41 @@ class CliptudeClient:
|
|
|
475
475
|
def get_template(self, template_id: str) -> Any:
|
|
476
476
|
return self.request("GET", f"/api/v1/templates/{_uuid_seg(template_id, 'template_id')}")
|
|
477
477
|
|
|
478
|
-
def create_template(self, *, name: str, format: str, settings: dict[str, Any]
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
478
|
+
def create_template(self, *, name: str, format: str, settings: dict[str, Any],
|
|
479
|
+
brand_kit_id: int | None = None, show_logo: bool | None = None) -> Any:
|
|
480
|
+
"""Create a ready-to-use template from settings (no create wizard); optional brand kit and logo."""
|
|
481
|
+
body: dict[str, Any] = {"name": name, "format": format, "settings": settings}
|
|
482
|
+
if brand_kit_id is not None:
|
|
483
|
+
body["brand_kit_id"] = brand_kit_id or None
|
|
484
|
+
if show_logo is not None:
|
|
485
|
+
body["show_logo"] = bool(show_logo)
|
|
486
|
+
return self.request("POST", "/api/v1/templates", json_body=body)
|
|
487
|
+
|
|
488
|
+
def update_template(self, template_id: str, *, name: str | None = None, brand_kit_id: int | None = None,
|
|
489
|
+
show_logo: bool | None = None) -> Any:
|
|
490
|
+
"""Rename a template, set its brand kit (0 = the user's default kit) or turn its logo on or off."""
|
|
491
|
+
body: dict[str, Any] = {}
|
|
492
|
+
if name is not None:
|
|
493
|
+
body["name"] = name
|
|
494
|
+
if brand_kit_id is not None:
|
|
495
|
+
body["brand_kit_id"] = brand_kit_id or None
|
|
496
|
+
if show_logo is not None:
|
|
497
|
+
body["show_logo"] = bool(show_logo)
|
|
498
|
+
return self.request("PATCH", f"/api/v1/templates/{_uuid_seg(template_id, 'template_id')}", json_body=body)
|
|
499
|
+
|
|
500
|
+
def list_brand_kits(self) -> Any:
|
|
501
|
+
"""The user's brand kits (one per channel): logo, colours, fonts; one is the default."""
|
|
502
|
+
return self.request("GET", "/api/v1/brand-kits")
|
|
503
|
+
|
|
504
|
+
def list_media(self, *, folder: str | None = None, kind: str | None = None, limit: int = 50,
|
|
505
|
+
offset: int = 0) -> Any:
|
|
506
|
+
"""The user's media library (images, clips, audio; shared with the editor's uploads)."""
|
|
507
|
+
params: dict[str, Any] = {"limit": limit, "offset": offset}
|
|
508
|
+
if folder is not None:
|
|
509
|
+
params["folder"] = folder
|
|
510
|
+
if kind:
|
|
511
|
+
params["kind"] = kind
|
|
512
|
+
return self.request("GET", "/api/v1/media", params=params)
|
|
483
513
|
|
|
484
514
|
def template_options(self, format: str) -> Any:
|
|
485
515
|
return self.request("GET", "/api/v1/templates/options", params={"format": format})
|
|
@@ -1075,6 +1105,14 @@ class CliptudeClient:
|
|
|
1075
1105
|
"""What sourcing used for each media request of the locked plan, and every fallback."""
|
|
1076
1106
|
return self.request("GET", f"/api/v1/jobs/{_uuid_seg(job_id)}/plan/report")
|
|
1077
1107
|
|
|
1108
|
+
def get_job_sources(self, job_id: str) -> Any:
|
|
1109
|
+
"""Where every visual in the video came from (time, source, author, license, link) and the description credits."""
|
|
1110
|
+
return self.request("GET", f"/api/v1/jobs/{_uuid_seg(job_id)}/sources")
|
|
1111
|
+
|
|
1112
|
+
def search_media_sources(self, query: str) -> Any:
|
|
1113
|
+
"""Which of the user's videos used a source: a link, YouTube channel or author."""
|
|
1114
|
+
return self.request("GET", "/api/v1/sources/search", params={"q": query})
|
|
1115
|
+
|
|
1078
1116
|
def get_plan_review(self, job_id: str) -> Any:
|
|
1079
1117
|
"""The built design, beat by beat and graphic by graphic, with links to the media (review before render)."""
|
|
1080
1118
|
return self.request("GET", f"/api/v1/jobs/{_uuid_seg(job_id)}/plan/review")
|
|
@@ -1205,6 +1243,24 @@ class CliptudeClient:
|
|
|
1205
1243
|
def cancel_agent_run(self, project_id: int | str, run_id: str) -> Any:
|
|
1206
1244
|
return self.request("POST", f"/api/v1/editor-projects/{_int_seg(project_id)}/agent/runs/{_uuid_seg(run_id, 'run_id')}/cancel")
|
|
1207
1245
|
|
|
1246
|
+
def edit_timeline(
|
|
1247
|
+
self, project_id: int | str, operations: list[dict[str, Any]], *, expected_revision: int | None = None,
|
|
1248
|
+
) -> Any:
|
|
1249
|
+
"""Apply exact timeline operations in one revision: no model call, no credits."""
|
|
1250
|
+
body: dict[str, Any] = {"operations": operations}
|
|
1251
|
+
if expected_revision is not None:
|
|
1252
|
+
body["expected_revision"] = int(expected_revision)
|
|
1253
|
+
return self.request("POST", f"/api/v1/editor-projects/{_int_seg(project_id)}/edits", json_body=body)
|
|
1254
|
+
|
|
1255
|
+
def list_editor_versions(self, project_id: int | str) -> Any:
|
|
1256
|
+
return self.request("GET", f"/api/v1/editor-projects/{_int_seg(project_id)}/versions")
|
|
1257
|
+
|
|
1258
|
+
def restore_editor_version(self, project_id: int | str, version_id: int | str) -> Any:
|
|
1259
|
+
return self.request(
|
|
1260
|
+
"POST",
|
|
1261
|
+
f"/api/v1/editor-projects/{_int_seg(project_id)}/versions/{_int_seg(version_id, 'version_id')}/restore",
|
|
1262
|
+
)
|
|
1263
|
+
|
|
1208
1264
|
def render_project(
|
|
1209
1265
|
self, project_id: int | str, *, accept_quality_findings: bool = False, review_token: str | None = None,
|
|
1210
1266
|
skip_frame_review: bool = False,
|
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. "
|
|
@@ -478,10 +481,66 @@ def build_server(*, with_http_auth: bool = False):
|
|
|
478
481
|
)
|
|
479
482
|
),
|
|
480
483
|
],
|
|
484
|
+
brand_kit_id: Annotated[
|
|
485
|
+
int | None,
|
|
486
|
+
Field(description="Brand kit id from list_brand_kits (the channel's logo, colours, fonts). Omit for the user's default kit."),
|
|
487
|
+
] = None,
|
|
488
|
+
show_logo: Annotated[
|
|
489
|
+
bool | None,
|
|
490
|
+
Field(description="Put the brand kit's logo on the video. Off unless the user asks for it."),
|
|
491
|
+
] = None,
|
|
492
|
+
) -> dict[str, Any]:
|
|
493
|
+
"""Create a ready-to-use template without the create wizard. Values are validated like the wizard; returns the template (use its id in create_job) and `warnings`: choices that will change what the video can show (no footage, AI stills, no graphics). Tell the user every warning in plain words and fix the ones they did not ask for before making a video. People with several channels keep one brand kit per channel: ask which channel the template is for and pass its brand_kit_id."""
|
|
494
|
+
try:
|
|
495
|
+
return _client().create_template(name=name, format=format, settings=settings,
|
|
496
|
+
brand_kit_id=brand_kit_id, show_logo=show_logo)
|
|
497
|
+
except Exception as exc:
|
|
498
|
+
return _err(exc)
|
|
499
|
+
|
|
500
|
+
@mcp.tool(
|
|
501
|
+
title="Update template",
|
|
502
|
+
annotations=ToolAnnotations(title="Update template", read_only_hint=False, destructive_hint=False,
|
|
503
|
+
idempotent_hint=True, open_world_hint=False),
|
|
504
|
+
)
|
|
505
|
+
def update_template(
|
|
506
|
+
template_id: Annotated[str, Field(min_length=8, description="Template UUID")],
|
|
507
|
+
name: Annotated[str | None, Field(max_length=120, description="New template name")] = None,
|
|
508
|
+
brand_kit_id: Annotated[
|
|
509
|
+
int | None,
|
|
510
|
+
Field(description="Brand kit id from list_brand_kits; 0 = the user's default kit. Videos made from the template use it."),
|
|
511
|
+
] = None,
|
|
512
|
+
show_logo: Annotated[bool | None, Field(description="Put the brand kit's logo on videos made from this template.")] = None,
|
|
513
|
+
) -> dict[str, Any]:
|
|
514
|
+
"""Rename a saved template, give it a channel's brand kit, or turn its logo on or off. Returns the template (brand_kit_id, brand_kit_name, show_logo)."""
|
|
515
|
+
try:
|
|
516
|
+
return _client().update_template(template_id, name=name, brand_kit_id=brand_kit_id, show_logo=show_logo)
|
|
517
|
+
except Exception as exc:
|
|
518
|
+
return _err(exc)
|
|
519
|
+
|
|
520
|
+
@mcp.tool(
|
|
521
|
+
title="List brand kits",
|
|
522
|
+
annotations=ToolAnnotations(title="List brand kits", read_only_hint=True, open_world_hint=False),
|
|
523
|
+
)
|
|
524
|
+
def list_brand_kits() -> dict[str, Any]:
|
|
525
|
+
"""The user's brand kits, usually one per YouTube channel: id, name, is_default, logo_url, logo_position, five colours and four fonts. Kits are made and edited at cliptude.com/videos/brand-kit/. A template uses its own kit, else the default."""
|
|
526
|
+
try:
|
|
527
|
+
return _untrusted(_client().list_brand_kits())
|
|
528
|
+
except Exception as exc:
|
|
529
|
+
return _err(exc)
|
|
530
|
+
|
|
531
|
+
@mcp.tool(
|
|
532
|
+
title="List media library",
|
|
533
|
+
annotations=ToolAnnotations(title="List media library", read_only_hint=True, open_world_hint=False),
|
|
534
|
+
)
|
|
535
|
+
def list_media(
|
|
536
|
+
folder: Annotated[str | None, Field(description="Only this folder ('' = files in no folder)")] = None,
|
|
537
|
+
kind: Annotated[str | None, Field(description="image, video or audio")] = None,
|
|
538
|
+
limit: Annotated[int, Field(ge=1, le=200, description="Page size")] = 50,
|
|
539
|
+
offset: Annotated[int, Field(ge=0, description="Offset")] = 0,
|
|
481
540
|
) -> dict[str, Any]:
|
|
482
|
-
"""
|
|
541
|
+
"""The user's own images, clips and audio (their media library, shared with the editor's uploads): name, folder, kind, url. Use a file's url as a beat's or graphic's `url` in a plan, or in edit_timeline, when the user wants their own footage, photos or logo."""
|
|
483
542
|
try:
|
|
484
|
-
return _client().
|
|
543
|
+
return _untrusted(_client().list_media(folder=folder, kind=kind, limit=limit, offset=offset))
|
|
485
544
|
except Exception as exc:
|
|
486
545
|
return _err(exc)
|
|
487
546
|
|
|
@@ -1342,6 +1401,32 @@ def build_server(*, with_http_auth: bool = False):
|
|
|
1342
1401
|
except Exception as exc:
|
|
1343
1402
|
return _err(exc)
|
|
1344
1403
|
|
|
1404
|
+
@mcp.tool(
|
|
1405
|
+
title="Get video sources",
|
|
1406
|
+
annotations=ToolAnnotations(title="Get video sources", read_only_hint=True, open_world_hint=False),
|
|
1407
|
+
)
|
|
1408
|
+
def get_video_sources(
|
|
1409
|
+
job_id: Annotated[str, Field(min_length=8, description="Job UUID of a finished video")],
|
|
1410
|
+
) -> dict[str, Any]:
|
|
1411
|
+
"""Where every visual in a finished video came from: the times it is on screen, provider, author, license and original link, plus description_credits (the credits block for the YouTube description, already added to its description) and a CSV. Use it to answer a copyright claim or to credit Creative Commons footage. complete=false means some visuals predate source tracking."""
|
|
1412
|
+
try:
|
|
1413
|
+
return _untrusted(_client().get_job_sources(job_id))
|
|
1414
|
+
except Exception as exc:
|
|
1415
|
+
return _err(exc)
|
|
1416
|
+
|
|
1417
|
+
@mcp.tool(
|
|
1418
|
+
title="Find media source",
|
|
1419
|
+
annotations=ToolAnnotations(title="Find media source", read_only_hint=True, open_world_hint=False),
|
|
1420
|
+
)
|
|
1421
|
+
def find_media_source(
|
|
1422
|
+
query: Annotated[str, Field(min_length=3, description="A link, YouTube channel name or author to look for")],
|
|
1423
|
+
) -> dict[str, Any]:
|
|
1424
|
+
"""Which of your videos used footage or images from a source, and at what times. Use after a copyright claim or takedown request to find every other video that used the same creator's footage."""
|
|
1425
|
+
try:
|
|
1426
|
+
return _untrusted(_client().search_media_sources(query))
|
|
1427
|
+
except Exception as exc:
|
|
1428
|
+
return _err(exc)
|
|
1429
|
+
|
|
1345
1430
|
@mcp.tool(
|
|
1346
1431
|
title="Get plan sourcing report",
|
|
1347
1432
|
annotations=ToolAnnotations(title="Get plan sourcing report", read_only_hint=True, open_world_hint=False),
|
|
@@ -1447,6 +1532,72 @@ def build_server(*, with_http_auth: bool = False):
|
|
|
1447
1532
|
out.append(Image(data=base64.b64decode(sheet["jpeg_base64"]), format="jpeg"))
|
|
1448
1533
|
return out
|
|
1449
1534
|
|
|
1535
|
+
@mcp.tool(
|
|
1536
|
+
title="Edit timeline",
|
|
1537
|
+
annotations=ToolAnnotations(title="Edit timeline", read_only_hint=False, destructive_hint=True,
|
|
1538
|
+
idempotent_hint=False, open_world_hint=False),
|
|
1539
|
+
)
|
|
1540
|
+
def edit_timeline(
|
|
1541
|
+
project_id: Annotated[int, Field(description="Editor project id")],
|
|
1542
|
+
operations: Annotated[
|
|
1543
|
+
list[dict[str, Any]],
|
|
1544
|
+
Field(description=(
|
|
1545
|
+
"Operations applied in order, in one revision (up to 60). Each is an object with op and its fields: "
|
|
1546
|
+
"{op:'delete', item_id}; {op:'retime', item_id, start_s?, end_s?}; {op:'trim', item_id, from_s, to_s?} "
|
|
1547
|
+
"(clips and audio: which part of the source plays); {op:'set', item_id, opacity?, volume?, playbackRate?} "
|
|
1548
|
+
"(opacity and volume 0-100); {op:'set_props', item_id, props:{...}} (a graphic's fields, as in its "
|
|
1549
|
+
"catalog prop_schema); {op:'set_type', item_id, animation_type, props?} (another design, same timing); "
|
|
1550
|
+
"{op:'set_picture', item_id, keep|url} (a graphic's picture slot, or a clip's or image's file); "
|
|
1551
|
+
"{op:'mute_cues', item_id} (silence a graphic's own sound cues); {op:'add_graphic', animation_type, "
|
|
1552
|
+
"start_s, end_s, props, keep?|url?}; {op:'add_clip', keep|url, start_s, end_s, from_s?} (footage layer); "
|
|
1553
|
+
"{op:'set_transition', from_id, to_id, kind, direction?, duration_s?} (the join between two clips; "
|
|
1554
|
+
"kind 'none' removes it); {op:'set_caption_style', style:{color, activeColor, appearedColor, fontSize, "
|
|
1555
|
+
"...}, item_ids?} (every caption when item_ids is omitted; wording follows the narration); "
|
|
1556
|
+
"{op:'set_music', library_file?|keep?|url?, volume?, remove?} (library_file from get_template_options); "
|
|
1557
|
+
"{op:'set_background', keep|url}; {op:'add_sfx', sound, start_s, volume?} (sound id from "
|
|
1558
|
+
"get_kind_catalog sounds). set_props on a text item sets text, color, fontSize, fontWeight, textAlign. "
|
|
1559
|
+
"keep is a keep id from upload_plan_media / start_media_upload or from get_plan_review; url a public "
|
|
1560
|
+
"https link."
|
|
1561
|
+
)),
|
|
1562
|
+
],
|
|
1563
|
+
expected_revision: Annotated[
|
|
1564
|
+
int | None, Field(description="The revision you read the item ids from; a newer timeline answers 409")
|
|
1565
|
+
] = None,
|
|
1566
|
+
) -> dict[str, Any]:
|
|
1567
|
+
"""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."""
|
|
1568
|
+
try:
|
|
1569
|
+
return _client().edit_timeline(project_id, operations, expected_revision=expected_revision)
|
|
1570
|
+
except Exception as exc:
|
|
1571
|
+
return _err(exc)
|
|
1572
|
+
|
|
1573
|
+
@mcp.tool(
|
|
1574
|
+
title="List editor versions",
|
|
1575
|
+
annotations=ToolAnnotations(title="List editor versions", read_only_hint=True, open_world_hint=False),
|
|
1576
|
+
)
|
|
1577
|
+
def list_editor_versions(
|
|
1578
|
+
project_id: Annotated[int, Field(description="Editor project id")],
|
|
1579
|
+
) -> dict[str, Any]:
|
|
1580
|
+
"""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."""
|
|
1581
|
+
try:
|
|
1582
|
+
return _client().list_editor_versions(project_id)
|
|
1583
|
+
except Exception as exc:
|
|
1584
|
+
return _err(exc)
|
|
1585
|
+
|
|
1586
|
+
@mcp.tool(
|
|
1587
|
+
title="Restore editor version",
|
|
1588
|
+
annotations=ToolAnnotations(title="Restore editor version", read_only_hint=False, destructive_hint=True,
|
|
1589
|
+
idempotent_hint=False, open_world_hint=False),
|
|
1590
|
+
)
|
|
1591
|
+
def restore_editor_version(
|
|
1592
|
+
project_id: Annotated[int, Field(description="Editor project id")],
|
|
1593
|
+
version_id: Annotated[int, Field(description="Version id from list_editor_versions")],
|
|
1594
|
+
) -> dict[str, Any]:
|
|
1595
|
+
"""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."""
|
|
1596
|
+
try:
|
|
1597
|
+
return _client().restore_editor_version(project_id, version_id)
|
|
1598
|
+
except Exception as exc:
|
|
1599
|
+
return _err(exc)
|
|
1600
|
+
|
|
1450
1601
|
@mcp.tool(
|
|
1451
1602
|
title="Run Cliptude Agent",
|
|
1452
1603
|
annotations=ToolAnnotations(title="Run Cliptude Agent", read_only_hint=False, destructive_hint=True,
|
|
@@ -1465,7 +1616,7 @@ def build_server(*, with_http_auth: bool = False):
|
|
|
1465
1616
|
Field(description=SPEND_REVIEW_TOKEN_HELP),
|
|
1466
1617
|
] = None,
|
|
1467
1618
|
) -> dict[str, Any]:
|
|
1468
|
-
"""Ask Cliptude Agent to edit the timeline (swap footage, regenerate images or voiceover ranges, music, transitions, text
|
|
1619
|
+
"""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
1620
|
try:
|
|
1470
1621
|
return _compact_agent_run(_client().run_agent(
|
|
1471
1622
|
project_id, prompt=prompt, tier=tier, referenced_item_ids=referenced_item_ids, chat_id=chat_id,
|
|
@@ -1548,7 +1699,7 @@ def build_server(*, with_http_auth: bool = False):
|
|
|
1548
1699
|
annotations=ToolAnnotations(title="Get account", read_only_hint=True, open_world_hint=False),
|
|
1549
1700
|
)
|
|
1550
1701
|
def get_account() -> dict[str, Any]:
|
|
1551
|
-
"""Plan, credits remaining, concurrency in use, and extra_formats: formats opened for this account only (faceless_explainer). Offer a format in extra_formats; others in that family answer 403."""
|
|
1702
|
+
"""Plan, credits remaining, concurrency in use, and extra_formats: formats opened for this account only (faceless_explainer). Offer a format in extra_formats; others in that family answer 403. can_create_jobs is true with a plan or with pay-as-you-go credits (plan is then null)."""
|
|
1552
1703
|
try:
|
|
1553
1704
|
return _client().get_account()
|
|
1554
1705
|
except Exception as exc:
|
|
@@ -202,6 +202,28 @@ var Views = (function () {
|
|
|
202
202
|
return section("Tags (" + tags.length + ")", [box], h("button", { type: "button", onclick: function () { copy(tags.join(", "), box); } }, ["Copy all tags"]));
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
+
// Where each visual came from (videos/media_credits.py), for copyright claims; credits are already in the description.
|
|
206
|
+
function sourcesSection(sources) {
|
|
207
|
+
var items = (sources && sources.items) || [];
|
|
208
|
+
if (!items.length) return null;
|
|
209
|
+
function clock(t) {
|
|
210
|
+
t = Math.max(0, Math.floor(Number(t) || 0));
|
|
211
|
+
var m = Math.floor(t / 60), sec = t % 60;
|
|
212
|
+
return m + ":" + (sec < 10 ? "0" : "") + sec;
|
|
213
|
+
}
|
|
214
|
+
var lines = items.map(function (e) {
|
|
215
|
+
var when = (e.times || []).map(function (r) { return clock(r[0]); }).join(", ");
|
|
216
|
+
var who = [e.provider || e.kind, e.author, e.license_label].filter(Boolean).join(" · ");
|
|
217
|
+
return when + " " + who + (e.page_url ? " " + e.page_url : "");
|
|
218
|
+
});
|
|
219
|
+
var text = lines.join("\n");
|
|
220
|
+
var pre = h("pre", { class: "copy", tabindex: "0" }, [text]);
|
|
221
|
+
var note = sources.complete === false
|
|
222
|
+
? [h("p", { class: "sub" }, ["Some visuals were made before sources were recorded, so they are not listed."])] : [];
|
|
223
|
+
return section("Sources (" + items.length + ")", note.concat([pre]),
|
|
224
|
+
h("button", { type: "button", onclick: function () { copy(text, pre); } }, ["Copy sources"]));
|
|
225
|
+
}
|
|
226
|
+
|
|
205
227
|
function render() {
|
|
206
228
|
var meta = kit.publish_metadata || {};
|
|
207
229
|
var thumbs = (kit.thumbnails && kit.thumbnails.items) || [];
|
|
@@ -222,6 +244,7 @@ var Views = (function () {
|
|
|
222
244
|
textSection("Description", description.trim()),
|
|
223
245
|
textSection("Chapters", meta.chapters || ""),
|
|
224
246
|
tagsSection(tags),
|
|
247
|
+
sourcesSection(kit.sources),
|
|
225
248
|
downloads.voiceover_url || downloads.project_zip_url ? section("Downloads", [h("div", { class: "toolbar" }, [
|
|
226
249
|
downloads.voiceover_url ? h("button", { type: "button", onclick: function () { open(downloads.voiceover_url); } }, ["Voiceover"]) : null,
|
|
227
250
|
downloads.project_zip_url ? h("button", { type: "button", onclick: function () { open(downloads.project_zip_url); } }, ["Project files"]) : null
|
package/package.json
CHANGED
package/pyproject.toml
CHANGED