post-engineer-mcp 1.52.585 → 1.52.594

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 (125) hide show
  1. package/README.md +87 -98
  2. package/dist/account-shapes.js +2 -2
  3. package/dist/account-shapes.js.map +1 -1
  4. package/dist/action-tool.d.ts +32 -0
  5. package/dist/action-tool.js +90 -0
  6. package/dist/action-tool.js.map +1 -0
  7. package/dist/analytics.d.ts +2 -0
  8. package/dist/analytics.js +10 -0
  9. package/dist/analytics.js.map +1 -1
  10. package/dist/client-types.d.ts +3 -3
  11. package/dist/client.js +1 -1
  12. package/dist/client.js.map +1 -1
  13. package/dist/cloned-voice-client.d.ts +11 -2
  14. package/dist/cloned-voice-client.js +121 -3
  15. package/dist/cloned-voice-client.js.map +1 -1
  16. package/dist/cloned-voice-tools.d.ts +3 -4
  17. package/dist/cloned-voice-tools.js +6 -35
  18. package/dist/cloned-voice-tools.js.map +1 -1
  19. package/dist/connect-account.js +3 -3
  20. package/dist/connect-account.js.map +1 -1
  21. package/dist/direct-publish-form.js +1 -1
  22. package/dist/direct-publish-form.js.map +1 -1
  23. package/dist/generate-video.d.ts +254 -0
  24. package/dist/generate-video.js +195 -0
  25. package/dist/generate-video.js.map +1 -0
  26. package/dist/http-transport.js +3 -4
  27. package/dist/http-transport.js.map +1 -1
  28. package/dist/index.js +27 -151
  29. package/dist/index.js.map +1 -1
  30. package/dist/intent-accounts.d.ts +5 -0
  31. package/dist/intent-accounts.js +66 -0
  32. package/dist/intent-accounts.js.map +1 -0
  33. package/dist/intent-content.d.ts +4 -0
  34. package/dist/intent-content.js +54 -0
  35. package/dist/intent-content.js.map +1 -0
  36. package/dist/intent-library.d.ts +4 -0
  37. package/dist/intent-library.js +41 -0
  38. package/dist/intent-library.js.map +1 -0
  39. package/dist/intent-personas.d.ts +6 -0
  40. package/dist/intent-personas.js +79 -0
  41. package/dist/intent-personas.js.map +1 -0
  42. package/dist/intent-video.d.ts +5 -0
  43. package/dist/intent-video.js +28 -0
  44. package/dist/intent-video.js.map +1 -0
  45. package/dist/{publish-uploaded-tools.d.ts → intent-voices.d.ts} +1 -1
  46. package/dist/intent-voices.js +33 -0
  47. package/dist/intent-voices.js.map +1 -0
  48. package/dist/limits.d.ts +2 -2
  49. package/dist/limits.js +2 -2
  50. package/dist/persona-avatar.d.ts +2 -2
  51. package/dist/persona-avatar.js +5 -5
  52. package/dist/persona-avatar.js.map +1 -1
  53. package/dist/persona-delete.d.ts +6 -0
  54. package/dist/persona-delete.js +41 -0
  55. package/dist/persona-delete.js.map +1 -0
  56. package/dist/persona-update.js +3 -3
  57. package/dist/persona-update.js.map +1 -1
  58. package/dist/public-ip.d.ts +1 -0
  59. package/dist/public-ip.js +128 -0
  60. package/dist/public-ip.js.map +1 -0
  61. package/dist/publish-direct-shape.js +3 -3
  62. package/dist/publish-direct-shape.js.map +1 -1
  63. package/dist/publish-notices.js +1 -1
  64. package/dist/publish-notices.js.map +1 -1
  65. package/dist/publish-uploaded-shape.js +6 -6
  66. package/dist/publish-uploaded-shape.js.map +1 -1
  67. package/dist/recipe-session.d.ts +7 -10
  68. package/dist/recipe-session.js +17 -25
  69. package/dist/recipe-session.js.map +1 -1
  70. package/dist/refs.d.ts +54 -0
  71. package/dist/refs.js +158 -0
  72. package/dist/refs.js.map +1 -0
  73. package/dist/remote-shapes.d.ts +2 -2
  74. package/dist/remote-shapes.js +6 -6
  75. package/dist/remote-shapes.js.map +1 -1
  76. package/dist/require-publishing-accounts.js +1 -1
  77. package/dist/require-publishing-accounts.js.map +1 -1
  78. package/dist/schedule-shapes.js +6 -6
  79. package/dist/schedule-shapes.js.map +1 -1
  80. package/dist/script-segments.js +1 -1
  81. package/dist/script-segments.js.map +1 -1
  82. package/dist/single-video-shape.d.ts +5 -5
  83. package/dist/single-video-shape.js +20 -20
  84. package/dist/single-video-shape.js.map +1 -1
  85. package/dist/tool-annotations.js.map +1 -1
  86. package/dist/tools-batch.d.ts +63 -64
  87. package/dist/tools-batch.js +7 -8
  88. package/dist/tools-batch.js.map +1 -1
  89. package/dist/tools-experiments.d.ts +48 -66
  90. package/dist/tools-experiments.js +26 -13
  91. package/dist/tools-experiments.js.map +1 -1
  92. package/dist/tools-pinterest.d.ts +0 -1
  93. package/dist/tools-pinterest.js +5 -6
  94. package/dist/tools-pinterest.js.map +1 -1
  95. package/dist/tools-posts.js +7 -7
  96. package/dist/tools-posts.js.map +1 -1
  97. package/dist/tools-prompts.d.ts +2 -2
  98. package/dist/tools-prompts.js +31 -31
  99. package/dist/tools-prompts.js.map +1 -1
  100. package/dist/tools-publish-uploaded.d.ts +0 -3
  101. package/dist/tools-publish-uploaded.js +7 -10
  102. package/dist/tools-publish-uploaded.js.map +1 -1
  103. package/dist/tools-publishing-accounts.js +3 -3
  104. package/dist/tools-publishing-accounts.js.map +1 -1
  105. package/dist/tools-single-video.d.ts +0 -2
  106. package/dist/tools-single-video.js +11 -15
  107. package/dist/tools-single-video.js.map +1 -1
  108. package/dist/tools-user-media.d.ts +0 -2
  109. package/dist/tools-user-media.js +2 -5
  110. package/dist/tools-user-media.js.map +1 -1
  111. package/dist/tools.d.ts +25 -28
  112. package/dist/tools.js +10 -85
  113. package/dist/tools.js.map +1 -1
  114. package/dist/video-task-tools.d.ts +2 -2
  115. package/dist/video-task-tools.js +14 -12
  116. package/dist/video-task-tools.js.map +1 -1
  117. package/dist/voice-filters.d.ts +1 -1
  118. package/dist/voice-filters.js +4 -4
  119. package/dist/voice-filters.js.map +1 -1
  120. package/package.json +1 -1
  121. package/dist/local-file-tools.d.ts +0 -3
  122. package/dist/local-file-tools.js +0 -15
  123. package/dist/local-file-tools.js.map +0 -1
  124. package/dist/publish-uploaded-tools.js +0 -10
  125. package/dist/publish-uploaded-tools.js.map +0 -1
package/dist/index.js CHANGED
@@ -3,174 +3,50 @@ import { realpathSync } from 'node:fs';
3
3
  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
- import { PostEngineerClient, MAX_LIBRARY_IMAGES } from './client.js';
7
- import { CreatePersonaShape, ListPersonasShape, ListVoicesShape, ListFacesShape, UpdatePersonaShape, ListSocialAccountsShape, ConnectAccountShape, ListSchedulesShape, GetTokenBalanceShape, ListPostsShape, CancelScheduleShape, GetSlotShape, UpdateSlotTitleShape, DeleteSlotShape, ListVideoGenerationsShape, GetVideoGenerationShape, ListTokenTransactionsShape, GetPersonaDeletePreviewShape, DeletePersonaShape, DisconnectAccountShape, GetVideoStatusShape, GetVideoTaskProgressShape, ListPersonaImagesShape, UpdatePersonaImageShape, RemovePersonaImageShape, handleCreatePersona, handleListPersonas, handleListVoices, handleListFaces, handleUpdatePersona, handleListSocialAccounts, handleConnectAccount, handleListSchedules, handleCancelSchedule, handleGetSlot, handleUpdateSlotTitle, handleDeleteSlot, handleListVideoGenerations, handleGetVideoGeneration, handleListTokenTransactions, handleGetPersonaDeletePreview, handleDeletePersona, handleDisconnectAccount, handleGetTokenBalance, handleGetVideoStatus, handleGetVideoTaskProgress, handleListPersonaImages, handleUpdatePersonaImage, handleRemovePersonaImage, } from './tools.js';
8
- import { GetPersonaPublishingAccountsShape, SetPersonaPublishingAccountsShape, handleGetPersonaPublishingAccounts, handleSetPersonaPublishingAccounts, } from './tools-publishing-accounts.js';
9
- import { registerClonedVoiceTools } from './cloned-voice-tools.js';
10
- import { GetPostShape, GetPostMetricsShape, GetYouTubeRetentionCurveShape, handleGetPost, handleListPosts, handleGetPostMetrics, handleGetYouTubeRetentionCurve, } from './tools-posts.js';
11
- import { CancelVideoTaskShape, WaitForVideoTasksShape, handleCancelVideoTask, handleWaitForVideoTasks, } from './video-task-tools.js';
12
- import { GeneratePersonaVideoShape, ValidateScriptShape, ValidateScriptDescription, ScoreDraftShape, ScoreDraftDescription, handleGeneratePersonaVideo, handleValidateScript, handleScoreDraft } from './tools-single-video.js';
13
- import { CheckMediaDescription, CheckMediaShape, handleCheckMedia } from './tools-user-media.js';
14
- import { CreatePersonaRemoteSchema, CreatePersonaRemoteShape, UpdatePersonaRemoteSchema, UpdatePersonaRemoteShape } from './remote-shapes.js';
15
- import { registerLocalFileTools } from './local-file-tools.js';
16
- import { registerPublishUploadedTools } from './publish-uploaded-tools.js';
17
- import { ListPinterestBoardsDescription, ListPinterestBoardsShape, handleListPinterestBoards } from './tools-pinterest.js';
18
- import { GeneratePersonaVideoBatchDescription, GeneratePersonaVideoBatchShape, handleGeneratePersonaVideoBatch } from './tools-batch.js';
19
- import { AddExperimentPairShape, CreateExperimentShape, GetExperimentResultsShape, ListExperimentsShape, handleAddExperimentPair, handleCreateExperiment, handleGetExperimentResults, handleListExperiments } from './tools-experiments.js';
20
- import { withTracking } from './analytics.js';
21
- import { READ_ONLY, MUTATING, DESTRUCTIVE } from './tool-annotations.js';
6
+ import { PostEngineerClient } from './client.js';
7
+ import { requireApiKey } from './require-api-key.js';
8
+ import { registerAccountTools } from './intent-accounts.js';
9
+ import { registerContentTools } from './intent-content.js';
10
+ import { registerLibraryTools } from './intent-library.js';
11
+ import { registerPersonaMediaTools, registerPersonaTools } from './intent-personas.js';
12
+ import { registerVideoTools } from './intent-video.js';
13
+ import { registerVoiceTools } from './intent-voices.js';
22
14
  import { parseHttpTransportOptions, serveHttpTransport } from './http-transport.js';
23
15
  import { parseHttpAuthOptions } from './http-auth.js';
24
- import { SERVER_INSTRUCTIONS, registerPromptTools, withRecipeNudge, withScriptOutcome } from './tools-prompts.js';
16
+ import { SERVER_INSTRUCTIONS, registerPromptTools } from './tools-prompts.js';
25
17
  import { registerRemotePrompts } from './prompts.js';
26
- import { requireApiKey } from './require-api-key.js';
18
+ // The server advertises the package version: import it so a version bump in
19
+ // package.json flows through without touching this file.
20
+ const { default: pkg } = await import('../package.json', { with: { type: 'json' } });
27
21
  // The web's hosted /mcp route (issue #561) builds the remote server from
28
22
  // this package: the Web Standard request handler plus the client it feeds
29
23
  // the verified bearer to. Re-exported here so the package entry stays the
30
24
  // single public surface.
31
25
  export { PostEngineerClient };
32
26
  export { handleMcpWebRequest } from './http-web.js';
33
- // The server advertises the package version: import it so a version bump in
34
- // package.json flows through without touching this file.
35
- const { default: pkg } = await import('../package.json', { with: { type: 'json' } });
27
+ //---------------
28
+ // The tools are intent tools (issue #566), not one tool per endpoint: 16
29
+ // tools, most with an `action`. Each tools module registers its own, next to
30
+ // its shapes and handlers; tools that read a file from the disk offer those
31
+ // actions only on the stdio server, where the disk is the agent's own
32
+ // machine (a path served over HTTP would resolve on the MCP server's host).
33
+ //---------------
36
34
  export function createPostEngineerMcpServer(client, transport = 'stdio') {
37
35
  const apiClient = client ?? new PostEngineerClient({ apiKey: requireApiKey() });
38
36
  const server = new McpServer({
39
37
  name: 'post-engineer-mcp',
40
38
  version: pkg.version,
41
39
  }, { instructions: SERVER_INSTRUCTIONS });
40
+ const remote = transport === 'http';
42
41
  registerRemotePrompts(server, apiClient);
43
42
  const recipeSession = registerPromptTools(server, apiClient, transport);
44
- const isRemote = transport === 'http';
45
- if (isRemote) {
46
- server.tool('create_persona', 'Create a new AI persona with avatar, voice, language, and niche prompt. A face is REQUIRED: pass avatarUrl (public URL or list_faces). The remote server cannot read local files. A video without a face is a per-video choice — set options.videoType to "faceless" on generate_persona_video. At least one publishing account is REQUIRED (accounts): the persona is bound to those accounts and videos publish only to them.', CreatePersonaRemoteShape, MUTATING, withTracking('create_persona', withRecipeNudge(recipeSession, 'create_persona', async (args) => {
47
- return handleCreatePersona(apiClient, CreatePersonaRemoteSchema.parse(args));
48
- })));
49
- }
50
- else {
51
- server.tool('create_persona', 'Create a new AI persona with avatar, voice, language, and niche prompt. A face is REQUIRED: pass avatarUrl (public URL or list_faces) or avatarPath (local photo file, uploaded directly). A video without a face is a per-video choice — set options.videoType to "faceless" on generate_persona_video. At least one publishing account is REQUIRED (accounts): the persona is bound to those accounts and videos publish only to them.', CreatePersonaShape, MUTATING, withTracking('create_persona', withRecipeNudge(recipeSession, 'create_persona', async (args) => {
52
- return handleCreatePersona(apiClient, args);
53
- })));
54
- }
55
- server.tool('list_personas', 'List all existing personas for the authenticated user.', ListPersonasShape, READ_ONLY, withTracking('list_personas', withRecipeNudge(recipeSession, 'list_personas', async () => {
56
- return handleListPersonas(apiClient);
57
- })));
58
- 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, READ_ONLY, withTracking('list_voices', async (args) => {
59
- return handleListVoices(apiClient, args);
60
- }));
61
- // Cloned-voice tools (list/create/get/delete/preview, plus the house-voice
62
- // preview) live in cloned-voice-tools.ts, next to their shapes/handlers.
63
- registerClonedVoiceTools(server, apiClient, isRemote);
64
- 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, READ_ONLY, withTracking('list_faces', async () => {
65
- return handleListFaces(apiClient);
66
- }));
67
- if (isRemote) {
68
- server.tool('update_persona', 'Update an existing AI persona (only the provided fields change). Replace the face with avatarUrl. The remote server cannot read local files.', UpdatePersonaRemoteShape, MUTATING, withTracking('update_persona', async (args) => {
69
- return handleUpdatePersona(apiClient, UpdatePersonaRemoteSchema.parse(args));
70
- }));
71
- }
72
- else {
73
- server.tool('update_persona', 'Update an existing AI persona (only the provided fields change). Replace the face with avatarUrl or avatarPath (local photo file).', UpdatePersonaShape, MUTATING, withTracking('update_persona', async (args) => {
74
- return handleUpdatePersona(apiClient, args);
75
- }));
76
- }
77
- server.tool('list_social_accounts', 'List connected social accounts (YouTube, Instagram, LinkedIn, Threads, Facebook Pages, Bluesky, Pinterest, Rumble, Fanvue) with the account IDs needed for posting.', ListSocialAccountsShape, READ_ONLY, withTracking('list_social_accounts', withRecipeNudge(recipeSession, 'list_social_accounts', async () => {
78
- return handleListSocialAccounts(apiClient);
79
- })));
80
- server.tool('list_pinterest_boards', ListPinterestBoardsDescription, ListPinterestBoardsShape, READ_ONLY, withTracking('list_pinterest_boards', async (args) => {
81
- return handleListPinterestBoards(apiClient, args);
82
- }));
83
- server.tool('get_persona_publishing_accounts', "List the publishing accounts a persona is bound to, per provider. generate_persona_video falls back to these when no account IDs are passed; explicit IDs must be a subset of the binding.", GetPersonaPublishingAccountsShape, READ_ONLY, withTracking('get_persona_publishing_accounts', async (args) => {
84
- return handleGetPersonaPublishingAccounts(apiClient, args);
85
- }));
86
- server.tool('set_persona_publishing_accounts', "Replace the publishing accounts a persona is bound to (per provider). Account IDs come from list_social_accounts. Providers mapped to empty arrays keep no binding for that provider; the binding as a whole must keep at least one account.", SetPersonaPublishingAccountsShape, MUTATING, withTracking('set_persona_publishing_accounts', async (args) => {
87
- return handleSetPersonaPublishingAccounts(apiClient, args);
88
- }));
89
- server.tool('connect_account', 'Connect a social account. For youtube/instagram/linkedin/threads/facebook/pinterest/fanvue: returns an authorization URL — the user must open it in a browser where they are signed in to Post Engineer with the same account, and authorize; the account then connects automatically (verify with list_social_accounts). A browser that is not signed in, or signed in as another user, is rejected. For bluesky: connects directly with handle + appPassword (app password, not the main account password). For 3speak: connects directly with Hive username + posting key (posting key, not the owner/active/master password) For rumble: connects directly with channelId + accessToken (40-character Simple Upload API token, issued by emailing bd@rumble.com — no OAuth).', ConnectAccountShape, MUTATING, withTracking('connect_account', async (args) => {
90
- return handleConnectAccount(apiClient, args);
91
- }));
92
- server.tool('list_schedules', 'List all automation schedules for the authenticated user.', ListSchedulesShape, READ_ONLY, withTracking('list_schedules', async () => {
93
- return handleListSchedules(apiClient);
94
- }));
95
- server.tool('list_posts', 'List upcoming (scheduled) and past (published/failed) posts across all connected accounts. With from + to (ISO-8601 timestamps with UTC offset, at most 62 days) it instead returns every post of any status (awaiting|generating|ready|publishing|published|failed) with slot_at in [from, to) as one slots list plus truncated (true when the cap was hit) — use it to read a day or month. Without from/to it returns two lists: upcoming slots and recent results, each with id, slot_at, status (awaiting|generating|ready|publishing|published|failed; publishing appears in upcoming only when the slot already has userNotices), title, schedule_id, task_id, postUrl (the link to the post detail page — send it in chat so the user can watch or download the video and edit, reschedule or delete the post), 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. A slot that is still publishing is included in upcoming when it already has userNotices (requiresUser true): relay each notice as-is and do not retry, because only the user can fix the account. providerFailures lists every terminal account failure; its requiresUser is true only for the failures also in userNotices.', ListPostsShape, READ_ONLY, withTracking('list_posts', async (args) => {
96
- return handleListPosts(apiClient, args);
97
- }));
98
- 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. Only slots whose generation never ran get their prepaid tokens back — a slot the engine already accepted (generating) or a ready video keeps its charge, because the GPU cost is already spent. A post already publishing or already published is not recalled. Use list_schedules to find the ID.', CancelScheduleShape, DESTRUCTIVE, withTracking('cancel_schedule', async (args) => {
99
- return handleCancelSchedule(apiClient, args);
100
- }));
101
- 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. userNotices (requiresUser true) and providerFailures are on the slot as soon as an account fails, including while the slot is still publishing. Relay each userNotices notice. Only the user can fix that account. Do not retry it. The slot carries postUrl, the link to its post detail page — send it in chat so the user can watch or download the video and edit, reschedule or delete the post. Use the slotId from list_posts.', GetSlotShape, READ_ONLY, withTracking('get_slot', async (args) => {
102
- return handleGetSlot(apiClient, args);
103
- }));
104
- server.tool('update_slot_title', 'Edit the title text of one scheduled post. Only a pending/awaiting or ready slot can be edited — published or mid-flight slots are rejected.', UpdateSlotTitleShape, MUTATING, withTracking('update_slot_title', async (args) => {
105
- return handleUpdateSlotTitle(apiClient, args);
106
- }));
107
- server.tool('delete_slot', 'Delete one scheduled post slot. Only pending (awaiting), ready 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, DESTRUCTIVE, withTracking('delete_slot', async (args) => {
108
- return handleDeleteSlot(apiClient, args);
109
- }));
110
- server.tool('list_video_generations', 'List the video generation history (newest first): one row per generated video with status, error code, token refund flag, and timestamps. Use get_video_generation for one row\'s detail.', ListVideoGenerationsShape, READ_ONLY, withTracking('list_video_generations', async (args) => {
111
- return handleListVideoGenerations(apiClient, args);
112
- }));
113
- server.tool('get_video_generation', 'Get one video generation\'s detail by generation ID (the generationId field from list_video_generations).', GetVideoGenerationShape, READ_ONLY, withTracking('get_video_generation', async (args) => {
114
- return handleGetVideoGeneration(apiClient, args);
115
- }));
116
- 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, DESTRUCTIVE, withTracking('cancel_video_task', async (args) => {
117
- return handleCancelVideoTask(apiClient, args);
118
- }));
119
- 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. A scheduled slot carries postUrl, the link to its post detail page — send it in chat so the user can watch or download the video and edit, reschedule or delete the post.', GetPostShape, READ_ONLY, withTracking('get_post', async (args) => {
120
- return handleGetPost(apiClient, args);
121
- }));
122
- server.tool('get_post_metrics', 'Get per-video performance snapshots (views, likes, comments, saves) of published posts for one window (24h, 7d or 28d), newest first, optionally filtered by persona, account, provider (network) and script angle. YouTube rows also carry YouTube Analytics retention for the user\'s own videos: engagedViews, stayedToWatchPct (derived: engaged views / views), averageViewPercentage, contentType, provisional (data may still change), and analyticsStatus (scope_missing = the user must reconnect YouTube). Returns rows plus truncated (true when more rows exist than the server cap).', GetPostMetricsShape, READ_ONLY, withTracking('get_post_metrics', async (args) => {
123
- return handleGetPostMetrics(apiClient, args);
124
- }));
125
- server.tool('get_youtube_retention_curve', 'Get the audience retention curve of one of the user\'s own published YouTube videos, read live from YouTube Analytics: points of ratio (elapsed share of the video, 0.01-1.0), audienceWatchRatio and relativeRetentionPerformance (vs. YouTube videos of similar length). Pass account and video from a youtube get_post_metrics row. Only the user\'s own channel is ever queried; a 403 YOUTUBE_ANALYTICS_SCOPE_MISSING means the user must reconnect YouTube.', GetYouTubeRetentionCurveShape, READ_ONLY, withTracking('get_youtube_retention_curve', async (args) => {
126
- return handleGetYouTubeRetentionCurve(apiClient, args);
127
- }));
128
- 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, READ_ONLY, withTracking('list_token_transactions', async (args) => {
129
- return handleListTokenTransactions(apiClient, args);
130
- }));
131
- server.tool('get_persona_delete_preview', 'Preview what deleting a persona would remove: counts of schedules, upcoming/published/failed slots, generated videos and library images, plus per-video download links (read-only, never mutates). Call before delete_persona.', GetPersonaDeletePreviewShape, READ_ONLY, withTracking('get_persona_delete_preview', async (args) => {
132
- return handleGetPersonaDeletePreview(apiClient, args);
133
- }));
134
- server.tool('delete_persona', 'DESTRUCTIVE and irreversible: delete a persona with all its schedules, slots, generated videos, and image library. No token refunds — prepaid tokens for pending slots are forfeited. Call get_persona_delete_preview first.', DeletePersonaShape, DESTRUCTIVE, withTracking('delete_persona', async (args) => {
135
- return handleDeletePersona(apiClient, args);
136
- }));
137
- server.tool('disconnect_account', 'Disconnect a social account by provider and account ID (the IDs from list_social_accounts). The account stops being available for publishing.', DisconnectAccountShape, DESTRUCTIVE, withTracking('disconnect_account', async (args) => {
138
- return handleDisconnectAccount(apiClient, args);
139
- }));
140
- server.tool('get_token_balance', 'Get the prepaid token wallet balance. Check before triggering video generation, which costs tokens.', GetTokenBalanceShape, READ_ONLY, withTracking('get_token_balance', withRecipeNudge(recipeSession, 'get_token_balance', async () => {
141
- return handleGetTokenBalance(apiClient);
142
- })));
143
- 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 content takes in order — a CTA is a content take and may appear anywhere; 60-200 words total, content at least 30, 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). If the request is a topic rather than a ready script, call list_prompts first and follow the matching recipe with get_prompt instead of improvising the script — recipes pre-validate the script, media, and price facts before any token is spent; then pass its slug as recipe. Wait for the slot\'s taskId with wait_for_video_tasks — it blocks until the video completes or fails and reports the outcome.', GeneratePersonaVideoShape, MUTATING, withTracking('generate_persona_video', withScriptOutcome(recipeSession, 'generate_persona_video', async (args) => handleGeneratePersonaVideo(apiClient, args))));
144
- server.tool('generate_persona_video_batch', GeneratePersonaVideoBatchDescription, GeneratePersonaVideoBatchShape, MUTATING, withTracking('generate_persona_video_batch', async (args) => handleGeneratePersonaVideoBatch(apiClient, args)));
145
- server.tool('validate_script', ValidateScriptDescription, ValidateScriptShape, READ_ONLY, withTracking('validate_script', withScriptOutcome(recipeSession, 'validate_script', async (args) => handleValidateScript(apiClient, args))));
146
- server.tool('score_draft', ScoreDraftDescription, ScoreDraftShape, READ_ONLY, withTracking('score_draft', async (args) => handleScoreDraft(apiClient, args)));
147
- server.tool('check_media', CheckMediaDescription, CheckMediaShape, READ_ONLY, withTracking('check_media', async (args) => handleCheckMedia(apiClient, args)));
148
- // Paired A/B content experiments (issue #476).
149
- server.tool('create_experiment', 'Create a paired A/B experiment that tests ONE script variable (the hook) with two variants, each with a slug variantId (e.g. hook-aggressive; never "A"/"B"), a name and a style description you will follow when writing its hooks. Then call add_experiment_pair once per pair. Results come from get_experiment_results.', CreateExperimentShape, MUTATING, withTracking('create_experiment', async (args) => handleCreateExperiment(apiClient, args)));
150
- server.tool('list_experiments', 'List your paired A/B experiments with their two variants and target pairs.', ListExperimentsShape, READ_ONLY, withTracking('list_experiments', async () => handleListExperiments(apiClient)));
151
- server.tool('add_experiment_pair', 'Create both videos of one experiment pair: the same title and content (segments, without the hook) and one hook per variant. Each video is a normal generate-and-schedule video (charged as usual); the second one starts spacingHours after the first and the order alternates per pair. The server rejects the second video of a pair (before charging; a concurrent race is caught after the insert and refunded) unless it matches the first in: the same providers and accounts, the same title, voice (id and audio URL), video type, video aspect and layout, paragraph number, face quality, language, niche and CTA text, and identical content segments, with a different hook. The pinned options.imageId is not stored, so it is not compared: pass the same imageId (or none) to both videos yourself. Calling it again with the same arguments replays the videos already created.', AddExperimentPairShape, MUTATING, withTracking('add_experiment_pair', async (args) => handleAddExperimentPair(apiClient, args)));
152
- server.tool('get_experiment_results', 'Get an experiment\'s videos by pair and its paired results per provider for a metrics window (default 7d): per-pair views/likes/comments/average view duration, wins per variant, sign-test pValue and a label — pending (nothing to compare), indicative (not proven: too few pairs or not all pairs in) or clear (every target pair decided and p < 0.05). Never call a variant the winner unless the label is clear.', GetExperimentResultsShape, READ_ONLY, withTracking('get_experiment_results', async (args) => handleGetExperimentResults(apiClient, args)));
153
- server.tool('get_video_status', 'Check the generation status and fetch final video URLs for a taskId. When the video belongs to a scheduled slot the body also carries postUrl, the link to its post detail page — send it in chat so the user can watch or download the video.', GetVideoStatusShape, READ_ONLY, withTracking('get_video_status', async (args) => handleGetVideoStatus(apiClient, args)));
154
- server.tool('get_video_task_progress', 'Poll one video task for its machine-readable progress: returns {task_id, state, progress, stage, error, postUrl}. error is the engine failure reason when state is -1 (failed), null otherwise. postUrl is the link to the post detail page when the video belongs to a scheduled slot (null otherwise) — send it in chat so the user can watch or download the video. Use for the video after generate_persona_video; prefer this over get_video_status when only progress matters. Prefer wait_for_video_tasks when you need the final outcome instead of progress snapshots.', GetVideoTaskProgressShape, READ_ONLY, withTracking('get_video_task_progress', async (args) => {
155
- return handleGetVideoTaskProgress(apiClient, args);
156
- }));
157
- server.tool('wait_for_video_tasks', 'Wait for one or more video tasks to reach a terminal state: blocks until every taskId completes (state 1) or fails (state -1, or gone from the engine), or the timeout elapses. Returns {summary, allTerminal, timedOut, results} with one entry per taskId: {task_id, state, outcome, progress, stage, error, postUrl}. error is the engine failure reason when outcome is failed. postUrl is the link to the post detail page when the video belongs to a scheduled slot (null otherwise) — send it in chat so the user can watch or download the video. Use after generate_persona_video or generate_persona_video_batch instead of polling get_video_task_progress. On timeout the results are partial: call again with the unfinished taskIds.', WaitForVideoTasksShape, READ_ONLY, withTracking('wait_for_video_tasks', async (args) => {
158
- return handleWaitForVideoTasks(apiClient, args);
159
- }));
160
- 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, READ_ONLY, withTracking('list_persona_images', async (args) => {
161
- return handleListPersonaImages(apiClient, args);
162
- }));
163
- server.tool('update_persona_image', 'Update a persona library image tag, description, or primary flag.', UpdatePersonaImageShape, MUTATING, withTracking('update_persona_image', async (args) => {
164
- return handleUpdatePersonaImage(apiClient, args);
165
- }));
166
- server.tool('remove_persona_image', 'Remove an image from a persona image library.', RemovePersonaImageShape, DESTRUCTIVE, withTracking('remove_persona_image', async (args) => {
167
- return handleRemovePersonaImage(apiClient, args);
168
- }));
169
- registerPublishUploadedTools(server, apiClient); // JSON-only signed-upload tools: both transports.
170
- // Local-file tools exist only on stdio, where the disk is the agent's
171
- // own machine; the remote server must never read paths from its host.
172
- if (!isRemote)
173
- registerLocalFileTools(server, apiClient);
43
+ registerVideoTools(server, apiClient, recipeSession);
44
+ registerPersonaTools(server, apiClient, recipeSession, remote);
45
+ registerPersonaMediaTools(server, apiClient, remote);
46
+ registerVoiceTools(server, apiClient, remote);
47
+ registerAccountTools(server, apiClient, recipeSession);
48
+ registerLibraryTools(server, apiClient, recipeSession);
49
+ registerContentTools(server, apiClient, recipeSession, remote);
174
50
  return server;
175
51
  }
176
52
  export function isMainModule() {
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,MAAM,aAAa,CAAC;AACrE,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,mBAAmB,EACnB,yBAAyB,EACzB,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,wBAAwB,EACxB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,aAAa,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AAG,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,5 @@
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import type { PostEngineerClient } from './client.js';
3
+ import { type RecipeSession } from './recipe-session.js';
4
+ export declare const AccountsDescription: string;
5
+ export declare function registerAccountTools(server: McpServer, client: PostEngineerClient, session: RecipeSession): void;
@@ -0,0 +1,66 @@
1
+ import { z } from 'zod';
2
+ import { actionDescription, actionShape, byAction } from './action-tool.js';
3
+ import { ConnectAccountShape, handleConnectAccount } from './connect-account.js';
4
+ import { personaRefShape, resolveAccountRef, withPersona } from './refs.js';
5
+ import { withRecipeNudge } from './recipe-session.js';
6
+ import { DESTRUCTIVE } from './tool-annotations.js';
7
+ import { DisconnectAccountShape, handleDisconnectAccount, handleListSocialAccounts } from './tools.js';
8
+ import { GetPersonaPublishingAccountsShape, SetPersonaPublishingAccountsShape, handleGetPersonaPublishingAccounts, handleSetPersonaPublishingAccounts } from './tools-publishing-accounts.js';
9
+ import { handleListPinterestBoards } from './tools-pinterest.js';
10
+ //---------------
11
+ // accounts (issue #566): connected social accounts and the accounts each
12
+ // persona publishes to. An account is given by name or id (refs.ts); the
13
+ // network is read from the account.
14
+ //---------------
15
+ const PROVIDERS = DisconnectAccountShape.provider;
16
+ const ACCOUNTS_SPECS = {
17
+ list: { provider: PROVIDERS.optional().describe('Only the accounts of this network.') },
18
+ connect: ConnectAccountShape,
19
+ disconnect: {
20
+ account: z.string().min(1, 'account is required').describe('The account to disconnect, by name or id (accounts list shows both).'),
21
+ provider: PROVIDERS.optional().describe('Narrow a name that exists on several networks.'),
22
+ },
23
+ get_persona_publishing: personaRefShape(GetPersonaPublishingAccountsShape),
24
+ set_persona_publishing: personaRefShape(SetPersonaPublishingAccountsShape),
25
+ list_boards: { account: z.string().min(1, 'account is required').describe('The Pinterest account, by name or id.') },
26
+ };
27
+ export const AccountsDescription = actionDescription('Connected social accounts. list: every account with the ids and names to publish with (YouTube, Instagram, LinkedIn, Threads, Facebook, Bluesky, Pinterest, 3Speak, Rumble, Fanvue). connect: starts the connection of a network (an OAuth link to open, or a direct connect for Bluesky, 3Speak and Rumble). disconnect: removes an account. get_persona_publishing / set_persona_publishing: the accounts a persona publishes to by default (set replaces the whole set and must keep at least one). list_boards: the boards of a Pinterest account.', ACCOUNTS_SPECS);
28
+ function filterByProvider(response, provider) {
29
+ if (provider === undefined || response.isError === true)
30
+ return response;
31
+ const [first] = response.content;
32
+ if (first?.type !== 'text')
33
+ return response;
34
+ try {
35
+ const parsed = JSON.parse(first.text);
36
+ const accounts = typeof parsed === 'object' && parsed !== null ? parsed.accounts : undefined;
37
+ if (!Array.isArray(accounts))
38
+ return response;
39
+ const kept = accounts.filter((entry) => typeof entry === 'object' && entry !== null && entry.provider === provider);
40
+ return { ...response, content: [{ type: 'text', text: JSON.stringify({ ...parsed, accounts: kept }, null, 2) }] };
41
+ }
42
+ catch {
43
+ return response;
44
+ }
45
+ }
46
+ export function registerAccountTools(server, client, session) {
47
+ server.tool('accounts', AccountsDescription, actionShape(ACCOUNTS_SPECS), DESTRUCTIVE, byAction({
48
+ list: withRecipeNudge(session, 'accounts_list', async (args) => filterByProvider(await handleListSocialAccounts(client), args.provider)),
49
+ connect: async (args) => handleConnectAccount(client, args),
50
+ disconnect: async (args) => {
51
+ const outcome = await resolveAccountRef(client, args.account, args.provider);
52
+ if (outcome.kind === 'response')
53
+ return outcome.response;
54
+ return handleDisconnectAccount(client, { provider: outcome.value.provider, providerAccountId: outcome.value.id });
55
+ },
56
+ get_persona_publishing: (args) => withPersona(client, args, (resolved) => handleGetPersonaPublishingAccounts(client, resolved)),
57
+ set_persona_publishing: (args) => withPersona(client, args, (resolved) => handleSetPersonaPublishingAccounts(client, resolved)),
58
+ list_boards: async (args) => {
59
+ const outcome = await resolveAccountRef(client, args.account, 'pinterest');
60
+ if (outcome.kind === 'response')
61
+ return outcome.response;
62
+ return handleListPinterestBoards(client, { accountId: outcome.value.id });
63
+ },
64
+ }, ACCOUNTS_SPECS, 'accounts'));
65
+ }
66
+ //# sourceMappingURL=intent-accounts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intent-accounts.js","sourceRoot":"","sources":["../src/intent-accounts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5E,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAsB,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAEvG,OAAO,EAAE,iCAAiC,EAAE,iCAAiC,EAAE,kCAAkC,EAAE,kCAAkC,EAAE,MAAM,gCAAgC,CAAC;AAC9L,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,iBAAiB;AACjB,yEAAyE;AACzE,yEAAyE;AACzE,oCAAoC;AACpC,iBAAiB;AAEjB,MAAM,SAAS,GAAG,sBAAsB,CAAC,QAAQ,CAAC;AAElD,MAAM,cAAc,GAAG;IACrB,IAAI,EAAE,EAAE,QAAQ,EAAE,SAAS,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,oCAAoC,CAAC,EAAE;IACvF,OAAO,EAAE,mBAAmB;IAC5B,UAAU,EAAE;QACV,OAAO,EAAE,CAAC,CAAC,MAAM,EAA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I,EAAE,EAAE,CAAC,WAAW,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,kCAAkC,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAC/H,sBAAsB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,WAAW,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,kCAAkC,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAC/H,WAAW,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;YAC1B,MAAM,OAAO,GAAG,MAAM,iBAAiB,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;YAC3E,IAAI,OAAO,CAAC,IAAI,KAAK,UAAU;gBAAE,OAAO,OAAO,CAAC,QAAQ,CAAC;YACzD,OAAO,yBAAyB,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,OAAO,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;QAC5E,CAAC;KACF,EACD,cAAc,EACd,UAAU,CACX,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import type { PostEngineerClient } from './client.js';
3
+ import { type RecipeSession } from './recipe-session.js';
4
+ export declare function registerContentTools(server: McpServer, client: PostEngineerClient, session: RecipeSession, remote: boolean): void;
@@ -0,0 +1,54 @@
1
+ import { actionDescription, actionShape, byAction, offeredSpecs } from './action-tool.js';
2
+ import { optionalPersonaRefShape, withOptionalPersona } from './refs.js';
3
+ import { withScriptOutcome } from './recipe-session.js';
4
+ import { CompleteVideoUploadShape, CreateVideoUploadShape, PublishUploadedVideoShape } from './publish-uploaded-shape.js';
5
+ import { DESTRUCTIVE, MUTATING, READ_ONLY } from './tool-annotations.js';
6
+ import { PublishVideoDirectShape, handlePublishVideoDirect } from './tools.js';
7
+ import { AddExperimentPairShape, CreateExperimentShape, GetExperimentResultsShape, ListExperimentsShape, handleAddExperimentPair, handleCreateExperiment, handleGetExperimentResults, handleListExperiments } from './tools-experiments.js';
8
+ import { CheckMediaShape, UploadMediaShape, handleCheckMedia, handleUploadMedia } from './tools-user-media.js';
9
+ import { ScoreDraftShape, ValidateScriptShape, handleScoreDraft, handleValidateScript } from './tools-single-video.js';
10
+ import { handleCompleteVideoUpload, handleCreateVideoUpload, handlePublishUploadedVideo } from './tools-publish-uploaded.js';
11
+ //---------------
12
+ // experiments, media, check_script and publish_video (issue #566).
13
+ //---------------
14
+ const EXPERIMENTS_SPECS = {
15
+ create: optionalPersonaRefShape(CreateExperimentShape),
16
+ list: ListExperimentsShape,
17
+ add_pair: AddExperimentPairShape,
18
+ results: GetExperimentResultsShape,
19
+ };
20
+ const MEDIA_SPECS = { upload: UploadMediaShape, check: CheckMediaShape };
21
+ const CHECK_SCRIPT_SPECS = { validate: ValidateScriptShape, score: optionalPersonaRefShape(ScoreDraftShape) };
22
+ const PUBLISH_SPECS = {
23
+ from_file: PublishVideoDirectShape,
24
+ create_upload: CreateVideoUploadShape,
25
+ complete_upload: CompleteVideoUploadShape,
26
+ publish_upload: PublishUploadedVideoShape,
27
+ };
28
+ export function registerContentTools(server, client, session, remote) {
29
+ server.tool('experiments', actionDescription('Paired A/B experiments that test ONE script variable, the hook, with two variants (each a slug variantId such as hook-aggressive, never "A"/"B", with a name and the style you will follow when writing its hooks). create: define it. add_pair: both videos of one pair (same title, content and delivery, one hook per variant; each is a normal charged video, the second starts spacingHours after the first; the server rejects a pair that differs in anything but the hook, before charging; calling it again with the same arguments replays). list / results: results compare per network for a window (default 7d) with a sign-test pValue and a label: pending, indicative or clear. Never call a variant the winner unless the label is clear.', EXPERIMENTS_SPECS), actionShape(EXPERIMENTS_SPECS), MUTATING, byAction({
30
+ create: (args) => withOptionalPersona(client, args, (resolved) => handleCreateExperiment(client, { ...resolved, targetPairs: resolved.targetPairs })),
31
+ list: async () => handleListExperiments(client),
32
+ add_pair: async (args) => handleAddExperimentPair(client, args),
33
+ results: async (args) => handleGetExperimentResults(client, args),
34
+ }, EXPERIMENTS_SPECS, 'experiments'));
35
+ // upload reads a local file: only the stdio server offers it.
36
+ const mediaOptions = remote ? { unavailable: ['upload'] } : {};
37
+ server.tool('media', actionDescription(`Images for video segments. check: mechanically check one public image URL (no LLM, relevance is for you to judge): returns one code (ok, blocked_403 when the host blocks the download — ${remote ? 'use another public URL for that photo' : 'then use upload with bytes fetched on your own machine'} — and the size, type and aspect failures)${remote ? '.' : '. upload: a local image becomes a mediaId for a segment (a temporary asset, 1 hour: upload shortly before generating).'}`, offeredSpecs(MEDIA_SPECS, mediaOptions)), actionShape(offeredSpecs(MEDIA_SPECS, mediaOptions)), MUTATING, byAction({
38
+ upload: async (args) => handleUploadMedia(client, args),
39
+ check: async (args) => handleCheckMedia(client, args),
40
+ }, MEDIA_SPECS, 'media', mediaOptions));
41
+ server.tool('check_script', actionDescription('Check a script before spending tokens. validate: the mechanical rules (hook first, exactly one hook, no placeholders/links/markdown/emoji/stage directions, hook terminal punctuation, word limits: total 60-200, content at least 30, hook 15-40 words; a CTA is a content take, placed anywhere), no tokens spent. score: a 0-100 score of a draft against your own measured posts, every point explained.', CHECK_SCRIPT_SPECS), actionShape(CHECK_SCRIPT_SPECS), READ_ONLY, byAction({
42
+ validate: withScriptOutcome(session, 'check_script_validate', async (args) => handleValidateScript(client, args), (args) => [{ segments: args.segments, videoType: args.videoType }]),
43
+ score: (args) => withOptionalPersona(client, args, (resolved) => handleScoreDraft(client, resolved)),
44
+ }, CHECK_SCRIPT_SPECS, 'check_script'));
45
+ // from_file reads a local video: only the stdio server offers it.
46
+ const publishOptions = remote ? { unavailable: ['from_file'] } : {};
47
+ server.tool('publish_video', actionDescription(`Publish a ready-made video directly to social accounts: no generation, no schedule. ${remote ? '' : 'from_file: a local video (.mp4 or .mov) is read and published. '}create_upload → complete_upload → publish_upload: a signed upload (the bytes are PUT straight to storage, never through this server; the upload expires in 15 minutes; publishing consumes it). YouTube needs title, description, tags and privacyStatus; Rumble and Fanvue title and description; the other networks a caption. If a call times out, retry with the same idempotencyKey (the original result is replayed); a result with errorCode publish_unknown must NOT be retried: the post may be live, check the account first.`, offeredSpecs(PUBLISH_SPECS, publishOptions)), actionShape(offeredSpecs(PUBLISH_SPECS, publishOptions)), DESTRUCTIVE, byAction({
48
+ from_file: async (args) => handlePublishVideoDirect(client, args),
49
+ create_upload: async (args) => handleCreateVideoUpload(client, args),
50
+ complete_upload: async (args) => handleCompleteVideoUpload(client, args),
51
+ publish_upload: async (args) => handlePublishUploadedVideo(client, args),
52
+ }, PUBLISH_SPECS, 'publish_video', publishOptions));
53
+ }
54
+ //# sourceMappingURL=intent-content.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intent-content.js","sourceRoot":"","sources":["../src/intent-content.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAsB,MAAM,kBAAkB,CAAC;AAE9G,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAsB,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAC1H,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAC/E,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,0BAA0B,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC5O,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/G,OA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ol/sdk/server/mcp.js';
2
+ import type { PostEngineerClient } from './client.js';
3
+ import { type RecipeSession } from './recipe-session.js';
4
+ export declare function registerLibraryTools(server: McpServer, client: PostEngineerClient, session: RecipeSession): void;
@@ -0,0 +1,41 @@
1
+ import { actionDescription, actionShape, byAction } from './action-tool.js';
2
+ import { withRecipeNudge } from './recipe-session.js';
3
+ import { DESTRUCTIVE, READ_ONLY } from './tool-annotations.js';
4
+ import { CancelScheduleShape, DeleteSlotShape, GetSlotShape, ListPostsShape, ListSchedulesShape, ListTokenTransactionsShape, UpdateSlotTitleShape, handleCancelSchedule, handleDeleteSlot, handleGetSlot, handleListSchedules, handleListTokenTransactions, handleUpdateSlotTitle, handleGetTokenBalance, } from './tools.js';
5
+ import { GetPostMetricsShape, GetPostShape, GetYouTubeRetentionCurveShape, handleGetPost, handleGetPostMetrics, handleGetYouTubeRetentionCurve, handleListPosts, } from './tools-posts.js';
6
+ //---------------
7
+ // schedules, posts, insights and billing (issue #566): what you have
8
+ // scheduled, what was published, how it performed, and what it cost.
9
+ //---------------
10
+ const SCHEDULES_SPECS = {
11
+ list: ListSchedulesShape,
12
+ cancel: CancelScheduleShape,
13
+ get_slot: GetSlotShape,
14
+ update_slot_title: UpdateSlotTitleShape,
15
+ delete_slot: DeleteSlotShape,
16
+ };
17
+ const POSTS_SPECS = { list: ListPostsShape, get: GetPostShape };
18
+ const INSIGHTS_SPECS = { post_metrics: GetPostMetricsShape, retention_curve: GetYouTubeRetentionCurveShape };
19
+ const BILLING_SPECS = { balance: {}, transactions: ListTokenTransactionsShape };
20
+ export function registerLibraryTools(server, client, session) {
21
+ server.tool('schedules', actionDescription('Your scheduled videos (future slots). list: the schedules. get_slot / update_slot_title / delete_slot: one slot of a schedule. cancel: cancels a whole schedule: unpublished slots are removed, but only slots whose generation never ran get their prepaid tokens back (a generating or ready slot keeps its charge, the GPU cost is spent); a post already publishing or published is not recalled; a cancelled video of a discounted batch gives back the discount the batch no longer earns.', SCHEDULES_SPECS), actionShape(SCHEDULES_SPECS), DESTRUCTIVE, byAction({
22
+ list: async () => handleListSchedules(client),
23
+ cancel: async (args) => handleCancelSchedule(client, args),
24
+ get_slot: async (args) => handleGetSlot(client, args),
25
+ update_slot_title: async (args) => handleUpdateSlotTitle(client, args),
26
+ delete_slot: async (args) => handleDeleteSlot(client, args),
27
+ }, SCHEDULES_SPECS, 'schedules'));
28
+ server.tool('posts', actionDescription('Your published and scheduled posts. list: the recent posts with their status and links. get: one post by slot id or generation id, with its publish results.', POSTS_SPECS), actionShape(POSTS_SPECS), READ_ONLY, byAction({
29
+ list: async (args) => handleListPosts(client, args),
30
+ get: async (args) => handleGetPost(client, args),
31
+ }, POSTS_SPECS, 'posts'));
32
+ server.tool('insights', actionDescription('How your posts performed. post_metrics: per-network metrics of published posts (views, likes, comments, average view duration), filterable by persona, network, account and window. retention_curve: the YouTube audience retention curve of one post.', INSIGHTS_SPECS), actionShape(INSIGHTS_SPECS), READ_ONLY, byAction({
33
+ post_metrics: async (args) => handleGetPostMetrics(client, args),
34
+ retention_curve: async (args) => handleGetYouTubeRetentionCurve(client, args),
35
+ }, INSIGHTS_SPECS, 'insights'));
36
+ server.tool('billing', actionDescription('Your prepaid tokens. balance: the current balance. transactions: the ledger of spends and credits, newest first.', BILLING_SPECS), actionShape(BILLING_SPECS), READ_ONLY, byAction({
37
+ balance: withRecipeNudge(session, 'billing_balance', async () => handleGetTokenBalance(client)),
38
+ transactions: async (args) => handleListTokenTransactions(client, args),
39
+ }, BILLING_SPECS, 'billing'));
40
+ }
41
+ //# sourceMappingURL=intent-library.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intent-library.js","sourceRoot":"","sources":["../src/intent-library.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5E,OAAO,EAAE,eAAe,EAAsB,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,SAAS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Ae,CAAC,OAAO,EAAE,iBAAiB,EAAE,KAAK,IAAI,EAAE,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC;QAC/F,YAAY,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,2BAA2B,CAAC,MAAM,EAAE,IAAI,CAAC;KACxE,EACD,aAAa,EACb,SAAS,CACV,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import type { PostEngineerClient } from './client.js';
3
+ import { type RecipeSession } from './recipe-session.js';
4
+ export declare function personasDescription(remote: boolean): string;
5
+ export declare function registerPersonaTools(server: McpServer, client: PostEngineerClient, session: RecipeSession, remote: boolean): void;
6
+ export declare function registerPersonaMediaTools(server: McpServer, client: PostEngineerClient, remote: boolean): void;
@@ -0,0 +1,79 @@
1
+ import { z } from 'zod';
2
+ import { actionDescription, actionShape, byAction, offeredSpecs } from './action-tool.js';
3
+ import { getPersonaPublishingAccounts } from './client-publishing-accounts.js';
4
+ import { handlePersonaDelete } from './persona-delete.js';
5
+ import { UpdatePersonaShape, handleUpdatePersona } from './persona-update.js';
6
+ import { PERSONA_REF, personaRefShape, withPersona } from './refs.js';
7
+ import { withRecipeNudge } from './recipe-session.js';
8
+ import { CreatePersonaRemoteSchema, CreatePersonaRemoteShape, UpdatePersonaRemoteSchema, UpdatePersonaRemoteShape } from './remote-shapes.js';
9
+ import { DESTRUCTIVE } from './tool-annotations.js';
10
+ import { AddPersonaImageShape, CreatePersonaSchema, CreatePersonaShape, ListFacesShape, ListPersonaImagesShape, RemovePersonaImageShape, UpdatePersonaImageShape, handleAddPersonaImage, handleCreatePersona, handleLibraryCall, handleListFaces, handleListPersonaImages, handleListPersonas, handleRemovePersonaImage, handleUpdatePersonaImage, } from './tools.js';
11
+ //---------------
12
+ // personas and persona_media (issue #566). A persona is given by name or id
13
+ // (refs.ts); delete is preview-then-confirm (persona-delete.ts).
14
+ //---------------
15
+ const DeleteFields = {
16
+ persona: PERSONA_REF.describe('The persona to delete, by name or id. DESTRUCTIVE and irreversible.'),
17
+ confirmToken: z.string().min(1).optional().describe('Omit it first: the call only previews what would be removed and returns a token. Send that token to delete.'),
18
+ };
19
+ const PERSONAS_SPECS = {
20
+ list: {},
21
+ get: { persona: PERSONA_REF },
22
+ create: CreatePersonaShape,
23
+ update: personaRefShape(UpdatePersonaShape),
24
+ delete: DeleteFields,
25
+ };
26
+ // The remote server takes avatarUrl only: no field names a file on disk.
27
+ function personasOptions(remote) {
28
+ return remote ? { variants: { create: CreatePersonaRemoteShape, update: personaRefShape(UpdatePersonaRemoteShape) } } : {};
29
+ }
30
+ export function personasDescription(remote) {
31
+ const face = remote ? 'avatarUrl (a public URL or a url from persona_media (action: list_faces))' : 'avatarUrl or avatarPath (a local photo, uploaded directly)';
32
+ return actionDescription(`Manage your personas (the on-camera presenter, voice and defaults). list: names and ids. get: one persona with its image count and bound publishing accounts. create: a face is REQUIRED (${face}) and at least one publishing account (accounts); a faceless video is chosen per video, not per persona. update: only the given fields change. delete: preview first, then confirm with the token.`, offeredSpecs(PERSONAS_SPECS, personasOptions(remote)));
33
+ }
34
+ async function getPersona(client, args) {
35
+ return handleLibraryCall(async () => {
36
+ const [listing, images, publishing] = await Promise.all([
37
+ client.listPersonas(),
38
+ client.listPersonaImages(args.personaId),
39
+ getPersonaPublishingAccounts(client, args.personaId),
40
+ ]);
41
+ const personas = typeof listing === 'object' && listing !== null ? listing.personas : undefined;
42
+ const persona = Array.isArray(personas) ? personas.find((entry) => typeof entry === 'object' && entry !== null && entry.id === args.personaId) : undefined;
43
+ if (persona === undefined)
44
+ throw new Error(`No persona with id ${args.personaId}. Call personas with action "list" to see them.`);
45
+ const imageList = typeof images === 'object' && images !== null ? images.images : undefined;
46
+ const defaults = typeof publishing === 'object' && publishing !== null ? publishing.defaults : undefined;
47
+ return { persona, libraryImages: Array.isArray(imageList) ? imageList.length : null, boundAccounts: defaults ?? null };
48
+ }, 'getting persona');
49
+ }
50
+ export function registerPersonaTools(server, client, session, remote) {
51
+ const options = personasOptions(remote);
52
+ server.tool('personas', personasDescription(remote), actionShape(offeredSpecs(PERSONAS_SPECS, options)), DESTRUCTIVE, byAction({
53
+ list: withRecipeNudge(session, 'personas_list', async () => handleListPersonas(client)),
54
+ get: (args) => withPersona(client, args, (resolved) => getPersona(client, resolved)),
55
+ create: withRecipeNudge(session, 'personas_create', async (args) => handleCreatePersona(client, remote ? CreatePersonaRemoteSchema.parse(args) : CreatePersonaSchema.parse(args))),
56
+ update: (args) => withPersona(client, args, (resolved) => handleUpdatePersona(client, remote ? UpdatePersonaRemoteSchema.parse(resolved) : resolved)),
57
+ delete: (args) => withPersona(client, args, (resolved) => handlePersonaDelete(client, resolved)),
58
+ }, PERSONAS_SPECS, 'personas', options));
59
+ }
60
+ const MEDIA_SPECS = {
61
+ list_faces: ListFacesShape,
62
+ list_images: personaRefShape(ListPersonaImagesShape),
63
+ add_image: personaRefShape(AddPersonaImageShape),
64
+ update_image: UpdatePersonaImageShape,
65
+ remove_image: RemovePersonaImageShape,
66
+ };
67
+ export function registerPersonaMediaTools(server, client, remote) {
68
+ // add_image reads a local file: only the stdio server offers it.
69
+ const options = remote ? { unavailable: ['add_image'] } : {};
70
+ const offered = offeredSpecs(MEDIA_SPECS, options);
71
+ server.tool('persona_media', actionDescription(`A persona's face and image library. list_faces: the stock faces to pick an avatar from (id, url, description). list_images${remote ? '' : ' / add_image (reads a local file)'} / update_image / remove_image: the library images used for the per-video image selection.`, offered), actionShape(offered), DESTRUCTIVE, byAction({
72
+ list_faces: async () => handleListFaces(client),
73
+ list_images: (args) => withPersona(client, args, (resolved) => handleListPersonaImages(client, resolved)),
74
+ add_image: (args) => withPersona(client, args, (resolved) => handleAddPersonaImage(client, resolved)),
75
+ update_image: async (args) => handleUpdatePersonaImage(client, args),
76
+ remove_image: async (args) => handleRemovePersonaImage(client, args),
77
+ }, MEDIA_SPECS, 'persona_media', options));
78
+ }
79
+ //# sourceMappingURL=intent-personas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intent-personas.js","sourceRoot":"","sources":["../src/intent-personas.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAsB,MAAM,kBAAkB,CAAC;AAE9G,OAAO,EAAE,4BAA4B,EAAE,MAAM,iCAAiC,CAAC;AAC/E,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACtE,OAAO,EAAE,eAAe,EAAsB,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAC9I,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EAClB,cAAc,EACd,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EACjB,eAAe,EACf,uBAAuB,EACvB,kBAAkB,EAClB,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,YAAY,CAAC;AAGpB,iBAAiB;AACjB,4EAA4E;AAC5E,iEAAiE;AACjE,iBAAiB;AAEjB,MAAM,YAAY,GAAG;IACnB,OAAO,EAAE,WAAW,CAAC,QAAQ,CAAC,qEAAqE,CAAC;IACpG,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,6GAA6G,CAAC;CACnK,CAAC;AAEF,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