post-engineer-mcp 1.52.584 → 1.52.586

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 (119) 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-tools.d.ts +1 -3
  14. package/dist/cloned-voice-tools.js +4 -33
  15. package/dist/cloned-voice-tools.js.map +1 -1
  16. package/dist/connect-account.js +3 -3
  17. package/dist/connect-account.js.map +1 -1
  18. package/dist/direct-publish-form.js +1 -1
  19. package/dist/direct-publish-form.js.map +1 -1
  20. package/dist/generate-video.d.ts +254 -0
  21. package/dist/generate-video.js +195 -0
  22. package/dist/generate-video.js.map +1 -0
  23. package/dist/http-transport.js +3 -4
  24. package/dist/http-transport.js.map +1 -1
  25. package/dist/index.js +27 -151
  26. package/dist/index.js.map +1 -1
  27. package/dist/intent-accounts.d.ts +5 -0
  28. package/dist/intent-accounts.js +66 -0
  29. package/dist/intent-accounts.js.map +1 -0
  30. package/dist/intent-content.d.ts +4 -0
  31. package/dist/intent-content.js +54 -0
  32. package/dist/intent-content.js.map +1 -0
  33. package/dist/intent-library.d.ts +4 -0
  34. package/dist/intent-library.js +41 -0
  35. package/dist/intent-library.js.map +1 -0
  36. package/dist/intent-personas.d.ts +6 -0
  37. package/dist/intent-personas.js +79 -0
  38. package/dist/intent-personas.js.map +1 -0
  39. package/dist/intent-video.d.ts +5 -0
  40. package/dist/intent-video.js +28 -0
  41. package/dist/intent-video.js.map +1 -0
  42. package/dist/{publish-uploaded-tools.d.ts → intent-voices.d.ts} +1 -1
  43. package/dist/intent-voices.js +33 -0
  44. package/dist/intent-voices.js.map +1 -0
  45. package/dist/limits.d.ts +2 -2
  46. package/dist/limits.js +2 -2
  47. package/dist/persona-avatar.d.ts +2 -2
  48. package/dist/persona-avatar.js +5 -5
  49. package/dist/persona-avatar.js.map +1 -1
  50. package/dist/persona-delete.d.ts +6 -0
  51. package/dist/persona-delete.js +41 -0
  52. package/dist/persona-delete.js.map +1 -0
  53. package/dist/persona-update.js +3 -3
  54. package/dist/persona-update.js.map +1 -1
  55. package/dist/publish-direct-shape.js +3 -3
  56. package/dist/publish-direct-shape.js.map +1 -1
  57. package/dist/publish-notices.js +1 -1
  58. package/dist/publish-notices.js.map +1 -1
  59. package/dist/publish-uploaded-shape.js +6 -6
  60. package/dist/publish-uploaded-shape.js.map +1 -1
  61. package/dist/recipe-session.d.ts +7 -10
  62. package/dist/recipe-session.js +17 -25
  63. package/dist/recipe-session.js.map +1 -1
  64. package/dist/refs.d.ts +54 -0
  65. package/dist/refs.js +158 -0
  66. package/dist/refs.js.map +1 -0
  67. package/dist/remote-shapes.d.ts +2 -2
  68. package/dist/remote-shapes.js +6 -6
  69. package/dist/remote-shapes.js.map +1 -1
  70. package/dist/require-publishing-accounts.js +1 -1
  71. package/dist/require-publishing-accounts.js.map +1 -1
  72. package/dist/schedule-shapes.js +7 -7
  73. package/dist/schedule-shapes.js.map +1 -1
  74. package/dist/script-segments.js +1 -1
  75. package/dist/script-segments.js.map +1 -1
  76. package/dist/single-video-shape.d.ts +5 -5
  77. package/dist/single-video-shape.js +20 -20
  78. package/dist/single-video-shape.js.map +1 -1
  79. package/dist/tool-annotations.js.map +1 -1
  80. package/dist/tools-batch.d.ts +63 -64
  81. package/dist/tools-batch.js +7 -8
  82. package/dist/tools-batch.js.map +1 -1
  83. package/dist/tools-experiments.d.ts +48 -66
  84. package/dist/tools-experiments.js +26 -13
  85. package/dist/tools-experiments.js.map +1 -1
  86. package/dist/tools-pinterest.d.ts +0 -1
  87. package/dist/tools-pinterest.js +5 -6
  88. package/dist/tools-pinterest.js.map +1 -1
  89. package/dist/tools-posts.js +7 -7
  90. package/dist/tools-posts.js.map +1 -1
  91. package/dist/tools-prompts.d.ts +2 -2
  92. package/dist/tools-prompts.js +31 -31
  93. package/dist/tools-prompts.js.map +1 -1
  94. package/dist/tools-publish-uploaded.d.ts +0 -3
  95. package/dist/tools-publish-uploaded.js +7 -10
  96. package/dist/tools-publish-uploaded.js.map +1 -1
  97. package/dist/tools-publishing-accounts.js +3 -3
  98. package/dist/tools-publishing-accounts.js.map +1 -1
  99. package/dist/tools-single-video.d.ts +0 -2
  100. package/dist/tools-single-video.js +11 -15
  101. package/dist/tools-single-video.js.map +1 -1
  102. package/dist/tools-user-media.d.ts +0 -2
  103. package/dist/tools-user-media.js +2 -5
  104. package/dist/tools-user-media.js.map +1 -1
  105. package/dist/tools.d.ts +25 -28
  106. package/dist/tools.js +10 -85
  107. package/dist/tools.js.map +1 -1
  108. package/dist/video-task-tools.d.ts +2 -2
  109. package/dist/video-task-tools.js +14 -12
  110. package/dist/video-task-tools.js.map +1 -1
  111. package/dist/voice-filters.d.ts +1 -1
  112. package/dist/voice-filters.js +4 -4
  113. package/dist/voice-filters.js.map +1 -1
  114. package/package.json +1 -1
  115. package/dist/local-file-tools.d.ts +0 -3
  116. package/dist/local-file-tools.js +0 -15
  117. package/dist/local-file-tools.js.map +0 -1
  118. package/dist/publish-uploaded-tools.js +0 -10
  119. package/dist/publish-uploaded-tools.js.map +0 -1
@@ -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,CAA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,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,m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D,WAAW,CAAC,YAAY,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC,EACxD,WAAW,EACX,QAAQ,CACN;QACE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,wBAAwB,CAAC,MAAM,EAAE,IAAI,CAAC;QACjE,aAAa,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,uBAAuB,CAAC,MAAM,EAAE,IAAI,CAAC;QACpE,eAAe,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,yBAAyB,CAAC,MAAM,EAAE,IAAI,CAAC;QACxE,cAAc,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,0BAA0B,CAAC,MAAM,EAAE,IAAI,CAAC;KACzE,EACD,aAAa,EACb,eAAe,EACf,cAAc,CACf,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 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,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,0BAA0B,EAC1B,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,EAChB,aAAa,EACb,mBAAmB,EACnB,2BAA2B,EAC3B,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,mBAAmB,EACnB,YAAY,EACZ,6BAA6B,EAC7B,aAAa,EACb,oBAAoB,EACpB,8BAA8B,EAC9B,eAAe,GAChB,MAAM,kBAAkB,CAAC;AAE1B,iBAAiB;AACjB,qEAAqE;AACrE,qEAAqE;AACrE,iBAAiB;AAEjB,MAAM,eAAe,GAAG;IACtB,IAAI,EAAE,kBAAkB;IACxB,MAAM,EAAE,mBAAmB;IAC3B,QAAQ,EAAE,YAAY;IACtB,iBAAiB,EAAE,oBAAoB;IACvC,WAAW,EAAE,eAAe;CAC7B,CAAC;AAEF,MAAM,WAAW,GAAG,EAAE,IAAI,EAAE,cA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,EACD,WAAW,EACX,OAAO,CACR,CACF,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,UAAU,EACV,iBAAiB,CAAC,wPAAwP,EAAE,cAAc,CAAC,EAC3R,WAAW,CAAC,cAAc,CAAC,EAC3B,SAAS,EACT,QAAQ,CACN;QACE,YAAY,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,oBAAoB,CAAC,MAAM,EAAE,IAAI,CAAC;QAChE,eAAe,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,8BAA8B,CAAC,MAAM,EAAE,IAAI,CAAC;KAC9E,EACD,cAAc,EACd,UAAU,CACX,CACF,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,SAAS,EACT,iBAAiB,CAAC,kHAAkH,EAAE,aAAa,CAAC,EACpJ,WAAW,CAAC,aAAa,CAAC,EAC1B,SAAS,EACT,QAAQ,CACN;QACE,OAAO,EAAE,eAAe,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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AE,CAAC,qBAAqB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QACrG,YAAY,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,wBAAwB,CAAC,MAAM,EAAE,IAAI,CAAC;QACpE,YAAY,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,wBAAwB,CAAC,MAAM,EAAE,IAAI,CAAC;KACrE,EACD,WAAW,EACX,eAAe,EACf,OAAO,CACR,CACF,CAAC;AACJ,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 VideoTasksDescription: string;
5
+ export declare function registerVideoTools(server: McpServer, client: PostEngineerClient, session: RecipeSession): void;
@@ -0,0 +1,28 @@
1
+ import { actionDescription, actionShape, byAction } from './action-tool.js';
2
+ import { withTracking } from './analytics.js';
3
+ import { GenerateVideoDescription, GenerateVideoShape, handleGenerateVideo } from './generate-video.js';
4
+ import { DESTRUCTIVE, MUTATING, READ_ONLY } from './tool-annotations.js';
5
+ import { GetVideoGenerationShape, ListVideoGenerationsShape, handleGetVideoGeneration, handleListVideoGenerations } from './tools.js';
6
+ import { withScriptOutcome } from './tools-prompts.js';
7
+ import { CancelVideoTaskShape, WaitForVideoTasksShape, handleCancelVideoTask, handleWaitForVideoTasks } from './video-task-tools.js';
8
+ //---------------
9
+ // The video tools of issue #566: generate_video (one or a batch),
10
+ // video_tasks (status/wait, generation history) and cancel_video. Registered
11
+ // here; index.ts only wires the intent modules.
12
+ //---------------
13
+ const VIDEO_TASKS_SPECS = {
14
+ status: WaitForVideoTasksShape,
15
+ list_generations: ListVideoGenerationsShape,
16
+ get_generation: GetVideoGenerationShape,
17
+ };
18
+ export const VideoTasksDescription = actionDescription('Follow your videos. status: the state, progress, stage, error and post link of up to 12 tasks at once; waitSeconds 0 is a snapshot, more blocks until every task finishes (partial results on timeout, call again with the unfinished taskIds). list_generations / get_generation: the history of generated videos.', VIDEO_TASKS_SPECS);
19
+ export function registerVideoTools(server, client, session) {
20
+ server.tool('generate_video', GenerateVideoDescription, GenerateVideoShape, MUTATING, withTracking('generate_video', withScriptOutcome(session, 'generate_video', async (args) => handleGenerateVideo(client, args), (args) => args.videos.map((video) => ({ segments: video.segments, videoType: video.options?.videoType })))));
21
+ server.tool('video_tasks', VideoTasksDescription, actionShape(VIDEO_TASKS_SPECS), READ_ONLY, byAction({
22
+ status: (args) => handleWaitForVideoTasks(client, args),
23
+ list_generations: (args) => handleListVideoGenerations(client, args),
24
+ get_generation: (args) => handleGetVideoGeneration(client, args),
25
+ }, VIDEO_TASKS_SPECS, 'video_tasks'));
26
+ server.tool('cancel_video', 'Cancel a video that is still generating (your own task only). Kept apart from video_tasks so a client can allow status checks without allowing cancellation.', CancelVideoTaskShape, DESTRUCTIVE, withTracking('cancel_video', async (args) => handleCancelVideoTask(client, args)));
27
+ }
28
+ //# sourceMappingURL=intent-video.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intent-video.js","sourceRoot":"","sources":["../src/intent-video.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAExG,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AACtI,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM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a,CACd,CACF,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,cAAc,EACd,8JAA8J,EAC9J,oBAAoB,EACpB,WAAW,EACX,YAAY,CAAC,cAAc,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,qBAAqB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAClF,CAAC;AACJ,CAAC"}
@@ -1,3 +1,3 @@
1
1
  import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
2
  import type { PostEngineerClient } from './client.js';
3
- export declare function registerPublishUploadedTools(server: McpServer, apiClient: PostEngineerClient): void;
3
+ export declare function registerVoiceTools(server: McpServer, client: PostEngineerClient, remote: boolean): void;
@@ -0,0 +1,33 @@
1
+ import { actionDescription, actionShape, byAction, offeredSpecs } from './action-tool.js';
2
+ import { CreateClonedVoiceRemoteSchema, CreateClonedVoiceRemoteShape, CreateClonedVoiceSchema, CreateClonedVoiceShape, DeleteClonedVoiceShape, GetClonedVoiceShape, ListClonedVoicesShape, PreviewClonedVoiceShape, PreviewHouseVoiceShape, handleCreateClonedVoice, handleDeleteClonedVoice, handleGetClonedVoice, handleListClonedVoices, handlePreviewClonedVoice, handlePreviewHouseVoice, } from './cloned-voice-tools.js';
3
+ import { DESTRUCTIVE } from './tool-annotations.js';
4
+ import { ListVoicesShape, handleListVoices } from './tools.js';
5
+ //---------------
6
+ // voices (issue #566): the house voices and the voice clones of the account.
7
+ // create_clone from a local audio file exists only on the stdio server; the
8
+ // remote server takes an HTTPS audioUrl.
9
+ //---------------
10
+ const VOICES_SPECS = {
11
+ list: ListVoicesShape,
12
+ preview: PreviewHouseVoiceShape,
13
+ list_clones: ListClonedVoicesShape,
14
+ create_clone: CreateClonedVoiceShape,
15
+ get_clone: GetClonedVoiceShape,
16
+ preview_clone: PreviewClonedVoiceShape,
17
+ delete_clone: DeleteClonedVoiceShape,
18
+ };
19
+ export function registerVoiceTools(server, client, remote) {
20
+ // The remote create_clone takes audioUrl only (a path would resolve on the server).
21
+ const options = remote ? { variants: { create_clone: CreateClonedVoiceRemoteShape } } : {};
22
+ const offered = offeredSpecs(VOICES_SPECS, options);
23
+ server.tool('voices', actionDescription(`Voices for personas and videos. list: the 65 English house voices, each with a text description plus gender/accent/kind (filter with gender, origin, search such as "deep calm"); the voiceId of a persona or video is one of these ids, a label, or a ready clone. preview: a short MP3 of a house voice, optionally with your own text (10 previews a day). Clones: list_clones, create_clone (${remote ? 'from an HTTPS audioUrl' : 'from an HTTPS audioUrl or a local audioPath'}; needs explicit consent), get_clone (poll until ready), preview_clone, delete_clone.`, offered), actionShape(offered), DESTRUCTIVE, byAction({
24
+ list: async (args) => handleListVoices(client, args),
25
+ preview: async (args) => handlePreviewHouseVoice(client, args),
26
+ list_clones: async () => handleListClonedVoices(client),
27
+ create_clone: async (args) => handleCreateClonedVoice(client, remote ? CreateClonedVoiceRemoteSchema.parse(args) : CreateClonedVoiceSchema.parse(args)),
28
+ get_clone: async (args) => handleGetClonedVoice(client, args),
29
+ preview_clone: async (args) => handlePreviewClonedVoice(client, args),
30
+ delete_clone: async (args) => handleDeleteClonedVoice(client, args),
31
+ }, VOICES_SPECS, 'voices', options));
32
+ }
33
+ //# sourceMappingURL=intent-voices.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intent-voices.js","sourceRoot":"","sources":["../src/intent-voices.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAsB,MAAM,kBAAkB,CAAC;AAE9G,OAAO,EACL,6BAA6B,EAC7B,4BAA4B,EAC5B,uBAAuB,EACvB,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,oBAAoB,EACpB,sBAAsB,EACtB,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,uB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CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,uBAAuB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACvJ,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,oBAAoB,CAAC,MAAM,EAAE,IAAI,CAAC;QAC7D,aAAa,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,wBAAwB,CAAC,MAAM,EAAE,IAAI,CAAC;QACrE,YAAY,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,uBAAuB,CAAC,MAAM,EAAE,IAAI,CAAC;KACpE,EACD,YAAY,EACZ,QAAQ,EACR,OAAO,CACR,CACF,CAAC;AACJ,CAAC"}
package/dist/limits.d.ts CHANGED
@@ -6,14 +6,14 @@
6
6
  * a client<->errors import cycle.
7
7
  */
8
8
  /**
9
- * Max caller text for preview_cloned_voice, in characters after trimming.
9
+ * Max caller text for voices (action: preview_clone), in characters after trimming.
10
10
  * Same literal as the engine (app/services/cloned_voices/preview_text.py)
11
11
  * and the web preview route (preview/preview-text.ts), pinned by
12
12
  * __tests__/clone-preview-text-sync.test.ts.
13
13
  */
14
14
  export declare const CLONE_PREVIEW_TEXT_MAX_CHARS = 300;
15
15
  /**
16
- * Max caller text for preview_house_voice, in characters after trimming.
16
+ * Max caller text for voices (action: preview), in characters after trimming.
17
17
  * Same literal as the engine (the house preview reuses the cloned-voice
18
18
  * validator in app/services/cloned_voices/preview_text.py) and the web
19
19
  * house preview route (preview/preview-text.ts), pinned by
package/dist/limits.js CHANGED
@@ -6,14 +6,14 @@
6
6
  * a client<->errors import cycle.
7
7
  */
8
8
  /**
9
- * Max caller text for preview_cloned_voice, in characters after trimming.
9
+ * Max caller text for voices (action: preview_clone), in characters after trimming.
10
10
  * Same literal as the engine (app/services/cloned_voices/preview_text.py)
11
11
  * and the web preview route (preview/preview-text.ts), pinned by
12
12
  * __tests__/clone-preview-text-sync.test.ts.
13
13
  */
14
14
  export const CLONE_PREVIEW_TEXT_MAX_CHARS = 300;
15
15
  /**
16
- * Max caller text for preview_house_voice, in characters after trimming.
16
+ * Max caller text for voices (action: preview), in characters after trimming.
17
17
  * Same literal as the engine (the house preview reuses the cloned-voice
18
18
  * validator in app/services/cloned_voices/preview_text.py) and the web
19
19
  * house preview route (preview/preview-text.ts), pinned by
@@ -1,11 +1,11 @@
1
1
  import { z } from 'zod';
2
2
  export declare function imageFormFile(path: string): Promise<Blob>;
3
- /** create_persona: exactly one of avatarUrl or avatarPath (checked in the client). */
3
+ /** personas (action: create): exactly one of avatarUrl or avatarPath (checked in the client). */
4
4
  export declare const CreatePersonaAvatarFields: {
5
5
  avatarUrl: z.ZodOptional<z.ZodString>;
6
6
  avatarPath: z.ZodOptional<z.ZodString>;
7
7
  };
8
- /** update_persona: at most one of avatarUrl or avatarPath. */
8
+ /** personas (action: update): at most one of avatarUrl or avatarPath. */
9
9
  export declare const UpdatePersonaAvatarFields: {
10
10
  avatarUrl: z.ZodOptional<z.ZodString>;
11
11
  avatarPath: z.ZodOptional<z.ZodString>;
@@ -1,4 +1,4 @@
1
- // Persona face sources for create_persona and update_persona: a public
1
+ // Persona face sources for personas (action: create) and personas (action: update): a public
2
2
  // image URL (avatarUrl) or a local image file (avatarPath). The file goes
3
3
  // up as the multipart `photo` field, the same field the web form uses, so
4
4
  // the face never depends on the server downloading a link. Extracted from
@@ -54,16 +54,16 @@ export async function imageFormFile(path) {
54
54
  return new Blob([buffer], { type: mimeType });
55
55
  }
56
56
  const AVATAR_PATH_DESCRIPTION = `Local file path to the persona face photo (JPG/JPEG, PNG, or WebP, max ${MAX_LIBRARY_IMAGE_MB}MB), uploaded directly. Use instead of avatarUrl for your own photo.`;
57
- /** create_persona: exactly one of avatarUrl or avatarPath (checked in the client). */
57
+ /** personas (action: create): exactly one of avatarUrl or avatarPath (checked in the client). */
58
58
  export const CreatePersonaAvatarFields = {
59
59
  avatarUrl: z
60
60
  .string()
61
61
  .url()
62
62
  .optional()
63
- .describe('Public URL to the persona avatar image (use list_faces for stock face URLs). Give exactly one of avatarUrl or avatarPath: every persona has a face; "no face" is chosen per video with generate_persona_video options.videoType: \'faceless\'.'),
63
+ .describe('Public URL to the persona avatar image (use persona_media (action: list_faces) for stock face URLs). Give exactly one of avatarUrl or avatarPath: every persona has a face; "no face" is chosen per video with generate_video options.videoType: \'faceless\'.'),
64
64
  avatarPath: z.string().min(1).optional().describe(AVATAR_PATH_DESCRIPTION),
65
65
  };
66
- /** update_persona: at most one of avatarUrl or avatarPath. */
66
+ /** personas (action: update): at most one of avatarUrl or avatarPath. */
67
67
  export const UpdatePersonaAvatarFields = {
68
68
  // No .nullable(): the API has no "clear avatar" sentinel — null would be silently ignored.
69
69
  avatarUrl: z.string().url().optional().describe('New public avatar image URL'),
@@ -109,7 +109,7 @@ export async function appendPersonaAvatar(formData, input, required) {
109
109
  return;
110
110
  }
111
111
  if (required) {
112
- throw new Error('avatarUrl or avatarPath is required: every persona has a face. Use list_faces for a stock face URL, avatarPath for a local photo, and generate_persona_video options.videoType: \'faceless\' for videos without a face.');
112
+ throw new Error('avatarUrl or avatarPath is required: every persona has a face. Use persona_media (action: list_faces) for a stock face URL, avatarPath for a local photo, and generate_video options.videoType: \'faceless\' for videos without a face.');
113
113
  }
114
114
  }
115
115
  //# sourceMappingURL=persona-avatar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"persona-avatar.js","sourceRoot":"","sources":["../src/persona-avatar.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,0EAA0E;AAC1E,0EAA0E;AAC1E,0EAA0E;AAC1E,mEAAmE;AACnE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,eAAe,EAA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CAAC;IACD,IAAI,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;QACzB,QAAQ,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,aAAa,CAAC,UAAU,CAAC,EAAE,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC;QAC7E,OAAO;IACT,CAAC;IACD,IAAI,QAAQ,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACb,yOAAyO,CAC1O,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { PostEngineerClient } from './client.js';
2
+ import type { McpToolResponse } from './tools-call.js';
3
+ export declare function handlePersonaDelete(client: PostEngineerClient, args: {
4
+ personaId: string;
5
+ confirmToken?: string;
6
+ }): Promise<McpToolResponse>;
@@ -0,0 +1,41 @@
1
+ import { createHash } from 'node:crypto';
2
+ import { ApiError, getErrorMessage } from './errors.js';
3
+ import { handleDeletePersona, handleLibraryCall, narrowDeletePreview, sanitizeEngineError } from './tools.js';
4
+ function digest(personaId, preview) {
5
+ const stable = { personaId, counts: preview.counts, tasks: preview.videos.map((video) => video.taskId), truncated: preview.videosTruncated };
6
+ return createHash('sha256').update(JSON.stringify(stable)).digest('hex').slice(0, 16);
7
+ }
8
+ function previewText(personaId, preview, confirmToken, note) {
9
+ const counts = preview.counts;
10
+ const summary = `Deleting persona "${preview.persona.name ?? personaId}" would remove ` +
11
+ `${counts.schedules ?? '?'} schedule(s), ${counts.upcomingSlots ?? '?'} upcoming slot(s), ` +
12
+ `${counts.publishedSlots ?? '?'} published slot(s), ${counts.generatedVideos ?? '?'} generated video(s), ` +
13
+ `and ${counts.personaImages ?? '?'} library image(s). No token refunds.`;
14
+ return `${note}\n${summary}\n${JSON.stringify(preview, null, 2)}\nNothing was deleted. To delete, call personas with action "delete", the same persona and confirmToken "${confirmToken}".`;
15
+ }
16
+ export async function handlePersonaDelete(client, args) {
17
+ let preview;
18
+ try {
19
+ preview = narrowDeletePreview(await client.getPersonaDeletePreview(args.personaId));
20
+ }
21
+ catch (error) {
22
+ // An API error keeps its structured contract (code, message, field), as the other persona tools.
23
+ if (error instanceof ApiError && error.code !== null) {
24
+ const body = JSON.stringify({ code: error.code, message: sanitizeEngineError(getErrorMessage(error)), field: error.field });
25
+ return { content: [{ type: 'text', text: `Error previewing the persona deletion: ${body}` }], isError: true };
26
+ }
27
+ return handleLibraryCall(async () => { throw error; }, 'previewing the persona deletion');
28
+ }
29
+ const token = digest(args.personaId, preview);
30
+ if (args.confirmToken === undefined) {
31
+ return { content: [{ type: 'text', text: previewText(args.personaId, preview, token, 'Preview only — confirmation needed.') }] };
32
+ }
33
+ if (args.confirmToken !== token) {
34
+ return {
35
+ content: [{ type: 'text', text: previewText(args.personaId, preview, token, 'The confirmToken does not match the persona as it is now (it changed since the preview, or the token is wrong).') }],
36
+ isError: true,
37
+ };
38
+ }
39
+ return handleDeletePersona(client, { personaId: args.personaId });
40
+ }
41
+ //# sourceMappingURL=persona-delete.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"persona-delete.js","sourceRoot":"","sources":["../src/persona-delete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAmB9G,SAAS,MAAM,CAAC,SAAiB,EAAE,OAAsB;IACvD,MAAM,MAAM,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,eAAe,EAAE,CAAC;IAC7I,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,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,CAAC,CAAC;YAC5H,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,0CAA0C,IAAI,EAAE,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;QAChH,CAAC;QACD,OAAO,iBAAiB,CAAC,KAAK,IAAI,EAAE,GAAG,MAAM,KAAK,CAAC,CAAC,CAAC,EAAE,iCAAiC,CAAC,CAAC;IAC5F,CAAC;IACD,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAC9C,IAAI,IAAI,CAAC,YAAY,KAAK,SAAS,EAAE,CAAC;QACpC,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,qCAAqC,CAAC,EAAE,CAAC,EAAE,CAAC;IACnI,CAAC;IACD,IAAI,IAAI,CAAC,YAAY,KAAK,KAAK,EAAE,CAAC;QAChC,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,iHAAiH,CAAC,EAAE,CAAC;YACjM,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;IACD,OAAO,mBAAmB,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;AACpE,CAAC"}
@@ -1,8 +1,8 @@
1
- // update_persona: shape, schema and handler.
1
+ // personas (action: update): shape, schema and handler.
2
2
  //
3
3
  // Extracted from tools.ts so tools.ts stays under the file-size ratchet.
4
4
  // Re-exported from tools.ts, so existing import sites (`./tools.js`) keep
5
- // working, including the tool registration in index.ts.
5
+ // working, including the personas and accounts registration (intent-*.ts).
6
6
  import { z } from 'zod';
7
7
  import { VIDEO_LAYOUTS } from './client.js';
8
8
  import { handleLibraryCall } from './tools-call.js';
@@ -13,7 +13,7 @@ export const UpdatePersonaShape = {
13
13
  personaId: z.string().min(1, 'personaId is required').describe('The ID of the persona to update'),
14
14
  name: z.string().min(1).optional().describe('New name for the persona'),
15
15
  ...UpdatePersonaAvatarFields,
16
- voiceId: personaVoiceField().optional().describe('New voice id or label from list_voices. Never type a provider prefix.'),
16
+ voiceId: personaVoiceField().optional().describe('New voice id or label from voices (action: list). Never type a provider prefix.'),
17
17
  language: z
18
18
  .string()
19
19
  .refine(isEnglishLanguage, { message: ONLY_ENGLISH_VIDEOS_MESSAGE })