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.
- package/README.md +87 -98
- package/dist/account-shapes.js +2 -2
- package/dist/account-shapes.js.map +1 -1
- package/dist/action-tool.d.ts +32 -0
- package/dist/action-tool.js +90 -0
- package/dist/action-tool.js.map +1 -0
- package/dist/analytics.d.ts +2 -0
- package/dist/analytics.js +10 -0
- package/dist/analytics.js.map +1 -1
- package/dist/client-types.d.ts +3 -3
- package/dist/client.js +1 -1
- package/dist/client.js.map +1 -1
- package/dist/cloned-voice-tools.d.ts +1 -3
- package/dist/cloned-voice-tools.js +4 -33
- package/dist/cloned-voice-tools.js.map +1 -1
- package/dist/connect-account.js +3 -3
- package/dist/connect-account.js.map +1 -1
- package/dist/direct-publish-form.js +1 -1
- package/dist/direct-publish-form.js.map +1 -1
- package/dist/generate-video.d.ts +254 -0
- package/dist/generate-video.js +195 -0
- package/dist/generate-video.js.map +1 -0
- package/dist/http-transport.js +3 -4
- package/dist/http-transport.js.map +1 -1
- package/dist/index.js +27 -151
- package/dist/index.js.map +1 -1
- package/dist/intent-accounts.d.ts +5 -0
- package/dist/intent-accounts.js +66 -0
- package/dist/intent-accounts.js.map +1 -0
- package/dist/intent-content.d.ts +4 -0
- package/dist/intent-content.js +54 -0
- package/dist/intent-content.js.map +1 -0
- package/dist/intent-library.d.ts +4 -0
- package/dist/intent-library.js +41 -0
- package/dist/intent-library.js.map +1 -0
- package/dist/intent-personas.d.ts +6 -0
- package/dist/intent-personas.js +79 -0
- package/dist/intent-personas.js.map +1 -0
- package/dist/intent-video.d.ts +5 -0
- package/dist/intent-video.js +28 -0
- package/dist/intent-video.js.map +1 -0
- package/dist/{publish-uploaded-tools.d.ts → intent-voices.d.ts} +1 -1
- package/dist/intent-voices.js +33 -0
- package/dist/intent-voices.js.map +1 -0
- package/dist/limits.d.ts +2 -2
- package/dist/limits.js +2 -2
- package/dist/persona-avatar.d.ts +2 -2
- package/dist/persona-avatar.js +5 -5
- package/dist/persona-avatar.js.map +1 -1
- package/dist/persona-delete.d.ts +6 -0
- package/dist/persona-delete.js +41 -0
- package/dist/persona-delete.js.map +1 -0
- package/dist/persona-update.js +3 -3
- package/dist/persona-update.js.map +1 -1
- package/dist/publish-direct-shape.js +3 -3
- package/dist/publish-direct-shape.js.map +1 -1
- package/dist/publish-notices.js +1 -1
- package/dist/publish-notices.js.map +1 -1
- package/dist/publish-uploaded-shape.js +6 -6
- package/dist/publish-uploaded-shape.js.map +1 -1
- package/dist/recipe-session.d.ts +7 -10
- package/dist/recipe-session.js +17 -25
- package/dist/recipe-session.js.map +1 -1
- package/dist/refs.d.ts +54 -0
- package/dist/refs.js +158 -0
- package/dist/refs.js.map +1 -0
- package/dist/remote-shapes.d.ts +2 -2
- package/dist/remote-shapes.js +6 -6
- package/dist/remote-shapes.js.map +1 -1
- package/dist/require-publishing-accounts.js +1 -1
- package/dist/require-publishing-accounts.js.map +1 -1
- package/dist/schedule-shapes.js +7 -7
- package/dist/schedule-shapes.js.map +1 -1
- package/dist/script-segments.js +1 -1
- package/dist/script-segments.js.map +1 -1
- package/dist/single-video-shape.d.ts +5 -5
- package/dist/single-video-shape.js +20 -20
- package/dist/single-video-shape.js.map +1 -1
- package/dist/tool-annotations.js.map +1 -1
- package/dist/tools-batch.d.ts +63 -64
- package/dist/tools-batch.js +7 -8
- package/dist/tools-batch.js.map +1 -1
- package/dist/tools-experiments.d.ts +48 -66
- package/dist/tools-experiments.js +26 -13
- package/dist/tools-experiments.js.map +1 -1
- package/dist/tools-pinterest.d.ts +0 -1
- package/dist/tools-pinterest.js +5 -6
- package/dist/tools-pinterest.js.map +1 -1
- package/dist/tools-posts.js +7 -7
- package/dist/tools-posts.js.map +1 -1
- package/dist/tools-prompts.d.ts +2 -2
- package/dist/tools-prompts.js +31 -31
- package/dist/tools-prompts.js.map +1 -1
- package/dist/tools-publish-uploaded.d.ts +0 -3
- package/dist/tools-publish-uploaded.js +7 -10
- package/dist/tools-publish-uploaded.js.map +1 -1
- package/dist/tools-publishing-accounts.js +3 -3
- package/dist/tools-publishing-accounts.js.map +1 -1
- package/dist/tools-single-video.d.ts +0 -2
- package/dist/tools-single-video.js +11 -15
- package/dist/tools-single-video.js.map +1 -1
- package/dist/tools-user-media.d.ts +0 -2
- package/dist/tools-user-media.js +2 -5
- package/dist/tools-user-media.js.map +1 -1
- package/dist/tools.d.ts +25 -28
- package/dist/tools.js +10 -85
- package/dist/tools.js.map +1 -1
- package/dist/video-task-tools.d.ts +2 -2
- package/dist/video-task-tools.js +14 -12
- package/dist/video-task-tools.js.map +1 -1
- package/dist/voice-filters.d.ts +1 -1
- package/dist/voice-filters.js +4 -4
- package/dist/voice-filters.js.map +1 -1
- package/package.json +1 -1
- package/dist/local-file-tools.d.ts +0 -3
- package/dist/local-file-tools.js +0 -15
- package/dist/local-file-tools.js.map +0 -1
- package/dist/publish-uploaded-tools.js +0 -10
- package/dist/publish-uploaded-tools.js.map +0 -1
package/README.md
CHANGED
|
@@ -32,16 +32,16 @@ credits is billed by Modal.
|
|
|
32
32
|
## Remote (HTTP) surface
|
|
33
33
|
|
|
34
34
|
With `--http-transport` the same server speaks Streamable HTTP, but it
|
|
35
|
-
never reads files from the host it runs on: `
|
|
36
|
-
`
|
|
37
|
-
`
|
|
35
|
+
never reads files from the host it runs on: `media (action: upload)`,
|
|
36
|
+
`persona_media (action: add_image)` and `publish_video (action: from_file)` are not registered, and
|
|
37
|
+
`personas (action: create)`, `personas (action: update)` and `voices (action: create_clone)` accept only
|
|
38
38
|
public URLs (`avatarUrl` / `audioUrl`) — no `avatarPath`, `audioPath` or
|
|
39
39
|
library image files. Local paths stay available on the default stdio
|
|
40
40
|
server, where the disk is the agent's own machine. Signed upload
|
|
41
|
-
replaces them on the remote surface: `
|
|
41
|
+
replaces them on the remote surface: `publish_video (action: create_upload)` mints a
|
|
42
42
|
short-lived signed URL, the caller PUTs the video bytes to it directly,
|
|
43
|
-
`
|
|
44
|
-
`
|
|
43
|
+
`publish_video (action: complete_upload)` verifies the stored bytes, and
|
|
44
|
+
`publish_video (action: publish_upload)` publishes by id (single-use).
|
|
45
45
|
|
|
46
46
|
### Hosted endpoint and ChatGPT
|
|
47
47
|
|
|
@@ -51,10 +51,12 @@ The hosted remote endpoint is `https://post-engineer.com/mcp`
|
|
|
51
51
|
a remote MCP client — including ChatGPT, which requires a public HTTPS
|
|
52
52
|
endpoint, OAuth, and tool annotations — at that URL and sign in; no
|
|
53
53
|
local install or API key is needed. Every tool carries MCP annotations
|
|
54
|
-
(`readOnlyHint` for `
|
|
55
|
-
`
|
|
56
|
-
|
|
57
|
-
can auto-approve reads and confirm
|
|
54
|
+
(`readOnlyHint` for `video_tasks`/`posts`/`insights`/`billing`/`prompts`/
|
|
55
|
+
`check_script`, `destructiveHint` for `personas`/`persona_media`/`voices`/
|
|
56
|
+
`accounts`/`schedules`/`publish_video`/`cancel_video`, `openWorldHint`
|
|
57
|
+
throughout) so annotation-aware clients can auto-approve reads and confirm
|
|
58
|
+
writes. Annotations are per tool, so a tool with a destructive action is
|
|
59
|
+
destructive for all its actions. The stdio package above
|
|
58
60
|
remains fully supported for local agents.
|
|
59
61
|
|
|
60
62
|
### Deployment (remote HTTP service)
|
|
@@ -80,9 +82,9 @@ No script content, media or credentials are sent. The server itself never
|
|
|
80
82
|
contacts any analytics service.
|
|
81
83
|
|
|
82
84
|
To measure whether agents use the recipes, the requests of the recipe-aware
|
|
83
|
-
tools (`
|
|
84
|
-
`
|
|
85
|
-
`
|
|
85
|
+
tools (`prompts (action: list)`, `prompts (action: get)`, `personas (action: create)`, `personas (action: list)`,
|
|
86
|
+
`accounts (action: list)`, `billing (action: balance)`, `check_script (action: validate)`,
|
|
87
|
+
`generate_video`) also carry:
|
|
86
88
|
|
|
87
89
|
| Header | Value |
|
|
88
90
|
| --- | --- |
|
|
@@ -90,9 +92,9 @@ tools (`list_prompts`, `get_prompt`, `create_persona`, `list_personas`,
|
|
|
90
92
|
| `X-MCP-Transport` | `stdio` or `http` |
|
|
91
93
|
| `X-MCP-Nudged-By` | The last tool whose result showed the recipe nudge, or `none` |
|
|
92
94
|
| `X-MCP-Recipes-Known` | `true` once the agent listed or fetched a recipe |
|
|
93
|
-
| `X-MCP-Recipe-Fetched` | The last recipe slug `
|
|
95
|
+
| `X-MCP-Recipe-Fetched` | The last recipe slug `prompts (action: get)` returned, or `none` |
|
|
94
96
|
| `X-MCP-Script-Rejections` | Scripts the local validator rejected so far in the session |
|
|
95
|
-
| `X-MCP-Recipe` | The recipe slug of this call (`
|
|
97
|
+
| `X-MCP-Recipe` | The recipe slug of this call (`prompts (action: get)`'s slug, `generate_video`'s `recipe`) |
|
|
96
98
|
|
|
97
99
|
The web API records them as `mcp_tool_called` properties; a slug that is not
|
|
98
100
|
a hub slug is recorded as `unknown`.
|
|
@@ -176,84 +178,71 @@ Run it before and after a change to tool schemas and put both outputs in the PR.
|
|
|
176
178
|
|
|
177
179
|
## Tools
|
|
178
180
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
- `create_cloned_voice`: register a voice clone from a short reference recording — exactly one of `audioUrl` (HTTPS URL) or `audioPath` (local `.mp3`/`.wav`/`.m4a`/`.webm` file, max 20MB, checked before it is read; errors name only the file, never the full path) (requires `consent: true` and `denoise`: `true` cleans background noise first, `false` keeps the original).
|
|
183
|
-
- `get_cloned_voice`: get one voice clone by id — poll its `status` after `create_cloned_voice` until `ready` (then `voice_id` is set) or `failed`.
|
|
184
|
-
- `delete_cloned_voice`: delete a voice clone by id.
|
|
185
|
-
- `preview_cloned_voice`: synthesize a short MP3 preview for a ready clone (returns base64 audio). Optional `text` (1-300 chars, English) makes the clone speak your words instead of the fixed sample; previews are free and limited to 10 per user per day.
|
|
186
|
-
- `preview_house_voice`: synthesize a short MP3 preview for a house voice from `list_voices` (returns base64 audio). Optional `text` (1-300 chars, English) makes the voice speak your words instead of the fixed sample; previews are free and limited to 10 per user per day.
|
|
187
|
-
- `list_faces`: list default/stock persona faces (live catalog from `/api/persona/faces`). Each item has `id`, `url`, `name`, `gender`, `age` (single number, e.g. 23), `ethnicity`, `hair`, and `description` (English) so agents can choose without the photo; pass a face `url` as `avatarUrl` on `create_persona`.
|
|
188
|
-
- `create_persona`: create an AI persona (avatar, voice, language, niche). A face is REQUIRED, from exactly one source: `avatarUrl` (a public image URL or a `list_faces` url) or `avatarPath` (a local JPG/PNG/WebP file, max 10MB, uploaded directly as the persona photo, so the server never has to download a link). Passing both is rejected before anything is sent. "No face" is a per-video choice (`options.videoType: 'faceless'` on `generate_persona_video`). `voiceId` takes a house name or label from `list_voices` (`phonon_zoey`, `Zoey`) or a clone id/key you copied from `list_voices`; never type a provider prefix (`elevenlabs:`/`openrouter:`) — an unknown voice is rejected before anything is sent.
|
|
189
|
-
- `update_persona`: update an existing persona (only the provided fields change). Replace the face with `avatarUrl` or `avatarPath` (local photo file, uploaded directly); at most one of the two. `faceQuality` (`ok` 480p / `very_good` 720p) can be changed without recreating the persona: future videos price at the new quality, already-scheduled posts keep the quality they were charged for.
|
|
190
|
-
- `get_token_balance`: get the prepaid token wallet balance. Check before generating videos, which cost tokens.
|
|
191
|
-
- `list_prompts`: list the recipe prompts this server can run — one entry per recipe with `slug`, `title`, and `description` (news, place spotlight, subject spotlight, GitHub PRs, full setup), no prompt text (cheap discovery). Call this first when the request is a topic instead of a ready script; then fetch the matching recipe with `get_prompt`.
|
|
192
|
-
- `get_prompt`: get one recipe prompt by its `slug` (from `list_prompts`) as ready-to-run instructions covering the full validated flow (script limits, media checks, the generation call), ending with a line asking the agent to pass the slug as `recipe` on `generate_persona_video`. Unknown slugs return an error naming the valid slugs.
|
|
193
|
-
- `validate_script`: validate a segments script mechanically, without spending tokens — hook first, then content takes in order, exactly one hook, word limits (total 60-200, content at least 30, hook 15-40 words before TTS). Returns the word counts and the hook window (8-12 seconds spoken). Measured hook duration is pending a hook-only TTS endpoint and is reported as pending, never invented. It also checks that every segment's `media` is a list with about one image per ~3s of speech (a 60s video needs about 20 images, at most 30); optional `fullLipsync` leaves media optional there (at most 6 images in total).
|
|
194
|
-
- `score_draft`: score a draft mechanically against the caller's own measured posts, without spending tokens. Returns a 0-100 score where every point is explained (hook, length, hashtags, slop markers, links, top-theme match, call to action), the baseline it was scored against (top angles by engagement), and the publish check for the requested network (linkedin, youtube, instagram, bluesky, threads, facebook, 3speak): it fails only on an empty draft or the network's own ceiling where this repo has evidence for it (LinkedIn 3000 characters, Threads 500 characters, Facebook 63206 characters, Bluesky 300 graphemes); the rest are warnings. A failing publish check means: fix the draft before scheduling it for that network. Pass kind 'script' for a video script (segments joined by newlines, hook first, then content takes): hashtags are not scored and publishCheck is null.
|
|
195
|
-
- `score_draft`: score a draft mechanically against the caller's own measured posts, without spending tokens. Returns a 0-100 score where every point is explained (hook, length, hashtags, slop markers, links, top-theme match, call to action), the baseline it was scored against (top angles by engagement), and the publish check for the requested network (linkedin, youtube, instagram, bluesky, threads, facebook, rumble): it fails only on an empty draft or the network's own ceiling where this repo has evidence for it (LinkedIn 3000 characters, Threads 500 characters, Facebook 63206 characters, Bluesky 300 graphemes); the rest are warnings. A failing publish check means: fix the draft before scheduling it for that network. Pass kind 'script' for a video script (segments joined by newlines, hook first, then content takes): hashtags are not scored and publishCheck is null.
|
|
196
|
-
- `upload_media`: upload a local image for a video segment and get a `mediaId` to use in a segment's `media` field. JPG/JPEG, PNG, or WebP, max 8MB (the engine photo limit, not the 10MB library limit); the real content type is validated, not the extension. The file is stored as a temporary engine asset (1 hour TTL): upload shortly before generating, since a scheduled slot far in the future may outlive the asset — in the images modes an expired mediaId fails the task at render; full lip sync only warns. Returns only the `mediaId`. Each item in a segment's `media` list may also carry an `overlay` (`title`, optional `subtitle` and `badge`, at most 60, 80 and 30 characters): an info card with the real place name, address and price, painted at the top of the photo. The photo is shown over the video for the seconds its segment is spoken, with the subtitles on top: full frame on faceless videos (the whole photo over a blurred copy of itself, so it never leaves black bars), and as a framed panel (about 38% of the frame, 30 px from the bottom edge) where a persona's face is on screen, so the face still shows behind it. That means the hook of a hook-only lip-sync video and every segment of a full lip-sync video get the panel; once a hook-only video switches to the agent's images the photo goes full frame. In the react layout the persona fills the top half, so the panel sits at the bottom. A card that cannot be drawn is skipped with a task warning while the photo still ships.
|
|
197
|
-
- `check_media`: mechanically check one public image URL for a segment, without an LLM and without judging relevance (the agent, who sees the image, decides relevance). Returns exactly one code: `ok`, `blocked_403`, `not_image`, `too_small`, `too_large`, `timeout`, or `wrong_aspect`. No fake User-Agent or Referer is sent to bypass hotlink blocks, and private addresses are never fetched.
|
|
198
|
-
- `generate_persona_video`: generate and schedule ONE persona video from a complete script — generation is always tied to publishing (one call = generate + schedule + auto-publish; no orphan videos, no separate schedule step). Send the full script as `segments` (first `hook`, then content takes in order; 60-200 words total, content at least 30, hook 15-40 words ending with terminal punctuation). A CTA is just a content take, placed anywhere — no LLM expands it. `title` is the slot label for this video. `personaId` is optional: omit it for a faceless post with no persona, in which case set `options.videoType: 'faceless'` and `options.voiceId` (or `options.audioUrl`), plus `videoAspect` / `language` / `niche` as needed. `options.voiceId` takes a house name or label from `list_voices` (`phonon_zoey`, `Zoey`) or a clone id/key from `list_voices`; never type a provider prefix — an unknown voice is rejected before generation (no tokens spent). Pass `providers` plus per-provider account IDs (see the account ID table below), `startAt` + `times` in `timezone` (or `mode: 'asap'` with no `startAt`/`times`). The slot must be 3h–30d ahead. `idempotencyKey` is generated automatically; reuse it to retry without generating twice (`replayed: true`). Optional `recipe`: the recipe slug the script was written with — sent only as the `X-MCP-Recipe` telemetry header, never in the request body. Wait for the slot's `taskId` with `wait_for_video_tasks` — it blocks until the video completes or fails and reports the outcome. The video shows only the images you send on the segments. A segment's `media` is a list of `{ mediaId }` or `{ url }` items. Every segment needs about one image per ~3s of speech (about 8 words; a 60s video needs about 20 images, split across the segments, at most 30), checked before any token is spent; each image is shown full frame with a slow zoom for its share of the segment. If an image fails at render time the task fails with `images_do_not_cover_audio` — naming the skipped photos and why each one died — and the tokens are refunded, so send only photos that will survive (right aspect, big enough, fresh mediaId). Full lip-sync videos are the exception: the face is on screen throughout, so a failed photo there is only a warning. The images are third-party content you supply: use only images you have the rights to.
|
|
199
|
-
- `generate_persona_video_batch`: generate and schedule a BATCH of 2-12 persona videos in one call, cheaper than one by one: for every 6 videos with the persona face, the cheapest one is free. Each video takes the same fields as `generate_persona_video` (no `idempotencyKey`, `experiment` or `recipe`). The videos are created one after the other through the same route (each charged its normal price and dispatched at once, so the batch renders back to back in one warm GPU container), then the server credits back the free ones (`POST /api/videos/batch-discount`). Faceless videos can be in the batch but pay full price, do not count toward the 6 and are never free. All videos must be created within 10 minutes of the first, and a video belongs to one batch only. `batchKey` names the batch: calling again with the same `batchKey` and the same videos in the same order replays the created videos (no second charge), creates the missing ones and retries the discount. Cancelling a video of a discounted batch (`cancel_schedule`) withholds, from that video's refund, the discount the batch no longer earns. After creation, wait for every `taskId` with `wait_for_video_tasks`.
|
|
200
|
-
- `get_video_status`: check generation status and get the final video URL. 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.
|
|
201
|
-
- `get_video_task_progress`: poll one video task for 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 per-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.
|
|
202
|
-
- `wait_for_video_tasks`: wait for one or more video tasks to reach a terminal state: blocks until every `taskId` completes or fails, or the timeout elapses. Returns `{summary, allTerminal, timedOut, results}` with one entry per task: `{task_id, state, outcome, progress, stage, error, postUrl}`. `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 `taskId`s.
|
|
203
|
-
- `cancel_video_task`: cancel/remove one of your video tasks on the engine by `taskId` (from `get_video_status`, `get_video_task_progress`, `get_post` or `list_posts`). Only your 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.
|
|
204
|
-
- `list_persona_images`: list a persona's image library (id, tag, description, is_primary). Use the ids with `generate_persona_video` `options.imageId` to force a specific image for every video in one call.
|
|
205
|
-
- `add_persona_image`: add an image to a persona image library from a local file path (JPG/JPEG, PNG, or WebP, max 9MB). Optional tag and description drive the deterministic per-video image selection.
|
|
206
|
-
- `update_persona_image`: update a persona library image tag, description, or primary flag.
|
|
207
|
-
- `remove_persona_image`: remove an image from a persona image library.
|
|
208
|
-
- `publish_video_direct`: publish a ready-made video file directly to social accounts — no generation, no schedule (local .mp4/.mov, max 2GB; YouTube needs title, description, tags, privacyStatus; Rumble needs title and description; Pinterest needs a boardId from `list_pinterest_boards`; others need caption).
|
|
209
|
-
- `create_video_upload`: mint a short-lived signed upload for one video (MP4 or MOV, max 2GB) — returns an uploadId and a signedUrl to PUT the bytes to directly; bound to your account, expires in 15 minutes.
|
|
210
|
-
- `complete_video_upload`: verify a signed video upload after the PUT (the server checks the real bytes and size) and mark it ready to publish; safe to retry.
|
|
211
|
-
- `publish_uploaded_video`: publish a completed signed-upload video by uploadId — no generation, no schedule, no local path; single-use (same provider field rules as `publish_video_direct`).
|
|
212
|
-
- `list_social_accounts`: list connected social accounts with the account IDs needed for scheduling.
|
|
213
|
-
- `list_pinterest_boards`: list the boards of a connected Pinterest account (id + name) — the id is the boardId for Pinterest publishing.
|
|
214
|
-
- `get_persona_publishing_accounts`: list a persona's default publishing accounts per provider. `generate_persona_video` falls back to these when no account IDs are passed; explicit IDs always win.
|
|
215
|
-
- `set_persona_publishing_accounts`: replace a persona's default publishing accounts per provider (account IDs from `list_social_accounts`; providers mapped to `[]` keep no defaults).
|
|
216
|
-
- `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 + app 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 (the 40-character Simple Upload API token, issued by emailing bd@rumble.com — no OAuth).
|
|
217
|
-
- `list_schedules`: list automation schedules.
|
|
218
|
-
- `list_posts`: list upcoming (scheduled) and past (published/failed) posts across all connected accounts. With `from` + `to` (ISO-8601 with UTC offset, at most 62 days) it returns every post of any status in that window as one `slots` list, plus `truncated`. Each 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.
|
|
219
|
-
- `cancel_schedule`: cancel a schedule by its ID.
|
|
220
|
-
- `get_slot`: get one scheduled post's full detail by slot ID (status, title, scheduled time, progress, schedule, persona). 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.
|
|
221
|
-
- `update_slot_title`: edit the title of a scheduled post (pending/awaiting or ready slots only).
|
|
222
|
-
- `delete_slot`: delete one scheduled post slot (only pending/awaiting, ready or failed slots; never the schedule's last slot).
|
|
223
|
-
- `list_video_generations`: list the video generation history, newest first (status, error code, token refunds).
|
|
224
|
-
- `get_video_generation`: get one video generation's detail by generation ID.
|
|
225
|
-
- `get_post`: get one post's full detail by id, whether the id is a slot id or a generation id (the server resolves it; the response says `kind: "slot"` or `kind: "generation"`). Both kinds carry live generation progress. 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.
|
|
226
|
-
- `get_post_metrics`: per-video performance snapshots (views, likes, comments, saves) for a `window` of `24h`, `7d` or `28d`, newest first. Optional exact-match filters: `persona` (uuid, or `^@none` for posts without a persona), `account`, `provider`, `angle` (or `^@none`). Returns `rows` and `truncated`. YouTube rows also carry YouTube Analytics retention for your own videos: `engagedViews`, `stayedToWatchPct` (derived: engaged views / views, not a native metric), `averageViewPercentage`, `contentType`, `provisional` (Analytics data is not final for ~3 days; `28d` rows are final), and `analyticsStatus` (`scope_missing` = reconnect YouTube to grant `yt-analytics.readonly`).
|
|
227
|
-
- `get_youtube_retention_curve`: the audience retention curve of one of your own published YouTube videos (`account` + `video` from a youtube `get_post_metrics` row), read live from YouTube Analytics: `points` of `ratio` (0.01–1.0 of the video), `audienceWatchRatio`, `relativeRetentionPerformance`. Only your own channel is queried. Shorts have no per-second curve in YouTube Studio; long-form videos do.
|
|
228
|
-
- `create_experiment`: create a paired A/B test of ONE script variable (the hook): a name, an optional `personaId`, `targetPairs` (3–20, default 6) and exactly two variants, each with a slug `variantId` (e.g. `hook-aggressive`, never "A"/"B"), a `name` and a style `description` you follow when writing its hooks. Nothing is charged.
|
|
229
|
-
- `list_experiments`: your experiments with their two variants and target pairs.
|
|
230
|
-
- `add_experiment_pair`: create both videos of one pair: same `title` and content (`segments` without the hook) and one hook per variant in `hooks`, plus the usual delivery fields of `generate_persona_video`. Each video is a normal charged video; the second starts `spacingHours` (default 24) 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), faceless and faceless material, full lip-sync, 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 again with the same arguments replays what was already created; if a video's dispatch failed (its slot is `failed`, tokens refunded) the call reports an error and that pair number stays taken (a single-video schedule's only slot cannot be removed with `delete_slot`), so continue with the next free pair number.
|
|
231
|
-
- `get_experiment_results`: the experiment's videos by pair and, per provider, each pair's views/likes/comments/average view duration, wins per variant, a sign-test `pValue` and a `label`: `pending`, `indicative` (not proven yet) or `clear` (every target pair decided and p < 0.05). `window` is `24h`, `7d` (default) or `28d`.
|
|
232
|
-
- `list_token_transactions`: list the token ledger — every credit and debit (purchases, generation spends, refunds), newest first.
|
|
233
|
-
- `get_persona_delete_preview`: preview what deleting a persona would remove (counts + per-video download links). Read-only.
|
|
234
|
-
- `delete_persona`: DESTRUCTIVE — delete a persona with all its schedules, slots, videos, and image library. No token refunds.
|
|
235
|
-
- `disconnect_account`: disconnect a social account by provider and account ID.
|
|
236
|
-
|
|
237
|
-
### Social account IDs for `generate_persona_video`
|
|
238
|
-
|
|
239
|
-
Each provider's `*AccountIds` field expects the provider's account identifier
|
|
240
|
-
from `list_social_accounts` — **not** the `recordId` (that is the internal
|
|
241
|
-
database row id and is rejected):
|
|
242
|
-
|
|
243
|
-
| Provider | `generate_persona_video` field | Use this `list_social_accounts` field |
|
|
181
|
+
The server offers **16 intent tools**, not one tool per API endpoint. A tool is a complete abstraction of an intent: it takes what you would say ("the persona Maria", "my YouTube channel"), resolves the ids inside the call, and returns only what the agent needs for the next step. Most tools take an `action`; the schema is one flat object (a required `action` plus the fields of every action), and each tool's description lists the required fields per action. A field of another action, or a missing required field, is rejected before any request is sent, naming the tool, the action and the field.
|
|
182
|
+
|
|
183
|
+
| Tool | Actions | What it is for |
|
|
244
184
|
|---|---|---|
|
|
245
|
-
|
|
|
246
|
-
|
|
|
247
|
-
|
|
|
248
|
-
|
|
|
249
|
-
|
|
|
250
|
-
|
|
|
251
|
-
|
|
|
252
|
-
|
|
|
253
|
-
|
|
|
254
|
-
|
|
|
255
|
-
|
|
256
|
-
|
|
185
|
+
| `generate_video` | — | Generate and schedule one video, or a batch of 2-12 (every 6 face videos, the cheapest is free). `persona` and `accounts` by name or id; the result echoes what was resolved. |
|
|
186
|
+
| `video_tasks` | `status`, `list_generations`, `get_generation` | Follow videos: `status` takes up to 12 `taskIds`; `waitSeconds` 0 is a snapshot, more blocks until they finish. |
|
|
187
|
+
| `cancel_video` | — | Cancel a video that is still generating. Separate so a client can allow status without cancel. |
|
|
188
|
+
| `personas` | `list`, `get`, `create`, `update`, `delete` | Personas. `delete` previews first and needs the `confirmToken` of that preview to delete. |
|
|
189
|
+
| `persona_media` | `list_faces`, `list_images`, `add_image`, `update_image`, `remove_image` | Stock faces and a persona's image library. |
|
|
190
|
+
| `voices` | `list`, `preview`, `list_clones`, `create_clone`, `get_clone`, `preview_clone`, `delete_clone` | House voices and voice clones. |
|
|
191
|
+
| `accounts` | `list`, `connect`, `disconnect`, `get_persona_publishing`, `set_persona_publishing`, `list_boards` | Social accounts and the accounts each persona publishes to. |
|
|
192
|
+
| `schedules` | `list`, `cancel`, `get_slot`, `update_slot_title`, `delete_slot` | Future slots. |
|
|
193
|
+
| `posts` | `list`, `get` | Published and scheduled posts. |
|
|
194
|
+
| `insights` | `post_metrics`, `retention_curve` | How posts performed. |
|
|
195
|
+
| `experiments` | `create`, `list`, `add_pair`, `results` | Paired A/B hook experiments. |
|
|
196
|
+
| `media` | `upload`, `check` | Images for video segments. |
|
|
197
|
+
| `billing` | `balance`, `transactions` | Prepaid tokens. |
|
|
198
|
+
| `prompts` | `list`, `get` | The recipe prompts. |
|
|
199
|
+
| `check_script` | `validate`, `score` | Check a script before spending tokens. |
|
|
200
|
+
| `publish_video` | `from_file`, `create_upload`, `complete_upload`, `publish_upload` | Publish a ready-made video directly. |
|
|
201
|
+
|
|
202
|
+
Actions that read a file from the disk (`persona_media` `add_image`, `media` `upload`, `publish_video` `from_file`, and a local `audioPath`/`avatarPath`) exist only on the stdio server: a path served over HTTP would resolve on the server's host. Over HTTP use public URLs, or the signed upload of `publish_video`.
|
|
203
|
+
|
|
204
|
+
### Names instead of ids
|
|
205
|
+
|
|
206
|
+
`persona` and `accounts` accept a display name or an id. An id wins; otherwise the name must match **exactly** (case-insensitive, trimmed; never a prefix). No match is an error that says how to list the candidates. Several matches is **not** an error and not a guess: the result lists the candidates and says nothing was done, so you call again with the id. In `generate_video` every reference of every video is resolved before the first video is created, and `accounts` omitted means the persona's bound publishing accounts.
|
|
207
|
+
|
|
208
|
+
```json
|
|
209
|
+
{ "videos": [ { "persona": "Maria", "accounts": ["Maria Cooks"], "title": "...", "description": "...", "segments": [ ... ], "mode": "asap", "options": { "videoType": "full_lipsync" } } ] }
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
`mode: "scheduled"` (the default) slots a video 3h-30d ahead (`startAt` and `times`); `mode: "asap"` publishes it when generation finishes.
|
|
213
|
+
|
|
214
|
+
Batch (2-12 videos) needs a `batchKey` and rejects `idempotencyKey`; one video takes an `idempotencyKey` and rejects `batchKey`. A batch is created video by video: if one fails, the earlier videos stay created; call again with the same `batchKey` and the same videos and the created ones replay without a new charge.
|
|
215
|
+
|
|
216
|
+
### Measuring the size of `tools/list`
|
|
217
|
+
|
|
218
|
+
See "Measuring the `tools/list` payload" above. The 16 tools weigh about 59 KB on the stdio server (the 56 tools they replace weighed about 102 KB).
|
|
219
|
+
|
|
220
|
+
### Breaking change: the 56 old tool names are gone
|
|
221
|
+
|
|
222
|
+
There is no alias for the old names. Saved prompts, recipes and agent configuration that call them must be updated:
|
|
223
|
+
|
|
224
|
+
| Old tool | Now |
|
|
225
|
+
|---|---|
|
|
226
|
+
| `generate_persona_video`, `generate_persona_video_batch` | `generate_video` (`videos` has 1-12 entries) |
|
|
227
|
+
| `get_video_status`, `get_video_task_progress`, `wait_for_video_tasks` | `video_tasks` `status` (`taskIds`, `waitSeconds`) |
|
|
228
|
+
| `list_video_generations`, `get_video_generation` | `video_tasks` `list_generations`, `get_generation` |
|
|
229
|
+
| `cancel_video_task` | `cancel_video` |
|
|
230
|
+
| `list_personas`, `create_persona`, `update_persona` | `personas` `list`, `create`, `update` |
|
|
231
|
+
| `get_persona_delete_preview`, `delete_persona` | `personas` `delete` (no token = preview, then the token deletes) |
|
|
232
|
+
| `list_faces`, `list_persona_images`, `add_persona_image`, `update_persona_image`, `remove_persona_image` | `persona_media` `list_faces`, `list_images`, `add_image`, `update_image`, `remove_image` |
|
|
233
|
+
| `list_voices`, `preview_house_voice` | `voices` `list`, `preview` |
|
|
234
|
+
| `list_cloned_voices`, `create_cloned_voice`, `get_cloned_voice`, `preview_cloned_voice`, `delete_cloned_voice` | `voices` `list_clones`, `create_clone`, `get_clone`, `preview_clone`, `delete_clone` |
|
|
235
|
+
| `list_social_accounts`, `connect_account`, `disconnect_account` | `accounts` `list`, `connect`, `disconnect` |
|
|
236
|
+
| `get_persona_publishing_accounts`, `set_persona_publishing_accounts`, `list_pinterest_boards` | `accounts` `get_persona_publishing`, `set_persona_publishing`, `list_boards` |
|
|
237
|
+
| `list_schedules`, `cancel_schedule`, `get_slot`, `update_slot_title`, `delete_slot` | `schedules` `list`, `cancel`, `get_slot`, `update_slot_title`, `delete_slot` |
|
|
238
|
+
| `list_posts`, `get_post` | `posts` `list`, `get` |
|
|
239
|
+
| `get_post_metrics`, `get_youtube_retention_curve` | `insights` `post_metrics`, `retention_curve` |
|
|
240
|
+
| `create_experiment`, `list_experiments`, `add_experiment_pair`, `get_experiment_results` | `experiments` `create`, `list`, `add_pair`, `results` |
|
|
241
|
+
| `upload_media`, `check_media` | `media` `upload`, `check` |
|
|
242
|
+
| `get_token_balance`, `list_token_transactions` | `billing` `balance`, `transactions` |
|
|
243
|
+
| `list_prompts`, `get_prompt` | `prompts` `list`, `get` |
|
|
244
|
+
| `validate_script`, `score_draft` | `check_script` `validate`, `score` |
|
|
245
|
+
| `publish_video_direct`, `create_video_upload`, `complete_video_upload`, `publish_uploaded_video` | `publish_video` `from_file`, `create_upload`, `complete_upload`, `publish_upload` |
|
|
257
246
|
|
|
258
247
|
## Prompts (slash commands)
|
|
259
248
|
|
|
@@ -275,14 +264,14 @@ web reaches every install without a package update.
|
|
|
275
264
|
- `/full-setup`: Full setup becomes videos — connect accounts, create a persona, validate the script, and publish your first video without skipping a step.
|
|
276
265
|
|
|
277
266
|
An agent that arrives without a human typing a slash command can still self-serve
|
|
278
|
-
the same hub through MCP **tools**: `
|
|
279
|
-
(slug/title/description) and `
|
|
267
|
+
the same hub through MCP **tools**: `prompts (action: list)` lists the recipes
|
|
268
|
+
(slug/title/description) and `prompts (action: get)` returns one recipe's full text by
|
|
280
269
|
`slug`. The server's initialize instructions point agents there for
|
|
281
270
|
topic-shaped requests. Until the agent lists or fetches a recipe, the results
|
|
282
|
-
of `
|
|
283
|
-
`
|
|
284
|
-
`
|
|
285
|
-
`
|
|
271
|
+
of `personas (action: create)`, `personas (action: list)`, `accounts (action: list)`, and
|
|
272
|
+
`billing (action: balance)` end with a short next-step block pointing at
|
|
273
|
+
`prompts (action: list)`, and a script rejected by `check_script (action: validate)` or
|
|
274
|
+
`generate_video` gets a hint that recipes produce scripts that pass.
|
|
286
275
|
|
|
287
276
|
To add a prompt, add its text to `shared/prompt-base/prompt-base.ts` and its
|
|
288
277
|
entry to the web hub (`apps/web/app/recipes/prompts.ts` + its i18n title and
|
package/dist/account-shapes.js
CHANGED
|
@@ -9,7 +9,7 @@ export const DisconnectAccountShape = {
|
|
|
9
9
|
providerAccountId: z
|
|
10
10
|
.string()
|
|
11
11
|
.min(1, 'providerAccountId is required')
|
|
12
|
-
.describe('The account ID on that provider (the channelId / igUserId / providerAccountId / did field from
|
|
12
|
+
.describe('The account ID on that provider (the channelId / igUserId / providerAccountId / did field from accounts (action: list)).'),
|
|
13
13
|
};
|
|
14
14
|
export const DisconnectAccountSchema = z.object(DisconnectAccountShape);
|
|
15
15
|
//---------------
|
|
@@ -27,5 +27,5 @@ export const createPersonaAccountsField = z
|
|
|
27
27
|
message: 'Select at least one publishing account for this persona.',
|
|
28
28
|
})
|
|
29
29
|
.describe('Publishing accounts this persona is bound to, per provider, e.g. { youtube: ["UC..."], bluesky: ["did:plc:..."], \'3speak\': ["alice"] }. ' +
|
|
30
|
-
'At least one account is required. Account IDs come from
|
|
30
|
+
'At least one account is required. Account IDs come from accounts (action: list) (channelId / igUserId / providerAccountId / did).');
|
|
31
31
|
//# sourceMappingURL=account-shapes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account-shapes.js","sourceRoot":"","sources":["../src/account-shapes.ts"],"names":[],"mappings":"AAAA,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,MAAM,0BAA0B,GAAG,CAAC;KACxC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;KAC9C,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE;IAC3E,OAAO,EAAE,0DAA0D;CACpE,CAAC;KACD,QAAQ,CACP,4IAA4I;IAC1I,mIAAmI,CACtI,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { McpToolResponse } from './tools-call.js';
|
|
3
|
+
export type ActionShape = Record<string, z.ZodType>;
|
|
4
|
+
export type ActionSpecs = Record<string, ActionShape>;
|
|
5
|
+
type ActionArgs<TShape extends ActionShape> = z.infer<z.ZodObject<TShape>>;
|
|
6
|
+
export type ActionHandlers<TSpecs extends ActionSpecs> = {
|
|
7
|
+
[TAction in keyof TSpecs]: (args: ActionArgs<TSpecs[TAction]>) => Promise<McpToolResponse>;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Server-specific differences of one tool: `unavailable` actions are not
|
|
11
|
+
* offered (a local-file action on the remote server) and `variants` replace
|
|
12
|
+
* the field set of an action (an audioUrl-only create on the remote server).
|
|
13
|
+
* The handlers literal of byAction still names every action, so the parity
|
|
14
|
+
* gate sees the endpoint each one reaches.
|
|
15
|
+
*/
|
|
16
|
+
export interface ActionOptions<TSpecs extends ActionSpecs> {
|
|
17
|
+
unavailable?: readonly (keyof TSpecs)[];
|
|
18
|
+
variants?: Partial<Record<keyof TSpecs, ActionShape>>;
|
|
19
|
+
}
|
|
20
|
+
/** The specs this server offers: without the unavailable actions, with the variant shapes. */
|
|
21
|
+
export declare function offeredSpecs<TSpecs extends ActionSpecs>(specs: TSpecs, options?: ActionOptions<TSpecs>): ActionSpecs;
|
|
22
|
+
/** The flat advertised shape: `action` plus every field of every action, optional (first definition wins). */
|
|
23
|
+
export declare function actionShape(specs: ActionSpecs): ActionShape;
|
|
24
|
+
/** `base` plus one line naming the required fields of each action. */
|
|
25
|
+
export declare function actionDescription(base: string, specs: ActionSpecs): string;
|
|
26
|
+
/**
|
|
27
|
+
* The MCP callback of an action tool. Each call runs inside a tracked tool
|
|
28
|
+
* call naming the tool and the action; the arguments are validated against
|
|
29
|
+
* the strict schema of the chosen action before the handler runs.
|
|
30
|
+
*/
|
|
31
|
+
export declare function byAction<TSpecs extends ActionSpecs>(handlers: ActionHandlers<TSpecs>, allSpecs: TSpecs, tool: string, options?: ActionOptions<TSpecs>): (args: Record<string, unknown>) => Promise<McpToolResponse>;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { withToolCall } from './analytics.js';
|
|
3
|
+
const ACTION_FIELD = 'action';
|
|
4
|
+
/** The specs this server offers: without the unavailable actions, with the variant shapes. */
|
|
5
|
+
export function offeredSpecs(specs, options = {}) {
|
|
6
|
+
const unavailable = options.unavailable ?? [];
|
|
7
|
+
return Object.fromEntries(Object.entries(specs)
|
|
8
|
+
.filter(([action]) => !unavailable.includes(action))
|
|
9
|
+
.map(([action, shape]) => [action, options.variants?.[action] ?? shape]));
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The field as the flat shape advertises it: optional and WITHOUT its default.
|
|
13
|
+
* The SDK parses the arguments with the flat shape before byAction runs; a
|
|
14
|
+
* default there would fill the field of an action that does not have it and
|
|
15
|
+
* the strict per-action parse would reject it. The default still applies, from
|
|
16
|
+
* the field's own action schema.
|
|
17
|
+
*/
|
|
18
|
+
function advertised(schema) {
|
|
19
|
+
if (!(schema instanceof z.ZodDefault))
|
|
20
|
+
return schema.optional();
|
|
21
|
+
const optional = z.optional(schema.unwrap());
|
|
22
|
+
return schema.description === undefined ? optional : optional.describe(schema.description);
|
|
23
|
+
}
|
|
24
|
+
/** The flat advertised shape: `action` plus every field of every action, optional (first definition wins). */
|
|
25
|
+
export function actionShape(specs) {
|
|
26
|
+
const names = Object.keys(specs);
|
|
27
|
+
if (names.length === 0)
|
|
28
|
+
throw new Error('an action tool needs at least one action');
|
|
29
|
+
const shape = {
|
|
30
|
+
[ACTION_FIELD]: z.enum(names).describe(`What to do: ${names.join(' | ')}. The description lists the fields each action needs.`),
|
|
31
|
+
};
|
|
32
|
+
for (const spec of Object.values(specs)) {
|
|
33
|
+
for (const [field, schema] of Object.entries(spec)) {
|
|
34
|
+
if (field === ACTION_FIELD)
|
|
35
|
+
throw new Error('an action cannot declare a field named "action"');
|
|
36
|
+
if (!(field in shape))
|
|
37
|
+
shape[field] = advertised(schema);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return shape;
|
|
41
|
+
}
|
|
42
|
+
function requiredFields(spec) {
|
|
43
|
+
return Object.entries(spec)
|
|
44
|
+
.filter(([, schema]) => !schema.safeParse(undefined).success)
|
|
45
|
+
.map(([field]) => field);
|
|
46
|
+
}
|
|
47
|
+
/** `base` plus one line naming the required fields of each action. */
|
|
48
|
+
export function actionDescription(base, specs) {
|
|
49
|
+
const lines = Object.entries(specs).map(([action, spec]) => {
|
|
50
|
+
const required = requiredFields(spec);
|
|
51
|
+
return required.length === 0 ? `${action} (no required fields)` : `${action} (${required.join(', ')})`;
|
|
52
|
+
});
|
|
53
|
+
return `${base}\nActions and their required fields: ${lines.join('; ')}.`;
|
|
54
|
+
}
|
|
55
|
+
function errorResponse(message) {
|
|
56
|
+
return { content: [{ type: 'text', text: message }], isError: true };
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* The MCP callback of an action tool. Each call runs inside a tracked tool
|
|
60
|
+
* call naming the tool and the action; the arguments are validated against
|
|
61
|
+
* the strict schema of the chosen action before the handler runs.
|
|
62
|
+
*/
|
|
63
|
+
export function byAction(handlers, allSpecs, tool, options = {}) {
|
|
64
|
+
const unavailable = (options.unavailable ?? []).map(String);
|
|
65
|
+
const specs = offeredSpecs(allSpecs, options);
|
|
66
|
+
const declared = Object.keys(specs);
|
|
67
|
+
const implemented = Object.keys(handlers);
|
|
68
|
+
const missing = declared.filter((action) => !implemented.includes(action));
|
|
69
|
+
const extra = implemented.filter((action) => !declared.includes(action) && !unavailable.includes(action));
|
|
70
|
+
if (missing.length > 0 || extra.length > 0) {
|
|
71
|
+
throw new Error(`${tool}: handlers and specs differ (missing handlers: ${missing.join(', ') || 'none'}; handlers without a spec: ${extra.join(', ') || 'none'})`);
|
|
72
|
+
}
|
|
73
|
+
const schemas = new Map(declared.map((action) => [action, z.object(specs[action]).strict()]));
|
|
74
|
+
const handlerOf = new Map(declared.map((action) => [action, handlers[action]]));
|
|
75
|
+
return async (args) => {
|
|
76
|
+
const { [ACTION_FIELD]: action, ...fields } = args;
|
|
77
|
+
const schema = typeof action === 'string' ? schemas.get(action) : undefined;
|
|
78
|
+
const handler = typeof action === 'string' ? handlerOf.get(action) : undefined;
|
|
79
|
+
if (typeof action !== 'string' || schema === undefined || handler === undefined) {
|
|
80
|
+
return errorResponse(`Error in ${tool}: unknown action ${JSON.stringify(action)}. Use one of: ${declared.join(', ')}.`);
|
|
81
|
+
}
|
|
82
|
+
const parsed = schema.safeParse(fields);
|
|
83
|
+
if (!parsed.success) {
|
|
84
|
+
const problems = parsed.error.issues.map((issue) => `${issue.path.join('.') || '(input)'}: ${issue.message}`).join('; ');
|
|
85
|
+
return errorResponse(`Error in ${tool} · ${action}: ${problems}`);
|
|
86
|
+
}
|
|
87
|
+
return withToolCall(tool, action, () => handler(parsed.data));
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=action-tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-tool.js","sourceRoot":"","sources":["../src/action-tool.ts"],"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AAM,GAAG,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACxC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACpB,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,SAAS,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACzH,OAAO,aAAa,CAAC,YAAY,IAAI,MAAM,MAAM,KAAK,QAAQ,EAAE,CAAC,CAAC;QACpE,CAAC;QACD,OAAO,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,IAAa,CAAC,CAAC,CAAC;IACzE,CAAC,CAAC;AACJ,CAAC"}
|
package/dist/analytics.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export declare const MCP_TOOL_HEADER = "X-MCP-Tool";
|
|
2
2
|
export declare const MCP_CALL_ID_HEADER = "X-MCP-Call-Id";
|
|
3
|
+
export declare const MCP_ACTION_HEADER = "X-MCP-Action";
|
|
3
4
|
export declare const MCP_VERSION_HEADER = "X-MCP-Version";
|
|
4
5
|
export declare function withTelemetryHeaders<TResult>(headers: () => Record<string, string>, run: () => Promise<TResult>): Promise<TResult>;
|
|
5
6
|
export declare function mcpTelemetryHeaders(options?: {
|
|
6
7
|
includeVersion?: boolean;
|
|
7
8
|
}): Record<string, string>;
|
|
9
|
+
export declare function withToolCall<TResult>(toolName: string, action: string, run: () => Promise<TResult>): Promise<TResult>;
|
|
8
10
|
export declare function withTracking<TArgs extends Record<string, unknown>, TResult>(toolName: string, handler: (args: TArgs) => Promise<TResult>): (args: TArgs) => Promise<TResult>;
|
package/dist/analytics.js
CHANGED
|
@@ -18,6 +18,7 @@ import { randomUUID } from 'node:crypto';
|
|
|
18
18
|
const { default: pkg } = await import('../package.json', { with: { type: 'json' } });
|
|
19
19
|
export const MCP_TOOL_HEADER = 'X-MCP-Tool';
|
|
20
20
|
export const MCP_CALL_ID_HEADER = 'X-MCP-Call-Id';
|
|
21
|
+
export const MCP_ACTION_HEADER = 'X-MCP-Action';
|
|
21
22
|
export const MCP_VERSION_HEADER = 'X-MCP-Version';
|
|
22
23
|
const toolCallContext = new AsyncLocalStorage();
|
|
23
24
|
//---------------
|
|
@@ -49,10 +50,19 @@ export function mcpTelemetryHeaders(options) {
|
|
|
49
50
|
if (context !== undefined) {
|
|
50
51
|
headers[MCP_TOOL_HEADER] = context.toolName;
|
|
51
52
|
headers[MCP_CALL_ID_HEADER] = context.callId;
|
|
53
|
+
if (context.action !== undefined)
|
|
54
|
+
headers[MCP_ACTION_HEADER] = context.action;
|
|
52
55
|
}
|
|
53
56
|
return headers;
|
|
54
57
|
}
|
|
55
58
|
//---------------
|
|
59
|
+
// Run one action of an action tool: every API request it sends is tagged
|
|
60
|
+
// with the tool name, the action and a fresh call id.
|
|
61
|
+
//---------------
|
|
62
|
+
export function withToolCall(toolName, action, run) {
|
|
63
|
+
return toolCallContext.run({ toolName, action, callId: randomUUID() }, run);
|
|
64
|
+
}
|
|
65
|
+
//---------------
|
|
56
66
|
// Wrap a tool (or prompt) handler so every API request it sends is tagged
|
|
57
67
|
// with its name and a fresh call id.
|
|
58
68
|
//---------------
|
package/dist/analytics.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analytics.js","sourceRoot":"","sources":["../src/analytics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,iBAAiB;AACjB,oDAAoD;AACpD,EAAE;AACF,2EAA2E;AAC3E,2EAA2E;AAC3E,2EAA2E;AAC3E,sEAAsE;AACtE,yEAAyE;AACzE,EAA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AAG,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,EAAE,GAAG,CAAC,CAAC;AAC9E,CAAC;AAED,iBAAiB;AACjB,0EAA0E;AAC1E,qCAAqC;AACrC,iBAAiB;AACjB,MAAM,UAAU,YAAY,CAAiD,QAAgB,EAAE,OAA0C;IACvI,OAAO,KAAK,EAAE,IAAW,EAAoB,EAAE,CAC7C,eAAe,CAAC,GAAG,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;AACjF,CAAC"}
|
package/dist/client-types.d.ts
CHANGED
|
@@ -80,7 +80,7 @@ export interface GeneratePersonaVideoInput {
|
|
|
80
80
|
threadsAccountIds?: string[];
|
|
81
81
|
facebookAccountIds?: string[];
|
|
82
82
|
pinterestAccountIds?: string[];
|
|
83
|
-
/** Pinterest only: the board the pin goes to (the id from
|
|
83
|
+
/** Pinterest only: the board the pin goes to (the id from accounts (action: list_boards)). Required when pinterest is selected. */
|
|
84
84
|
pinterestBoardId?: string;
|
|
85
85
|
fanvueAccountIds?: string[];
|
|
86
86
|
threespeakAccountIds?: string[];
|
|
@@ -160,7 +160,7 @@ export interface PublishVideoDirectInput {
|
|
|
160
160
|
privacyStatus?: 'public' | 'private' | 'unlisted';
|
|
161
161
|
/** Instagram/Bluesky/LinkedIn/Threads/Facebook/3Speak: required. Pinterest: pin description when description is omitted. */
|
|
162
162
|
caption?: string;
|
|
163
|
-
/** Pinterest only: required. The board the pin goes to (the id from
|
|
163
|
+
/** Pinterest only: required. The board the pin goes to (the id from accounts (action: list_boards)). */
|
|
164
164
|
boardId?: string;
|
|
165
165
|
/**
|
|
166
166
|
* Omitted: a UUID is generated per call. Reuse the same key when retrying
|
|
@@ -188,7 +188,7 @@ export interface PublishUploadedVideoInput {
|
|
|
188
188
|
privacyStatus?: 'public' | 'private' | 'unlisted';
|
|
189
189
|
/** Instagram/Bluesky/LinkedIn/Threads/Facebook/3Speak: required. Pinterest: pin description when description is omitted. */
|
|
190
190
|
caption?: string;
|
|
191
|
-
/** Pinterest only: required. The board the pin goes to (the id from
|
|
191
|
+
/** Pinterest only: required. The board the pin goes to (the id from accounts (action: list_boards)). */
|
|
192
192
|
boardId?: string;
|
|
193
193
|
}
|
|
194
194
|
/** A minted signed video upload: PUT the bytes to signedUrl, then complete. */
|
package/dist/client.js
CHANGED
|
@@ -489,7 +489,7 @@ export class PostEngineerClient {
|
|
|
489
489
|
if (description)
|
|
490
490
|
formData.set('description', description);
|
|
491
491
|
// isPrimary is typed as `true` only (swap-only, symmetric with
|
|
492
|
-
//
|
|
492
|
+
// persona_media (action: update_image)): an explicit false is rejected at schema parse
|
|
493
493
|
// time and can never reach this branch.
|
|
494
494
|
if (image.isPrimary)
|
|
495
495
|
formData.set('isPrimary', 'true');
|