@clipform/mcp-server 1.41.0 → 1.44.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
  FORM_TYPE_KEYS,
4
4
  callApi,
5
5
  getSessionContext
6
- } from "./chunk-WCC65GB5.js";
6
+ } from "./chunk-5GITXD5V.js";
7
7
 
8
8
  // src/lib/guides.ts
9
9
  var guidesPromise = null;
@@ -136,4 +136,4 @@ export {
136
136
  getGuideUri,
137
137
  registerResources
138
138
  };
139
- //# sourceMappingURL=chunk-EZHJR3UM.js.map
139
+ //# sourceMappingURL=chunk-BRHXMMZH.js.map
@@ -2,7 +2,7 @@ import {
2
2
  WORKFLOW_TYPES,
3
3
  getDiscoveryParams,
4
4
  getSessionContextWithAuth
5
- } from "./chunk-WCC65GB5.js";
5
+ } from "./chunk-5GITXD5V.js";
6
6
  import {
7
7
  __export
8
8
  } from "./chunk-HCZI2UJ5.js";
@@ -4705,4 +4705,4 @@ export {
4705
4705
  getWorkflowText,
4706
4706
  registerPrompts
4707
4707
  };
4708
- //# sourceMappingURL=chunk-UGVXQM5S.js.map
4708
+ //# sourceMappingURL=chunk-YAJTUAON.js.map
@@ -6,7 +6,7 @@ import {
6
6
  getWorkflowText,
7
7
  objectType,
8
8
  registerPrompts
9
- } from "./chunk-UGVXQM5S.js";
9
+ } from "./chunk-YAJTUAON.js";
10
10
  import {
11
11
  GUIDE_TYPES,
12
12
  QUIZ_VARIANTS,
@@ -14,7 +14,7 @@ import {
14
14
  getGuideUri,
15
15
  guideFallbackText,
16
16
  registerResources
17
- } from "./chunk-EZHJR3UM.js";
17
+ } from "./chunk-BRHXMMZH.js";
18
18
  import {
19
19
  BUSINESS,
20
20
  CONTACT_FIELDS,
@@ -34,7 +34,7 @@ import {
34
34
  errorResult,
35
35
  resolveFormType,
36
36
  textResult
37
- } from "./chunk-WCC65GB5.js";
37
+ } from "./chunk-5GITXD5V.js";
38
38
  import {
39
39
  __commonJS,
40
40
  __export,
@@ -17070,22 +17070,7 @@ var NODE_TYPES_DESCRIPTION = (() => {
17070
17070
  }
17071
17071
  return lines.join("\n");
17072
17072
  })();
17073
- var CONFIG_DESCRIPTION = (() => {
17074
- const lines = ["Type-specific configuration. Omit to use defaults. Per-type keys:"];
17075
- for (const type of ACTIVE_NODE_TYPES) {
17076
- const def = NODE_TYPES[type];
17077
- const summary = generateConfigSummary(def.config_schema, type);
17078
- if (summary) {
17079
- let line = ` ${type}: ${summary}`;
17080
- const defaultStr = formatDefaultConfig(def.default_config);
17081
- if (defaultStr) {
17082
- line += `. Defaults: ${defaultStr}`;
17083
- }
17084
- lines.push(line);
17085
- }
17086
- }
17087
- return lines.join("\n");
17088
- })();
17073
+ var CONFIG_FIELD_DESCRIPTION = "Type-specific configuration keyed by node type. Omit to use defaults. Per-type keys, shapes, and defaults are listed in the clipform_create_form description; craft guidance via clipform_get_guide.";
17089
17074
  var STYLE_PRESET_ENUM = external_exports.enum(KEN_BURNS_PRESETS).describe(`Ken Burns style preset: ${KEN_BURNS_PRESETS.join(", ")}`);
17090
17075
  var OptionSchema = external_exports.object({
17091
17076
  content: external_exports.string().describe("Option text"),
@@ -17110,7 +17095,7 @@ var NodeSchema = external_exports.object({
17110
17095
  prompt: external_exports.string().describe("The text shown to the respondent"),
17111
17096
  label: external_exports.string().optional().describe("Short label for the node (used in logic builder). Defaults to the prompt text."),
17112
17097
  required: external_exports.boolean().optional().default(true),
17113
- config: external_exports.record(external_exports.unknown()).optional().describe(CONFIG_DESCRIPTION),
17098
+ config: external_exports.record(external_exports.unknown()).optional().describe(CONFIG_FIELD_DESCRIPTION),
17114
17099
  options: external_exports.array(OptionSchema).optional().describe(OPTIONS_DESCRIPTION)
17115
17100
  });
17116
17101
  function applyNodeDefaults(node) {
@@ -17229,42 +17214,34 @@ Example: A form that asks a question, collects contact info, then finishes:
17229
17214
  }
17230
17215
  }
17231
17216
  }
17217
+ for (const q of nodes) {
17218
+ applyNodeDefaults(q);
17219
+ }
17220
+ const settings = {};
17221
+ if (show_step_counter !== void 0) settings.show_step_counter = show_step_counter;
17222
+ if (disable_back_navigation !== void 0) settings.disable_back_navigation = disable_back_navigation;
17223
+ if (primary_color !== void 0) settings.primary_color = primary_color;
17224
+ if (background_color !== void 0) settings.background_color = background_color;
17232
17225
  const createResult = await callApi("/forms", {
17233
17226
  method: "POST",
17234
- body: { title, workspace_id: workspaceId }
17227
+ body: {
17228
+ title,
17229
+ workspace_id: workspaceId,
17230
+ nodes,
17231
+ ...Object.keys(settings).length > 0 ? { settings } : {}
17232
+ }
17235
17233
  });
17236
17234
  if (!createResult.ok) {
17237
- return errorResult(createResult.error);
17235
+ return errorResult(`Form NOT created (nothing was saved): ${createResult.error}`);
17238
17236
  }
17239
17237
  const { data } = createResult;
17240
17238
  const formId = data.form_id;
17241
17239
  const formUrl = data.form_url ?? void 0;
17242
- const settingsBody = {};
17243
- if (show_step_counter !== void 0) settingsBody.show_step_counter = show_step_counter;
17244
- if (disable_back_navigation !== void 0) settingsBody.disable_back_navigation = disable_back_navigation;
17245
- if (primary_color !== void 0) settingsBody.primary_color = primary_color;
17246
- if (background_color !== void 0) settingsBody.background_color = background_color;
17247
- if (font_family !== void 0) settingsBody.font_family = font_family;
17248
- if (Object.keys(settingsBody).length > 0) {
17240
+ const createdNodes = data.nodes ?? [];
17241
+ if (font_family !== void 0) {
17249
17242
  await callApi(`/forms/${formId}`, {
17250
17243
  method: "PATCH",
17251
- body: settingsBody
17252
- });
17253
- }
17254
- const createdNodes = [];
17255
- for (const q of nodes) {
17256
- applyNodeDefaults(q);
17257
- const addResult = await callApi(`/forms/${formId}/nodes`, {
17258
- method: "POST",
17259
- body: { node: q }
17260
- });
17261
- if (!addResult.ok) {
17262
- return errorResult(`Failed to add node "${q.prompt}": ${addResult.error}`);
17263
- }
17264
- createdNodes.push({
17265
- id: addResult.data.node_id,
17266
- type: q.type,
17267
- prompt: q.prompt
17244
+ body: { font_family }
17268
17245
  });
17269
17246
  }
17270
17247
  if (tags && tags.length > 0) {
@@ -17648,7 +17625,7 @@ var NodeUpdateSchema = external_exports.object({
17648
17625
  label: external_exports.string().optional().describe("Short label for the node (used in logic builder)"),
17649
17626
  type: external_exports.enum(ACTIVE_NODE_TYPES).optional().describe("Change the node type"),
17650
17627
  required: external_exports.boolean().optional().describe("Whether an answer is required"),
17651
- config: external_exports.record(external_exports.unknown()).optional().describe(CONFIG_DESCRIPTION),
17628
+ config: external_exports.record(external_exports.unknown()).optional().describe(CONFIG_FIELD_DESCRIPTION),
17652
17629
  options: external_exports.array(OptionSchema).optional().describe(
17653
17630
  "Replace all options (for choice nodes). Omit to keep existing options."
17654
17631
  )
@@ -18458,6 +18435,14 @@ function summarizeSchema(schema) {
18458
18435
  return "none (renders built-in defaults only - omit inputProps)";
18459
18436
  }
18460
18437
  const required2 = new Set(schema.required ?? []);
18438
+ const keysOf = (prop) => {
18439
+ const props = prop.properties;
18440
+ if (!props) return "object";
18441
+ const req = new Set(prop.required ?? []);
18442
+ const keys = Object.keys(props).map((k) => `${k}${req.has(k) ? "" : "?"}`);
18443
+ const shown = keys.length > 10 ? [...keys.slice(0, 10), `+${keys.length - 10} more`] : keys;
18444
+ return `{${shown.join(", ")}}`;
18445
+ };
18461
18446
  const typeOf = (prop) => {
18462
18447
  if (prop.enum) {
18463
18448
  return prop.enum.length <= 8 ? prop.enum.map((v) => JSON.stringify(v)).join("|") : `enum(${prop.enum.length} values, e.g. ${JSON.stringify(prop.enum[0])})`;
@@ -18465,6 +18450,7 @@ function summarizeSchema(schema) {
18465
18450
  if (prop.anyOf) return prop.anyOf.map(typeOf).join(" | ");
18466
18451
  if (Array.isArray(prop.type)) return prop.type.join("|");
18467
18452
  if (prop.type === "array") return `${typeOf(prop.items ?? {})}[]`;
18453
+ if (prop.type === "object" || prop.properties) return keysOf(prop);
18468
18454
  return prop.type ?? "object";
18469
18455
  };
18470
18456
  const parts = Object.entries(schema.properties).map(
@@ -18675,7 +18661,14 @@ Returns the current status and, when complete, the output URL. Typical render ti
18675
18661
  pruneJobs();
18676
18662
  const job = getJob(job_id);
18677
18663
  if (!job) {
18678
- return errorResult(`No render job found with ID ${job_id}. Jobs expire after 30 minutes.`);
18664
+ return errorResult(
18665
+ [
18666
+ `No render job found with ID ${job_id}. Jobs expire after 30 minutes and are lost if the server restarts - the render itself may still have completed.`,
18667
+ `To recover, re-run the original render call with identical arguments:`,
18668
+ `- clipform_render_composition results are content-cached: a finished render returns its URL immediately without re-rendering.`,
18669
+ `- clipform_generate_video is not cached and will re-render.`
18670
+ ].join("\n")
18671
+ );
18679
18672
  }
18680
18673
  if (job.status === "rendering") {
18681
18674
  const elapsed = Math.round((Date.now() - job.createdAt) / 1e3);
@@ -18952,6 +18945,7 @@ function createServer(options) {
18952
18945
  instructions: [
18953
18946
  "Clipform builds interactive video-style forms. When the brief is clear, build the form directly; when it's vague, ask one or two short questions first.",
18954
18947
  "Prefer rich media: video over images over plain text.",
18948
+ "Before building, derive a register from the topic and audience (e.g. hype, playful, warm, considered, elegant, sombre); if the user states a mood explicitly, that wins. State the register once, then apply it to every rendering choice - narration tone, motion preset, music, pacing. Never mix registers in one form.",
18955
18949
  "At the start of a build, call clipform_get_workflow to load the recipe for the form type, and clipform_get_guide for craft detail.",
18956
18950
  "Every *_id argument is a UUID returned by the tools - not the short share_id from a form URL.",
18957
18951
  "Deleting a form, node, or its media is permanent; those tools ask the user to confirm before running."
@@ -19014,4 +19008,4 @@ export {
19014
19008
  JSONRPCMessageSchema,
19015
19009
  createServer
19016
19010
  };
19017
- //# sourceMappingURL=chunk-CILPQ5ZL.js.map
19011
+ //# sourceMappingURL=chunk-YZMZME25.js.map