@discomedia/utils 1.0.69 → 1.0.70

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/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.0.69",
6
+ "version": "1.0.70",
7
7
  "author": "Disco Media",
8
8
  "description": "Utility functions used in Disco Media apps",
9
9
  "always-build-npm": true,
package/dist/test.js CHANGED
@@ -389,33 +389,36 @@ const OPENAI_MODELS = [
389
389
  function isOpenAIModel(model) {
390
390
  return OPENAI_MODELS.includes(model);
391
391
  }
392
+ /**
393
+ * Represents OpenRouter models
394
+ */
395
+ const OPENROUTER_MODELS = [
396
+ 'openai/gpt-5',
397
+ 'openai/gpt-5-mini',
398
+ 'openai/gpt-5.4-mini',
399
+ 'openai/gpt-5-nano',
400
+ 'openai/gpt-5.1',
401
+ 'openai/gpt-5.4',
402
+ 'openai/gpt-5.4-pro',
403
+ 'openai/gpt-5.5',
404
+ 'openai/gpt-5.5-pro',
405
+ 'openai/gpt-5.2',
406
+ 'openai/gpt-5.2-pro',
407
+ 'openai/gpt-5.1-codex',
408
+ 'openai/gpt-5.1-codex-max',
409
+ 'openai/gpt-oss-120b',
410
+ 'z.ai/glm-4.5',
411
+ 'z.ai/glm-4.5-air',
412
+ 'google/gemini-2.5-flash',
413
+ 'google/gemini-2.5-flash-lite',
414
+ 'deepseek/deepseek-r1-0528',
415
+ 'deepseek/deepseek-chat-v3-0324',
416
+ ];
392
417
  /**
393
418
  * Type guard to check if a model is an OpenRouter model
394
419
  */
395
420
  function isOpenRouterModel(model) {
396
- const openRouterModels = [
397
- 'openai/gpt-5',
398
- 'openai/gpt-5-mini',
399
- 'openai/gpt-5.4-mini',
400
- 'openai/gpt-5-nano',
401
- 'openai/gpt-5.1',
402
- 'openai/gpt-5.4',
403
- 'openai/gpt-5.4-pro',
404
- 'openai/gpt-5.5',
405
- 'openai/gpt-5.5-pro',
406
- 'openai/gpt-5.2',
407
- 'openai/gpt-5.2-pro',
408
- 'openai/gpt-5.1-codex',
409
- 'openai/gpt-5.1-codex-max',
410
- 'openai/gpt-oss-120b',
411
- 'z.ai/glm-4.5',
412
- 'z.ai/glm-4.5-air',
413
- 'google/gemini-2.5-flash',
414
- 'google/gemini-2.5-flash-lite',
415
- 'deepseek/deepseek-r1-0528',
416
- 'deepseek/deepseek-chat-v3-0324',
417
- ];
418
- return openRouterModels.includes(model);
421
+ return OPENROUTER_MODELS.includes(model);
419
422
  }
420
423
 
421
424
  function __classPrivateFieldSet(receiver, state, value, kind, f) {
@@ -22306,9 +22309,20 @@ function testOpenAIModelDeprecation() {
22306
22309
  if (OPENAI_MODELS.length !== supportedModels.length) {
22307
22310
  throw new Error(`Expected ${supportedModels.length} direct OpenAI models, received ${OPENAI_MODELS.length}`);
22308
22311
  }
22312
+ const expectedOpenRouterModel = 'openai/gpt-5-mini';
22313
+ if (!OPENROUTER_MODELS.includes(expectedOpenRouterModel)) {
22314
+ throw new Error(`Expected OPENROUTER_MODELS to include ${expectedOpenRouterModel}`);
22315
+ }
22316
+ if (!isOpenRouterModel(expectedOpenRouterModel)) {
22317
+ throw new Error(`Expected ${expectedOpenRouterModel} to be accepted as an OpenRouter model`);
22318
+ }
22319
+ if (isOpenRouterModel('openai/gpt-4o-mini')) {
22320
+ throw new Error('Expected openai/gpt-4o-mini to be excluded from OpenRouter runtime models');
22321
+ }
22309
22322
  console.log('\n[OpenAI] Model deprecation test');
22310
22323
  console.log(` Default model: ${DEFAULT_MODEL}`);
22311
22324
  console.log(` Supported direct OpenAI models: ${OPENAI_MODELS.join(', ')}`);
22325
+ console.log(` Supported OpenRouter models: ${OPENROUTER_MODELS.join(', ')}`);
22312
22326
  }
22313
22327
  async function testLLMStructuredOutputWithZod() {
22314
22328
  if (!process.env.OPENAI_API_KEY) {