@combycode/llm-sdk 3.0.0 → 3.1.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.
- package/CHANGELOG.md +56 -0
- package/dist/catalog/catalog.d.ts +15 -3
- package/dist/helpers/select-model.d.ts +35 -0
- package/dist/index.browser.js +229 -67
- package/dist/index.d.ts +2 -2
- package/dist/index.js +229 -67
- package/dist/llm/client.d.ts +3 -0
- package/dist/llm/types/provider.d.ts +5 -0
- package/dist/wire/interpreter.d.ts +40 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -548,6 +548,7 @@ var TelemetryAdapter = class {
|
|
|
548
548
|
break;
|
|
549
549
|
case "onModelError":
|
|
550
550
|
this.metrics.errors++;
|
|
551
|
+
this.metrics.inFlight = Math.max(0, this.metrics.inFlight - 1);
|
|
551
552
|
break;
|
|
552
553
|
case "onCostEntry":
|
|
553
554
|
this.metrics.costUsd += event.ctx.entry?.cost?.total ?? 0;
|
|
@@ -3328,7 +3329,8 @@ var anthropic_default = {
|
|
|
3328
3329
|
"anthropic/claude-opus-4.1": {
|
|
3329
3330
|
providerModelName: "claude-opus-4-1-20250805",
|
|
3330
3331
|
aliases: [
|
|
3331
|
-
"claude-opus-4-1-20250805"
|
|
3332
|
+
"claude-opus-4-1-20250805",
|
|
3333
|
+
"claude-opus-4-1"
|
|
3332
3334
|
],
|
|
3333
3335
|
pricing: {
|
|
3334
3336
|
inputPerMTok: 15,
|
|
@@ -3392,7 +3394,8 @@ var anthropic_default = {
|
|
|
3392
3394
|
"anthropic/claude-opus-4.5": {
|
|
3393
3395
|
providerModelName: "claude-opus-4-5-20251101",
|
|
3394
3396
|
aliases: [
|
|
3395
|
-
"claude-opus-4-5-20251101"
|
|
3397
|
+
"claude-opus-4-5-20251101",
|
|
3398
|
+
"claude-opus-4-5"
|
|
3396
3399
|
],
|
|
3397
3400
|
pricing: {
|
|
3398
3401
|
inputPerMTok: 5,
|
|
@@ -3731,7 +3734,8 @@ var anthropic_default = {
|
|
|
3731
3734
|
"anthropic/claude-sonnet-4.5": {
|
|
3732
3735
|
providerModelName: "claude-sonnet-4-5-20250929",
|
|
3733
3736
|
aliases: [
|
|
3734
|
-
"claude-sonnet-4-5-20250929"
|
|
3737
|
+
"claude-sonnet-4-5-20250929",
|
|
3738
|
+
"claude-sonnet-4-5"
|
|
3735
3739
|
],
|
|
3736
3740
|
pricing: {
|
|
3737
3741
|
inputPerMTok: 3,
|
|
@@ -3865,7 +3869,8 @@ var anthropic_default = {
|
|
|
3865
3869
|
"anthropic/claude-haiku-4.5": {
|
|
3866
3870
|
providerModelName: "claude-haiku-4-5-20251001",
|
|
3867
3871
|
aliases: [
|
|
3868
|
-
"claude-haiku-4-5-20251001"
|
|
3872
|
+
"claude-haiku-4-5-20251001",
|
|
3873
|
+
"claude-haiku-4-5"
|
|
3869
3874
|
],
|
|
3870
3875
|
pricing: {
|
|
3871
3876
|
inputPerMTok: 1,
|
|
@@ -4224,7 +4229,7 @@ var google_default = {
|
|
|
4224
4229
|
structuredOutput: true,
|
|
4225
4230
|
vision: true,
|
|
4226
4231
|
audio: true,
|
|
4227
|
-
video:
|
|
4232
|
+
video: true,
|
|
4228
4233
|
imageGeneration: false,
|
|
4229
4234
|
audioGeneration: false,
|
|
4230
4235
|
videoGeneration: false
|
|
@@ -4240,7 +4245,9 @@ var google_default = {
|
|
|
4240
4245
|
inputModalities: [
|
|
4241
4246
|
"text",
|
|
4242
4247
|
"image",
|
|
4243
|
-
"audio"
|
|
4248
|
+
"audio",
|
|
4249
|
+
"pdf",
|
|
4250
|
+
"video"
|
|
4244
4251
|
],
|
|
4245
4252
|
outputModalities: [
|
|
4246
4253
|
"text"
|
|
@@ -4296,7 +4303,7 @@ var google_default = {
|
|
|
4296
4303
|
structuredOutput: true,
|
|
4297
4304
|
vision: true,
|
|
4298
4305
|
audio: true,
|
|
4299
|
-
video:
|
|
4306
|
+
video: true,
|
|
4300
4307
|
imageGeneration: false,
|
|
4301
4308
|
audioGeneration: false,
|
|
4302
4309
|
videoGeneration: false
|
|
@@ -4318,7 +4325,9 @@ var google_default = {
|
|
|
4318
4325
|
inputModalities: [
|
|
4319
4326
|
"text",
|
|
4320
4327
|
"image",
|
|
4321
|
-
"audio"
|
|
4328
|
+
"audio",
|
|
4329
|
+
"pdf",
|
|
4330
|
+
"video"
|
|
4322
4331
|
],
|
|
4323
4332
|
outputModalities: [
|
|
4324
4333
|
"text"
|
|
@@ -4356,7 +4365,7 @@ var google_default = {
|
|
|
4356
4365
|
structuredOutput: true,
|
|
4357
4366
|
vision: true,
|
|
4358
4367
|
audio: true,
|
|
4359
|
-
video:
|
|
4368
|
+
video: true,
|
|
4360
4369
|
imageGeneration: false,
|
|
4361
4370
|
audioGeneration: false,
|
|
4362
4371
|
videoGeneration: false
|
|
@@ -4372,7 +4381,9 @@ var google_default = {
|
|
|
4372
4381
|
inputModalities: [
|
|
4373
4382
|
"text",
|
|
4374
4383
|
"image",
|
|
4375
|
-
"audio"
|
|
4384
|
+
"audio",
|
|
4385
|
+
"pdf",
|
|
4386
|
+
"video"
|
|
4376
4387
|
],
|
|
4377
4388
|
outputModalities: [
|
|
4378
4389
|
"text"
|
|
@@ -4431,7 +4442,7 @@ var google_default = {
|
|
|
4431
4442
|
structuredOutput: true,
|
|
4432
4443
|
vision: true,
|
|
4433
4444
|
audio: true,
|
|
4434
|
-
video:
|
|
4445
|
+
video: true,
|
|
4435
4446
|
imageGeneration: false,
|
|
4436
4447
|
audioGeneration: false,
|
|
4437
4448
|
videoGeneration: false
|
|
@@ -4447,7 +4458,9 @@ var google_default = {
|
|
|
4447
4458
|
inputModalities: [
|
|
4448
4459
|
"text",
|
|
4449
4460
|
"image",
|
|
4450
|
-
"audio"
|
|
4461
|
+
"audio",
|
|
4462
|
+
"pdf",
|
|
4463
|
+
"video"
|
|
4451
4464
|
],
|
|
4452
4465
|
outputModalities: [
|
|
4453
4466
|
"text"
|
|
@@ -4506,7 +4519,7 @@ var google_default = {
|
|
|
4506
4519
|
structuredOutput: true,
|
|
4507
4520
|
vision: true,
|
|
4508
4521
|
audio: true,
|
|
4509
|
-
video:
|
|
4522
|
+
video: true,
|
|
4510
4523
|
imageGeneration: false,
|
|
4511
4524
|
audioGeneration: false,
|
|
4512
4525
|
videoGeneration: false
|
|
@@ -4529,7 +4542,9 @@ var google_default = {
|
|
|
4529
4542
|
inputModalities: [
|
|
4530
4543
|
"text",
|
|
4531
4544
|
"image",
|
|
4532
|
-
"audio"
|
|
4545
|
+
"audio",
|
|
4546
|
+
"pdf",
|
|
4547
|
+
"video"
|
|
4533
4548
|
],
|
|
4534
4549
|
outputModalities: [
|
|
4535
4550
|
"text"
|
|
@@ -4584,7 +4599,7 @@ var google_default = {
|
|
|
4584
4599
|
structuredOutput: true,
|
|
4585
4600
|
vision: true,
|
|
4586
4601
|
audio: true,
|
|
4587
|
-
video:
|
|
4602
|
+
video: true,
|
|
4588
4603
|
imageGeneration: false,
|
|
4589
4604
|
audioGeneration: false,
|
|
4590
4605
|
videoGeneration: false
|
|
@@ -4600,7 +4615,9 @@ var google_default = {
|
|
|
4600
4615
|
inputModalities: [
|
|
4601
4616
|
"text",
|
|
4602
4617
|
"image",
|
|
4603
|
-
"audio"
|
|
4618
|
+
"audio",
|
|
4619
|
+
"pdf",
|
|
4620
|
+
"video"
|
|
4604
4621
|
],
|
|
4605
4622
|
outputModalities: [
|
|
4606
4623
|
"text"
|
|
@@ -4659,7 +4676,7 @@ var google_default = {
|
|
|
4659
4676
|
structuredOutput: true,
|
|
4660
4677
|
vision: true,
|
|
4661
4678
|
audio: true,
|
|
4662
|
-
video:
|
|
4679
|
+
video: true,
|
|
4663
4680
|
imageGeneration: false,
|
|
4664
4681
|
audioGeneration: false,
|
|
4665
4682
|
videoGeneration: false
|
|
@@ -4675,7 +4692,9 @@ var google_default = {
|
|
|
4675
4692
|
inputModalities: [
|
|
4676
4693
|
"text",
|
|
4677
4694
|
"image",
|
|
4678
|
-
"audio"
|
|
4695
|
+
"audio",
|
|
4696
|
+
"pdf",
|
|
4697
|
+
"video"
|
|
4679
4698
|
],
|
|
4680
4699
|
outputModalities: [
|
|
4681
4700
|
"text"
|
|
@@ -4735,7 +4754,7 @@ var google_default = {
|
|
|
4735
4754
|
structuredOutput: true,
|
|
4736
4755
|
vision: true,
|
|
4737
4756
|
audio: true,
|
|
4738
|
-
video:
|
|
4757
|
+
video: true,
|
|
4739
4758
|
imageGeneration: false,
|
|
4740
4759
|
audioGeneration: false,
|
|
4741
4760
|
videoGeneration: false
|
|
@@ -4751,7 +4770,9 @@ var google_default = {
|
|
|
4751
4770
|
inputModalities: [
|
|
4752
4771
|
"text",
|
|
4753
4772
|
"image",
|
|
4754
|
-
"audio"
|
|
4773
|
+
"audio",
|
|
4774
|
+
"pdf",
|
|
4775
|
+
"video"
|
|
4755
4776
|
],
|
|
4756
4777
|
outputModalities: [
|
|
4757
4778
|
"text"
|
|
@@ -5734,7 +5755,8 @@ var google_default = {
|
|
|
5734
5755
|
type: "chat",
|
|
5735
5756
|
inputModalities: [
|
|
5736
5757
|
"text",
|
|
5737
|
-
"image"
|
|
5758
|
+
"image",
|
|
5759
|
+
"pdf"
|
|
5738
5760
|
],
|
|
5739
5761
|
outputModalities: [
|
|
5740
5762
|
"text"
|
|
@@ -5787,7 +5809,8 @@ var google_default = {
|
|
|
5787
5809
|
type: "chat",
|
|
5788
5810
|
inputModalities: [
|
|
5789
5811
|
"text",
|
|
5790
|
-
"image"
|
|
5812
|
+
"image",
|
|
5813
|
+
"pdf"
|
|
5791
5814
|
],
|
|
5792
5815
|
outputModalities: [
|
|
5793
5816
|
"text"
|
|
@@ -6956,7 +6979,7 @@ var google_default = {
|
|
|
6956
6979
|
structuredOutput: true,
|
|
6957
6980
|
vision: true,
|
|
6958
6981
|
audio: true,
|
|
6959
|
-
video:
|
|
6982
|
+
video: true,
|
|
6960
6983
|
imageGeneration: false,
|
|
6961
6984
|
audioGeneration: false,
|
|
6962
6985
|
videoGeneration: false
|
|
@@ -6972,7 +6995,9 @@ var google_default = {
|
|
|
6972
6995
|
inputModalities: [
|
|
6973
6996
|
"text",
|
|
6974
6997
|
"image",
|
|
6975
|
-
"audio"
|
|
6998
|
+
"audio",
|
|
6999
|
+
"pdf",
|
|
7000
|
+
"video"
|
|
6976
7001
|
],
|
|
6977
7002
|
outputModalities: [
|
|
6978
7003
|
"text"
|
|
@@ -7028,7 +7053,7 @@ var google_default = {
|
|
|
7028
7053
|
structuredOutput: true,
|
|
7029
7054
|
vision: true,
|
|
7030
7055
|
audio: true,
|
|
7031
|
-
video:
|
|
7056
|
+
video: true,
|
|
7032
7057
|
imageGeneration: false,
|
|
7033
7058
|
audioGeneration: false,
|
|
7034
7059
|
videoGeneration: false
|
|
@@ -7044,7 +7069,9 @@ var google_default = {
|
|
|
7044
7069
|
inputModalities: [
|
|
7045
7070
|
"text",
|
|
7046
7071
|
"image",
|
|
7047
|
-
"audio"
|
|
7072
|
+
"audio",
|
|
7073
|
+
"pdf",
|
|
7074
|
+
"video"
|
|
7048
7075
|
],
|
|
7049
7076
|
outputModalities: [
|
|
7050
7077
|
"text"
|
|
@@ -7099,7 +7126,7 @@ var google_default = {
|
|
|
7099
7126
|
structuredOutput: true,
|
|
7100
7127
|
vision: true,
|
|
7101
7128
|
audio: true,
|
|
7102
|
-
video:
|
|
7129
|
+
video: true,
|
|
7103
7130
|
imageGeneration: false,
|
|
7104
7131
|
audioGeneration: false,
|
|
7105
7132
|
videoGeneration: false
|
|
@@ -7115,7 +7142,9 @@ var google_default = {
|
|
|
7115
7142
|
inputModalities: [
|
|
7116
7143
|
"text",
|
|
7117
7144
|
"image",
|
|
7118
|
-
"audio"
|
|
7145
|
+
"audio",
|
|
7146
|
+
"pdf",
|
|
7147
|
+
"video"
|
|
7119
7148
|
],
|
|
7120
7149
|
outputModalities: [
|
|
7121
7150
|
"text"
|
|
@@ -7405,7 +7434,8 @@ var openai_default = {
|
|
|
7405
7434
|
type: "chat",
|
|
7406
7435
|
inputModalities: [
|
|
7407
7436
|
"text",
|
|
7408
|
-
"image"
|
|
7437
|
+
"image",
|
|
7438
|
+
"pdf"
|
|
7409
7439
|
],
|
|
7410
7440
|
outputModalities: [
|
|
7411
7441
|
"text"
|
|
@@ -7465,7 +7495,8 @@ var openai_default = {
|
|
|
7465
7495
|
type: "chat",
|
|
7466
7496
|
inputModalities: [
|
|
7467
7497
|
"text",
|
|
7468
|
-
"image"
|
|
7498
|
+
"image",
|
|
7499
|
+
"pdf"
|
|
7469
7500
|
],
|
|
7470
7501
|
outputModalities: [
|
|
7471
7502
|
"text"
|
|
@@ -7521,7 +7552,8 @@ var openai_default = {
|
|
|
7521
7552
|
type: "chat",
|
|
7522
7553
|
inputModalities: [
|
|
7523
7554
|
"text",
|
|
7524
|
-
"image"
|
|
7555
|
+
"image",
|
|
7556
|
+
"pdf"
|
|
7525
7557
|
],
|
|
7526
7558
|
outputModalities: [
|
|
7527
7559
|
"text"
|
|
@@ -7632,7 +7664,8 @@ var openai_default = {
|
|
|
7632
7664
|
type: "chat",
|
|
7633
7665
|
inputModalities: [
|
|
7634
7666
|
"text",
|
|
7635
|
-
"image"
|
|
7667
|
+
"image",
|
|
7668
|
+
"pdf"
|
|
7636
7669
|
],
|
|
7637
7670
|
outputModalities: [
|
|
7638
7671
|
"text"
|
|
@@ -7688,7 +7721,8 @@ var openai_default = {
|
|
|
7688
7721
|
type: "chat",
|
|
7689
7722
|
inputModalities: [
|
|
7690
7723
|
"text",
|
|
7691
|
-
"image"
|
|
7724
|
+
"image",
|
|
7725
|
+
"pdf"
|
|
7692
7726
|
],
|
|
7693
7727
|
outputModalities: [
|
|
7694
7728
|
"text"
|
|
@@ -7768,7 +7802,8 @@ var openai_default = {
|
|
|
7768
7802
|
type: "chat",
|
|
7769
7803
|
inputModalities: [
|
|
7770
7804
|
"text",
|
|
7771
|
-
"image"
|
|
7805
|
+
"image",
|
|
7806
|
+
"pdf"
|
|
7772
7807
|
],
|
|
7773
7808
|
outputModalities: [
|
|
7774
7809
|
"text"
|
|
@@ -7841,7 +7876,8 @@ var openai_default = {
|
|
|
7841
7876
|
type: "chat",
|
|
7842
7877
|
inputModalities: [
|
|
7843
7878
|
"text",
|
|
7844
|
-
"image"
|
|
7879
|
+
"image",
|
|
7880
|
+
"pdf"
|
|
7845
7881
|
],
|
|
7846
7882
|
outputModalities: [
|
|
7847
7883
|
"text"
|
|
@@ -7896,7 +7932,8 @@ var openai_default = {
|
|
|
7896
7932
|
type: "chat",
|
|
7897
7933
|
inputModalities: [
|
|
7898
7934
|
"text",
|
|
7899
|
-
"image"
|
|
7935
|
+
"image",
|
|
7936
|
+
"pdf"
|
|
7900
7937
|
],
|
|
7901
7938
|
outputModalities: [
|
|
7902
7939
|
"text"
|
|
@@ -7955,7 +7992,8 @@ var openai_default = {
|
|
|
7955
7992
|
type: "chat",
|
|
7956
7993
|
inputModalities: [
|
|
7957
7994
|
"text",
|
|
7958
|
-
"image"
|
|
7995
|
+
"image",
|
|
7996
|
+
"pdf"
|
|
7959
7997
|
],
|
|
7960
7998
|
outputModalities: [
|
|
7961
7999
|
"text"
|
|
@@ -8014,7 +8052,8 @@ var openai_default = {
|
|
|
8014
8052
|
type: "chat",
|
|
8015
8053
|
inputModalities: [
|
|
8016
8054
|
"text",
|
|
8017
|
-
"image"
|
|
8055
|
+
"image",
|
|
8056
|
+
"pdf"
|
|
8018
8057
|
],
|
|
8019
8058
|
outputModalities: [
|
|
8020
8059
|
"text"
|
|
@@ -8073,7 +8112,8 @@ var openai_default = {
|
|
|
8073
8112
|
type: "chat",
|
|
8074
8113
|
inputModalities: [
|
|
8075
8114
|
"text",
|
|
8076
|
-
"image"
|
|
8115
|
+
"image",
|
|
8116
|
+
"pdf"
|
|
8077
8117
|
],
|
|
8078
8118
|
outputModalities: [
|
|
8079
8119
|
"text"
|
|
@@ -8490,7 +8530,8 @@ var openai_default = {
|
|
|
8490
8530
|
type: "chat",
|
|
8491
8531
|
inputModalities: [
|
|
8492
8532
|
"text",
|
|
8493
|
-
"image"
|
|
8533
|
+
"image",
|
|
8534
|
+
"pdf"
|
|
8494
8535
|
],
|
|
8495
8536
|
outputModalities: [
|
|
8496
8537
|
"text"
|
|
@@ -8553,7 +8594,8 @@ var openai_default = {
|
|
|
8553
8594
|
type: "chat",
|
|
8554
8595
|
inputModalities: [
|
|
8555
8596
|
"text",
|
|
8556
|
-
"image"
|
|
8597
|
+
"image",
|
|
8598
|
+
"pdf"
|
|
8557
8599
|
],
|
|
8558
8600
|
outputModalities: [
|
|
8559
8601
|
"text"
|
|
@@ -8633,7 +8675,8 @@ var openai_default = {
|
|
|
8633
8675
|
type: "chat",
|
|
8634
8676
|
inputModalities: [
|
|
8635
8677
|
"text",
|
|
8636
|
-
"image"
|
|
8678
|
+
"image",
|
|
8679
|
+
"pdf"
|
|
8637
8680
|
],
|
|
8638
8681
|
outputModalities: [
|
|
8639
8682
|
"text"
|
|
@@ -8696,7 +8739,8 @@ var openai_default = {
|
|
|
8696
8739
|
type: "chat",
|
|
8697
8740
|
inputModalities: [
|
|
8698
8741
|
"text",
|
|
8699
|
-
"image"
|
|
8742
|
+
"image",
|
|
8743
|
+
"pdf"
|
|
8700
8744
|
],
|
|
8701
8745
|
outputModalities: [
|
|
8702
8746
|
"text"
|
|
@@ -8763,7 +8807,8 @@ var openai_default = {
|
|
|
8763
8807
|
type: "chat",
|
|
8764
8808
|
inputModalities: [
|
|
8765
8809
|
"text",
|
|
8766
|
-
"image"
|
|
8810
|
+
"image",
|
|
8811
|
+
"pdf"
|
|
8767
8812
|
],
|
|
8768
8813
|
outputModalities: [
|
|
8769
8814
|
"text"
|
|
@@ -8838,7 +8883,8 @@ var openai_default = {
|
|
|
8838
8883
|
type: "chat",
|
|
8839
8884
|
inputModalities: [
|
|
8840
8885
|
"text",
|
|
8841
|
-
"image"
|
|
8886
|
+
"image",
|
|
8887
|
+
"pdf"
|
|
8842
8888
|
],
|
|
8843
8889
|
outputModalities: [
|
|
8844
8890
|
"text"
|
|
@@ -8892,7 +8938,8 @@ var openai_default = {
|
|
|
8892
8938
|
type: "chat",
|
|
8893
8939
|
inputModalities: [
|
|
8894
8940
|
"text",
|
|
8895
|
-
"image"
|
|
8941
|
+
"image",
|
|
8942
|
+
"pdf"
|
|
8896
8943
|
],
|
|
8897
8944
|
outputModalities: [
|
|
8898
8945
|
"text"
|
|
@@ -8946,7 +8993,8 @@ var openai_default = {
|
|
|
8946
8993
|
type: "chat",
|
|
8947
8994
|
inputModalities: [
|
|
8948
8995
|
"text",
|
|
8949
|
-
"image"
|
|
8996
|
+
"image",
|
|
8997
|
+
"pdf"
|
|
8950
8998
|
],
|
|
8951
8999
|
outputModalities: [
|
|
8952
9000
|
"text"
|
|
@@ -9016,7 +9064,8 @@ var openai_default = {
|
|
|
9016
9064
|
type: "chat",
|
|
9017
9065
|
inputModalities: [
|
|
9018
9066
|
"text",
|
|
9019
|
-
"image"
|
|
9067
|
+
"image",
|
|
9068
|
+
"pdf"
|
|
9020
9069
|
],
|
|
9021
9070
|
outputModalities: [
|
|
9022
9071
|
"text"
|
|
@@ -9080,7 +9129,8 @@ var openai_default = {
|
|
|
9080
9129
|
type: "chat",
|
|
9081
9130
|
inputModalities: [
|
|
9082
9131
|
"text",
|
|
9083
|
-
"image"
|
|
9132
|
+
"image",
|
|
9133
|
+
"pdf"
|
|
9084
9134
|
],
|
|
9085
9135
|
outputModalities: [
|
|
9086
9136
|
"text"
|
|
@@ -9138,7 +9188,8 @@ var openai_default = {
|
|
|
9138
9188
|
type: "chat",
|
|
9139
9189
|
inputModalities: [
|
|
9140
9190
|
"text",
|
|
9141
|
-
"image"
|
|
9191
|
+
"image",
|
|
9192
|
+
"pdf"
|
|
9142
9193
|
],
|
|
9143
9194
|
outputModalities: [
|
|
9144
9195
|
"text"
|
|
@@ -9195,7 +9246,8 @@ var openai_default = {
|
|
|
9195
9246
|
type: "chat",
|
|
9196
9247
|
inputModalities: [
|
|
9197
9248
|
"text",
|
|
9198
|
-
"image"
|
|
9249
|
+
"image",
|
|
9250
|
+
"pdf"
|
|
9199
9251
|
],
|
|
9200
9252
|
outputModalities: [
|
|
9201
9253
|
"text"
|
|
@@ -10275,7 +10327,8 @@ var openai_default = {
|
|
|
10275
10327
|
type: "chat",
|
|
10276
10328
|
inputModalities: [
|
|
10277
10329
|
"text",
|
|
10278
|
-
"image"
|
|
10330
|
+
"image",
|
|
10331
|
+
"pdf"
|
|
10279
10332
|
],
|
|
10280
10333
|
outputModalities: [
|
|
10281
10334
|
"text"
|
|
@@ -10332,7 +10385,8 @@ var openai_default = {
|
|
|
10332
10385
|
type: "chat",
|
|
10333
10386
|
inputModalities: [
|
|
10334
10387
|
"text",
|
|
10335
|
-
"image"
|
|
10388
|
+
"image",
|
|
10389
|
+
"pdf"
|
|
10336
10390
|
],
|
|
10337
10391
|
outputModalities: [
|
|
10338
10392
|
"text"
|
|
@@ -10397,7 +10451,8 @@ var openai_default = {
|
|
|
10397
10451
|
type: "chat",
|
|
10398
10452
|
inputModalities: [
|
|
10399
10453
|
"text",
|
|
10400
|
-
"image"
|
|
10454
|
+
"image",
|
|
10455
|
+
"pdf"
|
|
10401
10456
|
],
|
|
10402
10457
|
outputModalities: [
|
|
10403
10458
|
"text"
|
|
@@ -10514,7 +10569,8 @@ var openai_default = {
|
|
|
10514
10569
|
type: "chat",
|
|
10515
10570
|
inputModalities: [
|
|
10516
10571
|
"text",
|
|
10517
|
-
"image"
|
|
10572
|
+
"image",
|
|
10573
|
+
"pdf"
|
|
10518
10574
|
],
|
|
10519
10575
|
outputModalities: [
|
|
10520
10576
|
"text"
|
|
@@ -10582,7 +10638,8 @@ var openai_default = {
|
|
|
10582
10638
|
type: "chat",
|
|
10583
10639
|
inputModalities: [
|
|
10584
10640
|
"text",
|
|
10585
|
-
"image"
|
|
10641
|
+
"image",
|
|
10642
|
+
"pdf"
|
|
10586
10643
|
],
|
|
10587
10644
|
outputModalities: [
|
|
10588
10645
|
"text"
|
|
@@ -11622,7 +11679,8 @@ var openai_default = {
|
|
|
11622
11679
|
type: "chat",
|
|
11623
11680
|
inputModalities: [
|
|
11624
11681
|
"text",
|
|
11625
|
-
"image"
|
|
11682
|
+
"image",
|
|
11683
|
+
"pdf"
|
|
11626
11684
|
],
|
|
11627
11685
|
outputModalities: [
|
|
11628
11686
|
"text"
|
|
@@ -11700,7 +11758,8 @@ var openai_default = {
|
|
|
11700
11758
|
type: "chat",
|
|
11701
11759
|
inputModalities: [
|
|
11702
11760
|
"text",
|
|
11703
|
-
"image"
|
|
11761
|
+
"image",
|
|
11762
|
+
"pdf"
|
|
11704
11763
|
],
|
|
11705
11764
|
outputModalities: [
|
|
11706
11765
|
"text"
|
|
@@ -11778,7 +11837,8 @@ var openai_default = {
|
|
|
11778
11837
|
type: "chat",
|
|
11779
11838
|
inputModalities: [
|
|
11780
11839
|
"text",
|
|
11781
|
-
"image"
|
|
11840
|
+
"image",
|
|
11841
|
+
"pdf"
|
|
11782
11842
|
],
|
|
11783
11843
|
outputModalities: [
|
|
11784
11844
|
"text"
|
|
@@ -29485,14 +29545,23 @@ function withBuiltinTools(provider, caps) {
|
|
|
29485
29545
|
if (!tools || tools.length === 0) return caps;
|
|
29486
29546
|
return { ...caps, builtinTools: [...tools] };
|
|
29487
29547
|
}
|
|
29548
|
+
function normalizeId(model) {
|
|
29549
|
+
return model.toLowerCase().replace(/(?<=\d)[-.](?=\d)/g, ".");
|
|
29550
|
+
}
|
|
29488
29551
|
var ModelCatalog = class _ModelCatalog {
|
|
29489
29552
|
models = /* @__PURE__ */ new Map();
|
|
29490
29553
|
/** `provider/alias` → `provider/canonical-slug`. Lets get()/resolveModelId
|
|
29491
29554
|
* accept any callable id (providerModelName, dated snapshot) AND the slug. */
|
|
29492
29555
|
aliasIndex = /* @__PURE__ */ new Map();
|
|
29556
|
+
/** `provider/normalized-id` → `provider/canonical-slug`. The last resort, so a
|
|
29557
|
+
* user's spelling of a version never decides whether the model is found. */
|
|
29558
|
+
normIndex = /* @__PURE__ */ new Map();
|
|
29493
29559
|
key(provider, model) {
|
|
29494
29560
|
return `${provider}/${model}`;
|
|
29495
29561
|
}
|
|
29562
|
+
normKey(provider, model) {
|
|
29563
|
+
return `${provider}/${normalizeId(model)}`;
|
|
29564
|
+
}
|
|
29496
29565
|
set(provider, model, info) {
|
|
29497
29566
|
const canonical = this.key(provider, model);
|
|
29498
29567
|
this.models.set(canonical, {
|
|
@@ -29530,19 +29599,39 @@ var ModelCatalog = class _ModelCatalog {
|
|
|
29530
29599
|
this.aliasIndex.set(this.key(provider, alias), canonical);
|
|
29531
29600
|
}
|
|
29532
29601
|
}
|
|
29602
|
+
for (const name of [model, info.providerModelName, ...info.aliases ?? []]) {
|
|
29603
|
+
if (!name) continue;
|
|
29604
|
+
const nk = this.normKey(provider, name);
|
|
29605
|
+
if (!this.normIndex.has(nk)) this.normIndex.set(nk, canonical);
|
|
29606
|
+
}
|
|
29533
29607
|
}
|
|
29534
29608
|
get(provider, model) {
|
|
29535
29609
|
const direct = this.models.get(this.key(provider, model));
|
|
29536
29610
|
if (direct) return direct;
|
|
29537
|
-
const canonical = this.aliasIndex.get(this.key(provider, model))
|
|
29611
|
+
const canonical = this.aliasIndex.get(this.key(provider, model)) ?? // Last resort: the same model under a different spelling of its version.
|
|
29612
|
+
this.normIndex.get(this.normKey(provider, model));
|
|
29538
29613
|
return canonical ? this.models.get(canonical) ?? null : null;
|
|
29539
29614
|
}
|
|
29540
|
-
/** The exact id to SEND to the provider for a given model string.
|
|
29541
|
-
*
|
|
29542
|
-
*
|
|
29615
|
+
/** The exact id to SEND to the provider for a given model string.
|
|
29616
|
+
*
|
|
29617
|
+
* Three cases, and the difference between them is what the caller ASKED for:
|
|
29618
|
+
* - our slug → translate to providerModelName (the pinned snapshot)
|
|
29619
|
+
* - an id the provider itself accepts (a listed alias, e.g. a dated snapshot
|
|
29620
|
+
* or anthropic's undated name) → verbatim, because it is a deliberate choice
|
|
29621
|
+
* and rewriting it would pin a caller who asked to float
|
|
29622
|
+
* - a spelling variant that is NOT callable (`gemini-2-5-flash`) → the
|
|
29623
|
+
* canonical entry's providerModelName, since forwarding it verbatim only
|
|
29624
|
+
* produces a 404 with the user's typo in it
|
|
29625
|
+
* - unknown → verbatim, so a model we have never heard of still works */
|
|
29543
29626
|
resolveModelId(provider, model) {
|
|
29544
29627
|
const direct = this.models.get(this.key(provider, model));
|
|
29545
29628
|
if (direct) return direct.providerModelName ?? model;
|
|
29629
|
+
if (this.aliasIndex.has(this.key(provider, model))) return model;
|
|
29630
|
+
const canonical = this.normIndex.get(this.normKey(provider, model));
|
|
29631
|
+
if (canonical) {
|
|
29632
|
+
const info = this.models.get(canonical);
|
|
29633
|
+
if (info) return info.providerModelName ?? info.model;
|
|
29634
|
+
}
|
|
29546
29635
|
return model;
|
|
29547
29636
|
}
|
|
29548
29637
|
getPricing(provider, model) {
|
|
@@ -29691,14 +29780,31 @@ function evalCond(cond, ctx, reg) {
|
|
|
29691
29780
|
const t = ctx.item?.value;
|
|
29692
29781
|
return !reg.predicates.isFunctionTool(ctx) && t?.type === c.builtin;
|
|
29693
29782
|
}
|
|
29783
|
+
if ("hasPartType" in c) {
|
|
29784
|
+
const messages = ctx.req.messages;
|
|
29785
|
+
return Boolean(
|
|
29786
|
+
messages?.some(
|
|
29787
|
+
(m) => Array.isArray(m?.content) ? m.content.some((part) => c.hasPartType.includes(part?.type)) : false
|
|
29788
|
+
)
|
|
29789
|
+
);
|
|
29790
|
+
}
|
|
29694
29791
|
if ("hasTool" in c) {
|
|
29695
29792
|
const tools = ctx.req.tools;
|
|
29696
|
-
|
|
29793
|
+
const present = Boolean(
|
|
29697
29794
|
tools?.some((t) => {
|
|
29698
29795
|
const itemCtx = { ...ctx, item: { value: t, index: 0, isLast: false } };
|
|
29699
29796
|
return !reg.predicates.isFunctionTool(itemCtx) && t?.type === c.hasTool;
|
|
29700
29797
|
})
|
|
29701
29798
|
);
|
|
29799
|
+
if (!present) return false;
|
|
29800
|
+
const blocked = ctx.spec.toolConstraints?.find(
|
|
29801
|
+
(tc) => tc.tool === c.hasTool && evalCond(tc.conflictsWith, ctx, reg)
|
|
29802
|
+
);
|
|
29803
|
+
if (blocked) {
|
|
29804
|
+
if (ctx.notes && !ctx.notes.includes(blocked.why)) ctx.notes.push(blocked.why);
|
|
29805
|
+
return false;
|
|
29806
|
+
}
|
|
29807
|
+
return true;
|
|
29702
29808
|
}
|
|
29703
29809
|
if ("hasFunctionTool" in c) {
|
|
29704
29810
|
const tools = ctx.req.tools;
|
|
@@ -29824,7 +29930,8 @@ function buildFromSpec(spec, req, reg, flavor = spec.provider, onUse, config = {
|
|
|
29824
29930
|
flavor,
|
|
29825
29931
|
config,
|
|
29826
29932
|
variants: resolveVariants(spec, req.model ?? "", reg),
|
|
29827
|
-
body: {}
|
|
29933
|
+
body: {},
|
|
29934
|
+
notes: []
|
|
29828
29935
|
};
|
|
29829
29936
|
for (const v of ctx.variants) onUse?.("variant", v);
|
|
29830
29937
|
for (const f of spec.fields ?? []) {
|
|
@@ -29919,6 +30026,7 @@ function buildFromSpec(spec, req, reg, flavor = spec.provider, onUse, config = {
|
|
|
29919
30026
|
}
|
|
29920
30027
|
}
|
|
29921
30028
|
const out = { body: ctx.body };
|
|
30029
|
+
if (ctx.notes?.length) out.notes = ctx.notes;
|
|
29922
30030
|
if (ctx.multipart) out.multipart = ctx.multipart;
|
|
29923
30031
|
if (spec.envelope?.bodyKind === "none") out.noBody = true;
|
|
29924
30032
|
if (spec.envelope?.bodyKind === "raw") out.rawBody = true;
|
|
@@ -36216,6 +36324,18 @@ var LLMClient = class {
|
|
|
36216
36324
|
return streamFile(file, this.retrieveContext());
|
|
36217
36325
|
}
|
|
36218
36326
|
/** Submit a request. Returns the parsed CompletionResponse. */
|
|
36327
|
+
/** Anything the spec left out on purpose reaches the caller as a warning.
|
|
36328
|
+
* Said once per request; the build already de-duplicates within one. */
|
|
36329
|
+
reportBuildNotes(req, ctx) {
|
|
36330
|
+
for (const note of req.notes ?? []) {
|
|
36331
|
+
this.hooks.emitSync("onWarning", {
|
|
36332
|
+
source: "llm",
|
|
36333
|
+
code: "request_adjusted",
|
|
36334
|
+
message: note,
|
|
36335
|
+
details: { provider: this.provider, model: this.model, ctx }
|
|
36336
|
+
});
|
|
36337
|
+
}
|
|
36338
|
+
}
|
|
36219
36339
|
async complete(input, options = {}) {
|
|
36220
36340
|
const rawMessages = normalizeInput(input);
|
|
36221
36341
|
const { system: systemFromMessages, messages } = extractSystem(rawMessages);
|
|
@@ -36278,6 +36398,7 @@ var LLMClient = class {
|
|
|
36278
36398
|
normalized.messages = decision.messages;
|
|
36279
36399
|
}
|
|
36280
36400
|
const providerReq = this.adapter.buildRequest(normalized);
|
|
36401
|
+
this.reportBuildNotes(providerReq, ctx);
|
|
36281
36402
|
const url = this.adapter.baseURL() + (providerReq.path ?? this.adapter.completionPath());
|
|
36282
36403
|
if (this.cacheKeyFn) {
|
|
36283
36404
|
ctx.cacheKey = ctx.cacheKey ?? this.cacheKeyFn(normalized, ctx);
|
|
@@ -36439,6 +36560,7 @@ var LLMClient = class {
|
|
|
36439
36560
|
normalized.messages = resolveCtx.messages;
|
|
36440
36561
|
normalized.system = resolveCtx.system;
|
|
36441
36562
|
const providerReq = this.adapter.buildRequest(normalized);
|
|
36563
|
+
this.reportBuildNotes(providerReq, ctx);
|
|
36442
36564
|
this.adapter.enableStreaming?.(providerReq, normalized);
|
|
36443
36565
|
const url = this.adapter.baseURL() + (providerReq.path ?? this.adapter.completionPath());
|
|
36444
36566
|
const httpReq = {
|
|
@@ -37217,6 +37339,14 @@ var generate_2_5_default = {
|
|
|
37217
37339
|
id: "google/generate@2.5",
|
|
37218
37340
|
provider: "google",
|
|
37219
37341
|
api: "generate",
|
|
37342
|
+
_toolConstraints: `Measured 2026-08-25: Google answers 400 "The mime type: X is not supported for code execution" when codeExecution is sent with a PDF or a video part. Images are fine, googleSearch is fine, and OpenAI accepts every combination -- so this is one provider's rule, kept with that provider's spec.`,
|
|
37343
|
+
toolConstraints: [
|
|
37344
|
+
{
|
|
37345
|
+
tool: "code_interpreter",
|
|
37346
|
+
conflictsWith: { hasPartType: ["document", "video"] },
|
|
37347
|
+
why: "google: code execution cannot run alongside a PDF or video attachment, so the request was sent without it"
|
|
37348
|
+
}
|
|
37349
|
+
],
|
|
37220
37350
|
tables: {
|
|
37221
37351
|
toolMode: {
|
|
37222
37352
|
auto: "AUTO",
|
|
@@ -54670,6 +54800,35 @@ var KNOWN_KEYS = /* @__PURE__ */ new Set([
|
|
|
54670
54800
|
...Object.keys(CAP_KEYS),
|
|
54671
54801
|
...Object.keys(BUILTIN_TOOL_KEYS)
|
|
54672
54802
|
]);
|
|
54803
|
+
function filterFacets(catalog) {
|
|
54804
|
+
const models = catalog?.list() ?? [];
|
|
54805
|
+
const distinct = (pick) => [...new Set(models.map(pick).filter((v) => !!v))].sort();
|
|
54806
|
+
const facets = [
|
|
54807
|
+
{ key: "type", category: "what it is", label: "Type", values: distinct((m) => m.type), numeric: false, bare: false },
|
|
54808
|
+
{ key: "provider", category: "what it is", label: "Provider", values: distinct((m) => m.provider), numeric: false, bare: false },
|
|
54809
|
+
// The named cutoffs the parser compares against, plus `free` for exactly zero.
|
|
54810
|
+
{ key: "price", category: "cost", label: "Price", values: ["free", "low", "mid", "high"], numeric: true, bare: false },
|
|
54811
|
+
// filled below from the models themselves — tiers are per model, not a fixed set
|
|
54812
|
+
{ key: "tier", category: "cost", label: "Billing tier", values: [], numeric: false, bare: false },
|
|
54813
|
+
{ key: "context", category: "inputs", label: "Context window", values: ["small", "large"], numeric: true, bare: false },
|
|
54814
|
+
{ key: "reasoning", category: "thinking", label: "Reasoning", values: ["yes", "no"], numeric: false, bare: true },
|
|
54815
|
+
{ key: "status", category: "availability", label: "Status", values: distinct((m) => m.status), numeric: false, bare: false },
|
|
54816
|
+
{ key: "active", category: "availability", label: "Offered now", values: ["yes", "no"], numeric: false, bare: true }
|
|
54817
|
+
];
|
|
54818
|
+
for (const key of Object.keys(CAP_KEYS)) {
|
|
54819
|
+
facets.push({ key, category: "inputs", label: key, values: ["yes", "no"], numeric: false, bare: true });
|
|
54820
|
+
}
|
|
54821
|
+
for (const key of Object.keys(BUILTIN_TOOL_KEYS)) {
|
|
54822
|
+
facets.push({ key, category: "hosted tools", label: key.replace(/_/g, " "), values: ["yes", "no"], numeric: false, bare: true });
|
|
54823
|
+
}
|
|
54824
|
+
const tiers = [...new Set(models.flatMap((m) => Object.keys(m.pricing?.tiers ?? {})))].sort();
|
|
54825
|
+
const tierFacet = facets.find((f) => f.key === "tier");
|
|
54826
|
+
if (tierFacet) tierFacet.values = tiers;
|
|
54827
|
+
return facets;
|
|
54828
|
+
}
|
|
54829
|
+
function filterAliases() {
|
|
54830
|
+
return { ...DEFAULT_TAGS };
|
|
54831
|
+
}
|
|
54673
54832
|
function parseNum(v) {
|
|
54674
54833
|
const m = /^([\d.]+)\s*([kKmM]?)$/.exec(v.trim());
|
|
54675
54834
|
if (!m) return Number.NaN;
|
|
@@ -54791,6 +54950,7 @@ function select(query, opts = {}) {
|
|
|
54791
54950
|
function createRealtime(opts) {
|
|
54792
54951
|
const engine = opts.engine ?? coreRegistry.get();
|
|
54793
54952
|
const { provider, model } = resolveModel(opts.model, opts.provider, "createRealtime");
|
|
54953
|
+
const sendModel = engine.catalog.resolveModelId(provider, model);
|
|
54794
54954
|
const apiKey = opts.apiKey ?? engine.apiKeys[provider];
|
|
54795
54955
|
if (!apiKey) {
|
|
54796
54956
|
throw new Error(
|
|
@@ -54800,11 +54960,11 @@ function createRealtime(opts) {
|
|
|
54800
54960
|
const adapter = resolveAdapter2(provider, apiKey);
|
|
54801
54961
|
const voice = resolveVoice(provider, opts.audio?.voice ?? opts.voice);
|
|
54802
54962
|
const session = adapter.connect(
|
|
54803
|
-
{ model, modalities: opts.modalities, voice, instructions: opts.instructions },
|
|
54963
|
+
{ model: sendModel, modalities: opts.modalities, voice, instructions: opts.instructions },
|
|
54804
54964
|
engine.connect
|
|
54805
54965
|
);
|
|
54806
54966
|
session.on("usage", (e) => {
|
|
54807
|
-
void engine.hooks.emit("onCompletion", realtimeCompletionContext(provider,
|
|
54967
|
+
void engine.hooks.emit("onCompletion", realtimeCompletionContext(provider, sendModel, e.usage)).catch(() => {
|
|
54808
54968
|
});
|
|
54809
54969
|
});
|
|
54810
54970
|
return session;
|
|
@@ -57175,6 +57335,8 @@ export {
|
|
|
57175
57335
|
exchangeCode,
|
|
57176
57336
|
extractLastUserText,
|
|
57177
57337
|
extractSystemText,
|
|
57338
|
+
filterAliases,
|
|
57339
|
+
filterFacets,
|
|
57178
57340
|
finalAnswerText,
|
|
57179
57341
|
finishMcpAuth,
|
|
57180
57342
|
formatBulletedList,
|