@clipform/mcp-server 5.7.2 → 5.8.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.d.ts +34 -1
- package/dist/api-client.js +8 -1
- package/dist/{chunk-AZ2MC7BU.js → chunk-5AODH5TC.js} +3 -3
- package/dist/{chunk-PW7O7KZF.js → chunk-7PJHCRSD.js} +18 -1
- package/dist/{chunk-PW7O7KZF.js.map → chunk-7PJHCRSD.js.map} +1 -1
- package/dist/{chunk-F42Q6ZMK.js → chunk-EQPYULVM.js} +70 -58
- package/dist/{chunk-F42Q6ZMK.js.map → chunk-EQPYULVM.js.map} +1 -1
- package/dist/{chunk-GIELHE2Y.js → chunk-HHRUYPFP.js} +2 -2
- package/dist/chunk-XO7XBMRY.js +15 -0
- package/dist/chunk-XO7XBMRY.js.map +1 -0
- package/dist/{chunk-KQI22YZM.js → chunk-YFOTTAGR.js} +3 -3
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/dist/instrument.js +9 -0
- package/dist/instrument.js.map +1 -1
- package/dist/prompts.js +4 -3
- package/dist/resources.js +4 -3
- package/dist/server.js +6 -5
- package/package.json +1 -1
- package/server.json +2 -2
- /package/dist/{chunk-AZ2MC7BU.js.map → chunk-5AODH5TC.js.map} +0 -0
- /package/dist/{chunk-GIELHE2Y.js.map → chunk-HHRUYPFP.js.map} +0 -0
- /package/dist/{chunk-KQI22YZM.js.map → chunk-YFOTTAGR.js.map} +0 -0
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
union,
|
|
32
32
|
unknown,
|
|
33
33
|
url
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-YFOTTAGR.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-5AODH5TC.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-HHRUYPFP.js";
|
|
58
58
|
import {
|
|
59
59
|
ACTIVE_NODE_TYPES,
|
|
60
60
|
ANON_MCP_BLOCKED_NODE_TYPES,
|
|
@@ -75,6 +75,7 @@ import {
|
|
|
75
75
|
NODE_TYPES,
|
|
76
76
|
NON_COUNTABLE_TYPES,
|
|
77
77
|
PII_NODE_TYPES,
|
|
78
|
+
apiErrorResult,
|
|
78
79
|
authChallengeMeta,
|
|
79
80
|
bfsOrder,
|
|
80
81
|
callApi,
|
|
@@ -94,11 +95,12 @@ import {
|
|
|
94
95
|
normalizeConsentItems,
|
|
95
96
|
normalizeContactFields,
|
|
96
97
|
recallDisplayText,
|
|
98
|
+
refusedResult,
|
|
97
99
|
resolveFormType,
|
|
98
100
|
stripGatedConfigKeys,
|
|
99
101
|
structuredResult,
|
|
100
102
|
textResult
|
|
101
|
-
} from "./chunk-
|
|
103
|
+
} from "./chunk-7PJHCRSD.js";
|
|
102
104
|
import {
|
|
103
105
|
getMcpAuth,
|
|
104
106
|
runWithMcpAuth,
|
|
@@ -16377,7 +16379,7 @@ async function runWithWorkspaceTarget(args, run) {
|
|
|
16377
16379
|
const ctx = getMcpAuth();
|
|
16378
16380
|
const resolve = ctx?.resolveWorkspace;
|
|
16379
16381
|
if (!resolve) {
|
|
16380
|
-
if (workspaceId) return
|
|
16382
|
+
if (workspaceId) return refusedResult(PINNED_WORKSPACE_ERROR);
|
|
16381
16383
|
return run();
|
|
16382
16384
|
}
|
|
16383
16385
|
if (workspaceId && !formId && workspaceId === ctx.default_workspace_id) {
|
|
@@ -16544,7 +16546,7 @@ Example: A form that asks a question, collects contact info, then finishes:
|
|
|
16544
16546
|
const contentCount = nodes.filter((q) => !NON_COUNTABLE_TYPES.includes(q.type)).length;
|
|
16545
16547
|
if (planContext.node_limit !== null && contentCount > planContext.node_limit) {
|
|
16546
16548
|
const message = planContext.is_authenticated ? `Your '${planContext.workspace_name}' workspace is on the ${planContext.plan_name} plan, capped at ${planContext.node_limit} nodes per form. You asked for ${contentCount}. Rerun with ${planContext.node_limit} nodes or fewer.` : `Anonymous sessions are capped at ${planContext.node_limit} nodes per form (${planContext.plan_name} plan). You asked for ${contentCount}. Either rerun with ${planContext.node_limit} nodes, or sign in to your Clipform account so forms land in your workspace with your real plan limits.`;
|
|
16547
|
-
return
|
|
16549
|
+
return refusedResult(message);
|
|
16548
16550
|
}
|
|
16549
16551
|
let limitFormList = null;
|
|
16550
16552
|
if (planContext.form_limit !== null) {
|
|
@@ -16560,7 +16562,7 @@ Example: A form that asks a question, collects contact info, then finishes:
|
|
|
16560
16562
|
} else {
|
|
16561
16563
|
const options = planContext.is_authenticated ? ` - Delete one of the forms below to free a slot.` : ` - Delete one of the forms below to free a slot.
|
|
16562
16564
|
- Or sign in to a Clipform account to keep these forms and get higher limits.`;
|
|
16563
|
-
return
|
|
16565
|
+
return refusedResult(
|
|
16564
16566
|
[
|
|
16565
16567
|
`LIMIT REACHED - the form was NOT created. The plan's form limit is full.`,
|
|
16566
16568
|
``,
|
|
@@ -16629,7 +16631,7 @@ Example: A form that asks a question, collects contact info, then finishes:
|
|
|
16629
16631
|
].join("\n");
|
|
16630
16632
|
}
|
|
16631
16633
|
}
|
|
16632
|
-
return isAnonymousAccountRequired(createResult) ?
|
|
16634
|
+
return isAnonymousAccountRequired(createResult) ? refusedResult(message, authChallengeMeta("insufficient_scope", createResult.apiMessage ?? message)) : apiErrorResult(createResult, message);
|
|
16633
16635
|
}
|
|
16634
16636
|
const { data } = createResult;
|
|
16635
16637
|
const formId = data.form_id;
|
|
@@ -16886,12 +16888,10 @@ function detectImportPlatform(url2) {
|
|
|
16886
16888
|
return provider && IMPORTABLE_PROVIDERS.includes(provider) ? provider : null;
|
|
16887
16889
|
}
|
|
16888
16890
|
var SUPPORTED_LIST = "clipform_import_form only supports Google Forms (docs.google.com or forms.gle), Typeform (form.typeform.com/to/...), and Tally (tally.so) links.";
|
|
16889
|
-
|
|
16890
|
-
|
|
16891
|
-
|
|
16892
|
-
}
|
|
16893
|
-
const base = `Unsupported URL (${label}). ${SUPPORTED_LIST}`;
|
|
16894
|
-
return label === "VideoAsk" ? `${base} VideoAsk import is not available yet.` : base;
|
|
16891
|
+
var TYPEFORM_SHARE_LINK_MESSAGE = `Unsupported URL (Typeform, not a public share link). Use the form's public form.typeform.com/to/... link. ${SUPPORTED_LIST}`;
|
|
16892
|
+
function cannotImportMessage(label) {
|
|
16893
|
+
const what = label === "other" ? "Clipform can't import this link: it is not a Google Form, Typeform or Tally form." : label === "VideoAsk" ? "Clipform can't import VideoAsk forms yet." : `Clipform can't import ${label.endsWith(" Forms") ? label : `${label} forms`}.`;
|
|
16894
|
+
return `${what} Nothing was created. ${SUPPORTED_LIST} To rebuild this form in Clipform, use clipform_create_form with its questions.`;
|
|
16895
16895
|
}
|
|
16896
16896
|
function pluralQuestions(n) {
|
|
16897
16897
|
return `${n} question${n === 1 ? "" : "s"}`;
|
|
@@ -16936,7 +16936,18 @@ function registerImportFormTool(server) {
|
|
|
16936
16936
|
async ({ url: url2, is_live }) => {
|
|
16937
16937
|
const platform = detectImportPlatform(url2);
|
|
16938
16938
|
if (!platform) {
|
|
16939
|
-
|
|
16939
|
+
const label = detectFormToolLabel(url2);
|
|
16940
|
+
if (label === "Typeform") return refusedResult(TYPEFORM_SHARE_LINK_MESSAGE);
|
|
16941
|
+
const message = cannotImportMessage(label);
|
|
16942
|
+
return structuredResult(message, {
|
|
16943
|
+
form_id: null,
|
|
16944
|
+
viewer_url: null,
|
|
16945
|
+
is_live: false,
|
|
16946
|
+
preview_url: null,
|
|
16947
|
+
builder_url: null,
|
|
16948
|
+
live_refused_reason: null,
|
|
16949
|
+
import_summary: { title: "", total_questions: 0, imported: 0, skipped: 0, skipped_details: [], warnings: [message] }
|
|
16950
|
+
});
|
|
16940
16951
|
}
|
|
16941
16952
|
const meResult = await callApi("/me", { method: "GET" });
|
|
16942
16953
|
if (!meResult.ok) {
|
|
@@ -16953,7 +16964,7 @@ function registerImportFormTool(server) {
|
|
|
16953
16964
|
const body = { url: url2, workspace_id: workspaceId, ...is_live !== void 0 ? { is_live } : {} };
|
|
16954
16965
|
const importResult = platform === "google" ? await callApi("/forms/import/google", { method: "POST", body }) : platform === "typeform" ? await callApi("/forms/import/typeform", { method: "POST", body }) : await callApi("/forms/import/tally", { method: "POST", body });
|
|
16955
16966
|
if (!importResult.ok) {
|
|
16956
|
-
return errorResult(importResult.error);
|
|
16967
|
+
return importResult.status === 400 ? errorResult(importResult.error) : apiErrorResult(importResult);
|
|
16957
16968
|
}
|
|
16958
16969
|
const data = importResult.data;
|
|
16959
16970
|
const summary = data.import_summary;
|
|
@@ -17076,7 +17087,7 @@ function registerListFormsTool(server, caps = FULL_CAPS) {
|
|
|
17076
17087
|
if (order) params.order = order;
|
|
17077
17088
|
const result = await callApi("/forms", { params });
|
|
17078
17089
|
if (!result.ok) {
|
|
17079
|
-
return
|
|
17090
|
+
return apiErrorResult(result);
|
|
17080
17091
|
}
|
|
17081
17092
|
const data = result.data;
|
|
17082
17093
|
const structured = {
|
|
@@ -17356,7 +17367,7 @@ function registerGetFormTool(server) {
|
|
|
17356
17367
|
async ({ form_id }) => {
|
|
17357
17368
|
const result = await callApi(`/forms/${form_id}?include=logic`);
|
|
17358
17369
|
if (!result.ok) {
|
|
17359
|
-
return
|
|
17370
|
+
return apiErrorResult(result);
|
|
17360
17371
|
}
|
|
17361
17372
|
return structuredResult(formatFormState(result.data), projectFormState(result.data));
|
|
17362
17373
|
}
|
|
@@ -17430,20 +17441,21 @@ function registerUpdateFormTool(server) {
|
|
|
17430
17441
|
});
|
|
17431
17442
|
if (!result.ok) {
|
|
17432
17443
|
if (isAnonymousAccountRequired(result)) {
|
|
17433
|
-
return
|
|
17444
|
+
return refusedResult(
|
|
17434
17445
|
result.error,
|
|
17435
17446
|
authChallengeMeta("insufficient_scope", result.apiMessage ?? result.error)
|
|
17436
17447
|
);
|
|
17437
17448
|
}
|
|
17438
17449
|
if (is_live === true && isConnectorGuest() && (result.status === 403 || result.status === 503)) {
|
|
17439
17450
|
const others = Object.keys(body).some((k) => k !== "is_live");
|
|
17440
|
-
return
|
|
17451
|
+
return apiErrorResult(
|
|
17452
|
+
result,
|
|
17441
17453
|
`${result.error}
|
|
17442
17454
|
|
|
17443
17455
|
${others ? "The other changes in this call were saved to the draft, but the form was not republished." : "The form was not republished."}`
|
|
17444
17456
|
);
|
|
17445
17457
|
}
|
|
17446
|
-
return
|
|
17458
|
+
return apiErrorResult(result);
|
|
17447
17459
|
}
|
|
17448
17460
|
const returned = result.data?.alias;
|
|
17449
17461
|
if (typeof returned === "string" && returned) storedAlias = returned;
|
|
@@ -17454,10 +17466,10 @@ ${others ? "The other changes in this call were saved to the draft, but the form
|
|
|
17454
17466
|
body: { tags }
|
|
17455
17467
|
});
|
|
17456
17468
|
if (!tagResult.ok) {
|
|
17457
|
-
return isAnonymousAccountRequired(tagResult) ?
|
|
17469
|
+
return isAnonymousAccountRequired(tagResult) ? refusedResult(
|
|
17458
17470
|
tagResult.error,
|
|
17459
17471
|
authChallengeMeta("insufficient_scope", tagResult.apiMessage ?? tagResult.error)
|
|
17460
|
-
) :
|
|
17472
|
+
) : apiErrorResult(tagResult);
|
|
17461
17473
|
}
|
|
17462
17474
|
}
|
|
17463
17475
|
const updates = [];
|
|
@@ -17626,7 +17638,7 @@ function registerDeleteFormTool(server) {
|
|
|
17626
17638
|
method: "DELETE"
|
|
17627
17639
|
});
|
|
17628
17640
|
if (!result.ok) {
|
|
17629
|
-
return
|
|
17641
|
+
return apiErrorResult(result);
|
|
17630
17642
|
}
|
|
17631
17643
|
return textResult(`Form ${form_id} has been moved to the trash.`);
|
|
17632
17644
|
}
|
|
@@ -17769,7 +17781,7 @@ function registerGetResultsTool(server) {
|
|
|
17769
17781
|
async ({ form_id }) => {
|
|
17770
17782
|
const result = await callApi(`/forms/${form_id}/results`);
|
|
17771
17783
|
if (!result.ok) {
|
|
17772
|
-
return
|
|
17784
|
+
return apiErrorResult(result);
|
|
17773
17785
|
}
|
|
17774
17786
|
const data = result.data;
|
|
17775
17787
|
const nodes = (data.nodes || []).map(projectNode);
|
|
@@ -17873,7 +17885,7 @@ function registerGetResponsesTool(server) {
|
|
|
17873
17885
|
callApi(`/forms/${form_id}`)
|
|
17874
17886
|
]);
|
|
17875
17887
|
if (!subsResult.ok) {
|
|
17876
|
-
return
|
|
17888
|
+
return apiErrorResult(subsResult, `Could not fetch responses: ${subsResult.error}`);
|
|
17877
17889
|
}
|
|
17878
17890
|
const nodeById = /* @__PURE__ */ new Map();
|
|
17879
17891
|
let nodeList = [];
|
|
@@ -18004,7 +18016,7 @@ function registerWhoamiTool(server) {
|
|
|
18004
18016
|
async () => {
|
|
18005
18017
|
const result = await callApi("/me", { method: "GET" });
|
|
18006
18018
|
if (!result.ok) {
|
|
18007
|
-
return
|
|
18019
|
+
return apiErrorResult(result);
|
|
18008
18020
|
}
|
|
18009
18021
|
const me = result.data;
|
|
18010
18022
|
const ctx = getMcpAuth();
|
|
@@ -18091,10 +18103,10 @@ function registerAddNodeTool(server) {
|
|
|
18091
18103
|
},
|
|
18092
18104
|
async ({ form_id, node, after_node_id, unlinked }) => {
|
|
18093
18105
|
if (unlinked && after_node_id) {
|
|
18094
|
-
return
|
|
18106
|
+
return refusedResult("Pass either after_node_id (insert into the flow) or unlinked: true (outside the flow), not both.");
|
|
18095
18107
|
}
|
|
18096
18108
|
if (unlinked && !isTerminalType(node.type)) {
|
|
18097
|
-
return
|
|
18109
|
+
return refusedResult(
|
|
18098
18110
|
`unlinked is only for an ending (end_screen or redirect), not ${node.type}. To give one answer its own question, insert it into the flow with after_node_id, then route answers with clipform_set_logic.`
|
|
18099
18111
|
);
|
|
18100
18112
|
}
|
|
@@ -18108,7 +18120,7 @@ function registerAddNodeTool(server) {
|
|
|
18108
18120
|
body
|
|
18109
18121
|
});
|
|
18110
18122
|
if (!result.ok) {
|
|
18111
|
-
return
|
|
18123
|
+
return apiErrorResult(result);
|
|
18112
18124
|
}
|
|
18113
18125
|
const nodeId = result.data.node_id;
|
|
18114
18126
|
const warnings = result.data.warnings ?? [];
|
|
@@ -18263,7 +18275,7 @@ function registerDeleteNodeTool(server) {
|
|
|
18263
18275
|
{ method: "DELETE" }
|
|
18264
18276
|
);
|
|
18265
18277
|
if (!result.ok) {
|
|
18266
|
-
return
|
|
18278
|
+
return apiErrorResult(result);
|
|
18267
18279
|
}
|
|
18268
18280
|
return textResult(`Node ${node_id} deleted.`);
|
|
18269
18281
|
}
|
|
@@ -18388,11 +18400,11 @@ Provide media via \`items\` (explicit type + URL), \`files\` (files attached by
|
|
|
18388
18400
|
// resolves the (now-targeted) workspace.
|
|
18389
18401
|
async ({ items, files, form_id: _form_id }) => {
|
|
18390
18402
|
if ((!items || items.length === 0) && (!files || files.length === 0)) {
|
|
18391
|
-
return
|
|
18403
|
+
return refusedResult("Provide at least one media item via `items` or `files`.");
|
|
18392
18404
|
}
|
|
18393
18405
|
const totalEntryCount = (items?.length ?? 0) + (files?.length ?? 0);
|
|
18394
18406
|
if (totalEntryCount > 10) {
|
|
18395
|
-
return
|
|
18407
|
+
return refusedResult(`Provide at most 10 media items total across \`items\` and \`files\` (got ${totalEntryCount}).`);
|
|
18396
18408
|
}
|
|
18397
18409
|
const meResult = await callApi("/me", { method: "GET" });
|
|
18398
18410
|
if (!meResult.ok) {
|
|
@@ -18563,7 +18575,7 @@ function registerCompleteMediaUploadTool(server) {
|
|
|
18563
18575
|
body: { uploaded: true }
|
|
18564
18576
|
});
|
|
18565
18577
|
if (!result.ok) {
|
|
18566
|
-
return
|
|
18578
|
+
return apiErrorResult(result);
|
|
18567
18579
|
}
|
|
18568
18580
|
const status = result.data.status ?? "ready";
|
|
18569
18581
|
const noop = Boolean(result.data.noop);
|
|
@@ -18694,7 +18706,7 @@ function registerGetNodeMediaTool(server) {
|
|
|
18694
18706
|
`/forms/${form_id}/nodes/${node_id}/media`
|
|
18695
18707
|
);
|
|
18696
18708
|
if (!result.ok) {
|
|
18697
|
-
return
|
|
18709
|
+
return apiErrorResult(result);
|
|
18698
18710
|
}
|
|
18699
18711
|
const media = result.data.media;
|
|
18700
18712
|
if (!media) {
|
|
@@ -18755,7 +18767,7 @@ function registerDeleteNodeMediaTool(server) {
|
|
|
18755
18767
|
{ method: "DELETE" }
|
|
18756
18768
|
);
|
|
18757
18769
|
if (!result.ok) {
|
|
18758
|
-
return
|
|
18770
|
+
return apiErrorResult(result);
|
|
18759
18771
|
}
|
|
18760
18772
|
return textResult("Media removed from node.");
|
|
18761
18773
|
}
|
|
@@ -18902,7 +18914,7 @@ function registerLogGenerationTool(server) {
|
|
|
18902
18914
|
const result = await callApi("/internal/log-generation", {
|
|
18903
18915
|
body: { form_id, summary, details }
|
|
18904
18916
|
});
|
|
18905
|
-
if (!result.ok) return
|
|
18917
|
+
if (!result.ok) return apiErrorResult(result);
|
|
18906
18918
|
return textResult(`Audit log saved for form ${form_id}
|
|
18907
18919
|
Summary: ${summary}
|
|
18908
18920
|
This is an internal generation-audit step, not a user-requested action.`);
|
|
@@ -18947,7 +18959,7 @@ Returns: article title, source, author, date, URL, description, and image URL pe
|
|
|
18947
18959
|
const result = await callApi("/internal/search-news", {
|
|
18948
18960
|
body: { query, count }
|
|
18949
18961
|
});
|
|
18950
|
-
if (!result.ok) return
|
|
18962
|
+
if (!result.ok) return apiErrorResult(result);
|
|
18951
18963
|
const results = result.data.results;
|
|
18952
18964
|
if (!results.length) return structuredResult(`No news articles found for "${query}".`, { query, articles: [] });
|
|
18953
18965
|
const articles = results.map((article) => ({
|
|
@@ -19028,7 +19040,7 @@ Pass one item or many (max 10) - multiple items run in parallel. Returns audio_u
|
|
|
19028
19040
|
// checks the node belongs to the form in the caller's workspace.
|
|
19029
19041
|
async ({ items, form_id }) => {
|
|
19030
19042
|
if (FORM_CLIP_RULES && (!form_id || items.some((i) => !i.node_id))) {
|
|
19031
|
-
return
|
|
19043
|
+
return refusedResult("form_id and a node_id per item are required: a voiceover is for one question in a Clipform form.");
|
|
19032
19044
|
}
|
|
19033
19045
|
const workspace_id = getMcpAuth()?.workspace_id;
|
|
19034
19046
|
const results = await Promise.allSettled(
|
|
@@ -19567,25 +19579,25 @@ ${RENDER_ATTACH_RULE} In batch mode, set node_id per item (see items) and form_i
|
|
|
19567
19579
|
},
|
|
19568
19580
|
async ({ compositionId, outputFormat, inputProps, wait, items, node_id, form_id, captions, caption_ref }) => {
|
|
19569
19581
|
if (FORM_CLIP_RULES) {
|
|
19570
|
-
if (!form_id) return
|
|
19582
|
+
if (!form_id) return refusedResult("form_id is required: a render is for one question in a Clipform form.");
|
|
19571
19583
|
const missing = items?.length ? items.some((i) => !i.node_id) : !node_id;
|
|
19572
|
-
if (missing) return
|
|
19584
|
+
if (missing) return refusedResult("node_id is required: a render is for one question in a Clipform form, so every render needs the node it attaches to.");
|
|
19573
19585
|
}
|
|
19574
19586
|
if (items?.length && compositionId) {
|
|
19575
|
-
return
|
|
19587
|
+
return refusedResult("Pass EITHER items (batch) OR compositionId (single render), not both.");
|
|
19576
19588
|
}
|
|
19577
19589
|
if (!items?.length && !compositionId) {
|
|
19578
|
-
return
|
|
19590
|
+
return refusedResult("Pass compositionId for a single render, or items for a batch.");
|
|
19579
19591
|
}
|
|
19580
19592
|
if (node_id && !form_id) {
|
|
19581
|
-
return
|
|
19593
|
+
return refusedResult("form_id is required when node_id is set.");
|
|
19582
19594
|
}
|
|
19583
19595
|
if (items?.some((i) => i.node_id) && !form_id) {
|
|
19584
|
-
return
|
|
19596
|
+
return refusedResult("form_id is required when any item sets node_id.");
|
|
19585
19597
|
}
|
|
19586
19598
|
const unknown2 = (items ?? [{ compositionId, outputFormat, inputProps }]).map((i) => i.compositionId).filter((id) => !EXPOSED_COMPOSITIONS.includes(id));
|
|
19587
19599
|
if (unknown2.length) {
|
|
19588
|
-
return
|
|
19600
|
+
return refusedResult(`Composition${unknown2.length > 1 ? "s" : ""} ${unknown2.map((id) => `"${id}"`).join(", ")} not available. Call clipform_list_compositions to see available options.`);
|
|
19589
19601
|
}
|
|
19590
19602
|
if (items?.length) {
|
|
19591
19603
|
const jobs2 = items.map((item) => ({ item, job: fireRender(item, form_id) }));
|
|
@@ -19636,7 +19648,7 @@ ${RENDER_ATTACH_RULE} In batch mode, set node_id per item (see items) and form_i
|
|
|
19636
19648
|
if (!result.ok) {
|
|
19637
19649
|
const placeholder = await placeholderPromise;
|
|
19638
19650
|
if (placeholder) await failPlaceholder(placeholder, result.error);
|
|
19639
|
-
return
|
|
19651
|
+
return apiErrorResult(result);
|
|
19640
19652
|
}
|
|
19641
19653
|
const data = result.data;
|
|
19642
19654
|
let attach;
|
|
@@ -19715,7 +19727,7 @@ function registerSearchMusicTool(server) {
|
|
|
19715
19727
|
const result = await callApi("/internal/search-music", {
|
|
19716
19728
|
body: { query, count, instrumentalOnly, minDuration, maxDuration, tags }
|
|
19717
19729
|
});
|
|
19718
|
-
if (!result.ok) return
|
|
19730
|
+
if (!result.ok) return apiErrorResult(result);
|
|
19719
19731
|
const results = result.data.results;
|
|
19720
19732
|
if (!results.length) return structuredResult(`No music found for "${query}".`, { query, tracks: [] });
|
|
19721
19733
|
const tracks = results.map((item) => ({
|
|
@@ -19800,7 +19812,7 @@ function registerListCompositionsTool(server) {
|
|
|
19800
19812
|
if (result.status === 0 || result.status === 404) {
|
|
19801
19813
|
return errorResult("Video compositions are not available (API server may not be running). Start the API with 'npm run dev --workspace=apps/api'.");
|
|
19802
19814
|
}
|
|
19803
|
-
return
|
|
19815
|
+
return apiErrorResult(result);
|
|
19804
19816
|
}
|
|
19805
19817
|
const all = result.data.compositions;
|
|
19806
19818
|
const compositions = all.filter((c) => EXPOSED_COMPOSITIONS.includes(c.id));
|
|
@@ -19858,7 +19870,7 @@ function registerListVideoTemplatesTool(server) {
|
|
|
19858
19870
|
if (result.status === 0 || result.status === 404) {
|
|
19859
19871
|
return errorResult("Video templates are not available (API server may not be running). Start the API with 'npm run dev --workspace=apps/api'.");
|
|
19860
19872
|
}
|
|
19861
|
-
return
|
|
19873
|
+
return apiErrorResult(result);
|
|
19862
19874
|
}
|
|
19863
19875
|
const templates = result.data.templates ?? [];
|
|
19864
19876
|
if (!templates.length) {
|
|
@@ -19930,10 +19942,10 @@ ${RENDER_ATTACH_RULE}`,
|
|
|
19930
19942
|
},
|
|
19931
19943
|
async ({ template, controls, outputFormat, wait, node_id, form_id, captions, caption_ref }) => {
|
|
19932
19944
|
if (FORM_CLIP_RULES && (!form_id || !node_id)) {
|
|
19933
|
-
return
|
|
19945
|
+
return refusedResult("form_id and node_id are required: a render is for one question in a Clipform form, so it needs the node it attaches to.");
|
|
19934
19946
|
}
|
|
19935
19947
|
if (node_id && !form_id) {
|
|
19936
|
-
return
|
|
19948
|
+
return refusedResult("form_id is required when node_id is set.");
|
|
19937
19949
|
}
|
|
19938
19950
|
const captionRef = resolveCaptionRef(caption_ref, controls?.audio_url);
|
|
19939
19951
|
const narrated = renderHasNarration({ captions, captionRef, controls });
|
|
@@ -19994,7 +20006,7 @@ ${RENDER_ATTACH_RULE}`,
|
|
|
19994
20006
|
if (!result.ok) {
|
|
19995
20007
|
const placeholder = await placeholderPromise;
|
|
19996
20008
|
if (placeholder) await failPlaceholder(placeholder, result.error);
|
|
19997
|
-
return
|
|
20009
|
+
return apiErrorResult(result);
|
|
19998
20010
|
}
|
|
19999
20011
|
const data = result.data;
|
|
20000
20012
|
let attach;
|
|
@@ -20053,7 +20065,7 @@ function registerListAssetsTool(server) {
|
|
|
20053
20065
|
method: "GET",
|
|
20054
20066
|
params: { type: type ?? "all" }
|
|
20055
20067
|
});
|
|
20056
|
-
if (!result.ok) return
|
|
20068
|
+
if (!result.ok) return apiErrorResult(result);
|
|
20057
20069
|
data = result.data;
|
|
20058
20070
|
}
|
|
20059
20071
|
const lines = [];
|
|
@@ -20167,12 +20179,12 @@ Pass job_ids to check a whole batch in ONE call - one line of status per job. Pa
|
|
|
20167
20179
|
async ({ job_id, job_ids }) => {
|
|
20168
20180
|
const ids = job_ids?.length ? job_ids : job_id ? [job_id] : [];
|
|
20169
20181
|
if (!ids.length) {
|
|
20170
|
-
return
|
|
20182
|
+
return refusedResult("Pass job_id (single) or job_ids (batch).");
|
|
20171
20183
|
}
|
|
20172
20184
|
if (ids.length === 1) {
|
|
20173
20185
|
const job = getJob(ids[0]);
|
|
20174
20186
|
if (!job) {
|
|
20175
|
-
return
|
|
20187
|
+
return refusedResult(`No render job found with ID ${ids[0]}. ${LOST_JOB_RECOVERY}`);
|
|
20176
20188
|
}
|
|
20177
20189
|
if (job.status === "rendering") {
|
|
20178
20190
|
const elapsed = Math.round((Date.now() - job.createdAt) / 1e3);
|
|
@@ -20293,7 +20305,7 @@ mainlandOnly excludes small islands and overseas territories (e.g. Corsica for F
|
|
|
20293
20305
|
}
|
|
20294
20306
|
const data = await response.json();
|
|
20295
20307
|
if (!data.features?.length) {
|
|
20296
|
-
return
|
|
20308
|
+
return refusedResult(`No boundary found for "${query}" (type: ${type}). Try a different name or type.`);
|
|
20297
20309
|
}
|
|
20298
20310
|
const feature = data.features[0];
|
|
20299
20311
|
let geometry = feature.geometry;
|
|
@@ -20673,4 +20685,4 @@ export {
|
|
|
20673
20685
|
* MIT Licensed
|
|
20674
20686
|
*)
|
|
20675
20687
|
*/
|
|
20676
|
-
//# sourceMappingURL=chunk-
|
|
20688
|
+
//# sourceMappingURL=chunk-EQPYULVM.js.map
|