@inkeep/agents-cli 0.15.0 → 0.16.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.js +1281 -1119
- package/package.json +8 -7
package/dist/index.js
CHANGED
|
@@ -49,14 +49,14 @@ var init_esm_shims = __esm({
|
|
|
49
49
|
|
|
50
50
|
// ../packages/agents-core/src/api-client/base-client.ts
|
|
51
51
|
async function apiFetch(url, options = {}) {
|
|
52
|
-
const
|
|
52
|
+
const headers2 = {
|
|
53
53
|
"Content-Type": "application/json",
|
|
54
54
|
Accept: "application/json",
|
|
55
55
|
...options.headers || {}
|
|
56
56
|
};
|
|
57
57
|
return fetch(url, {
|
|
58
58
|
...options,
|
|
59
|
-
headers
|
|
59
|
+
headers: headers2
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
62
|
var init_base_client = __esm({
|
|
@@ -66,6 +66,62 @@ var init_base_client = __esm({
|
|
|
66
66
|
}
|
|
67
67
|
});
|
|
68
68
|
|
|
69
|
+
// ../node_modules/.pnpm/nanoid@5.1.6/node_modules/nanoid/index.js
|
|
70
|
+
import { webcrypto as crypto2 } from "crypto";
|
|
71
|
+
function fillPool(bytes) {
|
|
72
|
+
if (!pool || pool.length < bytes) {
|
|
73
|
+
pool = Buffer.allocUnsafe(bytes * POOL_SIZE_MULTIPLIER);
|
|
74
|
+
crypto2.getRandomValues(pool);
|
|
75
|
+
poolOffset = 0;
|
|
76
|
+
} else if (poolOffset + bytes > pool.length) {
|
|
77
|
+
crypto2.getRandomValues(pool);
|
|
78
|
+
poolOffset = 0;
|
|
79
|
+
}
|
|
80
|
+
poolOffset += bytes;
|
|
81
|
+
}
|
|
82
|
+
function random(bytes) {
|
|
83
|
+
fillPool(bytes |= 0);
|
|
84
|
+
return pool.subarray(poolOffset - bytes, poolOffset);
|
|
85
|
+
}
|
|
86
|
+
function customRandom(alphabet, defaultSize, getRandom) {
|
|
87
|
+
let mask = (2 << 31 - Math.clz32(alphabet.length - 1 | 1)) - 1;
|
|
88
|
+
let step = Math.ceil(1.6 * mask * defaultSize / alphabet.length);
|
|
89
|
+
return (size = defaultSize) => {
|
|
90
|
+
if (!size) return "";
|
|
91
|
+
let id = "";
|
|
92
|
+
while (true) {
|
|
93
|
+
let bytes = getRandom(step);
|
|
94
|
+
let i2 = step;
|
|
95
|
+
while (i2--) {
|
|
96
|
+
id += alphabet[bytes[i2] & mask] || "";
|
|
97
|
+
if (id.length >= size) return id;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
function customAlphabet(alphabet, size = 21) {
|
|
103
|
+
return customRandom(alphabet, size, random);
|
|
104
|
+
}
|
|
105
|
+
var POOL_SIZE_MULTIPLIER, pool, poolOffset;
|
|
106
|
+
var init_nanoid = __esm({
|
|
107
|
+
"../node_modules/.pnpm/nanoid@5.1.6/node_modules/nanoid/index.js"() {
|
|
108
|
+
"use strict";
|
|
109
|
+
init_esm_shims();
|
|
110
|
+
POOL_SIZE_MULTIPLIER = 128;
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
// ../packages/agents-core/src/utils/conversations.ts
|
|
115
|
+
var generateId;
|
|
116
|
+
var init_conversations = __esm({
|
|
117
|
+
"../packages/agents-core/src/utils/conversations.ts"() {
|
|
118
|
+
"use strict";
|
|
119
|
+
init_esm_shims();
|
|
120
|
+
init_nanoid();
|
|
121
|
+
generateId = customAlphabet("abcdefghijklmnopqrstuvwxyz0123456789", 21);
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
|
|
69
125
|
// ../packages/agents-core/src/utils/logger.ts
|
|
70
126
|
import pino from "pino";
|
|
71
127
|
import pinoPretty from "pino-pretty";
|
|
@@ -202,22 +258,22 @@ var init_logger = __esm({
|
|
|
202
258
|
*/
|
|
203
259
|
getLogger(name) {
|
|
204
260
|
if (this.loggers.has(name)) {
|
|
205
|
-
const
|
|
206
|
-
if (!
|
|
261
|
+
const logger15 = this.loggers.get(name);
|
|
262
|
+
if (!logger15) {
|
|
207
263
|
throw new Error(`Logger '${name}' not found in cache`);
|
|
208
264
|
}
|
|
209
|
-
return
|
|
265
|
+
return logger15;
|
|
210
266
|
}
|
|
211
|
-
let
|
|
267
|
+
let logger14;
|
|
212
268
|
if (this.config.loggerFactory) {
|
|
213
|
-
|
|
269
|
+
logger14 = this.config.loggerFactory(name);
|
|
214
270
|
} else if (this.config.defaultLogger) {
|
|
215
|
-
|
|
271
|
+
logger14 = this.config.defaultLogger;
|
|
216
272
|
} else {
|
|
217
|
-
|
|
273
|
+
logger14 = new PinoLogger(name, this.config.pinoConfig);
|
|
218
274
|
}
|
|
219
|
-
this.loggers.set(name,
|
|
220
|
-
return
|
|
275
|
+
this.loggers.set(name, logger14);
|
|
276
|
+
return logger14;
|
|
221
277
|
}
|
|
222
278
|
/**
|
|
223
279
|
* Reset factory to default state
|
|
@@ -231,7 +287,19 @@ var init_logger = __esm({
|
|
|
231
287
|
}
|
|
232
288
|
});
|
|
233
289
|
|
|
234
|
-
// ../
|
|
290
|
+
// ../packages/agents-core/src/utils/schema-conversion.ts
|
|
291
|
+
import { z } from "zod";
|
|
292
|
+
var logger;
|
|
293
|
+
var init_schema_conversion = __esm({
|
|
294
|
+
"../packages/agents-core/src/utils/schema-conversion.ts"() {
|
|
295
|
+
"use strict";
|
|
296
|
+
init_esm_shims();
|
|
297
|
+
init_logger();
|
|
298
|
+
logger = getLogger("schema-conversion");
|
|
299
|
+
}
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
// ../node_modules/.pnpm/@asteasolutions+zod-to-openapi@8.1.0_zod@4.1.12/node_modules/@asteasolutions/zod-to-openapi/dist/index.mjs
|
|
235
303
|
function __rest(s2, e2) {
|
|
236
304
|
var t2 = {};
|
|
237
305
|
for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2) && e2.indexOf(p2) < 0)
|
|
@@ -363,7 +431,7 @@ function getOpenApiConfiguration(refOrOpenapi, metadataOrOptions, options) {
|
|
|
363
431
|
}
|
|
364
432
|
var ZodTypeKeys, $ZodRegistry, zodToOpenAPIRegistry, Metadata;
|
|
365
433
|
var init_dist = __esm({
|
|
366
|
-
"../node_modules/.pnpm/@asteasolutions+zod-to-openapi@8.1.0_zod@4.1.
|
|
434
|
+
"../node_modules/.pnpm/@asteasolutions+zod-to-openapi@8.1.0_zod@4.1.12/node_modules/@asteasolutions/zod-to-openapi/dist/index.mjs"() {
|
|
367
435
|
"use strict";
|
|
368
436
|
init_esm_shims();
|
|
369
437
|
ZodTypeKeys = {
|
|
@@ -556,10 +624,10 @@ var init_dist = __esm({
|
|
|
556
624
|
}
|
|
557
625
|
});
|
|
558
626
|
|
|
559
|
-
// ../node_modules/.pnpm/hono@4.9.
|
|
627
|
+
// ../node_modules/.pnpm/hono@4.9.10/node_modules/hono/dist/utils/url.js
|
|
560
628
|
var tryDecode, _decodeURI, _getQueryParam, getQueryParam, getQueryParams, decodeURIComponent_;
|
|
561
629
|
var init_url = __esm({
|
|
562
|
-
"../node_modules/.pnpm/hono@4.9.
|
|
630
|
+
"../node_modules/.pnpm/hono@4.9.10/node_modules/hono/dist/utils/url.js"() {
|
|
563
631
|
"use strict";
|
|
564
632
|
init_esm_shims();
|
|
565
633
|
tryDecode = (str, decoder) => {
|
|
@@ -656,52 +724,52 @@ var init_url = __esm({
|
|
|
656
724
|
}
|
|
657
725
|
});
|
|
658
726
|
|
|
659
|
-
// ../node_modules/.pnpm/hono@4.9.
|
|
727
|
+
// ../node_modules/.pnpm/hono@4.9.10/node_modules/hono/dist/utils/cookie.js
|
|
660
728
|
var init_cookie = __esm({
|
|
661
|
-
"../node_modules/.pnpm/hono@4.9.
|
|
729
|
+
"../node_modules/.pnpm/hono@4.9.10/node_modules/hono/dist/utils/cookie.js"() {
|
|
662
730
|
"use strict";
|
|
663
731
|
init_esm_shims();
|
|
664
732
|
init_url();
|
|
665
733
|
}
|
|
666
734
|
});
|
|
667
735
|
|
|
668
|
-
// ../node_modules/.pnpm/hono@4.9.
|
|
736
|
+
// ../node_modules/.pnpm/hono@4.9.10/node_modules/hono/dist/helper/cookie/index.js
|
|
669
737
|
var init_cookie2 = __esm({
|
|
670
|
-
"../node_modules/.pnpm/hono@4.9.
|
|
738
|
+
"../node_modules/.pnpm/hono@4.9.10/node_modules/hono/dist/helper/cookie/index.js"() {
|
|
671
739
|
"use strict";
|
|
672
740
|
init_esm_shims();
|
|
673
741
|
init_cookie();
|
|
674
742
|
}
|
|
675
743
|
});
|
|
676
744
|
|
|
677
|
-
// ../node_modules/.pnpm/hono@4.9.
|
|
745
|
+
// ../node_modules/.pnpm/hono@4.9.10/node_modules/hono/dist/http-exception.js
|
|
678
746
|
var init_http_exception = __esm({
|
|
679
|
-
"../node_modules/.pnpm/hono@4.9.
|
|
747
|
+
"../node_modules/.pnpm/hono@4.9.10/node_modules/hono/dist/http-exception.js"() {
|
|
680
748
|
"use strict";
|
|
681
749
|
init_esm_shims();
|
|
682
750
|
}
|
|
683
751
|
});
|
|
684
752
|
|
|
685
|
-
// ../node_modules/.pnpm/hono@4.9.
|
|
753
|
+
// ../node_modules/.pnpm/hono@4.9.10/node_modules/hono/dist/utils/crypto.js
|
|
686
754
|
var init_crypto = __esm({
|
|
687
|
-
"../node_modules/.pnpm/hono@4.9.
|
|
755
|
+
"../node_modules/.pnpm/hono@4.9.10/node_modules/hono/dist/utils/crypto.js"() {
|
|
688
756
|
"use strict";
|
|
689
757
|
init_esm_shims();
|
|
690
758
|
}
|
|
691
759
|
});
|
|
692
760
|
|
|
693
|
-
// ../node_modules/.pnpm/hono@4.9.
|
|
761
|
+
// ../node_modules/.pnpm/hono@4.9.10/node_modules/hono/dist/utils/buffer.js
|
|
694
762
|
var init_buffer = __esm({
|
|
695
|
-
"../node_modules/.pnpm/hono@4.9.
|
|
763
|
+
"../node_modules/.pnpm/hono@4.9.10/node_modules/hono/dist/utils/buffer.js"() {
|
|
696
764
|
"use strict";
|
|
697
765
|
init_esm_shims();
|
|
698
766
|
init_crypto();
|
|
699
767
|
}
|
|
700
768
|
});
|
|
701
769
|
|
|
702
|
-
// ../node_modules/.pnpm/hono@4.9.
|
|
770
|
+
// ../node_modules/.pnpm/hono@4.9.10/node_modules/hono/dist/validator/validator.js
|
|
703
771
|
var init_validator = __esm({
|
|
704
|
-
"../node_modules/.pnpm/hono@4.9.
|
|
772
|
+
"../node_modules/.pnpm/hono@4.9.10/node_modules/hono/dist/validator/validator.js"() {
|
|
705
773
|
"use strict";
|
|
706
774
|
init_esm_shims();
|
|
707
775
|
init_cookie2();
|
|
@@ -710,43 +778,43 @@ var init_validator = __esm({
|
|
|
710
778
|
}
|
|
711
779
|
});
|
|
712
780
|
|
|
713
|
-
// ../node_modules/.pnpm/hono@4.9.
|
|
781
|
+
// ../node_modules/.pnpm/hono@4.9.10/node_modules/hono/dist/validator/index.js
|
|
714
782
|
var init_validator2 = __esm({
|
|
715
|
-
"../node_modules/.pnpm/hono@4.9.
|
|
783
|
+
"../node_modules/.pnpm/hono@4.9.10/node_modules/hono/dist/validator/index.js"() {
|
|
716
784
|
"use strict";
|
|
717
785
|
init_esm_shims();
|
|
718
786
|
init_validator();
|
|
719
787
|
}
|
|
720
788
|
});
|
|
721
789
|
|
|
722
|
-
// ../node_modules/.pnpm/@hono+zod-validator@0.7.3_hono@4.9.
|
|
790
|
+
// ../node_modules/.pnpm/@hono+zod-validator@0.7.3_hono@4.9.10_zod@4.1.12/node_modules/@hono/zod-validator/dist/index.js
|
|
723
791
|
var init_dist2 = __esm({
|
|
724
|
-
"../node_modules/.pnpm/@hono+zod-validator@0.7.3_hono@4.9.
|
|
792
|
+
"../node_modules/.pnpm/@hono+zod-validator@0.7.3_hono@4.9.10_zod@4.1.12/node_modules/@hono/zod-validator/dist/index.js"() {
|
|
725
793
|
"use strict";
|
|
726
794
|
init_esm_shims();
|
|
727
795
|
init_validator2();
|
|
728
796
|
}
|
|
729
797
|
});
|
|
730
798
|
|
|
731
|
-
// ../node_modules/.pnpm/hono@4.9.
|
|
799
|
+
// ../node_modules/.pnpm/hono@4.9.10/node_modules/hono/dist/compose.js
|
|
732
800
|
var init_compose = __esm({
|
|
733
|
-
"../node_modules/.pnpm/hono@4.9.
|
|
801
|
+
"../node_modules/.pnpm/hono@4.9.10/node_modules/hono/dist/compose.js"() {
|
|
734
802
|
"use strict";
|
|
735
803
|
init_esm_shims();
|
|
736
804
|
}
|
|
737
805
|
});
|
|
738
806
|
|
|
739
|
-
// ../node_modules/.pnpm/hono@4.9.
|
|
807
|
+
// ../node_modules/.pnpm/hono@4.9.10/node_modules/hono/dist/request/constants.js
|
|
740
808
|
var GET_MATCH_RESULT;
|
|
741
809
|
var init_constants = __esm({
|
|
742
|
-
"../node_modules/.pnpm/hono@4.9.
|
|
810
|
+
"../node_modules/.pnpm/hono@4.9.10/node_modules/hono/dist/request/constants.js"() {
|
|
743
811
|
"use strict";
|
|
744
812
|
init_esm_shims();
|
|
745
813
|
GET_MATCH_RESULT = Symbol();
|
|
746
814
|
}
|
|
747
815
|
});
|
|
748
816
|
|
|
749
|
-
// ../node_modules/.pnpm/hono@4.9.
|
|
817
|
+
// ../node_modules/.pnpm/hono@4.9.10/node_modules/hono/dist/utils/body.js
|
|
750
818
|
async function parseFormData(request, options) {
|
|
751
819
|
const formData = await request.formData();
|
|
752
820
|
if (formData) {
|
|
@@ -777,14 +845,14 @@ function convertFormDataToBodyData(formData, options) {
|
|
|
777
845
|
}
|
|
778
846
|
var parseBody, handleParsingAllValues, handleParsingNestedValues;
|
|
779
847
|
var init_body = __esm({
|
|
780
|
-
"../node_modules/.pnpm/hono@4.9.
|
|
848
|
+
"../node_modules/.pnpm/hono@4.9.10/node_modules/hono/dist/utils/body.js"() {
|
|
781
849
|
"use strict";
|
|
782
850
|
init_esm_shims();
|
|
783
851
|
init_request();
|
|
784
852
|
parseBody = async (request, options = /* @__PURE__ */ Object.create(null)) => {
|
|
785
853
|
const { all = false, dot = false } = options;
|
|
786
|
-
const
|
|
787
|
-
const contentType =
|
|
854
|
+
const headers2 = request instanceof HonoRequest ? request.raw.headers : request.headers;
|
|
855
|
+
const contentType = headers2.get("Content-Type");
|
|
788
856
|
if (contentType?.startsWith("multipart/form-data") || contentType?.startsWith("application/x-www-form-urlencoded")) {
|
|
789
857
|
return parseFormData(request, { all, dot });
|
|
790
858
|
}
|
|
@@ -823,10 +891,10 @@ var init_body = __esm({
|
|
|
823
891
|
}
|
|
824
892
|
});
|
|
825
893
|
|
|
826
|
-
// ../node_modules/.pnpm/hono@4.9.
|
|
894
|
+
// ../node_modules/.pnpm/hono@4.9.10/node_modules/hono/dist/request.js
|
|
827
895
|
var tryDecodeURIComponent, HonoRequest;
|
|
828
896
|
var init_request = __esm({
|
|
829
|
-
"../node_modules/.pnpm/hono@4.9.
|
|
897
|
+
"../node_modules/.pnpm/hono@4.9.10/node_modules/hono/dist/request.js"() {
|
|
830
898
|
"use strict";
|
|
831
899
|
init_esm_shims();
|
|
832
900
|
init_constants();
|
|
@@ -944,17 +1012,17 @@ var init_request = __esm({
|
|
|
944
1012
|
}
|
|
945
1013
|
});
|
|
946
1014
|
|
|
947
|
-
// ../node_modules/.pnpm/hono@4.9.
|
|
1015
|
+
// ../node_modules/.pnpm/hono@4.9.10/node_modules/hono/dist/utils/html.js
|
|
948
1016
|
var init_html = __esm({
|
|
949
|
-
"../node_modules/.pnpm/hono@4.9.
|
|
1017
|
+
"../node_modules/.pnpm/hono@4.9.10/node_modules/hono/dist/utils/html.js"() {
|
|
950
1018
|
"use strict";
|
|
951
1019
|
init_esm_shims();
|
|
952
1020
|
}
|
|
953
1021
|
});
|
|
954
1022
|
|
|
955
|
-
// ../node_modules/.pnpm/hono@4.9.
|
|
1023
|
+
// ../node_modules/.pnpm/hono@4.9.10/node_modules/hono/dist/context.js
|
|
956
1024
|
var init_context = __esm({
|
|
957
|
-
"../node_modules/.pnpm/hono@4.9.
|
|
1025
|
+
"../node_modules/.pnpm/hono@4.9.10/node_modules/hono/dist/context.js"() {
|
|
958
1026
|
"use strict";
|
|
959
1027
|
init_esm_shims();
|
|
960
1028
|
init_request();
|
|
@@ -962,25 +1030,25 @@ var init_context = __esm({
|
|
|
962
1030
|
}
|
|
963
1031
|
});
|
|
964
1032
|
|
|
965
|
-
// ../node_modules/.pnpm/hono@4.9.
|
|
1033
|
+
// ../node_modules/.pnpm/hono@4.9.10/node_modules/hono/dist/router.js
|
|
966
1034
|
var init_router = __esm({
|
|
967
|
-
"../node_modules/.pnpm/hono@4.9.
|
|
1035
|
+
"../node_modules/.pnpm/hono@4.9.10/node_modules/hono/dist/router.js"() {
|
|
968
1036
|
"use strict";
|
|
969
1037
|
init_esm_shims();
|
|
970
1038
|
}
|
|
971
1039
|
});
|
|
972
1040
|
|
|
973
|
-
// ../node_modules/.pnpm/hono@4.9.
|
|
1041
|
+
// ../node_modules/.pnpm/hono@4.9.10/node_modules/hono/dist/utils/constants.js
|
|
974
1042
|
var init_constants2 = __esm({
|
|
975
|
-
"../node_modules/.pnpm/hono@4.9.
|
|
1043
|
+
"../node_modules/.pnpm/hono@4.9.10/node_modules/hono/dist/utils/constants.js"() {
|
|
976
1044
|
"use strict";
|
|
977
1045
|
init_esm_shims();
|
|
978
1046
|
}
|
|
979
1047
|
});
|
|
980
1048
|
|
|
981
|
-
// ../node_modules/.pnpm/hono@4.9.
|
|
1049
|
+
// ../node_modules/.pnpm/hono@4.9.10/node_modules/hono/dist/hono-base.js
|
|
982
1050
|
var init_hono_base = __esm({
|
|
983
|
-
"../node_modules/.pnpm/hono@4.9.
|
|
1051
|
+
"../node_modules/.pnpm/hono@4.9.10/node_modules/hono/dist/hono-base.js"() {
|
|
984
1052
|
"use strict";
|
|
985
1053
|
init_esm_shims();
|
|
986
1054
|
init_compose();
|
|
@@ -991,10 +1059,10 @@ var init_hono_base = __esm({
|
|
|
991
1059
|
}
|
|
992
1060
|
});
|
|
993
1061
|
|
|
994
|
-
// ../node_modules/.pnpm/hono@4.9.
|
|
1062
|
+
// ../node_modules/.pnpm/hono@4.9.10/node_modules/hono/dist/router/reg-exp-router/node.js
|
|
995
1063
|
var PATH_ERROR, regExpMetaChars;
|
|
996
1064
|
var init_node = __esm({
|
|
997
|
-
"../node_modules/.pnpm/hono@4.9.
|
|
1065
|
+
"../node_modules/.pnpm/hono@4.9.10/node_modules/hono/dist/router/reg-exp-router/node.js"() {
|
|
998
1066
|
"use strict";
|
|
999
1067
|
init_esm_shims();
|
|
1000
1068
|
PATH_ERROR = Symbol();
|
|
@@ -1002,18 +1070,18 @@ var init_node = __esm({
|
|
|
1002
1070
|
}
|
|
1003
1071
|
});
|
|
1004
1072
|
|
|
1005
|
-
// ../node_modules/.pnpm/hono@4.9.
|
|
1073
|
+
// ../node_modules/.pnpm/hono@4.9.10/node_modules/hono/dist/router/reg-exp-router/trie.js
|
|
1006
1074
|
var init_trie = __esm({
|
|
1007
|
-
"../node_modules/.pnpm/hono@4.9.
|
|
1075
|
+
"../node_modules/.pnpm/hono@4.9.10/node_modules/hono/dist/router/reg-exp-router/trie.js"() {
|
|
1008
1076
|
"use strict";
|
|
1009
1077
|
init_esm_shims();
|
|
1010
1078
|
init_node();
|
|
1011
1079
|
}
|
|
1012
1080
|
});
|
|
1013
1081
|
|
|
1014
|
-
// ../node_modules/.pnpm/hono@4.9.
|
|
1082
|
+
// ../node_modules/.pnpm/hono@4.9.10/node_modules/hono/dist/router/reg-exp-router/router.js
|
|
1015
1083
|
var init_router2 = __esm({
|
|
1016
|
-
"../node_modules/.pnpm/hono@4.9.
|
|
1084
|
+
"../node_modules/.pnpm/hono@4.9.10/node_modules/hono/dist/router/reg-exp-router/router.js"() {
|
|
1017
1085
|
"use strict";
|
|
1018
1086
|
init_esm_shims();
|
|
1019
1087
|
init_router();
|
|
@@ -1023,36 +1091,36 @@ var init_router2 = __esm({
|
|
|
1023
1091
|
}
|
|
1024
1092
|
});
|
|
1025
1093
|
|
|
1026
|
-
// ../node_modules/.pnpm/hono@4.9.
|
|
1094
|
+
// ../node_modules/.pnpm/hono@4.9.10/node_modules/hono/dist/router/reg-exp-router/index.js
|
|
1027
1095
|
var init_reg_exp_router = __esm({
|
|
1028
|
-
"../node_modules/.pnpm/hono@4.9.
|
|
1096
|
+
"../node_modules/.pnpm/hono@4.9.10/node_modules/hono/dist/router/reg-exp-router/index.js"() {
|
|
1029
1097
|
"use strict";
|
|
1030
1098
|
init_esm_shims();
|
|
1031
1099
|
init_router2();
|
|
1032
1100
|
}
|
|
1033
1101
|
});
|
|
1034
1102
|
|
|
1035
|
-
// ../node_modules/.pnpm/hono@4.9.
|
|
1103
|
+
// ../node_modules/.pnpm/hono@4.9.10/node_modules/hono/dist/router/smart-router/router.js
|
|
1036
1104
|
var init_router3 = __esm({
|
|
1037
|
-
"../node_modules/.pnpm/hono@4.9.
|
|
1105
|
+
"../node_modules/.pnpm/hono@4.9.10/node_modules/hono/dist/router/smart-router/router.js"() {
|
|
1038
1106
|
"use strict";
|
|
1039
1107
|
init_esm_shims();
|
|
1040
1108
|
init_router();
|
|
1041
1109
|
}
|
|
1042
1110
|
});
|
|
1043
1111
|
|
|
1044
|
-
// ../node_modules/.pnpm/hono@4.9.
|
|
1112
|
+
// ../node_modules/.pnpm/hono@4.9.10/node_modules/hono/dist/router/smart-router/index.js
|
|
1045
1113
|
var init_smart_router = __esm({
|
|
1046
|
-
"../node_modules/.pnpm/hono@4.9.
|
|
1114
|
+
"../node_modules/.pnpm/hono@4.9.10/node_modules/hono/dist/router/smart-router/index.js"() {
|
|
1047
1115
|
"use strict";
|
|
1048
1116
|
init_esm_shims();
|
|
1049
1117
|
init_router3();
|
|
1050
1118
|
}
|
|
1051
1119
|
});
|
|
1052
1120
|
|
|
1053
|
-
// ../node_modules/.pnpm/hono@4.9.
|
|
1121
|
+
// ../node_modules/.pnpm/hono@4.9.10/node_modules/hono/dist/router/trie-router/node.js
|
|
1054
1122
|
var init_node2 = __esm({
|
|
1055
|
-
"../node_modules/.pnpm/hono@4.9.
|
|
1123
|
+
"../node_modules/.pnpm/hono@4.9.10/node_modules/hono/dist/router/trie-router/node.js"() {
|
|
1056
1124
|
"use strict";
|
|
1057
1125
|
init_esm_shims();
|
|
1058
1126
|
init_router();
|
|
@@ -1060,9 +1128,9 @@ var init_node2 = __esm({
|
|
|
1060
1128
|
}
|
|
1061
1129
|
});
|
|
1062
1130
|
|
|
1063
|
-
// ../node_modules/.pnpm/hono@4.9.
|
|
1131
|
+
// ../node_modules/.pnpm/hono@4.9.10/node_modules/hono/dist/router/trie-router/router.js
|
|
1064
1132
|
var init_router4 = __esm({
|
|
1065
|
-
"../node_modules/.pnpm/hono@4.9.
|
|
1133
|
+
"../node_modules/.pnpm/hono@4.9.10/node_modules/hono/dist/router/trie-router/router.js"() {
|
|
1066
1134
|
"use strict";
|
|
1067
1135
|
init_esm_shims();
|
|
1068
1136
|
init_url();
|
|
@@ -1070,18 +1138,18 @@ var init_router4 = __esm({
|
|
|
1070
1138
|
}
|
|
1071
1139
|
});
|
|
1072
1140
|
|
|
1073
|
-
// ../node_modules/.pnpm/hono@4.9.
|
|
1141
|
+
// ../node_modules/.pnpm/hono@4.9.10/node_modules/hono/dist/router/trie-router/index.js
|
|
1074
1142
|
var init_trie_router = __esm({
|
|
1075
|
-
"../node_modules/.pnpm/hono@4.9.
|
|
1143
|
+
"../node_modules/.pnpm/hono@4.9.10/node_modules/hono/dist/router/trie-router/index.js"() {
|
|
1076
1144
|
"use strict";
|
|
1077
1145
|
init_esm_shims();
|
|
1078
1146
|
init_router4();
|
|
1079
1147
|
}
|
|
1080
1148
|
});
|
|
1081
1149
|
|
|
1082
|
-
// ../node_modules/.pnpm/hono@4.9.
|
|
1150
|
+
// ../node_modules/.pnpm/hono@4.9.10/node_modules/hono/dist/hono.js
|
|
1083
1151
|
var init_hono = __esm({
|
|
1084
|
-
"../node_modules/.pnpm/hono@4.9.
|
|
1152
|
+
"../node_modules/.pnpm/hono@4.9.10/node_modules/hono/dist/hono.js"() {
|
|
1085
1153
|
"use strict";
|
|
1086
1154
|
init_esm_shims();
|
|
1087
1155
|
init_hono_base();
|
|
@@ -1091,31 +1159,31 @@ var init_hono = __esm({
|
|
|
1091
1159
|
}
|
|
1092
1160
|
});
|
|
1093
1161
|
|
|
1094
|
-
// ../node_modules/.pnpm/hono@4.9.
|
|
1162
|
+
// ../node_modules/.pnpm/hono@4.9.10/node_modules/hono/dist/index.js
|
|
1095
1163
|
var init_dist3 = __esm({
|
|
1096
|
-
"../node_modules/.pnpm/hono@4.9.
|
|
1164
|
+
"../node_modules/.pnpm/hono@4.9.10/node_modules/hono/dist/index.js"() {
|
|
1097
1165
|
"use strict";
|
|
1098
1166
|
init_esm_shims();
|
|
1099
1167
|
init_hono();
|
|
1100
1168
|
}
|
|
1101
1169
|
});
|
|
1102
1170
|
|
|
1103
|
-
// ../node_modules/.pnpm/@hono+zod-openapi@1.1.3_hono@4.9.
|
|
1104
|
-
import { z } from "zod";
|
|
1171
|
+
// ../node_modules/.pnpm/@hono+zod-openapi@1.1.3_hono@4.9.10_zod@4.1.12/node_modules/@hono/zod-openapi/dist/index.js
|
|
1172
|
+
import { z as z2 } from "zod";
|
|
1105
1173
|
var init_dist4 = __esm({
|
|
1106
|
-
"../node_modules/.pnpm/@hono+zod-openapi@1.1.3_hono@4.9.
|
|
1174
|
+
"../node_modules/.pnpm/@hono+zod-openapi@1.1.3_hono@4.9.10_zod@4.1.12/node_modules/@hono/zod-openapi/dist/index.js"() {
|
|
1107
1175
|
"use strict";
|
|
1108
1176
|
init_esm_shims();
|
|
1109
1177
|
init_dist();
|
|
1110
1178
|
init_dist2();
|
|
1111
1179
|
init_dist3();
|
|
1112
1180
|
init_url();
|
|
1113
|
-
extendZodWithOpenApi(
|
|
1181
|
+
extendZodWithOpenApi(z2);
|
|
1114
1182
|
}
|
|
1115
1183
|
});
|
|
1116
1184
|
|
|
1117
|
-
// ../node_modules/.pnpm/drizzle-zod@0.8.3_drizzle-orm@0.44.
|
|
1118
|
-
import { z as
|
|
1185
|
+
// ../node_modules/.pnpm/drizzle-zod@0.8.3_drizzle-orm@0.44.6_@libsql+client@0.15.15_@opentelemetry+api@1.9.0_@types+pg@8.15.5__zod@4.1.12/node_modules/drizzle-zod/index.mjs
|
|
1186
|
+
import { z as z3 } from "zod/v4";
|
|
1119
1187
|
import { isTable, getTableColumns, getViewSelectedFields, is, Column, SQL, isView } from "drizzle-orm";
|
|
1120
1188
|
function isColumnType(column, columnTypes) {
|
|
1121
1189
|
return columnTypes.includes(column.columnType);
|
|
@@ -1124,7 +1192,7 @@ function isWithEnum(column) {
|
|
|
1124
1192
|
return "enumValues" in column && Array.isArray(column.enumValues) && column.enumValues.length > 0;
|
|
1125
1193
|
}
|
|
1126
1194
|
function columnToSchema(column, factory) {
|
|
1127
|
-
const z$1 = factory?.zodInstance ??
|
|
1195
|
+
const z$1 = factory?.zodInstance ?? z3;
|
|
1128
1196
|
const coerce = factory?.coerce ?? {};
|
|
1129
1197
|
let schema;
|
|
1130
1198
|
if (isWithEnum(column)) {
|
|
@@ -1174,7 +1242,7 @@ function columnToSchema(column, factory) {
|
|
|
1174
1242
|
}
|
|
1175
1243
|
return schema;
|
|
1176
1244
|
}
|
|
1177
|
-
function numberColumnToSchema(column,
|
|
1245
|
+
function numberColumnToSchema(column, z12, coerce) {
|
|
1178
1246
|
let unsigned = column.getSQLType().includes("unsigned");
|
|
1179
1247
|
let min;
|
|
1180
1248
|
let max;
|
|
@@ -1242,20 +1310,20 @@ function numberColumnToSchema(column, z11, coerce) {
|
|
|
1242
1310
|
min = Number.MIN_SAFE_INTEGER;
|
|
1243
1311
|
max = Number.MAX_SAFE_INTEGER;
|
|
1244
1312
|
}
|
|
1245
|
-
let schema = coerce === true || coerce?.number ? integer2 ?
|
|
1313
|
+
let schema = coerce === true || coerce?.number ? integer2 ? z12.coerce.number() : z12.coerce.number().int() : integer2 ? z12.int() : z12.number();
|
|
1246
1314
|
schema = schema.gte(min).lte(max);
|
|
1247
1315
|
return schema;
|
|
1248
1316
|
}
|
|
1249
|
-
function bigintColumnToSchema(column,
|
|
1317
|
+
function bigintColumnToSchema(column, z12, coerce) {
|
|
1250
1318
|
const unsigned = column.getSQLType().includes("unsigned");
|
|
1251
1319
|
const min = unsigned ? 0n : CONSTANTS.INT64_MIN;
|
|
1252
1320
|
const max = unsigned ? CONSTANTS.INT64_UNSIGNED_MAX : CONSTANTS.INT64_MAX;
|
|
1253
|
-
const schema = coerce === true || coerce?.bigint ?
|
|
1321
|
+
const schema = coerce === true || coerce?.bigint ? z12.coerce.bigint() : z12.bigint();
|
|
1254
1322
|
return schema.gte(min).lte(max);
|
|
1255
1323
|
}
|
|
1256
|
-
function stringColumnToSchema(column,
|
|
1324
|
+
function stringColumnToSchema(column, z12, coerce) {
|
|
1257
1325
|
if (isColumnType(column, ["PgUUID"])) {
|
|
1258
|
-
return
|
|
1326
|
+
return z12.uuid();
|
|
1259
1327
|
}
|
|
1260
1328
|
let max;
|
|
1261
1329
|
let regex;
|
|
@@ -1287,7 +1355,7 @@ function stringColumnToSchema(column, z11, coerce) {
|
|
|
1287
1355
|
regex = /^[01]+$/;
|
|
1288
1356
|
max = column.dimensions;
|
|
1289
1357
|
}
|
|
1290
|
-
let schema = coerce === true || coerce?.string ?
|
|
1358
|
+
let schema = coerce === true || coerce?.string ? z12.coerce.string() : z12.string();
|
|
1291
1359
|
schema = regex ? schema.regex(regex) : schema;
|
|
1292
1360
|
return max && fixed ? schema.length(max) : max ? schema.max(max) : schema;
|
|
1293
1361
|
}
|
|
@@ -1308,7 +1376,7 @@ function handleColumns(columns, refinements, conditions, factory) {
|
|
|
1308
1376
|
continue;
|
|
1309
1377
|
}
|
|
1310
1378
|
const column = is(selected, Column) ? selected : void 0;
|
|
1311
|
-
const schema = column ? columnToSchema(column, factory) :
|
|
1379
|
+
const schema = column ? columnToSchema(column, factory) : z3.any();
|
|
1312
1380
|
const refined = typeof refinement === "function" ? refinement(schema) : schema;
|
|
1313
1381
|
if (conditions.never(column)) {
|
|
1314
1382
|
continue;
|
|
@@ -1324,15 +1392,15 @@ function handleColumns(columns, refinements, conditions, factory) {
|
|
|
1324
1392
|
}
|
|
1325
1393
|
}
|
|
1326
1394
|
}
|
|
1327
|
-
return
|
|
1395
|
+
return z3.object(columnSchemas);
|
|
1328
1396
|
}
|
|
1329
1397
|
function handleEnum(enum_, factory) {
|
|
1330
|
-
const zod = factory?.zodInstance ??
|
|
1398
|
+
const zod = factory?.zodInstance ?? z3;
|
|
1331
1399
|
return zod.enum(enum_.enumValues);
|
|
1332
1400
|
}
|
|
1333
1401
|
var CONSTANTS, isPgEnum, literalSchema, jsonSchema, bufferSchema, selectConditions, insertConditions, createSelectSchema, createInsertSchema;
|
|
1334
1402
|
var init_drizzle_zod = __esm({
|
|
1335
|
-
"../node_modules/.pnpm/drizzle-zod@0.8.3_drizzle-orm@0.44.
|
|
1403
|
+
"../node_modules/.pnpm/drizzle-zod@0.8.3_drizzle-orm@0.44.6_@libsql+client@0.15.15_@opentelemetry+api@1.9.0_@types+pg@8.15.5__zod@4.1.12/node_modules/drizzle-zod/index.mjs"() {
|
|
1336
1404
|
"use strict";
|
|
1337
1405
|
init_esm_shims();
|
|
1338
1406
|
CONSTANTS = {
|
|
@@ -1356,13 +1424,13 @@ var init_drizzle_zod = __esm({
|
|
|
1356
1424
|
INT64_UNSIGNED_MAX: 18446744073709551615n
|
|
1357
1425
|
};
|
|
1358
1426
|
isPgEnum = isWithEnum;
|
|
1359
|
-
literalSchema =
|
|
1360
|
-
jsonSchema =
|
|
1427
|
+
literalSchema = z3.union([z3.string(), z3.number(), z3.boolean(), z3.null()]);
|
|
1428
|
+
jsonSchema = z3.union([
|
|
1361
1429
|
literalSchema,
|
|
1362
|
-
|
|
1363
|
-
|
|
1430
|
+
z3.record(z3.string(), z3.any()),
|
|
1431
|
+
z3.array(z3.any())
|
|
1364
1432
|
]);
|
|
1365
|
-
bufferSchema =
|
|
1433
|
+
bufferSchema = z3.custom((v2) => v2 instanceof Buffer);
|
|
1366
1434
|
selectConditions = {
|
|
1367
1435
|
never: () => false,
|
|
1368
1436
|
optional: () => false,
|
|
@@ -1399,7 +1467,7 @@ import {
|
|
|
1399
1467
|
text,
|
|
1400
1468
|
unique
|
|
1401
1469
|
} from "drizzle-orm/sqlite-core";
|
|
1402
|
-
var tenantScoped, projectScoped, graphScoped, agentScoped, uiProperties, timestamps, projects, agentGraph, contextConfigs, contextCache, agents, agentRelations, externalAgents, tasks, taskRelations, dataComponents, agentDataComponents, artifactComponents, agentArtifactComponents, tools, agentToolRelations, conversations, messages, ledgerArtifacts, apiKeys, credentialReferences, tasksRelations, projectsRelations, taskRelationsRelations, contextConfigsRelations, contextCacheRelations, agentsRelations, agentGraphRelations, externalAgentsRelations, apiKeysRelations, agentToolRelationsRelations, credentialReferencesRelations, toolsRelations, conversationsRelations, messagesRelations, artifactComponentsRelations, agentArtifactComponentsRelations, dataComponentsRelations, agentDataComponentsRelations, ledgerArtifactsRelations, agentRelationsRelations;
|
|
1470
|
+
var tenantScoped, projectScoped, graphScoped, agentScoped, uiProperties, timestamps, projects, agentGraph, contextConfigs, contextCache, agents, agentRelations, externalAgents, tasks, taskRelations, dataComponents, agentDataComponents, artifactComponents, agentArtifactComponents, tools, functions, agentToolRelations, conversations, messages, ledgerArtifacts, apiKeys, credentialReferences, tasksRelations, projectsRelations, taskRelationsRelations, contextConfigsRelations, contextCacheRelations, agentsRelations, agentGraphRelations, externalAgentsRelations, apiKeysRelations, agentToolRelationsRelations, credentialReferencesRelations, toolsRelations, conversationsRelations, messagesRelations, artifactComponentsRelations, agentArtifactComponentsRelations, dataComponentsRelations, agentDataComponentsRelations, ledgerArtifactsRelations, functionsRelations, agentRelationsRelations;
|
|
1403
1471
|
var init_schema = __esm({
|
|
1404
1472
|
"../packages/agents-core/src/db/schema.ts"() {
|
|
1405
1473
|
"use strict";
|
|
@@ -1437,6 +1505,8 @@ var init_schema = __esm({
|
|
|
1437
1505
|
models: text("models", { mode: "json" }).$type(),
|
|
1438
1506
|
// Project-level stopWhen configuration that can be inherited by graphs and agents
|
|
1439
1507
|
stopWhen: text("stop_when", { mode: "json" }).$type(),
|
|
1508
|
+
// Project-level sandbox configuration for function execution
|
|
1509
|
+
sandboxConfig: text("sandbox_config", { mode: "json" }).$type(),
|
|
1440
1510
|
...timestamps
|
|
1441
1511
|
},
|
|
1442
1512
|
(table) => [primaryKey({ columns: [table.tenantId, table.id] })]
|
|
@@ -1474,9 +1544,8 @@ var init_schema = __esm({
|
|
|
1474
1544
|
"context_configs",
|
|
1475
1545
|
{
|
|
1476
1546
|
...graphScoped,
|
|
1477
|
-
...uiProperties,
|
|
1478
1547
|
// Developer-defined Zod schema for validating incoming request context
|
|
1479
|
-
|
|
1548
|
+
headersSchema: blob("headers_schema", { mode: "json" }).$type(),
|
|
1480
1549
|
// Stores serialized Zod schema
|
|
1481
1550
|
// Object mapping template keys to fetch definitions that use request context data
|
|
1482
1551
|
contextVariables: blob("context_variables", { mode: "json" }).$type(),
|
|
@@ -1683,8 +1752,7 @@ var init_schema = __esm({
|
|
|
1683
1752
|
{
|
|
1684
1753
|
...projectScoped,
|
|
1685
1754
|
...uiProperties,
|
|
1686
|
-
|
|
1687
|
-
fullProps: blob("full_props", { mode: "json" }).$type(),
|
|
1755
|
+
props: blob("props", { mode: "json" }).$type(),
|
|
1688
1756
|
...timestamps
|
|
1689
1757
|
},
|
|
1690
1758
|
(table) => [
|
|
@@ -1730,13 +1798,16 @@ var init_schema = __esm({
|
|
|
1730
1798
|
{
|
|
1731
1799
|
...projectScoped,
|
|
1732
1800
|
name: text("name").notNull(),
|
|
1733
|
-
|
|
1801
|
+
description: text("description"),
|
|
1802
|
+
// Tool configuration - supports both MCP and function tools
|
|
1734
1803
|
config: blob("config", { mode: "json" }).$type().notNull(),
|
|
1804
|
+
// For function tools, reference the global functions table
|
|
1805
|
+
functionId: text("function_id"),
|
|
1735
1806
|
credentialReferenceId: text("credential_reference_id"),
|
|
1736
1807
|
headers: blob("headers", { mode: "json" }).$type(),
|
|
1737
1808
|
// Image URL for custom tool icon (supports regular URLs and base64 encoded images)
|
|
1738
1809
|
imageUrl: text("image_url"),
|
|
1739
|
-
// Server capabilities and status
|
|
1810
|
+
// Server capabilities and status (only for MCP tools)
|
|
1740
1811
|
capabilities: blob("capabilities", { mode: "json" }).$type(),
|
|
1741
1812
|
lastError: text("last_error"),
|
|
1742
1813
|
...timestamps
|
|
@@ -1747,6 +1818,30 @@ var init_schema = __esm({
|
|
|
1747
1818
|
columns: [table.tenantId, table.projectId],
|
|
1748
1819
|
foreignColumns: [projects.tenantId, projects.id],
|
|
1749
1820
|
name: "tools_project_fk"
|
|
1821
|
+
}).onDelete("cascade"),
|
|
1822
|
+
// Foreign key constraint to functions table (for function tools)
|
|
1823
|
+
foreignKey({
|
|
1824
|
+
columns: [table.tenantId, table.projectId, table.functionId],
|
|
1825
|
+
foreignColumns: [functions.tenantId, functions.projectId, functions.id],
|
|
1826
|
+
name: "tools_function_fk"
|
|
1827
|
+
}).onDelete("cascade")
|
|
1828
|
+
]
|
|
1829
|
+
);
|
|
1830
|
+
functions = sqliteTable(
|
|
1831
|
+
"functions",
|
|
1832
|
+
{
|
|
1833
|
+
...projectScoped,
|
|
1834
|
+
inputSchema: blob("input_schema", { mode: "json" }).$type(),
|
|
1835
|
+
executeCode: text("execute_code").notNull(),
|
|
1836
|
+
dependencies: blob("dependencies", { mode: "json" }).$type(),
|
|
1837
|
+
...timestamps
|
|
1838
|
+
},
|
|
1839
|
+
(table) => [
|
|
1840
|
+
primaryKey({ columns: [table.tenantId, table.projectId, table.id] }),
|
|
1841
|
+
foreignKey({
|
|
1842
|
+
columns: [table.tenantId, table.projectId],
|
|
1843
|
+
foreignColumns: [projects.tenantId, projects.id],
|
|
1844
|
+
name: "functions_project_fk"
|
|
1750
1845
|
}).onDelete("cascade")
|
|
1751
1846
|
]
|
|
1752
1847
|
);
|
|
@@ -2081,6 +2176,10 @@ var init_schema = __esm({
|
|
|
2081
2176
|
credentialReference: one(credentialReferences, {
|
|
2082
2177
|
fields: [tools.credentialReferenceId],
|
|
2083
2178
|
references: [credentialReferences.id]
|
|
2179
|
+
}),
|
|
2180
|
+
function: one(functions, {
|
|
2181
|
+
fields: [tools.functionId],
|
|
2182
|
+
references: [functions.id]
|
|
2084
2183
|
})
|
|
2085
2184
|
}));
|
|
2086
2185
|
conversationsRelations = relations(conversations, ({ one, many }) => ({
|
|
@@ -2178,6 +2277,9 @@ var init_schema = __esm({
|
|
|
2178
2277
|
references: [tasks.id]
|
|
2179
2278
|
})
|
|
2180
2279
|
}));
|
|
2280
|
+
functionsRelations = relations(functions, ({ many }) => ({
|
|
2281
|
+
tools: many(tools)
|
|
2282
|
+
}));
|
|
2181
2283
|
agentRelationsRelations = relations(agentRelations, ({ one }) => ({
|
|
2182
2284
|
graph: one(agentGraph, {
|
|
2183
2285
|
fields: [agentRelations.graphId],
|
|
@@ -2226,7 +2328,7 @@ var init_utility = __esm({
|
|
|
2226
2328
|
});
|
|
2227
2329
|
|
|
2228
2330
|
// ../packages/agents-core/src/validation/schemas.ts
|
|
2229
|
-
var StopWhenSchema, GraphStopWhenSchema, AgentStopWhenSchema, MIN_ID_LENGTH, MAX_ID_LENGTH, URL_SAFE_ID_PATTERN, resourceIdSchema, ModelSettingsSchema, ModelSchema, ProjectModelSchema, createApiSchema, createApiInsertSchema, createApiUpdateSchema, createGraphScopedApiSchema, createGraphScopedApiInsertSchema, createGraphScopedApiUpdateSchema, AgentSelectSchema, AgentInsertSchema, AgentUpdateSchema, AgentApiSelectSchema, AgentApiInsertSchema, AgentApiUpdateSchema, AgentRelationSelectSchema, AgentRelationInsertSchema, AgentRelationUpdateSchema, AgentRelationApiSelectSchema, AgentRelationApiInsertSchema, AgentRelationApiUpdateSchema, AgentRelationQuerySchema, ExternalAgentRelationInsertSchema, ExternalAgentRelationApiInsertSchema, AgentGraphSelectSchema, AgentGraphInsertSchema, AgentGraphUpdateSchema, AgentGraphApiSelectSchema, AgentGraphApiInsertSchema, AgentGraphApiUpdateSchema, TaskSelectSchema, TaskInsertSchema, TaskUpdateSchema, TaskApiSelectSchema, TaskApiInsertSchema, TaskApiUpdateSchema, TaskRelationSelectSchema, TaskRelationInsertSchema, TaskRelationUpdateSchema, TaskRelationApiSelectSchema, TaskRelationApiInsertSchema, TaskRelationApiUpdateSchema, imageUrlSchema, McpTransportConfigSchema, ToolStatusSchema, McpToolDefinitionSchema, ToolSelectSchema, ToolInsertSchema, ConversationSelectSchema, ConversationInsertSchema, ConversationUpdateSchema, ConversationApiSelectSchema, ConversationApiInsertSchema, ConversationApiUpdateSchema, MessageSelectSchema, MessageInsertSchema, MessageUpdateSchema, MessageApiSelectSchema, MessageApiInsertSchema, MessageApiUpdateSchema, ContextCacheSelectSchema, ContextCacheInsertSchema, ContextCacheUpdateSchema, ContextCacheApiSelectSchema, ContextCacheApiInsertSchema, ContextCacheApiUpdateSchema, DataComponentSelectSchema, DataComponentInsertSchema, DataComponentBaseSchema, DataComponentUpdateSchema, DataComponentApiSelectSchema, DataComponentApiInsertSchema, DataComponentApiUpdateSchema, AgentDataComponentSelectSchema, AgentDataComponentInsertSchema, AgentDataComponentUpdateSchema, AgentDataComponentApiSelectSchema, AgentDataComponentApiInsertSchema, AgentDataComponentApiUpdateSchema, ArtifactComponentSelectSchema, ArtifactComponentInsertSchema, ArtifactComponentUpdateSchema, ArtifactComponentApiSelectSchema, ArtifactComponentApiInsertSchema, ArtifactComponentApiUpdateSchema, AgentArtifactComponentSelectSchema, AgentArtifactComponentInsertSchema, AgentArtifactComponentUpdateSchema, AgentArtifactComponentApiSelectSchema, AgentArtifactComponentApiInsertSchema, AgentArtifactComponentApiUpdateSchema, ExternalAgentSelectSchema, ExternalAgentInsertSchema, ExternalAgentUpdateSchema, ExternalAgentApiSelectSchema, ExternalAgentApiInsertSchema, ExternalAgentApiUpdateSchema, AllAgentSchema, ApiKeySelectSchema, ApiKeyInsertSchema, ApiKeyUpdateSchema, ApiKeyApiSelectSchema, ApiKeyApiCreationResponseSchema, ApiKeyApiInsertSchema, CredentialReferenceSelectSchema, CredentialReferenceInsertSchema, CredentialReferenceUpdateSchema, CredentialReferenceApiSelectSchema, CredentialReferenceApiInsertSchema, CredentialReferenceApiUpdateSchema, McpToolSchema, MCPToolConfigSchema, ToolUpdateSchema, ToolApiSelectSchema, ToolApiInsertSchema, ToolApiUpdateSchema, FetchConfigSchema, FetchDefinitionSchema, ContextConfigSelectSchema, ContextConfigInsertSchema, ContextConfigUpdateSchema, ContextConfigApiSelectSchema, ContextConfigApiInsertSchema, ContextConfigApiUpdateSchema, AgentToolRelationSelectSchema, AgentToolRelationInsertSchema, AgentToolRelationUpdateSchema, AgentToolRelationApiSelectSchema, AgentToolRelationApiInsertSchema, AgentToolRelationApiUpdateSchema, LedgerArtifactSelectSchema, LedgerArtifactInsertSchema, LedgerArtifactUpdateSchema, LedgerArtifactApiSelectSchema, LedgerArtifactApiInsertSchema, LedgerArtifactApiUpdateSchema, StatusComponentSchema, StatusUpdateSchema, CanUseItemSchema, FullGraphAgentInsertSchema, FullGraphDefinitionSchema, GraphWithinContextOfProjectSchema, PaginationSchema, ErrorResponseSchema, ExistsResponseSchema, RemovedResponseSchema, ProjectSelectSchema, ProjectInsertSchema, ProjectUpdateSchema, ProjectApiSelectSchema, ProjectApiInsertSchema, ProjectApiUpdateSchema, FullProjectDefinitionSchema, HeadersScopeSchema, TenantParamsSchema, TenantProjectParamsSchema, TenantProjectGraphParamsSchema, TenantProjectGraphIdParamsSchema, TenantProjectIdParamsSchema, TenantIdParamsSchema, IdParamsSchema, PaginationQueryParamsSchema;
|
|
2331
|
+
var StopWhenSchema, GraphStopWhenSchema, AgentStopWhenSchema, MIN_ID_LENGTH, MAX_ID_LENGTH, URL_SAFE_ID_PATTERN, resourceIdSchema, ModelSettingsSchema, ModelSchema, ProjectModelSchema, SandboxConfigSchema, FunctionToolConfigSchema, createApiSchema, createApiInsertSchema, createApiUpdateSchema, createGraphScopedApiSchema, createGraphScopedApiInsertSchema, createGraphScopedApiUpdateSchema, AgentSelectSchema, AgentInsertSchema, AgentUpdateSchema, AgentApiSelectSchema, AgentApiInsertSchema, AgentApiUpdateSchema, AgentRelationSelectSchema, AgentRelationInsertSchema, AgentRelationUpdateSchema, AgentRelationApiSelectSchema, AgentRelationApiInsertSchema, AgentRelationApiUpdateSchema, AgentRelationQuerySchema, ExternalAgentRelationInsertSchema, ExternalAgentRelationApiInsertSchema, AgentGraphSelectSchema, AgentGraphInsertSchema, AgentGraphUpdateSchema, AgentGraphApiSelectSchema, AgentGraphApiInsertSchema, AgentGraphApiUpdateSchema, TaskSelectSchema, TaskInsertSchema, TaskUpdateSchema, TaskApiSelectSchema, TaskApiInsertSchema, TaskApiUpdateSchema, TaskRelationSelectSchema, TaskRelationInsertSchema, TaskRelationUpdateSchema, TaskRelationApiSelectSchema, TaskRelationApiInsertSchema, TaskRelationApiUpdateSchema, imageUrlSchema, McpTransportConfigSchema, ToolStatusSchema, McpToolDefinitionSchema, ToolSelectSchema, ToolInsertSchema, ConversationSelectSchema, ConversationInsertSchema, ConversationUpdateSchema, ConversationApiSelectSchema, ConversationApiInsertSchema, ConversationApiUpdateSchema, MessageSelectSchema, MessageInsertSchema, MessageUpdateSchema, MessageApiSelectSchema, MessageApiInsertSchema, MessageApiUpdateSchema, ContextCacheSelectSchema, ContextCacheInsertSchema, ContextCacheUpdateSchema, ContextCacheApiSelectSchema, ContextCacheApiInsertSchema, ContextCacheApiUpdateSchema, DataComponentSelectSchema, DataComponentInsertSchema, DataComponentBaseSchema, DataComponentUpdateSchema, DataComponentApiSelectSchema, DataComponentApiInsertSchema, DataComponentApiUpdateSchema, AgentDataComponentSelectSchema, AgentDataComponentInsertSchema, AgentDataComponentUpdateSchema, AgentDataComponentApiSelectSchema, AgentDataComponentApiInsertSchema, AgentDataComponentApiUpdateSchema, ArtifactComponentSelectSchema, ArtifactComponentInsertSchema, ArtifactComponentUpdateSchema, ArtifactComponentApiSelectSchema, ArtifactComponentApiInsertSchema, ArtifactComponentApiUpdateSchema, AgentArtifactComponentSelectSchema, AgentArtifactComponentInsertSchema, AgentArtifactComponentUpdateSchema, AgentArtifactComponentApiSelectSchema, AgentArtifactComponentApiInsertSchema, AgentArtifactComponentApiUpdateSchema, ExternalAgentSelectSchema, ExternalAgentInsertSchema, ExternalAgentUpdateSchema, ExternalAgentApiSelectSchema, ExternalAgentApiInsertSchema, ExternalAgentApiUpdateSchema, AllAgentSchema, ApiKeySelectSchema, ApiKeyInsertSchema, ApiKeyUpdateSchema, ApiKeyApiSelectSchema, ApiKeyApiCreationResponseSchema, ApiKeyApiInsertSchema, CredentialReferenceSelectSchema, CredentialReferenceInsertSchema, CredentialReferenceUpdateSchema, CredentialReferenceApiSelectSchema, CredentialReferenceApiInsertSchema, CredentialReferenceApiUpdateSchema, McpToolSchema, MCPToolConfigSchema, ToolUpdateSchema, ToolApiSelectSchema, ToolApiInsertSchema, ToolApiUpdateSchema, FunctionSelectSchema, FunctionInsertSchema, FunctionUpdateSchema, FunctionApiSelectSchema, FunctionApiInsertSchema, FunctionApiUpdateSchema, FetchConfigSchema, FetchDefinitionSchema, ContextConfigSelectSchema, ContextConfigInsertSchema, ContextConfigUpdateSchema, ContextConfigApiSelectSchema, ContextConfigApiInsertSchema, ContextConfigApiUpdateSchema, AgentToolRelationSelectSchema, AgentToolRelationInsertSchema, AgentToolRelationUpdateSchema, AgentToolRelationApiSelectSchema, AgentToolRelationApiInsertSchema, AgentToolRelationApiUpdateSchema, LedgerArtifactSelectSchema, LedgerArtifactInsertSchema, LedgerArtifactUpdateSchema, LedgerArtifactApiSelectSchema, LedgerArtifactApiInsertSchema, LedgerArtifactApiUpdateSchema, StatusComponentSchema, StatusUpdateSchema, CanUseItemSchema, FullGraphAgentInsertSchema, FullGraphDefinitionSchema, GraphWithinContextOfProjectSchema, PaginationSchema, ErrorResponseSchema, ExistsResponseSchema, RemovedResponseSchema, ProjectSelectSchema, ProjectInsertSchema, ProjectUpdateSchema, ProjectApiSelectSchema, ProjectApiInsertSchema, ProjectApiUpdateSchema, FullProjectDefinitionSchema, HeadersScopeSchema, TenantParamsSchema, TenantProjectParamsSchema, TenantProjectGraphParamsSchema, TenantProjectGraphIdParamsSchema, TenantProjectIdParamsSchema, TenantIdParamsSchema, IdParamsSchema, PaginationQueryParamsSchema;
|
|
2230
2332
|
var init_schemas = __esm({
|
|
2231
2333
|
"../packages/agents-core/src/validation/schemas.ts"() {
|
|
2232
2334
|
"use strict";
|
|
@@ -2235,35 +2337,48 @@ var init_schemas = __esm({
|
|
|
2235
2337
|
init_drizzle_zod();
|
|
2236
2338
|
init_schema();
|
|
2237
2339
|
init_utility();
|
|
2238
|
-
StopWhenSchema =
|
|
2239
|
-
transferCountIs:
|
|
2240
|
-
stepCountIs:
|
|
2340
|
+
StopWhenSchema = z2.object({
|
|
2341
|
+
transferCountIs: z2.number().min(1).max(100).optional(),
|
|
2342
|
+
stepCountIs: z2.number().min(1).max(1e3).optional()
|
|
2241
2343
|
});
|
|
2242
2344
|
GraphStopWhenSchema = StopWhenSchema.pick({ transferCountIs: true });
|
|
2243
2345
|
AgentStopWhenSchema = StopWhenSchema.pick({ stepCountIs: true });
|
|
2244
2346
|
MIN_ID_LENGTH = 1;
|
|
2245
2347
|
MAX_ID_LENGTH = 255;
|
|
2246
2348
|
URL_SAFE_ID_PATTERN = /^[a-zA-Z0-9\-_.]+$/;
|
|
2247
|
-
resourceIdSchema =
|
|
2349
|
+
resourceIdSchema = z2.string().min(MIN_ID_LENGTH).max(MAX_ID_LENGTH).regex(URL_SAFE_ID_PATTERN, {
|
|
2248
2350
|
message: "ID must contain only letters, numbers, hyphens, underscores, and dots"
|
|
2249
2351
|
}).openapi({
|
|
2250
2352
|
description: "Resource identifier",
|
|
2251
2353
|
example: "resource_789"
|
|
2252
2354
|
});
|
|
2253
|
-
ModelSettingsSchema =
|
|
2254
|
-
model:
|
|
2255
|
-
providerOptions:
|
|
2355
|
+
ModelSettingsSchema = z2.object({
|
|
2356
|
+
model: z2.string().optional(),
|
|
2357
|
+
providerOptions: z2.record(z2.string(), z2.any()).optional()
|
|
2256
2358
|
});
|
|
2257
|
-
ModelSchema =
|
|
2359
|
+
ModelSchema = z2.object({
|
|
2258
2360
|
base: ModelSettingsSchema.optional(),
|
|
2259
2361
|
structuredOutput: ModelSettingsSchema.optional(),
|
|
2260
2362
|
summarizer: ModelSettingsSchema.optional()
|
|
2261
2363
|
});
|
|
2262
|
-
ProjectModelSchema =
|
|
2364
|
+
ProjectModelSchema = z2.object({
|
|
2263
2365
|
base: ModelSettingsSchema,
|
|
2264
2366
|
structuredOutput: ModelSettingsSchema.optional(),
|
|
2265
2367
|
summarizer: ModelSettingsSchema.optional()
|
|
2266
2368
|
});
|
|
2369
|
+
SandboxConfigSchema = z2.object({
|
|
2370
|
+
provider: z2.enum(["vercel", "local"]),
|
|
2371
|
+
runtime: z2.enum(["node22", "typescript"]),
|
|
2372
|
+
timeout: z2.number().min(1e3).max(3e5).optional(),
|
|
2373
|
+
vcpus: z2.number().min(1).max(8).optional()
|
|
2374
|
+
});
|
|
2375
|
+
FunctionToolConfigSchema = z2.object({
|
|
2376
|
+
name: z2.string(),
|
|
2377
|
+
description: z2.string(),
|
|
2378
|
+
inputSchema: z2.record(z2.string(), z2.unknown()),
|
|
2379
|
+
dependencies: z2.record(z2.string(), z2.string()).optional(),
|
|
2380
|
+
execute: z2.union([z2.function(), z2.string()])
|
|
2381
|
+
});
|
|
2267
2382
|
createApiSchema = (schema) => schema.omit({ tenantId: true, projectId: true });
|
|
2268
2383
|
createApiInsertSchema = (schema) => schema.omit({ tenantId: true, projectId: true });
|
|
2269
2384
|
createApiUpdateSchema = (schema) => schema.omit({ tenantId: true, projectId: true }).partial();
|
|
@@ -2292,7 +2407,7 @@ var init_schemas = __esm({
|
|
|
2292
2407
|
AgentRelationApiInsertSchema = createGraphScopedApiInsertSchema(
|
|
2293
2408
|
AgentRelationInsertSchema
|
|
2294
2409
|
).extend({
|
|
2295
|
-
relationType:
|
|
2410
|
+
relationType: z2.enum(VALID_RELATION_TYPES)
|
|
2296
2411
|
}).refine(
|
|
2297
2412
|
(data) => {
|
|
2298
2413
|
const hasTarget = data.targetAgentId != null;
|
|
@@ -2307,7 +2422,7 @@ var init_schemas = __esm({
|
|
|
2307
2422
|
AgentRelationApiUpdateSchema = createGraphScopedApiUpdateSchema(
|
|
2308
2423
|
AgentRelationUpdateSchema
|
|
2309
2424
|
).extend({
|
|
2310
|
-
relationType:
|
|
2425
|
+
relationType: z2.enum(VALID_RELATION_TYPES).optional()
|
|
2311
2426
|
}).refine(
|
|
2312
2427
|
(data) => {
|
|
2313
2428
|
const hasTarget = data.targetAgentId != null;
|
|
@@ -2322,10 +2437,10 @@ var init_schemas = __esm({
|
|
|
2322
2437
|
path: ["targetAgentId", "externalAgentId"]
|
|
2323
2438
|
}
|
|
2324
2439
|
);
|
|
2325
|
-
AgentRelationQuerySchema =
|
|
2326
|
-
sourceAgentId:
|
|
2327
|
-
targetAgentId:
|
|
2328
|
-
externalAgentId:
|
|
2440
|
+
AgentRelationQuerySchema = z2.object({
|
|
2441
|
+
sourceAgentId: z2.string().optional(),
|
|
2442
|
+
targetAgentId: z2.string().optional(),
|
|
2443
|
+
externalAgentId: z2.string().optional()
|
|
2329
2444
|
});
|
|
2330
2445
|
ExternalAgentRelationInsertSchema = createInsertSchema(agentRelations).extend({
|
|
2331
2446
|
id: resourceIdSchema,
|
|
@@ -2365,7 +2480,7 @@ var init_schemas = __esm({
|
|
|
2365
2480
|
TaskRelationApiSelectSchema = createApiSchema(TaskRelationSelectSchema);
|
|
2366
2481
|
TaskRelationApiInsertSchema = createApiInsertSchema(TaskRelationInsertSchema);
|
|
2367
2482
|
TaskRelationApiUpdateSchema = createApiUpdateSchema(TaskRelationUpdateSchema);
|
|
2368
|
-
imageUrlSchema =
|
|
2483
|
+
imageUrlSchema = z2.string().optional().refine(
|
|
2369
2484
|
(url) => {
|
|
2370
2485
|
if (!url) return true;
|
|
2371
2486
|
if (url.startsWith("data:image/")) {
|
|
@@ -2384,23 +2499,49 @@ var init_schemas = __esm({
|
|
|
2384
2499
|
message: "Image URL must be a valid HTTP(S) URL or a base64 data URL (max 1MB)"
|
|
2385
2500
|
}
|
|
2386
2501
|
);
|
|
2387
|
-
McpTransportConfigSchema =
|
|
2388
|
-
type:
|
|
2389
|
-
requestInit:
|
|
2390
|
-
eventSourceInit:
|
|
2391
|
-
reconnectionOptions:
|
|
2392
|
-
sessionId:
|
|
2502
|
+
McpTransportConfigSchema = z2.object({
|
|
2503
|
+
type: z2.enum(MCPTransportType),
|
|
2504
|
+
requestInit: z2.record(z2.string(), z2.unknown()).optional(),
|
|
2505
|
+
eventSourceInit: z2.record(z2.string(), z2.unknown()).optional(),
|
|
2506
|
+
reconnectionOptions: z2.custom().optional(),
|
|
2507
|
+
sessionId: z2.string().optional()
|
|
2393
2508
|
});
|
|
2394
|
-
ToolStatusSchema =
|
|
2395
|
-
McpToolDefinitionSchema =
|
|
2396
|
-
name:
|
|
2397
|
-
description:
|
|
2398
|
-
inputSchema:
|
|
2509
|
+
ToolStatusSchema = z2.enum(TOOL_STATUS_VALUES);
|
|
2510
|
+
McpToolDefinitionSchema = z2.object({
|
|
2511
|
+
name: z2.string(),
|
|
2512
|
+
description: z2.string().optional(),
|
|
2513
|
+
inputSchema: z2.record(z2.string(), z2.unknown()).optional()
|
|
2399
2514
|
});
|
|
2400
2515
|
ToolSelectSchema = createSelectSchema(tools);
|
|
2401
2516
|
ToolInsertSchema = createInsertSchema(tools).extend({
|
|
2402
2517
|
id: resourceIdSchema,
|
|
2403
|
-
imageUrl: imageUrlSchema
|
|
2518
|
+
imageUrl: imageUrlSchema,
|
|
2519
|
+
functionId: resourceIdSchema.optional(),
|
|
2520
|
+
// For function tools, reference to global functions table
|
|
2521
|
+
config: z2.discriminatedUnion("type", [
|
|
2522
|
+
// MCP tools
|
|
2523
|
+
z2.object({
|
|
2524
|
+
type: z2.literal("mcp"),
|
|
2525
|
+
mcp: z2.object({
|
|
2526
|
+
server: z2.object({
|
|
2527
|
+
url: z2.string().url()
|
|
2528
|
+
}),
|
|
2529
|
+
transport: z2.object({
|
|
2530
|
+
type: z2.enum(MCPTransportType),
|
|
2531
|
+
requestInit: z2.record(z2.string(), z2.unknown()).optional(),
|
|
2532
|
+
eventSourceInit: z2.record(z2.string(), z2.unknown()).optional(),
|
|
2533
|
+
reconnectionOptions: z2.custom().optional(),
|
|
2534
|
+
sessionId: z2.string().optional()
|
|
2535
|
+
}).optional(),
|
|
2536
|
+
activeTools: z2.array(z2.string()).optional()
|
|
2537
|
+
})
|
|
2538
|
+
}),
|
|
2539
|
+
// Function tools (reference-only, no inline duplication)
|
|
2540
|
+
z2.object({
|
|
2541
|
+
type: z2.literal("function")
|
|
2542
|
+
// No inline function details - they're in the functions table via functionId
|
|
2543
|
+
})
|
|
2544
|
+
])
|
|
2404
2545
|
});
|
|
2405
2546
|
ConversationSelectSchema = createSelectSchema(conversations);
|
|
2406
2547
|
ConversationInsertSchema = createInsertSchema(conversations).extend({
|
|
@@ -2491,8 +2632,8 @@ var init_schemas = __esm({
|
|
|
2491
2632
|
AgentArtifactComponentUpdateSchema
|
|
2492
2633
|
);
|
|
2493
2634
|
ExternalAgentSelectSchema = createSelectSchema(externalAgents).extend({
|
|
2494
|
-
credentialReferenceId:
|
|
2495
|
-
headers:
|
|
2635
|
+
credentialReferenceId: z2.string().nullable().optional(),
|
|
2636
|
+
headers: z2.record(z2.string(), z2.string()).nullable().optional()
|
|
2496
2637
|
});
|
|
2497
2638
|
ExternalAgentInsertSchema = createInsertSchema(externalAgents).extend({
|
|
2498
2639
|
id: resourceIdSchema
|
|
@@ -2501,9 +2642,9 @@ var init_schemas = __esm({
|
|
|
2501
2642
|
ExternalAgentApiSelectSchema = createGraphScopedApiSchema(ExternalAgentSelectSchema);
|
|
2502
2643
|
ExternalAgentApiInsertSchema = createGraphScopedApiInsertSchema(ExternalAgentInsertSchema);
|
|
2503
2644
|
ExternalAgentApiUpdateSchema = createGraphScopedApiUpdateSchema(ExternalAgentUpdateSchema);
|
|
2504
|
-
AllAgentSchema =
|
|
2505
|
-
AgentApiSelectSchema.extend({ type:
|
|
2506
|
-
ExternalAgentApiSelectSchema.extend({ type:
|
|
2645
|
+
AllAgentSchema = z2.discriminatedUnion("type", [
|
|
2646
|
+
AgentApiSelectSchema.extend({ type: z2.literal("internal") }),
|
|
2647
|
+
ExternalAgentApiSelectSchema.extend({ type: z2.literal("external") })
|
|
2507
2648
|
]);
|
|
2508
2649
|
ApiKeySelectSchema = createSelectSchema(apiKeys);
|
|
2509
2650
|
ApiKeyInsertSchema = createInsertSchema(apiKeys).extend({
|
|
@@ -2525,10 +2666,10 @@ var init_schemas = __esm({
|
|
|
2525
2666
|
keyHash: true
|
|
2526
2667
|
// Never expose the hash
|
|
2527
2668
|
});
|
|
2528
|
-
ApiKeyApiCreationResponseSchema =
|
|
2529
|
-
data:
|
|
2669
|
+
ApiKeyApiCreationResponseSchema = z2.object({
|
|
2670
|
+
data: z2.object({
|
|
2530
2671
|
apiKey: ApiKeyApiSelectSchema,
|
|
2531
|
-
key:
|
|
2672
|
+
key: z2.string().describe("The full API key (shown only once)")
|
|
2532
2673
|
})
|
|
2533
2674
|
});
|
|
2534
2675
|
ApiKeyApiInsertSchema = ApiKeyInsertSchema.omit({
|
|
@@ -2545,46 +2686,46 @@ var init_schemas = __esm({
|
|
|
2545
2686
|
lastUsedAt: true
|
|
2546
2687
|
// Not set on creation
|
|
2547
2688
|
});
|
|
2548
|
-
CredentialReferenceSelectSchema =
|
|
2549
|
-
id:
|
|
2550
|
-
tenantId:
|
|
2551
|
-
projectId:
|
|
2552
|
-
type:
|
|
2553
|
-
credentialStoreId:
|
|
2554
|
-
retrievalParams:
|
|
2555
|
-
createdAt:
|
|
2556
|
-
updatedAt:
|
|
2689
|
+
CredentialReferenceSelectSchema = z2.object({
|
|
2690
|
+
id: z2.string(),
|
|
2691
|
+
tenantId: z2.string(),
|
|
2692
|
+
projectId: z2.string(),
|
|
2693
|
+
type: z2.string(),
|
|
2694
|
+
credentialStoreId: z2.string(),
|
|
2695
|
+
retrievalParams: z2.record(z2.string(), z2.unknown()).nullish(),
|
|
2696
|
+
createdAt: z2.string(),
|
|
2697
|
+
updatedAt: z2.string()
|
|
2557
2698
|
});
|
|
2558
2699
|
CredentialReferenceInsertSchema = createInsertSchema(credentialReferences).extend({
|
|
2559
2700
|
id: resourceIdSchema,
|
|
2560
|
-
type:
|
|
2701
|
+
type: z2.string(),
|
|
2561
2702
|
credentialStoreId: resourceIdSchema,
|
|
2562
|
-
retrievalParams:
|
|
2703
|
+
retrievalParams: z2.record(z2.string(), z2.unknown()).nullish()
|
|
2563
2704
|
});
|
|
2564
2705
|
CredentialReferenceUpdateSchema = CredentialReferenceInsertSchema.partial();
|
|
2565
2706
|
CredentialReferenceApiSelectSchema = createApiSchema(
|
|
2566
2707
|
CredentialReferenceSelectSchema
|
|
2567
2708
|
).extend({
|
|
2568
|
-
type:
|
|
2569
|
-
tools:
|
|
2709
|
+
type: z2.enum(CredentialStoreType),
|
|
2710
|
+
tools: z2.array(ToolSelectSchema).optional()
|
|
2570
2711
|
});
|
|
2571
2712
|
CredentialReferenceApiInsertSchema = createApiInsertSchema(
|
|
2572
2713
|
CredentialReferenceInsertSchema
|
|
2573
2714
|
).extend({
|
|
2574
|
-
type:
|
|
2715
|
+
type: z2.enum(CredentialStoreType)
|
|
2575
2716
|
});
|
|
2576
2717
|
CredentialReferenceApiUpdateSchema = createApiUpdateSchema(
|
|
2577
2718
|
CredentialReferenceUpdateSchema
|
|
2578
2719
|
).extend({
|
|
2579
|
-
type:
|
|
2720
|
+
type: z2.enum(CredentialStoreType).optional()
|
|
2580
2721
|
});
|
|
2581
2722
|
McpToolSchema = ToolInsertSchema.extend({
|
|
2582
2723
|
imageUrl: imageUrlSchema,
|
|
2583
|
-
availableTools:
|
|
2724
|
+
availableTools: z2.array(McpToolDefinitionSchema).optional(),
|
|
2584
2725
|
status: ToolStatusSchema.default("unknown"),
|
|
2585
|
-
version:
|
|
2586
|
-
createdAt:
|
|
2587
|
-
updatedAt:
|
|
2726
|
+
version: z2.string().optional(),
|
|
2727
|
+
createdAt: z2.date(),
|
|
2728
|
+
updatedAt: z2.date()
|
|
2588
2729
|
});
|
|
2589
2730
|
MCPToolConfigSchema = McpToolSchema.omit({
|
|
2590
2731
|
config: true,
|
|
@@ -2596,12 +2737,12 @@ var init_schemas = __esm({
|
|
|
2596
2737
|
updatedAt: true,
|
|
2597
2738
|
credentialReferenceId: true
|
|
2598
2739
|
}).extend({
|
|
2599
|
-
tenantId:
|
|
2600
|
-
projectId:
|
|
2601
|
-
description:
|
|
2602
|
-
serverUrl:
|
|
2603
|
-
activeTools:
|
|
2604
|
-
mcpType:
|
|
2740
|
+
tenantId: z2.string().optional(),
|
|
2741
|
+
projectId: z2.string().optional(),
|
|
2742
|
+
description: z2.string().optional(),
|
|
2743
|
+
serverUrl: z2.url(),
|
|
2744
|
+
activeTools: z2.array(z2.string()).optional(),
|
|
2745
|
+
mcpType: z2.enum(MCPServerType).optional(),
|
|
2605
2746
|
transport: McpTransportConfigSchema.optional(),
|
|
2606
2747
|
credential: CredentialReferenceApiInsertSchema.optional()
|
|
2607
2748
|
});
|
|
@@ -2609,31 +2750,39 @@ var init_schemas = __esm({
|
|
|
2609
2750
|
ToolApiSelectSchema = createApiSchema(ToolSelectSchema);
|
|
2610
2751
|
ToolApiInsertSchema = createApiInsertSchema(ToolInsertSchema);
|
|
2611
2752
|
ToolApiUpdateSchema = createApiUpdateSchema(ToolUpdateSchema);
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2753
|
+
FunctionSelectSchema = createSelectSchema(functions);
|
|
2754
|
+
FunctionInsertSchema = createInsertSchema(functions).extend({
|
|
2755
|
+
id: resourceIdSchema
|
|
2756
|
+
});
|
|
2757
|
+
FunctionUpdateSchema = FunctionInsertSchema.partial();
|
|
2758
|
+
FunctionApiSelectSchema = createApiSchema(FunctionSelectSchema);
|
|
2759
|
+
FunctionApiInsertSchema = createApiInsertSchema(FunctionInsertSchema);
|
|
2760
|
+
FunctionApiUpdateSchema = createApiUpdateSchema(FunctionUpdateSchema);
|
|
2761
|
+
FetchConfigSchema = z2.object({
|
|
2762
|
+
url: z2.string().min(1, "URL is required"),
|
|
2763
|
+
method: z2.enum(["GET", "POST", "PUT", "DELETE", "PATCH"]).optional().default("GET"),
|
|
2764
|
+
headers: z2.record(z2.string(), z2.string()).optional(),
|
|
2765
|
+
body: z2.record(z2.string(), z2.unknown()).optional(),
|
|
2766
|
+
transform: z2.string().optional(),
|
|
2618
2767
|
// JSONPath or JS transform function
|
|
2619
|
-
timeout:
|
|
2768
|
+
timeout: z2.number().min(0).optional().default(1e4).optional()
|
|
2620
2769
|
});
|
|
2621
|
-
FetchDefinitionSchema =
|
|
2622
|
-
id:
|
|
2623
|
-
name:
|
|
2624
|
-
trigger:
|
|
2770
|
+
FetchDefinitionSchema = z2.object({
|
|
2771
|
+
id: z2.string().min(1, "Fetch definition ID is required"),
|
|
2772
|
+
name: z2.string().optional(),
|
|
2773
|
+
trigger: z2.enum(["initialization", "invocation"]),
|
|
2625
2774
|
fetchConfig: FetchConfigSchema,
|
|
2626
|
-
responseSchema:
|
|
2775
|
+
responseSchema: z2.any().optional(),
|
|
2627
2776
|
// JSON Schema for validating HTTP response
|
|
2628
|
-
defaultValue:
|
|
2777
|
+
defaultValue: z2.unknown().optional(),
|
|
2629
2778
|
credential: CredentialReferenceApiInsertSchema.optional()
|
|
2630
2779
|
});
|
|
2631
2780
|
ContextConfigSelectSchema = createSelectSchema(contextConfigs).extend({
|
|
2632
|
-
|
|
2781
|
+
headersSchema: z2.unknown().optional()
|
|
2633
2782
|
});
|
|
2634
2783
|
ContextConfigInsertSchema = createInsertSchema(contextConfigs).extend({
|
|
2635
|
-
id: resourceIdSchema,
|
|
2636
|
-
|
|
2784
|
+
id: resourceIdSchema.optional(),
|
|
2785
|
+
headersSchema: z2.unknown().optional()
|
|
2637
2786
|
}).omit({
|
|
2638
2787
|
createdAt: true,
|
|
2639
2788
|
updatedAt: true
|
|
@@ -2653,8 +2802,8 @@ var init_schemas = __esm({
|
|
|
2653
2802
|
id: resourceIdSchema,
|
|
2654
2803
|
agentId: resourceIdSchema,
|
|
2655
2804
|
toolId: resourceIdSchema,
|
|
2656
|
-
selectedTools:
|
|
2657
|
-
headers:
|
|
2805
|
+
selectedTools: z2.array(z2.string()).nullish(),
|
|
2806
|
+
headers: z2.record(z2.string(), z2.string()).nullish()
|
|
2658
2807
|
});
|
|
2659
2808
|
AgentToolRelationUpdateSchema = AgentToolRelationInsertSchema.partial();
|
|
2660
2809
|
AgentToolRelationApiSelectSchema = createGraphScopedApiSchema(
|
|
@@ -2672,83 +2821,87 @@ var init_schemas = __esm({
|
|
|
2672
2821
|
LedgerArtifactApiSelectSchema = createApiSchema(LedgerArtifactSelectSchema);
|
|
2673
2822
|
LedgerArtifactApiInsertSchema = createApiInsertSchema(LedgerArtifactInsertSchema);
|
|
2674
2823
|
LedgerArtifactApiUpdateSchema = createApiUpdateSchema(LedgerArtifactUpdateSchema);
|
|
2675
|
-
StatusComponentSchema =
|
|
2676
|
-
type:
|
|
2677
|
-
description:
|
|
2678
|
-
detailsSchema:
|
|
2679
|
-
type:
|
|
2680
|
-
properties:
|
|
2681
|
-
required:
|
|
2824
|
+
StatusComponentSchema = z2.object({
|
|
2825
|
+
type: z2.string(),
|
|
2826
|
+
description: z2.string().optional(),
|
|
2827
|
+
detailsSchema: z2.object({
|
|
2828
|
+
type: z2.literal("object"),
|
|
2829
|
+
properties: z2.record(z2.string(), z2.any()),
|
|
2830
|
+
required: z2.array(z2.string()).optional()
|
|
2682
2831
|
}).optional()
|
|
2683
2832
|
});
|
|
2684
|
-
StatusUpdateSchema =
|
|
2685
|
-
enabled:
|
|
2686
|
-
numEvents:
|
|
2687
|
-
timeInSeconds:
|
|
2688
|
-
prompt:
|
|
2689
|
-
statusComponents:
|
|
2833
|
+
StatusUpdateSchema = z2.object({
|
|
2834
|
+
enabled: z2.boolean().optional(),
|
|
2835
|
+
numEvents: z2.number().min(1).max(100).optional(),
|
|
2836
|
+
timeInSeconds: z2.number().min(1).max(600).optional(),
|
|
2837
|
+
prompt: z2.string().max(2e3, "Custom prompt cannot exceed 2000 characters").optional(),
|
|
2838
|
+
statusComponents: z2.array(StatusComponentSchema).optional()
|
|
2690
2839
|
});
|
|
2691
|
-
CanUseItemSchema =
|
|
2692
|
-
agentToolRelationId:
|
|
2693
|
-
toolId:
|
|
2694
|
-
toolSelection:
|
|
2695
|
-
headers:
|
|
2840
|
+
CanUseItemSchema = z2.object({
|
|
2841
|
+
agentToolRelationId: z2.string().optional(),
|
|
2842
|
+
toolId: z2.string(),
|
|
2843
|
+
toolSelection: z2.array(z2.string()).nullish(),
|
|
2844
|
+
headers: z2.record(z2.string(), z2.string()).nullish()
|
|
2696
2845
|
});
|
|
2697
2846
|
FullGraphAgentInsertSchema = AgentApiInsertSchema.extend({
|
|
2698
|
-
type:
|
|
2699
|
-
canUse:
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2847
|
+
type: z2.literal("internal"),
|
|
2848
|
+
canUse: z2.array(CanUseItemSchema),
|
|
2849
|
+
// All tools (both MCP and function tools)
|
|
2850
|
+
dataComponents: z2.array(z2.string()).optional(),
|
|
2851
|
+
artifactComponents: z2.array(z2.string()).optional(),
|
|
2852
|
+
canTransferTo: z2.array(z2.string()).optional(),
|
|
2853
|
+
canDelegateTo: z2.array(z2.string()).optional()
|
|
2704
2854
|
});
|
|
2705
2855
|
FullGraphDefinitionSchema = AgentGraphApiInsertSchema.extend({
|
|
2706
|
-
agents:
|
|
2707
|
-
//
|
|
2708
|
-
|
|
2709
|
-
//
|
|
2710
|
-
|
|
2711
|
-
|
|
2856
|
+
agents: z2.record(z2.string(), z2.union([FullGraphAgentInsertSchema, ExternalAgentApiInsertSchema])),
|
|
2857
|
+
// Lookup maps for UI to resolve canUse items
|
|
2858
|
+
tools: z2.record(z2.string(), ToolApiInsertSchema).optional(),
|
|
2859
|
+
// Get tool name/description from toolId
|
|
2860
|
+
functions: z2.record(z2.string(), FunctionApiInsertSchema).optional(),
|
|
2861
|
+
// Get function code for function tools
|
|
2862
|
+
contextConfig: z2.optional(ContextConfigApiInsertSchema),
|
|
2863
|
+
statusUpdates: z2.optional(StatusUpdateSchema),
|
|
2712
2864
|
models: ModelSchema.optional(),
|
|
2713
2865
|
stopWhen: GraphStopWhenSchema.optional(),
|
|
2714
|
-
graphPrompt:
|
|
2866
|
+
graphPrompt: z2.string().max(5e3, "Graph prompt cannot exceed 5000 characters").optional()
|
|
2715
2867
|
});
|
|
2716
2868
|
GraphWithinContextOfProjectSchema = AgentGraphApiInsertSchema.extend({
|
|
2717
|
-
agents:
|
|
2718
|
-
|
|
2719
|
-
|
|
2869
|
+
agents: z2.record(
|
|
2870
|
+
z2.string(),
|
|
2871
|
+
z2.discriminatedUnion("type", [
|
|
2720
2872
|
FullGraphAgentInsertSchema,
|
|
2721
|
-
ExternalAgentApiInsertSchema.extend({ type:
|
|
2873
|
+
ExternalAgentApiInsertSchema.extend({ type: z2.literal("external") })
|
|
2722
2874
|
])
|
|
2723
2875
|
),
|
|
2724
|
-
contextConfig:
|
|
2725
|
-
statusUpdates:
|
|
2876
|
+
contextConfig: z2.optional(ContextConfigApiInsertSchema),
|
|
2877
|
+
statusUpdates: z2.optional(StatusUpdateSchema),
|
|
2726
2878
|
models: ModelSchema.optional(),
|
|
2727
2879
|
stopWhen: GraphStopWhenSchema.optional(),
|
|
2728
|
-
graphPrompt:
|
|
2880
|
+
graphPrompt: z2.string().max(5e3, "Graph prompt cannot exceed 5000 characters").optional()
|
|
2729
2881
|
});
|
|
2730
|
-
PaginationSchema =
|
|
2731
|
-
page:
|
|
2732
|
-
limit:
|
|
2733
|
-
total:
|
|
2734
|
-
pages:
|
|
2882
|
+
PaginationSchema = z2.object({
|
|
2883
|
+
page: z2.coerce.number().min(1).default(1),
|
|
2884
|
+
limit: z2.coerce.number().min(1).max(100).default(10),
|
|
2885
|
+
total: z2.number(),
|
|
2886
|
+
pages: z2.number()
|
|
2735
2887
|
});
|
|
2736
|
-
ErrorResponseSchema =
|
|
2737
|
-
error:
|
|
2738
|
-
message:
|
|
2739
|
-
details:
|
|
2888
|
+
ErrorResponseSchema = z2.object({
|
|
2889
|
+
error: z2.string(),
|
|
2890
|
+
message: z2.string().optional(),
|
|
2891
|
+
details: z2.unknown().optional()
|
|
2740
2892
|
});
|
|
2741
|
-
ExistsResponseSchema =
|
|
2742
|
-
exists:
|
|
2893
|
+
ExistsResponseSchema = z2.object({
|
|
2894
|
+
exists: z2.boolean()
|
|
2743
2895
|
});
|
|
2744
|
-
RemovedResponseSchema =
|
|
2745
|
-
message:
|
|
2746
|
-
removed:
|
|
2896
|
+
RemovedResponseSchema = z2.object({
|
|
2897
|
+
message: z2.string(),
|
|
2898
|
+
removed: z2.boolean()
|
|
2747
2899
|
});
|
|
2748
2900
|
ProjectSelectSchema = createSelectSchema(projects);
|
|
2749
2901
|
ProjectInsertSchema = createInsertSchema(projects).extend({
|
|
2750
2902
|
models: ProjectModelSchema,
|
|
2751
|
-
stopWhen: StopWhenSchema.optional()
|
|
2903
|
+
stopWhen: StopWhenSchema.optional(),
|
|
2904
|
+
sandboxConfig: SandboxConfigSchema.optional()
|
|
2752
2905
|
}).omit({
|
|
2753
2906
|
createdAt: true,
|
|
2754
2907
|
updatedAt: true
|
|
@@ -2758,112 +2911,117 @@ var init_schemas = __esm({
|
|
|
2758
2911
|
ProjectApiInsertSchema = ProjectInsertSchema.omit({ tenantId: true });
|
|
2759
2912
|
ProjectApiUpdateSchema = ProjectUpdateSchema.omit({ tenantId: true });
|
|
2760
2913
|
FullProjectDefinitionSchema = ProjectApiInsertSchema.extend({
|
|
2761
|
-
graphs:
|
|
2762
|
-
tools:
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2914
|
+
graphs: z2.record(z2.string(), GraphWithinContextOfProjectSchema),
|
|
2915
|
+
tools: z2.record(z2.string(), ToolApiInsertSchema),
|
|
2916
|
+
// Now includes both MCP and function tools
|
|
2917
|
+
functions: z2.record(z2.string(), FunctionApiInsertSchema).optional(),
|
|
2918
|
+
// Global functions
|
|
2919
|
+
dataComponents: z2.record(z2.string(), DataComponentApiInsertSchema).optional(),
|
|
2920
|
+
artifactComponents: z2.record(z2.string(), ArtifactComponentApiInsertSchema).optional(),
|
|
2921
|
+
statusUpdates: z2.optional(StatusUpdateSchema),
|
|
2922
|
+
credentialReferences: z2.record(z2.string(), CredentialReferenceApiInsertSchema).optional(),
|
|
2923
|
+
createdAt: z2.string().optional(),
|
|
2924
|
+
updatedAt: z2.string().optional()
|
|
2769
2925
|
});
|
|
2770
|
-
HeadersScopeSchema =
|
|
2771
|
-
"x-inkeep-tenant-id":
|
|
2926
|
+
HeadersScopeSchema = z2.object({
|
|
2927
|
+
"x-inkeep-tenant-id": z2.string().optional().openapi({
|
|
2772
2928
|
description: "Tenant identifier",
|
|
2773
2929
|
example: "tenant_123"
|
|
2774
2930
|
}),
|
|
2775
|
-
"x-inkeep-project-id":
|
|
2931
|
+
"x-inkeep-project-id": z2.string().optional().openapi({
|
|
2776
2932
|
description: "Project identifier",
|
|
2777
2933
|
example: "project_456"
|
|
2778
2934
|
}),
|
|
2779
|
-
"x-inkeep-graph-id":
|
|
2935
|
+
"x-inkeep-graph-id": z2.string().optional().openapi({
|
|
2780
2936
|
description: "Graph identifier",
|
|
2781
2937
|
example: "graph_789"
|
|
2782
2938
|
})
|
|
2783
2939
|
});
|
|
2784
|
-
TenantParamsSchema =
|
|
2785
|
-
tenantId:
|
|
2940
|
+
TenantParamsSchema = z2.object({
|
|
2941
|
+
tenantId: z2.string().openapi({
|
|
2786
2942
|
description: "Tenant identifier",
|
|
2787
2943
|
example: "tenant_123"
|
|
2788
2944
|
})
|
|
2789
2945
|
}).openapi("TenantParams");
|
|
2790
|
-
TenantProjectParamsSchema =
|
|
2791
|
-
tenantId:
|
|
2946
|
+
TenantProjectParamsSchema = z2.object({
|
|
2947
|
+
tenantId: z2.string().openapi({
|
|
2792
2948
|
description: "Tenant identifier",
|
|
2793
2949
|
example: "tenant_123"
|
|
2794
2950
|
}),
|
|
2795
|
-
projectId:
|
|
2951
|
+
projectId: z2.string().openapi({
|
|
2796
2952
|
description: "Project identifier",
|
|
2797
2953
|
example: "project_456"
|
|
2798
2954
|
})
|
|
2799
2955
|
}).openapi("TenantProjectParams");
|
|
2800
|
-
TenantProjectGraphParamsSchema =
|
|
2801
|
-
tenantId:
|
|
2956
|
+
TenantProjectGraphParamsSchema = z2.object({
|
|
2957
|
+
tenantId: z2.string().openapi({
|
|
2802
2958
|
description: "Tenant identifier",
|
|
2803
2959
|
example: "tenant_123"
|
|
2804
2960
|
}),
|
|
2805
|
-
projectId:
|
|
2961
|
+
projectId: z2.string().openapi({
|
|
2806
2962
|
description: "Project identifier",
|
|
2807
2963
|
example: "project_456"
|
|
2808
2964
|
}),
|
|
2809
|
-
graphId:
|
|
2965
|
+
graphId: z2.string().openapi({
|
|
2810
2966
|
description: "Graph identifier",
|
|
2811
2967
|
example: "graph_789"
|
|
2812
2968
|
})
|
|
2813
2969
|
}).openapi("TenantProjectGraphParams");
|
|
2814
|
-
TenantProjectGraphIdParamsSchema =
|
|
2815
|
-
tenantId:
|
|
2970
|
+
TenantProjectGraphIdParamsSchema = z2.object({
|
|
2971
|
+
tenantId: z2.string().openapi({
|
|
2816
2972
|
description: "Tenant identifier",
|
|
2817
2973
|
example: "tenant_123"
|
|
2818
2974
|
}),
|
|
2819
|
-
projectId:
|
|
2975
|
+
projectId: z2.string().openapi({
|
|
2820
2976
|
description: "Project identifier",
|
|
2821
2977
|
example: "project_456"
|
|
2822
2978
|
}),
|
|
2823
|
-
graphId:
|
|
2979
|
+
graphId: z2.string().openapi({
|
|
2824
2980
|
description: "Graph identifier",
|
|
2825
2981
|
example: "graph_789"
|
|
2826
2982
|
}),
|
|
2827
2983
|
id: resourceIdSchema
|
|
2828
2984
|
}).openapi("TenantProjectGraphIdParams");
|
|
2829
|
-
TenantProjectIdParamsSchema =
|
|
2830
|
-
tenantId:
|
|
2985
|
+
TenantProjectIdParamsSchema = z2.object({
|
|
2986
|
+
tenantId: z2.string().openapi({
|
|
2831
2987
|
description: "Tenant identifier",
|
|
2832
2988
|
example: "tenant_123"
|
|
2833
2989
|
}),
|
|
2834
|
-
projectId:
|
|
2990
|
+
projectId: z2.string().openapi({
|
|
2835
2991
|
description: "Project identifier",
|
|
2836
2992
|
example: "project_456"
|
|
2837
2993
|
}),
|
|
2838
2994
|
id: resourceIdSchema
|
|
2839
2995
|
}).openapi("TenantProjectIdParams");
|
|
2840
|
-
TenantIdParamsSchema =
|
|
2841
|
-
tenantId:
|
|
2996
|
+
TenantIdParamsSchema = z2.object({
|
|
2997
|
+
tenantId: z2.string().openapi({
|
|
2842
2998
|
description: "Tenant identifier",
|
|
2843
2999
|
example: "tenant_123"
|
|
2844
3000
|
}),
|
|
2845
3001
|
id: resourceIdSchema
|
|
2846
3002
|
}).openapi("TenantIdParams");
|
|
2847
|
-
IdParamsSchema =
|
|
3003
|
+
IdParamsSchema = z2.object({
|
|
2848
3004
|
id: resourceIdSchema
|
|
2849
3005
|
}).openapi("IdParams");
|
|
2850
|
-
PaginationQueryParamsSchema =
|
|
2851
|
-
page:
|
|
2852
|
-
limit:
|
|
3006
|
+
PaginationQueryParamsSchema = z2.object({
|
|
3007
|
+
page: z2.coerce.number().min(1).default(1),
|
|
3008
|
+
limit: z2.coerce.number().min(1).max(100).default(10)
|
|
2853
3009
|
});
|
|
2854
3010
|
}
|
|
2855
3011
|
});
|
|
2856
3012
|
|
|
2857
3013
|
// ../packages/agents-core/src/context/ContextConfig.ts
|
|
2858
|
-
import { z as
|
|
2859
|
-
var
|
|
3014
|
+
import { z as z4 } from "zod";
|
|
3015
|
+
var logger2;
|
|
2860
3016
|
var init_ContextConfig = __esm({
|
|
2861
3017
|
"../packages/agents-core/src/context/ContextConfig.ts"() {
|
|
2862
3018
|
"use strict";
|
|
2863
3019
|
init_esm_shims();
|
|
3020
|
+
init_conversations();
|
|
2864
3021
|
init_logger();
|
|
3022
|
+
init_schema_conversion();
|
|
2865
3023
|
init_schemas();
|
|
2866
|
-
|
|
3024
|
+
logger2 = getLogger("context-config");
|
|
2867
3025
|
}
|
|
2868
3026
|
});
|
|
2869
3027
|
|
|
@@ -4379,14 +4537,14 @@ var require_jmespath = __commonJS({
|
|
|
4379
4537
|
});
|
|
4380
4538
|
|
|
4381
4539
|
// ../packages/agents-core/src/context/TemplateEngine.ts
|
|
4382
|
-
var import_jmespath,
|
|
4540
|
+
var import_jmespath, logger3;
|
|
4383
4541
|
var init_TemplateEngine = __esm({
|
|
4384
4542
|
"../packages/agents-core/src/context/TemplateEngine.ts"() {
|
|
4385
4543
|
"use strict";
|
|
4386
4544
|
init_esm_shims();
|
|
4387
4545
|
import_jmespath = __toESM(require_jmespath(), 1);
|
|
4388
4546
|
init_logger();
|
|
4389
|
-
|
|
4547
|
+
logger3 = getLogger("template-engine");
|
|
4390
4548
|
}
|
|
4391
4549
|
});
|
|
4392
4550
|
|
|
@@ -4458,51 +4616,6 @@ var init_client = __esm({
|
|
|
4458
4616
|
}
|
|
4459
4617
|
});
|
|
4460
4618
|
|
|
4461
|
-
// ../node_modules/.pnpm/nanoid@5.1.6/node_modules/nanoid/index.js
|
|
4462
|
-
import { webcrypto as crypto2 } from "crypto";
|
|
4463
|
-
function fillPool(bytes) {
|
|
4464
|
-
if (!pool || pool.length < bytes) {
|
|
4465
|
-
pool = Buffer.allocUnsafe(bytes * POOL_SIZE_MULTIPLIER);
|
|
4466
|
-
crypto2.getRandomValues(pool);
|
|
4467
|
-
poolOffset = 0;
|
|
4468
|
-
} else if (poolOffset + bytes > pool.length) {
|
|
4469
|
-
crypto2.getRandomValues(pool);
|
|
4470
|
-
poolOffset = 0;
|
|
4471
|
-
}
|
|
4472
|
-
poolOffset += bytes;
|
|
4473
|
-
}
|
|
4474
|
-
function random(bytes) {
|
|
4475
|
-
fillPool(bytes |= 0);
|
|
4476
|
-
return pool.subarray(poolOffset - bytes, poolOffset);
|
|
4477
|
-
}
|
|
4478
|
-
function customRandom(alphabet, defaultSize, getRandom) {
|
|
4479
|
-
let mask = (2 << 31 - Math.clz32(alphabet.length - 1 | 1)) - 1;
|
|
4480
|
-
let step = Math.ceil(1.6 * mask * defaultSize / alphabet.length);
|
|
4481
|
-
return (size = defaultSize) => {
|
|
4482
|
-
if (!size) return "";
|
|
4483
|
-
let id = "";
|
|
4484
|
-
while (true) {
|
|
4485
|
-
let bytes = getRandom(step);
|
|
4486
|
-
let i2 = step;
|
|
4487
|
-
while (i2--) {
|
|
4488
|
-
id += alphabet[bytes[i2] & mask] || "";
|
|
4489
|
-
if (id.length >= size) return id;
|
|
4490
|
-
}
|
|
4491
|
-
}
|
|
4492
|
-
};
|
|
4493
|
-
}
|
|
4494
|
-
function customAlphabet(alphabet, size = 21) {
|
|
4495
|
-
return customRandom(alphabet, size, random);
|
|
4496
|
-
}
|
|
4497
|
-
var POOL_SIZE_MULTIPLIER, pool, poolOffset;
|
|
4498
|
-
var init_nanoid = __esm({
|
|
4499
|
-
"../node_modules/.pnpm/nanoid@5.1.6/node_modules/nanoid/index.js"() {
|
|
4500
|
-
"use strict";
|
|
4501
|
-
init_esm_shims();
|
|
4502
|
-
POOL_SIZE_MULTIPLIER = 128;
|
|
4503
|
-
}
|
|
4504
|
-
});
|
|
4505
|
-
|
|
4506
4619
|
// ../packages/agents-core/src/data-access/agentRelations.ts
|
|
4507
4620
|
import { and, count, desc, eq, isNotNull } from "drizzle-orm";
|
|
4508
4621
|
var init_agentRelations = __esm({
|
|
@@ -4543,24 +4656,29 @@ var init_externalAgents = __esm({
|
|
|
4543
4656
|
}
|
|
4544
4657
|
});
|
|
4545
4658
|
|
|
4546
|
-
// ../packages/agents-core/src/data-access/
|
|
4547
|
-
import { and as and5,
|
|
4548
|
-
var
|
|
4549
|
-
"../packages/agents-core/src/data-access/
|
|
4659
|
+
// ../packages/agents-core/src/data-access/functions.ts
|
|
4660
|
+
import { and as and5, eq as eq5 } from "drizzle-orm";
|
|
4661
|
+
var init_functions = __esm({
|
|
4662
|
+
"../packages/agents-core/src/data-access/functions.ts"() {
|
|
4550
4663
|
"use strict";
|
|
4551
4664
|
init_esm_shims();
|
|
4552
4665
|
init_schema();
|
|
4553
|
-
|
|
4554
|
-
|
|
4555
|
-
|
|
4556
|
-
|
|
4666
|
+
}
|
|
4667
|
+
});
|
|
4668
|
+
|
|
4669
|
+
// ../packages/agents-core/src/credential-stuffer/index.ts
|
|
4670
|
+
var init_credential_stuffer = __esm({
|
|
4671
|
+
"../packages/agents-core/src/credential-stuffer/index.ts"() {
|
|
4672
|
+
"use strict";
|
|
4673
|
+
init_esm_shims();
|
|
4674
|
+
init_CredentialStuffer();
|
|
4557
4675
|
}
|
|
4558
4676
|
});
|
|
4559
4677
|
|
|
4560
4678
|
// ../packages/agents-core/src/utils/apiKeys.ts
|
|
4561
4679
|
import { randomBytes, scrypt, timingSafeEqual } from "crypto";
|
|
4562
4680
|
import { promisify } from "util";
|
|
4563
|
-
var scryptAsync,
|
|
4681
|
+
var scryptAsync, logger4, PUBLIC_ID_LENGTH, PUBLIC_ID_ALPHABET, generatePublicId;
|
|
4564
4682
|
var init_apiKeys = __esm({
|
|
4565
4683
|
"../packages/agents-core/src/utils/apiKeys.ts"() {
|
|
4566
4684
|
"use strict";
|
|
@@ -4568,104 +4686,13 @@ var init_apiKeys = __esm({
|
|
|
4568
4686
|
init_nanoid();
|
|
4569
4687
|
init_logger();
|
|
4570
4688
|
scryptAsync = promisify(scrypt);
|
|
4571
|
-
|
|
4689
|
+
logger4 = getLogger("api-key");
|
|
4572
4690
|
PUBLIC_ID_LENGTH = 12;
|
|
4573
4691
|
PUBLIC_ID_ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-";
|
|
4574
4692
|
generatePublicId = customAlphabet(PUBLIC_ID_ALPHABET, PUBLIC_ID_LENGTH);
|
|
4575
4693
|
}
|
|
4576
4694
|
});
|
|
4577
4695
|
|
|
4578
|
-
// ../packages/agents-core/src/data-access/apiKeys.ts
|
|
4579
|
-
import { and as and6, count as count6, desc as desc6, eq as eq6 } from "drizzle-orm";
|
|
4580
|
-
var init_apiKeys2 = __esm({
|
|
4581
|
-
"../packages/agents-core/src/data-access/apiKeys.ts"() {
|
|
4582
|
-
"use strict";
|
|
4583
|
-
init_esm_shims();
|
|
4584
|
-
init_schema();
|
|
4585
|
-
init_apiKeys();
|
|
4586
|
-
}
|
|
4587
|
-
});
|
|
4588
|
-
|
|
4589
|
-
// ../packages/agents-core/src/data-access/artifactComponents.ts
|
|
4590
|
-
import { and as and7, count as count7, desc as desc7, eq as eq7 } from "drizzle-orm";
|
|
4591
|
-
var init_artifactComponents = __esm({
|
|
4592
|
-
"../packages/agents-core/src/data-access/artifactComponents.ts"() {
|
|
4593
|
-
"use strict";
|
|
4594
|
-
init_esm_shims();
|
|
4595
|
-
init_schema();
|
|
4596
|
-
}
|
|
4597
|
-
});
|
|
4598
|
-
|
|
4599
|
-
// ../packages/agents-core/src/data-access/contextCache.ts
|
|
4600
|
-
import { and as and8, eq as eq8 } from "drizzle-orm";
|
|
4601
|
-
var init_contextCache = __esm({
|
|
4602
|
-
"../packages/agents-core/src/data-access/contextCache.ts"() {
|
|
4603
|
-
"use strict";
|
|
4604
|
-
init_esm_shims();
|
|
4605
|
-
init_schema();
|
|
4606
|
-
}
|
|
4607
|
-
});
|
|
4608
|
-
|
|
4609
|
-
// ../packages/agents-core/src/utils/conversations.ts
|
|
4610
|
-
var generateId;
|
|
4611
|
-
var init_conversations = __esm({
|
|
4612
|
-
"../packages/agents-core/src/utils/conversations.ts"() {
|
|
4613
|
-
"use strict";
|
|
4614
|
-
init_esm_shims();
|
|
4615
|
-
init_nanoid();
|
|
4616
|
-
generateId = customAlphabet("abcdefghijklmnopqrstuvwxyz0123456789", 21);
|
|
4617
|
-
}
|
|
4618
|
-
});
|
|
4619
|
-
|
|
4620
|
-
// ../packages/agents-core/src/data-access/conversations.ts
|
|
4621
|
-
import { and as and9, count as count8, desc as desc8, eq as eq9 } from "drizzle-orm";
|
|
4622
|
-
var init_conversations2 = __esm({
|
|
4623
|
-
"../packages/agents-core/src/data-access/conversations.ts"() {
|
|
4624
|
-
"use strict";
|
|
4625
|
-
init_esm_shims();
|
|
4626
|
-
init_schema();
|
|
4627
|
-
init_conversations();
|
|
4628
|
-
}
|
|
4629
|
-
});
|
|
4630
|
-
|
|
4631
|
-
// ../packages/agents-core/src/data-access/credentialReferences.ts
|
|
4632
|
-
import { and as and10, count as count9, desc as desc9, eq as eq10, sql as sql3 } from "drizzle-orm";
|
|
4633
|
-
var init_credentialReferences = __esm({
|
|
4634
|
-
"../packages/agents-core/src/data-access/credentialReferences.ts"() {
|
|
4635
|
-
"use strict";
|
|
4636
|
-
init_esm_shims();
|
|
4637
|
-
init_schema();
|
|
4638
|
-
}
|
|
4639
|
-
});
|
|
4640
|
-
|
|
4641
|
-
// ../packages/agents-core/src/data-access/dataComponents.ts
|
|
4642
|
-
import { and as and11, count as count10, desc as desc10, eq as eq11 } from "drizzle-orm";
|
|
4643
|
-
var init_dataComponents = __esm({
|
|
4644
|
-
"../packages/agents-core/src/data-access/dataComponents.ts"() {
|
|
4645
|
-
"use strict";
|
|
4646
|
-
init_esm_shims();
|
|
4647
|
-
init_schema();
|
|
4648
|
-
}
|
|
4649
|
-
});
|
|
4650
|
-
|
|
4651
|
-
// ../packages/agents-core/src/validation/graphFull.ts
|
|
4652
|
-
var init_graphFull = __esm({
|
|
4653
|
-
"../packages/agents-core/src/validation/graphFull.ts"() {
|
|
4654
|
-
"use strict";
|
|
4655
|
-
init_esm_shims();
|
|
4656
|
-
init_schemas();
|
|
4657
|
-
}
|
|
4658
|
-
});
|
|
4659
|
-
|
|
4660
|
-
// ../packages/agents-core/src/credential-stuffer/index.ts
|
|
4661
|
-
var init_credential_stuffer = __esm({
|
|
4662
|
-
"../packages/agents-core/src/credential-stuffer/index.ts"() {
|
|
4663
|
-
"use strict";
|
|
4664
|
-
init_esm_shims();
|
|
4665
|
-
init_CredentialStuffer();
|
|
4666
|
-
}
|
|
4667
|
-
});
|
|
4668
|
-
|
|
4669
4696
|
// ../packages/agents-core/src/utils/auth-detection.ts
|
|
4670
4697
|
var init_auth_detection = __esm({
|
|
4671
4698
|
"../packages/agents-core/src/utils/auth-detection.ts"() {
|
|
@@ -4703,7 +4730,7 @@ var init_error = __esm({
|
|
|
4703
4730
|
init_dist4();
|
|
4704
4731
|
init_http_exception();
|
|
4705
4732
|
init_logger();
|
|
4706
|
-
ErrorCode =
|
|
4733
|
+
ErrorCode = z2.enum([
|
|
4707
4734
|
"bad_request",
|
|
4708
4735
|
"unauthorized",
|
|
4709
4736
|
"forbidden",
|
|
@@ -4721,28 +4748,28 @@ var init_error = __esm({
|
|
|
4721
4748
|
unprocessable_entity: 422,
|
|
4722
4749
|
internal_server_error: 500
|
|
4723
4750
|
};
|
|
4724
|
-
problemDetailsSchema =
|
|
4751
|
+
problemDetailsSchema = z2.object({
|
|
4725
4752
|
// type: z.string().url().openapi({
|
|
4726
4753
|
// description: "A URI reference that identifies the problem type.",
|
|
4727
4754
|
// example: `${ERROR_DOCS_BASE_URL}#not-found`,
|
|
4728
4755
|
// }),
|
|
4729
|
-
title:
|
|
4756
|
+
title: z2.string().openapi({
|
|
4730
4757
|
description: "A short, human-readable summary of the problem type.",
|
|
4731
4758
|
example: "Resource Not Found"
|
|
4732
4759
|
}),
|
|
4733
|
-
status:
|
|
4760
|
+
status: z2.number().int().openapi({
|
|
4734
4761
|
description: "The HTTP status code.",
|
|
4735
4762
|
example: 404
|
|
4736
4763
|
}),
|
|
4737
|
-
detail:
|
|
4764
|
+
detail: z2.string().openapi({
|
|
4738
4765
|
description: "A human-readable explanation specific to this occurrence of the problem.",
|
|
4739
4766
|
example: "The requested resource was not found."
|
|
4740
4767
|
}),
|
|
4741
|
-
instance:
|
|
4768
|
+
instance: z2.string().optional().openapi({
|
|
4742
4769
|
description: "A URI reference that identifies the specific occurrence of the problem.",
|
|
4743
4770
|
example: "/conversations/123"
|
|
4744
4771
|
}),
|
|
4745
|
-
requestId:
|
|
4772
|
+
requestId: z2.string().optional().openapi({
|
|
4746
4773
|
description: "A unique identifier for the request, useful for troubleshooting.",
|
|
4747
4774
|
example: "req_1234567890"
|
|
4748
4775
|
}),
|
|
@@ -4751,13 +4778,13 @@ var init_error = __esm({
|
|
|
4751
4778
|
example: "not_found"
|
|
4752
4779
|
})
|
|
4753
4780
|
}).openapi("ProblemDetails");
|
|
4754
|
-
errorResponseSchema =
|
|
4755
|
-
error:
|
|
4781
|
+
errorResponseSchema = z2.object({
|
|
4782
|
+
error: z2.object({
|
|
4756
4783
|
code: ErrorCode.openapi({
|
|
4757
4784
|
description: "A short code indicating the error code returned.",
|
|
4758
4785
|
example: "not_found"
|
|
4759
4786
|
}),
|
|
4760
|
-
message:
|
|
4787
|
+
message: z2.string().openapi({
|
|
4761
4788
|
description: "A human readable error message.",
|
|
4762
4789
|
example: "The requested resource was not found."
|
|
4763
4790
|
})
|
|
@@ -4769,15 +4796,15 @@ var init_error = __esm({
|
|
|
4769
4796
|
content: {
|
|
4770
4797
|
"application/problem+json": {
|
|
4771
4798
|
schema: problemDetailsSchema.extend({
|
|
4772
|
-
code:
|
|
4799
|
+
code: z2.literal(code).openapi({
|
|
4773
4800
|
description: "A short code indicating the error code returned.",
|
|
4774
4801
|
example: code
|
|
4775
4802
|
}),
|
|
4776
|
-
detail:
|
|
4803
|
+
detail: z2.string().openapi({
|
|
4777
4804
|
description: "A detailed explanation specific to this occurrence of the problem, providing context and specifics about what went wrong.",
|
|
4778
4805
|
example: description
|
|
4779
4806
|
}),
|
|
4780
|
-
title:
|
|
4807
|
+
title: z2.string().openapi({
|
|
4781
4808
|
description: "A short, human-readable summary of the problem type.",
|
|
4782
4809
|
example: getTitleFromCode(code)
|
|
4783
4810
|
}),
|
|
@@ -4785,16 +4812,16 @@ var init_error = __esm({
|
|
|
4785
4812
|
// description: "A URI reference that identifies the problem type.",
|
|
4786
4813
|
// example: `${ERROR_DOCS_BASE_URL}#${code}`,
|
|
4787
4814
|
// }),
|
|
4788
|
-
status:
|
|
4815
|
+
status: z2.literal(errorCodeToHttpStatus[code]).openapi({
|
|
4789
4816
|
description: "The HTTP status code.",
|
|
4790
4817
|
example: errorCodeToHttpStatus[code]
|
|
4791
4818
|
}),
|
|
4792
|
-
error:
|
|
4793
|
-
code:
|
|
4819
|
+
error: z2.object({
|
|
4820
|
+
code: z2.literal(code).openapi({
|
|
4794
4821
|
description: "A short code indicating the error code returned.",
|
|
4795
4822
|
example: code
|
|
4796
4823
|
}),
|
|
4797
|
-
message:
|
|
4824
|
+
message: z2.string().openapi({
|
|
4798
4825
|
description: "A concise error message suitable for display to end users. May be truncated if the full detail is long.",
|
|
4799
4826
|
example: description.length > 100 ? `${description.substring(0, 97)}...` : description
|
|
4800
4827
|
})
|
|
@@ -4847,57 +4874,57 @@ var init_execution = __esm({
|
|
|
4847
4874
|
}
|
|
4848
4875
|
});
|
|
4849
4876
|
|
|
4850
|
-
// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
4851
|
-
import { z as
|
|
4852
|
-
var JSONRPC_VERSION, ProgressTokenSchema, CursorSchema, RequestMetaSchema, BaseRequestParamsSchema, RequestSchema, BaseNotificationParamsSchema, NotificationSchema, ResultSchema, RequestIdSchema, JSONRPCRequestSchema, JSONRPCNotificationSchema, JSONRPCResponseSchema, ErrorCode2, JSONRPCErrorSchema, JSONRPCMessageSchema, EmptyResultSchema, CancelledNotificationSchema, IconSchema, BaseMetadataSchema, ImplementationSchema, ClientCapabilitiesSchema, InitializeRequestSchema, ServerCapabilitiesSchema, InitializeResultSchema, InitializedNotificationSchema, PingRequestSchema, ProgressSchema, ProgressNotificationSchema, PaginatedRequestSchema, PaginatedResultSchema, ResourceContentsSchema, TextResourceContentsSchema, Base64Schema, BlobResourceContentsSchema, ResourceSchema, ResourceTemplateSchema, ListResourcesRequestSchema, ListResourcesResultSchema, ListResourceTemplatesRequestSchema, ListResourceTemplatesResultSchema, ReadResourceRequestSchema, ReadResourceResultSchema, ResourceListChangedNotificationSchema, SubscribeRequestSchema, UnsubscribeRequestSchema, ResourceUpdatedNotificationSchema, PromptArgumentSchema, PromptSchema, ListPromptsRequestSchema, ListPromptsResultSchema, GetPromptRequestSchema, TextContentSchema, ImageContentSchema, AudioContentSchema, EmbeddedResourceSchema, ResourceLinkSchema, ContentBlockSchema, PromptMessageSchema, GetPromptResultSchema, PromptListChangedNotificationSchema, ToolAnnotationsSchema, ToolSchema, ListToolsRequestSchema, ListToolsResultSchema, CallToolResultSchema, CompatibilityCallToolResultSchema, CallToolRequestSchema, ToolListChangedNotificationSchema, LoggingLevelSchema, SetLevelRequestSchema, LoggingMessageNotificationSchema, ModelHintSchema, ModelPreferencesSchema, SamplingMessageSchema, CreateMessageRequestSchema, CreateMessageResultSchema, BooleanSchemaSchema, StringSchemaSchema, NumberSchemaSchema, EnumSchemaSchema, PrimitiveSchemaDefinitionSchema, ElicitRequestSchema, ElicitResultSchema, ResourceTemplateReferenceSchema, PromptReferenceSchema, CompleteRequestSchema, CompleteResultSchema, RootSchema, ListRootsRequestSchema, ListRootsResultSchema, RootsListChangedNotificationSchema, ClientRequestSchema, ClientNotificationSchema, ClientResultSchema, ServerRequestSchema, ServerNotificationSchema, ServerResultSchema;
|
|
4877
|
+
// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.19.1/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
|
|
4878
|
+
import { z as z5 } from "zod";
|
|
4879
|
+
var JSONRPC_VERSION, ProgressTokenSchema, CursorSchema, RequestMetaSchema, BaseRequestParamsSchema, RequestSchema, BaseNotificationParamsSchema, NotificationSchema, ResultSchema, RequestIdSchema, JSONRPCRequestSchema, JSONRPCNotificationSchema, JSONRPCResponseSchema, ErrorCode2, JSONRPCErrorSchema, JSONRPCMessageSchema, EmptyResultSchema, CancelledNotificationSchema, IconSchema, IconsSchema, BaseMetadataSchema, ImplementationSchema, ClientCapabilitiesSchema, InitializeRequestSchema, ServerCapabilitiesSchema, InitializeResultSchema, InitializedNotificationSchema, PingRequestSchema, ProgressSchema, ProgressNotificationSchema, PaginatedRequestSchema, PaginatedResultSchema, ResourceContentsSchema, TextResourceContentsSchema, Base64Schema, BlobResourceContentsSchema, ResourceSchema, ResourceTemplateSchema, ListResourcesRequestSchema, ListResourcesResultSchema, ListResourceTemplatesRequestSchema, ListResourceTemplatesResultSchema, ReadResourceRequestSchema, ReadResourceResultSchema, ResourceListChangedNotificationSchema, SubscribeRequestSchema, UnsubscribeRequestSchema, ResourceUpdatedNotificationSchema, PromptArgumentSchema, PromptSchema, ListPromptsRequestSchema, ListPromptsResultSchema, GetPromptRequestSchema, TextContentSchema, ImageContentSchema, AudioContentSchema, EmbeddedResourceSchema, ResourceLinkSchema, ContentBlockSchema, PromptMessageSchema, GetPromptResultSchema, PromptListChangedNotificationSchema, ToolAnnotationsSchema, ToolSchema, ListToolsRequestSchema, ListToolsResultSchema, CallToolResultSchema, CompatibilityCallToolResultSchema, CallToolRequestSchema, ToolListChangedNotificationSchema, LoggingLevelSchema, SetLevelRequestSchema, LoggingMessageNotificationSchema, ModelHintSchema, ModelPreferencesSchema, SamplingMessageSchema, CreateMessageRequestSchema, CreateMessageResultSchema, BooleanSchemaSchema, StringSchemaSchema, NumberSchemaSchema, EnumSchemaSchema, PrimitiveSchemaDefinitionSchema, ElicitRequestSchema, ElicitResultSchema, ResourceTemplateReferenceSchema, PromptReferenceSchema, CompleteRequestSchema, CompleteResultSchema, RootSchema, ListRootsRequestSchema, ListRootsResultSchema, RootsListChangedNotificationSchema, ClientRequestSchema, ClientNotificationSchema, ClientResultSchema, ServerRequestSchema, ServerNotificationSchema, ServerResultSchema;
|
|
4853
4880
|
var init_types2 = __esm({
|
|
4854
|
-
"../node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
4881
|
+
"../node_modules/.pnpm/@modelcontextprotocol+sdk@1.19.1/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js"() {
|
|
4855
4882
|
"use strict";
|
|
4856
4883
|
init_esm_shims();
|
|
4857
4884
|
JSONRPC_VERSION = "2.0";
|
|
4858
|
-
ProgressTokenSchema =
|
|
4859
|
-
CursorSchema =
|
|
4860
|
-
RequestMetaSchema =
|
|
4885
|
+
ProgressTokenSchema = z5.union([z5.string(), z5.number().int()]);
|
|
4886
|
+
CursorSchema = z5.string();
|
|
4887
|
+
RequestMetaSchema = z5.object({
|
|
4861
4888
|
/**
|
|
4862
4889
|
* If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.
|
|
4863
4890
|
*/
|
|
4864
|
-
progressToken:
|
|
4891
|
+
progressToken: z5.optional(ProgressTokenSchema)
|
|
4865
4892
|
}).passthrough();
|
|
4866
|
-
BaseRequestParamsSchema =
|
|
4867
|
-
_meta:
|
|
4893
|
+
BaseRequestParamsSchema = z5.object({
|
|
4894
|
+
_meta: z5.optional(RequestMetaSchema)
|
|
4868
4895
|
}).passthrough();
|
|
4869
|
-
RequestSchema =
|
|
4870
|
-
method:
|
|
4871
|
-
params:
|
|
4896
|
+
RequestSchema = z5.object({
|
|
4897
|
+
method: z5.string(),
|
|
4898
|
+
params: z5.optional(BaseRequestParamsSchema)
|
|
4872
4899
|
});
|
|
4873
|
-
BaseNotificationParamsSchema =
|
|
4900
|
+
BaseNotificationParamsSchema = z5.object({
|
|
4874
4901
|
/**
|
|
4875
4902
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
4876
4903
|
* for notes on _meta usage.
|
|
4877
4904
|
*/
|
|
4878
|
-
_meta:
|
|
4905
|
+
_meta: z5.optional(z5.object({}).passthrough())
|
|
4879
4906
|
}).passthrough();
|
|
4880
|
-
NotificationSchema =
|
|
4881
|
-
method:
|
|
4882
|
-
params:
|
|
4907
|
+
NotificationSchema = z5.object({
|
|
4908
|
+
method: z5.string(),
|
|
4909
|
+
params: z5.optional(BaseNotificationParamsSchema)
|
|
4883
4910
|
});
|
|
4884
|
-
ResultSchema =
|
|
4911
|
+
ResultSchema = z5.object({
|
|
4885
4912
|
/**
|
|
4886
4913
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
4887
4914
|
* for notes on _meta usage.
|
|
4888
4915
|
*/
|
|
4889
|
-
_meta:
|
|
4916
|
+
_meta: z5.optional(z5.object({}).passthrough())
|
|
4890
4917
|
}).passthrough();
|
|
4891
|
-
RequestIdSchema =
|
|
4892
|
-
JSONRPCRequestSchema =
|
|
4893
|
-
jsonrpc:
|
|
4918
|
+
RequestIdSchema = z5.union([z5.string(), z5.number().int()]);
|
|
4919
|
+
JSONRPCRequestSchema = z5.object({
|
|
4920
|
+
jsonrpc: z5.literal(JSONRPC_VERSION),
|
|
4894
4921
|
id: RequestIdSchema
|
|
4895
4922
|
}).merge(RequestSchema).strict();
|
|
4896
|
-
JSONRPCNotificationSchema =
|
|
4897
|
-
jsonrpc:
|
|
4923
|
+
JSONRPCNotificationSchema = z5.object({
|
|
4924
|
+
jsonrpc: z5.literal(JSONRPC_VERSION)
|
|
4898
4925
|
}).merge(NotificationSchema).strict();
|
|
4899
|
-
JSONRPCResponseSchema =
|
|
4900
|
-
jsonrpc:
|
|
4926
|
+
JSONRPCResponseSchema = z5.object({
|
|
4927
|
+
jsonrpc: z5.literal(JSONRPC_VERSION),
|
|
4901
4928
|
id: RequestIdSchema,
|
|
4902
4929
|
result: ResultSchema
|
|
4903
4930
|
}).strict();
|
|
@@ -4910,33 +4937,28 @@ var init_types2 = __esm({
|
|
|
4910
4937
|
ErrorCode3[ErrorCode3["InvalidParams"] = -32602] = "InvalidParams";
|
|
4911
4938
|
ErrorCode3[ErrorCode3["InternalError"] = -32603] = "InternalError";
|
|
4912
4939
|
})(ErrorCode2 || (ErrorCode2 = {}));
|
|
4913
|
-
JSONRPCErrorSchema =
|
|
4914
|
-
jsonrpc:
|
|
4940
|
+
JSONRPCErrorSchema = z5.object({
|
|
4941
|
+
jsonrpc: z5.literal(JSONRPC_VERSION),
|
|
4915
4942
|
id: RequestIdSchema,
|
|
4916
|
-
error:
|
|
4943
|
+
error: z5.object({
|
|
4917
4944
|
/**
|
|
4918
4945
|
* The error type that occurred.
|
|
4919
4946
|
*/
|
|
4920
|
-
code:
|
|
4947
|
+
code: z5.number().int(),
|
|
4921
4948
|
/**
|
|
4922
4949
|
* A short description of the error. The message SHOULD be limited to a concise single sentence.
|
|
4923
4950
|
*/
|
|
4924
|
-
message:
|
|
4951
|
+
message: z5.string(),
|
|
4925
4952
|
/**
|
|
4926
4953
|
* Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.).
|
|
4927
4954
|
*/
|
|
4928
|
-
data:
|
|
4955
|
+
data: z5.optional(z5.unknown())
|
|
4929
4956
|
})
|
|
4930
4957
|
}).strict();
|
|
4931
|
-
JSONRPCMessageSchema =
|
|
4932
|
-
JSONRPCRequestSchema,
|
|
4933
|
-
JSONRPCNotificationSchema,
|
|
4934
|
-
JSONRPCResponseSchema,
|
|
4935
|
-
JSONRPCErrorSchema
|
|
4936
|
-
]);
|
|
4958
|
+
JSONRPCMessageSchema = z5.union([JSONRPCRequestSchema, JSONRPCNotificationSchema, JSONRPCResponseSchema, JSONRPCErrorSchema]);
|
|
4937
4959
|
EmptyResultSchema = ResultSchema.strict();
|
|
4938
4960
|
CancelledNotificationSchema = NotificationSchema.extend({
|
|
4939
|
-
method:
|
|
4961
|
+
method: z5.literal("notifications/cancelled"),
|
|
4940
4962
|
params: BaseNotificationParamsSchema.extend({
|
|
4941
4963
|
/**
|
|
4942
4964
|
* The ID of the request to cancel.
|
|
@@ -4947,136 +4969,144 @@ var init_types2 = __esm({
|
|
|
4947
4969
|
/**
|
|
4948
4970
|
* An optional string describing the reason for the cancellation. This MAY be logged or presented to the user.
|
|
4949
4971
|
*/
|
|
4950
|
-
reason:
|
|
4972
|
+
reason: z5.string().optional()
|
|
4951
4973
|
})
|
|
4952
4974
|
});
|
|
4953
|
-
IconSchema =
|
|
4975
|
+
IconSchema = z5.object({
|
|
4954
4976
|
/**
|
|
4955
4977
|
* URL or data URI for the icon.
|
|
4956
4978
|
*/
|
|
4957
|
-
src:
|
|
4979
|
+
src: z5.string(),
|
|
4958
4980
|
/**
|
|
4959
4981
|
* Optional MIME type for the icon.
|
|
4960
4982
|
*/
|
|
4961
|
-
mimeType:
|
|
4983
|
+
mimeType: z5.optional(z5.string()),
|
|
4984
|
+
/**
|
|
4985
|
+
* Optional array of strings that specify sizes at which the icon can be used.
|
|
4986
|
+
* Each string should be in WxH format (e.g., `"48x48"`, `"96x96"`) or `"any"` for scalable formats like SVG.
|
|
4987
|
+
*
|
|
4988
|
+
* If not provided, the client should assume that the icon can be used at any size.
|
|
4989
|
+
*/
|
|
4990
|
+
sizes: z5.optional(z5.array(z5.string()))
|
|
4991
|
+
}).passthrough();
|
|
4992
|
+
IconsSchema = z5.object({
|
|
4962
4993
|
/**
|
|
4963
|
-
* Optional
|
|
4994
|
+
* Optional set of sized icons that the client can display in a user interface.
|
|
4995
|
+
*
|
|
4996
|
+
* Clients that support rendering icons MUST support at least the following MIME types:
|
|
4997
|
+
* - `image/png` - PNG images (safe, universal compatibility)
|
|
4998
|
+
* - `image/jpeg` (and `image/jpg`) - JPEG images (safe, universal compatibility)
|
|
4999
|
+
*
|
|
5000
|
+
* Clients that support rendering icons SHOULD also support:
|
|
5001
|
+
* - `image/svg+xml` - SVG images (scalable but requires security precautions)
|
|
5002
|
+
* - `image/webp` - WebP images (modern, efficient format)
|
|
4964
5003
|
*/
|
|
4965
|
-
|
|
5004
|
+
icons: z5.array(IconSchema).optional()
|
|
4966
5005
|
}).passthrough();
|
|
4967
|
-
BaseMetadataSchema =
|
|
5006
|
+
BaseMetadataSchema = z5.object({
|
|
4968
5007
|
/** Intended for programmatic or logical use, but used as a display name in past specs or fallback */
|
|
4969
|
-
name:
|
|
5008
|
+
name: z5.string(),
|
|
4970
5009
|
/**
|
|
4971
|
-
|
|
4972
|
-
|
|
4973
|
-
|
|
4974
|
-
|
|
4975
|
-
|
|
4976
|
-
|
|
4977
|
-
|
|
4978
|
-
title:
|
|
5010
|
+
* Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
|
|
5011
|
+
* even by those unfamiliar with domain-specific terminology.
|
|
5012
|
+
*
|
|
5013
|
+
* If not provided, the name should be used for display (except for Tool,
|
|
5014
|
+
* where `annotations.title` should be given precedence over using `name`,
|
|
5015
|
+
* if present).
|
|
5016
|
+
*/
|
|
5017
|
+
title: z5.optional(z5.string())
|
|
4979
5018
|
}).passthrough();
|
|
4980
5019
|
ImplementationSchema = BaseMetadataSchema.extend({
|
|
4981
|
-
version:
|
|
5020
|
+
version: z5.string(),
|
|
4982
5021
|
/**
|
|
4983
5022
|
* An optional URL of the website for this implementation.
|
|
4984
5023
|
*/
|
|
4985
|
-
websiteUrl:
|
|
4986
|
-
|
|
4987
|
-
|
|
4988
|
-
* This can be used by clients to display the implementation in a user interface.
|
|
4989
|
-
* Each icon should have a `kind` property that specifies whether it is a data representation or a URL source, a `src` property that points to the icon file or data representation, and may also include a `mimeType` and `sizes` property.
|
|
4990
|
-
* The `mimeType` property should be a valid MIME type for the icon file, such as "image/png" or "image/svg+xml".
|
|
4991
|
-
* The `sizes` property should be a string that specifies one or more sizes at which the icon file can be used, such as "48x48" or "any" for scalable formats like SVG.
|
|
4992
|
-
* The `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size.
|
|
4993
|
-
*/
|
|
4994
|
-
icons: z4.optional(z4.array(IconSchema))
|
|
4995
|
-
});
|
|
4996
|
-
ClientCapabilitiesSchema = z4.object({
|
|
5024
|
+
websiteUrl: z5.optional(z5.string())
|
|
5025
|
+
}).merge(IconsSchema);
|
|
5026
|
+
ClientCapabilitiesSchema = z5.object({
|
|
4997
5027
|
/**
|
|
4998
5028
|
* Experimental, non-standard capabilities that the client supports.
|
|
4999
5029
|
*/
|
|
5000
|
-
experimental:
|
|
5030
|
+
experimental: z5.optional(z5.object({}).passthrough()),
|
|
5001
5031
|
/**
|
|
5002
5032
|
* Present if the client supports sampling from an LLM.
|
|
5003
5033
|
*/
|
|
5004
|
-
sampling:
|
|
5034
|
+
sampling: z5.optional(z5.object({}).passthrough()),
|
|
5005
5035
|
/**
|
|
5006
5036
|
* Present if the client supports eliciting user input.
|
|
5007
5037
|
*/
|
|
5008
|
-
elicitation:
|
|
5038
|
+
elicitation: z5.optional(z5.object({}).passthrough()),
|
|
5009
5039
|
/**
|
|
5010
5040
|
* Present if the client supports listing roots.
|
|
5011
5041
|
*/
|
|
5012
|
-
roots:
|
|
5042
|
+
roots: z5.optional(z5.object({
|
|
5013
5043
|
/**
|
|
5014
5044
|
* Whether the client supports issuing notifications for changes to the roots list.
|
|
5015
5045
|
*/
|
|
5016
|
-
listChanged:
|
|
5046
|
+
listChanged: z5.optional(z5.boolean())
|
|
5017
5047
|
}).passthrough())
|
|
5018
5048
|
}).passthrough();
|
|
5019
5049
|
InitializeRequestSchema = RequestSchema.extend({
|
|
5020
|
-
method:
|
|
5050
|
+
method: z5.literal("initialize"),
|
|
5021
5051
|
params: BaseRequestParamsSchema.extend({
|
|
5022
5052
|
/**
|
|
5023
5053
|
* The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well.
|
|
5024
5054
|
*/
|
|
5025
|
-
protocolVersion:
|
|
5055
|
+
protocolVersion: z5.string(),
|
|
5026
5056
|
capabilities: ClientCapabilitiesSchema,
|
|
5027
5057
|
clientInfo: ImplementationSchema
|
|
5028
5058
|
})
|
|
5029
5059
|
});
|
|
5030
|
-
ServerCapabilitiesSchema =
|
|
5060
|
+
ServerCapabilitiesSchema = z5.object({
|
|
5031
5061
|
/**
|
|
5032
5062
|
* Experimental, non-standard capabilities that the server supports.
|
|
5033
5063
|
*/
|
|
5034
|
-
experimental:
|
|
5064
|
+
experimental: z5.optional(z5.object({}).passthrough()),
|
|
5035
5065
|
/**
|
|
5036
5066
|
* Present if the server supports sending log messages to the client.
|
|
5037
5067
|
*/
|
|
5038
|
-
logging:
|
|
5068
|
+
logging: z5.optional(z5.object({}).passthrough()),
|
|
5039
5069
|
/**
|
|
5040
5070
|
* Present if the server supports sending completions to the client.
|
|
5041
5071
|
*/
|
|
5042
|
-
completions:
|
|
5072
|
+
completions: z5.optional(z5.object({}).passthrough()),
|
|
5043
5073
|
/**
|
|
5044
5074
|
* Present if the server offers any prompt templates.
|
|
5045
5075
|
*/
|
|
5046
|
-
prompts:
|
|
5076
|
+
prompts: z5.optional(z5.object({
|
|
5047
5077
|
/**
|
|
5048
5078
|
* Whether this server supports issuing notifications for changes to the prompt list.
|
|
5049
5079
|
*/
|
|
5050
|
-
listChanged:
|
|
5080
|
+
listChanged: z5.optional(z5.boolean())
|
|
5051
5081
|
}).passthrough()),
|
|
5052
5082
|
/**
|
|
5053
5083
|
* Present if the server offers any resources to read.
|
|
5054
5084
|
*/
|
|
5055
|
-
resources:
|
|
5085
|
+
resources: z5.optional(z5.object({
|
|
5056
5086
|
/**
|
|
5057
5087
|
* Whether this server supports clients subscribing to resource updates.
|
|
5058
5088
|
*/
|
|
5059
|
-
subscribe:
|
|
5089
|
+
subscribe: z5.optional(z5.boolean()),
|
|
5060
5090
|
/**
|
|
5061
5091
|
* Whether this server supports issuing notifications for changes to the resource list.
|
|
5062
5092
|
*/
|
|
5063
|
-
listChanged:
|
|
5093
|
+
listChanged: z5.optional(z5.boolean())
|
|
5064
5094
|
}).passthrough()),
|
|
5065
5095
|
/**
|
|
5066
5096
|
* Present if the server offers any tools to call.
|
|
5067
5097
|
*/
|
|
5068
|
-
tools:
|
|
5098
|
+
tools: z5.optional(z5.object({
|
|
5069
5099
|
/**
|
|
5070
5100
|
* Whether this server supports issuing notifications for changes to the tool list.
|
|
5071
5101
|
*/
|
|
5072
|
-
listChanged:
|
|
5102
|
+
listChanged: z5.optional(z5.boolean())
|
|
5073
5103
|
}).passthrough())
|
|
5074
5104
|
}).passthrough();
|
|
5075
5105
|
InitializeResultSchema = ResultSchema.extend({
|
|
5076
5106
|
/**
|
|
5077
5107
|
* The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect.
|
|
5078
5108
|
*/
|
|
5079
|
-
protocolVersion:
|
|
5109
|
+
protocolVersion: z5.string(),
|
|
5080
5110
|
capabilities: ServerCapabilitiesSchema,
|
|
5081
5111
|
serverInfo: ImplementationSchema,
|
|
5082
5112
|
/**
|
|
@@ -5084,30 +5114,30 @@ var init_types2 = __esm({
|
|
|
5084
5114
|
*
|
|
5085
5115
|
* This can be used by clients to improve the LLM's understanding of available tools, resources, etc. It can be thought of like a "hint" to the model. For example, this information MAY be added to the system prompt.
|
|
5086
5116
|
*/
|
|
5087
|
-
instructions:
|
|
5117
|
+
instructions: z5.optional(z5.string())
|
|
5088
5118
|
});
|
|
5089
5119
|
InitializedNotificationSchema = NotificationSchema.extend({
|
|
5090
|
-
method:
|
|
5120
|
+
method: z5.literal("notifications/initialized")
|
|
5091
5121
|
});
|
|
5092
5122
|
PingRequestSchema = RequestSchema.extend({
|
|
5093
|
-
method:
|
|
5123
|
+
method: z5.literal("ping")
|
|
5094
5124
|
});
|
|
5095
|
-
ProgressSchema =
|
|
5125
|
+
ProgressSchema = z5.object({
|
|
5096
5126
|
/**
|
|
5097
5127
|
* The progress thus far. This should increase every time progress is made, even if the total is unknown.
|
|
5098
5128
|
*/
|
|
5099
|
-
progress:
|
|
5129
|
+
progress: z5.number(),
|
|
5100
5130
|
/**
|
|
5101
5131
|
* Total number of items to process (or total progress required), if known.
|
|
5102
5132
|
*/
|
|
5103
|
-
total:
|
|
5133
|
+
total: z5.optional(z5.number()),
|
|
5104
5134
|
/**
|
|
5105
5135
|
* An optional message describing the current progress.
|
|
5106
5136
|
*/
|
|
5107
|
-
message:
|
|
5137
|
+
message: z5.optional(z5.string())
|
|
5108
5138
|
}).passthrough();
|
|
5109
5139
|
ProgressNotificationSchema = NotificationSchema.extend({
|
|
5110
|
-
method:
|
|
5140
|
+
method: z5.literal("notifications/progress"),
|
|
5111
5141
|
params: BaseNotificationParamsSchema.merge(ProgressSchema).extend({
|
|
5112
5142
|
/**
|
|
5113
5143
|
* The progress token which was given in the initial request, used to associate this notification with the request that is proceeding.
|
|
@@ -5121,7 +5151,7 @@ var init_types2 = __esm({
|
|
|
5121
5151
|
* An opaque token representing the current pagination position.
|
|
5122
5152
|
* If provided, the server should return results starting after this cursor.
|
|
5123
5153
|
*/
|
|
5124
|
-
cursor:
|
|
5154
|
+
cursor: z5.optional(CursorSchema)
|
|
5125
5155
|
}).optional()
|
|
5126
5156
|
});
|
|
5127
5157
|
PaginatedResultSchema = ResultSchema.extend({
|
|
@@ -5129,30 +5159,30 @@ var init_types2 = __esm({
|
|
|
5129
5159
|
* An opaque token representing the pagination position after the last returned result.
|
|
5130
5160
|
* If present, there may be more results available.
|
|
5131
5161
|
*/
|
|
5132
|
-
nextCursor:
|
|
5162
|
+
nextCursor: z5.optional(CursorSchema)
|
|
5133
5163
|
});
|
|
5134
|
-
ResourceContentsSchema =
|
|
5164
|
+
ResourceContentsSchema = z5.object({
|
|
5135
5165
|
/**
|
|
5136
5166
|
* The URI of this resource.
|
|
5137
5167
|
*/
|
|
5138
|
-
uri:
|
|
5168
|
+
uri: z5.string(),
|
|
5139
5169
|
/**
|
|
5140
5170
|
* The MIME type of this resource, if known.
|
|
5141
5171
|
*/
|
|
5142
|
-
mimeType:
|
|
5172
|
+
mimeType: z5.optional(z5.string()),
|
|
5143
5173
|
/**
|
|
5144
5174
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
5145
5175
|
* for notes on _meta usage.
|
|
5146
5176
|
*/
|
|
5147
|
-
_meta:
|
|
5177
|
+
_meta: z5.optional(z5.object({}).passthrough())
|
|
5148
5178
|
}).passthrough();
|
|
5149
5179
|
TextResourceContentsSchema = ResourceContentsSchema.extend({
|
|
5150
5180
|
/**
|
|
5151
5181
|
* The text of the item. This must only be set if the item can actually be represented as text (not binary data).
|
|
5152
5182
|
*/
|
|
5153
|
-
text:
|
|
5183
|
+
text: z5.string()
|
|
5154
5184
|
});
|
|
5155
|
-
Base64Schema =
|
|
5185
|
+
Base64Schema = z5.string().refine((val) => {
|
|
5156
5186
|
try {
|
|
5157
5187
|
atob(val);
|
|
5158
5188
|
return true;
|
|
@@ -5170,168 +5200,160 @@ var init_types2 = __esm({
|
|
|
5170
5200
|
/**
|
|
5171
5201
|
* The URI of this resource.
|
|
5172
5202
|
*/
|
|
5173
|
-
uri:
|
|
5203
|
+
uri: z5.string(),
|
|
5174
5204
|
/**
|
|
5175
5205
|
* A description of what this resource represents.
|
|
5176
5206
|
*
|
|
5177
5207
|
* This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model.
|
|
5178
5208
|
*/
|
|
5179
|
-
description:
|
|
5209
|
+
description: z5.optional(z5.string()),
|
|
5180
5210
|
/**
|
|
5181
5211
|
* The MIME type of this resource, if known.
|
|
5182
5212
|
*/
|
|
5183
|
-
mimeType:
|
|
5184
|
-
/**
|
|
5185
|
-
* An optional list of icons for this resource.
|
|
5186
|
-
*/
|
|
5187
|
-
icons: z4.optional(z4.array(IconSchema)),
|
|
5213
|
+
mimeType: z5.optional(z5.string()),
|
|
5188
5214
|
/**
|
|
5189
5215
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
5190
5216
|
* for notes on _meta usage.
|
|
5191
5217
|
*/
|
|
5192
|
-
_meta:
|
|
5193
|
-
});
|
|
5218
|
+
_meta: z5.optional(z5.object({}).passthrough())
|
|
5219
|
+
}).merge(IconsSchema);
|
|
5194
5220
|
ResourceTemplateSchema = BaseMetadataSchema.extend({
|
|
5195
5221
|
/**
|
|
5196
5222
|
* A URI template (according to RFC 6570) that can be used to construct resource URIs.
|
|
5197
5223
|
*/
|
|
5198
|
-
uriTemplate:
|
|
5224
|
+
uriTemplate: z5.string(),
|
|
5199
5225
|
/**
|
|
5200
5226
|
* A description of what this template is for.
|
|
5201
5227
|
*
|
|
5202
5228
|
* This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model.
|
|
5203
5229
|
*/
|
|
5204
|
-
description:
|
|
5230
|
+
description: z5.optional(z5.string()),
|
|
5205
5231
|
/**
|
|
5206
5232
|
* The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type.
|
|
5207
5233
|
*/
|
|
5208
|
-
mimeType:
|
|
5234
|
+
mimeType: z5.optional(z5.string()),
|
|
5209
5235
|
/**
|
|
5210
5236
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
5211
5237
|
* for notes on _meta usage.
|
|
5212
5238
|
*/
|
|
5213
|
-
_meta:
|
|
5214
|
-
});
|
|
5239
|
+
_meta: z5.optional(z5.object({}).passthrough())
|
|
5240
|
+
}).merge(IconsSchema);
|
|
5215
5241
|
ListResourcesRequestSchema = PaginatedRequestSchema.extend({
|
|
5216
|
-
method:
|
|
5242
|
+
method: z5.literal("resources/list")
|
|
5217
5243
|
});
|
|
5218
5244
|
ListResourcesResultSchema = PaginatedResultSchema.extend({
|
|
5219
|
-
resources:
|
|
5245
|
+
resources: z5.array(ResourceSchema)
|
|
5220
5246
|
});
|
|
5221
5247
|
ListResourceTemplatesRequestSchema = PaginatedRequestSchema.extend({
|
|
5222
|
-
method:
|
|
5248
|
+
method: z5.literal("resources/templates/list")
|
|
5223
5249
|
});
|
|
5224
5250
|
ListResourceTemplatesResultSchema = PaginatedResultSchema.extend({
|
|
5225
|
-
resourceTemplates:
|
|
5251
|
+
resourceTemplates: z5.array(ResourceTemplateSchema)
|
|
5226
5252
|
});
|
|
5227
5253
|
ReadResourceRequestSchema = RequestSchema.extend({
|
|
5228
|
-
method:
|
|
5254
|
+
method: z5.literal("resources/read"),
|
|
5229
5255
|
params: BaseRequestParamsSchema.extend({
|
|
5230
5256
|
/**
|
|
5231
5257
|
* The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it.
|
|
5232
5258
|
*/
|
|
5233
|
-
uri:
|
|
5259
|
+
uri: z5.string()
|
|
5234
5260
|
})
|
|
5235
5261
|
});
|
|
5236
5262
|
ReadResourceResultSchema = ResultSchema.extend({
|
|
5237
|
-
contents:
|
|
5263
|
+
contents: z5.array(z5.union([TextResourceContentsSchema, BlobResourceContentsSchema]))
|
|
5238
5264
|
});
|
|
5239
5265
|
ResourceListChangedNotificationSchema = NotificationSchema.extend({
|
|
5240
|
-
method:
|
|
5266
|
+
method: z5.literal("notifications/resources/list_changed")
|
|
5241
5267
|
});
|
|
5242
5268
|
SubscribeRequestSchema = RequestSchema.extend({
|
|
5243
|
-
method:
|
|
5269
|
+
method: z5.literal("resources/subscribe"),
|
|
5244
5270
|
params: BaseRequestParamsSchema.extend({
|
|
5245
5271
|
/**
|
|
5246
5272
|
* The URI of the resource to subscribe to. The URI can use any protocol; it is up to the server how to interpret it.
|
|
5247
5273
|
*/
|
|
5248
|
-
uri:
|
|
5274
|
+
uri: z5.string()
|
|
5249
5275
|
})
|
|
5250
5276
|
});
|
|
5251
5277
|
UnsubscribeRequestSchema = RequestSchema.extend({
|
|
5252
|
-
method:
|
|
5278
|
+
method: z5.literal("resources/unsubscribe"),
|
|
5253
5279
|
params: BaseRequestParamsSchema.extend({
|
|
5254
5280
|
/**
|
|
5255
5281
|
* The URI of the resource to unsubscribe from.
|
|
5256
5282
|
*/
|
|
5257
|
-
uri:
|
|
5283
|
+
uri: z5.string()
|
|
5258
5284
|
})
|
|
5259
5285
|
});
|
|
5260
5286
|
ResourceUpdatedNotificationSchema = NotificationSchema.extend({
|
|
5261
|
-
method:
|
|
5287
|
+
method: z5.literal("notifications/resources/updated"),
|
|
5262
5288
|
params: BaseNotificationParamsSchema.extend({
|
|
5263
5289
|
/**
|
|
5264
5290
|
* The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to.
|
|
5265
5291
|
*/
|
|
5266
|
-
uri:
|
|
5292
|
+
uri: z5.string()
|
|
5267
5293
|
})
|
|
5268
5294
|
});
|
|
5269
|
-
PromptArgumentSchema =
|
|
5295
|
+
PromptArgumentSchema = z5.object({
|
|
5270
5296
|
/**
|
|
5271
5297
|
* The name of the argument.
|
|
5272
5298
|
*/
|
|
5273
|
-
name:
|
|
5299
|
+
name: z5.string(),
|
|
5274
5300
|
/**
|
|
5275
5301
|
* A human-readable description of the argument.
|
|
5276
5302
|
*/
|
|
5277
|
-
description:
|
|
5303
|
+
description: z5.optional(z5.string()),
|
|
5278
5304
|
/**
|
|
5279
5305
|
* Whether this argument must be provided.
|
|
5280
5306
|
*/
|
|
5281
|
-
required:
|
|
5307
|
+
required: z5.optional(z5.boolean())
|
|
5282
5308
|
}).passthrough();
|
|
5283
5309
|
PromptSchema = BaseMetadataSchema.extend({
|
|
5284
5310
|
/**
|
|
5285
5311
|
* An optional description of what this prompt provides
|
|
5286
5312
|
*/
|
|
5287
|
-
description:
|
|
5313
|
+
description: z5.optional(z5.string()),
|
|
5288
5314
|
/**
|
|
5289
5315
|
* A list of arguments to use for templating the prompt.
|
|
5290
5316
|
*/
|
|
5291
|
-
arguments:
|
|
5292
|
-
/**
|
|
5293
|
-
* An optional list of icons for this prompt.
|
|
5294
|
-
*/
|
|
5295
|
-
icons: z4.optional(z4.array(IconSchema)),
|
|
5317
|
+
arguments: z5.optional(z5.array(PromptArgumentSchema)),
|
|
5296
5318
|
/**
|
|
5297
5319
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
5298
5320
|
* for notes on _meta usage.
|
|
5299
5321
|
*/
|
|
5300
|
-
_meta:
|
|
5301
|
-
});
|
|
5322
|
+
_meta: z5.optional(z5.object({}).passthrough())
|
|
5323
|
+
}).merge(IconsSchema);
|
|
5302
5324
|
ListPromptsRequestSchema = PaginatedRequestSchema.extend({
|
|
5303
|
-
method:
|
|
5325
|
+
method: z5.literal("prompts/list")
|
|
5304
5326
|
});
|
|
5305
5327
|
ListPromptsResultSchema = PaginatedResultSchema.extend({
|
|
5306
|
-
prompts:
|
|
5328
|
+
prompts: z5.array(PromptSchema)
|
|
5307
5329
|
});
|
|
5308
5330
|
GetPromptRequestSchema = RequestSchema.extend({
|
|
5309
|
-
method:
|
|
5331
|
+
method: z5.literal("prompts/get"),
|
|
5310
5332
|
params: BaseRequestParamsSchema.extend({
|
|
5311
5333
|
/**
|
|
5312
5334
|
* The name of the prompt or prompt template.
|
|
5313
5335
|
*/
|
|
5314
|
-
name:
|
|
5336
|
+
name: z5.string(),
|
|
5315
5337
|
/**
|
|
5316
5338
|
* Arguments to use for templating the prompt.
|
|
5317
5339
|
*/
|
|
5318
|
-
arguments:
|
|
5340
|
+
arguments: z5.optional(z5.record(z5.string()))
|
|
5319
5341
|
})
|
|
5320
5342
|
});
|
|
5321
|
-
TextContentSchema =
|
|
5322
|
-
type:
|
|
5343
|
+
TextContentSchema = z5.object({
|
|
5344
|
+
type: z5.literal("text"),
|
|
5323
5345
|
/**
|
|
5324
5346
|
* The text content of the message.
|
|
5325
5347
|
*/
|
|
5326
|
-
text:
|
|
5348
|
+
text: z5.string(),
|
|
5327
5349
|
/**
|
|
5328
5350
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
5329
5351
|
* for notes on _meta usage.
|
|
5330
5352
|
*/
|
|
5331
|
-
_meta:
|
|
5353
|
+
_meta: z5.optional(z5.object({}).passthrough())
|
|
5332
5354
|
}).passthrough();
|
|
5333
|
-
ImageContentSchema =
|
|
5334
|
-
type:
|
|
5355
|
+
ImageContentSchema = z5.object({
|
|
5356
|
+
type: z5.literal("image"),
|
|
5335
5357
|
/**
|
|
5336
5358
|
* The base64-encoded image data.
|
|
5337
5359
|
*/
|
|
@@ -5339,15 +5361,15 @@ var init_types2 = __esm({
|
|
|
5339
5361
|
/**
|
|
5340
5362
|
* The MIME type of the image. Different providers may support different image types.
|
|
5341
5363
|
*/
|
|
5342
|
-
mimeType:
|
|
5364
|
+
mimeType: z5.string(),
|
|
5343
5365
|
/**
|
|
5344
5366
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
5345
5367
|
* for notes on _meta usage.
|
|
5346
5368
|
*/
|
|
5347
|
-
_meta:
|
|
5369
|
+
_meta: z5.optional(z5.object({}).passthrough())
|
|
5348
5370
|
}).passthrough();
|
|
5349
|
-
AudioContentSchema =
|
|
5350
|
-
type:
|
|
5371
|
+
AudioContentSchema = z5.object({
|
|
5372
|
+
type: z5.literal("audio"),
|
|
5351
5373
|
/**
|
|
5352
5374
|
* The base64-encoded audio data.
|
|
5353
5375
|
*/
|
|
@@ -5355,57 +5377,57 @@ var init_types2 = __esm({
|
|
|
5355
5377
|
/**
|
|
5356
5378
|
* The MIME type of the audio. Different providers may support different audio types.
|
|
5357
5379
|
*/
|
|
5358
|
-
mimeType:
|
|
5380
|
+
mimeType: z5.string(),
|
|
5359
5381
|
/**
|
|
5360
5382
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
5361
5383
|
* for notes on _meta usage.
|
|
5362
5384
|
*/
|
|
5363
|
-
_meta:
|
|
5385
|
+
_meta: z5.optional(z5.object({}).passthrough())
|
|
5364
5386
|
}).passthrough();
|
|
5365
|
-
EmbeddedResourceSchema =
|
|
5366
|
-
type:
|
|
5367
|
-
resource:
|
|
5387
|
+
EmbeddedResourceSchema = z5.object({
|
|
5388
|
+
type: z5.literal("resource"),
|
|
5389
|
+
resource: z5.union([TextResourceContentsSchema, BlobResourceContentsSchema]),
|
|
5368
5390
|
/**
|
|
5369
5391
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
5370
5392
|
* for notes on _meta usage.
|
|
5371
5393
|
*/
|
|
5372
|
-
_meta:
|
|
5394
|
+
_meta: z5.optional(z5.object({}).passthrough())
|
|
5373
5395
|
}).passthrough();
|
|
5374
5396
|
ResourceLinkSchema = ResourceSchema.extend({
|
|
5375
|
-
type:
|
|
5397
|
+
type: z5.literal("resource_link")
|
|
5376
5398
|
});
|
|
5377
|
-
ContentBlockSchema =
|
|
5399
|
+
ContentBlockSchema = z5.union([
|
|
5378
5400
|
TextContentSchema,
|
|
5379
5401
|
ImageContentSchema,
|
|
5380
5402
|
AudioContentSchema,
|
|
5381
5403
|
ResourceLinkSchema,
|
|
5382
5404
|
EmbeddedResourceSchema
|
|
5383
5405
|
]);
|
|
5384
|
-
PromptMessageSchema =
|
|
5385
|
-
role:
|
|
5406
|
+
PromptMessageSchema = z5.object({
|
|
5407
|
+
role: z5.enum(["user", "assistant"]),
|
|
5386
5408
|
content: ContentBlockSchema
|
|
5387
5409
|
}).passthrough();
|
|
5388
5410
|
GetPromptResultSchema = ResultSchema.extend({
|
|
5389
5411
|
/**
|
|
5390
5412
|
* An optional description for the prompt.
|
|
5391
5413
|
*/
|
|
5392
|
-
description:
|
|
5393
|
-
messages:
|
|
5414
|
+
description: z5.optional(z5.string()),
|
|
5415
|
+
messages: z5.array(PromptMessageSchema)
|
|
5394
5416
|
});
|
|
5395
5417
|
PromptListChangedNotificationSchema = NotificationSchema.extend({
|
|
5396
|
-
method:
|
|
5418
|
+
method: z5.literal("notifications/prompts/list_changed")
|
|
5397
5419
|
});
|
|
5398
|
-
ToolAnnotationsSchema =
|
|
5420
|
+
ToolAnnotationsSchema = z5.object({
|
|
5399
5421
|
/**
|
|
5400
5422
|
* A human-readable title for the tool.
|
|
5401
5423
|
*/
|
|
5402
|
-
title:
|
|
5424
|
+
title: z5.optional(z5.string()),
|
|
5403
5425
|
/**
|
|
5404
5426
|
* If true, the tool does not modify its environment.
|
|
5405
5427
|
*
|
|
5406
5428
|
* Default: false
|
|
5407
5429
|
*/
|
|
5408
|
-
readOnlyHint:
|
|
5430
|
+
readOnlyHint: z5.optional(z5.boolean()),
|
|
5409
5431
|
/**
|
|
5410
5432
|
* If true, the tool may perform destructive updates to its environment.
|
|
5411
5433
|
* If false, the tool performs only additive updates.
|
|
@@ -5414,7 +5436,7 @@ var init_types2 = __esm({
|
|
|
5414
5436
|
*
|
|
5415
5437
|
* Default: true
|
|
5416
5438
|
*/
|
|
5417
|
-
destructiveHint:
|
|
5439
|
+
destructiveHint: z5.optional(z5.boolean()),
|
|
5418
5440
|
/**
|
|
5419
5441
|
* If true, calling the tool repeatedly with the same arguments
|
|
5420
5442
|
* will have no additional effect on the its environment.
|
|
@@ -5423,7 +5445,7 @@ var init_types2 = __esm({
|
|
|
5423
5445
|
*
|
|
5424
5446
|
* Default: false
|
|
5425
5447
|
*/
|
|
5426
|
-
idempotentHint:
|
|
5448
|
+
idempotentHint: z5.optional(z5.boolean()),
|
|
5427
5449
|
/**
|
|
5428
5450
|
* If true, this tool may interact with an "open world" of external
|
|
5429
5451
|
* entities. If false, the tool's domain of interaction is closed.
|
|
@@ -5432,49 +5454,45 @@ var init_types2 = __esm({
|
|
|
5432
5454
|
*
|
|
5433
5455
|
* Default: true
|
|
5434
5456
|
*/
|
|
5435
|
-
openWorldHint:
|
|
5457
|
+
openWorldHint: z5.optional(z5.boolean())
|
|
5436
5458
|
}).passthrough();
|
|
5437
5459
|
ToolSchema = BaseMetadataSchema.extend({
|
|
5438
5460
|
/**
|
|
5439
5461
|
* A human-readable description of the tool.
|
|
5440
5462
|
*/
|
|
5441
|
-
description:
|
|
5463
|
+
description: z5.optional(z5.string()),
|
|
5442
5464
|
/**
|
|
5443
5465
|
* A JSON Schema object defining the expected parameters for the tool.
|
|
5444
5466
|
*/
|
|
5445
|
-
inputSchema:
|
|
5446
|
-
type:
|
|
5447
|
-
properties:
|
|
5448
|
-
required:
|
|
5467
|
+
inputSchema: z5.object({
|
|
5468
|
+
type: z5.literal("object"),
|
|
5469
|
+
properties: z5.optional(z5.object({}).passthrough()),
|
|
5470
|
+
required: z5.optional(z5.array(z5.string()))
|
|
5449
5471
|
}).passthrough(),
|
|
5450
5472
|
/**
|
|
5451
5473
|
* An optional JSON Schema object defining the structure of the tool's output returned in
|
|
5452
5474
|
* the structuredContent field of a CallToolResult.
|
|
5453
5475
|
*/
|
|
5454
|
-
outputSchema:
|
|
5455
|
-
type:
|
|
5456
|
-
properties:
|
|
5457
|
-
required:
|
|
5476
|
+
outputSchema: z5.optional(z5.object({
|
|
5477
|
+
type: z5.literal("object"),
|
|
5478
|
+
properties: z5.optional(z5.object({}).passthrough()),
|
|
5479
|
+
required: z5.optional(z5.array(z5.string()))
|
|
5458
5480
|
}).passthrough()),
|
|
5459
5481
|
/**
|
|
5460
5482
|
* Optional additional tool information.
|
|
5461
5483
|
*/
|
|
5462
|
-
annotations:
|
|
5463
|
-
/**
|
|
5464
|
-
* An optional list of icons for this tool.
|
|
5465
|
-
*/
|
|
5466
|
-
icons: z4.optional(z4.array(IconSchema)),
|
|
5484
|
+
annotations: z5.optional(ToolAnnotationsSchema),
|
|
5467
5485
|
/**
|
|
5468
5486
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
5469
5487
|
* for notes on _meta usage.
|
|
5470
5488
|
*/
|
|
5471
|
-
_meta:
|
|
5472
|
-
});
|
|
5489
|
+
_meta: z5.optional(z5.object({}).passthrough())
|
|
5490
|
+
}).merge(IconsSchema);
|
|
5473
5491
|
ListToolsRequestSchema = PaginatedRequestSchema.extend({
|
|
5474
|
-
method:
|
|
5492
|
+
method: z5.literal("tools/list")
|
|
5475
5493
|
});
|
|
5476
5494
|
ListToolsResultSchema = PaginatedResultSchema.extend({
|
|
5477
|
-
tools:
|
|
5495
|
+
tools: z5.array(ToolSchema)
|
|
5478
5496
|
});
|
|
5479
5497
|
CallToolResultSchema = ResultSchema.extend({
|
|
5480
5498
|
/**
|
|
@@ -5483,13 +5501,13 @@ var init_types2 = __esm({
|
|
|
5483
5501
|
* If the Tool does not define an outputSchema, this field MUST be present in the result.
|
|
5484
5502
|
* For backwards compatibility, this field is always present, but it may be empty.
|
|
5485
5503
|
*/
|
|
5486
|
-
content:
|
|
5504
|
+
content: z5.array(ContentBlockSchema).default([]),
|
|
5487
5505
|
/**
|
|
5488
5506
|
* An object containing structured tool output.
|
|
5489
5507
|
*
|
|
5490
5508
|
* If the Tool defines an outputSchema, this field MUST be present in the result, and contain a JSON object that matches the schema.
|
|
5491
5509
|
*/
|
|
5492
|
-
structuredContent:
|
|
5510
|
+
structuredContent: z5.object({}).passthrough().optional(),
|
|
5493
5511
|
/**
|
|
5494
5512
|
* Whether the tool call ended in an error.
|
|
5495
5513
|
*
|
|
@@ -5504,33 +5522,24 @@ var init_types2 = __esm({
|
|
|
5504
5522
|
* server does not support tool calls, or any other exceptional conditions,
|
|
5505
5523
|
* should be reported as an MCP error response.
|
|
5506
5524
|
*/
|
|
5507
|
-
isError:
|
|
5525
|
+
isError: z5.optional(z5.boolean())
|
|
5508
5526
|
});
|
|
5509
5527
|
CompatibilityCallToolResultSchema = CallToolResultSchema.or(ResultSchema.extend({
|
|
5510
|
-
toolResult:
|
|
5528
|
+
toolResult: z5.unknown()
|
|
5511
5529
|
}));
|
|
5512
5530
|
CallToolRequestSchema = RequestSchema.extend({
|
|
5513
|
-
method:
|
|
5531
|
+
method: z5.literal("tools/call"),
|
|
5514
5532
|
params: BaseRequestParamsSchema.extend({
|
|
5515
|
-
name:
|
|
5516
|
-
arguments:
|
|
5533
|
+
name: z5.string(),
|
|
5534
|
+
arguments: z5.optional(z5.record(z5.unknown()))
|
|
5517
5535
|
})
|
|
5518
5536
|
});
|
|
5519
5537
|
ToolListChangedNotificationSchema = NotificationSchema.extend({
|
|
5520
|
-
method:
|
|
5538
|
+
method: z5.literal("notifications/tools/list_changed")
|
|
5521
5539
|
});
|
|
5522
|
-
LoggingLevelSchema =
|
|
5523
|
-
"debug",
|
|
5524
|
-
"info",
|
|
5525
|
-
"notice",
|
|
5526
|
-
"warning",
|
|
5527
|
-
"error",
|
|
5528
|
-
"critical",
|
|
5529
|
-
"alert",
|
|
5530
|
-
"emergency"
|
|
5531
|
-
]);
|
|
5540
|
+
LoggingLevelSchema = z5.enum(["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]);
|
|
5532
5541
|
SetLevelRequestSchema = RequestSchema.extend({
|
|
5533
|
-
method:
|
|
5542
|
+
method: z5.literal("logging/setLevel"),
|
|
5534
5543
|
params: BaseRequestParamsSchema.extend({
|
|
5535
5544
|
/**
|
|
5536
5545
|
* The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/logging/message.
|
|
@@ -5539,7 +5548,7 @@ var init_types2 = __esm({
|
|
|
5539
5548
|
})
|
|
5540
5549
|
});
|
|
5541
5550
|
LoggingMessageNotificationSchema = NotificationSchema.extend({
|
|
5542
|
-
method:
|
|
5551
|
+
method: z5.literal("notifications/message"),
|
|
5543
5552
|
params: BaseNotificationParamsSchema.extend({
|
|
5544
5553
|
/**
|
|
5545
5554
|
* The severity of this log message.
|
|
@@ -5548,133 +5557,124 @@ var init_types2 = __esm({
|
|
|
5548
5557
|
/**
|
|
5549
5558
|
* An optional name of the logger issuing this message.
|
|
5550
5559
|
*/
|
|
5551
|
-
logger:
|
|
5560
|
+
logger: z5.optional(z5.string()),
|
|
5552
5561
|
/**
|
|
5553
5562
|
* The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here.
|
|
5554
5563
|
*/
|
|
5555
|
-
data:
|
|
5564
|
+
data: z5.unknown()
|
|
5556
5565
|
})
|
|
5557
5566
|
});
|
|
5558
|
-
ModelHintSchema =
|
|
5567
|
+
ModelHintSchema = z5.object({
|
|
5559
5568
|
/**
|
|
5560
5569
|
* A hint for a model name.
|
|
5561
5570
|
*/
|
|
5562
|
-
name:
|
|
5571
|
+
name: z5.string().optional()
|
|
5563
5572
|
}).passthrough();
|
|
5564
|
-
ModelPreferencesSchema =
|
|
5573
|
+
ModelPreferencesSchema = z5.object({
|
|
5565
5574
|
/**
|
|
5566
5575
|
* Optional hints to use for model selection.
|
|
5567
5576
|
*/
|
|
5568
|
-
hints:
|
|
5577
|
+
hints: z5.optional(z5.array(ModelHintSchema)),
|
|
5569
5578
|
/**
|
|
5570
5579
|
* How much to prioritize cost when selecting a model.
|
|
5571
5580
|
*/
|
|
5572
|
-
costPriority:
|
|
5581
|
+
costPriority: z5.optional(z5.number().min(0).max(1)),
|
|
5573
5582
|
/**
|
|
5574
5583
|
* How much to prioritize sampling speed (latency) when selecting a model.
|
|
5575
5584
|
*/
|
|
5576
|
-
speedPriority:
|
|
5585
|
+
speedPriority: z5.optional(z5.number().min(0).max(1)),
|
|
5577
5586
|
/**
|
|
5578
5587
|
* How much to prioritize intelligence and capabilities when selecting a model.
|
|
5579
5588
|
*/
|
|
5580
|
-
intelligencePriority:
|
|
5589
|
+
intelligencePriority: z5.optional(z5.number().min(0).max(1))
|
|
5581
5590
|
}).passthrough();
|
|
5582
|
-
SamplingMessageSchema =
|
|
5583
|
-
role:
|
|
5584
|
-
content:
|
|
5591
|
+
SamplingMessageSchema = z5.object({
|
|
5592
|
+
role: z5.enum(["user", "assistant"]),
|
|
5593
|
+
content: z5.union([TextContentSchema, ImageContentSchema, AudioContentSchema])
|
|
5585
5594
|
}).passthrough();
|
|
5586
5595
|
CreateMessageRequestSchema = RequestSchema.extend({
|
|
5587
|
-
method:
|
|
5596
|
+
method: z5.literal("sampling/createMessage"),
|
|
5588
5597
|
params: BaseRequestParamsSchema.extend({
|
|
5589
|
-
messages:
|
|
5598
|
+
messages: z5.array(SamplingMessageSchema),
|
|
5590
5599
|
/**
|
|
5591
5600
|
* An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt.
|
|
5592
5601
|
*/
|
|
5593
|
-
systemPrompt:
|
|
5602
|
+
systemPrompt: z5.optional(z5.string()),
|
|
5594
5603
|
/**
|
|
5595
5604
|
* A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request.
|
|
5596
5605
|
*/
|
|
5597
|
-
includeContext:
|
|
5598
|
-
temperature:
|
|
5606
|
+
includeContext: z5.optional(z5.enum(["none", "thisServer", "allServers"])),
|
|
5607
|
+
temperature: z5.optional(z5.number()),
|
|
5599
5608
|
/**
|
|
5600
5609
|
* The maximum number of tokens to sample, as requested by the server. The client MAY choose to sample fewer tokens than requested.
|
|
5601
5610
|
*/
|
|
5602
|
-
maxTokens:
|
|
5603
|
-
stopSequences:
|
|
5611
|
+
maxTokens: z5.number().int(),
|
|
5612
|
+
stopSequences: z5.optional(z5.array(z5.string())),
|
|
5604
5613
|
/**
|
|
5605
5614
|
* Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific.
|
|
5606
5615
|
*/
|
|
5607
|
-
metadata:
|
|
5616
|
+
metadata: z5.optional(z5.object({}).passthrough()),
|
|
5608
5617
|
/**
|
|
5609
5618
|
* The server's preferences for which model to select.
|
|
5610
5619
|
*/
|
|
5611
|
-
modelPreferences:
|
|
5620
|
+
modelPreferences: z5.optional(ModelPreferencesSchema)
|
|
5612
5621
|
})
|
|
5613
5622
|
});
|
|
5614
5623
|
CreateMessageResultSchema = ResultSchema.extend({
|
|
5615
5624
|
/**
|
|
5616
5625
|
* The name of the model that generated the message.
|
|
5617
5626
|
*/
|
|
5618
|
-
model:
|
|
5627
|
+
model: z5.string(),
|
|
5619
5628
|
/**
|
|
5620
5629
|
* The reason why sampling stopped.
|
|
5621
5630
|
*/
|
|
5622
|
-
stopReason:
|
|
5623
|
-
role:
|
|
5624
|
-
content:
|
|
5625
|
-
TextContentSchema,
|
|
5626
|
-
ImageContentSchema,
|
|
5627
|
-
AudioContentSchema
|
|
5628
|
-
])
|
|
5631
|
+
stopReason: z5.optional(z5.enum(["endTurn", "stopSequence", "maxTokens"]).or(z5.string())),
|
|
5632
|
+
role: z5.enum(["user", "assistant"]),
|
|
5633
|
+
content: z5.discriminatedUnion("type", [TextContentSchema, ImageContentSchema, AudioContentSchema])
|
|
5629
5634
|
});
|
|
5630
|
-
BooleanSchemaSchema =
|
|
5631
|
-
type:
|
|
5632
|
-
title:
|
|
5633
|
-
description:
|
|
5634
|
-
default:
|
|
5635
|
+
BooleanSchemaSchema = z5.object({
|
|
5636
|
+
type: z5.literal("boolean"),
|
|
5637
|
+
title: z5.optional(z5.string()),
|
|
5638
|
+
description: z5.optional(z5.string()),
|
|
5639
|
+
default: z5.optional(z5.boolean())
|
|
5635
5640
|
}).passthrough();
|
|
5636
|
-
StringSchemaSchema =
|
|
5637
|
-
type:
|
|
5638
|
-
title:
|
|
5639
|
-
description:
|
|
5640
|
-
minLength:
|
|
5641
|
-
maxLength:
|
|
5642
|
-
format:
|
|
5641
|
+
StringSchemaSchema = z5.object({
|
|
5642
|
+
type: z5.literal("string"),
|
|
5643
|
+
title: z5.optional(z5.string()),
|
|
5644
|
+
description: z5.optional(z5.string()),
|
|
5645
|
+
minLength: z5.optional(z5.number()),
|
|
5646
|
+
maxLength: z5.optional(z5.number()),
|
|
5647
|
+
format: z5.optional(z5.enum(["email", "uri", "date", "date-time"]))
|
|
5643
5648
|
}).passthrough();
|
|
5644
|
-
NumberSchemaSchema =
|
|
5645
|
-
type:
|
|
5646
|
-
title:
|
|
5647
|
-
description:
|
|
5648
|
-
minimum:
|
|
5649
|
-
maximum:
|
|
5649
|
+
NumberSchemaSchema = z5.object({
|
|
5650
|
+
type: z5.enum(["number", "integer"]),
|
|
5651
|
+
title: z5.optional(z5.string()),
|
|
5652
|
+
description: z5.optional(z5.string()),
|
|
5653
|
+
minimum: z5.optional(z5.number()),
|
|
5654
|
+
maximum: z5.optional(z5.number())
|
|
5650
5655
|
}).passthrough();
|
|
5651
|
-
EnumSchemaSchema =
|
|
5652
|
-
type:
|
|
5653
|
-
title:
|
|
5654
|
-
description:
|
|
5655
|
-
enum:
|
|
5656
|
-
enumNames:
|
|
5656
|
+
EnumSchemaSchema = z5.object({
|
|
5657
|
+
type: z5.literal("string"),
|
|
5658
|
+
title: z5.optional(z5.string()),
|
|
5659
|
+
description: z5.optional(z5.string()),
|
|
5660
|
+
enum: z5.array(z5.string()),
|
|
5661
|
+
enumNames: z5.optional(z5.array(z5.string()))
|
|
5657
5662
|
}).passthrough();
|
|
5658
|
-
PrimitiveSchemaDefinitionSchema =
|
|
5659
|
-
BooleanSchemaSchema,
|
|
5660
|
-
StringSchemaSchema,
|
|
5661
|
-
NumberSchemaSchema,
|
|
5662
|
-
EnumSchemaSchema
|
|
5663
|
-
]);
|
|
5663
|
+
PrimitiveSchemaDefinitionSchema = z5.union([BooleanSchemaSchema, StringSchemaSchema, NumberSchemaSchema, EnumSchemaSchema]);
|
|
5664
5664
|
ElicitRequestSchema = RequestSchema.extend({
|
|
5665
|
-
method:
|
|
5665
|
+
method: z5.literal("elicitation/create"),
|
|
5666
5666
|
params: BaseRequestParamsSchema.extend({
|
|
5667
5667
|
/**
|
|
5668
5668
|
* The message to present to the user.
|
|
5669
5669
|
*/
|
|
5670
|
-
message:
|
|
5670
|
+
message: z5.string(),
|
|
5671
5671
|
/**
|
|
5672
5672
|
* The schema for the requested user input.
|
|
5673
5673
|
*/
|
|
5674
|
-
requestedSchema:
|
|
5675
|
-
type:
|
|
5676
|
-
properties:
|
|
5677
|
-
required:
|
|
5674
|
+
requestedSchema: z5.object({
|
|
5675
|
+
type: z5.literal("object"),
|
|
5676
|
+
properties: z5.record(z5.string(), PrimitiveSchemaDefinitionSchema),
|
|
5677
|
+
required: z5.optional(z5.array(z5.string()))
|
|
5678
5678
|
}).passthrough()
|
|
5679
5679
|
})
|
|
5680
5680
|
});
|
|
@@ -5682,92 +5682,92 @@ var init_types2 = __esm({
|
|
|
5682
5682
|
/**
|
|
5683
5683
|
* The user's response action.
|
|
5684
5684
|
*/
|
|
5685
|
-
action:
|
|
5685
|
+
action: z5.enum(["accept", "decline", "cancel"]),
|
|
5686
5686
|
/**
|
|
5687
5687
|
* The collected user input content (only present if action is "accept").
|
|
5688
5688
|
*/
|
|
5689
|
-
content:
|
|
5689
|
+
content: z5.optional(z5.record(z5.string(), z5.unknown()))
|
|
5690
5690
|
});
|
|
5691
|
-
ResourceTemplateReferenceSchema =
|
|
5692
|
-
type:
|
|
5691
|
+
ResourceTemplateReferenceSchema = z5.object({
|
|
5692
|
+
type: z5.literal("ref/resource"),
|
|
5693
5693
|
/**
|
|
5694
5694
|
* The URI or URI template of the resource.
|
|
5695
5695
|
*/
|
|
5696
|
-
uri:
|
|
5696
|
+
uri: z5.string()
|
|
5697
5697
|
}).passthrough();
|
|
5698
|
-
PromptReferenceSchema =
|
|
5699
|
-
type:
|
|
5698
|
+
PromptReferenceSchema = z5.object({
|
|
5699
|
+
type: z5.literal("ref/prompt"),
|
|
5700
5700
|
/**
|
|
5701
5701
|
* The name of the prompt or prompt template
|
|
5702
5702
|
*/
|
|
5703
|
-
name:
|
|
5703
|
+
name: z5.string()
|
|
5704
5704
|
}).passthrough();
|
|
5705
5705
|
CompleteRequestSchema = RequestSchema.extend({
|
|
5706
|
-
method:
|
|
5706
|
+
method: z5.literal("completion/complete"),
|
|
5707
5707
|
params: BaseRequestParamsSchema.extend({
|
|
5708
|
-
ref:
|
|
5708
|
+
ref: z5.union([PromptReferenceSchema, ResourceTemplateReferenceSchema]),
|
|
5709
5709
|
/**
|
|
5710
5710
|
* The argument's information
|
|
5711
5711
|
*/
|
|
5712
|
-
argument:
|
|
5712
|
+
argument: z5.object({
|
|
5713
5713
|
/**
|
|
5714
5714
|
* The name of the argument
|
|
5715
5715
|
*/
|
|
5716
|
-
name:
|
|
5716
|
+
name: z5.string(),
|
|
5717
5717
|
/**
|
|
5718
5718
|
* The value of the argument to use for completion matching.
|
|
5719
5719
|
*/
|
|
5720
|
-
value:
|
|
5720
|
+
value: z5.string()
|
|
5721
5721
|
}).passthrough(),
|
|
5722
|
-
context:
|
|
5722
|
+
context: z5.optional(z5.object({
|
|
5723
5723
|
/**
|
|
5724
5724
|
* Previously-resolved variables in a URI template or prompt.
|
|
5725
5725
|
*/
|
|
5726
|
-
arguments:
|
|
5726
|
+
arguments: z5.optional(z5.record(z5.string(), z5.string()))
|
|
5727
5727
|
}))
|
|
5728
5728
|
})
|
|
5729
5729
|
});
|
|
5730
5730
|
CompleteResultSchema = ResultSchema.extend({
|
|
5731
|
-
completion:
|
|
5731
|
+
completion: z5.object({
|
|
5732
5732
|
/**
|
|
5733
5733
|
* An array of completion values. Must not exceed 100 items.
|
|
5734
5734
|
*/
|
|
5735
|
-
values:
|
|
5735
|
+
values: z5.array(z5.string()).max(100),
|
|
5736
5736
|
/**
|
|
5737
5737
|
* The total number of completion options available. This can exceed the number of values actually sent in the response.
|
|
5738
5738
|
*/
|
|
5739
|
-
total:
|
|
5739
|
+
total: z5.optional(z5.number().int()),
|
|
5740
5740
|
/**
|
|
5741
5741
|
* Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown.
|
|
5742
5742
|
*/
|
|
5743
|
-
hasMore:
|
|
5743
|
+
hasMore: z5.optional(z5.boolean())
|
|
5744
5744
|
}).passthrough()
|
|
5745
5745
|
});
|
|
5746
|
-
RootSchema =
|
|
5746
|
+
RootSchema = z5.object({
|
|
5747
5747
|
/**
|
|
5748
5748
|
* The URI identifying the root. This *must* start with file:// for now.
|
|
5749
5749
|
*/
|
|
5750
|
-
uri:
|
|
5750
|
+
uri: z5.string().startsWith("file://"),
|
|
5751
5751
|
/**
|
|
5752
5752
|
* An optional name for the root.
|
|
5753
5753
|
*/
|
|
5754
|
-
name:
|
|
5754
|
+
name: z5.optional(z5.string()),
|
|
5755
5755
|
/**
|
|
5756
5756
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
5757
5757
|
* for notes on _meta usage.
|
|
5758
5758
|
*/
|
|
5759
|
-
_meta:
|
|
5759
|
+
_meta: z5.optional(z5.object({}).passthrough())
|
|
5760
5760
|
}).passthrough();
|
|
5761
5761
|
ListRootsRequestSchema = RequestSchema.extend({
|
|
5762
|
-
method:
|
|
5762
|
+
method: z5.literal("roots/list")
|
|
5763
5763
|
});
|
|
5764
5764
|
ListRootsResultSchema = ResultSchema.extend({
|
|
5765
|
-
roots:
|
|
5765
|
+
roots: z5.array(RootSchema)
|
|
5766
5766
|
});
|
|
5767
5767
|
RootsListChangedNotificationSchema = NotificationSchema.extend({
|
|
5768
|
-
method:
|
|
5768
|
+
method: z5.literal("notifications/roots/list_changed")
|
|
5769
5769
|
});
|
|
5770
|
-
ClientRequestSchema =
|
|
5770
|
+
ClientRequestSchema = z5.union([
|
|
5771
5771
|
PingRequestSchema,
|
|
5772
5772
|
InitializeRequestSchema,
|
|
5773
5773
|
CompleteRequestSchema,
|
|
@@ -5782,25 +5782,15 @@ var init_types2 = __esm({
|
|
|
5782
5782
|
CallToolRequestSchema,
|
|
5783
5783
|
ListToolsRequestSchema
|
|
5784
5784
|
]);
|
|
5785
|
-
ClientNotificationSchema =
|
|
5785
|
+
ClientNotificationSchema = z5.union([
|
|
5786
5786
|
CancelledNotificationSchema,
|
|
5787
5787
|
ProgressNotificationSchema,
|
|
5788
5788
|
InitializedNotificationSchema,
|
|
5789
5789
|
RootsListChangedNotificationSchema
|
|
5790
5790
|
]);
|
|
5791
|
-
ClientResultSchema =
|
|
5792
|
-
|
|
5793
|
-
|
|
5794
|
-
ElicitResultSchema,
|
|
5795
|
-
ListRootsResultSchema
|
|
5796
|
-
]);
|
|
5797
|
-
ServerRequestSchema = z4.union([
|
|
5798
|
-
PingRequestSchema,
|
|
5799
|
-
CreateMessageRequestSchema,
|
|
5800
|
-
ElicitRequestSchema,
|
|
5801
|
-
ListRootsRequestSchema
|
|
5802
|
-
]);
|
|
5803
|
-
ServerNotificationSchema = z4.union([
|
|
5791
|
+
ClientResultSchema = z5.union([EmptyResultSchema, CreateMessageResultSchema, ElicitResultSchema, ListRootsResultSchema]);
|
|
5792
|
+
ServerRequestSchema = z5.union([PingRequestSchema, CreateMessageRequestSchema, ElicitRequestSchema, ListRootsRequestSchema]);
|
|
5793
|
+
ServerNotificationSchema = z5.union([
|
|
5804
5794
|
CancelledNotificationSchema,
|
|
5805
5795
|
ProgressNotificationSchema,
|
|
5806
5796
|
LoggingMessageNotificationSchema,
|
|
@@ -5809,7 +5799,7 @@ var init_types2 = __esm({
|
|
|
5809
5799
|
ToolListChangedNotificationSchema,
|
|
5810
5800
|
PromptListChangedNotificationSchema
|
|
5811
5801
|
]);
|
|
5812
|
-
ServerResultSchema =
|
|
5802
|
+
ServerResultSchema = z5.union([
|
|
5813
5803
|
EmptyResultSchema,
|
|
5814
5804
|
InitializeResultSchema,
|
|
5815
5805
|
CompleteResultSchema,
|
|
@@ -5824,9 +5814,9 @@ var init_types2 = __esm({
|
|
|
5824
5814
|
}
|
|
5825
5815
|
});
|
|
5826
5816
|
|
|
5827
|
-
// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
5817
|
+
// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.19.1/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js
|
|
5828
5818
|
var init_protocol = __esm({
|
|
5829
|
-
"../node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
5819
|
+
"../node_modules/.pnpm/@modelcontextprotocol+sdk@1.19.1/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js"() {
|
|
5830
5820
|
"use strict";
|
|
5831
5821
|
init_esm_shims();
|
|
5832
5822
|
init_types2();
|
|
@@ -6698,7 +6688,7 @@ var require_uri_all = __commonJS({
|
|
|
6698
6688
|
mailtoComponents.path = void 0;
|
|
6699
6689
|
if (mailtoComponents.query) {
|
|
6700
6690
|
var unknownHeaders = false;
|
|
6701
|
-
var
|
|
6691
|
+
var headers2 = {};
|
|
6702
6692
|
var hfields = mailtoComponents.query.split("&");
|
|
6703
6693
|
for (var x2 = 0, xl = hfields.length; x2 < xl; ++x2) {
|
|
6704
6694
|
var hfield = hfields[x2].split("=");
|
|
@@ -6717,11 +6707,11 @@ var require_uri_all = __commonJS({
|
|
|
6717
6707
|
break;
|
|
6718
6708
|
default:
|
|
6719
6709
|
unknownHeaders = true;
|
|
6720
|
-
|
|
6710
|
+
headers2[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options);
|
|
6721
6711
|
break;
|
|
6722
6712
|
}
|
|
6723
6713
|
}
|
|
6724
|
-
if (unknownHeaders) mailtoComponents.headers =
|
|
6714
|
+
if (unknownHeaders) mailtoComponents.headers = headers2;
|
|
6725
6715
|
}
|
|
6726
6716
|
mailtoComponents.query = void 0;
|
|
6727
6717
|
for (var _x2 = 0, _xl2 = to.length; _x2 < _xl2; ++_x2) {
|
|
@@ -6758,13 +6748,13 @@ var require_uri_all = __commonJS({
|
|
|
6758
6748
|
}
|
|
6759
6749
|
components.path = to.join(",");
|
|
6760
6750
|
}
|
|
6761
|
-
var
|
|
6762
|
-
if (mailtoComponents.subject)
|
|
6763
|
-
if (mailtoComponents.body)
|
|
6751
|
+
var headers2 = mailtoComponents.headers = mailtoComponents.headers || {};
|
|
6752
|
+
if (mailtoComponents.subject) headers2["subject"] = mailtoComponents.subject;
|
|
6753
|
+
if (mailtoComponents.body) headers2["body"] = mailtoComponents.body;
|
|
6764
6754
|
var fields = [];
|
|
6765
|
-
for (var name in
|
|
6766
|
-
if (
|
|
6767
|
-
fields.push(name.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) + "=" +
|
|
6755
|
+
for (var name in headers2) {
|
|
6756
|
+
if (headers2[name] !== O[name]) {
|
|
6757
|
+
fields.push(name.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) + "=" + headers2[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar));
|
|
6768
6758
|
}
|
|
6769
6759
|
}
|
|
6770
6760
|
if (fields.length) {
|
|
@@ -11755,33 +11745,33 @@ var require_ajv = __commonJS({
|
|
|
11755
11745
|
var rules = require_rules();
|
|
11756
11746
|
var $dataMetaSchema = require_data();
|
|
11757
11747
|
var util = require_util();
|
|
11758
|
-
module.exports =
|
|
11759
|
-
|
|
11760
|
-
|
|
11761
|
-
|
|
11762
|
-
|
|
11763
|
-
|
|
11764
|
-
|
|
11765
|
-
|
|
11766
|
-
|
|
11767
|
-
|
|
11768
|
-
|
|
11769
|
-
|
|
11770
|
-
|
|
11748
|
+
module.exports = Ajv4;
|
|
11749
|
+
Ajv4.prototype.validate = validate;
|
|
11750
|
+
Ajv4.prototype.compile = compile;
|
|
11751
|
+
Ajv4.prototype.addSchema = addSchema;
|
|
11752
|
+
Ajv4.prototype.addMetaSchema = addMetaSchema;
|
|
11753
|
+
Ajv4.prototype.validateSchema = validateSchema;
|
|
11754
|
+
Ajv4.prototype.getSchema = getSchema;
|
|
11755
|
+
Ajv4.prototype.removeSchema = removeSchema;
|
|
11756
|
+
Ajv4.prototype.addFormat = addFormat;
|
|
11757
|
+
Ajv4.prototype.errorsText = errorsText;
|
|
11758
|
+
Ajv4.prototype._addSchema = _addSchema;
|
|
11759
|
+
Ajv4.prototype._compile = _compile;
|
|
11760
|
+
Ajv4.prototype.compileAsync = require_async();
|
|
11771
11761
|
var customKeyword = require_keyword();
|
|
11772
|
-
|
|
11773
|
-
|
|
11774
|
-
|
|
11775
|
-
|
|
11762
|
+
Ajv4.prototype.addKeyword = customKeyword.add;
|
|
11763
|
+
Ajv4.prototype.getKeyword = customKeyword.get;
|
|
11764
|
+
Ajv4.prototype.removeKeyword = customKeyword.remove;
|
|
11765
|
+
Ajv4.prototype.validateKeyword = customKeyword.validate;
|
|
11776
11766
|
var errorClasses = require_error_classes();
|
|
11777
|
-
|
|
11778
|
-
|
|
11779
|
-
|
|
11767
|
+
Ajv4.ValidationError = errorClasses.Validation;
|
|
11768
|
+
Ajv4.MissingRefError = errorClasses.MissingRef;
|
|
11769
|
+
Ajv4.$dataMetaSchema = $dataMetaSchema;
|
|
11780
11770
|
var META_SCHEMA_ID = "http://json-schema.org/draft-07/schema";
|
|
11781
11771
|
var META_IGNORE_OPTIONS = ["removeAdditional", "useDefaults", "coerceTypes", "strictDefaults"];
|
|
11782
11772
|
var META_SUPPORT_DATA = ["/properties"];
|
|
11783
|
-
function
|
|
11784
|
-
if (!(this instanceof
|
|
11773
|
+
function Ajv4(opts) {
|
|
11774
|
+
if (!(this instanceof Ajv4)) return new Ajv4(opts);
|
|
11785
11775
|
opts = this._opts = util.copy(opts) || {};
|
|
11786
11776
|
setLogger(this);
|
|
11787
11777
|
this._schemas = {};
|
|
@@ -12079,14 +12069,14 @@ var require_ajv = __commonJS({
|
|
|
12079
12069
|
return metaOpts;
|
|
12080
12070
|
}
|
|
12081
12071
|
function setLogger(self) {
|
|
12082
|
-
var
|
|
12083
|
-
if (
|
|
12072
|
+
var logger14 = self._opts.logger;
|
|
12073
|
+
if (logger14 === false) {
|
|
12084
12074
|
self.logger = { log: noop, warn: noop, error: noop };
|
|
12085
12075
|
} else {
|
|
12086
|
-
if (
|
|
12087
|
-
if (!(typeof
|
|
12076
|
+
if (logger14 === void 0) logger14 = console;
|
|
12077
|
+
if (!(typeof logger14 == "object" && logger14.log && logger14.warn && logger14.error))
|
|
12088
12078
|
throw new Error("logger must implement log, warn and error methods");
|
|
12089
|
-
self.logger =
|
|
12079
|
+
self.logger = logger14;
|
|
12090
12080
|
}
|
|
12091
12081
|
}
|
|
12092
12082
|
function noop() {
|
|
@@ -12094,10 +12084,10 @@ var require_ajv = __commonJS({
|
|
|
12094
12084
|
}
|
|
12095
12085
|
});
|
|
12096
12086
|
|
|
12097
|
-
// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
12087
|
+
// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.19.1/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js
|
|
12098
12088
|
var import_ajv;
|
|
12099
12089
|
var init_client2 = __esm({
|
|
12100
|
-
"../node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
12090
|
+
"../node_modules/.pnpm/@modelcontextprotocol+sdk@1.19.1/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js"() {
|
|
12101
12091
|
"use strict";
|
|
12102
12092
|
init_esm_shims();
|
|
12103
12093
|
init_protocol();
|
|
@@ -12118,164 +12108,164 @@ var init_index_node = __esm({
|
|
|
12118
12108
|
}
|
|
12119
12109
|
});
|
|
12120
12110
|
|
|
12121
|
-
// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
12122
|
-
import { z as
|
|
12111
|
+
// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.19.1/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js
|
|
12112
|
+
import { z as z6 } from "zod";
|
|
12123
12113
|
var SafeUrlSchema, OAuthProtectedResourceMetadataSchema, OAuthMetadataSchema, OpenIdProviderMetadataSchema, OpenIdProviderDiscoveryMetadataSchema, OAuthTokensSchema, OAuthErrorResponseSchema, OAuthClientMetadataSchema, OAuthClientInformationSchema, OAuthClientInformationFullSchema, OAuthClientRegistrationErrorSchema, OAuthTokenRevocationRequestSchema;
|
|
12124
12114
|
var init_auth = __esm({
|
|
12125
|
-
"../node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
12115
|
+
"../node_modules/.pnpm/@modelcontextprotocol+sdk@1.19.1/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js"() {
|
|
12126
12116
|
"use strict";
|
|
12127
12117
|
init_esm_shims();
|
|
12128
|
-
SafeUrlSchema =
|
|
12118
|
+
SafeUrlSchema = z6.string().url().superRefine((val, ctx) => {
|
|
12129
12119
|
if (!URL.canParse(val)) {
|
|
12130
12120
|
ctx.addIssue({
|
|
12131
|
-
code:
|
|
12121
|
+
code: z6.ZodIssueCode.custom,
|
|
12132
12122
|
message: "URL must be parseable",
|
|
12133
12123
|
fatal: true
|
|
12134
12124
|
});
|
|
12135
|
-
return
|
|
12125
|
+
return z6.NEVER;
|
|
12136
12126
|
}
|
|
12137
12127
|
}).refine((url) => {
|
|
12138
12128
|
const u2 = new URL(url);
|
|
12139
12129
|
return u2.protocol !== "javascript:" && u2.protocol !== "data:" && u2.protocol !== "vbscript:";
|
|
12140
12130
|
}, { message: "URL cannot use javascript:, data:, or vbscript: scheme" });
|
|
12141
|
-
OAuthProtectedResourceMetadataSchema =
|
|
12142
|
-
resource:
|
|
12143
|
-
authorization_servers:
|
|
12144
|
-
jwks_uri:
|
|
12145
|
-
scopes_supported:
|
|
12146
|
-
bearer_methods_supported:
|
|
12147
|
-
resource_signing_alg_values_supported:
|
|
12148
|
-
resource_name:
|
|
12149
|
-
resource_documentation:
|
|
12150
|
-
resource_policy_uri:
|
|
12151
|
-
resource_tos_uri:
|
|
12152
|
-
tls_client_certificate_bound_access_tokens:
|
|
12153
|
-
authorization_details_types_supported:
|
|
12154
|
-
dpop_signing_alg_values_supported:
|
|
12155
|
-
dpop_bound_access_tokens_required:
|
|
12131
|
+
OAuthProtectedResourceMetadataSchema = z6.object({
|
|
12132
|
+
resource: z6.string().url(),
|
|
12133
|
+
authorization_servers: z6.array(SafeUrlSchema).optional(),
|
|
12134
|
+
jwks_uri: z6.string().url().optional(),
|
|
12135
|
+
scopes_supported: z6.array(z6.string()).optional(),
|
|
12136
|
+
bearer_methods_supported: z6.array(z6.string()).optional(),
|
|
12137
|
+
resource_signing_alg_values_supported: z6.array(z6.string()).optional(),
|
|
12138
|
+
resource_name: z6.string().optional(),
|
|
12139
|
+
resource_documentation: z6.string().optional(),
|
|
12140
|
+
resource_policy_uri: z6.string().url().optional(),
|
|
12141
|
+
resource_tos_uri: z6.string().url().optional(),
|
|
12142
|
+
tls_client_certificate_bound_access_tokens: z6.boolean().optional(),
|
|
12143
|
+
authorization_details_types_supported: z6.array(z6.string()).optional(),
|
|
12144
|
+
dpop_signing_alg_values_supported: z6.array(z6.string()).optional(),
|
|
12145
|
+
dpop_bound_access_tokens_required: z6.boolean().optional()
|
|
12156
12146
|
}).passthrough();
|
|
12157
|
-
OAuthMetadataSchema =
|
|
12158
|
-
issuer:
|
|
12147
|
+
OAuthMetadataSchema = z6.object({
|
|
12148
|
+
issuer: z6.string(),
|
|
12159
12149
|
authorization_endpoint: SafeUrlSchema,
|
|
12160
12150
|
token_endpoint: SafeUrlSchema,
|
|
12161
12151
|
registration_endpoint: SafeUrlSchema.optional(),
|
|
12162
|
-
scopes_supported:
|
|
12163
|
-
response_types_supported:
|
|
12164
|
-
response_modes_supported:
|
|
12165
|
-
grant_types_supported:
|
|
12166
|
-
token_endpoint_auth_methods_supported:
|
|
12167
|
-
token_endpoint_auth_signing_alg_values_supported:
|
|
12152
|
+
scopes_supported: z6.array(z6.string()).optional(),
|
|
12153
|
+
response_types_supported: z6.array(z6.string()),
|
|
12154
|
+
response_modes_supported: z6.array(z6.string()).optional(),
|
|
12155
|
+
grant_types_supported: z6.array(z6.string()).optional(),
|
|
12156
|
+
token_endpoint_auth_methods_supported: z6.array(z6.string()).optional(),
|
|
12157
|
+
token_endpoint_auth_signing_alg_values_supported: z6.array(z6.string()).optional(),
|
|
12168
12158
|
service_documentation: SafeUrlSchema.optional(),
|
|
12169
12159
|
revocation_endpoint: SafeUrlSchema.optional(),
|
|
12170
|
-
revocation_endpoint_auth_methods_supported:
|
|
12171
|
-
revocation_endpoint_auth_signing_alg_values_supported:
|
|
12172
|
-
introspection_endpoint:
|
|
12173
|
-
introspection_endpoint_auth_methods_supported:
|
|
12174
|
-
introspection_endpoint_auth_signing_alg_values_supported:
|
|
12175
|
-
code_challenge_methods_supported:
|
|
12160
|
+
revocation_endpoint_auth_methods_supported: z6.array(z6.string()).optional(),
|
|
12161
|
+
revocation_endpoint_auth_signing_alg_values_supported: z6.array(z6.string()).optional(),
|
|
12162
|
+
introspection_endpoint: z6.string().optional(),
|
|
12163
|
+
introspection_endpoint_auth_methods_supported: z6.array(z6.string()).optional(),
|
|
12164
|
+
introspection_endpoint_auth_signing_alg_values_supported: z6.array(z6.string()).optional(),
|
|
12165
|
+
code_challenge_methods_supported: z6.array(z6.string()).optional()
|
|
12176
12166
|
}).passthrough();
|
|
12177
|
-
OpenIdProviderMetadataSchema =
|
|
12178
|
-
issuer:
|
|
12167
|
+
OpenIdProviderMetadataSchema = z6.object({
|
|
12168
|
+
issuer: z6.string(),
|
|
12179
12169
|
authorization_endpoint: SafeUrlSchema,
|
|
12180
12170
|
token_endpoint: SafeUrlSchema,
|
|
12181
12171
|
userinfo_endpoint: SafeUrlSchema.optional(),
|
|
12182
12172
|
jwks_uri: SafeUrlSchema,
|
|
12183
12173
|
registration_endpoint: SafeUrlSchema.optional(),
|
|
12184
|
-
scopes_supported:
|
|
12185
|
-
response_types_supported:
|
|
12186
|
-
response_modes_supported:
|
|
12187
|
-
grant_types_supported:
|
|
12188
|
-
acr_values_supported:
|
|
12189
|
-
subject_types_supported:
|
|
12190
|
-
id_token_signing_alg_values_supported:
|
|
12191
|
-
id_token_encryption_alg_values_supported:
|
|
12192
|
-
id_token_encryption_enc_values_supported:
|
|
12193
|
-
userinfo_signing_alg_values_supported:
|
|
12194
|
-
userinfo_encryption_alg_values_supported:
|
|
12195
|
-
userinfo_encryption_enc_values_supported:
|
|
12196
|
-
request_object_signing_alg_values_supported:
|
|
12197
|
-
request_object_encryption_alg_values_supported:
|
|
12198
|
-
request_object_encryption_enc_values_supported:
|
|
12199
|
-
token_endpoint_auth_methods_supported:
|
|
12200
|
-
token_endpoint_auth_signing_alg_values_supported:
|
|
12201
|
-
display_values_supported:
|
|
12202
|
-
claim_types_supported:
|
|
12203
|
-
claims_supported:
|
|
12204
|
-
service_documentation:
|
|
12205
|
-
claims_locales_supported:
|
|
12206
|
-
ui_locales_supported:
|
|
12207
|
-
claims_parameter_supported:
|
|
12208
|
-
request_parameter_supported:
|
|
12209
|
-
request_uri_parameter_supported:
|
|
12210
|
-
require_request_uri_registration:
|
|
12174
|
+
scopes_supported: z6.array(z6.string()).optional(),
|
|
12175
|
+
response_types_supported: z6.array(z6.string()),
|
|
12176
|
+
response_modes_supported: z6.array(z6.string()).optional(),
|
|
12177
|
+
grant_types_supported: z6.array(z6.string()).optional(),
|
|
12178
|
+
acr_values_supported: z6.array(z6.string()).optional(),
|
|
12179
|
+
subject_types_supported: z6.array(z6.string()),
|
|
12180
|
+
id_token_signing_alg_values_supported: z6.array(z6.string()),
|
|
12181
|
+
id_token_encryption_alg_values_supported: z6.array(z6.string()).optional(),
|
|
12182
|
+
id_token_encryption_enc_values_supported: z6.array(z6.string()).optional(),
|
|
12183
|
+
userinfo_signing_alg_values_supported: z6.array(z6.string()).optional(),
|
|
12184
|
+
userinfo_encryption_alg_values_supported: z6.array(z6.string()).optional(),
|
|
12185
|
+
userinfo_encryption_enc_values_supported: z6.array(z6.string()).optional(),
|
|
12186
|
+
request_object_signing_alg_values_supported: z6.array(z6.string()).optional(),
|
|
12187
|
+
request_object_encryption_alg_values_supported: z6.array(z6.string()).optional(),
|
|
12188
|
+
request_object_encryption_enc_values_supported: z6.array(z6.string()).optional(),
|
|
12189
|
+
token_endpoint_auth_methods_supported: z6.array(z6.string()).optional(),
|
|
12190
|
+
token_endpoint_auth_signing_alg_values_supported: z6.array(z6.string()).optional(),
|
|
12191
|
+
display_values_supported: z6.array(z6.string()).optional(),
|
|
12192
|
+
claim_types_supported: z6.array(z6.string()).optional(),
|
|
12193
|
+
claims_supported: z6.array(z6.string()).optional(),
|
|
12194
|
+
service_documentation: z6.string().optional(),
|
|
12195
|
+
claims_locales_supported: z6.array(z6.string()).optional(),
|
|
12196
|
+
ui_locales_supported: z6.array(z6.string()).optional(),
|
|
12197
|
+
claims_parameter_supported: z6.boolean().optional(),
|
|
12198
|
+
request_parameter_supported: z6.boolean().optional(),
|
|
12199
|
+
request_uri_parameter_supported: z6.boolean().optional(),
|
|
12200
|
+
require_request_uri_registration: z6.boolean().optional(),
|
|
12211
12201
|
op_policy_uri: SafeUrlSchema.optional(),
|
|
12212
12202
|
op_tos_uri: SafeUrlSchema.optional()
|
|
12213
12203
|
}).passthrough();
|
|
12214
12204
|
OpenIdProviderDiscoveryMetadataSchema = OpenIdProviderMetadataSchema.merge(OAuthMetadataSchema.pick({
|
|
12215
12205
|
code_challenge_methods_supported: true
|
|
12216
12206
|
}));
|
|
12217
|
-
OAuthTokensSchema =
|
|
12218
|
-
access_token:
|
|
12219
|
-
id_token:
|
|
12207
|
+
OAuthTokensSchema = z6.object({
|
|
12208
|
+
access_token: z6.string(),
|
|
12209
|
+
id_token: z6.string().optional(),
|
|
12220
12210
|
// Optional for OAuth 2.1, but necessary in OpenID Connect
|
|
12221
|
-
token_type:
|
|
12222
|
-
expires_in:
|
|
12223
|
-
scope:
|
|
12224
|
-
refresh_token:
|
|
12211
|
+
token_type: z6.string(),
|
|
12212
|
+
expires_in: z6.number().optional(),
|
|
12213
|
+
scope: z6.string().optional(),
|
|
12214
|
+
refresh_token: z6.string().optional()
|
|
12225
12215
|
}).strip();
|
|
12226
|
-
OAuthErrorResponseSchema =
|
|
12227
|
-
error:
|
|
12228
|
-
error_description:
|
|
12229
|
-
error_uri:
|
|
12216
|
+
OAuthErrorResponseSchema = z6.object({
|
|
12217
|
+
error: z6.string(),
|
|
12218
|
+
error_description: z6.string().optional(),
|
|
12219
|
+
error_uri: z6.string().optional()
|
|
12230
12220
|
});
|
|
12231
|
-
OAuthClientMetadataSchema =
|
|
12232
|
-
redirect_uris:
|
|
12233
|
-
token_endpoint_auth_method:
|
|
12234
|
-
grant_types:
|
|
12235
|
-
response_types:
|
|
12236
|
-
client_name:
|
|
12221
|
+
OAuthClientMetadataSchema = z6.object({
|
|
12222
|
+
redirect_uris: z6.array(SafeUrlSchema),
|
|
12223
|
+
token_endpoint_auth_method: z6.string().optional(),
|
|
12224
|
+
grant_types: z6.array(z6.string()).optional(),
|
|
12225
|
+
response_types: z6.array(z6.string()).optional(),
|
|
12226
|
+
client_name: z6.string().optional(),
|
|
12237
12227
|
client_uri: SafeUrlSchema.optional(),
|
|
12238
12228
|
logo_uri: SafeUrlSchema.optional(),
|
|
12239
|
-
scope:
|
|
12240
|
-
contacts:
|
|
12229
|
+
scope: z6.string().optional(),
|
|
12230
|
+
contacts: z6.array(z6.string()).optional(),
|
|
12241
12231
|
tos_uri: SafeUrlSchema.optional(),
|
|
12242
|
-
policy_uri:
|
|
12232
|
+
policy_uri: z6.string().optional(),
|
|
12243
12233
|
jwks_uri: SafeUrlSchema.optional(),
|
|
12244
|
-
jwks:
|
|
12245
|
-
software_id:
|
|
12246
|
-
software_version:
|
|
12247
|
-
software_statement:
|
|
12234
|
+
jwks: z6.any().optional(),
|
|
12235
|
+
software_id: z6.string().optional(),
|
|
12236
|
+
software_version: z6.string().optional(),
|
|
12237
|
+
software_statement: z6.string().optional()
|
|
12248
12238
|
}).strip();
|
|
12249
|
-
OAuthClientInformationSchema =
|
|
12250
|
-
client_id:
|
|
12251
|
-
client_secret:
|
|
12252
|
-
client_id_issued_at:
|
|
12253
|
-
client_secret_expires_at:
|
|
12239
|
+
OAuthClientInformationSchema = z6.object({
|
|
12240
|
+
client_id: z6.string(),
|
|
12241
|
+
client_secret: z6.string().optional(),
|
|
12242
|
+
client_id_issued_at: z6.number().optional(),
|
|
12243
|
+
client_secret_expires_at: z6.number().optional()
|
|
12254
12244
|
}).strip();
|
|
12255
12245
|
OAuthClientInformationFullSchema = OAuthClientMetadataSchema.merge(OAuthClientInformationSchema);
|
|
12256
|
-
OAuthClientRegistrationErrorSchema =
|
|
12257
|
-
error:
|
|
12258
|
-
error_description:
|
|
12246
|
+
OAuthClientRegistrationErrorSchema = z6.object({
|
|
12247
|
+
error: z6.string(),
|
|
12248
|
+
error_description: z6.string().optional()
|
|
12259
12249
|
}).strip();
|
|
12260
|
-
OAuthTokenRevocationRequestSchema =
|
|
12261
|
-
token:
|
|
12262
|
-
token_type_hint:
|
|
12250
|
+
OAuthTokenRevocationRequestSchema = z6.object({
|
|
12251
|
+
token: z6.string(),
|
|
12252
|
+
token_type_hint: z6.string().optional()
|
|
12263
12253
|
}).strip();
|
|
12264
12254
|
}
|
|
12265
12255
|
});
|
|
12266
12256
|
|
|
12267
|
-
// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
12257
|
+
// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.19.1/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth-utils.js
|
|
12268
12258
|
var init_auth_utils = __esm({
|
|
12269
|
-
"../node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
12259
|
+
"../node_modules/.pnpm/@modelcontextprotocol+sdk@1.19.1/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth-utils.js"() {
|
|
12270
12260
|
"use strict";
|
|
12271
12261
|
init_esm_shims();
|
|
12272
12262
|
}
|
|
12273
12263
|
});
|
|
12274
12264
|
|
|
12275
|
-
// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
12265
|
+
// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.19.1/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/errors.js
|
|
12276
12266
|
var OAuthError, InvalidRequestError, InvalidClientError, InvalidGrantError, UnauthorizedClientError, UnsupportedGrantTypeError, InvalidScopeError, AccessDeniedError, ServerError, TemporarilyUnavailableError, UnsupportedResponseTypeError, UnsupportedTokenTypeError, InvalidTokenError, MethodNotAllowedError, TooManyRequestsError, InvalidClientMetadataError, InsufficientScopeError, OAUTH_ERRORS;
|
|
12277
12267
|
var init_errors = __esm({
|
|
12278
|
-
"../node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
12268
|
+
"../node_modules/.pnpm/@modelcontextprotocol+sdk@1.19.1/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/errors.js"() {
|
|
12279
12269
|
"use strict";
|
|
12280
12270
|
init_esm_shims();
|
|
12281
12271
|
OAuthError = class extends Error {
|
|
@@ -12370,9 +12360,9 @@ var init_errors = __esm({
|
|
|
12370
12360
|
}
|
|
12371
12361
|
});
|
|
12372
12362
|
|
|
12373
|
-
// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
12363
|
+
// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.19.1/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.js
|
|
12374
12364
|
var init_auth2 = __esm({
|
|
12375
|
-
"../node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
12365
|
+
"../node_modules/.pnpm/@modelcontextprotocol+sdk@1.19.1/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.js"() {
|
|
12376
12366
|
"use strict";
|
|
12377
12367
|
init_esm_shims();
|
|
12378
12368
|
init_index_node();
|
|
@@ -12384,9 +12374,9 @@ var init_auth2 = __esm({
|
|
|
12384
12374
|
}
|
|
12385
12375
|
});
|
|
12386
12376
|
|
|
12387
|
-
// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
12377
|
+
// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.19.1/node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.js
|
|
12388
12378
|
var init_sse = __esm({
|
|
12389
|
-
"../node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
12379
|
+
"../node_modules/.pnpm/@modelcontextprotocol+sdk@1.19.1/node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.js"() {
|
|
12390
12380
|
"use strict";
|
|
12391
12381
|
init_esm_shims();
|
|
12392
12382
|
init_types2();
|
|
@@ -12394,9 +12384,9 @@ var init_sse = __esm({
|
|
|
12394
12384
|
}
|
|
12395
12385
|
});
|
|
12396
12386
|
|
|
12397
|
-
// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
12387
|
+
// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.19.1/node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.js
|
|
12398
12388
|
var init_streamableHttp = __esm({
|
|
12399
|
-
"../node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
12389
|
+
"../node_modules/.pnpm/@modelcontextprotocol+sdk@1.19.1/node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.js"() {
|
|
12400
12390
|
"use strict";
|
|
12401
12391
|
init_esm_shims();
|
|
12402
12392
|
init_types2();
|
|
@@ -12548,7 +12538,7 @@ var init_dist5 = __esm({
|
|
|
12548
12538
|
|
|
12549
12539
|
// ../packages/agents-core/src/utils/mcp-client.ts
|
|
12550
12540
|
import { tool } from "ai";
|
|
12551
|
-
import { z as
|
|
12541
|
+
import { z as z8 } from "zod";
|
|
12552
12542
|
var init_mcp_client = __esm({
|
|
12553
12543
|
"../packages/agents-core/src/utils/mcp-client.ts"() {
|
|
12554
12544
|
"use strict";
|
|
@@ -12731,12 +12721,12 @@ var init_global_utils = __esm({
|
|
|
12731
12721
|
|
|
12732
12722
|
// ../node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/diag/ComponentLogger.js
|
|
12733
12723
|
function logProxy(funcName, namespace, args) {
|
|
12734
|
-
var
|
|
12735
|
-
if (!
|
|
12724
|
+
var logger14 = getGlobal("diag");
|
|
12725
|
+
if (!logger14) {
|
|
12736
12726
|
return;
|
|
12737
12727
|
}
|
|
12738
12728
|
args.unshift(namespace);
|
|
12739
|
-
return
|
|
12729
|
+
return logger14[funcName].apply(logger14, __spreadArray([], __read(args), false));
|
|
12740
12730
|
}
|
|
12741
12731
|
var __read, __spreadArray, DiagComponentLogger;
|
|
12742
12732
|
var init_ComponentLogger = __esm({
|
|
@@ -12834,17 +12824,17 @@ var init_types3 = __esm({
|
|
|
12834
12824
|
});
|
|
12835
12825
|
|
|
12836
12826
|
// ../node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/diag/internal/logLevelLogger.js
|
|
12837
|
-
function createLogLevelDiagLogger(maxLevel,
|
|
12827
|
+
function createLogLevelDiagLogger(maxLevel, logger14) {
|
|
12838
12828
|
if (maxLevel < DiagLogLevel.NONE) {
|
|
12839
12829
|
maxLevel = DiagLogLevel.NONE;
|
|
12840
12830
|
} else if (maxLevel > DiagLogLevel.ALL) {
|
|
12841
12831
|
maxLevel = DiagLogLevel.ALL;
|
|
12842
12832
|
}
|
|
12843
|
-
|
|
12833
|
+
logger14 = logger14 || {};
|
|
12844
12834
|
function _filterFunc(funcName, theLevel) {
|
|
12845
|
-
var theFunc =
|
|
12835
|
+
var theFunc = logger14[funcName];
|
|
12846
12836
|
if (typeof theFunc === "function" && maxLevel >= theLevel) {
|
|
12847
|
-
return theFunc.bind(
|
|
12837
|
+
return theFunc.bind(logger14);
|
|
12848
12838
|
}
|
|
12849
12839
|
return function() {
|
|
12850
12840
|
};
|
|
@@ -12911,19 +12901,19 @@ var init_diag = __esm({
|
|
|
12911
12901
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
12912
12902
|
args[_i] = arguments[_i];
|
|
12913
12903
|
}
|
|
12914
|
-
var
|
|
12915
|
-
if (!
|
|
12904
|
+
var logger14 = getGlobal("diag");
|
|
12905
|
+
if (!logger14)
|
|
12916
12906
|
return;
|
|
12917
|
-
return
|
|
12907
|
+
return logger14[funcName].apply(logger14, __spreadArray2([], __read2(args), false));
|
|
12918
12908
|
};
|
|
12919
12909
|
}
|
|
12920
12910
|
var self = this;
|
|
12921
|
-
var setLogger = function(
|
|
12911
|
+
var setLogger = function(logger14, optionsOrLogLevel) {
|
|
12922
12912
|
var _a, _b, _c;
|
|
12923
12913
|
if (optionsOrLogLevel === void 0) {
|
|
12924
12914
|
optionsOrLogLevel = { logLevel: DiagLogLevel.INFO };
|
|
12925
12915
|
}
|
|
12926
|
-
if (
|
|
12916
|
+
if (logger14 === self) {
|
|
12927
12917
|
var err = new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");
|
|
12928
12918
|
self.error((_a = err.stack) !== null && _a !== void 0 ? _a : err.message);
|
|
12929
12919
|
return false;
|
|
@@ -12934,7 +12924,7 @@ var init_diag = __esm({
|
|
|
12934
12924
|
};
|
|
12935
12925
|
}
|
|
12936
12926
|
var oldLogger = getGlobal("diag");
|
|
12937
|
-
var newLogger = createLogLevelDiagLogger((_b = optionsOrLogLevel.logLevel) !== null && _b !== void 0 ? _b : DiagLogLevel.INFO,
|
|
12927
|
+
var newLogger = createLogLevelDiagLogger((_b = optionsOrLogLevel.logLevel) !== null && _b !== void 0 ? _b : DiagLogLevel.INFO, logger14);
|
|
12938
12928
|
if (oldLogger && !optionsOrLogLevel.suppressOverrideMessage) {
|
|
12939
12929
|
var stack = (_c = new Error().stack) !== null && _c !== void 0 ? _c : "<failed to generate stacktrace>";
|
|
12940
12930
|
oldLogger.warn("Current logger will be overwritten from " + stack);
|
|
@@ -13503,18 +13493,18 @@ function getTracer(serviceName, serviceVersion) {
|
|
|
13503
13493
|
try {
|
|
13504
13494
|
return trace.getTracer(serviceName, serviceVersion);
|
|
13505
13495
|
} catch (_error) {
|
|
13506
|
-
|
|
13496
|
+
logger5.debug({}, "OpenTelemetry tracer not available, using no-op tracer");
|
|
13507
13497
|
return noopTracer;
|
|
13508
13498
|
}
|
|
13509
13499
|
}
|
|
13510
|
-
var
|
|
13500
|
+
var logger5, createNoOpSpan, noopTracer;
|
|
13511
13501
|
var init_tracer_factory = __esm({
|
|
13512
13502
|
"../packages/agents-core/src/utils/tracer-factory.ts"() {
|
|
13513
13503
|
"use strict";
|
|
13514
13504
|
init_esm_shims();
|
|
13515
13505
|
init_esm();
|
|
13516
13506
|
init_utils();
|
|
13517
|
-
|
|
13507
|
+
logger5 = getLogger("tracer");
|
|
13518
13508
|
createNoOpSpan = () => ({
|
|
13519
13509
|
setAttributes: () => ({}),
|
|
13520
13510
|
recordException: () => ({}),
|
|
@@ -13552,148 +13542,72 @@ var init_utils = __esm({
|
|
|
13552
13542
|
"use strict";
|
|
13553
13543
|
init_esm_shims();
|
|
13554
13544
|
init_apiKeys();
|
|
13555
|
-
init_auth_detection();
|
|
13556
|
-
init_conversations();
|
|
13557
|
-
init_credential_store_utils();
|
|
13558
|
-
init_error();
|
|
13559
|
-
init_execution();
|
|
13560
|
-
init_logger();
|
|
13561
|
-
init_mcp_client();
|
|
13562
|
-
|
|
13563
|
-
|
|
13564
|
-
});
|
|
13565
|
-
|
|
13566
|
-
// ../packages/agents-core/src/data-access/tools.ts
|
|
13567
|
-
import { and as and12, count as count11, desc as desc11, eq as eq12 } from "drizzle-orm";
|
|
13568
|
-
var logger5;
|
|
13569
|
-
var init_tools = __esm({
|
|
13570
|
-
"../packages/agents-core/src/data-access/tools.ts"() {
|
|
13571
|
-
"use strict";
|
|
13572
|
-
init_esm_shims();
|
|
13573
|
-
init_context5();
|
|
13574
|
-
init_credential_stuffer();
|
|
13575
|
-
init_schema();
|
|
13576
|
-
init_types();
|
|
13577
|
-
init_utils();
|
|
13578
|
-
init_logger();
|
|
13579
|
-
init_mcp_client();
|
|
13580
|
-
init_agentRelations();
|
|
13581
|
-
init_credentialReferences();
|
|
13582
|
-
logger5 = getLogger("tools");
|
|
13583
|
-
}
|
|
13584
|
-
});
|
|
13585
|
-
|
|
13586
|
-
// ../packages/agents-core/src/data-access/graphFull.ts
|
|
13587
|
-
import { and as and13, eq as eq13, inArray as inArray3, not } from "drizzle-orm";
|
|
13588
|
-
var init_graphFull2 = __esm({
|
|
13589
|
-
"../packages/agents-core/src/data-access/graphFull.ts"() {
|
|
13590
|
-
"use strict";
|
|
13591
|
-
init_esm_shims();
|
|
13592
|
-
init_schema();
|
|
13593
|
-
init_graphFull();
|
|
13594
|
-
init_agentGraphs();
|
|
13595
|
-
init_agentRelations();
|
|
13596
|
-
init_agents();
|
|
13597
|
-
init_artifactComponents();
|
|
13598
|
-
init_contextConfigs();
|
|
13599
|
-
init_dataComponents();
|
|
13600
|
-
init_externalAgents();
|
|
13601
|
-
init_tools();
|
|
13602
|
-
}
|
|
13603
|
-
});
|
|
13604
|
-
|
|
13605
|
-
// ../packages/agents-core/src/data-access/ledgerArtifacts.ts
|
|
13606
|
-
import { and as and14, count as count12, eq as eq14 } from "drizzle-orm";
|
|
13607
|
-
var init_ledgerArtifacts = __esm({
|
|
13608
|
-
"../packages/agents-core/src/data-access/ledgerArtifacts.ts"() {
|
|
13609
|
-
"use strict";
|
|
13610
|
-
init_esm_shims();
|
|
13611
|
-
init_schema();
|
|
13612
|
-
}
|
|
13613
|
-
});
|
|
13614
|
-
|
|
13615
|
-
// ../packages/agents-core/src/data-access/messages.ts
|
|
13616
|
-
import { and as and15, asc as asc2, count as count13, desc as desc12, eq as eq15, inArray as inArray4 } from "drizzle-orm";
|
|
13617
|
-
var init_messages = __esm({
|
|
13618
|
-
"../packages/agents-core/src/data-access/messages.ts"() {
|
|
13619
|
-
"use strict";
|
|
13620
|
-
init_esm_shims();
|
|
13621
|
-
init_schema();
|
|
13622
|
-
}
|
|
13623
|
-
});
|
|
13624
|
-
|
|
13625
|
-
// ../packages/agents-core/src/data-access/projects.ts
|
|
13626
|
-
import { and as and16, count as count14, desc as desc13, eq as eq16 } from "drizzle-orm";
|
|
13627
|
-
var init_projects = __esm({
|
|
13628
|
-
"../packages/agents-core/src/data-access/projects.ts"() {
|
|
13629
|
-
"use strict";
|
|
13630
|
-
init_esm_shims();
|
|
13631
|
-
init_schema();
|
|
13632
|
-
}
|
|
13633
|
-
});
|
|
13634
|
-
|
|
13635
|
-
// ../packages/agents-core/src/data-access/projectFull.ts
|
|
13636
|
-
var defaultLogger;
|
|
13637
|
-
var init_projectFull = __esm({
|
|
13638
|
-
"../packages/agents-core/src/data-access/projectFull.ts"() {
|
|
13639
|
-
"use strict";
|
|
13640
|
-
init_esm_shims();
|
|
13641
|
-
init_logger();
|
|
13642
|
-
init_agentGraphs();
|
|
13643
|
-
init_artifactComponents();
|
|
13644
|
-
init_credentialReferences();
|
|
13645
|
-
init_dataComponents();
|
|
13646
|
-
init_graphFull2();
|
|
13647
|
-
init_projects();
|
|
13648
|
-
init_tools();
|
|
13649
|
-
defaultLogger = getLogger("projectFull");
|
|
13545
|
+
init_auth_detection();
|
|
13546
|
+
init_conversations();
|
|
13547
|
+
init_credential_store_utils();
|
|
13548
|
+
init_error();
|
|
13549
|
+
init_execution();
|
|
13550
|
+
init_logger();
|
|
13551
|
+
init_mcp_client();
|
|
13552
|
+
init_schema_conversion();
|
|
13553
|
+
init_tracer_factory();
|
|
13650
13554
|
}
|
|
13651
13555
|
});
|
|
13652
13556
|
|
|
13653
|
-
// ../packages/agents-core/src/data-access/
|
|
13654
|
-
import { and as
|
|
13655
|
-
var
|
|
13656
|
-
"../packages/agents-core/src/data-access/
|
|
13557
|
+
// ../packages/agents-core/src/data-access/credentialReferences.ts
|
|
13558
|
+
import { and as and6, count as count5, desc as desc5, eq as eq6, sql as sql3 } from "drizzle-orm";
|
|
13559
|
+
var init_credentialReferences = __esm({
|
|
13560
|
+
"../packages/agents-core/src/data-access/credentialReferences.ts"() {
|
|
13657
13561
|
"use strict";
|
|
13658
13562
|
init_esm_shims();
|
|
13659
13563
|
init_schema();
|
|
13660
13564
|
}
|
|
13661
13565
|
});
|
|
13662
13566
|
|
|
13663
|
-
// ../packages/agents-core/src/data-access/
|
|
13664
|
-
|
|
13665
|
-
|
|
13567
|
+
// ../packages/agents-core/src/data-access/tools.ts
|
|
13568
|
+
import { and as and7, count as count6, desc as desc6, eq as eq7 } from "drizzle-orm";
|
|
13569
|
+
var logger6;
|
|
13570
|
+
var init_tools = __esm({
|
|
13571
|
+
"../packages/agents-core/src/data-access/tools.ts"() {
|
|
13666
13572
|
"use strict";
|
|
13667
13573
|
init_esm_shims();
|
|
13668
|
-
|
|
13574
|
+
init_context5();
|
|
13575
|
+
init_credential_stuffer();
|
|
13576
|
+
init_schema();
|
|
13577
|
+
init_types();
|
|
13578
|
+
init_utils();
|
|
13579
|
+
init_logger();
|
|
13580
|
+
init_mcp_client();
|
|
13581
|
+
init_agentRelations();
|
|
13582
|
+
init_credentialReferences();
|
|
13583
|
+
logger6 = getLogger("tools");
|
|
13669
13584
|
}
|
|
13670
13585
|
});
|
|
13671
13586
|
|
|
13672
|
-
// ../packages/agents-core/src/data-access/
|
|
13673
|
-
|
|
13674
|
-
|
|
13587
|
+
// ../packages/agents-core/src/data-access/agentGraphs.ts
|
|
13588
|
+
import { and as and8, count as count7, desc as desc7, eq as eq8, inArray as inArray2 } from "drizzle-orm";
|
|
13589
|
+
var init_agentGraphs = __esm({
|
|
13590
|
+
"../packages/agents-core/src/data-access/agentGraphs.ts"() {
|
|
13675
13591
|
"use strict";
|
|
13676
13592
|
init_esm_shims();
|
|
13677
|
-
|
|
13678
|
-
init_agentGraphs();
|
|
13593
|
+
init_schema();
|
|
13679
13594
|
init_agentRelations();
|
|
13680
13595
|
init_agents();
|
|
13681
|
-
init_apiKeys2();
|
|
13682
|
-
init_artifactComponents();
|
|
13683
|
-
init_contextCache();
|
|
13684
13596
|
init_contextConfigs();
|
|
13685
|
-
init_conversations2();
|
|
13686
|
-
init_credentialReferences();
|
|
13687
|
-
init_dataComponents();
|
|
13688
13597
|
init_externalAgents();
|
|
13689
|
-
|
|
13690
|
-
init_ledgerArtifacts();
|
|
13691
|
-
init_messages();
|
|
13692
|
-
init_projectFull();
|
|
13693
|
-
init_projects();
|
|
13694
|
-
init_tasks();
|
|
13598
|
+
init_functions();
|
|
13695
13599
|
init_tools();
|
|
13696
|
-
|
|
13600
|
+
}
|
|
13601
|
+
});
|
|
13602
|
+
|
|
13603
|
+
// ../packages/agents-core/src/data-access/apiKeys.ts
|
|
13604
|
+
import { and as and9, count as count8, desc as desc8, eq as eq9 } from "drizzle-orm";
|
|
13605
|
+
var init_apiKeys2 = __esm({
|
|
13606
|
+
"../packages/agents-core/src/data-access/apiKeys.ts"() {
|
|
13607
|
+
"use strict";
|
|
13608
|
+
init_esm_shims();
|
|
13609
|
+
init_schema();
|
|
13610
|
+
init_apiKeys();
|
|
13697
13611
|
}
|
|
13698
13612
|
});
|
|
13699
13613
|
|
|
@@ -14701,10 +14615,10 @@ var require_codegen = __commonJS({
|
|
|
14701
14615
|
}
|
|
14702
14616
|
exports.not = not2;
|
|
14703
14617
|
var andCode = mappend(exports.operators.AND);
|
|
14704
|
-
function
|
|
14618
|
+
function and19(...args) {
|
|
14705
14619
|
return args.reduce(andCode);
|
|
14706
14620
|
}
|
|
14707
|
-
exports.and =
|
|
14621
|
+
exports.and = and19;
|
|
14708
14622
|
var orCode = mappend(exports.operators.OR);
|
|
14709
14623
|
function or(...args) {
|
|
14710
14624
|
return args.reduce(orCode);
|
|
@@ -17598,7 +17512,7 @@ var require_core = __commonJS({
|
|
|
17598
17512
|
uriResolver
|
|
17599
17513
|
};
|
|
17600
17514
|
}
|
|
17601
|
-
var
|
|
17515
|
+
var Ajv4 = class {
|
|
17602
17516
|
constructor(opts = {}) {
|
|
17603
17517
|
this.schemas = {};
|
|
17604
17518
|
this.refs = {};
|
|
@@ -17968,9 +17882,9 @@ var require_core = __commonJS({
|
|
|
17968
17882
|
}
|
|
17969
17883
|
}
|
|
17970
17884
|
};
|
|
17971
|
-
|
|
17972
|
-
|
|
17973
|
-
exports.default =
|
|
17885
|
+
Ajv4.ValidationError = validation_error_1.default;
|
|
17886
|
+
Ajv4.MissingRefError = ref_error_1.default;
|
|
17887
|
+
exports.default = Ajv4;
|
|
17974
17888
|
function checkOptions(checkOpts, options, msg, log = "error") {
|
|
17975
17889
|
for (const key in checkOpts) {
|
|
17976
17890
|
const opt = key;
|
|
@@ -18022,13 +17936,13 @@ var require_core = __commonJS({
|
|
|
18022
17936
|
}, warn() {
|
|
18023
17937
|
}, error() {
|
|
18024
17938
|
} };
|
|
18025
|
-
function getLogger2(
|
|
18026
|
-
if (
|
|
17939
|
+
function getLogger2(logger14) {
|
|
17940
|
+
if (logger14 === false)
|
|
18027
17941
|
return noLogs;
|
|
18028
|
-
if (
|
|
17942
|
+
if (logger14 === void 0)
|
|
18029
17943
|
return console;
|
|
18030
|
-
if (
|
|
18031
|
-
return
|
|
17944
|
+
if (logger14.log && logger14.warn && logger14.error)
|
|
17945
|
+
return logger14;
|
|
18032
17946
|
throw new Error("logger must implement log, warn and error methods");
|
|
18033
17947
|
}
|
|
18034
17948
|
var KEYWORD_NAME = /^[a-z_$][a-z0-9_$:-]*$/i;
|
|
@@ -20112,7 +20026,7 @@ var require_ajv2 = __commonJS({
|
|
|
20112
20026
|
var draft7MetaSchema = require_json_schema_draft_072();
|
|
20113
20027
|
var META_SUPPORT_DATA = ["/properties"];
|
|
20114
20028
|
var META_SCHEMA_ID = "http://json-schema.org/draft-07/schema";
|
|
20115
|
-
var
|
|
20029
|
+
var Ajv4 = class extends core_1.default {
|
|
20116
20030
|
_addVocabularies() {
|
|
20117
20031
|
super._addVocabularies();
|
|
20118
20032
|
draft7_1.default.forEach((v2) => this.addVocabulary(v2));
|
|
@@ -20131,11 +20045,11 @@ var require_ajv2 = __commonJS({
|
|
|
20131
20045
|
return this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : void 0);
|
|
20132
20046
|
}
|
|
20133
20047
|
};
|
|
20134
|
-
exports.Ajv =
|
|
20135
|
-
module.exports = exports =
|
|
20136
|
-
module.exports.Ajv =
|
|
20048
|
+
exports.Ajv = Ajv4;
|
|
20049
|
+
module.exports = exports = Ajv4;
|
|
20050
|
+
module.exports.Ajv = Ajv4;
|
|
20137
20051
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20138
|
-
exports.default =
|
|
20052
|
+
exports.default = Ajv4;
|
|
20139
20053
|
var validate_1 = require_validate2();
|
|
20140
20054
|
Object.defineProperty(exports, "KeywordCxt", { enumerable: true, get: function() {
|
|
20141
20055
|
return validate_1.KeywordCxt;
|
|
@@ -20170,6 +20084,184 @@ var require_ajv2 = __commonJS({
|
|
|
20170
20084
|
}
|
|
20171
20085
|
});
|
|
20172
20086
|
|
|
20087
|
+
// ../packages/agents-core/src/validation/props-validation.ts
|
|
20088
|
+
var import_ajv2;
|
|
20089
|
+
var init_props_validation = __esm({
|
|
20090
|
+
"../packages/agents-core/src/validation/props-validation.ts"() {
|
|
20091
|
+
"use strict";
|
|
20092
|
+
init_esm_shims();
|
|
20093
|
+
import_ajv2 = __toESM(require_ajv2(), 1);
|
|
20094
|
+
}
|
|
20095
|
+
});
|
|
20096
|
+
|
|
20097
|
+
// ../packages/agents-core/src/data-access/artifactComponents.ts
|
|
20098
|
+
import { and as and10, count as count9, desc as desc9, eq as eq10 } from "drizzle-orm";
|
|
20099
|
+
var init_artifactComponents = __esm({
|
|
20100
|
+
"../packages/agents-core/src/data-access/artifactComponents.ts"() {
|
|
20101
|
+
"use strict";
|
|
20102
|
+
init_esm_shims();
|
|
20103
|
+
init_schema();
|
|
20104
|
+
init_props_validation();
|
|
20105
|
+
}
|
|
20106
|
+
});
|
|
20107
|
+
|
|
20108
|
+
// ../packages/agents-core/src/data-access/contextCache.ts
|
|
20109
|
+
import { and as and11, eq as eq11 } from "drizzle-orm";
|
|
20110
|
+
var init_contextCache = __esm({
|
|
20111
|
+
"../packages/agents-core/src/data-access/contextCache.ts"() {
|
|
20112
|
+
"use strict";
|
|
20113
|
+
init_esm_shims();
|
|
20114
|
+
init_schema();
|
|
20115
|
+
}
|
|
20116
|
+
});
|
|
20117
|
+
|
|
20118
|
+
// ../packages/agents-core/src/data-access/conversations.ts
|
|
20119
|
+
import { and as and12, count as count10, desc as desc10, eq as eq12 } from "drizzle-orm";
|
|
20120
|
+
var init_conversations2 = __esm({
|
|
20121
|
+
"../packages/agents-core/src/data-access/conversations.ts"() {
|
|
20122
|
+
"use strict";
|
|
20123
|
+
init_esm_shims();
|
|
20124
|
+
init_schema();
|
|
20125
|
+
init_conversations();
|
|
20126
|
+
}
|
|
20127
|
+
});
|
|
20128
|
+
|
|
20129
|
+
// ../packages/agents-core/src/data-access/dataComponents.ts
|
|
20130
|
+
import { and as and13, count as count11, desc as desc11, eq as eq13 } from "drizzle-orm";
|
|
20131
|
+
var init_dataComponents = __esm({
|
|
20132
|
+
"../packages/agents-core/src/data-access/dataComponents.ts"() {
|
|
20133
|
+
"use strict";
|
|
20134
|
+
init_esm_shims();
|
|
20135
|
+
init_schema();
|
|
20136
|
+
init_props_validation();
|
|
20137
|
+
}
|
|
20138
|
+
});
|
|
20139
|
+
|
|
20140
|
+
// ../packages/agents-core/src/validation/graphFull.ts
|
|
20141
|
+
var init_graphFull = __esm({
|
|
20142
|
+
"../packages/agents-core/src/validation/graphFull.ts"() {
|
|
20143
|
+
"use strict";
|
|
20144
|
+
init_esm_shims();
|
|
20145
|
+
init_schemas();
|
|
20146
|
+
}
|
|
20147
|
+
});
|
|
20148
|
+
|
|
20149
|
+
// ../packages/agents-core/src/data-access/graphFull.ts
|
|
20150
|
+
import { and as and14, eq as eq14, inArray as inArray3, not } from "drizzle-orm";
|
|
20151
|
+
var init_graphFull2 = __esm({
|
|
20152
|
+
"../packages/agents-core/src/data-access/graphFull.ts"() {
|
|
20153
|
+
"use strict";
|
|
20154
|
+
init_esm_shims();
|
|
20155
|
+
init_schema();
|
|
20156
|
+
init_graphFull();
|
|
20157
|
+
init_agentGraphs();
|
|
20158
|
+
init_agentRelations();
|
|
20159
|
+
init_agents();
|
|
20160
|
+
init_artifactComponents();
|
|
20161
|
+
init_contextConfigs();
|
|
20162
|
+
init_dataComponents();
|
|
20163
|
+
init_externalAgents();
|
|
20164
|
+
init_tools();
|
|
20165
|
+
}
|
|
20166
|
+
});
|
|
20167
|
+
|
|
20168
|
+
// ../packages/agents-core/src/data-access/ledgerArtifacts.ts
|
|
20169
|
+
import { and as and15, count as count12, eq as eq15 } from "drizzle-orm";
|
|
20170
|
+
var init_ledgerArtifacts = __esm({
|
|
20171
|
+
"../packages/agents-core/src/data-access/ledgerArtifacts.ts"() {
|
|
20172
|
+
"use strict";
|
|
20173
|
+
init_esm_shims();
|
|
20174
|
+
init_schema();
|
|
20175
|
+
}
|
|
20176
|
+
});
|
|
20177
|
+
|
|
20178
|
+
// ../packages/agents-core/src/data-access/messages.ts
|
|
20179
|
+
import { and as and16, asc as asc2, count as count13, desc as desc12, eq as eq16, inArray as inArray4 } from "drizzle-orm";
|
|
20180
|
+
var init_messages = __esm({
|
|
20181
|
+
"../packages/agents-core/src/data-access/messages.ts"() {
|
|
20182
|
+
"use strict";
|
|
20183
|
+
init_esm_shims();
|
|
20184
|
+
init_schema();
|
|
20185
|
+
}
|
|
20186
|
+
});
|
|
20187
|
+
|
|
20188
|
+
// ../packages/agents-core/src/data-access/projects.ts
|
|
20189
|
+
import { and as and17, count as count14, desc as desc13, eq as eq17 } from "drizzle-orm";
|
|
20190
|
+
var init_projects = __esm({
|
|
20191
|
+
"../packages/agents-core/src/data-access/projects.ts"() {
|
|
20192
|
+
"use strict";
|
|
20193
|
+
init_esm_shims();
|
|
20194
|
+
init_schema();
|
|
20195
|
+
}
|
|
20196
|
+
});
|
|
20197
|
+
|
|
20198
|
+
// ../packages/agents-core/src/data-access/projectFull.ts
|
|
20199
|
+
var defaultLogger;
|
|
20200
|
+
var init_projectFull = __esm({
|
|
20201
|
+
"../packages/agents-core/src/data-access/projectFull.ts"() {
|
|
20202
|
+
"use strict";
|
|
20203
|
+
init_esm_shims();
|
|
20204
|
+
init_logger();
|
|
20205
|
+
init_agentGraphs();
|
|
20206
|
+
init_artifactComponents();
|
|
20207
|
+
init_credentialReferences();
|
|
20208
|
+
init_dataComponents();
|
|
20209
|
+
init_functions();
|
|
20210
|
+
init_graphFull2();
|
|
20211
|
+
init_projects();
|
|
20212
|
+
init_tools();
|
|
20213
|
+
defaultLogger = getLogger("projectFull");
|
|
20214
|
+
}
|
|
20215
|
+
});
|
|
20216
|
+
|
|
20217
|
+
// ../packages/agents-core/src/data-access/tasks.ts
|
|
20218
|
+
import { and as and18, eq as eq18 } from "drizzle-orm";
|
|
20219
|
+
var init_tasks = __esm({
|
|
20220
|
+
"../packages/agents-core/src/data-access/tasks.ts"() {
|
|
20221
|
+
"use strict";
|
|
20222
|
+
init_esm_shims();
|
|
20223
|
+
init_schema();
|
|
20224
|
+
}
|
|
20225
|
+
});
|
|
20226
|
+
|
|
20227
|
+
// ../packages/agents-core/src/data-access/validation.ts
|
|
20228
|
+
var init_validation = __esm({
|
|
20229
|
+
"../packages/agents-core/src/data-access/validation.ts"() {
|
|
20230
|
+
"use strict";
|
|
20231
|
+
init_esm_shims();
|
|
20232
|
+
init_projects();
|
|
20233
|
+
}
|
|
20234
|
+
});
|
|
20235
|
+
|
|
20236
|
+
// ../packages/agents-core/src/data-access/index.ts
|
|
20237
|
+
var init_data_access = __esm({
|
|
20238
|
+
"../packages/agents-core/src/data-access/index.ts"() {
|
|
20239
|
+
"use strict";
|
|
20240
|
+
init_esm_shims();
|
|
20241
|
+
init_client();
|
|
20242
|
+
init_agentGraphs();
|
|
20243
|
+
init_agentRelations();
|
|
20244
|
+
init_agents();
|
|
20245
|
+
init_apiKeys2();
|
|
20246
|
+
init_artifactComponents();
|
|
20247
|
+
init_contextCache();
|
|
20248
|
+
init_contextConfigs();
|
|
20249
|
+
init_conversations2();
|
|
20250
|
+
init_credentialReferences();
|
|
20251
|
+
init_dataComponents();
|
|
20252
|
+
init_externalAgents();
|
|
20253
|
+
init_functions();
|
|
20254
|
+
init_graphFull2();
|
|
20255
|
+
init_ledgerArtifacts();
|
|
20256
|
+
init_messages();
|
|
20257
|
+
init_projectFull();
|
|
20258
|
+
init_projects();
|
|
20259
|
+
init_tasks();
|
|
20260
|
+
init_tools();
|
|
20261
|
+
init_validation();
|
|
20262
|
+
}
|
|
20263
|
+
});
|
|
20264
|
+
|
|
20173
20265
|
// ../packages/agents-core/src/utils/tracer.ts
|
|
20174
20266
|
var tracer;
|
|
20175
20267
|
var init_tracer = __esm({
|
|
@@ -20183,20 +20275,20 @@ var init_tracer = __esm({
|
|
|
20183
20275
|
});
|
|
20184
20276
|
|
|
20185
20277
|
// ../packages/agents-core/src/context/contextCache.ts
|
|
20186
|
-
var
|
|
20278
|
+
var logger7;
|
|
20187
20279
|
var init_contextCache2 = __esm({
|
|
20188
20280
|
"../packages/agents-core/src/context/contextCache.ts"() {
|
|
20189
20281
|
"use strict";
|
|
20190
20282
|
init_esm_shims();
|
|
20191
20283
|
init_data_access();
|
|
20192
20284
|
init_logger();
|
|
20193
|
-
|
|
20285
|
+
logger7 = getLogger("context-cache");
|
|
20194
20286
|
}
|
|
20195
20287
|
});
|
|
20196
20288
|
|
|
20197
20289
|
// ../packages/agents-core/src/context/ContextResolver.ts
|
|
20198
20290
|
import crypto4 from "crypto";
|
|
20199
|
-
var
|
|
20291
|
+
var logger8;
|
|
20200
20292
|
var init_ContextResolver = __esm({
|
|
20201
20293
|
"../packages/agents-core/src/context/ContextResolver.ts"() {
|
|
20202
20294
|
"use strict";
|
|
@@ -20205,25 +20297,25 @@ var init_ContextResolver = __esm({
|
|
|
20205
20297
|
init_tracer();
|
|
20206
20298
|
init_ContextFetcher();
|
|
20207
20299
|
init_contextCache2();
|
|
20208
|
-
|
|
20300
|
+
logger8 = getLogger("context-resolver");
|
|
20209
20301
|
}
|
|
20210
20302
|
});
|
|
20211
20303
|
|
|
20212
20304
|
// ../packages/agents-core/src/middleware/contextValidation.ts
|
|
20213
|
-
var
|
|
20305
|
+
var import_ajv3, logger9, ajv;
|
|
20214
20306
|
var init_contextValidation = __esm({
|
|
20215
20307
|
"../packages/agents-core/src/middleware/contextValidation.ts"() {
|
|
20216
20308
|
"use strict";
|
|
20217
20309
|
init_esm_shims();
|
|
20218
|
-
|
|
20310
|
+
import_ajv3 = __toESM(require_ajv2(), 1);
|
|
20219
20311
|
init_ContextResolver();
|
|
20220
20312
|
init_agentGraphs();
|
|
20221
20313
|
init_contextConfigs();
|
|
20222
20314
|
init_error();
|
|
20223
20315
|
init_execution();
|
|
20224
20316
|
init_logger();
|
|
20225
|
-
|
|
20226
|
-
ajv = new
|
|
20317
|
+
logger9 = getLogger("context-validation");
|
|
20318
|
+
ajv = new import_ajv3.default({ allErrors: true, strict: false });
|
|
20227
20319
|
}
|
|
20228
20320
|
});
|
|
20229
20321
|
|
|
@@ -20237,7 +20329,7 @@ var init_middleware = __esm({
|
|
|
20237
20329
|
});
|
|
20238
20330
|
|
|
20239
20331
|
// ../packages/agents-core/src/context/ContextFetcher.ts
|
|
20240
|
-
var import_jmespath2,
|
|
20332
|
+
var import_jmespath2, logger10;
|
|
20241
20333
|
var init_ContextFetcher = __esm({
|
|
20242
20334
|
"../packages/agents-core/src/context/ContextFetcher.ts"() {
|
|
20243
20335
|
"use strict";
|
|
@@ -20248,12 +20340,12 @@ var init_ContextFetcher = __esm({
|
|
|
20248
20340
|
init_middleware();
|
|
20249
20341
|
init_logger();
|
|
20250
20342
|
init_TemplateEngine();
|
|
20251
|
-
|
|
20343
|
+
logger10 = getLogger("context-fetcher");
|
|
20252
20344
|
}
|
|
20253
20345
|
});
|
|
20254
20346
|
|
|
20255
20347
|
// ../packages/agents-core/src/context/context.ts
|
|
20256
|
-
var
|
|
20348
|
+
var logger11;
|
|
20257
20349
|
var init_context4 = __esm({
|
|
20258
20350
|
"../packages/agents-core/src/context/context.ts"() {
|
|
20259
20351
|
"use strict";
|
|
@@ -20262,7 +20354,7 @@ var init_context4 = __esm({
|
|
|
20262
20354
|
init_utils();
|
|
20263
20355
|
init_tracer();
|
|
20264
20356
|
init_ContextResolver();
|
|
20265
|
-
|
|
20357
|
+
logger11 = getLogger("context");
|
|
20266
20358
|
}
|
|
20267
20359
|
});
|
|
20268
20360
|
|
|
@@ -20354,8 +20446,8 @@ var init_dist6 = __esm({
|
|
|
20354
20446
|
});
|
|
20355
20447
|
|
|
20356
20448
|
// ../packages/agents-core/src/credential-stores/nango-store.ts
|
|
20357
|
-
import { z as
|
|
20358
|
-
var
|
|
20449
|
+
import { z as z9 } from "zod";
|
|
20450
|
+
var logger12, CredentialKeySchema;
|
|
20359
20451
|
var init_nango_store = __esm({
|
|
20360
20452
|
"../packages/agents-core/src/credential-stores/nango-store.ts"() {
|
|
20361
20453
|
"use strict";
|
|
@@ -20363,10 +20455,10 @@ var init_nango_store = __esm({
|
|
|
20363
20455
|
init_dist6();
|
|
20364
20456
|
init_types();
|
|
20365
20457
|
init_logger();
|
|
20366
|
-
|
|
20367
|
-
CredentialKeySchema =
|
|
20368
|
-
connectionId:
|
|
20369
|
-
providerConfigKey:
|
|
20458
|
+
logger12 = getLogger("nango-credential-store");
|
|
20459
|
+
CredentialKeySchema = z9.object({
|
|
20460
|
+
connectionId: z9.string().min(1, "connectionId must be a non-empty string"),
|
|
20461
|
+
providerConfigKey: z9.string().min(1, "providerConfigKey must be a non-empty string")
|
|
20370
20462
|
});
|
|
20371
20463
|
}
|
|
20372
20464
|
});
|
|
@@ -20474,7 +20566,7 @@ import os from "os";
|
|
|
20474
20566
|
import path2 from "path";
|
|
20475
20567
|
import dotenv from "dotenv";
|
|
20476
20568
|
import { findUpSync } from "find-up";
|
|
20477
|
-
import { z as
|
|
20569
|
+
import { z as z10 } from "zod";
|
|
20478
20570
|
var import_dotenv_expand, loadEnvironmentFiles, envSchema, parseEnv, env;
|
|
20479
20571
|
var init_env = __esm({
|
|
20480
20572
|
"../packages/agents-core/src/env.ts"() {
|
|
@@ -20507,19 +20599,19 @@ var init_env = __esm({
|
|
|
20507
20599
|
}
|
|
20508
20600
|
};
|
|
20509
20601
|
loadEnvironmentFiles();
|
|
20510
|
-
envSchema =
|
|
20511
|
-
ENVIRONMENT:
|
|
20512
|
-
DB_FILE_NAME:
|
|
20513
|
-
TURSO_DATABASE_URL:
|
|
20514
|
-
TURSO_AUTH_TOKEN:
|
|
20515
|
-
OTEL_TRACES_FORCE_FLUSH_ENABLED:
|
|
20602
|
+
envSchema = z10.object({
|
|
20603
|
+
ENVIRONMENT: z10.enum(["development", "production", "pentest", "test"]).optional(),
|
|
20604
|
+
DB_FILE_NAME: z10.string().optional(),
|
|
20605
|
+
TURSO_DATABASE_URL: z10.string().optional(),
|
|
20606
|
+
TURSO_AUTH_TOKEN: z10.string().optional(),
|
|
20607
|
+
OTEL_TRACES_FORCE_FLUSH_ENABLED: z10.coerce.boolean().optional()
|
|
20516
20608
|
});
|
|
20517
20609
|
parseEnv = () => {
|
|
20518
20610
|
try {
|
|
20519
20611
|
const parsedEnv = envSchema.parse(process.env);
|
|
20520
20612
|
return parsedEnv;
|
|
20521
20613
|
} catch (error) {
|
|
20522
|
-
if (error instanceof
|
|
20614
|
+
if (error instanceof z10.ZodError) {
|
|
20523
20615
|
const missingVars = error.issues.map((issue) => issue.path.join("."));
|
|
20524
20616
|
throw new Error(
|
|
20525
20617
|
`\u274C Invalid environment variables: ${missingVars.join(", ")}
|
|
@@ -20549,6 +20641,7 @@ var init_validation2 = __esm({
|
|
|
20549
20641
|
init_esm_shims();
|
|
20550
20642
|
init_graphFull();
|
|
20551
20643
|
init_id_validation();
|
|
20644
|
+
init_props_validation();
|
|
20552
20645
|
init_schemas();
|
|
20553
20646
|
}
|
|
20554
20647
|
});
|
|
@@ -20676,7 +20769,7 @@ function findConfigFile(startPath = process.cwd()) {
|
|
|
20676
20769
|
return null;
|
|
20677
20770
|
}
|
|
20678
20771
|
async function loadConfigFromFile(configPath) {
|
|
20679
|
-
|
|
20772
|
+
logger13.info({ fromPath: configPath }, `Loading config file`);
|
|
20680
20773
|
let resolvedPath;
|
|
20681
20774
|
if (configPath) {
|
|
20682
20775
|
resolvedPath = resolve2(process.cwd(), configPath);
|
|
@@ -20696,7 +20789,7 @@ async function loadConfigFromFile(configPath) {
|
|
|
20696
20789
|
throw new Error(`No config exported from ${resolvedPath}`);
|
|
20697
20790
|
}
|
|
20698
20791
|
const config = normalizeConfig(rawConfig);
|
|
20699
|
-
|
|
20792
|
+
logger13.info({ config: maskSensitiveConfig(config) }, `Loaded config values`);
|
|
20700
20793
|
return config;
|
|
20701
20794
|
} catch (error) {
|
|
20702
20795
|
console.warn(`Warning: Failed to load config file ${resolvedPath}:`, error);
|
|
@@ -20717,9 +20810,9 @@ async function loadConfig(configPath) {
|
|
|
20717
20810
|
config[key] = value;
|
|
20718
20811
|
}
|
|
20719
20812
|
});
|
|
20720
|
-
|
|
20813
|
+
logger13.info({ mergedConfig: maskSensitiveConfig(config) }, `Config loaded from file`);
|
|
20721
20814
|
} else {
|
|
20722
|
-
|
|
20815
|
+
logger13.info(
|
|
20723
20816
|
{ config: maskSensitiveConfig(config) },
|
|
20724
20817
|
`Using default config (no config file found)`
|
|
20725
20818
|
);
|
|
@@ -20771,14 +20864,14 @@ Please add agentsRunApiUrl to your configuration file`
|
|
|
20771
20864
|
sources
|
|
20772
20865
|
};
|
|
20773
20866
|
}
|
|
20774
|
-
var
|
|
20867
|
+
var logger13;
|
|
20775
20868
|
var init_config = __esm({
|
|
20776
20869
|
"src/utils/config.ts"() {
|
|
20777
20870
|
"use strict";
|
|
20778
20871
|
init_esm_shims();
|
|
20779
20872
|
init_src();
|
|
20780
20873
|
init_tsx_loader();
|
|
20781
|
-
|
|
20874
|
+
logger13 = getLogger("config");
|
|
20782
20875
|
}
|
|
20783
20876
|
});
|
|
20784
20877
|
|
|
@@ -20810,15 +20903,15 @@ var init_api = __esm({
|
|
|
20810
20903
|
* Wrapper around fetch that automatically includes Authorization header if API key is present
|
|
20811
20904
|
*/
|
|
20812
20905
|
async authenticatedFetch(url, options = {}) {
|
|
20813
|
-
const
|
|
20906
|
+
const headers2 = {
|
|
20814
20907
|
...options.headers || {}
|
|
20815
20908
|
};
|
|
20816
20909
|
if (this.apiKey) {
|
|
20817
|
-
|
|
20910
|
+
headers2.Authorization = `Bearer ${this.apiKey}`;
|
|
20818
20911
|
}
|
|
20819
20912
|
return apiFetch(url, {
|
|
20820
20913
|
...options,
|
|
20821
|
-
headers
|
|
20914
|
+
headers: headers2
|
|
20822
20915
|
});
|
|
20823
20916
|
}
|
|
20824
20917
|
getTenantId() {
|
|
@@ -21329,19 +21422,19 @@ init_esm_shims();
|
|
|
21329
21422
|
// src/env.ts
|
|
21330
21423
|
init_esm_shims();
|
|
21331
21424
|
init_src();
|
|
21332
|
-
import { z as
|
|
21425
|
+
import { z as z11 } from "zod";
|
|
21333
21426
|
loadEnvironmentFiles();
|
|
21334
|
-
var envSchema2 =
|
|
21335
|
-
DEBUG:
|
|
21427
|
+
var envSchema2 = z11.object({
|
|
21428
|
+
DEBUG: z11.string().optional(),
|
|
21336
21429
|
// Secrets loaded from .env files (relative to where CLI is executed)
|
|
21337
|
-
ANTHROPIC_API_KEY:
|
|
21430
|
+
ANTHROPIC_API_KEY: z11.string().optional()
|
|
21338
21431
|
});
|
|
21339
21432
|
var parseEnv2 = () => {
|
|
21340
21433
|
try {
|
|
21341
21434
|
const parsedEnv = envSchema2.parse(process.env);
|
|
21342
21435
|
return parsedEnv;
|
|
21343
21436
|
} catch (error) {
|
|
21344
|
-
if (error instanceof
|
|
21437
|
+
if (error instanceof z11.ZodError) {
|
|
21345
21438
|
const missingVars = error.issues.map((issue) => issue.path.join("."));
|
|
21346
21439
|
throw new Error(
|
|
21347
21440
|
`\u274C Invalid environment variables: ${missingVars.join(", ")}
|
|
@@ -22044,6 +22137,7 @@ import { generateText } from "ai";
|
|
|
22044
22137
|
// src/commands/pull.placeholder-system.ts
|
|
22045
22138
|
init_esm_shims();
|
|
22046
22139
|
import { randomBytes as randomBytes2 } from "crypto";
|
|
22140
|
+
import { jsonSchemaToZod } from "json-schema-to-zod";
|
|
22047
22141
|
var MIN_REPLACEMENT_LENGTH = 50;
|
|
22048
22142
|
function generateShortId(length = 8) {
|
|
22049
22143
|
return randomBytes2(Math.ceil(length / 2)).toString("hex").slice(0, length);
|
|
@@ -22055,6 +22149,16 @@ function generatePlaceholder(jsonPath) {
|
|
|
22055
22149
|
function shouldReplaceString(value, placeholder) {
|
|
22056
22150
|
return value.length >= MIN_REPLACEMENT_LENGTH && placeholder.length < value.length;
|
|
22057
22151
|
}
|
|
22152
|
+
function isJsonSchemaPath(path3) {
|
|
22153
|
+
if (path3.endsWith("contextConfig.headersSchema") || path3.endsWith("responseSchema")) {
|
|
22154
|
+
return true;
|
|
22155
|
+
}
|
|
22156
|
+
return false;
|
|
22157
|
+
}
|
|
22158
|
+
function updateTracker(tracker, placeholder, value) {
|
|
22159
|
+
tracker.placeholderToValue.set(placeholder, value);
|
|
22160
|
+
tracker.valueToPlaceholder.set(value, placeholder);
|
|
22161
|
+
}
|
|
22058
22162
|
function processObject(obj, tracker, path3 = "") {
|
|
22059
22163
|
if (typeof obj === "string") {
|
|
22060
22164
|
const existingPlaceholder = tracker.valueToPlaceholder.get(obj);
|
|
@@ -22069,12 +22173,19 @@ function processObject(obj, tracker, path3 = "") {
|
|
|
22069
22173
|
`Placeholder collision detected: placeholder '${placeholder}' already exists with different value. Existing value length: ${existingValue.length}, New value length: ${obj.length}`
|
|
22070
22174
|
);
|
|
22071
22175
|
}
|
|
22072
|
-
tracker
|
|
22073
|
-
tracker.valueToPlaceholder.set(obj, placeholder);
|
|
22176
|
+
updateTracker(tracker, placeholder, obj);
|
|
22074
22177
|
return placeholder;
|
|
22075
22178
|
}
|
|
22076
22179
|
return obj;
|
|
22077
22180
|
}
|
|
22181
|
+
if (isJsonSchemaPath(path3)) {
|
|
22182
|
+
try {
|
|
22183
|
+
const zodSchema = jsonSchemaToZod(obj);
|
|
22184
|
+
return zodSchema;
|
|
22185
|
+
} catch (error) {
|
|
22186
|
+
console.error("Error converting JSON schema to Zod schema:", error);
|
|
22187
|
+
}
|
|
22188
|
+
}
|
|
22078
22189
|
if (Array.isArray(obj)) {
|
|
22079
22190
|
return obj.map((item, index2) => processObject(item, tracker, `${path3}[${index2}]`));
|
|
22080
22191
|
}
|
|
@@ -22472,6 +22583,7 @@ ${getTypeDefinitions()}
|
|
|
22472
22583
|
IMPORTANT CONTEXT:
|
|
22473
22584
|
- Agents reference resources (tools, components) by their imported variable names
|
|
22474
22585
|
- The 'tools' field in agents contains tool IDs that must match the imported variable names
|
|
22586
|
+
- If contextConfig is present, it must be imported from '@inkeep/agents-core' and used to create the context config
|
|
22475
22587
|
|
|
22476
22588
|
${NAMING_CONVENTION_RULES}
|
|
22477
22589
|
|
|
@@ -22488,6 +22600,8 @@ REQUIREMENTS:
|
|
|
22488
22600
|
- IMPORTANT: ANY placeholder that starts with < and ends with > MUST be wrapped in template literals (backticks)
|
|
22489
22601
|
- Placeholders contain multi-line content and require template literals
|
|
22490
22602
|
- This prevents TypeScript syntax errors with newlines and special characters
|
|
22603
|
+
- you must import { z } from 'zod' if you are using zod schemas in the graph file.
|
|
22604
|
+
6. If you are writing zod schemas make them clean. For example if you see z.union([z.string(), z.null()]) write it as z.string().nullable()
|
|
22491
22605
|
|
|
22492
22606
|
PLACEHOLDER HANDLING EXAMPLES:
|
|
22493
22607
|
// CORRECT - Placeholder wrapped in template literals:
|
|
@@ -22498,9 +22612,40 @@ prompt: '<{{agents.facts.prompt.abc12345}}>'
|
|
|
22498
22612
|
|
|
22499
22613
|
FULL EXAMPLE:
|
|
22500
22614
|
import { agent, agentGraph } from '@inkeep/agents-sdk';
|
|
22615
|
+
import { contextConfig, fetchDefinition } from '@inkeep/agents-core';
|
|
22501
22616
|
import { userProfile } from '../data-components/user-profile';
|
|
22502
22617
|
import { searchTool } from '../tools/search-tool';
|
|
22503
22618
|
import { weatherTool } from '../tools/weather-tool';
|
|
22619
|
+
import { z } from 'zod';
|
|
22620
|
+
|
|
22621
|
+
|
|
22622
|
+
const supportDescriptionFetchDefinition = fetchDefinition({
|
|
22623
|
+
id: 'support-description',
|
|
22624
|
+
name: 'Support Description',
|
|
22625
|
+
trigger: 'initialization',
|
|
22626
|
+
fetchConfig: {
|
|
22627
|
+
url: 'https://api.example.com/support-description',
|
|
22628
|
+
method: 'GET',
|
|
22629
|
+
headers: {
|
|
22630
|
+
'Authorization': 'Bearer {{headers.sessionToken}}',
|
|
22631
|
+
},
|
|
22632
|
+
transform: 'data',
|
|
22633
|
+
},
|
|
22634
|
+
responseSchema: z.object({
|
|
22635
|
+
description: z.string(),
|
|
22636
|
+
}),
|
|
22637
|
+
defaultValue: 'Support Description',
|
|
22638
|
+
});
|
|
22639
|
+
|
|
22640
|
+
const supportGraphContext = contextConfig({
|
|
22641
|
+
headers: z.object({
|
|
22642
|
+
userId: z.string(),
|
|
22643
|
+
sessionToken: z.string(),
|
|
22644
|
+
}),
|
|
22645
|
+
contextVariables: {
|
|
22646
|
+
supportDescription: supportDescriptionDefinition,
|
|
22647
|
+
},
|
|
22648
|
+
});
|
|
22504
22649
|
|
|
22505
22650
|
const routerAgent = agent({
|
|
22506
22651
|
id: 'router',
|
|
@@ -22568,6 +22713,7 @@ Generate ONLY the TypeScript code without any markdown or explanations.`;
|
|
|
22568
22713
|
console.log(`[DEBUG] - Unique tools: ${toolIds.size}`);
|
|
22569
22714
|
console.log(`[DEBUG] - Data components: ${dataComponentIds.size}`);
|
|
22570
22715
|
console.log(`[DEBUG] - Artifact components: ${artifactComponentIds.size}`);
|
|
22716
|
+
console.log(`[DEBUG] - Context config: ${graphData.contextConfig ? "Yes" : "No"}`);
|
|
22571
22717
|
console.log(
|
|
22572
22718
|
`[DEBUG] - Has relations: ${graphData.relations ? Object.keys(graphData.relations).length : 0}`
|
|
22573
22719
|
);
|
|
@@ -22738,24 +22884,42 @@ ${IMPORT_INSTRUCTIONS}
|
|
|
22738
22884
|
REQUIREMENTS:
|
|
22739
22885
|
1. Import artifactComponent from '@inkeep/agents-sdk'
|
|
22740
22886
|
2. Create the artifact component using artifactComponent()
|
|
22741
|
-
3. Include
|
|
22742
|
-
4.
|
|
22887
|
+
3. Include props from the component data with inPreview indicators
|
|
22888
|
+
4. Export following naming convention rules (camelCase version of ID)
|
|
22889
|
+
5. Include the 'id' property to preserve the original component ID
|
|
22890
|
+
6. CRITICAL: All imports must be alphabetically sorted to comply with Biome linting
|
|
22743
22891
|
|
|
22744
22892
|
EXAMPLE:
|
|
22745
22893
|
import { artifactComponent } from '@inkeep/agents-sdk';
|
|
22746
22894
|
|
|
22895
|
+
// Component ID 'pdf_export' becomes export name 'pdfExport'
|
|
22896
|
+
export const pdfExport = artifactComponent({
|
|
22897
|
+
id: 'pdf_export',
|
|
22898
|
+
name: 'PDF Export',
|
|
22899
|
+
description: 'Export data as PDF',
|
|
22900
|
+
props: {
|
|
22901
|
+
type: 'object',
|
|
22902
|
+
properties: {
|
|
22903
|
+
filename: { type: 'string', required: true, inPreview: true },
|
|
22904
|
+
content: { type: 'object', required: true, inPreview: false }
|
|
22905
|
+
}
|
|
22906
|
+
}
|
|
22907
|
+
});
|
|
22908
|
+
|
|
22909
|
+
EXAMPLE WITH HYPHEN ID:
|
|
22910
|
+
import { artifactComponent } from '@inkeep/agents-sdk';
|
|
22911
|
+
|
|
22912
|
+
// Component ID 'order-summary' becomes export name 'orderSummary'
|
|
22747
22913
|
export const orderSummary = artifactComponent({
|
|
22748
22914
|
id: 'order-summary',
|
|
22749
22915
|
name: 'Order Summary',
|
|
22750
22916
|
description: 'Summary of customer order',
|
|
22751
|
-
|
|
22752
|
-
|
|
22753
|
-
|
|
22754
|
-
|
|
22755
|
-
|
|
22756
|
-
|
|
22757
|
-
items: { type: 'array', required: true },
|
|
22758
|
-
total: { type: 'number', required: true },
|
|
22917
|
+
props: {
|
|
22918
|
+
type: 'object',
|
|
22919
|
+
properties: {
|
|
22920
|
+
orderId: { type: 'string', required: true, inPreview: true },
|
|
22921
|
+
total: { type: 'number', required: true, inPreview: true },
|
|
22922
|
+
items: { type: 'array', required: true, inPreview: false },
|
|
22759
22923
|
tax: { type: 'number' }
|
|
22760
22924
|
}
|
|
22761
22925
|
});
|
|
@@ -23620,9 +23784,7 @@ async function pushCommand(options) {
|
|
|
23620
23784
|
for (const graph of graphs) {
|
|
23621
23785
|
const graphStats = graph.getStats();
|
|
23622
23786
|
console.log(
|
|
23623
|
-
chalk8.gray(
|
|
23624
|
-
` \u2022 ${graph.getName()} (${graph.getId()}): ${graphStats.agentCount} agents, ${graphStats.toolCount} tools`
|
|
23625
|
-
)
|
|
23787
|
+
chalk8.gray(` \u2022 ${graph.getName()} (${graph.getId()}): ${graphStats.agentCount} agents`)
|
|
23626
23788
|
);
|
|
23627
23789
|
}
|
|
23628
23790
|
}
|