post-engineer-mcp 1.31.0 → 1.33.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.
Files changed (88) hide show
  1. package/README.md +51 -9
  2. package/dist/analytics.d.ts +1 -0
  3. package/dist/analytics.js +23 -1
  4. package/dist/analytics.js.map +1 -1
  5. package/dist/client-posts.d.ts +10 -0
  6. package/dist/client-posts.js +15 -0
  7. package/dist/client-posts.js.map +1 -0
  8. package/dist/client-publishing-accounts.d.ts +3 -0
  9. package/dist/client-publishing-accounts.js +18 -0
  10. package/dist/client-publishing-accounts.js.map +1 -0
  11. package/dist/client-types.d.ts +140 -0
  12. package/dist/client-types.js +2 -0
  13. package/dist/client-types.js.map +1 -0
  14. package/dist/client-user-media.d.ts +29 -0
  15. package/dist/client-user-media.js +135 -0
  16. package/dist/client-user-media.js.map +1 -0
  17. package/dist/client-video-task.d.ts +2 -0
  18. package/dist/client-video-task.js +9 -0
  19. package/dist/client-video-task.js.map +1 -0
  20. package/dist/client.d.ts +11 -134
  21. package/dist/client.js +32 -40
  22. package/dist/client.js.map +1 -1
  23. package/dist/cloned-voice-client.d.ts +11 -0
  24. package/dist/cloned-voice-client.js +134 -0
  25. package/dist/cloned-voice-client.js.map +1 -0
  26. package/dist/cloned-voice-tools.d.ts +70 -0
  27. package/dist/cloned-voice-tools.js +60 -0
  28. package/dist/cloned-voice-tools.js.map +1 -0
  29. package/dist/http-auth.d.ts +27 -0
  30. package/dist/http-auth.js +148 -0
  31. package/dist/http-auth.js.map +1 -0
  32. package/dist/http-rate-limit.d.ts +14 -0
  33. package/dist/http-rate-limit.js +28 -0
  34. package/dist/http-rate-limit.js.map +1 -0
  35. package/dist/http-transport.d.ts +13 -0
  36. package/dist/http-transport.js +311 -0
  37. package/dist/http-transport.js.map +1 -0
  38. package/dist/image-guards.d.ts +6 -0
  39. package/dist/image-guards.js +30 -0
  40. package/dist/image-guards.js.map +1 -0
  41. package/dist/index.js +69 -29
  42. package/dist/index.js.map +1 -1
  43. package/dist/language.d.ts +11 -0
  44. package/dist/language.js +19 -0
  45. package/dist/language.js.map +1 -0
  46. package/dist/limits.d.ts +39 -0
  47. package/dist/limits.js +39 -0
  48. package/dist/limits.js.map +1 -1
  49. package/dist/prompts.d.ts +9 -0
  50. package/dist/prompts.js +125 -0
  51. package/dist/prompts.js.map +1 -0
  52. package/dist/require-title.d.ts +1 -0
  53. package/dist/require-title.js +12 -0
  54. package/dist/require-title.js.map +1 -0
  55. package/dist/schedule-shapes.d.ts +70 -0
  56. package/dist/schedule-shapes.js +98 -0
  57. package/dist/schedule-shapes.js.map +1 -0
  58. package/dist/script-segments.d.ts +49 -0
  59. package/dist/script-segments.js +222 -0
  60. package/dist/script-segments.js.map +1 -0
  61. package/dist/single-video-shape.d.ts +340 -0
  62. package/dist/single-video-shape.js +74 -0
  63. package/dist/single-video-shape.js.map +1 -0
  64. package/dist/tools-call.d.ts +4 -0
  65. package/dist/tools-call.js +25 -0
  66. package/dist/tools-call.js.map +1 -0
  67. package/dist/tools-posts.d.ts +41 -0
  68. package/dist/tools-posts.js +45 -0
  69. package/dist/tools-posts.js.map +1 -0
  70. package/dist/tools-publishing-accounts.d.ts +29 -0
  71. package/dist/tools-publishing-accounts.js +38 -0
  72. package/dist/tools-publishing-accounts.js.map +1 -0
  73. package/dist/tools-single-video.d.ts +10 -0
  74. package/dist/tools-single-video.js +143 -0
  75. package/dist/tools-single-video.js.map +1 -0
  76. package/dist/tools-user-media.d.ts +27 -0
  77. package/dist/tools-user-media.js +38 -0
  78. package/dist/tools-user-media.js.map +1 -0
  79. package/dist/tools.d.ts +32 -230
  80. package/dist/tools.js +42 -295
  81. package/dist/tools.js.map +1 -1
  82. package/dist/video-task-tools.d.ts +14 -0
  83. package/dist/video-task-tools.js +20 -0
  84. package/dist/video-task-tools.js.map +1 -0
  85. package/dist/voice-filters.d.ts +21 -0
  86. package/dist/voice-filters.js +76 -0
  87. package/dist/voice-filters.js.map +1 -0
  88. package/package.json +6 -2
@@ -0,0 +1,311 @@
1
+ // Streamable HTTP transport for the MCP server (Phase 6, P6-1).
2
+ //
3
+ // This module wires the same McpServer built by createPostEngineerMcpServer()
4
+ // to the SDK's StreamableHTTPServerTransport instead of stdio. No tool is
5
+ // added, removed, or changed here: the HTTP endpoint serves exactly the
6
+ // tools the stdio server serves, with the same handlers.
7
+ //
8
+ // Authentication (Phase 6, P6-2): when OAuth is configured
9
+ // (MCP_OAUTH_ISSUER + MCP_RESOURCE, see http-auth.ts), every /mcp
10
+ // request must present a valid Bearer access token with the mcp:tools
11
+ // scope, and the listener may bind a non-loopback host. Without OAuth
12
+ // configured the P6-1 behaviour stands: loopback only, and a remote
13
+ // bind is refused at startup — an unauthenticated remote endpoint is
14
+ // no longer possible, not merely warned about. The stdio default is
15
+ // unchanged: without --http-transport, no port is opened.
16
+ //
17
+ // Regardless of authentication, it also validates request
18
+ // origin and host against DNS rebinding: the SDK's own rebinding
19
+ // protection defaults to off and validates nothing without configured
20
+ // allowlists, so this module enforces it directly. A request with a
21
+ // non-loopback Origin is rejected with 403 (non-browser clients send no
22
+ // Origin and are unaffected), and while the listener is bound to
23
+ // loopback, a non-loopback Host header is rejected too — a rebinding
24
+ // request from a malicious page arrives with the attacker's domain as
25
+ // Host, and binding 127.0.0.1 alone does not stop the browser on the
26
+ // same machine from reaching it.
27
+ //
28
+ // The transport is stateless (sessionIdGenerator: undefined): the SDK
29
+ // keeps no session state in memory, no Mcp-Session-Id header is issued,
30
+ // and no tool state is shared between requests beyond what the protocol
31
+ // itself requires. The SDK forbids reusing a stateless transport across
32
+ // requests ("Stateless transport cannot be reused across requests"), and
33
+ // a server instance can only connect to one transport, so every /mcp
34
+ // request builds a fresh server (from the factory) plus a fresh transport
35
+ // and closes both when the request ends.
36
+ import { createServer } from 'node:http';
37
+ import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
38
+ import { authenticateHttpRequest, bearerTokenPresented, createHttpAuthenticator, protectedResourceDocument, unauthorizedHttpResponse, } from './http-auth.js';
39
+ import { createHttpRateLimiter } from './http-rate-limit.js';
40
+ // Maximum JSON-RPC request body accepted on /mcp (1 MiB).
41
+ const MAX_BODY_BYTES = 1024 * 1024;
42
+ const LOOPBACK_HOSTS = new Set(['127.0.0.1', '::1', 'localhost']);
43
+ function isLoopbackHost(host) {
44
+ return LOOPBACK_HOSTS.has(host);
45
+ }
46
+ function parsePort(value) {
47
+ // Number('') is 0: without this guard an empty --http-port= or
48
+ // MCP_HTTP_PORT='' would silently bind an ephemeral port instead of
49
+ // failing fast on the invalid value.
50
+ if (value.trim() === '') {
51
+ throw new Error(`Invalid MCP HTTP port: "${value}" — pass --http-port <0-65535> or set MCP_HTTP_PORT.`);
52
+ }
53
+ const port = Number(value);
54
+ if (!Number.isInteger(port) || port < 0 || port > 65535) {
55
+ throw new Error(`Invalid MCP HTTP port: "${value}" — pass --http-port <0-65535> or set MCP_HTTP_PORT.`);
56
+ }
57
+ return port;
58
+ }
59
+ function flagValue(argv, flag, envValue) {
60
+ for (const [i, arg] of argv.entries()) {
61
+ if (arg === flag) {
62
+ const value = argv[i + 1];
63
+ if (value === undefined || value.startsWith('--')) {
64
+ throw new Error(`Missing value for ${flag} — pass ${flag} <value>.`);
65
+ }
66
+ return value;
67
+ }
68
+ if (arg.startsWith(`${flag}=`)) {
69
+ return arg.slice(flag.length + 1);
70
+ }
71
+ }
72
+ return envValue;
73
+ }
74
+ // Parse the HTTP transport startup options. Returns null unless the
75
+ // explicit --http-transport flag is present: the stdio default and the
76
+ // legacy --http flag never open a port. Throws on invalid input so the
77
+ // process fails fast instead of binding an unintended address.
78
+ export function parseHttpTransportOptions(argv, env) {
79
+ if (!argv.includes('--http-transport')) {
80
+ return null;
81
+ }
82
+ const host = flagValue(argv, '--host', env.MCP_HTTP_HOST) ?? '127.0.0.1';
83
+ const portValue = flagValue(argv, '--http-port', env.MCP_HTTP_PORT);
84
+ if (portValue === undefined) {
85
+ throw new Error('Missing MCP HTTP port — pass --http-port <port> or set MCP_HTTP_PORT.');
86
+ }
87
+ const port = parsePort(portValue);
88
+ const allowRemote = argv.includes('--allow-remote') || env.MCP_HTTP_ALLOW_REMOTE === 'true';
89
+ if (!isLoopbackHost(host) && !allowRemote) {
90
+ throw new Error(`Refusing to bind the MCP HTTP server to non-loopback host "${host}" without --allow-remote. ` +
91
+ 'Bind loopback, or pass --allow-remote explicitly; when OAuth is configured, requests are authenticated per request (see http-auth.ts).');
92
+ }
93
+ return { host, port, allowRemote };
94
+ }
95
+ function formatHostForUrl(host) {
96
+ return host.includes(':') ? `[${host}]` : host;
97
+ }
98
+ // Hostname from a Host header: strips a trailing :port, unwraps [::1]
99
+ // brackets, and tolerates a bare IPv6 literal (which has several colons
100
+ // and no brackets). Returns undefined for a missing or malformed value.
101
+ function hostHostname(host) {
102
+ if (host === undefined || host.length === 0)
103
+ return undefined;
104
+ if (host.startsWith('[')) {
105
+ const end = host.indexOf(']');
106
+ return end === -1 ? undefined : host.slice(1, end);
107
+ }
108
+ const colon = host.indexOf(':');
109
+ if (colon !== -1 && host.indexOf(':', colon + 1) !== -1)
110
+ return host;
111
+ return colon === -1 ? host : host.slice(0, colon);
112
+ }
113
+ // DNS-rebinding guard (see the module header). Non-browser clients send
114
+ // no Origin and pass; a browser Origin must name a loopback host. While
115
+ // the listener is bound to loopback, the Host header must name one too.
116
+ function isAllowedRequest(req, options) {
117
+ const origin = req.headers.origin;
118
+ if (origin !== undefined) {
119
+ try {
120
+ // URL keeps brackets on IPv6 literals: http://[::1]:5173 has
121
+ // hostname "[::1]", while LOOPBACK_HOSTS stores the bare "::1".
122
+ // Strip them so the Origin branch agrees with the Host branch.
123
+ const originHost = new URL(origin).hostname.replace(/^\[|\]$/g, '');
124
+ if (!LOOPBACK_HOSTS.has(originHost))
125
+ return false;
126
+ }
127
+ catch {
128
+ return false;
129
+ }
130
+ }
131
+ if (isLoopbackHost(options.host)) {
132
+ const hostname = hostHostname(req.headers.host);
133
+ if (hostname === undefined || !LOOPBACK_HOSTS.has(hostname))
134
+ return false;
135
+ }
136
+ return true;
137
+ }
138
+ async function readBody(req, res) {
139
+ const chunks = [];
140
+ let totalBytes = 0;
141
+ let tooLarge = false;
142
+ for await (const chunk of req) {
143
+ const buffer = chunk;
144
+ totalBytes += buffer.length;
145
+ if (totalBytes > MAX_BODY_BYTES) {
146
+ // Do not return mid-stream: leaving a for-await loop destroys the
147
+ // request stream, which can reset the connection before the 413
148
+ // response flushes. Drain instead (discarding, never storing), and
149
+ // answer 413 after the body ends.
150
+ tooLarge = true;
151
+ continue;
152
+ }
153
+ chunks.push(buffer);
154
+ }
155
+ if (tooLarge) {
156
+ res.writeHead(413, { 'content-type': 'application/json' });
157
+ res.end(JSON.stringify({ error: 'Request body too large' }));
158
+ return undefined;
159
+ }
160
+ if (chunks.length === 0)
161
+ return undefined;
162
+ const text = Buffer.concat(chunks).toString('utf-8');
163
+ try {
164
+ return JSON.parse(text);
165
+ }
166
+ catch {
167
+ res.writeHead(400, { 'content-type': 'application/json' });
168
+ res.end(JSON.stringify({
169
+ jsonrpc: '2.0',
170
+ error: { code: -32700, message: 'Parse error' },
171
+ id: null,
172
+ }));
173
+ return undefined;
174
+ }
175
+ }
176
+ // Start the HTTP server. serverFactory builds one McpServer per /mcp
177
+ // request (see the stateless note above); the HTTP listener itself holds
178
+ // no server or tool state. Serves POST /mcp, a plain GET /health probe,
179
+ // and GET /.well-known/oauth-protected-resource when auth is configured.
180
+ // When auth is null the P6-1 loopback-only behaviour applies and any
181
+ // remote bind is refused here, before listening: --allow-remote without
182
+ // OAuth configured is a startup error, not a warning, since P6-2.
183
+ export async function serveHttpTransport(serverFactory, options, auth = null) {
184
+ if (auth === null) {
185
+ if (!isLoopbackHost(options.host)) {
186
+ throw new Error(`Refusing to bind the MCP HTTP server to non-loopback host "${options.host}" without OAuth ` +
187
+ 'authentication configured (set MCP_OAUTH_ISSUER and MCP_RESOURCE). Bind loopback, or configure OAuth first.');
188
+ }
189
+ if (options.allowRemote) {
190
+ throw new Error('Refusing to start the MCP HTTP server with --allow-remote without OAuth authentication ' +
191
+ 'configured (set MCP_OAUTH_ISSUER and MCP_RESOURCE). An unauthenticated remote endpoint is not allowed.');
192
+ }
193
+ }
194
+ const authenticator = auth === null ? null : createHttpAuthenticator(auth);
195
+ const rateLimiter = auth === null
196
+ ? null
197
+ : createHttpRateLimiter({ limit: auth.rateLimitPerMinute, windowMs: 60_000 });
198
+ const httpServer = createServer(async (req, res) => {
199
+ try {
200
+ if (!isAllowedRequest(req, options)) {
201
+ res.writeHead(403, { 'content-type': 'application/json' });
202
+ res.end(JSON.stringify({ error: 'Forbidden: non-loopback origin or host' }));
203
+ return;
204
+ }
205
+ const pathname = new URL(req.url ?? '/', 'http://localhost').pathname;
206
+ if (pathname === '/health' && req.method === 'GET') {
207
+ res.writeHead(200, { 'content-type': 'application/json' });
208
+ res.end(JSON.stringify({ ok: true }));
209
+ return;
210
+ }
211
+ if (pathname === '/.well-known/oauth-protected-resource' && req.method === 'GET') {
212
+ if (auth === null) {
213
+ res.writeHead(404, { 'content-type': 'application/json' });
214
+ res.end(JSON.stringify({ error: 'Not found' }));
215
+ return;
216
+ }
217
+ res.writeHead(200, { 'content-type': 'application/json' });
218
+ res.end(JSON.stringify(protectedResourceDocument(auth)));
219
+ return;
220
+ }
221
+ if (pathname !== '/mcp') {
222
+ res.writeHead(404, { 'content-type': 'application/json' });
223
+ res.end(JSON.stringify({ error: 'Not found' }));
224
+ return;
225
+ }
226
+ // Authenticate before any tool is built or dispatched: an
227
+ // unauthenticated request never learns the tool list, and a
228
+ // request authenticated as one subject never runs as another.
229
+ // The rate limit is per verified subject, checked after auth so
230
+ // unauthenticated traffic cannot burn another subject's budget.
231
+ let authContext;
232
+ if (auth !== null && authenticator !== null && rateLimiter !== null) {
233
+ const verified = await authenticateHttpRequest(req, authenticator);
234
+ if (verified === null) {
235
+ unauthorizedHttpResponse(res, auth, bearerTokenPresented(req));
236
+ return;
237
+ }
238
+ const limited = rateLimiter.check(verified.sub);
239
+ if (!limited.allowed) {
240
+ res.writeHead(429, {
241
+ 'content-type': 'application/json',
242
+ 'retry-after': String(limited.retryAfterSeconds),
243
+ });
244
+ res.end(JSON.stringify({ error: 'Too many requests.' }));
245
+ return;
246
+ }
247
+ authContext = verified;
248
+ }
249
+ // Fresh server + transport per request: the SDK's stateless
250
+ // transport cannot be reused, and a server binds to one transport.
251
+ // The factory receives the verified context so the per-request
252
+ // client forwards this subject's bearer to the web API — the
253
+ // server never falls back to another subject's credential.
254
+ const server = serverFactory(authContext);
255
+ const transport = new StreamableHTTPServerTransport({ sessionIdGenerator: undefined });
256
+ let cleanedUp = false;
257
+ const cleanup = () => {
258
+ if (cleanedUp)
259
+ return;
260
+ cleanedUp = true;
261
+ // allSettled never rejects, so no rejection handler is needed here.
262
+ void Promise.allSettled([transport.close(), server.close()]);
263
+ };
264
+ res.on('close', cleanup);
265
+ await server.connect(transport);
266
+ if (req.method === 'POST') {
267
+ const parsedBody = await readBody(req, res);
268
+ // readBody already answered 400/413 on failure; res.writableEnded
269
+ // distinguishes that case from a successfully parsed body.
270
+ if (res.writableEnded) {
271
+ cleanup();
272
+ return;
273
+ }
274
+ await transport.handleRequest(req, res, parsedBody);
275
+ }
276
+ else {
277
+ await transport.handleRequest(req, res);
278
+ }
279
+ cleanup();
280
+ }
281
+ catch (error) {
282
+ // Guard on headersSent, not writableEnded: if the handler already
283
+ // wrote response headers, writeHead would throw ERR_HTTP_HEADERS_SENT
284
+ // out of this catch and kill the process on an unhandled rejection.
285
+ if (!res.headersSent) {
286
+ res.writeHead(500, { 'content-type': 'application/json' });
287
+ res.end(JSON.stringify({ error: 'Internal server error' }));
288
+ }
289
+ else if (!res.writableEnded) {
290
+ res.end();
291
+ }
292
+ console.error('MCP HTTP request failed:', error);
293
+ }
294
+ });
295
+ await new Promise((resolve, reject) => {
296
+ httpServer.once('error', reject);
297
+ httpServer.listen(options.port, options.host, () => resolve());
298
+ });
299
+ const address = httpServer.address();
300
+ const boundPort = typeof address === 'object' && address !== null ? address.port : options.port;
301
+ const url = `http://${formatHostForUrl(options.host)}:${boundPort}/mcp`;
302
+ return {
303
+ url,
304
+ close: async () => {
305
+ await new Promise((resolve) => {
306
+ httpServer.close(() => resolve());
307
+ });
308
+ },
309
+ };
310
+ }
311
+ //# sourceMappingURL=http-transport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http-transport.js","sourceRoot":"","sources":["../src/http-transport.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,EAAE;AACF,8EAA8E;AAC9E,0EAA0E;AAC1E,wEAAwE;AACxE,yDAAyD;AACzD,EAAE;AACF,2DAA2D;AAC3D,kEAAkE;AAClE,sEAAsE;AACtE,sEAAsE;AACtE,oEAAoE;AACpE,qEAAqE;AACrE,oEAAoE;AACpE,0DAA0D;AAC1D,EAAE;AACF,0DAA0D;AAC1D,iEAAiE;AACjE,sEAAsE;AACtE,oEAAoE;AACpE,wEAAwE;AACxE,iEAAiE;AACjE,qEAAqE;AACrE,sEAAsE;AACtE,qEAAqE;AACrE,iCAAiC;AACjC,EAAE;AACF,sEAAsE;AACtE,wEAAwE;AACxE,wEAAwE;AACxE,wEAAwE;AACxE,yEAAyE;AACzE,qEAAqE;AACrE,0EAA0E;AAC1E,yCAAyC;AACzC,OAAO,EAAE,YAAY,EAA0D,MAAM,WAAW,CAAC;AACjG,OAAO,EAAE,6BAA6B,EAAE,MAAM,oDAAoD,CAAC;AAEnG,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACpB,uBAAuB,EACvB,yBAAyB,EACzB,wBAAwB,GAGzB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,qBAAqB,EAAwB,MAAM,sBAAsB,CAAC;AAanF,0DAA0D;AAC1D,MAAM,cAAc,GAAG,IAAI,GAAG,IAAI,CAAC;AAEnC,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,CAAC,WAAW,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC,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ooLargeError carrying the full path when the
3
+ * image exceeds the library size limit.
4
+ */
5
+ export declare function assertImageSize(sizeBytes: number, path: string): void;
6
+ export declare function mimeTypeForImagePath(path: string): string;
@@ -0,0 +1,30 @@
1
+ // Shared guards for persona library image reads, extracted from client.ts
2
+ // so the client stays under the file-size ratchet. The size guard is
3
+ // shared by the stat pre-check and the post-read check so the limit and
4
+ // the message text can't drift apart.
5
+ import { extname } from 'node:path';
6
+ import { ImageTooLargeError } from './errors.js';
7
+ import { MAX_LIBRARY_IMAGE_BYTES } from './limits.js';
8
+ /**
9
+ * Throws the typed ImageTooLargeError carrying the full path when the
10
+ * image exceeds the library size limit.
11
+ */
12
+ export function assertImageSize(sizeBytes, path) {
13
+ if (sizeBytes > MAX_LIBRARY_IMAGE_BYTES) {
14
+ throw new ImageTooLargeError(path, sizeBytes);
15
+ }
16
+ }
17
+ export function mimeTypeForImagePath(path) {
18
+ const extension = extname(path).toLowerCase();
19
+ // No special hidden-file check needed: Node's extname('.PNG') is ''
20
+ // (a leading dot with no other dots is not an extension), so dotfiles
21
+ // fall through to the unsupported-extension rejection below.
22
+ if (extension === '.png')
23
+ return 'image/png';
24
+ if (extension === '.webp')
25
+ return 'image/webp';
26
+ if (extension === '.jpg' || extension === '.jpeg')
27
+ return 'image/jpeg';
28
+ throw new Error(`Unsupported image extension "${extension || '(none)'}": use JPG/JPEG, PNG, or WebP.`);
29
+ }
30
+ //# sourceMappingURL=image-guards.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image-guards.js","sourceRoot":"","sources":["../src/image-guards.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,qEAAqE;AACrE,wEAAwE;AACxE,sCAAsC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAEtD;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,SAAiB,EAAE,IAAY;IAC7D,IAAI,SAAS,GAAG,uBAAuB,EAAE,CAAC;QACxC,MAAM,IAAI,kBAAkB,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IAChD,CAAC;AACH,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,IAAY;IAC/C,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC;IAC9C,oEAAoE;IACpE,sEAAsE;IACtE,6DAA6D;IAC7D,IAAI,SAAS,KAAK,MAAM;QAAE,OAAO,WAAW,CAAC;IAC7C,IAAI,SAAS,KAAK,OAAO;QAAE,OAAO,YAAY,CAAC;IAC/C,IAAI,SAAS,KAAK,MAAM,IAAI,SAAS,KAAK,OAAO;QAAE,OAAO,YAAY,CAAC;IACvE,MAAM,IAAI,KAAK,CACb,gCAAgC,SAAS,IAAI,QAAQ,gCAAgC,CACtF,CAAC;AACJ,CAAC"}
package/dist/index.js CHANGED
@@ -4,18 +4,17 @@ import { fileURLToPath } from 'node:url';
4
4
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
5
5
  import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
6
6
  import { PostEngineerClient, MAX_LIBRARY_IMAGES, MAX_LIBRARY_IMAGE_MB, MAX_UPLOAD_VIDEO_GB } from './client.js';
7
- import { CreatePersonaShape, ListPersonasShape, ListVoicesShape, ListFacesShape, UpdatePersonaShape, ListSocialAccountsShape, ConnectAccountShape, ListSchedulesShape, GetTokenBalanceShape, ListPostsShape, CancelScheduleShape, GetSlotShape, UpdateSlotTopicShape, DeleteSlotShape, ListVideoGenerationsShape, GetVideoGenerationShape, ListTokenTransactionsShape, GetPersonaDeletePreviewShape, DeletePersonaShape, DisconnectAccountShape, GeneratePersonaVideosShape, GetVideoStatusShape, GetVideoTaskProgressShape, ListPersonaImagesShape, AddPersonaImageShape, UpdatePersonaImageShape, RemovePersonaImageShape, PublishVideoDirectShape, handleCreatePersona, handleListPersonas, handleListVoices, handleListFaces, handleUpdatePersona, handleListSocialAccounts, handleConnectAccount, handleListSchedules, handleListPosts, handleCancelSchedule, handleGetSlot, handleUpdateSlotTopic, handleDeleteSlot, handleListVideoGenerations, handleGetVideoGeneration, handleListTokenTransactions, handleGetPersonaDeletePreview, handleDeletePersona, handleDisconnectAccount, handleGetTokenBalance, handleGeneratePersonaVideos, handleGetVideoStatus, handleGetVideoTaskProgress, handleListPersonaImages, handleAddPersonaImage, handleUpdatePersonaImage, handleRemovePersonaImage, handlePublishVideoDirect, } from './tools.js';
8
- import { trackEvent } from './analytics.js';
9
- //---------------
10
- // Track every tool invocation as a PostHog analytics event.
11
- // The wrapper never throws and never blocks the tool.
12
- //---------------
13
- function withTracking(toolName, handler) {
14
- return async (args) => {
15
- trackEvent('mcp_tool_called', { toolName });
16
- return handler(args);
17
- };
18
- }
7
+ import { registerPrompts } from './prompts.js';
8
+ import { CreatePersonaShape, ListPersonasShape, ListVoicesShape, ListClonedVoicesShape, CreateClonedVoiceShape, DeleteClonedVoiceShape, PreviewClonedVoiceShape, ListFacesShape, UpdatePersonaShape, ListSocialAccountsShape, ConnectAccountShape, ListSchedulesShape, GetTokenBalanceShape, ListPostsShape, CancelScheduleShape, GetSlotShape, UpdateSlotTitleShape, DeleteSlotShape, ListVideoGenerationsShape, GetVideoGenerationShape, ListTokenTransactionsShape, GetPersonaDeletePreviewShape, DeletePersonaShape, DisconnectAccountShape, GetVideoStatusShape, GetVideoTaskProgressShape, ListPersonaImagesShape, AddPersonaImageShape, UpdatePersonaImageShape, RemovePersonaImageShape, PublishVideoDirectShape, handleCreatePersona, handleListPersonas, handleListVoices, handleListClonedVoices, handleCreateClonedVoice, handleDeleteClonedVoice, handlePreviewClonedVoice, handleListFaces, handleUpdatePersona, handleListSocialAccounts, handleConnectAccount, handleListSchedules, handleListPosts, handleCancelSchedule, handleGetSlot, handleUpdateSlotTitle, handleDeleteSlot, handleListVideoGenerations, handleGetVideoGeneration, handleListTokenTransactions, handleGetPersonaDeletePreview, handleDeletePersona, handleDisconnectAccount, handleGetTokenBalance, handleGetVideoStatus, handleGetVideoTaskProgress, handleListPersonaImages, handleAddPersonaImage, handleUpdatePersonaImage, handleRemovePersonaImage, handlePublishVideoDirect, } from './tools.js';
9
+ import { GetPersonaPublishingAccountsShape, SetPersonaPublishingAccountsShape, handleGetPersonaPublishingAccounts, handleSetPersonaPublishingAccounts, } from './tools-publishing-accounts.js';
10
+ import { GetClonedVoiceShape, handleGetClonedVoice } from './cloned-voice-tools.js';
11
+ import { GetPostShape, GetPostMetricsShape, handleGetPost, handleGetPostMetrics, } from './tools-posts.js';
12
+ import { CancelVideoTaskShape, handleCancelVideoTask, } from './video-task-tools.js';
13
+ import { GeneratePersonaVideoShape, ValidateScriptShape, ValidateScriptDescription, handleGeneratePersonaVideo, handleValidateScript } from './tools-single-video.js';
14
+ import { CheckMediaDescription, CheckMediaShape, UploadMediaDescription, UploadMediaShape, handleCheckMedia, handleUploadMedia } from './tools-user-media.js';
15
+ import { withTracking } from './analytics.js';
16
+ import { parseHttpTransportOptions, serveHttpTransport } from './http-transport.js';
17
+ import { parseHttpAuthOptions } from './http-auth.js';
19
18
  // The server advertises the package version: import it so a version bump in
20
19
  // package.json flows through without touching this file.
21
20
  const { default: pkg } = await import('../package.json', { with: { type: 'json' } });
@@ -32,14 +31,30 @@ export function createPostEngineerMcpServer(client) {
32
31
  name: 'post-engineer-mcp',
33
32
  version: pkg.version,
34
33
  });
35
- server.tool('create_persona', 'Create a new AI persona with avatar, voice, language, and niche prompt. avatarUrl is REQUIRED: every persona has a face. A video without a face is a per-video choice — set options.faceless on generate_persona_videos.', CreatePersonaShape, withTracking('create_persona', async (args) => {
34
+ registerPrompts(server);
35
+ server.tool('create_persona', 'Create a new AI persona with avatar, voice, language, and niche prompt. avatarUrl is REQUIRED: every persona has a face. A video without a face is a per-video choice — set options.faceless on generate_persona_video.', CreatePersonaShape, withTracking('create_persona', async (args) => {
36
36
  return handleCreatePersona(apiClient, args);
37
37
  }));
38
38
  server.tool('list_personas', 'List all existing personas for the authenticated user.', ListPersonasShape, withTracking('list_personas', async () => {
39
39
  return handleListPersonas(apiClient);
40
40
  }));
41
- server.tool('list_voices', 'List all available persona voices (voiceId options) for the authenticated user.', ListVoicesShape, withTracking('list_voices', async () => {
42
- return handleListVoices(apiClient);
41
+ server.tool('list_voices', 'List persona voices (voiceId options): 65 English house voices, each with a text description of how it sounds plus gender/accent/kind, and your ready clones. Filter with gender, origin and search (e.g. "deep calm").', ListVoicesShape, withTracking('list_voices', async (args) => {
42
+ return handleListVoices(apiClient, args);
43
+ }));
44
+ server.tool('list_cloned_voices', 'List per-user Chatterbox voice clones (status, voice_id when ready).', ListClonedVoicesShape, withTracking('list_cloned_voices', async () => {
45
+ return handleListClonedVoices(apiClient);
46
+ }));
47
+ server.tool('create_cloned_voice', 'Register a voice clone from a short HTTPS audio URL (requires explicit consent).', CreateClonedVoiceShape, withTracking('create_cloned_voice', async (args) => {
48
+ return handleCreateClonedVoice(apiClient, args);
49
+ }));
50
+ server.tool('get_cloned_voice', 'Get one voice clone by id: its status (poll after create_cloned_voice until ready or failed) and voice_id once ready.', GetClonedVoiceShape, withTracking('get_cloned_voice', async (args) => {
51
+ return handleGetClonedVoice(apiClient, args);
52
+ }));
53
+ server.tool('delete_cloned_voice', 'Delete one of your voice clones by id.', DeleteClonedVoiceShape, withTracking('delete_cloned_voice', async (args) => {
54
+ return handleDeleteClonedVoice(apiClient, args);
55
+ }));
56
+ server.tool('preview_cloned_voice', 'Synthesize a short MP3 preview for a ready voice clone, optionally speaking your own text (returns base64 audio; 10 previews per day).', PreviewClonedVoiceShape, withTracking('preview_cloned_voice', async (args) => {
57
+ return handlePreviewClonedVoice(apiClient, args);
43
58
  }));
44
59
  server.tool('list_faces', 'List default/stock persona faces (avatar options). Each face includes id, url, name, gender, age (single number, not a range), ethnicity, hair, and description in English so you can pick without seeing the photo. Pass a face url as avatarUrl when calling create_persona.', ListFacesShape, withTracking('list_faces', async () => {
45
60
  return handleListFaces(apiClient);
@@ -47,26 +62,32 @@ export function createPostEngineerMcpServer(client) {
47
62
  server.tool('update_persona', 'Update an existing AI persona (only the provided fields change).', UpdatePersonaShape, withTracking('update_persona', async (args) => {
48
63
  return handleUpdatePersona(apiClient, args);
49
64
  }));
50
- server.tool('list_social_accounts', 'List connected social accounts (YouTube, Instagram, LinkedIn, Bluesky) with the account IDs needed for batch posting.', ListSocialAccountsShape, withTracking('list_social_accounts', async () => {
65
+ server.tool('list_social_accounts', 'List connected social accounts (YouTube, Instagram, LinkedIn, Bluesky) with the account IDs needed for posting.', ListSocialAccountsShape, withTracking('list_social_accounts', async () => {
51
66
  return handleListSocialAccounts(apiClient);
52
67
  }));
68
+ server.tool('get_persona_publishing_accounts', "List a persona's default publishing accounts per provider. generate_persona_video falls back to these when no account IDs are passed; explicit IDs always win.", GetPersonaPublishingAccountsShape, withTracking('get_persona_publishing_accounts', async (args) => {
69
+ return handleGetPersonaPublishingAccounts(apiClient, args);
70
+ }));
71
+ server.tool('set_persona_publishing_accounts', "Replace a persona's default publishing accounts (per provider). Account IDs come from list_social_accounts. Providers mapped to empty arrays keep no defaults.", SetPersonaPublishingAccountsShape, withTracking('set_persona_publishing_accounts', async (args) => {
72
+ return handleSetPersonaPublishingAccounts(apiClient, args);
73
+ }));
53
74
  server.tool('connect_account', 'Connect a social account. For youtube/instagram/linkedin: returns an authorization URL — the user must open it in a browser and authorize, then the account connects automatically (verify with list_social_accounts). For bluesky: connects directly with handle + appPassword (app password, not the main account password).', ConnectAccountShape, withTracking('connect_account', async (args) => {
54
75
  return handleConnectAccount(apiClient, args);
55
76
  }));
56
77
  server.tool('list_schedules', 'List all automation schedules for the authenticated user.', ListSchedulesShape, withTracking('list_schedules', async () => {
57
78
  return handleListSchedules(apiClient);
58
79
  }));
59
- server.tool('list_posts', 'List upcoming (scheduled) and past (published/failed) posts across all connected accounts. Returns two lists: upcoming slots and recent results, each with id, slot_at, status (awaiting|generating|ready|publishing|published|failed), topic, schedule_id, task_id, progress (0-100: 0 for awaiting, 100 for ready/publishing/published, live engine progress for generating, last known for failed), stage (engine pipeline stage like "lipsync" while generating, "done" when complete, null otherwise), queuePosition/queueTotal (1-based position among the schedule\'s awaiting+generating slots; awaiting slots only, null otherwise). Failed slots also carry error and retryable (boolean: true when the failure looks transient). Use when the user asks about their posts — what is coming next, what already went out, how far a video has generated, where it sits in the queue, or why a post failed. Combine with list_schedules or list_social_accounts when persona/account names are needed.', ListPostsShape, withTracking('list_posts', async (args) => {
80
+ server.tool('list_posts', 'List upcoming (scheduled) and past (published/failed) posts across all connected accounts. Returns two lists: upcoming slots and recent results, each with id, slot_at, status (awaiting|generating|ready|publishing|published|failed), title, schedule_id, task_id, progress (0-100: 0 for awaiting, 100 for ready/publishing/published, live engine progress for generating, last known for failed), stage (engine pipeline stage like "lipsync" while generating, "done" when complete, null otherwise), queuePosition/queueTotal (1-based position among the schedule\'s awaiting+generating slots; awaiting slots only, null otherwise). Failed slots also carry error and retryable (boolean: true when the failure looks transient). Use when the user asks about their posts — what is coming next, what already went out, how far a video has generated, where it sits in the queue, or why a post failed. Combine with list_schedules or list_social_accounts when persona/account names are needed.', ListPostsShape, withTracking('list_posts', async (args) => {
60
81
  return handleListPosts(apiClient, args);
61
82
  }));
62
- server.tool('cancel_schedule', 'Cancel (delete) an automation schedule by its schedule ID. Use list_schedules to find the ID.', CancelScheduleShape, withTracking('cancel_schedule', async (args) => {
83
+ server.tool('cancel_schedule', 'Cancel (delete) an automation schedule by its schedule ID. Unpublished slots (pending, generating, or ready) are removed so they cannot publish, and their prepaid tokens are refunded. A post already publishing or already published is not recalled. Use list_schedules to find the ID.', CancelScheduleShape, withTracking('cancel_schedule', async (args) => {
63
84
  return handleCancelSchedule(apiClient, args);
64
85
  }));
65
- server.tool('get_slot', 'Get one scheduled post\'s full detail by slot ID: status, topic, scheduled time, generation progress, its schedule (providers, publish mode) and persona. Use the slotId from list_posts.', GetSlotShape, withTracking('get_slot', async (args) => {
86
+ server.tool('get_slot', 'Get one scheduled post\'s full detail by slot ID: status, title, scheduled time, generation progress, its schedule (providers, publish mode) and persona. Use the slotId from list_posts.', GetSlotShape, withTracking('get_slot', async (args) => {
66
87
  return handleGetSlot(apiClient, args);
67
88
  }));
68
- server.tool('update_slot_topic', 'Edit the topic text of one scheduled post. Only a slot that has not started generating (status pending/awaiting) can be edited — published or mid-flight slots are rejected.', UpdateSlotTopicShape, withTracking('update_slot_topic', async (args) => {
69
- return handleUpdateSlotTopic(apiClient, args);
89
+ server.tool('update_slot_title', 'Edit the title text of one scheduled post. Only a slot that has not started generating (status pending/awaiting) can be edited — published or mid-flight slots are rejected.', UpdateSlotTitleShape, withTracking('update_slot_title', async (args) => {
90
+ return handleUpdateSlotTitle(apiClient, args);
70
91
  }));
71
92
  server.tool('delete_slot', 'Delete one scheduled post slot. Only pending (awaiting) or failed slots can be deleted; published or mid-flight slots are rejected. The schedule\'s last slot cannot be deleted — use cancel_schedule to delete the whole schedule instead.', DeleteSlotShape, withTracking('delete_slot', async (args) => {
72
93
  return handleDeleteSlot(apiClient, args);
@@ -77,6 +98,15 @@ export function createPostEngineerMcpServer(client) {
77
98
  server.tool('get_video_generation', 'Get one video generation\'s detail by generation ID (the generationId field from list_video_generations).', GetVideoGenerationShape, withTracking('get_video_generation', async (args) => {
78
99
  return handleGetVideoGeneration(apiClient, args);
79
100
  }));
101
+ server.tool('cancel_video_task', 'Cancel/remove one of your video tasks on the generation engine by task id (from get_video_status, get_video_task_progress, get_post or list_posts). Only the caller\'s own task can be cancelled; a persona-scoped API key can only cancel tasks belonging to its personas. Unknown or already-finished tasks return an error. No token refund is issued by this call.', CancelVideoTaskShape, withTracking('cancel_video_task', async (args) => {
102
+ return handleCancelVideoTask(apiClient, args);
103
+ }));
104
+ server.tool('get_post', 'Get one post\'s full detail by id, whichever kind it is: a scheduled slot (kind "slot") or a direct video generation (kind "generation"). The server resolves the id, so there is no need to guess between get_slot and get_video_generation. Both kinds carry live generation progress while the video is still generating.', GetPostShape, withTracking('get_post', async (args) => {
105
+ return handleGetPost(apiClient, args);
106
+ }));
107
+ server.tool('get_post_metrics', 'Get per-video performance snapshots (views, likes, comments, saves) of published posts for one window (24h or 7d), newest first, optionally filtered by persona, account, provider (network) and script angle. Returns rows plus truncated (true when more rows exist than the server cap).', GetPostMetricsShape, withTracking('get_post_metrics', async (args) => {
108
+ return handleGetPostMetrics(apiClient, args);
109
+ }));
80
110
  server.tool('list_token_transactions', 'List the token ledger: every token credit and debit (purchases, generation spends, refunds), newest first, with amounts, reasons, and the related generation when there is one. Use to audit where tokens went.', ListTokenTransactionsShape, withTracking('list_token_transactions', async (args) => {
81
111
  return handleListTokenTransactions(apiClient, args);
82
112
  }));
@@ -92,16 +122,17 @@ export function createPostEngineerMcpServer(client) {
92
122
  server.tool('get_token_balance', 'Get the prepaid token wallet balance. Check before triggering video generation, which costs tokens.', GetTokenBalanceShape, withTracking('get_token_balance', async () => {
93
123
  return handleGetTokenBalance(apiClient);
94
124
  }));
95
- server.tool('generate_persona_videos', 'Generate and schedule 1-10 persona videos in ONE operation. Product rule: generation is always tied to publishing — one call generates each video AND schedules its automatic publish; there is no separate schedule step and no orphan generation. personaId is REQUIRED even for faceless videos (set options.faceless: true to drop the face; the persona voice, niche, and script prompt still apply). topics is one topic per video; the server assigns publish slots (topic i lands on day startAt\'s date + floor(i/times.length) at the i-th sorted time in times). Pass providers plus per-provider account IDs (see list_social_accounts), startAt (ISO datetime, wall-clock in timezone when naive), times (HH:MM, 24h), and timezone. Set mode to \'asap\' to publish each video the moment its generation finishes instead of scheduling it — startAt and times must NOT be set then. Every slot must be 3h-30d ahead. idempotencyKey is generated automatically; reuse it to retry without generating twice (replayed: true). Poll each slot\'s taskId with get_video_task_progress.', GeneratePersonaVideosShape, withTracking('generate_persona_videos', async (args) => {
96
- return handleGeneratePersonaVideos(apiClient, args);
97
- }));
125
+ server.tool('generate_persona_video', 'Generate and schedule ONE persona video from a complete script. Product rule: generation is always tied to publishing — one call generates the video AND schedules its automatic publish; there is no orphan generation. Send the full script as segments (first hook, then body, last CTA; 60-200 words total, body at least 30, CTA 5-20, hook 15-40 words ending with terminal punctuation) — no LLM expands it. title is the slot label for this video. Pass providers plus per-provider account IDs (see list_social_accounts), startAt (ISO datetime, wall-clock in timezone when naive), times (HH:MM, 24h), and timezone. Set mode to \'asap\' to publish the video the moment its generation finishes instead of scheduling it — startAt and times must NOT be set then. The slot must be 3h-30d ahead. idempotencyKey is generated automatically; reuse it to retry without generating twice (replayed: true). Poll the slot\'s taskId with get_video_task_progress.', GeneratePersonaVideoShape, withTracking('generate_persona_video', async (args) => handleGeneratePersonaVideo(apiClient, args)));
126
+ server.tool('validate_script', ValidateScriptDescription, ValidateScriptShape, withTracking('validate_script', async (args) => handleValidateScript(apiClient, args)));
127
+ server.tool('upload_media', UploadMediaDescription, UploadMediaShape, withTracking('upload_media', async (args) => handleUploadMedia(apiClient, args)));
128
+ server.tool('check_media', CheckMediaDescription, CheckMediaShape, withTracking('check_media', async (args) => handleCheckMedia(apiClient, args)));
98
129
  server.tool('get_video_status', 'Check the generation status and fetch final video URLs for a taskId.', GetVideoStatusShape, withTracking('get_video_status', async (args) => {
99
130
  return handleGetVideoStatus(apiClient, args);
100
131
  }));
101
- server.tool('get_video_task_progress', 'Poll one video task for its machine-readable progress: returns {task_id, state, progress, stage, error}. error is the engine failure reason when state is -1 (failed), null otherwise. Use per-video (1/6, 2/6, ...) after generate_persona_videos; prefer this over get_video_status when only progress matters.', GetVideoTaskProgressShape, withTracking('get_video_task_progress', async (args) => {
132
+ server.tool('get_video_task_progress', 'Poll one video task for its machine-readable progress: returns {task_id, state, progress, stage, error}. error is the engine failure reason when state is -1 (failed), null otherwise. Use for the video after generate_persona_video; prefer this over get_video_status when only progress matters.', GetVideoTaskProgressShape, withTracking('get_video_task_progress', async (args) => {
102
133
  return handleGetVideoTaskProgress(apiClient, args);
103
134
  }));
104
- server.tool('list_persona_images', `List the image library of a persona (up to ${MAX_LIBRARY_IMAGES} tagged images). Each entry has id, tag, description, and is_primary. Use the ids with generate_persona_videos options.imageId to force a specific image for every video in one call.`, ListPersonaImagesShape, withTracking('list_persona_images', async (args) => {
135
+ server.tool('list_persona_images', `List the image library of a persona (up to ${MAX_LIBRARY_IMAGES} tagged images). Each entry has id, tag, description, and is_primary. Use the ids with generate_persona_video options.imageId to force a specific image for the video.`, ListPersonaImagesShape, withTracking('list_persona_images', async (args) => {
105
136
  return handleListPersonaImages(apiClient, args);
106
137
  }));
107
138
  server.tool('add_persona_image', `Add an image to a persona image library from a local file path (JPG/JPEG, PNG, or WebP, max ${MAX_LIBRARY_IMAGE_MB}MB). Optional tag and description drive the deterministic per-video image selection. The server rejects full libraries (${MAX_LIBRARY_IMAGES} max).`, AddPersonaImageShape, withTracking('add_persona_image', async (args) => {
@@ -133,9 +164,18 @@ export function isMainModule() {
133
164
  }
134
165
  }
135
166
  async function main() {
136
- // Fail fast: without a key every tool call would fail with an opaque 401.
137
- const apiKey = requireApiKey();
138
- const server = createPostEngineerMcpServer(new PostEngineerClient({ apiKey }));
167
+ // Without --http-transport the server stays on stdio, no port; with OAuth, HTTP requests authenticate, else loopback only.
168
+ const httpOptions = parseHttpTransportOptions(process.argv.slice(2), process.env);
169
+ if (httpOptions !== null) {
170
+ // HTTP-only parse: stdio startup must never fail on a malformed HTTP limit.
171
+ const authOptions = parseHttpAuthOptions(process.env);
172
+ // OAuth mode needs no local key; loopback mode still fails fast without one.
173
+ // Fresh server per request; the bearer is forwarded as this request's web API credential.
174
+ const apiKey = authOptions !== null ? process.env.POST_ENGINEER_API_KEY : requireApiKey();
175
+ await serveHttpTransport((auth) => createPostEngineerMcpServer(new PostEngineerClient({ apiKey: auth?.bearer ?? apiKey })), httpOptions, authOptions);
176
+ return;
177
+ }
178
+ const server = createPostEngineerMcpServer(new PostEngineerClient({ apiKey: requireApiKey() }));
139
179
  const transport = new StdioServerTransport();
140
180
  await server.connect(transport);
141
181
  }
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAChH,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,uBAAuB,EACvB,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,cAAc,EACd,mBAAmB,EACnB,YAAY,EACZ,oBAAoB,EACpB,eAAe,EACf,yBAAyB,EACzB,uBAAuB,EACvB,0BAA0B,EAC1B,4BAA4B,EAC5B,kBAAkB,EAClB,sBAAsB,EACtB,0BAA0B,EAC1B,mBAAmB,EACnB,yBAAyB,EACzB,sBAAsB,EACtB,oBAAoB,EACpB,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,wBAAwB,EACxB,oBAAoB,EACpB,mBAAmB,EACnB,eAAe,EACf,oBAAoB,EACpB,aAAa,EACb,qBAAqB,EACrB,gBAAgB,EAChB,0BAA0B,EAC1B,wBAAwB,EACxB,2BAA2B,EAC3B,6BAA6B,EAC7B,mBAAmB,EACnB,uBAAuB,EACvB,qBAAqB,EACrB,2BAA2B,EAC3B,oBAAoB,EACpB,0BAA0B,EAC1B,uBAAuB,EACvB,qBAAqB,EACrB,wBAAwB,EACxB,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,UA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,MAAM,WAAW,GAAG,yBAAyB,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;IAClF,IAAI,WAAW,KAAK,IAAI,EAAE,CAAC;QACzB,4EAA4E;QAC5E,MAAM,WAAW,GAAG,oBAAoB,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACtD,6EAA6E;QAC7E,0FAA0F;QAC1F,MAAM,MAAM,GAAG,WAAW,KAAK,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC;QAC1F,MAAM,kBAAkB,CACtB,CAAC,IAAI,EAAE,EAAE,CAAC,2BAA2B,CAAC,IAAI,kBAAkB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,IAAI,MAAM,EAAE,CAAC,CAAC,EACjG,WAAW,EACX,WAAW,CACZ,CAAC;QACF,OAAO;IACT,CAAC;IACD,MAAM,MAAM,GAAG,2BAA2B,CAAC,IAAI,kBAAkB,CAAC,EAAE,MAAM,EAAE,aAAa,EAAE,EAAE,CAAC,CAAC,CAAC;IAChG,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAClC,CAAC;AAED,IAAI,YAAY,EAAE,EAAE,CAAC;IACnB,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;QACnB,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,GAAG,CAAC,CAAC;QAC9C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * English-only launch gate — the single place the MCP server decides
3
+ * whether a language argument is allowed. Voice cloning only ever
4
+ * worked well in English and the non-English preset catalogs are not
5
+ * ready, so the tool schemas reject any other language until the
6
+ * launch lock lifts. Regional variants of English (en-US, en-GB, ...)
7
+ * count as English.
8
+ */
9
+ export declare const ONLY_ENGLISH_VIDEOS_MESSAGE = "Only English videos are supported for now";
10
+ export declare const ONLY_ENGLISH_CLONE_MESSAGE = "Voice cloning is only available in English for now";
11
+ export declare function isEnglishLanguage(language: string): boolean;