@everworker/oneringai 0.4.8 → 0.5.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.
Files changed (32) hide show
  1. package/README.md +423 -43
  2. package/dist/{ImageModel-1uP-2vk7.d.ts → ImageModel-CV8OuP3Z.d.ts} +10 -4
  3. package/dist/{ImageModel-BDI37OED.d.cts → ImageModel-OjV5NvLY.d.cts} +10 -4
  4. package/dist/capabilities/agents/index.cjs +9 -0
  5. package/dist/capabilities/agents/index.cjs.map +1 -1
  6. package/dist/capabilities/agents/index.d.cts +1 -1
  7. package/dist/capabilities/agents/index.d.ts +1 -1
  8. package/dist/capabilities/agents/index.js +9 -0
  9. package/dist/capabilities/agents/index.js.map +1 -1
  10. package/dist/capabilities/images/index.cjs +262 -15
  11. package/dist/capabilities/images/index.cjs.map +1 -1
  12. package/dist/capabilities/images/index.d.cts +1 -1
  13. package/dist/capabilities/images/index.d.ts +1 -1
  14. package/dist/capabilities/images/index.js +262 -15
  15. package/dist/capabilities/images/index.js.map +1 -1
  16. package/dist/index-BlEwczd4.d.ts +320 -0
  17. package/dist/index-DrJYI_0l.d.cts +320 -0
  18. package/dist/{index-13HQuxEB.d.ts → index-hmTj59TM.d.ts} +352 -29
  19. package/dist/{index-Cbd5vY_8.d.cts → index-t4cRhBZW.d.cts} +352 -29
  20. package/dist/index.cjs +15543 -4232
  21. package/dist/index.cjs.map +1 -1
  22. package/dist/index.d.cts +3043 -586
  23. package/dist/index.d.ts +3043 -586
  24. package/dist/index.js +14567 -3281
  25. package/dist/index.js.map +1 -1
  26. package/dist/shared/index.cjs +596 -7
  27. package/dist/shared/index.cjs.map +1 -1
  28. package/dist/shared/index.d.cts +2 -284
  29. package/dist/shared/index.d.ts +2 -284
  30. package/dist/shared/index.js +596 -7
  31. package/dist/shared/index.js.map +1 -1
  32. package/package.json +1 -1
@@ -1176,16 +1176,18 @@ var CircuitBreaker = class extends eventemitter3.EventEmitter {
1176
1176
  timestamp: Date.now()
1177
1177
  });
1178
1178
  break;
1179
- case "closed":
1179
+ case "closed": {
1180
+ const capturedSuccesses = this.consecutiveSuccesses;
1180
1181
  this.failures = [];
1181
1182
  this.consecutiveSuccesses = 0;
1182
1183
  this.openedAt = void 0;
1183
1184
  this.emit("closed", {
1184
1185
  name: this.name,
1185
- successCount: this.consecutiveSuccesses,
1186
+ successCount: capturedSuccesses,
1186
1187
  timestamp: Date.now()
1187
1188
  });
1188
1189
  break;
1190
+ }
1189
1191
  }
1190
1192
  }
1191
1193
  /**
@@ -2319,6 +2321,9 @@ var Connector = class _Connector {
2319
2321
  dispose() {
2320
2322
  if (this.disposed) return;
2321
2323
  this.disposed = true;
2324
+ if (this.circuitBreaker) {
2325
+ this.circuitBreaker.removeAllListeners();
2326
+ }
2322
2327
  this.oauthManager = void 0;
2323
2328
  this.circuitBreaker = void 0;
2324
2329
  }
@@ -2940,7 +2945,7 @@ var GoogleImageProvider = class extends BaseMediaProvider {
2940
2945
  imageBytes = image.toString("base64");
2941
2946
  } else {
2942
2947
  const fs5 = await import('fs');
2943
- const buffer = fs5.readFileSync(image);
2948
+ const buffer = await fs5.promises.readFile(image);
2944
2949
  imageBytes = buffer.toString("base64");
2945
2950
  }
2946
2951
  return {
@@ -3225,11 +3230,17 @@ function createRegistryHelpers(registry) {
3225
3230
  // src/domain/entities/ImageModel.ts
3226
3231
  var IMAGE_MODELS = {
3227
3232
  [Vendor.OpenAI]: {
3228
- /** GPT-Image-1: Latest OpenAI image model with best quality */
3233
+ /** GPT-Image-1.5: State-of-the-art image generation */
3234
+ GPT_IMAGE_1_5: "gpt-image-1.5",
3235
+ /** ChatGPT-Image-Latest: Image model used in ChatGPT (floating alias) */
3236
+ CHATGPT_IMAGE_LATEST: "chatgpt-image-latest",
3237
+ /** GPT-Image-1: Previous generation image model */
3229
3238
  GPT_IMAGE_1: "gpt-image-1",
3230
- /** DALL-E 3: High quality image generation */
3239
+ /** GPT-Image-1-Mini: Cost-efficient version of GPT Image 1 */
3240
+ GPT_IMAGE_1_MINI: "gpt-image-1-mini",
3241
+ /** DALL-E 3: Deprecated. High quality image generation */
3231
3242
  DALL_E_3: "dall-e-3",
3232
- /** DALL-E 2: Fast, supports editing and variations */
3243
+ /** DALL-E 2: Deprecated. Supports editing and variations */
3233
3244
  DALL_E_2: "dall-e-2"
3234
3245
  },
3235
3246
  [Vendor.Google]: {
@@ -3255,17 +3266,173 @@ var IMAGE_MODELS = {
3255
3266
  };
3256
3267
  var IMAGE_MODEL_REGISTRY = {
3257
3268
  // ======================== OpenAI ========================
3269
+ "gpt-image-1.5": {
3270
+ name: "gpt-image-1.5",
3271
+ displayName: "GPT Image 1.5",
3272
+ provider: Vendor.OpenAI,
3273
+ description: "State-of-the-art image generation with better instruction following and prompt adherence",
3274
+ isActive: true,
3275
+ releaseDate: "2025-12-16",
3276
+ sources: {
3277
+ documentation: "https://developers.openai.com/api/docs/models/gpt-image-1.5",
3278
+ pricing: "https://openai.com/pricing",
3279
+ lastVerified: "2026-03-14"
3280
+ },
3281
+ capabilities: {
3282
+ sizes: ["1024x1024", "1024x1536", "1536x1024", "auto"],
3283
+ maxImagesPerRequest: 10,
3284
+ outputFormats: ["png", "webp", "jpeg"],
3285
+ features: {
3286
+ generation: true,
3287
+ editing: true,
3288
+ variations: false,
3289
+ styleControl: false,
3290
+ qualityControl: true,
3291
+ transparency: true,
3292
+ promptRevision: false
3293
+ },
3294
+ limits: { maxPromptLength: 32e3 },
3295
+ vendorOptions: {
3296
+ quality: {
3297
+ type: "enum",
3298
+ label: "Quality",
3299
+ description: "Image quality level",
3300
+ enum: ["auto", "low", "medium", "high"],
3301
+ default: "auto",
3302
+ controlType: "select"
3303
+ },
3304
+ background: {
3305
+ type: "enum",
3306
+ label: "Background",
3307
+ description: "Background transparency (requires png or webp)",
3308
+ enum: ["auto", "transparent", "opaque"],
3309
+ default: "auto",
3310
+ controlType: "select"
3311
+ },
3312
+ output_format: {
3313
+ type: "enum",
3314
+ label: "Output Format",
3315
+ description: "Image file format",
3316
+ enum: ["png", "jpeg", "webp"],
3317
+ default: "png",
3318
+ controlType: "select"
3319
+ },
3320
+ output_compression: {
3321
+ type: "number",
3322
+ label: "Compression",
3323
+ description: "Compression level for JPEG/WebP (0-100)",
3324
+ min: 0,
3325
+ max: 100,
3326
+ default: 100,
3327
+ controlType: "slider"
3328
+ },
3329
+ moderation: {
3330
+ type: "enum",
3331
+ label: "Moderation",
3332
+ description: "Content moderation strictness",
3333
+ enum: ["auto", "low"],
3334
+ default: "auto",
3335
+ controlType: "radio"
3336
+ }
3337
+ }
3338
+ },
3339
+ pricing: {
3340
+ perImageStandard: 0.034,
3341
+ // medium quality 1024x1024
3342
+ perImageHD: 0.133,
3343
+ // high quality 1024x1024
3344
+ currency: "USD"
3345
+ }
3346
+ },
3347
+ "chatgpt-image-latest": {
3348
+ name: "chatgpt-image-latest",
3349
+ displayName: "ChatGPT Image Latest",
3350
+ provider: Vendor.OpenAI,
3351
+ description: "Image model used in ChatGPT. Floating alias pointing to current ChatGPT image snapshot",
3352
+ isActive: true,
3353
+ releaseDate: "2025-12-01",
3354
+ sources: {
3355
+ documentation: "https://developers.openai.com/api/docs/models/chatgpt-image-latest",
3356
+ pricing: "https://openai.com/pricing",
3357
+ lastVerified: "2026-03-14"
3358
+ },
3359
+ capabilities: {
3360
+ sizes: ["1024x1024", "1024x1536", "1536x1024", "auto"],
3361
+ maxImagesPerRequest: 10,
3362
+ outputFormats: ["png", "webp", "jpeg"],
3363
+ features: {
3364
+ generation: true,
3365
+ editing: true,
3366
+ variations: false,
3367
+ styleControl: false,
3368
+ qualityControl: true,
3369
+ transparency: true,
3370
+ promptRevision: false
3371
+ },
3372
+ limits: { maxPromptLength: 32e3 },
3373
+ vendorOptions: {
3374
+ quality: {
3375
+ type: "enum",
3376
+ label: "Quality",
3377
+ description: "Image quality level",
3378
+ enum: ["auto", "low", "medium", "high"],
3379
+ default: "auto",
3380
+ controlType: "select"
3381
+ },
3382
+ background: {
3383
+ type: "enum",
3384
+ label: "Background",
3385
+ description: "Background transparency (requires png or webp)",
3386
+ enum: ["auto", "transparent", "opaque"],
3387
+ default: "auto",
3388
+ controlType: "select"
3389
+ },
3390
+ output_format: {
3391
+ type: "enum",
3392
+ label: "Output Format",
3393
+ description: "Image file format",
3394
+ enum: ["png", "jpeg", "webp"],
3395
+ default: "png",
3396
+ controlType: "select"
3397
+ },
3398
+ output_compression: {
3399
+ type: "number",
3400
+ label: "Compression",
3401
+ description: "Compression level for JPEG/WebP (0-100)",
3402
+ min: 0,
3403
+ max: 100,
3404
+ default: 100,
3405
+ controlType: "slider"
3406
+ },
3407
+ moderation: {
3408
+ type: "enum",
3409
+ label: "Moderation",
3410
+ description: "Content moderation strictness",
3411
+ enum: ["auto", "low"],
3412
+ default: "auto",
3413
+ controlType: "radio"
3414
+ }
3415
+ }
3416
+ },
3417
+ pricing: {
3418
+ perImageStandard: 0.034,
3419
+ // medium quality 1024x1024
3420
+ perImageHD: 0.133,
3421
+ // high quality 1024x1024
3422
+ currency: "USD"
3423
+ }
3424
+ },
3258
3425
  "gpt-image-1": {
3259
3426
  name: "gpt-image-1",
3260
- displayName: "GPT-Image-1",
3427
+ displayName: "GPT Image 1",
3261
3428
  provider: Vendor.OpenAI,
3262
- description: "OpenAI latest image generation model with best quality and features",
3429
+ description: "Previous generation OpenAI image model. More expensive than GPT Image 1.5",
3263
3430
  isActive: true,
3264
3431
  releaseDate: "2025-04-01",
3265
3432
  sources: {
3266
- documentation: "https://platform.openai.com/docs/guides/images",
3433
+ documentation: "https://developers.openai.com/api/docs/models/gpt-image-1",
3267
3434
  pricing: "https://openai.com/pricing",
3268
- lastVerified: "2026-01-25"
3435
+ lastVerified: "2026-03-14"
3269
3436
  },
3270
3437
  capabilities: {
3271
3438
  sizes: ["1024x1024", "1024x1536", "1536x1024", "auto"],
@@ -3325,9 +3492,89 @@ var IMAGE_MODEL_REGISTRY = {
3325
3492
  }
3326
3493
  }
3327
3494
  },
3495
+ pricing: {
3496
+ perImageStandard: 0.042,
3497
+ // medium quality 1024x1024
3498
+ perImageHD: 0.167,
3499
+ // high quality 1024x1024
3500
+ currency: "USD"
3501
+ }
3502
+ },
3503
+ "gpt-image-1-mini": {
3504
+ name: "gpt-image-1-mini",
3505
+ displayName: "GPT Image 1 Mini",
3506
+ provider: Vendor.OpenAI,
3507
+ description: "Cost-efficient version of GPT Image 1. Cheapest OpenAI image model",
3508
+ isActive: true,
3509
+ releaseDate: "2025-06-01",
3510
+ sources: {
3511
+ documentation: "https://developers.openai.com/api/docs/models/gpt-image-1-mini",
3512
+ pricing: "https://openai.com/pricing",
3513
+ lastVerified: "2026-03-14"
3514
+ },
3515
+ capabilities: {
3516
+ sizes: ["1024x1024", "1024x1536", "1536x1024", "auto"],
3517
+ maxImagesPerRequest: 10,
3518
+ outputFormats: ["png", "webp", "jpeg"],
3519
+ features: {
3520
+ generation: true,
3521
+ editing: true,
3522
+ variations: false,
3523
+ styleControl: false,
3524
+ qualityControl: true,
3525
+ transparency: true,
3526
+ promptRevision: false
3527
+ },
3528
+ limits: { maxPromptLength: 32e3 },
3529
+ vendorOptions: {
3530
+ quality: {
3531
+ type: "enum",
3532
+ label: "Quality",
3533
+ description: "Image quality level",
3534
+ enum: ["auto", "low", "medium", "high"],
3535
+ default: "auto",
3536
+ controlType: "select"
3537
+ },
3538
+ background: {
3539
+ type: "enum",
3540
+ label: "Background",
3541
+ description: "Background transparency (requires png or webp)",
3542
+ enum: ["auto", "transparent", "opaque"],
3543
+ default: "auto",
3544
+ controlType: "select"
3545
+ },
3546
+ output_format: {
3547
+ type: "enum",
3548
+ label: "Output Format",
3549
+ description: "Image file format",
3550
+ enum: ["png", "jpeg", "webp"],
3551
+ default: "png",
3552
+ controlType: "select"
3553
+ },
3554
+ output_compression: {
3555
+ type: "number",
3556
+ label: "Compression",
3557
+ description: "Compression level for JPEG/WebP (0-100)",
3558
+ min: 0,
3559
+ max: 100,
3560
+ default: 100,
3561
+ controlType: "slider"
3562
+ },
3563
+ moderation: {
3564
+ type: "enum",
3565
+ label: "Moderation",
3566
+ description: "Content moderation strictness",
3567
+ enum: ["auto", "low"],
3568
+ default: "auto",
3569
+ controlType: "radio"
3570
+ }
3571
+ }
3572
+ },
3328
3573
  pricing: {
3329
3574
  perImageStandard: 0.011,
3330
- perImageHD: 0.042,
3575
+ // medium quality 1024x1024
3576
+ perImageHD: 0.036,
3577
+ // high quality 1024x1024
3331
3578
  currency: "USD"
3332
3579
  }
3333
3580
  },
@@ -3335,8 +3582,8 @@ var IMAGE_MODEL_REGISTRY = {
3335
3582
  name: "dall-e-3",
3336
3583
  displayName: "DALL-E 3",
3337
3584
  provider: Vendor.OpenAI,
3338
- description: "High quality image generation with prompt revision",
3339
- isActive: true,
3585
+ description: "Deprecated. High quality image generation with prompt revision. Migrate to gpt-image-1.5",
3586
+ isActive: false,
3340
3587
  releaseDate: "2023-11-06",
3341
3588
  deprecationDate: "2026-05-12",
3342
3589
  sources: {
@@ -3387,8 +3634,8 @@ var IMAGE_MODEL_REGISTRY = {
3387
3634
  name: "dall-e-2",
3388
3635
  displayName: "DALL-E 2",
3389
3636
  provider: Vendor.OpenAI,
3390
- description: "Fast image generation with editing and variation support",
3391
- isActive: true,
3637
+ description: "Deprecated. Fast image generation with editing and variation support. Migrate to gpt-image-1-mini",
3638
+ isActive: false,
3392
3639
  releaseDate: "2022-11-03",
3393
3640
  deprecationDate: "2026-05-12",
3394
3641
  sources: {