@contenthero/mcp 0.4.13 → 0.4.14
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/format.d.ts +15 -0
- package/dist/format.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +145 -53
- package/dist/model-presentation.d.ts +35 -0
- package/dist/model-presentation.d.ts.map +1 -0
- package/dist/models.d.ts +2 -2
- package/dist/models.d.ts.map +1 -1
- package/dist/server.d.ts +25 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/widget/generation.d.ts +1 -1
- package/dist/widget-uri.d.ts +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How a model is PRESENTED, remembered from the catalog the server already fetches.
|
|
3
|
+
*
|
|
4
|
+
* ## ⭐⭐ THIS IS NOT THE CACHE THAT WAS DELETED
|
|
5
|
+
*
|
|
6
|
+
* This package once fetched the whole model catalog on every chip and kept a module-level copy behind a
|
|
7
|
+
* `catch` that returned the RAW ID. An id reads enough like a label that a failed fetch surfaced as a chip
|
|
8
|
+
* flickering between kebab case and title case, with nothing logging why. Deleting it was correct.
|
|
9
|
+
*
|
|
10
|
+
* Two things are different here. A failure renders NO CHIP, never an id: the map is simply empty and every
|
|
11
|
+
* card loads without one, which is exactly what happens today. And it costs no request of its own, because
|
|
12
|
+
* `resolveModelEnums` already calls `listModels` at startup for the tool enums and these fields ride along
|
|
13
|
+
* in the same rows.
|
|
14
|
+
*
|
|
15
|
+
* ## Why it exists at all
|
|
16
|
+
*
|
|
17
|
+
* The prompt, the model and the shape are all decided at SUBMIT, but a card used to show none of them until
|
|
18
|
+
* the generation FINISHED and the completed row carried its own provenance. So the entire loading period,
|
|
19
|
+
* which is the part a person actually watches, was placeholders and nothing else.
|
|
20
|
+
*
|
|
21
|
+
* ⛔ IT LIVES IN ITS OWN MODULE because `server.ts` reads it and `models.ts` writes it. Putting it in
|
|
22
|
+
* either one makes those two import each other, and a cycle between the tool definitions and the catalog
|
|
23
|
+
* resolver is the kind of thing that works until a bundler orders them differently.
|
|
24
|
+
*/
|
|
25
|
+
import type { ModelInfo } from '@contenthero/sdk';
|
|
26
|
+
export interface ModelChip {
|
|
27
|
+
name: string;
|
|
28
|
+
brandColor: string | null;
|
|
29
|
+
iconKey: string | null;
|
|
30
|
+
}
|
|
31
|
+
/** Replace what is known about every model. Called once per catalog fetch. */
|
|
32
|
+
export declare function rememberModelPresentation(models: readonly ModelInfo[]): void;
|
|
33
|
+
/** The chip for a model id, or null when the catalog does not name it. Null means render nothing. */
|
|
34
|
+
export declare function modelChipFor(modelId: string | null | undefined): ModelChip | null;
|
|
35
|
+
//# sourceMappingURL=model-presentation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-presentation.d.ts","sourceRoot":"","sources":["../src/model-presentation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAEjD,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;CACvB;AAID,8EAA8E;AAC9E,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,SAAS,SAAS,EAAE,GAAG,IAAI,CAY5E;AAED,qGAAqG;AACrG,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,SAAS,GAAG,IAAI,CAEjF"}
|
package/dist/models.d.ts
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
*/
|
|
22
22
|
import type { ContentHero } from '@contenthero/sdk';
|
|
23
23
|
/** Fallback image-generation models (used only if discovery is unreachable). */
|
|
24
|
-
export declare const IMAGE_MODELS_FALLBACK: readonly ["nano-banana-2", "nano-banana", "nano-banana-pro", "seedream-5-lite", "gpt-image-2", "flux-2-pro", "flux-1-kontext"];
|
|
24
|
+
export declare const IMAGE_MODELS_FALLBACK: readonly ["nano-banana-2", "nano-banana", "nano-banana-pro", "seedream-5-lite", "gpt-image-2", "flux-2-pro", "flux-1-kontext-pro"];
|
|
25
25
|
/** Fallback video-generation models (used only if discovery is unreachable). */
|
|
26
26
|
export declare const VIDEO_MODELS_FALLBACK: readonly ["veo-3.1-fast", "veo-3.1-quality", "seedance-2", "seedance-2-fast", "kling-3.0", "kling-2.6", "kling-3.0-motion-control", "kling-2.6-motion-control", "wan-2.6"];
|
|
27
27
|
/** Fallback audio-generation models (used only if discovery is unreachable). */
|
|
@@ -68,7 +68,7 @@ export declare const BOARD_TYPES: readonly ["character", "pose", "mascot", "crea
|
|
|
68
68
|
/** Short selection guidance baked into the generate_board boardType description. */
|
|
69
69
|
export declare const BOARD_TYPE_GUIDANCE = "character = a person or figure. pose = a pose / action sheet. mascot = a brand mascot. creature = a creature or animal. weapon = a weapon. vehicle = a vehicle. object = a prop or object. location = an environment. shot = a multi-shot storyboard in one image.";
|
|
70
70
|
/** Short selection guidance baked into each generate tool's modelId description. */
|
|
71
|
-
export declare const IMAGE_MODEL_GUIDANCE = "nano-banana-2 = strong general default (1K/2K/4K). gpt-image-2 = best text rendering (resolution 1K/2K/4K, no quality param). flux-2-pro
|
|
71
|
+
export declare const IMAGE_MODEL_GUIDANCE = "nano-banana-2 = strong general default (1K/2K/4K). gpt-image-2 = best text rendering (resolution 1K/2K/4K, no quality param). flux-2-pro / seedream-5-lite / nano-banana-pro = alternatives. flux-1-kontext-pro = edit/recreate. Higher tiers are separate ids, not a parameter: flux-2-flex, flux-1-kontext-max, wan-2.7-image-pro. Pass referenceImages for image-to-image / editing.";
|
|
72
72
|
export declare const VIDEO_MODEL_GUIDANCE = "veo-3.1-fast / veo-3.1-quality = high quality clips with audio. seedance-2 / seedance-2-fast = multimodal references; startFrame(+endFrame) = frame mode, referenceImages/Videos/Audio = references mode. kling-3.0 (per-shot via shots) / kling-2.6 = strong motion. wan-2.6 (multiShot for multi-shot mode) = alternative. The motion-control variants require an input image plus an input video.";
|
|
73
73
|
export declare const AUDIO_MODEL_GUIDANCE = "elevenlabs-tts = text to speech (needs text + voiceId). elevenlabs-music = music from a prompt. elevenlabs-sound-effects = a sound effect from a prompt.";
|
|
74
74
|
export declare const EDIT_AUDIO_MODEL_GUIDANCE = "The audio-processing model. Each transforms audio input into audio output. elevenlabs-voice-isolator = remove background noise and music, leaving clean speech (synchronous). auphonic-enhance = level loudness and clean up background noise (asynchronous; poll get_generation_status).";
|
package/dist/models.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../src/models.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../src/models.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAGnD,gFAAgF;AAChF,eAAO,MAAM,qBAAqB,oIAQxB,CAAA;AAEV,gFAAgF;AAChF,eAAO,MAAM,qBAAqB,4KAUxB,CAAA;AAEV,gFAAgF;AAChF,eAAO,MAAM,qBAAqB,6EAIxB,CAAA;AAEV,uGAAuG;AACvG,eAAO,MAAM,0BAA0B,4DAA6D,CAAA;AAEpG,uEAAuE;AACvE,eAAO,MAAM,uBAAuB,yDAA0D,CAAA;AAE9F,wEAAwE;AACxE,eAAO,MAAM,wBAAwB,+DAAgE,CAAA;AAQrG,+DAA+D;AAC/D,MAAM,MAAM,SAAS,GAAG,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,CAAA;AAE7C,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,SAAS,CAAA;IAChB,KAAK,EAAE,SAAS,CAAA;IAChB,KAAK,EAAE,SAAS,CAAA;IAChB,0FAA0F;IAC1F,SAAS,EAAE,SAAS,CAAA;IACpB,OAAO,EAAE,SAAS,CAAA;IAClB,OAAO,EAAE,SAAS,CAAA;IAClB,2EAA2E;IAC3E,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,CAAA;CACtD;AAMD;;;;;GAKG;AACH,wBAAgB,kBAAkB,IAAI,kBAAkB,CAUvD;AAED;;;;GAIG;AACH,wBAAsB,iBAAiB,CAAC,SAAS,EAAE,MAAM,WAAW,GAAG,OAAO,CAAC,kBAAkB,CAAC,CA6DjG;AAED;;;;;GAKG;AACH,eAAO,MAAM,WAAW,yGAUd,CAAA;AAEV,oFAAoF;AACpF,eAAO,MAAM,mBAAmB,uQACsO,CAAA;AAEtQ,oFAAoF;AACpF,eAAO,MAAM,oBAAoB,4XAC0V,CAAA;AAE3X,eAAO,MAAM,oBAAoB,yYACuW,CAAA;AAExY,eAAO,MAAM,oBAAoB,6JAC2H,CAAA;AAE5J,eAAO,MAAM,yBAAyB,8RACuP,CAAA;AAE7R,eAAO,MAAM,sBAAsB,yKACqI,CAAA;AAExK,eAAO,MAAM,uBAAuB,+MAC0K,CAAA"}
|
package/dist/server.d.ts
CHANGED
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
* (generate / upscale / lip-sync) gets a tool whose schema only carries its own
|
|
30
30
|
* fields, and per-tool modelId enums prevent cross-type model misuse.
|
|
31
31
|
*/
|
|
32
|
+
import type { Implementation } from '@modelcontextprotocol/sdk/types.js';
|
|
32
33
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
33
34
|
import { ContentHero, type Generation } from '@contenthero/sdk';
|
|
34
35
|
export { GENERATION_WIDGET_URI } from './widget-uri.js';
|
|
@@ -167,6 +168,30 @@ export interface BuildServerOptions {
|
|
|
167
168
|
* enums are supplied pre-resolved, and the backend client is resolved per call.
|
|
168
169
|
*/
|
|
169
170
|
export declare function registerTools(server: McpServer, opts: RegisterToolsOptions): void;
|
|
171
|
+
/**
|
|
172
|
+
* ⭐⭐⭐ **WHO THIS SERVER SAYS IT IS, FOR BOTH TRANSPORTS, FROM ONE PLACE.**
|
|
173
|
+
*
|
|
174
|
+
* The stdio server named itself `contenthero` here. The HOSTED server never named itself at all: the app's
|
|
175
|
+
* route calls `createMcpHandler(register, {}, config)` and that empty second argument is `serverOptions`,
|
|
176
|
+
* so `mcp-handler` fell back to its own default, `"mcp-typescript server on vercel"`.
|
|
177
|
+
*
|
|
178
|
+
* ⛔⛔ **AND THAT DEFAULT IS WHAT A USER NAMES THE CONNECTION.** Measured in Gemini 2026-09-21: the "Save
|
|
179
|
+
* your custom app" dialog pre-filled **"Mcp Typescript Server On Vercel"** next to our laurel mark and a
|
|
180
|
+
* correct list of 88 tools. Every person connecting over the hosted transport has been offered someone
|
|
181
|
+
* else's build-tool name as our product name, in the one dialog that decides what they will call us
|
|
182
|
+
* forever. Claude and ChatGPT never surfaced it, so nothing made it visible until a host put it in a text
|
|
183
|
+
* field.
|
|
184
|
+
*
|
|
185
|
+
* ⚠️ EXPORTED, NOT RESTATED. A second literal in the app's route would be a third spelling of one identity
|
|
186
|
+
* across two repos, which is the same shape as the widget uri problem: correct on the day it is typed and
|
|
187
|
+
* silently stale afterwards.
|
|
188
|
+
*
|
|
189
|
+
* ⛔ The VERSION half used to parse `../package.json` relative to `import.meta.url` inside a try/catch
|
|
190
|
+
* returning '0.0.0'. Same defect as the widget read and the same blast radius: under a bundler the path
|
|
191
|
+
* does not exist, so the hosted server reported 0.0.0 and the catch made it silent. A version is a
|
|
192
|
+
* build-time fact, so it is generated alongside the widget and no path resolution is left to get wrong.
|
|
193
|
+
*/
|
|
194
|
+
export declare const SERVER_INFO: Implementation;
|
|
170
195
|
/**
|
|
171
196
|
* Build a stdio-style server bound to a single env-configured client. The model
|
|
172
197
|
* enums are resolved live from the discovery catalog (the client has a key).
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAA;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAgBnE,OAAO,EACL,WAAW,EAcX,KAAK,UAAU,EAChB,MAAM,kBAAkB,CAAA;AAazB,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AAEvD,OAAO,EAEL,KAAK,kBAAkB,EASxB,MAAM,aAAa,CAAA;AACpB,OAAO,EAeL,KAAK,mBAAmB,EAgEzB,MAAM,aAAa,CAAA;AA4LpB;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,cAAc,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAoEpF;AAqGD;;;;;;;;;;;GAWG;AACH,KAAK,eAAe,GAChB,kBAAkB,GAClB,cAAc,GACd,QAAQ,GACR,cAAc;AAChB,wGAAwG;GACtG,aAAa;AACf;;;;;;GAMG;GACD,cAAc,CAAA;AA8HlB;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAA;IAChD,6EAA6E;IAC7E,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;;;OAIG;IACH,MAAM,CAAC,EAAE,eAAe,CAAA;CACzB;AA+KD;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,iFAAiF;AACjF,MAAM,MAAM,SAAS,GAAG,CAAC,KAAK,CAAC,EAAE,OAAO,KAAK,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,CAAA;AAE/E,MAAM,WAAW,oBAAoB;IACnC,8EAA8E;IAC9E,SAAS,EAAE,SAAS,CAAA;IACpB,2EAA2E;IAC3E,MAAM,EAAE,kBAAkB,CAAA;CAC3B;AAED,MAAM,WAAW,kBAAkB;IACjC,kFAAkF;IAClF,SAAS,CAAC,EAAE,MAAM,WAAW,CAAA;CAC9B;AAYD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,oBAAoB,GAAG,IAAI,CA8yGjF;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,WAAW,EAAE,cA2BzB,CAAA;AAED;;;GAGG;AACH,wBAAsB,WAAW,CAAC,OAAO,GAAE,kBAAuB,GAAG,OAAO,CAAC,SAAS,CAAC,CAMtF"}
|