@clipwright/mcp-server 0.38.2 → 0.40.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 +38 -5
- package/SKILL.md +11 -5
- package/dist/advertised-schema.d.ts +15 -10
- package/dist/advertised-schema.js +102 -43
- package/dist/advertised-schema.js.map +1 -1
- package/dist/format.d.ts +8 -6
- package/dist/format.js +18 -33
- package/dist/format.js.map +1 -1
- package/dist/listed-texts.d.ts +4 -0
- package/dist/listed-texts.js +188 -0
- package/dist/listed-texts.js.map +1 -0
- package/dist/run-display.js +21 -3
- package/dist/run-display.js.map +1 -1
- package/dist/server.d.ts +26 -0
- package/dist/server.js +173 -67
- package/dist/server.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -159,7 +159,7 @@ rate. [Watch it](https://clipwright.io/mcp#examples).
|
|
|
159
159
|
- `list_workflows` — read workflow methods and current availability. Free.
|
|
160
160
|
- `get_workflow` — read one method's required inputs, script rules, evidence and limitations. Free.
|
|
161
161
|
- `prepare_workflow_plan` — create with a complete document, or save with both `plan_id` and `base_version`. Free; starts no run.
|
|
162
|
-
- `plan_reference_remake` — the server compiles a reference ad's profile and your exact script into a new plan; its warnings name what the plan does not reproduce. Free; starts no run and generates nothing.
|
|
162
|
+
- `plan_reference_remake` — the server compiles a reference ad's analysis (`analysis_id`, or the profile itself) and your exact script into a new plan; its warnings name what the plan does not reproduce. Free; starts no run and generates nothing.
|
|
163
163
|
- `get_workflow_plan` — read the current owned plan, revision and readiness. Free.
|
|
164
164
|
- `approve_workflow_plan` — explicitly approve a chosen revision and content digest. Free; starts no run.
|
|
165
165
|
- `quote_workflow_plan` — quote the approved revision without spending credits.
|
|
@@ -172,6 +172,9 @@ rate. [Watch it](https://clipwright.io/mcp#examples).
|
|
|
172
172
|
credits.
|
|
173
173
|
- `list_template_sounds` — the sounds `make_ugc` templates play, by beat: where
|
|
174
174
|
each beat plays, its default and every name `template_sounds` takes. Free.
|
|
175
|
+
- `list_moves` — the catalogue of moves, motion and graphics to put on lines of
|
|
176
|
+
a script as `moves` of `make_ugc`, `make_faceless` and `plan_reference_remake`:
|
|
177
|
+
what each does for the viewer, the lines it suits and its credits. Free.
|
|
175
178
|
- `list_actors` — ready-made faces with stable ids and verified formats. Free.
|
|
176
179
|
- `quote_ugc` — estimated duration and price, plus a warning when `make_ugc`
|
|
177
180
|
with the same input would be refused for money or access. Free.
|
|
@@ -181,12 +184,17 @@ rate. [Watch it](https://clipwright.io/mcp#examples).
|
|
|
181
184
|
Free.
|
|
182
185
|
- `send_feedback` — tell Clipwright what is missing, confusing, wrong or slow,
|
|
183
186
|
optionally about a run; we read every one. Free.
|
|
187
|
+
- `describe_tool` — the full guidance of a tool, or of one of its fields, which
|
|
188
|
+
the tool list gives in short. Free.
|
|
184
189
|
- `make_ugc` — **renders a clip; this is the call that costs money.** Returns a
|
|
185
190
|
`run_id` immediately instead of blocking, because a render takes minutes.
|
|
186
191
|
- `get_run` — status of a run. Free; poll it every few seconds.
|
|
187
192
|
- `get_run_shots` — the shots of a finished video: the span, kind, description
|
|
188
193
|
and preview link of each, with the narration words and their timing. Free and
|
|
189
194
|
read-only. A run with no shots to show answers with the reason instead.
|
|
195
|
+
- `delete_run_media` — delete the files of a finished run: they stop opening at
|
|
196
|
+
once and are erased from storage after 7 days; the run and its charge stay.
|
|
197
|
+
Refused while another unfinished run uses them. Free.
|
|
190
198
|
- `quote_revision` — price of a revision of a faceless video: what it would
|
|
191
199
|
change and what it costs. Free.
|
|
192
200
|
- `revise_run` — **starts a revision: a new run that renders the video again
|
|
@@ -218,12 +226,16 @@ rate. [Watch it](https://clipwright.io/mcp#examples).
|
|
|
218
226
|
remote: PUT the file with curl, then use the `upload_id`. Free.
|
|
219
227
|
- `get_upload` — one upload with a fresh url, its size and `usable_until`;
|
|
220
228
|
after `create_upload` it confirms the PUT. Free.
|
|
229
|
+
- `delete_upload` — delete an upload: no tool takes it from then on, and its
|
|
230
|
+
file is erased from storage after 7 days. Refused while an unfinished run uses
|
|
231
|
+
it. Free.
|
|
221
232
|
- `create_asset` — save a picture or an MP4 clip as an account asset, kept
|
|
222
233
|
until you delete it: from a `run_id`, an `upload_id`, a public `url` (a clip
|
|
223
234
|
with `kind: "video"`), `base64`, a presigned `put`, and a local `path` on
|
|
224
235
|
stdio. A clip is checked in the background: `get_asset` says when it is
|
|
225
236
|
ready. Your own material needs `rights_confirmed: true` once. Free; 2000
|
|
226
|
-
assets and
|
|
237
|
+
assets and 1 GB per account (20 GB once it has bought credits), 100 new
|
|
238
|
+
ones per day.
|
|
227
239
|
- `list_assets`, `get_asset` — the account's assets with fresh urls and the
|
|
228
240
|
usage of the caps. Free.
|
|
229
241
|
- `update_asset` — rename an asset or change its role. Free.
|
|
@@ -236,8 +248,10 @@ rate. [Watch it](https://clipwright.io/mcp#examples).
|
|
|
236
248
|
pacing and what we cannot draw. Returns at once; poll
|
|
237
249
|
`get_reference_analysis`. 70 credits held and charged once it succeeds; a
|
|
238
250
|
failed analysis costs nothing. 10 new analyses per hour.
|
|
239
|
-
- `get_reference_analysis` — the state of an analysis, with
|
|
240
|
-
warnings once it succeeded
|
|
251
|
+
- `get_reference_analysis` — the state of an analysis, with its breakdown and
|
|
252
|
+
warnings once it succeeded, and `next`: `plan_reference_remake` with its
|
|
253
|
+
`analysis_id`, for a video like the reference. The profile and the frame
|
|
254
|
+
links come with `include: ["profile", "frames"]`. Free.
|
|
241
255
|
- `quote_creator_profile` — price of a creator profile for a link: 20 credits,
|
|
242
256
|
or 0 when a profile of the same creator from the last hour would answer. Free.
|
|
243
257
|
- `analyze_creator` — profile the creator behind an Instagram or TikTok profile
|
|
@@ -248,9 +262,23 @@ rate. [Watch it](https://clipwright.io/mcp#examples).
|
|
|
248
262
|
nothing. 30 new profiles per hour.
|
|
249
263
|
- `get_creator_profile` — the state of a creator profile, with its videos and
|
|
250
264
|
warnings once it succeeded. Free.
|
|
265
|
+
- `delete_creator_profile` — delete a finished creator profile at once; the run
|
|
266
|
+
that made it and its charge stay. Free.
|
|
267
|
+
- `quote_trends` — price of a trend search: 20 credits, or 0 when a search of
|
|
268
|
+
the same query from the last hour would answer. Free.
|
|
269
|
+
- `find_trends` — reels that took off on a topic: keywords on TikTok and
|
|
270
|
+
Instagram in one ranking by default (`platform: mix`), or on one of them, up
|
|
271
|
+
to 10 reels per platform posted within `posted_within_days`, one per creator,
|
|
272
|
+
ranked by the reel's views over its creator's median views. `language`
|
|
273
|
+
filters the TikTok reels only. Waits for the result; an unfinished one is read
|
|
274
|
+
by repeating the call, free. 20 credits held and charged once it succeeds,
|
|
275
|
+
also when a mix reaches only one platform (`warnings[]` names the other); a
|
|
276
|
+
search that finds no reel costs nothing. 10 new searches per hour.
|
|
251
277
|
- `quote_actor` — price of a personal actor before creating one. Free.
|
|
252
278
|
- `create_actor` — **creates a personal actor from a description; this costs
|
|
253
|
-
money.** Each requested format is a separate charged image.
|
|
279
|
+
money.** Each requested format is a separate charged image. With `portrait`
|
|
280
|
+
(your own 9:16 image asset) that image becomes the actor's portrait at no
|
|
281
|
+
charge, and only the other formats are charged. Returns a `run_id`
|
|
254
282
|
immediately; poll `get_run` until `succeeded`, then pass `created_actor.actor_id`
|
|
255
283
|
to `make_ugc` as `actor_id`.
|
|
256
284
|
- `quote_faceless` — price of a faceless video before making one. Free.
|
|
@@ -265,6 +293,11 @@ rate. [Watch it](https://clipwright.io/mcp#examples).
|
|
|
265
293
|
with it stay as they are. Free.
|
|
266
294
|
- `get_actor_defaults`, `set_actor_defaults` — read and save an actor's B-roll
|
|
267
295
|
default. It is stored only: today's talking-actor videos do not use it. Free.
|
|
296
|
+
- `extract_brand` — reads a public site's colours, fonts, logo and corners into
|
|
297
|
+
a proposed `design` with readable text, for you to confirm. Free.
|
|
298
|
+
- `brand_kit` — without `design`, reads the account's saved design and the looks
|
|
299
|
+
and faces to pick from; with `design`, saves it so a series keeps one look.
|
|
300
|
+
A video that names no `design` or `template_theme` draws in the kit. Free.
|
|
268
301
|
|
|
269
302
|
Call `quote_ugc` before `make_ugc`: the quote is where the contract tells you
|
|
270
303
|
what it will and will not honor. Anything the API cannot deliver comes back in
|
package/SKILL.md
CHANGED
|
@@ -114,13 +114,18 @@ For a source build, the command is `node` with the absolute path to
|
|
|
114
114
|
| `CLIPWRIGHT_API_URL` | no | Defaults to `https://api.clipwright.io`; set it only for another environment. |
|
|
115
115
|
|
|
116
116
|
After a restart, confirm that `tools/list`
|
|
117
|
-
returns
|
|
117
|
+
returns 57 tools: `make_ugc`, `get_run`, `get_run_shots`, `delete_run_media`, `quote_revision`, `revise_run`, `quote_candidate`, `create_candidate`,
|
|
118
118
|
`list_generation_models`, `quote_image`, `generate_image`, `quote_video`, `generate_video`, `quote_ugc`, `list_actors`,
|
|
119
|
-
`list_voices`, `list_template_sounds`, `upload_image`, `create_upload`, `get_upload`, `create_asset`, `list_assets`, `get_asset`, `update_asset`,
|
|
119
|
+
`list_voices`, `list_template_sounds`, `list_moves`, `upload_image`, `create_upload`, `get_upload`, `delete_upload`, `create_asset`, `list_assets`, `get_asset`, `update_asset`,
|
|
120
120
|
`delete_asset`, `quote_analysis`, `analyze_reference`, `get_reference_analysis`, `quote_creator_profile`, `analyze_creator`,
|
|
121
|
-
`get_creator_profile`, `get_account`, `list_prices`, `create_actor`, `quote_actor`, `delete_actor`, `get_actor_defaults`,
|
|
122
|
-
`set_actor_defaults`, `quote_faceless`, `make_faceless`, `list_workflows`, `get_workflow`, `prepare_workflow_plan`,
|
|
123
|
-
`plan_reference_remake`, `get_workflow_plan`, `approve_workflow_plan`, `quote_workflow_plan`, `run_workflow_plan`, `send_feedback
|
|
121
|
+
`get_creator_profile`, `delete_creator_profile`, `quote_trends`, `find_trends`, `get_account`, `list_prices`, `create_actor`, `quote_actor`, `delete_actor`, `get_actor_defaults`,
|
|
122
|
+
`set_actor_defaults`, `extract_brand`, `brand_kit`, `quote_faceless`, `make_faceless`, `list_workflows`, `get_workflow`, `prepare_workflow_plan`,
|
|
123
|
+
`plan_reference_remake`, `get_workflow_plan`, `approve_workflow_plan`, `quote_workflow_plan`, `run_workflow_plan`, `send_feedback`,
|
|
124
|
+
`describe_tool`.
|
|
125
|
+
|
|
126
|
+
The tool list gives each tool and field in short. Before the first use of a
|
|
127
|
+
tool or field, read its full guidance with `describe_tool` (free), for example
|
|
128
|
+
`describe_tool({tool: "quote_ugc", field: "templates"})`.
|
|
124
129
|
|
|
125
130
|
When no tool does the job, or an answer is confusing or wrong, file it with
|
|
126
131
|
`send_feedback` (free) instead of rephrasing the request and giving up.
|
|
@@ -225,6 +230,7 @@ quote or `list_prices`, never from memory or this page: they change.
|
|
|
225
230
|
| A personal actor | `quote_actor` | `create_actor` | `get_run` | `created_actor.actor_id` |
|
|
226
231
|
| A reading of a reference reel | `quote_analysis` | `analyze_reference` | `get_reference_analysis` | `reference_profile` or `data` |
|
|
227
232
|
| A creator's latest 12 videos with x to their median | `quote_creator_profile` | `analyze_creator` | `get_creator_profile` | `profile` |
|
|
233
|
+
| Reels that took off on a topic | `quote_trends` | `find_trends` | `find_trends` again | `result.reels` |
|
|
228
234
|
| A revision of a faceless video | `quote_revision` | `revise_run` | `get_run` | `video_url` |
|
|
229
235
|
| A new picture or clip for one shot | `quote_candidate` | `create_candidate` | `get_run` | `candidate.preview_url` |
|
|
230
236
|
| A plan from a workflow method | `quote_workflow_plan` | `run_workflow_plan` | `get_run` | `workflow` |
|
|
@@ -5,12 +5,7 @@ type Schema = {
|
|
|
5
5
|
};
|
|
6
6
|
/** Fields an agent copies from another answer or tool, advertised by pointer instead of by schema. */
|
|
7
7
|
export declare const COPIED_FIELDS: Record<string, Record<string, string>>;
|
|
8
|
-
/**
|
|
9
|
-
export declare const FIELD_DESCRIPTION_CHARS = 160;
|
|
10
|
-
export declare const NESTED_DESCRIPTION_CHARS = 80;
|
|
11
|
-
/** Tools whose field descriptions stay whole: quote_ugc's carry the templates catalog, the snap rule and the script limits. */
|
|
12
|
-
export declare const WHOLE_FIELD_DESCRIPTIONS: Set<string>;
|
|
13
|
-
/** The paid tools whose input is their free quote's plus a few fields; the quote, read first, keeps the schema. */
|
|
8
|
+
/** The paid tools whose input is their free quote's plus a few fields; the quote, read first, keeps the field descriptions. */
|
|
14
9
|
export declare const PAID_TWINS: Record<string, string>;
|
|
15
10
|
/** The paid tool's fields its quote lacks, or undefined when the quote's fields differ from the paid tool's. */
|
|
16
11
|
export declare function twinExtras(paid: Tool, quote: Tool): string[] | undefined;
|
|
@@ -19,12 +14,22 @@ export declare function findTwins(tools: readonly Tool[]): Map<string, {
|
|
|
19
14
|
of: string;
|
|
20
15
|
plus: string[];
|
|
21
16
|
}>;
|
|
22
|
-
/** A description cut after its last whole sentence that fits, or after a whole word. */
|
|
23
|
-
export declare function shorten(text: string, limit: number): string;
|
|
24
17
|
/** Repeated subschemas move to `$defs` once, largest saving first; each copy becomes a `$ref`. Nodes in `keep` stay in place. */
|
|
25
18
|
export declare function hoistRepeats(schema: Schema, keep?: ReadonlySet<Schema>): Schema;
|
|
19
|
+
/** A twin's field as its types only, so a client building the call sends the right types; the quote describes it and lists its values. */
|
|
20
|
+
export declare function typeShape(field: unknown): unknown;
|
|
21
|
+
/** A tool's listed text: its short text and the price line its full text ends with, or the full text when it has none. */
|
|
22
|
+
export declare function listedDescription(tool: Pick<Tool, "name" | "description">): string | undefined;
|
|
23
|
+
/** Every description a tool's schema holds, by field path (`a.b`, `a[]` for items), for describe_tool. */
|
|
24
|
+
export declare function fieldTexts(node: Schema, path?: string, into?: Record<string, string>): Record<string, string>;
|
|
25
|
+
/** describe_tool's answer: a tool's full description and field guidance as the server registered them, or one field's (with its subfields). */
|
|
26
|
+
export declare function describeTool(tools: readonly Tool[], name: string, field?: string): {
|
|
27
|
+
tool: string;
|
|
28
|
+
description: string;
|
|
29
|
+
fields: Record<string, string>;
|
|
30
|
+
} | undefined;
|
|
26
31
|
/** The advertised list for the tools the SDK lists; the hosted server builds a server per request, so the last answer is kept. */
|
|
27
32
|
export declare function advertisedTools(tools: readonly Tool[]): Tool[];
|
|
28
|
-
/** Wraps the SDK's tools/list answer; call after every tool is registered. */
|
|
29
|
-
export declare function advertiseSlimTools(server: McpServer):
|
|
33
|
+
/** Wraps the SDK's tools/list answer; call after every tool is registered. Answers the SDK's own list, which describe_tool reads. */
|
|
34
|
+
export declare function advertiseSlimTools(server: McpServer): () => Promise<Tool[]>;
|
|
30
35
|
export {};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { priceLine } from "@clipwright/core";
|
|
2
|
+
import { LISTED_DESCRIPTIONS, LISTED_FIELDS } from "./listed-texts.js";
|
|
1
3
|
/** Fields an agent copies from another answer or tool, advertised by pointer instead of by schema. */
|
|
2
4
|
export const COPIED_FIELDS = {
|
|
3
5
|
prepare_workflow_plan: {
|
|
@@ -7,13 +9,16 @@ export const COPIED_FIELDS = {
|
|
|
7
9
|
},
|
|
8
10
|
plan_reference_remake: {
|
|
9
11
|
"/properties/reference_profile": "The reference_profile field of a succeeded get_reference_analysis answer, passed unchanged.",
|
|
12
|
+
"/properties/moves": "The moves array of quote_ugc input.",
|
|
13
|
+
"/properties/motion_style": "The motion_style object of quote_ugc input.",
|
|
10
14
|
},
|
|
15
|
+
brand_kit: { "/properties/design": "The design object of quote_ugc input." },
|
|
16
|
+
// The style list and when to use each are describe_tool's: listed whole they cost the bytes tools/list lacks (#1123).
|
|
17
|
+
quote_ugc: { "/properties/motion_style": "Free drawing style of captions, templates and scenes; describe_tool quote_ugc motion_style " +
|
|
18
|
+
"lists the styles and spans." },
|
|
11
19
|
};
|
|
12
|
-
/**
|
|
13
|
-
|
|
14
|
-
export const NESTED_DESCRIPTION_CHARS = 80;
|
|
15
|
-
/** Tools whose field descriptions stay whole: quote_ugc's carry the templates catalog, the snap rule and the script limits. */
|
|
16
|
-
export const WHOLE_FIELD_DESCRIPTIONS = new Set(["quote_ugc"]);
|
|
20
|
+
/** A field text that starts by marking the field unusable stays listed whole: the renderer ignores it, or the server refuses it. */
|
|
21
|
+
const MARKED_FIELD = /^(NOT HONORED YET|REJECTED for now):/;
|
|
17
22
|
const MAP_KEYWORDS = ["properties", "patternProperties", "$defs", "definitions", "dependentSchemas"];
|
|
18
23
|
const ONE_KEYWORDS = ["items", "additionalProperties", "not", "if", "then", "else", "contains", "propertyNames", "unevaluatedProperties", "unevaluatedItems"];
|
|
19
24
|
const LIST_KEYWORDS = ["anyOf", "oneOf", "allOf", "prefixItems"];
|
|
@@ -46,10 +51,11 @@ function walk(node, depth, visit) {
|
|
|
46
51
|
}
|
|
47
52
|
}
|
|
48
53
|
const withoutDescriptions = (schema) => JSON.stringify(schema, (key, value) => (key === "description" && typeof value === "string") || key === "$schema" ? undefined : value);
|
|
49
|
-
/** The paid tools whose input is their free quote's plus a few fields; the quote, read first, keeps the
|
|
54
|
+
/** The paid tools whose input is their free quote's plus a few fields; the quote, read first, keeps the field descriptions. */
|
|
50
55
|
export const PAID_TWINS = {
|
|
51
56
|
make_ugc: "quote_ugc", revise_run: "quote_revision", generate_video: "quote_video", generate_image: "quote_image",
|
|
52
57
|
create_actor: "quote_actor", make_faceless: "quote_faceless", create_candidate: "quote_candidate", analyze_reference: "quote_analysis",
|
|
58
|
+
find_trends: "quote_trends",
|
|
53
59
|
};
|
|
54
60
|
/** The paid tool's fields its quote lacks, or undefined when the quote's fields differ from the paid tool's. */
|
|
55
61
|
export function twinExtras(paid, quote) {
|
|
@@ -73,14 +79,6 @@ export function findTwins(tools) {
|
|
|
73
79
|
}
|
|
74
80
|
return twins;
|
|
75
81
|
}
|
|
76
|
-
/** A description cut after its last whole sentence that fits, or after a whole word. */
|
|
77
|
-
export function shorten(text, limit) {
|
|
78
|
-
if (text.length <= limit)
|
|
79
|
-
return text;
|
|
80
|
-
const head = text.slice(0, limit);
|
|
81
|
-
const end = Math.max(head.lastIndexOf(". "), head.lastIndexOf(".\n"), head.lastIndexOf("; "));
|
|
82
|
-
return end >= limit / 3 ? head.slice(0, end + 1) : `${head.replace(/\s+\S*$/, "")}…`;
|
|
83
|
-
}
|
|
84
82
|
/** Repeated subschemas move to `$defs` once, largest saving first; each copy becomes a `$ref`. Nodes in `keep` stay in place. */
|
|
85
83
|
export function hoistRepeats(schema, keep = new Set()) {
|
|
86
84
|
const { $defs: existing, ...root } = schema;
|
|
@@ -129,6 +127,25 @@ export function hoistRepeats(schema, keep = new Set()) {
|
|
|
129
127
|
}
|
|
130
128
|
return Object.keys(defs).length === 0 ? root : { ...root, $defs: defs };
|
|
131
129
|
}
|
|
130
|
+
/** A twin's field as its types only, so a client building the call sends the right types; the quote describes it and lists its values. */
|
|
131
|
+
export function typeShape(field) {
|
|
132
|
+
if (!isSchema(field))
|
|
133
|
+
return field;
|
|
134
|
+
const shape = {};
|
|
135
|
+
for (const keyword of ["type", "format"])
|
|
136
|
+
if (keyword in field)
|
|
137
|
+
shape[keyword] = field[keyword];
|
|
138
|
+
if (isSchema(field.items))
|
|
139
|
+
shape.items = typeShape(field.items);
|
|
140
|
+
// oneOf turns anyOf: branches stripped of what told them apart could match a value twice.
|
|
141
|
+
const branches = ["anyOf", "oneOf"].flatMap(keyword => (Array.isArray(field[keyword]) ? field[keyword] : []).map(typeShape));
|
|
142
|
+
const distinct = [...new Map(branches.map(branch => [JSON.stringify(branch), branch])).values()];
|
|
143
|
+
if (distinct.length === 1 && Object.keys(shape).length === 0)
|
|
144
|
+
return distinct[0];
|
|
145
|
+
if (distinct.length > 0)
|
|
146
|
+
shape.anyOf = distinct;
|
|
147
|
+
return shape;
|
|
148
|
+
}
|
|
132
149
|
/** A paid twin's description starts by naming the quote whose fields it takes. */
|
|
133
150
|
const withTwinNote = (description, twin) => `Input: the same fields as ${twin.of}${twin.plus.length === 0 ? "" : `, plus ${twin.plus.join(", ")}`}. ${description}`.trim();
|
|
134
151
|
function pointer(root, path) {
|
|
@@ -143,60 +160,99 @@ function pointer(root, path) {
|
|
|
143
160
|
}
|
|
144
161
|
function advertise(tools) {
|
|
145
162
|
const twins = findTwins(tools);
|
|
146
|
-
const described = new Set();
|
|
147
|
-
// A text a whole-described tool gives a field is said there and nowhere else, whatever the order of the list.
|
|
148
|
-
const kept = new Set();
|
|
149
|
-
for (const tool of tools.filter(entry => WHOLE_FIELD_DESCRIPTIONS.has(entry.name))) {
|
|
150
|
-
walk(tool.inputSchema, 0, (node, depth) => { if (depth === 1 && typeof node.description === "string")
|
|
151
|
-
kept.add(node.description); });
|
|
152
|
-
}
|
|
153
163
|
return tools.map(tool => {
|
|
154
164
|
const twin = twins.get(tool.name);
|
|
155
|
-
|
|
156
|
-
// A pointer is the field's only description, so no
|
|
165
|
+
const schema = structuredClone(tool.inputSchema);
|
|
166
|
+
// A pointer or a listed text is the field's only description, so no cut or $defs move touches it.
|
|
157
167
|
const pointers = new Set();
|
|
158
168
|
for (const [path, description] of Object.entries(COPIED_FIELDS[tool.name] ?? {})) {
|
|
159
169
|
const [container, key] = pointer(schema, path);
|
|
160
|
-
|
|
170
|
+
// The field's types stay, so a client still sends an array as an array.
|
|
171
|
+
const node = { ...typeShape(child(container, key)), description };
|
|
161
172
|
pointers.add(node);
|
|
162
173
|
put(container, key, node);
|
|
163
174
|
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
const
|
|
167
|
-
|
|
168
|
-
|
|
175
|
+
const listed = new Set();
|
|
176
|
+
for (const [key, description] of Object.entries(LISTED_FIELDS[tool.name] ?? {})) {
|
|
177
|
+
const [container, at] = pointer(schema, `/properties/${key}`);
|
|
178
|
+
const node = child(container, at);
|
|
179
|
+
node.description = description;
|
|
180
|
+
listed.add(node);
|
|
181
|
+
}
|
|
182
|
+
if (twin !== undefined && isSchema(schema.properties)) {
|
|
183
|
+
schema.properties = Object.fromEntries(Object.entries(schema.properties).map(([key, field]) => [key, typeShape(field)]));
|
|
184
|
+
// Open at the root to save bytes: the server parses the call against the full schema and names an unknown field.
|
|
185
|
+
delete schema.additionalProperties;
|
|
169
186
|
}
|
|
170
187
|
delete schema.$schema;
|
|
171
|
-
const own = new Set();
|
|
172
|
-
const keepFields = WHOLE_FIELD_DESCRIPTIONS.has(tool.name);
|
|
173
188
|
walk(schema, 0, (node, depth) => {
|
|
174
189
|
if (node.maximum === Number.MAX_SAFE_INTEGER)
|
|
175
190
|
delete node.maximum;
|
|
176
191
|
if (node.minimum === -Number.MAX_SAFE_INTEGER)
|
|
177
192
|
delete node.minimum;
|
|
193
|
+
// Constraints any JSON object meets, a format no JSON Schema defines (its pattern stays), and a pattern a date-time format states (#1045).
|
|
194
|
+
if (node.format === "starts_with" && typeof node.pattern === "string")
|
|
195
|
+
delete node.format;
|
|
196
|
+
if (isSchema(node.propertyNames) && Object.keys(node.propertyNames).join() === "type" && node.propertyNames.type === "string")
|
|
197
|
+
delete node.propertyNames;
|
|
198
|
+
if (isSchema(node.additionalProperties) && Object.keys(node.additionalProperties).length === 0)
|
|
199
|
+
delete node.additionalProperties;
|
|
200
|
+
if (node.format === "date-time" && typeof node.pattern === "string")
|
|
201
|
+
delete node.pattern;
|
|
178
202
|
// The root still refuses unknown fields; a nested one is refused by the server, which names it.
|
|
179
203
|
if (depth > 0 && node.additionalProperties === false)
|
|
180
204
|
delete node.additionalProperties;
|
|
181
|
-
|
|
205
|
+
// Any other field text is describe_tool's (#1142): names, types and values are listed, guidance is read on demand.
|
|
206
|
+
if (depth === 0 || typeof node.description !== "string" || pointers.has(node) || listed.has(node))
|
|
182
207
|
return;
|
|
183
|
-
if (
|
|
184
|
-
return;
|
|
185
|
-
if (described.has(node.description) || kept.has(node.description)) {
|
|
208
|
+
if (depth > 1 || !MARKED_FIELD.test(node.description))
|
|
186
209
|
delete node.description;
|
|
187
|
-
return;
|
|
188
|
-
}
|
|
189
|
-
own.add(node.description);
|
|
190
|
-
node.description = shorten(node.description, depth === 1 ? FIELD_DESCRIPTION_CHARS : NESTED_DESCRIPTION_CHARS);
|
|
191
210
|
});
|
|
192
|
-
for (const text of own)
|
|
193
|
-
described.add(text);
|
|
194
211
|
const { execution, ...rest } = tool;
|
|
195
|
-
const
|
|
212
|
+
const body = listedDescription(tool);
|
|
213
|
+
const description = twin === undefined ? body : withTwinNote(body ?? "", twin);
|
|
196
214
|
return { ...rest, ...(execution === undefined || execution.taskSupport === "forbidden" ? {} : { execution }),
|
|
197
215
|
...(description === undefined ? {} : { description }), inputSchema: hoistRepeats(schema, pointers) };
|
|
198
216
|
});
|
|
199
217
|
}
|
|
218
|
+
/** A tool's listed text: its short text and the price line its full text ends with, or the full text when it has none. */
|
|
219
|
+
export function listedDescription(tool) {
|
|
220
|
+
const short = LISTED_DESCRIPTIONS[tool.name];
|
|
221
|
+
if (short === undefined)
|
|
222
|
+
return tool.description;
|
|
223
|
+
const price = priceLine(tool.name);
|
|
224
|
+
return price !== null && tool.description?.endsWith(price) ? `${short} ${price}` : short;
|
|
225
|
+
}
|
|
226
|
+
/** Every description a tool's schema holds, by field path (`a.b`, `a[]` for items), for describe_tool. */
|
|
227
|
+
export function fieldTexts(node, path = "", into = {}) {
|
|
228
|
+
if (path !== "" && typeof node.description === "string" && !(into[path]?.split("\n").includes(node.description) ?? false)) {
|
|
229
|
+
into[path] = into[path] === undefined ? node.description : `${into[path]}\n${node.description}`;
|
|
230
|
+
}
|
|
231
|
+
for (const [keyword, value] of Object.entries(node)) {
|
|
232
|
+
if (MAP_KEYWORDS.includes(keyword) && isSchema(value)) {
|
|
233
|
+
for (const [key, sub] of Object.entries(value)) {
|
|
234
|
+
if (isSchema(sub))
|
|
235
|
+
fieldTexts(sub, keyword === "properties" ? (path === "" ? key : `${path}.${key}`) : `${keyword}.${key}`, into);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
else if (ONE_KEYWORDS.includes(keyword) && isSchema(value))
|
|
239
|
+
fieldTexts(value, keyword === "items" ? `${path}[]` : path, into);
|
|
240
|
+
else if (LIST_KEYWORDS.includes(keyword) && Array.isArray(value))
|
|
241
|
+
for (const branch of value)
|
|
242
|
+
if (isSchema(branch))
|
|
243
|
+
fieldTexts(branch, path, into);
|
|
244
|
+
}
|
|
245
|
+
return into;
|
|
246
|
+
}
|
|
247
|
+
/** describe_tool's answer: a tool's full description and field guidance as the server registered them, or one field's (with its subfields). */
|
|
248
|
+
export function describeTool(tools, name, field) {
|
|
249
|
+
const tool = tools.find(entry => entry.name === name);
|
|
250
|
+
if (tool === undefined)
|
|
251
|
+
return undefined;
|
|
252
|
+
const fields = Object.entries(fieldTexts(tool.inputSchema))
|
|
253
|
+
.filter(([path]) => field === undefined || path === field || path.startsWith(`${field}.`) || path.startsWith(`${field}[]`));
|
|
254
|
+
return { tool: name, description: tool.description ?? "", fields: Object.fromEntries(fields) };
|
|
255
|
+
}
|
|
200
256
|
let cached;
|
|
201
257
|
/** The advertised list for the tools the SDK lists; the hosted server builds a server per request, so the last answer is kept. */
|
|
202
258
|
export function advertisedTools(tools) {
|
|
@@ -205,7 +261,7 @@ export function advertisedTools(tools) {
|
|
|
205
261
|
cached = { key, tools: advertise(tools) };
|
|
206
262
|
return structuredClone(cached.tools);
|
|
207
263
|
}
|
|
208
|
-
/** Wraps the SDK's tools/list answer; call after every tool is registered. */
|
|
264
|
+
/** Wraps the SDK's tools/list answer; call after every tool is registered. Answers the SDK's own list, which describe_tool reads. */
|
|
209
265
|
export function advertiseSlimTools(server) {
|
|
210
266
|
// The SDK offers no hook into its tools/list answer, so the registered handler is wrapped in its private map.
|
|
211
267
|
const handlers = server.server._requestHandlers;
|
|
@@ -216,5 +272,8 @@ export function advertiseSlimTools(server) {
|
|
|
216
272
|
const answer = await list(request, extra);
|
|
217
273
|
return { ...answer, tools: advertisedTools(answer.tools) };
|
|
218
274
|
});
|
|
275
|
+
// Every tool is registered by now, so one server's list never changes: built once, on the first read.
|
|
276
|
+
let full;
|
|
277
|
+
return () => (full ??= list({ method: "tools/list", params: {} }, {}).then(answer => answer.tools));
|
|
219
278
|
}
|
|
220
279
|
//# sourceMappingURL=advertised-schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"advertised-schema.js","sourceRoot":"","sources":["../src/advertised-schema.ts"],"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,CAAC,CAAC;AACtG,CAAC"}
|
package/dist/format.d.ts
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
|
+
import { RUN_WAIT_MAX_SECONDS, type Skill } from "@clipwright/core";
|
|
1
2
|
import type { WorkflowRunRead, WorkflowLaunchRead } from '@clipwright/core/workflows';
|
|
2
|
-
/** The longest a `get_run` holds its answer
|
|
3
|
-
export
|
|
4
|
-
/** A waiting `get_run` reads the run this often. */
|
|
5
|
-
export declare const RUN_WAIT_STEP_MS = 3000;
|
|
3
|
+
/** The longest a `get_run` holds its answer; the API holds it (#1036). */
|
|
4
|
+
export { RUN_WAIT_MAX_SECONDS };
|
|
6
5
|
/** When an agent that cannot hold the read reads an unfinished run again. */
|
|
7
6
|
export declare const RUN_RETRY_AFTER_SECONDS = 5;
|
|
8
|
-
/** Reads the run until it is terminal, the wait ends or the caller leaves. */
|
|
9
|
-
export declare function waitForRun(read: () => Promise<WorkflowRunRead>, waitSeconds: number, signal?: AbortSignal): Promise<WorkflowRunRead>;
|
|
10
7
|
/** MCP tool response: content blocks. The index signature matches the SDK's */
|
|
11
8
|
/** `CallToolResult`; without it the handler does not type-check. */
|
|
12
9
|
export interface McpToolResponse {
|
|
@@ -22,6 +19,11 @@ export declare function formatFailure(error: unknown): McpToolResponse;
|
|
|
22
19
|
/** Tool body with API refusals expanded for the agent; shared by every tool so */
|
|
23
20
|
/** no tool can forget the `try`. */
|
|
24
21
|
export declare function withFailureReport(body: () => Promise<McpToolResponse>): Promise<McpToolResponse>;
|
|
22
|
+
/** What each run kind delivers and where a succeeded read names it: a picture's run is never "the video". */
|
|
23
|
+
export declare const PENDING_RESULTS: Readonly<Record<Skill, {
|
|
24
|
+
noun: string;
|
|
25
|
+
field: string;
|
|
26
|
+
}>>;
|
|
25
27
|
/** Pure `get_run` formatter. Terminal answers carry both `status` and `state`; */
|
|
26
28
|
/** an unknown terminal state falls into IN_PROGRESS by design. */
|
|
27
29
|
export declare function formatGetRun(run: WorkflowRunRead, receipt?: WorkflowLaunchRead['receipt']): McpToolResponse;
|
package/dist/format.js
CHANGED
|
@@ -1,36 +1,10 @@
|
|
|
1
|
-
import { FAILED_STATE, isTerminal, runMoney, VIDEO_URL_CHECK } from "@clipwright/core";
|
|
1
|
+
import { FAILED_STATE, isTerminal, RUN_WAIT_MAX_SECONDS, runMoney, VIDEO_URL_CHECK } from "@clipwright/core";
|
|
2
2
|
import { ClipwrightApiError } from "@clipwright/sdk";
|
|
3
3
|
import { RUN_DISPLAY_HINT, terminalRunMarkdown } from "./run-display.js";
|
|
4
|
-
/** The longest a `get_run` holds its answer
|
|
5
|
-
export
|
|
6
|
-
/** A waiting `get_run` reads the run this often. */
|
|
7
|
-
export const RUN_WAIT_STEP_MS = 3000;
|
|
4
|
+
/** The longest a `get_run` holds its answer; the API holds it (#1036). */
|
|
5
|
+
export { RUN_WAIT_MAX_SECONDS };
|
|
8
6
|
/** When an agent that cannot hold the read reads an unfinished run again. */
|
|
9
7
|
export const RUN_RETRY_AFTER_SECONDS = 5;
|
|
10
|
-
/** Reads the run until it is terminal, the wait ends or the caller leaves. */
|
|
11
|
-
export async function waitForRun(read, waitSeconds, signal) {
|
|
12
|
-
const until = Date.now() + waitSeconds * 1000;
|
|
13
|
-
let run = await read();
|
|
14
|
-
while (!isTerminal(run.state) && Date.now() < until && !signal?.aborted) {
|
|
15
|
-
await pause(Math.min(RUN_WAIT_STEP_MS, until - Date.now()), signal);
|
|
16
|
-
if (signal?.aborted)
|
|
17
|
-
break;
|
|
18
|
-
run = await read();
|
|
19
|
-
}
|
|
20
|
-
return run;
|
|
21
|
-
}
|
|
22
|
-
/** A sleep that ends early when the caller leaves. */
|
|
23
|
-
function pause(ms, signal) {
|
|
24
|
-
return new Promise((resolve) => {
|
|
25
|
-
const done = () => {
|
|
26
|
-
clearTimeout(timer);
|
|
27
|
-
signal?.removeEventListener("abort", done);
|
|
28
|
-
resolve();
|
|
29
|
-
};
|
|
30
|
-
const timer = setTimeout(done, ms);
|
|
31
|
-
signal?.addEventListener("abort", done, { once: true });
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
8
|
/** An API refusal expanded for the agent: `retryable`, `next_action` and numbers */
|
|
35
9
|
/** as fields. Local errors rethrow, since they carry no server answer. */
|
|
36
10
|
export function formatFailure(error) {
|
|
@@ -51,6 +25,16 @@ export async function withFailureReport(body) {
|
|
|
51
25
|
return formatFailure(error);
|
|
52
26
|
}
|
|
53
27
|
}
|
|
28
|
+
/** What each run kind delivers and where a succeeded read names it: a picture's run is never "the video". */
|
|
29
|
+
export const PENDING_RESULTS = {
|
|
30
|
+
make_ugc: { noun: "video", field: "video_url" },
|
|
31
|
+
make_faceless: { noun: "video", field: "video_url" },
|
|
32
|
+
revise_long_form: { noun: "video", field: "video_url" },
|
|
33
|
+
generate_image: { noun: "image", field: "generation.url" },
|
|
34
|
+
generate_video: { noun: "clip", field: "generation.url" },
|
|
35
|
+
edit_shot: { noun: "shot candidate", field: "candidate" },
|
|
36
|
+
create_actor: { noun: "actor", field: "created_actor.actor_id" },
|
|
37
|
+
};
|
|
54
38
|
/** Pure `get_run` formatter. Terminal answers carry both `status` and `state`; */
|
|
55
39
|
/** an unknown terminal state falls into IN_PROGRESS by design. */
|
|
56
40
|
export function formatGetRun(run, receipt) {
|
|
@@ -111,7 +95,8 @@ export function formatGetRun(run, receipt) {
|
|
|
111
95
|
],
|
|
112
96
|
};
|
|
113
97
|
}
|
|
114
|
-
// Non-terminal (or unknown terminal) state: the same imperative format
|
|
98
|
+
// Non-terminal (or unknown terminal) state: the same imperative format for every run, naming what this run delivers (#1172).
|
|
99
|
+
const pending = PENDING_RESULTS[run.skill] ?? { noun: "result", field: "a succeeded state" };
|
|
115
100
|
return {
|
|
116
101
|
content: [
|
|
117
102
|
{
|
|
@@ -122,12 +107,12 @@ export function formatGetRun(run, receipt) {
|
|
|
122
107
|
run_id: run.run_id,
|
|
123
108
|
state: run.state,
|
|
124
109
|
...runMoney(run),
|
|
125
|
-
video_url: null,
|
|
110
|
+
...(pending.field === "video_url" ? { video_url: null } : {}),
|
|
126
111
|
warnings: run.warnings,
|
|
127
|
-
next_action:
|
|
112
|
+
next_action: `The ${pending.noun} is NOT ready. Call get_run with poll.arguments (run_id=` +
|
|
128
113
|
run.run_id +
|
|
129
114
|
`, wait_seconds=${RUN_WAIT_MAX_SECONDS}): it waits up to ${RUN_WAIT_MAX_SECONDS} s for the run to end. Repeat until state is 'succeeded' or 'failed'. ` +
|
|
130
|
-
|
|
115
|
+
`Do NOT tell the user the ${pending.noun} is done until you have ${pending.field}.`,
|
|
131
116
|
poll: { tool: "get_run", arguments: { run_id: run.run_id, wait_seconds: RUN_WAIT_MAX_SECONDS }, retry_after_seconds: RUN_RETRY_AFTER_SECONDS },
|
|
132
117
|
}),
|
|
133
118
|
},
|
package/dist/format.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.js","sourceRoot":"","sources":["../src/format.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"format.js","sourceRoot":"","sources":["../src/format.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,oBAAoB,EAAE,QAAQ,EAAE,eAAe,EAAc,MAAM,kBAAkB,CAAC;AAEzH,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAErD,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEzE,0EAA0E;AAC1E,OAAO,EAAE,oBAAoB,EAAE,CAAC;AAChC,6EAA6E;AAC7E,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC;AASzC,oFAAoF;AACpF,0EAA0E;AAC1E,MAAM,UAAU,aAAa,CAAC,KAAc;IAC1C,IAAI,CAAC,CAAC,KAAK,YAAY,kBAAkB,CAAC;QAAE,MAAM,KAAK,CAAC;IACxD,OAAO;QACL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ONS: Record<string, string>;
|
|
3
|
+
/** A top field's text in tools/list; a field not named keeps its first words. */
|
|
4
|
+
export declare const LISTED_FIELDS: Record<string, Record<string, string>>;
|