@automagik/omni 2.260727.1 → 2.260727.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/dist/index.js CHANGED
@@ -126250,7 +126250,7 @@ import { fileURLToPath } from "url";
126250
126250
  // package.json
126251
126251
  var package_default = {
126252
126252
  name: "@automagik/omni",
126253
- version: "2.260727.1",
126253
+ version: "2.260727.2",
126254
126254
  description: "LLM-optimized CLI for Omni",
126255
126255
  type: "module",
126256
126256
  bin: {
@@ -227026,7 +227026,7 @@ var init_sentry_scrub = __esm(() => {
227026
227026
  var require_package7 = __commonJS((exports, module) => {
227027
227027
  module.exports = {
227028
227028
  name: "@omni/api",
227029
- version: "2.260727.1",
227029
+ version: "2.260727.2",
227030
227030
  type: "module",
227031
227031
  exports: {
227032
227032
  ".": {
@@ -368234,6 +368234,15 @@ function parseVoiceStreamParams(url) {
368234
368234
  return null;
368235
368235
  return { sessionId, apiKey, format: format === "pcm" ? "pcm" : "opus", filterUserId };
368236
368236
  }
368237
+ async function authorizeVoiceApiKey(validate, apiKey) {
368238
+ if (!validate)
368239
+ return false;
368240
+ try {
368241
+ return await validate(apiKey) != null;
368242
+ } catch {
368243
+ return false;
368244
+ }
368245
+ }
368237
368246
  var log124, opusCodec = null;
368238
368247
  var init_voice3 = __esm(() => {
368239
368248
  init_src();
@@ -368348,14 +368357,11 @@ function startBunServer(app) {
368348
368357
  ws.close(4001, "Invalid parameters");
368349
368358
  return;
368350
368359
  }
368351
- if (globalDbRef) {
368352
- try {
368353
- const apiKeyService = new ApiKeyService(globalDbRef);
368354
- await apiKeyService.validate(params.apiKey);
368355
- } catch {
368356
- ws.close(4004, "Invalid API key");
368357
- return;
368358
- }
368360
+ const db3 = globalDbRef;
368361
+ const authorized = await authorizeVoiceApiKey(db3 ? (key) => new ApiKeyService(db3).validate(key) : null, params.apiKey);
368362
+ if (!authorized) {
368363
+ ws.close(4004, "Invalid API key");
368364
+ return;
368359
368365
  }
368360
368366
  const voicePlugin = globalChannelRegistry?.getAll().find((p2) => isVoiceCapable(p2) && p2.voiceSession(params.sessionId));
368361
368367
  if (!voicePlugin) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automagik/omni",
3
- "version": "2.260727.1",
3
+ "version": "2.260727.2",
4
4
  "description": "LLM-optimized CLI for Omni",
5
5
  "type": "module",
6
6
  "bin": {