freebeat-mcp 0.4.1 → 0.4.2
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 +47 -1
- package/dist/capabilities/effects/tools/list-effects.js +18 -5
- package/dist/capabilities/effects/tools/list-effects.js.map +1 -1
- package/dist/capabilities/media/tools/shared.d.ts +6 -6
- package/dist/capabilities/media/tools/shared.js +2 -2
- package/dist/capabilities/media/tools/shared.js.map +1 -1
- package/dist/capabilities/tasks/tools/get-task-result.js +13 -2
- package/dist/capabilities/tasks/tools/get-task-result.js.map +1 -1
- package/dist/capabilities/tasks/tools/get-task-status.js +10 -6
- package/dist/capabilities/tasks/tools/get-task-status.js.map +1 -1
- package/dist/core/agent-products.d.ts +19 -0
- package/dist/core/agent-products.js.map +1 -1
- package/dist/core/credit-approval.d.ts +3 -3
- package/dist/core/credit-approval.js +1 -1
- package/dist/core/credit-approval.js.map +1 -1
- package/dist/core/model-output.d.ts +2 -2
- package/dist/core/response.d.ts +55 -3
- package/dist/core/response.js +42 -17
- package/dist/core/response.js.map +1 -1
- package/dist/core/task-result.d.ts +3 -3
- package/dist/core/task-status.d.ts +1 -1
- package/dist/hosted.d.ts +5 -2
- package/dist/hosted.js +2 -1
- package/dist/hosted.js.map +1 -1
- package/dist/server.d.ts +2 -2
- package/dist/server.js +2 -2
- package/dist/server.js.map +1 -1
- package/dist/services/freebeat-api.d.ts +11 -10
- package/dist/services/freebeat-api.js +171 -66
- package/dist/services/freebeat-api.js.map +1 -1
- package/dist/services/remote-media.d.ts +2 -0
- package/dist/services/remote-media.js +1 -1
- package/dist/services/remote-media.js.map +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -78,12 +78,35 @@ npx -y freebeat-mcp
|
|
|
78
78
|
|
|
79
79
|
The hosted MCP endpoint is served by freebeat.ai.
|
|
80
80
|
The website mounts `freebeat-mcp/hosted`.
|
|
81
|
+
It supplies `HostedMcpRequestOptions.renderAgentFinalVideo`, an `AgentFinalVideoRenderer`
|
|
82
|
+
exported from that entry point. The callback receives `{ product, threadId, flowIndex, assetVersion, isCurrent }`
|
|
83
|
+
and returns `running`, `completed` with `video_url`, or `failed` with a safe
|
|
84
|
+
`failure: { stage, reason, retryable }`. It closes over the authenticated website
|
|
85
|
+
context; no credentials are passed to the callback. The website owns render
|
|
86
|
+
execution, shared deduplication and bounded waiting. Use `assetVersion` with stable
|
|
87
|
+
composition inputs to identify prepared assets. After preparing, call `isCurrent()`
|
|
88
|
+
immediately before recording or submitting a new render; false means return `running`
|
|
89
|
+
without submitting. MCP owns this check of the active run and final asset version.
|
|
90
|
+
|
|
91
|
+
Polling `get_task_status` or `get_task_result` can render an existing agent's final
|
|
92
|
+
assembly once its latest final asset reports status `102` or `2`; it does not
|
|
93
|
+
regenerate source assets. An active agent run prevents rendering. The client checks
|
|
94
|
+
the thread and selected final flow/version/readiness again after the callback before returning media.
|
|
95
|
+
Missing rendering capability or flow reference returns a `final_render` failure.
|
|
96
|
+
Completed status includes `video_url`; result includes `result.video_url`. An agent
|
|
97
|
+
video still rendering returns `running` with a polling message from either tool.
|
|
81
98
|
|
|
82
99
|
This package depends on Freebeat online services. Available source platforms, effect templates, and generation capabilities may change with backend updates.
|
|
83
100
|
|
|
84
101
|
## Tools
|
|
85
102
|
|
|
86
|
-
22 tools are available with full scopes.
|
|
103
|
+
22 tools are available with full scopes. Successful responses and tool errors are projected through their declared output schemas before both MCP text and structured content are built; undeclared object properties are excluded.
|
|
104
|
+
|
|
105
|
+
Tool errors set `isError: true` and return `success: false`, `error`, and `code`
|
|
106
|
+
in both representations. A rejected credit approval may also include
|
|
107
|
+
`submitted: false`, `quote`, and `max_credits`. Errors omit successful result
|
|
108
|
+
fields. Raw handler text and metadata are excluded; input validation errors return
|
|
109
|
+
fixed `INVALID_PARAMS` guidance without echoing the rejected values.
|
|
87
110
|
|
|
88
111
|
### `get_credit_balance` and `quote_generation`
|
|
89
112
|
|
|
@@ -106,6 +129,10 @@ Missing consent or both consent modes are refused. Never remove or raise a ceili
|
|
|
106
129
|
or switch to unknown-cost consent, without new user approval. Agent videos charge
|
|
107
130
|
per stage; a submission-time check cannot cap the whole run.
|
|
108
131
|
|
|
132
|
+
After the user requests creation with Freebeat and approves the quote or explicitly
|
|
133
|
+
accepts an unknown total, call the appropriate Freebeat generation tool; do not
|
|
134
|
+
substitute another generator.
|
|
135
|
+
|
|
109
136
|
A production diagnosis on 2026-10-27 observed 855 credits for the video step alone
|
|
110
137
|
of a 15-second 720p dance, with planning and images extra: on the order of 1,000
|
|
111
138
|
credits. This is a historical configuration example, not a current quote or ceiling.
|
|
@@ -196,6 +223,16 @@ Lip-sync an existing clip to audio. Provide `video_url`, `video_duration_ms`, an
|
|
|
196
223
|
|
|
197
224
|
### `list_effects`
|
|
198
225
|
|
|
226
|
+
Returns one page of supported effects: `page` starts at `1` (default), and
|
|
227
|
+
`page_size` defaults to `20`, with an allowed range of `1`–`100`. The response
|
|
228
|
+
includes `total`, `page`, `page_size`, and `next_page`; follow `next_page` until it
|
|
229
|
+
is `null`. A page beyond the end returns an empty `effects` array and the actual
|
|
230
|
+
`total`, with `next_page: null`.
|
|
231
|
+
|
|
232
|
+
Each call reads the complete backend catalog within a shared 30-second deadline,
|
|
233
|
+
at most 100 backend pages and 10,000 effects. Exceeding any budget returns an
|
|
234
|
+
error without a partial catalog or total; repeated backend cursors also fail.
|
|
235
|
+
|
|
199
236
|
List supported effects with:
|
|
200
237
|
|
|
201
238
|
- `effect_id`
|
|
@@ -298,6 +335,15 @@ Parameters:
|
|
|
298
335
|
|
|
299
336
|
Freebeat validates the options per model; check `get_model_help` first and read `message` if a request is rejected.
|
|
300
337
|
|
|
338
|
+
For image, image-edit, and video batches, `success: true` means the response was
|
|
339
|
+
retrieved; check `accepted_count` and `items[].accepted` to see what was accepted.
|
|
340
|
+
If Freebeat provides no specific rejection reason, the response says so without
|
|
341
|
+
guessing the cause. Structured required and available credit amounts can provide
|
|
342
|
+
actionable credit guidance. `accepted_credits` describes acceptance, not an actual
|
|
343
|
+
charge. When only accepted credits are reported, including `0`, check
|
|
344
|
+
`get_task_status` billing for actual charges and refunds. Zero-charge statements
|
|
345
|
+
require an explicitly reported charge of `0`.
|
|
346
|
+
|
|
301
347
|
### `generate_text`
|
|
302
348
|
|
|
303
349
|
Ask any text model from `list_models(type=text)` and get its reply. Parameters: `model`, `messages` (`role` and `content`, oldest first), optional `max_tokens` and `temperature`. Usage is billed to the user's Freebeat credits through the user's own gateway token. The response preserves numeric prompt/completion/total token counts and their defined numeric breakdowns, not arbitrary provider usage metadata.
|
|
@@ -14,7 +14,7 @@ function normalizeEffect(effect) {
|
|
|
14
14
|
}
|
|
15
15
|
export function registerListEffectsTool(server, client) {
|
|
16
16
|
registerTool(server, "list_effects", {
|
|
17
|
-
description: "Use this when the user wants effect templates and the metadata needed to select an effect and create an effect task. Each effect includes a default image_url and default_music_id you can use directly. This lists templates rather than generating a video. For song-driven music, dance, or lyric videos, use generate_music_video, generate_dance_video, or generate_lyric_video.",
|
|
17
|
+
description: "Use this when the user wants effect templates and the metadata needed to select an effect and create an effect task. Returns 20 effects per page by default; use page and page_size to browse, and next_page until it is null. Each effect includes a default image_url and default_music_id you can use directly. This lists templates rather than generating a video. For song-driven music, dance, or lyric videos, use generate_music_video, generate_dance_video, or generate_lyric_video.",
|
|
18
18
|
annotations: { title: "List effects", ...READ_ONLY_TOOL_ANNOTATIONS },
|
|
19
19
|
outputSchema: {
|
|
20
20
|
success: z
|
|
@@ -35,18 +35,31 @@ export function registerListEffectsTool(server, client) {
|
|
|
35
35
|
aspect_ratio: z.string().describe("Preview aspect ratio."),
|
|
36
36
|
}))
|
|
37
37
|
.describe("Supported effects with the metadata needed to create an effect task."),
|
|
38
|
+
total: z.number().int().nonnegative().describe("Total number of supported effects across all pages."),
|
|
39
|
+
page: z.number().int().min(1).describe("Requested page number, starting at 1."),
|
|
40
|
+
page_size: z.number().int().min(1).max(100).describe("Requested maximum number of effects per page."),
|
|
41
|
+
next_page: z.number().int().min(1).nullable().describe("Next page number, or null when no further effects are available."),
|
|
38
42
|
message: z
|
|
39
43
|
.string()
|
|
40
44
|
.describe("A human-readable summary of the retrieved effects."),
|
|
41
45
|
},
|
|
42
|
-
inputSchema: {
|
|
43
|
-
|
|
46
|
+
inputSchema: {
|
|
47
|
+
page: z.number().int().min(1).default(1).describe("Page number, starting at 1."),
|
|
48
|
+
page_size: z.number().int().min(1).max(100).default(20).describe("Effects per page, from 1 to 100; defaults to 20."),
|
|
49
|
+
},
|
|
50
|
+
}, async ({ page, page_size }) => {
|
|
44
51
|
try {
|
|
45
52
|
const effects = await client.listEffects();
|
|
53
|
+
const start = (page - 1) * page_size;
|
|
54
|
+
const pageEffects = effects.slice(start, start + page_size);
|
|
46
55
|
return toolResult({
|
|
47
56
|
success: true,
|
|
48
|
-
effects:
|
|
49
|
-
|
|
57
|
+
effects: pageEffects.map(normalizeEffect),
|
|
58
|
+
total: effects.length,
|
|
59
|
+
page,
|
|
60
|
+
page_size,
|
|
61
|
+
next_page: start + page_size < effects.length ? page + 1 : null,
|
|
62
|
+
message: `Retrieved ${pageEffects.length} of ${effects.length} effect(s) (page ${page}).`,
|
|
50
63
|
});
|
|
51
64
|
}
|
|
52
65
|
catch (error) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-effects.js","sourceRoot":"","sources":["../../../../src/capabilities/effects/tools/list-effects.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACtF,OAAO,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AAG/E,SAAS,eAAe,CAAC,MAAsB;IAC7C,OAAO;QACL,SAAS,EAAE,MAAM,CAAC,aAAa;QAC/B,YAAY,EAAE,MAAM,CAAC,kBAAkB;QACvC,SAAS,EAAE,MAAM,CAAC,QAAQ;QAC1B,iBAAiB,EAAE,MAAM,CAAC,QAAQ;QAClC,gBAAgB,EAAE,MAAM,CAAC,OAAO;QAChC,kBAAkB,EAAE,MAAM,CAAC,SAAS;QACpC,YAAY,EAAE,MAAM,CAAC,WAAW;KACjC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,uBAAuB,CACrC,MAAiB,EACjB,MAA8C;IAE9C,YAAY,CAAC,MAAM,EACjB,cAAc,EACd;QACE,WAAW,EACT,
|
|
1
|
+
{"version":3,"file":"list-effects.js","sourceRoot":"","sources":["../../../../src/capabilities/effects/tools/list-effects.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACtF,OAAO,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AAG/E,SAAS,eAAe,CAAC,MAAsB;IAC7C,OAAO;QACL,SAAS,EAAE,MAAM,CAAC,aAAa;QAC/B,YAAY,EAAE,MAAM,CAAC,kBAAkB;QACvC,SAAS,EAAE,MAAM,CAAC,QAAQ;QAC1B,iBAAiB,EAAE,MAAM,CAAC,QAAQ;QAClC,gBAAgB,EAAE,MAAM,CAAC,OAAO;QAChC,kBAAkB,EAAE,MAAM,CAAC,SAAS;QACpC,YAAY,EAAE,MAAM,CAAC,WAAW;KACjC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,uBAAuB,CACrC,MAAiB,EACjB,MAA8C;IAE9C,YAAY,CAAC,MAAM,EACjB,cAAc,EACd;QACE,WAAW,EACT,ieAAie;QACne,WAAW,EAAE,EAAE,KAAK,EAAE,cAAc,EAAE,GAAG,0BAA0B,EAAE;QACrE,YAAY,EAAE;YACZ,OAAO,EAAE,CAAC;iBACP,OAAO,CAAC,IAAI,CAAC;iBACb,QAAQ,CAAC,sDAAsD,CAAC;YACnE,OAAO,EAAE,CAAC;iBACP,KAAK,CACJ,CAAC,CAAC,MA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ema: {
|
|
|
19
19
|
source: z.ZodString;
|
|
20
20
|
message: z.ZodString;
|
|
21
21
|
}, "strip", z.ZodTypeAny, {
|
|
22
|
-
message: string;
|
|
23
22
|
status: "quoted" | "unavailable";
|
|
23
|
+
message: string;
|
|
24
24
|
source: string;
|
|
25
25
|
credits?: number | undefined;
|
|
26
26
|
}, {
|
|
27
|
-
message: string;
|
|
28
27
|
status: "quoted" | "unavailable";
|
|
28
|
+
message: string;
|
|
29
29
|
source: string;
|
|
30
30
|
credits?: number | undefined;
|
|
31
31
|
}>>;
|
|
@@ -46,18 +46,18 @@ export declare const batchCreateOutputSchema: {
|
|
|
46
46
|
code: z.ZodNull;
|
|
47
47
|
message: z.ZodNullable<z.ZodString>;
|
|
48
48
|
}, "strip", z.ZodTypeAny, {
|
|
49
|
-
|
|
49
|
+
status: "unknown" | "running" | "completed" | "failed" | "pending" | "queued" | "accepted" | "processing" | "rejected" | "cancelled" | "action_required" | "partial_failed";
|
|
50
50
|
code: null;
|
|
51
51
|
message: string | null;
|
|
52
|
-
|
|
52
|
+
accepted: boolean;
|
|
53
53
|
business_type: number;
|
|
54
54
|
serial_no: string | null;
|
|
55
55
|
need_credits: number;
|
|
56
56
|
}, {
|
|
57
|
-
|
|
57
|
+
status: "unknown" | "running" | "completed" | "failed" | "pending" | "queued" | "accepted" | "processing" | "rejected" | "cancelled" | "action_required" | "partial_failed";
|
|
58
58
|
code: null;
|
|
59
59
|
message: string | null;
|
|
60
|
-
|
|
60
|
+
accepted: boolean;
|
|
61
61
|
business_type: number;
|
|
62
62
|
serial_no: string | null;
|
|
63
63
|
need_credits: number;
|
|
@@ -15,7 +15,7 @@ const GENERATION_TYPE_NAMES = {
|
|
|
15
15
|
};
|
|
16
16
|
export const batchCreateOutputSchema = {
|
|
17
17
|
quote: creditQuoteSchema.optional(),
|
|
18
|
-
success: z.literal(true).describe("Whether the batch
|
|
18
|
+
success: z.literal(true).describe("Whether the batch response was retrieved; check accepted_count and items[].accepted for acceptance."),
|
|
19
19
|
batch_id: z.string().describe("Open RPC batch ID for get_task_status."),
|
|
20
20
|
batch_status: taskStatusSchema.describe("Initial batch status."),
|
|
21
21
|
total_count: z.number().describe("Total number of submitted items."),
|
|
@@ -58,7 +58,7 @@ export function normalizeBatchCreate(response, noun) {
|
|
|
58
58
|
message: item.message,
|
|
59
59
|
})),
|
|
60
60
|
message: rejected.length === response.items.length
|
|
61
|
-
? `${noun} was
|
|
61
|
+
? `${noun} was not accepted. ${[...new Set(rejected.map((item) => item.message ?? "Freebeat did not provide a specific rejection reason."))].join(" ")}`
|
|
62
62
|
: `${noun} batch queued. Use get_task_status with task_id="${response.batchId}" to check status.`,
|
|
63
63
|
};
|
|
64
64
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../../src/capabilities/media/tools/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACrF,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAW,CAAC;AAIpF,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAW,CAAC;AAElG,MAAM,qBAAqB,GAA2B;IACpD,CAAC,EAAE,gBAAgB;IACnB,CAAC,EAAE,eAAe;IAClB,CAAC,EAAE,6BAA6B;IAChC,CAAC,EAAE,oBAAoB;IACvB,CAAC,EAAE,QAAQ;IACX,CAAC,EAAE,eAAe;IAClB,CAAC,EAAE,YAAY;IACf,EAAE,EAAE,sBAAsB;CAC3B,CAAC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ACvC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,KAAgB;IACnD,OAAO,CAAC,KAAK,CAAC,kBAAkB,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QACvD,eAAe,EAAE,MAAM,CAAC,cAAc;QACtC,eAAe,EAAE,qBAAqB,CAAC,MAAM,CAAC,cAAc,CAAC;QAC7D,aAAa,EAAE,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,CAAC,SAAS;QACpF,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;QAC/D,8GAA8G;QAC9G,WAAW,EAAE,CAAC,MAAM,CAAC,oBAAoB,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;YACpE,UAAU,EAAE,UAAU,CAAC,UAAU,IAAI,SAAS;YAC9C,iBAAiB,EAAE,CAAC,UAAU,CAAC,kBAAkB,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC;SAC9F,CAAC,CAAC;KACJ,CAAC,CAAC,CAAC;AACN,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,cAAsB;IACvD,OAAO,qBAAqB,CAAC,cAAc,CAAC,CAAC;AAC/C,CAAC"}
|
|
@@ -7,6 +7,8 @@ import { AppError } from "../../../core/errors.js";
|
|
|
7
7
|
import { formatToolError, toolResult, registerTool } from "../../../core/response.js";
|
|
8
8
|
import { READ_ONLY_TOOL_ANNOTATIONS } from "../../../core/tool-annotations.js";
|
|
9
9
|
import { EFFECT_TASK_TYPE } from "../../effects/task-type.js";
|
|
10
|
+
import { AGENT_PRODUCTS } from "../../../core/agent-products.js";
|
|
11
|
+
import { decodeCreativeTaskId } from "../../../core/creative-task-id.js";
|
|
10
12
|
import { DANCE_VIDEO_TASK_TYPE, LIP_SYNC_VIDEO_TASK_TYPE, LYRIC_VIDEO_TASK_TYPE, MUSIC_VIDEO_TASK_TYPE, MUSIC_GENERATION_TASK_TYPE, SINGING_VIDEO_TASK_TYPE, } from "../../../core/task-types.js";
|
|
11
13
|
import { mapSessionTypeToTaskType } from "../task-type.js";
|
|
12
14
|
const SUPPORTED_RESULT_TASK_TYPES = new Set([
|
|
@@ -43,6 +45,15 @@ function normalizeTaskResult(result) {
|
|
|
43
45
|
};
|
|
44
46
|
}
|
|
45
47
|
if (normalizedStatus !== "completed") {
|
|
48
|
+
const creative = decodeCreativeTaskId(result.task_id);
|
|
49
|
+
if (normalizedStatus === "running" && creative && creative.kind in AGENT_PRODUCTS)
|
|
50
|
+
return {
|
|
51
|
+
success: true, task_id: result.task_id, task_type, status: normalizedStatus,
|
|
52
|
+
message: result.message ?? "Freebeat is preparing the final video. Poll again later.",
|
|
53
|
+
billing: result.billing ?? taskOutcome({ usedCredits: result.used_credits }).billing,
|
|
54
|
+
used_credits: result.used_credits, session_url: result.session_url,
|
|
55
|
+
billing_message: "Freebeat has not returned a completed final video yet.",
|
|
56
|
+
};
|
|
46
57
|
throw new AppError(`Task is not completed yet. Current status: ${normalizedStatus}. Call get_task_status until status is completed before calling get_task_result.`, "TASK_NOT_COMPLETED");
|
|
47
58
|
}
|
|
48
59
|
if (!SUPPORTED_RESULT_TASK_TYPES.has(task_type)) {
|
|
@@ -71,8 +82,8 @@ function normalizeTaskResult(result) {
|
|
|
71
82
|
}
|
|
72
83
|
export function registerGetTaskResultTool(server, client) {
|
|
73
84
|
registerTool(server, "get_task_result", {
|
|
74
|
-
description: "Use this when the user needs output or failure and billing details from an existing Freebeat task. Call after get_task_status returns completed, failed, or action_required. Failed or paused tasks return failure and billing even without final media. Song-driven videos from generate_music_video, generate_dance_video, and generate_lyric_video, plus effects, singing, and lip-sync tasks, return result.video_url and usually result.cover_url; music tasks return result.audio_url.
|
|
75
|
-
annotations: { title: "Get task result", ...READ_ONLY_TOOL_ANNOTATIONS },
|
|
85
|
+
description: "Use this when the user needs output or failure and billing details from an existing Freebeat task. Call after get_task_status returns completed, failed, or action_required. Failed or paused tasks return failure and billing even without final media. Polling a song-driven video may start its final video assembly from already generated assets; it does not regenerate source assets. Song-driven videos from generate_music_video, generate_dance_video, and generate_lyric_video, plus effects, singing, and lip-sync tasks, return result.video_url and usually result.cover_url; music tasks return result.audio_url. Song-driven video assembly still in progress returns running with a message to poll again. Other pending or running tasks return TASK_NOT_COMPLETED. If the task failed, this tool surfaces the backend failure. For Open RPC image/video batches, get result URLs from get_task_status instead.",
|
|
86
|
+
annotations: { title: "Get task result", ...READ_ONLY_TOOL_ANNOTATIONS, readOnlyHint: false },
|
|
76
87
|
outputSchema: {
|
|
77
88
|
success: z
|
|
78
89
|
.literal(true)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-task-result.js","sourceRoot":"","sources":["../../../../src/capabilities/tasks/tools/get-task-result.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACrF,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAC7F,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAE1F,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACtF,OAAO,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AAE/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC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AAgB;QACxB,OAAO,EAAE,MAAM,CAAC,OAAO,IAAI,WAAW,CAAC,EAAC,WAAW,EAAC,MAAM,CAAC,YAAY,EAAC,CAAC,CAAC,OAAO;QACjF,YAAY,EAAE,MAAM,CAAC,YAAY;QACjC,eAAe,EAAE,MAAM,CAAC,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,iEAAiE,CAAC,CAAC,CAAC,oDAAoD;QAC7K,OAAO,EAAE,8BAA8B,UAAU,EAAE;KACpD,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,yBAAyB,CACvC,MAAiB,EACjB,MAAgD;IAEhD,YAAY,CAAC,MAAM,EACjB,iBAAiB,EACjB;QACE,WAAW,EACT,
|
|
1
|
+
{"version":3,"file":"get-task-result.js","sourceRoot":"","sources":["../../../../src/capabilities/tasks/tools/get-task-result.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACrF,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAC7F,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAE1F,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACtF,OAAO,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AAE/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EACxB,qBAA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AE,cAAc;iBACtB,QAAQ,CAAC,yCAAyC,CAAC;YACtD,MAAM,EAAE,gBAAgB;iBACrB,QAAQ,CACP,0EAA0E,CAC3E;YACH,MAAM,EAAE,oBAAoB,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAC9C,kKAAkK,CACnK;YACD,OAAO,EAAE,CAAC;iBACP,MAAM,EAAE;iBACR,QAAQ,CAAC,wDAAwD,CAAC;YACrE,OAAO,EAAE,aAAa,CAAC,QAAQ,EAAE;YACjC,OAAO,EAAE,aAAa;YACtB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;YACnC,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE;YAC3B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;SACnC;QACD,WAAW,EAAE;YACX,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uCAAuC,CAAC;SACtE;KACF,EACD,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QACpB,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;YACnD,OAAO,UAAU,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAC;QACjD,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACxB,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC;QAChC,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { taskTypeSchema } from "../../../core/task-types.js";
|
|
2
2
|
import { normalizeTaskStatus, taskStatusSchema } from "../../../core/task-status.js";
|
|
3
|
+
import { normalizeCreativeResult } from "../../../core/task-result.js";
|
|
3
4
|
import { billingSchema, failureSchema, taskOutcome } from "../../../core/task-outcome.js";
|
|
4
5
|
import { z } from "zod";
|
|
5
6
|
import { formatToolError, toolResult, registerTool } from "../../../core/response.js";
|
|
@@ -26,13 +27,13 @@ function normalizeBatchStatus(batch) {
|
|
|
26
27
|
task_type: "open_rpc_batch",
|
|
27
28
|
status,
|
|
28
29
|
batch_id: batch.batchId,
|
|
29
|
-
items: batch.items.map((item) => ({
|
|
30
|
+
items: batch.items.map((item, index) => ({
|
|
30
31
|
business_type: item.businessType,
|
|
31
32
|
serial_no: item.serialNo,
|
|
32
33
|
status: normalizeTaskStatus(item.status),
|
|
33
|
-
used_credits:
|
|
34
|
+
used_credits: billings[index].charged,
|
|
34
35
|
failure: item.failure,
|
|
35
|
-
billing:
|
|
36
|
+
billing: billings[index],
|
|
36
37
|
error_code: null,
|
|
37
38
|
error_message: item.errorMessage,
|
|
38
39
|
video_url: item.videoUrl,
|
|
@@ -61,8 +62,8 @@ function summarizeBatchStatus(batch) {
|
|
|
61
62
|
}
|
|
62
63
|
export function registerGetTaskStatusTool(server, client) {
|
|
63
64
|
registerTool(server, "get_task_status", {
|
|
64
|
-
description: "Use this when the user needs the status of an existing asynchronous Freebeat task. Supports task IDs from generate_music_video, generate_dance_video, generate_lyric_video, music, singing, lip-sync, and effect tools, plus Open RPC image/video batch IDs. Song-driven video jobs report running, completed, or action_required; on action_required relay the message and session_url. For Open RPC batches, result URLs are returned on completed items; do not call get_task_result for these batches. For other tasks call get_task_result after completed, failed, or action_required. On failures or pauses, explain failure.stage, failure.reason, failure.retryable and billing charged/refunded/net/refund_state; null means not reported, and pending refunds are not refunded credits.
|
|
65
|
-
annotations: { title: "Get task status", ...READ_ONLY_TOOL_ANNOTATIONS },
|
|
65
|
+
description: "Use this when the user needs the status of an existing asynchronous Freebeat task. Supports task IDs from generate_music_video, generate_dance_video, generate_lyric_video, music, singing, lip-sync, and effect tools, plus Open RPC image/video batch IDs. Polling a song-driven video may start its final video assembly from already generated assets; it does not regenerate source assets. Song-driven video jobs report running, completed, failed, or action_required; completed videos include video_url, and on action_required relay the message and session_url. For Open RPC batches, result URLs are returned on completed items; do not call get_task_result for these batches. For other tasks call get_task_result after completed, failed, or action_required. On failures or pauses, explain failure.stage, failure.reason, failure.retryable and billing charged/refunded/net/refund_state; null means not reported, and pending refunds are not refunded credits.",
|
|
66
|
+
annotations: { title: "Get task status", ...READ_ONLY_TOOL_ANNOTATIONS, readOnlyHint: false },
|
|
66
67
|
outputSchema: {
|
|
67
68
|
success: z
|
|
68
69
|
.literal(true)
|
|
@@ -90,6 +91,7 @@ export function registerGetTaskStatusTool(server, client) {
|
|
|
90
91
|
.string()
|
|
91
92
|
.optional()
|
|
92
93
|
.describe("For agent videos, the freebeat.ai page where the user can watch, review, or continue the session."),
|
|
94
|
+
video_url: z.string().optional().describe("The playable final video URL when the task is completed."),
|
|
93
95
|
batch_id: z
|
|
94
96
|
.string()
|
|
95
97
|
.optional()
|
|
@@ -99,7 +101,7 @@ export function registerGetTaskStatusTool(server, client) {
|
|
|
99
101
|
business_type: z.number(),
|
|
100
102
|
serial_no: z.string(),
|
|
101
103
|
status: taskStatusSchema,
|
|
102
|
-
used_credits: z.number(),
|
|
104
|
+
used_credits: z.number().nullable(),
|
|
103
105
|
failure: failureSchema.optional(),
|
|
104
106
|
billing: billingSchema,
|
|
105
107
|
error_code: z.null(),
|
|
@@ -144,6 +146,8 @@ export function registerGetTaskStatusTool(server, client) {
|
|
|
144
146
|
task_id: result.task_id,
|
|
145
147
|
task_type,
|
|
146
148
|
status: normalizedStatus,
|
|
149
|
+
video_url: normalizedStatus === "completed" && result.result_payload
|
|
150
|
+
? normalizeCreativeResult(JSON.parse(result.result_payload))?.video_url : undefined,
|
|
147
151
|
error_message: result.error_message,
|
|
148
152
|
message,
|
|
149
153
|
session_url: result.session_url,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-task-status.js","sourceRoot":"","sources":["../../../../src/capabilities/tasks/tools/get-task-status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,M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,gBAAgB,KAAK,QAAQ,EAAE,CAAC;gBACzC,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,aAAa,IAAI,cAAc,CAAC;YACrE,CAAC;YAED,OAAO,UAAU,CAAC;gBAChB,OAAO,EAAE,IAAI;gBACb,OAAO,EAAE,MAAM,CAAC,OAAO;gBACvB,SAAS;gBACT,MAAM,EAAE,gBAAgB;gBACxB,SAAS,EAAE,gBAAgB,KAAK,WAAW,IAAI,MAAM,CAAC,cAAc;oBAClE,CAAC,CAAC,uBAAuB,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,SAAS;gBACrF,aAAa,EAAE,MAAM,CAAC,aAAa;gBACnC,OAAO;gBACP,WAAW,EAAE,MAAM,CAAC,WAAW;gBAC/B,OAAO,EAAE,MAAM,CAAC,OAAO;gBACvB,OAAO,EAAE,MAAM,CAAC,OAAO,IAAI,WAAW,CAAC,EAAC,WAAW,EAAC,MAAM,CAAC,YAAY,EAAC,CAAC,CAAC,OAAO;gBACjF,YAAY,EAAE,MAAM,CAAC,YAAY;gBACjC,eAAe,EAAE,MAAM,CAAC,YAAY,KAAK,SAAS;oBAChD,CAAC,CAAC,iEAAiE,CAAC,CAAC,CAAC,SAAS;aAClF,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACxB,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC;QAChC,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -32,6 +32,25 @@ export declare const AGENT_PRODUCTS: {
|
|
|
32
32
|
};
|
|
33
33
|
};
|
|
34
34
|
export type AgentProduct = keyof typeof AGENT_PRODUCTS;
|
|
35
|
+
export type AgentFinalVideoRenderer = (input: {
|
|
36
|
+
product: AgentProduct;
|
|
37
|
+
threadId: string;
|
|
38
|
+
flowIndex: string;
|
|
39
|
+
assetVersion: string;
|
|
40
|
+
isCurrent: () => Promise<boolean>;
|
|
41
|
+
}) => Promise<{
|
|
42
|
+
status: "running";
|
|
43
|
+
} | {
|
|
44
|
+
status: "completed";
|
|
45
|
+
video_url: string;
|
|
46
|
+
} | {
|
|
47
|
+
status: "failed";
|
|
48
|
+
failure: {
|
|
49
|
+
stage: string;
|
|
50
|
+
reason: string;
|
|
51
|
+
retryable: boolean | null;
|
|
52
|
+
};
|
|
53
|
+
}>;
|
|
35
54
|
export declare const AGENT_PRODUCT_NAMES: [AgentProduct, ...AgentProduct[]];
|
|
36
55
|
export type AgentEndpoints = {
|
|
37
56
|
webHost: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-products.js","sourceRoot":"","sources":["../../src/core/agent-products.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,iBAAiB,CAAC;AAEzB,0FAA0F;AAC1F,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,WAAW,EAAE;QACX,WAAW,EAAE,CAAC;QACd,QAAQ,EAAE,qBAAqB;QAC/B,cAAc,EAAE,iBAAiB;QACjC,WAAW,EAAE,kCAAkC;QAC/C,WAAW,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;QAC9B,YAAY,EAAE,EAAE,cAAc,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE;KACjE;IACD,KAAK,EAAE;QACL,WAAW,EAAE,CAAC;QACd,QAAQ,EAAE,qBAAqB;QAC/B,cAAc,EAAE,mBAAmB;QACnC,WAAW,EAAE,aAAa;QAC1B,WAAW,EAAE,CAAC,MAAM,CAAC;QACrB,YAAY,EAAE,EAAE;KACjB;IACD,WAAW,EAAE;QACX,WAAW,EAAE,CAAC;QACd,QAAQ,EAAE,qBAAqB;QAC/B,cAAc,EAAE,iBAAiB;QACjC,WAAW,EAAE,aAAa;QAC1B,WAAW,EAAE,CAAC,MAAM,EAAE,IAAI,CAAC;QAC3B,YAAY,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,CAAC,KAAK,EAAE,EAAE,CAAC;IAE/F,OAAO;QACL,OAAO,EAAE,SAAS,CAAC,mBAAmB,EAAE,GAAG,CAAC,iBAAiB,IAAI,qBAAqB,CAAC;QACvF,WAAW,EAAE,SAAS,CAAC,uBAAuB,EAAE,GAAG,CAAC,qBAAqB,IAAI,4BAA4B,CAAC;QAC1G,KAAK,EAAE,SAAS,CAAC,0BAA0B,EAAE,GAAG,CAAC,wBAAwB,IAAI,wCAAwC,CAAC;QACtH,WAAW,EAAE,SAAS,CACpB,0BAA0B,EAC1B,GAAG,CAAC,wBAAwB,IAAI,2CAA2C,CAC5E;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -3,20 +3,20 @@ import { AppError } from "./errors.js";
|
|
|
3
3
|
import type { CreditQuote } from "./paid-tools.js";
|
|
4
4
|
export declare const maxCreditsSchema: z.ZodOptional<z.ZodNumber>;
|
|
5
5
|
export declare const acceptUnknownCostSchema: z.ZodOptional<z.ZodBoolean>;
|
|
6
|
-
export declare const CREDIT_APPROVAL_DESCRIPTION = "Before spending credits, call quote_generation and explain the returned price or unknown total. For a known quote, obtain approval and pass max_credits. For an unknown total, obtain explicit acceptance and pass accept_unknown_cost:true without max_credits. Never switch consent modes or remove or raise a ceiling without new user approval. Agents charge per stage; no whole-run spending cap is enforced. ";
|
|
6
|
+
export declare const CREDIT_APPROVAL_DESCRIPTION = "Before spending credits, call quote_generation and explain the returned price or unknown total. For a known quote, obtain approval and pass max_credits. For an unknown total, obtain explicit acceptance and pass accept_unknown_cost:true without max_credits. Never switch consent modes or remove or raise a ceiling without new user approval. Agents charge per stage; no whole-run spending cap is enforced. After the user requests creation with Freebeat and approves the quote or explicitly accepts an unknown total, call the appropriate Freebeat generation tool; do not substitute another generator. ";
|
|
7
7
|
export declare const creditQuoteSchema: z.ZodObject<{
|
|
8
8
|
status: z.ZodEnum<["quoted", "unavailable"]>;
|
|
9
9
|
credits: z.ZodOptional<z.ZodNumber>;
|
|
10
10
|
source: z.ZodString;
|
|
11
11
|
message: z.ZodString;
|
|
12
12
|
}, "strip", z.ZodTypeAny, {
|
|
13
|
-
message: string;
|
|
14
13
|
status: "quoted" | "unavailable";
|
|
14
|
+
message: string;
|
|
15
15
|
source: string;
|
|
16
16
|
credits?: number | undefined;
|
|
17
17
|
}, {
|
|
18
|
-
message: string;
|
|
19
18
|
status: "quoted" | "unavailable";
|
|
19
|
+
message: string;
|
|
20
20
|
source: string;
|
|
21
21
|
credits?: number | undefined;
|
|
22
22
|
}>;
|
|
@@ -2,7 +2,7 @@ import { z } from "zod";
|
|
|
2
2
|
import { AppError } from "./errors.js";
|
|
3
3
|
export const maxCreditsSchema = z.number().finite().nonnegative().optional().describe("User-approved ceiling for a known current quote. Cannot cap an unknown total or a multi-stage agent run. Never remove or raise it without new user consent.");
|
|
4
4
|
export const acceptUnknownCostSchema = z.boolean().optional().describe("Set true only after the user explicitly accepts an unknown total, without max_credits. Agents charge per stage; this does not enforce a total budget.");
|
|
5
|
-
export const CREDIT_APPROVAL_DESCRIPTION = "Before spending credits, call quote_generation and explain the returned price or unknown total. For a known quote, obtain approval and pass max_credits. For an unknown total, obtain explicit acceptance and pass accept_unknown_cost:true without max_credits. Never switch consent modes or remove or raise a ceiling without new user approval. Agents charge per stage; no whole-run spending cap is enforced. ";
|
|
5
|
+
export const CREDIT_APPROVAL_DESCRIPTION = "Before spending credits, call quote_generation and explain the returned price or unknown total. For a known quote, obtain approval and pass max_credits. For an unknown total, obtain explicit acceptance and pass accept_unknown_cost:true without max_credits. Never switch consent modes or remove or raise a ceiling without new user approval. Agents charge per stage; no whole-run spending cap is enforced. After the user requests creation with Freebeat and approves the quote or explicitly accepts an unknown total, call the appropriate Freebeat generation tool; do not substitute another generator. ";
|
|
6
6
|
export const creditQuoteSchema = z.object({
|
|
7
7
|
status: z.enum(["quoted", "unavailable"]), credits: z.number().optional(),
|
|
8
8
|
source: z.string(), message: z.string(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credit-approval.js","sourceRoot":"","sources":["../../src/core/credit-approval.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGvC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CACnF,6JAA6J,CAC9J,CAAC;AACF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CACpE,uJAAuJ,CACxJ,CAAC;AACF,MAAM,CAAC,MAAM,2BAA2B,GAAG,
|
|
1
|
+
{"version":3,"file":"credit-approval.js","sourceRoot":"","sources":["../../src/core/credit-approval.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGvC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CACnF,6JAA6J,CAC9J,CAAC;AACF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CACpE,uJAAuJ,CACxJ,CAAC;AACF,MAAM,CAAC,MAAM,2BAA2B,GAAG,wlBAAwlB,CAAC;AACpoB,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACzE,MAAM,EAAE,CAAC,CAAC,MAAM,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,CAAC;AACH,CAAC"}
|
|
@@ -171,15 +171,15 @@ export declare const mediaModelSchema: z.ZodObject<{
|
|
|
171
171
|
available: z.ZodBoolean;
|
|
172
172
|
member_only: z.ZodBoolean;
|
|
173
173
|
}, "strip", z.ZodTypeAny, {
|
|
174
|
+
name: string;
|
|
174
175
|
available: boolean;
|
|
175
176
|
model_id: number;
|
|
176
|
-
name: string;
|
|
177
177
|
member_only: boolean;
|
|
178
178
|
description?: string | null | undefined;
|
|
179
179
|
}, {
|
|
180
|
+
name: string;
|
|
180
181
|
available: boolean;
|
|
181
182
|
model_id: number;
|
|
182
|
-
name: string;
|
|
183
183
|
member_only: boolean;
|
|
184
184
|
description?: string | null | undefined;
|
|
185
185
|
}>;
|
package/dist/core/response.d.ts
CHANGED
|
@@ -1,13 +1,65 @@
|
|
|
1
1
|
import { McpServer, type ToolCallback } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import type { Transport } from "@modelcontextprotocol/sdk/shared/transport.js";
|
|
2
3
|
import type { ToolAnnotations } from "@modelcontextprotocol/sdk/types.js";
|
|
3
4
|
import { z } from "zod";
|
|
5
|
+
export declare const toolErrorSchema: z.ZodObject<{
|
|
6
|
+
success: z.ZodLiteral<false>;
|
|
7
|
+
error: z.ZodString;
|
|
8
|
+
code: z.ZodEnum<["INVALID_PARAMS", "TASK_NOT_COMPLETED", "FILE_NOT_FOUND", "UNSUPPORTED_TYPE", "FILE_TOO_LARGE", "INVALID_RESPONSE", "NETWORK_ERROR", "AUTH_ERROR", "NOT_FOUND", "RATE_LIMITED", "SERVER_ERROR", "API_ERROR", "UNKNOWN_ERROR"]>;
|
|
9
|
+
submitted: z.ZodOptional<z.ZodLiteral<false>>;
|
|
10
|
+
quote: z.ZodOptional<z.ZodObject<{
|
|
11
|
+
status: z.ZodEnum<["quoted", "unavailable"]>;
|
|
12
|
+
credits: z.ZodOptional<z.ZodNumber>;
|
|
13
|
+
source: z.ZodString;
|
|
14
|
+
message: z.ZodString;
|
|
15
|
+
}, "strip", z.ZodTypeAny, {
|
|
16
|
+
status: "quoted" | "unavailable";
|
|
17
|
+
message: string;
|
|
18
|
+
source: string;
|
|
19
|
+
credits?: number | undefined;
|
|
20
|
+
}, {
|
|
21
|
+
status: "quoted" | "unavailable";
|
|
22
|
+
message: string;
|
|
23
|
+
source: string;
|
|
24
|
+
credits?: number | undefined;
|
|
25
|
+
}>>;
|
|
26
|
+
max_credits: z.ZodOptional<z.ZodNumber>;
|
|
27
|
+
}, "strip", z.ZodTypeAny, {
|
|
28
|
+
code: "INVALID_PARAMS" | "TASK_NOT_COMPLETED" | "FILE_NOT_FOUND" | "UNSUPPORTED_TYPE" | "FILE_TOO_LARGE" | "INVALID_RESPONSE" | "NETWORK_ERROR" | "AUTH_ERROR" | "NOT_FOUND" | "RATE_LIMITED" | "SERVER_ERROR" | "API_ERROR" | "UNKNOWN_ERROR";
|
|
29
|
+
success: false;
|
|
30
|
+
error: string;
|
|
31
|
+
submitted?: false | undefined;
|
|
32
|
+
quote?: {
|
|
33
|
+
status: "quoted" | "unavailable";
|
|
34
|
+
message: string;
|
|
35
|
+
source: string;
|
|
36
|
+
credits?: number | undefined;
|
|
37
|
+
} | undefined;
|
|
38
|
+
max_credits?: number | undefined;
|
|
39
|
+
}, {
|
|
40
|
+
code: "INVALID_PARAMS" | "TASK_NOT_COMPLETED" | "FILE_NOT_FOUND" | "UNSUPPORTED_TYPE" | "FILE_TOO_LARGE" | "INVALID_RESPONSE" | "NETWORK_ERROR" | "AUTH_ERROR" | "NOT_FOUND" | "RATE_LIMITED" | "SERVER_ERROR" | "API_ERROR" | "UNKNOWN_ERROR";
|
|
41
|
+
success: false;
|
|
42
|
+
error: string;
|
|
43
|
+
submitted?: false | undefined;
|
|
44
|
+
quote?: {
|
|
45
|
+
status: "quoted" | "unavailable";
|
|
46
|
+
message: string;
|
|
47
|
+
source: string;
|
|
48
|
+
credits?: number | undefined;
|
|
49
|
+
} | undefined;
|
|
50
|
+
max_credits?: number | undefined;
|
|
51
|
+
}>;
|
|
4
52
|
export declare function formatToolError(error: unknown): {
|
|
5
|
-
|
|
53
|
+
isError?: true | undefined;
|
|
54
|
+
content: {
|
|
6
55
|
type: "text";
|
|
7
56
|
text: string;
|
|
8
|
-
}];
|
|
9
|
-
|
|
57
|
+
}[];
|
|
58
|
+
structuredContent: Record<string, unknown>;
|
|
10
59
|
};
|
|
60
|
+
export declare class FreebeatMcpServer extends McpServer {
|
|
61
|
+
connect(transport: Transport): Promise<void>;
|
|
62
|
+
}
|
|
11
63
|
export declare function toolResult<T extends Record<string, unknown>>(payload: T): {
|
|
12
64
|
content: [];
|
|
13
65
|
structuredContent: T;
|