@clipform/mcp-server 1.24.0 → 1.24.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.
@@ -6,14 +6,14 @@ import {
6
6
  getWorkflowText,
7
7
  objectType,
8
8
  registerPrompts
9
- } from "./chunk-ZVBCKXPT.js";
9
+ } from "./chunk-P46TFJ3P.js";
10
10
  import {
11
11
  GUIDE_TYPES,
12
12
  QUIZ_VARIANTS,
13
13
  getGuideContent,
14
14
  getGuideUri,
15
15
  registerResources
16
- } from "./chunk-2AQPZWXG.js";
16
+ } from "./chunk-U4BWWHDU.js";
17
17
  import {
18
18
  BUSINESS,
19
19
  CONTACT_FIELDS,
@@ -29,7 +29,7 @@ import {
29
29
  errorResult,
30
30
  resolveFormType,
31
31
  textResult
32
- } from "./chunk-ZFJGTESI.js";
32
+ } from "./chunk-HIINYZLX.js";
33
33
  import {
34
34
  __commonJS,
35
35
  __export,
@@ -3114,6 +3114,9 @@ var require_utils = __commonJS({
3114
3114
  "use strict";
3115
3115
  var isUUID = RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu);
3116
3116
  var isIPv4 = RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);
3117
+ var isHexPair = RegExp.prototype.test.bind(/^[\da-f]{2}$/iu);
3118
+ var isUnreserved = RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu);
3119
+ var isPathCharacter = RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);
3117
3120
  function stringArrayToHexStripped(input) {
3118
3121
  let acc = "";
3119
3122
  let code = 0;
@@ -3306,27 +3309,77 @@ var require_utils = __commonJS({
3306
3309
  }
3307
3310
  return output.join("");
3308
3311
  }
3309
- function normalizeComponentEncoding(component, esc2) {
3310
- const func = esc2 !== true ? escape : unescape;
3311
- if (component.scheme !== void 0) {
3312
- component.scheme = func(component.scheme);
3313
- }
3314
- if (component.userinfo !== void 0) {
3315
- component.userinfo = func(component.userinfo);
3316
- }
3317
- if (component.host !== void 0) {
3318
- component.host = func(component.host);
3312
+ var HOST_DELIMS = { "@": "%40", "/": "%2F", "?": "%3F", "#": "%23", ":": "%3A" };
3313
+ var HOST_DELIM_RE = /[@/?#:]/g;
3314
+ var HOST_DELIM_NO_COLON_RE = /[@/?#]/g;
3315
+ function reescapeHostDelimiters(host, isIP) {
3316
+ const re = isIP ? HOST_DELIM_NO_COLON_RE : HOST_DELIM_RE;
3317
+ re.lastIndex = 0;
3318
+ return host.replace(re, (ch) => HOST_DELIMS[ch]);
3319
+ }
3320
+ function normalizePercentEncoding(input, decodeUnreserved = false) {
3321
+ if (input.indexOf("%") === -1) {
3322
+ return input;
3319
3323
  }
3320
- if (component.path !== void 0) {
3321
- component.path = func(component.path);
3324
+ let output = "";
3325
+ for (let i = 0; i < input.length; i++) {
3326
+ if (input[i] === "%" && i + 2 < input.length) {
3327
+ const hex = input.slice(i + 1, i + 3);
3328
+ if (isHexPair(hex)) {
3329
+ const normalizedHex = hex.toUpperCase();
3330
+ const decoded = String.fromCharCode(parseInt(normalizedHex, 16));
3331
+ if (decodeUnreserved && isUnreserved(decoded)) {
3332
+ output += decoded;
3333
+ } else {
3334
+ output += "%" + normalizedHex;
3335
+ }
3336
+ i += 2;
3337
+ continue;
3338
+ }
3339
+ }
3340
+ output += input[i];
3322
3341
  }
3323
- if (component.query !== void 0) {
3324
- component.query = func(component.query);
3342
+ return output;
3343
+ }
3344
+ function normalizePathEncoding(input) {
3345
+ let output = "";
3346
+ for (let i = 0; i < input.length; i++) {
3347
+ if (input[i] === "%" && i + 2 < input.length) {
3348
+ const hex = input.slice(i + 1, i + 3);
3349
+ if (isHexPair(hex)) {
3350
+ const normalizedHex = hex.toUpperCase();
3351
+ const decoded = String.fromCharCode(parseInt(normalizedHex, 16));
3352
+ if (decoded !== "." && isUnreserved(decoded)) {
3353
+ output += decoded;
3354
+ } else {
3355
+ output += "%" + normalizedHex;
3356
+ }
3357
+ i += 2;
3358
+ continue;
3359
+ }
3360
+ }
3361
+ if (isPathCharacter(input[i])) {
3362
+ output += input[i];
3363
+ } else {
3364
+ output += escape(input[i]);
3365
+ }
3325
3366
  }
3326
- if (component.fragment !== void 0) {
3327
- component.fragment = func(component.fragment);
3367
+ return output;
3368
+ }
3369
+ function escapePreservingEscapes(input) {
3370
+ let output = "";
3371
+ for (let i = 0; i < input.length; i++) {
3372
+ if (input[i] === "%" && i + 2 < input.length) {
3373
+ const hex = input.slice(i + 1, i + 3);
3374
+ if (isHexPair(hex)) {
3375
+ output += "%" + hex.toUpperCase();
3376
+ i += 2;
3377
+ continue;
3378
+ }
3379
+ }
3380
+ output += escape(input[i]);
3328
3381
  }
3329
- return component;
3382
+ return output;
3330
3383
  }
3331
3384
  function recomposeAuthority(component) {
3332
3385
  const uriTokens = [];
@@ -3341,7 +3394,7 @@ var require_utils = __commonJS({
3341
3394
  if (ipV6res.isIPV6 === true) {
3342
3395
  host = `[${ipV6res.escapedHost}]`;
3343
3396
  } else {
3344
- host = component.host;
3397
+ host = reescapeHostDelimiters(host, false);
3345
3398
  }
3346
3399
  }
3347
3400
  uriTokens.push(host);
@@ -3355,7 +3408,10 @@ var require_utils = __commonJS({
3355
3408
  module.exports = {
3356
3409
  nonSimpleDomain,
3357
3410
  recomposeAuthority,
3358
- normalizeComponentEncoding,
3411
+ reescapeHostDelimiters,
3412
+ normalizePercentEncoding,
3413
+ normalizePathEncoding,
3414
+ escapePreservingEscapes,
3359
3415
  removeDotSegments,
3360
3416
  isIPv4,
3361
3417
  isUUID,
@@ -3579,12 +3635,12 @@ var require_schemes = __commonJS({
3579
3635
  var require_fast_uri = __commonJS({
3580
3636
  "../../node_modules/fast-uri/index.js"(exports, module) {
3581
3637
  "use strict";
3582
- var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizeComponentEncoding, isIPv4, nonSimpleDomain } = require_utils();
3638
+ var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, escapePreservingEscapes, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require_utils();
3583
3639
  var { SCHEMES, getSchemeHandler } = require_schemes();
3584
3640
  function normalize(uri, options) {
3585
3641
  if (typeof uri === "string") {
3586
3642
  uri = /** @type {T} */
3587
- serialize(parse3(uri, options), options);
3643
+ normalizeString(uri, options);
3588
3644
  } else if (typeof uri === "object") {
3589
3645
  uri = /** @type {T} */
3590
3646
  parse3(serialize(uri, options), options);
@@ -3651,19 +3707,9 @@ var require_fast_uri = __commonJS({
3651
3707
  return target;
3652
3708
  }
3653
3709
  function equal(uriA, uriB, options) {
3654
- if (typeof uriA === "string") {
3655
- uriA = unescape(uriA);
3656
- uriA = serialize(normalizeComponentEncoding(parse3(uriA, options), true), { ...options, skipEscape: true });
3657
- } else if (typeof uriA === "object") {
3658
- uriA = serialize(normalizeComponentEncoding(uriA, true), { ...options, skipEscape: true });
3659
- }
3660
- if (typeof uriB === "string") {
3661
- uriB = unescape(uriB);
3662
- uriB = serialize(normalizeComponentEncoding(parse3(uriB, options), true), { ...options, skipEscape: true });
3663
- } else if (typeof uriB === "object") {
3664
- uriB = serialize(normalizeComponentEncoding(uriB, true), { ...options, skipEscape: true });
3665
- }
3666
- return uriA.toLowerCase() === uriB.toLowerCase();
3710
+ const normalizedA = normalizeComparableURI(uriA, options);
3711
+ const normalizedB = normalizeComparableURI(uriB, options);
3712
+ return normalizedA !== void 0 && normalizedB !== void 0 && normalizedA.toLowerCase() === normalizedB.toLowerCase();
3667
3713
  }
3668
3714
  function serialize(cmpts, opts) {
3669
3715
  const component = {
@@ -3688,12 +3734,12 @@ var require_fast_uri = __commonJS({
3688
3734
  if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(component, options);
3689
3735
  if (component.path !== void 0) {
3690
3736
  if (!options.skipEscape) {
3691
- component.path = escape(component.path);
3737
+ component.path = escapePreservingEscapes(component.path);
3692
3738
  if (component.scheme !== void 0) {
3693
3739
  component.path = component.path.split("%3A").join(":");
3694
3740
  }
3695
3741
  } else {
3696
- component.path = unescape(component.path);
3742
+ component.path = normalizePercentEncoding(component.path);
3697
3743
  }
3698
3744
  }
3699
3745
  if (options.reference !== "suffix" && component.scheme) {
@@ -3728,7 +3774,16 @@ var require_fast_uri = __commonJS({
3728
3774
  return uriTokens.join("");
3729
3775
  }
3730
3776
  var URI_PARSE = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;
3731
- function parse3(uri, opts) {
3777
+ function getParseError(parsed, matches) {
3778
+ if (matches[2] !== void 0 && parsed.path && parsed.path[0] !== "/") {
3779
+ return 'URI path must start with "/" when authority is present.';
3780
+ }
3781
+ if (typeof parsed.port === "number" && (parsed.port < 0 || parsed.port > 65535)) {
3782
+ return "URI port is malformed.";
3783
+ }
3784
+ return void 0;
3785
+ }
3786
+ function parseWithStatus(uri, opts) {
3732
3787
  const options = Object.assign({}, opts);
3733
3788
  const parsed = {
3734
3789
  scheme: void 0,
@@ -3739,6 +3794,7 @@ var require_fast_uri = __commonJS({
3739
3794
  query: void 0,
3740
3795
  fragment: void 0
3741
3796
  };
3797
+ let malformedAuthorityOrPort = false;
3742
3798
  let isIP = false;
3743
3799
  if (options.reference === "suffix") {
3744
3800
  if (options.scheme) {
@@ -3759,6 +3815,11 @@ var require_fast_uri = __commonJS({
3759
3815
  if (isNaN(parsed.port)) {
3760
3816
  parsed.port = matches[5];
3761
3817
  }
3818
+ const parseError = getParseError(parsed, matches);
3819
+ if (parseError !== void 0) {
3820
+ parsed.error = parsed.error || parseError;
3821
+ malformedAuthorityOrPort = true;
3822
+ }
3762
3823
  if (parsed.host) {
3763
3824
  const ipv4result = isIPv4(parsed.host);
3764
3825
  if (ipv4result === false) {
@@ -3797,14 +3858,18 @@ var require_fast_uri = __commonJS({
3797
3858
  parsed.scheme = unescape(parsed.scheme);
3798
3859
  }
3799
3860
  if (parsed.host !== void 0) {
3800
- parsed.host = unescape(parsed.host);
3861
+ parsed.host = reescapeHostDelimiters(unescape(parsed.host), isIP);
3801
3862
  }
3802
3863
  }
3803
3864
  if (parsed.path) {
3804
- parsed.path = escape(unescape(parsed.path));
3865
+ parsed.path = normalizePathEncoding(parsed.path);
3805
3866
  }
3806
3867
  if (parsed.fragment) {
3807
- parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment));
3868
+ try {
3869
+ parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment));
3870
+ } catch {
3871
+ parsed.error = parsed.error || "URI malformed";
3872
+ }
3808
3873
  }
3809
3874
  }
3810
3875
  if (schemeHandler && schemeHandler.parse) {
@@ -3813,7 +3878,29 @@ var require_fast_uri = __commonJS({
3813
3878
  } else {
3814
3879
  parsed.error = parsed.error || "URI can not be parsed.";
3815
3880
  }
3816
- return parsed;
3881
+ return { parsed, malformedAuthorityOrPort };
3882
+ }
3883
+ function parse3(uri, opts) {
3884
+ return parseWithStatus(uri, opts).parsed;
3885
+ }
3886
+ function normalizeString(uri, opts) {
3887
+ return normalizeStringWithStatus(uri, opts).normalized;
3888
+ }
3889
+ function normalizeStringWithStatus(uri, opts) {
3890
+ const { parsed, malformedAuthorityOrPort } = parseWithStatus(uri, opts);
3891
+ return {
3892
+ normalized: malformedAuthorityOrPort ? uri : serialize(parsed, opts),
3893
+ malformedAuthorityOrPort
3894
+ };
3895
+ }
3896
+ function normalizeComparableURI(uri, opts) {
3897
+ if (typeof uri === "string") {
3898
+ const { normalized, malformedAuthorityOrPort } = normalizeStringWithStatus(uri, opts);
3899
+ return malformedAuthorityOrPort ? void 0 : normalized;
3900
+ }
3901
+ if (typeof uri === "object") {
3902
+ return serialize(uri, opts);
3903
+ }
3817
3904
  }
3818
3905
  var fastUri = {
3819
3906
  SCHEMES,
@@ -17312,6 +17399,9 @@ function registerUpdateFormTool(server) {
17312
17399
  description: external_exports.string().nullable().optional().describe("SEO description (meta description, og:description). Set null to clear."),
17313
17400
  author: external_exports.string().nullable().optional().describe("AI-PROTECTED: Only set when the user explicitly provides an author name. Set null to clear."),
17314
17401
  logo_url: external_exports.string().nullable().optional().describe("AI-PROTECTED: Only set when the user explicitly provides a logo URL. Set null to clear."),
17402
+ embed_autoplay: external_exports.boolean().optional().describe("Auto-play video when embed loads. Default false."),
17403
+ show_branding: external_exports.boolean().optional().describe("Show Clipform branding. Set false to remove (Pro plan)."),
17404
+ brand_name: external_exports.string().nullable().optional().describe("AI-PROTECTED: Custom brand name shown in footer. Only set when user explicitly provides."),
17315
17405
  tags: external_exports.array(external_exports.string()).optional().describe("Replace all tags on this form. Pass the full desired set (e.g. ['quiz', 'trivia', 'slug:elephants']). Omit to leave tags unchanged.")
17316
17406
  },
17317
17407
  annotations: {
@@ -17321,7 +17411,7 @@ function registerUpdateFormTool(server) {
17321
17411
  openWorldHint: true
17322
17412
  }
17323
17413
  },
17324
- async ({ form_id, title, is_live, show_step_counter, disable_back_navigation, total_steps, primary_color, background_color, font_family, description, author, logo_url, tags }) => {
17414
+ async ({ form_id, title, is_live, show_step_counter, disable_back_navigation, total_steps, primary_color, background_color, font_family, description, author, logo_url, embed_autoplay, show_branding, brand_name, tags }) => {
17325
17415
  const body = {};
17326
17416
  if (title !== void 0) body.title = title;
17327
17417
  if (is_live !== void 0) body.is_live = is_live;
@@ -17334,6 +17424,9 @@ function registerUpdateFormTool(server) {
17334
17424
  if (description !== void 0) body.description = description;
17335
17425
  if (author !== void 0) body.author = author;
17336
17426
  if (logo_url !== void 0) body.logo_url = logo_url;
17427
+ if (embed_autoplay !== void 0 && FEATURES.embed_autoplay.enabled) body.embed_autoplay = embed_autoplay;
17428
+ if (show_branding !== void 0) body.show_branding = show_branding;
17429
+ if (brand_name !== void 0) body.brand_name = brand_name;
17337
17430
  if (Object.keys(body).length > 0) {
17338
17431
  const result = await callApi(`/forms/${form_id}`, {
17339
17432
  method: "PATCH",
@@ -17374,6 +17467,12 @@ function registerUpdateFormTool(server) {
17374
17467
  updates.push(`Author \u2192 ${author === null ? "cleared" : `"${author}"`}`);
17375
17468
  if (logo_url !== void 0)
17376
17469
  updates.push(`Logo URL \u2192 ${logo_url === null ? "cleared" : logo_url}`);
17470
+ if (embed_autoplay !== void 0)
17471
+ updates.push(`Embed autoplay \u2192 ${embed_autoplay}`);
17472
+ if (show_branding !== void 0)
17473
+ updates.push(`Show branding \u2192 ${show_branding}`);
17474
+ if (brand_name !== void 0)
17475
+ updates.push(`Brand name \u2192 ${brand_name === null ? "cleared" : `"${brand_name}"`}`);
17377
17476
  if (tags)
17378
17477
  updates.push(`Tags \u2192 [${tags.join(", ")}]`);
17379
17478
  return textResult(`Form updated: ${updates.join(", ")}`);
@@ -18612,4 +18711,4 @@ export {
18612
18711
  JSONRPCMessageSchema,
18613
18712
  createServer
18614
18713
  };
18615
- //# sourceMappingURL=chunk-Q4LHGVFQ.js.map
18714
+ //# sourceMappingURL=chunk-GDPSZSHN.js.map