@clipform/mcp-server 1.8.1 → 1.9.1
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/dist/auth-context.js +9 -0
- package/dist/auth-context.js.map +1 -0
- package/dist/chunk-ESDD3WVD.js +24686 -0
- package/dist/chunk-ESDD3WVD.js.map +1 -0
- package/dist/chunk-YEDU3G7I.js +48 -0
- package/dist/chunk-YEDU3G7I.js.map +1 -0
- package/dist/index.js +108 -11
- package/dist/index.js.map +1 -1
- package/dist/server.js +7 -74
- package/dist/server.js.map +1 -1
- package/package.json +7 -8
- package/dist/__tests__/api-parity.test.d.ts +0 -1
- package/dist/__tests__/api-parity.test.js +0 -157
- package/dist/__tests__/api-parity.test.js.map +0 -1
- package/dist/__tests__/config-sync.test.d.ts +0 -1
- package/dist/__tests__/config-sync.test.js +0 -16
- package/dist/__tests__/config-sync.test.js.map +0 -1
- package/dist/index.d.ts +0 -2
- package/dist/lib/api-client.d.ts +0 -35
- package/dist/lib/api-client.js +0 -126
- package/dist/lib/api-client.js.map +0 -1
- package/dist/lib/auth-context.d.ts +0 -17
- package/dist/lib/auth-context.js +0 -9
- package/dist/lib/auth-context.js.map +0 -1
- package/dist/lib/config.d.ts +0 -23
- package/dist/lib/config.js +0 -6
- package/dist/lib/config.js.map +0 -1
- package/dist/lib/format-form.d.ts +0 -2
- package/dist/lib/format-form.js +0 -32
- package/dist/lib/format-form.js.map +0 -1
- package/dist/lib/render-jobs.d.ts +0 -17
- package/dist/lib/render-jobs.js +0 -44
- package/dist/lib/render-jobs.js.map +0 -1
- package/dist/lib/schemas.d.ts +0 -64
- package/dist/lib/schemas.js +0 -140
- package/dist/lib/schemas.js.map +0 -1
- package/dist/lib/session-context.d.ts +0 -1
- package/dist/lib/session-context.js +0 -38
- package/dist/lib/session-context.js.map +0 -1
- package/dist/prompts.d.ts +0 -2
- package/dist/prompts.js +0 -272
- package/dist/prompts.js.map +0 -1
- package/dist/resources.d.ts +0 -2
- package/dist/resources.js +0 -336
- package/dist/resources.js.map +0 -1
- package/dist/server.d.ts +0 -2
- package/dist/tools/add-node.d.ts +0 -2
- package/dist/tools/add-node.js +0 -48
- package/dist/tools/add-node.js.map +0 -1
- package/dist/tools/attach-node-audio.d.ts +0 -2
- package/dist/tools/attach-node-audio.js +0 -35
- package/dist/tools/attach-node-audio.js.map +0 -1
- package/dist/tools/check-render.d.ts +0 -2
- package/dist/tools/check-render.js +0 -47
- package/dist/tools/check-render.js.map +0 -1
- package/dist/tools/create-form.d.ts +0 -2
- package/dist/tools/create-form.js +0 -199
- package/dist/tools/create-form.js.map +0 -1
- package/dist/tools/delete-form.d.ts +0 -2
- package/dist/tools/delete-form.js +0 -26
- package/dist/tools/delete-form.js.map +0 -1
- package/dist/tools/delete-node-media.d.ts +0 -2
- package/dist/tools/delete-node-media.js +0 -25
- package/dist/tools/delete-node-media.js.map +0 -1
- package/dist/tools/delete-node.d.ts +0 -2
- package/dist/tools/delete-node.js +0 -28
- package/dist/tools/delete-node.js.map +0 -1
- package/dist/tools/generate-slideshow.d.ts +0 -2
- package/dist/tools/generate-slideshow.js +0 -155
- package/dist/tools/generate-slideshow.js.map +0 -1
- package/dist/tools/generate-tts.d.ts +0 -2
- package/dist/tools/generate-tts.js +0 -73
- package/dist/tools/generate-tts.js.map +0 -1
- package/dist/tools/generate-video.d.ts +0 -2
- package/dist/tools/generate-video.js +0 -119
- package/dist/tools/generate-video.js.map +0 -1
- package/dist/tools/get-form.d.ts +0 -2
- package/dist/tools/get-form.js +0 -25
- package/dist/tools/get-form.js.map +0 -1
- package/dist/tools/get-node-media.d.ts +0 -2
- package/dist/tools/get-node-media.js +0 -35
- package/dist/tools/get-node-media.js.map +0 -1
- package/dist/tools/list-assets.d.ts +0 -2
- package/dist/tools/list-assets.js +0 -45
- package/dist/tools/list-assets.js.map +0 -1
- package/dist/tools/list-compositions.d.ts +0 -2
- package/dist/tools/list-compositions.js +0 -34
- package/dist/tools/list-compositions.js.map +0 -1
- package/dist/tools/list-forms.d.ts +0 -2
- package/dist/tools/list-forms.js +0 -86
- package/dist/tools/list-forms.js.map +0 -1
- package/dist/tools/log-generation.d.ts +0 -2
- package/dist/tools/log-generation.js +0 -33
- package/dist/tools/log-generation.js.map +0 -1
- package/dist/tools/render-composition.d.ts +0 -2
- package/dist/tools/render-composition.js +0 -50
- package/dist/tools/render-composition.js.map +0 -1
- package/dist/tools/search-media.d.ts +0 -2
- package/dist/tools/search-media.js +0 -40
- package/dist/tools/search-media.js.map +0 -1
- package/dist/tools/search-music.d.ts +0 -2
- package/dist/tools/search-music.js +0 -40
- package/dist/tools/search-music.js.map +0 -1
- package/dist/tools/search-news.d.ts +0 -2
- package/dist/tools/search-news.js +0 -47
- package/dist/tools/search-news.js.map +0 -1
- package/dist/tools/set-node-logic.d.ts +0 -2
- package/dist/tools/set-node-logic.js +0 -54
- package/dist/tools/set-node-logic.js.map +0 -1
- package/dist/tools/update-form.d.ts +0 -2
- package/dist/tools/update-form.js +0 -155
- package/dist/tools/update-form.js.map +0 -1
- package/dist/tools/update-node.d.ts +0 -2
- package/dist/tools/update-node.js +0 -70
- package/dist/tools/update-node.js.map +0 -1
- package/dist/tools/upload-node-media.d.ts +0 -2
- package/dist/tools/upload-node-media.js +0 -105
- package/dist/tools/upload-node-media.js.map +0 -1
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { callInternalApi, textResult } from "../lib/api-client.js";
|
|
3
|
-
import { createJob, completeJob, failJob, RENDER_TIMING } from "../lib/render-jobs.js";
|
|
4
|
-
// Style knobs - mirror packages/remotion/src/compositions/slideshow/KenBurnsImage.tsx.
|
|
5
|
-
// Every field optional; unset fields fall back to library defaults (which shift
|
|
6
|
-
// automatically between 'cover' and 'blur-pad' fit modes).
|
|
7
|
-
const slideshowStyleSchema = z.object({
|
|
8
|
-
preset: z.enum(["cinematic", "dramatic", "calm", "documentary", "dreamy", "moody"]).optional().describe("Named shortcut applied before per-field overrides. cinematic = defaults; dramatic = big zoom, wider pan, ease-out, stronger vignette; calm = minimal motion, linear, no vignette; documentary = near-static, no pan; dreamy = bright heavy blur-pad, soft vignette, gentle zoom; moody = desaturated low-key blur-pad, strong vignette. Set any other field to override individual knobs on top of the preset."),
|
|
9
|
-
zoom: z.object({
|
|
10
|
-
from: z.number().optional().describe("Starting scale for zoom-in / ending scale for zoom-out. Default 1.0."),
|
|
11
|
-
to: z.number().optional().describe("Ending scale for zoom-in / starting scale for zoom-out. Default 1.3 (cover) / 1.15 (blur-pad)."),
|
|
12
|
-
}).optional().describe("Zoom range. Lower 'to' (e.g. 1.05) for near-static cinematography; higher (e.g. 1.4) for dramatic push-in."),
|
|
13
|
-
pan: z.object({
|
|
14
|
-
range: z.number().optional().describe("Pan drift as fraction of viewport on each side. Default 0.05 (cover) / 0.03 (blur-pad). 0.08+ feels like sweeping."),
|
|
15
|
-
scale: z.number().optional().describe("Baseline scale during pan effects. Must exceed 1 + 2×range so edges never show. Default 1.12 / 1.08."),
|
|
16
|
-
}).optional(),
|
|
17
|
-
zoomPan: z.object({
|
|
18
|
-
from: z.number().optional(),
|
|
19
|
-
to: z.number().optional(),
|
|
20
|
-
rangeFraction: z.number().optional().describe("Multiplier on pan.range for zoom-in-pan-* effects. Default 0.5."),
|
|
21
|
-
}).optional(),
|
|
22
|
-
easing: z.enum(["ease-in-out", "ease-in", "ease-out", "linear"]).optional().describe("Motion curve. 'ease-in-out' = cinematic default. 'linear' = mechanical/deliberate. 'ease-out' = fast-start slow-finish, good for reveals."),
|
|
23
|
-
blurPad: z.object({
|
|
24
|
-
blurPx: z.number().optional().describe("Blur strength on the background layer. Default 40. 60+ for heavy dreamy effect, 20 for just-barely."),
|
|
25
|
-
brightness: z.number().optional().describe("Background brightness multiplier. Default 0.55 (dimmed). Raise to 0.8+ for a brighter bed; lower for moodier."),
|
|
26
|
-
saturate: z.number().optional().describe("Background saturation. Default 1.15. Lower (0.6) for desaturated/muted bg; higher for vivid."),
|
|
27
|
-
overscale: z.number().optional().describe("Background overscale to hide blur edges. Default 1.12."),
|
|
28
|
-
foregroundScale: z.number().optional().describe("Gentle crop on the contain-fit sharp layer. Default 1.0 (pure contain). 1.2 reduces letterbox by accepting mild crop."),
|
|
29
|
-
}).optional().describe("Styling for the blurred-letterbox layer. Only applies when fit resolves to 'blur-pad' (landscape source in portrait viewport)."),
|
|
30
|
-
vignette: z.union([
|
|
31
|
-
z.literal(false),
|
|
32
|
-
z.object({
|
|
33
|
-
opacity: z.number().optional().describe("Edge darkness opacity, 0-1. Default 0.35 (cover) / 0.4 (blur-pad)."),
|
|
34
|
-
innerRadiusPercent: z.number().optional().describe("Where darkening starts, 0 = center, 100 = edge. Default 50-55."),
|
|
35
|
-
}),
|
|
36
|
-
]).optional().describe("Edge darkening for cinematic framing. Pass false to disable."),
|
|
37
|
-
backgroundColor: z.string().optional().describe("Hex color behind the image frame. Default '#000'."),
|
|
38
|
-
autoBlurPadThreshold: z.number().optional().describe("When fit='auto', trigger blur-pad if aspectRatio > this value. Default 1.1."),
|
|
39
|
-
}).describe("Creative style overrides. Every field optional - unset inherits defaults.");
|
|
40
|
-
export function registerGenerateSlideshowTool(server) {
|
|
41
|
-
server.registerTool("clipform_generate_slideshow", {
|
|
42
|
-
title: "Generate Slideshow",
|
|
43
|
-
description: `**Deprecated: prefer clipform_generate_video** which supports both images and video clips.
|
|
44
|
-
|
|
45
|
-
Generate a slideshow video from images and audio. Creates a 9:16 (720x1280) video with smooth pan/zoom effects (Ken Burns style), eased motion, and crossfade transitions, synced to the audio duration. Uploaded to storage; returns a public URL.
|
|
46
|
-
|
|
47
|
-
You are the director. Every stylistic choice below is yours - defaults exist for convenience but override anything that fits your creative vision.
|
|
48
|
-
|
|
49
|
-
## Workflow
|
|
50
|
-
|
|
51
|
-
1. Source images (use clipform_search_media with kind: "image"). Prefer portrait sources for 9:16 output; landscape works too via blur-pad fallback.
|
|
52
|
-
2. Produce narration audio (clipform_generate_tts).
|
|
53
|
-
3. Call this tool with images + audio_url + your creative direction.
|
|
54
|
-
4. Attach the returned public URL to a question via clipform_upload_media with media_type "video".
|
|
55
|
-
|
|
56
|
-
## Image framing (per-image)
|
|
57
|
-
|
|
58
|
-
- **aspect_ratio** (width/height): pass through from the image source so the composition can auto-pick framing. Landscape images with no aspect_ratio will cover-crop and may pixelate.
|
|
59
|
-
- **fit**: 'cover' (fill frame, crop), 'blur-pad' (sharp contained foreground + blurred cover background for landscape sources), 'auto' (default: cover for portrait, blur-pad for landscape > 1.1:1).
|
|
60
|
-
- **style**: per-image creative overrides (see Style Knobs below).
|
|
61
|
-
|
|
62
|
-
## Effects
|
|
63
|
-
|
|
64
|
-
zoom-in, zoom-out, pan-left, pan-right, pan-up, pan-down, zoom-in-pan-left, zoom-in-pan-right, random, static. Set 'random' or pass random_effects: true to shuffle per image.
|
|
65
|
-
|
|
66
|
-
## Transitions
|
|
67
|
-
|
|
68
|
-
fade (default), slide, wipe. Legacy names (fadeblack, slideleft, etc.) also work. duration is in seconds.
|
|
69
|
-
|
|
70
|
-
## Style presets (fastest path)
|
|
71
|
-
|
|
72
|
-
Pick one as a starting point via \`style.preset\` (per-image) or \`default_style.preset\` (global). Override individual knobs on top.
|
|
73
|
-
|
|
74
|
-
- **cinematic** - the default feel. Smooth ease-in-out, zoom 1.0→1.3, subtle pan, subtle vignette.
|
|
75
|
-
- **dramatic** - zoom 1.0→1.4, ease-out, wider pan (0.07), strong vignette. Good for big-reveal content, competitions, climactic moments.
|
|
76
|
-
- **calm** - zoom 1.0→1.08, linear easing, no vignette. Reflective topics, wellness, educational explainers.
|
|
77
|
-
- **documentary** - near-static (zoom 1.0→1.05, tiny pan, no vignette). Talking-heads-style context shots, historical photos.
|
|
78
|
-
- **dreamy** - heavy blur-pad (blurPx 60, brightness 0.75), soft vignette. Aspirational, romantic, nostalgic.
|
|
79
|
-
- **moody** - desaturated blur-pad (brightness 0.35, saturate 0.7), strong vignette, dark wrapper color. Crime, mystery, somber topics.
|
|
80
|
-
|
|
81
|
-
Per-image preset wins over default_style preset. Per-field overrides (zoom, pan, etc.) merge on top of whichever preset is active.
|
|
82
|
-
|
|
83
|
-
## Style Knobs (per-image via images[i].style, or global via default_style)
|
|
84
|
-
|
|
85
|
-
- **zoom**: { from, to } - push-in/pull-out range. Cinematic default 1.0→1.3. Drop to 1.0→1.05 for near-static; push to 1.0→1.4 for dramatic.
|
|
86
|
-
- **pan**: { range, scale } - drift magnitude. 0.03 subtle, 0.05 default, 0.08+ sweeping.
|
|
87
|
-
- **easing**: 'ease-in-out' (default, cinematic) | 'ease-in' (accelerate) | 'ease-out' (decelerate, good for reveals) | 'linear' (mechanical).
|
|
88
|
-
- **blurPad**: { blurPx, brightness, saturate, overscale, foregroundScale } - only applies when blur-pad fit is active. Heavier blurPx (60) + lower brightness (0.35) for moody; foregroundScale: 1.2 to reduce letterbox at the cost of mild crop.
|
|
89
|
-
- **vignette**: false to disable, or { opacity, innerRadiusPercent }. Stronger vignette (opacity 0.6) for dramatic focus; disable for bright, flat looks.
|
|
90
|
-
- **backgroundColor**: hex color shown behind the image frame (default '#000').
|
|
91
|
-
- **autoBlurPadThreshold**: when fit='auto', images wider than this ratio get blur-pad. Default 1.1.
|
|
92
|
-
|
|
93
|
-
## Global options
|
|
94
|
-
|
|
95
|
-
- **default_style**: style applied to every image unless the image overrides per-field. Per-image style merges over default_style at the field level.
|
|
96
|
-
- **background_color**: viewport wrapper color, visible during cross-fades.
|
|
97
|
-
- **random_effects**: shuffles effects across images when true.
|
|
98
|
-
|
|
99
|
-
## Creative guidance
|
|
100
|
-
|
|
101
|
-
- For the same 5-image quiz slideshow, vary the effects (one zoom-in on the opener, pan-left on a cityscape, zoom-out on the closer) rather than random_effects: true, unless you want the dice-roll.
|
|
102
|
-
- Quiet/reflective topics: slow easing ('linear'), tight zoom (1.0→1.08), no vignette.
|
|
103
|
-
- Energetic topics: punchy zoom (1.0→1.35), ease-out, wider pan.
|
|
104
|
-
- Mixed orientation sets: rely on fit: 'auto' + pass aspect_ratio per image. The composition will cover-crop portraits and blur-pad landscapes without more work.`,
|
|
105
|
-
inputSchema: {
|
|
106
|
-
images: z.array(z.object({
|
|
107
|
-
url: z.string().url().describe("Image URL"),
|
|
108
|
-
effect: z.string().optional().describe("Ken Burns effect name (see description). Pass 'random' to shuffle this image only."),
|
|
109
|
-
aspect_ratio: z.number().positive().optional().describe("Source image width / height. Enables auto blur-pad for landscape images in the 9:16 viewport."),
|
|
110
|
-
fit: z.enum(["cover", "blur-pad", "auto"]).optional().describe("Framing mode. 'auto' (default) picks cover for portrait, blur-pad for landscape."),
|
|
111
|
-
style: slideshowStyleSchema.optional(),
|
|
112
|
-
})).min(1).max(20).describe("Images for the slideshow (1-20)"),
|
|
113
|
-
audio_url: z.string().url().describe("URL of the audio track (mp3/wav). Slideshow duration matches audio duration."),
|
|
114
|
-
random_effects: z.boolean().optional().default(true).describe("Shuffle effects across all images (default: true). Set false when specifying effects explicitly per-image."),
|
|
115
|
-
transition: z.object({
|
|
116
|
-
type: z.string().optional().default("fade").describe("Transition type: fade (default), slide, wipe."),
|
|
117
|
-
duration: z.number().optional().default(1).describe("Transition duration in seconds (default: 1)."),
|
|
118
|
-
}).optional().describe("Transition between images."),
|
|
119
|
-
default_style: slideshowStyleSchema.optional().describe("Style applied to every image unless overridden per-image."),
|
|
120
|
-
background_color: z.string().optional().describe("Viewport background color behind all images (default '#000')."),
|
|
121
|
-
},
|
|
122
|
-
annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true },
|
|
123
|
-
}, async ({ images, audio_url, random_effects, transition, default_style, background_color }) => {
|
|
124
|
-
const workspace_id = process.env.MCP_WORKSPACE_ID;
|
|
125
|
-
const job = createJob("clipform_generate_slideshow");
|
|
126
|
-
callInternalApi("/internal/slideshow", {
|
|
127
|
-
body: {
|
|
128
|
-
images,
|
|
129
|
-
audio_url,
|
|
130
|
-
random_effects: random_effects ?? true,
|
|
131
|
-
transition: transition ?? { type: "fade", duration: 1 },
|
|
132
|
-
default_style,
|
|
133
|
-
background_color,
|
|
134
|
-
workspace_id,
|
|
135
|
-
},
|
|
136
|
-
}).then((result) => {
|
|
137
|
-
if (!result.ok) {
|
|
138
|
-
failJob(job.id, result.error);
|
|
139
|
-
}
|
|
140
|
-
else {
|
|
141
|
-
completeJob(job.id, result.data);
|
|
142
|
-
}
|
|
143
|
-
}).catch((err) => {
|
|
144
|
-
failJob(job.id, err instanceof Error ? err.message : String(err));
|
|
145
|
-
});
|
|
146
|
-
return textResult([
|
|
147
|
-
`Slideshow render started (${images.length} image${images.length > 1 ? "s" : ""}).`,
|
|
148
|
-
``,
|
|
149
|
-
`Job ID: ${job.id}`,
|
|
150
|
-
``,
|
|
151
|
-
`Renders typically take ${RENDER_TIMING.expectedRange}. Use clipform_check_render with this job ID to check status.`,
|
|
152
|
-
].join("\n"));
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
//# sourceMappingURL=generate-slideshow.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generate-slideshow.js","sourceRoot":"","sources":["../../src/tools/generate-slideshow.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAe,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAChF,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEvF,uFAAuF;AACvF,gFAAgF;AAChF,2DAA2D;AAC3D,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,gZAAgZ,CAAC;IACzf,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC;QACb,I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AAC,CAAC;QACpE,CAAC,CAAC,CAAC;QAEH,OAAO,UAAU,CACf;YACE,6BAA6B,MAAM,CAAC,MAAM,SAAS,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI;YACnF,EAAE;YACF,WAAW,GAAG,CAAC,EAAE,EAAE;YACnB,EAAE;YACF,0BAA0B,aAAa,CAAC,aAAa,+DAA+D;SACrH,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { callInternalApi, errorResult, textResult } from "../lib/api-client.js";
|
|
3
|
-
const TtsItemSchema = z.object({
|
|
4
|
-
text: z.string().min(1).max(5000).describe("Narration text"),
|
|
5
|
-
voice: z
|
|
6
|
-
.enum(["ryan", "sonia", "andrew", "ava", "guy"])
|
|
7
|
-
.optional()
|
|
8
|
-
.default("ryan")
|
|
9
|
-
.describe("TTS voice (default: ryan)"),
|
|
10
|
-
});
|
|
11
|
-
export function registerGenerateTtsTool(server) {
|
|
12
|
-
server.registerTool("clipform_generate_tts", {
|
|
13
|
-
title: "Generate Text-to-Speech",
|
|
14
|
-
description: `Generate narration audio from text using Edge TTS (free) with ElevenLabs fallback. Pass one item or many (max 10) - multiple items run in parallel.
|
|
15
|
-
|
|
16
|
-
Workflow:
|
|
17
|
-
1. Generate TTS audio with this tool
|
|
18
|
-
2. Search for images with clipform_search_media (kind: "image")
|
|
19
|
-
3. Create a slideshow with clipform_generate_slideshow (pass the audio URL + image URLs)
|
|
20
|
-
4. Attach the video to a node with clipform_upload_node_media
|
|
21
|
-
|
|
22
|
-
Available voices: ryan (British male, default), sonia (British female), andrew (American male), ava (American female), guy (American male casual).
|
|
23
|
-
|
|
24
|
-
Returns audio URL and word-level captions per item.`,
|
|
25
|
-
inputSchema: {
|
|
26
|
-
items: z
|
|
27
|
-
.array(TtsItemSchema)
|
|
28
|
-
.min(1)
|
|
29
|
-
.max(10)
|
|
30
|
-
.describe("One or more TTS items to generate"),
|
|
31
|
-
},
|
|
32
|
-
annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true },
|
|
33
|
-
}, async ({ items }) => {
|
|
34
|
-
const workspace_id = process.env.MCP_WORKSPACE_ID;
|
|
35
|
-
const results = await Promise.allSettled(items.map((item) => callInternalApi("/internal/tts", {
|
|
36
|
-
body: { text: item.text, voice: item.voice, workspace_id },
|
|
37
|
-
})));
|
|
38
|
-
const lines = [];
|
|
39
|
-
let successCount = 0;
|
|
40
|
-
for (let i = 0; i < results.length; i++) {
|
|
41
|
-
const r = results[i];
|
|
42
|
-
if (items.length > 1)
|
|
43
|
-
lines.push(`--- Item ${i + 1} ---`);
|
|
44
|
-
if (r.status === "fulfilled" && r.value.ok) {
|
|
45
|
-
successCount++;
|
|
46
|
-
const data = r.value.data;
|
|
47
|
-
lines.push(`Voice: ${data.voice}`);
|
|
48
|
-
lines.push(`Audio URL: ${data.audioUrl}`);
|
|
49
|
-
lines.push(`Storage path: ${data.storagePath}`);
|
|
50
|
-
lines.push(`Captions: ${JSON.stringify(data.captions)}`);
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
const error = r.status === "rejected"
|
|
54
|
-
? r.reason?.message || String(r.reason)
|
|
55
|
-
: r.value.error;
|
|
56
|
-
const status = r.status === "fulfilled" ? r.value.status : 0;
|
|
57
|
-
const hint = status === 500 || status === 0
|
|
58
|
-
? " (transient - retrying may help)"
|
|
59
|
-
: "";
|
|
60
|
-
lines.push(`FAILED: ${error}${hint}`);
|
|
61
|
-
}
|
|
62
|
-
lines.push("");
|
|
63
|
-
}
|
|
64
|
-
if (items.length > 1) {
|
|
65
|
-
lines.unshift(`TTS: ${successCount}/${items.length} succeeded\n`);
|
|
66
|
-
}
|
|
67
|
-
lines.push(`IMPORTANT: When uploading the final video with clipform_upload_node_media, pass the COMPLETE Captions JSON above as the "captions" parameter — including the "words" arrays inside each segment. Do NOT strip or simplify the JSON. The viewer needs word-level timing data to display captions.`);
|
|
68
|
-
if (successCount === 0)
|
|
69
|
-
return errorResult(lines.join("\n"));
|
|
70
|
-
return textResult(lines.join("\n"));
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
//# sourceMappingURL=generate-tts.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generate-tts.js","sourceRoot":"","sources":["../../src/tools/generate-tts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEhF,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,gBAAgB,CAAC;IAC5D,KAAK,EAAE,CAAC;SACL,IAAI,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;SAC/C,QAAQ,EAAE;SACV,OAAO,CAAC,MAAM,CAAC;SACf,QAAQ,CAAC,2BAA2B,CAAC;CACzC,CAAC,CAAC;AAEH,MAAM,UAAU,uBAAuB,CAAC,MAAiB;IACvD,MAAM,CAAC,YAAY,CACjB,uBAAuB,EACvB;QACE,KAAK,EAAE,yBAAyB;QAChC,WAAW,EAAE;;;;;;;;;;oDAUiC;QAC9C,WAAW,EAAE;YACX,KAAK,EAAE,CAAC;iBACL,KAAK,CAAC,aAAa,CAAC;iBACpB,GAAG,CAAC,CAAC,CAAC;iBACN,GAAG,CAAC,EAAE,CAAC;iBACP,QAAQ,CAAC,mCAAmC,CAAC;SACjD;QACD,WAAW,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE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{ createJob, completeJob, failJob, RENDER_TIMING } from "../lib/render-jobs.js";
|
|
4
|
-
const slideshowStyleSchema = z.object({
|
|
5
|
-
preset: z.enum(["cinematic", "dramatic", "calm", "documentary", "dreamy", "moody"]).optional(),
|
|
6
|
-
zoom: z.object({ from: z.number().optional(), to: z.number().optional() }).optional(),
|
|
7
|
-
pan: z.object({ range: z.number().optional(), scale: z.number().optional() }).optional(),
|
|
8
|
-
zoomPan: z.object({
|
|
9
|
-
from: z.number().optional(), to: z.number().optional(), rangeFraction: z.number().optional(),
|
|
10
|
-
}).optional(),
|
|
11
|
-
easing: z.enum(["ease-in-out", "ease-in", "ease-out", "linear"]).optional(),
|
|
12
|
-
blurPad: z.object({
|
|
13
|
-
blurPx: z.number().optional(), brightness: z.number().optional(),
|
|
14
|
-
saturate: z.number().optional(), overscale: z.number().optional(),
|
|
15
|
-
foregroundScale: z.number().optional(),
|
|
16
|
-
}).optional(),
|
|
17
|
-
vignette: z.union([
|
|
18
|
-
z.literal(false),
|
|
19
|
-
z.object({ opacity: z.number().optional(), innerRadiusPercent: z.number().optional() }),
|
|
20
|
-
]).optional(),
|
|
21
|
-
backgroundColor: z.string().optional(),
|
|
22
|
-
autoBlurPadThreshold: z.number().optional(),
|
|
23
|
-
});
|
|
24
|
-
export function registerGenerateVideoTool(server) {
|
|
25
|
-
server.registerTool("clipform_generate_video", {
|
|
26
|
-
title: "Generate Video",
|
|
27
|
-
description: `Generate a video from images, video clips, or a mix of both, synced to audio. Creates a 9:16 (720x1280) video with transitions, uploaded to storage. Returns a public URL.
|
|
28
|
-
|
|
29
|
-
## Workflow
|
|
30
|
-
|
|
31
|
-
1. Source media with clipform_search_media (kind: "image" or "video")
|
|
32
|
-
2. Source audio with clipform_generate_tts (narration) or clipform_search_music (background)
|
|
33
|
-
3. Call this tool with items + audio_url
|
|
34
|
-
4. Attach the returned URL to a node via clipform_upload_node_media with media_type "video"
|
|
35
|
-
|
|
36
|
-
## Items
|
|
37
|
-
|
|
38
|
-
Each item is an image or video clip:
|
|
39
|
-
- **type: "image"** - still image with Ken Burns motion (pan/zoom). Supports effect, fit, and style overrides.
|
|
40
|
-
- **type: "video"** - video clip, cover-cropped to fill 9:16 frame. Audio muted by default (set volume: 1 to mix in). Use start_from to trim.
|
|
41
|
-
|
|
42
|
-
## Style presets (image items)
|
|
43
|
-
|
|
44
|
-
Pick one via default_style.preset (all images) or per-image style.preset:
|
|
45
|
-
- **cinematic** (default) - smooth ease-in-out, subtle zoom/pan, subtle vignette
|
|
46
|
-
- **dramatic** - big zoom, wide pan, ease-out, strong vignette. Reveals, climactic moments.
|
|
47
|
-
- **calm** - minimal motion, linear easing, no vignette. Educational, reflective.
|
|
48
|
-
- **documentary** - near-static, tiny pan, no vignette. Historical photos, talking-heads context.
|
|
49
|
-
- **dreamy** - heavy blur-pad, soft vignette. Aspirational, nostalgic.
|
|
50
|
-
- **moody** - desaturated, dark, strong vignette. Mystery, somber.
|
|
51
|
-
|
|
52
|
-
## Effects (image items)
|
|
53
|
-
|
|
54
|
-
zoom-in, zoom-out, pan-left, pan-right, pan-up, pan-down, zoom-in-pan-left, zoom-in-pan-right, random, static.
|
|
55
|
-
Set per-image or use random_effects: true to shuffle.
|
|
56
|
-
|
|
57
|
-
## Transitions
|
|
58
|
-
|
|
59
|
-
fade (default), slide, wipe, none. Duration in seconds.
|
|
60
|
-
|
|
61
|
-
## Duration
|
|
62
|
-
|
|
63
|
-
Matches audio when audio_url is provided. Use duration_seconds for videos without audio.`,
|
|
64
|
-
inputSchema: {
|
|
65
|
-
items: z.array(z.object({
|
|
66
|
-
type: z.enum(["image", "video"]).describe("'image' for still images with Ken Burns effects, 'video' for video clips"),
|
|
67
|
-
url: z.string().url().describe("Media URL"),
|
|
68
|
-
effect: z.string().optional().describe("Ken Burns effect (image only): zoom-in, zoom-out, pan-left, pan-right, pan-up, pan-down, zoom-in-pan-left, zoom-in-pan-right, random, static"),
|
|
69
|
-
aspect_ratio: z.number().positive().optional().describe("Image width/height ratio (image only). Enables auto blur-pad for landscape images."),
|
|
70
|
-
fit: z.enum(["cover", "blur-pad", "auto"]).optional().describe("Framing mode (image only). auto = cover for portrait, blur-pad for landscape."),
|
|
71
|
-
style: slideshowStyleSchema.optional().describe("Creative style overrides (image only)"),
|
|
72
|
-
start_from: z.number().min(0).optional().describe("Start time in seconds (video only). Trims the clip."),
|
|
73
|
-
volume: z.number().min(0).max(1).optional().describe("Clip audio volume 0-1 (video only, default 0 = muted)"),
|
|
74
|
-
})).min(1).max(20).describe("Media items (images, video clips, or a mix)"),
|
|
75
|
-
audio_url: z.string().url().optional().describe("Audio track URL. Video duration matches audio duration."),
|
|
76
|
-
duration_seconds: z.number().positive().optional().describe("Video duration in seconds (required if no audio_url)"),
|
|
77
|
-
random_effects: z.boolean().optional().default(true).describe("Shuffle Ken Burns effects across image items (default: true)"),
|
|
78
|
-
transition: z.object({
|
|
79
|
-
type: z.string().optional().default("fade").describe("Transition: fade (default), slide, wipe, none"),
|
|
80
|
-
duration: z.number().optional().default(1).describe("Transition duration in seconds (default: 1)"),
|
|
81
|
-
}).optional(),
|
|
82
|
-
default_style: slideshowStyleSchema.optional().describe("Style applied to all image items unless overridden per-item"),
|
|
83
|
-
background_color: z.string().optional().describe("Background color (default '#000')"),
|
|
84
|
-
},
|
|
85
|
-
annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true },
|
|
86
|
-
}, async ({ items, audio_url, duration_seconds, random_effects, transition, default_style, background_color }) => {
|
|
87
|
-
const workspace_id = process.env.MCP_WORKSPACE_ID;
|
|
88
|
-
const job = createJob("clipform_generate_video");
|
|
89
|
-
callInternalApi("/internal/generate-video", {
|
|
90
|
-
body: {
|
|
91
|
-
items,
|
|
92
|
-
audio_url,
|
|
93
|
-
duration_seconds,
|
|
94
|
-
random_effects: random_effects ?? true,
|
|
95
|
-
transition: transition ?? { type: "fade", duration: 1 },
|
|
96
|
-
default_style,
|
|
97
|
-
background_color,
|
|
98
|
-
workspace_id,
|
|
99
|
-
},
|
|
100
|
-
}).then((result) => {
|
|
101
|
-
if (!result.ok) {
|
|
102
|
-
failJob(job.id, result.error);
|
|
103
|
-
}
|
|
104
|
-
else {
|
|
105
|
-
completeJob(job.id, result.data);
|
|
106
|
-
}
|
|
107
|
-
}).catch((err) => {
|
|
108
|
-
failJob(job.id, err instanceof Error ? err.message : String(err));
|
|
109
|
-
});
|
|
110
|
-
return textResult([
|
|
111
|
-
`Render started (${items.length} item${items.length > 1 ? "s" : ""}).`,
|
|
112
|
-
``,
|
|
113
|
-
`Job ID: ${job.id}`,
|
|
114
|
-
``,
|
|
115
|
-
`Renders typically take ${RENDER_TIMING.expectedRange}. Use clipform_check_render with this job ID to check status.`,
|
|
116
|
-
].join("\n"));
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
//# sourceMappingURL=generate-video.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generate-video.js","sourceRoot":"","sources":["../../src/tools/generate-video.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAe,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAChF,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEvF,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC9F,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,QAAQ,EAAE;IACrF,GA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DAA+D;SACrH,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
|
package/dist/tools/get-form.d.ts
DELETED
package/dist/tools/get-form.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { callApi, errorResult, textResult } from "../lib/api-client.js";
|
|
3
|
-
import { formatFormState } from "../lib/format-form.js";
|
|
4
|
-
export function registerGetFormTool(server) {
|
|
5
|
-
server.registerTool("clipform_get_form", {
|
|
6
|
-
title: "Get Clipform",
|
|
7
|
-
description: `Retrieve a form's details including all questions in sequential order. Use this to see the current state of a form before making changes.`,
|
|
8
|
-
inputSchema: {
|
|
9
|
-
form_id: z.string().uuid().describe("The form UUID (returned by clipform_create_form, not the short share_id from the URL)"),
|
|
10
|
-
},
|
|
11
|
-
annotations: {
|
|
12
|
-
readOnlyHint: true,
|
|
13
|
-
destructiveHint: false,
|
|
14
|
-
idempotentHint: true,
|
|
15
|
-
openWorldHint: true,
|
|
16
|
-
},
|
|
17
|
-
}, async ({ form_id }) => {
|
|
18
|
-
const result = await callApi(`/forms/${form_id}`);
|
|
19
|
-
if (!result.ok) {
|
|
20
|
-
return errorResult(result.error);
|
|
21
|
-
}
|
|
22
|
-
return textResult(formatFormState(result.data));
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=get-form.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-form.js","sourceRoot":"","sources":["../../src/tools/get-form.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,MAAM,UAAU,mBAAmB,CAAC,MAAiB;IACnD,MAAM,CAAC,YAAY,CACjB,mBAAmB,EACnB;QACE,KAAK,EAAE,cAAc;QACrB,WAAW,EAAE,2IAA2I;QACxJ,WAAW,EAAE;YACX,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,uFAAuF,CAAC;SAC7H;QACD,WAAW,EAAE;YACX,YAAY,EAAE,IAAI;YAClB,eAAe,EAAE,KAAK;YACtB,cAAc,EAAE,IAAI;YACpB,aAAa,EAAE,IAAI;SACpB;KACF,EACD,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QACpB,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,UAAU,OAAO,EAAE,CAAC,CAAC;QAElD,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;YACf,OAAO,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACnC,CAAC;QAED,OAAO,UAAU,CAAC,eAAe,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IAClD,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { callApi, errorResult, textResult } from "../lib/api-client.js";
|
|
3
|
-
export function registerGetNodeMediaTool(server) {
|
|
4
|
-
server.registerTool("clipform_get_node_media", {
|
|
5
|
-
title: "Get Node Media",
|
|
6
|
-
description: `Get the media attached to a node, including processing status. Useful for checking if a video upload has finished processing.`,
|
|
7
|
-
inputSchema: {
|
|
8
|
-
form_id: z.string().uuid().describe("The form UUID (returned by clipform_create_form, not the short share_id from the URL)"),
|
|
9
|
-
node_id: z.string().describe("The node ID"),
|
|
10
|
-
},
|
|
11
|
-
annotations: {
|
|
12
|
-
readOnlyHint: true,
|
|
13
|
-
destructiveHint: false,
|
|
14
|
-
idempotentHint: true,
|
|
15
|
-
openWorldHint: true,
|
|
16
|
-
},
|
|
17
|
-
}, async ({ form_id, node_id }) => {
|
|
18
|
-
const result = await callApi(`/forms/${form_id}/nodes/${node_id}/media`);
|
|
19
|
-
if (!result.ok) {
|
|
20
|
-
return errorResult(result.error);
|
|
21
|
-
}
|
|
22
|
-
const media = result.data.media;
|
|
23
|
-
if (!media) {
|
|
24
|
-
return textResult("No media attached to this node.");
|
|
25
|
-
}
|
|
26
|
-
return textResult(`Media ID: ${media.id}\n` +
|
|
27
|
-
`Type: ${media.media_type}\n` +
|
|
28
|
-
`Status: ${media.status}\n` +
|
|
29
|
-
(media.playback_id ? `Playback ID: ${media.playback_id}\n` : "") +
|
|
30
|
-
(media.storage_path ? `Storage path: ${media.storage_path}\n` : "") +
|
|
31
|
-
(media.duration ? `Duration: ${media.duration}s\n` : "") +
|
|
32
|
-
`Transcription: ${media.transcription_status}`);
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
//# sourceMappingURL=get-node-media.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-node-media.js","sourceRoot":"","sources":["../../src/tools/get-node-media.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAExE,MAAM,UAAU,wBAAwB,CAAC,MAAiB;IACxD,MAAM,CAAC,YAAY,CACjB,yBAAyB,EACzB;QACE,KAAK,EAAE,gBAAgB;QACvB,WAAW,EAAE,+HAA+H;QAC5I,WAAW,EAAE;YACX,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,uFAAuF,CAAC;YAC5H,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,aAAa,CAAC;SAC5C;QACD,WAAW,EAAE;YACX,YAAY,EAAE,IAAI;YAClB,eAAe,EAAE,KAAK;YACtB,cAAc,EAAE,IAAI;YACpB,aAAa,EAAE,IAAI;SACpB;KACF,EACD,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE;QAC7B,MAAM,MAAM,GAAG,MAAM,OAAO,CAC1B,UAAU,OAAO,UAAU,OAAO,QAAQ,CAC3C,CAAC;QAEF,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;YACf,OAAO,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACnC,CAAC;QAED,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,KAAuC,CAAC;QAClE,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,OAAO,UAAU,CAAC,iCAAiC,CAAC,CAAC;QACvD,CAAC;QAED,OAAO,UAAU,CACf,aAAa,KAAK,CAAC,EAAE,IAAI;YACvB,SAAS,KAAK,CAAC,UAAU,IAAI;YAC7B,WAAW,KAAK,CAAC,MAAM,IAAI;YAC3B,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,gBAAgB,KAAK,CAAC,WAAW,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;YAChE,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,iBAAiB,KAAK,CAAC,YAAY,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;YACnE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,aAAa,KAAK,CAAC,QAAQ,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;YACxD,kBAAkB,KAAK,CAAC,oBAAoB,EAAE,CACjD,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { callInternalApi, errorResult, textResult } from "../lib/api-client.js";
|
|
3
|
-
export function registerListAssetsTool(server) {
|
|
4
|
-
server.registerTool("clipform_list_assets", {
|
|
5
|
-
title: "List Assets",
|
|
6
|
-
description: `List available creative assets (sound effects, animations, fonts). Use this to discover what assets are available for use in compositions.`,
|
|
7
|
-
inputSchema: {
|
|
8
|
-
type: z.enum(["sfx", "animation", "font", "all"]).default("all").optional()
|
|
9
|
-
.describe("Asset type to list (default: all)"),
|
|
10
|
-
},
|
|
11
|
-
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
12
|
-
}, async ({ type }) => {
|
|
13
|
-
const result = await callInternalApi("/internal/assets", {
|
|
14
|
-
method: "GET",
|
|
15
|
-
params: { type: type ?? "all" },
|
|
16
|
-
});
|
|
17
|
-
if (!result.ok)
|
|
18
|
-
return errorResult(result.error);
|
|
19
|
-
const data = result.data;
|
|
20
|
-
const lines = [];
|
|
21
|
-
if (data.sfx?.length) {
|
|
22
|
-
lines.push(`## Sound Effects (${data.sfx.length})\n`);
|
|
23
|
-
for (const sfx of data.sfx) {
|
|
24
|
-
lines.push(`- ${sfx.name}: ${sfx.description || sfx.path}`);
|
|
25
|
-
}
|
|
26
|
-
lines.push("");
|
|
27
|
-
}
|
|
28
|
-
if (data.animations?.length) {
|
|
29
|
-
lines.push(`## Animations (${data.animations.length})\n`);
|
|
30
|
-
for (const anim of data.animations) {
|
|
31
|
-
lines.push(`- ${anim.name}: ${anim.description || anim.path}`);
|
|
32
|
-
}
|
|
33
|
-
lines.push("");
|
|
34
|
-
}
|
|
35
|
-
if (data.fonts?.length) {
|
|
36
|
-
lines.push(`## Fonts (${data.fonts.length})\n`);
|
|
37
|
-
for (const font of data.fonts) {
|
|
38
|
-
lines.push(`- ${font.name}: weights ${font.weights?.join(", ") || "default"}`);
|
|
39
|
-
}
|
|
40
|
-
lines.push("");
|
|
41
|
-
}
|
|
42
|
-
return textResult(lines.length ? lines.join("\n") : "No assets found.");
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
//# sourceMappingURL=list-assets.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"list-assets.js","sourceRoot":"","sources":["../../src/tools/list-assets.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe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,CAAC;YACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACjB,CAAC;QAED,IAAI,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,CAAC;YAC5B,KAAK,CAAC,IAAI,CAAC,kBAAkB,IAAI,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,CAAC;YAC1D,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;gBACnC,KAAK,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;YACjE,CAAC;YACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACjB,CAAC;QAED,IAAI,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC;YACvB,KAAK,CAAC,IAAI,CAAC,aAAa,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC;YAChD,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;gBAC9B,KAAK,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,aAAa,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,SAAS,EAAE,CAAC,CAAC;YACjF,CAAC;YACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACjB,CAAC;QAED,OAAO,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC;IAC1E,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { callInternalApi, errorResult, textResult } from "../lib/api-client.js";
|
|
2
|
-
export function registerListCompositionsTool(server) {
|
|
3
|
-
server.registerTool("clipform_list_compositions", {
|
|
4
|
-
title: "List Compositions",
|
|
5
|
-
description: `List all available Remotion compositions and their expected props schemas. Use clipform_render_composition to render them.`,
|
|
6
|
-
inputSchema: {},
|
|
7
|
-
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
8
|
-
}, async () => {
|
|
9
|
-
const result = await callInternalApi("/internal/compositions", {
|
|
10
|
-
method: "GET",
|
|
11
|
-
});
|
|
12
|
-
if (!result.ok) {
|
|
13
|
-
if (result.status === 0 || result.status === 404) {
|
|
14
|
-
return errorResult("Remotion compositions are not available (API server may not be running). Start the API with 'npm run dev --workspace=apps/api'.");
|
|
15
|
-
}
|
|
16
|
-
return errorResult(result.error);
|
|
17
|
-
}
|
|
18
|
-
const compositions = result.data.compositions;
|
|
19
|
-
if (!compositions.length)
|
|
20
|
-
return textResult("No compositions found.");
|
|
21
|
-
const lines = [`Available compositions (${compositions.length}):\n`];
|
|
22
|
-
for (const comp of compositions) {
|
|
23
|
-
lines.push(`## ${comp.id}`);
|
|
24
|
-
lines.push(` Duration: ${comp.durationInFrames} frames @ ${comp.fps}fps (${(comp.durationInFrames / comp.fps).toFixed(1)}s)`);
|
|
25
|
-
lines.push(` Size: ${comp.width}x${comp.height}`);
|
|
26
|
-
if (comp.defaultProps) {
|
|
27
|
-
lines.push(` Default props: ${JSON.stringify(comp.defaultProps, null, 2)}`);
|
|
28
|
-
}
|
|
29
|
-
lines.push("");
|
|
30
|
-
}
|
|
31
|
-
return textResult(lines.join("\n"));
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
//# sourceMappingURL=list-compositions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"list-compositions.js","sourceRoot":"","sources":["../../src/tools/list-compositions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEhF,MAAM,UAAU,4BAA4B,CAAC,MAAiB;IAC5D,MAAM,CAAC,YAAY,CACjB,4BAA4B,EAC5B;QACE,KAAK,EAA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