@cliptude/cli 0.1.30 → 0.1.32

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.
@@ -0,0 +1,152 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <title>Template</title>
7
+ <style>
8
+ /*@BASE_CSS@*/
9
+ .hero { display: grid; grid-template-columns: 150px 1fr; gap: 14px; align-items: start; }
10
+ .hero .thumb { aspect-ratio: 16 / 9; border-radius: var(--border-radius-md); }
11
+ .hero .thumb.portrait { aspect-ratio: 1 / 1; }
12
+ .parts { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
13
+ .part { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--border-radius-md);
14
+ background: var(--color-background-secondary); border: 1px solid var(--color-border-secondary); min-width: 0; }
15
+ .part .main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
16
+ .part .k { font-size: var(--font-text-xs-size); color: var(--color-text-tertiary); text-transform: uppercase; letter-spacing: .04em; }
17
+ .part .v { font-weight: 600; font-size: var(--font-text-sm-size); overflow-wrap: anywhere; }
18
+ .part .pic { width: 64px; flex: none; border-radius: var(--border-radius-sm); }
19
+ .part .pic.r16x9 { aspect-ratio: 16 / 9; }
20
+ @media (max-width: 420px) { .hero { grid-template-columns: 1fr; } }
21
+ </style>
22
+ </head>
23
+ <body>
24
+ <main class="app" id="content" aria-live="polite"><div class="status" role="status">Loading the template…</div></main>
25
+ <div id="toast" role="status" aria-live="polite"></div>
26
+ <script>
27
+ /*@BRIDGE_JS@*/
28
+ (function () {
29
+ "use strict";
30
+ var h = UI.h;
31
+ var PLAY = '<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M8 5v14l11-7z"/></svg>';
32
+ var PAUSE = '<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M6 5h4v14H6zm8 0h4v14h-4z"/></svg>';
33
+ var content = document.getElementById("content");
34
+ var tpl = null;
35
+
36
+ function playButton(key, url, name) {
37
+ if (!url) return null;
38
+ var playing = Media.playing() === key;
39
+ var b = h("button", { type: "button", class: "icon", "aria-pressed": String(playing),
40
+ "aria-label": (playing ? "Pause " : "Play ") + name, onclick: function () { Media.toggleAudio(key, url); } }, []);
41
+ b.innerHTML = playing ? PAUSE : PLAY;
42
+ return b;
43
+ }
44
+
45
+ // The product names of the model tiers (videos.models.Video.GenerationModel): the old high-family values
46
+ // (xhigh, v1_video, medium, low) all run as Cinder now.
47
+ var MODEL_NAMES = { pro: "Caldera", high: "Cinder", xhigh: "Cinder", v1_video: "Cinder", medium: "Cinder", low: "Cinder" };
48
+ function modelName(value) {
49
+ return MODEL_NAMES[String(value).toLowerCase()] || String(value);
50
+ }
51
+
52
+ function part(label, value, extra, pic) {
53
+ return h("div", { class: "part" }, [pic || null, h("span", { class: "main" }, [
54
+ h("span", { class: "k" }, [label]), h("span", { class: "v" }, [value || "—"])
55
+ ]), extra || null]);
56
+ }
57
+
58
+ /** The look from the server (newer Cliptude), else what the summary itself says. */
59
+ function look(t) {
60
+ if (t.look) return t.look;
61
+ return {
62
+ voice: t.voice_name ? { name: t.voice_name, provider: t.voice_provider, preview_url: "" } : null,
63
+ avatar: t.avatar_name ? { name: t.avatar_name, image_url: t.avatar_preview_url || "" } : null,
64
+ switches: [
65
+ { key: "animations", label: "Animations", on: !t.disable_animations },
66
+ { key: "overlays", label: "Text overlays", on: !t.disable_overlays },
67
+ { key: "sound_effects", label: "Sound effects", on: !t.disable_sound_effects },
68
+ { key: "transitions", label: "Transitions", on: !t.disable_transitions }
69
+ ]
70
+ };
71
+ }
72
+
73
+ function render() {
74
+ var t = tpl, l = look(t);
75
+ var presenter = l.avatar || l.character || null;
76
+ var heroPic = presenter && presenter.image_url ? UI.img(presenter.image_url, presenter.name, UI.initials(presenter.name))
77
+ : l.background && l.background.image_url ? UI.img(l.background.image_url, "Background", "")
78
+ : UI.img("", "", UI.initials(t.name));
79
+ if (l.character) heroPic.classList.add("portrait");
80
+ var facts = [t.format_label || t.format, t.duration ? t.duration + " min" : "", t.aspect_ratio || "16:9", t.language || ""]
81
+ .filter(Boolean).map(function (x) { return h("span", { class: "chip" }, [x]); });
82
+
83
+ var parts = [];
84
+ if (l.voice) {
85
+ parts.push(part("Voice", l.voice.name + (l.voice.provider ? " · " + l.voice.provider : ""),
86
+ playButton("voice", l.voice.preview_url, "the voice " + l.voice.name)));
87
+ } else if (t.format !== "talking_head") {
88
+ parts.push(part("Voice", "None set"));
89
+ }
90
+ if (l.avatar) parts.push(part("Presenter", l.avatar.name, null, l.avatar.image_url ? UI.img(l.avatar.image_url, "", "") : null));
91
+ if (t.format === "avatar_video" && !l.avatar) parts.push(part("Presenter", "No avatar chosen"));
92
+ if (l.character) parts.push(part("Character", l.character.name, null, l.character.image_url ? UI.img(l.character.image_url, "", "") : null));
93
+ if (l.music) {
94
+ parts.push(part("Music", l.music.on ? (l.music.label || l.music.file) + (l.music.default ? " (default)" : "") : "No music",
95
+ l.music.on ? playButton("music", l.music.preview_url, "the music") : null));
96
+ }
97
+ if (l.background) {
98
+ var bg = UI.img(l.background.image_url, "", "");
99
+ bg.classList.add("r16x9");
100
+ parts.push(part("Background", l.background.value.indexOf("upload:") === 0 ? "Your upload" : l.background.value, null, bg));
101
+ }
102
+ parts.forEach(function (p) { var pic = p.querySelector(".thumb"); if (pic) pic.classList.add("pic"); });
103
+
104
+ var styleChips = [];
105
+ if (l.style_pack) styleChips.push(h("span", { class: "chip info" }, [
106
+ h("span", { class: "swatches", style: { display: "inline-flex", verticalAlign: "middle", marginRight: "4px" } },
107
+ (l.style_pack.swatches || []).map(function (c) { return h("span", { class: "swatch", style: { background: c, width: "10px", height: "10px" } }); })),
108
+ "Style: " + l.style_pack.label]));
109
+ if (l.visual_theme) styleChips.push(h("span", { class: "chip info" }, ["Theme: " + l.visual_theme.label]));
110
+ if (l.caption_style) styleChips.push(h("span", { class: "chip info" }, ["Captions: " + l.caption_style.label]));
111
+ if (t.generation_model) styleChips.push(h("span", { class: "chip" }, ["Model: " + modelName(t.generation_model)]));
112
+
113
+ var switches = (l.switches || []).map(function (s) {
114
+ return h("span", { class: "chip " + (s.on ? "ok" : "warn off"), "aria-label": s.label + (s.on ? " on" : " off") },
115
+ [(s.on ? "✓ " : "✕ ") + s.label]);
116
+ });
117
+
118
+ UI.clear(content);
119
+ content.appendChild(h("div", { class: "hero" }, [heroPic, h("div", { class: "sec" }, [
120
+ h("h1", { style: { margin: 0, fontSize: "var(--font-heading-sm-size)" } }, [t.name || "Template"]),
121
+ h("span", { class: "chips" }, facts),
122
+ styleChips.length ? h("span", { class: "chips" }, styleChips) : null
123
+ ])]));
124
+ (t.warnings || []).forEach(function (w) { content.appendChild(h("div", { class: "callout warn", role: "note" }, [String(w)])); });
125
+ if (parts.length) content.appendChild(h("div", { class: "parts" }, parts));
126
+ if (switches.length) content.appendChild(h("section", { class: "sec" }, [h("h2", {}, ["Switches"]), h("div", { class: "chips" }, switches)]));
127
+ content.appendChild(h("div", { class: "selection" }, [
128
+ h("button", { type: "button", onclick: function () {
129
+ UI.choose("I want to change something in the template “" + t.name + "” (template_id " + t.id + "). Ask me what to change.",
130
+ { template_id: t.id, change: true });
131
+ } }, ["Change something"]),
132
+ h("button", { type: "button", class: "primary", onclick: function () {
133
+ UI.choose("Make a video with the template “" + t.name + "” (template_id " + t.id + ").", { template_id: t.id });
134
+ } }, ["Make a video with this template"])
135
+ ]));
136
+ }
137
+
138
+ Media.onChange(function () { if (tpl) render(); });
139
+ Cliptude.connect({
140
+ name: "cliptude-template",
141
+ onResult: function (data) {
142
+ var err = UI.errorText(data);
143
+ if (err) { UI.status(content, err, "error"); return; }
144
+ tpl = data.template && !data.id ? data.template : data;
145
+ render();
146
+ },
147
+ onCancelled: function () { UI.status(content, "Cancelled."); }
148
+ }).catch(function () { UI.status(content, "This view could not connect to the chat.", "error"); });
149
+ })();
150
+ </script>
151
+ </body>
152
+ </html>
@@ -0,0 +1,93 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <title>Templates</title>
7
+ <style>
8
+ /*@BASE_CSS@*/
9
+ .card { cursor: default; }
10
+ .card .thumb { aspect-ratio: 16 / 9; }
11
+ .tile { width: 100%; height: 100%; display: flex; align-items: flex-end; padding: 10px; color: #fff; font-weight: 700; font-size: 15px; }
12
+ .card .body .chips { margin-top: 2px; }
13
+ .card .actions { padding: 0 10px 10px; margin-top: auto; }
14
+ .card .actions button { width: 100%; }
15
+ </style>
16
+ </head>
17
+ <body>
18
+ <main class="app" aria-labelledby="title">
19
+ <div class="head">
20
+ <h1 id="title">Your templates</h1>
21
+ <span class="toolbar"><span class="sub" id="count"></span><button type="button" id="all" hidden aria-pressed="false">Show all</button></span>
22
+ </div>
23
+ <div id="content"><div class="status" role="status">Loading templates…</div></div>
24
+ </main>
25
+ <div id="toast" role="status" aria-live="polite"></div>
26
+ <script>
27
+ /*@BRIDGE_JS@*/
28
+ (function () {
29
+ "use strict";
30
+ var h = UI.h;
31
+ // Formats Cliptude makes today; templates of retired formats (whiteboard, sketch, stickman, low_poly_3d,
32
+ // monkey_explained, vox_animation, infographic, mannequin_3d, faceless_explainer, music, ...) hide behind "Show all".
33
+ var LIVE = { faceless_documentary: 1, faceless_top_10: 1, avatar_video: 1, talking_head: 1, vector_explainer: 1 };
34
+ var TILE = { faceless_documentary: "#1e3a5f, #0b1220", faceless_top_10: "#5b2130, #1a0b10", avatar_video: "#2d3b2a, #0e140c",
35
+ talking_head: "#4a3a1e, #171008", vector_explainer: "#3a2a5f, #120b20" };
36
+ var content = document.getElementById("content");
37
+ var all = document.getElementById("all");
38
+ var data = { results: [] };
39
+ var showAll = false;
40
+
41
+ function card(t) {
42
+ var pic;
43
+ if (t.format === "avatar_video" && t.avatar_preview_url) pic = UI.img(t.avatar_preview_url, "", UI.initials(t.avatar_name || t.name));
44
+ else pic = h("span", { class: "thumb" }, [h("span", { class: "tile", style: { background: "linear-gradient(150deg, " + (TILE[t.format] || "#444, #111") + ")" } },
45
+ [t.format_label || t.format || ""])]);
46
+ var chips = [t.duration ? t.duration + " min" : "", t.aspect_ratio || "", LIVE[t.format] ? "" : "Retired format"]
47
+ .filter(Boolean).map(function (x) { return h("span", { class: "chip" + (x === "Retired format" ? " warn" : "") }, [x]); });
48
+ return h("div", { class: "card", role: "listitem" }, [
49
+ pic,
50
+ h("span", { class: "body" }, [
51
+ h("span", { class: "name" }, [t.name || "Untitled"]),
52
+ h("span", { class: "muted" }, [(t.format_label || t.format || "") + (t.voice_name ? " · " + t.voice_name : "") +
53
+ (t.avatar_name ? " · " + t.avatar_name : "")]),
54
+ chips.length ? h("span", { class: "chips" }, chips) : null
55
+ ]),
56
+ h("span", { class: "actions" }, [h("button", { type: "button", class: LIVE[t.format] ? "primary" : "",
57
+ onclick: function () { UI.choose("Use the template “" + t.name + "” (template_id " + t.id + ").", { template_id: t.id }); } },
58
+ ["Use this template"])])
59
+ ]);
60
+ }
61
+
62
+ function render() {
63
+ var rows = data.results || [];
64
+ var live = rows.filter(function (t) { return LIVE[t.format]; });
65
+ var hidden = rows.length - live.length;
66
+ var shown = showAll ? rows : live;
67
+ all.hidden = hidden === 0;
68
+ all.textContent = showAll ? "Live formats only" : "Show all (" + hidden + " more)";
69
+ all.setAttribute("aria-pressed", String(showAll));
70
+ var total = data.count || rows.length;
71
+ document.getElementById("count").textContent = total > rows.length ? rows.length + " of " + total : rows.length + " saved";
72
+ if (!rows.length) { UI.status(content, "No templates yet. Ask Claude to make one: it walks you through the voice, look and music."); return; }
73
+ if (!shown.length) { UI.status(content, "None of your templates uses a format Cliptude makes today. Show all to see them, or ask Claude to make a new one."); return; }
74
+ var grid = h("div", { class: "grid wide", role: "list" });
75
+ shown.forEach(function (t) { grid.appendChild(card(t)); });
76
+ UI.clear(content).appendChild(grid);
77
+ }
78
+
79
+ all.addEventListener("click", function () { showAll = !showAll; render(); });
80
+ Cliptude.connect({
81
+ name: "cliptude-templates",
82
+ onResult: function (d) {
83
+ var err = UI.errorText(d);
84
+ if (err) { UI.status(content, err, "error"); return; }
85
+ data = d || { results: [] };
86
+ render();
87
+ },
88
+ onCancelled: function () { UI.status(content, "Cancelled."); }
89
+ }).catch(function () { UI.status(content, "This view could not connect to the chat.", "error"); });
90
+ })();
91
+ </script>
92
+ </body>
93
+ </html>