@anvailabs/agentbrowser-mcp 1.8.2 → 1.8.3
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/bin.js +374 -170
- package/dist/index.js +285 -17
- package/dist/mcp-server.d.ts.map +1 -1
- package/dist/mcp-server.js +25 -14
- package/dist/mcp-server.js.map +1 -1
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
// dist/bin.js
|
|
4
|
-
import { createInterface } from "node:readline";
|
|
5
|
-
import { readFileSync } from "node:fs";
|
|
6
|
-
import { dirname, join } from "node:path";
|
|
7
|
-
import { fileURLToPath } from "node:url";
|
|
8
2
|
var __defProp = Object.defineProperty;
|
|
9
3
|
var __export = (target, all) => {
|
|
10
4
|
for (var name in all)
|
|
11
5
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
6
|
};
|
|
7
|
+
|
|
8
|
+
// dist/bin.js
|
|
9
|
+
import { createInterface } from "node:readline";
|
|
10
|
+
|
|
11
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/guard/value.mjs
|
|
13
12
|
var value_exports = {};
|
|
14
13
|
__export(value_exports, {
|
|
15
14
|
HasPropertyKey: () => HasPropertyKey,
|
|
@@ -77,6 +76,8 @@ function IsUint8Array(value) {
|
|
|
77
76
|
function IsUndefined(value) {
|
|
78
77
|
return value === void 0;
|
|
79
78
|
}
|
|
79
|
+
|
|
80
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/clone/value.mjs
|
|
80
81
|
function ArrayType(value) {
|
|
81
82
|
return value.map((value2) => Visit(value2));
|
|
82
83
|
}
|
|
@@ -105,9 +106,13 @@ function Visit(value) {
|
|
|
105
106
|
function Clone(value) {
|
|
106
107
|
return Visit(value);
|
|
107
108
|
}
|
|
109
|
+
|
|
110
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/clone/type.mjs
|
|
108
111
|
function CloneType(schema, options) {
|
|
109
112
|
return options === void 0 ? Clone(schema) : Clone({ ...options, ...schema });
|
|
110
113
|
}
|
|
114
|
+
|
|
115
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/value/guard/guard.mjs
|
|
111
116
|
function IsAsyncIterator2(value) {
|
|
112
117
|
return IsObject2(value) && globalThis.Symbol.asyncIterator in value;
|
|
113
118
|
}
|
|
@@ -162,6 +167,8 @@ function IsSymbol2(value) {
|
|
|
162
167
|
function IsValueType(value) {
|
|
163
168
|
return IsBigInt2(value) || IsBoolean2(value) || IsNull2(value) || IsNumber2(value) || IsString2(value) || IsSymbol2(value) || IsUndefined2(value);
|
|
164
169
|
}
|
|
170
|
+
|
|
171
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/system/policy.mjs
|
|
165
172
|
var TypeSystemPolicy;
|
|
166
173
|
(function(TypeSystemPolicy2) {
|
|
167
174
|
TypeSystemPolicy2.InstanceMode = "default";
|
|
@@ -192,6 +199,8 @@ var TypeSystemPolicy;
|
|
|
192
199
|
}
|
|
193
200
|
TypeSystemPolicy2.IsVoidLike = IsVoidLike;
|
|
194
201
|
})(TypeSystemPolicy || (TypeSystemPolicy = {}));
|
|
202
|
+
|
|
203
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/create/immutable.mjs
|
|
195
204
|
function ImmutableArray(value) {
|
|
196
205
|
return globalThis.Object.freeze(value).map((value2) => Immutable(value2));
|
|
197
206
|
}
|
|
@@ -217,6 +226,8 @@ function ImmutableObject(value) {
|
|
|
217
226
|
function Immutable(value) {
|
|
218
227
|
return IsArray(value) ? ImmutableArray(value) : IsDate(value) ? ImmutableDate(value) : IsUint8Array(value) ? ImmutableUint8Array(value) : IsRegExp(value) ? ImmutableRegExp(value) : IsObject(value) ? ImmutableObject(value) : value;
|
|
219
228
|
}
|
|
229
|
+
|
|
230
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/create/type.mjs
|
|
220
231
|
function CreateType(schema, options) {
|
|
221
232
|
const result = options !== void 0 ? { ...options, ...schema } : schema;
|
|
222
233
|
switch (TypeSystemPolicy.InstanceMode) {
|
|
@@ -228,16 +239,22 @@ function CreateType(schema, options) {
|
|
|
228
239
|
return result;
|
|
229
240
|
}
|
|
230
241
|
}
|
|
242
|
+
|
|
243
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/error/error.mjs
|
|
231
244
|
var TypeBoxError = class extends Error {
|
|
232
245
|
constructor(message) {
|
|
233
246
|
super(message);
|
|
234
247
|
}
|
|
235
248
|
};
|
|
249
|
+
|
|
250
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/symbols/symbols.mjs
|
|
236
251
|
var TransformKind = /* @__PURE__ */ Symbol.for("TypeBox.Transform");
|
|
237
252
|
var ReadonlyKind = /* @__PURE__ */ Symbol.for("TypeBox.Readonly");
|
|
238
253
|
var OptionalKind = /* @__PURE__ */ Symbol.for("TypeBox.Optional");
|
|
239
254
|
var Hint = /* @__PURE__ */ Symbol.for("TypeBox.Hint");
|
|
240
255
|
var Kind = /* @__PURE__ */ Symbol.for("TypeBox.Kind");
|
|
256
|
+
|
|
257
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/guard/kind.mjs
|
|
241
258
|
function IsReadonly(value) {
|
|
242
259
|
return IsObject(value) && value[ReadonlyKind] === "Readonly";
|
|
243
260
|
}
|
|
@@ -367,6 +384,8 @@ function IsKind(value) {
|
|
|
367
384
|
function IsSchema(value) {
|
|
368
385
|
return IsAny(value) || IsArgument(value) || IsArray3(value) || IsBoolean3(value) || IsBigInt3(value) || IsAsyncIterator3(value) || IsComputed(value) || IsConstructor(value) || IsDate3(value) || IsFunction3(value) || IsInteger2(value) || IsIntersect(value) || IsIterator3(value) || IsLiteral(value) || IsMappedKey(value) || IsMappedResult(value) || IsNever(value) || IsNot(value) || IsNull3(value) || IsNumber3(value) || IsObject3(value) || IsPromise2(value) || IsRecord(value) || IsRef(value) || IsRegExp2(value) || IsString3(value) || IsSymbol3(value) || IsTemplateLiteral(value) || IsThis(value) || IsTuple(value) || IsUndefined3(value) || IsUnion(value) || IsUint8Array3(value) || IsUnknown(value) || IsUnsafe(value) || IsVoid(value) || IsKind(value);
|
|
369
386
|
}
|
|
387
|
+
|
|
388
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/guard/type.mjs
|
|
370
389
|
var type_exports = {};
|
|
371
390
|
__export(type_exports, {
|
|
372
391
|
IsAny: () => IsAny2,
|
|
@@ -657,6 +676,8 @@ function IsKind2(value) {
|
|
|
657
676
|
function IsSchema2(value) {
|
|
658
677
|
return IsObject(value) && (IsAny2(value) || IsArgument2(value) || IsArray4(value) || IsBoolean4(value) || IsBigInt4(value) || IsAsyncIterator4(value) || IsComputed2(value) || IsConstructor2(value) || IsDate4(value) || IsFunction4(value) || IsInteger3(value) || IsIntersect2(value) || IsIterator4(value) || IsLiteral2(value) || IsMappedKey2(value) || IsMappedResult2(value) || IsNever2(value) || IsNot2(value) || IsNull4(value) || IsNumber4(value) || IsObject4(value) || IsPromise3(value) || IsRecord2(value) || IsRef2(value) || IsRegExp3(value) || IsString4(value) || IsSymbol4(value) || IsTemplateLiteral2(value) || IsThis2(value) || IsTuple2(value) || IsUndefined4(value) || IsUnion2(value) || IsUint8Array4(value) || IsUnknown2(value) || IsUnsafe2(value) || IsVoid2(value) || IsKind2(value));
|
|
659
678
|
}
|
|
679
|
+
|
|
680
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/patterns/patterns.mjs
|
|
660
681
|
var PatternBoolean = "(true|false)";
|
|
661
682
|
var PatternNumber = "(0|[1-9][0-9]*)";
|
|
662
683
|
var PatternString = "(.*)";
|
|
@@ -665,6 +686,8 @@ var PatternBooleanExact = `^${PatternBoolean}$`;
|
|
|
665
686
|
var PatternNumberExact = `^${PatternNumber}$`;
|
|
666
687
|
var PatternStringExact = `^${PatternString}$`;
|
|
667
688
|
var PatternNeverExact = `^${PatternNever}$`;
|
|
689
|
+
|
|
690
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/registry/format.mjs
|
|
668
691
|
var format_exports = {};
|
|
669
692
|
__export(format_exports, {
|
|
670
693
|
Clear: () => Clear,
|
|
@@ -693,6 +716,8 @@ function Set2(format, func) {
|
|
|
693
716
|
function Get(format) {
|
|
694
717
|
return map.get(format);
|
|
695
718
|
}
|
|
719
|
+
|
|
720
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/registry/type.mjs
|
|
696
721
|
var type_exports2 = {};
|
|
697
722
|
__export(type_exports2, {
|
|
698
723
|
Clear: () => Clear2,
|
|
@@ -721,6 +746,8 @@ function Set3(kind, func) {
|
|
|
721
746
|
function Get2(kind) {
|
|
722
747
|
return map2.get(kind);
|
|
723
748
|
}
|
|
749
|
+
|
|
750
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/sets/set.mjs
|
|
724
751
|
function SetIncludes(T, S) {
|
|
725
752
|
return T.includes(S);
|
|
726
753
|
}
|
|
@@ -744,21 +771,33 @@ function SetUnionMany(T) {
|
|
|
744
771
|
Acc.push(...L);
|
|
745
772
|
return Acc;
|
|
746
773
|
}
|
|
774
|
+
|
|
775
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/any/any.mjs
|
|
747
776
|
function Any(options) {
|
|
748
777
|
return CreateType({ [Kind]: "Any" }, options);
|
|
749
778
|
}
|
|
779
|
+
|
|
780
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/array/array.mjs
|
|
750
781
|
function Array2(items, options) {
|
|
751
782
|
return CreateType({ [Kind]: "Array", type: "array", items }, options);
|
|
752
783
|
}
|
|
784
|
+
|
|
785
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/argument/argument.mjs
|
|
753
786
|
function Argument(index) {
|
|
754
787
|
return CreateType({ [Kind]: "Argument", index });
|
|
755
788
|
}
|
|
789
|
+
|
|
790
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/async-iterator/async-iterator.mjs
|
|
756
791
|
function AsyncIterator(items, options) {
|
|
757
792
|
return CreateType({ [Kind]: "AsyncIterator", type: "AsyncIterator", items }, options);
|
|
758
793
|
}
|
|
794
|
+
|
|
795
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/computed/computed.mjs
|
|
759
796
|
function Computed(target, parameters, options) {
|
|
760
797
|
return CreateType({ [Kind]: "Computed", target, parameters }, options);
|
|
761
798
|
}
|
|
799
|
+
|
|
800
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/discard/discard.mjs
|
|
762
801
|
function DiscardKey(value, key) {
|
|
763
802
|
const { [key]: _, ...rest } = value;
|
|
764
803
|
return rest;
|
|
@@ -766,24 +805,36 @@ function DiscardKey(value, key) {
|
|
|
766
805
|
function Discard(value, keys) {
|
|
767
806
|
return keys.reduce((acc, key) => DiscardKey(acc, key), value);
|
|
768
807
|
}
|
|
808
|
+
|
|
809
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/never/never.mjs
|
|
769
810
|
function Never(options) {
|
|
770
811
|
return CreateType({ [Kind]: "Never", not: {} }, options);
|
|
771
812
|
}
|
|
813
|
+
|
|
814
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/mapped/mapped-result.mjs
|
|
772
815
|
function MappedResult(properties) {
|
|
773
816
|
return CreateType({
|
|
774
817
|
[Kind]: "MappedResult",
|
|
775
818
|
properties
|
|
776
819
|
});
|
|
777
820
|
}
|
|
821
|
+
|
|
822
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/constructor/constructor.mjs
|
|
778
823
|
function Constructor(parameters, returns, options) {
|
|
779
824
|
return CreateType({ [Kind]: "Constructor", type: "Constructor", parameters, returns }, options);
|
|
780
825
|
}
|
|
826
|
+
|
|
827
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/function/function.mjs
|
|
781
828
|
function Function(parameters, returns, options) {
|
|
782
829
|
return CreateType({ [Kind]: "Function", type: "Function", parameters, returns }, options);
|
|
783
830
|
}
|
|
831
|
+
|
|
832
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/union/union-create.mjs
|
|
784
833
|
function UnionCreate(T, options) {
|
|
785
834
|
return CreateType({ [Kind]: "Union", anyOf: T }, options);
|
|
786
835
|
}
|
|
836
|
+
|
|
837
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/union/union-evaluated.mjs
|
|
787
838
|
function IsUnionOptional(types) {
|
|
788
839
|
return types.some((type) => IsOptional(type));
|
|
789
840
|
}
|
|
@@ -800,9 +851,13 @@ function ResolveUnion(types, options) {
|
|
|
800
851
|
function UnionEvaluated(T, options) {
|
|
801
852
|
return T.length === 1 ? CreateType(T[0], options) : T.length === 0 ? Never(options) : ResolveUnion(T, options);
|
|
802
853
|
}
|
|
854
|
+
|
|
855
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/union/union.mjs
|
|
803
856
|
function Union(types, options) {
|
|
804
857
|
return types.length === 0 ? Never(options) : types.length === 1 ? CreateType(types[0], options) : UnionCreate(types, options);
|
|
805
858
|
}
|
|
859
|
+
|
|
860
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/template-literal/parse.mjs
|
|
806
861
|
var TemplateLiteralParserError = class extends TypeBoxError {
|
|
807
862
|
};
|
|
808
863
|
function Unescape(pattern) {
|
|
@@ -925,6 +980,8 @@ function TemplateLiteralParse(pattern) {
|
|
|
925
980
|
function TemplateLiteralParseExact(pattern) {
|
|
926
981
|
return TemplateLiteralParse(pattern.slice(1, pattern.length - 1));
|
|
927
982
|
}
|
|
983
|
+
|
|
984
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/template-literal/finite.mjs
|
|
928
985
|
var TemplateLiteralFiniteError = class extends TypeBoxError {
|
|
929
986
|
};
|
|
930
987
|
function IsNumberExpression(expression) {
|
|
@@ -945,6 +1002,8 @@ function IsTemplateLiteralFinite(schema) {
|
|
|
945
1002
|
const expression = TemplateLiteralParseExact(schema.pattern);
|
|
946
1003
|
return IsTemplateLiteralExpressionFinite(expression);
|
|
947
1004
|
}
|
|
1005
|
+
|
|
1006
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/template-literal/generate.mjs
|
|
948
1007
|
var TemplateLiteralGenerateError = class extends TypeBoxError {
|
|
949
1008
|
};
|
|
950
1009
|
function* GenerateReduce(buffer) {
|
|
@@ -975,6 +1034,8 @@ function TemplateLiteralGenerate(schema) {
|
|
|
975
1034
|
const expression = TemplateLiteralParseExact(schema.pattern);
|
|
976
1035
|
return IsTemplateLiteralExpressionFinite(expression) ? [...TemplateLiteralExpressionGenerate(expression)] : [];
|
|
977
1036
|
}
|
|
1037
|
+
|
|
1038
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/literal/literal.mjs
|
|
978
1039
|
function Literal(value, options) {
|
|
979
1040
|
return CreateType({
|
|
980
1041
|
[Kind]: "Literal",
|
|
@@ -982,18 +1043,28 @@ function Literal(value, options) {
|
|
|
982
1043
|
type: typeof value
|
|
983
1044
|
}, options);
|
|
984
1045
|
}
|
|
1046
|
+
|
|
1047
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/boolean/boolean.mjs
|
|
985
1048
|
function Boolean2(options) {
|
|
986
1049
|
return CreateType({ [Kind]: "Boolean", type: "boolean" }, options);
|
|
987
1050
|
}
|
|
1051
|
+
|
|
1052
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/bigint/bigint.mjs
|
|
988
1053
|
function BigInt2(options) {
|
|
989
1054
|
return CreateType({ [Kind]: "BigInt", type: "bigint" }, options);
|
|
990
1055
|
}
|
|
1056
|
+
|
|
1057
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/number/number.mjs
|
|
991
1058
|
function Number2(options) {
|
|
992
1059
|
return CreateType({ [Kind]: "Number", type: "number" }, options);
|
|
993
1060
|
}
|
|
1061
|
+
|
|
1062
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/string/string.mjs
|
|
994
1063
|
function String2(options) {
|
|
995
1064
|
return CreateType({ [Kind]: "String", type: "string" }, options);
|
|
996
1065
|
}
|
|
1066
|
+
|
|
1067
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/template-literal/syntax.mjs
|
|
997
1068
|
function* FromUnion(syntax) {
|
|
998
1069
|
const trim = syntax.trim().replace(/"|'/g, "");
|
|
999
1070
|
return trim === "boolean" ? yield Boolean2() : trim === "number" ? yield Number2() : trim === "bigint" ? yield BigInt2() : trim === "string" ? yield String2() : yield (() => {
|
|
@@ -1029,6 +1100,8 @@ function* FromSyntax(syntax) {
|
|
|
1029
1100
|
function TemplateLiteralSyntax(syntax) {
|
|
1030
1101
|
return [...FromSyntax(syntax)];
|
|
1031
1102
|
}
|
|
1103
|
+
|
|
1104
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/template-literal/pattern.mjs
|
|
1032
1105
|
var TemplateLiteralPatternError = class extends TypeBoxError {
|
|
1033
1106
|
};
|
|
1034
1107
|
function Escape(value) {
|
|
@@ -1042,15 +1115,21 @@ function Visit2(schema, acc) {
|
|
|
1042
1115
|
function TemplateLiteralPattern(kinds) {
|
|
1043
1116
|
return `^${kinds.map((schema) => Visit2(schema, "")).join("")}$`;
|
|
1044
1117
|
}
|
|
1118
|
+
|
|
1119
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/template-literal/union.mjs
|
|
1045
1120
|
function TemplateLiteralToUnion(schema) {
|
|
1046
1121
|
const R = TemplateLiteralGenerate(schema);
|
|
1047
1122
|
const L = R.map((S) => Literal(S));
|
|
1048
1123
|
return UnionEvaluated(L);
|
|
1049
1124
|
}
|
|
1125
|
+
|
|
1126
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/template-literal/template-literal.mjs
|
|
1050
1127
|
function TemplateLiteral(unresolved, options) {
|
|
1051
1128
|
const pattern = IsString(unresolved) ? TemplateLiteralPattern(TemplateLiteralSyntax(unresolved)) : TemplateLiteralPattern(unresolved);
|
|
1052
1129
|
return CreateType({ [Kind]: "TemplateLiteral", type: "string", pattern }, options);
|
|
1053
1130
|
}
|
|
1131
|
+
|
|
1132
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-property-keys.mjs
|
|
1054
1133
|
function FromTemplateLiteral(templateLiteral) {
|
|
1055
1134
|
const keys = TemplateLiteralGenerate(templateLiteral);
|
|
1056
1135
|
return keys.map((key) => key.toString());
|
|
@@ -1067,6 +1146,8 @@ function FromLiteral(literalValue) {
|
|
|
1067
1146
|
function IndexPropertyKeys(type) {
|
|
1068
1147
|
return [...new Set(IsTemplateLiteral(type) ? FromTemplateLiteral(type) : IsUnion(type) ? FromUnion2(type.anyOf) : IsLiteral(type) ? FromLiteral(type.const) : IsNumber3(type) ? ["[number]"] : IsInteger2(type) ? ["[number]"] : [])];
|
|
1069
1148
|
}
|
|
1149
|
+
|
|
1150
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-result.mjs
|
|
1070
1151
|
function FromProperties(type, properties, options) {
|
|
1071
1152
|
const result = {};
|
|
1072
1153
|
for (const K2 of Object.getOwnPropertyNames(properties)) {
|
|
@@ -1081,6 +1162,8 @@ function IndexFromMappedResult(type, mappedResult, options) {
|
|
|
1081
1162
|
const properties = FromMappedResult(type, mappedResult, options);
|
|
1082
1163
|
return MappedResult(properties);
|
|
1083
1164
|
}
|
|
1165
|
+
|
|
1166
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed.mjs
|
|
1084
1167
|
function FromRest(types, key) {
|
|
1085
1168
|
return types.map((type) => IndexFromPropertyKey(type, key));
|
|
1086
1169
|
}
|
|
@@ -1127,6 +1210,8 @@ function Index(type, key, options) {
|
|
|
1127
1210
|
return IndexFromMappedKey(type, key, options);
|
|
1128
1211
|
return CreateType(IsSchema(key) ? FromSchema(type, IndexPropertyKeys(key)) : FromSchema(type, key), options);
|
|
1129
1212
|
}
|
|
1213
|
+
|
|
1214
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-key.mjs
|
|
1130
1215
|
function MappedIndexPropertyKey(type, key, options) {
|
|
1131
1216
|
return { [key]: Index(type, [key], Clone(options)) };
|
|
1132
1217
|
}
|
|
@@ -1142,9 +1227,13 @@ function IndexFromMappedKey(type, mappedKey, options) {
|
|
|
1142
1227
|
const properties = MappedIndexProperties(type, mappedKey, options);
|
|
1143
1228
|
return MappedResult(properties);
|
|
1144
1229
|
}
|
|
1230
|
+
|
|
1231
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/iterator/iterator.mjs
|
|
1145
1232
|
function Iterator(items, options) {
|
|
1146
1233
|
return CreateType({ [Kind]: "Iterator", type: "Iterator", items }, options);
|
|
1147
1234
|
}
|
|
1235
|
+
|
|
1236
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/object/object.mjs
|
|
1148
1237
|
function RequiredArray(properties) {
|
|
1149
1238
|
return globalThis.Object.keys(properties).filter((key) => !IsOptional(properties[key]));
|
|
1150
1239
|
}
|
|
@@ -1154,9 +1243,13 @@ function _Object_(properties, options) {
|
|
|
1154
1243
|
return CreateType(schema, options);
|
|
1155
1244
|
}
|
|
1156
1245
|
var Object2 = _Object_;
|
|
1246
|
+
|
|
1247
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/promise/promise.mjs
|
|
1157
1248
|
function Promise2(item, options) {
|
|
1158
1249
|
return CreateType({ [Kind]: "Promise", type: "Promise", item }, options);
|
|
1159
1250
|
}
|
|
1251
|
+
|
|
1252
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/readonly/readonly.mjs
|
|
1160
1253
|
function RemoveReadonly(schema) {
|
|
1161
1254
|
return CreateType(Discard(schema, [ReadonlyKind]));
|
|
1162
1255
|
}
|
|
@@ -1170,6 +1263,8 @@ function Readonly(schema, enable) {
|
|
|
1170
1263
|
const F = enable ?? true;
|
|
1171
1264
|
return IsMappedResult(schema) ? ReadonlyFromMappedResult(schema, F) : ReadonlyWithFlag(schema, F);
|
|
1172
1265
|
}
|
|
1266
|
+
|
|
1267
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/readonly/readonly-from-mapped-result.mjs
|
|
1173
1268
|
function FromProperties2(K, F) {
|
|
1174
1269
|
const Acc = {};
|
|
1175
1270
|
for (const K2 of globalThis.Object.getOwnPropertyNames(K))
|
|
@@ -1183,9 +1278,13 @@ function ReadonlyFromMappedResult(R, F) {
|
|
|
1183
1278
|
const P = FromMappedResult2(R, F);
|
|
1184
1279
|
return MappedResult(P);
|
|
1185
1280
|
}
|
|
1281
|
+
|
|
1282
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/tuple/tuple.mjs
|
|
1186
1283
|
function Tuple(types, options) {
|
|
1187
1284
|
return CreateType(types.length > 0 ? { [Kind]: "Tuple", type: "array", items: types, additionalItems: false, minItems: types.length, maxItems: types.length } : { [Kind]: "Tuple", type: "array", minItems: types.length, maxItems: types.length }, options);
|
|
1188
1285
|
}
|
|
1286
|
+
|
|
1287
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/mapped/mapped.mjs
|
|
1189
1288
|
function FromMappedResult3(K, P) {
|
|
1190
1289
|
return K in P ? FromSchemaType(K, P[K]) : MappedResult(P);
|
|
1191
1290
|
}
|
|
@@ -1239,6 +1338,8 @@ function Mapped(key, map3, options) {
|
|
|
1239
1338
|
const R = MappedFunctionReturnType(K, RT);
|
|
1240
1339
|
return Object2(R, options);
|
|
1241
1340
|
}
|
|
1341
|
+
|
|
1342
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/optional/optional.mjs
|
|
1242
1343
|
function RemoveOptional(schema) {
|
|
1243
1344
|
return CreateType(Discard(schema, [OptionalKind]));
|
|
1244
1345
|
}
|
|
@@ -1252,6 +1353,8 @@ function Optional(schema, enable) {
|
|
|
1252
1353
|
const F = enable ?? true;
|
|
1253
1354
|
return IsMappedResult(schema) ? OptionalFromMappedResult(schema, F) : OptionalWithFlag(schema, F);
|
|
1254
1355
|
}
|
|
1356
|
+
|
|
1357
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/optional/optional-from-mapped-result.mjs
|
|
1255
1358
|
function FromProperties4(P, F) {
|
|
1256
1359
|
const Acc = {};
|
|
1257
1360
|
for (const K2 of globalThis.Object.getOwnPropertyNames(P))
|
|
@@ -1265,11 +1368,15 @@ function OptionalFromMappedResult(R, F) {
|
|
|
1265
1368
|
const P = FromMappedResult4(R, F);
|
|
1266
1369
|
return MappedResult(P);
|
|
1267
1370
|
}
|
|
1371
|
+
|
|
1372
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-create.mjs
|
|
1268
1373
|
function IntersectCreate(T, options = {}) {
|
|
1269
1374
|
const allObjects = T.every((schema) => IsObject3(schema));
|
|
1270
1375
|
const clonedUnevaluatedProperties = IsSchema(options.unevaluatedProperties) ? { unevaluatedProperties: options.unevaluatedProperties } : {};
|
|
1271
1376
|
return CreateType(options.unevaluatedProperties === false || IsSchema(options.unevaluatedProperties) || allObjects ? { ...clonedUnevaluatedProperties, [Kind]: "Intersect", type: "object", allOf: T } : { ...clonedUnevaluatedProperties, [Kind]: "Intersect", allOf: T }, options);
|
|
1272
1377
|
}
|
|
1378
|
+
|
|
1379
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-evaluated.mjs
|
|
1273
1380
|
function IsIntersectOptional(types) {
|
|
1274
1381
|
return types.every((left) => IsOptional(left));
|
|
1275
1382
|
}
|
|
@@ -1291,6 +1398,8 @@ function IntersectEvaluated(types, options = {}) {
|
|
|
1291
1398
|
throw new Error("Cannot intersect transform types");
|
|
1292
1399
|
return ResolveIntersect(types, options);
|
|
1293
1400
|
}
|
|
1401
|
+
|
|
1402
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect.mjs
|
|
1294
1403
|
function Intersect(types, options) {
|
|
1295
1404
|
if (types.length === 1)
|
|
1296
1405
|
return CreateType(types[0], options);
|
|
@@ -1300,12 +1409,16 @@ function Intersect(types, options) {
|
|
|
1300
1409
|
throw new Error("Cannot intersect transform types");
|
|
1301
1410
|
return IntersectCreate(types, options);
|
|
1302
1411
|
}
|
|
1412
|
+
|
|
1413
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/ref/ref.mjs
|
|
1303
1414
|
function Ref(...args) {
|
|
1304
1415
|
const [$ref, options] = typeof args[0] === "string" ? [args[0], args[1]] : [args[0].$id, args[1]];
|
|
1305
1416
|
if (typeof $ref !== "string")
|
|
1306
1417
|
throw new TypeBoxError("Ref: $ref must be a string");
|
|
1307
1418
|
return CreateType({ [Kind]: "Ref", $ref }, options);
|
|
1308
1419
|
}
|
|
1420
|
+
|
|
1421
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/awaited/awaited.mjs
|
|
1309
1422
|
function FromComputed(target, parameters) {
|
|
1310
1423
|
return Computed("Awaited", [Computed(target, parameters)]);
|
|
1311
1424
|
}
|
|
@@ -1327,6 +1440,8 @@ function FromRest3(types) {
|
|
|
1327
1440
|
function Awaited(type, options) {
|
|
1328
1441
|
return CreateType(IsComputed(type) ? FromComputed(type.target, type.parameters) : IsIntersect(type) ? FromIntersect2(type.allOf) : IsUnion(type) ? FromUnion4(type.anyOf) : IsPromise2(type) ? FromPromise(type.item) : IsRef(type) ? FromRef(type.$ref) : type, options);
|
|
1329
1442
|
}
|
|
1443
|
+
|
|
1444
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-property-keys.mjs
|
|
1330
1445
|
function FromRest4(types) {
|
|
1331
1446
|
const result = [];
|
|
1332
1447
|
for (const L of types)
|
|
@@ -1371,6 +1486,8 @@ function KeyOfPattern(schema) {
|
|
|
1371
1486
|
const pattern = keys.map((key) => `(${key})`);
|
|
1372
1487
|
return `^(${pattern.join("|")})$`;
|
|
1373
1488
|
}
|
|
1489
|
+
|
|
1490
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof.mjs
|
|
1374
1491
|
function FromComputed2(target, parameters) {
|
|
1375
1492
|
return Computed("KeyOf", [Computed(target, parameters)]);
|
|
1376
1493
|
}
|
|
@@ -1389,6 +1506,8 @@ function KeyOfPropertyKeysToRest(propertyKeys) {
|
|
|
1389
1506
|
function KeyOf(type, options) {
|
|
1390
1507
|
return IsComputed(type) ? FromComputed2(type.target, type.parameters) : IsRef(type) ? FromRef2(type.$ref) : IsMappedResult(type) ? KeyOfFromMappedResult(type, options) : KeyOfFromType(type, options);
|
|
1391
1508
|
}
|
|
1509
|
+
|
|
1510
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-from-mapped-result.mjs
|
|
1392
1511
|
function FromProperties6(properties, options) {
|
|
1393
1512
|
const result = {};
|
|
1394
1513
|
for (const K2 of globalThis.Object.getOwnPropertyNames(properties))
|
|
@@ -1402,11 +1521,15 @@ function KeyOfFromMappedResult(mappedResult, options) {
|
|
|
1402
1521
|
const properties = FromMappedResult5(mappedResult, options);
|
|
1403
1522
|
return MappedResult(properties);
|
|
1404
1523
|
}
|
|
1524
|
+
|
|
1525
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-property-entries.mjs
|
|
1405
1526
|
function KeyOfPropertyEntries(schema) {
|
|
1406
1527
|
const keys = KeyOfPropertyKeys(schema);
|
|
1407
1528
|
const schemas = IndexFromPropertyKeys(schema, keys);
|
|
1408
1529
|
return keys.map((_, index) => [keys[index], schemas[index]]);
|
|
1409
1530
|
}
|
|
1531
|
+
|
|
1532
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/composite/composite.mjs
|
|
1410
1533
|
function CompositeKeys(T) {
|
|
1411
1534
|
const Acc = [];
|
|
1412
1535
|
for (const L of T)
|
|
@@ -1435,24 +1558,38 @@ function Composite(T, options) {
|
|
|
1435
1558
|
const R = Object2(P, options);
|
|
1436
1559
|
return R;
|
|
1437
1560
|
}
|
|
1561
|
+
|
|
1562
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/date/date.mjs
|
|
1438
1563
|
function Date2(options) {
|
|
1439
1564
|
return CreateType({ [Kind]: "Date", type: "Date" }, options);
|
|
1440
1565
|
}
|
|
1566
|
+
|
|
1567
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/null/null.mjs
|
|
1441
1568
|
function Null(options) {
|
|
1442
1569
|
return CreateType({ [Kind]: "Null", type: "null" }, options);
|
|
1443
1570
|
}
|
|
1571
|
+
|
|
1572
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/symbol/symbol.mjs
|
|
1444
1573
|
function Symbol2(options) {
|
|
1445
1574
|
return CreateType({ [Kind]: "Symbol", type: "symbol" }, options);
|
|
1446
1575
|
}
|
|
1576
|
+
|
|
1577
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/undefined/undefined.mjs
|
|
1447
1578
|
function Undefined(options) {
|
|
1448
1579
|
return CreateType({ [Kind]: "Undefined", type: "undefined" }, options);
|
|
1449
1580
|
}
|
|
1581
|
+
|
|
1582
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/uint8array/uint8array.mjs
|
|
1450
1583
|
function Uint8Array2(options) {
|
|
1451
1584
|
return CreateType({ [Kind]: "Uint8Array", type: "Uint8Array" }, options);
|
|
1452
1585
|
}
|
|
1586
|
+
|
|
1587
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/unknown/unknown.mjs
|
|
1453
1588
|
function Unknown(options) {
|
|
1454
1589
|
return CreateType({ [Kind]: "Unknown" }, options);
|
|
1455
1590
|
}
|
|
1591
|
+
|
|
1592
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/const/const.mjs
|
|
1456
1593
|
function FromArray3(T) {
|
|
1457
1594
|
return T.map((L) => FromValue(L, false));
|
|
1458
1595
|
}
|
|
@@ -1471,9 +1608,13 @@ function FromValue(value, root) {
|
|
|
1471
1608
|
function Const(T, options) {
|
|
1472
1609
|
return CreateType(FromValue(T, true), options);
|
|
1473
1610
|
}
|
|
1611
|
+
|
|
1612
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/constructor-parameters/constructor-parameters.mjs
|
|
1474
1613
|
function ConstructorParameters(schema, options) {
|
|
1475
1614
|
return IsConstructor(schema) ? Tuple(schema.parameters, options) : Never(options);
|
|
1476
1615
|
}
|
|
1616
|
+
|
|
1617
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/enum/enum.mjs
|
|
1477
1618
|
function Enum(item, options) {
|
|
1478
1619
|
if (IsUndefined(item))
|
|
1479
1620
|
throw new Error("Enum undefined or empty");
|
|
@@ -1482,6 +1623,8 @@ function Enum(item, options) {
|
|
|
1482
1623
|
const anyOf = values2.map((value) => Literal(value));
|
|
1483
1624
|
return Union(anyOf, { ...options, [Hint]: "Enum" });
|
|
1484
1625
|
}
|
|
1626
|
+
|
|
1627
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/extends/extends-check.mjs
|
|
1485
1628
|
var ExtendsResolverError = class extends TypeBoxError {
|
|
1486
1629
|
};
|
|
1487
1630
|
var ExtendsResult;
|
|
@@ -1731,6 +1874,8 @@ function Visit3(left, right) {
|
|
|
1731
1874
|
function ExtendsCheck(left, right) {
|
|
1732
1875
|
return Visit3(left, right);
|
|
1733
1876
|
}
|
|
1877
|
+
|
|
1878
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-result.mjs
|
|
1734
1879
|
function FromProperties8(P, Right, True, False, options) {
|
|
1735
1880
|
const Acc = {};
|
|
1736
1881
|
for (const K2 of globalThis.Object.getOwnPropertyNames(P))
|
|
@@ -1744,6 +1889,8 @@ function ExtendsFromMappedResult(Left, Right, True, False, options) {
|
|
|
1744
1889
|
const P = FromMappedResult6(Left, Right, True, False, options);
|
|
1745
1890
|
return MappedResult(P);
|
|
1746
1891
|
}
|
|
1892
|
+
|
|
1893
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/extends/extends.mjs
|
|
1747
1894
|
function ExtendsResolve(left, right, trueType, falseType) {
|
|
1748
1895
|
const R = ExtendsCheck(left, right);
|
|
1749
1896
|
return R === ExtendsResult.Union ? Union([trueType, falseType]) : R === ExtendsResult.True ? trueType : falseType;
|
|
@@ -1751,6 +1898,8 @@ function ExtendsResolve(left, right, trueType, falseType) {
|
|
|
1751
1898
|
function Extends(L, R, T, F, options) {
|
|
1752
1899
|
return IsMappedResult(L) ? ExtendsFromMappedResult(L, R, T, F, options) : IsMappedKey(L) ? CreateType(ExtendsFromMappedKey(L, R, T, F, options)) : CreateType(ExtendsResolve(L, R, T, F), options);
|
|
1753
1900
|
}
|
|
1901
|
+
|
|
1902
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-key.mjs
|
|
1754
1903
|
function FromPropertyKey(K, U, L, R, options) {
|
|
1755
1904
|
return {
|
|
1756
1905
|
[K]: Extends(Literal(K), U, L, R, Clone(options))
|
|
@@ -1768,6 +1917,8 @@ function ExtendsFromMappedKey(T, U, L, R, options) {
|
|
|
1768
1917
|
const P = FromMappedKey2(T, U, L, R, options);
|
|
1769
1918
|
return MappedResult(P);
|
|
1770
1919
|
}
|
|
1920
|
+
|
|
1921
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/extends/extends-undefined.mjs
|
|
1771
1922
|
function Intersect2(schema) {
|
|
1772
1923
|
return schema.allOf.every((schema2) => ExtendsUndefinedCheck(schema2));
|
|
1773
1924
|
}
|
|
@@ -1780,9 +1931,13 @@ function Not(schema) {
|
|
|
1780
1931
|
function ExtendsUndefinedCheck(schema) {
|
|
1781
1932
|
return schema[Kind] === "Intersect" ? Intersect2(schema) : schema[Kind] === "Union" ? Union2(schema) : schema[Kind] === "Not" ? Not(schema) : schema[Kind] === "Undefined" ? true : false;
|
|
1782
1933
|
}
|
|
1934
|
+
|
|
1935
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-template-literal.mjs
|
|
1783
1936
|
function ExcludeFromTemplateLiteral(L, R) {
|
|
1784
1937
|
return Exclude(TemplateLiteralToUnion(L), R);
|
|
1785
1938
|
}
|
|
1939
|
+
|
|
1940
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/exclude/exclude.mjs
|
|
1786
1941
|
function ExcludeRest(L, R) {
|
|
1787
1942
|
const excluded = L.filter((inner) => ExtendsCheck(inner, R) === ExtendsResult.False);
|
|
1788
1943
|
return excluded.length === 1 ? excluded[0] : Union(excluded);
|
|
@@ -1794,6 +1949,8 @@ function Exclude(L, R, options = {}) {
|
|
|
1794
1949
|
return CreateType(ExcludeFromMappedResult(L, R), options);
|
|
1795
1950
|
return CreateType(IsUnion(L) ? ExcludeRest(L.anyOf, R) : ExtendsCheck(L, R) !== ExtendsResult.False ? Never() : L, options);
|
|
1796
1951
|
}
|
|
1952
|
+
|
|
1953
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-mapped-result.mjs
|
|
1797
1954
|
function FromProperties9(P, U) {
|
|
1798
1955
|
const Acc = {};
|
|
1799
1956
|
for (const K2 of globalThis.Object.getOwnPropertyNames(P))
|
|
@@ -1807,9 +1964,13 @@ function ExcludeFromMappedResult(R, T) {
|
|
|
1807
1964
|
const P = FromMappedResult7(R, T);
|
|
1808
1965
|
return MappedResult(P);
|
|
1809
1966
|
}
|
|
1967
|
+
|
|
1968
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-template-literal.mjs
|
|
1810
1969
|
function ExtractFromTemplateLiteral(L, R) {
|
|
1811
1970
|
return Extract(TemplateLiteralToUnion(L), R);
|
|
1812
1971
|
}
|
|
1972
|
+
|
|
1973
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/extract/extract.mjs
|
|
1813
1974
|
function ExtractRest(L, R) {
|
|
1814
1975
|
const extracted = L.filter((inner) => ExtendsCheck(inner, R) !== ExtendsResult.False);
|
|
1815
1976
|
return extracted.length === 1 ? extracted[0] : Union(extracted);
|
|
@@ -1821,6 +1982,8 @@ function Extract(L, R, options) {
|
|
|
1821
1982
|
return CreateType(ExtractFromMappedResult(L, R), options);
|
|
1822
1983
|
return CreateType(IsUnion(L) ? ExtractRest(L.anyOf, R) : ExtendsCheck(L, R) !== ExtendsResult.False ? L : Never(), options);
|
|
1823
1984
|
}
|
|
1985
|
+
|
|
1986
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-mapped-result.mjs
|
|
1824
1987
|
function FromProperties10(P, T) {
|
|
1825
1988
|
const Acc = {};
|
|
1826
1989
|
for (const K2 of globalThis.Object.getOwnPropertyNames(P))
|
|
@@ -1834,12 +1997,18 @@ function ExtractFromMappedResult(R, T) {
|
|
|
1834
1997
|
const P = FromMappedResult8(R, T);
|
|
1835
1998
|
return MappedResult(P);
|
|
1836
1999
|
}
|
|
2000
|
+
|
|
2001
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/instance-type/instance-type.mjs
|
|
1837
2002
|
function InstanceType(schema, options) {
|
|
1838
2003
|
return IsConstructor(schema) ? CreateType(schema.returns, options) : Never(options);
|
|
1839
2004
|
}
|
|
2005
|
+
|
|
2006
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/readonly-optional/readonly-optional.mjs
|
|
1840
2007
|
function ReadonlyOptional(schema) {
|
|
1841
2008
|
return Readonly(Optional(schema));
|
|
1842
2009
|
}
|
|
2010
|
+
|
|
2011
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/record/record.mjs
|
|
1843
2012
|
function RecordCreateFromPattern(pattern, T, options) {
|
|
1844
2013
|
return CreateType({ [Kind]: "Record", type: "object", patternProperties: { [pattern]: T } }, options);
|
|
1845
2014
|
}
|
|
@@ -1893,6 +2062,8 @@ function RecordKey2(type) {
|
|
|
1893
2062
|
function RecordValue2(type) {
|
|
1894
2063
|
return type.patternProperties[RecordPattern(type)];
|
|
1895
2064
|
}
|
|
2065
|
+
|
|
2066
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/instantiate/instantiate.mjs
|
|
1896
2067
|
function FromConstructor2(args, type) {
|
|
1897
2068
|
type.parameters = FromTypes(args, type.parameters);
|
|
1898
2069
|
type.returns = FromType(args, type.returns);
|
|
@@ -1966,9 +2137,13 @@ function FromType(args, type) {
|
|
|
1966
2137
|
function Instantiate(type, args) {
|
|
1967
2138
|
return FromType(args, CloneType(type));
|
|
1968
2139
|
}
|
|
2140
|
+
|
|
2141
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/integer/integer.mjs
|
|
1969
2142
|
function Integer(options) {
|
|
1970
2143
|
return CreateType({ [Kind]: "Integer", type: "integer" }, options);
|
|
1971
2144
|
}
|
|
2145
|
+
|
|
2146
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic-from-mapped-key.mjs
|
|
1972
2147
|
function MappedIntrinsicPropertyKey(K, M, options) {
|
|
1973
2148
|
return {
|
|
1974
2149
|
[K]: Intrinsic(Literal(K), M, Clone(options))
|
|
@@ -1987,6 +2162,8 @@ function IntrinsicFromMappedKey(T, M, options) {
|
|
|
1987
2162
|
const P = MappedIntrinsicProperties(T, M, options);
|
|
1988
2163
|
return MappedResult(P);
|
|
1989
2164
|
}
|
|
2165
|
+
|
|
2166
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic.mjs
|
|
1990
2167
|
function ApplyUncapitalize(value) {
|
|
1991
2168
|
const [first, rest] = [value.slice(0, 1), value.slice(1)];
|
|
1992
2169
|
return [first.toLowerCase(), rest].join("");
|
|
@@ -2030,18 +2207,28 @@ function Intrinsic(schema, mode, options = {}) {
|
|
|
2030
2207
|
)
|
|
2031
2208
|
);
|
|
2032
2209
|
}
|
|
2210
|
+
|
|
2211
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/intrinsic/capitalize.mjs
|
|
2033
2212
|
function Capitalize(T, options = {}) {
|
|
2034
2213
|
return Intrinsic(T, "Capitalize", options);
|
|
2035
2214
|
}
|
|
2215
|
+
|
|
2216
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/intrinsic/lowercase.mjs
|
|
2036
2217
|
function Lowercase(T, options = {}) {
|
|
2037
2218
|
return Intrinsic(T, "Lowercase", options);
|
|
2038
2219
|
}
|
|
2220
|
+
|
|
2221
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/intrinsic/uncapitalize.mjs
|
|
2039
2222
|
function Uncapitalize(T, options = {}) {
|
|
2040
2223
|
return Intrinsic(T, "Uncapitalize", options);
|
|
2041
2224
|
}
|
|
2225
|
+
|
|
2226
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/intrinsic/uppercase.mjs
|
|
2042
2227
|
function Uppercase(T, options = {}) {
|
|
2043
2228
|
return Intrinsic(T, "Uppercase", options);
|
|
2044
2229
|
}
|
|
2230
|
+
|
|
2231
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-result.mjs
|
|
2045
2232
|
function FromProperties12(properties, propertyKeys, options) {
|
|
2046
2233
|
const result = {};
|
|
2047
2234
|
for (const K2 of globalThis.Object.getOwnPropertyNames(properties))
|
|
@@ -2055,6 +2242,8 @@ function OmitFromMappedResult(mappedResult, propertyKeys, options) {
|
|
|
2055
2242
|
const properties = FromMappedResult9(mappedResult, propertyKeys, options);
|
|
2056
2243
|
return MappedResult(properties);
|
|
2057
2244
|
}
|
|
2245
|
+
|
|
2246
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/omit/omit.mjs
|
|
2058
2247
|
function FromIntersect6(types, propertyKeys) {
|
|
2059
2248
|
return types.map((type) => OmitResolve(type, propertyKeys));
|
|
2060
2249
|
}
|
|
@@ -2087,6 +2276,8 @@ function Omit(type, key, options) {
|
|
|
2087
2276
|
const isKeyRef = IsRef(key);
|
|
2088
2277
|
return IsMappedResult(type) ? OmitFromMappedResult(type, propertyKeys, options) : IsMappedKey(key) ? OmitFromMappedKey(type, key, options) : isTypeRef && isKeyRef ? Computed("Omit", [type, typeKey], options) : !isTypeRef && isKeyRef ? Computed("Omit", [type, typeKey], options) : isTypeRef && !isKeyRef ? Computed("Omit", [type, typeKey], options) : CreateType({ ...OmitResolve(type, propertyKeys), ...options });
|
|
2089
2278
|
}
|
|
2279
|
+
|
|
2280
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-key.mjs
|
|
2090
2281
|
function FromPropertyKey2(type, key, options) {
|
|
2091
2282
|
return { [key]: Omit(type, [key], Clone(options)) };
|
|
2092
2283
|
}
|
|
@@ -2102,6 +2293,8 @@ function OmitFromMappedKey(type, mappedKey, options) {
|
|
|
2102
2293
|
const properties = FromMappedKey3(type, mappedKey, options);
|
|
2103
2294
|
return MappedResult(properties);
|
|
2104
2295
|
}
|
|
2296
|
+
|
|
2297
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-result.mjs
|
|
2105
2298
|
function FromProperties14(properties, propertyKeys, options) {
|
|
2106
2299
|
const result = {};
|
|
2107
2300
|
for (const K2 of globalThis.Object.getOwnPropertyNames(properties))
|
|
@@ -2115,6 +2308,8 @@ function PickFromMappedResult(mappedResult, propertyKeys, options) {
|
|
|
2115
2308
|
const properties = FromMappedResult10(mappedResult, propertyKeys, options);
|
|
2116
2309
|
return MappedResult(properties);
|
|
2117
2310
|
}
|
|
2311
|
+
|
|
2312
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/pick/pick.mjs
|
|
2118
2313
|
function FromIntersect7(types, propertyKeys) {
|
|
2119
2314
|
return types.map((type) => PickResolve(type, propertyKeys));
|
|
2120
2315
|
}
|
|
@@ -2147,6 +2342,8 @@ function Pick(type, key, options) {
|
|
|
2147
2342
|
const isKeyRef = IsRef(key);
|
|
2148
2343
|
return IsMappedResult(type) ? PickFromMappedResult(type, propertyKeys, options) : IsMappedKey(key) ? PickFromMappedKey(type, key, options) : isTypeRef && isKeyRef ? Computed("Pick", [type, typeKey], options) : !isTypeRef && isKeyRef ? Computed("Pick", [type, typeKey], options) : isTypeRef && !isKeyRef ? Computed("Pick", [type, typeKey], options) : CreateType({ ...PickResolve(type, propertyKeys), ...options });
|
|
2149
2344
|
}
|
|
2345
|
+
|
|
2346
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-key.mjs
|
|
2150
2347
|
function FromPropertyKey3(type, key, options) {
|
|
2151
2348
|
return {
|
|
2152
2349
|
[key]: Pick(type, [key], Clone(options))
|
|
@@ -2164,6 +2361,8 @@ function PickFromMappedKey(type, mappedKey, options) {
|
|
|
2164
2361
|
const properties = FromMappedKey4(type, mappedKey, options);
|
|
2165
2362
|
return MappedResult(properties);
|
|
2166
2363
|
}
|
|
2364
|
+
|
|
2365
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/partial/partial.mjs
|
|
2167
2366
|
function FromComputed3(target, parameters) {
|
|
2168
2367
|
return Computed("Partial", [Computed(target, parameters)]);
|
|
2169
2368
|
}
|
|
@@ -2203,6 +2402,8 @@ function Partial(type, options) {
|
|
|
2203
2402
|
return CreateType({ ...PartialResolve(type), ...options });
|
|
2204
2403
|
}
|
|
2205
2404
|
}
|
|
2405
|
+
|
|
2406
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/partial/partial-from-mapped-result.mjs
|
|
2206
2407
|
function FromProperties17(K, options) {
|
|
2207
2408
|
const Acc = {};
|
|
2208
2409
|
for (const K2 of globalThis.Object.getOwnPropertyNames(K))
|
|
@@ -2216,6 +2417,8 @@ function PartialFromMappedResult(R, options) {
|
|
|
2216
2417
|
const P = FromMappedResult11(R, options);
|
|
2217
2418
|
return MappedResult(P);
|
|
2218
2419
|
}
|
|
2420
|
+
|
|
2421
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/required/required.mjs
|
|
2219
2422
|
function FromComputed4(target, parameters) {
|
|
2220
2423
|
return Computed("Required", [Computed(target, parameters)]);
|
|
2221
2424
|
}
|
|
@@ -2255,6 +2458,8 @@ function Required(type, options) {
|
|
|
2255
2458
|
return CreateType({ ...RequiredResolve(type), ...options });
|
|
2256
2459
|
}
|
|
2257
2460
|
}
|
|
2461
|
+
|
|
2462
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/required/required-from-mapped-result.mjs
|
|
2258
2463
|
function FromProperties19(P, options) {
|
|
2259
2464
|
const Acc = {};
|
|
2260
2465
|
for (const K2 of globalThis.Object.getOwnPropertyNames(P))
|
|
@@ -2268,6 +2473,8 @@ function RequiredFromMappedResult(R, options) {
|
|
|
2268
2473
|
const P = FromMappedResult12(R, options);
|
|
2269
2474
|
return MappedResult(P);
|
|
2270
2475
|
}
|
|
2476
|
+
|
|
2477
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/module/compute.mjs
|
|
2271
2478
|
function DereferenceParameters(moduleProperties, types) {
|
|
2272
2479
|
return types.map((type) => {
|
|
2273
2480
|
return IsRef(type) ? Dereference(moduleProperties, type.$ref) : FromType2(moduleProperties, type);
|
|
@@ -2362,6 +2569,8 @@ function ComputeModuleProperties(moduleProperties) {
|
|
|
2362
2569
|
return { ...result, [key]: ComputeType(moduleProperties, key) };
|
|
2363
2570
|
}, {});
|
|
2364
2571
|
}
|
|
2572
|
+
|
|
2573
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/module/module.mjs
|
|
2365
2574
|
var TModule = class {
|
|
2366
2575
|
constructor($defs) {
|
|
2367
2576
|
const computed = ComputeModuleProperties($defs);
|
|
@@ -2383,12 +2592,18 @@ var TModule = class {
|
|
|
2383
2592
|
function Module(properties) {
|
|
2384
2593
|
return new TModule(properties);
|
|
2385
2594
|
}
|
|
2595
|
+
|
|
2596
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/not/not.mjs
|
|
2386
2597
|
function Not2(type, options) {
|
|
2387
2598
|
return CreateType({ [Kind]: "Not", not: type }, options);
|
|
2388
2599
|
}
|
|
2600
|
+
|
|
2601
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/parameters/parameters.mjs
|
|
2389
2602
|
function Parameters(schema, options) {
|
|
2390
2603
|
return IsFunction3(schema) ? Tuple(schema.parameters, options) : Never();
|
|
2391
2604
|
}
|
|
2605
|
+
|
|
2606
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/recursive/recursive.mjs
|
|
2392
2607
|
var Ordinal = 0;
|
|
2393
2608
|
function Recursive(callback, options = {}) {
|
|
2394
2609
|
if (IsUndefined(options.$id))
|
|
@@ -2397,19 +2612,27 @@ function Recursive(callback, options = {}) {
|
|
|
2397
2612
|
thisType.$id = options.$id;
|
|
2398
2613
|
return CreateType({ [Hint]: "Recursive", ...thisType }, options);
|
|
2399
2614
|
}
|
|
2615
|
+
|
|
2616
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/regexp/regexp.mjs
|
|
2400
2617
|
function RegExp2(unresolved, options) {
|
|
2401
2618
|
const expr = IsString(unresolved) ? new globalThis.RegExp(unresolved) : unresolved;
|
|
2402
2619
|
return CreateType({ [Kind]: "RegExp", type: "RegExp", source: expr.source, flags: expr.flags }, options);
|
|
2403
2620
|
}
|
|
2621
|
+
|
|
2622
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/rest/rest.mjs
|
|
2404
2623
|
function RestResolve(T) {
|
|
2405
2624
|
return IsIntersect(T) ? T.allOf : IsUnion(T) ? T.anyOf : IsTuple(T) ? T.items ?? [] : [];
|
|
2406
2625
|
}
|
|
2407
2626
|
function Rest(T) {
|
|
2408
2627
|
return RestResolve(T);
|
|
2409
2628
|
}
|
|
2629
|
+
|
|
2630
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/return-type/return-type.mjs
|
|
2410
2631
|
function ReturnType(schema, options) {
|
|
2411
2632
|
return IsFunction3(schema) ? CreateType(schema.returns, options) : Never(options);
|
|
2412
2633
|
}
|
|
2634
|
+
|
|
2635
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/transform/transform.mjs
|
|
2413
2636
|
var TransformDecodeBuilder = class {
|
|
2414
2637
|
constructor(schema) {
|
|
2415
2638
|
this.schema = schema;
|
|
@@ -2440,12 +2663,18 @@ var TransformEncodeBuilder = class {
|
|
|
2440
2663
|
function Transform(schema) {
|
|
2441
2664
|
return new TransformDecodeBuilder(schema);
|
|
2442
2665
|
}
|
|
2666
|
+
|
|
2667
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/unsafe/unsafe.mjs
|
|
2443
2668
|
function Unsafe(options = {}) {
|
|
2444
2669
|
return CreateType({ [Kind]: options[Kind] ?? "Unsafe" }, options);
|
|
2445
2670
|
}
|
|
2671
|
+
|
|
2672
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/void/void.mjs
|
|
2446
2673
|
function Void(options) {
|
|
2447
2674
|
return CreateType({ [Kind]: "Void", type: "void" }, options);
|
|
2448
2675
|
}
|
|
2676
|
+
|
|
2677
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/type/type.mjs
|
|
2449
2678
|
var type_exports3 = {};
|
|
2450
2679
|
__export(type_exports3, {
|
|
2451
2680
|
Any: () => Any,
|
|
@@ -2511,10 +2740,16 @@ __export(type_exports3, {
|
|
|
2511
2740
|
Uppercase: () => Uppercase,
|
|
2512
2741
|
Void: () => Void
|
|
2513
2742
|
});
|
|
2743
|
+
|
|
2744
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/type/index.mjs
|
|
2514
2745
|
var Type = type_exports3;
|
|
2746
|
+
|
|
2747
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/system/evaluate.mjs
|
|
2515
2748
|
function Evaluate(...args) {
|
|
2516
2749
|
return new globalThis.Function(...args);
|
|
2517
2750
|
}
|
|
2751
|
+
|
|
2752
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/errors/function.mjs
|
|
2518
2753
|
function DefaultErrorFunction(error2) {
|
|
2519
2754
|
switch (error2.errorType) {
|
|
2520
2755
|
case ValueErrorType.ArrayContains:
|
|
@@ -2653,6 +2888,8 @@ var errorFunction = DefaultErrorFunction;
|
|
|
2653
2888
|
function GetErrorFunction() {
|
|
2654
2889
|
return errorFunction;
|
|
2655
2890
|
}
|
|
2891
|
+
|
|
2892
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/value/deref/deref.mjs
|
|
2656
2893
|
var TypeDereferenceError = class extends TypeBoxError {
|
|
2657
2894
|
constructor(schema) {
|
|
2658
2895
|
super(`Unable to dereference schema with $id '${schema.$ref}'`);
|
|
@@ -2674,6 +2911,8 @@ function Pushref(schema, references) {
|
|
|
2674
2911
|
function Deref(schema, references) {
|
|
2675
2912
|
return schema[Kind] === "This" || schema[Kind] === "Ref" ? Resolve(schema, references) : schema;
|
|
2676
2913
|
}
|
|
2914
|
+
|
|
2915
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/value/hash/hash.mjs
|
|
2677
2916
|
var ValueHashError = class extends TypeBoxError {
|
|
2678
2917
|
constructor(value) {
|
|
2679
2918
|
super(`Unable to hash value`);
|
|
@@ -2802,6 +3041,8 @@ function Hash(value) {
|
|
|
2802
3041
|
Visit4(value);
|
|
2803
3042
|
return Accumulator;
|
|
2804
3043
|
}
|
|
3044
|
+
|
|
3045
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/value/check/check.mjs
|
|
2805
3046
|
var ValueCheckUnknownTypeError = class extends TypeBoxError {
|
|
2806
3047
|
constructor(schema) {
|
|
2807
3048
|
super(`Unknown type`);
|
|
@@ -3232,6 +3473,8 @@ function Visit5(schema, references, value) {
|
|
|
3232
3473
|
function Check(...args) {
|
|
3233
3474
|
return args.length === 3 ? Visit5(args[0], args[1], args[2]) : Visit5(args[0], [], args[1]);
|
|
3234
3475
|
}
|
|
3476
|
+
|
|
3477
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/errors/errors.mjs
|
|
3235
3478
|
var ValueErrorType;
|
|
3236
3479
|
(function(ValueErrorType2) {
|
|
3237
3480
|
ValueErrorType2[ValueErrorType2["ArrayContains"] = 0] = "ArrayContains";
|
|
@@ -3788,6 +4031,8 @@ function Errors(...args) {
|
|
|
3788
4031
|
const iterator = args.length === 3 ? Visit6(args[0], args[1], "", args[2]) : Visit6(args[0], [], "", args[1]);
|
|
3789
4032
|
return new ValueErrorIterator(iterator);
|
|
3790
4033
|
}
|
|
4034
|
+
|
|
4035
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/value/transform/decode.mjs
|
|
3791
4036
|
var TransformDecodeCheckError = class extends TypeBoxError {
|
|
3792
4037
|
constructor(schema, value, error2) {
|
|
3793
4038
|
super(`Unable to decode value as it does not match the expected schema`);
|
|
@@ -3945,6 +4190,8 @@ function Visit7(schema, references, path, value) {
|
|
|
3945
4190
|
function TransformDecode(schema, references, value) {
|
|
3946
4191
|
return Visit7(schema, references, "", value);
|
|
3947
4192
|
}
|
|
4193
|
+
|
|
4194
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/value/transform/encode.mjs
|
|
3948
4195
|
var TransformEncodeCheckError = class extends TypeBoxError {
|
|
3949
4196
|
constructor(schema, value, error2) {
|
|
3950
4197
|
super(`The encoded value does not match the expected schema`);
|
|
@@ -4113,6 +4360,8 @@ function Visit8(schema, references, path, value) {
|
|
|
4113
4360
|
function TransformEncode(schema, references, value) {
|
|
4114
4361
|
return Visit8(schema, references, "", value);
|
|
4115
4362
|
}
|
|
4363
|
+
|
|
4364
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/value/transform/has.mjs
|
|
4116
4365
|
function FromArray11(schema, references) {
|
|
4117
4366
|
return IsTransform(schema) || Visit9(schema.items, references);
|
|
4118
4367
|
}
|
|
@@ -4213,6 +4462,8 @@ function HasTransform(schema, references) {
|
|
|
4213
4462
|
visited.clear();
|
|
4214
4463
|
return Visit9(schema, references);
|
|
4215
4464
|
}
|
|
4465
|
+
|
|
4466
|
+
// ../protocol/dist/types.js
|
|
4216
4467
|
var REF_PATTERN = /^e\d+_\d+$/;
|
|
4217
4468
|
var DELIVERED_EXTRACT_FORMATS = [
|
|
4218
4469
|
"text",
|
|
@@ -4241,6 +4492,8 @@ var DELIVERED_ACTION_TYPES = [
|
|
|
4241
4492
|
"acceptDialog",
|
|
4242
4493
|
"dismissDialog"
|
|
4243
4494
|
];
|
|
4495
|
+
|
|
4496
|
+
// ../protocol/dist/schemas.js
|
|
4244
4497
|
var ErrorCodeEnum = Type.Union([
|
|
4245
4498
|
Type.Literal("INVALID_REQUEST"),
|
|
4246
4499
|
Type.Literal("INVALID_TENANT_ID"),
|
|
@@ -4647,6 +4900,8 @@ var ActionResultSchema = Type.Object({
|
|
|
4647
4900
|
artifacts: Type.Optional(Type.Array(ArtifactRefSchema)),
|
|
4648
4901
|
error: Type.Optional(ApiErrorDetailSchema)
|
|
4649
4902
|
});
|
|
4903
|
+
|
|
4904
|
+
// ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/compiler/compiler.mjs
|
|
4650
4905
|
var TypeCheck = class {
|
|
4651
4906
|
constructor(schema, references, checkFunc, code) {
|
|
4652
4907
|
this.schema = schema;
|
|
@@ -5208,9 +5463,13 @@ var TypeCompiler;
|
|
|
5208
5463
|
}
|
|
5209
5464
|
TypeCompiler2.Compile = Compile;
|
|
5210
5465
|
})(TypeCompiler || (TypeCompiler = {}));
|
|
5466
|
+
|
|
5467
|
+
// ../protocol/dist/validators.js
|
|
5211
5468
|
var sessionRequest = TypeCompiler.Compile(SessionRequestSchema);
|
|
5212
5469
|
var action = TypeCompiler.Compile(ActionSchema);
|
|
5213
5470
|
var planStep = TypeCompiler.Compile(PlanStepSchema);
|
|
5471
|
+
|
|
5472
|
+
// ../protocol/dist/errors.js
|
|
5214
5473
|
var ErrorCode;
|
|
5215
5474
|
(function(ErrorCode2) {
|
|
5216
5475
|
ErrorCode2["INVALID_REQUEST"] = "INVALID_REQUEST";
|
|
@@ -5259,6 +5518,8 @@ ${staleHint}`;
|
|
|
5259
5518
|
}
|
|
5260
5519
|
return String(error2);
|
|
5261
5520
|
}
|
|
5521
|
+
|
|
5522
|
+
// ../sdk-typescript/dist/client.js
|
|
5262
5523
|
var AgentBrowserError = class extends Error {
|
|
5263
5524
|
code;
|
|
5264
5525
|
retryable;
|
|
@@ -5269,110 +5530,114 @@ var AgentBrowserError = class extends Error {
|
|
|
5269
5530
|
this.name = "AgentBrowserError";
|
|
5270
5531
|
}
|
|
5271
5532
|
};
|
|
5272
|
-
var
|
|
5533
|
+
var HttpClient = class {
|
|
5273
5534
|
baseUrl;
|
|
5274
|
-
|
|
5535
|
+
timeoutMs;
|
|
5275
5536
|
headers;
|
|
5276
|
-
|
|
5277
|
-
constructor(baseUrl, timeout, headers, requestFn) {
|
|
5537
|
+
constructor(baseUrl, timeoutMs, headers) {
|
|
5278
5538
|
this.baseUrl = baseUrl;
|
|
5279
|
-
this.
|
|
5539
|
+
this.timeoutMs = timeoutMs;
|
|
5280
5540
|
this.headers = headers;
|
|
5281
|
-
|
|
5541
|
+
}
|
|
5542
|
+
async requestJson(path, init = {}) {
|
|
5543
|
+
const controller = new AbortController();
|
|
5544
|
+
const timeoutId = setTimeout(() => controller.abort(), this.timeoutMs);
|
|
5545
|
+
let response;
|
|
5546
|
+
try {
|
|
5547
|
+
response = await fetch(`${this.baseUrl}${path}`, {
|
|
5548
|
+
method: init.method ?? "GET",
|
|
5549
|
+
headers: {
|
|
5550
|
+
...this.headers,
|
|
5551
|
+
...init.body !== void 0 ? { "Content-Type": "application/json" } : {}
|
|
5552
|
+
},
|
|
5553
|
+
...init.body !== void 0 ? { body: JSON.stringify(init.body) } : {},
|
|
5554
|
+
signal: controller.signal
|
|
5555
|
+
});
|
|
5556
|
+
} catch (error2) {
|
|
5557
|
+
if (error2 instanceof Error && error2.name === "AbortError") {
|
|
5558
|
+
throw new AgentBrowserError("TIMEOUT", "Request timeout", false);
|
|
5559
|
+
}
|
|
5560
|
+
throw error2;
|
|
5561
|
+
} finally {
|
|
5562
|
+
clearTimeout(timeoutId);
|
|
5563
|
+
}
|
|
5564
|
+
if (!response.ok) {
|
|
5565
|
+
let error2;
|
|
5566
|
+
try {
|
|
5567
|
+
const data = await response.json();
|
|
5568
|
+
error2 = data.error || {
|
|
5569
|
+
code: "UNKNOWN_ERROR",
|
|
5570
|
+
message: "Unknown error",
|
|
5571
|
+
retryable: false
|
|
5572
|
+
};
|
|
5573
|
+
} catch {
|
|
5574
|
+
error2 = {
|
|
5575
|
+
code: "UNKNOWN_ERROR",
|
|
5576
|
+
message: `HTTP ${response.status}: ${response.statusText}`,
|
|
5577
|
+
retryable: false
|
|
5578
|
+
};
|
|
5579
|
+
}
|
|
5580
|
+
throw new AgentBrowserError(error2.code, error2.message, error2.retryable);
|
|
5581
|
+
}
|
|
5582
|
+
return response.json();
|
|
5583
|
+
}
|
|
5584
|
+
};
|
|
5585
|
+
var SessionsClient = class {
|
|
5586
|
+
http;
|
|
5587
|
+
constructor(http) {
|
|
5588
|
+
this.http = http;
|
|
5282
5589
|
}
|
|
5283
5590
|
async create(request) {
|
|
5284
|
-
|
|
5285
|
-
method: "POST",
|
|
5286
|
-
headers: {
|
|
5287
|
-
"Content-Type": "application/json",
|
|
5288
|
-
...this.headers
|
|
5289
|
-
},
|
|
5290
|
-
body: JSON.stringify(request)
|
|
5291
|
-
});
|
|
5292
|
-
return this.handleResponse(response);
|
|
5591
|
+
return this.http.requestJson("/v1/sessions", { method: "POST", body: request });
|
|
5293
5592
|
}
|
|
5294
5593
|
async get(sessionId) {
|
|
5295
|
-
|
|
5296
|
-
method: "GET",
|
|
5297
|
-
headers: this.headers
|
|
5298
|
-
});
|
|
5299
|
-
return this.handleResponse(response);
|
|
5594
|
+
return this.http.requestJson(`/v1/sessions/${sessionId}`);
|
|
5300
5595
|
}
|
|
5301
5596
|
async list() {
|
|
5302
|
-
const
|
|
5303
|
-
method: "GET",
|
|
5304
|
-
headers: this.headers
|
|
5305
|
-
});
|
|
5306
|
-
const data = await this.handleResponse(response);
|
|
5597
|
+
const data = await this.http.requestJson("/v1/sessions");
|
|
5307
5598
|
return data.sessions;
|
|
5308
5599
|
}
|
|
5309
5600
|
async close(sessionId) {
|
|
5310
|
-
|
|
5311
|
-
method: "DELETE",
|
|
5312
|
-
headers: this.headers
|
|
5313
|
-
});
|
|
5314
|
-
await this.handleResponse(response);
|
|
5601
|
+
await this.http.requestJson(`/v1/sessions/${sessionId}`, { method: "DELETE" });
|
|
5315
5602
|
}
|
|
5316
5603
|
async createPage(sessionId) {
|
|
5317
|
-
|
|
5318
|
-
method: "POST",
|
|
5319
|
-
headers: this.headers
|
|
5320
|
-
});
|
|
5321
|
-
return this.handleResponse(response);
|
|
5604
|
+
return this.http.requestJson(`/v1/sessions/${sessionId}/pages`, { method: "POST" });
|
|
5322
5605
|
}
|
|
5323
5606
|
async getPage(sessionId, pageId) {
|
|
5324
|
-
|
|
5325
|
-
method: "GET",
|
|
5326
|
-
headers: this.headers
|
|
5327
|
-
});
|
|
5328
|
-
return this.handleResponse(response);
|
|
5607
|
+
return this.http.requestJson(`/v1/sessions/${sessionId}/pages/${pageId}`);
|
|
5329
5608
|
}
|
|
5330
5609
|
async closePage(sessionId, pageId) {
|
|
5331
|
-
|
|
5332
|
-
method: "DELETE"
|
|
5333
|
-
headers: this.headers
|
|
5610
|
+
await this.http.requestJson(`/v1/sessions/${sessionId}/pages/${pageId}`, {
|
|
5611
|
+
method: "DELETE"
|
|
5334
5612
|
});
|
|
5335
|
-
await this.handleResponse(response);
|
|
5336
5613
|
}
|
|
5337
5614
|
/** TD-BROWSER-6: scoped cookie export — the read half of the credential handoff loop. */
|
|
5338
5615
|
async cookies(sessionId) {
|
|
5339
|
-
const
|
|
5340
|
-
headers: this.headers
|
|
5341
|
-
});
|
|
5342
|
-
const body = await this.handleResponse(response);
|
|
5616
|
+
const body = await this.http.requestJson(`/v1/sessions/${sessionId}/cookies`);
|
|
5343
5617
|
return body.cookies;
|
|
5344
5618
|
}
|
|
5345
5619
|
/** A3 evidence: export the session's completed spans as a trace artifact. */
|
|
5346
5620
|
async trace(sessionId) {
|
|
5347
|
-
|
|
5348
|
-
method: "POST",
|
|
5349
|
-
headers: this.headers
|
|
5350
|
-
});
|
|
5351
|
-
return this.handleResponse(response);
|
|
5621
|
+
return this.http.requestJson(`/v1/sessions/${sessionId}/trace`, { method: "POST" });
|
|
5352
5622
|
}
|
|
5353
5623
|
/** A3 evidence: capture the page's current HTML as an artifact (NOT redacted). */
|
|
5354
5624
|
async html(sessionId, pageId) {
|
|
5355
|
-
|
|
5356
|
-
|
|
5625
|
+
return this.http.requestJson(`/v1/sessions/${sessionId}/pages/${pageId}/html`, {
|
|
5626
|
+
method: "POST"
|
|
5627
|
+
});
|
|
5357
5628
|
}
|
|
5358
5629
|
/** A3/network summary: replay retained session events, oldest first per ledger. */
|
|
5359
5630
|
async events(sessionId, type) {
|
|
5360
5631
|
const query = type !== void 0 ? `?type=${encodeURIComponent(type)}` : "";
|
|
5361
|
-
const
|
|
5362
|
-
const body = await this.handleResponse(response);
|
|
5632
|
+
const body = await this.http.requestJson(`/v1/sessions/${sessionId}/events/replay${query}`);
|
|
5363
5633
|
return body.events;
|
|
5364
5634
|
}
|
|
5365
5635
|
/** TD-BROWSER-8: execute a batched action plan; returns per-step results. */
|
|
5366
5636
|
async plan(sessionId, pageId, actions) {
|
|
5367
|
-
|
|
5637
|
+
return this.http.requestJson(`/v1/sessions/${sessionId}/pages/${pageId}/plan`, {
|
|
5368
5638
|
method: "POST",
|
|
5369
|
-
|
|
5370
|
-
"Content-Type": "application/json",
|
|
5371
|
-
...this.headers
|
|
5372
|
-
},
|
|
5373
|
-
body: JSON.stringify({ actions })
|
|
5639
|
+
body: { actions }
|
|
5374
5640
|
});
|
|
5375
|
-
return this.handleResponse(response);
|
|
5376
5641
|
}
|
|
5377
5642
|
/** TD-BROWSER-8: self-contained snapshot payload for one-shot LLM reasoning. */
|
|
5378
5643
|
async snapshot(sessionId, pageId, bounds) {
|
|
@@ -5382,95 +5647,43 @@ var SessionsClient = class {
|
|
|
5382
5647
|
if (bounds?.maxBytes !== void 0)
|
|
5383
5648
|
query.set("maxBytes", String(bounds.maxBytes));
|
|
5384
5649
|
const qs = query.toString();
|
|
5385
|
-
|
|
5386
|
-
return this.handleResponse(response);
|
|
5650
|
+
return this.http.requestJson(`/v1/sessions/${sessionId}/pages/${pageId}/snapshot${qs ? `?${qs}` : ""}`);
|
|
5387
5651
|
}
|
|
5388
5652
|
async navigate(sessionId, pageId, request) {
|
|
5389
|
-
|
|
5653
|
+
return this.http.requestJson(`/v1/sessions/${sessionId}/pages/${pageId}/navigate`, {
|
|
5390
5654
|
method: "POST",
|
|
5391
|
-
|
|
5392
|
-
"Content-Type": "application/json",
|
|
5393
|
-
...this.headers
|
|
5394
|
-
},
|
|
5395
|
-
body: JSON.stringify(request)
|
|
5655
|
+
body: request
|
|
5396
5656
|
});
|
|
5397
|
-
return this.handleResponse(response);
|
|
5398
5657
|
}
|
|
5399
5658
|
async observe(sessionId, pageId, request = {}) {
|
|
5400
|
-
|
|
5659
|
+
return this.http.requestJson(`/v1/sessions/${sessionId}/pages/${pageId}/observe`, {
|
|
5401
5660
|
method: "POST",
|
|
5402
|
-
|
|
5403
|
-
"Content-Type": "application/json",
|
|
5404
|
-
...this.headers
|
|
5405
|
-
},
|
|
5406
|
-
body: JSON.stringify(request)
|
|
5661
|
+
body: request
|
|
5407
5662
|
});
|
|
5408
|
-
return this.handleResponse(response);
|
|
5409
5663
|
}
|
|
5410
5664
|
async executeAction(sessionId, pageId, request) {
|
|
5411
|
-
|
|
5665
|
+
return this.http.requestJson(`/v1/sessions/${sessionId}/pages/${pageId}/act`, {
|
|
5412
5666
|
method: "POST",
|
|
5413
|
-
|
|
5414
|
-
"Content-Type": "application/json",
|
|
5415
|
-
...this.headers
|
|
5416
|
-
},
|
|
5417
|
-
body: JSON.stringify(request)
|
|
5667
|
+
body: request
|
|
5418
5668
|
});
|
|
5419
|
-
return this.handleResponse(response);
|
|
5420
5669
|
}
|
|
5421
5670
|
async screenshot(sessionId, pageId, request = {}) {
|
|
5422
|
-
|
|
5671
|
+
return this.http.requestJson(`/v1/sessions/${sessionId}/pages/${pageId}/screenshot`, {
|
|
5423
5672
|
method: "POST",
|
|
5424
|
-
|
|
5425
|
-
"Content-Type": "application/json",
|
|
5426
|
-
...this.headers
|
|
5427
|
-
},
|
|
5428
|
-
body: JSON.stringify(request)
|
|
5673
|
+
body: request
|
|
5429
5674
|
});
|
|
5430
|
-
return this.handleResponse(response);
|
|
5431
5675
|
}
|
|
5432
5676
|
async extract(sessionId, pageId, request) {
|
|
5433
|
-
|
|
5677
|
+
return this.http.requestJson(`/v1/sessions/${sessionId}/pages/${pageId}/extract`, {
|
|
5434
5678
|
method: "POST",
|
|
5435
|
-
|
|
5436
|
-
"Content-Type": "application/json",
|
|
5437
|
-
...this.headers
|
|
5438
|
-
},
|
|
5439
|
-
body: JSON.stringify(request)
|
|
5679
|
+
body: request
|
|
5440
5680
|
});
|
|
5441
|
-
return this.handleResponse(response);
|
|
5442
5681
|
}
|
|
5443
5682
|
async pdf(sessionId, pageId, request = {}) {
|
|
5444
|
-
|
|
5683
|
+
return this.http.requestJson(`/v1/sessions/${sessionId}/pages/${pageId}/pdf`, {
|
|
5445
5684
|
method: "POST",
|
|
5446
|
-
|
|
5447
|
-
"Content-Type": "application/json",
|
|
5448
|
-
...this.headers
|
|
5449
|
-
},
|
|
5450
|
-
body: JSON.stringify(request)
|
|
5685
|
+
body: request
|
|
5451
5686
|
});
|
|
5452
|
-
return this.handleResponse(response);
|
|
5453
|
-
}
|
|
5454
|
-
async handleResponse(response) {
|
|
5455
|
-
if (!response.ok) {
|
|
5456
|
-
let error2;
|
|
5457
|
-
try {
|
|
5458
|
-
const data = await response.json();
|
|
5459
|
-
error2 = data.error || {
|
|
5460
|
-
code: "UNKNOWN_ERROR",
|
|
5461
|
-
message: "Unknown error",
|
|
5462
|
-
retryable: false
|
|
5463
|
-
};
|
|
5464
|
-
} catch {
|
|
5465
|
-
error2 = {
|
|
5466
|
-
code: "UNKNOWN_ERROR",
|
|
5467
|
-
message: `HTTP ${response.status}: ${response.statusText}`,
|
|
5468
|
-
retryable: false
|
|
5469
|
-
};
|
|
5470
|
-
}
|
|
5471
|
-
throw new AgentBrowserError(error2.code, error2.message, error2.retryable);
|
|
5472
|
-
}
|
|
5473
|
-
return response.json();
|
|
5474
5687
|
}
|
|
5475
5688
|
};
|
|
5476
5689
|
var AgentBrowserClient = class {
|
|
@@ -5485,7 +5698,7 @@ var AgentBrowserClient = class {
|
|
|
5485
5698
|
...options.apiKey !== void 0 ? { Authorization: `Bearer ${options.apiKey}` } : {},
|
|
5486
5699
|
...options.headers
|
|
5487
5700
|
};
|
|
5488
|
-
this.sessions = new SessionsClient(this.baseUrl, this.timeout, this.customHeaders
|
|
5701
|
+
this.sessions = new SessionsClient(new HttpClient(this.baseUrl, this.timeout, this.customHeaders));
|
|
5489
5702
|
}
|
|
5490
5703
|
/**
|
|
5491
5704
|
* Set default headers for all requests
|
|
@@ -5493,42 +5706,21 @@ var AgentBrowserClient = class {
|
|
|
5493
5706
|
setHeaders(headers) {
|
|
5494
5707
|
Object.assign(this.customHeaders, headers);
|
|
5495
5708
|
}
|
|
5496
|
-
/**
|
|
5497
|
-
* Make an HTTP request with timeout
|
|
5498
|
-
*/
|
|
5499
|
-
async request(url, options = {}) {
|
|
5500
|
-
const controller = new AbortController();
|
|
5501
|
-
const timeoutId = setTimeout(() => controller.abort(), this.timeout);
|
|
5502
|
-
try {
|
|
5503
|
-
const response = await fetch(url, {
|
|
5504
|
-
...options,
|
|
5505
|
-
signal: controller.signal
|
|
5506
|
-
});
|
|
5507
|
-
clearTimeout(timeoutId);
|
|
5508
|
-
return response;
|
|
5509
|
-
} catch (error2) {
|
|
5510
|
-
clearTimeout(timeoutId);
|
|
5511
|
-
if (error2 instanceof Error && error2.name === "AbortError") {
|
|
5512
|
-
throw new AgentBrowserError("TIMEOUT", "Request timeout", false);
|
|
5513
|
-
}
|
|
5514
|
-
throw error2;
|
|
5515
|
-
}
|
|
5516
|
-
}
|
|
5517
5709
|
};
|
|
5710
|
+
|
|
5711
|
+
// dist/mcp-server.js
|
|
5518
5712
|
var PROTOCOL_VERSION = "2024-11-05";
|
|
5519
|
-
function
|
|
5520
|
-
|
|
5521
|
-
|
|
5522
|
-
|
|
5523
|
-
|
|
5524
|
-
|
|
5525
|
-
|
|
5526
|
-
|
|
5527
|
-
|
|
5528
|
-
|
|
5529
|
-
|
|
5530
|
-
};
|
|
5531
|
-
const tools = [
|
|
5713
|
+
function sessionAndPage(args) {
|
|
5714
|
+
if (typeof args.sessionId !== "string" || args.sessionId.length === 0) {
|
|
5715
|
+
throw new UsageError("sessionId is required and must be a non-empty string.");
|
|
5716
|
+
}
|
|
5717
|
+
if (typeof args.pageId !== "string" || args.pageId.length === 0) {
|
|
5718
|
+
throw new UsageError("pageId is required and must be a non-empty string.");
|
|
5719
|
+
}
|
|
5720
|
+
return [args.sessionId, args.pageId];
|
|
5721
|
+
}
|
|
5722
|
+
function buildTools(client) {
|
|
5723
|
+
return [
|
|
5532
5724
|
{
|
|
5533
5725
|
name: "browser_create",
|
|
5534
5726
|
description: "Create a new isolated browser session. Sessions are ephemeral; element refs are scoped to a single session and page. Returns the sessionId.",
|
|
@@ -5875,6 +6067,11 @@ function buildMcpServer(deps) {
|
|
|
5875
6067
|
}
|
|
5876
6068
|
}
|
|
5877
6069
|
];
|
|
6070
|
+
}
|
|
6071
|
+
function buildMcpServer(deps) {
|
|
6072
|
+
const client = deps.createClient({ baseUrl: deps.baseUrl ?? "http://localhost:3000" });
|
|
6073
|
+
const serverInfo = deps.serverInfo ?? { name: "agentbrowser", version: "1.0.0" };
|
|
6074
|
+
const tools = buildTools(client);
|
|
5878
6075
|
const toolByName = new Map(tools.map((tool) => [tool.name, tool]));
|
|
5879
6076
|
return {
|
|
5880
6077
|
async handle(line) {
|
|
@@ -5955,6 +6152,11 @@ function ok(id, result) {
|
|
|
5955
6152
|
function error(id, code, message) {
|
|
5956
6153
|
return JSON.stringify({ jsonrpc: "2.0", id, error: { code, message } });
|
|
5957
6154
|
}
|
|
6155
|
+
|
|
6156
|
+
// dist/version.js
|
|
6157
|
+
import { readFileSync } from "node:fs";
|
|
6158
|
+
import { dirname, join } from "node:path";
|
|
6159
|
+
import { fileURLToPath } from "node:url";
|
|
5958
6160
|
function readPackageVersion(moduleUrl) {
|
|
5959
6161
|
try {
|
|
5960
6162
|
const here = dirname(fileURLToPath(moduleUrl));
|
|
@@ -5975,6 +6177,8 @@ function resolveVersion(env = process.env) {
|
|
|
5975
6177
|
}
|
|
5976
6178
|
return "unknown";
|
|
5977
6179
|
}
|
|
6180
|
+
|
|
6181
|
+
// dist/bin.js
|
|
5978
6182
|
var server = buildMcpServer({
|
|
5979
6183
|
createClient: (options) => new AgentBrowserClient({
|
|
5980
6184
|
...options,
|