@everworker/oneringai 0.4.7 → 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 +425 -45
  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 +17 -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 +17 -0
  9. package/dist/capabilities/agents/index.js.map +1 -1
  10. package/dist/capabilities/images/index.cjs +273 -16
  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 +273 -16
  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-Blci0FEd.d.ts → index-hmTj59TM.d.ts} +543 -36
  19. package/dist/{index-D8RCwpK9.d.cts → index-t4cRhBZW.d.cts} +543 -36
  20. package/dist/index.cjs +19916 -7155
  21. package/dist/index.cjs.map +1 -1
  22. package/dist/index.d.cts +7807 -5065
  23. package/dist/index.d.ts +7807 -5065
  24. package/dist/index.js +19377 -6645
  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
@@ -1021,6 +1021,12 @@ var StorageRegistry = class _StorageRegistry {
1021
1021
  _StorageRegistry.entries.set(key, value);
1022
1022
  return value;
1023
1023
  }
1024
+ /**
1025
+ * Remove a single storage backend.
1026
+ */
1027
+ static remove(key) {
1028
+ return _StorageRegistry.entries.delete(key);
1029
+ }
1024
1030
  /**
1025
1031
  * Check if a storage backend has been configured.
1026
1032
  */
@@ -1170,25 +1176,31 @@ var CircuitBreaker = class extends eventemitter3.EventEmitter {
1170
1176
  timestamp: Date.now()
1171
1177
  });
1172
1178
  break;
1173
- case "closed":
1179
+ case "closed": {
1180
+ const capturedSuccesses = this.consecutiveSuccesses;
1174
1181
  this.failures = [];
1175
1182
  this.consecutiveSuccesses = 0;
1176
1183
  this.openedAt = void 0;
1177
1184
  this.emit("closed", {
1178
1185
  name: this.name,
1179
- successCount: this.consecutiveSuccesses,
1186
+ successCount: capturedSuccesses,
1180
1187
  timestamp: Date.now()
1181
1188
  });
1182
1189
  break;
1190
+ }
1183
1191
  }
1184
1192
  }
1185
1193
  /**
1186
- * Remove failures outside the time window
1194
+ * Remove failures outside the time window and cap array size
1187
1195
  */
1188
1196
  pruneOldFailures() {
1189
1197
  const now = Date.now();
1190
1198
  const cutoff = now - this.config.windowMs;
1191
1199
  this.failures = this.failures.filter((f) => f.timestamp > cutoff);
1200
+ const maxFailures = Math.max(this.config.failureThreshold * 2, 20);
1201
+ if (this.failures.length > maxFailures) {
1202
+ this.failures = this.failures.slice(-maxFailures);
1203
+ }
1192
1204
  }
1193
1205
  /**
1194
1206
  * Get current state
@@ -2309,6 +2321,9 @@ var Connector = class _Connector {
2309
2321
  dispose() {
2310
2322
  if (this.disposed) return;
2311
2323
  this.disposed = true;
2324
+ if (this.circuitBreaker) {
2325
+ this.circuitBreaker.removeAllListeners();
2326
+ }
2312
2327
  this.oauthManager = void 0;
2313
2328
  this.circuitBreaker = void 0;
2314
2329
  }
@@ -2930,7 +2945,7 @@ var GoogleImageProvider = class extends BaseMediaProvider {
2930
2945
  imageBytes = image.toString("base64");
2931
2946
  } else {
2932
2947
  const fs5 = await import('fs');
2933
- const buffer = fs5.readFileSync(image);
2948
+ const buffer = await fs5.promises.readFile(image);
2934
2949
  imageBytes = buffer.toString("base64");
2935
2950
  }
2936
2951
  return {
@@ -3215,11 +3230,17 @@ function createRegistryHelpers(registry) {
3215
3230
  // src/domain/entities/ImageModel.ts
3216
3231
  var IMAGE_MODELS = {
3217
3232
  [Vendor.OpenAI]: {
3218
- /** 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 */
3219
3238
  GPT_IMAGE_1: "gpt-image-1",
3220
- /** 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 */
3221
3242
  DALL_E_3: "dall-e-3",
3222
- /** DALL-E 2: Fast, supports editing and variations */
3243
+ /** DALL-E 2: Deprecated. Supports editing and variations */
3223
3244
  DALL_E_2: "dall-e-2"
3224
3245
  },
3225
3246
  [Vendor.Google]: {
@@ -3245,17 +3266,173 @@ var IMAGE_MODELS = {
3245
3266
  };
3246
3267
  var IMAGE_MODEL_REGISTRY = {
3247
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
+ },
3248
3425
  "gpt-image-1": {
3249
3426
  name: "gpt-image-1",
3250
- displayName: "GPT-Image-1",
3427
+ displayName: "GPT Image 1",
3251
3428
  provider: Vendor.OpenAI,
3252
- 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",
3253
3430
  isActive: true,
3254
3431
  releaseDate: "2025-04-01",
3255
3432
  sources: {
3256
- documentation: "https://platform.openai.com/docs/guides/images",
3433
+ documentation: "https://developers.openai.com/api/docs/models/gpt-image-1",
3257
3434
  pricing: "https://openai.com/pricing",
3258
- lastVerified: "2026-01-25"
3435
+ lastVerified: "2026-03-14"
3259
3436
  },
3260
3437
  capabilities: {
3261
3438
  sizes: ["1024x1024", "1024x1536", "1536x1024", "auto"],
@@ -3315,9 +3492,89 @@ var IMAGE_MODEL_REGISTRY = {
3315
3492
  }
3316
3493
  }
3317
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
+ },
3318
3573
  pricing: {
3319
3574
  perImageStandard: 0.011,
3320
- perImageHD: 0.042,
3575
+ // medium quality 1024x1024
3576
+ perImageHD: 0.036,
3577
+ // high quality 1024x1024
3321
3578
  currency: "USD"
3322
3579
  }
3323
3580
  },
@@ -3325,8 +3582,8 @@ var IMAGE_MODEL_REGISTRY = {
3325
3582
  name: "dall-e-3",
3326
3583
  displayName: "DALL-E 3",
3327
3584
  provider: Vendor.OpenAI,
3328
- description: "High quality image generation with prompt revision",
3329
- isActive: true,
3585
+ description: "Deprecated. High quality image generation with prompt revision. Migrate to gpt-image-1.5",
3586
+ isActive: false,
3330
3587
  releaseDate: "2023-11-06",
3331
3588
  deprecationDate: "2026-05-12",
3332
3589
  sources: {
@@ -3377,8 +3634,8 @@ var IMAGE_MODEL_REGISTRY = {
3377
3634
  name: "dall-e-2",
3378
3635
  displayName: "DALL-E 2",
3379
3636
  provider: Vendor.OpenAI,
3380
- description: "Fast image generation with editing and variation support",
3381
- isActive: true,
3637
+ description: "Deprecated. Fast image generation with editing and variation support. Migrate to gpt-image-1-mini",
3638
+ isActive: false,
3382
3639
  releaseDate: "2022-11-03",
3383
3640
  deprecationDate: "2026-05-12",
3384
3641
  sources: {