@clipform/mcp-server 5.16.0 → 5.16.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.
@@ -31,7 +31,7 @@ import {
31
31
  union,
32
32
  unknown,
33
33
  url
34
- } from "./chunk-H7H5HGZR.js";
34
+ } from "./chunk-44EKWJYD.js";
35
35
  import {
36
36
  GUIDE_TYPES,
37
37
  QUIZ_VARIANTS,
@@ -16120,6 +16120,55 @@ import { readFileSync } from "fs";
16120
16120
  import { dirname, join } from "path";
16121
16121
  import { fileURLToPath } from "url";
16122
16122
 
16123
+ // src/lib/json-schema-compat.ts
16124
+ var ANNOTATIONS = /* @__PURE__ */ new Set([
16125
+ "$schema",
16126
+ "$id",
16127
+ "$comment",
16128
+ "title",
16129
+ "description",
16130
+ "default",
16131
+ "examples",
16132
+ "deprecated",
16133
+ "readOnly",
16134
+ "writeOnly"
16135
+ ]);
16136
+ var SCHEMA_KEYWORDS = ["items", "additionalProperties", "not", "if", "then", "else", "contains", "propertyNames"];
16137
+ var SCHEMA_ARRAY_KEYWORDS = ["anyOf", "oneOf", "allOf", "prefixItems"];
16138
+ var SCHEMA_MAP_KEYWORDS = ["properties", "patternProperties", "$defs", "definitions"];
16139
+ var isObj = (v) => v !== null && typeof v === "object" && !Array.isArray(v);
16140
+ function restoreAnyOfNullable(schema) {
16141
+ return walk(schema);
16142
+ }
16143
+ function walk(node) {
16144
+ if (!isObj(node)) return node;
16145
+ const out = { ...node };
16146
+ for (const k of SCHEMA_KEYWORDS) if (k in out) out[k] = walk(out[k]);
16147
+ for (const k of SCHEMA_ARRAY_KEYWORDS) {
16148
+ if (Array.isArray(out[k])) out[k] = out[k].map(walk);
16149
+ }
16150
+ for (const k of SCHEMA_MAP_KEYWORDS) {
16151
+ const map = out[k];
16152
+ if (isObj(map)) out[k] = Object.fromEntries(Object.entries(map).map(([name, sub]) => [name, walk(sub)]));
16153
+ }
16154
+ const type = out.type;
16155
+ if (!Array.isArray(type) || type.length < 2 || !type.every((t) => typeof t === "string")) return out;
16156
+ const members = type;
16157
+ const nonNull = members.filter((m) => m !== "null");
16158
+ const others = Object.keys(out).filter((k) => k !== "type" && !ANNOTATIONS.has(k));
16159
+ const pureNullable = members.length === 2 && nonNull.length === 1;
16160
+ if (!pureNullable && others.length > 0) return out;
16161
+ const rewritten = {};
16162
+ const branch = {};
16163
+ for (const [k, v] of Object.entries(out)) {
16164
+ if (k === "type") continue;
16165
+ if (ANNOTATIONS.has(k)) rewritten[k] = v;
16166
+ else branch[k] = v;
16167
+ }
16168
+ rewritten.anyOf = members.map((m) => m === nonNull[0] ? { type: m, ...branch } : { type: m });
16169
+ return rewritten;
16170
+ }
16171
+
16123
16172
  // src/lib/job-copy.ts
16124
16173
  var ACTIVE_JOB_LABELS = FORM_TYPES_LIST.filter(
16125
16174
  (t) => t.is_active
@@ -16752,7 +16801,7 @@ Example: A form that asks a question, collects contact info, then finishes:
16752
16801
  }
16753
16802
 
16754
16803
  // ../form-sources/dist/types.js
16755
- var isObj = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
16804
+ var isObj2 = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
16756
16805
  var str = (v) => typeof v === "string" ? v : "";
16757
16806
  var DEFAULT_QUESTION_CAP = 50;
16758
16807
  var MAX_OPTIONS = 10;
@@ -16800,7 +16849,7 @@ function detectVideoAskScript(text) {
16800
16849
  function optionText(o) {
16801
16850
  if (typeof o === "string")
16802
16851
  return o;
16803
- if (isObj(o))
16852
+ if (isObj2(o))
16804
16853
  return str(o.label) || str(o.text) || str(o.value) || str(o.title);
16805
16854
  return "";
16806
16855
  }
@@ -16815,11 +16864,11 @@ var videoask = {
16815
16864
  * fields below are copied.
16816
16865
  */
16817
16866
  summarize(id, json, opts) {
16818
- if (!isObj(json) || !Array.isArray(json.questions))
16867
+ if (!isObj2(json) || !Array.isArray(json.questions))
16819
16868
  throw new Error("not a VideoAsk form payload");
16820
16869
  const transcriptCap = opts?.transcriptCap;
16821
16870
  const questions = json.questions.slice(0, opts?.questionCap ?? DEFAULT_QUESTION_CAP).map((q) => {
16822
- const o = isObj(q) ? q : {};
16871
+ const o = isObj2(q) ? q : {};
16823
16872
  const transcript = str(o.transcription);
16824
16873
  return {
16825
16874
  label: str(o.label),
@@ -17838,6 +17887,14 @@ function registerGetResultsTool(server) {
17838
17887
  );
17839
17888
  }
17840
17889
 
17890
+ // src/lib/iso-datetime.ts
17891
+ var ISO_DATETIME_OFFSET_PATTERN = "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$";
17892
+ function isoDatetimeOffset() {
17893
+ return external_exports.string().regex(new RegExp(ISO_DATETIME_OFFSET_PATTERN), {
17894
+ message: "Invalid ISO 8601 date-time: use Z or an offset like +02:00"
17895
+ }).meta({ format: "date-time" });
17896
+ }
17897
+
17841
17898
  // src/tools/get-responses.ts
17842
17899
  var MAX_ANSWER_LENGTH = 300;
17843
17900
  var DEFAULT_LIMIT = 20;
@@ -17875,8 +17932,8 @@ function registerGetResponsesTool(server, opts = {}) {
17875
17932
  description: `List a Clipform form's individual responses (submissions) with time filtering - complements clipform_get_results (aggregates). Answers questions like 'what came in during the last 24 hours', 'what's the longest answer', 'what did people say'. Text answers plus a non-PII payment summary (amount and status); ${REDACTED_LABELS} answers and audio/video recordings are redacted to placeholders and the customer's payment details stay in the dashboard (the responses URL from clipform_get_form). Responses are sorted newest first unless sort: 'oldest'. Needs a signed-in Clipform account (an anonymous session is asked to sign in).`,
17876
17933
  inputSchema: external_exports.object({
17877
17934
  form_id: external_exports.string().describe("Form UUID (from clipform_list_forms / clipform_create_form)"),
17878
- since: external_exports.string().datetime({ offset: true }).optional().describe("Only responses submitted at or after this ISO 8601 time (e.g. '2026-08-29T00:00:00Z')"),
17879
- until: external_exports.string().datetime({ offset: true }).optional().describe("Only responses submitted at or before this ISO 8601 time"),
17935
+ since: isoDatetimeOffset().optional().describe("Only responses submitted at or after this ISO 8601 time (e.g. '2026-08-29T00:00:00Z')"),
17936
+ until: isoDatetimeOffset().optional().describe("Only responses submitted at or before this ISO 8601 time"),
17880
17937
  query: external_exports.string().optional().describe("Only responses whose text answers contain this string (case-insensitive)"),
17881
17938
  sort: external_exports.enum(["newest", "oldest"]).optional().describe("Order by submission time. Default: newest"),
17882
17939
  limit: external_exports.number().int().min(1).max(MAX_LIMIT).optional().describe(`Max responses to return (default ${DEFAULT_LIMIT}, max ${MAX_LIMIT})`)
@@ -20771,8 +20828,8 @@ function pinDraft07(schema) {
20771
20828
  value: {
20772
20829
  ...std,
20773
20830
  jsonSchema: {
20774
- input: (opts) => std.jsonSchema.input({ ...opts, target: "draft-07" }),
20775
- output: (opts) => std.jsonSchema.output({ ...opts, target: "draft-07" })
20831
+ input: (opts) => restoreAnyOfNullable(std.jsonSchema.input({ ...opts, target: "draft-07" })),
20832
+ output: (opts) => restoreAnyOfNullable(std.jsonSchema.output({ ...opts, target: "draft-07" }))
20776
20833
  }
20777
20834
  }
20778
20835
  }
@@ -20937,4 +20994,4 @@ export {
20937
20994
  * MIT Licensed
20938
20995
  *)
20939
20996
  */
20940
- //# sourceMappingURL=chunk-U5XDD74J.js.map
20997
+ //# sourceMappingURL=chunk-UNBHNTXB.js.map