post-engineer-mcp 1.41.0 → 1.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +64 -26
- package/dist/analytics.d.ts +5 -3
- package/dist/analytics.js +42 -124
- package/dist/analytics.js.map +1 -1
- package/dist/client-experiments.d.ts +15 -0
- package/dist/client-experiments.js +11 -0
- package/dist/client-experiments.js.map +1 -0
- package/dist/client-posts.d.ts +5 -1
- package/dist/client-posts.js +4 -0
- package/dist/client-posts.js.map +1 -1
- package/dist/client-prompts.d.ts +16 -0
- package/dist/client-prompts.js +50 -0
- package/dist/client-prompts.js.map +1 -0
- package/dist/client-types.d.ts +14 -4
- package/dist/client.d.ts +1 -1
- package/dist/client.js +22 -94
- package/dist/client.js.map +1 -1
- package/dist/cloned-voice-client.d.ts +12 -0
- package/dist/cloned-voice-client.js +103 -20
- package/dist/cloned-voice-client.js.map +1 -1
- package/dist/cloned-voice-tools.d.ts +40 -6
- package/dist/cloned-voice-tools.js +76 -6
- package/dist/cloned-voice-tools.js.map +1 -1
- package/dist/errors.d.ts +11 -0
- package/dist/errors.js +43 -0
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +35 -36
- package/dist/index.js.map +1 -1
- package/dist/limits.d.ts +40 -1
- package/dist/limits.js +40 -1
- package/dist/limits.js.map +1 -1
- package/dist/persona-avatar.d.ts +29 -0
- package/dist/persona-avatar.js +115 -0
- package/dist/persona-avatar.js.map +1 -0
- package/dist/persona-update.d.ts +84 -0
- package/dist/persona-update.js +37 -0
- package/dist/persona-update.js.map +1 -0
- package/dist/prompts.d.ts +5 -8
- package/dist/prompts.js +45 -46
- package/dist/prompts.js.map +1 -1
- package/dist/recipe-session.d.ts +46 -0
- package/dist/recipe-session.js +126 -0
- package/dist/recipe-session.js.map +1 -0
- package/dist/schedule-shapes.d.ts +1 -1
- package/dist/schedule-shapes.js +4 -4
- package/dist/schedule-shapes.js.map +1 -1
- package/dist/script-segments.d.ts +4 -2
- package/dist/script-segments.js +19 -7
- package/dist/script-segments.js.map +1 -1
- package/dist/single-video-shape.d.ts +75 -17
- package/dist/single-video-shape.js +25 -1
- package/dist/single-video-shape.js.map +1 -1
- package/dist/tools-experiments.d.ts +724 -0
- package/dist/tools-experiments.js +165 -0
- package/dist/tools-experiments.js.map +1 -0
- package/dist/tools-posts.d.ts +19 -4
- package/dist/tools-posts.js +15 -4
- package/dist/tools-posts.js.map +1 -1
- package/dist/tools-prompts.d.ts +16 -0
- package/dist/tools-prompts.js +89 -0
- package/dist/tools-prompts.js.map +1 -0
- package/dist/tools-single-video.d.ts +5 -0
- package/dist/tools-single-video.js +21 -12
- package/dist/tools-single-video.js.map +1 -1
- package/dist/tools.d.ts +46 -52
- package/dist/tools.js +10 -32
- package/dist/tools.js.map +1 -1
- package/dist/voice-filters.d.ts +5 -6
- package/dist/voice-filters.js +12 -43
- package/dist/voice-filters.js.map +1 -1
- package/package.json +1 -2
- package/dist/prompt-base.d.ts +0 -4
- package/dist/prompt-base.js +0 -134
- package/dist/prompt-base.js.map +0 -1
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
// Persona face sources for create_persona and update_persona: a public
|
|
2
|
+
// image URL (avatarUrl) or a local image file (avatarPath). The file goes
|
|
3
|
+
// up as the multipart `photo` field, the same field the web form uses, so
|
|
4
|
+
// the face never depends on the server downloading a link. Extracted from
|
|
5
|
+
// client.ts and tools.ts so both stay under the file-size ratchet.
|
|
6
|
+
import { readFile, stat } from 'node:fs/promises';
|
|
7
|
+
import { basename } from 'node:path';
|
|
8
|
+
import { z } from 'zod';
|
|
9
|
+
import { getErrorMessage, ImageTooLargeError } from './errors.js';
|
|
10
|
+
import { assertImageSize, mimeTypeForImagePath } from './image-guards.js';
|
|
11
|
+
import { MAX_LIBRARY_IMAGE_MB } from './limits.js';
|
|
12
|
+
export async function imageFormFile(path) {
|
|
13
|
+
// Validate before uploading: the API rejects the file anyway, so an
|
|
14
|
+
// oversized or unsupported image fails fast locally instead of wasting an
|
|
15
|
+
// upload. A stat() pre-check bounds memory before readFile — a multi-GB
|
|
16
|
+
// file misnamed .png would otherwise load fully into this stdio process.
|
|
17
|
+
// The TOCTOU window is benign: the authoritative size check still runs on
|
|
18
|
+
// the buffer after read. Any failure surfaces with the full path for a
|
|
19
|
+
// consistent, actionable message.
|
|
20
|
+
// Note: the extension is trusted as a hint only; the server re-validates
|
|
21
|
+
// content via magic bytes, so a mislabeled file still fails server-side
|
|
22
|
+
// (duplicating magic-byte sniffing locally would be a second source of
|
|
23
|
+
// truth that can drift).
|
|
24
|
+
const mimeType = mimeTypeForImagePath(path);
|
|
25
|
+
try {
|
|
26
|
+
const fileStat = await stat(path);
|
|
27
|
+
assertImageSize(fileStat.size, path);
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
// Discriminate by type, not by message text: the typed size error
|
|
31
|
+
// passes through untouched, while stat failures become the actionable
|
|
32
|
+
// "Failed to read image" wrapper.
|
|
33
|
+
if (error instanceof ImageTooLargeError)
|
|
34
|
+
throw error;
|
|
35
|
+
throw new Error(`Failed to read image "${path}": ${getErrorMessage(error)}`);
|
|
36
|
+
}
|
|
37
|
+
let buffer;
|
|
38
|
+
try {
|
|
39
|
+
buffer = await readFile(path);
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
throw new Error(`Failed to read image "${path}": ${getErrorMessage(error)}`);
|
|
43
|
+
}
|
|
44
|
+
if (buffer.length === 0) {
|
|
45
|
+
// A 0-byte file would pass the local gate but shift the index-aligned
|
|
46
|
+
// imageTags/imageDescriptions (the server 400s when the tag/description
|
|
47
|
+
// counts don't match the file count), so reject it here with a clear
|
|
48
|
+
// message instead of a confusing server 400.
|
|
49
|
+
throw new Error(`Image "${path}" is empty.`);
|
|
50
|
+
}
|
|
51
|
+
// The post-read check reuses the shared guard: same limit, same message,
|
|
52
|
+
// full path — and it covers the (benign) TOCTOU window after stat.
|
|
53
|
+
assertImageSize(buffer.length, path);
|
|
54
|
+
return new Blob([buffer], { type: mimeType });
|
|
55
|
+
}
|
|
56
|
+
const AVATAR_PATH_DESCRIPTION = `Local file path to the persona face photo (JPG/JPEG, PNG, or WebP, max ${MAX_LIBRARY_IMAGE_MB}MB), uploaded directly. Use instead of avatarUrl for your own photo.`;
|
|
57
|
+
/** create_persona: exactly one of avatarUrl or avatarPath (checked in the client). */
|
|
58
|
+
export const CreatePersonaAvatarFields = {
|
|
59
|
+
avatarUrl: z
|
|
60
|
+
.string()
|
|
61
|
+
.url()
|
|
62
|
+
.optional()
|
|
63
|
+
.describe('Public URL to the persona avatar image (use list_faces for stock face URLs). Give exactly one of avatarUrl or avatarPath: every persona has a face; "no face" is chosen per video with generate_persona_video options.faceless.'),
|
|
64
|
+
avatarPath: z.string().min(1).optional().describe(AVATAR_PATH_DESCRIPTION),
|
|
65
|
+
};
|
|
66
|
+
/** update_persona: at most one of avatarUrl or avatarPath. */
|
|
67
|
+
export const UpdatePersonaAvatarFields = {
|
|
68
|
+
// No .nullable(): the API has no "clear avatar" sentinel — null would be silently ignored.
|
|
69
|
+
avatarUrl: z.string().url().optional().describe('New public avatar image URL'),
|
|
70
|
+
avatarPath: z.string().min(1).optional().describe(`New face photo. ${AVATAR_PATH_DESCRIPTION}`),
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* Full-schema refine for the handler re-parse (the SDK validates the raw
|
|
74
|
+
* shape only): a face from exactly one source (create) or at most one
|
|
75
|
+
* (update) fails as a schema error before any file read or fetch.
|
|
76
|
+
*/
|
|
77
|
+
export function refinePersonaAvatar(required) {
|
|
78
|
+
return (value, ctx) => {
|
|
79
|
+
const count = [value.avatarUrl, value.avatarPath].filter(provided).length;
|
|
80
|
+
if (count > 1) {
|
|
81
|
+
ctx.addIssue({ code: z.ZodIssueCode.custom, path: ['avatarPath'], message: 'Give either avatarUrl or avatarPath, not both.' });
|
|
82
|
+
}
|
|
83
|
+
else if (required && count === 0) {
|
|
84
|
+
ctx.addIssue({ code: z.ZodIssueCode.custom, path: ['avatarUrl'], message: 'avatarUrl or avatarPath is required: every persona has a face.' });
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
// Programmatic callers can pass null; only a non-empty string is a face.
|
|
89
|
+
function provided(value) {
|
|
90
|
+
return value !== undefined && value !== null && value.length > 0;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Appends the persona face to the form: `avatarUrl` as text or
|
|
94
|
+
* `avatarPath` as the `photo` file. Both at once is a conflict the server
|
|
95
|
+
* would resolve silently (the photo wins on PATCH), so it fails here before
|
|
96
|
+
* any file read. `required` makes a missing face an error (create).
|
|
97
|
+
*/
|
|
98
|
+
export async function appendPersonaAvatar(formData, input, required) {
|
|
99
|
+
const { avatarUrl, avatarPath } = input;
|
|
100
|
+
if (provided(avatarUrl) && provided(avatarPath)) {
|
|
101
|
+
throw new Error('Give either avatarUrl or avatarPath, not both.');
|
|
102
|
+
}
|
|
103
|
+
if (provided(avatarUrl)) {
|
|
104
|
+
formData.set('avatarUrl', avatarUrl);
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
if (provided(avatarPath)) {
|
|
108
|
+
formData.set('photo', await imageFormFile(avatarPath), basename(avatarPath));
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
if (required) {
|
|
112
|
+
throw new Error('avatarUrl or avatarPath is required: every persona has a face. Use list_faces for a stock face URL, avatarPath for a local photo, and generate_persona_video options.faceless for videos without a face.');
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=persona-avatar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persona-avatar.js","sourceRoot":"","sources":["../src/persona-avatar.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,0EAA0E;AAC1E,0EAA0E;AAC1E,0EAA0E;AAC1E,mEAAmE;AACnE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MA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,UAAU,CAAC,CAAC,CAAC;QAC7E,OAAO;IACT,CAAC;IACD,IAAI,QAAQ,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACb,0MAA0M,CAC3M,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { PostEngineerClient } from './client.js';
|
|
3
|
+
import { type McpToolResponse } from './tools-call.js';
|
|
4
|
+
export declare const UpdatePersonaShape: {
|
|
5
|
+
voiceId: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodEnum<[string, ...string[]]>, z.ZodString]>, string, string>>;
|
|
6
|
+
language: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
7
|
+
videoAspect: z.ZodOptional<z.ZodEnum<["9:16", "16:9"]>>;
|
|
8
|
+
videoLayout: z.ZodOptional<z.ZodEnum<["standard", "react"]>>;
|
|
9
|
+
scriptPrompt: z.ZodOptional<z.ZodString>;
|
|
10
|
+
paragraphNumber: z.ZodOptional<z.ZodNumber>;
|
|
11
|
+
niche: z.ZodOptional<z.ZodString>;
|
|
12
|
+
faceQuality: z.ZodOptional<z.ZodEnum<["ok", "very_good"]>>;
|
|
13
|
+
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
14
|
+
avatarPath: z.ZodOptional<z.ZodString>;
|
|
15
|
+
personaId: z.ZodString;
|
|
16
|
+
name: z.ZodOptional<z.ZodString>;
|
|
17
|
+
};
|
|
18
|
+
export declare const UpdatePersonaSchema: z.ZodEffects<z.ZodObject<{
|
|
19
|
+
voiceId: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodEnum<[string, ...string[]]>, z.ZodString]>, string, string>>;
|
|
20
|
+
language: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
21
|
+
videoAspect: z.ZodOptional<z.ZodEnum<["9:16", "16:9"]>>;
|
|
22
|
+
videoLayout: z.ZodOptional<z.ZodEnum<["standard", "react"]>>;
|
|
23
|
+
scriptPrompt: z.ZodOptional<z.ZodString>;
|
|
24
|
+
paragraphNumber: z.ZodOptional<z.ZodNumber>;
|
|
25
|
+
niche: z.ZodOptional<z.ZodString>;
|
|
26
|
+
faceQuality: z.ZodOptional<z.ZodEnum<["ok", "very_good"]>>;
|
|
27
|
+
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
28
|
+
avatarPath: z.ZodOptional<z.ZodString>;
|
|
29
|
+
personaId: z.ZodString;
|
|
30
|
+
name: z.ZodOptional<z.ZodString>;
|
|
31
|
+
}, "strip", z.ZodTypeAny, {
|
|
32
|
+
personaId: string;
|
|
33
|
+
avatarUrl?: string | undefined;
|
|
34
|
+
avatarPath?: string | undefined;
|
|
35
|
+
name?: string | undefined;
|
|
36
|
+
voiceId?: string | undefined;
|
|
37
|
+
language?: string | undefined;
|
|
38
|
+
videoAspect?: "9:16" | "16:9" | undefined;
|
|
39
|
+
videoLayout?: "standard" | "react" | undefined;
|
|
40
|
+
scriptPrompt?: string | undefined;
|
|
41
|
+
paragraphNumber?: number | undefined;
|
|
42
|
+
niche?: string | undefined;
|
|
43
|
+
faceQuality?: "ok" | "very_good" | undefined;
|
|
44
|
+
}, {
|
|
45
|
+
personaId: string;
|
|
46
|
+
avatarUrl?: string | undefined;
|
|
47
|
+
avatarPath?: string | undefined;
|
|
48
|
+
name?: string | undefined;
|
|
49
|
+
voiceId?: string | undefined;
|
|
50
|
+
language?: string | undefined;
|
|
51
|
+
videoAspect?: "9:16" | "16:9" | undefined;
|
|
52
|
+
videoLayout?: "standard" | "react" | undefined;
|
|
53
|
+
scriptPrompt?: string | undefined;
|
|
54
|
+
paragraphNumber?: number | undefined;
|
|
55
|
+
niche?: string | undefined;
|
|
56
|
+
faceQuality?: "ok" | "very_good" | undefined;
|
|
57
|
+
}>, {
|
|
58
|
+
personaId: string;
|
|
59
|
+
avatarUrl?: string | undefined;
|
|
60
|
+
avatarPath?: string | undefined;
|
|
61
|
+
name?: string | undefined;
|
|
62
|
+
voiceId?: string | undefined;
|
|
63
|
+
language?: string | undefined;
|
|
64
|
+
videoAspect?: "9:16" | "16:9" | undefined;
|
|
65
|
+
videoLayout?: "standard" | "react" | undefined;
|
|
66
|
+
scriptPrompt?: string | undefined;
|
|
67
|
+
paragraphNumber?: number | undefined;
|
|
68
|
+
niche?: string | undefined;
|
|
69
|
+
faceQuality?: "ok" | "very_good" | undefined;
|
|
70
|
+
}, {
|
|
71
|
+
personaId: string;
|
|
72
|
+
avatarUrl?: string | undefined;
|
|
73
|
+
avatarPath?: string | undefined;
|
|
74
|
+
name?: string | undefined;
|
|
75
|
+
voiceId?: string | undefined;
|
|
76
|
+
language?: string | undefined;
|
|
77
|
+
videoAspect?: "9:16" | "16:9" | undefined;
|
|
78
|
+
videoLayout?: "standard" | "react" | undefined;
|
|
79
|
+
scriptPrompt?: string | undefined;
|
|
80
|
+
paragraphNumber?: number | undefined;
|
|
81
|
+
niche?: string | undefined;
|
|
82
|
+
faceQuality?: "ok" | "very_good" | undefined;
|
|
83
|
+
}>;
|
|
84
|
+
export declare function handleUpdatePersona(client: PostEngineerClient, args: z.infer<typeof UpdatePersonaSchema>): Promise<McpToolResponse>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// update_persona: shape, schema and handler.
|
|
2
|
+
//
|
|
3
|
+
// Extracted from tools.ts so tools.ts stays under the file-size ratchet.
|
|
4
|
+
// Re-exported from tools.ts, so existing import sites (`./tools.js`) keep
|
|
5
|
+
// working, including the tool registration in index.ts.
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
import { VIDEO_LAYOUTS } from './client.js';
|
|
8
|
+
import { handleLibraryCall } from './tools-call.js';
|
|
9
|
+
import { isEnglishLanguage, ONLY_ENGLISH_VIDEOS_MESSAGE } from './language.js';
|
|
10
|
+
import { refinePersonaAvatar, UpdatePersonaAvatarFields } from './persona-avatar.js';
|
|
11
|
+
import { personaVoiceField, withResolvedPersonaVoiceForUpdate } from './voice-filters.js';
|
|
12
|
+
export const UpdatePersonaShape = {
|
|
13
|
+
personaId: z.string().min(1, 'personaId is required').describe('The ID of the persona to update'),
|
|
14
|
+
name: z.string().min(1).optional().describe('New name for the persona'),
|
|
15
|
+
...UpdatePersonaAvatarFields,
|
|
16
|
+
voiceId: personaVoiceField().optional().describe('New voice id or label from list_voices. Never type a provider prefix.'),
|
|
17
|
+
language: z
|
|
18
|
+
.string()
|
|
19
|
+
.refine(isEnglishLanguage, { message: ONLY_ENGLISH_VIDEOS_MESSAGE })
|
|
20
|
+
.optional()
|
|
21
|
+
.describe('New language code — English only for now (e.g. en-US, en-GB)'),
|
|
22
|
+
videoAspect: z.enum(['9:16', '16:9']).optional().describe('New video aspect ratio'),
|
|
23
|
+
videoLayout: z.enum(VIDEO_LAYOUTS).optional().describe('New persona-hook layout (standard or react)'),
|
|
24
|
+
scriptPrompt: z.string().optional().describe('New system prompt instructions for video scripts'),
|
|
25
|
+
paragraphNumber: z.number().int().min(1).max(10).optional().describe('New number of paragraphs'),
|
|
26
|
+
niche: z.string().max(300).optional().describe('New content niche'),
|
|
27
|
+
faceQuality: z
|
|
28
|
+
.enum(['ok', 'very_good'])
|
|
29
|
+
.optional()
|
|
30
|
+
.describe('New face resolution of the rendered videos: ok (480p, 2 tokens/video) or very_good (720p, 3 tokens/video). Future videos price at the new quality; already-scheduled posts keep the quality they were charged for.'),
|
|
31
|
+
};
|
|
32
|
+
export const UpdatePersonaSchema = z.object(UpdatePersonaShape).superRefine(refinePersonaAvatar(false));
|
|
33
|
+
export async function handleUpdatePersona(client, args) {
|
|
34
|
+
// Full-schema parse, then voice routing BEFORE the POST; no voiceId keeps the stored voice (#353).
|
|
35
|
+
return handleLibraryCall(async () => client.updatePersona(await withResolvedPersonaVoiceForUpdate(client, UpdatePersonaSchema.parse(args))), 'updating persona', 'Persona updated successfully');
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=persona-update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persona-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declare function registerPrompts(server: McpServer): void;
|
|
2
|
+
import { type GetPromptResult, type ListPromptsResult } from '@modelcontextprotocol/sdk/types.js';
|
|
3
|
+
import type { PostEngineerClient } from './client.js';
|
|
4
|
+
export declare function listSlashPrompts(client: PostEngineerClient): Promise<ListPromptsResult>;
|
|
5
|
+
export declare function getSlashPrompt(client: PostEngineerClient, slug: string): Promise<GetPromptResult>;
|
|
6
|
+
export declare function registerRemotePrompts(server: McpServer, client: PostEngineerClient): void;
|
package/dist/prompts.js
CHANGED
|
@@ -1,52 +1,51 @@
|
|
|
1
|
+
import { ErrorCode, GetPromptRequestSchema, ListPromptsRequestSchema, McpError, } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
import { withTracking } from './analytics.js';
|
|
3
|
+
import { UnknownPromptSlugError, getPrompt, listPrompts } from './client-prompts.js';
|
|
4
|
+
import { getErrorMessage } from './errors.js';
|
|
5
|
+
import { recipeRunText } from './recipe-session.js';
|
|
1
6
|
//---------------
|
|
2
|
-
// MCP prompts hub: slash commands for the
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
7
|
+
// MCP prompts hub: slash commands for the recipe prompts, served from the
|
|
8
|
+
// web hub over the API (GET /api/prompts, GET /api/prompts/[slug]).
|
|
9
|
+
//
|
|
10
|
+
// The handlers are registered on the low-level server and fetch on
|
|
11
|
+
// demand: startup never depends on the API, a recipe edit on the web
|
|
12
|
+
// reaches every install on the next prompts/list, and nothing is cached
|
|
13
|
+
// stale. Prompts are zero-arg: the agent asks the user for values.
|
|
14
|
+
// A failed fetch surfaces as an MCP error to the client, never as an
|
|
15
|
+
// empty list. Both requests are tagged like tool calls (slash_list_prompts,
|
|
16
|
+
// slash_get_prompt) so the web API records slash-command usage too.
|
|
11
17
|
//---------------
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
slug: "full-setup",
|
|
32
|
-
title: "Full setup becomes videos",
|
|
33
|
-
description: [
|
|
34
|
-
"Connect accounts, create a persona, validate the script, and publish your first video without skipping a step.",
|
|
35
|
-
].join("\n"),
|
|
36
|
-
prompt: FULL_SETUP_PROMPT,
|
|
37
|
-
},
|
|
38
|
-
];
|
|
39
|
-
export function registerPrompts(server) {
|
|
40
|
-
for (const prompt of HUB_PROMPTS) {
|
|
41
|
-
server.registerPrompt(prompt.slug, {
|
|
42
|
-
title: prompt.title,
|
|
18
|
+
const trackedList = withTracking('slash_list_prompts', async (client) => listPrompts(client.client));
|
|
19
|
+
const trackedGet = withTracking('slash_get_prompt', async (args) => getPrompt(args.client, args.slug));
|
|
20
|
+
export async function listSlashPrompts(client) {
|
|
21
|
+
try {
|
|
22
|
+
const prompts = await trackedList({ client });
|
|
23
|
+
return {
|
|
24
|
+
prompts: prompts.map((prompt) => ({ name: prompt.slug, title: prompt.title, description: prompt.description })),
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
throw new McpError(ErrorCode.InternalError, `Failed to list prompts: ${getErrorMessage(error)}`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
export async function getSlashPrompt(client, slug) {
|
|
32
|
+
try {
|
|
33
|
+
const prompt = await trackedGet({ client, slug });
|
|
34
|
+
return {
|
|
43
35
|
description: prompt.description,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
role: 'user',
|
|
47
|
-
content: { type: 'text', text: prompt.prompt },
|
|
48
|
-
}],
|
|
49
|
-
}));
|
|
36
|
+
messages: [{ role: 'user', content: { type: 'text', text: recipeRunText(prompt.slug, prompt.prompt) } }],
|
|
37
|
+
};
|
|
50
38
|
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
if (error instanceof UnknownPromptSlugError) {
|
|
41
|
+
throw new McpError(ErrorCode.InvalidParams, error.message);
|
|
42
|
+
}
|
|
43
|
+
throw new McpError(ErrorCode.InternalError, `Failed to get prompt: ${getErrorMessage(error)}`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
export function registerRemotePrompts(server, client) {
|
|
47
|
+
server.server.registerCapabilities({ prompts: {} });
|
|
48
|
+
server.server.setRequestHandler(ListPromptsRequestSchema, async () => listSlashPrompts(client));
|
|
49
|
+
server.server.setRequestHandler(GetPromptRequestSchema, async (request) => getSlashPrompt(client, request.params.name));
|
|
51
50
|
}
|
|
52
51
|
//# sourceMappingURL=prompts.js.map
|
package/dist/prompts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"AACA,OAAO,EACL,SAAS,EACT,sBAAsB,EACtB,wBAAwB,EACxB,QAAQ,GAGT,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,sBAAsB,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACrF,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,iBAAiB;AACjB,0EAA0E;AAC1E,oEAAoE;AACpE,EAAE;AACF,mEAAmE;AACnE,qEAAqE;AACrE,wEAAwE;AACxE,mEAAmE;AACnE,qEAAqE;AACrE,4EAA4E;AAC5E,oEAAoE;AACpE,iBAAiB;AAEjB,MAAM,WAAW,GAAG,YAAY,CAAC,oBAAoB,EAAE,KAAK,EAA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f,IAAI,KAAK,YAAY,sBAAsB,EAAE,CAAC;YAC5C,MAAM,IAAI,QAAQ,CAAC,SAAS,CAAC,aAAa,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;QAC7D,CAAC;QACD,MAAM,IAAI,QAAQ,CAAC,SAAS,CAAC,aAAa,EAAE,yBAAyB,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACjG,CAAC;AACH,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,MAAiB,EAAE,MAA0B;IACjF,MAAM,CAAC,MAAM,CAAC,oBAAoB,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC;IACpD,MAAM,CAAC,MAAM,CAAC,iBAAiB,CAAC,wBAAwB,EAAE,KAAK,IAAI,EAAE,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC;IAChG,MAAM,CAAC,MAAM,CAAC,iBAAiB,CAAC,sBAAsB,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;AAC1H,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { McpToolResponse } from './tools-call.js';
|
|
2
|
+
export type McpTransportKind = 'stdio' | 'http';
|
|
3
|
+
export declare const RECIPE_NUDGE_SURFACES: readonly ["create_persona", "list_personas", "list_social_accounts", "get_token_balance", "validate_script", "generate_persona_video"];
|
|
4
|
+
export type RecipeNudgeSurface = (typeof RECIPE_NUDGE_SURFACES)[number];
|
|
5
|
+
export type ScriptTool = 'validate_script' | 'generate_persona_video';
|
|
6
|
+
export declare const MCP_SESSION_ID_HEADER = "X-MCP-Session-Id";
|
|
7
|
+
export declare const MCP_TRANSPORT_HEADER = "X-MCP-Transport";
|
|
8
|
+
export declare const MCP_NUDGED_BY_HEADER = "X-MCP-Nudged-By";
|
|
9
|
+
export declare const MCP_RECIPES_KNOWN_HEADER = "X-MCP-Recipes-Known";
|
|
10
|
+
export declare const MCP_RECIPE_FETCHED_HEADER = "X-MCP-Recipe-Fetched";
|
|
11
|
+
export declare const MCP_SCRIPT_REJECTIONS_HEADER = "X-MCP-Script-Rejections";
|
|
12
|
+
export declare const MCP_RECIPE_HEADER = "X-MCP-Recipe";
|
|
13
|
+
export declare const RECIPE_SLUG_PATTERN: RegExp;
|
|
14
|
+
export declare const RECIPE_NUDGE_TEXT = "Next step for a video about a topic (news, a place, a product, GitHub PRs): call list_prompts and follow the matching recipe with get_prompt instead of improvising the script \u2014 recipes pre-validate the script, media, and price facts before any token is spent.";
|
|
15
|
+
export declare const SCRIPT_REJECTED_RECIPE_HINT = "Recipes produce scripts that pass these limits: call list_prompts and follow the matching recipe with get_prompt.";
|
|
16
|
+
export declare function recipeRunText(slug: string, prompt: string): string;
|
|
17
|
+
export declare function isRecipeSlug(value: unknown): value is string;
|
|
18
|
+
export declare class RecipeSession {
|
|
19
|
+
readonly transport: McpTransportKind;
|
|
20
|
+
readonly sessionId: string;
|
|
21
|
+
private recipesListed;
|
|
22
|
+
private lastRecipeFetched;
|
|
23
|
+
private lastNudge;
|
|
24
|
+
private scriptRejections;
|
|
25
|
+
constructor(transport: McpTransportKind);
|
|
26
|
+
/** True once the agent listed or fetched a recipe in this session. */
|
|
27
|
+
knowsRecipes(): boolean;
|
|
28
|
+
recordNudgeShown(surface: RecipeNudgeSurface): void;
|
|
29
|
+
recordRecipesListed(): void;
|
|
30
|
+
/** Call only after the API returned the recipe, so the slug is real. */
|
|
31
|
+
recordRecipeFetched(slug: string): void;
|
|
32
|
+
recordScriptRejected(): void;
|
|
33
|
+
/** Headers for the API requests of one call; recipe is that call's slug. */
|
|
34
|
+
telemetryHeaders(recipe: unknown): Record<string, string>;
|
|
35
|
+
/** Run one call with this session's headers on every API request it sends. */
|
|
36
|
+
run<TResult>(recipe: unknown, call: () => Promise<TResult>): Promise<TResult>;
|
|
37
|
+
}
|
|
38
|
+
export declare function withRecipeNudge<TArgs>(session: RecipeSession, surface: RecipeNudgeSurface, handler: (args: TArgs) => Promise<McpToolResponse>): (args: TArgs) => Promise<McpToolResponse>;
|
|
39
|
+
export declare function withScriptOutcome<TArgs extends {
|
|
40
|
+
segments: unknown;
|
|
41
|
+
recipe?: string;
|
|
42
|
+
facelessMaterial?: string;
|
|
43
|
+
options?: {
|
|
44
|
+
facelessMaterial?: string;
|
|
45
|
+
};
|
|
46
|
+
}>(session: RecipeSession, toolName: ScriptTool, handler: (args: TArgs) => Promise<McpToolResponse>): (args: TArgs) => Promise<McpToolResponse>;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import { withTelemetryHeaders } from './analytics.js';
|
|
3
|
+
import { validateSegments } from './script-segments.js';
|
|
4
|
+
export const RECIPE_NUDGE_SURFACES = [
|
|
5
|
+
'create_persona',
|
|
6
|
+
'list_personas',
|
|
7
|
+
'list_social_accounts',
|
|
8
|
+
'get_token_balance',
|
|
9
|
+
'validate_script',
|
|
10
|
+
'generate_persona_video',
|
|
11
|
+
];
|
|
12
|
+
export const MCP_SESSION_ID_HEADER = 'X-MCP-Session-Id';
|
|
13
|
+
export const MCP_TRANSPORT_HEADER = 'X-MCP-Transport';
|
|
14
|
+
export const MCP_NUDGED_BY_HEADER = 'X-MCP-Nudged-By';
|
|
15
|
+
export const MCP_RECIPES_KNOWN_HEADER = 'X-MCP-Recipes-Known';
|
|
16
|
+
export const MCP_RECIPE_FETCHED_HEADER = 'X-MCP-Recipe-Fetched';
|
|
17
|
+
export const MCP_SCRIPT_REJECTIONS_HEADER = 'X-MCP-Script-Rejections';
|
|
18
|
+
export const MCP_RECIPE_HEADER = 'X-MCP-Recipe';
|
|
19
|
+
// A recipe slug as the web hub writes them; anything else is never sent.
|
|
20
|
+
export const RECIPE_SLUG_PATTERN = /^[a-z0-9][a-z0-9-]{0,63}$/;
|
|
21
|
+
// Header values stay bounded: the counter saturates instead of growing.
|
|
22
|
+
const MAX_SCRIPT_REJECTIONS = 999;
|
|
23
|
+
export const RECIPE_NUDGE_TEXT = 'Next step for a video about a topic (news, a place, a product, GitHub PRs): call list_prompts and follow the matching recipe with get_prompt instead of improvising the script — recipes pre-validate the script, media, and price facts before any token is spent.';
|
|
24
|
+
export const SCRIPT_REJECTED_RECIPE_HINT = 'Recipes produce scripts that pass these limits: call list_prompts and follow the matching recipe with get_prompt.';
|
|
25
|
+
//---------------
|
|
26
|
+
// The text an agent runs for a recipe: the hub text plus a footer asking
|
|
27
|
+
// it to declare the recipe on generate_persona_video, so its request
|
|
28
|
+
// carries X-MCP-Recipe. Shared by get_prompt and the slash commands.
|
|
29
|
+
//---------------
|
|
30
|
+
export function recipeRunText(slug, prompt) {
|
|
31
|
+
return `${prompt}\n\nWhen you call generate_persona_video for this recipe, pass recipe: "${slug}".`;
|
|
32
|
+
}
|
|
33
|
+
export function isRecipeSlug(value) {
|
|
34
|
+
return typeof value === 'string' && RECIPE_SLUG_PATTERN.test(value);
|
|
35
|
+
}
|
|
36
|
+
export class RecipeSession {
|
|
37
|
+
transport;
|
|
38
|
+
sessionId = randomUUID();
|
|
39
|
+
recipesListed = false;
|
|
40
|
+
lastRecipeFetched = null;
|
|
41
|
+
lastNudge = null;
|
|
42
|
+
scriptRejections = 0;
|
|
43
|
+
constructor(transport) {
|
|
44
|
+
this.transport = transport;
|
|
45
|
+
}
|
|
46
|
+
/** True once the agent listed or fetched a recipe in this session. */
|
|
47
|
+
knowsRecipes() {
|
|
48
|
+
return this.recipesListed || this.lastRecipeFetched !== null;
|
|
49
|
+
}
|
|
50
|
+
recordNudgeShown(surface) {
|
|
51
|
+
this.lastNudge = surface;
|
|
52
|
+
}
|
|
53
|
+
recordRecipesListed() {
|
|
54
|
+
this.recipesListed = true;
|
|
55
|
+
}
|
|
56
|
+
/** Call only after the API returned the recipe, so the slug is real. */
|
|
57
|
+
recordRecipeFetched(slug) {
|
|
58
|
+
if (isRecipeSlug(slug))
|
|
59
|
+
this.lastRecipeFetched = slug;
|
|
60
|
+
}
|
|
61
|
+
recordScriptRejected() {
|
|
62
|
+
this.scriptRejections = Math.min(this.scriptRejections + 1, MAX_SCRIPT_REJECTIONS);
|
|
63
|
+
}
|
|
64
|
+
/** Headers for the API requests of one call; recipe is that call's slug. */
|
|
65
|
+
telemetryHeaders(recipe) {
|
|
66
|
+
const headers = {
|
|
67
|
+
[MCP_SESSION_ID_HEADER]: this.sessionId,
|
|
68
|
+
[MCP_TRANSPORT_HEADER]: this.transport,
|
|
69
|
+
[MCP_NUDGED_BY_HEADER]: this.lastNudge ?? 'none',
|
|
70
|
+
[MCP_RECIPES_KNOWN_HEADER]: String(this.knowsRecipes()),
|
|
71
|
+
[MCP_RECIPE_FETCHED_HEADER]: this.lastRecipeFetched ?? 'none',
|
|
72
|
+
[MCP_SCRIPT_REJECTIONS_HEADER]: String(this.scriptRejections),
|
|
73
|
+
};
|
|
74
|
+
if (isRecipeSlug(recipe))
|
|
75
|
+
headers[MCP_RECIPE_HEADER] = recipe;
|
|
76
|
+
return headers;
|
|
77
|
+
}
|
|
78
|
+
/** Run one call with this session's headers on every API request it sends. */
|
|
79
|
+
run(recipe, call) {
|
|
80
|
+
return withTelemetryHeaders(() => this.telemetryHeaders(recipe), call);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
function withExtraText(response, text) {
|
|
84
|
+
return { ...response, content: [...response.content, { type: 'text', text }] };
|
|
85
|
+
}
|
|
86
|
+
//---------------
|
|
87
|
+
// Wrap an entry tool: its requests carry the session headers and, on
|
|
88
|
+
// success while the agent has not met the recipes yet, the nudge is
|
|
89
|
+
// appended as its own text block (the first block stays the tool's own
|
|
90
|
+
// payload, so JSON consumers keep parsing it).
|
|
91
|
+
//---------------
|
|
92
|
+
export function withRecipeNudge(session, surface, handler) {
|
|
93
|
+
return async (args) => {
|
|
94
|
+
const response = await session.run(undefined, () => handler(args));
|
|
95
|
+
if (response.isError === true || session.knowsRecipes()) {
|
|
96
|
+
return response;
|
|
97
|
+
}
|
|
98
|
+
session.recordNudgeShown(surface);
|
|
99
|
+
return withExtraText(response, RECIPE_NUDGE_TEXT);
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
//---------------
|
|
103
|
+
// Wrap a script tool (validate_script, generate_persona_video): its
|
|
104
|
+
// requests carry the session headers plus the declared recipe; a script
|
|
105
|
+
// the mechanical validator rejects (no API request is sent then) bumps the
|
|
106
|
+
// session's rejection counter, which the next request reports, and gets
|
|
107
|
+
// the recipe hint unless a recipe is already in play. The classification
|
|
108
|
+
// re-runs the same pure validator the handler runs, so it never parses
|
|
109
|
+
// the handler's error text.
|
|
110
|
+
//---------------
|
|
111
|
+
export function withScriptOutcome(session, toolName, handler) {
|
|
112
|
+
return async (args) => {
|
|
113
|
+
const response = await session.run(args.recipe, () => handler(args));
|
|
114
|
+
const material = args.facelessMaterial ?? args.options?.facelessMaterial;
|
|
115
|
+
if (response.isError !== true || validateSegments(args.segments, material).ok) {
|
|
116
|
+
return response;
|
|
117
|
+
}
|
|
118
|
+
session.recordScriptRejected();
|
|
119
|
+
if (args.recipe !== undefined || session.knowsRecipes()) {
|
|
120
|
+
return response;
|
|
121
|
+
}
|
|
122
|
+
session.recordNudgeShown(toolName);
|
|
123
|
+
return withExtraText(response, SCRIPT_REJECTED_RECIPE_HINT);
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
//# sourceMappingURL=recipe-session.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recipe-session.js","sourceRoot":"","sources":["../src/recipe-session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AA4BxD,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,gBAAgB;IAChB,eAAe;IACf,sBAAsB;IACtB,mBAAmB;I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AAI,CAAC,gBAAgB,IAAI,IAAI,CAAC,OAAO,EAAE,gBAAgB,CAAC;QACzE,IAAI,QAAQ,CAAC,OAAO,KAAK,IAAI,IAAI,gBAAgB,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC;YAC9E,OAAO,QAAQ,CAAC;QAClB,CAAC;QACD,OAAO,CAAC,oBAAoB,EAAE,CAAC;QAC/B,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,IAAI,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC;YACxD,OAAO,QAAQ,CAAC;QAClB,CAAC;QACD,OAAO,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;QACnC,OAAO,aAAa,CAAC,QAAQ,EAAE,2BAA2B,CAAC,CAAC;IAC9D,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -57,7 +57,7 @@ export declare const DeleteSlotSchema: z.ZodObject<{
|
|
|
57
57
|
}>;
|
|
58
58
|
export declare const GeneratePersonaVideoOptionsShape: {
|
|
59
59
|
faceless: z.ZodOptional<z.ZodBoolean>;
|
|
60
|
-
facelessMaterial: z.ZodOptional<z.ZodEnum<["broll", "svg"]>>;
|
|
60
|
+
facelessMaterial: z.ZodOptional<z.ZodEnum<["broll", "svg", "images"]>>;
|
|
61
61
|
fullLipsync: z.ZodOptional<z.ZodBoolean>;
|
|
62
62
|
audioUrl: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
63
63
|
imageId: z.ZodOptional<z.ZodString>;
|
package/dist/schedule-shapes.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
// keep working.
|
|
7
7
|
import { z } from 'zod';
|
|
8
8
|
import { isEnglishLanguage, ONLY_ENGLISH_VIDEOS_MESSAGE } from './language.js';
|
|
9
|
-
import { VIDEO_LAYOUTS } from './limits.js';
|
|
9
|
+
import { FACELESS_MATERIALS, VIDEO_LAYOUTS } from './limits.js';
|
|
10
10
|
import { personaVoiceField } from './voice-filters.js';
|
|
11
11
|
export const ListSchedulesShape = {};
|
|
12
12
|
export const ListSchedulesSchema = z.object(ListSchedulesShape);
|
|
@@ -74,9 +74,9 @@ function httpsUrlField(fieldName) {
|
|
|
74
74
|
export const GeneratePersonaVideoOptionsShape = {
|
|
75
75
|
faceless: z.boolean().optional().describe('Generate faceless (no face). With a persona this drops only the face — the persona voice and niche still apply. Without a persona it is REQUIRED.'),
|
|
76
76
|
facelessMaterial: z
|
|
77
|
-
.enum(
|
|
77
|
+
.enum(FACELESS_MATERIALS)
|
|
78
78
|
.optional()
|
|
79
|
-
.describe('What fills the video, with or without a face: "broll" = real stock footage only, "svg" = drawn illustrations only. The
|
|
79
|
+
.describe('What fills the video, with or without a face: "broll" = real stock footage only, "svg" = drawn illustrations only, "images" = only the images you send on the segments (no stock, no drawings): every segment needs media (upload_media or a public image url), up to 12, each shown full frame with a slow zoom while its segment is spoken. Use images you have the rights to. The materials never mix. Defaults to "broll".'),
|
|
80
80
|
fullLipsync: z
|
|
81
81
|
.boolean()
|
|
82
82
|
.optional()
|
|
@@ -89,7 +89,7 @@ export const GeneratePersonaVideoOptionsShape = {
|
|
|
89
89
|
videoLayout: z
|
|
90
90
|
.enum(VIDEO_LAYOUTS)
|
|
91
91
|
.optional()
|
|
92
|
-
.describe('How the persona hook is composed with the video material (facelessMaterial: real clips or
|
|
92
|
+
.describe('How the persona hook is composed with the video material (facelessMaterial: real clips, drawings or your images). Overrides the persona when one is given; a post without a persona defaults to "standard". Same render cost either way.'),
|
|
93
93
|
paragraphNumber: z.number().int().min(1).max(10).optional().describe('Paragraph count (1-10). Overrides the persona when one is given.'),
|
|
94
94
|
language: z
|
|
95
95
|
.string()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schedule-shapes.js","sourceRoot":"","sources":["../src/schedule-shapes.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,gDAAgD;AAChD,EAAE;AACF,wEAAwE;AACxE,yEAAyE;AACzE,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