freebeat-mcp 0.3.0 → 0.4.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/CHANGELOG.md +22 -0
- package/README.md +32 -6
- package/dist/capabilities/agents/tools/generate-agent-videos.js +10 -9
- package/dist/capabilities/agents/tools/generate-agent-videos.js.map +1 -1
- package/dist/capabilities/credits/register.d.ts +3 -0
- package/dist/capabilities/credits/register.js +41 -0
- package/dist/capabilities/credits/register.js.map +1 -0
- package/dist/capabilities/effects/tools/generate-effect.js +7 -2
- package/dist/capabilities/effects/tools/generate-effect.js.map +1 -1
- package/dist/capabilities/media/tools/edit-image.js +8 -19
- package/dist/capabilities/media/tools/edit-image.js.map +1 -1
- package/dist/capabilities/media/tools/generate-image.js +8 -18
- package/dist/capabilities/media/tools/generate-image.js.map +1 -1
- package/dist/capabilities/media/tools/generate-text.js +6 -1
- package/dist/capabilities/media/tools/generate-text.js.map +1 -1
- package/dist/capabilities/media/tools/generate-video.js +8 -21
- package/dist/capabilities/media/tools/generate-video.js.map +1 -1
- package/dist/capabilities/media/tools/shared.d.ts +18 -2
- package/dist/capabilities/media/tools/shared.js +3 -0
- package/dist/capabilities/media/tools/shared.js.map +1 -1
- package/dist/capabilities/music/tools/generate-music.js +7 -2
- package/dist/capabilities/music/tools/generate-music.js.map +1 -1
- package/dist/capabilities/music/tools/list-music-models.js +6 -3
- package/dist/capabilities/music/tools/list-music-models.js.map +1 -1
- package/dist/capabilities/performance/tools/generate-lip-sync-video.js +7 -2
- package/dist/capabilities/performance/tools/generate-lip-sync-video.js.map +1 -1
- package/dist/capabilities/performance/tools/generate-singing-video.js +7 -2
- package/dist/capabilities/performance/tools/generate-singing-video.js.map +1 -1
- package/dist/capabilities/tasks/tools/get-task-result.js +11 -4
- package/dist/capabilities/tasks/tools/get-task-result.js.map +1 -1
- package/dist/capabilities/tasks/tools/get-task-status.js +5 -0
- package/dist/capabilities/tasks/tools/get-task-status.js.map +1 -1
- package/dist/core/credit-approval.d.ts +26 -0
- package/dist/core/credit-approval.js +28 -0
- package/dist/core/credit-approval.js.map +1 -0
- package/dist/core/paid-tools.d.ts +11 -0
- package/dist/core/paid-tools.js +6 -0
- package/dist/core/paid-tools.js.map +1 -0
- package/dist/core/response.js +8 -3
- package/dist/core/response.js.map +1 -1
- package/dist/core/tool-annotations.d.ts +1 -1
- package/dist/core/tool-annotations.js +2 -1
- package/dist/core/tool-annotations.js.map +1 -1
- package/dist/server.js +5 -3
- package/dist/server.js.map +1 -1
- package/dist/services/freebeat-api.d.ts +214 -80
- package/dist/services/freebeat-api.js +257 -127
- package/dist/services/freebeat-api.js.map +1 -1
- package/dist/services/generation-requests.d.ts +26 -0
- package/dist/services/generation-requests.js +86 -0
- package/dist/services/generation-requests.js.map +1 -0
- package/dist/services/media-validation.d.ts +1 -0
- package/dist/services/media-validation.js +221 -0
- package/dist/services/media-validation.js.map +1 -0
- package/dist/services/pricing.d.ts +14 -0
- package/dist/services/pricing.js +277 -0
- package/dist/services/pricing.js.map +1 -0
- package/dist/services/remote-media.d.ts +0 -1
- package/dist/services/remote-media.js +22 -52
- package/dist/services/remote-media.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,28 @@ The format is based on Keep a Changelog, and this project follows Semantic Versi
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.4.0] - 2026-10-26
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
- Optional `max_credits` on every paid tool, checked against the current quote before submission; refused calls return the quote and reason, and submitted calls report their quote separately from actual charges.
|
|
13
|
+
- Read-only `get_credit_balance` and `quote_generation` tools, covering every paid tool with a current list-price quote or an explicit unavailable result.
|
|
14
|
+
- Backend price-rule evaluation for fixed, duration, combination, formula and branch rules without executing backend scripts as code.
|
|
15
|
+
- Actual credit charges on task results when reported by Freebeat; missing charges remain explicitly unknown.
|
|
16
|
+
|
|
17
|
+
### Fixed
|
|
18
|
+
- Remote uploads require an accepted declared Content-Type and a matching leading-byte signature. Only Freebeat media hosts `static.freebeat.ai` and `static.freebeatfit.com` may serve `application/octet-stream`; third-party links must serve a proper media type or use the generated-song `music_id` handoff.
|
|
19
|
+
- Removed deep audio/video container parsing, its concurrency limiter, the media worker, and unused `mediabunny`, `jpeg-js` and `pngjs` dependencies. PNG/JPEG structural checks and image size/dimension limits remain, without pixel decoding; internal validation failures stay distinct from invalid files.
|
|
20
|
+
- Server version metadata uses a static JSON import so webpack standalone output no longer reads the original build directory. Node support is `^18.20.0 || >=20.10.0` for JSON import attributes.
|
|
21
|
+
- Quotes and submissions share normalized media/music/lip-sync requests; reference-image counts come from the submitted inputs. Missing price-rule variables now return unavailable instead of selecting a cheaper branch.
|
|
22
|
+
- Lip-sync status parsing no longer requires unrelated display metadata; unreadable task responses report unknown state and a viewing link. Lip-sync generation uses the backend's configured default model.
|
|
23
|
+
- Generated music results can feed the three song-driven video tools directly, with automatic audio preparation.
|
|
24
|
+
- All three agent tools relay the agent's own pause reason and next step with structured credit notices.
|
|
25
|
+
- Music capabilities and submission prices come from current catalog/rule data instead of model-ID lists and stale prices. Missing length control is explained before generation.
|
|
26
|
+
- Backend errors use user-facing recovery guidance instead of exposing account identifiers or backend fields.
|
|
27
|
+
|
|
28
|
+
### Changed
|
|
29
|
+
- Write tools set `openWorldHint: true`: they send prompts and media to third-party model providers and accept arbitrary URLs, which OpenAI's tool scan flagged.
|
|
30
|
+
|
|
9
31
|
## [0.3.0] - 2026-10-23
|
|
10
32
|
|
|
11
33
|
### Changed
|
package/README.md
CHANGED
|
@@ -83,7 +83,23 @@ This package depends on Freebeat online services. Available source platforms, ef
|
|
|
83
83
|
|
|
84
84
|
## Tools
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
22 tools are available with full scopes.
|
|
87
|
+
|
|
88
|
+
### `get_credit_balance` and `quote_generation`
|
|
89
|
+
|
|
90
|
+
Read the current credit balance with `get_credit_balance`. Before any paid call, use
|
|
91
|
+
`quote_generation` with `tool` and `parameters` containing the planned generation
|
|
92
|
+
inputs. It evaluates Freebeat's current pricing rules and returns `status: quoted`
|
|
93
|
+
with `credits`, or `status: unavailable` with a reason. Quotes are list prices before
|
|
94
|
+
account discounts or allowances and never charge credits. Missing or unsupported
|
|
95
|
+
rules are not treated as free. Text, effects, singing, and multi-stage agents do not
|
|
96
|
+
currently expose a complete upfront quote through their service contracts.
|
|
97
|
+
|
|
98
|
+
Set `max_credits` on every paid tool to the numeric quote or ceiling the user approved. If the current price is higher or unavailable, the tool does not submit and returns `quote` and a reason. Never remove or raise an approved ceiling to bypass this refusal. Without a ceiling, existing submission behavior remains and the result includes the current `quote`; a quote is not an actual charge.
|
|
99
|
+
|
|
100
|
+
Finished tasks expose `used_credits` when Freebeat reports an actual charge. Otherwise
|
|
101
|
+
they explicitly state that the charge was not reported; token usage, estimates,
|
|
102
|
+
and a next-step credit requirement are not actual charges.
|
|
87
103
|
|
|
88
104
|
### `upload_audio`
|
|
89
105
|
|
|
@@ -126,17 +142,27 @@ Upload one MP4, MOV, or WebM clip and receive a `video_url` for
|
|
|
126
142
|
|
|
127
143
|
Hosted HTTP mode never reads caller-provided local file paths. Attachment and
|
|
128
144
|
URL downloads require HTTPS, reject private or reserved network addresses and
|
|
129
|
-
redirects,
|
|
130
|
-
files that are removed after upload.
|
|
145
|
+
redirects, identify allowed media types from the file bytes, and stream to size-limited temporary
|
|
146
|
+
files that are removed after upload. Remote uploads require a declared Content-Type accepted by the upload tool and a matching file signature. Only the exact Freebeat media hosts `static.freebeat.ai` and `static.freebeatfit.com` may serve `application/octet-stream`; their bytes must still match an accepted media type. Audio/video checks read only the first 16 bytes, without parsing tracks or packets; MP4/MOV must also have data beyond the leading ftyp box. PNG/JPEG structure and dimensions are checked without decoding pixels: PNG chunk CRCs and required chunks, or JPEG frame/scan/end markers, with a 10 MiB encoded-file and 16-million-pixel limit. Image scans yield every 64 KiB of work and check a cooperative 5-second deadline. Internal failures return a separate temporary validation error. These checks do not prove full playback or pixel integrity; downstream services decode the media. For Freebeat-generated songs, pass the `music_id` from `get_task_result` directly to video tools.
|
|
131
147
|
|
|
132
148
|
### `list_music_models`
|
|
133
149
|
|
|
134
|
-
List music-generation models and
|
|
150
|
+
List music-generation models, published input capabilities and current pricing before
|
|
151
|
+
calling `generate_music`. Unknown capabilities are `null`, not guessed from model IDs.
|
|
152
|
+
When length control is not offered, a prompt cannot guarantee the song's duration.
|
|
153
|
+
Use `quote_generation` with the prompt and other planned inputs for a specific quote.
|
|
135
154
|
|
|
136
155
|
### `generate_music`
|
|
137
156
|
|
|
138
157
|
Generate original audio from a `model_id` and `prompt`, with optional lyrics, instrumental mode, and duration when supported by the model. Poll `get_task_status`, then call `get_task_result` after completion. This does not turn an existing song into a video.
|
|
139
158
|
|
|
159
|
+
Pass the completed `result.music_id` (a reference such as `music:123`) straight into
|
|
160
|
+
`generate_music_video`, `generate_dance_video`, or `generate_lyric_video`. The video
|
|
161
|
+
call resolves and prepares your generated song automatically. If audio analysis is
|
|
162
|
+
still running, retry after it finishes; no download or manual re-upload is required.
|
|
163
|
+
Music submissions require a current price rule; stale catalog credit amounts are
|
|
164
|
+
never sent as the price.
|
|
165
|
+
|
|
140
166
|
### `generate_singing_video`
|
|
141
167
|
|
|
142
168
|
Make a photo, pet, or duet sing a track as a short performance. Provide `mode`, `image_urls`, `duration_seconds`, and exactly one of `music_id` or `audio_url`. Poll `get_task_status`, then call `get_task_result` after completion.
|
|
@@ -208,7 +234,7 @@ All three tools use the existing agents in Auto mode, usually take 15–60 minut
|
|
|
208
234
|
|
|
209
235
|
Parameters:
|
|
210
236
|
|
|
211
|
-
- `music_id` required, from `upload_audio`
|
|
237
|
+
- `music_id` required, from `upload_audio` or a completed `generate_music` result
|
|
212
238
|
- `prompt` optional creative direction
|
|
213
239
|
- `start_ms` / `end_ms` optional song window, default the first 15 seconds, or up to the song's end if shorter; the selected window must fit the song and account limits
|
|
214
240
|
- `aspect_ratio` optional, default `16:9`
|
|
@@ -257,7 +283,7 @@ Ask any text model from `list_models(type=text)` and get its reply. Parameters:
|
|
|
257
283
|
|
|
258
284
|
Poll a Freebeat async task or Open RPC batch until it reaches a terminal status. Current MCP endpoints return lowercase status values such as `pending`, `completed`, and `failed`; older backends may still return uppercase variants.
|
|
259
285
|
|
|
260
|
-
For agent videos, effects, music, singing, and lip-sync tasks, continue polling while the status is still in progress. Agent videos may also report `action_required` with a `session_url` for
|
|
286
|
+
For agent videos, effects, music, singing, and lip-sync tasks, continue polling while the status is still in progress. Agent videos may also report `action_required` with their own last message, any structured credit notice, and a `session_url` for reviewing and continuing. Only call `get_task_result` after the status is `completed`. If a task response cannot be read, `get_task_status` reports `unknown` and a viewing link; this is not a generation failure and must not trigger another paid submission.
|
|
261
287
|
|
|
262
288
|
For Open RPC image/video batches, pass the returned `batch_id` as `task_id`. You can also pass `serial_no` to query a single batch item. Completed batch items include result URLs directly in `get_task_status`, so `get_task_result` is not used for Open RPC batches.
|
|
263
289
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { maxCreditsSchema, creditQuoteSchema } from "../../../core/credit-approval.js";
|
|
1
2
|
import { z } from "zod";
|
|
2
3
|
import { AGENT_PRODUCTS } from "../../../core/agent-products.js";
|
|
3
4
|
import { formatToolError, jsonContent } from "../../../core/response.js";
|
|
@@ -6,31 +7,29 @@ const AGENT_VIDEO_TOOLS = {
|
|
|
6
7
|
music_video: {
|
|
7
8
|
name: "generate_music_video",
|
|
8
9
|
title: "Generate music video",
|
|
9
|
-
description: "Use this for music video generation: the user wants a music video (MV) for a song. Freebeat's music video agent plans scenes and generates and edits a multi-scene video timed to the song; people or characters from optional photos can appear. Requires music_id from upload_audio; optional photos via upload_image. Starts a generation job that uses the user's existing Freebeat credits and usually takes 15–60 minutes; by default it uses the first 15 seconds of the song, or up to the song's end if shorter. Returns task_id and session_url; poll get_task_status every few minutes, call get_task_result after completed; on action_required relay the message and session_url. Do not use for dance videos, lyric videos, short singing-photo clips, lip-sync of an existing clip, standalone video clips without a song, or generating audio.",
|
|
10
|
+
description: "Use this for music video generation: the user wants a music video (MV) for a song. Freebeat's music video agent plans scenes and generates and edits a multi-scene video timed to the song; people or characters from optional photos can appear. Requires music_id from upload_audio or a completed generate_music result; optional photos via upload_image. Starts a generation job that uses the user's existing Freebeat credits and usually takes 15–60 minutes; by default it uses the first 15 seconds of the song, or up to the song's end if shorter. Returns task_id and session_url; poll get_task_status every few minutes, call get_task_result after completed; on action_required relay the message and session_url. Do not use for dance videos, lyric videos, short singing-photo clips, lip-sync of an existing clip, standalone video clips without a song, or generating audio.",
|
|
10
11
|
},
|
|
11
12
|
dance: {
|
|
12
13
|
name: "generate_dance_video",
|
|
13
14
|
title: "Generate dance video",
|
|
14
|
-
description: "Use this for dance video generation: the user wants dancers performing to a song. Freebeat's dance video agent plans and generates a dance video timed to the song; people in optional photos become the dancers. Supports vertical 9:16 and 3:4 formats. Requires music_id from upload_audio; optional photos via upload_image. Starts a generation job that uses the user's existing Freebeat credits and usually takes 15–60 minutes; by default it uses the first 15 seconds of the song, or up to the song's end if shorter. Returns task_id and session_url; poll get_task_status every few minutes, call get_task_result after completed; on action_required relay the message and session_url. Do not use for story-based music videos, lyric videos, short singing-photo clips, lip-sync of an existing clip, standalone video clips without a song, or generating audio.",
|
|
15
|
+
description: "Use this for dance video generation: the user wants dancers performing to a song. Freebeat's dance video agent plans and generates a dance video timed to the song; people in optional photos become the dancers. Supports vertical 9:16 and 3:4 formats. Requires music_id from upload_audio or a completed generate_music result; optional photos via upload_image. Starts a generation job that uses the user's existing Freebeat credits and usually takes 15–60 minutes; by default it uses the first 15 seconds of the song, or up to the song's end if shorter. Returns task_id and session_url; poll get_task_status every few minutes, call get_task_result after completed; on action_required relay the message and session_url. Do not use for story-based music videos, lyric videos, short singing-photo clips, lip-sync of an existing clip, standalone video clips without a song, or generating audio.",
|
|
15
16
|
},
|
|
16
17
|
lyric_video: {
|
|
17
18
|
name: "generate_lyric_video",
|
|
18
19
|
title: "Generate lyric video",
|
|
19
|
-
description: "Use this for lyric video generation: the user wants animated lyrics timed to the vocals of a song. Freebeat's lyric video agent plans, generates, and edits the lyric video. Requires music_id from upload_audio; optional reference photos via upload_image. Starts a generation job that uses the user's existing Freebeat credits and usually takes 15–60 minutes; by default it uses the first 15 seconds of the song, or up to the song's end if shorter. Returns task_id and session_url; poll get_task_status every few minutes, call get_task_result after completed; on action_required relay the message and session_url. Do not use for story-based music videos, dance videos, short singing-photo clips, lip-sync of an existing clip, standalone video clips without a song, or generating audio.",
|
|
20
|
+
description: "Use this for lyric video generation: the user wants animated lyrics timed to the vocals of a song. Freebeat's lyric video agent plans, generates, and edits the lyric video. Requires music_id from upload_audio or a completed generate_music result; optional reference photos via upload_image. Starts a generation job that uses the user's existing Freebeat credits and usually takes 15–60 minutes; by default it uses the first 15 seconds of the song, or up to the song's end if shorter. Returns task_id and session_url; poll get_task_status every few minutes, call get_task_result after completed; on action_required relay the message and session_url. Do not use for story-based music videos, dance videos, short singing-photo clips, lip-sync of an existing clip, standalone video clips without a song, or generating audio.",
|
|
20
21
|
},
|
|
21
22
|
};
|
|
22
23
|
export function registerGenerateAgentVideoTools(server, client) {
|
|
23
24
|
for (const product of Object.keys(AGENT_VIDEO_TOOLS)) {
|
|
24
25
|
const tool = AGENT_VIDEO_TOOLS[product];
|
|
25
26
|
server.registerTool(tool.name, {
|
|
26
|
-
description: tool.description
|
|
27
|
+
description: `Before spending credits, call quote_generation with this tool and its planned parameters, then tell the user the price or that it is unavailable. Set max_credits to the user-approved quote or ceiling. A higher or unknown price stops submission; never remove or raise the ceiling without approval. ${tool.description}`,
|
|
27
28
|
annotations: { title: tool.title, ...CREATE_TOOL_ANNOTATIONS },
|
|
28
29
|
inputSchema: {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
.
|
|
32
|
-
.positive()
|
|
33
|
-
.describe("An analyzed music_id from upload_audio."),
|
|
30
|
+
max_credits: maxCreditsSchema,
|
|
31
|
+
music_id: z.union([z.number().int().positive(), z.string().regex(/^music:.+/)])
|
|
32
|
+
.describe("An analyzed music_id from upload_audio, or result.music_id from a completed generate_music task. Generated songs are prepared automatically; no manual upload is needed."),
|
|
34
33
|
prompt: z
|
|
35
34
|
.string()
|
|
36
35
|
.trim()
|
|
@@ -70,6 +69,7 @@ export function registerGenerateAgentVideoTools(server, client) {
|
|
|
70
69
|
.describe("Remove the Freebeat watermark if the account allows it."),
|
|
71
70
|
},
|
|
72
71
|
outputSchema: {
|
|
72
|
+
quote: creditQuoteSchema.optional(),
|
|
73
73
|
success: z.literal(true),
|
|
74
74
|
task_id: z
|
|
75
75
|
.string()
|
|
@@ -86,6 +86,7 @@ export function registerGenerateAgentVideoTools(server, client) {
|
|
|
86
86
|
const result = await client.createAgentVideo({ ...params, product });
|
|
87
87
|
return jsonContent({
|
|
88
88
|
success: true,
|
|
89
|
+
quote: result.quote,
|
|
89
90
|
task_id: result.task_id,
|
|
90
91
|
task_type: result.task_type,
|
|
91
92
|
status: result.status,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-agent-videos.js","sourceRoot":"","sources":["../../../../src/capabilities/agents/tools/generate-agent-videos.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generate-agent-videos.js","sourceRoot":"","sources":["../../../../src/capabilities/agents/tools/generate-agent-videos.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAEvF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAqB,MAAM,iCAAiC,CAAC;AACpF,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAG5E,MAAM,iBAAiB,GAAG;IACxB,WAAW,EAAE;QACX,IAAI,EAAE,sBAAsB;QAC5B,KAAK,EAAE,sBA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qBACR,QAAQ,CAAC,kFAAkF,CAAC;gBAC/F,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,kBAAkB,CAAC;aACjD;SACF,EACD,KAAK,EAAE,MAAM,EAAE,EAAE;YACf,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,gBAAgB,CAAC,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;gBACrE,OAAO,WAAW,CAAC;oBACjB,OAAO,EAAE,IAAI;oBACb,KAAK,EAAE,MAAM,CAAC,KAAK;oBACnB,OAAO,EAAE,MAAM,CAAC,OAAO;oBACvB,SAAS,EAAE,MAAM,CAAC,SAAS;oBAC3B,MAAM,EAAE,MAAM,CAAC,MAAM;oBACrB,WAAW,EAAE,MAAM,CAAC,WAAW;oBAC/B,OAAO,EACL,mKAAmK;iBACtK,CAAC,CAAC;YACL,CAAC;YAAC,OAAO,KAAc,EAAE,CAAC;gBACxB,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC;YAChC,CAAC;QACH,CAAC,CACF,CAAC;IACJ,CAAC;AAEH,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { FreebeatApiClient } from "../../services/freebeat-api.js";
|
|
3
|
+
export declare function registerCreditTools(server: McpServer, client: Pick<FreebeatApiClient, "getCreditBalance" | "quoteGeneration">): void;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { PAID_TOOLS } from "../../core/paid-tools.js";
|
|
3
|
+
import { formatToolError, jsonContent } from "../../core/response.js";
|
|
4
|
+
import { READ_ONLY_TOOL_ANNOTATIONS } from "../../core/tool-annotations.js";
|
|
5
|
+
export function registerCreditTools(server, client) {
|
|
6
|
+
server.registerTool("get_credit_balance", {
|
|
7
|
+
description: "Read the signed-in Freebeat account's available credit balance. Does not charge credits or start generation.",
|
|
8
|
+
annotations: { title: "Get credit balance", ...READ_ONLY_TOOL_ANNOTATIONS },
|
|
9
|
+
inputSchema: {},
|
|
10
|
+
outputSchema: { credits: z.number().describe("Available Freebeat credits.") },
|
|
11
|
+
}, async () => {
|
|
12
|
+
try {
|
|
13
|
+
return jsonContent(await client.getCreditBalance());
|
|
14
|
+
}
|
|
15
|
+
catch (error) {
|
|
16
|
+
return formatToolError(error);
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
server.registerTool("quote_generation", {
|
|
20
|
+
description: "Call before any paid generation and tell the user the returned price or that it is unavailable. After user approval, pass the quoted credits as max_credits on the paid tool. If a ceiling was set, never omit or raise it to bypass a refusal. Supply the intended tool and its planned input parameters. Reads current Freebeat pricing rules, without starting or charging for generation. Quoted credits are list price before account discounts or allowances. Unavailable means unknown, never free; agent totals depend on stages and retries. For music, check list_music_models for length control before quoting.",
|
|
21
|
+
annotations: { title: "Quote generation", ...READ_ONLY_TOOL_ANNOTATIONS },
|
|
22
|
+
inputSchema: {
|
|
23
|
+
tool: z.enum(PAID_TOOLS).describe("The paid tool to quote."),
|
|
24
|
+
parameters: z.record(z.unknown()).describe("The same input parameters planned for the paid tool, including the model, prompt, duration, and other price-changing options."),
|
|
25
|
+
},
|
|
26
|
+
outputSchema: {
|
|
27
|
+
status: z.enum(["quoted", "unavailable"]),
|
|
28
|
+
credits: z.number().optional(),
|
|
29
|
+
source: z.string(),
|
|
30
|
+
message: z.string(),
|
|
31
|
+
},
|
|
32
|
+
}, async ({ tool, parameters }) => {
|
|
33
|
+
try {
|
|
34
|
+
return jsonContent(await client.quoteGeneration(tool, parameters));
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
return formatToolError(error);
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=register.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register.js","sourceRoot":"","sources":["../../../src/capabilities/credits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,EAAE,aAAa,CAAC,CAAC;YACzC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;YAC9B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;YAClB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;SACpB;KACF,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE;QAChC,IAAI,CAAC;YAAC,OAAO,WAAW,CAAC,MAAM,MAAM,CAAC,eAAe,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC;QAAC,CAAC;QAC3E,OAAO,KAAK,EAAE,CAAC;YAAC,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC;QAAC,CAAC;IAClD,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { maxCreditsSchema, creditQuoteSchema } from "../../../core/credit-approval.js";
|
|
1
2
|
import { z } from "zod";
|
|
2
3
|
import { AppError } from "../../../core/errors.js";
|
|
3
4
|
import { normalizeGenerationPrompt } from "../../../core/prompt.js";
|
|
@@ -5,9 +6,10 @@ import { formatToolError, jsonContent } from "../../../core/response.js";
|
|
|
5
6
|
import { CREATE_TOOL_ANNOTATIONS } from "../../../core/tool-annotations.js";
|
|
6
7
|
export function registerGenerateEffectTool(server, client) {
|
|
7
8
|
server.registerTool("generate_effect", {
|
|
8
|
-
description: "Use this when the user wants an effect-template video from a music_id and exactly one reference image URL. Flow: list_effects -> optional upload_audio -> optional upload_image -> generate_effect -> get_task_status -> get_task_result. By default, use list_effects.image_url. You can also use a single uploaded image URL from upload_image. Only call get_task_result after get_task_status returns completed. For song-driven music, dance, or lyric videos, use generate_music_video, generate_dance_video, or generate_lyric_video.",
|
|
9
|
+
description: "Before spending credits, call quote_generation with this tool and its planned parameters, then tell the user the price or that it is unavailable. Set max_credits to the user-approved quote or ceiling. A higher or unknown price stops submission; never remove or raise the ceiling without approval. Use this when the user wants an effect-template video from a music_id and exactly one reference image URL. Flow: list_effects -> optional upload_audio -> optional upload_image -> generate_effect -> get_task_status -> get_task_result. By default, use list_effects.image_url. You can also use a single uploaded image URL from upload_image. Only call get_task_result after get_task_status returns completed. For song-driven music, dance, or lyric videos, use generate_music_video, generate_dance_video, or generate_lyric_video.",
|
|
9
10
|
annotations: { title: "Generate effect", ...CREATE_TOOL_ANNOTATIONS },
|
|
10
11
|
outputSchema: {
|
|
12
|
+
quote: creditQuoteSchema.optional(),
|
|
11
13
|
success: z
|
|
12
14
|
.literal(true)
|
|
13
15
|
.describe("Whether the effect task was created successfully."),
|
|
@@ -25,6 +27,7 @@ export function registerGenerateEffectTool(server, client) {
|
|
|
25
27
|
.describe("A human-readable summary of the task creation result."),
|
|
26
28
|
},
|
|
27
29
|
inputSchema: {
|
|
30
|
+
max_credits: maxCreditsSchema,
|
|
28
31
|
effect_id: z.number().int().describe("Effect ID returned by list_effects."),
|
|
29
32
|
music_id: z
|
|
30
33
|
.number()
|
|
@@ -48,7 +51,7 @@ export function registerGenerateEffectTool(server, client) {
|
|
|
48
51
|
.length(1, "reference_image_urls must contain exactly one image URL")
|
|
49
52
|
.describe("Exactly one image URL. Recommended: use list_effects.image_url. You may also use a single uploaded image URL from upload_image."),
|
|
50
53
|
},
|
|
51
|
-
}, async ({ effect_id, music_id, prompt, watermark, reference_image_urls, }) => {
|
|
54
|
+
}, async ({ max_credits, effect_id, music_id, prompt, watermark, reference_image_urls, }) => {
|
|
52
55
|
try {
|
|
53
56
|
const normalizedPrompt = normalizeGenerationPrompt(prompt);
|
|
54
57
|
if (!Number.isInteger(effect_id)) {
|
|
@@ -61,6 +64,7 @@ export function registerGenerateEffectTool(server, client) {
|
|
|
61
64
|
return formatToolError(new AppError("reference_image_urls must contain exactly one image URL", "INVALID_PARAMS"));
|
|
62
65
|
}
|
|
63
66
|
const result = await client.generateEffect({
|
|
67
|
+
max_credits,
|
|
64
68
|
effect_id,
|
|
65
69
|
music_id,
|
|
66
70
|
prompt: normalizedPrompt,
|
|
@@ -69,6 +73,7 @@ export function registerGenerateEffectTool(server, client) {
|
|
|
69
73
|
});
|
|
70
74
|
return jsonContent({
|
|
71
75
|
success: true,
|
|
76
|
+
quote: result.quote,
|
|
72
77
|
task_id: result.task_id,
|
|
73
78
|
task_type: result.task_type,
|
|
74
79
|
status: result.status,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-effect.js","sourceRoot":"","sources":["../../../../src/capabilities/effects/tools/generate-effect.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generate-effect.js","sourceRoot":"","sources":["../../../../src/capabilities/effects/tools/generate-effect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAEvF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAG5E,MAAM,UAAU,0BAA0B,CACxC,MAAiB,EACjB,MAAiD;IAEjD,MAAM,CAAC,YAAY,CACjB,iBAAiB,EACjB;QACE,WAAW,EACT,uzBAAuzB;QACzzB,WAAW,EAAE,EAAE,KAAK,EAAE,iBAAiB,EAAE,GAAG,uBAAuB,EAAE;QACrE,YAAY,EAAE;YACZ,KAAK,EAAE,iBAAiB,CAAC,QAAQ,EAAE;YACnC,OAAO,EAAE,CAAC;iBACP,OAAO,CAAC,IAAI,CAAC;iBACb,QAAQ,CAAC,mDAAmD,CAAC;YAChE,OAAO,EAAE,CAAC;iBACP,MAAM,EAAE;iBACR,QAAQ,CAAC,yDAAyD,CAAC;YACtE,SAAS,EAAE,CAAC;iBACT,MAAM,EAAE;iBACR,QAAQ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BAAgB,CAAC,CAC/D,CAAC;YACJ,CAAC;YAED,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC;gBAChC,OAAO,eAAe,CACpB,IAAI,QAAQ,CAAC,6BAA6B,EAAE,gBAAgB,CAAC,CAC9D,CAAC;YACJ,CAAC;YAED,IAAI,oBAAoB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACtC,OAAO,eAAe,CACpB,IAAI,QAAQ,CACV,yDAAyD,EACzD,gBAAgB,CACjB,CACF,CAAC;YACJ,CAAC;YAED,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC;gBACzC,WAAW;gBACX,SAAS;gBACT,QAAQ;gBACR,MAAM,EAAE,gBAAgB;gBACxB,SAAS,EAAE,SAAS,IAAI,KAAK;gBAC7B,oBAAoB;aACrB,CAAC,CAAC;YAEH,OAAO,WAAW,CAAC;gBACjB,OAAO,EAAE,IAAI;gBACb,KAAK,EAAE,MAAM,CAAC,KAAK;gBACnB,OAAO,EAAE,MAAM,CAAC,OAAO;gBACvB,SAAS,EAAE,MAAM,CAAC,SAAS;gBAC3B,MAAM,EAAE,MAAM,CAAC,MAAM;gBACrB,OAAO,EAAE,+DAA+D,MAAM,CAAC,OAAO,oBAAoB;aAC3G,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACxB,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC;QAChC,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
+
import { maxCreditsSchema } from "../../../core/credit-approval.js";
|
|
1
2
|
import { z } from "zod";
|
|
2
|
-
import {
|
|
3
|
+
import { buildImageRequest } from "../../../services/generation-requests.js";
|
|
3
4
|
import { formatToolError, jsonContent } from "../../../core/response.js";
|
|
4
5
|
import { CREATE_TOOL_ANNOTATIONS } from "../../../core/tool-annotations.js";
|
|
5
6
|
import { imageOptionsSchema } from "./generate-image.js";
|
|
6
|
-
import {
|
|
7
|
+
import { batchCreateOutputSchema, normalizeBatchCreate } from "./shared.js";
|
|
7
8
|
export function registerEditImageTool(server, client) {
|
|
8
9
|
server.registerTool("edit_image", {
|
|
9
|
-
description: "Use this when the user wants to edit one existing image with a text instruction. Upload the image with upload_image first. Flow: list_models(type=image_edit) -> get_model_help -> edit_image -> get_task_status with the returned batch_id. For a new image without a source, use generate_image. For song-driven music, dance, or lyric videos, use generate_music_video, generate_dance_video, or generate_lyric_video.",
|
|
10
|
+
description: "Before spending credits, call quote_generation with this tool and its planned parameters, then tell the user the price or that it is unavailable. Set max_credits to the user-approved quote or ceiling. A higher or unknown price stops submission; never remove or raise the ceiling without approval. Use this when the user wants to edit one existing image with a text instruction. Upload the image with upload_image first. Flow: list_models(type=image_edit) -> get_model_help -> edit_image -> get_task_status with the returned batch_id. For a new image without a source, use generate_image. For song-driven music, dance, or lyric videos, use generate_music_video, generate_dance_video, or generate_lyric_video.",
|
|
10
11
|
annotations: { title: "Edit image", ...CREATE_TOOL_ANNOTATIONS },
|
|
11
12
|
outputSchema: batchCreateOutputSchema,
|
|
12
13
|
inputSchema: {
|
|
14
|
+
max_credits: maxCreditsSchema,
|
|
13
15
|
model_id: z.number().int().positive().describe("model_id from list_models(type=image_edit)."),
|
|
14
16
|
image: z.string().url().describe("Image URL to edit, usually from upload_image."),
|
|
15
17
|
prompt: z
|
|
@@ -20,24 +22,11 @@ export function registerEditImageTool(server, client) {
|
|
|
20
22
|
.describe("Image edit prompt."),
|
|
21
23
|
...imageOptionsSchema,
|
|
22
24
|
},
|
|
23
|
-
}, async (
|
|
25
|
+
}, async (params) => {
|
|
24
26
|
try {
|
|
25
27
|
const response = await client.createImageBatch({
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
businessType: MODEL_BUSINESS_TYPES.image_edit,
|
|
29
|
-
modelId: String(model_id),
|
|
30
|
-
generationType: 8,
|
|
31
|
-
prompt: normalizeGenerationPrompt(prompt),
|
|
32
|
-
images: [image],
|
|
33
|
-
size,
|
|
34
|
-
resolution,
|
|
35
|
-
customResolution: custom_resolution ? 1 : undefined,
|
|
36
|
-
quality,
|
|
37
|
-
outputFormat: output_format,
|
|
38
|
-
count,
|
|
39
|
-
},
|
|
40
|
-
],
|
|
28
|
+
max_credits: params.max_credits,
|
|
29
|
+
items: [buildImageRequest(params, true)],
|
|
41
30
|
});
|
|
42
31
|
return jsonContent(normalizeBatchCreate(response, "Image edit"));
|
|
43
32
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edit-image.js","sourceRoot":"","sources":["../../../../src/capabilities/media/tools/edit-image.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"edit-image.js","sourceRoot":"","sources":["../../../../src/capabilities/media/tools/edit-image.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAE5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAE5E,MAAM,UAAU,qBAAqB,CACnC,MAAiB,EACjB,MAAmD;IAEnD,MAAM,CAAC,YAAY,CACjB,YAAY,EACZ;QACE,WAAW,EACT,qsBAAqsB;QACvsB,WAAW,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,uBAAuB,EAAE;QAChE,YAAY,EAAE,uBAAuB;QACrC,WAAW,EAAE;YACX,WAAW,EAAE,gBAAgB;YAC7B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,6CAA6C,CAAC;YAC7F,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,+CAA+C,CAAC;YACjF,MAAM,EAAE,CAAC;iBACN,MAAM,EAAE;iBACR,IAAI,EAAE;iBACN,GAAG,CAAC,CAAC,EAAE,6CAA6C,CAAC;iBACrD,GAAG,CAAC,IAAI,EAAE,uDAAuD,CAAC;iBAClE,QAAQ,CAAC,oBAAoB,CAAC;YACjC,GAAG,kBAAkB;SACtB;KACF,EACD,KAAK,EAAE,MAAM,EAAE,EAAE;QACf,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,gBAAgB,CAAC;gBAC7C,WAAW,EAAE,MAAM,CAAC,WAAW;gBAC/B,KAAK,EAAE,CAAC,iBAAiB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;aACzC,CAAC,CAAC;YAEH,OAAO,WAAW,CAAC,oBAAoB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC;QACnE,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACxB,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC;QAChC,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { maxCreditsSchema } from "../../../core/credit-approval.js";
|
|
1
2
|
import { z } from "zod";
|
|
2
|
-
import {
|
|
3
|
+
import { buildImageRequest } from "../../../services/generation-requests.js";
|
|
3
4
|
import { formatToolError, jsonContent } from "../../../core/response.js";
|
|
4
5
|
import { CREATE_TOOL_ANNOTATIONS } from "../../../core/tool-annotations.js";
|
|
5
|
-
import {
|
|
6
|
+
import { batchCreateOutputSchema, normalizeBatchCreate } from "./shared.js";
|
|
6
7
|
export const imageOptionsSchema = {
|
|
7
8
|
size: z.string().optional().describe("Image size or aspect ratio when the model supports it, for example 1024x1024 or 16:9."),
|
|
8
9
|
resolution: z.string().optional().describe("Image resolution when the model supports it."),
|
|
@@ -17,10 +18,11 @@ export const imageOptionsSchema = {
|
|
|
17
18
|
};
|
|
18
19
|
export function registerGenerateImageTool(server, client) {
|
|
19
20
|
server.registerTool("generate_image", {
|
|
20
|
-
description: "Use this when the user wants new still images from a text prompt. Flow: list_models(type=image) -> get_model_help -> generate_image -> get_task_status with the returned batch_id. For changes to an existing image, use edit_image. For song-driven music, dance, or lyric videos, use generate_music_video, generate_dance_video, or generate_lyric_video.",
|
|
21
|
+
description: "Before spending credits, call quote_generation with this tool and its planned parameters, then tell the user the price or that it is unavailable. Set max_credits to the user-approved quote or ceiling. A higher or unknown price stops submission; never remove or raise the ceiling without approval. Use this when the user wants new still images from a text prompt. Flow: list_models(type=image) -> get_model_help -> generate_image -> get_task_status with the returned batch_id. For changes to an existing image, use edit_image. For song-driven music, dance, or lyric videos, use generate_music_video, generate_dance_video, or generate_lyric_video.",
|
|
21
22
|
annotations: { title: "Generate image", ...CREATE_TOOL_ANNOTATIONS },
|
|
22
23
|
outputSchema: batchCreateOutputSchema,
|
|
23
24
|
inputSchema: {
|
|
25
|
+
max_credits: maxCreditsSchema,
|
|
24
26
|
model_id: z.number().int().positive().describe("model_id from list_models(type=image)."),
|
|
25
27
|
prompt: z
|
|
26
28
|
.string()
|
|
@@ -30,23 +32,11 @@ export function registerGenerateImageTool(server, client) {
|
|
|
30
32
|
.describe("Image generation prompt."),
|
|
31
33
|
...imageOptionsSchema,
|
|
32
34
|
},
|
|
33
|
-
}, async (
|
|
35
|
+
}, async (params) => {
|
|
34
36
|
try {
|
|
35
37
|
const response = await client.createImageBatch({
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
businessType: MODEL_BUSINESS_TYPES.image,
|
|
39
|
-
modelId: String(model_id),
|
|
40
|
-
generationType: 6,
|
|
41
|
-
prompt: normalizeGenerationPrompt(prompt),
|
|
42
|
-
size,
|
|
43
|
-
resolution,
|
|
44
|
-
customResolution: custom_resolution ? 1 : undefined,
|
|
45
|
-
quality,
|
|
46
|
-
outputFormat: output_format,
|
|
47
|
-
count,
|
|
48
|
-
},
|
|
49
|
-
],
|
|
38
|
+
max_credits: params.max_credits,
|
|
39
|
+
items: [buildImageRequest(params)],
|
|
50
40
|
});
|
|
51
41
|
return jsonContent(normalizeBatchCreate(response, "Image generation"));
|
|
52
42
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-image.js","sourceRoot":"","sources":["../../../../src/capabilities/media/tools/generate-image.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generate-image.js","sourceRoot":"","sources":["../../../../src/capabilities/media/tools/generate-image.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAE5E,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAE5E,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,uFAAuF,CAAC;IAC7H,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,8CAA8C,CAAC;IAC1F,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,0EAA0E,CAAC;IACnH,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,oEAAoE,CAAC;IACnH,iBAAiB,EAAE,CAAC;SACjB,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,KAAK,CAAC,CAAC;QAChC,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
import { maxCreditsSchema, creditQuoteSchema } from "../../../core/credit-approval.js";
|
|
1
2
|
import { z } from "zod";
|
|
2
3
|
import { formatToolError, jsonContent } from "../../../core/response.js";
|
|
3
4
|
import { CREATE_TOOL_ANNOTATIONS } from "../../../core/tool-annotations.js";
|
|
4
5
|
export function registerGenerateTextTool(server, client) {
|
|
5
6
|
server.registerTool("generate_text", {
|
|
6
|
-
description: "Use this when the user wants a reply from a selected Freebeat text model, discovered with list_models(type=text). Usage is billed to the user's existing Freebeat credits. Returns text, not media. For song-driven music, dance, or lyric videos, use generate_music_video, generate_dance_video, or generate_lyric_video.",
|
|
7
|
+
description: "Before spending credits, call quote_generation with this tool and its planned parameters, then tell the user the price or that it is unavailable. Set max_credits to the user-approved quote or ceiling. A higher or unknown price stops submission; never remove or raise the ceiling without approval. Use this when the user wants a reply from a selected Freebeat text model, discovered with list_models(type=text). Usage is billed to the user's existing Freebeat credits. Returns text, not media. For song-driven music, dance, or lyric videos, use generate_music_video, generate_dance_video, or generate_lyric_video.",
|
|
7
8
|
annotations: { title: "Generate text", ...CREATE_TOOL_ANNOTATIONS },
|
|
8
9
|
inputSchema: {
|
|
10
|
+
max_credits: maxCreditsSchema,
|
|
9
11
|
model: z.string().min(1).describe("Model name from list_models(type=text)."),
|
|
10
12
|
messages: z
|
|
11
13
|
.array(z.object({
|
|
@@ -18,11 +20,14 @@ export function registerGenerateTextTool(server, client) {
|
|
|
18
20
|
temperature: z.number().min(0).max(2).optional().describe("Sampling temperature."),
|
|
19
21
|
},
|
|
20
22
|
outputSchema: {
|
|
23
|
+
quote: creditQuoteSchema.optional(),
|
|
21
24
|
success: z.literal(true),
|
|
22
25
|
model: z.string().describe("The model that answered."),
|
|
23
26
|
text: z.string().describe("The model's reply."),
|
|
24
27
|
finish_reason: z.string().optional(),
|
|
25
28
|
usage: z.record(z.unknown()).optional().describe("Token usage reported by the model."),
|
|
29
|
+
used_credits: z.number().optional(),
|
|
30
|
+
billing_message: z.string().optional(),
|
|
26
31
|
},
|
|
27
32
|
}, async (params) => {
|
|
28
33
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-text.js","sourceRoot":"","sources":["../../../../src/capabilities/media/tools/generate-text.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generate-text.js","sourceRoot":"","sources":["../../../../src/capabilities/media/tools/generate-text.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAEvF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAG5E,MAAM,UAAU,wBAAwB,CACtC,MAAiB,EACjB,MAA+C;IAE/C,MAAM,CAAC,YAAY,CACjB,eAAe,EACf;QACE,WAAW,EACT,smBAAsmB;QACxmB,WAAW,EAAE,EAAE,KAAK,EAAE,eAAe,EAAE,GAAG,uBAAuB,EAAE;QACnE,WAAW,EAAE;YACX,WAAW,EAAE,gBAAgB;YAC7B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,yCAAyC,CAAC;YAC5E,QAAQ,EAAE,CAAC;iBACR,KAAK,CACJ,CAAC,CAAC,MAAM,CAAC;gBACP,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;gBAC7C,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;aAC3B,CAAC,CACH;iBACA,GAAG,CAAC,CAAC,CAAC;iBACN,QAAQ,CAAC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AAC"}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
+
import { maxCreditsSchema } from "../../../core/credit-approval.js";
|
|
1
2
|
import { z } from "zod";
|
|
2
|
-
import {
|
|
3
|
+
import { buildVideoRequest } from "../../../services/generation-requests.js";
|
|
3
4
|
import { formatToolError, jsonContent } from "../../../core/response.js";
|
|
4
5
|
import { CREATE_TOOL_ANNOTATIONS } from "../../../core/tool-annotations.js";
|
|
5
|
-
import {
|
|
6
|
+
import { batchCreateOutputSchema, normalizeBatchCreate } from "./shared.js";
|
|
6
7
|
export function registerGenerateVideoTool(server, client) {
|
|
7
8
|
server.registerTool("generate_video", {
|
|
8
|
-
description: "Use this when the user wants a standalone video clip from text, images, or reference frames. Supports text-to-video, image-to-video, first/last-frame transition, or reference-to-video when the model supports it. Upload images with upload_image first. Flow: list_models(type=video) -> get_model_help -> generate_video -> get_task_status with the returned batch_id. For song-driven music, dance, or lyric videos, use generate_music_video, generate_dance_video, or generate_lyric_video.",
|
|
9
|
+
description: "Before spending credits, call quote_generation with this tool and its planned parameters, then tell the user the price or that it is unavailable. Set max_credits to the user-approved quote or ceiling. A higher or unknown price stops submission; never remove or raise the ceiling without approval. Use this when the user wants a standalone video clip from text, images, or reference frames. Supports text-to-video, image-to-video, first/last-frame transition, or reference-to-video when the model supports it. Upload images with upload_image first. Flow: list_models(type=video) -> get_model_help -> generate_video -> get_task_status with the returned batch_id. For song-driven music, dance, or lyric videos, use generate_music_video, generate_dance_video, or generate_lyric_video.",
|
|
9
10
|
annotations: { title: "Generate video", ...CREATE_TOOL_ANNOTATIONS },
|
|
10
11
|
outputSchema: batchCreateOutputSchema,
|
|
11
12
|
inputSchema: {
|
|
13
|
+
max_credits: maxCreditsSchema,
|
|
12
14
|
model_id: z.number().int().positive().describe("model_id from list_models(type=video)."),
|
|
13
15
|
prompt: z
|
|
14
16
|
.string()
|
|
@@ -44,26 +46,11 @@ export function registerGenerateVideoTool(server, client) {
|
|
|
44
46
|
.default(false)
|
|
45
47
|
.describe("Include a watermark."),
|
|
46
48
|
},
|
|
47
|
-
}, async (
|
|
49
|
+
}, async (params) => {
|
|
48
50
|
try {
|
|
49
|
-
const audio = generate_audio === undefined ? undefined : generate_audio ? 1 : 0;
|
|
50
51
|
const response = await client.createVideoBatch({
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
modelId: String(model_id),
|
|
54
|
-
generationType: VIDEO_GENERATION_TYPES[generation_type],
|
|
55
|
-
prompt: normalizeGenerationPrompt(prompt),
|
|
56
|
-
images: generation_type === "text" ? undefined : images,
|
|
57
|
-
duration,
|
|
58
|
-
resolution,
|
|
59
|
-
aspectRatio: aspect_ratio,
|
|
60
|
-
style,
|
|
61
|
-
audio,
|
|
62
|
-
generateAudio: audio,
|
|
63
|
-
extraParams: multi_clip ? { generateMultiClip: true } : undefined,
|
|
64
|
-
watermark: watermark ? 1 : 0,
|
|
65
|
-
},
|
|
66
|
-
],
|
|
52
|
+
max_credits: params.max_credits,
|
|
53
|
+
items: [buildVideoRequest(params)],
|
|
67
54
|
});
|
|
68
55
|
return jsonContent(normalizeBatchCreate(response, "Video generation"));
|
|
69
56
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-video.js","sourceRoot":"","sources":["../../../../src/capabilities/media/tools/generate-video.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generate-video.js","sourceRoot":"","sources":["../../../../src/capabilities/media/tools/generate-video.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAE5E,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,M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AuC,CAAC;YACrF,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,yCAAyC,CAAC;YAChF,cAAc,EAAE,CAAC;iBACd,OAAO,EAAE;iBACT,QAAQ,EAAE;iBACV,QAAQ,CAAC,2DAA2D,CAAC;YACxE,UAAU,EAAE,CAAC;iBACV,OAAO,EAAE;iBACT,QAAQ,EAAE;iBACV,OAAO,CAAC,KAAK,CAAC;iBACd,QAAQ,CAAC,qDAAqD,CAAC;YAClE,SAAS,EAAE,CAAC;iBACT,OAAO,EAAE;iBACT,QAAQ,EAAE;iBACV,OAAO,CAAC,KAAK,CAAC;iBACd,QAAQ,CAAC,sBAAsB,CAAC;SACpC;KACF,EACD,KAAK,EAAE,MAAM,EAAE,EAAE;QACf,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,gBAAgB,CAAC;gBAC7C,WAAW,EAAE,MAAM,CAAC,WAAW;gBAC/B,KAAK,EAAE,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;aACnC,CAAC,CAAC;YAEH,OAAO,WAAW,CAAC,oBAAoB,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC,CAAC;QACzE,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACxB,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC;QAChC,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -13,6 +13,22 @@ export declare const VIDEO_GENERATION_TYPES: {
|
|
|
13
13
|
readonly reference: 3;
|
|
14
14
|
};
|
|
15
15
|
export declare const batchCreateOutputSchema: {
|
|
16
|
+
quote: z.ZodOptional<z.ZodObject<{
|
|
17
|
+
status: z.ZodEnum<["quoted", "unavailable"]>;
|
|
18
|
+
credits: z.ZodOptional<z.ZodNumber>;
|
|
19
|
+
source: z.ZodString;
|
|
20
|
+
message: z.ZodString;
|
|
21
|
+
}, "strip", z.ZodTypeAny, {
|
|
22
|
+
status: "quoted" | "unavailable";
|
|
23
|
+
message: string;
|
|
24
|
+
source: string;
|
|
25
|
+
credits?: number | undefined;
|
|
26
|
+
}, {
|
|
27
|
+
status: "quoted" | "unavailable";
|
|
28
|
+
message: string;
|
|
29
|
+
source: string;
|
|
30
|
+
credits?: number | undefined;
|
|
31
|
+
}>>;
|
|
16
32
|
success: z.ZodLiteral<true>;
|
|
17
33
|
batch_id: z.ZodString;
|
|
18
34
|
batch_status: z.ZodString;
|
|
@@ -30,17 +46,17 @@ export declare const batchCreateOutputSchema: {
|
|
|
30
46
|
code: z.ZodNullable<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
31
47
|
message: z.ZodNullable<z.ZodString>;
|
|
32
48
|
}, "strip", z.ZodTypeAny, {
|
|
49
|
+
status: string;
|
|
33
50
|
code: string | number | null;
|
|
34
51
|
message: string | null;
|
|
35
|
-
status: string;
|
|
36
52
|
accepted: boolean;
|
|
37
53
|
business_type: number;
|
|
38
54
|
serial_no: string | null;
|
|
39
55
|
need_credits: number;
|
|
40
56
|
}, {
|
|
57
|
+
status: string;
|
|
41
58
|
code: string | number | null;
|
|
42
59
|
message: string | null;
|
|
43
|
-
status: string;
|
|
44
60
|
accepted: boolean;
|
|
45
61
|
business_type: number;
|
|
46
62
|
serial_no: string | null;
|