post-engineer-mcp 1.52.585 → 1.52.594
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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-client.d.ts +11 -2
- package/dist/cloned-voice-client.js +121 -3
- package/dist/cloned-voice-client.js.map +1 -1
- package/dist/cloned-voice-tools.d.ts +3 -4
- package/dist/cloned-voice-tools.js +6 -35
- 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/public-ip.d.ts +1 -0
- package/dist/public-ip.js +128 -0
- package/dist/public-ip.js.map +1 -0
- 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 +6 -6
- 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
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { createExperiment, getExperimentResults, listExperiments } from './client-experiments.js';
|
|
3
3
|
import { EXPERIMENT_NAME_MAX_LENGTH, EXPERIMENT_TARGET_PAIRS_MAX, EXPERIMENT_TARGET_PAIRS_MIN, EXPERIMENT_VARIANT_DESCRIPTION_MAX_LENGTH, EXPERIMENT_VARIANT_ID_PATTERN, EXPERIMENT_VARIANT_NAME_MAX_LENGTH, METRICS_WINDOWS, } from './limits.js';
|
|
4
|
-
import {
|
|
4
|
+
import { GenerateVideoItemSchema, prepareVideo } from './generate-video.js';
|
|
5
|
+
import { createRefResolvers } from './refs.js';
|
|
6
|
+
import { ScriptSegmentShape } from './single-video-shape.js';
|
|
5
7
|
import { generatePersonaVideoOutcome } from './tools-single-video.js';
|
|
6
8
|
import { handleLibraryCall } from './tools-call.js';
|
|
7
9
|
//---------------
|
|
8
|
-
// Paired A/B content experiments (issue #476):
|
|
9
|
-
//
|
|
10
|
+
// Paired A/B content experiments (issue #476): experiments (action: create),
|
|
11
|
+
// experiments (action: list), experiments (action: add_pair) and experiments (action: results).
|
|
10
12
|
//
|
|
11
13
|
// An experiment tests ONE variable (the hook) with two variants. It is a
|
|
12
14
|
// set of pairs: inside a pair both videos share topic and content and only
|
|
13
|
-
// the hook differs; across pairs the topic changes.
|
|
15
|
+
// the hook differs; across pairs the topic changes. experiments (action: add_pair)
|
|
14
16
|
// creates both videos of one pair through generate-and-schedule (two normal
|
|
15
17
|
// charged videos) and the server rejects a pair that differs in anything
|
|
16
18
|
// but the hook, before charging.
|
|
@@ -54,13 +56,15 @@ export const CreateExperimentShape = {
|
|
|
54
56
|
export const CreateExperimentSchema = z.object(CreateExperimentShape);
|
|
55
57
|
export const ListExperimentsShape = {};
|
|
56
58
|
export const GetExperimentResultsShape = {
|
|
57
|
-
experimentId: z.string().uuid().describe('Experiment id from
|
|
59
|
+
experimentId: z.string().uuid().describe('Experiment id from experiments (action: create) / experiments (action: list).'),
|
|
58
60
|
window: z.enum(METRICS_WINDOWS).optional().describe('Metrics window to compare: 24h, 7d (default) or 28d.'),
|
|
59
61
|
};
|
|
60
62
|
export const GetExperimentResultsSchema = z.object(GetExperimentResultsShape);
|
|
61
|
-
|
|
63
|
+
// Both videos of a pair share everything but the hook: the delivery fields are
|
|
64
|
+
// the ones of a generate_video video (persona and accounts by name or id).
|
|
65
|
+
const { segments: _segments, title: _title, experiment: _experiment, ...deliveryShape } = GenerateVideoItemSchema.shape;
|
|
62
66
|
export const AddExperimentPairShape = {
|
|
63
|
-
experimentId: z.string().uuid().describe('Experiment id from
|
|
67
|
+
experimentId: z.string().uuid().describe('Experiment id from experiments (action: create).'),
|
|
64
68
|
pair: z.number().int().min(1).max(EXPERIMENT_TARGET_PAIRS_MAX).describe('Pair number: 1 for the first pair, then 2, 3... up to targetPairs.'),
|
|
65
69
|
title: z.string().min(1).describe('Slot label for both videos (the pair topic).'),
|
|
66
70
|
segments: z
|
|
@@ -98,7 +102,7 @@ export async function handleCreateExperiment(client, args) {
|
|
|
98
102
|
personaId: args.personaId ?? null,
|
|
99
103
|
targetPairs: args.targetPairs,
|
|
100
104
|
variants: args.variants,
|
|
101
|
-
}), 'creating experiment', 'Experiment created. Next:
|
|
105
|
+
}), 'creating experiment', 'Experiment created. Next: experiments (action: add_pair) for pair 1, 2, ... (each pair = 2 charged videos)');
|
|
102
106
|
}
|
|
103
107
|
export async function handleListExperiments(client) {
|
|
104
108
|
return handleLibraryCall(() => listExperiments(client), 'listing experiments');
|
|
@@ -117,7 +121,16 @@ function textOf(response) {
|
|
|
117
121
|
return response.content.map((part) => (part.type === 'text' ? part.text : '')).join('\n');
|
|
118
122
|
}
|
|
119
123
|
export async function handleAddExperimentPair(client, args) {
|
|
120
|
-
const { experimentId, pair, title, segments, hooks, spacingHours, ...
|
|
124
|
+
const { experimentId, pair, title, segments, hooks, spacingHours, ...deliveryRefs } = args;
|
|
125
|
+
// Resolve the persona and accounts once, before the first video exists.
|
|
126
|
+
const resolved = await prepareVideo(client, createRefResolvers(client), {
|
|
127
|
+
...deliveryRefs,
|
|
128
|
+
title,
|
|
129
|
+
segments: [{ kind: 'hook', text: hooks[0].text }],
|
|
130
|
+
});
|
|
131
|
+
if (resolved.kind === 'response')
|
|
132
|
+
return resolved.response;
|
|
133
|
+
const { segments: _placeholder, title: _slotTitle, idempotencyKey: _unused, experiment: _link, recipe: _recipe, ...delivery } = resolved.prepared.video;
|
|
121
134
|
// Alternate which variant goes first (A,B / B,A) so publish order never
|
|
122
135
|
// favours one variant.
|
|
123
136
|
const ordered = pair % 2 === 1 ? hooks : [hooks[1], hooks[0]];
|
|
@@ -137,14 +150,14 @@ export async function handleAddExperimentPair(client, args) {
|
|
|
137
150
|
experiment: { experimentId, variantId: hook.variantId, pair },
|
|
138
151
|
});
|
|
139
152
|
if (response.isError === true) {
|
|
140
|
-
const done = index === 1 ? ` The ${ordered[0].variantId} video of pair ${pair} was created; call
|
|
153
|
+
const done = index === 1 ? ` The ${ordered[0].variantId} video of pair ${pair} was created; call experiments (action: add_pair) again with the same arguments after fixing the error — it replays that video and only creates the missing one.` : '';
|
|
141
154
|
return { content: [{ type: 'text', text: `Pair ${pair}, variant ${hook.variantId}: ${textOf(response)}${done}` }], isError: true };
|
|
142
155
|
}
|
|
143
156
|
if (failedSlotIds.length > 0) {
|
|
144
157
|
// A 2xx can carry a failed slot: a dispatch failure (502) leaves the
|
|
145
158
|
// failed slot behind and a retry on the same key replays it. The slot
|
|
146
|
-
// is its schedule's only slot, so delete_slot answers 409 (last slot)
|
|
147
|
-
// and
|
|
159
|
+
// is its schedule's only slot, so schedules (action: delete_slot) answers 409 (last slot)
|
|
160
|
+
// and schedules (action: cancel) leaves a failed row alone, which keeps the
|
|
148
161
|
// (experiment, pair, variant) unique key taken: this pair number
|
|
149
162
|
// cannot be redone, so the recovery is a new pair number.
|
|
150
163
|
const done = index === 1 ? ` The ${ordered[0].variantId} video of pair ${pair} was created and stays; it is left without a partner and does not count toward the result.` : '';
|
|
@@ -152,7 +165,7 @@ export async function handleAddExperimentPair(client, args) {
|
|
|
152
165
|
content: [
|
|
153
166
|
{
|
|
154
167
|
type: 'text',
|
|
155
|
-
text: `Pair ${pair}, variant ${hook.variantId}: the video failed (slot ${failedSlotIds.join(', ')}, its tokens are refunded), so this pair was NOT created. The failed slot cannot be removed (delete_slot refuses a schedule's last slot and
|
|
168
|
+
text: `Pair ${pair}, variant ${hook.variantId}: the video failed (slot ${failedSlotIds.join(', ')}, its tokens are refunded), so this pair was NOT created. The failed slot cannot be removed (schedules (action: delete_slot) refuses a schedule's last slot and schedules (action: cancel) leaves failed slots in place) and it keeps pair ${pair} taken, so calling experiments (action: add_pair) again with pair ${pair} only replays the failed video. Call experiments (action: add_pair) with the next free pair number instead (up to the experiment's targetPairs).${done}`,
|
|
156
169
|
},
|
|
157
170
|
],
|
|
158
171
|
isError: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools-experiments.js","sourceRoot":"","sources":["../src/tools-experiments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAClG,OAAO,EACL,0BAA0B,EAC1B,2BAA2B,EAC3B,2BAA2B,EAC3B,yCAAyC,EACzC,6BAA6B,EAC7B,kCAAkC,EAClC,eAAe,GAChB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"tools-experiments.js","sourceRoot":"","sources":["../src/tools-experiments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAClG,OAAO,EACL,0BAA0B,EAC1B,2BAA2B,EAC3B,2BAA2B,EAC3B,yCAAyC,EACzC,6BAA6B,EAC7B,kCAAkC,EAClC,eAAe,GAChB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,uBAAuB,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAwB,MAAM,iBAAiB,CAAC;AAE1E,iBAAiB;AACjB,6EAA6E;AAC7E,gGAAgG;AAChG,EAAE;AACF,yEAAyE;AACzE,2EAA2E;AA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z.ZodString;
|
|
9
9
|
}, z.core.$strip>;
|
|
10
|
-
export declare const ListPinterestBoardsDescription = "List the boards of a connected Pinterest account (id + name). Use the id as pinterestBoardId on generate_persona_video when pinterest is selected, or as boardId on publish_video_direct for pinterest.";
|
|
11
10
|
export declare function handleListPinterestBoards(client: PostEngineerClient, args: z.infer<typeof ListPinterestBoardsSchema>): Promise<McpToolResponse>;
|
package/dist/tools-pinterest.js
CHANGED
|
@@ -2,10 +2,10 @@ import { z } from 'zod';
|
|
|
2
2
|
import { ApiError, getErrorMessage } from './errors.js';
|
|
3
3
|
import { sanitizeEngineError } from './tools.js';
|
|
4
4
|
//---------------
|
|
5
|
-
//
|
|
5
|
+
// accounts (action: list_boards) — the board picker for Pinterest publishing.
|
|
6
6
|
//
|
|
7
|
-
// Pinterest pins cannot exist without a board, so
|
|
8
|
-
// and
|
|
7
|
+
// Pinterest pins cannot exist without a board, so generate_video
|
|
8
|
+
// and publish_video (action: from_file) take the board id separately from the account
|
|
9
9
|
// ids. The web route lists the boards of one connected Pinterest account
|
|
10
10
|
// (the account id is the v5 user_account id stored at OAuth time); an
|
|
11
11
|
// expired access token is refreshed server-side before listing.
|
|
@@ -14,10 +14,9 @@ export const ListPinterestBoardsShape = {
|
|
|
14
14
|
accountId: z
|
|
15
15
|
.string()
|
|
16
16
|
.min(1, 'accountId is required')
|
|
17
|
-
.describe('The Pinterest account ID (the providerAccountId field from
|
|
17
|
+
.describe('The Pinterest account ID (the providerAccountId field from accounts (action: list)).'),
|
|
18
18
|
};
|
|
19
19
|
export const ListPinterestBoardsSchema = z.object(ListPinterestBoardsShape);
|
|
20
|
-
export const ListPinterestBoardsDescription = 'List the boards of a connected Pinterest account (id + name). Use the id as pinterestBoardId on generate_persona_video when pinterest is selected, or as boardId on publish_video_direct for pinterest.';
|
|
21
20
|
function narrowBoards(value) {
|
|
22
21
|
if (typeof value !== 'object' || value === null || !Array.isArray(value.boards)) {
|
|
23
22
|
throw new Error('Malformed boards response from the API.');
|
|
@@ -34,7 +33,7 @@ function narrowBoards(value) {
|
|
|
34
33
|
}
|
|
35
34
|
export async function handleListPinterestBoards(client, args) {
|
|
36
35
|
try {
|
|
37
|
-
const result = await client.request(`/api/pinterest/boards?accountId=${encodeURIComponent(args.accountId)}`, { method: 'GET', headers: client.getHeaders() }, '
|
|
36
|
+
const result = await client.request(`/api/pinterest/boards?accountId=${encodeURIComponent(args.accountId)}`, { method: 'GET', headers: client.getHeaders() }, 'list Pinterest boards');
|
|
38
37
|
const boards = narrowBoards(result);
|
|
39
38
|
return {
|
|
40
39
|
content: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools-pinterest.js","sourceRoot":"","sources":["../src/tools-pinterest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAGjD,iBAAiB;AACjB,
|
|
1
|
+
{"version":3,"file":"tools-pinterest.js","sourceRoot":"","sources":["../src/tools-pinterest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAGjD,iBAAiB;AACjB,8EAA8E;AAC9E,EAAE;AACF,iEAAiE;AACjE,sFAAsF;AACtF,yEAAyE;AACzE,sEAAsE;AACtE,gEAAgE;AAChE,iBAAiB;AAEjB,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,EAAE,uBAAuB,CAAC;SAC/B,QAAQ,CAAC,sFAAsF,CAAC;CACpG,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAG,CA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K,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,QAAQ,IAAI,KAAK,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;YACrD,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,mCAAmC,IAAI,CAAC,SAAS,CAAC;4BACtD,IAAI,EAAE,KAAK,CAAC,IAAI;4BAChB,OAAO,EAAE,mBAAmB,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;4BACpD,KAAK,EAAE,KAAK,CAAC,KAAK;yBACnB,CAAC,EAAE;qBACL;iBACF;gBACD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;QACD,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,mCAAmC,eAAe,CAAC,KAAK,CAAC,EAAE;iBAClE;aACF;YACD,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC"}
|
package/dist/tools-posts.js
CHANGED
|
@@ -4,7 +4,7 @@ import { ListPostsSchema } from './schedule-shapes.js';
|
|
|
4
4
|
import { METRICS_FILTER_MAX_LENGTH, METRICS_NONE, METRICS_PROVIDERS, METRICS_WINDOWS, YOUTUBE_VIDEO_ID, } from './limits.js';
|
|
5
5
|
import { handleLibraryCall } from './tools-call.js';
|
|
6
6
|
//---------------
|
|
7
|
-
//
|
|
7
|
+
// posts (action: get), insights (action: post_metrics) and insights (action: retention_curve) — MCP tools.
|
|
8
8
|
//
|
|
9
9
|
// Extracted from tools.ts so the tools module stays under the file-size
|
|
10
10
|
// ratchet.
|
|
@@ -14,7 +14,7 @@ export const GetPostShape = {
|
|
|
14
14
|
id: z
|
|
15
15
|
.string()
|
|
16
16
|
.min(1, 'id is required')
|
|
17
|
-
.describe('A post id of either kind: a slot id (slotId from
|
|
17
|
+
.describe('A post id of either kind: a slot id (slotId from posts (action: list) / generate_video) or a generation id (generationId from video_tasks (action: list_generations)). The server resolves which one it is.'),
|
|
18
18
|
};
|
|
19
19
|
export const GetPostSchema = z.object(GetPostShape);
|
|
20
20
|
const metricsFilter = z.string().min(1).max(METRICS_FILTER_MAX_LENGTH);
|
|
@@ -27,10 +27,10 @@ export const GetPostMetricsShape = {
|
|
|
27
27
|
message: `persona must be a uuid or ${METRICS_NONE}`,
|
|
28
28
|
})
|
|
29
29
|
.optional()
|
|
30
|
-
.describe(`Optional persona id filter (uuid from
|
|
30
|
+
.describe(`Optional persona id filter (uuid from personas (action: list)), or ${METRICS_NONE} for posts with no persona.`),
|
|
31
31
|
account: metricsFilter
|
|
32
32
|
.optional()
|
|
33
|
-
.describe('Optional publishing account id filter (the account ids from
|
|
33
|
+
.describe('Optional publishing account id filter (the account ids from accounts (action: list)).'),
|
|
34
34
|
provider: z.enum(METRICS_PROVIDERS).optional().describe('Optional network filter.'),
|
|
35
35
|
angle: metricsFilter
|
|
36
36
|
.optional()
|
|
@@ -38,11 +38,11 @@ export const GetPostMetricsShape = {
|
|
|
38
38
|
};
|
|
39
39
|
export const GetPostMetricsSchema = z.object(GetPostMetricsShape);
|
|
40
40
|
export const GetYouTubeRetentionCurveShape = {
|
|
41
|
-
account: metricsFilter.describe('The YouTube account id (channel id) the video was published on: accountId from
|
|
41
|
+
account: metricsFilter.describe('The YouTube account id (channel id) the video was published on: accountId from insights (action: post_metrics) rows.'),
|
|
42
42
|
video: z
|
|
43
43
|
.string()
|
|
44
44
|
.regex(YOUTUBE_VIDEO_ID, 'video must be a YouTube video id')
|
|
45
|
-
.describe('The YouTube video id: externalId from a youtube
|
|
45
|
+
.describe('The YouTube video id: externalId from a youtube insights (action: post_metrics) row.'),
|
|
46
46
|
};
|
|
47
47
|
export const GetYouTubeRetentionCurveSchema = z.object(GetYouTubeRetentionCurveShape);
|
|
48
48
|
export async function handleGetPost(client, args) {
|
|
@@ -54,7 +54,7 @@ export async function handleGetPostMetrics(client, args) {
|
|
|
54
54
|
export async function handleGetYouTubeRetentionCurve(client, args) {
|
|
55
55
|
return handleLibraryCall(() => getYouTubeRetentionCurve(client, args), 'getting YouTube retention curve');
|
|
56
56
|
}
|
|
57
|
-
//
|
|
57
|
+
// posts (action: list) — the upcoming/recent lists, or (with from + to) every post in a
|
|
58
58
|
// window. The schema's from/to pairing is a .refine, which the SDK's shape
|
|
59
59
|
// validation does not run, so the args are re-parsed here.
|
|
60
60
|
export async function handleListPosts(client, args) {
|
package/dist/tools-posts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools-posts.js","sourceRoot":"","sources":["../src/tools-posts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACxG,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EACL,yBAAyB,EACzB,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,gBAAgB,GACjB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,iBAAiB,EAAwB,MAAM,iBAAiB,CAAC;AAE1E,iBAAiB;AACjB,
|
|
1
|
+
{"version":3,"file":"tools-posts.js","sourceRoot":"","sources":["../src/tools-posts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACxG,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EACL,yBAAyB,EACzB,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,gBAAgB,GACjB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,iBAAiB,EAAwB,MAAM,iBAAiB,CAAC;AAE1E,iBAAiB;AACjB,2GAA2G;AAC3G,EAAE;AACF,wEAAwE;AACxE,WAA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AAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,wBAAwB,OAAO,EAAE,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IACjG,CAAC;IACD,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC;IACxC,IAAI,IAAI,KAAK,SAAS,IAAI,EAAE,KAAK,SAAS,EAAE,CAAC;QAC3C,OAAO,iBAAiB,CAAC,GAAG,EAAE,CAAC,gBAAgB,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,eAAe,CAAC,CAAC;IAC1F,CAAC;IACD,OAAO,iBAAiB,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,eAAe,CAAC,CAAC;AAC3E,CAAC"}
|
package/dist/tools-prompts.d.ts
CHANGED
|
@@ -5,10 +5,10 @@ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
|
5
5
|
import { RecipeSession, type McpTransportKind } from './recipe-session.js';
|
|
6
6
|
export { withRecipeNudge, withScriptOutcome, type McpTransportKind } from './recipe-session.js';
|
|
7
7
|
export declare const SERVER_INSTRUCTIONS: string;
|
|
8
|
-
export declare const ListPromptsDescription = "List the available recipe prompts (slug, title, description). Call this BEFORE writing or generating a video script when the user's request describes a topic rather than a ready script \u2014 news of the day, a real place with its own photos, a concrete subject like a car or a product, GitHub pull requests, or first-time account setup. Then call
|
|
8
|
+
export declare const ListPromptsDescription = "List the available recipe prompts (slug, title, description). Call this BEFORE writing or generating a video script when the user's request describes a topic rather than a ready script \u2014 news of the day, a real place with its own photos, a concrete subject like a car or a product, GitHub pull requests, or first-time account setup. Then call prompts (action: get) with the matching slug to load the full validated workflow for that recipe.";
|
|
9
9
|
export declare const ListPromptsShape: {};
|
|
10
10
|
export declare function handleListPrompts(client: PostEngineerClient): Promise<McpToolResponse>;
|
|
11
|
-
export declare const GetPromptDescription = "Return the full recipe prompt for one slug from
|
|
11
|
+
export declare const GetPromptDescription = "Return the full recipe prompt for one slug from prompts (action: list). Load only the recipe the agent will follow, and pass its slug as recipe on generate_video. Each recipe carries the complete validated workflow: script structure and word limits, media verification via media (action: check) for photo URLs, pricing rules for the overlay badge, and the generation and publish steps. Unknown slugs fail with the list of valid slugs \u2014 call prompts (action: list) first when unsure.";
|
|
12
12
|
export declare const GetPromptShape: {
|
|
13
13
|
slug: z.ZodString;
|
|
14
14
|
};
|
package/dist/tools-prompts.js
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { UnknownPromptSlugError, getPrompt, listPrompts } from './client-prompts.js';
|
|
3
3
|
import { getErrorMessage } from './errors.js';
|
|
4
|
-
import {
|
|
4
|
+
import { actionDescription, actionShape, byAction } from './action-tool.js';
|
|
5
5
|
import { READ_ONLY } from './tool-annotations.js';
|
|
6
|
-
import { RecipeSession, recipeRunText } from './recipe-session.js';
|
|
7
|
-
// Re-exported so index.ts
|
|
6
|
+
import { RecipeSession, isRecipeSlug, recipeRunText } from './recipe-session.js';
|
|
7
|
+
// Re-exported so the intent modules and index.ts import the recipe wrappers from one place.
|
|
8
8
|
export { withRecipeNudge, withScriptOutcome } from './recipe-session.js';
|
|
9
9
|
//---------------
|
|
10
|
-
// Recipe self-serve tools:
|
|
10
|
+
// Recipe self-serve tools: prompts (action: list) and prompts (action: get).
|
|
11
11
|
//
|
|
12
12
|
// Slash commands are a user channel: an agent that arrives without a human
|
|
13
13
|
// typing /place-spotlight only sees the tool list and tool results, so it
|
|
14
14
|
// never learns the recipes exist. These two tools put the hub in that
|
|
15
|
-
// channel:
|
|
16
|
-
// descriptions, no prompt text — cheap in tokens), and
|
|
15
|
+
// channel: prompts (action: list) advertises what recipes exist (slugs + titles +
|
|
16
|
+
// descriptions, no prompt text — cheap in tokens), and prompts (action: get) fetches
|
|
17
17
|
// one recipe's full text by slug. Both read the web hub over the API
|
|
18
18
|
// (client-prompts.ts), the same source the slash commands use.
|
|
19
19
|
//---------------
|
|
20
20
|
//---------------
|
|
21
21
|
// Server instructions, advertised in the MCP initialize result. An agent
|
|
22
22
|
// that reads the initialize payload sees the nudge before its first call;
|
|
23
|
-
// tools see it only in their descriptions (see
|
|
23
|
+
// tools see it only in their descriptions (see generate_video).
|
|
24
24
|
//---------------
|
|
25
25
|
export const SERVER_INSTRUCTIONS = [
|
|
26
26
|
'post-engineer turns content into scheduled persona videos.',
|
|
27
27
|
'Every video is generated from a complete, validated script — never improvised — and generation always costs prepaid tokens.',
|
|
28
|
-
'When the user asks for a video about a topic — news of the day, a real place with photos, a concrete subject like a car or a product, GitHub pull requests, or first-time setup — call
|
|
28
|
+
'When the user asks for a video about a topic — news of the day, a real place with photos, a concrete subject like a car or a product, GitHub pull requests, or first-time setup — call prompts (action: list) first and follow the matching recipe via prompts (action: get) instead of assembling the script yourself.',
|
|
29
29
|
'The recipes pre-validate scripts, media and prices before any token is spent.',
|
|
30
30
|
].join(' ');
|
|
31
|
-
export const ListPromptsDescription = 'List the available recipe prompts (slug, title, description). Call this BEFORE writing or generating a video script when the user\'s request describes a topic rather than a ready script — news of the day, a real place with its own photos, a concrete subject like a car or a product, GitHub pull requests, or first-time account setup. Then call
|
|
31
|
+
export const ListPromptsDescription = 'List the available recipe prompts (slug, title, description). Call this BEFORE writing or generating a video script when the user\'s request describes a topic rather than a ready script — news of the day, a real place with its own photos, a concrete subject like a car or a product, GitHub pull requests, or first-time account setup. Then call prompts (action: get) with the matching slug to load the full validated workflow for that recipe.';
|
|
32
32
|
export const ListPromptsShape = {};
|
|
33
33
|
export async function handleListPrompts(client) {
|
|
34
34
|
try {
|
|
@@ -39,15 +39,15 @@ export async function handleListPrompts(client) {
|
|
|
39
39
|
return errorResponse('listing prompts', getErrorMessage(error));
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
export const GetPromptDescription = 'Return the full recipe prompt for one slug from
|
|
42
|
+
export const GetPromptDescription = 'Return the full recipe prompt for one slug from prompts (action: list). Load only the recipe the agent will follow, and pass its slug as recipe on generate_video. Each recipe carries the complete validated workflow: script structure and word limits, media verification via media (action: check) for photo URLs, pricing rules for the overlay badge, and the generation and publish steps. Unknown slugs fail with the list of valid slugs — call prompts (action: list) first when unsure.';
|
|
43
43
|
export const GetPromptShape = {
|
|
44
|
-
slug: z.string().min(1, 'slug is required').describe('Prompt slug from
|
|
44
|
+
slug: z.string().min(1, 'slug is required').describe('Prompt slug from prompts (action: list).'),
|
|
45
45
|
};
|
|
46
46
|
const GetPromptSchema = z.object(GetPromptShape);
|
|
47
47
|
export async function handleGetPrompt(client, args) {
|
|
48
48
|
const parsed = GetPromptSchema.safeParse(args);
|
|
49
49
|
if (!parsed.success) {
|
|
50
|
-
return errorResponse('getting prompt', 'slug is required. Call
|
|
50
|
+
return errorResponse('getting prompt', 'slug is required. Call prompts (action: list) for the valid slugs.');
|
|
51
51
|
}
|
|
52
52
|
try {
|
|
53
53
|
const prompt = await getPrompt(client, parsed.data.slug);
|
|
@@ -63,28 +63,28 @@ function errorResponse(action, message) {
|
|
|
63
63
|
return { content: [{ type: 'text', text: `Error ${action}: ${message}` }], isError: true };
|
|
64
64
|
}
|
|
65
65
|
//---------------
|
|
66
|
-
// Registration lives here (
|
|
67
|
-
//
|
|
68
|
-
//
|
|
69
|
-
//
|
|
70
|
-
// Returns the session so index.ts wraps the entry and script tools with
|
|
71
|
-
// the same one.
|
|
66
|
+
// Registration lives here (index.ts only wires the intent modules). The prompts tool runs inside the server's RecipeSession: its
|
|
67
|
+
// requests carry the recipe-adoption headers, `list` marks the recipes as
|
|
68
|
+
// known, and `get` records the slug once the API returned it. Returns the
|
|
69
|
+
// session so the other intent modules wrap the entry and script actions with the same one.
|
|
72
70
|
//---------------
|
|
71
|
+
const PROMPTS_SPECS = { list: ListPromptsShape, get: GetPromptShape };
|
|
73
72
|
export function registerPromptTools(server, client, transport) {
|
|
74
73
|
const session = new RecipeSession(transport);
|
|
75
|
-
server.tool('
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
74
|
+
server.tool('prompts', actionDescription(`${ListPromptsDescription}\n${GetPromptDescription}`, PROMPTS_SPECS), actionShape(PROMPTS_SPECS), READ_ONLY, byAction({
|
|
75
|
+
list: async () => {
|
|
76
|
+
const response = await session.run(undefined, () => handleListPrompts(client));
|
|
77
|
+
if (response.isError !== true)
|
|
78
|
+
session.recordRecipesListed();
|
|
79
|
+
return response;
|
|
80
|
+
},
|
|
81
|
+
get: async (args) => {
|
|
82
|
+
const response = await session.run(args.slug, () => handleGetPrompt(client, args));
|
|
83
|
+
if (response.isError !== true && isRecipeSlug(args.slug))
|
|
84
|
+
session.recordRecipeFetched(args.slug);
|
|
85
|
+
return response;
|
|
86
|
+
},
|
|
87
|
+
}, PROMPTS_SPECS, 'prompts'));
|
|
88
88
|
return session;
|
|
89
89
|
}
|
|
90
90
|
//# sourceMappingURL=tools-prompts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools-prompts.js","sourceRoot":"","sources":["../src/tools-prompts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,sBAAsB,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACrF,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAG9C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"tools-prompts.js","sourceRoot":"","sources":["../src/tools-prompts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,sBAAsB,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACrF,OAAO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,CAAC;AACjB,CAAC"}
|
|
@@ -2,9 +2,6 @@ import type { z } from 'zod';
|
|
|
2
2
|
import type { PostEngineerClient } from './client.js';
|
|
3
3
|
import { CompleteVideoUploadSchema, CreateVideoUploadSchema, PublishUploadedVideoSchema } from './publish-uploaded-shape.js';
|
|
4
4
|
import { type McpToolResponse } from './tools-call.js';
|
|
5
|
-
export declare const CreateVideoUploadDescription = "Mint a short-lived signed upload for one video (MP4 or MOV, max 2GB): returns an uploadId plus a signedUrl to PUT the video bytes to directly (the bytes never pass through this server), bound to your account and expiring in 15 minutes. Then call complete_video_upload, then publish_uploaded_video with the uploadId.";
|
|
6
|
-
export declare const CompleteVideoUploadDescription = "Verify a signed video upload after its bytes were PUT to the signedUrl from create_video_upload: the server checks the real video content (magic bytes) and size, and marks the upload ready to publish. Completing an already-ready upload is safe to retry.";
|
|
7
|
-
export declare const PublishUploadedVideoDescription = "Publish a completed signed-upload video directly to social accounts by uploadId \u2014 no generation, no schedule, no local path. Single-use: one publish consumes the upload. YouTube requires title, description, tags, and privacyStatus; Rumble and Fanvue require title and description; Instagram/Bluesky/LinkedIn/Threads/Facebook/3Speak require caption; Pinterest requires boardId (plus description or caption). Create the upload first with create_video_upload and verify it with complete_video_upload.";
|
|
8
5
|
export declare function handleCreateVideoUpload(client: PostEngineerClient, args: z.infer<typeof CreateVideoUploadSchema>): Promise<McpToolResponse>;
|
|
9
6
|
export declare function handleCompleteVideoUpload(client: PostEngineerClient, args: z.infer<typeof CompleteVideoUploadSchema>): Promise<McpToolResponse>;
|
|
10
7
|
export declare function handlePublishUploadedVideo(client: PostEngineerClient, args: z.infer<typeof PublishUploadedVideoSchema>): Promise<McpToolResponse>;
|
|
@@ -4,18 +4,15 @@ import { CompleteVideoUploadSchema, CreateVideoUploadSchema, PublishUploadedVide
|
|
|
4
4
|
import { sanitizeEngineError } from './tools.js';
|
|
5
5
|
import { handleLibraryCall } from './tools-call.js';
|
|
6
6
|
//---------------
|
|
7
|
-
// Signed-upload publish
|
|
8
|
-
// that replaces
|
|
9
|
-
// module so tools.ts stays under the file-size ratchet;
|
|
10
|
-
//
|
|
11
|
-
// from tools.ts (
|
|
12
|
-
//
|
|
7
|
+
// Signed-upload publish handlers (issue #561): the JSON-only remote flow
|
|
8
|
+
// that replaces the local videoPath of publish_video (action: from_file).
|
|
9
|
+
// Kept in a new module so tools.ts stays under the file-size ratchet; the
|
|
10
|
+
// publish_video tool registers them in intent-content.ts. sanitizeEngineError
|
|
11
|
+
// is imported from tools.ts (an import cycle through tools.js that is safe:
|
|
12
|
+
// handlers run after module init).
|
|
13
13
|
//---------------
|
|
14
|
-
export const CreateVideoUploadDescription = 'Mint a short-lived signed upload for one video (MP4 or MOV, max 2GB): returns an uploadId plus a signedUrl to PUT the video bytes to directly (the bytes never pass through this server), bound to your account and expiring in 15 minutes. Then call complete_video_upload, then publish_uploaded_video with the uploadId.';
|
|
15
|
-
export const CompleteVideoUploadDescription = 'Verify a signed video upload after its bytes were PUT to the signedUrl from create_video_upload: the server checks the real video content (magic bytes) and size, and marks the upload ready to publish. Completing an already-ready upload is safe to retry.';
|
|
16
|
-
export const PublishUploadedVideoDescription = 'Publish a completed signed-upload video directly to social accounts by uploadId — no generation, no schedule, no local path. Single-use: one publish consumes the upload. YouTube requires title, description, tags, and privacyStatus; Rumble and Fanvue require title and description; Instagram/Bluesky/LinkedIn/Threads/Facebook/3Speak require caption; Pinterest requires boardId (plus description or caption). Create the upload first with create_video_upload and verify it with complete_video_upload.';
|
|
17
14
|
export async function handleCreateVideoUpload(client, args) {
|
|
18
|
-
return handleLibraryCall(async () => createVideoUpload(client, CreateVideoUploadSchema.parse(args)), 'creating video upload', 'Signed video upload created. PUT the video bytes to signedUrl before it expires, then call
|
|
15
|
+
return handleLibraryCall(async () => createVideoUpload(client, CreateVideoUploadSchema.parse(args)), 'creating video upload', 'Signed video upload created. PUT the video bytes to signedUrl before it expires, then call publish_video (action: complete_upload)');
|
|
19
16
|
}
|
|
20
17
|
export async function handleCompleteVideoUpload(client, args) {
|
|
21
18
|
return handleLibraryCall(async () => completeVideoUpload(client, CompleteVideoUploadSchema.parse(args).uploadId), 'completing video upload', 'Video upload verified and ready to publish');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools-publish-uploaded.js","sourceRoot":"","sources":["../src/tools-publish-uploaded.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAC5G,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EACL,yBAAyB,EACzB,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAwB,MAAM,iBAAiB,CAAC;AAE1E,iBAAiB;AACjB,
|
|
1
|
+
{"version":3,"file":"tools-publish-uploaded.js","sourceRoot":"","sources":["../src/tools-publish-uploaded.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAC5G,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EACL,yBAAyB,EACzB,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAwB,MAAM,iBAAiB,CAAC;AAE1E,iBAAiB;AACjB,yEAAyE;AACzE,0EAA0E;AAC1E,0EAA0E;AAC1E,8EAA8E;AAC9E,4EAA4E;AAC5E,mCAAmC;AACnC,iBAAiB;AAEjB,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,MAA0B,EAC1B,IAA6C;IAE7C,OAAO,iBAAiB,CACtB,KAAK,IAAI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AK,MAAM,CAAC,YAAY,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,wBAAwB;wBACvH,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;wBAChB,KAAK,IAAI,CAAC,SAAS,CAAC;4BAClB,OAAO,EAAE,MAAM,CAAC,OAAO;4BACvB,QAAQ,EAAE,MAAM,CAAC,QAAQ;4BACzB,YAAY,EAAE,MAAM,CAAC,YAAY;4BACjC,OAAO,EAAE,MAAM,CAAC,OAAO;4BACvB,KAAK,EAAE,MAAM,CAAC,KAAK;yBACpB,CAAC,EAAE;iBACP;aACF;SACF,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,QAAQ,IAAI,KAAK,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;YACrD,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,oCAAoC,IAAI,CAAC,SAAS,CAAC;4BACvD,IAAI,EAAE,KAAK,CAAC,IAAI;4BAChB,OAAO,EAAE,mBAAmB,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;4BACpD,KAAK,EAAE,KAAK,CAAC,KAAK;yBACnB,CAAC,EAAE;qBACL;iBACF;gBACD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;QACD,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,oCAAoC,eAAe,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC;YAC/F,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -6,8 +6,8 @@ import { handleLibraryCall } from './tools.js';
|
|
|
6
6
|
// issue #572) — MCP tools.
|
|
7
7
|
//
|
|
8
8
|
// Since issue #212, omitting all four provider account-id fields in
|
|
9
|
-
//
|
|
10
|
-
// accounts (set via
|
|
9
|
+
// generate_video falls back to the persona's bound publishing
|
|
10
|
+
// accounts (set via accounts (action: set_persona_publishing)); explicit ids must
|
|
11
11
|
// be a subset of the binding. The binding as a whole must keep at least
|
|
12
12
|
// one account: it can never be emptied.
|
|
13
13
|
//---------------
|
|
@@ -27,7 +27,7 @@ export const SetPersonaPublishingAccountsShape = {
|
|
|
27
27
|
.record(z.string(), z.array(z.string().min(1)))
|
|
28
28
|
.describe('Publishing accounts the persona is bound to, per provider, e.g. { youtube: ["UC..."], bluesky: ["did:plc:..."], \'3speak\': ["alice"] }. ' +
|
|
29
29
|
'Replaces the whole set: providers mapped to [] (or omitted) keep no binding for that provider, but the binding as a whole must keep at least one account (issue #572). ' +
|
|
30
|
-
'Account IDs come from
|
|
30
|
+
'Account IDs come from accounts (action: list) (channelId / igUserId / providerAccountId / did).'),
|
|
31
31
|
};
|
|
32
32
|
export const SetPersonaPublishingAccountsSchema = z.object(SetPersonaPublishingAccountsShape);
|
|
33
33
|
export async function handleGetPersonaPublishingAccounts(client, args) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools-publishing-accounts.js","sourceRoot":"","sources":["../src/tools-publishing-accounts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,4BAA4B,EAC5B,4BAA4B,GAC7B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAwB,MAAM,YAAY,CAAC;AAErE,iBAAiB;AACjB,uEAAuE;AACvE,2BAA2B;AAC3B,EAAE;AACF,oEAAoE;AACpE,
|
|
1
|
+
{"version":3,"file":"tools-publishing-accounts.js","sourceRoot":"","sources":["../src/tools-publishing-accounts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,4BAA4B,EAC5B,4BAA4B,GAC7B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAwB,MAAM,YAAY,CAAC;AAErE,iBAAiB;AACjB,uEAA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Q,CAAC,EACzE,qCAAqC,EACrC,kDAAkD,CACnD,CAAC;AACJ,CAAC"}
|
|
@@ -16,7 +16,6 @@ export declare function generatePersonaVideoOutcome(client: PostEngineerClient,
|
|
|
16
16
|
failedSlotIds: string[];
|
|
17
17
|
scheduleId: string | null;
|
|
18
18
|
}>;
|
|
19
|
-
export declare const ValidateScriptDescription = "Validate a segments script mechanically, without spending tokens: hook first, then content takes in order, 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 before TTS). A CTA is just a content take, placed anywhere. 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.";
|
|
20
19
|
export declare const ScoreDraftShape: {
|
|
21
20
|
draft: z.ZodString;
|
|
22
21
|
network: z.ZodOptional<z.ZodEnum<{
|
|
@@ -57,5 +56,4 @@ export declare const ScoreDraftSchema: z.ZodObject<{
|
|
|
57
56
|
script: "script";
|
|
58
57
|
}>>;
|
|
59
58
|
}, z.core.$strip>;
|
|
60
|
-
export declare const ScoreDraftDescription = "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, pinterest, 3speak, 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, Pinterest 800 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.";
|
|
61
59
|
export declare function handleScoreDraft(client: PostEngineerClient, args: z.infer<typeof ScoreDraftSchema>): Promise<McpToolResponse>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
// Singular MCP-first tools:
|
|
1
|
+
// Singular MCP-first tools: generate_video and check_script (action: validate).
|
|
2
2
|
// One call is one video, with a title and a complete segments script.
|
|
3
|
-
//
|
|
3
|
+
// generate_video (tools-batch.ts) creates several videos by
|
|
4
4
|
// running generatePersonaVideoOutcome once per video.
|
|
5
5
|
// Validation runs mechanically before the client call, so a rejected script
|
|
6
|
-
// never reaches the web route and never debits tokens.
|
|
6
|
+
// never reaches the web route and never debits tokens. check_script (action: validate)
|
|
7
7
|
// then calls POST /api/videos/validate-script, which re-runs the same
|
|
8
8
|
// mechanical validation server-side without debiting tokens, scheduling,
|
|
9
9
|
// or calling the engine or Modal. Measured hook duration is a documented
|
|
10
|
-
// Phase 1 gap: no hook-only TTS endpoint exists yet, so
|
|
10
|
+
// Phase 1 gap: no hook-only TTS endpoint exists yet, so check_script (action: validate)
|
|
11
11
|
// reports the 8-12s window and the hook word count and states that the
|
|
12
12
|
// measured duration is pending that endpoint — it does not invent a
|
|
13
13
|
// duration and does not call Modal.
|
|
@@ -115,7 +115,7 @@ export async function generatePersonaVideoOutcome(client, args) {
|
|
|
115
115
|
// Pinterest needs exactly one board for the batch (a pin cannot exist
|
|
116
116
|
// without one); the web route 400s without it, so fail fast here.
|
|
117
117
|
if (args.providers.includes('pinterest') && (args.pinterestBoardId === undefined || args.pinterestBoardId.trim() === '')) {
|
|
118
|
-
throw new Error('pinterestBoardId is required when pinterest is selected (list the boards with
|
|
118
|
+
throw new Error('pinterestBoardId is required when pinterest is selected (list the boards with accounts (action: list_boards)).');
|
|
119
119
|
}
|
|
120
120
|
// Voice resolution is an explicit pre-step after mechanical validation
|
|
121
121
|
// and before the generating call: an unknown voice fails without
|
|
@@ -203,21 +203,18 @@ function narrowScheduledVideos(result) {
|
|
|
203
203
|
replayed: typeof record.replayed === 'boolean' ? record.replayed : null,
|
|
204
204
|
};
|
|
205
205
|
}
|
|
206
|
-
// NOTE:
|
|
207
|
-
//
|
|
208
|
-
//
|
|
209
|
-
//
|
|
210
|
-
// registered the same way and maps to POST
|
|
211
|
-
// /api/videos/generate-and-schedule.
|
|
212
|
-
export const ValidateScriptDescription = 'Validate a segments script mechanically, without spending tokens: hook first, then content takes in order, 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 before TTS). A CTA is just a content take, placed anywhere. 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.';
|
|
206
|
+
// NOTE: check_script (action: validate) is registered by intent-content.ts and
|
|
207
|
+
// maps to POST /api/videos/validate-script, which it really calls through the
|
|
208
|
+
// client after the local mechanical pre-check. generate_video is registered by
|
|
209
|
+
// intent-video.ts and maps to POST /api/videos/generate-and-schedule.
|
|
213
210
|
//---------------
|
|
214
|
-
//
|
|
211
|
+
// check_script (action: score) — mechanical draft scoring, no tokens spent.
|
|
215
212
|
//
|
|
216
213
|
// The shape mirrors the web route's body (same names, same caps); the
|
|
217
214
|
// handler does no local pre-check beyond the schema because every signal
|
|
218
215
|
// needs the server-side baseline (the caller's own stored post metrics).
|
|
219
216
|
// The route really is called through the client, so the parity graph
|
|
220
|
-
// maps
|
|
217
|
+
// maps check_script (action: score) to POST /api/videos/score-draft.
|
|
221
218
|
//---------------
|
|
222
219
|
const SCORE_DRAFT_UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
223
220
|
export const ScoreDraftShape = {
|
|
@@ -238,7 +235,6 @@ export const ScoreDraftShape = {
|
|
|
238
235
|
kind: z.enum(['post', 'script']).optional().describe('What the text is. Defaults to post.'),
|
|
239
236
|
};
|
|
240
237
|
export const ScoreDraftSchema = z.object(ScoreDraftShape);
|
|
241
|
-
export const ScoreDraftDescription = '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, pinterest, 3speak, 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, Pinterest 800 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.';
|
|
242
238
|
export async function handleScoreDraft(client, args) {
|
|
243
239
|
try {
|
|
244
240
|
const result = await scoreDraft(client, {
|