@isaacthoman/pulpo 0.135.0 → 0.136.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 (2) hide show
  1. package/dist/index.js +42 -9
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -14532,6 +14532,18 @@ var imageGenerationPreferencesSchema = external_exports.object({
14532
14532
  enabled: external_exports.boolean().default(false),
14533
14533
  modelId: external_exports.string().max(120).nullable().default(null)
14534
14534
  }).default(() => ({ enabled: false, modelId: null }));
14535
+ var price = external_exports.number().int().min(0).max(1e12);
14536
+ var imageTokenPricesSchema = external_exports.object({
14537
+ input: price.nullable().default(null),
14538
+ cachedInput: price.nullable().default(null),
14539
+ output: price.nullable().default(null),
14540
+ imageInput: price.nullable().default(null),
14541
+ cachedImageInput: price.nullable().default(null),
14542
+ imageOutput: price.nullable().default(null)
14543
+ });
14544
+ function imageTokenRateKeys(adapter) {
14545
+ return adapter === "openai-images" ? ["input", "cachedInput", "imageInput", "cachedImageInput", "output", "imageOutput"] : ["input", "cachedInput", "output"];
14546
+ }
14535
14547
  var imageModelSchema = external_exports.object({
14536
14548
  id: external_exports.string().regex(/^[a-z0-9][a-z0-9._-]{0,119}$/),
14537
14549
  providerConnectionId: external_exports.uuid(),
@@ -14541,7 +14553,23 @@ var imageModelSchema = external_exports.object({
14541
14553
  enabled: external_exports.boolean().default(false),
14542
14554
  sortOrder: external_exports.number().int().min(0).default(0),
14543
14555
  billUsers: external_exports.boolean().default(false),
14544
- imagePriceMicros: external_exports.number().int().min(0).max(1e12).default(0)
14556
+ imagePriceMicros: price.default(0),
14557
+ billingUnit: external_exports.enum(["images", "tokens"]).default("images"),
14558
+ tokenPrices: imageTokenPricesSchema.default(() => imageTokenPricesSchema.parse({})),
14559
+ reservationMicros: price.default(0)
14560
+ }).superRefine((model, ctx) => {
14561
+ if (model.billingUnit !== "tokens")
14562
+ return;
14563
+ if (model.adapter === "azure-mai")
14564
+ ctx.addIssue({ code: "custom", path: ["billingUnit"], message: "Azure MAI does not report token usage; use per-image pricing." });
14565
+ if (!model.billUsers)
14566
+ return;
14567
+ if (model.reservationMicros <= 0)
14568
+ ctx.addIssue({ code: "custom", path: ["reservationMicros"], message: "Enter a positive upfront reservation." });
14569
+ for (const key of imageTokenRateKeys(model.adapter)) {
14570
+ if (model.tokenPrices[key] === null)
14571
+ ctx.addIssue({ code: "custom", path: ["tokenPrices", key], message: "Enter a token rate (zero is allowed)." });
14572
+ }
14545
14573
  });
14546
14574
  var AZURE_MAI_IMAGE_PRESET = {
14547
14575
  adapter: "azure-mai",
@@ -14550,7 +14578,10 @@ var AZURE_MAI_IMAGE_PRESET = {
14550
14578
  enabled: false,
14551
14579
  sortOrder: 0,
14552
14580
  billUsers: false,
14553
- imagePriceMicros: 0
14581
+ imagePriceMicros: 0,
14582
+ billingUnit: "images",
14583
+ tokenPrices: imageTokenPricesSchema.parse({}),
14584
+ reservationMicros: 0
14554
14585
  };
14555
14586
  var META_MUSE_IMAGE_PRESET = {
14556
14587
  ...AZURE_MAI_IMAGE_PRESET,
@@ -14562,7 +14593,9 @@ var OPENAI_IMAGE_PRESET = {
14562
14593
  ...AZURE_MAI_IMAGE_PRESET,
14563
14594
  adapter: "openai-images",
14564
14595
  name: "GPT Image 2.5 Flare",
14565
- upstreamModelId: "gpt-image-2.5-flare"
14596
+ upstreamModelId: "gpt-image-2.5-flare",
14597
+ // Microdollars / 1M tokens, verified 2026-09-13: developers.openai.com/api/docs/models/gpt-image-2.5-flare
14598
+ tokenPrices: { input: 5e6, cachedInput: 125e4, imageInput: 8e6, cachedImageInput: 2e6, output: 0, imageOutput: 3e7 }
14566
14599
  };
14567
14600
  var IMAGE_GENERATION_MAX_BYTES = 20 * 1024 * 1024;
14568
14601
  var imageGenerationInputSchema = external_exports.object({
@@ -14597,7 +14630,7 @@ var speechPreferencesSchema = external_exports.object({
14597
14630
  speed: external_exports.number().min(0.25).max(4).default(1)
14598
14631
  })).default({})
14599
14632
  }).default(() => ({ modelId: null, models: {} }));
14600
- var price = external_exports.number().int().min(0).max(1e12);
14633
+ var price2 = external_exports.number().int().min(0).max(1e12);
14601
14634
  var speechModelSchema = external_exports.object({
14602
14635
  id: external_exports.string().regex(/^[a-z0-9][a-z0-9._-]{0,119}$/),
14603
14636
  providerConnectionId: external_exports.string().uuid(),
@@ -14618,10 +14651,10 @@ var speechModelSchema = external_exports.object({
14618
14651
  supportsSse: external_exports.boolean().default(false),
14619
14652
  billUsers: external_exports.boolean().default(false),
14620
14653
  billingUnit: external_exports.enum(["tokens", "characters", "duration"]).default("characters"),
14621
- inputPriceMicros: price.default(0),
14622
- outputPriceMicros: price.default(0),
14623
- characterPriceMicros: price.default(0),
14624
- minutePriceMicros: price.default(0)
14654
+ inputPriceMicros: price2.default(0),
14655
+ outputPriceMicros: price2.default(0),
14656
+ characterPriceMicros: price2.default(0),
14657
+ minutePriceMicros: price2.default(0)
14625
14658
  }).superRefine((model, ctx) => {
14626
14659
  if ((model.enabled || model.voices.length || model.defaultVoice) && !model.voices.some((v) => v.id === model.defaultVoice))
14627
14660
  ctx.addIssue({ code: "custom", path: ["defaultVoice"], message: "Default voice must be in the voice list" });
@@ -20759,7 +20792,7 @@ async function runModelTest(input) {
20759
20792
  }
20760
20793
 
20761
20794
  // src/index.ts
20762
- var CLI_VERSION = true ? "0.135.0" : "0.1.0";
20795
+ var CLI_VERSION = true ? "0.136.0" : "0.1.0";
20763
20796
  var CLI_BUNDLED = true;
20764
20797
  var commandIo = /* @__PURE__ */ new WeakMap();
20765
20798
  var commandClientFactory = /* @__PURE__ */ new WeakMap();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@isaacthoman/pulpo",
3
- "version": "0.135.0",
3
+ "version": "0.136.0",
4
4
  "description": "Operator-first command-line client for Pulpo",
5
5
  "type": "module",
6
6
  "bin": {