@clipform/mcp-server 4.2.7 → 4.3.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.
@@ -142,6 +142,15 @@ var FEATURES = {
142
142
  status: "planned",
143
143
  category: "builder"
144
144
  },
145
+ // Built in #5148 (PR #5155), shipped dark. When off: no builder switch, viewer ignores
146
+ // stored allow_skip, MCP hiding tracked in #5150.
147
+ optional_questions: {
148
+ name: "Optional questions",
149
+ description: "Builders can mark a draw or camera question optional so respondents can skip it",
150
+ enabled: false,
151
+ status: "planned",
152
+ category: "builder"
153
+ },
145
154
  draw_target_shape: {
146
155
  name: "Draw target shape",
147
156
  description: "Score a drawing against a builder-drawn target outline (match-to-shape game)",
@@ -1652,6 +1661,7 @@ var NODE_TYPES = {
1652
1661
  // overlay share the same coordinate frame without re-deriving it.
1653
1662
  game: {
1654
1663
  type: "object",
1664
+ feature: "draw_target_shape",
1655
1665
  label: "Match-to-shape game",
1656
1666
  description: "Optional target shape the drawing is scored against on submit",
1657
1667
  properties: {
@@ -1691,6 +1701,12 @@ var NODE_TYPES = {
1691
1701
  description: "Score bands shown in the reveal, ascending by min_score - defaults to a 5-band Scribble to Perfect scale"
1692
1702
  }
1693
1703
  }
1704
+ },
1705
+ allow_skip: {
1706
+ type: "boolean",
1707
+ default: false,
1708
+ label: "Optional",
1709
+ description: "Respondents can skip this question without drawing"
1694
1710
  }
1695
1711
  }
1696
1712
  },
@@ -1853,6 +1869,12 @@ var NODE_TYPES = {
1853
1869
  label: "Minimum media items",
1854
1870
  shortLabel: "Min",
1855
1871
  description: "Fewest photos or videos a respondent must add before continuing"
1872
+ },
1873
+ allow_skip: {
1874
+ type: "boolean",
1875
+ default: false,
1876
+ label: "Optional",
1877
+ description: "Respondents can skip this question without adding a photo or video"
1856
1878
  }
1857
1879
  }
1858
1880
  },
@@ -2533,6 +2555,29 @@ for (const [type, def] of Object.entries(NODE_TYPES)) {
2533
2555
  }
2534
2556
  def.is_active = feature.enabled;
2535
2557
  }
2558
+ function validateFeatureMarkers(nodeTypes, features) {
2559
+ for (const [type, def] of Object.entries(nodeTypes)) {
2560
+ for (const [key, prop] of Object.entries(def.config_schema?.properties ?? {})) {
2561
+ if (prop.feature !== void 0 && !features[prop.feature]) {
2562
+ throw new Error(`NODE_TYPES.${type}.config_schema.${key}: feature "${prop.feature}" is not in FEATURES`);
2563
+ }
2564
+ }
2565
+ }
2566
+ }
2567
+ validateFeatureMarkers(NODE_TYPES, FEATURES);
2568
+ function gatedConfigKeys(type) {
2569
+ const props = NODE_TYPES[type]?.config_schema?.properties ?? {};
2570
+ return new Set(
2571
+ Object.entries(props).filter(([, prop]) => prop.feature !== void 0 && !FEATURES[prop.feature]?.enabled).map(([key]) => key)
2572
+ );
2573
+ }
2574
+ function stripGatedConfigKeys(type, config) {
2575
+ if (!config || typeof config !== "object") return { config, dropped: [] };
2576
+ const gated = gatedConfigKeys(type);
2577
+ const dropped = Object.keys(config).filter((k) => gated.has(k));
2578
+ if (dropped.length === 0) return { config, dropped };
2579
+ return { config: Object.fromEntries(Object.entries(config).filter(([k]) => !gated.has(k))), dropped };
2580
+ }
2536
2581
  var NODE_TYPES_LIST = Object.entries(NODE_TYPES).map(([type, def]) => ({ type, ...def })).sort((a, b) => a.sort_order - b.sort_order);
2537
2582
  var ACTIVE_NODE_TYPES = Object.entries(NODE_TYPES).filter(([, def]) => def.is_active && !def.is_system).map(([type]) => type);
2538
2583
  var NODE_TYPE_KEYS = Object.keys(NODE_TYPES);
@@ -3449,6 +3494,8 @@ function structuredResult(text, structuredContent) {
3449
3494
  export {
3450
3495
  FEATURE_FLAGS,
3451
3496
  NODE_TYPES,
3497
+ gatedConfigKeys,
3498
+ stripGatedConfigKeys,
3452
3499
  ACTIVE_NODE_TYPES,
3453
3500
  NON_COUNTABLE_TYPES,
3454
3501
  FORM_TYPES,
@@ -3476,4 +3523,4 @@ export {
3476
3523
  textResult,
3477
3524
  structuredResult
3478
3525
  };
3479
- //# sourceMappingURL=chunk-UMO47NOJ.js.map
3526
+ //# sourceMappingURL=chunk-AEU5YBXM.js.map