@letta-ai/letta-code 0.34.55 → 0.34.56

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.
@@ -1 +1 @@
1
- {"version":3,"file":"remote-external-coding-agent.d.ts","sourceRoot":"","sources":["../../../../src/tools/impl/remote-external-coding-agent.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EACL,KAAK,eAAe,EAErB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,KAAK,qBAAqB,EAK3B,MAAM,4BAA4B,CAAC;AASpC,OAAO,KAAK,EACV,oBAAoB,EACpB,wBAAwB,EACzB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAEL,KAAK,6BAA6B,EAClC,KAAK,uBAAuB,EAG7B,MAAM,yBAAyB,CAAC;AAGjC,eAAO,MAAM,8BAA8B,eAE1C,CAAC;AAEF,UAAU,WAAW;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED,uFAAuF;AACvF,MAAM,MAAM,qBAAqB,GAAG,CAAC,IAAI,EAAE;IACzC,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,cAAc,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,WAAW,CAAC;IACzB,IAAI,EAAE;QAAE,iBAAiB,EAAE,OAAO,aAAa,CAAA;KAAE,CAAC;CACnD,KAAK;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,UAAU,E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
+ {"version":3,"file":"remote-external-coding-agent.d.ts","sourceRoot":"","sources":["../../../../src/tools/impl/remote-external-coding-agent.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EACL,KAAK,eAAe,EAErB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,KAAK,qBAAqB,EAK3B,MAAM,4BAA4B,CAAC;AASpC,OAAO,KAAK,EACV,oBAAoB,EACpB,wBAAwB,EACzB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAEL,KAAK,6BAA6B,EAClC,KAAK,uBAAuB,EAG7B,MAAM,yBAAyB,CAAC;AAGjC,eAAO,MAAM,8BAA8B,eAE1C,CAAC;AAEF,UAAU,WAAW;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED,uFAAuF;AACvF,MAAM,MAAM,qBAAqB,GAAG,CAAC,IAAI,EAAE;IACzC,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,cAAc,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,WAAW,CAAC;IACzB,IAAI,EAAE;QAAE,iBAAiB,EAAE,OAAO,aAAa,CAAA;KAAE,CAAC;CACnD,KAAK;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC;AAEjE,MAAM,WAAW,+BAA+B;IAC9C,IAAI,EAAE,uBAAuB,CAAC;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB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nD,eAAe,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC;QAC9C,YAAY,EAAE,MAAM,CAAC;QACrB,WAAW,EAAE,qBAAqB,CAAC;KACpC,CAAC,CAAC;IACH,OAAO,CAAC,EAAE,CACR,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,WAAW,KACrB,OAAO,CAAC,eAAe,CAAC,CAAC;IAC9B,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE;QACb,IAAI,EAAE,uBAAuB,CAAC;QAC9B,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;QAChB,WAAW,EAAE,WAAW,CAAC;QACzB,UAAU,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;QACpC,SAAS,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;KAChC,KAAK;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC;CAClE;AA4BD,wBAAsB,6BAA6B,CACjD,MAAM,EAAE,IAAI,CAAC,gCAAgC,EAAE,SAAS,GAAG,YAAY,CAAC,EACxE,IAAI,GAAE,oCAAyC,GAC9C,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CA4B/B;AAED,wBAAsB,oCAAoC,CACxD,MAAM,EAAE,gCAAgC,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,EAC9D,IAAI,GAAE,oCAAyC,GAC9C,OAAO,CAAC;IACT,QAAQ,EAAE,SAAS,GAAG,SAAS,CAAC;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC,CAgBD"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Semver comparison utilities
3
+ */
4
+ /**
5
+ * Parse a semver string into [major, minor, patch]
6
+ * Returns null if invalid format
7
+ */
8
+ export declare function parseSemver(version: string): [number, number, number] | null;
9
+ /**
10
+ * Compare two semver versions
11
+ * Returns:
12
+ * -1 if a < b
13
+ * 0 if a === b
14
+ * 1 if a > b
15
+ * Returns null if either version is invalid
16
+ */
17
+ export declare function compareSemver(a: string, b: string): -1 | 0 | 1 | null;
18
+ /**
19
+ * Check if version is less than minimum
20
+ * Returns false if either version is invalid
21
+ */
22
+ export declare function isVersionBelow(version: string, minimum: string): boolean;
23
+ //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../src/utils/version.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;GAGG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAS5E;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,CAYrE;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAGxE"}
package/letta.js CHANGED
@@ -6098,7 +6098,7 @@ var package_default;
6098
6098
  var init_package = __esm(() => {
6099
6099
  package_default = {
6100
6100
  name: "@letta-ai/letta-code",
6101
- version: "0.34.55",
6101
+ version: "0.34.56",
6102
6102
  lettaStartupLogProtocol: 1,
6103
6103
  lettaConfigDirProtocol: 1,
6104
6104
  description: "Letta Code is a CLI tool for interacting with stateful Letta agents from the terminal.",
@@ -212386,7 +212386,7 @@ var init_mcp_client = __esm(() => {
212386
212386
  init_streamableHttp();
212387
212387
  DEFAULT_CLIENT_INFO = {
212388
212388
  name: "letta-code",
212389
- version: "0.34.55"
212389
+ version: "0.34.56"
212390
212390
  };
212391
212391
  });
212392
212392
 
@@ -248974,7 +248974,7 @@ class CodexAppServerClient {
248974
248974
  await this.request("initialize", {
248975
248975
  clientInfo: {
248976
248976
  name: "letta-code",
248977
- version: "0.34.55"
248977
+ version: "0.34.56"
248978
248978
  },
248979
248979
  capabilities: null
248980
248980
  });
@@ -254206,6 +254206,38 @@ var init_memory_task_lifecycle = __esm(() => {
254206
254206
  init_process_manager();
254207
254207
  });
254208
254208
 
254209
+ // src/utils/version.ts
254210
+ function parseSemver(version3) {
254211
+ const match3 = version3.match(/^(\d+)\.(\d+)\.(\d+)/);
254212
+ if (!match3)
254213
+ return null;
254214
+ const [, major, minor, patch2] = match3;
254215
+ return [
254216
+ parseInt(major ?? "0", 10),
254217
+ parseInt(minor ?? "0", 10),
254218
+ parseInt(patch2 ?? "0", 10)
254219
+ ];
254220
+ }
254221
+ function compareSemver(a2, b3) {
254222
+ const aParts = parseSemver(a2);
254223
+ const bParts = parseSemver(b3);
254224
+ if (!aParts || !bParts)
254225
+ return null;
254226
+ for (let i4 = 0;i4 < 3; i4++) {
254227
+ const a3 = aParts[i4] ?? 0;
254228
+ const b4 = bParts[i4] ?? 0;
254229
+ if (a3 < b4)
254230
+ return -1;
254231
+ if (a3 > b4)
254232
+ return 1;
254233
+ }
254234
+ return 0;
254235
+ }
254236
+ function isVersionBelow(version3, minimum3) {
254237
+ const result3 = compareSemver(version3, minimum3);
254238
+ return result3 === -1;
254239
+ }
254240
+
254209
254241
  // src/tools/impl/remote-subagent-events.ts
254210
254242
  function followRemoteSubagentEvents(subagentId, read2) {
254211
254243
  let cursor = 0;
@@ -254528,6 +254560,7 @@ async function launchRemoteExternalCodingAgent(params, deps) {
254528
254560
  sendsForkContext = resolved2.environment.metadata?.external_fork_context === true;
254529
254561
  if (params.forkContext && !sendsForkContext)
254530
254562
  return fail2("outdated_computer", `Update Letta Code on ${computer} to fork external workers with destination-local history files.`);
254563
+ sendsForkContext ||= (compareSemver(resolved2.environment.metadata?.lettaCodeVersion ?? "", "0.34.40") ?? -1) >= 0;
254531
254564
  connectionId = resolved2.connectionId;
254532
254565
  deviceId = resolved2.environment.deviceId;
254533
254566
  supportsSteering = resolved2.environment.metadata?.subagent_message === true;
@@ -490797,38 +490830,6 @@ var init_router = __esm(async () => {
490797
490830
  ]);
490798
490831
  });
490799
490832
 
490800
- // src/utils/version.ts
490801
- function parseSemver(version3) {
490802
- const match3 = version3.match(/^(\d+)\.(\d+)\.(\d+)/);
490803
- if (!match3)
490804
- return null;
490805
- const [, major, minor, patch2] = match3;
490806
- return [
490807
- parseInt(major ?? "0", 10),
490808
- parseInt(minor ?? "0", 10),
490809
- parseInt(patch2 ?? "0", 10)
490810
- ];
490811
- }
490812
- function compareSemver(a2, b3) {
490813
- const aParts = parseSemver(a2);
490814
- const bParts = parseSemver(b3);
490815
- if (!aParts || !bParts)
490816
- return null;
490817
- for (let i4 = 0;i4 < 3; i4++) {
490818
- const a3 = aParts[i4] ?? 0;
490819
- const b4 = bParts[i4] ?? 0;
490820
- if (a3 < b4)
490821
- return -1;
490822
- if (a3 > b4)
490823
- return 1;
490824
- }
490825
- return 0;
490826
- }
490827
- function isVersionBelow(version3, minimum3) {
490828
- const result3 = compareSemver(version3, minimum3);
490829
- return result3 === -1;
490830
- }
490831
-
490832
490833
  // src/runtime-version.ts
490833
490834
  function assertSupportedBunRuntime(bunVersion = process.versions.bun) {
490834
490835
  if (!bunVersion || !isVersionBelow(bunVersion, MINIMUM_BUN_VERSION)) {
@@ -545180,4 +545181,4 @@ function registerBunOAuthFlows() {
545180
545181
  registerBunOAuthFlows();
545181
545182
  await init_src5().then(() => exports_src2);
545182
545183
 
545183
- //# debugId=FF8CD17B6CDA3A2264756E2164756E21
545184
+ //# debugId=21B3B10894C15C2064756E2164756E21
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letta-ai/letta-code",
3
- "version": "0.34.55",
3
+ "version": "0.34.56",
4
4
  "lockfileVersion": 3,
5
5
  "packages": {
6
6
  "node_modules/@alcalzone/ansi-tokenize": {
@@ -5080,7 +5080,7 @@
5080
5080
  },
5081
5081
  "": {
5082
5082
  "name": "@letta-ai/letta-code",
5083
- "version": "0.34.55",
5083
+ "version": "0.34.56",
5084
5084
  "dependencies": {
5085
5085
  "@cursor/sdk": "1.1.0",
5086
5086
  "@earendil-works/pi-ai": "^0.99.1",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letta-ai/letta-code",
3
- "version": "0.34.55",
3
+ "version": "0.34.56",
4
4
  "lettaStartupLogProtocol": 1,
5
5
  "lettaConfigDirProtocol": 1,
6
6
  "description": "Letta Code is a CLI tool for interacting with stateful Letta agents from the terminal.",
@@ -0,0 +1,74 @@
1
+ import { describe, expect, test } from "bun:test";
2
+ import { verifyUpgradePr } from "./update-tracker.ts";
3
+
4
+ const repo = "letta-ai/letta-code";
5
+ const url = `https://github.com/${repo}/pull/123`;
6
+ const analysis = { previous_version: "1.5.1", current_version: "1.5.2" };
7
+ const pull = {
8
+ author: { login: "watcher-agent" },
9
+ body: "Pi-ai-watch: 1.5.1...1.5.2",
10
+ isDraft: false,
11
+ state: "OPEN",
12
+ };
13
+
14
+ describe("pi-ai upgrade PR verification", () => {
15
+ test("accepts a ready PR and fetches it from the expected repository", () => {
16
+ const requests: Array<[string, string]> = [];
17
+ verifyUpgradePr(url, repo, "watcher-agent", analysis, (number, name) => {
18
+ requests.push([number, name]);
19
+ return pull;
20
+ });
21
+ expect(requests).toEqual([["123", repo]]);
22
+ });
23
+
24
+ test("rejects a draft or closed PR", () => {
25
+ expect(() =>
26
+ verifyUpgradePr(url, repo, "watcher-agent", analysis, () => ({
27
+ ...pull,
28
+ isDraft: true,
29
+ })),
30
+ ).toThrow("must be ready for review");
31
+ expect(() =>
32
+ verifyUpgradePr(url, repo, "watcher-agent", analysis, () => ({
33
+ ...pull,
34
+ state: "CLOSED",
35
+ })),
36
+ ).toThrow("must be open");
37
+ });
38
+
39
+ test("rejects the wrong author or release marker", () => {
40
+ expect(() =>
41
+ verifyUpgradePr(url, repo, "watcher-agent", analysis, () => ({
42
+ ...pull,
43
+ author: { login: "someone-else" },
44
+ })),
45
+ ).toThrow("does not match");
46
+ expect(() =>
47
+ verifyUpgradePr(url, repo, "watcher-agent", analysis, () => ({
48
+ ...pull,
49
+ body: "Pi-ai-watch: 1.5.0...1.5.2",
50
+ })),
51
+ ).toThrow("missing marker");
52
+ });
53
+
54
+ test("rejects malformed and other-repository URLs before fetching", () => {
55
+ let fetched = false;
56
+ const getPull = () => {
57
+ fetched = true;
58
+ return pull;
59
+ };
60
+ expect(() =>
61
+ verifyUpgradePr(`${url}/files`, repo, "watcher-agent", analysis, getPull),
62
+ ).toThrow("Invalid GitHub pull request URL");
63
+ expect(() =>
64
+ verifyUpgradePr(
65
+ "https://github.com/letta-ai/another-repo/pull/123",
66
+ repo,
67
+ "watcher-agent",
68
+ analysis,
69
+ getPull,
70
+ ),
71
+ ).toThrow(`must belong to ${repo}`);
72
+ expect(fetched).toBe(false);
73
+ });
74
+ });
@@ -146,11 +146,28 @@ function main(): void {
146
146
  );
147
147
  }
148
148
 
149
- function verifyUpgradePr(
149
+ interface UpgradePullRequest {
150
+ author: { login: string };
151
+ body: string;
152
+ isDraft: boolean;
153
+ state: string;
154
+ }
155
+
156
+ export function verifyUpgradePr(
150
157
  prUrl: string,
151
158
  expectedRepo: string,
152
159
  expectedGithubLogin: string,
153
- analysis: PiAiWatchAnalysis,
160
+ analysis: Pick<PiAiWatchAnalysis, "previous_version" | "current_version">,
161
+ getPull: (number: string, repo: string) => UpgradePullRequest = (number, repo) =>
162
+ ghJson<UpgradePullRequest>([
163
+ "pr",
164
+ "view",
165
+ number,
166
+ "--repo",
167
+ repo,
168
+ "--json",
169
+ "author,body,isDraft,state",
170
+ ]),
154
171
  ): void {
155
172
  const match = /^https:\/\/github\.com\/([^/]+)\/([^/]+)\/pull\/(\d+)$/.exec(
156
173
  prUrl,
@@ -160,27 +177,14 @@ function verifyUpgradePr(
160
177
  if (`${owner}/${repo}` !== expectedRepo) {
161
178
  throw new Error(`pi-ai upgrade PR must belong to ${expectedRepo}`);
162
179
  }
163
- const pull = ghJson<{
164
- author: { login: string };
165
- body: string;
166
- isDraft: boolean;
167
- state: string;
168
- }>([
169
- "pr",
170
- "view",
171
- number as string,
172
- "--repo",
173
- `${owner}/${repo}`,
174
- "--json",
175
- "author,body,isDraft,state",
176
- ]);
180
+ const pull = getPull(number as string, `${owner}/${repo}`);
177
181
  const marker = `Pi-ai-watch: ${analysis.previous_version}...${analysis.current_version}`;
178
182
  if (pull.author.login !== expectedGithubLogin) {
179
183
  throw new Error(
180
184
  `pi-ai PR author ${pull.author.login} does not match ${expectedGithubLogin}`,
181
185
  );
182
186
  }
183
- if (!pull.isDraft) throw new Error("pi-ai upgrade PR must be a draft");
187
+ if (pull.isDraft) throw new Error("pi-ai upgrade PR must be ready for review");
184
188
  if (pull.state !== "OPEN") throw new Error("pi-ai upgrade PR must be open");
185
189
  if (!pull.body.includes(marker)) {
186
190
  throw new Error(`pi-ai upgrade PR is missing marker: ${marker}`);
@@ -212,4 +216,4 @@ function defaultNotes(outcome: TrackerOutcome): string {
212
216
  }
213
217
  }
214
218
 
215
- main();
219
+ if (import.meta.main) main();
@@ -44,6 +44,7 @@ Recommendation as of 2026-10-29. Video models move fast, so this will go stale;
44
44
  - **Fast:** `minimax/hailuo-3-max` (MiniMax H3). Also top tier; renders in well under a minute. Use it for quick replies in a live thread or for iterating on a prompt, then rerun the final cut on Seedance.
45
45
  - Other top-tier models on the endpoint include `alibaba/wan-3.0`, `black-forest-labs/flux-3-video` and `heygen/heygen-video-1`. Some providers filter prompts more strictly than others; if one rejects a prompt, try another model rather than rewording around the filter.
46
46
  - `heygen/avatar-iv` makes a talking head from one photo.
47
+ - `alibaba/wan-3.0` does reference-guided generation: image `input_references` hold a person's identity, and an `audio_url` reference drives lip-sync to that clip. Use it for a talking head of a specific person in their own voice: pass a few front-facing photos and a clip of them (or their generated voice) saying the exact script.
47
48
 
48
49
  ## Writing the prompt
49
50
 
@@ -116,10 +117,10 @@ Required: `model`. `prompt` is required by every model except those that can gen
116
117
  - `generate_audio` (bool) — only meaningful if the model's `generate_audio` capability is true.
117
118
  - `seed` (int) — honored only if the model's `seed` capability is true.
118
119
  - `frame_images[]` — image-to-video; each entry is `{ type: "image_url", image_url: { url }, frame_type: "first_frame" | "last_frame" }`.
119
- - `input_references[]` — reference-to-video (style guidance); image entries have the same shape, no `frame_type`. Audio and video references are `{ type: "audio_url", audio_url: { url } }` and `{ type: "video_url", video_url: { url } }`; only some models (such as `bytedance/seedance-2.5`) use them, and the rest ignore them. If both arrays are present, `frame_images` wins.
120
+ - `input_references[]` — reference-to-video (style guidance); image entries have the same shape, no `frame_type`. Audio and video references are `{ type: "audio_url", audio_url: { url } }` and `{ type: "video_url", video_url: { url } }`; only some models (such as `bytedance/seedance-2.5` and `alibaba/wan-3.0`) use them, and the rest ignore them. If both arrays are present, `frame_images` wins.
120
121
  - `provider.options.<slug>.parameters.<key>` — provider passthrough, see below.
121
122
 
122
- Image `url` can be a public `https://` URL or a local-file data URL: `MIME=image/png; B64=$(base64 < file.png | tr -d '\n'); url="data:${MIME};base64,${B64}"`. Audio and video references take URLs the same way.
123
+ Image `url` can be a public `https://` URL or a local-file data URL: `MIME=image/png; B64=$(base64 < file.png | tr -d '\n'); url="data:${MIME};base64,${B64}"`. Audio and video references must be public `https://` URLs; data URLs are rejected, so host the file somewhere public first.
123
124
 
124
125
  ## Provider passthrough
125
126
 
@@ -160,7 +161,7 @@ Example:
160
161
  ## Chaining with other skills
161
162
 
162
163
  - **Keyframes:** generate stills with the `image-generation` skill, then pass them as `frame_images` (`first_frame` / `last_frame`) or image `input_references` as data URLs.
163
- - **Sound:** make a voiceover with the `speech-generation` skill or a soundtrack with the `music-generation` skill, then pass the audio as an `audio_url` input reference to a model that uses audio, or mix it onto the finished MP4 (for example with `ffmpeg`).
164
+ - **Sound:** make a voiceover with the `speech-generation` skill or a soundtrack with the `music-generation` skill, then host it at a public `https://` URL and pass that as an `audio_url` input reference to a model that uses audio, or mix it onto the finished MP4 (for example with `ffmpeg`).
164
165
 
165
166
  ## Notes
166
167