@clipform/mcp-server 4.10.2 → 4.10.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.
- package/dist/api-client.js +1 -1
- package/dist/{chunk-62DVPH4I.js → chunk-7YMFQZB3.js} +45 -13
- package/dist/chunk-7YMFQZB3.js.map +1 -0
- package/dist/{chunk-E456QCTV.js → chunk-B537GXNT.js} +13 -10
- package/dist/chunk-B537GXNT.js.map +1 -0
- package/dist/{chunk-36WRDNVW.js → chunk-BXLWHTT4.js} +3 -3
- package/dist/{chunk-NBHDZORG.js → chunk-CB6GJKIE.js} +2 -2
- package/dist/{chunk-57ZVZROW.js → chunk-FMGNRBCL.js} +5 -5
- package/dist/{chunk-57ZVZROW.js.map → chunk-FMGNRBCL.js.map} +1 -1
- package/dist/index.js +5 -5
- package/dist/prompts.js +3 -3
- package/dist/resources.js +3 -3
- package/dist/server.js +5 -5
- package/package.json +1 -1
- package/server.json +2 -2
- package/dist/chunk-62DVPH4I.js.map +0 -1
- package/dist/chunk-E456QCTV.js.map +0 -1
- /package/dist/{chunk-36WRDNVW.js.map → chunk-BXLWHTT4.js.map} +0 -0
- /package/dist/{chunk-NBHDZORG.js.map → chunk-CB6GJKIE.js.map} +0 -0
package/dist/api-client.js
CHANGED
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
union,
|
|
30
30
|
unknown,
|
|
31
31
|
url
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-FMGNRBCL.js";
|
|
33
33
|
import {
|
|
34
34
|
GUIDE_TYPES,
|
|
35
35
|
QUIZ_VARIANTS,
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
getGuideUri,
|
|
39
39
|
guideFallbackText,
|
|
40
40
|
registerResources
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-BXLWHTT4.js";
|
|
42
42
|
import {
|
|
43
43
|
ANON_PREVIEW_LINK_LABEL,
|
|
44
44
|
ANON_PREVIEW_NOTICE,
|
|
@@ -52,7 +52,7 @@ import {
|
|
|
52
52
|
isPreviewViewerUrl,
|
|
53
53
|
previewOnlyNotice,
|
|
54
54
|
withAdoptedNotice
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-CB6GJKIE.js";
|
|
56
56
|
import {
|
|
57
57
|
ACTIVE_NODE_TYPES,
|
|
58
58
|
ANON_MCP_BLOCKED_NODE_TYPES,
|
|
@@ -81,7 +81,7 @@ import {
|
|
|
81
81
|
stripGatedConfigKeys,
|
|
82
82
|
structuredResult,
|
|
83
83
|
textResult
|
|
84
|
-
} from "./chunk-
|
|
84
|
+
} from "./chunk-B537GXNT.js";
|
|
85
85
|
import {
|
|
86
86
|
getMcpAuth,
|
|
87
87
|
runWithMcpAuth,
|
|
@@ -16295,7 +16295,7 @@ function gatedConfigKeysOnEveryType() {
|
|
|
16295
16295
|
function ignoredConfigNote(keys) {
|
|
16296
16296
|
return `Ignored unsupported config key(s): ${keys.join(", ")}.`;
|
|
16297
16297
|
}
|
|
16298
|
-
function applyNodeDefaults(node) {
|
|
16298
|
+
function applyNodeDefaults(node, rng2 = Math.random) {
|
|
16299
16299
|
const def = NODE_TYPES[node.type];
|
|
16300
16300
|
if (node.type === "button" && (!node.options || node.options.length === 0)) {
|
|
16301
16301
|
const buttonDefault = def?.config_schema?.properties?.button_text?.default || "Continue";
|
|
@@ -16318,6 +16318,21 @@ function applyNodeDefaults(node) {
|
|
|
16318
16318
|
choice.record_scores = true;
|
|
16319
16319
|
if (choice.show_answer_feedback === void 0) choice.show_answer_feedback = true;
|
|
16320
16320
|
}
|
|
16321
|
+
const supportsRandomise = def?.config_schema?.properties?.randomise_options !== void 0;
|
|
16322
|
+
const hasSingleScores = node.options?.some((o) => o.score != null);
|
|
16323
|
+
const hasPersonalityScores = node.options?.some((o) => o.scores != null);
|
|
16324
|
+
const isLetters = node.config?.option_display === "letters";
|
|
16325
|
+
if (supportsRandomise && hasSingleScores && !hasPersonalityScores && !isLetters && node.options) {
|
|
16326
|
+
const config = node.config ??= {};
|
|
16327
|
+
if (config.randomise_options === void 0) config.randomise_options = true;
|
|
16328
|
+
if (config.randomise_options === true) {
|
|
16329
|
+
const opts = node.options;
|
|
16330
|
+
for (let i = opts.length - 1; i > 0; i--) {
|
|
16331
|
+
const j = Math.floor(rng2() * (i + 1));
|
|
16332
|
+
[opts[i], opts[j]] = [opts[j], opts[i]];
|
|
16333
|
+
}
|
|
16334
|
+
}
|
|
16335
|
+
}
|
|
16321
16336
|
}
|
|
16322
16337
|
|
|
16323
16338
|
// src/lib/workspace-target.ts
|
|
@@ -17472,10 +17487,26 @@ function registerDeleteFormTool(server) {
|
|
|
17472
17487
|
);
|
|
17473
17488
|
}
|
|
17474
17489
|
|
|
17490
|
+
// src/lib/results-redaction.ts
|
|
17491
|
+
var META = NODE_TYPES;
|
|
17492
|
+
var COUNTS_ONLY_TYPES = Object.entries(META).filter(([, v]) => v.pii || v.respondent_media === "files" || v.respondent_media === "drawing").map(([t]) => t);
|
|
17493
|
+
var ACTION_BREAKDOWN_TYPES = Object.entries(META).filter(([t, v]) => v.category === "action" && !COUNTS_ONLY_TYPES.includes(t)).map(([t]) => t);
|
|
17494
|
+
var PHRASE_OVERRIDES = { details: "contact details" };
|
|
17495
|
+
function typePhrase(type) {
|
|
17496
|
+
return PHRASE_OVERRIDES[type] ?? META[type].label.toLowerCase();
|
|
17497
|
+
}
|
|
17498
|
+
function labelList(types) {
|
|
17499
|
+
const labels = Object.keys(META).filter((t) => types.includes(t)).map(typePhrase);
|
|
17500
|
+
if (labels.length <= 2) return labels.join(" and ");
|
|
17501
|
+
return `${labels.slice(0, -1).join(", ")}, and ${labels[labels.length - 1]}`;
|
|
17502
|
+
}
|
|
17503
|
+
|
|
17475
17504
|
// src/tools/get-results.ts
|
|
17476
17505
|
var MAX_TEXT_LENGTH = 500;
|
|
17477
17506
|
var MAX_LABEL_LENGTH = 80;
|
|
17478
17507
|
var MAX_RECENT_ANSWERS = 20;
|
|
17508
|
+
var COUNTS_ONLY_LABELS = labelList(COUNTS_ONLY_TYPES);
|
|
17509
|
+
var BREAKDOWN_ACTION_TYPES = ACTION_BREAKDOWN_TYPES.join("/");
|
|
17479
17510
|
function coerceToString(value, maxLength) {
|
|
17480
17511
|
if (value === null || value === void 0) return "";
|
|
17481
17512
|
if (typeof value === "string") {
|
|
@@ -17500,8 +17531,7 @@ function projectNode(node) {
|
|
|
17500
17531
|
total_responses: node.total_responses,
|
|
17501
17532
|
total_views: node.total_views
|
|
17502
17533
|
};
|
|
17503
|
-
|
|
17504
|
-
if (meta && (meta.pii || meta.respondent_media === "files" || meta.respondent_media === "drawing")) {
|
|
17534
|
+
if (COUNTS_ONLY_TYPES.includes(node.node_type)) {
|
|
17505
17535
|
return base;
|
|
17506
17536
|
}
|
|
17507
17537
|
if (node.node_type === "choice") {
|
|
@@ -17546,7 +17576,7 @@ function registerGetResultsTool(server) {
|
|
|
17546
17576
|
"clipform_get_results",
|
|
17547
17577
|
{
|
|
17548
17578
|
title: "Get Clipform Results",
|
|
17549
|
-
description: `View response counts, choice/action answer breakdowns, and recent open-text answers for a form.
|
|
17579
|
+
description: `View response counts, choice/action answer breakdowns, and recent open-text answers for a form. Answers to ${COUNTS_ONLY_LABELS} nodes are counts only - use the dashboard for per-response detail. Needs a signed-in Clipform account (an anonymous session is asked to sign in).`,
|
|
17550
17580
|
inputSchema: external_exports.object({
|
|
17551
17581
|
form_id: external_exports.string().describe("The form UUID (returned by clipform_create_form, not the short share_id from the URL)")
|
|
17552
17582
|
}),
|
|
@@ -17572,7 +17602,7 @@ function registerGetResultsTool(server) {
|
|
|
17572
17602
|
count: external_exports.number(),
|
|
17573
17603
|
percentage: external_exports.number()
|
|
17574
17604
|
})
|
|
17575
|
-
).optional().describe(
|
|
17605
|
+
).optional().describe(`Answer breakdown - choice and action-category (${BREAKDOWN_ACTION_TYPES}) nodes only`),
|
|
17576
17606
|
recent_answers: external_exports.array(
|
|
17577
17607
|
external_exports.object({
|
|
17578
17608
|
text: external_exports.string(),
|
|
@@ -17580,7 +17610,7 @@ function registerGetResultsTool(server) {
|
|
|
17580
17610
|
})
|
|
17581
17611
|
).optional().describe("Most recent open-text answers, capped at 20 - open questions only")
|
|
17582
17612
|
})
|
|
17583
|
-
).describe(
|
|
17613
|
+
).describe(`Nodes in form order. The ${COUNTS_ONLY_LABELS} nodes carry only total_responses/total_views - no per-response detail.`),
|
|
17584
17614
|
results_url: external_exports.string().optional().describe("Dashboard Responses tab for this form. Not present for an anonymous caller.")
|
|
17585
17615
|
}),
|
|
17586
17616
|
annotations: {
|
|
@@ -17635,6 +17665,8 @@ var REDACTED_TYPES = Object.fromEntries([
|
|
|
17635
17665
|
// open is redacted ONLY when the answer is a recording (handled below).
|
|
17636
17666
|
...Object.entries(NODE_TYPES).filter(([, v]) => v.respondent_media === "files" || v.respondent_media === "drawing").map(([t, v]) => [t, `[${v.label.toLowerCase()} - view in dashboard]`])
|
|
17637
17667
|
]);
|
|
17668
|
+
var REDACTED_LABELS = labelList(Object.keys(REDACTED_TYPES));
|
|
17669
|
+
var REDACTION_FOOTER = `Answers to ${REDACTED_LABELS} questions and audio/video recordings are redacted here; payments show an amount/status summary only (the customer's details stay in the dashboard, which shows full response detail). For aggregate stats use clipform_get_results.`;
|
|
17638
17670
|
function truncate(s, n = MAX_ANSWER_LENGTH) {
|
|
17639
17671
|
return s.length > n ? `${s.slice(0, n - 1)}\u2026` : s;
|
|
17640
17672
|
}
|
|
@@ -17655,7 +17687,7 @@ function registerGetResponsesTool(server) {
|
|
|
17655
17687
|
"clipform_get_responses",
|
|
17656
17688
|
{
|
|
17657
17689
|
title: "List form responses",
|
|
17658
|
-
description:
|
|
17690
|
+
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).`,
|
|
17659
17691
|
inputSchema: external_exports.object({
|
|
17660
17692
|
form_id: external_exports.string().describe("Form UUID (from clipform_list_forms / clipform_create_form)"),
|
|
17661
17693
|
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')"),
|
|
@@ -17774,7 +17806,7 @@ function registerGetResponsesTool(server) {
|
|
|
17774
17806
|
...r.answers.map((a) => ` ${a.question}: ${a.answer}`)
|
|
17775
17807
|
]),
|
|
17776
17808
|
``,
|
|
17777
|
-
|
|
17809
|
+
REDACTION_FOOTER
|
|
17778
17810
|
];
|
|
17779
17811
|
return structuredResult(lines.join("\n"), {
|
|
17780
17812
|
total_matching: totalMatching,
|
|
@@ -20395,4 +20427,4 @@ export {
|
|
|
20395
20427
|
* MIT Licensed
|
|
20396
20428
|
*)
|
|
20397
20429
|
*/
|
|
20398
|
-
//# sourceMappingURL=chunk-
|
|
20430
|
+
//# sourceMappingURL=chunk-7YMFQZB3.js.map
|