@automagik/omni 2.260422.1 → 2.260422.3

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
@@ -113804,7 +113804,7 @@ import { fileURLToPath } from "url";
113804
113804
  // package.json
113805
113805
  var package_default = {
113806
113806
  name: "@automagik/omni",
113807
- version: "2.260422.1",
113807
+ version: "2.260422.3",
113808
113808
  description: "LLM-optimized CLI for Omni",
113809
113809
  type: "module",
113810
113810
  bin: {
@@ -224451,7 +224451,7 @@ var init_sentry_scrub = __esm(() => {
224451
224451
  var require_package8 = __commonJS((exports, module) => {
224452
224452
  module.exports = {
224453
224453
  name: "@omni/api",
224454
- version: "2.260422.1",
224454
+ version: "2.260422.3",
224455
224455
  type: "module",
224456
224456
  exports: {
224457
224457
  ".": {
@@ -347967,6 +347967,26 @@ var init_src7 = __esm(() => {
347967
347967
  init_pricing();
347968
347968
  });
347969
347969
 
347970
+ // ../api/src/services/batch-pricing.ts
347971
+ function computeEstimatedCostCents(counts, pricing = BATCH_PRICING_V1) {
347972
+ const audioUsd = counts.audioCount * pricing.audioAvgMinutes * pricing.audioPerMinuteUsd;
347973
+ const imageUsd = counts.imageCount / 1000 * pricing.imagePer1kUsd;
347974
+ const videoUsd = counts.videoCount / 1000 * pricing.videoPer1kUsd;
347975
+ const documentUsd = counts.documentCount / 1000 * pricing.documentPer1kUsd;
347976
+ const totalUsd = audioUsd + imageUsd + videoUsd + documentUsd;
347977
+ return Math.ceil(totalUsd * 100);
347978
+ }
347979
+ var BATCH_PRICING_V1, BATCH_PRICING_VERSION = "2026-04-v1";
347980
+ var init_batch_pricing = __esm(() => {
347981
+ BATCH_PRICING_V1 = {
347982
+ audioPerMinuteUsd: 0.04 / 60,
347983
+ audioAvgMinutes: 40 / 60,
347984
+ imagePer1kUsd: 0.15,
347985
+ videoPer1kUsd: 9,
347986
+ documentPer1kUsd: 0.5
347987
+ };
347988
+ });
347989
+
347970
347990
  // ../api/src/services/media-storage.ts
347971
347991
  import { existsSync as existsSync5, mkdirSync as mkdirSync3, readFileSync as readFileSync8, statSync as statSync3, writeFileSync as writeFileSync3 } from "fs";
347972
347992
  import { dirname as dirname8, extname as extname2, join as join18, relative as relative2 } from "path";
@@ -348183,7 +348203,8 @@ class BatchJobService {
348183
348203
  contentTypes: contentTypes2 ?? ["audio", "image", "video", "document"],
348184
348204
  force,
348185
348205
  delayMinMs: delayMinMs ?? BatchJobService.DEFAULT_DELAY_MIN_MS,
348186
- delayMaxMs: delayMaxMs ?? BatchJobService.DEFAULT_DELAY_MAX_MS
348206
+ delayMaxMs: delayMaxMs ?? BatchJobService.DEFAULT_DELAY_MAX_MS,
348207
+ pricingVersion: BATCH_PRICING_VERSION
348187
348208
  };
348188
348209
  const jobData = {
348189
348210
  jobType,
@@ -348202,7 +348223,12 @@ class BatchJobService {
348202
348223
  if (!created) {
348203
348224
  throw new Error("Failed to create batch job");
348204
348225
  }
348205
- log76.info("Batch job created", { jobId: created.id, jobType, instanceId });
348226
+ log76.info("Batch job created", {
348227
+ jobId: created.id,
348228
+ jobType,
348229
+ instanceId,
348230
+ pricingVersion: BATCH_PRICING_VERSION
348231
+ });
348206
348232
  if (this.eventBus) {
348207
348233
  await this.eventBus.publish("batch-job.created", {
348208
348234
  jobId: created.id,
@@ -348306,7 +348332,12 @@ class BatchJobService {
348306
348332
  else if (type === "document")
348307
348333
  counts.documentCount++;
348308
348334
  }
348309
- const estimatedCostCents = counts.audioCount * 10 + counts.imageCount * 1 + counts.videoCount * 2 + counts.documentCount * 0;
348335
+ const estimatedCostCents = computeEstimatedCostCents(counts);
348336
+ log76.debug("Batch cost estimated", {
348337
+ totalItems: items.length,
348338
+ estimatedCostCents,
348339
+ pricingVersion: BATCH_PRICING_VERSION
348340
+ });
348310
348341
  const avgDelayMs = (BatchJobService.DEFAULT_DELAY_MIN_MS + BatchJobService.DEFAULT_DELAY_MAX_MS) / 2;
348311
348342
  const estimatedDurationMinutes = Math.ceil(items.length * (BatchJobService.AVG_PROCESSING_TIME_MS + avgDelayMs) / 60000);
348312
348343
  return {
@@ -348667,6 +348698,7 @@ var init_batch_jobs = __esm(() => {
348667
348698
  init_src5();
348668
348699
  init_src7();
348669
348700
  init_drizzle_orm();
348701
+ init_batch_pricing();
348670
348702
  init_media_storage();
348671
348703
  log76 = createLogger("services:batch-jobs");
348672
348704
  PROCESSABLE_CONTENT_TYPES = new Set(["audio", "image", "video", "document"]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automagik/omni",
3
- "version": "2.260422.1",
3
+ "version": "2.260422.3",
4
4
  "description": "LLM-optimized CLI for Omni",
5
5
  "type": "module",
6
6
  "bin": {
@@ -36,14 +36,14 @@
36
36
  "qrcode-terminal": "^0.12.0"
37
37
  },
38
38
  "devDependencies": {
39
- "@omni/api": "2.260421.6",
40
- "@omni/channel-discord": "2.260421.6",
41
- "@omni/channel-sdk": "2.260421.6",
42
- "@omni/channel-slack": "2.260421.6",
43
- "@omni/channel-telegram": "2.260421.6",
44
- "@omni/channel-whatsapp": "2.260421.6",
45
- "@omni/core": "2.260421.6",
46
- "@omni/sdk": "2.260421.6",
39
+ "@omni/api": "2.260422.2",
40
+ "@omni/channel-discord": "2.260422.2",
41
+ "@omni/channel-sdk": "2.260422.2",
42
+ "@omni/channel-slack": "2.260422.2",
43
+ "@omni/channel-telegram": "2.260422.2",
44
+ "@omni/channel-whatsapp": "2.260422.2",
45
+ "@omni/core": "2.260422.2",
46
+ "@omni/sdk": "2.260422.2",
47
47
  "@types/node": "^22.10.3",
48
48
  "@types/qrcode-terminal": "^0.12.2",
49
49
  "typescript": "^5.7.3"