supercompat 2.10.0 → 2.11.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/dist/index.cjs CHANGED
@@ -1012,6 +1012,70 @@ var azureOpenaiClientAdapter = function(param) {
1012
1012
  }
1013
1013
  };
1014
1014
  };
1015
+ // src/adapters/client/mistralClientAdapter/models/get.ts
1016
+ var get2 = function(param) {
1017
+ var mistral = param.mistral;
1018
+ return /*#__PURE__*/ function() {
1019
+ var _ref = _async_to_generator(function(_url, _options) {
1020
+ var data, error;
1021
+ return _ts_generator(this, function(_state) {
1022
+ switch(_state.label){
1023
+ case 0:
1024
+ _state.trys.push([
1025
+ 0,
1026
+ 2,
1027
+ ,
1028
+ 3
1029
+ ]);
1030
+ return [
1031
+ 4,
1032
+ mistral.models.list()
1033
+ ];
1034
+ case 1:
1035
+ data = _state.sent();
1036
+ return [
1037
+ 2,
1038
+ new Response(JSON.stringify(data), {
1039
+ status: 200,
1040
+ headers: {
1041
+ "Content-Type": "application/json"
1042
+ }
1043
+ })
1044
+ ];
1045
+ case 2:
1046
+ error = _state.sent();
1047
+ return [
1048
+ 2,
1049
+ new Response(JSON.stringify({
1050
+ error: error
1051
+ }), {
1052
+ status: 500,
1053
+ headers: {
1054
+ "Content-Type": "application/json"
1055
+ }
1056
+ })
1057
+ ];
1058
+ case 3:
1059
+ return [
1060
+ 2
1061
+ ];
1062
+ }
1063
+ });
1064
+ });
1065
+ return function(_url, _options) {
1066
+ return _ref.apply(this, arguments);
1067
+ };
1068
+ }();
1069
+ };
1070
+ // src/adapters/client/mistralClientAdapter/models/index.ts
1071
+ var models2 = function(param) {
1072
+ var mistral = param.mistral;
1073
+ return {
1074
+ get: get2({
1075
+ mistral: mistral
1076
+ })
1077
+ };
1078
+ };
1015
1079
  // src/adapters/client/mistralClientAdapter/completions/serializeChunk.ts
1016
1080
  var serializeDelta = function(_param) {
1017
1081
  var toolCalls = _param.delta.toolCalls, rest = _object_without_properties(_param.delta, [
@@ -1260,12 +1324,76 @@ var mistralClientAdapter = function(param) {
1260
1324
  return {
1261
1325
  client: mistral,
1262
1326
  requestHandlers: {
1327
+ "^/v1/models$": models2({
1328
+ mistral: mistral
1329
+ }),
1263
1330
  "^/v1/chat/completions$": completions3({
1264
1331
  mistral: mistral
1265
1332
  })
1266
1333
  }
1267
1334
  };
1268
1335
  };
1336
+ // src/adapters/client/perplexityClientAdapter/models/get.ts
1337
+ var models3 = [
1338
+ "llama-3.1-sonar-small-128k-online",
1339
+ "llama-3.1-sonar-large-128k-online",
1340
+ "llama-3.1-sonar-huge-128k-online"
1341
+ ];
1342
+ var get3 = function(param) {
1343
+ var perplexity = param.perplexity;
1344
+ return /*#__PURE__*/ function() {
1345
+ var _ref = _async_to_generator(function(_url, _options) {
1346
+ return _ts_generator(this, function(_state) {
1347
+ try {
1348
+ return [
1349
+ 2,
1350
+ new Response(JSON.stringify({
1351
+ type: "list",
1352
+ data: models3.map(function(model) {
1353
+ return {
1354
+ id: model,
1355
+ object: "model"
1356
+ };
1357
+ })
1358
+ }), {
1359
+ status: 200,
1360
+ headers: {
1361
+ "Content-Type": "application/json"
1362
+ }
1363
+ })
1364
+ ];
1365
+ } catch (error) {
1366
+ return [
1367
+ 2,
1368
+ new Response(JSON.stringify({
1369
+ error: error
1370
+ }), {
1371
+ status: 500,
1372
+ headers: {
1373
+ "Content-Type": "application/json"
1374
+ }
1375
+ })
1376
+ ];
1377
+ }
1378
+ return [
1379
+ 2
1380
+ ];
1381
+ });
1382
+ });
1383
+ return function(_url, _options) {
1384
+ return _ref.apply(this, arguments);
1385
+ };
1386
+ }();
1387
+ };
1388
+ // src/adapters/client/perplexityClientAdapter/models/index.ts
1389
+ var models4 = function(param) {
1390
+ var perplexity = param.perplexity;
1391
+ return {
1392
+ get: get3({
1393
+ perplexity: perplexity
1394
+ })
1395
+ };
1396
+ };
1269
1397
  // src/lib/messages/alternatingMessages.ts
1270
1398
  var agentSideRoles = [
1271
1399
  "assistant",
@@ -1484,12 +1612,79 @@ var perplexityClientAdapter = function(param) {
1484
1612
  return {
1485
1613
  client: perplexity,
1486
1614
  requestHandlers: {
1615
+ "^/v1/models$": models4({
1616
+ perplexity: perplexity
1617
+ }),
1487
1618
  "^/v1/chat/completions$": completions4({
1488
1619
  perplexity: perplexity
1489
1620
  })
1490
1621
  }
1491
1622
  };
1492
1623
  };
1624
+ // src/adapters/client/anthropicClientAdapter/models/get.ts
1625
+ var models5 = [
1626
+ "claude-3-5-sonnet-20241022",
1627
+ "claude-3-5-sonnet-20240620",
1628
+ "claude-3-opus-20240229",
1629
+ "claude-3-sonnet-20240229",
1630
+ "claude-3-5-haiku-20241022",
1631
+ "claude-3-haiku-20240307"
1632
+ ];
1633
+ var get4 = function(param) {
1634
+ var anthropic = param.anthropic;
1635
+ return /*#__PURE__*/ function() {
1636
+ var _ref = _async_to_generator(function(_url, _options) {
1637
+ return _ts_generator(this, function(_state) {
1638
+ try {
1639
+ return [
1640
+ 2,
1641
+ new Response(JSON.stringify({
1642
+ type: "list",
1643
+ data: models5.map(function(model) {
1644
+ return {
1645
+ id: model,
1646
+ object: "model"
1647
+ };
1648
+ })
1649
+ }), {
1650
+ status: 200,
1651
+ headers: {
1652
+ "Content-Type": "application/json"
1653
+ }
1654
+ })
1655
+ ];
1656
+ } catch (error) {
1657
+ return [
1658
+ 2,
1659
+ new Response(JSON.stringify({
1660
+ error: error
1661
+ }), {
1662
+ status: 500,
1663
+ headers: {
1664
+ "Content-Type": "application/json"
1665
+ }
1666
+ })
1667
+ ];
1668
+ }
1669
+ return [
1670
+ 2
1671
+ ];
1672
+ });
1673
+ });
1674
+ return function(_url, _options) {
1675
+ return _ref.apply(this, arguments);
1676
+ };
1677
+ }();
1678
+ };
1679
+ // src/adapters/client/anthropicClientAdapter/models/index.ts
1680
+ var models6 = function(param) {
1681
+ var anthropic = param.anthropic;
1682
+ return {
1683
+ get: get4({
1684
+ anthropic: anthropic
1685
+ })
1686
+ };
1687
+ };
1493
1688
  // src/adapters/client/anthropicClientAdapter/completions/post.ts
1494
1689
  var import_radash3 = require("radash");
1495
1690
  // src/lib/messages/nonEmptyMessages.ts
@@ -1864,6 +2059,9 @@ var anthropicClientAdapter = function(param) {
1864
2059
  return {
1865
2060
  client: anthropic,
1866
2061
  requestHandlers: {
2062
+ "^/v1/models$": models6({
2063
+ anthropic: anthropic
2064
+ }),
1867
2065
  "^/v1/chat/completions$": completions5({
1868
2066
  anthropic: anthropic
1869
2067
  })
@@ -2588,7 +2786,7 @@ var post7 = function(param) {
2588
2786
  };
2589
2787
  // src/adapters/storage/prismaStorageAdapter/threads/messages/get.ts
2590
2788
  var import_radash7 = require("radash");
2591
- var get2 = function(param) {
2789
+ var get5 = function(param) {
2592
2790
  var prisma = param.prisma;
2593
2791
  return /*#__PURE__*/ function() {
2594
2792
  var _ref = _async_to_generator(function(urlString) {
@@ -2657,7 +2855,7 @@ var messages2 = function(param) {
2657
2855
  post: post7({
2658
2856
  prisma: prisma
2659
2857
  }),
2660
- get: get2({
2858
+ get: get5({
2661
2859
  prisma: prisma
2662
2860
  })
2663
2861
  };
@@ -2702,7 +2900,7 @@ var serializeRun = function(param) {
2702
2900
  };
2703
2901
  };
2704
2902
  // src/adapters/storage/prismaStorageAdapter/threads/runs/get.ts
2705
- var get3 = function(param) {
2903
+ var get6 = function(param) {
2706
2904
  var prisma = param.prisma;
2707
2905
  return /*#__PURE__*/ function() {
2708
2906
  var _ref = _async_to_generator(function(urlString) {
@@ -3299,7 +3497,7 @@ var post8 = function(param) {
3299
3497
  var runs = function(param) {
3300
3498
  var prisma = param.prisma, runAdapter = param.runAdapter;
3301
3499
  return {
3302
- get: get3({
3500
+ get: get6({
3303
3501
  prisma: prisma
3304
3502
  }),
3305
3503
  post: post8({
@@ -3309,7 +3507,7 @@ var runs = function(param) {
3309
3507
  };
3310
3508
  };
3311
3509
  // src/adapters/storage/prismaStorageAdapter/threads/run/get.ts
3312
- var get4 = function(param) {
3510
+ var get7 = function(param) {
3313
3511
  var prisma = param.prisma;
3314
3512
  return /*#__PURE__*/ function() {
3315
3513
  var _ref = _async_to_generator(function(urlString) {
@@ -3354,14 +3552,14 @@ var get4 = function(param) {
3354
3552
  var run = function(param) {
3355
3553
  var prisma = param.prisma, runAdapter = param.runAdapter;
3356
3554
  return {
3357
- get: get4({
3555
+ get: get7({
3358
3556
  prisma: prisma
3359
3557
  })
3360
3558
  };
3361
3559
  };
3362
3560
  // src/adapters/storage/prismaStorageAdapter/threads/runs/steps/get.ts
3363
3561
  var import_radash10 = require("radash");
3364
- var get5 = function(param) {
3562
+ var get8 = function(param) {
3365
3563
  var prisma = param.prisma;
3366
3564
  return /*#__PURE__*/ function() {
3367
3565
  var _ref = _async_to_generator(function(urlString) {
@@ -3429,7 +3627,7 @@ var get5 = function(param) {
3429
3627
  var steps = function(param) {
3430
3628
  var prisma = param.prisma;
3431
3629
  return {
3432
- get: get5({
3630
+ get: get8({
3433
3631
  prisma: prisma
3434
3632
  })
3435
3633
  };