@clipform/mcp-server 5.3.0 → 5.4.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.
@@ -2,7 +2,7 @@ import {
2
2
  CURRENT_PLAN_VERSIONS,
3
3
  PLAN_LIMITS,
4
4
  callApi
5
- } from "./chunk-5D3UEINC.js";
5
+ } from "./chunk-42DEGWIU.js";
6
6
  import {
7
7
  getMcpAuth
8
8
  } from "./chunk-ENVV65JX.js";
@@ -145,4 +145,4 @@ export {
145
145
  getSessionContextWithAuth,
146
146
  getSessionContext
147
147
  };
148
- //# sourceMappingURL=chunk-SH53TD4L.js.map
148
+ //# sourceMappingURL=chunk-6HTNG4QA.js.map
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  FULL_CAPS,
3
3
  getSessionContext
4
- } from "./chunk-SH53TD4L.js";
4
+ } from "./chunk-6HTNG4QA.js";
5
5
  import {
6
6
  ALL_VARIANTS,
7
7
  FORM_TYPES,
8
8
  FORM_TYPE_KEYS,
9
9
  callApi
10
- } from "./chunk-5D3UEINC.js";
10
+ } from "./chunk-42DEGWIU.js";
11
11
  import {
12
12
  getMcpAuth
13
13
  } from "./chunk-ENVV65JX.js";
@@ -146,4 +146,4 @@ export {
146
146
  getGuideUri,
147
147
  registerResources
148
148
  };
149
- //# sourceMappingURL=chunk-4KXP67SR.js.map
149
+ //# sourceMappingURL=chunk-C2NKMZ4Q.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  FULL_CAPS,
3
3
  getSessionContextWithAuth
4
- } from "./chunk-SH53TD4L.js";
4
+ } from "./chunk-6HTNG4QA.js";
5
5
  import {
6
6
  FORM_TYPES,
7
7
  MAX_CLIP_SECONDS,
@@ -10,7 +10,7 @@ import {
10
10
  WORKFLOW_TYPES,
11
11
  exposedCompositionIds,
12
12
  getDiscoveryParams
13
- } from "./chunk-5D3UEINC.js";
13
+ } from "./chunk-42DEGWIU.js";
14
14
  import {
15
15
  __export
16
16
  } from "./chunk-PZ5AY32C.js";
@@ -15259,4 +15259,4 @@ export {
15259
15259
  getWorkflowText,
15260
15260
  registerPrompts
15261
15261
  };
15262
- //# sourceMappingURL=chunk-NXNCAGMO.js.map
15262
+ //# sourceMappingURL=chunk-M6AWVKPK.js.map
@@ -31,7 +31,7 @@ import {
31
31
  union,
32
32
  unknown,
33
33
  url
34
- } from "./chunk-NXNCAGMO.js";
34
+ } from "./chunk-M6AWVKPK.js";
35
35
  import {
36
36
  GUIDE_TYPES,
37
37
  QUIZ_VARIANTS,
@@ -40,7 +40,7 @@ import {
40
40
  getGuideUri,
41
41
  guideFallbackText,
42
42
  registerResources
43
- } from "./chunk-4KXP67SR.js";
43
+ } from "./chunk-C2NKMZ4Q.js";
44
44
  import {
45
45
  ANON_PREVIEW_LINK_LABEL,
46
46
  ANON_PREVIEW_NOTICE,
@@ -54,7 +54,7 @@ import {
54
54
  isPreviewViewerUrl,
55
55
  previewOnlyNotice,
56
56
  withAdoptedNotice
57
- } from "./chunk-SH53TD4L.js";
57
+ } from "./chunk-6HTNG4QA.js";
58
58
  import {
59
59
  ACTIVE_NODE_TYPES,
60
60
  ANON_MCP_BLOCKED_NODE_TYPES,
@@ -84,11 +84,12 @@ import {
84
84
  isAnonymousAccountRequired,
85
85
  lettersCapError,
86
86
  normalizeContactFields,
87
+ recallDisplayText,
87
88
  resolveFormType,
88
89
  stripGatedConfigKeys,
89
90
  structuredResult,
90
91
  textResult
91
- } from "./chunk-5D3UEINC.js";
92
+ } from "./chunk-42DEGWIU.js";
92
93
  import {
93
94
  getMcpAuth,
94
95
  runWithMcpAuth,
@@ -17770,8 +17771,11 @@ function registerGetResponsesTool(server) {
17770
17771
  return errorResult(`Could not fetch responses: ${subsResult.error}`);
17771
17772
  }
17772
17773
  const nodeById = /* @__PURE__ */ new Map();
17774
+ let nodeList = [];
17773
17775
  if (formResult.ok) {
17774
- const nodes = formResult.data?.nodes ?? [];
17776
+ const data = formResult.data;
17777
+ const nodes = data?.node ?? data?.nodes ?? [];
17778
+ nodeList = nodes;
17775
17779
  for (const n of nodes) nodeById.set(n.id, n);
17776
17780
  }
17777
17781
  const rows = subsResult.data ?? [];
@@ -17794,7 +17798,7 @@ function registerGetResponsesTool(server) {
17794
17798
  for (const [nodeId, resp] of Object.entries(row.node_responses ?? {})) {
17795
17799
  const node = nodeById.get(nodeId);
17796
17800
  const type = node?.type ?? (typeof resp?.type === "string" ? resp.type : "unknown");
17797
- const question = truncate(node?.prompt || type, 120);
17801
+ const question = truncate(recallDisplayText(node?.prompt || type, { variables: [], nodes: nodeList }), 120);
17798
17802
  if (type === "payment") {
17799
17803
  const summary = paymentSummary(resp?.value);
17800
17804
  answers.push({
@@ -18002,7 +18006,7 @@ function registerAddNodeTool(server) {
18002
18006
 
18003
18007
  // src/tools/update-node.ts
18004
18008
  var UpdateOptionSchema = OptionSchema.extend({
18005
- id: external_exports.string().uuid().optional().describe("The option's id from clipform_get_form. Include it to keep this option with its routes, answer key and results; omit it to add a new option.")
18009
+ id: external_exports.string().uuid().optional().describe("The option's id from clipform_get_form. Include it to keep this option with its routes, answer key and results; omit it to add a new option (if no option in the list has an id, options are matched to the existing ones instead).")
18006
18010
  });
18007
18011
  var NodeUpdateSchema = external_exports.object({
18008
18012
  node_id: external_exports.string().describe("The node ID to update"),
@@ -18014,7 +18018,7 @@ var NodeUpdateSchema = external_exports.object({
18014
18018
  `${CONFIG_FIELD_DESCRIPTION} Merged shallowly into the stored config - only the keys you pass are changed. Set a key to null to delete it; nested objects are replaced wholesale. When type is changed in the same call, config replaces the stored configuration instead of merging.`
18015
18019
  ),
18016
18020
  options: external_exports.array(UpdateOptionSchema).optional().describe(
18017
- "The full option list (for choice nodes). Include each option's id from clipform_get_form to keep that option and its routes, answer key and results. Options without an id are added as new. Options left out are removed together with their routes. Omit to keep existing options."
18021
+ "The full option list (for choice nodes). Include each option's id from clipform_get_form to keep that option and its routes, answer key and results. Options without an id are added as new, except that if no option has an id, options are matched to the existing ones by text, then by position, so their routes are kept. Options left out are removed together with their routes. Omit to keep existing options."
18018
18022
  )
18019
18023
  }).superRefine((update, ctx) => {
18020
18024
  if (update.type && update.options !== void 0) {
@@ -20517,4 +20521,4 @@ export {
20517
20521
  * MIT Licensed
20518
20522
  *)
20519
20523
  */
20520
- //# sourceMappingURL=chunk-H7MHP72Z.js.map
20524
+ //# sourceMappingURL=chunk-MQTISSLP.js.map