@clipform/mcp-server 5.21.0 → 6.0.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/README.md +0 -3
- package/dist/api-client.js +1 -1
- package/dist/{caps-KNlvfilv.d.ts → caps-Dxnb9br4.d.ts} +2 -2
- package/dist/{chunk-3XYVOC62.js → chunk-GMXM2CKO.js} +2 -2
- package/dist/chunk-GMXM2CKO.js.map +1 -0
- package/dist/{chunk-W3DTFENN.js → chunk-JVP5TKQO.js} +3 -3
- package/dist/{chunk-46JO5PXU.js → chunk-LXIO5NZH.js} +5 -268
- package/dist/chunk-LXIO5NZH.js.map +1 -0
- package/dist/{chunk-44RMJB7K.js → chunk-UBBW6AL6.js} +3 -11
- package/dist/chunk-UBBW6AL6.js.map +1 -0
- package/dist/{chunk-OKT4X4OW.js → chunk-YKPF75H3.js} +4 -4
- package/dist/{chunk-OKT4X4OW.js.map → chunk-YKPF75H3.js.map} +1 -1
- package/dist/index.js +5 -5
- package/dist/prompts.d.ts +1 -1
- package/dist/prompts.js +3 -3
- package/dist/resources.d.ts +1 -1
- package/dist/resources.js +3 -3
- package/dist/server.d.ts +1 -1
- package/dist/server.js +5 -5
- package/package.json +1 -1
- package/server.json +2 -2
- package/dist/chunk-3XYVOC62.js.map +0 -1
- package/dist/chunk-44RMJB7K.js.map +0 -1
- package/dist/chunk-46JO5PXU.js.map +0 -1
- /package/dist/{chunk-W3DTFENN.js.map → chunk-JVP5TKQO.js.map} +0 -0
package/README.md
CHANGED
|
@@ -78,17 +78,14 @@ Your MCP client lists these automatically on connect (via `tools/list`). Full re
|
|
|
78
78
|
| `clipform_delete_node_media` | Remove media from a node by unlinking it; the media asset and its files stay in the workspace library and keep working on any other node or live form that uses them. |
|
|
79
79
|
| `clipform_set_logic` | Set where one or more nodes go next. |
|
|
80
80
|
| `clipform_log_generation` | Internal audit step run by a form-generation workflow. |
|
|
81
|
-
| `clipform_search_news` | Search recent news articles from NewsAPI and The Guardian and return them as structured results. |
|
|
82
81
|
| `clipform_generate_tts` | Generate narration audio from text with word-level captions for one question in a Clipform form (max 400 characters). |
|
|
83
82
|
| `clipform_search_media` | Search images or stock video clips. |
|
|
84
83
|
| `clipform_render_composition` | Render a specialised video composition to MP4 or PNG for one question in a Clipform form (max 30s, attached to that question) - custom animated visuals that a video template can't provide, such as geography animations or designed motion graphics. |
|
|
85
|
-
| `clipform_search_music` | Search for royalty-free music tracks and ambient sounds. |
|
|
86
84
|
| `clipform_list_compositions` | Browse available video compositions and their expected props schemas. |
|
|
87
85
|
| `clipform_list_video_templates` | Browse available video templates - curated Scene arrangements (bed + overlay + sane defaults) that render through the Scene composition from a small controls object. |
|
|
88
86
|
| `clipform_render_video_template` | Render a curated video template (a pre-arranged Scene: bed + overlay + sane defaults) to MP4 or PNG for one question in a Clipform form (max 30s, attached to that question) from a small controls object, instead of hand-assembling Scene layers. |
|
|
89
87
|
| `clipform_list_assets` | List available creative assets (sound effects, animations, fonts) for video compositions. |
|
|
90
88
|
| `clipform_check_render` | Check the status of render jobs started by clipform_render_video_template or clipform_render_composition. |
|
|
91
|
-
| `clipform_fetch_boundary` | Fetch a GeoJSON boundary polygon for a country, city, or region. |
|
|
92
89
|
| `clipform_get_guide` | Retrieve craft knowledge for building a specific form type. |
|
|
93
90
|
| `clipform_get_workflow` | Retrieve a step-by-step build workflow for creating a specific form type. |
|
|
94
91
|
|
package/dist/api-client.js
CHANGED
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
* calls. Every guidance producer takes a ServerCaps and gates on it.
|
|
12
12
|
*/
|
|
13
13
|
interface ServerCaps {
|
|
14
|
-
/** Narration, video, image,
|
|
14
|
+
/** Narration, video, image, render, and asset tools are registered. */
|
|
15
15
|
media: boolean;
|
|
16
|
-
/**
|
|
16
|
+
/** The generation audit log is registered. */
|
|
17
17
|
research: boolean;
|
|
18
18
|
/** Form tools (create, edit, publish) are registered. */
|
|
19
19
|
forms: boolean;
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
CURRENT_PLAN_VERSIONS,
|
|
3
3
|
PLAN_LIMITS,
|
|
4
4
|
callApi
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-UBBW6AL6.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-GMXM2CKO.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/anon-notice.ts","../src/lib/caps.ts","../src/lib/session-context.ts"],"sourcesContent":["import { getMcpAuth } from \"./auth-context.js\";\n\n/**\n * #4650: anonymous (preview) accounts are temporary. Date-free by design - the\n * generic notice promises no day count. The 7-day offline expiry of a live\n * guest form IS enforced now (#4847; ANON_MCP_LIVE_TTL_DAYS, stated in the\n * create_form reply), while the account purge keeps its own schedule (#4662).\n * Defined once; every anonymous-lane surface (create/update_form text, whoami,\n * session resource) reuses it.\n */\nexport const ANON_PREVIEW_NOTICE =\n \"Preview accounts are temporary - claim yours to keep your forms.\";\n\n/** The notice for an anonymous MCP caller, or null for everyone else. */\nexport function anonPreviewNotice(): string | null {\n return getMcpAuth()?.is_anonymous ? ANON_PREVIEW_NOTICE : null;\n}\n\n/**\n * #4845: a preview link is private, never a respondent link (answers are not\n * saved). A guest build now goes live at creation (#4847); a preview is what\n * remains for a draft (moderation held it, or it was taken offline). Wording\n * defined once; create_form, get_form, the format-form link label and the\n * output-schema descriptions all reuse it.\n */\nexport const ANON_PREVIEW_LINK_LABEL = \"Preview (answers not saved)\";\n\nexport const ANON_PREVIEW_ONLY_NOTICE =\n 'The form is ready as a preview. To put it live, call clipform_update_form with is_live:true - no sign-in is needed. In the preview, answers are not saved: do not share the preview link with respondents.';\n\n/** The drafts-only lanes (bot, email, web demo - not the MCP connector): signing up is what publishes. */\nexport const ANON_PREVIEW_ONLY_NOTICE_DRAFTS_ONLY =\n 'The form is ready as a preview. To go live, say \"publish it\" - that prompts sign-in and keeps this chat connected to your account. In the preview, answers are not saved: do not share the preview link with respondents.';\n\n/**\n * True when the caller is an anonymous session per the MCP auth context. /v1/me\n * reports `auth_mode: \"api_key\"` for the anonymous MCP lane (it runs on a bot key),\n * so `/me` alone cannot tell a guest from a signed-in key - the context can.\n */\nexport function isAnonymousSession(): boolean {\n return getMcpAuth()?.is_anonymous === true;\n}\n\n/** True on the MCP handler's anonymous connector lane (#4847). */\nexport function isConnectorGuest(): boolean {\n const auth = getMcpAuth();\n return auth?.is_anonymous === true && auth.connector_guest === true;\n}\n\n/** The preview-only notice for this caller's lane. */\nexport function previewOnlyNotice(): string {\n return isConnectorGuest() ? ANON_PREVIEW_ONLY_NOTICE : ANON_PREVIEW_ONLY_NOTICE_DRAFTS_ONLY;\n}\n\nexport const PREVIEW_URL_DESCRIPTION =\n \"Private preview of the form. Answers are not saved, so do not share it with respondents.\";\n\nexport const CLAIM_URL_DESCRIPTION =\n \"One-time link to sign up, keep this form and switch on its locked steps.\";\n\n/**\n * #5158: sign-in happens in a popup the model never sees, so after an adopt\n * (apps/api oauth-adopt.ts) the tool result tells it the form is now the\n * user's. Prepended by the server.ts registerTool wrapper.\n */\nexport const ADOPTED_FORM_NOTICE =\n \"Signed in - this form moved from the temporary preview account into your Clipform account, so it is yours now. The earlier claim link is no longer needed.\";\n\n/**\n * #4847: a claimed form with a locked step (payment, uploads, links ...) was\n * taken offline by the claim lock, so it arrives as a draft. Publishing it as\n * the new owner switches those steps on.\n */\nexport const ADOPTED_DRAFT_FORM_NOTICE =\n \"Signed in - this form moved from the temporary preview account into your Clipform account, so it is yours now. It is a draft now: publish it (clipform_update_form with is_live:true) to switch its steps on. The earlier claim link is no longer needed.\";\n\n/** The same call published the claimed form: every step is on. */\nexport const ADOPTED_LIVE_FORM_NOTICE =\n \"Signed in - this form moved from the temporary preview account into your Clipform account, so it is yours now. It is live with every step switched on. The earlier claim link is no longer needed.\";\n\n/**\n * Prepend the adopt notice to a successful result for a just-adopted form.\n * content only; structuredContent untouched. A form the claim lock drafted gets\n * the draft variant, or the live one when THIS call is update_form is_live:true.\n */\nexport function withAdoptedNotice<T>(result: T, args: unknown, toolName?: string): T {\n const formId = (args as { form_id?: unknown } | undefined)?.form_id;\n if (typeof formId !== \"string\") return result;\n const auth = getMcpAuth();\n const id = formId.toLowerCase();\n const has = (ids?: string[]) => !!ids && ids.map((i) => i.toLowerCase()).includes(id);\n if (!has(auth?.adopted_form_ids)) return result;\n const r = result as { isError?: boolean; content?: unknown } | undefined;\n if (!r || r.isError || !Array.isArray(r.content)) return result;\n let notice = ADOPTED_FORM_NOTICE;\n if (has(auth?.adopted_draft_form_ids)) {\n const publishedNow =\n toolName === \"clipform_update_form\" && (args as { is_live?: unknown } | undefined)?.is_live === true;\n notice = publishedNow ? ADOPTED_LIVE_FORM_NOTICE : ADOPTED_DRAFT_FORM_NOTICE;\n }\n return { ...r, content: [{ type: \"text\", text: notice }, ...r.content] } as T;\n}\n\n/** True for a viewer link in preview mode (an anonymous caller's draft). */\nexport function isPreviewViewerUrl(url: unknown): boolean {\n return typeof url === \"string\" && url.includes(\"mode=preview\");\n}\n","import type { McpToolset } from \"@vid-master/config\";\n\n/**\n * What a connected surface can actually do, derived from the connect-time\n * toolset filter (#3309) so the guidance layers (server instructions, prompt\n * recipes, `clipform_get_workflow`, craft guides) never reference a tool the\n * surface doesn't register (#3681).\n *\n * The Claude Connectors Directory surface (`mcp.clipform.io/forms`) is\n * account + forms only: no media generation and no research helpers. A\n * workflow that still says \"call clipform_generate_tts\" there sends the model\n * at a tool that doesn't exist, which shows up in review as failed tool\n * calls. Every guidance producer takes a ServerCaps and gates on it.\n */\nexport interface ServerCaps {\n /** Narration, video, image, render, and asset tools are registered. */\n media: boolean;\n /** The generation audit log is registered. */\n research: boolean;\n /** Form tools (create, edit, publish) are registered. */\n forms: boolean;\n}\n\n/** Every toolset registered - stdio/npx and the bare remote endpoint. */\nexport const FULL_CAPS: ServerCaps = Object.freeze({ media: true, research: true, forms: true });\n\nexport function capsFromToolsets(toolsets?: readonly McpToolset[]): ServerCaps {\n if (toolsets === undefined) return FULL_CAPS;\n return {\n media: toolsets.includes(\"media\"),\n research: toolsets.includes(\"research\"),\n forms: toolsets.includes(\"forms\"),\n };\n}\n","import { BUSINESS, PLAN_LIMITS, CURRENT_PLAN_VERSIONS } from \"@vid-master/config\";\nimport { callApi } from \"./api-client.js\";\nimport { ANON_PREVIEW_NOTICE } from \"./anon-notice.js\";\nimport { getMcpAuth } from \"./auth-context.js\";\n\nexport type AuthMode = \"authenticated\" | \"anonymous\";\n\nexport interface SessionContextResult {\n text: string;\n authMode: AuthMode;\n}\n\nexport async function getSessionContextWithAuth(): Promise<SessionContextResult> {\n let me: any;\n const authCtx = getMcpAuth();\n if (authCtx?.loadInternalContent && !authCtx.api_key) {\n // #4657: the no-workspace anon lane (get_workflow with no mint) has no\n // workspace for /me to describe, so plan caps default to Free.\n const free = PLAN_LIMITS[CURRENT_PLAN_VERSIONS[0]];\n me = {\n auth_mode: \"anonymous\",\n plan: {\n name: free.name,\n tier: free.tier,\n node_limit: free.node_limit,\n form_limit: free.form_limit ?? null,\n custom_theme: free.custom_theme,\n },\n };\n } else {\n let result;\n try {\n result = await callApi(\"/me\", { method: \"GET\" });\n } catch {\n return { text: \"\", authMode: \"anonymous\" };\n }\n if (!result.ok) return { text: \"\", authMode: \"anonymous\" };\n me = result.data as any;\n }\n // The API's auth_mode is \"api_key\" | \"oauth\" | \"session\" | \"anonymous\".\n // Anything credentialed counts as authenticated - the old `=== \"oauth\"`\n // check matched nothing the API returns, so API-key sessions were labelled\n // anonymous with a \"sign in to unlock\" nudge right next to their real\n // plan (#412 F6).\n // The anon MCP lane runs as a minted bot key (/me says \"api_key\"), so the\n // auth context is the truth for anonymous (#4653).\n const apiAuthMode: string = getMcpAuth()?.is_anonymous\n ? \"anonymous\"\n : ((me.auth_mode as string) ?? \"anonymous\");\n const authMode: AuthMode = apiAuthMode === \"anonymous\" ? \"anonymous\" : \"authenticated\";\n const plan = me.plan;\n const lines: string[] = [];\n\n lines.push(\"## Your Session\");\n if (authMode === \"authenticated\") {\n lines.push(\n apiAuthMode === \"api_key\"\n ? \"Auth: API key (workspace-scoped)\"\n : \"Auth: signed in (connected to a Clipform account)\"\n );\n // Workspace NAME only - the workspace UUID and the raw user_id/company_id\n // are internal database identifiers the model never needs (response\n // hygiene / disclosure guard, #2976).\n lines.push(`Workspace: ${me.workspace?.name ?? \"Unknown\"}`);\n } else {\n lines.push(\"Auth: anonymous (not connected to a Clipform account)\");\n if (me.workspace) {\n lines.push(`Workspace: ${me.workspace.name}`);\n }\n }\n lines.push(`Plan: ${plan.name} (tier ${plan.tier})`);\n if (plan.node_limit !== null) {\n lines.push(`Question limit: ${plan.node_limit} per form`);\n } else {\n lines.push(\"Questions: unlimited\");\n }\n if (plan.form_limit !== null) {\n lines.push(`Form limit: ${plan.form_limit} forms`);\n } else {\n lines.push(\"Forms: unlimited\");\n }\n if (plan.custom_theme === false) {\n lines.push(\"Custom themes: not available on this plan\");\n }\n if (authMode === \"anonymous\") {\n // Neutral statement of fact, no upsell/CTA copy (commerce sweep, #2976):\n // an anonymous session's forms are not tied to an account until one signs in.\n lines.push(`\\nAnonymous session: forms are not tied to a Clipform account until you sign in.`);\n lines.push(ANON_PREVIEW_NOTICE);\n }\n\n return { text: lines.join(\"\\n\"), authMode };\n}\n\nexport async function getSessionContext(): Promise<string> {\n const { text } = await getSessionContextWithAuth();\n return text;\n}\n"],"mappings":";;;;;;;;;;AAUO,IAAM,sBACX;AAGK,SAAS,oBAAmC;AACjD,SAAO,WAAW,GAAG,eAAe,sBAAsB;AAC5D;AASO,IAAM,0BAA0B;AAEhC,IAAM,2BACX;AAGK,IAAM,uCACX;AAOK,SAAS,qBAA8B;AAC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AC5B,UAAM,KAAK,mBAAmB,KAAK,UAAU,WAAW;AAAA,EAC1D,OAAO;AACL,UAAM,KAAK,sBAAsB;AAAA,EACnC;AACA,MAAI,KAAK,eAAe,MAAM;AAC5B,UAAM,KAAK,eAAe,KAAK,UAAU,QAAQ;AAAA,EACnD,OAAO;AACL,UAAM,KAAK,kBAAkB;AAAA,EAC/B;AACA,MAAI,KAAK,iBAAiB,OAAO;AAC/B,UAAM,KAAK,2CAA2C;AAAA,EACxD;AACA,MAAI,aAAa,aAAa;AAG5B,UAAM,KAAK;AAAA,+EAAkF;AAC7F,UAAM,KAAK,mBAAmB;AAAA,EAChC;AAEA,SAAO,EAAE,MAAM,MAAM,KAAK,IAAI,GAAG,SAAS;AAC5C;AAEA,eAAsB,oBAAqC;AACzD,QAAM,EAAE,KAAK,IAAI,MAAM,0BAA0B;AACjD,SAAO;AACT;","names":[]}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FULL_CAPS,
|
|
3
3
|
getSessionContext
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-GMXM2CKO.js";
|
|
5
5
|
import {
|
|
6
6
|
ALL_VARIANTS,
|
|
7
7
|
FORM_TYPES,
|
|
8
8
|
FORM_TYPE_KEYS,
|
|
9
9
|
callApi
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-UBBW6AL6.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-
|
|
149
|
+
//# sourceMappingURL=chunk-JVP5TKQO.js.map
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
union,
|
|
32
32
|
unknown,
|
|
33
33
|
url
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-YKPF75H3.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-JVP5TKQO.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-GMXM2CKO.js";
|
|
58
58
|
import {
|
|
59
59
|
ACTIVE_NODE_TYPES,
|
|
60
60
|
ANON_MCP_BLOCKED_NODE_TYPES,
|
|
@@ -120,7 +120,7 @@ import {
|
|
|
120
120
|
textResult,
|
|
121
121
|
validateVariableKey,
|
|
122
122
|
viewerUrl
|
|
123
|
-
} from "./chunk-
|
|
123
|
+
} from "./chunk-UBBW6AL6.js";
|
|
124
124
|
import {
|
|
125
125
|
getMcpAuth,
|
|
126
126
|
runWithMcpAuth,
|
|
@@ -19341,71 +19341,6 @@ This is an internal generation-audit step, not a user-requested action.`);
|
|
|
19341
19341
|
);
|
|
19342
19342
|
}
|
|
19343
19343
|
|
|
19344
|
-
// src/tools/search-news.ts
|
|
19345
|
-
function registerSearchNewsTool(server) {
|
|
19346
|
-
server.registerTool(
|
|
19347
|
-
"clipform_search_news",
|
|
19348
|
-
{
|
|
19349
|
-
title: "Search Recent News",
|
|
19350
|
-
description: `Search recent news articles from NewsAPI and The Guardian and return them as structured results.
|
|
19351
|
-
|
|
19352
|
-
Coverage: recent events, people, and topics (post-May-2025). Does NOT cover timeless topics (history, geography, science).
|
|
19353
|
-
|
|
19354
|
-
Returns: article title, source, author, date, URL, description, and image URL per result.`,
|
|
19355
|
-
inputSchema: external_exports.object({
|
|
19356
|
-
query: external_exports.string().describe("News search query (e.g. 'Iran war 2026', 'Australian Open final', 'UK election')"),
|
|
19357
|
-
count: external_exports.number().min(1).max(15).optional().describe("Max results per provider (default 5)")
|
|
19358
|
-
}),
|
|
19359
|
-
outputSchema: external_exports.object({
|
|
19360
|
-
query: external_exports.string(),
|
|
19361
|
-
articles: external_exports.array(
|
|
19362
|
-
external_exports.object({
|
|
19363
|
-
title: external_exports.string().optional(),
|
|
19364
|
-
source: external_exports.string().optional(),
|
|
19365
|
-
description: external_exports.string().optional(),
|
|
19366
|
-
author: external_exports.string().optional(),
|
|
19367
|
-
published_at: external_exports.string().optional(),
|
|
19368
|
-
url: external_exports.string(),
|
|
19369
|
-
image_url: external_exports.string().optional()
|
|
19370
|
-
})
|
|
19371
|
-
).describe("Matching articles (empty if none)")
|
|
19372
|
-
}),
|
|
19373
|
-
// Fetches from NewsAPI / The Guardian, external systems outside our
|
|
19374
|
-
// product - openWorldHint: true (#2976).
|
|
19375
|
-
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true }
|
|
19376
|
-
},
|
|
19377
|
-
async ({ query, count }) => {
|
|
19378
|
-
const result = await callApi("/internal/search-news", {
|
|
19379
|
-
body: { query, count }
|
|
19380
|
-
});
|
|
19381
|
-
if (!result.ok) return apiErrorResult(result);
|
|
19382
|
-
const results = result.data.results;
|
|
19383
|
-
if (!results.length) return structuredResult(`No news articles found for "${query}".`, { query, articles: [] });
|
|
19384
|
-
const articles = results.map((article) => ({
|
|
19385
|
-
...article.title ? { title: article.title } : {},
|
|
19386
|
-
...article.source ? { source: article.source } : {},
|
|
19387
|
-
...article.description ? { description: article.description } : {},
|
|
19388
|
-
...article.author ? { author: article.author } : {},
|
|
19389
|
-
...article.publishedAt ? { published_at: article.publishedAt } : {},
|
|
19390
|
-
url: article.url,
|
|
19391
|
-
...article.imageUrl ? { image_url: article.imageUrl } : {}
|
|
19392
|
-
}));
|
|
19393
|
-
const lines = [`Found ${results.length} articles for "${query}":
|
|
19394
|
-
`];
|
|
19395
|
-
for (const article of results) {
|
|
19396
|
-
lines.push(`- [${article.source}] ${article.title}`);
|
|
19397
|
-
if (article.description) lines.push(` ${article.description}`);
|
|
19398
|
-
if (article.author) lines.push(` Author: ${article.author}`);
|
|
19399
|
-
lines.push(` Date: ${article.publishedAt}`);
|
|
19400
|
-
lines.push(` URL: ${article.url}`);
|
|
19401
|
-
if (article.imageUrl) lines.push(` Image: ${article.imageUrl}`);
|
|
19402
|
-
lines.push("");
|
|
19403
|
-
}
|
|
19404
|
-
return structuredResult(lines.join("\n"), { query, articles });
|
|
19405
|
-
}
|
|
19406
|
-
);
|
|
19407
|
-
}
|
|
19408
|
-
|
|
19409
19344
|
// src/tools/generate-tts.ts
|
|
19410
19345
|
function isTransientStatus(status) {
|
|
19411
19346
|
return status === 0 || status === 502 || status === 503 || status === 504;
|
|
@@ -20110,68 +20045,6 @@ ${RENDER_ATTACH_RULE} In batch mode, set node_id per item (see items) and form_i
|
|
|
20110
20045
|
);
|
|
20111
20046
|
}
|
|
20112
20047
|
|
|
20113
|
-
// src/tools/search-music.ts
|
|
20114
|
-
function registerSearchMusicTool(server) {
|
|
20115
|
-
server.registerTool(
|
|
20116
|
-
"clipform_search_music",
|
|
20117
|
-
{
|
|
20118
|
-
title: "Search Music",
|
|
20119
|
-
description: `Search for royalty-free music tracks and ambient sounds. Quiz forms especially benefit from background music - it keeps energy up between questions. Also consider it for multi-step surveys and longer forms. Pass the returned URL as the audio for the slideshow video template via clipform_render_video_template. Returns download URLs, duration, artist, and license info.`,
|
|
20120
|
-
inputSchema: external_exports.object({
|
|
20121
|
-
query: external_exports.string().min(1).describe("What to search for (e.g. 'upbeat quiz background', 'calm ambient', 'playful pizzicato')"),
|
|
20122
|
-
count: external_exports.number().int().min(1).max(10).optional().describe("Max results (default: 5)"),
|
|
20123
|
-
instrumentalOnly: external_exports.boolean().optional().default(true).describe("Only instrumental tracks (default: true)"),
|
|
20124
|
-
minDuration: external_exports.number().positive().optional().describe("Minimum duration in seconds"),
|
|
20125
|
-
maxDuration: external_exports.number().positive().optional().describe("Maximum duration in seconds"),
|
|
20126
|
-
tags: external_exports.array(external_exports.string()).optional().describe("Genre/mood tags to filter by. Multiple tags are ANDed together (e.g. ['ambient', 'chill'] matches tracks tagged both).")
|
|
20127
|
-
}),
|
|
20128
|
-
outputSchema: external_exports.object({
|
|
20129
|
-
query: external_exports.string(),
|
|
20130
|
-
tracks: external_exports.array(
|
|
20131
|
-
external_exports.object({
|
|
20132
|
-
title: external_exports.string().optional(),
|
|
20133
|
-
artist: external_exports.string().optional(),
|
|
20134
|
-
url: external_exports.string(),
|
|
20135
|
-
duration: external_exports.number().optional(),
|
|
20136
|
-
source: external_exports.string().optional(),
|
|
20137
|
-
license: external_exports.string().optional()
|
|
20138
|
-
})
|
|
20139
|
-
).describe("Matching tracks (empty if none); pass a url as the audio for the slideshow template")
|
|
20140
|
-
}),
|
|
20141
|
-
// Fetches from an external royalty-free music provider - openWorldHint:
|
|
20142
|
-
// true (#2976).
|
|
20143
|
-
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true }
|
|
20144
|
-
},
|
|
20145
|
-
async ({ query, count, instrumentalOnly, minDuration, maxDuration, tags }) => {
|
|
20146
|
-
const result = await callApi("/internal/search-music", {
|
|
20147
|
-
body: { query, count, instrumentalOnly, minDuration, maxDuration, tags }
|
|
20148
|
-
});
|
|
20149
|
-
if (!result.ok) return apiErrorResult(result);
|
|
20150
|
-
const results = result.data.results;
|
|
20151
|
-
if (!results.length) return structuredResult(`No music found for "${query}".`, { query, tracks: [] });
|
|
20152
|
-
const tracks = results.map((item) => ({
|
|
20153
|
-
...item.title ? { title: item.title } : {},
|
|
20154
|
-
...item.artist ? { artist: item.artist } : {},
|
|
20155
|
-
url: item.url,
|
|
20156
|
-
...typeof item.duration === "number" ? { duration: item.duration } : {},
|
|
20157
|
-
...item.source ? { source: item.source } : {},
|
|
20158
|
-
...item.license ? { license: item.license } : {}
|
|
20159
|
-
}));
|
|
20160
|
-
const lines = [`Found ${results.length} tracks for "${query}":
|
|
20161
|
-
`];
|
|
20162
|
-
for (const item of results) {
|
|
20163
|
-
lines.push(`- ${item.title} by ${item.artist}`);
|
|
20164
|
-
lines.push(` URL: ${item.url}`);
|
|
20165
|
-
if (item.duration) lines.push(` Duration: ${item.duration}s`);
|
|
20166
|
-
if (item.source) lines.push(` Source: ${item.source}`);
|
|
20167
|
-
if (item.license) lines.push(` License: ${item.license}`);
|
|
20168
|
-
lines.push("");
|
|
20169
|
-
}
|
|
20170
|
-
return structuredResult(lines.join("\n"), { query, tracks });
|
|
20171
|
-
}
|
|
20172
|
-
);
|
|
20173
|
-
}
|
|
20174
|
-
|
|
20175
20048
|
// src/tools/list-compositions.ts
|
|
20176
20049
|
function summarizeSchema(schema) {
|
|
20177
20050
|
if (!schema || typeof schema !== "object" || !schema.properties) {
|
|
@@ -20650,139 +20523,6 @@ Pass job_ids to check a whole batch in ONE call - one line of status per job. Pa
|
|
|
20650
20523
|
);
|
|
20651
20524
|
}
|
|
20652
20525
|
|
|
20653
|
-
// src/tools/fetch-boundary.ts
|
|
20654
|
-
var NOMINATIM_BASE = "https://nominatim.openstreetmap.org/search";
|
|
20655
|
-
var USER_AGENT = "Clipform/1.0 (https://clipform.io)";
|
|
20656
|
-
function polygonArea(ring) {
|
|
20657
|
-
let area = 0;
|
|
20658
|
-
for (let i = 0; i < ring.length - 1; i++) {
|
|
20659
|
-
area += ring[i][0] * ring[i + 1][1];
|
|
20660
|
-
area -= ring[i + 1][0] * ring[i][1];
|
|
20661
|
-
}
|
|
20662
|
-
return Math.abs(area / 2);
|
|
20663
|
-
}
|
|
20664
|
-
function simplifyRing(ring, maxPoints) {
|
|
20665
|
-
if (ring.length <= maxPoints) return ring;
|
|
20666
|
-
const step = Math.max(1, Math.floor(ring.length / maxPoints));
|
|
20667
|
-
const result = [];
|
|
20668
|
-
for (let i = 0; i < ring.length - 1; i += step) {
|
|
20669
|
-
result.push(ring[i]);
|
|
20670
|
-
}
|
|
20671
|
-
result.push(ring[ring.length - 1]);
|
|
20672
|
-
return result;
|
|
20673
|
-
}
|
|
20674
|
-
function registerFetchBoundaryTool(server) {
|
|
20675
|
-
server.registerTool(
|
|
20676
|
-
"clipform_fetch_boundary",
|
|
20677
|
-
{
|
|
20678
|
-
title: "Fetch Geographic Boundary",
|
|
20679
|
-
description: `Fetch a GeoJSON boundary polygon for a country, city, or region. Returns simplified GeoJSON ready to use as the 'boundary' prop in the Map composition.
|
|
20680
|
-
|
|
20681
|
-
mainlandOnly excludes small islands and overseas territories (e.g. Corsica for France, Hawaii for USA).`,
|
|
20682
|
-
inputSchema: external_exports.object({
|
|
20683
|
-
query: external_exports.string().describe("Place name (e.g. 'France', 'Paris', 'Tokyo', 'Brazil')"),
|
|
20684
|
-
type: external_exports.enum(["country", "city", "state", "region"]).default("country").describe("Type of place to search for"),
|
|
20685
|
-
mainlandOnly: external_exports.boolean().default(true).describe("Keep only the largest landmass, excluding small islands and overseas territories"),
|
|
20686
|
-
maxPoints: external_exports.number().default(500).describe("Maximum points per polygon ring for simplification (default 500, lower = smaller payload)")
|
|
20687
|
-
}),
|
|
20688
|
-
outputSchema: external_exports.object({
|
|
20689
|
-
name: external_exports.string().describe("Resolved place name"),
|
|
20690
|
-
geometry_type: external_exports.enum(["Polygon", "MultiPolygon"]),
|
|
20691
|
-
size_kb: external_exports.number().describe("Approximate size of the returned GeoJSON in KB"),
|
|
20692
|
-
mainland_only: external_exports.boolean(),
|
|
20693
|
-
geojson: external_exports.string().describe("The Feature GeoJSON as a JSON string - use as the boundary prop in the Map composition")
|
|
20694
|
-
}),
|
|
20695
|
-
// Fetches from Nominatim (OpenStreetMap), an external system -
|
|
20696
|
-
// openWorldHint: true (#2976).
|
|
20697
|
-
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true }
|
|
20698
|
-
},
|
|
20699
|
-
async ({ query, type, mainlandOnly, maxPoints }) => {
|
|
20700
|
-
const params = new URLSearchParams({
|
|
20701
|
-
format: "geojson",
|
|
20702
|
-
polygon_geojson: "1",
|
|
20703
|
-
polygon_threshold: "0.001",
|
|
20704
|
-
limit: "1"
|
|
20705
|
-
});
|
|
20706
|
-
if (type === "country") {
|
|
20707
|
-
params.set("country", query);
|
|
20708
|
-
} else if (type === "city") {
|
|
20709
|
-
params.set("city", query);
|
|
20710
|
-
} else {
|
|
20711
|
-
params.set("q", query);
|
|
20712
|
-
}
|
|
20713
|
-
const url2 = `${NOMINATIM_BASE}?${params}`;
|
|
20714
|
-
let response;
|
|
20715
|
-
try {
|
|
20716
|
-
response = await fetch(url2, {
|
|
20717
|
-
headers: { "User-Agent": USER_AGENT }
|
|
20718
|
-
});
|
|
20719
|
-
} catch {
|
|
20720
|
-
return errorResult(`Boundary lookup failed for "${query}". Try again, or try a different name or type.`);
|
|
20721
|
-
}
|
|
20722
|
-
if (!response.ok) {
|
|
20723
|
-
return errorResult(`Boundary lookup failed for "${query}". Try again, or try a different name or type.`);
|
|
20724
|
-
}
|
|
20725
|
-
const data = await response.json();
|
|
20726
|
-
if (!data.features?.length) {
|
|
20727
|
-
return refusedResult(`No boundary found for "${query}" (type: ${type}). Try a different name or type.`);
|
|
20728
|
-
}
|
|
20729
|
-
const feature = data.features[0];
|
|
20730
|
-
let geometry = feature.geometry;
|
|
20731
|
-
if (geometry.type === "MultiPolygon" && mainlandOnly) {
|
|
20732
|
-
const withArea = geometry.coordinates.map((poly, i) => ({
|
|
20733
|
-
index: i,
|
|
20734
|
-
coords: poly,
|
|
20735
|
-
area: polygonArea(poly[0])
|
|
20736
|
-
}));
|
|
20737
|
-
withArea.sort((a, b) => b.area - a.area);
|
|
20738
|
-
const largestArea = withArea[0].area;
|
|
20739
|
-
const kept = withArea.filter((p) => p.area > largestArea * 0.05);
|
|
20740
|
-
geometry = {
|
|
20741
|
-
type: kept.length === 1 ? "Polygon" : "MultiPolygon",
|
|
20742
|
-
coordinates: kept.length === 1 ? kept[0].coords : kept.map((p) => p.coords)
|
|
20743
|
-
};
|
|
20744
|
-
}
|
|
20745
|
-
if (geometry.type === "Polygon") {
|
|
20746
|
-
geometry.coordinates = geometry.coordinates.map(
|
|
20747
|
-
(ring) => simplifyRing(ring, maxPoints)
|
|
20748
|
-
);
|
|
20749
|
-
} else if (geometry.type === "MultiPolygon") {
|
|
20750
|
-
geometry.coordinates = geometry.coordinates.map(
|
|
20751
|
-
(poly) => poly.map((ring) => simplifyRing(ring, maxPoints))
|
|
20752
|
-
);
|
|
20753
|
-
}
|
|
20754
|
-
const result = {
|
|
20755
|
-
type: "Feature",
|
|
20756
|
-
properties: { name: feature.properties.display_name },
|
|
20757
|
-
geometry
|
|
20758
|
-
};
|
|
20759
|
-
const geojsonStr = JSON.stringify(result);
|
|
20760
|
-
const sizeKb = Number((geojsonStr.length / 1024).toFixed(1));
|
|
20761
|
-
return structuredResult(
|
|
20762
|
-
[
|
|
20763
|
-
`Boundary fetched for: ${feature.properties.display_name}`,
|
|
20764
|
-
`Geometry: ${geometry.type}`,
|
|
20765
|
-
`Size: ${sizeKb} KB`,
|
|
20766
|
-
mainlandOnly ? `Mainland filter: applied (islands < 5% of largest landmass removed)` : `Mainland filter: off`,
|
|
20767
|
-
``,
|
|
20768
|
-
`Use this as the boundary.geojson prop in Map:`,
|
|
20769
|
-
``,
|
|
20770
|
-
"```json",
|
|
20771
|
-
geojsonStr,
|
|
20772
|
-
"```"
|
|
20773
|
-
].join("\n"),
|
|
20774
|
-
{
|
|
20775
|
-
name: feature.properties.display_name,
|
|
20776
|
-
geometry_type: geometry.type,
|
|
20777
|
-
size_kb: sizeKb,
|
|
20778
|
-
mainland_only: mainlandOnly,
|
|
20779
|
-
geojson: geojsonStr
|
|
20780
|
-
}
|
|
20781
|
-
);
|
|
20782
|
-
}
|
|
20783
|
-
);
|
|
20784
|
-
}
|
|
20785
|
-
|
|
20786
20526
|
// src/tools/get-guide.ts
|
|
20787
20527
|
function registerGetGuideTool(server, caps = FULL_CAPS) {
|
|
20788
20528
|
const aliasHint = Object.entries(FORM_TYPE_ALIASES).map(([alias, target]) => `${alias} \u2192 ${target}`).join(", ");
|
|
@@ -21021,17 +20761,14 @@ function createServer(options) {
|
|
|
21021
20761
|
if (options?.variables === true) registerSetLinkVariablesTool(server);
|
|
21022
20762
|
if (options?.guide === true) registerSetNodeGuideTool(server);
|
|
21023
20763
|
registerLogGenerationTool(server);
|
|
21024
|
-
registerSearchNewsTool(server);
|
|
21025
20764
|
registerGenerateTtsTool(server);
|
|
21026
20765
|
registerSearchMediaTool(server);
|
|
21027
20766
|
registerRenderCompositionTool(server);
|
|
21028
|
-
registerSearchMusicTool(server);
|
|
21029
20767
|
registerListCompositionsTool(server);
|
|
21030
20768
|
registerListVideoTemplatesTool(server);
|
|
21031
20769
|
registerRenderVideoTemplateTool(server);
|
|
21032
20770
|
registerListAssetsTool(server);
|
|
21033
20771
|
registerCheckRenderTool(server);
|
|
21034
|
-
registerFetchBoundaryTool(server);
|
|
21035
20772
|
registerGetGuideTool(server, caps);
|
|
21036
20773
|
registerGetWorkflowTool(server, caps);
|
|
21037
20774
|
registerPrompts(server, caps);
|
|
@@ -21106,4 +20843,4 @@ export {
|
|
|
21106
20843
|
* MIT Licensed
|
|
21107
20844
|
*)
|
|
21108
20845
|
*/
|
|
21109
|
-
//# sourceMappingURL=chunk-
|
|
20846
|
+
//# sourceMappingURL=chunk-LXIO5NZH.js.map
|