@cliptude/cli 0.1.44 → 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 +4 -0
- package/cliptude_mcp/apps.py +5 -0
- package/cliptude_mcp/client.py +43 -5
- package/cliptude_mcp/server.py +85 -3
- package/cliptude_mcp/widgets/views.js +23 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -71,6 +71,10 @@ To check the price first, `estimate` (MCP `estimate_credits`, REST `POST /api/v1
|
|
|
71
71
|
|
|
72
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
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`.
|
|
77
|
+
|
|
74
78
|
### Agent-planned videos
|
|
75
79
|
|
|
76
80
|
On Faceless Documentary, Faceless Top 10, Avatar Video and Vector Explainer templates an agent can plan every visual and leave Cliptude
|
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/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")
|
package/cliptude_mcp/server.py
CHANGED
|
@@ -481,10 +481,66 @@ def build_server(*, with_http_auth: bool = False):
|
|
|
481
481
|
)
|
|
482
482
|
),
|
|
483
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,
|
|
484
513
|
) -> dict[str, Any]:
|
|
485
|
-
"""
|
|
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)."""
|
|
486
515
|
try:
|
|
487
|
-
return _client().
|
|
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,
|
|
540
|
+
) -> dict[str, Any]:
|
|
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."""
|
|
542
|
+
try:
|
|
543
|
+
return _untrusted(_client().list_media(folder=folder, kind=kind, limit=limit, offset=offset))
|
|
488
544
|
except Exception as exc:
|
|
489
545
|
return _err(exc)
|
|
490
546
|
|
|
@@ -1345,6 +1401,32 @@ def build_server(*, with_http_auth: bool = False):
|
|
|
1345
1401
|
except Exception as exc:
|
|
1346
1402
|
return _err(exc)
|
|
1347
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
|
+
|
|
1348
1430
|
@mcp.tool(
|
|
1349
1431
|
title="Get plan sourcing report",
|
|
1350
1432
|
annotations=ToolAnnotations(title="Get plan sourcing report", read_only_hint=True, open_world_hint=False),
|
|
@@ -1617,7 +1699,7 @@ def build_server(*, with_http_auth: bool = False):
|
|
|
1617
1699
|
annotations=ToolAnnotations(title="Get account", read_only_hint=True, open_world_hint=False),
|
|
1618
1700
|
)
|
|
1619
1701
|
def get_account() -> dict[str, Any]:
|
|
1620
|
-
"""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)."""
|
|
1621
1703
|
try:
|
|
1622
1704
|
return _client().get_account()
|
|
1623
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
|