@clipform/mcp-server 2.15.2 → 2.15.4

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.
@@ -6,7 +6,7 @@ import {
6
6
  getWorkflowText,
7
7
  objectType,
8
8
  registerPrompts
9
- } from "./chunk-L5JC7PQO.js";
9
+ } from "./chunk-HZ6FDVRW.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-OI2B3SCS.js";
18
+ } from "./chunk-QJFPADOJ.js";
19
19
  import {
20
20
  ACTIVE_NODE_TYPES,
21
21
  CONTACT_FIELDS,
@@ -39,7 +39,7 @@ import {
39
39
  resolveFormType,
40
40
  structuredResult,
41
41
  textResult
42
- } from "./chunk-ZAWP567M.js";
42
+ } from "./chunk-J5ASR5EU.js";
43
43
  import {
44
44
  getMcpAuth,
45
45
  runWithMcpTool
@@ -17119,6 +17119,30 @@ var OPTIONS_DESCRIPTION = (() => {
17119
17119
  }
17120
17120
  return hints.join(" ");
17121
17121
  })();
17122
+ function refineNodeOptions(ctx, type, options, basePath) {
17123
+ const def = NODE_TYPES[type];
17124
+ if (!def?.has_options || !options) return;
17125
+ if (def.max_option_length !== void 0) {
17126
+ const cap = def.max_option_length;
17127
+ options.forEach((option, i) => {
17128
+ const len = option.content?.length ?? 0;
17129
+ if (typeof option.content === "string" && len > cap) {
17130
+ ctx.addIssue({
17131
+ code: external_exports.ZodIssueCode.custom,
17132
+ path: [...basePath, "options", i, "content"],
17133
+ message: `${type} option ${i + 1} is ${len} characters; max is ${cap}. Shorten it, or move detail into the node prompt.`
17134
+ });
17135
+ }
17136
+ });
17137
+ }
17138
+ if (def.max_options !== void 0 && options.length > def.max_options) {
17139
+ ctx.addIssue({
17140
+ code: external_exports.ZodIssueCode.custom,
17141
+ path: [...basePath, "options"],
17142
+ message: `${type} has ${options.length} options; max is ${def.max_options}. Remove extras.`
17143
+ });
17144
+ }
17145
+ }
17122
17146
  var NodeSchema = external_exports.object({
17123
17147
  type: external_exports.enum(ACTIVE_NODE_TYPES2),
17124
17148
  prompt: external_exports.string().describe("The text shown to the respondent"),
@@ -17126,7 +17150,7 @@ var NodeSchema = external_exports.object({
17126
17150
  required: external_exports.boolean().optional().default(true),
17127
17151
  config: external_exports.record(external_exports.unknown()).optional().describe(CONFIG_FIELD_DESCRIPTION),
17128
17152
  options: external_exports.array(OptionSchema).optional().describe(OPTIONS_DESCRIPTION)
17129
- });
17153
+ }).superRefine((node, ctx) => refineNodeOptions(ctx, node.type, node.options, []));
17130
17154
  function applyNodeDefaults(node) {
17131
17155
  const def = NODE_TYPES[node.type];
17132
17156
  if (node.type === "button" && (!node.options || node.options.length === 0)) {
@@ -17308,14 +17332,14 @@ Example: A form that asks a question, collects contact info, then finishes:
17308
17332
  ];
17309
17333
  if (formUrl) {
17310
17334
  lines.push(
17311
- isPreview ? `CLAIM URL (one-time - claim this account to publish): ${formUrl}` : `DASHBOARD URL (sign in to edit and manage): ${formUrl}`
17335
+ isPreview ? `CLAIM URL (one-time - sign up to claim and publish): ${formUrl}` : `DASHBOARD URL (sign in to edit and manage): ${formUrl}`
17312
17336
  );
17313
17337
  }
17314
17338
  const firstUrlLabel = isPreview ? "PREVIEW" : "FORM";
17315
17339
  const secondUrlLabel = isPreview ? "CLAIM" : "DASHBOARD";
17316
17340
  lines.push(
17317
17341
  ``,
17318
- isPreview ? `This form is a preview - claim and publish to start collecting responses.${formUrl ? " Open the CLAIM URL to sign into the account this form already belongs to, then republish" : " Sign in to the account this form already belongs to and republish"} with clipform_update_form (is_live: true). The PREVIEW URL never becomes public on its own.` : `The form is live and accessible at the FORM URL above. Edits and media attached AFTER this point are NOT visible to respondents until you re-send is_live: true via clipform_update_form - republishing is the expected final step of a build, never skip it after attaching media/narration.`,
17342
+ isPreview ? `This form is a preview - claim and publish to start collecting responses.${formUrl ? " Open the CLAIM URL to sign up and claim the account this form already belongs to, then republish" : " Sign up to claim the account this form already belongs to and republish"} with clipform_update_form (is_live: true). The PREVIEW URL never becomes public on its own.` : `The form is live and accessible at the FORM URL above. Edits and media attached AFTER this point are NOT visible to respondents until you re-send is_live: true via clipform_update_form - republishing is the expected final step of a build, never skip it after attaching media/narration.`,
17319
17343
  formUrl ? `The URLs above are exact values; constructed or guessed URLs return 404. Use the ${firstUrlLabel} URL and ${secondUrlLabel} URL as shown.` : `The ${firstUrlLabel} URL above is an exact value; constructed or guessed URLs return 404.`,
17320
17344
  `Pass form_id on follow-up tools (get_form, add_node, attach_node_media, etc.).`
17321
17345
  );
@@ -18403,6 +18427,10 @@ var NodeUpdateSchema = external_exports.object({
18403
18427
  options: external_exports.array(OptionSchema).optional().describe(
18404
18428
  "Replace all options (for choice nodes). Omit to keep existing options."
18405
18429
  )
18430
+ }).superRefine((update, ctx) => {
18431
+ if (update.type && update.options !== void 0) {
18432
+ refineNodeOptions(ctx, update.type, update.options, []);
18433
+ }
18406
18434
  });
18407
18435
  function registerUpdateNodeTool(server) {
18408
18436
  server.registerTool(
@@ -20723,4 +20751,4 @@ export {
20723
20751
  buildInstructions,
20724
20752
  createServer
20725
20753
  };
20726
- //# sourceMappingURL=chunk-IUXD73XS.js.map
20754
+ //# sourceMappingURL=chunk-BLUAOHYW.js.map