@automagik/omni 2.260530.3 → 2.260530.4

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":"film.d.ts","sourceRoot":"","sources":["../../src/commands/film.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAqBpC,wBAAgB,iBAAiB,IAAI,OAAO,CA4H3C"}
1
+ {"version":3,"file":"film.d.ts","sourceRoot":"","sources":["../../src/commands/film.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA2BpC,wBAAgB,iBAAiB,IAAI,OAAO,CA2J3C"}
@@ -1 +1 @@
1
- {"version":3,"file":"imagine.d.ts","sourceRoot":"","sources":["../../src/commands/imagine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAkDpC,wBAAgB,oBAAoB,IAAI,OAAO,CA+I9C"}
1
+ {"version":3,"file":"imagine.d.ts","sourceRoot":"","sources":["../../src/commands/imagine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAgEpC,wBAAgB,oBAAoB,IAAI,OAAO,CA+J9C"}
@@ -0,0 +1,4 @@
1
+ /** Music Command — generate music/audio via Lyria-compatible providers. */
2
+ import { Command } from 'commander';
3
+ export declare function createMusicCommand(): Command;
4
+ //# sourceMappingURL=music.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"music.d.ts","sourceRoot":"","sources":["../../src/commands/music.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAI3E,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAwCpC,wBAAgB,kBAAkB,IAAI,OAAO,CAyE5C"}
@@ -1 +1 @@
1
- {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../src/commands/prompts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAsBpC,wBAAgB,oBAAoB,IAAI,OAAO,CAiH9C"}
1
+ {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../src/commands/prompts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAyBpC,wBAAgB,oBAAoB,IAAI,OAAO,CAiH9C"}
@@ -1 +1 @@
1
- {"version":3,"file":"speak.d.ts","sourceRoot":"","sources":["../../src/commands/speak.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAsCpC,wBAAgB,kBAAkB,IAAI,OAAO,CAoG5C"}
1
+ {"version":3,"file":"speak.d.ts","sourceRoot":"","sources":["../../src/commands/speak.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA6CpC,wBAAgB,kBAAkB,IAAI,OAAO,CAkH5C"}
package/dist/index.js CHANGED
@@ -124593,6 +124593,21 @@ function createOmniClient(config) {
124593
124593
  throw new OmniApiError("Film response missing data", "INVALID_RESPONSE", undefined, 500);
124594
124594
  }
124595
124595
  return data;
124596
+ },
124597
+ async music(body) {
124598
+ const resp = await apiFetch(`${baseUrl}/api/v2/media/music`, {
124599
+ method: "POST",
124600
+ headers: { "Content-Type": "application/json" },
124601
+ body: JSON.stringify(body)
124602
+ });
124603
+ const json = await resp.json();
124604
+ if (!resp.ok)
124605
+ throw OmniApiError.from(json, resp.status);
124606
+ const data = json?.data;
124607
+ if (!data) {
124608
+ throw new OmniApiError("Music response missing data", "INVALID_RESPONSE", undefined, 500);
124609
+ }
124610
+ return data;
124596
124611
  }
124597
124612
  },
124598
124613
  turns: {
@@ -124950,7 +124965,7 @@ import { fileURLToPath } from "url";
124950
124965
  // package.json
124951
124966
  var package_default = {
124952
124967
  name: "@automagik/omni",
124953
- version: "2.260530.3",
124968
+ version: "2.260530.4",
124954
124969
  description: "LLM-optimized CLI for Omni",
124955
124970
  type: "module",
124956
124971
  bin: {
@@ -124982,7 +124997,7 @@ var package_default = {
124982
124997
  postinstall: "node scripts/postinstall-pin-version.cjs",
124983
124998
  "test:integration": "RUN_INTEGRATION_TESTS=1 bun test",
124984
124999
  clean: "rm -rf dist db",
124985
- "build:server": "bun build src/bundled-server-entry.ts --outdir dist/server --entry-naming 'index.[ext]' --asset-naming '[name].[ext]' --target bun --external @anthropic-ai/claude-agent-sdk --external @snazzah/davey --external libsodium-wrappers --external opusscript --external pdf-parse --external mammoth --external exceljs",
125000
+ "build:server": "bun build src/bundled-server-entry.ts --outdir dist/server --entry-naming 'index.[ext]' --asset-naming '[name].[ext]' --target bun --external @anthropic-ai/claude-agent-sdk --external @snazzah/davey --external libsodium-wrappers --external opusscript --external pdf-parse --external mammoth --external exceljs --external sharp",
124986
125001
  "build:migrations": "rm -rf db/drizzle && mkdir -p db && cp -r ../db/drizzle db/drizzle",
124987
125002
  prepack: "bun run build && bun run build:server && bun run build:migrations"
124988
125003
  },
@@ -124998,7 +125013,8 @@ var package_default = {
124998
125013
  opusscript: "^0.1.1",
124999
125014
  ora: "^8.1.1",
125000
125015
  "pdf-parse": "^1.1.1",
125001
- "qrcode-terminal": "^0.12.0"
125016
+ "qrcode-terminal": "^0.12.0",
125017
+ sharp: "^0.34.5"
125002
125018
  },
125003
125019
  devDependencies: {
125004
125020
  "@omni/api": "workspace:*",
@@ -125393,8 +125409,22 @@ ${names}`);
125393
125409
  error(`No instance found matching "${input}"`);
125394
125410
  }
125395
125411
  async function resolveChatId(input, instanceId) {
125396
- if (UUID_RE.test(input))
125412
+ if (UUID_RE.test(input)) {
125413
+ if (instanceId) {
125414
+ const client2 = getClient();
125415
+ let chat = null;
125416
+ try {
125417
+ chat = await client2.chats.get(input);
125418
+ } catch {}
125419
+ if (!chat) {
125420
+ error(`No chat found matching "${input}"`);
125421
+ }
125422
+ if (chat.instanceId !== instanceId) {
125423
+ error(`Chat ${input.slice(0, 8)} belongs to instance ${chat.instanceId}, not ${instanceId}`);
125424
+ }
125425
+ }
125397
125426
  return input;
125427
+ }
125398
125428
  const client = getClient();
125399
125429
  const result = await client.chats.list({ limit: 100, instanceId });
125400
125430
  const chats = result.items;
@@ -131646,11 +131676,11 @@ function createEventsCommand() {
131646
131676
  }
131647
131677
 
131648
131678
  // src/commands/film.ts
131649
- import { writeFileSync as writeFileSync7 } from "fs";
131679
+ import { readFileSync as readFileSync8, writeFileSync as writeFileSync7 } from "fs";
131650
131680
  import { resolve as resolvePath } from "path";
131651
131681
  init_output();
131652
131682
  function createFilmCommand() {
131653
- return new Command("film").description("Generate a video from a text prompt (Gemini Veo 3.1)").argument("<prompt>", "Text prompt describing the video").option("--duration <seconds>", "Clip duration in seconds (provider-dependent max)").option("--resolution <res>", "Resolution hint (720p or 1080p)").option("--aspect-ratio <ratio>", "Aspect ratio (16:9 or 9:16)", "16:9").option("--reference <path>", "Reference image path (reserved for future use)").option("--extend <operationId>", "Extend an existing video operation (reserved for future use)").option("--seed <number>", "RNG seed for reproducible output").option("--no-audio", "Disable audio generation").option("-o, --output <path>", "Save video to file locally (does not send)").option("--reply [message-id]", "Quote-reply to trigger message or specific message ID").option("--provider <name>", "Video generation provider (default: gemini)").option("--instance <id>", "Override instance (default: from context)").option("--chat <id>", "Override chat (default: from context)").action(async (prompt, options) => {
131683
+ return new Command("film").description("Generate a video from a text prompt (Gemini Veo 3.1)").argument("<prompt>", "Text prompt describing the video").option("--duration <seconds>", "Clip duration in seconds (provider-dependent max)").option("--resolution <res>", "Resolution hint (720p or 1080p)").option("--aspect-ratio <ratio>", "Aspect ratio (16:9 or 9:16)", "16:9").option("--reference <path>", "Reference image path for image-to-video").option("--extend <operationId>", "Extend an existing video operation (reserved for future use)").option("--dialogue <text>", "Dialogue direction to fold into the prompt").option("--camera <text>", "Camera/framing direction").option("--shot <text>", "Shot-list item (repeatable)", (value, previous = []) => [...previous, value], []).option("--audio-direction <text>", "Sound/dialogue/ambient direction").option("--music <text>", "Music direction").option("--style <text>", "Visual style direction").option("--seed <number>", "RNG seed for reproducible output").option("--no-audio", "Disable audio generation").option("-o, --output <path>", "Save video to file locally (does not send)").option("--reply [message-id]", "Quote-reply to trigger message or specific message ID").option("--provider <name>", "Video generation provider (default: gemini)").option("--instance <id>", "Override instance (default: from context)").option("--chat <id>", "Override chat (default: from context)").action(async (prompt, options) => {
131654
131684
  const client = getClient();
131655
131685
  const saveOnly = Boolean(options.output);
131656
131686
  let instanceId;
@@ -131686,6 +131716,18 @@ function createFilmCommand() {
131686
131716
  if (options.seed !== undefined && Number.isNaN(seed)) {
131687
131717
  return error(`Invalid --seed value: ${options.seed}`);
131688
131718
  }
131719
+ let imageBase64;
131720
+ let imageMimeType;
131721
+ if (options.reference) {
131722
+ try {
131723
+ const ref = readFileSync8(resolvePath(options.reference));
131724
+ imageBase64 = ref.toString("base64");
131725
+ imageMimeType = mimeForImagePath(options.reference);
131726
+ } catch (err) {
131727
+ const message = err instanceof Error ? err.message : "Unknown error";
131728
+ return error(`Failed to read --reference ${options.reference}: ${message}`);
131729
+ }
131730
+ }
131689
131731
  const spinner = ora({
131690
131732
  text: "Submitting video generation request\u2026",
131691
131733
  isEnabled: getCurrentFormat() === "human"
@@ -131703,7 +131745,15 @@ function createFilmCommand() {
131703
131745
  resolution: options.resolution,
131704
131746
  aspectRatio: options.aspectRatio,
131705
131747
  seed,
131706
- audio: options.audio !== false
131748
+ audio: options.audio !== false,
131749
+ imageBase64,
131750
+ imageMimeType,
131751
+ dialogue: options.dialogue,
131752
+ camera: options.camera,
131753
+ shotList: options.shot,
131754
+ audioDirection: options.audioDirection,
131755
+ music: options.music,
131756
+ style: options.style
131707
131757
  });
131708
131758
  clearInterval(tick);
131709
131759
  spinner.succeed(`Video ready (${result.sizeBytes} bytes, ${result.mimeType})`);
@@ -131732,9 +131782,17 @@ function createFilmCommand() {
131732
131782
  }
131733
131783
  });
131734
131784
  }
131785
+ function mimeForImagePath(path) {
131786
+ const lower = path.toLowerCase();
131787
+ if (lower.endsWith(".jpg") || lower.endsWith(".jpeg"))
131788
+ return "image/jpeg";
131789
+ if (lower.endsWith(".webp"))
131790
+ return "image/webp";
131791
+ return "image/png";
131792
+ }
131735
131793
 
131736
131794
  // src/commands/follow-up.ts
131737
- import { readFileSync as readFileSync8 } from "fs";
131795
+ import { readFileSync as readFileSync9 } from "fs";
131738
131796
  init_output();
131739
131797
  var VALID_SCOPES = ["agents", "instances", "chats"];
131740
131798
  function assertScope(scope) {
@@ -131752,9 +131810,9 @@ async function resolveScopedId(scope, id) {
131752
131810
  function readJsonArg(raw2) {
131753
131811
  let body = raw2;
131754
131812
  if (body === "-") {
131755
- body = readFileSync8(0, "utf8");
131813
+ body = readFileSync9(0, "utf8");
131756
131814
  } else if (body.startsWith("@")) {
131757
- body = readFileSync8(body.slice(1), "utf8");
131815
+ body = readFileSync9(body.slice(1), "utf8");
131758
131816
  }
131759
131817
  try {
131760
131818
  return JSON.parse(body);
@@ -131910,6 +131968,7 @@ import { writeFileSync as writeFileSync8 } from "fs";
131910
131968
  import { basename as basename2, dirname as dirname4, extname as extname2, join as join14 } from "path";
131911
131969
  init_output();
131912
131970
  var ALLOWED_ASPECT_RATIOS = ["1:1", "4:3", "3:4", "16:9", "9:16", "3:2", "2:3"];
131971
+ var ALLOWED_OUTPUT_FORMATS = ["png", "jpeg", "webp"];
131913
131972
  function extensionForMime(mimeType) {
131914
131973
  if (mimeType.includes("jpeg") || mimeType.includes("jpg"))
131915
131974
  return ".jpg";
@@ -131934,8 +131993,16 @@ function parseAspectRatio(value) {
131934
131993
  }
131935
131994
  return value;
131936
131995
  }
131996
+ function parseOutputFormat(value) {
131997
+ if (!value)
131998
+ return;
131999
+ if (!ALLOWED_OUTPUT_FORMATS.includes(value)) {
132000
+ error(`Invalid --output-format "${value}". Allowed: ${ALLOWED_OUTPUT_FORMATS.join(", ")}`);
132001
+ }
132002
+ return value;
132003
+ }
131937
132004
  function createImagineCommand() {
131938
- return new Command("imagine").description("Generate an image from a text prompt (Gemini Nano Banana) and send or save it").argument("<prompt...>", "Prompt describing the image to generate").option("--aspect-ratio <ratio>", "Aspect ratio (1:1, 3:4, 4:3, 9:16, 16:9, 3:2, 2:3)").option("--size <size>", "Image size preset (1K, 2K, 4K \u2014 not all models support all sizes)").option("--model <name>", "Model alias (nano-banana-2, nano-banana-pro) or raw Gemini model ID").option("--provider <name>", "Provider override (default: config imagegen.provider)").option("--count <n>", "Number of images to generate (1-4)", "1").option("--output <path>", "Save locally instead of sending (appends -N for count > 1)").option("--reply [message-id]", "Quote-reply to the trigger message or a specific message ID").option("--instance <id>", "Override instance (default: from context)").option("--chat <id>", "Override chat (default: from context)").action(async (promptParts, options) => {
132005
+ return new Command("imagine").description("Generate an image from a text prompt (Gemini Nano Banana) and send or save it").argument("<prompt...>", "Prompt describing the image to generate").option("--aspect-ratio <ratio>", "Aspect ratio (1:1, 3:4, 4:3, 9:16, 16:9, 3:2, 2:3)").option("--size <size>", "Image size preset (1K, 2K, 4K \u2014 not all models support all sizes)").option("--model <name>", "Model alias (nano-banana-2, nano-banana-pro) or raw Gemini model ID").option("--provider <name>", "Provider override (default: config imagegen.provider)").option("--quality <quality>", "Quality hint (OpenAI/provider-specific)").option("--background <mode>", "Background mode (OpenAI/provider-specific)").option("--output-format <fmt>", "Output format: png, jpeg, webp").option("--compression <0-100>", "Output compression 0-100").option("--count <n>", "Number of images to generate (1-4)", "1").option("--output <path>", "Save locally instead of sending (appends -N for count > 1)").option("--reply [message-id]", "Quote-reply to the trigger message or a specific message ID").option("--instance <id>", "Override instance (default: from context)").option("--chat <id>", "Override chat (default: from context)").action(async (promptParts, options) => {
131939
132006
  const prompt = promptParts.join(" ").trim();
131940
132007
  if (!prompt) {
131941
132008
  return error('Prompt is required. Example: omni imagine "a neon cat in Tokyo"');
@@ -131945,6 +132012,14 @@ function createImagineCommand() {
131945
132012
  return error("--count must be an integer between 1 and 4");
131946
132013
  }
131947
132014
  const aspectRatio = parseAspectRatio(options.aspectRatio);
132015
+ const outputFormat = parseOutputFormat(options.outputFormat);
132016
+ let compression;
132017
+ if (options.compression !== undefined) {
132018
+ compression = Number.parseInt(options.compression, 10);
132019
+ if (Number.isNaN(compression) || compression < 0 || compression > 100) {
132020
+ return error("--compression must be an integer between 0 and 100");
132021
+ }
132022
+ }
131948
132023
  const saveLocally = !!options.output;
131949
132024
  let instanceId;
131950
132025
  let chatId;
@@ -131980,7 +132055,11 @@ function createImagineCommand() {
131980
132055
  count,
131981
132056
  aspectRatio,
131982
132057
  imageSize: options.size,
131983
- model: options.model
132058
+ model: options.model,
132059
+ quality: options.quality,
132060
+ background: options.background,
132061
+ outputFormat,
132062
+ compression
131984
132063
  });
131985
132064
  } catch (err) {
131986
132065
  const message = err instanceof Error ? err.message : "Unknown error";
@@ -134526,6 +134605,86 @@ async function handleCloseContact(options) {
134526
134605
  }
134527
134606
  }
134528
134607
 
134608
+ // src/commands/music.ts
134609
+ import { writeFileSync as writeFileSync9 } from "fs";
134610
+ import { resolve as resolvePath2 } from "path";
134611
+ init_output();
134612
+ function extensionForMime2(mimeType) {
134613
+ if (mimeType.includes("wav"))
134614
+ return ".wav";
134615
+ if (mimeType.includes("ogg") || mimeType.includes("opus"))
134616
+ return ".ogg";
134617
+ if (mimeType.includes("aac"))
134618
+ return ".aac";
134619
+ if (mimeType.includes("flac"))
134620
+ return ".flac";
134621
+ return ".mp3";
134622
+ }
134623
+ function parsePositiveIntOption(value, flag) {
134624
+ if (value === undefined)
134625
+ return;
134626
+ const parsed = Number.parseInt(value, 10);
134627
+ if (Number.isNaN(parsed))
134628
+ throw new Error(`Invalid ${flag}: ${value}`);
134629
+ return parsed;
134630
+ }
134631
+ function assertMusicMode(mode) {
134632
+ if (mode && mode !== "clip" && mode !== "pro")
134633
+ throw new Error("--mode must be clip or pro");
134634
+ }
134635
+ function createMusicCommand() {
134636
+ return new Command("music").description("Generate music/audio from a prompt (Gemini Lyria)").argument("<prompt...>", "Prompt describing the music/song").option("--provider <name>", "Music provider (default: config musicgen.provider)").option("--model <model>", "Model override (e.g. lyria-3-pro-preview, lyria-3-clip-preview)").option("--mode <mode>", "Generation mode: clip or pro").option("--duration <seconds>", "Target duration in seconds").option("--instrumental", "Generate instrumental music without vocals").option("--lyrics <text>", "Lyrics to include").option("--genre <text>", "Genre hint").option("--mood <text>", "Mood hint").option("--bpm <number>", "Tempo in BPM").option("--instrument <name>", "Instrument hint (repeatable)", (value, previous = []) => [...previous, value], []).option("--singer-profile <text>", "Singer/vocal profile").option("--style <text>", "Style direction").option("-o, --output <path>", "Save audio to file (default: music.<returned-format>)").action(async (promptParts, options) => {
134637
+ const prompt = promptParts.join(" ").trim();
134638
+ if (!prompt)
134639
+ return error('Prompt is required. Example: omni music "lo-fi samba for coding"');
134640
+ let durationSec;
134641
+ let bpm;
134642
+ try {
134643
+ durationSec = parsePositiveIntOption(options.duration, "--duration");
134644
+ bpm = parsePositiveIntOption(options.bpm, "--bpm");
134645
+ assertMusicMode(options.mode);
134646
+ } catch (err2) {
134647
+ const message2 = err2 instanceof Error ? err2.message : "Invalid music options";
134648
+ return error(message2);
134649
+ }
134650
+ const spinner = ora({ text: "Generating music\u2026", isEnabled: getCurrentFormat() === "human" }).start();
134651
+ try {
134652
+ const client = getClient();
134653
+ const result = await client.media.music({
134654
+ prompt,
134655
+ provider: options.provider,
134656
+ model: options.model,
134657
+ mode: options.mode,
134658
+ durationSec,
134659
+ instrumental: options.instrumental,
134660
+ lyrics: options.lyrics,
134661
+ genre: options.genre,
134662
+ mood: options.mood,
134663
+ bpm,
134664
+ instruments: options.instrument,
134665
+ singerProfile: options.singerProfile,
134666
+ style: options.style
134667
+ });
134668
+ const audio = Buffer.from(result.audioBase64, "base64");
134669
+ const out = resolvePath2(options.output ?? `music${extensionForMime2(result.mimeType)}`);
134670
+ writeFileSync9(out, audio);
134671
+ spinner.succeed(`Music ready (${result.sizeBytes} bytes, ${result.mimeType})`);
134672
+ success("Music saved", {
134673
+ path: out,
134674
+ provider: result.provider,
134675
+ model: result.model,
134676
+ mimeType: result.mimeType,
134677
+ sizeBytes: result.sizeBytes,
134678
+ processingMs: result.processingMs
134679
+ });
134680
+ } catch (err2) {
134681
+ spinner.fail("Music generation failed");
134682
+ const message2 = err2 instanceof Error ? err2.message : "Unknown error";
134683
+ error(`omni music: ${message2}`);
134684
+ }
134685
+ });
134686
+ }
134687
+
134529
134688
  // src/commands/open.ts
134530
134689
  init_output();
134531
134690
  function createOpenCommand() {
@@ -134776,10 +134935,13 @@ function createPersonsCommand() {
134776
134935
  // src/commands/prompts.ts
134777
134936
  init_output();
134778
134937
  var PROMPT_MAP = {
134938
+ audio: "prompt.audio_transcription",
134779
134939
  image: "prompt.image_description",
134780
134940
  video: "prompt.video_description",
134781
134941
  document: "prompt.document_ocr",
134782
- gate: "prompt.response_gate"
134942
+ gate: "prompt.response_gate",
134943
+ "tts-openai": "tts.openai.default_instructions",
134944
+ "tts-gemini": "tts.gemini.default_style"
134783
134945
  };
134784
134946
  var PROMPT_NAMES = Object.keys(PROMPT_MAP);
134785
134947
  function resolveKey(name) {
@@ -134811,7 +134973,7 @@ function createPromptsCommand() {
134811
134973
  error(`Failed to list prompts: ${message2}`);
134812
134974
  }
134813
134975
  });
134814
- prompts.command("get <name>").description("Show current prompt (image|video|document|gate)").action(async (name) => {
134976
+ prompts.command("get <name>").description(`Show current prompt (${PROMPT_NAMES.join("|")})`).action(async (name) => {
134815
134977
  const key = resolveKey(name);
134816
134978
  const client = getClient();
134817
134979
  try {
@@ -134877,7 +135039,7 @@ init_output();
134877
135039
  init_src();
134878
135040
  import { execFileSync as execFileSync4, execSync } from "child_process";
134879
135041
  import * as nodeCrypto2 from "crypto";
134880
- import { existsSync as existsSync15, mkdirSync as mkdirSync10, readFileSync as readFileSync10, writeFileSync as writeFileSync9 } from "fs";
135042
+ import { existsSync as existsSync15, mkdirSync as mkdirSync10, readFileSync as readFileSync11, writeFileSync as writeFileSync10 } from "fs";
134881
135043
  import { homedir as homedir11 } from "os";
134882
135044
  import { dirname as dirname6, resolve as resolve3 } from "path";
134883
135045
  import { createInterface as createInterface2 } from "readline";
@@ -135110,14 +135272,14 @@ var PLUGIN_MARKER = "plugin-openclaw/omni.ts";
135110
135272
  function readOpenClawConfig(configPath) {
135111
135273
  if (!existsSync15(configPath))
135112
135274
  return {};
135113
- const raw2 = readFileSync10(configPath, "utf-8").trim();
135275
+ const raw2 = readFileSync11(configPath, "utf-8").trim();
135114
135276
  if (!raw2)
135115
135277
  return {};
135116
135278
  return JSON.parse(raw2);
135117
135279
  }
135118
135280
  function writeOpenClawConfig(configPath, config2) {
135119
135281
  mkdirSync10(dirname6(configPath), { recursive: true, mode: 448 });
135120
- writeFileSync9(configPath, `${JSON.stringify(config2, null, 2)}
135282
+ writeFileSync10(configPath, `${JSON.stringify(config2, null, 2)}
135121
135283
  `, { mode: 384 });
135122
135284
  }
135123
135285
  function isPluginRegistered(config2, marker, pluginPath) {
@@ -136204,7 +136366,7 @@ function createSayCommand() {
136204
136366
  }
136205
136367
 
136206
136368
  // src/commands/see.ts
136207
- import { existsSync as existsSync16, readFileSync as readFileSync11, statSync as statSync5 } from "fs";
136369
+ import { existsSync as existsSync16, readFileSync as readFileSync12, statSync as statSync5 } from "fs";
136208
136370
  import { extname as extname4 } from "path";
136209
136371
  init_output();
136210
136372
  var MIME_BY_EXT = {
@@ -136247,7 +136409,7 @@ function loadMedia(file) {
136247
136409
  error(`File is empty: ${file}`);
136248
136410
  }
136249
136411
  try {
136250
- return { buffer: readFileSync11(file), mimeType: guessMimeType(file) };
136412
+ return { buffer: readFileSync12(file), mimeType: guessMimeType(file) };
136251
136413
  } catch (err2) {
136252
136414
  const message2 = err2 instanceof Error ? err2.message : "Unknown error";
136253
136415
  return error(`Failed to read ${file}: ${message2}`);
@@ -136322,7 +136484,7 @@ function createSeeCommand() {
136322
136484
  }
136323
136485
 
136324
136486
  // src/commands/send.ts
136325
- import { existsSync as existsSync17, readFileSync as readFileSync12 } from "fs";
136487
+ import { existsSync as existsSync17, readFileSync as readFileSync13 } from "fs";
136326
136488
  import { basename as basename5, extname as extname5 } from "path";
136327
136489
  init_source();
136328
136490
  init_config();
@@ -136342,7 +136504,7 @@ function getMediaType2(path) {
136342
136504
  return "document";
136343
136505
  }
136344
136506
  function readFileAsBase64(path) {
136345
- const buffer3 = readFileSync12(path);
136507
+ const buffer3 = readFileSync13(path);
136346
136508
  return buffer3.toString("base64");
136347
136509
  }
136348
136510
  var messageSenders = {
@@ -136807,7 +136969,7 @@ function parseSpeed(value) {
136807
136969
  return n2;
136808
136970
  }
136809
136971
  function createSpeakCommand() {
136810
- return new Command("speak").description("Synthesize text to speech and send as a voice note (or save with --output)").argument("<text>", "Text to convert to speech").option("--provider <name>", "TTS provider (gemini, elevenlabs). Default: server config.").option("--voice <name>", "Voice identifier (e.g. Kore for Gemini, JBFqn... for ElevenLabs)").option("--style <prompt>", 'Style prompt prepended to text (Gemini only, e.g. "Say cheerfully")').option("--language <code>", "BCP-47 language code (e.g. en-US, pt-BR)").option("--speed <factor>", "Speaking speed multiplier 0.5-2.0 (provider-dependent)").option("--format <fmt>", `Audio format: ${ALLOWED_FORMATS2.join(", ")} (default: ogg)`).option("--output <path>", "Save audio to file instead of sending").option("--instance <id>", "Override instance (default: from context)").option("--chat <id>", "Override chat (default: from context)").action(async (text3, options3) => {
136972
+ return new Command("speak").description("Synthesize text to speech and send as a voice note (or save with --output)").argument("<text>", "Text to convert to speech").option("--provider <name>", "TTS provider (gemini, openai, elevenlabs). Default: server config.").option("--model <model>", "TTS model override (provider-specific)").option("--voice <name>", "Voice identifier (e.g. Kore for Gemini, JBFqn... for ElevenLabs)").option("--style <prompt>", 'Style prompt prepended to text (Gemini only, e.g. "Say cheerfully")').option("--instructions <text>", "Provider-native speaking instructions").option("--tone <text>", "Tone guidance").option("--accent <text>", "Accent guidance").option("--pace <text>", "Pace guidance").option("--emotion <text>", "Emotion guidance").option("--voice-note-profile <name>", "Voice-note profile/preset name").option("--language <code>", "BCP-47 language code (e.g. en-US, pt-BR)").option("--speed <factor>", "Speaking speed multiplier 0.5-2.0 (provider-dependent)").option("--format <fmt>", `Audio format: ${ALLOWED_FORMATS2.join(", ")} (default: ogg)`).option("--output <path>", "Save audio to file instead of sending").option("--instance <id>", "Override instance (default: from context)").option("--chat <id>", "Override chat (default: from context)").action(async (text3, options3) => {
136811
136973
  const client = getClient();
136812
136974
  const format = parseFormat2(options3.format);
136813
136975
  const speed = parseSpeed(options3.speed);
@@ -136823,7 +136985,14 @@ function createSpeakCommand() {
136823
136985
  language: options3.language,
136824
136986
  speed,
136825
136987
  format,
136826
- style: options3.style
136988
+ style: options3.style,
136989
+ model: options3.model,
136990
+ instructions: options3.instructions,
136991
+ tone: options3.tone,
136992
+ accent: options3.accent,
136993
+ pace: options3.pace,
136994
+ emotion: options3.emotion,
136995
+ voiceNoteProfile: options3.voiceNoteProfile
136827
136996
  });
136828
136997
  audioBuffer = result.audio;
136829
136998
  mimeType = result.mimeType;
@@ -137634,7 +137803,7 @@ async function cleanupLegacyArtifacts(skipList) {
137634
137803
  init_output();
137635
137804
 
137636
137805
  // src/update-diagnostics.ts
137637
- import { existsSync as existsSync19, mkdirSync as mkdirSync12, readFileSync as readFileSync13, writeFileSync as writeFileSync10 } from "fs";
137806
+ import { existsSync as existsSync19, mkdirSync as mkdirSync12, readFileSync as readFileSync14, writeFileSync as writeFileSync11 } from "fs";
137638
137807
  import { homedir as homedir13 } from "os";
137639
137808
  import { join as join18 } from "path";
137640
137809
  var UPDATE_DIAGNOSTICS_SCHEMA_VERSION = 1;
@@ -137669,7 +137838,7 @@ function tailFileLines(path, maxLines) {
137669
137838
  if (!existsSync19(path))
137670
137839
  return [];
137671
137840
  try {
137672
- const raw2 = readFileSync13(path, "utf8");
137841
+ const raw2 = readFileSync14(path, "utf8");
137673
137842
  const lines = raw2.split(/\r?\n/);
137674
137843
  if (lines.length > 0 && lines[lines.length - 1] === "")
137675
137844
  lines.pop();
@@ -137705,7 +137874,7 @@ function writeDiagnostics(state, exitCode) {
137705
137874
  if (!existsSync19(dir)) {
137706
137875
  mkdirSync12(dir, { recursive: true, mode: 448 });
137707
137876
  }
137708
- writeFileSync10(path, `${JSON.stringify(state, null, 2)}
137877
+ writeFileSync11(path, `${JSON.stringify(state, null, 2)}
137709
137878
  `, { mode: 384 });
137710
137879
  return path;
137711
137880
  } catch {
@@ -138509,7 +138678,7 @@ init_config();
138509
138678
  init_output();
138510
138679
 
138511
138680
  // src/manifest-pin.ts
138512
- import { existsSync as existsSync21, readFileSync as readFileSync14, renameSync as renameSync3, writeFileSync as writeFileSync11 } from "fs";
138681
+ import { existsSync as existsSync21, readFileSync as readFileSync15, renameSync as renameSync3, writeFileSync as writeFileSync12 } from "fs";
138513
138682
  import { homedir as homedir14 } from "os";
138514
138683
  import { join as join20 } from "path";
138515
138684
  var PACKAGE_NAME2 = "@automagik/omni";
@@ -138519,7 +138688,7 @@ function pinManifestEntry(manifestPath, exactVersion) {
138519
138688
  return false;
138520
138689
  let manifest;
138521
138690
  try {
138522
- manifest = JSON.parse(readFileSync14(manifestPath, "utf-8"));
138691
+ manifest = JSON.parse(readFileSync15(manifestPath, "utf-8"));
138523
138692
  } catch {
138524
138693
  return false;
138525
138694
  }
@@ -138545,7 +138714,7 @@ function pinManifestEntry(manifestPath, exactVersion) {
138545
138714
  return false;
138546
138715
  const tmp = `${manifestPath}.tmp.${process.pid}`;
138547
138716
  try {
138548
- writeFileSync11(tmp, `${JSON.stringify(manifest, null, 2)}
138717
+ writeFileSync12(tmp, `${JSON.stringify(manifest, null, 2)}
138549
138718
  `, { mode: 420 });
138550
138719
  renameSync3(tmp, manifestPath);
138551
138720
  } catch {
@@ -138761,6 +138930,12 @@ var COMMANDS = [
138761
138930
  helpGroup: "Core",
138762
138931
  helpDescription: "Generate a video from a prompt (Gemini Veo 3.1, verb command)"
138763
138932
  },
138933
+ {
138934
+ create: createMusicCommand,
138935
+ category: "core",
138936
+ helpGroup: "Core",
138937
+ helpDescription: "Generate music/audio from a prompt (Gemini Lyria, verb command)"
138938
+ },
138764
138939
  {
138765
138940
  create: createSpeakCommand,
138766
138941
  category: "core",
@@ -1 +1 @@
1
- {"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../src/resolve.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH;;;;;;;;;;GAUG;AACH,wBAAsB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA+BtE;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA+BvF;AAED;;;;;;;;GAQG;AACH,wBAAsB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAY1F;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAwCtF;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAoBpE;AAED;;;;;;;;;GASG;AACH,wBAAsB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA+BjE;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA8BxE;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAkBtE;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA8BtE;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA8BnE;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA8BrE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAiBvF"}
1
+ {"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../src/resolve.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH;;;;;;;;;;GAUG;AACH,wBAAsB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA+BtE;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAgDvF;AAED;;;;;;;;GAQG;AACH,wBAAsB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAY1F;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAwCtF;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAoBpE;AAED;;;;;;;;;GASG;AACH,wBAAsB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA+BjE;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA8BxE;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAkBtE;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA8BtE;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA8BnE;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA8BrE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAiBvF"}
@@ -1877,6 +1877,17 @@ export declare function createOmniClient(config: OmniClientConfig): {
1877
1877
  speed?: number;
1878
1878
  format?: "mp3" | "ogg" | "opus" | "wav" | "pcm" | "flac" | "aac";
1879
1879
  style?: string;
1880
+ model?: string;
1881
+ instructions?: string;
1882
+ tone?: string;
1883
+ accent?: string;
1884
+ pace?: string;
1885
+ emotion?: string;
1886
+ voiceNoteProfile?: string;
1887
+ multiSpeaker?: Array<{
1888
+ speaker: string;
1889
+ voice: string;
1890
+ }>;
1880
1891
  }): Promise<{
1881
1892
  provider: string;
1882
1893
  mimeType: string;
@@ -1935,6 +1946,10 @@ export declare function createOmniClient(config: OmniClientConfig): {
1935
1946
  model?: string;
1936
1947
  negativePrompt?: string;
1937
1948
  seed?: number;
1949
+ quality?: string;
1950
+ background?: string;
1951
+ outputFormat?: "png" | "jpeg" | "webp";
1952
+ compression?: number;
1938
1953
  }): Promise<{
1939
1954
  provider: string;
1940
1955
  processingMs: number;
@@ -1989,6 +2004,14 @@ export declare function createOmniClient(config: OmniClientConfig): {
1989
2004
  aspectRatio?: string;
1990
2005
  seed?: number;
1991
2006
  audio?: boolean;
2007
+ imageBase64?: string;
2008
+ imageMimeType?: string;
2009
+ dialogue?: string;
2010
+ camera?: string;
2011
+ shotList?: string[];
2012
+ audioDirection?: string;
2013
+ music?: string;
2014
+ style?: string;
1992
2015
  }): Promise<{
1993
2016
  provider: string;
1994
2017
  operationId: string;
@@ -1997,6 +2020,37 @@ export declare function createOmniClient(config: OmniClientConfig): {
1997
2020
  durationMs: number;
1998
2021
  videoBase64: string;
1999
2022
  }>;
2023
+ /** Generate music/audio via the registered music-generation provider. */
2024
+ music(body: {
2025
+ prompt: string;
2026
+ provider?: string;
2027
+ model?: string;
2028
+ mode?: "clip" | "pro";
2029
+ durationSec?: number;
2030
+ instrumental?: boolean;
2031
+ lyrics?: string;
2032
+ timedSections?: Array<{
2033
+ start: string;
2034
+ end: string;
2035
+ instruction: string;
2036
+ }>;
2037
+ genre?: string;
2038
+ mood?: string;
2039
+ bpm?: number;
2040
+ instruments?: string[];
2041
+ singerProfile?: string;
2042
+ imageBase64?: string;
2043
+ imageMimeType?: string;
2044
+ style?: string;
2045
+ }): Promise<{
2046
+ provider: string;
2047
+ model: string;
2048
+ mimeType: string;
2049
+ sizeBytes: number;
2050
+ durationMs?: number;
2051
+ processingMs: number;
2052
+ audioBase64: string;
2053
+ }>;
2000
2054
  };
2001
2055
  /**
2002
2056
  * Turn lifecycle for turn-based agent execution