supercompat 2.10.0 → 2.12.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 +273 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +273 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -30,6 +30,9 @@ declare const openaiClientAdapter: ({ openai, }: {
|
|
|
30
30
|
}) => {
|
|
31
31
|
client: OpenAI;
|
|
32
32
|
requestHandlers: {
|
|
33
|
+
'^/v1/models$': {
|
|
34
|
+
get: (_url: string, _options: any) => Promise<Response>;
|
|
35
|
+
};
|
|
33
36
|
'^/(?:v1|/?openai)/chat/completions$': {
|
|
34
37
|
post: (_url: string, options: any) => Promise<Response>;
|
|
35
38
|
};
|
|
@@ -53,6 +56,9 @@ declare const mistralClientAdapter: ({ mistral, }: {
|
|
|
53
56
|
}) => {
|
|
54
57
|
client: Mistral;
|
|
55
58
|
requestHandlers: {
|
|
59
|
+
'^/v1/models$': {
|
|
60
|
+
get: (_url: string, _options: any) => Promise<Response>;
|
|
61
|
+
};
|
|
56
62
|
'^/v1/chat/completions$': {
|
|
57
63
|
post: (_url: string, options: any) => Promise<Response>;
|
|
58
64
|
};
|
|
@@ -64,6 +70,9 @@ declare const perplexityClientAdapter: ({ perplexity, }: {
|
|
|
64
70
|
}) => {
|
|
65
71
|
client: OpenAI;
|
|
66
72
|
requestHandlers: {
|
|
73
|
+
'^/v1/models$': {
|
|
74
|
+
get: (_url: string, _options: any) => Promise<Response>;
|
|
75
|
+
};
|
|
67
76
|
'^/v1/chat/completions$': {
|
|
68
77
|
post: (_url: string, options: any) => Promise<Response>;
|
|
69
78
|
};
|
|
@@ -75,6 +84,9 @@ declare const anthropicClientAdapter: ({ anthropic, }: {
|
|
|
75
84
|
}) => {
|
|
76
85
|
client: Anthropic;
|
|
77
86
|
requestHandlers: {
|
|
87
|
+
'^/v1/models$': {
|
|
88
|
+
get: (_url: string, _options: any) => Promise<Response>;
|
|
89
|
+
};
|
|
78
90
|
'^/v1/chat/completions$': {
|
|
79
91
|
post: (_url: string, options: any) => Promise<Response>;
|
|
80
92
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -30,6 +30,9 @@ declare const openaiClientAdapter: ({ openai, }: {
|
|
|
30
30
|
}) => {
|
|
31
31
|
client: OpenAI;
|
|
32
32
|
requestHandlers: {
|
|
33
|
+
'^/v1/models$': {
|
|
34
|
+
get: (_url: string, _options: any) => Promise<Response>;
|
|
35
|
+
};
|
|
33
36
|
'^/(?:v1|/?openai)/chat/completions$': {
|
|
34
37
|
post: (_url: string, options: any) => Promise<Response>;
|
|
35
38
|
};
|
|
@@ -53,6 +56,9 @@ declare const mistralClientAdapter: ({ mistral, }: {
|
|
|
53
56
|
}) => {
|
|
54
57
|
client: Mistral;
|
|
55
58
|
requestHandlers: {
|
|
59
|
+
'^/v1/models$': {
|
|
60
|
+
get: (_url: string, _options: any) => Promise<Response>;
|
|
61
|
+
};
|
|
56
62
|
'^/v1/chat/completions$': {
|
|
57
63
|
post: (_url: string, options: any) => Promise<Response>;
|
|
58
64
|
};
|
|
@@ -64,6 +70,9 @@ declare const perplexityClientAdapter: ({ perplexity, }: {
|
|
|
64
70
|
}) => {
|
|
65
71
|
client: OpenAI;
|
|
66
72
|
requestHandlers: {
|
|
73
|
+
'^/v1/models$': {
|
|
74
|
+
get: (_url: string, _options: any) => Promise<Response>;
|
|
75
|
+
};
|
|
67
76
|
'^/v1/chat/completions$': {
|
|
68
77
|
post: (_url: string, options: any) => Promise<Response>;
|
|
69
78
|
};
|
|
@@ -75,6 +84,9 @@ declare const anthropicClientAdapter: ({ anthropic, }: {
|
|
|
75
84
|
}) => {
|
|
76
85
|
client: Anthropic;
|
|
77
86
|
requestHandlers: {
|
|
87
|
+
'^/v1/models$': {
|
|
88
|
+
get: (_url: string, _options: any) => Promise<Response>;
|
|
89
|
+
};
|
|
78
90
|
'^/v1/chat/completions$': {
|
|
79
91
|
post: (_url: string, options: any) => Promise<Response>;
|
|
80
92
|
};
|
package/dist/index.js
CHANGED
|
@@ -701,6 +701,70 @@ var groqClientAdapter = function(param) {
|
|
|
701
701
|
}
|
|
702
702
|
};
|
|
703
703
|
};
|
|
704
|
+
// src/adapters/client/openaiClientAdapter/models/get.ts
|
|
705
|
+
var get2 = function(param) {
|
|
706
|
+
var openai = param.openai;
|
|
707
|
+
return /*#__PURE__*/ function() {
|
|
708
|
+
var _ref = _async_to_generator(function(_url, _options) {
|
|
709
|
+
var data, error;
|
|
710
|
+
return _ts_generator(this, function(_state) {
|
|
711
|
+
switch(_state.label){
|
|
712
|
+
case 0:
|
|
713
|
+
_state.trys.push([
|
|
714
|
+
0,
|
|
715
|
+
2,
|
|
716
|
+
,
|
|
717
|
+
3
|
|
718
|
+
]);
|
|
719
|
+
return [
|
|
720
|
+
4,
|
|
721
|
+
openai.models.list()
|
|
722
|
+
];
|
|
723
|
+
case 1:
|
|
724
|
+
data = _state.sent();
|
|
725
|
+
return [
|
|
726
|
+
2,
|
|
727
|
+
new Response(JSON.stringify(data), {
|
|
728
|
+
status: 200,
|
|
729
|
+
headers: {
|
|
730
|
+
"Content-Type": "application/json"
|
|
731
|
+
}
|
|
732
|
+
})
|
|
733
|
+
];
|
|
734
|
+
case 2:
|
|
735
|
+
error = _state.sent();
|
|
736
|
+
return [
|
|
737
|
+
2,
|
|
738
|
+
new Response(JSON.stringify({
|
|
739
|
+
error: error
|
|
740
|
+
}), {
|
|
741
|
+
status: 500,
|
|
742
|
+
headers: {
|
|
743
|
+
"Content-Type": "application/json"
|
|
744
|
+
}
|
|
745
|
+
})
|
|
746
|
+
];
|
|
747
|
+
case 3:
|
|
748
|
+
return [
|
|
749
|
+
2
|
|
750
|
+
];
|
|
751
|
+
}
|
|
752
|
+
});
|
|
753
|
+
});
|
|
754
|
+
return function(_url, _options) {
|
|
755
|
+
return _ref.apply(this, arguments);
|
|
756
|
+
};
|
|
757
|
+
}();
|
|
758
|
+
};
|
|
759
|
+
// src/adapters/client/openaiClientAdapter/models/index.ts
|
|
760
|
+
var models2 = function(param) {
|
|
761
|
+
var openai = param.openai;
|
|
762
|
+
return {
|
|
763
|
+
get: get2({
|
|
764
|
+
openai: openai
|
|
765
|
+
})
|
|
766
|
+
};
|
|
767
|
+
};
|
|
704
768
|
// src/adapters/client/openaiClientAdapter/completions/post.ts
|
|
705
769
|
var post2 = function(param) {
|
|
706
770
|
var openai = param.openai;
|
|
@@ -898,6 +962,9 @@ var openaiClientAdapter = function(param) {
|
|
|
898
962
|
return {
|
|
899
963
|
client: openai,
|
|
900
964
|
requestHandlers: {
|
|
965
|
+
"^/v1/models$": models2({
|
|
966
|
+
openai: openai
|
|
967
|
+
}),
|
|
901
968
|
"^/(?:v1|/?openai)/chat/completions$": completions2({
|
|
902
969
|
openai: openai
|
|
903
970
|
})
|
|
@@ -917,6 +984,70 @@ var azureOpenaiClientAdapter = function(param) {
|
|
|
917
984
|
}
|
|
918
985
|
};
|
|
919
986
|
};
|
|
987
|
+
// src/adapters/client/mistralClientAdapter/models/get.ts
|
|
988
|
+
var get3 = function(param) {
|
|
989
|
+
var mistral = param.mistral;
|
|
990
|
+
return /*#__PURE__*/ function() {
|
|
991
|
+
var _ref = _async_to_generator(function(_url, _options) {
|
|
992
|
+
var data, error;
|
|
993
|
+
return _ts_generator(this, function(_state) {
|
|
994
|
+
switch(_state.label){
|
|
995
|
+
case 0:
|
|
996
|
+
_state.trys.push([
|
|
997
|
+
0,
|
|
998
|
+
2,
|
|
999
|
+
,
|
|
1000
|
+
3
|
|
1001
|
+
]);
|
|
1002
|
+
return [
|
|
1003
|
+
4,
|
|
1004
|
+
mistral.models.list()
|
|
1005
|
+
];
|
|
1006
|
+
case 1:
|
|
1007
|
+
data = _state.sent();
|
|
1008
|
+
return [
|
|
1009
|
+
2,
|
|
1010
|
+
new Response(JSON.stringify(data), {
|
|
1011
|
+
status: 200,
|
|
1012
|
+
headers: {
|
|
1013
|
+
"Content-Type": "application/json"
|
|
1014
|
+
}
|
|
1015
|
+
})
|
|
1016
|
+
];
|
|
1017
|
+
case 2:
|
|
1018
|
+
error = _state.sent();
|
|
1019
|
+
return [
|
|
1020
|
+
2,
|
|
1021
|
+
new Response(JSON.stringify({
|
|
1022
|
+
error: error
|
|
1023
|
+
}), {
|
|
1024
|
+
status: 500,
|
|
1025
|
+
headers: {
|
|
1026
|
+
"Content-Type": "application/json"
|
|
1027
|
+
}
|
|
1028
|
+
})
|
|
1029
|
+
];
|
|
1030
|
+
case 3:
|
|
1031
|
+
return [
|
|
1032
|
+
2
|
|
1033
|
+
];
|
|
1034
|
+
}
|
|
1035
|
+
});
|
|
1036
|
+
});
|
|
1037
|
+
return function(_url, _options) {
|
|
1038
|
+
return _ref.apply(this, arguments);
|
|
1039
|
+
};
|
|
1040
|
+
}();
|
|
1041
|
+
};
|
|
1042
|
+
// src/adapters/client/mistralClientAdapter/models/index.ts
|
|
1043
|
+
var models3 = function(param) {
|
|
1044
|
+
var mistral = param.mistral;
|
|
1045
|
+
return {
|
|
1046
|
+
get: get3({
|
|
1047
|
+
mistral: mistral
|
|
1048
|
+
})
|
|
1049
|
+
};
|
|
1050
|
+
};
|
|
920
1051
|
// src/adapters/client/mistralClientAdapter/completions/serializeChunk.ts
|
|
921
1052
|
var serializeDelta = function(_param) {
|
|
922
1053
|
var toolCalls = _param.delta.toolCalls, rest = _object_without_properties(_param.delta, [
|
|
@@ -1165,12 +1296,76 @@ var mistralClientAdapter = function(param) {
|
|
|
1165
1296
|
return {
|
|
1166
1297
|
client: mistral,
|
|
1167
1298
|
requestHandlers: {
|
|
1299
|
+
"^/v1/models$": models3({
|
|
1300
|
+
mistral: mistral
|
|
1301
|
+
}),
|
|
1168
1302
|
"^/v1/chat/completions$": completions3({
|
|
1169
1303
|
mistral: mistral
|
|
1170
1304
|
})
|
|
1171
1305
|
}
|
|
1172
1306
|
};
|
|
1173
1307
|
};
|
|
1308
|
+
// src/adapters/client/perplexityClientAdapter/models/get.ts
|
|
1309
|
+
var models4 = [
|
|
1310
|
+
"llama-3.1-sonar-small-128k-online",
|
|
1311
|
+
"llama-3.1-sonar-large-128k-online",
|
|
1312
|
+
"llama-3.1-sonar-huge-128k-online"
|
|
1313
|
+
];
|
|
1314
|
+
var get4 = function(param) {
|
|
1315
|
+
var perplexity = param.perplexity;
|
|
1316
|
+
return /*#__PURE__*/ function() {
|
|
1317
|
+
var _ref = _async_to_generator(function(_url, _options) {
|
|
1318
|
+
return _ts_generator(this, function(_state) {
|
|
1319
|
+
try {
|
|
1320
|
+
return [
|
|
1321
|
+
2,
|
|
1322
|
+
new Response(JSON.stringify({
|
|
1323
|
+
type: "list",
|
|
1324
|
+
data: models4.map(function(model) {
|
|
1325
|
+
return {
|
|
1326
|
+
id: model,
|
|
1327
|
+
object: "model"
|
|
1328
|
+
};
|
|
1329
|
+
})
|
|
1330
|
+
}), {
|
|
1331
|
+
status: 200,
|
|
1332
|
+
headers: {
|
|
1333
|
+
"Content-Type": "application/json"
|
|
1334
|
+
}
|
|
1335
|
+
})
|
|
1336
|
+
];
|
|
1337
|
+
} catch (error) {
|
|
1338
|
+
return [
|
|
1339
|
+
2,
|
|
1340
|
+
new Response(JSON.stringify({
|
|
1341
|
+
error: error
|
|
1342
|
+
}), {
|
|
1343
|
+
status: 500,
|
|
1344
|
+
headers: {
|
|
1345
|
+
"Content-Type": "application/json"
|
|
1346
|
+
}
|
|
1347
|
+
})
|
|
1348
|
+
];
|
|
1349
|
+
}
|
|
1350
|
+
return [
|
|
1351
|
+
2
|
|
1352
|
+
];
|
|
1353
|
+
});
|
|
1354
|
+
});
|
|
1355
|
+
return function(_url, _options) {
|
|
1356
|
+
return _ref.apply(this, arguments);
|
|
1357
|
+
};
|
|
1358
|
+
}();
|
|
1359
|
+
};
|
|
1360
|
+
// src/adapters/client/perplexityClientAdapter/models/index.ts
|
|
1361
|
+
var models5 = function(param) {
|
|
1362
|
+
var perplexity = param.perplexity;
|
|
1363
|
+
return {
|
|
1364
|
+
get: get4({
|
|
1365
|
+
perplexity: perplexity
|
|
1366
|
+
})
|
|
1367
|
+
};
|
|
1368
|
+
};
|
|
1174
1369
|
// src/lib/messages/alternatingMessages.ts
|
|
1175
1370
|
var agentSideRoles = [
|
|
1176
1371
|
"assistant",
|
|
@@ -1389,12 +1584,79 @@ var perplexityClientAdapter = function(param) {
|
|
|
1389
1584
|
return {
|
|
1390
1585
|
client: perplexity,
|
|
1391
1586
|
requestHandlers: {
|
|
1587
|
+
"^/v1/models$": models5({
|
|
1588
|
+
perplexity: perplexity
|
|
1589
|
+
}),
|
|
1392
1590
|
"^/v1/chat/completions$": completions4({
|
|
1393
1591
|
perplexity: perplexity
|
|
1394
1592
|
})
|
|
1395
1593
|
}
|
|
1396
1594
|
};
|
|
1397
1595
|
};
|
|
1596
|
+
// src/adapters/client/anthropicClientAdapter/models/get.ts
|
|
1597
|
+
var models6 = [
|
|
1598
|
+
"claude-3-5-sonnet-20241022",
|
|
1599
|
+
"claude-3-5-sonnet-20240620",
|
|
1600
|
+
"claude-3-opus-20240229",
|
|
1601
|
+
"claude-3-sonnet-20240229",
|
|
1602
|
+
"claude-3-5-haiku-20241022",
|
|
1603
|
+
"claude-3-haiku-20240307"
|
|
1604
|
+
];
|
|
1605
|
+
var get5 = function(param) {
|
|
1606
|
+
var anthropic = param.anthropic;
|
|
1607
|
+
return /*#__PURE__*/ function() {
|
|
1608
|
+
var _ref = _async_to_generator(function(_url, _options) {
|
|
1609
|
+
return _ts_generator(this, function(_state) {
|
|
1610
|
+
try {
|
|
1611
|
+
return [
|
|
1612
|
+
2,
|
|
1613
|
+
new Response(JSON.stringify({
|
|
1614
|
+
type: "list",
|
|
1615
|
+
data: models6.map(function(model) {
|
|
1616
|
+
return {
|
|
1617
|
+
id: model,
|
|
1618
|
+
object: "model"
|
|
1619
|
+
};
|
|
1620
|
+
})
|
|
1621
|
+
}), {
|
|
1622
|
+
status: 200,
|
|
1623
|
+
headers: {
|
|
1624
|
+
"Content-Type": "application/json"
|
|
1625
|
+
}
|
|
1626
|
+
})
|
|
1627
|
+
];
|
|
1628
|
+
} catch (error) {
|
|
1629
|
+
return [
|
|
1630
|
+
2,
|
|
1631
|
+
new Response(JSON.stringify({
|
|
1632
|
+
error: error
|
|
1633
|
+
}), {
|
|
1634
|
+
status: 500,
|
|
1635
|
+
headers: {
|
|
1636
|
+
"Content-Type": "application/json"
|
|
1637
|
+
}
|
|
1638
|
+
})
|
|
1639
|
+
];
|
|
1640
|
+
}
|
|
1641
|
+
return [
|
|
1642
|
+
2
|
|
1643
|
+
];
|
|
1644
|
+
});
|
|
1645
|
+
});
|
|
1646
|
+
return function(_url, _options) {
|
|
1647
|
+
return _ref.apply(this, arguments);
|
|
1648
|
+
};
|
|
1649
|
+
}();
|
|
1650
|
+
};
|
|
1651
|
+
// src/adapters/client/anthropicClientAdapter/models/index.ts
|
|
1652
|
+
var models7 = function(param) {
|
|
1653
|
+
var anthropic = param.anthropic;
|
|
1654
|
+
return {
|
|
1655
|
+
get: get5({
|
|
1656
|
+
anthropic: anthropic
|
|
1657
|
+
})
|
|
1658
|
+
};
|
|
1659
|
+
};
|
|
1398
1660
|
// src/adapters/client/anthropicClientAdapter/completions/post.ts
|
|
1399
1661
|
import { uid, fork, omit, isEmpty as isEmpty2 } from "radash";
|
|
1400
1662
|
// src/lib/messages/nonEmptyMessages.ts
|
|
@@ -1769,6 +2031,9 @@ var anthropicClientAdapter = function(param) {
|
|
|
1769
2031
|
return {
|
|
1770
2032
|
client: anthropic,
|
|
1771
2033
|
requestHandlers: {
|
|
2034
|
+
"^/v1/models$": models7({
|
|
2035
|
+
anthropic: anthropic
|
|
2036
|
+
}),
|
|
1772
2037
|
"^/v1/chat/completions$": completions5({
|
|
1773
2038
|
anthropic: anthropic
|
|
1774
2039
|
})
|
|
@@ -2492,7 +2757,7 @@ var post7 = function(param) {
|
|
|
2492
2757
|
};
|
|
2493
2758
|
// src/adapters/storage/prismaStorageAdapter/threads/messages/get.ts
|
|
2494
2759
|
import { assign as assign3, last } from "radash";
|
|
2495
|
-
var
|
|
2760
|
+
var get6 = function(param) {
|
|
2496
2761
|
var prisma = param.prisma;
|
|
2497
2762
|
return /*#__PURE__*/ function() {
|
|
2498
2763
|
var _ref = _async_to_generator(function(urlString) {
|
|
@@ -2561,7 +2826,7 @@ var messages2 = function(param) {
|
|
|
2561
2826
|
post: post7({
|
|
2562
2827
|
prisma: prisma
|
|
2563
2828
|
}),
|
|
2564
|
-
get:
|
|
2829
|
+
get: get6({
|
|
2565
2830
|
prisma: prisma
|
|
2566
2831
|
})
|
|
2567
2832
|
};
|
|
@@ -2606,7 +2871,7 @@ var serializeRun = function(param) {
|
|
|
2606
2871
|
};
|
|
2607
2872
|
};
|
|
2608
2873
|
// src/adapters/storage/prismaStorageAdapter/threads/runs/get.ts
|
|
2609
|
-
var
|
|
2874
|
+
var get7 = function(param) {
|
|
2610
2875
|
var prisma = param.prisma;
|
|
2611
2876
|
return /*#__PURE__*/ function() {
|
|
2612
2877
|
var _ref = _async_to_generator(function(urlString) {
|
|
@@ -3203,7 +3468,7 @@ var post8 = function(param) {
|
|
|
3203
3468
|
var runs = function(param) {
|
|
3204
3469
|
var prisma = param.prisma, runAdapter = param.runAdapter;
|
|
3205
3470
|
return {
|
|
3206
|
-
get:
|
|
3471
|
+
get: get7({
|
|
3207
3472
|
prisma: prisma
|
|
3208
3473
|
}),
|
|
3209
3474
|
post: post8({
|
|
@@ -3213,7 +3478,7 @@ var runs = function(param) {
|
|
|
3213
3478
|
};
|
|
3214
3479
|
};
|
|
3215
3480
|
// src/adapters/storage/prismaStorageAdapter/threads/run/get.ts
|
|
3216
|
-
var
|
|
3481
|
+
var get8 = function(param) {
|
|
3217
3482
|
var prisma = param.prisma;
|
|
3218
3483
|
return /*#__PURE__*/ function() {
|
|
3219
3484
|
var _ref = _async_to_generator(function(urlString) {
|
|
@@ -3258,14 +3523,14 @@ var get4 = function(param) {
|
|
|
3258
3523
|
var run = function(param) {
|
|
3259
3524
|
var prisma = param.prisma, runAdapter = param.runAdapter;
|
|
3260
3525
|
return {
|
|
3261
|
-
get:
|
|
3526
|
+
get: get8({
|
|
3262
3527
|
prisma: prisma
|
|
3263
3528
|
})
|
|
3264
3529
|
};
|
|
3265
3530
|
};
|
|
3266
3531
|
// src/adapters/storage/prismaStorageAdapter/threads/runs/steps/get.ts
|
|
3267
3532
|
import { assign as assign6, last as last3 } from "radash";
|
|
3268
|
-
var
|
|
3533
|
+
var get9 = function(param) {
|
|
3269
3534
|
var prisma = param.prisma;
|
|
3270
3535
|
return /*#__PURE__*/ function() {
|
|
3271
3536
|
var _ref = _async_to_generator(function(urlString) {
|
|
@@ -3333,7 +3598,7 @@ var get5 = function(param) {
|
|
|
3333
3598
|
var steps = function(param) {
|
|
3334
3599
|
var prisma = param.prisma;
|
|
3335
3600
|
return {
|
|
3336
|
-
get:
|
|
3601
|
+
get: get9({
|
|
3337
3602
|
prisma: prisma
|
|
3338
3603
|
})
|
|
3339
3604
|
};
|