@clipform/mcp-server 2.17.1 → 2.18.0

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.
@@ -3,7 +3,7 @@ import {
3
3
  WORKFLOW_TYPES,
4
4
  getDiscoveryParams,
5
5
  getSessionContextWithAuth
6
- } from "./chunk-FIUAXSVQ.js";
6
+ } from "./chunk-RKYB6247.js";
7
7
  import {
8
8
  __export
9
9
  } from "./chunk-G3PMV62Z.js";
@@ -4856,4 +4856,4 @@ export {
4856
4856
  getWorkflowText,
4857
4857
  registerPrompts
4858
4858
  };
4859
- //# sourceMappingURL=chunk-2EPNC4AY.js.map
4859
+ //# sourceMappingURL=chunk-WWIQEIFF.js.map
@@ -6,7 +6,7 @@ import {
6
6
  getWorkflowText,
7
7
  objectType,
8
8
  registerPrompts
9
- } from "./chunk-2EPNC4AY.js";
9
+ } from "./chunk-WWIQEIFF.js";
10
10
  import {
11
11
  GUIDE_TYPES,
12
12
  QUIZ_VARIANTS,
@@ -15,7 +15,7 @@ import {
15
15
  getGuideUri,
16
16
  guideFallbackText,
17
17
  registerResources
18
- } from "./chunk-5TQU2XJ7.js";
18
+ } from "./chunk-CHSPV2VI.js";
19
19
  import {
20
20
  ACTIVE_NODE_TYPES,
21
21
  CONTACT_FIELDS,
@@ -43,7 +43,7 @@ import {
43
43
  resolveFormType,
44
44
  structuredResult,
45
45
  textResult
46
- } from "./chunk-FIUAXSVQ.js";
46
+ } from "./chunk-RKYB6247.js";
47
47
  import {
48
48
  getMcpAuth,
49
49
  runWithMcpTool
@@ -19498,6 +19498,10 @@ function pruneJobs() {
19498
19498
  }
19499
19499
 
19500
19500
  // src/lib/auto-attach.ts
19501
+ function resolveCaptionRef(explicit, audioUrl) {
19502
+ if (explicit) return explicit;
19503
+ return typeof audioUrl === "string" && audioUrl ? audioUrl : void 0;
19504
+ }
19501
19505
  async function createRenderPlaceholder(input) {
19502
19506
  try {
19503
19507
  const me = await callApi("/me", { method: "GET" });
@@ -20044,13 +20048,14 @@ ${RENDER_ATTACH_RULE}`,
20044
20048
  node_id: external_exports.string().optional().describe("Form node to attach this render to automatically once it completes - skips the manual clipform_upload_media_asset + clipform_attach_node_media steps and republishes the form if it's currently live. Requires form_id."),
20045
20049
  form_id: external_exports.string().uuid().optional().describe("The form UUID (required when node_id is set)."),
20046
20050
  captions: external_exports.array(CaptionSchema).optional().describe("Word-level captions from clipform_generate_tts - carried onto the attached media asset. Only used when node_id is set."),
20047
- caption_ref: external_exports.string().optional().describe("caption_ref from clipform_generate_tts - an opaque handle that attaches that TTS run's word-level captions to the media asset, resolved server-side. Preferred over captions. Only used when node_id is set.")
20051
+ caption_ref: external_exports.string().optional().describe("caption_ref from clipform_generate_tts - an opaque handle that attaches that TTS run's word-level captions to the media asset, resolved server-side. Preferred over captions. Only used when node_id is set. Defaults to controls.audio_url when that is a clipform_generate_tts track (slideshow narration), so narrated montages keep their captions.")
20048
20052
  },
20049
20053
  outputSchema: {
20050
20054
  status: external_exports.enum(["rendering", "complete"]),
20051
20055
  job_id: external_exports.string().optional().describe("Present when status is 'rendering' - pass to clipform_check_render"),
20052
20056
  public_url: external_exports.string().optional().describe("Present when status is 'complete' - attach via upload_media_asset then attach_node_media (fit_media: true), unless node_id was set (auto-attached)"),
20053
20057
  template: external_exports.string().optional(),
20058
+ duration_seconds: external_exports.number().optional().describe("Final video length in seconds - the narration's real length when audio_url drove it."),
20054
20059
  output_format: external_exports.string().optional(),
20055
20060
  attached: external_exports.boolean().optional().describe("True when node_id was provided and the render was attached to the node automatically (present once the attach outcome is known)."),
20056
20061
  media_asset_id: external_exports.string().optional().describe("The workspace media asset created from this render, when attached."),
@@ -20067,6 +20072,7 @@ ${RENDER_ATTACH_RULE}`,
20067
20072
  if (node_id && !form_id) {
20068
20073
  return errorResult("form_id is required when node_id is set.");
20069
20074
  }
20075
+ const captionRef = resolveCaptionRef(caption_ref, controls?.audio_url);
20070
20076
  const renderBody = { template, controls: controls ?? {}, outputFormat };
20071
20077
  const mediaType = outputFormat === "png" ? "still" : "video";
20072
20078
  if (wait === false) {
@@ -20087,7 +20093,7 @@ ${RENDER_ATTACH_RULE}`,
20087
20093
  const publicUrl = r.data.public_url;
20088
20094
  const placeholder = await placeholderPromise2;
20089
20095
  if (publicUrl) {
20090
- attach2 = await autoAttachRender({ formId: form_id, nodeId: node_id, publicUrl, mediaType, captions, captionRef: caption_ref, placeholder });
20096
+ attach2 = await autoAttachRender({ formId: form_id, nodeId: node_id, publicUrl, mediaType, captions, captionRef, placeholder });
20091
20097
  } else {
20092
20098
  const message = "Render completed without a public_url; nothing to attach.";
20093
20099
  attach2 = { attached: false, error: message };
@@ -20125,7 +20131,7 @@ ${RENDER_ATTACH_RULE}`,
20125
20131
  if (node_id && form_id) {
20126
20132
  const placeholder = await placeholderPromise;
20127
20133
  if (data.public_url) {
20128
- attach = await autoAttachRender({ formId: form_id, nodeId: node_id, publicUrl: data.public_url, mediaType, captions, captionRef: caption_ref, placeholder });
20134
+ attach = await autoAttachRender({ formId: form_id, nodeId: node_id, publicUrl: data.public_url, mediaType, captions, captionRef, placeholder });
20129
20135
  } else if (placeholder) {
20130
20136
  await failPlaceholder(placeholder, "Render completed without a public_url; nothing to attach.");
20131
20137
  }
@@ -20133,11 +20139,13 @@ ${RENDER_ATTACH_RULE}`,
20133
20139
  return structuredResult(
20134
20140
  [
20135
20141
  `Render complete. Public URL: ${data.public_url}`,
20142
+ typeof data.duration_seconds === "number" ? `Duration: ${data.duration_seconds}s` : "",
20136
20143
  attach ? attachSummaryLine(node_id, attach) : `Attach via clipform_upload_media_asset then clipform_attach_node_media with fit_media: true (composed 9:16 frame - contain, never crop).`
20137
- ].join("\n"),
20144
+ ].filter(Boolean).join("\n"),
20138
20145
  {
20139
20146
  status: "complete",
20140
20147
  ...data.public_url ? { public_url: data.public_url } : {},
20148
+ ...typeof data.duration_seconds === "number" ? { duration_seconds: data.duration_seconds } : {},
20141
20149
  template,
20142
20150
  output_format: outputFormat,
20143
20151
  ...attachStructuredFields(attach)
@@ -20281,7 +20289,6 @@ ${RENDER_ATTACH_RULE}`,
20281
20289
  if (node_id && !form_id) {
20282
20290
  return errorResult("form_id is required when node_id is set.");
20283
20291
  }
20284
- const workspace_id = getMcpAuth()?.workspace_id;
20285
20292
  const default_style = style_preset || texture || duotone ? {
20286
20293
  ...style_preset ? { preset: style_preset } : {},
20287
20294
  ...texture ? { texture } : {},
@@ -20305,8 +20312,7 @@ ${RENDER_ATTACH_RULE}`,
20305
20312
  random_effects: random_effects ?? true,
20306
20313
  transition,
20307
20314
  default_style,
20308
- background_color,
20309
- workspace_id
20315
+ background_color
20310
20316
  }
20311
20317
  });
20312
20318
  if (wait === false) {
@@ -20324,7 +20330,7 @@ ${RENDER_ATTACH_RULE}`,
20324
20330
  const publicUrl = r.data.public_url;
20325
20331
  const placeholder = await placeholderPromise2;
20326
20332
  if (publicUrl) {
20327
- attach2 = await autoAttachRender({ formId: form_id, nodeId: node_id, publicUrl, mediaType: "video", captions, captionRef: audio_url, placeholder });
20333
+ attach2 = await autoAttachRender({ formId: form_id, nodeId: node_id, publicUrl, mediaType: "video", captions, captionRef: resolveCaptionRef(void 0, audio_url), placeholder });
20328
20334
  } else {
20329
20335
  const message = "Render completed without a public_url; nothing to attach.";
20330
20336
  attach2 = { attached: false, error: message };
@@ -20359,7 +20365,7 @@ ${RENDER_ATTACH_RULE}`,
20359
20365
  if (node_id && form_id) {
20360
20366
  const placeholder = await placeholderPromise;
20361
20367
  if (data.public_url) {
20362
- attach = await autoAttachRender({ formId: form_id, nodeId: node_id, publicUrl: data.public_url, mediaType: "video", captions, captionRef: audio_url, placeholder });
20368
+ attach = await autoAttachRender({ formId: form_id, nodeId: node_id, publicUrl: data.public_url, mediaType: "video", captions, captionRef: resolveCaptionRef(void 0, audio_url), placeholder });
20363
20369
  } else if (placeholder) {
20364
20370
  await failPlaceholder(placeholder, "Render completed without a public_url; nothing to attach.");
20365
20371
  }
@@ -20864,4 +20870,4 @@ export {
20864
20870
  buildInstructions,
20865
20871
  createServer
20866
20872
  };
20867
- //# sourceMappingURL=chunk-HBKYE4JQ.js.map
20873
+ //# sourceMappingURL=chunk-Y4RGN6KA.js.map