@jclvsh/dropspace 2.49.0 → 2.51.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -0
- package/dist/cli.js +4 -0
- package/dist/commands/scene-clips.d.ts +3 -0
- package/dist/commands/scene-clips.js +79 -0
- package/dist/commands/song-reels.d.ts +3 -0
- package/dist/commands/song-reels.js +95 -0
- package/dist/server.js +4 -0
- package/dist/tool-policy.js +12 -0
- package/dist/tools/scene-clips.d.ts +4 -0
- package/dist/tools/scene-clips.js +66 -0
- package/dist/tools/song-reels.d.ts +4 -0
- package/dist/tools/song-reels.js +75 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -61,6 +61,9 @@ dropspace launches --help
|
|
|
61
61
|
| audience | follower counts + growth per connected account |
|
|
62
62
|
| autopilot | status, configure, review, approve, reject, run, runs |
|
|
63
63
|
| recommendations (recs) | list, apply, dismiss |
|
|
64
|
+
| songs | list, get, add, lyrics, rename, retry, delete |
|
|
65
|
+
| song-reels | make, list, get, retry, launch, delete |
|
|
66
|
+
| scene-clips | cut, list, get, retry, delete |
|
|
64
67
|
| profile | get, update |
|
|
65
68
|
| billing | portal |
|
|
66
69
|
|
|
@@ -394,6 +397,16 @@ Reddit engagement (drafted comments in other communities) is paused: its tools a
|
|
|
394
397
|
| `add_song` | Add a song from a YouTube or SoundCloud link, or a public audio file url (local package only) |
|
|
395
398
|
| `get_song_lyrics` | The song's lyrics with word timings, transcribed once (local package only) |
|
|
396
399
|
| `delete_song` | Delete a song and its audio file (local package only) |
|
|
400
|
+
| `make_song_reel` | Make a 9:16 lyric reel from a snippet of a song: clips from the media library or a gradient, lyrics burned in (local package only) |
|
|
401
|
+
| `list_song_reels` | Lyric reels, newest first, with render status and video_url once ready (local package only) |
|
|
402
|
+
| `get_song_reel` | One reel with its lyric lines (local package only) |
|
|
403
|
+
| `launch_song_reel` | A draft launch carrying a ready reel and its lyrics as the caption (local package only) |
|
|
404
|
+
| `delete_song_reel` | Delete a reel; its media library item and launch stay (local package only) |
|
|
405
|
+
| `cut_scene_clips` | Cut a long video (a media library video, a YouTube link, or a public video url) into 2-8 second clips at its scene changes, up to 40, into the media library (local package only) |
|
|
406
|
+
| `list_scene_clip_jobs` | Clip jobs, newest first, with status, clips made and added, and each clip's urls (local package only) |
|
|
407
|
+
| `get_scene_clip_job` | One clip job; reading a ready job adds its clips to the media library (local package only) |
|
|
408
|
+
| `retry_scene_clip_job` | Cut a failed or stuck job again (local package only) |
|
|
409
|
+
| `delete_scene_clip_job` | Delete a clip job; clips already in the media library stay (local package only) |
|
|
397
410
|
|
|
398
411
|
Prompts (local package only): `instagram_audit`, `best_times_plan`, `winners_report`. Each tells the AI app which tools to call and ends with `save_report`.
|
|
399
412
|
|
package/dist/cli.js
CHANGED
|
@@ -20,6 +20,8 @@ import { registerRecommendationCommands } from "./commands/recommendations.js";
|
|
|
20
20
|
import { registerAudienceCommands } from "./commands/audience.js";
|
|
21
21
|
import { registerAccountCommands } from "./commands/account.js";
|
|
22
22
|
import { registerSongCommands } from "./commands/songs.js";
|
|
23
|
+
import { registerSongReelCommands } from "./commands/song-reels.js";
|
|
24
|
+
import { registerSceneClipCommands } from "./commands/scene-clips.js";
|
|
23
25
|
const program = new Command()
|
|
24
26
|
.name("dropspace")
|
|
25
27
|
.description("dropspace CLI - manage launches, personas, boosts, and more")
|
|
@@ -44,6 +46,8 @@ try {
|
|
|
44
46
|
registerRedditCommands(program, client);
|
|
45
47
|
registerAccountCommands(program, client);
|
|
46
48
|
registerSongCommands(program, client);
|
|
49
|
+
registerSongReelCommands(program, client);
|
|
50
|
+
registerSceneClipCommands(program, client);
|
|
47
51
|
await program.parseAsync(process.argv);
|
|
48
52
|
}
|
|
49
53
|
catch (error) {
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { formatOutput, handleError, getFormat } from "../cli-utils.js";
|
|
2
|
+
export function registerSceneClipCommands(program, client) {
|
|
3
|
+
const clips = program
|
|
4
|
+
.command("scene-clips")
|
|
5
|
+
.description("cut a long video into short clips for your media library (pro and premium)");
|
|
6
|
+
clips
|
|
7
|
+
.command("cut")
|
|
8
|
+
.description("start a job: give one of --media, --link, or --url")
|
|
9
|
+
.option("--media <id>", "a video in your media library")
|
|
10
|
+
.option("--link <url>", "a YouTube link (up to 30 minutes)")
|
|
11
|
+
.option("--url <url>", "a public video file url (up to 512 MB)")
|
|
12
|
+
.action(async (opts) => {
|
|
13
|
+
try {
|
|
14
|
+
const body = {};
|
|
15
|
+
if (opts.media)
|
|
16
|
+
body.media_library_id = opts.media;
|
|
17
|
+
if (opts.link)
|
|
18
|
+
body.link_url = opts.link;
|
|
19
|
+
if (opts.url)
|
|
20
|
+
body.video_url = opts.url;
|
|
21
|
+
formatOutput(await client.post("/scene-clips", body), getFormat(program.opts()));
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
handleError(error);
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
clips
|
|
28
|
+
.command("list")
|
|
29
|
+
.description("your clip jobs, newest first")
|
|
30
|
+
.option("--page <n>", "page number")
|
|
31
|
+
.option("--page-size <n>", "jobs per page (max 100)")
|
|
32
|
+
.action(async (opts) => {
|
|
33
|
+
try {
|
|
34
|
+
const params = {};
|
|
35
|
+
if (opts.page)
|
|
36
|
+
params.page = opts.page;
|
|
37
|
+
if (opts.pageSize)
|
|
38
|
+
params.page_size = opts.pageSize;
|
|
39
|
+
formatOutput(await client.get("/scene-clips", params), getFormat(program.opts()));
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
handleError(error);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
clips
|
|
46
|
+
.command("get <id>")
|
|
47
|
+
.description("one job; reading a ready job adds its clips to your media library")
|
|
48
|
+
.action(async (id) => {
|
|
49
|
+
try {
|
|
50
|
+
formatOutput(await client.get(`/scene-clips/${id}`), getFormat(program.opts()));
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
handleError(error);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
clips
|
|
57
|
+
.command("retry <id>")
|
|
58
|
+
.description("cut a failed (or stuck) job again")
|
|
59
|
+
.action(async (id) => {
|
|
60
|
+
try {
|
|
61
|
+
formatOutput(await client.post(`/scene-clips/${id}/retry`), getFormat(program.opts()));
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
handleError(error);
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
clips
|
|
68
|
+
.command("delete <id>")
|
|
69
|
+
.description("delete a job; clips already in your media library stay")
|
|
70
|
+
.action(async (id) => {
|
|
71
|
+
try {
|
|
72
|
+
await client.delete(`/scene-clips/${id}`);
|
|
73
|
+
formatOutput({ id, deleted: true }, getFormat(program.opts()));
|
|
74
|
+
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
handleError(error);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { formatOutput, handleError, getFormat } from "../cli-utils.js";
|
|
2
|
+
export function registerSongReelCommands(program, client) {
|
|
3
|
+
const reels = program.command("song-reels").description("lyric reels made from your songs (pro and premium)");
|
|
4
|
+
reels
|
|
5
|
+
.command("make <songId>")
|
|
6
|
+
.description("make a lyric reel from a snippet of a ready song")
|
|
7
|
+
.requiredOption("--start <seconds>", "snippet start, seconds from the song's start")
|
|
8
|
+
.requiredOption("--end <seconds>", "snippet end, 5 to 30 seconds after the start")
|
|
9
|
+
.option("--style <style>", "lower-third, center-bold, karaoke, one-word, or caps-top", "lower-third")
|
|
10
|
+
.option("--clips <ids>", "media library ids in order, comma separated (footage from your library)")
|
|
11
|
+
.option("--background <name>", "midnight, sunset, forest, sand, slate, or violet (no footage)")
|
|
12
|
+
.action(async (songId, opts) => {
|
|
13
|
+
try {
|
|
14
|
+
const body = {
|
|
15
|
+
snippet_start: Number(opts.start),
|
|
16
|
+
snippet_end: Number(opts.end),
|
|
17
|
+
style: opts.style,
|
|
18
|
+
footage_mode: opts.clips ? "clips" : "none",
|
|
19
|
+
};
|
|
20
|
+
if (opts.clips)
|
|
21
|
+
body.clip_ids = String(opts.clips).split(",").map((id) => id.trim()).filter(Boolean);
|
|
22
|
+
if (opts.background)
|
|
23
|
+
body.background = opts.background;
|
|
24
|
+
formatOutput(await client.post(`/songs/${songId}/reels`, body), getFormat(program.opts()));
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
handleError(error);
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
reels
|
|
31
|
+
.command("list")
|
|
32
|
+
.description("your lyric reels, newest first")
|
|
33
|
+
.option("--song <id>", "only this song's reels")
|
|
34
|
+
.option("--page <n>", "page number")
|
|
35
|
+
.option("--page-size <n>", "reels per page (max 100)")
|
|
36
|
+
.action(async (opts) => {
|
|
37
|
+
try {
|
|
38
|
+
const params = {};
|
|
39
|
+
if (opts.song)
|
|
40
|
+
params.song_id = opts.song;
|
|
41
|
+
if (opts.page)
|
|
42
|
+
params.page = opts.page;
|
|
43
|
+
if (opts.pageSize)
|
|
44
|
+
params.page_size = opts.pageSize;
|
|
45
|
+
formatOutput(await client.get("/song-reels", params), getFormat(program.opts()));
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
handleError(error);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
reels
|
|
52
|
+
.command("get <id>")
|
|
53
|
+
.description("one reel, with its lyric lines")
|
|
54
|
+
.action(async (id) => {
|
|
55
|
+
try {
|
|
56
|
+
formatOutput(await client.get(`/song-reels/${id}`), getFormat(program.opts()));
|
|
57
|
+
}
|
|
58
|
+
catch (error) {
|
|
59
|
+
handleError(error);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
reels
|
|
63
|
+
.command("retry <id>")
|
|
64
|
+
.description("render a failed reel again")
|
|
65
|
+
.action(async (id) => {
|
|
66
|
+
try {
|
|
67
|
+
formatOutput(await client.post(`/song-reels/${id}/retry`), getFormat(program.opts()));
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
handleError(error);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
reels
|
|
74
|
+
.command("launch <id>")
|
|
75
|
+
.description("make a draft launch from a ready reel")
|
|
76
|
+
.action(async (id) => {
|
|
77
|
+
try {
|
|
78
|
+
formatOutput(await client.post(`/song-reels/${id}/launch`), getFormat(program.opts()));
|
|
79
|
+
}
|
|
80
|
+
catch (error) {
|
|
81
|
+
handleError(error);
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
reels
|
|
85
|
+
.command("delete <id>")
|
|
86
|
+
.description("delete a reel (its media library item and launch stay)")
|
|
87
|
+
.action(async (id) => {
|
|
88
|
+
try {
|
|
89
|
+
formatOutput(await client.delete(`/song-reels/${id}`), getFormat(program.opts()));
|
|
90
|
+
}
|
|
91
|
+
catch (error) {
|
|
92
|
+
handleError(error);
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
}
|
package/dist/server.js
CHANGED
|
@@ -20,6 +20,8 @@ import { registerAccountTools } from "./tools/account.js";
|
|
|
20
20
|
import { registerTrialReelTools } from "./tools/trial-reels.js";
|
|
21
21
|
import { registerReportTools, registerWorkflowPrompts } from "./tools/reports.js";
|
|
22
22
|
import { registerSongTools } from "./tools/songs.js";
|
|
23
|
+
import { registerSongReelTools } from "./tools/song-reels.js";
|
|
24
|
+
import { registerSceneClipTools } from "./tools/scene-clips.js";
|
|
23
25
|
/** Drops tools whose feature is paused before the policy registrar sees them (see PAUSED_TOOLS). */
|
|
24
26
|
function skipPausedTools(registrar) {
|
|
25
27
|
return {
|
|
@@ -52,6 +54,8 @@ export function createDropspaceServer({ client, version, profile }) {
|
|
|
52
54
|
registerTrialReelTools(registrar, client);
|
|
53
55
|
registerReportTools(registrar, client);
|
|
54
56
|
registerSongTools(registrar, client);
|
|
57
|
+
registerSongReelTools(registrar, client);
|
|
58
|
+
registerSceneClipTools(registrar, client);
|
|
55
59
|
// Prompts are not tools, so the policy registrar does not filter them: the hosted profile
|
|
56
60
|
// (frozen for the Meta review) gets none.
|
|
57
61
|
if (profile === "full")
|
package/dist/tool-policy.js
CHANGED
|
@@ -142,6 +142,18 @@ const FULL_TOOL_POLICY = {
|
|
|
142
142
|
add_song: localOnly("media", "write"),
|
|
143
143
|
get_song_lyrics: localOnly("media", "read"),
|
|
144
144
|
delete_song: localOnly("media", "write"),
|
|
145
|
+
// lyric reels: a render spends the plan's quota; a launch is a draft the user still publishes
|
|
146
|
+
make_song_reel: localOnly("media", "write"),
|
|
147
|
+
list_song_reels: localOnly("media", "read"),
|
|
148
|
+
get_song_reel: localOnly("media", "read"),
|
|
149
|
+
launch_song_reel: localOnly("media", "write"),
|
|
150
|
+
delete_song_reel: localOnly("media", "write"),
|
|
151
|
+
// scene clips: a job spends server minutes and adds up to 40 items to the media library
|
|
152
|
+
cut_scene_clips: localOnly("media", "write"),
|
|
153
|
+
list_scene_clip_jobs: localOnly("media", "read"),
|
|
154
|
+
get_scene_clip_job: localOnly("media", "read"),
|
|
155
|
+
retry_scene_clip_job: localOnly("media", "write"),
|
|
156
|
+
delete_scene_clip_job: localOnly("media", "write"),
|
|
145
157
|
get_usage: hosted("usage", "read"),
|
|
146
158
|
get_changelog: hosted("usage", "read"),
|
|
147
159
|
get_dropspace_status: hosted("dropspace", "read"),
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import type { DropspaceClient } from "../client.js";
|
|
3
|
+
/** Scene clips: a long video cut into short clips for the media library (pro and premium). Local package only. */
|
|
4
|
+
export declare function registerSceneClipTools(server: McpServer, client: DropspaceClient): void;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
function text(result) {
|
|
3
|
+
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
4
|
+
}
|
|
5
|
+
function fail(error) {
|
|
6
|
+
return {
|
|
7
|
+
content: [{ type: "text", text: `error: ${error instanceof Error ? error.message : String(error)}` }],
|
|
8
|
+
isError: true,
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
/** Scene clips: a long video cut into short clips for the media library (pro and premium). Local package only. */
|
|
12
|
+
export function registerSceneClipTools(server, client) {
|
|
13
|
+
server.tool("cut_scene_clips", "cut a long video into 2 to 8 second clips at its scene changes, up to 40 a job, each with a thumbnail, for the user's media library (footage for make_song_reel and autopilot). give exactly one source: media_library_id (a video from list_media_library), link_url (a YouTube link, up to 30 minutes), or video_url (a public mp4 or mov url, up to 512 MB). only the first 15 minutes are scanned. the work runs on the server: the job comes back pending; read it with get_scene_clip_job until ready (the clips are added to the media library then, source scene) or failed (error). pro and premium; at most 10 jobs a day and one running at a time.", {
|
|
14
|
+
media_library_id: z.string().uuid().optional().describe("a video in the media library"),
|
|
15
|
+
link_url: z.string().url().optional().describe("a YouTube link"),
|
|
16
|
+
video_url: z.string().url().optional().describe("a public video file url"),
|
|
17
|
+
}, async (body) => {
|
|
18
|
+
try {
|
|
19
|
+
return text(await client.post("/scene-clips", body));
|
|
20
|
+
}
|
|
21
|
+
catch (error) {
|
|
22
|
+
return fail(error);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
server.tool("list_scene_clip_jobs", "the user's clip jobs, newest first: id, source (library, link, url), source_title, status (pending, running, ready, or failed with error), clips_made, clips_added (in the media library), clips (start, end, video_url, thumbnail_url, media_library_id), and a note when clips are waiting for room in the library.", {
|
|
26
|
+
page: z.number().int().min(1).optional(),
|
|
27
|
+
page_size: z.number().int().min(1).max(100).optional(),
|
|
28
|
+
}, async ({ page, page_size }) => {
|
|
29
|
+
try {
|
|
30
|
+
const params = {};
|
|
31
|
+
if (page)
|
|
32
|
+
params.page = String(page);
|
|
33
|
+
if (page_size)
|
|
34
|
+
params.page_size = String(page_size);
|
|
35
|
+
return text(await client.get("/scene-clips", params));
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
return fail(error);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
server.tool("get_scene_clip_job", "one clip job. reading a ready job adds its clips to the media library (as many as fit under the 500-item cap; the rest on a later read).", { job_id: z.string().uuid() }, async ({ job_id }) => {
|
|
42
|
+
try {
|
|
43
|
+
return text(await client.get(`/scene-clips/${job_id}`));
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
return fail(error);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
server.tool("retry_scene_clip_job", "cut a failed (or stuck) clip job again. three attempts in all.", { job_id: z.string().uuid() }, async ({ job_id }) => {
|
|
50
|
+
try {
|
|
51
|
+
return text(await client.post(`/scene-clips/${job_id}/retry`));
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
return fail(error);
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
server.tool("delete_scene_clip_job", "delete a clip job. clips already in the media library stay (delete_media_library_item removes one).", { job_id: z.string().uuid() }, async ({ job_id }) => {
|
|
58
|
+
try {
|
|
59
|
+
await client.delete(`/scene-clips/${job_id}`);
|
|
60
|
+
return text({ id: job_id, deleted: true });
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
return fail(error);
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import type { DropspaceClient } from "../client.js";
|
|
3
|
+
/** Lyric reels made from songs (pro and premium). Local package only. */
|
|
4
|
+
export declare function registerSongReelTools(server: McpServer, client: DropspaceClient): void;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
function text(result) {
|
|
3
|
+
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
4
|
+
}
|
|
5
|
+
function fail(error) {
|
|
6
|
+
return {
|
|
7
|
+
content: [{ type: "text", text: `error: ${error instanceof Error ? error.message : String(error)}` }],
|
|
8
|
+
isError: true,
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
const STYLES = ["lower-third", "center-bold", "karaoke", "one-word", "caps-top"];
|
|
12
|
+
const BACKGROUNDS = ["midnight", "sunset", "forest", "sand", "slate", "violet"];
|
|
13
|
+
/** Lyric reels made from songs (pro and premium). Local package only. */
|
|
14
|
+
export function registerSongReelTools(server, client) {
|
|
15
|
+
server.tool("make_song_reel", "make a 9:16 lyric reel from a snippet of a ready song (get_song for its duration and peaks): 5 to 30 seconds of the song under footage, with the lyrics inside the snippet burned in. footage_mode clips uses the user's media library videos and images (clip_ids from list_media_library, in order; the clip changes at lyric lines, skipping cuts closer than 1.5 s apart); none puts the lyrics over a gradient (background). the lyrics are read from the song on the first reel (takes up to a minute). the render runs on the server: the reel comes back pending; read it with get_song_reel until ready (video_url, and it is in the media library) or failed. counts against the plan's song reels per billing period (pro 30, premium 100; a rendered reel keeps its slot even when deleted).", {
|
|
16
|
+
song_id: z.string().uuid(),
|
|
17
|
+
snippet_start: z.number().min(0).describe("seconds from the start of the song"),
|
|
18
|
+
snippet_end: z.number().positive().describe("5 to 30 seconds after snippet_start"),
|
|
19
|
+
style: z.enum(STYLES).describe("how the lyrics look: lower-third, center-bold, karaoke (word by word), one-word, caps-top"),
|
|
20
|
+
footage_mode: z.enum(["clips", "none"]),
|
|
21
|
+
clip_ids: z.array(z.string().uuid()).max(20).optional().describe("media library ids, in order (footage_mode clips)"),
|
|
22
|
+
background: z.enum(BACKGROUNDS).optional().describe("the gradient (footage_mode none); midnight unless given"),
|
|
23
|
+
}, async ({ song_id, ...body }) => {
|
|
24
|
+
try {
|
|
25
|
+
return text(await client.post(`/songs/${song_id}/reels`, body));
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
return fail(error);
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
server.tool("list_song_reels", "the user's lyric reels, newest first: id, song_id, title, snippet, style, footage_mode, render_status (pending, running, ready, or failed with render_error), video_url and thumbnail_url once ready, media_library_id, launch_id. song_id narrows to one song.", {
|
|
32
|
+
song_id: z.string().uuid().optional(),
|
|
33
|
+
page: z.number().int().min(1).optional(),
|
|
34
|
+
page_size: z.number().int().min(1).max(100).optional(),
|
|
35
|
+
}, async ({ song_id, page, page_size }) => {
|
|
36
|
+
try {
|
|
37
|
+
const params = {};
|
|
38
|
+
if (song_id)
|
|
39
|
+
params.song_id = song_id;
|
|
40
|
+
if (page)
|
|
41
|
+
params.page = String(page);
|
|
42
|
+
if (page_size)
|
|
43
|
+
params.page_size = String(page_size);
|
|
44
|
+
return text(await client.get("/song-reels", params));
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
return fail(error);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
server.tool("get_song_reel", "one lyric reel: everything list_song_reels shows plus its lines (the lyric lines inside the snippet with their timing).", { reel_id: z.string().uuid() }, async ({ reel_id }) => {
|
|
51
|
+
try {
|
|
52
|
+
return text(await client.get(`/song-reels/${reel_id}`));
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
return fail(error);
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
server.tool("launch_song_reel", "make a draft launch from a ready reel: the reel is its video and the snippet's lyrics its instagram caption. the launch stays a draft until the user (or update_launch + publish) sets platforms, caption, and timing, and it counts as one of the plan's launches. returns the reel with launch_id.", { reel_id: z.string().uuid() }, async ({ reel_id }) => {
|
|
59
|
+
try {
|
|
60
|
+
return text(await client.post(`/song-reels/${reel_id}/launch`));
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
return fail(error);
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
server.tool("delete_song_reel", "delete a lyric reel. its media library item and any launch made from it stay.", { reel_id: z.string().uuid() }, async ({ reel_id }) => {
|
|
67
|
+
try {
|
|
68
|
+
await client.delete(`/song-reels/${reel_id}`);
|
|
69
|
+
return text({ id: reel_id, deleted: true });
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
return fail(error);
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
}
|