@clipform/mcp-server 5.16.1 → 5.18.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.
- package/dist/api-client.js +1 -1
- package/dist/{chunk-LYWTKEW6.js → chunk-DOXSGWYD.js} +3 -3
- package/dist/{chunk-44EKWJYD.js → chunk-HIEBNDBW.js} +3 -3
- package/dist/{chunk-WWFCE5WZ.js → chunk-K4NSJZAP.js} +31 -7
- package/dist/chunk-K4NSJZAP.js.map +1 -0
- package/dist/{chunk-GFSORADL.js → chunk-NRYDSMLT.js} +2 -2
- package/dist/{chunk-UNBHNTXB.js → chunk-THJUTILR.js} +82 -13
- package/dist/chunk-THJUTILR.js.map +1 -0
- package/dist/index.js +5 -5
- package/dist/prompts.js +3 -3
- package/dist/resources.js +3 -3
- package/dist/server.d.ts +7 -0
- package/dist/server.js +5 -5
- package/package.json +1 -1
- package/server.json +2 -2
- package/dist/chunk-UNBHNTXB.js.map +0 -1
- package/dist/chunk-WWFCE5WZ.js.map +0 -1
- /package/dist/{chunk-LYWTKEW6.js.map → chunk-DOXSGWYD.js.map} +0 -0
- /package/dist/{chunk-44EKWJYD.js.map → chunk-HIEBNDBW.js.map} +0 -0
- /package/dist/{chunk-GFSORADL.js.map → chunk-NRYDSMLT.js.map} +0 -0
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
CURRENT_PLAN_VERSIONS,
|
|
3
3
|
PLAN_LIMITS,
|
|
4
4
|
callApi
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-K4NSJZAP.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-
|
|
148
|
+
//# sourceMappingURL=chunk-NRYDSMLT.js.map
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
union,
|
|
32
32
|
unknown,
|
|
33
33
|
url
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-HIEBNDBW.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-
|
|
43
|
+
} from "./chunk-DOXSGWYD.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-
|
|
57
|
+
} from "./chunk-NRYDSMLT.js";
|
|
58
58
|
import {
|
|
59
59
|
ACTIVE_NODE_TYPES,
|
|
60
60
|
ANON_MCP_BLOCKED_NODE_TYPES,
|
|
@@ -66,6 +66,9 @@ import {
|
|
|
66
66
|
FEATURE_FLAGS,
|
|
67
67
|
FORM_TYPES_LIST,
|
|
68
68
|
FORM_TYPE_ALIASES,
|
|
69
|
+
GUIDE_CONFIG_KEY,
|
|
70
|
+
GUIDE_LIMITS,
|
|
71
|
+
GUIDE_TOUR_ANCHORS,
|
|
69
72
|
LINK_VARIABLE_PRESETS,
|
|
70
73
|
LOGIC_TARGET_TYPES,
|
|
71
74
|
MAX_CLIP_SECONDS,
|
|
@@ -114,7 +117,7 @@ import {
|
|
|
114
117
|
textResult,
|
|
115
118
|
validateVariableKey,
|
|
116
119
|
viewerUrl
|
|
117
|
-
} from "./chunk-
|
|
120
|
+
} from "./chunk-K4NSJZAP.js";
|
|
118
121
|
import {
|
|
119
122
|
getMcpAuth,
|
|
120
123
|
runWithMcpAuth,
|
|
@@ -17211,11 +17214,15 @@ function allowedConfigKeys(nodeType) {
|
|
|
17211
17214
|
return /* @__PURE__ */ new Set();
|
|
17212
17215
|
}
|
|
17213
17216
|
var HIDDEN_CONFIG_KEYS = /* @__PURE__ */ new Set(["workspace_integration_id"]);
|
|
17214
|
-
function projectConfig(nodeType, config) {
|
|
17217
|
+
function projectConfig(nodeType, config, opts = {}) {
|
|
17215
17218
|
if (!config) return void 0;
|
|
17216
17219
|
const allowed = allowedConfigKeys(nodeType);
|
|
17217
17220
|
const projected = {};
|
|
17218
17221
|
for (const [key, value] of Object.entries(config)) {
|
|
17222
|
+
if (key === GUIDE_CONFIG_KEY && opts.guide === true) {
|
|
17223
|
+
projected[key] = value;
|
|
17224
|
+
continue;
|
|
17225
|
+
}
|
|
17219
17226
|
if (!allowed.has(key) || HIDDEN_CONFIG_KEYS.has(key)) continue;
|
|
17220
17227
|
if (typeof value === "string" && gatedEnumValues(nodeType, key).has(value)) continue;
|
|
17221
17228
|
projected[key] = value;
|
|
@@ -17279,7 +17286,7 @@ function projectAnswerRoutes(node, logicByNode) {
|
|
|
17279
17286
|
return to ? [{ option_id: o.id, option_content: o.content, target_id: to.value, target_type: to.type }] : [];
|
|
17280
17287
|
});
|
|
17281
17288
|
}
|
|
17282
|
-
function projectFormState(data) {
|
|
17289
|
+
function projectFormState(data, opts = {}) {
|
|
17283
17290
|
const { nodes, logicByNode } = orderNodesWithLogic(data);
|
|
17284
17291
|
const urls = projectUrls(data);
|
|
17285
17292
|
return {
|
|
@@ -17290,7 +17297,7 @@ function projectFormState(data) {
|
|
|
17290
17297
|
...urls ? { urls } : {},
|
|
17291
17298
|
nodes: nodes.map((q) => {
|
|
17292
17299
|
const options = q.node_options ?? q.options;
|
|
17293
|
-
const config = projectConfig(q.type, q.config);
|
|
17300
|
+
const config = projectConfig(q.type, q.config, opts);
|
|
17294
17301
|
const next = projectNext(q, logicByNode);
|
|
17295
17302
|
return {
|
|
17296
17303
|
id: q.id,
|
|
@@ -17304,7 +17311,7 @@ function projectFormState(data) {
|
|
|
17304
17311
|
})
|
|
17305
17312
|
};
|
|
17306
17313
|
}
|
|
17307
|
-
function formatFormState(data) {
|
|
17314
|
+
function formatFormState(data, opts = {}) {
|
|
17308
17315
|
const { nodes, logicByNode } = orderNodesWithLogic(data);
|
|
17309
17316
|
const lines = [
|
|
17310
17317
|
`Form: ${data.title}`,
|
|
@@ -17339,7 +17346,7 @@ function formatFormState(data) {
|
|
|
17339
17346
|
lines.push(` ${i + 1}. [${q.type}] ${q.prompt || "(no prompt)"}`);
|
|
17340
17347
|
lines.push(` Node ID: ${q.id}`);
|
|
17341
17348
|
if (q.required) lines.push(` Required: yes`);
|
|
17342
|
-
const config = projectConfig(q.type, q.config);
|
|
17349
|
+
const config = projectConfig(q.type, q.config, opts);
|
|
17343
17350
|
if (config && Object.keys(config).length > 0) {
|
|
17344
17351
|
lines.push(` Config: ${JSON.stringify(config)}`);
|
|
17345
17352
|
}
|
|
@@ -17444,8 +17451,9 @@ function registerGetFormTool(server, opts = {}) {
|
|
|
17444
17451
|
if (!result.ok) {
|
|
17445
17452
|
return apiErrorResult(result);
|
|
17446
17453
|
}
|
|
17447
|
-
const
|
|
17448
|
-
|
|
17454
|
+
const state = { guide: opts.guide === true };
|
|
17455
|
+
const text = formatFormState(result.data, state) + (opts.variables ? linkVariablesText(result.data) : "");
|
|
17456
|
+
return structuredResult(text, projectFormState(result.data, state));
|
|
17449
17457
|
}
|
|
17450
17458
|
);
|
|
17451
17459
|
}
|
|
@@ -19193,6 +19201,66 @@ function registerSetLinkVariablesTool(server) {
|
|
|
19193
19201
|
);
|
|
19194
19202
|
}
|
|
19195
19203
|
|
|
19204
|
+
// src/tools/set-node-guide.ts
|
|
19205
|
+
var NOT_AVAILABLE2 = "Walkthrough notes are not available on this workspace.";
|
|
19206
|
+
var TourSchema = external_exports.object({
|
|
19207
|
+
title: external_exports.string().min(1).max(GUIDE_LIMITS.titleMax).describe(`Short heading, up to ${GUIDE_LIMITS.titleMax} characters`),
|
|
19208
|
+
body: external_exports.string().min(1).max(GUIDE_LIMITS.bodyMax).describe(`The note, up to ${GUIDE_LIMITS.bodyMax} characters of plain text`),
|
|
19209
|
+
anchor: external_exports.enum(GUIDE_TOUR_ANCHORS).optional().describe('Where the note points: "node" (default) or "share" for the closing note on the Share button')
|
|
19210
|
+
});
|
|
19211
|
+
var IntroSchema = external_exports.object({
|
|
19212
|
+
title: external_exports.string().min(1).max(GUIDE_LIMITS.titleMax).describe(`Who it was built for, up to ${GUIDE_LIMITS.titleMax} characters`),
|
|
19213
|
+
body: external_exports.string().min(1).max(GUIDE_LIMITS.bodyMax).describe("What the form does for them, in one or two plain sentences")
|
|
19214
|
+
});
|
|
19215
|
+
function registerSetNodeGuideTool(server) {
|
|
19216
|
+
server.registerTool(
|
|
19217
|
+
"clipform_set_node_guide",
|
|
19218
|
+
{
|
|
19219
|
+
title: "Set a walkthrough note",
|
|
19220
|
+
description: `Set or remove the builder walkthrough note, or the intro card, on one node of an outbound template. When someone copies the template and opens it in the builder, an intro card says what was built for them (title: who it is for, body: what the form does, four short lines at most), then the walkthrough pans to each noted node in form order and shows its note. Put the intro on the first noted node; each note covers only its own node, and the closing note goes on the last step with anchor "share". Write public facts about the company only, never a person's name. At most ${GUIDE_LIMITS.maxTourSteps} notes show per form. Send tour or intro (or both); null removes it.`,
|
|
19221
|
+
inputSchema: external_exports.object({
|
|
19222
|
+
form_id: external_exports.string().uuid().describe("The form UUID (returned by clipform_create_form, not the short share_id from the URL)"),
|
|
19223
|
+
node_id: external_exports.string().uuid().describe("The node to put the note on (ids from clipform_get_form). Not the Start node."),
|
|
19224
|
+
tour: TourSchema.nullable().optional().describe("The note, or null to remove it. Omit to leave it as is."),
|
|
19225
|
+
intro: IntroSchema.nullable().optional().describe("The intro card shown before the first note, or null to remove it. Omit to leave it as is.")
|
|
19226
|
+
}),
|
|
19227
|
+
outputSchema: external_exports.object({
|
|
19228
|
+
form_id: external_exports.string(),
|
|
19229
|
+
node_id: external_exports.string(),
|
|
19230
|
+
tour: TourSchema.nullable().describe("The note now stored on the node (trimmed), or null when it has none"),
|
|
19231
|
+
intro: IntroSchema.nullable().describe("The intro now stored on the node (trimmed), or null when it has none")
|
|
19232
|
+
}),
|
|
19233
|
+
annotations: {
|
|
19234
|
+
readOnlyHint: false,
|
|
19235
|
+
// Replaces the node's note, and tour: null removes it.
|
|
19236
|
+
destructiveHint: true,
|
|
19237
|
+
idempotentHint: true,
|
|
19238
|
+
openWorldHint: false
|
|
19239
|
+
}
|
|
19240
|
+
},
|
|
19241
|
+
async ({ form_id, node_id, tour, intro }) => {
|
|
19242
|
+
if (tour === void 0 && intro === void 0) return refusedResult("Send tour, intro or both (null removes one).");
|
|
19243
|
+
const guide = { ...tour !== void 0 ? { tour } : {}, ...intro !== void 0 ? { intro } : {} };
|
|
19244
|
+
const res = await callApi(`/forms/${form_id}/nodes/${node_id}`, { method: "PATCH", body: { config: { guide } } });
|
|
19245
|
+
if (!res.ok) return apiErrorResult(res);
|
|
19246
|
+
const data = res.data;
|
|
19247
|
+
const storedTour = data?.config?.guide?.tour ?? null;
|
|
19248
|
+
const storedIntro = data?.config?.guide?.intro ?? null;
|
|
19249
|
+
if (tour && !storedTour || intro && !storedIntro) return refusedResult(NOT_AVAILABLE2);
|
|
19250
|
+
const lines = [];
|
|
19251
|
+
if (tour !== void 0) {
|
|
19252
|
+
lines.push(
|
|
19253
|
+
storedTour ? `Walkthrough note set on node ${node_id}: "${storedTour.title}" (${storedTour.anchor === "share" ? "points at Share" : "points at the node"}).` : `Walkthrough note removed from node ${node_id}.`
|
|
19254
|
+
);
|
|
19255
|
+
}
|
|
19256
|
+
if (intro !== void 0) {
|
|
19257
|
+
lines.push(storedIntro ? `Intro card set on node ${node_id}: "${storedIntro.title}".` : `Intro card removed from node ${node_id}.`);
|
|
19258
|
+
}
|
|
19259
|
+
return structuredResult(lines.join(" "), { form_id, node_id, tour: storedTour, intro: storedIntro });
|
|
19260
|
+
}
|
|
19261
|
+
);
|
|
19262
|
+
}
|
|
19263
|
+
|
|
19196
19264
|
// src/tools/log-generation.ts
|
|
19197
19265
|
function registerLogGenerationTool(server) {
|
|
19198
19266
|
server.registerTool(
|
|
@@ -20893,7 +20961,7 @@ function createServer(options) {
|
|
|
20893
20961
|
registerImportFormTool(server);
|
|
20894
20962
|
registerListFormsTool(server, caps);
|
|
20895
20963
|
registerWhoamiTool(server);
|
|
20896
|
-
registerGetFormTool(server, { variables: options?.variables === true });
|
|
20964
|
+
registerGetFormTool(server, { variables: options?.variables === true, guide: options?.guide === true });
|
|
20897
20965
|
registerUpdateFormTool(server);
|
|
20898
20966
|
registerDeleteFormTool(server);
|
|
20899
20967
|
registerGetResultsTool(server);
|
|
@@ -20908,6 +20976,7 @@ function createServer(options) {
|
|
|
20908
20976
|
registerDeleteNodeMediaTool(server);
|
|
20909
20977
|
registerSetNodeLogicTool(server);
|
|
20910
20978
|
if (options?.variables === true) registerSetLinkVariablesTool(server);
|
|
20979
|
+
if (options?.guide === true) registerSetNodeGuideTool(server);
|
|
20911
20980
|
registerLogGenerationTool(server);
|
|
20912
20981
|
registerSearchNewsTool(server);
|
|
20913
20982
|
registerGenerateTtsTool(server);
|
|
@@ -20994,4 +21063,4 @@ export {
|
|
|
20994
21063
|
* MIT Licensed
|
|
20995
21064
|
*)
|
|
20996
21065
|
*/
|
|
20997
|
-
//# sourceMappingURL=chunk-
|
|
21066
|
+
//# sourceMappingURL=chunk-THJUTILR.js.map
|